31 #include "StAnalysisMaker.h"
32 #include "StEventTypes.h"
33 #include "StMessMgr.h"
34 #include "StDcaGeometry.h"
35 #if ROOT_VERSION_CODE < 334081
38 #include "TArrayL64.h"
40 #include "TClassTable.h"
42 #include "StThreeVectorF.hh"
43 #include "StDetectorName.h"
44 #ifdef __TPC_LOCAL_COORDINATES__
45 #include "StDbUtilities/StTpcCoordinateTransform.hh"
46 #include "StDbUtilities/StCoordinates.hh"
81 gMessMgr->Info() <<
"StAnalysisMaker::Finish() "
82 <<
"Processed " << mEventCounter <<
" events." << endm;
98 event = (
StEvent *) GetInputDS(
"StEvent");
100 gMessMgr->Warning() <<
"StAnalysisMaker::Make : No StEvent" << endm;
109 summarizeEvent(event, mEventCounter);
116 gMessMgr->Warning() <<
"StAnalysisMaker::Make : Event was not accepted" << endm;
122 bool StAnalysisMaker::accept(
StEvent* event)
129 return event->primaryVertex();
141 return track && track->flag() >= 0;
144 void StAnalysisMaker::PrintStEvent(TString opt) {
146 StEvent* pEvent = (
StEvent*) StMaker::GetChain()->GetInputDS(
"StEvent");
148 cout <<
"Event: Run "<< pEvent->runId() <<
" Event No: " << pEvent->id() << endl;
149 UInt_t NpVX = pEvent->numberOfPrimaryVertices();
151 if (opt.Contains(
"v",TString::kIgnoreCase)) {
152 for (UInt_t i = 0; i < NpVX; i++) {
154 vx->Print(Form(
"Vertex: %3i ",i));
155 #ifdef StTrackMassFit_hh
156 const StTrackMassFit *pf = vx->parent();
157 if (pf) cout << *pf << endl;
159 if (opt.Contains(
"p",TString::kIgnoreCase)) {
160 UInt_t nDaughters = vx->numberOfDaughters();
161 for (UInt_t j = 0; j < nDaughters; j++) {
162 const StTrack* track = vx->daughter(j);
163 if (! track)
continue;
165 #ifdef StTrackMassFit_hh
166 const StVertex* vxEnd = track->endVertex();
167 if (vxEnd) cout << *vxEnd << endl;
170 #ifdef StTrackMassFit_hh
171 UInt_t nMassFits = vx->numberOfMassFits();
172 for (UInt_t j = 0; j < nMassFits; j++) {
173 const StTrackMassFit * track = vx->massFit(j);
174 if (! track)
continue;
175 cout << *track << endl;
182 cout <<
"Event: Vertex Not Found" << endl;
184 if (opt.Contains(
"g",TString::kIgnoreCase)) {
185 StSPtrVecTrackNode& trackNode = pEvent->trackNodes();
186 UInt_t nTracks = trackNode.size();
188 #ifndef StTrackMassFit_hh
189 cout <<
" Global tracks " << nTracks << endl;
191 cout << nTracks <<
" Track nodes" << endl;
193 for (UInt_t i=0; i < nTracks; i++) {
194 node = trackNode[i];
if (!node)
continue;
195 #ifdef StTrackMassFit_hh
196 cout << *node << endl;
198 UInt_t nentries = node->entries();
199 for (UInt_t j = 0; j < nentries; j++) {
200 StTrack *track = node->track(j);
201 if (! track)
continue;
202 if (track->type() == global) {
204 cout << *gTrack << endl;
205 }
else if (track->type() == primary) {
207 cout << *pTrack << endl;
213 if (opt.Contains(
"l3",TString::kIgnoreCase)) {
214 if (pEvent->l3Trigger()) {
215 StSPtrVecTrackNode& trackNode = pEvent->l3Trigger()->trackNodes();
216 UInt_t nTracks = trackNode.size();
218 cout <<
" L3 global tracks " << nTracks << endl;
219 for (UInt_t i=0; i < nTracks; i++) {
220 node = trackNode[i];
if (!node)
continue;
222 if (gTrack) cout << *gTrack << endl;
228 void StAnalysisMaker::PrintGlobalTrack(Int_t itk) {
229 StEvent* pEvent = (
StEvent*) StMaker::GetChain()->GetInputDS(
"StEvent");
231 cout <<
"Event: Run "<< pEvent->runId() <<
" Event No: " << pEvent->id() << endl;
232 StSPtrVecTrackNode& trackNode = pEvent->trackNodes();
233 UInt_t nTracks = trackNode.size();
235 cout <<
" Global tracks " << endl;
236 for (UInt_t i = 0; i < nTracks; i++) {
237 node = trackNode[i];
if (!node)
continue;
239 if (itk != 0 && gTrack->key() != itk)
continue;
240 cout << *gTrack << endl;
241 if (! gTrack->detectorInfo()) {cout <<
"=============== detectorInfo is missing" << endl;
continue;}
242 StPtrVecHit hvec = gTrack->detectorInfo()->hits();
243 for (UInt_t j=0; j<hvec.size(); j++) {
244 if (hvec[j]->detector() == kTpcId) {
246 if (! tpcHit)
continue;
247 cout << *tpcHit << endl;
249 cout << *hvec[j] << endl;
255 void StAnalysisMaker::PrintVertex(Int_t ivx) {
257 StEvent* pEvent = (
StEvent*) StMaker::GetChain()->GetInputDS(
"StEvent");
259 cout <<
"Event: Run "<< pEvent->runId() <<
" Event No: " << pEvent->id() << endl;
260 UInt_t NpVX = pEvent->numberOfPrimaryVertices();
262 for (Int_t i = 0; i < NpVX; i++) {
263 if (ivx >= 0 && i != ivx)
continue;
265 vx->Print(Form(
"Vertex: %3i ",i));
266 UInt_t nDaughters = vx->numberOfDaughters();
267 for (UInt_t j = 0; j < nDaughters; j++) {
269 if (! pTrack)
continue;
270 cout << *pTrack << endl;
271 if (! pTrack->detectorInfo()) {cout <<
"=============== detectorInfo is missing" << endl;
continue;}
272 StPtrVecHit hvec = pTrack->detectorInfo()->hits();
273 for (UInt_t j=0; j<hvec.size(); j++) {
274 if (hvec[j]->detector() == kTpcId) {
276 if (! tpcHit)
continue;
277 cout << *tpcHit << endl;
279 cout << *hvec[j] << endl;
285 cout <<
"Event: Vertex Not Found" << endl;
289 void StAnalysisMaker::PrintTpcHits(Int_t sector, Int_t row, Int_t plot, Int_t IdTruth) {
293 Float_t sector,row,x,y,z,q,adc,pad,timebucket,IdTruth,xL,yL,zL;
295 static const Char_t *vname =
"sector:row:x:y:z:q:adc:pad:timebucket:IdTruth"
296 #ifdef __TPC_LOCAL_COORDINATES__
301 static TNtuple *Nt = 0;
302 if (plot && Nt == 0) {
303 TFile *tf = StMaker::GetTopChain()->GetTFile();
304 if (tf) {tf->cd(); Nt =
new TNtuple(
"TpcHit",
"TpcHit",vname);}
306 StEvent* pEvent = (
StEvent*) StMaker::GetChain()->GetInputDS(
"StEvent");
307 if (!pEvent) { cout <<
"Can't find StEvent" << endl;
return;}
309 Int_t TotalNoOfTpcHits = 0;
311 if (! TpcHitCollection) { cout <<
"No TPC Hit Collection" << endl;
return;}
312 UInt_t numberOfSectors = TpcHitCollection->numberOfSectors();
313 for (UInt_t i = 0; i< numberOfSectors; i++) {
314 if (sector == 0 || (Int_t) i+1 == sector) {
316 if (sectorCollection) {
317 Int_t numberOfPadrows = sectorCollection->numberOfPadrows();
319 for (
int j = 0; j< numberOfPadrows; j++) {
320 if (row == 0 || j+1 == row) {
323 StSPtrVecTpcHit &hits = rowCollection->hits();
324 #if ROOT_VERSION_CODE < 334081
325 Long_t NoHits = hits.size();
326 TArrayL idxT(NoHits); Long_t *idx = idxT.GetArray();
328 Long64_t NoHits = hits.size();
329 TArrayL64 idxT(NoHits); Long64_t *idx = idxT.GetArray();
331 if (! NoHits)
continue;
332 TotalNoOfTpcHits += NoHits;
334 TArrayD dT(NoHits); Double_t *d = dT.GetArray();
335 for (Long64_t k = 0; k < NoHits; k++) {
345 if (NoHits > 1) TMath::Sort(NoHits,d,idx,kFALSE);
347 for (Long64_t k = 0; k < NoHits; k++) {
354 if (! tpcHit)
continue;
355 if (IdTruth >= 0 && tpcHit->idTruth() != IdTruth)
continue;
356 if (! plot) tpcHit->Print();
360 if (plot == 2 && TMath::Abs(xyz.z()) < 195.0)
continue;
361 #ifdef __TPC_LOCAL_COORDINATES__
365 tran(glob,lTpc,i+1,j+1);
366 BPoint.xL = lTpc.position().x();
367 BPoint.yL = lTpc.position().y();
368 BPoint.zL = lTpc.position().z();
375 BPoint.q = 1.e6*tpcHit->charge();
376 BPoint.adc = tpcHit->adc();
377 BPoint.pad = tpcHit->pad();
378 BPoint.timebucket = tpcHit->timeBucket();
379 BPoint.IdTruth = tpcHit->idTruth();
380 Nt->Fill(&BPoint.sector);
391 cout <<
"TotalNoOfTpcHits = " << TotalNoOfTpcHits << endl;
394 void StAnalysisMaker::PrintEmcHits(Int_t det, Int_t mod,
const Option_t *opt) {
396 StEvent* pEvent = (
StEvent*) StMaker::GetChain()->GetInputDS(
"StEvent");
397 if (!pEvent) { cout <<
"Can't find StEvent" << endl;
return;}
399 if (! emccol) { cout <<
"No Emc Hit Collection" << endl;
return;}
401 Int_t d1 = 0, d2 = 7;
402 if (det >= 0 && det <= 7) {d1 = d2 = det;}
403 for(Int_t d = d1; d <= d2; d++) {
404 StDetectorId
id =
static_cast<StDetectorId
>(d+kBarrelEmcTowerId);
405 if (
id != kBarrelEmcTowerId &&
id != kEndcapEmcTowerId &&
406 ! Opt.Contains(
"Pre",TString::kIgnoreCase))
continue;
410 if (d > 3) maxMod = 14;
412 if (mod > 0 and mod < maxMod) {j1 = maxMod = mod;}
414 if (Opt.Contains(
"Adc",TString::kIgnoreCase)) {
415 for(Int_t j = j1; j < maxMod; j++) {
418 const StSPtrVecEmcRawHit& rawHit=module->hits();
419 Int_t nhits = (Int_t) rawHit.size();
420 for(Int_t k = 0; k < nhits; k++)
if (rawHit[k]->energy() > 0) cout << DetectorName(
id) <<
"\t" << *rawHit[k] << endl;
424 if (Opt.Contains(
"Clu",TString::kIgnoreCase)) {
427 Int_t NoCls = cl->numberOfClusters();
429 const StSPtrVecEmcCluster& clusters = cl->clusters();
430 for (Int_t i = 0; i < NoCls; i++) {
431 if (clusters[i]->energy() > 0) cout << DetectorName(
id) <<
"\t" << *clusters[i] << endl;
438 if (Opt.Contains(
"Point",TString::kIgnoreCase)) {
439 const StSPtrVecEmcPoint& bp = emccol->barrelPoints();
440 const StSPtrVecEmcPoint& ep = emccol->endcapPoints();
441 for (Int_t i = 0; i < 2; i++) {
442 const StSPtrVecEmcPoint& p = (i == 0) ? bp : ep;
443 Int_t np = (Int_t) p.size();
445 cout <<
"Found " << np <<
" Points in ";
446 if (! i) cout <<
"Barrel";
447 else cout <<
"Encap";
449 for (Int_t j = 0; j < np; j++) {
450 cout << *p[j] << endl;
457 void StAnalysisMaker::PrintSvtHits() {
460 StEvent* pEvent = (
StEvent*) StMaker::GetChain()->GetInputDS(
"StEvent");
464 if ( primaryVertex) {
467 cout <<
"primaryVertex \t" << primXYZ.x() <<
"\t" << primXYZ.y() <<
"\t" << primXYZ.z() << endl;
469 Int_t TotalNoOfSvtHits = 0;
471 if (! SvtHitCollection) { cout <<
"No SVT Hit Collection" << endl;
return;}
472 UInt_t numberOfBarrels = SvtHitCollection->numberOfBarrels();
474 for ( i = 0; i< numberOfBarrels; i++) {
476 if (barrelCollection) {
477 UInt_t numberOfLadders = barrelCollection->numberOfLadders();
479 for (j = 0; j< numberOfLadders; j++) {
481 if (ladderCollection) {
482 UInt_t numberOfWafers = ladderCollection->numberOfWafers();
483 for (k = 0; k < numberOfWafers; k++) {
485 StSPtrVecSvtHit &hits = waferCollection->hits();
486 UInt_t NoHits = hits.size();
487 for (l = 0; l < NoHits; l++) {
500 cout <<
"Total no. of Svt Hits " << TotalNoOfSvtHits << endl;
503 void StAnalysisMaker::PrintSsdHits() {
506 StEvent* pEvent = (
StEvent*) StMaker::GetChain()->GetInputDS(
"StEvent");
510 if ( primaryVertex) {
513 cout <<
"primaryVertex \t" << primXYZ.x() <<
"\t" << primXYZ.y() <<
"\t" << primXYZ.z() << endl;
517 if (! SsdHitCollection) { cout <<
"No SSD Hit Collection" << endl;
return;}
518 UInt_t numberOfLadders = SsdHitCollection->numberOfLadders();
520 for ( i = 0; i< numberOfLadders; i++) {
522 if (ladderCollection) {
523 UInt_t numberOfWafers = ladderCollection->numberOfWafers();
524 for (k = 0; k < numberOfWafers; k++) {
526 StSPtrVecSsdHit &hits = waferCollection->hits();
527 UInt_t NoHits = hits.size();
528 for (l = 0; l < NoHits; l++) {
539 void StAnalysisMaker::PrintSstHits() {
542 StEvent* pEvent = (
StEvent*) StMaker::GetChain()->GetInputDS(
"StEvent");
546 if ( primaryVertex) {
549 cout <<
"primaryVertex \t" << primXYZ.x() <<
"\t" << primXYZ.y() <<
"\t" << primXYZ.z() << endl;
553 if (! SstHitCollection) { cout <<
"No SST Hit Collection" << endl;
return;}
554 UInt_t numberOfLadders = SstHitCollection->numberOfLadders();
556 for ( i = 0; i< numberOfLadders; i++) {
558 if (ladderCollection) {
559 UInt_t numberOfWafers = ladderCollection->numberOfWafers();
560 for (k = 0; k < numberOfWafers; k++) {
562 StSPtrVecSstHit &hits = waferCollection->hits();
563 UInt_t NoHits = hits.size();
564 for (l = 0; l < NoHits; l++) {
575 void StAnalysisMaker::PrintToFHits() {
577 StEvent* pEvent = (
StEvent*) StMaker::GetChain()->GetInputDS(
"StEvent");
580 if (! tof) {LOG_QA <<
"No BToF collection" << endm;
return;}
581 else {LOG_QA <<
"BToF collection";}
582 if (tof->tofHeader() && tof->tofHeader()->vpdVz() > -250) {
583 LOG_QA <<
" VpdZ:" << Form(
"%7.2f",tof->tofHeader()->vpdVz());
586 const StSPtrVecBTofHit& tofHits = tof->tofHits();
587 for(
size_t i=0;i<tofHits.size();i++) {
590 LOG_QA << *aHit << endm;
594 void StAnalysisMaker::PrintRnDHits() {
597 StEvent* pEvent = (
StEvent*) StMaker::GetChain()->GetInputDS(
"StEvent");
601 if ( primaryVertex) {
604 cout <<
"primaryVertex \t" << primXYZ.x() <<
"\t" << primXYZ.y() <<
"\t" << primXYZ.z() << endl;
608 if (! RnDHitCollection) { cout <<
"No RND Hit Collection" << endl;
return;}
609 StSPtrVecRnDHit &hits = RnDHitCollection->hits();
610 UInt_t NoHits = hits.size();
611 for (l = 0; l < NoHits; l++) {
616 printf(
"l:%2i w:%2i",i+1,k+1);
617 printf(
" x: %8.3f y: %8.3f z: %8.3f ", P.x(), P.y(), P.z());
618 printf(
"l:%2i w:%2i",
619 hit->ladder(), hit->wafer());
620 printf(
" Id: %4i Q: %4i",hit->idTruth(), hit->qaTruth());
621 printf(
" Flag: %4i Fit: %3i",hit->flag(), hit->usedInFit());
627 void StAnalysisMaker::summarizeEvent(
StEvent *event, Int_t mEventCounter) {
628 if (! event)
event = (
StEvent*) StMaker::GetChain()->GetInputDS(
"StEvent");
629 static const UInt_t NoFitPointCutForGoodTrack = StVertex::NoFitPointCutForGoodTrack();
630 LOG_QA <<
"+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-" << endm
631 <<
"StAnalysisMaker, Reading Event: " << mEventCounter
632 <<
" Type: " <<
event->type()
633 <<
" Run: " <<
event->runId()
634 <<
" EventId: " <<
event->id();
637 const StTriggerId* nominal = triggerCol->nominal();
639 UInt_t maxTriggers = nominal->maxTriggerIds();
640 LOG_QA <<
" TriggerIds: ";
641 for (UInt_t i = 0; i < maxTriggers; i++) {
642 if (nominal->triggerId(i)) {LOG_QA << nominal->triggerId(i) <<
"|";}
647 StSPtrVecTrackNode& trackNode =
event->trackNodes();
648 UInt_t nTracks = trackNode.size();
650 UInt_t nGoodTracks = 0;
651 UInt_t nGoodFtpcTracks = 0;
652 UInt_t nBeamBackTracks = 0;
653 UInt_t nGoodBeamBackTracks = 0;
654 UInt_t nShortTrackForEEmc = 0;
655 UInt_t nShortTrackForETOF = 0;
657 UInt_t promptTracks = 0;
658 UInt_t crossMembrane = 0;
659 UInt_t nToFMatched = 0;
660 UInt_t nBEmcMatched = 0;
661 UInt_t nEEmcMatched = 0;
662 UInt_t nWestTpcOnly = 0;
663 UInt_t nEastTpcOnly = 0;
665 for (UInt_t i=0; i < nTracks; i++) {
666 node = trackNode[i];
if (!node)
continue;
668 if (! gTrack)
continue;
669 if (gTrack->flag() < 0)
continue;
670 if (TMath::Abs(gTrack->flag())%100 == 11) nShortTrackForEEmc++;
671 if (TMath::Abs(gTrack->flag())%100 == 12) nShortTrackForETOF++;
672 if (gTrack->flag()/100 == 9) {
674 if (! gTrack->bad()) nGoodBeamBackTracks++;
676 if (gTrack->flag() >= 700 && gTrack->flag() < 900) nGoodFtpcTracks++;
677 if (gTrack->isPostXTrack()) pcTracks++;
678 if (gTrack->isPromptTrack()) promptTracks++;
679 if (gTrack->isMembraneCrossingTrack()) crossMembrane++;
680 if (gTrack->isToFMatched()) nToFMatched++;
681 if (gTrack->isBemcMatched()) nBEmcMatched++;
682 if (gTrack->isEemcMatched() ) nEEmcMatched++;
683 if (gTrack->fitTraits().numberOfFitPoints() < NoFitPointCutForGoodTrack)
continue;
684 if (gTrack->isWestTpcOnly()) nWestTpcOnly++;
685 if (gTrack->isEastTpcOnly()) nEastTpcOnly++;
688 LOG_QA <<
"# track nodes: \t"
689 << nTracks <<
": good globals with NFitP>="<< NoFitPointCutForGoodTrack <<
": " << nGoodTracks;
690 if (nGoodFtpcTracks) {LOG_QA <<
": Ftpc tracks : " << nGoodFtpcTracks;}
692 if (nBeamBackTracks) {LOG_QA <<
"BeamBack tracks: " << nBeamBackTracks <<
": good ones: " << nGoodBeamBackTracks;}
693 if (nShortTrackForEEmc) {LOG_QA <<
": Short tracks pointing to EEMC : " << nShortTrackForEEmc;}
694 if (nShortTrackForETOF) {LOG_QA <<
": Short tracks pointing to ETOF : " << nShortTrackForETOF;}
695 if (nBeamBackTracks || nShortTrackForEEmc || nShortTrackForETOF) {LOG_QA << endm;}
696 LOG_QA <<
"post (C)rossing tracks :" << pcTracks <<
": (P)rompt:" << promptTracks
697 <<
": (X) membrane :" << crossMembrane
698 <<
"(T)of/ctb matches:" << nToFMatched <<
" :Emc matches(B/E): " << nBEmcMatched <<
"/" << nEEmcMatched
699 <<
" :Only W:" << nWestTpcOnly <<
" E:" << nEastTpcOnly;
700 if (event->btofCollection()) {
701 if (event->btofCollection()->tofHeader() &&
event->btofCollection()->tofHeader()->vpdVz() > -250){
702 LOG_QA <<
" VpdZ:" << Form(
"%7.2f",event->btofCollection()->tofHeader()->vpdVz());
705 if (event->triggerData()) {
706 LOG_QA <<
": ZdcZ:" << Form(
"%7.2f",event->triggerData()->zdcVertexZ());
714 <<
",MessageKey=" <<
"'nodes all'"
715 <<
",MessageValue='" << nTracks
723 <<
",MessageKey=" <<
"'nodes good'"
724 <<
",MessageValue='" << nGoodTracks
729 Int_t NoVertexPos = 0;
730 for (Int_t ipr=0;(pVertex=
event->primaryVertex(ipr));ipr++) {
731 if (pVertex->ranking() > 0) NoVertexPos++;
733 LOG_QA <<
"StageID='3'" <<
",MessageKey=" <<
"'No. of Vertices with positive rank'" <<
",MessageValue='" << NoVertexPos <<
"'" << endm;
734 for (Int_t ipr=0;(pVertex=
event->primaryVertex(ipr));ipr++) {
735 #ifdef StTrackMassFit_hh
736 Int_t key = pVertex->key();
737 if (key <= 0) pVertex->setKey(ipr);
738 LOG_QA << *pVertex << endm;
740 LOG_QA << Form(
"#V[%3i]",ipr) << *pVertex << endm;
743 if (pVertex->numberOfDaughters()) {
747 <<
",MessageKey=" <<
"'primary all'"
748 <<
",MessageValue='" << pVertex->numberOfDaughters()
751 if (pVertex->numberOfGoodTracks()) {
755 <<
",MessageKey=" <<
"'primary good'"
756 <<
",MessageValue='" << pVertex->numberOfGoodTracks()
760 if (event->v0Vertices() .size()) {
761 LOG_QA <<
"# V0 vertices: " <<
event->v0Vertices().size() << endm;
762 StSPtrVecV0Vertex& v0Vertices =
event->v0Vertices();
763 Int_t nv0 = v0Vertices.size();
764 for (Int_t iv0=0;iv0<nv0;iv0++) {
766 if (! v0Vertex)
continue;
767 #ifdef StTrackMassFit_hh
768 Int_t key = v0Vertex->key();
769 if (key <= 0) key = iv0;
770 LOG_QA << Form(
"#V[%3i]",key) << *v0Vertex << endm;
772 LOG_QA << *v0Vertex << endm;
777 if (event->xiVertices() .size()) {
778 LOG_QA <<
"# Xi vertices: " <<
event->xiVertices().size() << endm;
780 if (event->kinkVertices().size()) { LOG_QA <<
"# Kink vertices: "
781 <<
event->kinkVertices().size() << endm;
784 if (event->v0Vertices() .size()) {
788 <<
",MessageKey=" <<
"'V0Vertices', " <<
"MessageValue=" <<
event->v0Vertices() .size() << endm;
790 if (event->xiVertices() .size()) {
794 <<
",MessageKey=" <<
"'XiVertices', " <<
"MessageValue="<<
event->xiVertices() .size() << endm;
797 if (event->kinkVertices().size()) {
801 <<
",MessageKey=" <<
"'KinkVertices'," <<
"MessageValue="<<
event->kinkVertices().size() << endm;
804 UInt_t TotalNoOfTpcHits = 0, noBadTpcHits = 0, noTpcHitsUsedInFit = 0;
806 if (TpcHitCollection) {
807 UInt_t numberOfSectors = TpcHitCollection->numberOfSectors();
808 for (UInt_t i = 0; i< numberOfSectors; i++) {
810 if (sectorCollection) {
811 Int_t numberOfPadrows = sectorCollection->numberOfPadrows();
812 for (Int_t j = 0; j< numberOfPadrows; j++) {
815 StSPtrVecTpcHit &hits = rowCollection->hits();
816 UInt_t NoHits = hits.size();
817 for (UInt_t k = 0; k < NoHits; k++) {
821 if ( tpcHit->flag()) noBadTpcHits++;
822 if (tpcHit->usedInFit()) noTpcHitsUsedInFit++;
830 if (TotalNoOfTpcHits) {
831 LOG_QA <<
"# TPC hits: " << TotalNoOfTpcHits
832 <<
":\tBad ones (! flag): " << noBadTpcHits
833 <<
":\tUsed in Fit: " << noTpcHitsUsedInFit << endm;
835 UInt_t TotalNoOfSvtHits = 0, noBadSvtHits = 0, noSvtHitsUsedInFit = 0;
839 for (UInt_t barrel=0; barrel<svthits->numberOfBarrels(); ++barrel) {
841 if (!barrelhits)
continue;
842 for (UInt_t ladder=0; ladder<barrelhits->numberOfLadders(); ++ladder) {
844 if (!ladderhits)
continue;
845 for (UInt_t wafer=0; wafer<ladderhits->numberOfWafers(); ++wafer) {
847 if (!waferhits)
continue;
848 const StSPtrVecSvtHit& hits = waferhits->hits();
849 for (const_StSvtHitIterator it=hits.begin(); it!=hits.end(); ++it) {
853 if (hit->flag() >3) noBadSvtHits++;
854 if (hit->usedInFit()) noSvtHitsUsedInFit++;
860 if (TotalNoOfSvtHits) {
861 LOG_QA <<
"# SVT hits: " << TotalNoOfSvtHits
862 <<
":\tBad ones(flag >3): " << noBadSvtHits
863 <<
":\tUsed in Fit: " << noSvtHitsUsedInFit << endm;
865 UInt_t TotalNoOfPxlHits = 0, noBadPxlHits = 0, noPxlHitsUsedInFit = 0;
869 for (UInt_t sector=0; sector<pxlhits->numberOfSectors(); ++sector) {
871 if (!sectorhits)
continue;
872 for (UInt_t ladder=0; ladder<sectorhits->numberOfLadders(); ++ladder) {
874 if (!ladderhits)
continue;
875 for (UInt_t sensor=0; sensor<ladderhits->numberOfSensors(); ++sensor) {
877 if (!sensorhits)
continue;
878 const StSPtrVecPxlHit& hits = sensorhits->hits();
879 for (const_StPxlHitIterator it=hits.begin(); it!=hits.end(); ++it) {
883 if (hit->flag() >3) noBadPxlHits++;
884 if (hit->usedInFit()) noPxlHitsUsedInFit++;
890 if (TotalNoOfPxlHits) {
891 LOG_QA <<
"# PXL hits: " << TotalNoOfPxlHits
892 <<
":\tBad ones(flag >3): " << noBadPxlHits
893 <<
":\tUsed in Fit: " << noPxlHitsUsedInFit << endm;
895 UInt_t TotalNoOfIstHits = 0, noBadIstHits = 0, noIstHitsUsedInFit = 0;
901 if (!ladderhits)
continue;
904 if (!sensorhits)
continue;
905 const StSPtrVecIstHit& hits = sensorhits->hits();
906 for (const_StIstHitIterator it=hits.begin(); it!=hits.end(); ++it) {
910 if (hit->flag() >3) noBadIstHits++;
911 if (hit->usedInFit()) noIstHitsUsedInFit++;
916 if (TotalNoOfIstHits) {
917 LOG_QA <<
"# IST hits: " << TotalNoOfIstHits
918 <<
":\tBad ones(flag >3): " << noBadIstHits
919 <<
":\tUsed in Fit: " << noIstHitsUsedInFit << endm;
922 UInt_t TotalNoOfSsdHits = 0, noBadSsdHits = 0, noSsdHitsUsedInFit = 0;
926 for (UInt_t ladder=0; ladder<ssdhits->numberOfLadders(); ++ladder) {
928 if (!ladderhits)
continue;
929 for (UInt_t wafer=0; wafer<ladderhits->numberOfWafers(); ++wafer) {
931 if (!waferhits)
continue;
932 const StSPtrVecSsdHit& hits = waferhits->hits();
933 for (const_StSsdHitIterator it=hits.begin(); it!=hits.end(); ++it) {
937 if (hit->flag() >3) noBadSsdHits++;
938 if (hit->usedInFit()) noSsdHitsUsedInFit++;
943 if (TotalNoOfSsdHits) {
944 LOG_QA <<
"# SSD hits: " << TotalNoOfSsdHits
945 <<
":\tBad ones(flag>3): " << noBadSsdHits
946 <<
":\tUsed in Fit: " << noSsdHitsUsedInFit << endm;
948 UInt_t TotalNoOfSstHits = 0, noBadSstHits = 0, noSstHitsUsedInFit = 0;
952 for (UInt_t ladder=0; ladder<ssthits->numberOfLadders(); ++ladder) {
954 if (!ladderhits)
continue;
955 for (UInt_t wafer=0; wafer<ladderhits->numberOfWafers(); ++wafer) {
957 if (!waferhits)
continue;
958 const StSPtrVecSstHit& hits = waferhits->hits();
959 for (const_StSstHitIterator it=hits.begin(); it!=hits.end(); ++it) {
963 if (hit->flag() >3) noBadSstHits++;
964 if (hit->usedInFit()) noSstHitsUsedInFit++;
969 if (TotalNoOfSstHits) {
970 LOG_QA <<
"# SST hits: " << TotalNoOfSstHits
971 <<
":\tBad ones(flag>3): " << noBadSstHits
972 <<
":\tUsed in Fit: " << noSstHitsUsedInFit << endm;
974 UInt_t TotalNoOfFtpcHits = 0, noBadFtpcHits = 0, noFtpcHitsUsedInFit = 0;
978 for (UInt_t plane=0; plane<ftpchits->numberOfPlanes(); ++plane) {
980 if (!planehits)
continue;
981 for (UInt_t sector=0; sector<planehits->numberOfSectors(); ++sector) {
983 if (!sectorhits)
continue;
984 const StSPtrVecFtpcHit& hits = sectorhits->hits();
985 for (const_StFtpcHitIterator it=hits.begin(); it!=hits.end(); ++it) {
1005 if (! ( hit->flag() & 1 || hit->flag() & (1 << 5))) noBadFtpcHits++;
1006 else if (hit->flag() & (1 << 5)) noFtpcHitsUsedInFit++;
1011 if (TotalNoOfFtpcHits) {
1012 LOG_QA <<
"# FTPC hits: " << TotalNoOfFtpcHits
1013 <<
":\tBad ones(!bit0): " << noBadFtpcHits
1014 <<
":\tUsed in Fit: " << noFtpcHitsUsedInFit << endm;
1019 StSPtrVecRnDHit& hits = rndhits->hits();
1020 Int_t NoHits = rndhits->numberOfHits();
1025 Int_t TotalNoOfHits;
1027 Int_t noHitsUsedInFit;
1029 const Int_t NHtypes = 4;
1030 NoHits_t Hits[7] = {
1031 {kPxlId,
"Hft", 0, 0, 0},
1032 {kIstId,
"Ist", 0, 0, 0},
1033 {kFgtId,
"Fgt", 0, 0, 0},
1034 {kUnknownId,
"UnKnown", 0, 0, 0}
1037 for (Int_t i = 0; i < NoHits; i++) {
1040 for (j = 0; j < NHtypes-1; j++)
if ( Hits[j].kId == hit->detector())
break;
1041 Hits[j].TotalNoOfHits++;
1042 if (hit->flag()) Hits[j].noBadHits++;
1043 if (hit->usedInFit()) Hits[j].noHitsUsedInFit++;
1045 for (Int_t j = 0; j < NHtypes; j++) {
1046 if (Hits[j].TotalNoOfHits) {
1047 LOG_QA <<
"# " << Hits[j].Name <<
" hits: " << Hits[j].TotalNoOfHits
1048 <<
":\tBad ones: " << Hits[j].noBadHits
1049 <<
":\tUsed in Fit: " << Hits[j].noHitsUsedInFit << endm;
1057 const Char_t *Names[2] = {
"EMC ",
"EEMC"};
1058 for (Int_t be = 0; be < 2; be++) {
1061 if (be) {d1 = 4; d2 =7;}
1062 Int_t Adcs[4] = {0, 0, 0, 0};
1063 Int_t Cls[4] = {0, 0, 0, 0};
1064 for(Int_t d = d1; d <= d2; d++) {
1065 StDetectorId
id =
static_cast<StDetectorId
>(d+kBarrelEmcTowerId);
1069 if (d > 3) maxMod = 14;
1070 for(Int_t j = 1; j < maxMod; j++) {
1073 const StSPtrVecEmcRawHit& rawHit=module->hits();
1074 for(UInt_t k=0;k<rawHit.size();k++) {
1075 if (rawHit[k]->energy() <= 0.1)
continue;
1082 Cls[d-d1] = cl->numberOfClusters();
1087 if (! be) np = emccol->barrelPoints().size();
1088 else np = emccol->endcapPoints().size();
1090 Adcs[0] || Adcs[1] || Adcs[2] || Adcs[3] ||
1091 Cls[0] || Cls[1] || Cls[2] || Cls[3] ) {
1092 LOG_QA << Form(
"# %s points:%5i",Names[be],np);
1093 LOG_QA << Form(
": Adc(T/p/E/P) %4i/%4i/%5i/%5i",Adcs[0],Adcs[1],Adcs[2],Adcs[3]);
1094 LOG_QA << Form(
": Cls(T/p/E/P) %4i/%4i/%5i/%5i",Cls[0],Cls[1],Cls[2],Cls[3]);
1101 const StSPtrVecBTofHit& tofHits = tof->tofHits();
1102 if (tofHits.size()) {
1103 Int_t n = tofHits.size();
1105 for(Int_t i=0;i<n;i++) {
1108 if (aHit->associatedTrack()) m++;
1110 LOG_QA << Form(
"# BTof hits:%5i: Matched with tracks:%5i",n,m) << endm;
1115 const StPhmdDetector* pmd_det = pmdcol->detector(StDetectorId(kPhmdId));
1116 const StPhmdDetector* cpv_det = pmdcol->detector(StDetectorId(kPhmdCpvId));
1121 if (pmd_clusters) n = pmd_clusters->numberOfclusters();
1125 if (cpv_clusters) m = cpv_clusters->numberOfclusters();
1127 LOG_QA << Form(
"# Pmd clusters:%5i: Cpv clusters:%5i",n,m) << endm;
1129 if (event->fpdCollection() &&
event->fpdCollection()->numberOfADC()) {
1131 for (UInt_t i = 0; i <
event->fpdCollection()->numberOfADC(); i++) sum += event->fpdCollection()->adc()[i];
1133 LOG_QA <<
"# FPD ADC sum: " << sum << endm;
1135 if (event->fgtCollection()) {
1136 LOG_QA <<
"# FGT hits: " <<
event->fgtCollection()->getNumHits() << endm;
1138 if (event->richCollection() &&
event->richCollection()->getRichHits().size()) {
1139 LOG_QA <<
"# RICH hits: " <<
event->richCollection()->getRichHits().size() << endm;
1141 if (event->numberOfPsds()) {
1142 LOG_QA <<
"# PSDs: " <<
event->numberOfPsds() << endm;
1144 #ifdef _ST_GMT_HIT_H_
1145 if (event->gmtCollection() &&
event->gmtCollection()->getNumHits()) {
1146 LOG_QA <<
"# GMT hits: " <<
event->gmtCollection()->getNumHits()
1147 <<
" points: " <<
event->gmtCollection()->getNumPoints()
1151 if (event->rpsCollection()) {
1152 LOG_QA <<
"# RPS hits: " <<
event->rpsCollection()->clusters().size() << endm;
1155 LOG_QA <<
"*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-" << endm;
const int kIstNumLadders
24 IST Ladders
A typical Analysis Class.
Collection of trigger ids as stored in StEvent.
StAnalysisMaker(const Char_t *name="analysis")
The constructor. Initialize you data members here.
const int kIstNumSensorsPerLadder
6 sensor per one IST Ladder