25 cout <<
"Constructor" << endl;
27 cout <<
"TreeProducerCalibSimul" << endl;
28 cout <<
"xtal in beam = " << xtalInBeam << endl;
29 cout <<
"Fetching hitCollection: " << EBRecHitCollection_.c_str() <<
" prod by " << RecHitProducer_.c_str() <<endl;
30 cout <<
"Fetching hodoCollection: " << hodoRecInfoCollection_.c_str() <<
" prod by " << hodoRecInfoProducer_.c_str() <<endl;
31 cout <<
"Fetching tdcCollection: " << tdcRecInfoCollection_.c_str() <<
" prod by " << tdcRecInfoProducer_.c_str() <<endl;
32 cout <<
"Fetching evHeaCollection: " << eventHeaderCollection_.c_str() <<
" prod by " << eventHeaderProducer_.c_str() <<endl;
42 cout <<
"Deleting" << endl;
55 cout <<
"BeginJob" << endl;
77 cout <<
"EndJob" << endl;
80 ofstream *MyOut =
new ofstream(txtfile_.c_str());
81 *MyOut <<
"total events: " << tot_events << endl;
82 *MyOut <<
"events skipped because of no hits: " << noHits << endl;
83 *MyOut <<
"events skipped because of no hodos: " << noHodo << endl;
84 *MyOut <<
"events skipped because of no tdc: " << noTdc << endl;
85 *MyOut <<
"events skipped because of no header: " << noHeader << endl;
86 *MyOut <<
"total OK events (passing the basic selection): " << tot_events_ok << endl;
103 if ( tot_events%5000 == 0){
cout <<
"event " << tot_events << endl;}
111 iEvent.getByLabel (RecHitProducer_, EBRecHitCollection_, pEBRecHits) ;
122 iEvent.getByLabel( hodoRecInfoProducer_, hodoRecInfoCollection_, pHodo);
133 iEvent.getByLabel( tdcRecInfoProducer_, tdcRecInfoCollection_, pTDC);
144 iEvent.getByLabel( eventHeaderProducer_ , pEventHeader );
145 evtHeader = pEventHeader.
product();
153 if (!recTDC) { noTdc++;
return; }
154 if (!recHodo) { noHodo++;
return; }
155 if (!evtHeader) { noHeader++;
return; }
168 int nomXtalInBeam = -999;
169 int nextXtalInBeam = -999;
172 if (xtalInBeamId==
EBDetId(0)){
return; }
173 int mySupCry = xtalInBeamId.
ic();
174 int mySupEta = xtalInBeamId.
ieta();
175 int mySupPhi = xtalInBeamId.
iphi();
180 double x = recHodo->
posX();
181 double y = recHodo->
posY();
184 double qx = recHodo->
qualX();
185 double qy = recHodo->
qualY();
190 double tdcOffset = recTDC->
offset();
199 for (
unsigned int icry=0; icry<49; icry++){
200 unsigned int row = icry/7;
201 unsigned int column = icry%7;
206 if ( Xtals7x7[icry].
ism() == 1){
208 crystal[icry] = Xtals7x7[icry].
ic();
211 crystal[icry] = -100;
229 int maxEneCry = 9999;
230 int maxEneInMatrix = -999;
233 maxEneCry = crystal[
ii];
234 maxEneInMatrix =
ii;}
244 myTree->fillInfo(
run,
event, mySupCry, maxEneCry, nomXtalInBeam, nextXtalInBeam, mySupEta, mySupPhi, tbm, x, y, Xcal, Ycal,
sx,
sy, qx, qy, tdcOffset, allMatrix,
energy, crystal);