NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
IceRawTWR Class Reference

Job for conversion of TWR raw data into IceEvent data structures. More...

#include "IceRawTWR.h"

Inheritance diagram for IceRawTWR:
NcJob

Detailed Description

Job for conversion of TWR raw data into IceEvent data structures.

Copyright(c) 2003, IceCube Experiment at the South Pole. All rights reserved.
Author: The IceCube NCFS-based Offline Project.
Contributors are mentioned in the code where appropriate.
Permission to use, copy, modify and distribute this software and its
documentation strictly for non-commercial purposes is hereby granted
without fee, provided that the above copyright notice appears in all
copies and that both the copyright notice and this permission notice
appear in the supporting documentation.
The authors make no claims about the suitability of this software for
any purpose. It is provided "as is" without express or implied warranty.
// Class IceRawTWR
// Conversion of Amanda raw TWR data into IceEvent data structures.
// The code to actually read the TWR raw data structures is an Ralice/IcePack
// implementation of Wolfgang Wagner's (Dortmund University, Germany)
// original read_twr_binary_file.cxx and wf2hit_new.cxx source code.
// The trigger information as encountered in the raw data, is available
// in the IceEvent structure via a device named "Trigger".
// The various triggers (and times) have been stored as different "hits"
// in this "Trigger" device, just like it was done in the IceF2k processor
// for the mu-daq F2K data.
// An indication of the active DAQ system is available in the IceEvent structure
// via a device named "Daq". Here the various daq systems (TWR, Muon, ...)
// from which the actual hits (ADC, LE, TOT) eventually will be composed
// are indicated as "signals" of the device itself.
// This class is derived from NcJob providing a task-based processing
// structure on an event-by-event basis.
// The main object in the job environment is an IceEvent* pointer.
// In case the user has provided sub-tasks, these will be executed
// on an event-by-event basis after the IceEvent structure has been filled
// with the raw TWR data and before the final structures are written out.
// Note that the data structures are only written out if an outputfile has
// been specified via the SetOutputFile memberfunction.
// In case an NcEventSelector (based) task has been invoked, the data structures
// are only written out for events that fulfilled the selection criteria.
// In case no outputfile has been specified, this class provides a facility
// to investigate/analyse raw TWR data using the Ralice/IcePack analysis tools.
//
// Usage example :
// ---------------
//
// gSystem->Load("ncfspack");
// gSystem->Load("icepack");
// gSystem->Load("iceconvert");
//
// IceRawTWR q("IceRawTWR","TWR raw data to IcePack data structure conversion");
//
// // Limit the number of entries for testing
// q.SetMaxEvents(10);
//
// // Print frequency to produce a short summary print every printfreq events
// q.SetPrintFreq(1);
//
// // The TWR raw data input filename(s)
// q.AddInputFile("twr_2005_101_009225_0983_57784_57850.dat.twr.to_tape_1");
//
// // Output file for the event structures
// q.SetOutputFile("events.root");
//
// ///////////////////////////////////////////////////////////////////
// // Here the user can specify his/her sub-tasks to be executed
// // on an event-by-event basis after the IceEvent structure
// // has been filled and before the data is written out.
// // Sub-tasks (i.e. a user classes derived from TTask) are entered
// // as follows :
// //
// // MyXtalk task1("task1","Cross talk correction");
// // MyClean task2("task2","Hit cleaning");
// // q.Add(&task1);
// // q.Add(&task2);
// //
// // The sub-tasks will be executed in the order as they are entered.
// ///////////////////////////////////////////////////////////////////
//
// // Perform the conversion and execute subtasks (if any)
// // on an event-by-event basis
// q.ExecuteJob();
//
//--- Author: Nick van Eijndhoven 12-dec-2006 Utrecht University
//- Modified: NvE $Date: 2010-03-19 11:10:02 +0100 (Fri, 19 Mar 2010) $ NCFS

Definition at line 24 of file IceRawTWR.h.

Public Member Functions

 IceRawTWR (const char *name="IceRawTWR", const char *title="")
 
virtual ~IceRawTWR ()
 
void AddInputFile (TString name)
 
virtual void Exec (Option_t *opt)
 
TFile * GetOutputFile ()
 
void SetBufferSize (Int_t bsize)
 
void SetMaxEvents (Int_t n)
 
void SetOutputFile (TFile *ofile)
 
void SetOutputFile (TString name)
 
void SetPrintFreq (Int_t f)
 
void SetSplitLevel (Int_t split)
 
- Public Member Functions inherited from NcJob
 NcJob (const char *name="NcJob", const char *title="")
 
virtual ~NcJob ()
 
void AddObject (TObject *obj)
 
void AddObjects (TObjArray *arr)
 
void ExecuteJob (Int_t mode=0)
 
TFolder * GetFolder () const
 
TObject * GetMainObject () const
 
TObject * GetObject (const char *classname) const
 
TObject * GetObject (Int_t j) const
 
TObjArray * GetObjects () const
 
TObjArray * GetObjects (const char *classname)
 
void ListEnvironment ()
 
void MakeFolder ()
 
void ProcessObject (TObject *obj)
 
