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

Job for conversion of F2K data into IceEvent physics event structures. More...

#include "IceF2k.h"

Inheritance diagram for IceF2k:
NcJob

Detailed Description

Job for conversion of F2K data into IceEvent physics event 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 IceF2k
// Conversion of Amanda F2K data into IceEvent physics event structures.
// 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 F2K 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 F2K data using the Ralice/IcePack analysis tools.
// 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) are composed have been indicated
// as "signals" of the device itself.
//
// Note : Sometimes the filtering/reco process which produced the F2K file
// may have introduced a shift (i.e. offset) in the hit times w.r.t.
// the actual trigger time. The aim of this is to obtain the hit times
// centered more or less around zero.
// In case of real data, this is recorded in the F2K data itself and
// as such will be taken automatically into account by this IceF2k
// processor such that all times will be provided again unshifted.
// In other words, all times will be w.r.t. the actual trigger time
// as recorded in the trigger data device named "Trigger" in the IceEvent
// structure.
// In case of simulated data this shift is not available in the F2K data.
// The offset denoted in the F2K record is related to the time of the
// primary interaction to put it well ahead of the detector trigger.
// This primary interaction time, however, is irrelevant for the
// reconstruction of the recorded hit patterns.
// If a user had introduced a shift in producing the MC data,
// very frequently (but not always) a value of -19000 is used.
// For the IceF2k processing, the user can manually introduce a
// time offset in case of MC data via the memberfunction SetMcToffset().
// This user defined offset value will then be used to correct all
// the hit times such that they will be provided again unshifted
// w.r.t. the actual trigger time as recorded in the device named
// "Trigger" in the IceEvent structure.
// By default the MC time offset is set to 0 in the constructor
// of this class.
//
// Usage example :
// ---------------
//
// Note : This example creates automatically the ROOT output file, which
// is the most user friendly way of running the conversion job.
// In the subdirectory /macros the example macro icef2k.cc provides
// an example of how to create a ROOT output file yourself and passing
// this file via a pointer to IceF2k.
//
// gSystem->Load("ncfspack");
// gSystem->Load("icepack");
// gSystem->Load("iceconvert");
//
// IceF2k q("IceF2k","F2K 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);
//
// // Split level for the output structures
// q.SetSplitLevel(0);
//
// // Buffer size for the output structures
// q.SetBufferSize(32000);
//
// // The F2K input filename(s)
// q.AddInputFile("run7825.f2k");
//
// // 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();
//
// // Select various objects to be added to the output file
//
// TFile* ofile=q.GetOutputFile();
//
// if (ofile)
// {
// ofile->cd(); // Switch to the output file directory
//
// NcObjMatrix* omdb=q.GetOMdbase();
// if (omdb) omdb->Write();
//
// NcDevice* fitdefs=q.GetFitdefs();
// if (fitdefs) fitdefs->Write();
//
// TDatabasePDG* pdg=q.GetPDG();
// if (pdg) pdg->Write();
//
// // Flush additional objects to the output file.
// // The output file is not explicitly closed here
// // to allow interactive investigation of the data tree
// // when this macro is run in an interactive ROOT/CINT session.
// ofile->Write();
// }
//
//--- Author: Nick van Eijndhoven 11-mar-2005 Utrecht University
//- Modified: NvE $Date: 2016-05-27 11:04:55 +0200 (Fri, 27 May 2016) $ NCFS

Definition at line 24 of file IceF2k.h.

Public Member Functions

 IceF2k (const char *name="IceF2k", const char *title="")
 
virtual ~IceF2k ()
 
void AddInputFile (TString name)
 
virtual void Exec (Option_t *opt)
 
NcDeviceGetFitdefs ()
 
NcObjMatrixGetOMdbase ()
 
TFile * GetOutputFile ()
 
TDatabasePDG * GetPDG ()
 
NcDeviceGetTrigdefs ()
 
void SelectMcTracks (Int_t mode)
 
void SetBufferSize (Int_t bsize)
 
void SetCompressedTWR (Int_t mode)
 
void SetInputFile (TString name)
 
void SetMaxEvents (Int_t n)
 
