BmnRoot
Loading...
Searching...
No Matches
CbmStsRealMatchHits.cxx
Go to the documentation of this file.
1//* $Id: */
2
3// -------------------------------------------------------------------------
4// ----- CbmStsRealMatchHits source file -----
5// ----- Created 01/07/2008 by R. Karabowicz -----
6// -------------------------------------------------------------------------
7
8
9// --- Includes from ROOT
10#include "TClonesArray.h"
11
12// --- Includes from base
13#include "FairRootManager.h"
14#include "FairRunAna.h"
15#include "FairRuntimeDb.h"
16
17// --- Includes from STS
18#include "CbmGeoStsPar.h"
19#include "FairGeoPassivePar.h"
20#include "CbmStsDigiPar.h"
21#include "CbmStsDigiScheme.h"
22#include "CbmStsDigiMatch.h"
23#include "CbmStsHit.h"
24#include "CbmStsRealMatchHits.h"
25#include "CbmStsPoint.h"
26#include "CbmStsSector.h"
27#include "CbmStsStation.h"
28#include "FairGeoVector.h"
29#include "FairGeoNode.h"
30
31#include "TMath.h"
32
33#include <iostream>
34#include <iomanip>
35#include <map>
36
37using std::cout;
38using std::endl;
39using std::setw;
40using std::left;
41using std::right;
42using std::fixed;
43using std::setprecision;
44using std::map;
45
46// ----- Default constructor -------------------------------------------
47CbmStsRealMatchHits::CbmStsRealMatchHits() : FairTask("STSMatchHits", 1) {
48 fPassGeo = NULL;
49 fGeoPar = NULL;
50 fDigiPar = NULL;
51 fPoints = NULL;
52 fDigis = NULL;
53 fDigiMatches = NULL;
54 fHits = NULL;
55 fRealistic = kFALSE;
56 fDigiScheme = new CbmStsDigiScheme();
57}
58// -------------------------------------------------------------------------
59
60
61
62// ----- Standard constructor ------------------------------------------
64 : FairTask("STSMatchHits", iVerbose) {
65 fPassGeo = NULL;
66 fGeoPar = NULL;
67 fDigiPar = NULL;
68 fPoints = NULL;
69 fDigis = NULL;
70 fDigiMatches = NULL;
71 fHits = NULL;
72 fRealistic = kFALSE;
73 fDigiScheme = new CbmStsDigiScheme();
74}
75// -------------------------------------------------------------------------
76
77
78
79// ----- Constructor with name -----------------------------------------
80CbmStsRealMatchHits::CbmStsRealMatchHits(const char* name, Int_t iVerbose)
81 : FairTask(name, iVerbose) {
82 fPassGeo = NULL;
83 fGeoPar = NULL;
84 fDigiPar = NULL;
85 fPoints = NULL;
86 fDigis = NULL;
87 fDigiMatches = NULL;
88 fHits = NULL;
89 fRealistic = kFALSE;
90 fDigiScheme = new CbmStsDigiScheme();
91}
92// -------------------------------------------------------------------------
93
94
95
96// ----- Destructor ----------------------------------------------------
98 if ( fPassGeo ) delete fPassGeo;
99 if ( fGeoPar ) delete fGeoPar;
100 if ( fDigiPar ) delete fDigiPar;
101 if ( fDigiScheme ) delete fDigiScheme;
102}
103// -------------------------------------------------------------------------
104
105
106
107// ----- Public method Exec --------------------------------------------
108void CbmStsRealMatchHits::Exec(Option_t* opt) {
109
110 if ( fRealistic ) {
111 ExecReal(opt);
112 return;
113 }
114
115 // Timer
116 fTimer.Start();
117 Bool_t warn = kFALSE;
118
119 // Counters
120 Int_t nHits = fHits->GetEntriesFast();
121 Int_t nNoDigi = 0;
122 Int_t nBackgrd = 0;
123 Int_t nDistant = 0;
124 Int_t nMatched = 0;
125
126 // Loop over all StsHits
127 for (Int_t iHit=0; iHit<nHits; iHit++) {
128 CbmStsHit* hit = (CbmStsHit*) fHits->At(iHit);
129 if ( ! hit ) {
130 cout << "-W- " << GetName() << "::Exec: Empty hit at index "
131 << iHit << endl;
132 warn = kTRUE;
133 continue;
134 }
135
136 // Determine sector type and channel numbers
137 Int_t iStation = hit->GetStationNr();
138 Int_t iSector = hit->GetSectorNr();
139 CbmStsStation* station = fDigiScheme->GetStationByNr(iStation);
140 CbmStsSector* sector = fDigiScheme->GetSector(iStation, iSector);
141 Int_t iType = sector->GetType();
142 CbmStsDigiMatch* dMatchF = NULL;
143 CbmStsDigiMatch* dMatchB = NULL;
144
145
146 // Hit coordinates and errors
147 Double_t xH = hit->GetX();
148 Double_t yH = hit->GetY();
149 Double_t dX = hit->GetDx();
150 Double_t dY = hit->GetDy();
151
152 // Get front side DigiMatch corresponding to hit
153 Int_t iMatchF = (Int_t)hit->GetDigi(0);
154 if ( iMatchF >= 0 )
155 dMatchF = (CbmStsDigiMatch*) fDigiMatches->At(iMatchF);
156 if ( ! dMatchF ) {
157 cout << "-E- " << GetName() << "::Exec: "
158 << "No DigiMatchF for hit " << iHit << endl;
159 hit->SetRefIndex(-1);
160 nNoDigi++;
161 warn = kTRUE;
162 continue;
163 }
164
165 // Get back side DigiMatch of hit (for strip sensors only)
166 if ( iType != 1 ) {
167 Int_t iMatchB = (Int_t)hit->GetDigi(1);
168 if ( iMatchB >= 0 )
169 dMatchB = (CbmStsDigiMatch*) fDigiMatches->At(iMatchB);
170 if ( ! dMatchB ) {
171 cout << "-E- " << GetName() << "::Exec: "
172 << "No DigiMatchB for hit " << iHit << endl;
173 hit->SetRefIndex(-1);
174 nNoDigi++;
175 warn = kTRUE;
176 continue;
177 }
178 }
179
180 // Map candidate points to distance to hit
181 fCandMap.clear();
182 Int_t nPointsF = 0;
183 Int_t nPointsB = 0;
184
185 if ( iType == 1 ) {
186 // Case pixel: Candidates are all points of the digi.
187 for (Int_t iMatchF=0; iMatchF<3; iMatchF++) {
188 Int_t iPointF = dMatchF->GetRefIndex(iMatchF);
189 if ( iPointF < 0 ) continue;
190 nPointsF++;
191 // Calculate distance to hit
192 CbmStsPoint* point = (CbmStsPoint*) fPoints->At(iPointF);
193 if ( ! point ) {
194 cout << "-E- " << GetName() << "::Exec: "
195 << "No StsPoint (" << iPointF << ") for pixel hit "
196 << iHit << endl;
197 warn = kTRUE;
198 continue;
199 }
200 // point coordinates in station midplane
201 Double_t xP = point->GetX(station->GetZ());
202 Double_t yP = point->GetY(station->GetZ());
203 Double_t dist = TMath::Sqrt( (xP-xH)*(xP-xH) + (yP-yH)*(yP-yH) );
204 // cout << "candidate dist = " << dist << endl;
205 fCandMap[dist] = iPointF;
206 } // front digi loop
207 } // pixel sensor
208
209 else if ( iType == 2 || iType == 3 ) {
210 // Case strip: Candidates are points corresponding to front
211 // and back side digis
212 for ( Int_t iMatchF=0; iMatchF<3; iMatchF++) {
213 Int_t iPointF = dMatchF->GetRefIndex(iMatchF);
214 if ( iPointF < 0 ) continue;
215 // cout << " got pointf index = " << iPointF << endl;
216 nPointsF++;
217 for ( Int_t iMatchB=0; iMatchB<3; iMatchB++) {
218 Int_t iPointB = dMatchB->GetRefIndex(iMatchB);
219 if ( iPointB < 0 ) continue;
220 // cout << " got pointb index = " << iPointB << endl;
221 if ( iMatchF == 0 ) nPointsB++;
222 if ( iPointB != iPointF ) continue; // chance combination
223 // Calculate distance to hit
224 CbmStsPoint* point = (CbmStsPoint*) fPoints->At(iPointF);
225 if ( ! point ) {
226 cout << "-E- " << GetName() << "::Exec: "
227 << "No StsPoint (" << iPointF << ") for strip hit "
228 << iHit << endl;
229 warn = kTRUE;
230 continue;
231 }
232 // point coordinates in station midplane
233 Double_t xP = point->GetX(station->GetZ());
234 Double_t yP = point->GetY(station->GetZ());
235 Double_t dist = TMath::Sqrt( (xP-xH)*(xP-xH) +
236 (yP-yH)*(yP-yH) );
237 fCandMap[dist] = iPointF;
238 } // back digi loop
239 } // front digi loop
240 } // strip sensor
241
242 else {
243 // Unknown sensor type
244 cout << "-E- " << GetName() << "::Exec: Unknwon sensor type "
245 << iType << endl;
246 Fatal("Exec", "Unknwon sensor type");
247 }
248
249 if ( fVerbose > 1 ) cout << "-I- " << GetName() << ": Hit "
250 << iHit << ", type " << iType
251 << ", points " << nPointsF << " / "
252 << nPointsB << ", candidates "
253 << fCandMap.size();
254
255
256 // Check for at least one candidate point. Else background hit.
257 // This can happen for noise digis or for fake combinations
258 // of strip digis.
259 if ( fCandMap.empty() ) {
260 hit->SetRefIndex(-1);
261 if (fVerbose>1) cout << ", background " << endl;
262 nBackgrd++;
263 continue;
264 }
265
266 // Select closest point from candidates.
267 Double_t distMin = 999999.;
268 Int_t iPoint = -1;
269 for (fIter=fCandMap.begin(); fIter!=fCandMap.end(); fIter++) {
270 if ( (*fIter).first < distMin ) {
271 distMin = (*fIter).first;
272 iPoint = (*fIter).second;
273 }
274 }
275 if ( iPoint < 0 ) {
276 cout << "-E- " << GetName() << "::Exec: "
277 << "No closest point found in candidate map!" << endl;
278 Fatal("Exec", "No closest point");
279 }
280 CbmStsPoint* point = (CbmStsPoint*) fPoints->At(iPoint);
281 if (fVerbose>1) cout << ", matched to " << iPoint << ", distance "
282 << distMin << " cm";
283
284 // Check whether closest point is more than 5 sigma away from hit.
285 // This should not happen in case of pixel or strip OSU sensors,
286 // but can happen for strip GSI sensors due to multiple
287 // crossings of front and back side strips.
288 Double_t xP = point->GetX(station->GetZ());
289 Double_t yP = point->GetY(station->GetZ());
290 if ( TMath::Abs(xP-xH) > 5. * dX ||
291 TMath::Abs(yP-yH) > 5. * dY ) {
292 hit->SetRefIndex(-2);
293 nDistant++;
294 if (fVerbose>1) cout << ", distant" << endl;
295 if ( iType == 1 || iType == 2) {
296 cout << "-W- " << fName << "::Exec: "
297 << "Distant hit in pixel / strip MSU station" << endl;
298 cout << "Hit " << iHit << " coordinates " << xH
299 << ", " << yH << endl;
300 cout << "Matched point " << iPoint << ", distance "
301 << distMin << endl;
302 cout << "Distance y " << TMath::Abs(xP-xH) << " Error " << dX << endl;
303 cout << "Distance y " << TMath::Abs(yP-yH) << " Error " << dY << endl;
304 }
305
306
307 continue;
308 }
309
310 // Match closest StsPoint to hit
311 hit->SetRefIndex(iPoint);
312 nMatched++;
313 if (fVerbose>1) cout << ", good match" << endl;
314
315 // Check whether hit and point are in the same station.
316 // Else something has really gone wrong.
317 if ( TMath::Abs(hit->GetZ() - point->GetZ()) > 1. ) {
318 cout << "-E- " << GetName() << "::Exec: Hit " << iHit
319 << " is at z = " << hit->GetZ() << " cm, but matched point "
320 << iPoint << " is at z = " << point->GetZ() << "cm " << endl;
321 Fatal("Exec", "Different stations for hit and point");
322 }
323
324 } // Loop over StsHits
325
326 // Event statistics
327 fTimer.Stop();
328 if ( warn ) cout << "- ";
329 else cout << "+ ";
330 cout << setw(15) << left << fName << ": " << setprecision(4) << setw(8)
331 << fixed << right << fTimer.RealTime()
332 << " s, hits " << nHits << ", matched " << nMatched << ", distant "
333 << nDistant << ", background " << setw(6) << nBackgrd << endl;
334
335 // Run statistics
336 if ( warn) fNEventsFailed++;
337 else {
338 fNEvents++;
339 fTime += fTimer.RealTime();
340 fNHits += Double_t(nHits);
341 fNMatched += Double_t(nMatched);
342 fNDistant += Double_t(nDistant);
343 fNBackgrd += Double_t(nBackgrd);
344 }
345
346}
347
348// -------------------------------------------------------------------------
349
350// ----- Public method ExecReal --------------------------------------------
351void CbmStsRealMatchHits::ExecReal(Option_t* opt) {
352
353 // Timer
354 fTimer.Start();
355 Bool_t warn = kFALSE;
356
357 // Counters
358 Int_t nHits = fHits->GetEntriesFast();
359 Int_t nNoDigi = 0;
360 Int_t nBackgrd = 0;
361 Int_t nDistant = 0;
362 Int_t nMatched = 0;
363
364 Int_t nofStsHits = fHits->GetEntriesFast();
365 Int_t nofStsPoints = fPoints->GetEntriesFast();
366 cout << "there are " << nofStsPoints << " points and " << nofStsHits << " hits." << endl;
367 Int_t hitStationLimits[2][100];
368
369 for ( Int_t ist = 0 ; ist < fNStations ; ist++ ) {
370 hitStationLimits[0][ist] = -1;
371 hitStationLimits[1][ist] = -1;
372 }
373
374 // check for limits of hit indices on different stations...
375 for ( Int_t ihit = 0 ; ihit < nofStsHits ; ihit++ ) {
376 CbmStsHit *stsHit = (CbmStsHit*)fHits->At(ihit);
377 stsHit->SetRefIndex(-1);
378 if ( hitStationLimits[0][stsHit->GetStationNr()-1] == -1 )
379 hitStationLimits[0][stsHit->GetStationNr()-1] = ihit;
380 CbmStsHit *stsHitBack = (CbmStsHit*)fHits->At(nofStsHits-ihit-1);
381 if ( hitStationLimits[1][stsHitBack->GetStationNr()-1] == -1 ) {
382 hitStationLimits[1][stsHitBack->GetStationNr()-1] = nofStsHits-ihit;
383 }
384 }
385// for ( Int_t istat = 0 ; istat < fNStations ; istat++ )
386// cout << "station " << istat << " hits from " << hitStationLimits[0][istat] << " to " << hitStationLimits[1][istat] << endl;
387
388 for ( Int_t ipnt = 0 ; ipnt < nofStsPoints ; ipnt++ ) {
389 CbmStsPoint *stsPoint = (CbmStsPoint*)fPoints->At(ipnt);
390
391 Int_t startHit = hitStationLimits[0][fStationNrFromMcId[stsPoint->GetDetectorID()]];
392 Int_t finalHit = hitStationLimits[1][fStationNrFromMcId[stsPoint->GetDetectorID()]];
393
394 if ( startHit == -1 && finalHit == -1 ) continue;
395
396 for ( Int_t ihit = startHit ; ihit < finalHit ; ihit++ ) {
397 CbmStsHit *stsHit= (CbmStsHit*)fHits->At(ihit);
398 if ( ( TMath::Abs(stsHit->GetX()-stsPoint->GetX(stsHit->GetZ())) < .01 ) &&
399 ( TMath::Abs(stsHit->GetY()-stsPoint->GetY(stsHit->GetZ())) < .04 ) ) {
400// cout << "matching "
401// << "X: " << stsHit->GetX() << " - " << stsPoint->GetX(stsHit->GetZ())
402// << "Y: " << stsHit->GetY() << " - " << stsPoint->GetY(stsHit->GetZ()) << endl;
403 stsHit->SetRefIndex(ipnt);
404 // cout << "setting ref index = " << stsHit->GetRefIndex() << " (max sts pnt = " << nofStsPoints << ")" << endl;
405 nMatched++;
406 }
407 }
408 }
409
410 // Event statistics
411 fTimer.Stop();
412 if ( warn ) cout << "- ";
413 else cout << "+ ";
414 cout << setw(15) << left << fName << ": " << setprecision(4) << setw(8)
415 << fixed << right << fTimer.RealTime()
416 << " s, hits " << nHits << ", matched " << nMatched << ", distant "
417 << nDistant << ", background " << setw(6) << nBackgrd << endl;
418
419 // Run statistics
420 if ( warn) fNEventsFailed++;
421 else {
422 fNEvents++;
423 fTime += fTimer.RealTime();
424 fNHits += Double_t(nHits);
425 fNMatched += Double_t(nMatched);
426 fNDistant += Double_t(nDistant);
427 fNBackgrd += Double_t(nBackgrd);
428 }
429
430}
431// -------------------------------------------------------------------------
432
433
434
435// ----- Private method SetParContainers -------------------------------
436void CbmStsRealMatchHits::SetParContainers() {
437
438 // Get run and runtime database
439 FairRunAna* run = FairRunAna::Instance();
440 if ( ! run ) Fatal("SetParContainers", "No analysis run");
441 FairRuntimeDb* db = run->GetRuntimeDb();
442 if ( ! db ) Fatal("SetParContainers", "No runtime database");
443
444 // Get STS geometry and digitisation parameter container
445 fPassGeo = (FairGeoPassivePar*) db->getContainer("FairGeoPassivePar");
446 fGeoPar = (CbmGeoStsPar*) db->getContainer("CbmGeoStsPar");
447 fDigiPar = (CbmStsDigiPar*) db->getContainer("CbmStsDigiPar");
448
449}
450// -------------------------------------------------------------------------
451
452
453
454// ----- Private method Init -------------------------------------------
455InitStatus CbmStsRealMatchHits::Init() {
456
457 // Reset counters
458 fNEvents = fNEventsFailed = 0;
459 fTime = fNHits = fNMatched = fNDistant = fNBackgrd = 0.;
460
461 // Get input arrays
462 FairRootManager* ioman = FairRootManager::Instance();
463 if ( ! ioman ) Fatal("Init", "No FairRootManager");
464 fPoints = (TClonesArray*) ioman->GetObject("StsPoint");
465 if ( ! fPoints ) {
466 //cout << "-E- " << GetName() << "::Init: No STSPoint array!" << endl;
467 return kERROR;
468 }
469 fDigis = (TClonesArray*) ioman->GetObject("StsDigi");
470 if ( ! fDigis ) {
471 cout << "-E- " << GetName() << "::Init: No StsDigi array!" << endl;
472 return kERROR;
473 }
474 fDigiMatches = (TClonesArray*) ioman->GetObject("StsDigiMatch");
475 if ( ! fDigiMatches ) {
476 cout << "-E- " << GetName() << "::Init: No StsDigiMatch array!"
477 << endl;
478 return kERROR;
479 }
480 fHits = (TClonesArray*) ioman->GetObject("StsHit");
481 if ( ! fHits ) {
482 cout << "-E- " << GetName() << "::Init: No StsHit array!" << endl;
483 return kERROR;
484 }
485
486 InitStatus geoStatus = GetGeometry();
487 if ( geoStatus != kSUCCESS ) {
488 cout << "-E- " << GetName() << "::Init: Error in reading geometry!"
489 << endl;
490 return geoStatus;
491 }
492
493 // Build digitisation scheme
494 if ( fDigiScheme->Init(fGeoPar, fDigiPar) ) {
495 if (fVerbose == 1 || fVerbose == 2) fDigiScheme->Print(kFALSE);
496 else if (fVerbose > 2) fDigiScheme->Print(kTRUE);
497 cout << "-I- " << fName << "::Init: "
498 << "STS digitisation scheme succesfully initialised" << endl;
499 cout << " Stations: " << fDigiScheme->GetNStations()
500 << ", Sectors: " << fDigiScheme->GetNSectors() << ", Channels: "
501 << fDigiScheme->GetNChannels() << endl;
502 return kSUCCESS;
503 }
504
505 return kERROR;
506
507}
508// -------------------------------------------------------------------------
509
510
511
512// ----- Private method ReInit -----------------------------------------
513InitStatus CbmStsRealMatchHits::ReInit() {
514
515 // Clear digitisation scheme
516 fDigiScheme->Clear();
517
518 // Build new digitisation scheme
519 if ( fDigiScheme->Init(fGeoPar, fDigiPar) ) return kSUCCESS;
520
521 InitStatus geoStatus = GetGeometry();
522 if ( geoStatus != kSUCCESS ) {
523 cout << "-E- " << GetName() << "::Init: Error in reading geometry!"
524 << endl;
525 return geoStatus;
526 }
527
528 return kERROR;
529
530}
531// -------------------------------------------------------------------------
532
533// ----- Private method GetGeometry ------------------------------------
534InitStatus CbmStsRealMatchHits::GetGeometry() {
535
536 // Get target geometry
537 if ( ! fPassGeo ) {
538 cout << "-W- " << GetName() << "::GetGeometry: No passive geometry!"
539 <<endl;
540 fTargetPos.SetXYZ(0., 0., 0.);
541 return kERROR;
542 }
543 TObjArray* passNodes = fPassGeo->GetGeoPassiveNodes();
544 if ( ! passNodes ) {
545 cout << "-W- " << GetName() << "::GetGeometry: No passive node array"
546 << endl;
547 fTargetPos.SetXYZ(0., 0., 0.);
548 return kERROR;
549 }
550 /* FairGeoNode* target = (FairGeoNode*) passNodes->FindObject("targ");
551 if ( ! target ) {
552 cout << "-E- " << GetName() << "::GetGeometry: No target node"
553 << endl;
554 fTargetPos.SetXYZ(0., 0., 0.);
555 return kERROR;
556 }
557 FairGeoVector targetPos = target->getLabTransform()->getTranslation();
558 FairGeoVector centerPos = target->getCenterPosition().getTranslation();
559 Double_t targetX = targetPos.X() + centerPos.X();
560 Double_t targetY = targetPos.Y() + centerPos.Y();
561 Double_t targetZ = targetPos.Z() + centerPos.Z();
562 fTargetPos.SetXYZ(targetX, targetY, targetZ);*/
563
564 // Get STS geometry
565 if ( ! fGeoPar ) {
566 cout << "-W- " << GetName() << "::GetGeometry: No passive geometry!"
567 <<endl;
568 fNStations = 0;
569 return kERROR;
570 }
571 TObjArray* stsNodes = fGeoPar->GetGeoSensitiveNodes();
572 if ( ! stsNodes ) {
573 cout << "-E- " << GetName() << "::GetGeometry: No STS node array"
574 << endl;
575 fNStations = 0;
576 return kERROR;
577 }
578 Int_t tempNofStations = stsNodes->GetEntries();
579
580 cout << "There are " << tempNofStations << " nodes" << (tempNofStations > 10 ? "!!!" : "" ) << endl;
581
582 TString geoNodeName;
583 fNStations = 0;
584 TString stationNames[100];
585 for ( Int_t ist = 0 ; ist < tempNofStations ; ist++ ) {
586 FairGeoNode* stsNode = (FairGeoNode*)stsNodes->At(ist);
587 if ( ! stsNode ) {
588 cout << "-W- CbmStsDigiScheme::Init: station#" << ist
589 << " not found among sensitive nodes " << endl;
590 continue;
591 }
592 geoNodeName = stsNode->getName();
593 // TArrayD* params = stsNode->getParameters();
594
595 Bool_t stationKnown = kFALSE;
596 // check if the node belongs to some station, save the MCId and outer radius
597 for ( Int_t ikst = 0 ; ikst < fNStations ; ikst++ )
598 if ( geoNodeName.Contains(stationNames[ikst]) ) {
599 fStationNrFromMcId[stsNode->getMCid()] = ikst;
600 stationKnown = kTRUE;
601 }
602
603 if ( stationKnown ) continue;
604
605 // if not known, register it and save MCId
606 fStationNrFromMcId[stsNode->getMCid()] = fNStations;
607
608 // it will work only if the node name is organized as:
609 // for station name is "stsstationXX", where XX is the station number (f.e. XX=07 for station number 7)
610 // for sector name is "stsstationXXanythingHereToDistinguishDifferentSectors"
611 geoNodeName.Remove(12,geoNodeName.Length()-12);
612 stationNames[fNStations] = geoNodeName.Data();
613 fNStations++;
614
615 cout << "station #" << fNStations << " has MCID = " << stsNode->getMCid() << " and name " << stsNode->GetName() << endl;
616
617 // fStationsMCId[fNStations] = stsNode->getMCid(); // not used
618 }
619 cout << "There are " << fNStations << " stations" << endl;
620
621 return kSUCCESS;
622
623}
624// -------------------------------------------------------------------------
625
626
627
628// ----- Private method Finish -----------------------------------------
629void CbmStsRealMatchHits::Finish() {
630
631 cout << endl;
632 cout << "============================================================"
633 << endl;
634 cout << "===== " << GetName() << ": Run summary " << endl;
635 cout << "===== " << endl;
636 cout << "===== Good events : " << setw(6) << fNEvents << endl;
637 cout << "===== Failed events : " << setw(6) << fNEventsFailed << endl;
638 cout << "===== Average time : " << setprecision(4) << setw(8) << right
639 << fTime / Double_t(fNEvents) << " s" << endl;
640 cout << "===== " << endl;
641 cout << "===== Hits per event : " << fixed << setprecision(0)
642 << fNHits / Double_t(fNEvents) << endl;
643 cout << setprecision(2);
644 cout << "===== Matched hits : " << fixed << setw(6) << right
645 << fNMatched / fNHits * 100. << " %" << endl;
646 cout << "===== Distant hits : " << fixed << setw(6) << right
647 << fNDistant / fNHits * 100. << " %" << endl;
648 cout << "===== Background hits : " << fixed << setw(6) << right
649 << fNBackgrd / fNHits * 100. << " % " << endl;
650 cout << "============================================================"
651 << endl;
652
653}
654// -------------------------------------------------------------------------
vector< Double_t > dist(vector< Double_t > qp, Double_t mu)
Definition BmnMath.cxx:869
TObjArray * GetGeoSensitiveNodes()
Int_t GetRefIndex(Int_t i=0) const
void Print(Bool_t kLong=kFALSE)
CbmStsStation * GetStationByNr(Int_t stationNr)
CbmStsSector * GetSector(Int_t stationNr, Int_t sectorNr)
virtual Int_t GetStationNr() const
Definition CbmStsHit.h:66
Int_t GetSectorNr() const
Definition CbmStsHit.h:68
Int_t GetDigi(Int_t iSide) const
Double_t GetY(Double_t z) const
Double_t GetX(Double_t z) const
virtual void Exec(Option_t *opt)
virtual void ExecReal(Option_t *opt)
Int_t GetType() const
Double_t GetZ(Int_t it=0)
TObjArray * GetGeoPassiveNodes()
-clang-format