StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTofCalibration.cxx
1 /*******************************************************************
2  *
3  * $Id: StTofCalibration.cxx,v 1.5 2003/09/02 17:59:10 perev Exp $
4  *
5  * Author: Frank Geurts
6  *****************************************************************
7  *
8  * Description: Calibration class for TOFp
9  *
10  *****************************************************************
11  *
12  * $Log: StTofCalibration.cxx,v $
13  * Revision 1.5 2003/09/02 17:59:10 perev
14  * gcc 3.2 updates + WarnOff
15  *
16  * Revision 1.4 2002/01/29 23:33:26 geurts
17  * change default tdc calibration factor
18  *
19  * Revision 1.3 2002/01/22 16:12:42 geurts
20  * minor bugfix for Solaris
21  *
22  * Revision 1.2 2002/01/22 07:11:32 geurts
23  * doxygenized
24  *
25  * Revision 1.1 2001/09/28 19:09:39 llope
26  * first version
27  *
28  *******************************************************************/
30 
44 #include <Stiostream.h>
45 #include "StTofCalibration.h"
46 //#include "St_XDFFile.h"
47 //#include "St_DataSetIter.h"
48 //#include "ctf/St_ctg_Module.h"
49 
52 
55  mSlatCalibVec.clear();
56  for(int iRow=0; iRow<TOFP_MAX_SLATS; iRow++){
57  StructSlatCalib* tempSlatCalib = new StructSlatCalib;
58  tempSlatCalib->offset_tdc = 0.;
59  tempSlatCalib->cc_tdc = 50.0e-12;
60  tempSlatCalib->ods_tdc = 0.;
61  tempSlatCalib->offset_adc = 0.;
62  tempSlatCalib->ods_adc = 0.;
63  tempSlatCalib->cc_adc = 2.4e-2; // typically this one is nphe_to_adc
64  mSlatCalibVec.push_back(*tempSlatCalib);
65  delete tempSlatCalib;
66  }
67 }
68 
69 
72  //Char_t *InputXdfFile= "ctg_pars.xdf";
73  //St_XDFFile xdf(InputXdfFile);
74  //St_DataSet *ctfg = xdf.NextEventGet();
75  //St_DataSetIter gime(ctfg);
76  //
77  //mSlatCalibVec.clear();
78  //
79  //St_ctg_slat* stafSlatParam(0);
80  //stafSlatParam = (St_ctg_slat *) gime("tof_slat");
81  //ctg_slat_st *slatCalib = stafSlatParam->GetTable();
82  //for(int iRow=0; iRow<stafSlatParam->GetNRows(); iRow++,slatCalib++){
83  // StructSlatCalib* tempSlatCalib = new StructSlatCalib;
84  // tempSlatCalib->offset_tdc = slatCalib->offset_tdc; // 0.
85  // tempSlatCalib->cc_tdc = slatCalib->cc_tdc; // 25.0e-12
86  // tempSlatCalib->ods_tdc = slatCalib->ods_tdc; // 0.
87  // tempSlatCalib->offset_adc = slatCalib->offset_adc; // 0.
88  // tempSlatCalib->ods_adc = slatCalib->ods_adc; // 0.
89  // tempSlatCalib->cc_adc = 0.; // 2.4e-2 typically this one is nphe_to_adc
90  //
91  // mSlatCalibVec.push_back(*tempSlatCalib);
92  // delete tempSlatCalib;
93  //}
94 }
95 
97 void StTofCalibration::print(ostream& os){
98  os << "------StTofCalibration:print()----" << endl;
99  os << " CalibrationVector Size = " << mSlatCalibVec.size() << endl;
100  for (unsigned int i=0;i<mSlatCalibVec.size();i++){
101  os << " slat: " << i
102  << " tdc: " << mSlatCalibVec[i].offset_tdc << " " << mSlatCalibVec[i].cc_tdc
103  << " " << mSlatCalibVec[i].ods_tdc
104  << " adc: " << mSlatCalibVec[i].offset_adc
105  << " " << mSlatCalibVec[i].ods_adc << " " << mSlatCalibVec[i].cc_adc
106  << endl;
107  }
108  os << "----------------------------------" << endl;
109 
110 }
void print(ostream &os=cout)
dump contents of calibration vector to stdout
void init()
initializes calibration from XDF or dBase (not functioning yet)
~StTofCalibration()
default empty destructor
StTofCalibration()
default constructor, initializes default calibration values