void SetMcToffset (Float_t toffset)
 
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

void FillOMdbase ()
 
void PutHits ()
 
void PutMcTracks ()
 
void PutRecoTracks ()
 
void PutTrigger ()
 
void SetFitdefs ()
 
void SetTrigdefs ()
 
- Protected Member Functions inherited from NcJob
void SetMainObject (TObject *obj)
 

Protected Attributes

Int_t fBsize
 
Int_t fCompTWR
 
mevt fEvent
 ! Structure holding the actual event data (hits, tracks, etc...)
 
NcDevicefFitdefs
 
Array fHeader
 ! Structure holding the file header info
 
TObjArray * fInfiles
 
mcfile * fInput
 ! Structure holding the input file characteristics
 
Int_t fMaxevt
 
Float_t fMctoffset
 
Int_t fMctracks
 
NcObjMatrixfOmdb
 
TFile * fOutfile
 
TDatabasePDG * fPdg
 
Int_t fPrintfreq
 
Int_t fSplit
 
Float_t fToffset
 
NcDevicefTrigdefs
 
- 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

◆ IceF2k()

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

Definition at line 153 of file IceF2k.cxx.

◆ ~IceF2k()

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

Definition at line 179 of file IceF2k.cxx.

Member Function Documentation

◆ AddInputFile()

void IceF2k::AddInputFile ( TString name)
// Add the name of this F2K input file to the list to be processed.

Definition at line 340 of file IceF2k.cxx.

◆ Exec()

void IceF2k::Exec ( Option_t * opt)
virtual
// Job to loop over the specified number of events and convert the
// F2K 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 an F2K 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 438 of file IceF2k.cxx.

◆ FillOMdbase()

void IceF2k::FillOMdbase ( )
protected
// Fill the database with geometry, calib. etc... parameters
// for all the devices.

Definition at line 650 of file IceF2k.cxx.

◆ GetFitdefs()

NcDevice * IceF2k::GetFitdefs ( )
// Provide pointer to the fit definitions

Definition at line 416 of file IceF2k.cxx.

◆ GetOMdbase()

NcObjMatrix * IceF2k::GetOMdbase ( )
// Provide pointer to the OM geometry, calib. etc... database

Definition at line 405 of file IceF2k.cxx.

◆ GetOutputFile()

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

Definition at line 383 of file IceF2k.cxx.

◆ GetPDG()

TDatabasePDG * IceF2k::GetPDG ( )
// Provide pointer to the PDG database

Definition at line 394 of file IceF2k.cxx.

◆ GetTrigdefs()

NcDevice * IceF2k::GetTrigdefs ( )
// Provide pointer to the trigger definitions

Definition at line 427 of file IceF2k.cxx.

◆ PutHits()

void IceF2k::PutHits ( )
protected
// Get the hit and waveform info from the F2000 file into the IcePack structure.
// This memberfunction is based on the original code by Adam Bouchta.

Definition at line 1187 of file IceF2k.cxx.

◆ PutMcTracks()

void IceF2k::PutMcTracks ( )
protected
// Get the MC tracks from the F2000 file into the IcePack structure.
// Note : MC tracks are given negative track id's in the event structure.
// This memberfunction is based on the original code by Adam Bouchta.

Definition at line 952 of file IceF2k.cxx.

◆ PutRecoTracks()

void IceF2k::PutRecoTracks ( )
protected
// Get the reconstructed tracks from the F2000 file into the IcePack structure.
// Note : Reco tracks are given positive track id's in the event structure.
// This memberfunction is based on the original code by Adam Bouchta.

Definition at line 1077 of file IceF2k.cxx.

◆ PutTrigger()

void IceF2k::PutTrigger ( )
protected
// Get the trigger info from the F2000 file into the IcePack structure.

Definition at line 1392 of file IceF2k.cxx.

◆ SelectMcTracks()

void IceF2k::SelectMcTracks ( Int_t mode)
// User selection of MC tracks to be stored in the event structure.
//
// mode = 0 : No MC tracks are stored
// 1 : Only muon and muon-neutrino MC tracks are stored
// 2 : All lepton MC tracks are stored
// 3 : All MC tracks (incl. brems, pairprod etc...) are stored
//
// By default mode=3 is set in the constructor of this class.

