CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
TreeTofElecDataCnv Class Reference

#include <TreeTofQElecCnv.h>

+ Inheritance diagram for TreeTofElecDataCnv:

Public Member Functions

const CLID & objType () const
 
 TreeTofElecDataCnv (ISvcLocator *svc)
 
virtual ~TreeTofElecDataCnv ()
 
virtual long repSvcType () const
 
- Public Member Functions inherited from TreeCalBaseCnv
virtual ~TreeCalBaseCnv ()
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
virtual StatusCode createObj (IOpaqueAddress *addr, DataObject *&refpObject)
 
ICalibTreeSvcgetCalibTreeSvc ()
 
 TreeCalBaseCnv (ISvcLocator *svc, const CLID &clid)
 
virtual StatusCode createRoot (const std::string &fname, CalibData::CalibBase1 *pTDSObj)
 
- Public Member Functions inherited from Converter< Ty1, Ty2 >
destinationoperator (const source &) const
 

Static Public Member Functions

static const CLID & classID ()
 
- Static Public Member Functions inherited from TreeCalBaseCnv
static const unsigned char storageType ()
 

Protected Member Functions

virtual StatusCode i_createObj (IOpaqueAddress *address, DataObject *&refpObject)
 
- Protected Member Functions inherited from TreeCalBaseCnv
virtual StatusCode internalCreateObj (DataObject *&refpObject, IOpaqueAddress *address)
 
virtual StatusCode i_processObj (DataObject *pObject, IOpaqueAddress *address)
 In case there is additional work to do on the created object.
 
virtual StatusCode fillRoot (CalibData::CalibBase *pTDSObj, TObject *pRootObj)
 
void setBaseInfo (CalibData::CalibBase1 *pObj)
 Another utility for derived classes to use.
 
- Protected Member Functions inherited from Converter< Ty1, Ty2 >
virtual destinationconvert (const source &) const =0
 

Friends

class CnvFactory< TreeTofElecDataCnv >
 

Additional Inherited Members

- Public Types inherited from Converter< Ty1, Ty2 >
typedef Ty1 source
 
typedef Ty2 destination
 
- Protected Attributes inherited from TreeCalBaseCnv
ICalibTreeSvcm_treeSvc
 
ICalibMetaCnvSvcm_metaSvc
 
IInstrumentNamem_instrSvc
 
int m_serNo
 
int m_runfrm
 
int m_runto
 
TFile * m_outFile
 
TTree * m_ttree
 
TFile * m_inFile
 
TDirectory * m_saveDir
 

Detailed Description

Base class for CAL calibration converters from Ttrees to TCDS. All such converters need to do certain things, which are handled here. Methods common to all calibrations are in the base class TreeCalBaseCnv

Author
huang bin

Definition at line 20 of file TreeTofQElecCnv.h.

Constructor & Destructor Documentation

◆ TreeTofElecDataCnv()

TreeTofElecDataCnv::TreeTofElecDataCnv ( ISvcLocator * svc)

Definition at line 31 of file TreeTofQElecCnv.cxx.

31 :
33
34 }
const CLID CLID_TofQ_Elec
Definition CalibModel.h:57
TreeCalBaseCnv(ISvcLocator *svc, const CLID &clid)

◆ ~TreeTofElecDataCnv()

virtual TreeTofElecDataCnv::~TreeTofElecDataCnv ( )
inlinevirtual

Definition at line 29 of file TreeTofQElecCnv.h.

29{};

Member Function Documentation

◆ classID()

const CLID & TreeTofElecDataCnv::classID ( )
static

Definition at line 41 of file TreeTofQElecCnv.cxx.

41 {
42 return CLID_TofQ_Elec;
43}

◆ i_createObj()

StatusCode TreeTofElecDataCnv::i_createObj ( IOpaqueAddress * address,
DataObject *& refpObject )
protectedvirtual

This creates the transient representation of an object from the corresponding ROOT object. This actually does the "new" operation and deals with the attributes of the node. This base class implementation does nothing; it should not normally be called because it doesn't correspond to any TCDS class. Instead, i_createObj of some derived class will be called.

