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

Job for conversion of (ascii) calibration data into an NcObjMatrix OM dbase. More...

#include "IceCal2Root.h"

Inheritance diagram for IceCal2Root:
NcJob

Detailed Description

Job for conversion of (ascii) calibration data into an NcObjMatrix OM dbase.

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 IceCal2Root
// Conversion of Amanda (ascii) calibration data into a NcObjMatrix objects
// containing the complete OM position, calibration, Xtalk etc... database.
//
// This facility will become obsolete soon and is only kept for
// backward compatibility and testing purposes.
// Please use the more recent IceDB2Root facility instead.
//
// Via specification of the various input files, various NcObjMatrix objects
// are created and (optionally) stored in a single output file.
// The names of the NcObjMatrix objects indicate the type of database they
// contain.
// For example :
// The name "MuDaq-OMDBASE" indicates the database info for MuDaq data,
// whereas TWRDaq calibration data is in the object named "TWRDaq-OMDBASE".
// Note that a MuDaq Amacalib ascii input file has always to be provided,
// since the geometry data for all the other databases is obtained from there.
// In addition a PDG particle database, extended with some specific Amanda
// entries, is provided as well.
// This class is derived from NcJob providing task-based processing.
// Note that the data structures are only written out if an outputfile has
// been specified via the SetOutputFile memberfunction.
// In case no outputfile has been specified, this class provides a facility
// to investigate/use the dbase data directly in subsequent (sub)tasks.
//
// The OM database information in the NcObjMatrix has the following structure :
//
// (j,1) : Pointer to OM with identifier "j"
// (j,k+1) : Pointer to a TF1* being the probability function for Xtalk
// with OM "j" as transmitter and OM "k" as receiver.
//
// The latter is only available for MuDaq databases.
//
// The geometry information is directly available from the OM pointer
// in the form of its position and data words like "ORIENT" for orientation etc...
// Just use the OM memberfunction Data() to obtain a full overview.
//
// Note : Position coordinates are indicated in meters and times are in nanoseconds,
// in accordance with the convention used previously for Amanda.
//
// From the OM pointer also the various (de)calibration functions for
// ADC, LE and TOT can be obtained as TF1* pointers.
// The actual values of the calibration constants are stored as parameters
// of these (de)calibration functions and can be investigated via the
// usual TF1::Print() or TF1::GetParameter() facilities.
// The last two parameters of the Xtalk probability function have no effect
// on the evaluated probability value. However, these two parameters provide
// the minimum and maximum allowed LE differences between the transmitter
// and receiver hits, respectively (as can be seen from the parameter names).
//
// The (de)calibration of signals and/or determination of the Xtalk probability
// can be performed via the standard TF1::Eval(x) functionality, where "x"
// represents the input argument of the function (e.g. an uncalibrated ADC value).
//
// In general the database is not directly accessed by the user in performing
// physics analysis, since all the necessary information is contained in the
// event data itself and available via the GetSignal() memberfunction of the hits.
// However, specific tasks like e.g. calibration, Xtalk correction,
// bad module removal, noise hit removal etc... might need explicit database access.
// So, at the end of the example below some functionality is indicated for clarity.
// The user may use exactly the same procedures to obtain explicit access to the calibration
// functions etc... from the various OMs and/or hits within the actual event data which he/she
// is analysing.
//
// The PDG particle database is a standard ROOT TDatabasePDG object
// with the following extensions :
//
// Name PDG code
// ---- --------
// brems 10001001
// deltae 10001002
// pairprod 10001003
// nucl_int 10001004
// mu_pair 10001005
// hadrons 10001006
// fiberlaser 10002100
// n2laser 10002101
// yaglaser 10002201
// z_primary 10003000
// a_primary 10003500
//
// Usage example :
// ---------------
//
// gSystem->Load("ncfspack");
// gSystem->Load("icepack");
// gSystem->Load("iceconvert");
//
// IceCal2Root q("IceCal2Root","Amacalib to IcePack data structure conversion");
//
// // The MuDaq Amacalib input filename
// q.SetAmacalibFile("amacalib_amanda2_2005.txt");
//
// // The TWRDaq input filename with the newly determined TWR T0 and ADC calibs.
// q.SetTWRDaqFile("twr-cal-2005.txt");
//
// // Output file for the event structures
// q.SetOutputFile("cal2005.root");
//
// ///////////////////////////////////////////////////////////////////
// // Here the user can specify his/her sub-tasks to be executed
// // after the database structures have been filled and before the
// // data is written out.
// // Sub-tasks (i.e. a user classes derived from TTask) are entered
// // as follows :
// //
// // MyTask1 task1("task1","Some modifications to specific OMs");
// // MyTask2 task2("task2","Removal of specific OMs");
// // MyTask3 task3("task3","Add private objects to the output file");
// // q.Add(&task1);
// // q.Add(&task2);
// // q.Add(&task3);
// //
// // The sub-tasks will be executed in the order as they are entered.
// ///////////////////////////////////////////////////////////////////
//
// // Perform the conversion and execute subtasks (if any)
// q.ExecuteJob();
//
// // Outline of dbase usage for (de)calibration and Xtalk
//
// NcObjMatrix* omdb=q.GetOMdbase("MuDaq");
// IceAOM* om=(IceAOM*)omdb->GetObject(9,1); // Pointer to OM 9
// om->Data(); // Overview of generic module parameters
// TF1* fcal=0; // Calibration function
// TF1* fdecal=0; // De-calibration function
// fcal=om->GetCalFunction("ADC");
// Float_t adc=248; // Uncalibrated ADC
// Float_t cadc=0; // Calibrated ADC
// if (fcal) cadc=fcal->Eval(adc);
// fcal=om->GetCalFunction("TOT");
// Float_t tot=1538; // Uncalibrated TOT
// Float_t ctot=0; // Calibrated TOT
// if (fcal) ctot=fcal->Eval(tot);
// fdecal=om->GetDecalFunction("LE");
// Float_t le=21697; // Uncalibrated LE
// Float_t cle=0; // Calibrated LE
// if (fcal) cle=fcal->Eval(le);
//
// // Xtalk probability between (trans) OM 90 and (rec) OM 113
// // for a transmitter signal of uncalibrated amplitude "adc".
// TF1* fxtalkp=(TF1*)omdb->GetObject(90,113+1);
// Float_t prob=0;
// adc=378;
// if (fxtalkp) prob=fxtalkp->Eval(adc);
//
//--- Author: Nick van Eijndhoven 09-aug-2005 Utrecht University
//- Modified: NvE $Date: 2010-03-19 11:10:02 +0100 (Fri, 19 Mar 2010) $ NCFS