Definition at line 280 of file IceF2k.cxx.

◆ SetBufferSize()

void IceF2k::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 255 of file IceF2k.cxx.

◆ SetCompressedTWR()

void IceF2k::SetCompressedTWR ( Int_t mode)
// Set flag to denote compression level of TWR input data.
//
// mode = 0 : Uncompressed TWR input data
// 1 : Compressed TWR input data
//
// By default mode=0 is set in the constructor of this class.

Definition at line 299 of file IceF2k.cxx.

◆ SetFitdefs()

void IceF2k::SetFitdefs ( )
protected
// Obtain the names of the variables for each fit procedure from the
// f2000 header. Each different fit procedure is then stored as a separate
// "hit" of an NcDevice object and the various fit variables are stored
// as separate signal slots of the corresponding "hit".
// Via the GetFitdefs() memberfunction this NcDevice object can be
// retrieved and stored in the ROOT output file if wanted.
// The name of the object is FitDefinitions and the stored data can be
// inspected via the NcDevice::Data() memberfunction and looks as follows :
//
// *NcDevice::Data* Id :0 Name : FitDefinitions
// Position Vector in car coordinates : 0 0 0
// Err. in car coordinates : 0 0 0
// The following 8 hits are registered :
// *NcSignal::Data* Id :0
// Position Vector in car coordinates : 0 0 0
// Err. in car coordinates : 0 0 0
// Owned by device : NcDevice Name : FitDefinitions
// Slot : 1 Signal value : 0 name : id
// Slot : 2 Signal value : 0 name : rchi2
// Slot : 3 Signal value : 0 name : prob
// Slot : 4 Signal value : 0 name : sigth
// Slot : 5 Signal value : 0 name : covmin
// Slot : 6 Signal value : 0 name : covmax
// Slot : 7 Signal value : 0 name : cutflag
// Slot : 8 Signal value : 0 name : chi2
// *NcSignal::Data* Id :1
// Position Vector in car coordinates : 0 0 0
// Err. in car coordinates : 0 0 0
// Owned by device : NcDevice Name : FitDefinitions
// Slot : 1 Signal value : 0 name : id
// Slot : 2 Signal value : 0 name : rchi2
// Slot : 3 Signal value : 0 name : prob
// etc....
//
// This memberfunction is based on the original idea/code by Adam Bouchta.

Definition at line 786 of file IceF2k.cxx.

◆ SetInputFile()

void IceF2k::SetInputFile ( TString name)
// Set the name of the F2K input file.
// This function has become obsolete but is kept for backward compatibility.
// The user is advised to use AddInputFile() instead, which allows processing
// of multiple F2K input files.
// This function will reset the list of all F2K input files and put the specified
// filename at the first position.
// Additional F2K input files can be specified via AddInputFile().

Definition at line 316 of file IceF2k.cxx.

◆ SetMaxEvents()

void IceF2k::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 218 of file IceF2k.cxx.

◆ SetMcToffset()

void IceF2k::SetMcToffset ( Float_t toffset)
// Set a user defined time offset for Monte Carlo data.
// A very frequently (but not always) used value is -19000.
// See the introductory docs of this class for further details.

Definition at line 267 of file IceF2k.cxx.

◆ SetOutputFile() [1/2]

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

Definition at line 359 of file IceF2k.cxx.

◆ SetOutputFile() [2/2]

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

Definition at line 371 of file IceF2k.cxx.

◆ SetPrintFreq()

void IceF2k::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 231 of file IceF2k.cxx.

◆ SetSplitLevel()

void IceF2k::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 243 of file IceF2k.cxx.

◆ SetTrigdefs()