Parameters
fnameThe ROOT file to be read in to be used to builds the object
refpObjectthe object to be built
Returns
status depending on the completion of the call

Reimplemented from TreeCalBaseCnv.

Definition at line 45 of file TreeTofQElecCnv.cxx.

46 {
47
48 MsgStream log(msgSvc(), "TreeTofElecDataCnv");
49 log<<MSG::DEBUG<<"SetProperty"<<endreq;
50
51 TreeAddress* add = dynamic_cast<TreeAddress*>(addr);
52 DatabaseRecord *records=add->pp();
53
54 TBufferFile *buf1 = new TBufferFile(TBuffer::kRead);
55 TBufferFile *buf2 = new TBufferFile(TBuffer::kRead);
56 TBufferFile *buf3 = new TBufferFile(TBuffer::kRead);
57 TBufferFile *buf4 = new TBufferFile(TBuffer::kRead);
58 TBufferFile *buf5 = new TBufferFile(TBuffer::kRead);
59 TBufferFile *buf6 = new TBufferFile(TBuffer::kRead);
60 TBufferFile *buf7 = new TBufferFile(TBuffer::kRead);
61 TBufferFile *buf8 = new TBufferFile(TBuffer::kRead);
62
63 buf1->SetBuffer((*records)["BarBoardNum"],512000,kFALSE);
64 buf2->SetBuffer((*records)["EndBoardNum"],512000,kFALSE);
65 buf3->SetBuffer((*records)["QELecBarParEast"],512000,kFALSE);
66 buf4->SetBuffer((*records)["QELecBarParWest"],512000,kFALSE);
67 buf5->SetBuffer((*records)["QELecEndPar"],512000,kFALSE);
68 buf6->SetBuffer((*records)["SimQELecBarParEast"],512000,kFALSE);
69 buf7->SetBuffer((*records)["SimQELecBarParWest"],512000,kFALSE);
70 buf8->SetBuffer((*records)["SimQELecEndPar"],512000,kFALSE);
71
72 std::cout<<" SftVer is "<<(*records)["SftVer"];
73 std::cout<<" CalVerSft is "<<(*records)["CalParVer"];
74 std::cout<<" File name is "<<(*records)["FileName"]<<std::endl;
75
76
77 TTree *BarBoardNum= new TTree();
78 TTree *EndBoardNum= new TTree();
79 TTree *QElecBarParEast = new TTree();
80 TTree *QElecBarParWest = new TTree();
81 TTree *QElecEndPar = new TTree();
82 TTree *SimQElecBarParEast = new TTree();
83 TTree *SimQElecBarParWest = new TTree();
84 TTree *SimQElecEndPar = new TTree();
85 BarBoardNum->Streamer(*buf1);
86 EndBoardNum->Streamer(*buf2);
87 QElecBarParEast->Streamer(*buf3);
88 QElecBarParWest->Streamer(*buf4);
89 QElecEndPar->Streamer(*buf5);
90 SimQElecBarParEast->Streamer(*buf6);
91 SimQElecBarParWest->Streamer(*buf7);
92 SimQElecEndPar->Streamer(*buf8);
93
94
97
98 std::vector<CalibData::BarrelElec> tmpbTof;//; = new vector<CalibData::bTofCalibBase>;
99 std::vector<CalibData::EndcapElec> tmpeTof;
100
101 // Read in the object
102 int cnt;
103 // read btoftree ------------------------------------------------------------
104 unsigned int num[4];
105 double num1[4];
106 BarBoardNum -> SetBranchAddress("Board", &num1[0]);
107 BarBoardNum -> SetBranchAddress("Channel", &num1[1]);
108 BarBoardNum -> SetBranchAddress("Crate", &num1[2]);
109 BarBoardNum -> SetBranchAddress("Fee", &num1[3]);
110 double p[11];
111 QElecBarParEast->SetBranchAddress("P0",&p[0]);
112 QElecBarParEast->SetBranchAddress("P1",&p[1]);
113 QElecBarParEast->SetBranchAddress("P2",&p[2]);
114 QElecBarParEast->SetBranchAddress("P3",&p[3]);
115 QElecBarParEast->SetBranchAddress("P4",&p[4]);
116 QElecBarParEast->SetBranchAddress("P5",&p[5]);
117 QElecBarParEast->SetBranchAddress("P6",&p[6]);
118 QElecBarParEast->SetBranchAddress("P7",&p[7]);
119 QElecBarParEast->SetBranchAddress("P8",&p[8]);
120 QElecBarParEast->SetBranchAddress("P9",&p[9]);
121 QElecBarParEast->SetBranchAddress("P10",&p[10]);
122 double p_w[11];
123 QElecBarParWest->SetBranchAddress("P0",&p_w[0]);
124 QElecBarParWest->SetBranchAddress("P1",&p_w[1]);
125 QElecBarParWest->SetBranchAddress("P2",&p_w[2]);
126 QElecBarParWest->SetBranchAddress("P3",&p_w[3]);
127 QElecBarParWest->SetBranchAddress("P4",&p_w[4]);
128 QElecBarParWest->SetBranchAddress("P5",&p_w[5]);
129 QElecBarParWest->SetBranchAddress("P6",&p_w[6]);
130 QElecBarParWest->SetBranchAddress("P7",&p_w[7]);
131 QElecBarParWest->SetBranchAddress("P8",&p_w[8]);
132 QElecBarParWest->SetBranchAddress("P9",&p_w[9]);
133 QElecBarParWest->SetBranchAddress("P10",&p_w[10]);
134 double p_se[11];
135 SimQElecBarParEast->SetBranchAddress("P0",&p_se[0]);
136 SimQElecBarParEast->SetBranchAddress("P1",&p_se[1]);
137 SimQElecBarParEast->SetBranchAddress("P2",&p_se[2]);
138 SimQElecBarParEast->SetBranchAddress("P3",&p_se[3]);
139 SimQElecBarParEast->SetBranchAddress("P4",&p_se[4]);
140 SimQElecBarParEast->SetBranchAddress("P5",&p_se[5]);
141 SimQElecBarParEast->SetBranchAddress("P6",&p_se[6]);
142 SimQElecBarParEast->SetBranchAddress("P7",&p_se[7]);
143 SimQElecBarParEast->SetBranchAddress("P8",&p_se[8]);
144 SimQElecBarParEast->SetBranchAddress("P9",&p_se[9]);
145 SimQElecBarParEast->SetBranchAddress("P10",&p_se[10]);
146 double p_sw[11];
147 SimQElecBarParWest->SetBranchAddress("P0",&p_sw[0]);
148 SimQElecBarParWest->SetBranchAddress("P1",&p_sw[1]);
149 SimQElecBarParWest->SetBranchAddress("P2",&p_sw[2]);
150 SimQElecBarParWest->SetBranchAddress("P3",&p_sw[3]);
151 SimQElecBarParWest->SetBranchAddress("P4",&p_sw[4]);
152 SimQElecBarParWest->SetBranchAddress("P5",&p_sw[5]);
153 SimQElecBarParWest->SetBranchAddress("P6",&p_sw[6]);
154 SimQElecBarParWest->SetBranchAddress("P7",&p_sw[7]);
155 SimQElecBarParWest->SetBranchAddress("P8",&p_sw[8]);
156 SimQElecBarParWest->SetBranchAddress("P9",&p_sw[9]);
157 SimQElecBarParWest->SetBranchAddress("P10",&p_sw[10]);
158
159 for(cnt=0; cnt<352; cnt++){
160 BarBoardNum -> GetEntry(cnt);
161 num[0]=num1[0];
162 num[1]=num1[1];
163 num[2]=num1[2];
164 num[3]=num1[3];
165 if(cnt%2!=0){
166 bTof.setNumWest(num);
167 }
168 if(cnt%2==0){
169 bTof.setNumEast(num);
170 int kkk=cnt/2;
171 QElecBarParEast->GetEntry(kkk);
172 QElecBarParWest->GetEntry(kkk);
173 SimQElecBarParEast->GetEntry(kkk);
174 SimQElecBarParWest->GetEntry(kkk);
175 bTof.setP1(p);
176 bTof.setP2(p_w);
177 bTof.setSimP1(p_se);
178 bTof.setSimP2(p_sw);
179 }
180 if(cnt%2!=0)
181 tmpbTof.push_back(bTof);
182 }
183
184 //read etoftree
185 EndBoardNum -> SetBranchAddress("Board", &num1[0]);
186 EndBoardNum -> SetBranchAddress("Channel", &num1[1]);
187 EndBoardNum -> SetBranchAddress("Crate", &num1[2]);
188 EndBoardNum -> SetBranchAddress("Fee", &num1[3]);
189 QElecEndPar-> SetBranchAddress("P0",&p[0]);
190 QElecEndPar->SetBranchAddress("P1",&p[1]);
191 QElecEndPar->SetBranchAddress("P2",&p[2]);
192 QElecEndPar->SetBranchAddress("P3",&p[3]);
193 QElecEndPar->SetBranchAddress("P4",&p[4]);
194 QElecEndPar->SetBranchAddress("P5",&p[5]);
195 QElecEndPar->SetBranchAddress("P6",&p[6]);
196 QElecEndPar->SetBranchAddress("P7",&p[7]);
197 QElecEndPar->SetBranchAddress("P8",&p[8]);
198 QElecEndPar->SetBranchAddress("P9",&p[9]);
199 QElecEndPar->SetBranchAddress("P10",&p[10]);
200 SimQElecEndPar-> SetBranchAddress("P0",&p_w[0]);
201 SimQElecEndPar->SetBranchAddress("P1",&p_w[1]);
202 SimQElecEndPar->SetBranchAddress("P2",&p_w[2]);
203 SimQElecEndPar->SetBranchAddress("P3",&p_w[3]);
204 SimQElecEndPar->SetBranchAddress("P4",&p_w[4]);
205 SimQElecEndPar->SetBranchAddress("P5",&p_w[5]);
206 SimQElecEndPar->SetBranchAddress("P6",&p_w[6]);
207 SimQElecEndPar->SetBranchAddress("P7",&p_w[7]);
208 SimQElecEndPar->SetBranchAddress("P8",&p_w[8]);
209 SimQElecEndPar->SetBranchAddress("P9",&p_w[9]);
210 SimQElecEndPar->SetBranchAddress("P10",&p_w[10]);
211 for(cnt=0; cnt<96; cnt++){
212 EndBoardNum->GetEntry(cnt);
213 QElecEndPar->GetEntry(cnt);
214 SimQElecEndPar->GetEntry(cnt);
215 num[0]=num1[0];
216 num[1]=num1[1];
217 num[2]=num1[2];
218 num[3]=num1[3];
219
220 eTof.setNum(num);
221 eTof.setP(p);
222 eTof.setSimP(p_w);
223 tmpeTof.push_back(eTof);
224 }
225
226 CalibData::TofElecData *tmpObject = new CalibData::TofElecData(&tmpbTof,&tmpeTof);
227
228
229 refpObject=tmpObject;
230 delete BarBoardNum;
231 delete EndBoardNum;
232 delete QElecBarParEast;
233 delete QElecBarParWest;
234 delete QElecEndPar;
235 delete SimQElecBarParEast;
236 delete SimQElecBarParWest;
237 delete SimQElecEndPar;
238
239 return StatusCode::SUCCESS;
240
241
242}
const int num1
data SetBranchAddress("time",&time)
data GetEntry(0)
IMessageSvc * msgSvc()
virtual DatabaseRecord * pp()
int num[96]
Definition ranlxd.c:373

◆ objType()

const CLID & TreeTofElecDataCnv::objType ( ) const

Definition at line 37 of file TreeTofQElecCnv.cxx.

37 {
38 return CLID_TofQ_Elec;
39}

◆ repSvcType()

virtual long TreeTofElecDataCnv::repSvcType ( ) const
inlinevirtual

Definition at line 34 of file TreeTofQElecCnv.h.

34 {
36 }
unsigned const char CALIBTREE_StorageType

Friends And Related Symbol Documentation

◆ CnvFactory< TreeTofElecDataCnv >

friend class CnvFactory< TreeTofElecDataCnv >
friend

Definition at line 1 of file TreeTofQElecCnv.h.


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