|
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:
-
| fname | The ROOT file to be read in to be used to builds the object |
| refpObject | the object to be built |
- Returns:
- status depending on the completion of the call
Reimplemented from TreeCalBaseCnv. 00046 {
00047
00048 MsgStream log(msgSvc(), "TreeTofElecDataCnv");
00049 log<<MSG::DEBUG<<"SetProperty"<<endreq;
00050
00051 TreeAddress* add = dynamic_cast<TreeAddress*>(addr);
00052 DatabaseRecord *records=add->pp();
00053
00054 TBuffer *buf1 = new TBuffer(TBuffer::kRead);
00055 TBuffer *buf2 = new TBuffer(TBuffer::kRead);
00056 TBuffer *buf3 = new TBuffer(TBuffer::kRead);
00057 TBuffer *buf4 = new TBuffer(TBuffer::kRead);
00058 TBuffer *buf5 = new TBuffer(TBuffer::kRead);
00059 TBuffer *buf6 = new TBuffer(TBuffer::kRead);
00060 TBuffer *buf7 = new TBuffer(TBuffer::kRead);
00061 TBuffer *buf8 = new TBuffer(TBuffer::kRead);
00062
00063 buf1->SetBuffer((*records)["BarBoardNum"],512000,kFALSE);
00064 buf2->SetBuffer((*records)["EndBoardNum"],512000,kFALSE);
00065 buf3->SetBuffer((*records)["QELecBarParEast"],512000,kFALSE);
00066 buf4->SetBuffer((*records)["QELecBarParWest"],512000,kFALSE);
00067 buf5->SetBuffer((*records)["QELecEndPar"],512000,kFALSE);
00068 buf6->SetBuffer((*records)["SimQELecBarParEast"],512000,kFALSE);
00069 buf7->SetBuffer((*records)["SimQELecBarParWest"],512000,kFALSE);
00070 buf8->SetBuffer((*records)["SimQELecEndPar"],512000,kFALSE);
00071
00072 std::cout<<" CalVerSft is "<<(*records)["CalParVer"];
00073 std::cout<<" File name is "<<(*records)["FileName"]<<std::endl;
00074
00075
00076 TTree *BarBoardNum= new TTree();
00077 TTree *EndBoardNum= new TTree();
00078 TTree *QElecBarParEast = new TTree();
00079 TTree *QElecBarParWest = new TTree();
00080 TTree *QElecEndPar = new TTree();
00081 TTree *SimQElecBarParEast = new TTree();
00082 TTree *SimQElecBarParWest = new TTree();
00083 TTree *SimQElecEndPar = new TTree();
00084 BarBoardNum->Streamer(*buf1);
00085 EndBoardNum->Streamer(*buf2);
00086 QElecBarParEast->Streamer(*buf3);
00087 QElecBarParWest->Streamer(*buf4);
00088 QElecEndPar->Streamer(*buf5);
00089 SimQElecBarParEast->Streamer(*buf6);
00090 SimQElecBarParWest->Streamer(*buf7);
00091 SimQElecEndPar->Streamer(*buf8);
00092
00093
00094 CalibData::BarrelElec bTof;
00095 CalibData::EndcapElec eTof;
00096
00097 std::vector<CalibData::BarrelElec> tmpbTof;
00098 std::vector<CalibData::EndcapElec> tmpeTof;
00099
00100
00101 int cnt;
00102
00103 unsigned int num[4];
00104 double num1[4];
00105 BarBoardNum -> SetBranchAddress("Board", &num1[0]);
00106 BarBoardNum -> SetBranchAddress("Channel", &num1[1]);
00107 BarBoardNum -> SetBranchAddress("Crate", &num1[2]);
00108 BarBoardNum -> SetBranchAddress("Fee", &num1[3]);
00109 double p[11];
00110 QElecBarParEast->SetBranchAddress("P0",&p[0]);
00111 QElecBarParEast->SetBranchAddress("P1",&p[1]);
00112 QElecBarParEast->SetBranchAddress("P2",&p[2]);
00113 QElecBarParEast->SetBranchAddress("P3",&p[3]);
00114 QElecBarParEast->SetBranchAddress("P4",&p[4]);
00115 QElecBarParEast->SetBranchAddress("P5",&p[5]);
00116 QElecBarParEast->SetBranchAddress("P6",&p[6]);
00117 QElecBarParEast->SetBranchAddress("P7",&p[7]);
00118 QElecBarParEast->SetBranchAddress("P8",&p[8]);
00119 QElecBarParEast->SetBranchAddress("P9",&p[9]);
00120 QElecBarParEast->SetBranchAddress("P10",&p[10]);
00121 double p_w[11];
00122 QElecBarParWest->SetBranchAddress("P0",&p_w[0]);
00123 QElecBarParWest->SetBranchAddress("P1",&p_w[1]);
00124 QElecBarParWest->SetBranchAddress("P2",&p_w[2]);
00125 QElecBarParWest->SetBranchAddress("P3",&p_w[3]);
00126 QElecBarParWest->SetBranchAddress("P4",&p_w[4]);
00127 QElecBarParWest->SetBranchAddress("P5",&p_w[5]);
00128 QElecBarParWest->SetBranchAddress("P6",&p_w[6]);
00129 QElecBarParWest->SetBranchAddress("P7",&p_w[7]);
00130 QElecBarParWest->SetBranchAddress("P8",&p_w[8]);
00131 QElecBarParWest->SetBranchAddress("P9",&p_w[9]);
00132 QElecBarParWest->SetBranchAddress("P10",&p_w[10]);
00133 double p_se[11];
00134 SimQElecBarParEast->SetBranchAddress("P0",&p_se[0]);
00135 SimQElecBarParEast->SetBranchAddress("P1",&p_se[1]);
00136 SimQElecBarParEast->SetBranchAddress("P2",&p_se[2]);
00137 SimQElecBarParEast->SetBranchAddress("P3",&p_se[3]);
00138 SimQElecBarParEast->SetBranchAddress("P4",&p_se[4]);
00139 SimQElecBarParEast->SetBranchAddress("P5",&p_se[5]);
00140 SimQElecBarParEast->SetBranchAddress("P6",&p_se[6]);
00141 SimQElecBarParEast->SetBranchAddress("P7",&p_se[7]);
00142 SimQElecBarParEast->SetBranchAddress("P8",&p_se[8]);
00143 SimQElecBarParEast->SetBranchAddress("P9",&p_se[9]);
00144 SimQElecBarParEast->SetBranchAddress("P10",&p_se[10]);
00145 double p_sw[11];
00146 SimQElecBarParWest->SetBranchAddress("P0",&p_sw[0]);
00147 SimQElecBarParWest->SetBranchAddress("P1",&p_sw[1]);
00148 SimQElecBarParWest->SetBranchAddress("P2",&p_sw[2]);
00149 SimQElecBarParWest->SetBranchAddress("P3",&p_sw[3]);
00150 SimQElecBarParWest->SetBranchAddress("P4",&p_sw[4]);
00151 SimQElecBarParWest->SetBranchAddress("P5",&p_sw[5]);
00152 SimQElecBarParWest->SetBranchAddress("P6",&p_sw[6]);
00153 SimQElecBarParWest->SetBranchAddress("P7",&p_sw[7]);
00154 SimQElecBarParWest->SetBranchAddress("P8",&p_sw[8]);
00155 SimQElecBarParWest->SetBranchAddress("P9",&p_sw[9]);
00156 SimQElecBarParWest->SetBranchAddress("P10",&p_sw[10]);
00157
00158 for(cnt=0; cnt<352; cnt++){
00159 BarBoardNum -> GetEntry(cnt);
00160 num[0]=num1[0];
00161 num[1]=num1[1];
00162 num[2]=num1[2];
00163 num[3]=num1[3];
00164 if(cnt%2!=0){
00165 bTof.setNumWest(num);
00166 }
00167 if(cnt%2==0){
00168 bTof.setNumEast(num);
00169 int kkk=cnt/2;
00170 QElecBarParEast->GetEntry(kkk);
00171 QElecBarParWest->GetEntry(kkk);
00172 SimQElecBarParEast->GetEntry(kkk);
00173 SimQElecBarParWest->GetEntry(kkk);
00174 bTof.setP1(p);
00175 bTof.setP2(p_w);
00176 bTof.setSimP1(p_se);
00177 bTof.setSimP2(p_sw);
00178 }
00179 if(cnt%2!=0)
00180 tmpbTof.push_back(bTof);
00181 }
00182
00183
00184 EndBoardNum -> SetBranchAddress("Board", &num1[0]);
00185 EndBoardNum -> SetBranchAddress("Channel", &num1[1]);
00186 EndBoardNum -> SetBranchAddress("Crate", &num1[2]);
00187 EndBoardNum -> SetBranchAddress("Fee", &num1[3]);
00188 QElecEndPar-> SetBranchAddress("P0",&p[0]);
00189 QElecEndPar->SetBranchAddress("P1",&p[1]);
00190 QElecEndPar->SetBranchAddress("P2",&p[2]);
00191 QElecEndPar->SetBranchAddress("P3",&p[3]);
00192 QElecEndPar->SetBranchAddress("P4",&p[4]);
00193 QElecEndPar->SetBranchAddress("P5",&p[5]);
00194 QElecEndPar->SetBranchAddress("P6",&p[6]);
00195 QElecEndPar->SetBranchAddress("P7",&p[7]);
00196 QElecEndPar->SetBranchAddress("P8",&p[8]);
00197 QElecEndPar->SetBranchAddress("P9",&p[9]);
00198 QElecEndPar->SetBranchAddress("P10",&p[10]);
00199 SimQElecEndPar-> SetBranchAddress("P0",&p_w[0]);
00200 SimQElecEndPar->SetBranchAddress("P1",&p_w[1]);
00201 SimQElecEndPar->SetBranchAddress("P2",&p_w[2]);
00202 SimQElecEndPar->SetBranchAddress("P3",&p_w[3]);
00203 SimQElecEndPar->SetBranchAddress("P4",&p_w[4]);
00204 SimQElecEndPar->SetBranchAddress("P5",&p_w[5]);
00205 SimQElecEndPar->SetBranchAddress("P6",&p_w[6]);
00206 SimQElecEndPar->SetBranchAddress("P7",&p_w[7]);
00207 SimQElecEndPar->SetBranchAddress("P8",&p_w[8]);
00208 SimQElecEndPar->SetBranchAddress("P9",&p_w[9]);
00209 SimQElecEndPar->SetBranchAddress("P10",&p_w[10]);
00210 for(cnt=0; cnt<96; cnt++){
00211 EndBoardNum->GetEntry(cnt);
00212 QElecEndPar->GetEntry(cnt);
00213 SimQElecEndPar->GetEntry(cnt);
00214 num[0]=num1[0];
00215 num[1]=num1[1];
00216 num[2]=num1[2];
00217 num[3]=num1[3];
00218
00219 eTof.setNum(num);
00220 eTof.setP(p);
00221 eTof.setSimP(p_w);
00222 tmpeTof.push_back(eTof);
00223 }
00224
00225 CalibData::TofElecData *tmpObject = new CalibData::TofElecData(&tmpbTof,&tmpeTof);
00226
00227
00228 refpObject=tmpObject;
00229 delete BarBoardNum;
00230 delete EndBoardNum;
00231 delete QElecBarParEast;
00232 delete QElecBarParWest;
00233 delete QElecEndPar;
00234 delete SimQElecBarParEast;
00235 delete SimQElecBarParWest;
00236 delete SimQElecEndPar;
00237
00238 return StatusCode::SUCCESS;
00239
00240
00241 }
|