void IceF2k::SetTrigdefs ( )
protected
// Obtain the names of the variables for each trigger procedure from the
// f2000 header. Each different trigger procedure is then stored as a separate
// "hit" of an NcDevice object and the various trigger variables are stored
// as separate signal slots of the corresponding "hit".
// Via the GetFitdefs() memberfunction this NcDevice object can be
// retrieved and stored in the ROOT output file if wanted.
// The name of the object is TrigDefinitions and the stored data can be
// inspected via the NcDevice::Data() memberfunction and looks as follows :
//
// *NcDevice::Data* Id : 0 Name : TrigDefinitions
// Position Vector in car (rad) coordinates : 0 0 0
// Err. in car (rad) coordinates : 0 0 0
// The following 9 hits are registered :
// *NcSignal::Data* Id : 1 Name : main
// Position Vector in car (rad) coordinates : 0 0 0
// Err. in car (rad) coordinates : 0 0 0
// Owned by device : NcDevice Id : 0 Name : TrigDefinitions
// Slot : 1 Signal value : 0 name : trig_pulse_le
// Slot : 2 Signal value : 0 name : trig_pulse_tot
// Slot : 3 Signal value : 0 name : regi_flag
// *NcSignal::Data* Id : 2 Name : amaa
// Position Vector in car (rad) coordinates : 0 0 0
// Err. in car (rad) coordinates : 0 0 0
// Owned by device : NcDevice Id : 0 Name : TrigDefinitions
// Slot : 1 Signal value : 0 name : trig_pulse_le
// Slot : 2 Signal value : 0 name : trig_pulse_tot
// Slot : 3 Signal value : 0 name : regi_flag
// *NcSignal::Data* Id : 3 Name : amab10
// Position Vector in car (rad) coordinates : 0 0 0
// Err. in car (rad) coordinates : 0 0 0
// Owned by device : NcDevice Id : 0 Name : TrigDefinitions
// Slot : 1 Signal value : 0 name : trig_pulse_le
// Slot : 2 Signal value : 0 name : trig_pulse_tot
// Slot : 3 Signal value : 0 name : regi_flag
// etc....

Definition at line 869 of file IceF2k.cxx.

Member Data Documentation

◆ fBsize

Int_t IceF2k::fBsize
protected

Definition at line 49 of file IceF2k.h.

◆ fCompTWR

Int_t IceF2k::fCompTWR
protected

Definition at line 62 of file IceF2k.h.

◆ fEvent

mevt IceF2k::fEvent
protected

! Structure holding the actual event data (hits, tracks, etc...)

Definition at line 74 of file IceF2k.h.

◆ fFitdefs

NcDevice* IceF2k::fFitdefs
protected

Definition at line 57 of file IceF2k.h.

◆ fHeader

Array IceF2k::fHeader
protected

! Structure holding the file header info

Definition at line 73 of file IceF2k.h.

◆ fInfiles

TObjArray* IceF2k::fInfiles
protected

Definition at line 52 of file IceF2k.h.

◆ fInput

mcfile* IceF2k::fInput
protected

! Structure holding the input file characteristics

Definition at line 72 of file IceF2k.h.

◆ fMaxevt

Int_t IceF2k::fMaxevt
protected

Definition at line 50 of file IceF2k.h.

◆ fMctoffset

Float_t IceF2k::fMctoffset
protected

Definition at line 60 of file IceF2k.h.

◆ fMctracks

Int_t IceF2k::fMctracks
protected

Definition at line 61 of file IceF2k.h.

◆ fOmdb

NcObjMatrix* IceF2k::fOmdb
protected

Definition at line 56 of file IceF2k.h.

◆ fOutfile

TFile* IceF2k::fOutfile
protected

Definition at line 53 of file IceF2k.h.

◆ fPdg

TDatabasePDG* IceF2k::fPdg
protected

Definition at line 55 of file IceF2k.h.

◆ fPrintfreq

Int_t IceF2k::fPrintfreq
protected

Definition at line 51 of file IceF2k.h.

◆ fSplit

Int_t IceF2k::fSplit
protected

Definition at line 48 of file IceF2k.h.

◆ fToffset

Float_t IceF2k::fToffset
protected

Definition at line 59 of file IceF2k.h.

◆ fTrigdefs

NcDevice* IceF2k::fTrigdefs
protected

Definition at line 58 of file IceF2k.h.


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