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

Job for extracting calibration data from database and storing them into an NcObjMatrix OM dbase. More...

#include "IceDB2Root.h"

Inheritance diagram for IceDB2Root:
NcJob

Detailed Description

Job for extracting calibration data from database and storing them 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 IceDB2Root
// Extraction of Amanda and IceCube calibration data from the IceCube database.
// Calibration data are stored into an NcObjMatrix containing the complete OM
// position, calibration, Xtalk etc... database.
// 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".
// 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 and TWRDaq 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");
//
// IceDB2Root q("IceDB2Root","DB to IcePack data structure conversion");
//
// // Output file for the event structures
// q.SetOutputFile("cal2005.root");
// q.SetUT(2005,7,1);
//
// ///////////////////////////////////////////////////////////////////
// // 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: Garmt de Vries-Uiterweerd 06-jun-2007 Utrecht University
//- Modified: NvE $Date: 2010-03-19 11:10:02 +0100 (Fri, 19 Mar 2010) $ NCFS

Definition at line 21 of file IceDB2Root.h.

Public Member Functions

 IceDB2Root (const char *name="IceDB2Root", const char *title="")
 
virtual ~IceDB2Root ()
 
virtual void Exec (Option_t *opt)
 
NcObjMatrixGetOMdbase (TString name="MuDaq")
 
TDatabasePDG * GetPDG ()
 
NcTimestamp GetTime ()
 
void SetDatabase (TString name, TString user, TString password="")
 
void SetOutputFile (TString name)
 
void SetUT (Int_t y, Int_t m, Int_t d, Int_t hh=0, Int_t mm=0, Int_t ss=0)
 
- 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 GetJEBADaqData ()
 
void GetJEBTDaqData ()
 
void GetMuDaqData ()
 
void GetTWRDaqData ()
 
- Protected Member Functions inherited from NcJob
void SetMainObject (TObject *obj)
 

Protected Attributes

TString fDBName
 
NcObjMatrixfJEBADaqdb
 
NcObjMatrixfJEBTDaqdb
 
NcObjMatrixfMuDaqdb
 
TFile * fOutfile
 
TString fPassword
 
TDatabasePDG * fPdg
 
TString fRootFileName
 
NcTimestamp fTime
 
NcObjMatrixfTWRDaqdb
 
TString fUser
 
- 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

◆ IceDB2Root()

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

Definition at line 167 of file IceDB2Root.cxx.

◆ ~IceDB2Root()

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

Definition at line 188 of file IceDB2Root.cxx.

Member Function Documentation

◆ Exec()

void IceDB2Root::Exec ( Option_t * opt)
virtual
// Job to extract calibration data from database 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 302 of file IceDB2Root.cxx.

◆ GetJEBADaqData()

void IceDB2Root::GetJEBADaqData ( )
protected
// Obtain all the JEB ATWDDaq geometry, calibration.

Definition at line 1692 of file IceDB2Root.cxx.

◆ GetJEBTDaqData()

void IceDB2Root::GetJEBTDaqData ( )
protected
// Obtain all the JEB TWRDaq geometry, calibration and Xtalk data.

Definition at line 1252 of file IceDB2Root.cxx.

◆ GetMuDaqData()

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

Definition at line 394 of file IceDB2Root.cxx.

◆ GetOMdbase()

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

Definition at line 285 of file IceDB2Root.cxx.

◆ GetPDG()

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

Definition at line 274 of file IceDB2Root.cxx.

◆ GetTime()

NcTimestamp IceDB2Root::GetTime ( )
// Return time for which the calibration is done.

Definition at line 251 of file IceDB2Root.cxx.

◆ GetTWRDaqData()

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

Definition at line 834 of file IceDB2Root.cxx.

◆ SetDatabase()

void IceDB2Root::SetDatabase ( TString name,
TString user,
TString password = "" )
// Set the name of the database, and username/password needed to access it.

Definition at line 227 of file IceDB2Root.cxx.

◆ SetOutputFile()

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

Definition at line 240 of file IceDB2Root.cxx.

◆ SetUT()

void IceDB2Root::SetUT ( Int_t y,
Int_t m,
Int_t d,
Int_t hh = 0,
Int_t mm = 0,
Int_t ss = 0 )
// Set time for which calibration is done. Input parameters are the same as
// for NcTimestamp::SetUT. Default value for hh, mm and ss is 0.

Definition at line 262 of file IceDB2Root.cxx.

Member Data Documentation

◆ fDBName

TString IceDB2Root::fDBName
protected

Definition at line 35 of file IceDB2Root.h.

◆ fJEBADaqdb

NcObjMatrix* IceDB2Root::fJEBADaqdb
protected

Definition at line 46 of file IceDB2Root.h.

◆ fJEBTDaqdb

NcObjMatrix* IceDB2Root::fJEBTDaqdb
protected

Definition at line 45 of file IceDB2Root.h.

◆ fMuDaqdb

NcObjMatrix* IceDB2Root::fMuDaqdb
protected

Definition at line 43 of file IceDB2Root.h.

◆ fOutfile

TFile* IceDB2Root::fOutfile
protected

Definition at line 39 of file IceDB2Root.h.

◆ fPassword

TString IceDB2Root::fPassword
protected

Definition at line 37 of file IceDB2Root.h.

◆ fPdg

TDatabasePDG* IceDB2Root::fPdg
protected

Definition at line 42 of file IceDB2Root.h.

◆ fRootFileName

TString IceDB2Root::fRootFileName
protected

Definition at line 38 of file IceDB2Root.h.

◆ fTime

NcTimestamp IceDB2Root::fTime
protected

Definition at line 40 of file IceDB2Root.h.

◆ fTWRDaqdb

NcObjMatrix* IceDB2Root::fTWRDaqdb
protected

Definition at line 44 of file IceDB2Root.h.

◆ fUser

TString IceDB2Root::fUser
protected

Definition at line 36 of file IceDB2Root.h.


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