void RemoveObject (TObject *obj)
 
void RemoveObjects (const char *classname)
 

Protected Member Functions

Int_t clear_event (event_t *event_ptr)
 
Int_t clear_system (sys_config_t *sys)
 
Int_t clear_waveform_analysis (waveform_analyse_t *wfm_om)
 
Int_t extract_info_from_filename (char *fname, twr_raw_data_file_t *twr_file)
 
void PutTrigger (Int_t year)
 
void PutWaveforms (Int_t year)
 
Int_t read_event (FILE *fin, sys_config_t *sys, event_t *event_ptr)
 
Int_t read_header_from_file (FILE *fin, sys_config_t **system_ptr, UInt_t *header_length)
 
Int_t restore_waveform (waveform_t f_wfm, waveform_analyse_t *wfm_om, Int_t year)
 
Int_t retrigger (event_t *ev, trigger_hits_t *trig)
 
Int_t update_system (sys_config_t *sys, Int_t run_number)
 
- Protected Member Functions inherited from NcJob
void SetMainObject (TObject *obj)
 

Protected Attributes

Int_t fBsize
 
event_t fEvent
 ! Structure holding the actual raw event data
 
TArrayI fExtstop
 
sys_config_t * fHeader
 ! Structure holding the raw configuration header info
 
TObjArray * fInfiles
 
FILE * fInput
 ! Pointer to the TWR raw data input file
 
Int_t fMaxevt
 
TFile * fOutfile
 
Int_t fPrintfreq
 
TArrayI fReadout
 
Int_t fSplit
 
TArrayI fThreshold
 
trigger_hits_t fTrigger
 ! Structure holding the event trigger info
 
waveform_analyse_t fWform
 ! Waveform info for a certain OM from (merged) fragment(s)
 
- Protected Attributes inherited from NcJob
TFolder * fFolder
 
TObject * fMainObject
 
Int_t fMakefolder
 
TObjArray * fObjects
 
TObjArray * fSelect
 ! Temp. array of pointers to user-selected stored objects
 

Constructor & Destructor Documentation

◆ IceRawTWR()

IceRawTWR::IceRawTWR ( const char * name = "IceRawTWR",
const char * title = "" )
// Default constructor.
// By default maxevent=-1, split=0, bsize=32000, printfreq=1.

Definition at line 99 of file IceRawTWR.cxx.

◆ ~IceRawTWR()

IceRawTWR::~IceRawTWR ( )
virtual
// Default destructor.

Definition at line 116 of file IceRawTWR.cxx.

Member Function Documentation

◆ AddInputFile()

void IceRawTWR::AddInputFile ( TString name)
// Add the name of this TWR raw data input file to the list to be processed.

Definition at line 180 of file IceRawTWR.cxx.

◆ clear_event()

Int_t IceRawTWR::clear_event ( event_t * event_ptr)
protected

Definition at line 796 of file IceRawTWR.cxx.

◆ clear_system()

Int_t IceRawTWR::clear_system ( sys_config_t * sys)
protected
// Deletion of the file header structure.

Definition at line 772 of file IceRawTWR.cxx.

◆ clear_waveform_analysis()

Int_t IceRawTWR::clear_waveform_analysis ( waveform_analyse_t * wfm_om)
protected

Definition at line 1169 of file IceRawTWR.cxx.

◆ Exec()

void IceRawTWR::Exec ( Option_t * opt)
virtual
// Job to loop over the specified number of events and convert the
// TWR raw data into the IceEvent structure.
// If maxevents<0 (default) all the entries of the input file
// will be processed.
// Every "printfreq" events a short event summary will be printed.
// The default value is printfreq=1.
// The output will be written on a standard output tree named "T".
//
// Notes :
// -------
// 1) This class is derived from NcJob, allowing a task based processing.
// After the conversion of a raw data event into an IceEvent structure,
// the processing of all available sub-tasks (if any) is invoked.
// This provides an event-by-event (sub)task processing before the
// final data structures are written out.
// 2) The main object in this job environment is an IceEvent* pointer.

Definition at line 234 of file IceRawTWR.cxx.

◆ extract_info_from_filename()

Int_t IceRawTWR::extract_info_from_filename ( char * fname,
twr_raw_data_file_t * twr_file )
protected

Definition at line 686 of file IceRawTWR.cxx.

◆ GetOutputFile()

TFile * IceRawTWR::GetOutputFile ( )
// Provide pointer to the ROOT output file.

Definition at line 223 of file IceRawTWR.cxx.

◆ PutTrigger()

void IceRawTWR::PutTrigger ( Int_t year)
protected
// Get the trigger info from the raw data event into the IcePack structure.
// Currently only the trigger settings for the years 2005 and 2006 have been
// implemented.
// In addition to the hardware and software triggers as encountered in the
// raw data, an artificial "main" trigger has been introduced.
// This artificial "main" trigger is just an "or" of the standard hard and soft
// triggers (except calibration and random triggers) and serves only to
// provide a generic "main" trigger a la Amanda mu-daq so that the default
// "IceCleanHits" hit cleaning procedure will work correctly.
// The trigger time for the artificial "main" trigger is taken to be the
// time of the earliest hardware trigger pulse. In case there is no hardware
// trigger pulse available, the "main" trigger time is set to 0.
// For other years, only the artificial "main" trigger with a trigger time
// set to 0 will be stored in the IceEvent structure.