Definition at line 20 of file IceCal2Root.h.

Public Member Functions

 IceCal2Root (const char *name="IceCal2Root", const char *title="")
 
virtual ~IceCal2Root ()
 
virtual void Exec (Option_t *opt)
 
NcObjMatrixGetOMdbase (TString name="MuDaq")
 
TDatabasePDG * GetPDG ()
 
void SetAmacalibFile (TString name)
 
void SetOutputFile (TString name)
 
void SetTWRDaqFile (TString name)
 
- 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 GetMuDaqData ()
 
void GetTWRDaqData ()
 
- Protected Member Functions inherited from NcJob
void SetMainObject (TObject *obj)
 

Protected Attributes

TString fAmacalFileName
 
ifstream fInput
 
NcObjMatrixfMuDaqdb
 
TFile * fOutfile
 
TDatabasePDG * fPdg
 
TString fRootFileName
 
NcObjMatrixfTWRDaqdb
 
TString fTWRDaqFileName
 
- 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

◆ IceCal2Root()

IceCal2Root::IceCal2Root ( const char * name = "IceCal2Root",
const char * title = "" )
// Default constructor.

Definition at line 178 of file IceCal2Root.cxx.

◆ ~IceCal2Root()

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

Definition at line 195 of file IceCal2Root.cxx.

Member Function Documentation

◆ Exec()

void IceCal2Root::Exec ( Option_t * opt)
virtual
// Job to convert the (ascii) database info into the IcePack structure.
//
// Notes :
// -------
// 1) This class is derived from NcJob, allowing a task based processing.
// After conversion of the (ascii) dbase data into the IcePack structure,
// the processing of all available sub-tasks (if any) is invoked.
// This provides a facility to investigate/use the dbase data in
// subsequent (sub)tasks processing before the final data structures
// are written out.
//
// 2) Creation of a TFolder via the argument of the ExecuteJob statement
// makes all created database objects accessible to subsequent tasks
// via the TFolder::FindObject facility.

Definition at line 277 of file IceCal2Root.cxx.

◆ GetMuDaqData()

void IceCal2Root::GetMuDaqData ( )
protected
// Obtain all the MuDaq geometry, calibration and Xtalk data.

Definition at line 361 of file IceCal2Root.cxx.

◆ GetOMdbase()

NcObjMatrix * IceCal2Root::GetOMdbase ( TString name = "MuDaq")
// Provide pointer to the requested OM geometry, calib. etc... database.
// Options for the "name" specification are : MuDaq, TWRDaq.
// For backward compatibility the default is name="MuDaq".

Definition at line 262 of file IceCal2Root.cxx.

◆ GetPDG()

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

Definition at line 252 of file IceCal2Root.cxx.

◆ GetTWRDaqData()

void IceCal2Root::GetTWRDaqData ( )
protected
// Obtain all the TWRDaq geometry and calibration data.

Definition at line 615 of file IceCal2Root.cxx.

◆ SetAmacalibFile()

void IceCal2Root::SetAmacalibFile ( TString name)
// Set the name of the Amacalib MuDaq input file.

Definition at line 222 of file IceCal2Root.cxx.

◆ SetOutputFile()

void IceCal2Root::SetOutputFile ( TString name)
// Set the name of the ROOT output file.

Definition at line 242 of file IceCal2Root.cxx.

◆ SetTWRDaqFile()

void IceCal2Root::SetTWRDaqFile ( TString name)
// Set the name of the TWRDaq calibration input file.

Definition at line 232 of file IceCal2Root.cxx.

Member Data Documentation

◆ fAmacalFileName

TString IceCal2Root::fAmacalFileName
protected

Definition at line 35 of file IceCal2Root.h.

◆ fInput

ifstream IceCal2Root::fInput
protected

Definition at line 33 of file IceCal2Root.h.

◆ fMuDaqdb

NcObjMatrix* IceCal2Root::fMuDaqdb
protected

Definition at line 41 of file IceCal2Root.h.

◆ fOutfile

TFile* IceCal2Root::fOutfile
protected

Definition at line 38 of file IceCal2Root.h.

◆ fPdg

TDatabasePDG* IceCal2Root::fPdg
protected

Definition at line 40 of file IceCal2Root.h.

◆ fRootFileName

TString IceCal2Root::fRootFileName
protected

Definition at line 37 of file IceCal2Root.h.

◆ fTWRDaqdb

NcObjMatrix* IceCal2Root::fTWRDaqdb
protected

Definition at line 42 of file IceCal2Root.h.

◆ fTWRDaqFileName

TString IceCal2Root::fTWRDaqFileName
protected

Definition at line 36 of file IceCal2Root.h.


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