00001
00002
00003
00004
00005
00006
00007
00008
00009
00025
00026
00027
00028
00029
00030 #include "StAnalysisMaker.h"
00031 #include "StEventTypes.h"
00032 #include "StMessMgr.h"
00033 #include "StDcaGeometry.h"
00034 #if ROOT_VERSION_CODE < 334081
00035 #include "TArrayL.h"
00036 #else
00037 #include "TArrayL64.h"
00038 #endif
00039 #include "TClassTable.h"
00040 #include "TNtuple.h"
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 ClassImp(StAnalysisMaker)
00063
00064
00065
00066 StAnalysisMaker::StAnalysisMaker(const Char_t *name) : StMaker(name)
00067 {
00068 mEventCounter = 0;
00069 }
00070 Int_t StAnalysisMaker::Finish() {
00071
00072
00073
00074
00075 gMessMgr->Info() << "StAnalysisMaker::Finish() "
00076 << "Processed " << mEventCounter << " events." << endm;
00077
00078 return kStOK;
00079 }
00080
00085 Int_t StAnalysisMaker::Make() {
00086 mEventCounter++;
00087
00088
00089
00090
00091 StEvent* event;
00092 event = (StEvent *) GetInputDS("StEvent");
00093 if (!event){
00094 gMessMgr->Warning() << "StAnalysisMaker::Make : No StEvent" << endm;
00095 return kStOK;
00096 }
00097
00098
00099
00100
00101
00102
00103 summarizeEvent(event, mEventCounter);
00104
00105
00106
00107
00108
00109 if (!accept(event)){
00110 gMessMgr->Warning() << "StAnalysisMaker::Make : Event was not accepted" << endm;
00111 return kStOK;
00112 }
00113 return kStOK;
00114 }
00115
00116 bool StAnalysisMaker::accept(StEvent* event)
00117 {
00118
00119
00120
00121
00122
00123 return event->primaryVertex();
00124 }
00125
00126 bool StAnalysisMaker::accept(StTrack* track)
00127 {
00128
00129
00130
00131
00132
00133
00134
00135 return track && track->flag() >= 0;
00136 }
00137
00138 void StAnalysisMaker::PrintStEvent(TString opt) {
00139
00140 StEvent* pEvent = (StEvent*) StMaker::GetChain()->GetInputDS("StEvent");
00141 if (!pEvent) return;
00142 cout << "Event: Run "<< pEvent->runId() << " Event No: " << pEvent->id() << endl;
00143 UInt_t NpVX = pEvent->numberOfPrimaryVertices();
00144 if (NpVX) {
00145 if (opt.Contains("v",TString::kIgnoreCase)) {
00146 for (UInt_t i = 0; i < NpVX; i++) {
00147 const StPrimaryVertex *vx = pEvent->primaryVertex(i);
00148 cout << Form("Vertex: %3i ",i) << *vx << endl;
00149 if (opt.Contains("p",TString::kIgnoreCase)) {
00150 UInt_t nDaughters = vx->numberOfDaughters();
00151 for (UInt_t j = 0; j < nDaughters; j++) {
00152 StPrimaryTrack* pTrack = (StPrimaryTrack*) vx->daughter(j);
00153 if (! pTrack) continue;
00154 cout << *pTrack << endl;
00155 }
00156 }
00157 }
00158 }
00159 } else {
00160 cout << "Event: Vertex Not Found" << endl;
00161 }
00162 if (opt.Contains("g",TString::kIgnoreCase)) {
00163 StSPtrVecTrackNode& trackNode = pEvent->trackNodes();
00164 UInt_t nTracks = trackNode.size();
00165 StTrackNode *node = 0;
00166 cout << " Global tracks " << endl;
00167 for (UInt_t i=0; i < nTracks; i++) {
00168 node = trackNode[i]; if (!node) continue;
00169 StGlobalTrack* gTrack = static_cast<StGlobalTrack*>(node->track(global));
00170 cout << *gTrack << endl;
00171 }
00172 }
00173 }
00174
00175 void StAnalysisMaker::PrintTpcHits(Int_t sector, Int_t row, Bool_t plot, Int_t IdTruth) {
00176 struct BPoint_t {
00177 Float_t sector, row, x, y, z, q;
00178 };
00179
00180 StEvent* pEvent = (StEvent*) StMaker::GetChain()->GetInputDS("StEvent");
00181 if (!pEvent) { cout << "Can't find StEvent" << endl; return;}
00182
00183 Int_t TotalNoOfTpcHits = 0;
00184 StTpcHitCollection* TpcHitCollection = pEvent->tpcHitCollection();
00185 if (! TpcHitCollection) { cout << "No TPC Hit Collection" << endl; return;}
00186 UInt_t numberOfSectors = TpcHitCollection->numberOfSectors();
00187 for (UInt_t i = 0; i< numberOfSectors; i++) {
00188 if (sector == 0 || (Int_t) i+1 == sector) {
00189 StTpcSectorHitCollection* sectorCollection = TpcHitCollection->sector(i);
00190 if (sectorCollection) {
00191 Int_t numberOfPadrows = sectorCollection->numberOfPadrows();
00192
00193 for (int j = 0; j< numberOfPadrows; j++) {
00194 if (row == 0 || j+1 == row) {
00195 StTpcPadrowHitCollection *rowCollection = sectorCollection->padrow(j);
00196 if (rowCollection) {
00197 StSPtrVecTpcHit &hits = rowCollection->hits();
00198 #if ROOT_VERSION_CODE < 334081
00199 Long_t NoHits = hits.size();
00200 TArrayL idxT(NoHits); Long_t *idx = idxT.GetArray();
00201 #else
00202 Long64_t NoHits = hits.size();
00203 TArrayL64 idxT(NoHits); Long64_t *idx = idxT.GetArray();
00204 #endif
00205 TotalNoOfTpcHits += NoHits;
00206 TArrayD dT(NoHits); Double_t *d = dT.GetArray();
00207 for (Long64_t k = 0; k < NoHits; k++) {
00208 StTpcHit *tpcHit = static_cast<StTpcHit *> (hits[k]);
00209 const StThreeVectorF& xyz = tpcHit->position();
00210 d[k] = xyz.z();
00211 }
00212 TMath::Sort(NoHits,d,idx,kFALSE);
00213 for (Long64_t k = 0; k < NoHits; k++) {
00214 Int_t l = idx[k];
00215 StTpcHit *tpcHit = static_cast<StTpcHit *> (hits[l]);
00216 if (! tpcHit) continue;
00217 if (IdTruth >= 0 && tpcHit->idTruth() != IdTruth) continue;
00218 tpcHit->Print();
00219 }
00220 }
00221 }
00222 }
00223 }
00224 }
00225
00226 }
00227 cout << "TotalNoOfTpcHits = " << TotalNoOfTpcHits << endl;
00228 }
00229
00230 void StAnalysisMaker::PrintSvtHits() {
00231 UInt_t i,j,k,l;
00232
00233 StEvent* pEvent = (StEvent*) StMaker::GetChain()->GetInputDS("StEvent");
00234 if (!pEvent) return;
00235
00236 StPrimaryVertex *primaryVertex = pEvent->primaryVertex();
00237 if ( primaryVertex) {
00238 const StThreeVectorF &primXYZ = primaryVertex->position();
00239
00240 cout << "primaryVertex \t" << primXYZ.x() << "\t" << primXYZ.y() << "\t" << primXYZ.z() << endl;
00241 }
00242 Int_t TotalNoOfSvtHits = 0;
00243 StSvtHitCollection* SvtHitCollection = pEvent->svtHitCollection();
00244 if (! SvtHitCollection) { cout << "No SVT Hit Collection" << endl; return;}
00245 UInt_t numberOfBarrels = SvtHitCollection->numberOfBarrels();
00246
00247 for ( i = 0; i< numberOfBarrels; i++) {
00248 StSvtBarrelHitCollection* barrelCollection = SvtHitCollection->barrel(i);
00249 if (barrelCollection) {
00250 UInt_t numberOfLadders = barrelCollection->numberOfLadders();
00251
00252 for (j = 0; j< numberOfLadders; j++) {
00253 StSvtLadderHitCollection *ladderCollection = barrelCollection->ladder(j);
00254 if (ladderCollection) {
00255 UInt_t numberOfWafers = ladderCollection->numberOfWafers();
00256 for (k = 0; k < numberOfWafers; k++) {
00257 StSvtWaferHitCollection* waferCollection = ladderCollection->wafer(k);
00258 StSPtrVecSvtHit &hits = waferCollection->hits();
00259 UInt_t NoHits = hits.size();
00260 for (l = 0; l < NoHits; l++) {
00261 StSvtHit *hit = hits[l];
00262 if (hit) {
00263
00264 TotalNoOfSvtHits++;
00265 hit->Print();
00266 }
00267 }
00268 }
00269 }
00270 }
00271 }
00272 }
00273 cout << "Total no. of Svt Hits " << TotalNoOfSvtHits << endl;
00274 }
00275
00276 void StAnalysisMaker::PrintSsdHits() {
00277 UInt_t i,k,l;
00278
00279 StEvent* pEvent = (StEvent*) StMaker::GetChain()->GetInputDS("StEvent");
00280 if (!pEvent) return;
00281
00282 StPrimaryVertex *primaryVertex = pEvent->primaryVertex();
00283 if ( primaryVertex) {
00284 const StThreeVectorF &primXYZ = primaryVertex->position();
00285
00286 cout << "primaryVertex \t" << primXYZ.x() << "\t" << primXYZ.y() << "\t" << primXYZ.z() << endl;
00287 }
00288
00289 StSsdHitCollection* SsdHitCollection = pEvent->ssdHitCollection();
00290 if (! SsdHitCollection) { cout << "No SSD Hit Collection" << endl; return;}
00291 UInt_t numberOfLadders = SsdHitCollection->numberOfLadders();
00292
00293 for ( i = 0; i< numberOfLadders; i++) {
00294 StSsdLadderHitCollection* ladderCollection = SsdHitCollection->ladder(i);
00295 if (ladderCollection) {
00296 UInt_t numberOfWafers = ladderCollection->numberOfWafers();
00297 for (k = 0; k < numberOfWafers; k++) {
00298 StSsdWaferHitCollection* waferCollection = ladderCollection->wafer(k);
00299 StSPtrVecSsdHit &hits = waferCollection->hits();
00300 UInt_t NoHits = hits.size();
00301 for (l = 0; l < NoHits; l++) {
00302 StSsdHit *hit = hits[l];
00303 if (hit) {
00304 hit->Print("");
00305 }
00306 }
00307 }
00308 }
00309 }
00310 }
00311
00312 void StAnalysisMaker::PrintRnDHits() {
00313 UInt_t i=0,k=0,l;
00314
00315 StEvent* pEvent = (StEvent*) StMaker::GetChain()->GetInputDS("StEvent");
00316 if (!pEvent) return;
00317
00318 StPrimaryVertex *primaryVertex = pEvent->primaryVertex();
00319 if ( primaryVertex) {
00320 const StThreeVectorF &primXYZ = primaryVertex->position();
00321
00322 cout << "primaryVertex \t" << primXYZ.x() << "\t" << primXYZ.y() << "\t" << primXYZ.z() << endl;
00323 }
00324
00325 StRnDHitCollection* RnDHitCollection = pEvent->rndHitCollection();
00326 if (! RnDHitCollection) { cout << "No RND Hit Collection" << endl; return;}
00327 StSPtrVecRnDHit &hits = RnDHitCollection->hits();
00328 UInt_t NoHits = hits.size();
00329 for (l = 0; l < NoHits; l++) {
00330 StRnDHit *hit = hits[l];
00331 if (hit) {
00332
00333 const StThreeVectorF &P = hit->position();
00334 printf("l:%2i w:%2i",i+1,k+1);
00335 printf(" x: %8.3f y: %8.3f z: %8.3f ", P.x(), P.y(), P.z());
00336 printf("l:%2i w:%2i",
00337 hit->ladder(), hit->wafer());
00338 printf(" Id: %4i Q: %4i",hit->idTruth(), hit->qaTruth());
00339 printf(" Flag: %4i Fit: %3i",hit->flag(), hit->usedInFit());
00340 printf("\n");
00341 }
00342 }
00343 }
00344
00345 void StAnalysisMaker::summarizeEvent(StEvent *event, Int_t mEventCounter) {
00346 if (! event) event = (StEvent*) StMaker::GetChain()->GetInputDS("StEvent");
00347 static const UInt_t NoFitPointCutForGoodTrack = StVertex::NoFitPointCutForGoodTrack();
00348 LOG_QA << "StAnalysisMaker, Reading Event: " << mEventCounter
00349 << " Type: " << event->type()
00350 << " Run: " << event->runId()
00351 << " EventId: " << event->id() << endm;
00352
00353 StSPtrVecTrackNode& trackNode = event->trackNodes();
00354 UInt_t nTracks = trackNode.size();
00355 StTrackNode *node = 0;
00356 UInt_t nGoodTracks = 0;
00357 UInt_t nGoodFtpcTracks = 0;
00358 UInt_t nBeamBackTracks = 0;
00359 UInt_t nGoodBeamBackTracks = 0;
00360 UInt_t nShortTrackForEEmc = 0;
00361 UInt_t pcTracks = 0;
00362 UInt_t promptTracks = 0;
00363 UInt_t crossMembrane = 0;
00364 UInt_t nToFMatched = 0;
00365 UInt_t nEmcMatched = 0;
00366 StGlobalTrack* gTrack = 0;
00367 for (UInt_t i=0; i < nTracks; i++) {
00368 node = trackNode[i]; if (!node) continue;
00369 gTrack = static_cast<StGlobalTrack*>(node->track(global));
00370 if (! gTrack) continue;
00371 if (gTrack->flag() < 0) continue;
00372 if (TMath::Abs(gTrack->flag())%100 == 11) nShortTrackForEEmc++;
00373 if (gTrack->flag()/100 == 9) {
00374 nBeamBackTracks++;
00375 if (! gTrack->bad()) nGoodBeamBackTracks++;
00376 }
00377 if (gTrack->flag() >= 700 && gTrack->flag() < 900) nGoodFtpcTracks++;
00378 if (gTrack->isPostXTrack()) pcTracks++;
00379 if (gTrack->isPromptTrack()) promptTracks++;
00380 if (gTrack->isMembraneCrossingTrack()) crossMembrane++;
00381 if (gTrack->isToFMatched()) nToFMatched++;
00382 if (gTrack->isBemcMatched() ||
00383 gTrack->isEemcMatched() ) nEmcMatched++;
00384 if (gTrack->fitTraits().numberOfFitPoints() < NoFitPointCutForGoodTrack) continue;
00385 nGoodTracks++;
00386 }
00387 LOG_QA << "# track nodes: \t"
00388 << nTracks << ":\tgood globals with NFitP>="<< NoFitPointCutForGoodTrack << ":\t" << nGoodTracks
00389 << ":\tFtpc tracks :\t" << nGoodFtpcTracks << endm;
00390 LOG_QA << "BeamBack tracks:\t" << nBeamBackTracks << ":\tgood ones:\t" << nGoodBeamBackTracks
00391 << ":\tShort tracks pointing to EEMC :\t" << nShortTrackForEEmc << endm;
00392 LOG_QA << "post (C)rossing tracks :" << pcTracks << ":\t(P)rompt:" << promptTracks << ":\t(X) membrane :" << crossMembrane
00393 << ":\t(T)of/ctb matches:" << nToFMatched << ":\t(E)mc matches: " << nEmcMatched
00394 << endm;
00395
00396 if (nTracks) {
00397
00398 LOG_QA
00399 << "StageID='3'"
00400 << ",MessageKey=" << "'nodes all'"
00401 << ",MessageValue='" << nTracks
00402 << "'" << endm;
00403 }
00404
00405 if (nGoodTracks) {
00406
00407 LOG_QA
00408 << "StageID='3'"
00409 << ",MessageKey=" << "'nodes good'"
00410 << ",MessageValue='" << nGoodTracks
00411 << "'" << endm;
00412 }
00413
00414 StPrimaryVertex *pVertex=0;
00415 for (Int_t ipr=0;(pVertex=event->primaryVertex(ipr));ipr++) {
00416 LOG_QA << Form("#V[%3i]",ipr) << *pVertex << endm;
00417
00418 if (pVertex->numberOfDaughters()) {
00419
00420 LOG_QA
00421 << "StageID='3'"
00422 << ",MessageKey=" << "'primary all'"
00423 << ",MessageValue='" << pVertex->numberOfDaughters()
00424 << "'" << endm;
00425 }
00426 if (pVertex->numberOfGoodTracks()) {
00427
00428 LOG_QA
00429 << "StageID='3'"
00430 << ",MessageKey=" << "'primary good'"
00431 << ",MessageValue='" << pVertex->numberOfGoodTracks()
00432 << "'" << endm;
00433 }
00434 }
00435 if (event->v0Vertices() .size()) {
00436 LOG_QA << "# V0 vertices: "
00437 << event->v0Vertices().size() << endm;
00438 }
00439 if (event->xiVertices() .size()) {
00440 LOG_QA << "# Xi vertices: "
00441 << event->xiVertices().size() << endm;
00442 }
00443 if (event->kinkVertices().size()) {
00444 LOG_QA << "# Kink vertices: "
00445 << event->kinkVertices().size() << endm;
00446 }
00447
00448 if (event->v0Vertices() .size()) {
00449
00450 LOG_QA
00451 << "StageID='3'"
00452 << ",MessageKey=" << "'V0Vertices', " << "MessageValue=" << event->v0Vertices() .size() << endm;
00453 }
00454 if (event->xiVertices() .size()) {
00455
00456 LOG_QA
00457 << "StageID='3'"
00458 << ",MessageKey=" << "'XiVertices', " << "MessageValue="<< event->xiVertices() .size() << endm;
00459 }
00460
00461 if (event->kinkVertices().size()) {
00462
00463 LOG_QA
00464 << "StageID='3'"
00465 << ",MessageKey=" << "'KinkVertices'," << "MessageValue="<< event->kinkVertices().size() << endm;
00466 }
00467
00468 UInt_t TotalNoOfTpcHits = 0, noBadTpcHits = 0, noTpcHitsUsedInFit = 0;
00469 StTpcHitCollection* TpcHitCollection = event->tpcHitCollection();
00470 if (TpcHitCollection) {
00471 UInt_t numberOfSectors = TpcHitCollection->numberOfSectors();
00472 for (UInt_t i = 0; i< numberOfSectors; i++) {
00473 StTpcSectorHitCollection* sectorCollection = TpcHitCollection->sector(i);
00474 if (sectorCollection) {
00475 Int_t numberOfPadrows = sectorCollection->numberOfPadrows();
00476 for (Int_t j = 0; j< numberOfPadrows; j++) {
00477 StTpcPadrowHitCollection *rowCollection = sectorCollection->padrow(j);
00478 if (rowCollection) {
00479 StSPtrVecTpcHit &hits = rowCollection->hits();
00480 UInt_t NoHits = hits.size();
00481 for (UInt_t k = 0; k < NoHits; k++) {
00482 StTpcHit *tpcHit = static_cast<StTpcHit *> (hits[k]);
00483 if (tpcHit) {
00484 TotalNoOfTpcHits++;
00485 if ( tpcHit->flag()) noBadTpcHits++;
00486 if (tpcHit->usedInFit()) noTpcHitsUsedInFit++;
00487 }
00488 }
00489 }
00490 }
00491 }
00492 }
00493 }
00494 if (TotalNoOfTpcHits) {
00495 LOG_QA << "# TPC hits: " << TotalNoOfTpcHits
00496 << ":\tBad ones (! flag): " << noBadTpcHits
00497 << ":\tUsed in Fit: " << noTpcHitsUsedInFit << endm;
00498 }
00499 UInt_t TotalNoOfSvtHits = 0, noBadSvtHits = 0, noSvtHitsUsedInFit = 0;
00500 StSvtHitCollection* svthits = event->svtHitCollection();
00501 if (svthits) {
00502 StSvtHit* hit;
00503 for (UInt_t barrel=0; barrel<svthits->numberOfBarrels(); ++barrel) {
00504 StSvtBarrelHitCollection* barrelhits = svthits->barrel(barrel);
00505 if (!barrelhits) continue;
00506 for (UInt_t ladder=0; ladder<barrelhits->numberOfLadders(); ++ladder) {
00507 StSvtLadderHitCollection* ladderhits = barrelhits->ladder(ladder);
00508 if (!ladderhits) continue;
00509 for (UInt_t wafer=0; wafer<ladderhits->numberOfWafers(); ++wafer) {
00510 StSvtWaferHitCollection* waferhits = ladderhits->wafer(wafer);
00511 if (!waferhits) continue;
00512 const StSPtrVecSvtHit& hits = waferhits->hits();
00513 for (const_StSvtHitIterator it=hits.begin(); it!=hits.end(); ++it) {
00514 hit = static_cast<StSvtHit*>(*it);
00515 if (!hit) continue;
00516 TotalNoOfSvtHits++;
00517 if (hit->flag() >3) noBadSvtHits++;
00518 if (hit->usedInFit()) noSvtHitsUsedInFit++;
00519 }
00520 }
00521 }
00522 }
00523 }
00524 if (TotalNoOfSvtHits) {
00525 LOG_QA << "# SVT hits: " << TotalNoOfSvtHits
00526 << ":\tBad ones(flag >3): " << noBadSvtHits
00527 << ":\tUsed in Fit: " << noSvtHitsUsedInFit << endm;
00528 }
00529 UInt_t TotalNoOfSsdHits = 0, noBadSsdHits = 0, noSsdHitsUsedInFit = 0;
00530 StSsdHitCollection* ssdhits = event->ssdHitCollection();
00531 if (ssdhits) {
00532 StSsdHit* hit;
00533 for (UInt_t ladder=0; ladder<ssdhits->numberOfLadders(); ++ladder) {
00534 StSsdLadderHitCollection* ladderhits = ssdhits->ladder(ladder);
00535 if (!ladderhits) continue;
00536 for (UInt_t wafer=0; wafer<ladderhits->numberOfWafers(); ++wafer) {
00537 StSsdWaferHitCollection* waferhits = ladderhits->wafer(wafer);
00538 if (!waferhits) continue;
00539 const StSPtrVecSsdHit& hits = waferhits->hits();
00540 for (const_StSsdHitIterator it=hits.begin(); it!=hits.end(); ++it) {
00541 hit = static_cast<StSsdHit*>(*it);
00542 if (!hit) continue;
00543 TotalNoOfSsdHits++;
00544 if (hit->flag() >3) noBadSsdHits++;
00545 if (hit->usedInFit()) noSsdHitsUsedInFit++;
00546 }
00547 }
00548 }
00549 }
00550 if (TotalNoOfSsdHits) {
00551 LOG_QA << "# SSD hits: " << TotalNoOfSsdHits
00552 << ":\tBad ones(flag>3): " << noBadSsdHits
00553 << ":\tUsed in Fit: " << noSsdHitsUsedInFit << endm;
00554 }
00555 UInt_t TotalNoOfFtpcHits = 0, noBadFtpcHits = 0, noFtpcHitsUsedInFit = 0;
00556 StFtpcHitCollection* ftpchits = event->ftpcHitCollection();
00557 if (ftpchits) {
00558 StFtpcHit* hit;
00559 for (UInt_t plane=0; plane<ftpchits->numberOfPlanes(); ++plane) {
00560 StFtpcPlaneHitCollection* planehits = ftpchits->plane(plane);
00561 if (!planehits) continue;
00562 for (UInt_t sector=0; sector<planehits->numberOfSectors(); ++sector) {
00563 StFtpcSectorHitCollection* sectorhits = planehits->sector(sector);
00564 if (!sectorhits) continue;
00565 const StSPtrVecFtpcHit& hits = sectorhits->hits();
00566 for (const_StFtpcHitIterator it=hits.begin(); it!=hits.end(); ++it) {
00567 hit = static_cast<StFtpcHit*>(*it);
00568 if (!hit) continue;
00569 TotalNoOfFtpcHits++;
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586 if (! ( hit->flag() & 1 || hit->flag() & (1 << 5))) noBadFtpcHits++;
00587 else if (hit->flag() & (1 << 5)) noFtpcHitsUsedInFit++;
00588 }
00589 }
00590 }
00591 }
00592 if (TotalNoOfFtpcHits) {
00593 LOG_QA << "# FTPC hits: " << TotalNoOfFtpcHits
00594 << ":\tBad ones(!bit0): " << noBadFtpcHits
00595 << ":\tUsed in Fit: " << noFtpcHitsUsedInFit << endm;
00596 }
00597 StRnDHitCollection* rndhits = event->rndHitCollection();
00598 if (rndhits) {
00599 StSPtrVecRnDHit& hits = rndhits->hits();
00600 Int_t NoHits = rndhits->numberOfHits();
00601 if (NoHits) {
00602 struct NoHits_t {
00603 StDetectorId kId;
00604 const Char_t *Name;
00605 Int_t TotalNoOfHits;
00606 Int_t noBadHits;
00607 Int_t noHitsUsedInFit;
00608 };
00609 const Int_t NHtypes = 4;
00610 NoHits_t Hits[7] = {
00611 {kPxlId, "Hft", 0, 0, 0},
00612 {kIstId, "Ist", 0, 0, 0},
00613 {kFgtId, "Fgt", 0, 0, 0},
00614 {kUnknownId,"UnKnown", 0, 0, 0}
00615 };
00616 StRnDHit* hit;
00617 for (Int_t i = 0; i < NoHits; i++) {
00618 hit = hits[i];
00619 Int_t j = 0;
00620 for (j = 0; j < NHtypes-1; j++) if ( Hits[j].kId == hit->detector()) break;
00621 Hits[j].TotalNoOfHits++;
00622 if (hit->flag()) Hits[j].noBadHits++;
00623 if (hit->usedInFit()) Hits[j].noHitsUsedInFit++;
00624 }
00625 for (Int_t j = 0; j < NHtypes; j++) {
00626 if (Hits[j].TotalNoOfHits) {
00627 LOG_QA << "# " << Hits[j].Name << " hits: " << Hits[j].TotalNoOfHits
00628 << ":\tBad ones: " << Hits[j].noBadHits
00629 << ":\tUsed in Fit: " << Hits[j].noHitsUsedInFit << endm;
00630 }
00631 }
00632 }
00633 }
00634 }
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652
00653
00654
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688
00689
00690
00691
00692
00693
00694
00695