Definition at line 600 of file IceRawTWR.cxx.

◆ PutWaveforms()

void IceRawTWR::PutWaveforms ( Int_t year)
protected
// Get the waveform info from the raw data event into the IcePack structure.

Definition at line 489 of file IceRawTWR.cxx.

◆ read_event()

Int_t IceRawTWR::read_event ( FILE * fin,
sys_config_t * sys,
event_t * event_ptr )
protected

Definition at line 1028 of file IceRawTWR.cxx.

◆ read_header_from_file()

Int_t IceRawTWR::read_header_from_file ( FILE * fin,
sys_config_t ** system_ptr,
UInt_t * header_length )
protected

Definition at line 808 of file IceRawTWR.cxx.

◆ restore_waveform()

Int_t IceRawTWR::restore_waveform ( waveform_t f_wfm,
waveform_analyse_t * wfm_om,
Int_t year )
protected

Definition at line 1233 of file IceRawTWR.cxx.

◆ retrigger()

Int_t IceRawTWR::retrigger ( event_t * ev,
trigger_hits_t * trig )
protected
// Obtain the active trigger(s)

Definition at line 1117 of file IceRawTWR.cxx.

◆ SetBufferSize()

void IceRawTWR::SetBufferSize ( Int_t bsize)
// Set the buffer size for the ROOT data file.
// bsize=32000 is the default initialisation in the constructor.

Definition at line 168 of file IceRawTWR.cxx.

◆ SetMaxEvents()

void IceRawTWR::SetMaxEvents ( Int_t n)
// Set the maximum number of events to be processed.
// n=-1 implies processing of the complete input file, which is the default
// initialisation in the constructor.

Definition at line 131 of file IceRawTWR.cxx.

◆ SetOutputFile() [1/2]

void IceRawTWR::SetOutputFile ( TFile * ofile)
// Set the output file for the ROOT data.

Definition at line 199 of file IceRawTWR.cxx.

◆ SetOutputFile() [2/2]

void IceRawTWR::SetOutputFile ( TString name)
// Create the output file for the ROOT data.

Definition at line 211 of file IceRawTWR.cxx.

◆ SetPrintFreq()

void IceRawTWR::SetPrintFreq ( Int_t f)
// Set the printfrequency to produce info every f events.
// f=1 is the default initialisation in the constructor.

Definition at line 144 of file IceRawTWR.cxx.

◆ SetSplitLevel()

void IceRawTWR::SetSplitLevel ( Int_t split)
// Set the split level for the ROOT data file.
// split=0 is the default initialisation in the constructor.

Definition at line 156 of file IceRawTWR.cxx.

◆ update_system()

Int_t IceRawTWR::update_system ( sys_config_t * sys,
Int_t run_number )
protected

Definition at line 910 of file IceRawTWR.cxx.

Member Data Documentation

◆ fBsize

Int_t IceRawTWR::fBsize
protected

Definition at line 41 of file IceRawTWR.h.

◆ fEvent

event_t IceRawTWR::fEvent
protected

! Structure holding the actual raw event data

Definition at line 54 of file IceRawTWR.h.

◆ fExtstop

TArrayI IceRawTWR::fExtstop
protected

Definition at line 48 of file IceRawTWR.h.

◆ fHeader

sys_config_t* IceRawTWR::fHeader
protected

! Structure holding the raw configuration header info

Definition at line 53 of file IceRawTWR.h.

◆ fInfiles

TObjArray* IceRawTWR::fInfiles
protected

Definition at line 44 of file IceRawTWR.h.

◆ fInput

FILE* IceRawTWR::fInput
protected

! Pointer to the TWR raw data input file

Definition at line 52 of file IceRawTWR.h.

◆ fMaxevt

Int_t IceRawTWR::fMaxevt
protected

Definition at line 42 of file IceRawTWR.h.

◆ fOutfile

TFile* IceRawTWR::fOutfile
protected

Definition at line 45 of file IceRawTWR.h.

◆ fPrintfreq

Int_t IceRawTWR::fPrintfreq
protected

Definition at line 43 of file IceRawTWR.h.

◆ fReadout

TArrayI IceRawTWR::fReadout
protected

Definition at line 46 of file IceRawTWR.h.

◆ fSplit

Int_t IceRawTWR::fSplit
protected

Definition at line 40 of file IceRawTWR.h.

◆ fThreshold

TArrayI IceRawTWR::fThreshold
protected

Definition at line 47 of file IceRawTWR.h.

◆ fTrigger

trigger_hits_t IceRawTWR::fTrigger
protected

! Structure holding the event trigger info

Definition at line 55 of file IceRawTWR.h.

◆ fWform

waveform_analyse_t IceRawTWR::fWform
protected

! Waveform info for a certain OM from (merged) fragment(s)

Definition at line 56 of file IceRawTWR.h.


The documentation for this class was generated from the following files: