BmnRoot
Loading...
Searching...
No Matches
BmnEfficiency.cxx
Go to the documentation of this file.
1#include "BmnEfficiency.h"
2
3#include "TFile.h"
4
6{
7 dstChain = nullptr;
8 fNEvents = 0;
9 fKalman = nullptr;
10
11 fHeader = nullptr;
12
13 fInnerHits = nullptr;
14 fGemHits = nullptr;
15 fSiliconHits = nullptr;
16 fGlobTracks = nullptr;
17 fGemTracks = nullptr;
18 fSiliconTracks = nullptr;
19 fVertices = nullptr;
20
21 fField = nullptr;
22 fMagField = nullptr;
23 fKalman = nullptr;
24
26
27 gem = fInnTracker->GetGemGeometry();
28 silicon = fInnTracker->GetSiliconGeometry();
29
30 fNHits = 5;
31}
32
33BmnEfficiency::BmnEfficiency(FairRunAna* fAna, BmnInnerTrackerGeometryDraw* fInnTracker, TString dstFile, Int_t nEvents)
34: isGoodDst(kFALSE),
35 fNHitsSilicon(2),
36 fNHitsGem(4),
37 gem(nullptr),
38 silicon(nullptr),
39 fHeader(nullptr),
40 fInnerHits(nullptr),
41 fGemHits(nullptr),
42 fSiliconHits(nullptr),
43 fGlobTracks(nullptr),
44 fGemTracks(nullptr),
45 fSiliconTracks(nullptr),
46 fVertices(nullptr),
47 dstChain(nullptr),
48 fNEvents(nEvents),
49 fMagField(nullptr),
50 fKalman(nullptr),
51 fNHits(6)
52{
53 // Open dst file ...
54 dstChain = new TChain("bmndata");
55
56 // Adding dst file to the chain ...
57 TFile f(dstFile);
58 if (f.IsOpen() && !f.IsZombie()) {
59 dstChain->Add(dstFile.Data());
60 isGoodDst = kTRUE;
61 }
62
63 if (!isGoodDst)
64 return;
65
66 cout << "Num. of events to be used# " << dstChain->GetEntries() << endl;
67
68 dstChain->SetBranchAddress("DstEventHeader.", &fHeader);
69 dstChain->SetBranchAddress("BmnInnerHits", &fInnerHits);
70 dstChain->SetBranchAddress("BmnGemStripHit", &fGemHits);
71 dstChain->SetBranchAddress("BmnSiliconHit", &fSiliconHits);
72 dstChain->SetBranchAddress("BmnGlobalTrack", &fGlobTracks);
73 dstChain->SetBranchAddress("BmnGemTrack", &fGemTracks);
74 dstChain->SetBranchAddress("BmnSiliconTrack", &fSiliconTracks);
75 dstChain->SetBranchAddress("BmnVertex", &fVertices);
76
77 dstChain->GetEntry();
78
79 UInt_t runId = fHeader->GetRunId();
80 cout << "runId = " << runId << endl;
81
82 fMagField = new BmnNewFieldMap("field_sp41v4_ascii_Extrap.root");
83
84 if (runId && runId < 10000) {
85 UniRun* runInfo = UniRun::GetRun(7, runId);
86
87 if (!runInfo)
88 return;
89
90 fMagField->SetScale(*runInfo->GetFieldVoltage() / 55.87);
91 } else
92 fMagField->SetScale(1251.9 / 900.); // FIXME!!!
93
94 fMagField->Init();
95
96 fAna->SetField(fMagField);
97 fField = fAna->GetField();
98
100
101 // Calculating boarders and stat (mod) positions to be sure whether we are in acceptance ...
102 gem = fInnTracker->GetGemGeometry();
103 silicon = fInnTracker->GetSiliconGeometry();
104
105 TClonesArray* GEM = new TClonesArray("InnerTrackerParams");
106 TClonesArray* SILICON = new TClonesArray("InnerTrackerParams");
107
108 for (Int_t iEvent = 0; iEvent < 2000; iEvent++) {
109 dstChain->GetEntry(iEvent);
110
111 // Loop over GEM hits ...
112 for (Int_t iHit = 0; iHit < fGemHits->GetEntriesFast(); iHit++) {
113 BmnHit* hit = (BmnHit*) fGemHits->UncheckedAt(iHit);
114
115 new ((*GEM)[GEM->GetEntriesFast()])
116 InnerTrackerParams((Int_t) hit->GetStation(), hit->GetModule(), hit->GetX(), hit->GetY(), hit->GetZ());
117 }
118
119 // Loop over SILICON hits ...
120 for (Int_t iHit = 0; iHit < fSiliconHits->GetEntriesFast(); iHit++) {
121 BmnHit* hit = (BmnHit*) fSiliconHits->UncheckedAt(iHit);
122
123 new ((*SILICON)[SILICON->GetEntriesFast()])
124 InnerTrackerParams((Int_t) hit->GetStation(), hit->GetModule(), hit->GetX(), hit->GetY(), hit->GetZ());
125 }
126 }
127
128 FillAcceptanceMaps(GEM);
129 FillAcceptanceMaps(GEM, SILICON);
130
131 delete GEM;
132 delete SILICON;
133}
134
135void BmnEfficiency::FillAcceptanceMaps(TClonesArray* GEMs, TClonesArray* SILs) {
136 Int_t nStats = 0;
137 Int_t nMods = 0;
138
139 if (!SILs) {
140 nStats = gem->GetNStations();
141 nMods = gem->GetStation(0)->GetNModules();
142 } else {
143 nStats = silicon->GetNStations();
144 nMods = silicon->GetStation(2)->GetNModules();
145 }
146
147 set <Double_t>*** x = new set <Double_t>**[nStats];
148 set <Double_t>*** y = new set <Double_t>**[nStats];
149 set <Double_t>*** z = new set <Double_t>**[nStats];
150
151 for (Int_t iStat = 0; iStat < nStats; iStat++) {
152 x[iStat] = new set <Double_t>*[nMods];
153 y[iStat] = new set <Double_t>*[nMods];
154 z[iStat] = new set <Double_t>*[nMods];
155
156 for (Int_t iMod = 0; iMod < nMods; iMod++) {
157 x[iStat][iMod] = new set <Double_t>();
158 y[iStat][iMod] = new set <Double_t>();
159 z[iStat][iMod] = new set <Double_t>();
160 }
161 }
162
163 TClonesArray* arr = (!SILs) ? GEMs : SILs;
164
165 for (Int_t iStat = 0; iStat < nStats; iStat++)
166 for (Int_t iMod = 0; iMod < nMods; iMod++)
167 for (Int_t iEle = 0; iEle < arr->GetEntriesFast(); iEle++) {
168 InnerTrackerParams* g = (InnerTrackerParams*) arr->UncheckedAt(iEle);
169 if (g->station() == iStat && g->module() == iMod) {
170 x[iStat][iMod]->insert(g->xyz().X());
171 y[iStat][iMod]->insert(g->xyz().Y());
172 z[iStat][iMod]->insert(g->xyz().Z());
173 }
174 }
175
176 Int_t shift = (!SILs) ? silicon->GetNStations() : 0;
177
178 for (Int_t iStat = 0; iStat < nStats; iStat++)
179 for (Int_t iMod = 0; iMod < nMods; iMod++) {
180
181 Double_t minX = *min_element(x[iStat][iMod]->begin(), x[iStat][iMod]->end());
182 Double_t maxX = *max_element(x[iStat][iMod]->begin(), x[iStat][iMod]->end());
183
184 Double_t minY = *min_element(y[iStat][iMod]->begin(), y[iStat][iMod]->end());
185 Double_t maxY = *max_element(y[iStat][iMod]->begin(), y[iStat][iMod]->end());
186
187 vector <Double_t> borders{minX, maxX, minY, maxY};
188
189 if (z[iStat][iMod]->size()) {
190 fStatZ[make_pair(iStat + shift, iMod)] = *z[iStat][iMod]->begin();
191 fStatAcceptance[make_pair(iStat + shift, iMod)] = borders;
192 }
193 }
194
195 // Deleting allocated memory ...
196 for (Int_t iStat = 0; iStat < nStats; iStat++)
197 for (Int_t iMod = 0; iMod < nMods; iMod++) {
198 delete x[iStat][iMod];
199 delete y[iStat][iMod];
200 delete z[iStat][iMod];
201 }
202
203 delete [] x;
204 delete [] y;
205 delete [] z;
206}
207
208BmnEfficiency::BmnEfficiency(FairRunAna* fAna, TString dstFile, Int_t nEvents) {
209 isGoodDst = kFALSE;
210 fNEvents = nEvents;
211 gem = nullptr;
212 silicon = nullptr;
213 fHeader = nullptr;
214 fInnerHits = nullptr;
215 fGemHits = nullptr;
216 fSiliconHits = nullptr;
217 fGlobTracks = nullptr;
218 fGemTracks = nullptr;
219 fSiliconTracks = nullptr;
220 fVertices = nullptr;
221 dstChain = nullptr;
222 fKalman = nullptr;
223 fMagField = nullptr;
224 fNHits = 6;
225 fNHitsSilicon = 2;
226 fNHitsGem = 4;
227
228 // Open dst file ...
229 dstChain = new TChain("bmndata");
230
231 // Adding dst file to the chain ...
232 TFile f(dstFile);
233 if (f.IsOpen() && !f.IsZombie()) {
234 dstChain->Add(dstFile.Data());
235 isGoodDst = kTRUE;
236 }
237
238 if (!isGoodDst)
239 return;
240
241 cout << "Num. of events to be used# " << dstChain->GetEntries() << endl;
242
243 dstChain->SetBranchAddress("DstEventHeader.", &fHeader);
244 dstChain->SetBranchAddress("BmnInnerHits", &fInnerHits);
245 dstChain->SetBranchAddress("BmnGemStripHit", &fGemHits);
246 dstChain->SetBranchAddress("BmnSiliconHit", &fSiliconHits);
247 dstChain->SetBranchAddress("BmnGlobalTrack", &fGlobTracks);
248 dstChain->SetBranchAddress("BmnGemTrack", &fGemTracks);
249 dstChain->SetBranchAddress("BmnSiliconTrack", &fSiliconTracks);
250 dstChain->SetBranchAddress("BmnVertex", &fVertices);
251
252 dstChain->GetEntry();
253
254 UInt_t runId = fHeader->GetRunId();
255
256 fMagField = new BmnNewFieldMap("field_sp41v4_ascii_Extrap.root");
257
258 if (runId && runId < 10000) {
259 UniRun* runInfo = UniRun::GetRun(7, runId);
260
261 if (!runInfo)
262 return;
263
264 fMagField->SetScale(*runInfo->GetFieldVoltage() / 55.87);
265 } else
266 fMagField->SetScale(1251.9 / 900.); // FIXME !!!
267
268 fMagField->Init();
269
270 fAna->SetField(fMagField);
271 fField = fAna->GetField();
272
273 fKalman = new BmnKalmanFilter();
274}
275
276void BmnEfficiency::Efficiency(TClonesArray* effGem,
277 TClonesArray* effSilicon,
278 map <Int_t, vector <pair <Double_t, Double_t>>> gYr,
279 map <Int_t, vector <pair <Double_t, Double_t>>> sYr) {
280
281 if (!isGoodDst)
282 return;
283
284 auto silFirst = fStatZ.begin();
285 auto gemLast = fStatZ.rbegin();
286
287 Int_t nHitsMax = gem->GetNStations() + silicon->GetNStations();
288 Double_t zBegin = silFirst->second - 5.; // first SILICON - 5 cm
289 Double_t zEnd = gemLast->second + 5.; // last GEM + 5 cm
290
291 Int_t nModsSilicon = 0;
292 for (Int_t iStat = 0; iStat < silicon->GetNStations(); iStat++)
293 for (Int_t iMod = 0; iMod < silicon->GetStation(iStat)->GetNModules(); iMod++)
294 nModsSilicon++;
295
296 auto gemFirst = next(fStatZ.begin(), nModsSilicon);
297 auto silLast = next(fStatZ.begin(), nModsSilicon - 1);
298
299 Double_t borderSilGem = .5 * (gemFirst->second + silLast->second);
300
301 gStyle->SetOptStat(0);
302
303 for (Int_t iEvent = 0; iEvent < ((fNEvents == 0) ? dstChain->GetEntries() : fNEvents); iEvent++) {
304 dstChain->GetEntry(iEvent);
305
306 if (iEvent % 100000 == 0)
307 cout << "Event# " << iEvent << endl;
308
309 BmnVertex* Vp = (BmnVertex*) fVertices->UncheckedAt(0);
310 if (Vp->GetNTracks() < 3) // FIXME !!!
311 continue;
312
313 // Whether we skip it or not ...
314 if (TMath::Abs(Vp->GetZ()) > 6.) // FIXME !!!
315 continue;
316
317 // Loop over glob. tracks ...
318 for (Int_t iTrack = 0; iTrack < fGlobTracks->GetEntriesFast(); iTrack++) {
319 BmnGlobalTrack* track = (BmnGlobalTrack*) fGlobTracks->UncheckedAt(iTrack);
320
321 if (TMath::Abs(track->GetP()) < .5 || TMath::Abs(track->GetP()) > 5.)
322 continue;
323
324 vector <BmnHit*> hits;
325
326 // Loop over silicon hits ...
327 if (track->GetSilTrackIndex() != -1) {
328 BmnTrack* silTrack = (BmnTrack*) fSiliconTracks->UncheckedAt(track->GetSilTrackIndex());
329
330 for (Int_t iHit = 0; iHit < silTrack->GetNHits(); iHit++)
331 hits.push_back((BmnHit*) fSiliconHits->UncheckedAt(silTrack->GetHitIndex(iHit)));
332 }
333
334 // Loop over gem hits ...
335 if (track->GetGemTrackIndex() != -1) {
336 BmnTrack* gemTrack = (BmnTrack*) fGemTracks->UncheckedAt(track->GetGemTrackIndex());
337
338 for (Int_t iHit = 0; iHit < gemTrack->GetNHits(); iHit++)
339 hits.push_back((BmnHit*) fGemHits->UncheckedAt(gemTrack->GetHitIndex(iHit)));
340 }
341
342 Int_t nHits = 0;
343
344 // Let us calculate number of hits in [zBegin, zEnd] ...
345 for (BmnHit* hit : hits) {
346 Double_t Z = hit->GetZ();
347 if (Z > zBegin && Z < zEnd)
348 nHits++;
349 }
350
351 if (nHits < fNHits)
352 continue;
353
354 // Also, a track should satisfy the condition: SilHits >= 2 && GemHits >= 4
355 Int_t nHitsPerSilicon = 0;
356 Int_t nHitsPerGem = 0;
357
358 for (BmnHit* hit : hits) {
359 if (hit->GetZ() < borderSilGem)
360 nHitsPerSilicon++;
361 else
362 nHitsPerGem++;
363 }
364
365 if (nHitsPerSilicon < fNHitsSilicon || nHitsPerGem < fNHitsGem)
366 continue;
367
368 // 1. Selecting tracks assumed to be from Vp ...
369 Double_t x = Vp->GetX();
370 Double_t y = Vp->GetY();
371 Double_t z = Vp->GetZ();
372
373 // Updating track params. for all hits connected to the track ...
374 FairTrackParam* first = track->GetParamFirst();
375 FairTrackParam* last = track->GetParamLast();
376
377 FairTrackParam par = *first;
378 for (BmnHit* hit : hits) {
379 BmnStatus status = fKalman->TGeoTrackPropagate(&par, hit->GetZ(), last->GetQp() > 0. ? 2212 : -211, nullptr, nullptr, kTRUE);
380 if (status == kBMNERROR)
381 continue;
382
383 Double_t chi2 = 0.;
384 fKalman->Update(&par, hit, chi2);
385 }
386
387 // Going to the VpZ with the updated params ...
388 BmnStatus status = fKalman->TGeoTrackPropagate(&par, z, last->GetQp() > 0. ? 2212 : -211, nullptr, nullptr, kTRUE);
389 if (status == kBMNERROR)
390 continue;
391
392 Double_t xPredictedAtVp = par.GetX();
393 Double_t yPredictedAtVp = par.GetY();
394
395 const Double_t distCut = 2.; // FIXME!!!
396 Double_t distXY = TMath::Sqrt((xPredictedAtVp - x) * (xPredictedAtVp - x) + (yPredictedAtVp - y) * (yPredictedAtVp - y));
397
398 if (distXY > distCut)
399 continue;
400
401 FairTrackParam parPredicted = *track->GetParamFirst();
402 pair <FairTrackParam, FairTrackParam> trackParams = make_pair(parPredicted, *track->GetParamLast());
403
404 // 3. Array to store info on hits per SILICON and GEM part of tracker
405 Bool_t hitsPerStation[nHitsMax];
406 for (Int_t iHit = 0; iHit < nHitsMax; iHit++)
407 hitsPerStation[iHit] = kFALSE;
408
409 // 4. Collecting hits found on the track in one array ...
410 for (BmnHit* hit : hits) {
411 TString det = GetDetector(hit);
412 Int_t shift = (det.Contains("GEM")) ? silicon->GetNStations() : 0;
413
414 Int_t stat = hit->GetStation();
415 hitsPerStation[stat + shift] = kTRUE;
416 }
417
418 inputForEfficiency input;
419 // Setting for GEM ...
420 input.hits = hits;
421
422 vector <Bool_t> v;
423 v.assign(hitsPerStation, hitsPerStation + nHitsMax);
424 input.usedStats = v;
425
426 input.sfIndices.first = silicon->GetNStations();
427 input.sfIndices.second = nHitsMax;
428
429 input.flParams = trackParams;
430 input.eContainers = effGem;
431
432 input.gPairMap = gYr;
433 input.sPairMap = sYr;
434
435 fillEfficiency(std::move(input));
436
437 inputForEfficiency input1;
438 input1 = std::move(input); // Right now input becomes not fully valid since is in unspecified state !!! ...
439
440 input1.det = "SILICON";
441 input1.sfIndices.first = 0;
442 input1.sfIndices.second = silicon->GetNStations();
443 input1.eContainers = effSilicon;
444
445 fillEfficiency(std::move(input1));
446 }
447 }
448}
449
450Bool_t BmnEfficiency::isVirtualHitInAcceptance(Int_t iHit, vector <BmnHit*> hits, pair <FairTrackParam, FairTrackParam> params, pair <Double_t, Double_t>& xyPred) {
451 // Averaged Z by all modules for station ... ???
452 Double_t Z = FindZ(iHit);
453
454 vector <BmnHit*> hitsBeforeCurrentZ;
455
456 for (BmnHit* hit : hits) {
457 Double_t zHit = hit->GetZ();
458
459 if (zHit > Z)
460 continue;
461
462 hitsBeforeCurrentZ.push_back(hit);
463 }
464
465 for (BmnHit* hit : hitsBeforeCurrentZ) {
466 BmnStatus status = fKalman->TGeoTrackPropagate(&(params.first), hit->GetZ(), params.second.GetQp() > 0. ? 2212 : -211, nullptr, nullptr, kTRUE);
467 if (status == kBMNERROR)
468 continue;
469
470 Double_t chi2 = 0.;
471 fKalman->Update(&(params.first), hit, chi2);
472 }
473
474 BmnStatus status = fKalman->TGeoTrackPropagate(&(params.first), Z, params.second.GetQp() > 0. ? 2212 : -211, nullptr, nullptr, kTRUE);
475 if (status == kBMNERROR)
476 return kFALSE;
477
478 Int_t mod0 = -1;
479 Double_t xPred = params.first.GetX();
480 Double_t yPred = params.first.GetY();
481
482 xyPred.first = xPred;
483 xyPred.second = yPred;
484
485 for (auto it : fStatAcceptance) {
486 Int_t stat = it.first.first;
487 Int_t mod = it.first.second;
488
489 Double_t xMin = it.second[0];
490 Double_t xMax = it.second[1];
491 Double_t yMin = it.second[2];
492 Double_t yMax = it.second[3];
493
494 if (xPred > xMin && xPred < xMax && yPred > yMin && yPred < yMax && (stat == iHit)) {
495 mod0 = mod;
496 break;
497 }
498 }
499
500 return (mod0 > -1) ? kTRUE : kFALSE;
501}
502
503void BmnEfficiency::fillEfficiency(inputForEfficiency&& input) {
504 const Int_t hitCut = (input.det.Contains("GEM") ? input.nGemCut : input.nSilCut);
505 const Int_t shift = (input.det.Contains("GEM") ? -silicon->GetNStations() : 0);
506
507 // Getting nHits per detector ...
508 Int_t nHitsPerDetector = 0;
509
510 auto itBegin = input.usedStats.begin();
511 auto itEnd = input.usedStats.end();
512 auto itMiddle = next(input.usedStats.begin(), silicon->GetNStations());
513
514 if (input.det.Contains("SILICON"))
515 for (auto it = itBegin; it < itMiddle; it++) {
516 if (*it)
517 nHitsPerDetector++;
518 } else
519 for (auto it = itMiddle; it != itEnd; it++) {
520 if (*it)
521 nHitsPerDetector++;
522 }
523
524 if (!nHitsPerDetector)
525 return;
526
527 for (Int_t iHit = input.sfIndices.first; iHit < input.sfIndices.second; iHit++) {
528 // Skipping tracks with four hits having a hit in considering station ...
529 if (nHitsPerDetector == hitCut && input.usedStats.at(iHit))
530 continue;
531
532 if (input.usedStats.at(iHit) && nHitsPerDetector != hitCut) {
533 // Trying to get required hit ...
534 BmnHit* hit0 = nullptr;
535
536 Int_t stat = -1;
537 for (BmnHit* hit : input.hits) {
538 if (!GetDetector(hit).Contains(input.det.Data()))
539 continue;
540 stat = hit->GetStation();
541
542 if (stat == (iHit + shift)) {
543 hit0 = hit;
544 break;
545 }
546 }
547
548 if (hit0) {
549 Int_t eCont = -1;
550 for (Int_t iCont = 0; iCont < input.eContainers->GetEntriesFast(); iCont++) {
551 EffStore2D* effCont = (EffStore2D*) input.eContainers->UncheckedAt(iCont);
552
553 if (effCont->Detector() == input.det && effCont->Station() == (iHit + shift)) {
554 eCont = iCont;
555 break;
556 }
557 }
558
559 if (eCont > -1) {
560 EffStore2D* eff = (EffStore2D*) input.eContainers->UncheckedAt(eCont);
561 eff->efficiency(((input.flParams.second.GetQp() > 0.) ? 0 : 1), "", input.det)->Fill(kTRUE, hit0->GetX(), hit0->GetY());
562
563 if (input.det.Contains("SILICON"))
564 eff->efficiency(((input.flParams.second.GetQp() > 0.) ? 0 : 1), "xP", input.det)->Fill(kTRUE, hit0->GetX(),
565 TMath::Abs(1. / input.flParams.first.GetQp()));
566
567 Int_t yBin = FindBin(hit0->GetY(), stat, ((input.det.Contains("GEM")) ? input.gPairMap : input.sPairMap));
568 if (yBin != -1)
569 eff->efficiency4range(yBin, ((input.flParams.second.GetQp() > 0.) ? 0 : 1), input.det)->Fill(kTRUE, hit0->GetX());
570 }
571 }
572 } else {
573 pair <Double_t, Double_t> xyPred;
574
575 if (isVirtualHitInAcceptance(iHit, input.hits, input.flParams, xyPred)) {
576 Int_t yBin = FindBin(xyPred.second, iHit + shift, ((input.det.Contains("GEM")) ? input.gPairMap : input.sPairMap));
577 if (yBin == -1)
578 continue;
579
580 Int_t eCont = -1;
581 for (Int_t iCont = 0; iCont < input.eContainers->GetEntriesFast(); iCont++) {
582 EffStore2D* effCont = (EffStore2D*) input.eContainers->UncheckedAt(iCont);
583
584 if (effCont->Detector() == input.det && effCont->Station() == (iHit + shift)) {
585 eCont = iCont;
586 break;
587 }
588 }
589
590 if (eCont > -1) {
591 EffStore2D* eff = (EffStore2D*) input.eContainers->UncheckedAt(eCont);
592 eff->efficiency(((input.flParams.second.GetQp() > 0.) ? 0 : 1), "", input.det)->Fill(kFALSE, xyPred.first, xyPred.second);
593
594 if (input.det.Contains("SILICON"))
595 eff->efficiency(((input.flParams.second.GetQp() > 0.) ? 0 : 1), "xP", input.det)->Fill(kFALSE, xyPred.first,
596 TMath::Abs(1. / input.flParams.first.GetQp()));
597
598 eff->efficiency4range(yBin, ((input.flParams.second.GetQp() > 0.) ? 0 : 1), input.det)->Fill(kFALSE, xyPred.first);
599 }
600 }
601 }
602 }
603}
604
606 TString zone = "";
607
608 if (hit->GetZ() < gem->GetStation(0)->GetZPosition() - 5.)
609 return zone;
610
611 Int_t stat = hit->GetStation();
612 Int_t mod = hit->GetModule();
613
614 Double_t x = hit->GetX();
615 Double_t y = hit->GetY();
616
617 const Int_t nLayers = gem->GetStation(stat)->GetModule(mod)->GetNStripLayers();
618 Bool_t isHitInside[nLayers];
619
620 for (Int_t iLayer = 0; iLayer < nLayers; iLayer++) {
621 BmnGemStripLayer layer = gem->GetStation(stat)->GetModule(mod)->GetStripLayer(iLayer);
622 isHitInside[iLayer] = layer.IsPointInsideStripLayer(-x, y);
623 }
624
625 if (isHitInside[0] && isHitInside[1])
626 zone = "big";
627 else if (isHitInside[2] && isHitInside[3])
628 zone = "hot";
629
630 return zone;
631}
__m128 v
Definition P4_F32vec4.h:1
float f
Definition P4_F32vec4.h:21
BmnStatus
Definition BmnEnums.h:24
@ kBMNERROR
Definition BmnEnums.h:26
BmnKalmanFilter * fKalman
BmnNewFieldMap * fMagField
TClonesArray * fInnerHits
void Efficiency(TClonesArray *, TClonesArray *effSilicon, map< Int_t, vector< pair< Double_t, Double_t > > >, map< Int_t, vector< pair< Double_t, Double_t > > >)
BmnGemStripStationSet * gem
TClonesArray * fSiliconTracks
BmnSiliconStationSet * silicon
TClonesArray * fGemTracks
TClonesArray * fVertices
DstEventHeader * fHeader
FairField * fField
TClonesArray * fGemHits
TClonesArray * fSiliconHits
TChain * dstChain
TString GetGemZone(BmnHit *)
TClonesArray * fGlobTracks
void SetScale(Double_t factor)
Definition BmnFieldMap.h:55
virtual void Init()
Bool_t IsPointInsideStripLayer(Double_t x, Double_t y)
BmnGemStripLayer & GetStripLayer(Int_t num)
BmnGemStripStation * GetStation(Int_t station_num)
BmnGemStripModule * GetModule(Int_t module_num)
Int_t GetGemTrackIndex() const
Int_t GetSilTrackIndex() const
Int_t GetModule()
Definition BmnHit.h:77
Short_t GetStation() const
Definition BmnHit.h:45
BmnGemStripStationSet * GetGemGeometry()
BmnSiliconStationSet * GetSiliconGeometry()
BmnStatus TGeoTrackPropagate(FairTrackParam *par, Double_t zOut, Int_t pdg, vector< Double_t > *F, Double_t *length, Bool_t isField)
BmnStatus Update(FairTrackParam *par, const BmnHit *hit, Double_t &chiSq)
BmnSiliconStation * GetStation(Int_t station_num)
FairTrackParam * GetParamFirst()
Definition BmnTrack.h:72
Int_t GetNHits() const
Definition BmnTrack.h:44
Int_t GetHitIndex(Int_t iHit) const
Definition BmnTrack.h:48
Double_t GetP()
Definition BmnTrack.h:80
FairTrackParam * GetParamLast()
Definition BmnTrack.h:76
Int_t GetNTracks() const
Definition BmnVertex.h:54
Double_t GetX() const
Definition BmnVertex.h:49
Double_t GetZ() const
Definition BmnVertex.h:51
Double_t GetY() const
Definition BmnVertex.h:50
TEfficiency * efficiency(Int_t qpBin=0, TString hType="", TString det="GEM")
TEfficiency * efficiency4range(Int_t range, Int_t qpBin=0, TString det="GEM")
Int_t Station()
TString Detector()
static UniRun * GetRun(int period_number, int run_number)
get run from the database
Definition UniRun.cxx:177
double * GetFieldVoltage()
get field voltage of the current run
Definition UniRun.h:125
pair< Int_t, Int_t > sfIndices
vector< Bool_t > usedStats
pair< FairTrackParam, FairTrackParam > flParams
map< Int_t, vector< pair< Double_t, Double_t > > > gPairMap
vector< BmnHit * > hits
map< Int_t, vector< pair< Double_t, Double_t > > > sPairMap
TClonesArray * eContainers