162 |
|
/* Destructor */ |
163 |
|
STAOfflineAnalyzer::~STAOfflineAnalyzer() { |
164 |
|
theDQMStore->rmdir("DT/STAOfflineAnalyzer"); |
165 |
– |
// theFile->cd(); |
166 |
– |
// theFile->Write(); |
167 |
– |
// theFile->Close(); |
165 |
|
} |
166 |
|
|
167 |
|
/* Operations */ |
203 |
|
|
204 |
|
if (!mc) { |
205 |
|
Handle<LTCDigiCollection> ltcdigis; |
206 |
< |
event.getByType(ltcdigis); |
210 |
< |
//cout << "ltcdigis " << ltcdigis << endl; |
206 |
> |
event.getByLabel("none",ltcdigis); |
207 |
|
|
208 |
|
for (std::vector<LTCDigi>::const_iterator ltc= ltcdigis->begin(); ltc!= |
209 |
|
ltcdigis->end(); ++ltc) { |
214 |
– |
//if (debug) cout << (*ltc) << endl; |
210 |
|
for (int i = 0; i < 6; i++) |
211 |
|
if ((*ltc).HasTriggered(i)) { |
212 |
|
LCT.set(i); |
311 |
|
Cylinder::RotationType rot0; |
312 |
|
const Cylinder::CylinderPointer ecal = Cylinder::build(pos0, rot0, |
313 |
|
radiusECAL); |
319 |
– |
//cout << "Cyl " << ecal->radius() << endl; |
314 |
|
|
315 |
|
TrajectoryStateOnSurface tsosAtEcal = |
316 |
|
thePropagator->propagate(*innerTSOS.freeState(), *ecal); |
420 |
|
|
421 |
|
int nLay=0, nSL=0, nCh=0; |
422 |
|
for (int c=1; c<=5;++c) { |
429 |
– |
// cout << "c, lh, fh " << c <<" " << firstHitSector << " " << |
430 |
– |
// lastHitSector << endl; |
423 |
|
if (c==5 && firstHitSector==14) firstHitSector=10; |
424 |
|
else if (c==5 && lastHitSector==14) lastHitSector=10; |
425 |
|
else if (c==5 && firstHitSector==13) firstHitSector=4; |
435 |
|
const DTChamber * ch = dtGeom->chamber(chid); |
436 |
|
|
437 |
|
if (hitsPerChamber[chid]==0) { |
446 |
– |
//cout << "Hits missing in " << chid << endl; |
438 |
|
missingHit(dtGeom, segs, ch, innerTSOS); |
439 |
|
} else { |
440 |
|
nCh++; |
450 |
– |
//cout << "Hits in " << chid << " = " << hitsPerChamber[chid]<< endl; |
441 |
|
} |
442 |
|
int nLayPerCh=0, nSLPerCh=0; |
443 |
< |
for (int sl=1; sl<=3; ++sl) { |
444 |
< |
if (sl==2 && cc==4) continue; |
445 |
< |
DTSuperLayerId slid(chid, sl); |
443 |
> |
for (int i=1; i<=3; ++i) { |
444 |
> |
if (i==2 && cc==4) continue; |
445 |
> |
DTSuperLayerId slid(chid, i); |
446 |
|
const DTSuperLayer* sl = dtGeom->superLayer(slid); |
447 |
|
if (hitsPerSL[slid]==0) { |
458 |
– |
//cout << "Hits missing in " << slid << endl; |
448 |
|
missingHit(dtGeom, segs2d, sl, innerTSOS); |
449 |
|
} else { |
450 |
|
nSL++; |
451 |
|
nSLPerCh++; |
463 |
– |
//cout << "Hits in " << slid << " = " << hitsPerSL[slid]<< endl; |
452 |
|
} |
453 |
|
int nLayPerSL=0; |
454 |
|
for (int l=1; l<=4; ++l) { |
455 |
|
DTLayerId lid(slid, l); |
456 |
|
const DTLayer* lay = dtGeom->layer(lid); |
457 |
|
if (hitsPerLayer[lid]==0) { |
470 |
– |
//cout << "Hits missing in " << lid << endl; |
458 |
|
missingHit(dtGeom, hits1d, lay, innerTSOS); |
459 |
|
} else { |
460 |
|
nLay++; |
461 |
|
nLayPerCh++; |
462 |
|
nLayPerSL++; |
476 |
– |
//cout << "Hits in " << lid << " = " << hitsPerLayer[lid]<< endl; |
463 |
|
} |
464 |
|
} |
465 |
|
histo("hSANLayersPerSL")->Fill(nLayPerSL); |
535 |
|
histo("hHitsLostChamber")->Fill(nSegsCh); |
536 |
|
if (nSegsCh) { |
537 |
|
LocalPoint extrapPos=extraptsos.localPosition(); |
552 |
– |
//cout << "Extrap pos " << extrapPos << endl; |
538 |
|
double minDist=99999.; |
539 |
|
for (DTRecSegment4DCollection::const_iterator hit=segsch.first; hit!=segsch.second; |
540 |
|
++hit) { |
556 |
– |
//cout << "Hit pos " << hit->localPosition() << endl; |
541 |
|
LocalVector dist = hit->localPosition() - extrapPos; |
558 |
– |
//cout << "dist " << dist << " " << dist.perp() << endl; |
542 |
|
if (dist.perp()<minDist) minDist=dist.perp(); |
543 |
|
} |
544 |
|
histo("hMinDistChamber")->Fill(minDist); |
552 |
|
histo("hHitsLostSL")->Fill(nSegsCh); |
553 |
|
if (nSegsCh) { |
554 |
|
LocalPoint extrapPos=extraptsos.localPosition(); |
572 |
– |
//cout << "Extrap pos " << extrapPos << endl; |
555 |
|
double minDist=99999.; |
556 |
|
for (DTRecSegment2DCollection::const_iterator hit=segsch.first; hit!=segsch.second; |
557 |
|
++hit) { |
576 |
– |
//cout << "Hit pos " << hit->localPosition() << endl; |
558 |
|
LocalVector dist = hit->localPosition() - extrapPos; |
578 |
– |
//cout << "dist " << dist << " " << dist.perp() << endl; |
559 |
|
if (dist.perp()<minDist) minDist=dist.x(); |
560 |
|
} |
561 |
|
histo("hMinDistSL")->Fill(minDist); |
569 |
|
histo("hHitsLostLayer")->Fill(nSegsCh); |
570 |
|
if (nSegsCh) { |
571 |
|
LocalPoint extrapPos=extraptsos.localPosition(); |
592 |
– |
//cout << "Extrap pos " << extrapPos << endl; |
572 |
|
double minDist=99999.; |
573 |
|
for (DTRecHitCollection::const_iterator hit=segsch.first; hit!=segsch.second; |
574 |
|
++hit) { |
596 |
– |
//cout << "Hit pos " << hit->localPosition() << endl; |
575 |
|
LocalVector dist = hit->localPosition() - extrapPos; |
598 |
– |
//cout << "dist " << dist << " " << dist.perp() << endl; |
576 |
|
if (dist.perp()<minDist) minDist=dist.x(); |
577 |
|
} |
578 |
|
histo("hMinDistLayer")->Fill(minDist); |
669 |
|
|
670 |
|
} |
671 |
|
|
695 |
– |
DEFINE_FWK_MODULE(STAOfflineAnalyzer); |