BmnRoot
Loading...
Searching...
No Matches
BmnTofHitProducer.cxx
Go to the documentation of this file.
1#include "BmnTofHitProducer.h"
2#include "BmnTofHit.h"
3#include "BmnTOFPoint.h"
4//#include "BmnTofGeoUtils.h"
5#include "CbmMCTrack.h"
6
7#include "FairLogger.h"
8#include "FairRootManager.h"
9
10#include <TRandom2.h>
11#include <TGeoManager.h>
12#include <TGeoBBox.h>
13#include <TGeoManager.h>
14#include <TGeoMatrix.h>
15#include <TH1D.h>
16#include <TH2D.h>
17#include "TFile.h"
18#include <TEfficiency.h>
19#include <TVector3.h>
20#include <TStopwatch.h>
21#include <TVector3.h>
22#include <assert.h>
23
24#include<assert.h>
25#include<map>
26
27#define MAKE_CLUSTERS 1
28#define OCCUPANCY 1
29#define OCCUPANCY_DEBUG 0
30
31using namespace std;
32
33static Double_t workTime = 0.0;
34
35BmnTofHitProducer::BmnTofHitProducer(const char *name, const char *geomFile,
36 Bool_t useMCdata, Int_t verbose,
37 Bool_t test)
38: BmnTofHitProducerIdeal(name, useMCdata, verbose, test),
39 fTimeSigma(0.100),
40 fErrX(1.0),
41 fErrY(1.0),
42 pRandom(nullptr),
43 fDoINL(true),
44 fDoSlewing(true),
45 h1TestDistance(nullptr),
46 h2TestNeighborPair(nullptr),
47 h2TestStrips(nullptr),
48 fSignalVelosity(1.0 / 16.0)
49{
50 fgeomFile = geomFile;
51 fMCTimeFile = NULL;
52 fProtonTimeCorrectionFile = NULL;
53 fMainStripSelection = 0; // 0 - minimal time, != 0 - maximal amplitude
54 fSelectXYCalibration = 2; // 0 - Petukhov, 1 - Panin, 2 - new Petukhov
55 fTimeMin = -2.f; // Minimal digit time, ns
56 fTimeMax = +15.f; // Maximal digit time, ns
57 fDiffTimeMaxSmall = 1.3f; // Maximal abs time difference, small chambers
58 fDiffTimeMaxBig = 4.0f; // Maximal abs time difference, big chambers
59
60 if (fDoTest) {
61 fTestFlnm = "test.BmnTofHitProducer.root";
62 effTestEfficiencySingleHit = new TEfficiency(
63 "TOF700_effSingleHit", "Efficiency single hit;R, cm;Side", 10000,
64 -0.1, 2.);
65 fList.Add(effTestEfficiencySingleHit);
66 effTestEfficiencyDoubleHit = new TEfficiency(
67 "TOF700_effDoubleHit", "Efficiency double hit;R, cm;Side", 10000,
68 -0.1, 2.);
69 fList.Add(effTestEfficiencyDoubleHit);
70 h1TestDistance =
71 new TH1D("TOF700_TestDistance",
72 "Distance between strips;M, cm;Side", 1000, 0., 100.);
73 fList.Add(h1TestDistance);
74 // h2TestStrips = new TH2D("TOF700_TestStrips", ";Z,
75 // cm;#phi, rads", 2000, -300., 300., 500, -3.5, 3.5);
76 // fList.Add(h1TestStrips);
77
78 h2TestNeighborPair =
79 new TH2D("TOF700_TestNeighborPair",
80 "Neighbor strip pairs test;stripID1;stripID2", 100, -0.5,
81 49.5, 100, -0.5, 49.5);
82 fList.Add(h2TestNeighborPair);
83 h2TestXYSmeared =
84 new TH2D("TOF700_TestXYSmeared",
85 "Smeared XY (single hit) test;#DeltaX, cm;#DeltaY, cm",
86 1000, -1., 1., 1000, -2., 2.);
87 fList.Add(h2TestXYSmeared);
88 h2TestXYSmeared2 = new TH2D("TOF700_TestXYSmeared2",
89 "Smeared XY (single hit) test;X, cm;Y, cm",
90 1000, -180., 180., 1000, -180., 180.);
91 fList.Add(h2TestXYSmeared2);
92 h2TestXYSmearedDouble =
93 new TH2D("TOF700_TestXYSmearedDouble",
94 "Smeared XY (double hit) test;#DeltaX, cm;#DeltaY, cm",
95 1000, -2., 2., 1000, -2., 2.);
96 fList.Add(h2TestXYSmearedDouble);
97 h2TestXYSmearedDouble2 =
98 new TH2D("TOF700_TestXYSmearedDouble2",
99 "Smeared XY (double hit) test;X, cm;Y, cm", 1000, -180.,
100 180., 1000, -180., 180.);
101 fList.Add(h2TestXYSmearedDouble2);
102
103 h2TestEtaPhi = new TH2D("TOF700_TestEtaPhi", ";#eta;#phi, degree", 1000,
104 -5., +5., 1000, -181., 181.);
105 fList.Add(h2TestEtaPhi);
106 h2TestRZ = new TH2D("TOF700_TestRZ", ";X, cm;Y, cm", 1000, -300., 300.,
107 1000, -200., 200.);
108 fList.Add(h2TestRZ);
109 h2TdetIdStripId = new TH2D("TOF700_TdetIdStripId", ";stripId;detId",
110 100, -0.5, 99.5, 26, -0.5, 25.5);
111 fList.Add(h2TdetIdStripId);
112 h1TestMass = new TH1D("TOF700_TestMass", "Mass", 500, 0., 100.);
113 fList.Add(h1TestMass);
114 h1TestMassLong = new TH1D("TOF700_TestMassLong", "Mass - long tracks",
115 500, 0., 100.);
116 fList.Add(h1TestMassLong);
117 h1TestOccupancyTimeShift =
118 new TH1D("TOF700_TestOccupancyTimeShift", "Occupancy Time Shift",
119 100, -1., 1.);
120 fList.Add(h1TestOccupancyTimeShift);
121 h1TestOccupancyPositionShift =
122 new TH1D("TOF700_TestOccupancyPositionShift",
123 "Occupancy Position Shift", 200, -10., 10.);
124 fList.Add(h1TestOccupancyPositionShift);
125 }
126}
127
129 delete pRandom;
130 delete pGeoUtils;
131}
132
134 LOG(debug) << "Begin [BmnTof700HitProducer::Init].";
135
136 pRandom = new TRandom2;
137 pGeoUtils = new BmnTofGeoUtils(fUseMCData);
138 pGeoUtils->SetVerbosity(fVerbose);
139
140 if (fOnlyPrimary && fVerbose > 1)
141 LOG(info) << " Only primary particles are processed!!! ";
142
143 if (fUseMCData) {
144 aMcPoints = (TClonesArray *)FairRootManager::Instance()->GetObject(
145 "TOF700Point");
146 if (!aMcPoints) {
147 cout << "BmnTof700HitProducer::Init(): branch TOFPoint not found! "
148 "Task will be deactivated"
149 << endl;
150 SetActive(kFALSE);
151 return kERROR;
152 }
153 aMcTracks =
154 (TClonesArray *)FairRootManager::Instance()->GetObject("MCTrack");
155 if (!aMcTracks) {
156 cout << "BmnTof700HitProducer::Init(): branch MCTrack not found! "
157 "Task will be deactivated"
158 << endl;
159 SetActive(kFALSE);
160 return kERROR;
161 }
162 } else {
163 if (strstr(fgeomFile, "_run8"))
164 fTOF2 = new BmnTof2Raw2DigitNew("TOF700_map_period_8.txt",
165 "bmn_run6666_raw.root", 0, 0,
166 fgeomFile);
167 else
168 fTOF2 = new BmnTof2Raw2DigitNew("TOF700_map_period_7.txt",
169 "bmn_run3332_raw.root", 0, 0,
170 fgeomFile);
171
172 aExpDigits =
173 (TClonesArray *)FairRootManager::Instance()->GetObject("TOF700");
174 if (!aExpDigits) {
175 cout << "BmnTof700HitProducer::Init(): branch TOF700 not found! "
176 "Task will be deactivated"
177 << endl;
178 SetActive(kFALSE);
179 return kERROR;
180 }
181 if (fMCTimeFile == NULL) {
182 cout << "BmnTof700HitProducer::Init(): MC times file not defined! "
183 "Use default!"
184 << endl;
185 for (int c = 0; c < TOF2_MAX_CHAMBERS; c++) fMCTime[c] = 21.f;
186 } else {
187 readMCTimeFile(fMCTimeFile);
188 }
189 // Proton hit based corrections
190 for (int c = 0; c < TOF2_MAX_CHAMBERS; c++) {
191 tofcalc[c] = 0.f;
192 for (int s = 0; s < 32; s++) {
193 tofcals[c][s] = 0.f;
194 }
195 }
196 if (fProtonTimeCorrectionFile == NULL) {
197 cout << "BmnTof700HitProducer::Init(): Proton-based time "
198 "corrections file not defined! Don't use corrections!"
199 << endl;
200 } else {
201 TProfile2D *itcalibr = 0;
202 TProfile *itcalibrc = 0;
203 float idchambers[59] = {
204 27.1, 28.1, 3.1, 1.1, 29.1, 4.1, 33.1, 30.1, 5.1,
205 19.3, 31.1, 6.1, 2.1, 32.1, 15.2, 16.2, 17.2, 18.2,
206 19.2, 20.2, 7.1, 115.2, 113.1, 117.1, 35.1, 9.1, 37.1,
207 11.1, 39.1, 13.1, 34.1, 8.1, 36.1, 10.1, 38.1, 12.1,
208 21.2, 23.2, 25.2, 22.2, 24.2, 26.2, 107.2, 108.2, 109.2,
209 110.2, 111.2, 112.2, 114.1, 116.2, 118.1, 14.1, 40.1, 119.2,
210 120.2, 121.2, 122.2, 123.2, 124.2};
211 char fname[256];
212 TString dir = getenv("VMCWORKDIR");
213 sprintf(fname, "%s/input/%s", dir.Data(),
214 fProtonTimeCorrectionFile);
215 TFile *fc = new TFile(fname, "READ",
216 "Proton mass based calibration of BmnTOF700");
217 if (fc->IsZombie()) {
218 cout << "BmnTof700HitProducer::Init(): Error open Proton-based "
219 "time corrections file "
220 << fname << endl;
221 return kERROR;
222 }
223 if (CVERS == 0) {
224 itcalibr = (TProfile2D *)fc->Get("tcalibr");
225 itcalibrc = (TProfile *)fc->Get("tcalibrc");
226 } else {
227 itcalibr = (TProfile2D *)fc->Get("tcalibr;1");
228 itcalibrc = (TProfile *)fc->Get("tcalibrc;1");
229 }
230 for (int c = 0; c < TOF2_MAX_CHAMBERS; c++) {
231 tofcalc[c] = itcalibrc->GetBinContent(c + 1);
232 }
234 printf(
235 "\n ******************* Time offsets for whole chamber "
236 "**********************\n");
237 for (int c = 0; c < TOF2_MAX_CHAMBERS; c++) {
238 printf("%d %f\n", c, tofcalc[c]);
239 }
240 }
241 if (STRIP_CORRECTIONS) {
243 printf(
244 "\n ******************* Time offsets for each strip "
245 "**************************\n");
246 for (int c = 0; c < TOF2_MAX_CHAMBERS; c++) {
248 printf("\n Chamber %d %.1f\n", c, idchambers[c]);
249 int smax = 32;
250 if (idchambers[c] >= 100.f) smax = 16;
251 for (int s = 0; s < smax; s++) {
252 tofcals[c][s] = itcalibr->GetBinContent(c + 1, s + 1);
254 printf(" strip %d %f\n", s, tofcals[c][s]);
255 }
257 printf(
258 "\n "
259 "**************************************************"
260 "***********************\n");
261 }
262 }
263 fc->Close();
264 }
265 }
266
267 // Create and register output array
268 aTofHits = new TClonesArray("BmnTofHit");
269 FairRootManager::Instance()->Register("BmnTof700Hit", "TOF", aTofHits,
270 kTRUE);
271
272 // readGeom(geomFile);
273 pGeoUtils->ParseTGeoManager(fUseMCData, h2TestStrips, true);
274 // pGeoUtils->ParseStripsGeometry(fgeomFile);
275 pGeoUtils->FindNeighborStrips(h1TestDistance, h2TestNeighborPair, fDoTest);
276
277 LOG(debug)
278 << "Initialization [BmnTof700HitProducer::Init] finished succesfully.";
279
280 return kSUCCESS;
281}
282//--------------------------------------------------------------------------------------------------------------------------------------
283Bool_t BmnTofHitProducer::HitExist(
284 Double_t val) // val - distance to the pad edge [cm]
285{
286 const static Double_t slope = (0.98 - 0.95) / 0.2;
287 Double_t efficiency = (val > 0.2) ? 0.98 : (0.95 + slope * val);
288 //-------------------------------------
289 // 99% ---------
290 // /
291 // /
292 // /
293 // 95% /
294 // <-----------|--|
295 // 0.2 0.
296 //-------------------------------------
297 if (pRandom->Rndm() < efficiency) return true;
298 return false;
299}
300//------------------------------------------------------------------------------------------------------------------------
301Bool_t BmnTofHitProducer::DoubleHitExist(
302 Double_t val) // val - distance to the pad edge [cm]
303{
304 const static Double_t slope = (0.3 - 0.0) / 0.5;
305 Double_t efficiency = (val > 0.5) ? 0. : (0.3 - slope * val);
306
307 //-------------------------------------
308 // 30% /
309 // /
310 // /
311 // /
312 // 0% /
313 // <-----------|----|
314 // 0.5 0.
315 //-------------------------------------
316
317 if (efficiency == 0.) return false;
318
319 if (pRandom->Rndm() < efficiency) return HitExist(val);
320 return false;
321}
322//--------------------------------------------------------------------------------------------------------------------------------------
323void BmnTofHitProducer::Exec(Option_t *opt) {
324 TStopwatch sw;
325 sw.Start();
326
327 if (!IsActive()) return;
328
329 float idchambers[59] = {
330 27.1, 28.1, 3.1, 1.1, 29.1, 4.1, 33.1, 30.1, 5.1, 19.3,
331 31.1, 6.1, 2.1, 32.1, 15.2, 16.2, 17.2, 18.2, 19.2, 20.2,
332 7.1, 115.2, 113.1, 117.1, 35.1, 9.1, 37.1, 11.1, 39.1, 13.1,
333 34.1, 8.1, 36.1, 10.1, 38.1, 12.1, 21.2, 23.2, 25.2, 22.2,
334 24.2, 26.2, 107.2, 108.2, 109.2, 110.2, 111.2, 112.2, 114.1, 116.2,
335 118.1, 14.1, 40.1, 119.2, 120.2, 121.2, 122.2, 123.2, 124.2};
336
337 if (fVerbose > 1)
338 cout << endl
339 << "======================== TOF700 exec started "
340 "===================="
341 << endl;
342 static const TVector3 XYZ_err(fErrX, fErrY, 0.);
343
344 aTofHits->Clear();
345
346 Int_t UID, trackID;
347 TVector3 pos, XYZ_smeared, mom;
348 int nSingleHits = 0, nDoubleHits = 0;
349
350 if (fUseMCData) {
351 for (Int_t pointIndex = 0, nTofPoint = aMcPoints->GetEntriesFast();
352 pointIndex < nTofPoint; pointIndex++) // cycle by TOF points
353 {
354 BmnTOFPoint *pPoint =
355 (BmnTOFPoint *)aMcPoints->UncheckedAt(pointIndex);
356
357 if (fVerbose > 2) pPoint->Print("");
358
359 trackID = pPoint->GetTrackID();
360 UID = pPoint->GetDetectorID();
361 if (UID == 1) continue; // TMP!!!
362 Double_t time = 0.;
363 if (OCCUPANCY)
364 time = pPoint->GetTime(); // time rsolution in ps
365 else
366 time = pRandom->Gaus(pPoint->GetTime(),
367 fTimeSigma); // time rsolution in ps
368 Double_t length = pRandom->Gaus(pPoint->GetLength(), 1.); // 1 cm
369 pPoint->Position(pos);
370 pPoint->Momentum(mom);
371 Double_t p = mom.Mag();
372 p = p * (1. + pRandom->Gaus(0.04 * p)); // momentum resolution 4%
373 Double_t cvel = 29.97925;
374 Double_t ct = cvel * time;
375 Double_t ctl = ct / length;
376 Double_t sqr = TMath::Sqrt(ctl * ctl - 1.);
377 Double_t mass = p * sqr;
378 Double_t elcut = 0.; // 0.02e-3;
379 if (fDoTest)
380 if (pPoint->GetEnergyLoss() > elcut) h1TestMass->Fill(mass);
381 if (fDoTest)
382 if (pPoint->GetEnergyLoss() > elcut && length > 600.)
383 h1TestMassLong->Fill(mass);
384 // const LStrip *pStrip = pGeoUtils->FindStrip(UID,
385 //pos);
386 const LStrip *pStrip = pGeoUtils->FindStrip(UID);
387 if (pStrip == NULL) continue;
388
389 // if (UID == ((19<<8)|32)) printf("Hit x %f y %f z
390 //%f, strip x %f y %f z %f\n", pos.X(), pos.Y(), pos.Z(),
391 //pStrip->center.X(), pStrip->center.Y(), pStrip->center.Z());
392
393 if (OCCUPANCY)
394 XYZ_smeared.SetXYZ(pos.X(), pStrip->center.Y(),
395 pStrip->center.Z());
396 else
397 XYZ_smeared.SetXYZ(pRandom->Gaus(pos.X(), fErrX),
398 pStrip->center.Y(), pStrip->center.Z());
399
400 LStrip::Side_t side;
401 Double_t distance = pStrip->MinDistanceToEdge(&pos, side); // [cm]
402
403 bool passed;
404 if ((passed = HitExist(distance)) == true) // check efficiency
405 {
406 AddHit(UID, XYZ_smeared, XYZ_err, pointIndex, trackID, time);
407 nSingleHits++;
408
409 if (fDoTest) {
410 Int_t strip = BmnTOFPoint::GetStrip(UID);
411 Int_t chamber = BmnTOFPoint::GetChamber(UID);
412 h2TestXYSmeared->Fill(pos.X() - XYZ_smeared.X(),
413 pos.Y() - XYZ_smeared.Y());
414 h2TestXYSmeared2->Fill(XYZ_smeared.X(), XYZ_smeared.Y());
415 h2TestEtaPhi->Fill(pos.Eta(),
416 pos.Phi() * TMath::RadToDeg());
417 h2TestRZ->Fill(pos.X(), pos.Y());
418 h2TdetIdStripId->Fill(strip, chamber);
419 }
420 }
421
422 if (fDoTest) effTestEfficiencySingleHit->Fill(passed, distance);
423
424 // if((passed = DoubleHitExist(distance))) // check
425 // cross hit
426 if (false) // check efficiency
427 {
428 Int_t CrossUID = (side == LStrip::kUpper)
429 ? pStrip->neighboring[LStrip::kUpper]
430 : pStrip->neighboring[LStrip::kLower];
431
432 if (LStrip::kInvalid == CrossUID)
433 continue; // last strip on module
434
435 pStrip = pGeoUtils->FindStrip(CrossUID);
436 XYZ_smeared.SetXYZ(pRandom->Gaus(pos.X(), fErrX),
437 pStrip->center.Y(), pStrip->center.Z());
438
439 AddHit(CrossUID, XYZ_smeared, XYZ_err, pointIndex, trackID,
440 time);
441 nDoubleHits++;
442
443 if (fDoTest) {
444 h2TestXYSmearedDouble->Fill((pos - XYZ_smeared).Mag(),
445 pos.Z() - XYZ_smeared.Z());
446 h2TestXYSmearedDouble2->Fill(XYZ_smeared.X(),
447 XYZ_smeared.Y());
448 }
449 }
450
451 if (fDoTest) effTestEfficiencyDoubleHit->Fill(passed, distance);
452
453 } // cycle by the TOF points
454 } else {
455 TVector3 crosspoint;
456 Int_t tofWidths[TOF2_MAX_CHAMBERS][32] = {{0}};
457 Float_t tof[TOF2_MAX_CHAMBERS][32] = {{0.}};
458 Float_t lrdiff[TOF2_MAX_CHAMBERS][32] = {{0.}};
459 if (MAKE_CLUSTERS) {
460 for (Int_t digitIndex = 0,
461 nTof2Digits = aExpDigits->GetEntriesFast();
462 digitIndex < nTof2Digits; digitIndex++) // cycle by TOF digits
463 {
464 BmnTof2Digit *pDigit =
465 (BmnTof2Digit *)aExpDigits->UncheckedAt(digitIndex);
466 UID =
467 ((pDigit->GetPlane() + 1) << 8) | (pDigit->GetStrip() + 1);
468 Int_t strip = pDigit->GetStrip();
469 Int_t chamber = pDigit->GetPlane();
470 tofWidths[chamber][strip] = pDigit->GetAmplitude();
471 tof[chamber][strip] = pDigit->GetTime();
472 lrdiff[chamber][strip] = pDigit->GetDiff();
473 }
474 int ncl0 = 0, ncl[TOF2_MAX_CHAMBERS] = {0};
475 //int clchamb[TOF2_MAX_CHAMBERS] = {0};
476 //int clstrip[TOF2_MAX_CHAMBERS] = {0};
477 for (int i = 0; i < TOF2_MAX_CHAMBERS; i++) {
478 if (fMCTimeFile && fMCTime[i] == 0.f) continue;
479 Double_t DiffTimeMax = fDiffTimeMaxSmall;
480 if (idchambers[i] >= 100.f) DiffTimeMax = fDiffTimeMaxBig;
481 ncl[i] = 0;
482 int clstart = -1, /*clwidth = -1, */cstr = -1;
483 float samps = 0., timemin = 1000000000., amplmax = 0.;
484 int nstr = 32;
485 if (idchambers[i] >= 100.f) nstr = 16;
486 for (int j = 0; j < nstr; j++) {
487 if (tofWidths[i][j] > 0.) {
488 if (clstart < 0) {
489 clstart = j;
490 timemin = tof[i][j];
491 amplmax = tofWidths[i][j];
492 cstr = j;
493 } else {
494 if (fMainStripSelection == 0 &&
495 tof[i][j] < timemin) {
496 timemin = tof[i][j];
497 cstr = j;
498 }
499 if (fMainStripSelection != 0 &&
500 tofWidths[i][j] > amplmax) {
501 amplmax = tofWidths[i][j];
502 cstr = j;
503 }
504 }
505 samps += tofWidths[i][j];
506 if (j == (nstr - 1)) {
507 if (tof[i][cstr] > fTimeMin &&
508 tof[i][cstr] < fTimeMax &&
509 TMath::Abs(lrdiff[i][cstr]) < DiffTimeMax) {
510 //clchamb[ncl0] = i;
511 //clstrip[ncl0] = cstr;
512 //clwidth = (j + 1 - clstart);
513 ncl0++;
514 ncl[i]++;
515 UID = ((i + 1) << 8) | (cstr + 1);
516 Float_t xcl, ycl, zcl;
517 if (fSelectXYCalibration == 0)
518 fTOF2->get_hit_xyz(i, cstr, lrdiff[i][cstr],
519 &xcl, &ycl, &zcl);
520 else if (fSelectXYCalibration == 1)
521 fTOF2->get_hit_xyzp(i, cstr,
522 lrdiff[i][cstr], &xcl,
523 &ycl, &zcl);
524 else if (fSelectXYCalibration == 2)
525 fTOF2->get_hit_xyzng(i, cstr,
526 lrdiff[i][cstr], &xcl,
527 &ycl, &zcl);
528 else if (fSelectXYCalibration == 3)
529 fTOF2->get_hit_xyznl(i, cstr,
530 lrdiff[i][cstr], &xcl,
531 &ycl, &zcl);
532 else
533 fTOF2->get_hit_xyzng(i, cstr,
534 lrdiff[i][cstr], &xcl,
535 &ycl, &zcl);
536 if (zcl == 0.) {
537 fTOF2->get_hit_xyz(i, cstr, lrdiff[i][cstr],
538 &xcl, &ycl, &zcl);
539 }
540 if (zcl != 0.) {
541 crosspoint.SetXYZ(xcl, ycl, zcl);
543 AddHit(UID, crosspoint, XYZ_err, -1, -1,
544 tof[i][cstr] + fMCTime[i] +
545 tofcals[i][cstr]);
546 else
547 AddHit(UID, crosspoint, XYZ_err, -1, -1,
548 tof[i][cstr] + fMCTime[i] +
549 tofcalc[i]);
550 nSingleHits++;
551
552 if (fDoTest) {
553 h2TestXYSmeared2->Fill(crosspoint.X(),
554 crosspoint.Y());
555 Float_t xc, yc, zc;
556 fTOF2->get_strip_xyz(i, cstr, &xc, &yc,
557 &zc);
558 h2TestRZ->Fill(xc, yc);
559 }
560 }
561 }
562 samps = 0.;
563 timemin = 1000000000.;
564 amplmax = 0.;
565 }
566 } else if (clstart >= 0) {
567 if (tof[i][cstr] > fTimeMin &&
568 tof[i][cstr] < fTimeMax &&
569 TMath::Abs(lrdiff[i][cstr]) < DiffTimeMax) {
570 //clchamb[ncl0] = i;
571 //clstrip[ncl0] = cstr;
572 //clwidth = (j - clstart);
573 ncl0++;
574 ncl[i]++;
575 UID = ((i + 1) << 8) | (cstr + 1);
576 Float_t xcl = 0., ycl = 0., zcl = 0.;
577 if (fSelectXYCalibration == 0)
578 fTOF2->get_hit_xyz(i, cstr, lrdiff[i][cstr],
579 &xcl, &ycl, &zcl);
580 else if (fSelectXYCalibration == 1)
581 fTOF2->get_hit_xyzp(i, cstr, lrdiff[i][cstr],
582 &xcl, &ycl, &zcl);
583 else if (fSelectXYCalibration == 2)
584 fTOF2->get_hit_xyzng(i, cstr, lrdiff[i][cstr],
585 &xcl, &ycl, &zcl);
586 else if (fSelectXYCalibration == 3)
587 fTOF2->get_hit_xyznl(i, cstr, lrdiff[i][cstr],
588 &xcl, &ycl, &zcl);
589 else
590 fTOF2->get_hit_xyzng(i, cstr, lrdiff[i][cstr],
591 &xcl, &ycl, &zcl);
592 if (zcl == 0.) {
593 fTOF2->get_hit_xyz(i, cstr, lrdiff[i][cstr],
594 &xcl, &ycl, &zcl);
595 }
596 if (zcl != 0.) {
597 crosspoint.SetXYZ(xcl, ycl, zcl);
599 AddHit(UID, crosspoint, XYZ_err, -1, -1,
600 tof[i][cstr] + fMCTime[i] +
601 tofcals[i][cstr]);
602 else
603 AddHit(
604 UID, crosspoint, XYZ_err, -1, -1,
605 tof[i][cstr] + fMCTime[i] + tofcalc[i]);
606 nSingleHits++;
607
608 if (fDoTest) {
609 h2TestXYSmeared2->Fill(crosspoint.X(),
610 crosspoint.Y());
611 Float_t xc, yc, zc;
612 fTOF2->get_strip_xyz(i, cstr, &xc, &yc,
613 &zc);
614 h2TestRZ->Fill(xc, yc);
615 }
616 }
617 }
618 samps = 0.;
619 timemin = 1000000000.;
620 amplmax = 0.;
621 clstart = -1;
622 }
623 }
624 }
625 } else {
626 for (Int_t digitIndex = 0,
627 nTof2Digits = aExpDigits->GetEntriesFast();
628 digitIndex < nTof2Digits; digitIndex++) // cycle by TOF digits
629 {
630 BmnTof2Digit *pDigit =
631 (BmnTof2Digit *)aExpDigits->UncheckedAt(digitIndex);
632 UID =
633 ((pDigit->GetPlane() + 1) << 8) | (pDigit->GetStrip() + 1);
634 Int_t strip = pDigit->GetStrip();
635 Int_t chamber = pDigit->GetPlane();
636 if (fMCTimeFile && fMCTime[chamber] == 0.f) continue;
637 // if (chamber > 40 && strip > 15)
638 //continue; printf("C %d s %d\n",pDigit->GetPlane(),
639 //pDigit->GetStrip());
640 // pos.SetXYZ(xcens[chamber][strip],ycens[chamber][strip],zchamb[chamber]);
641 Float_t dtime = pDigit->GetTime();
642 Float_t dlrdiff = pDigit->GetDiff();
643 if (dtime < fTimeMin || dtime > fTimeMax) continue;
644 Double_t DiffTimeMax = fDiffTimeMaxSmall;
645 if (idchambers[chamber] >= 100.f) DiffTimeMax = fDiffTimeMaxBig;
646 if (TMath::Abs(dlrdiff) > DiffTimeMax) continue;
647 const LStrip *pStrip = pGeoUtils->FindStrip(UID);
648 Float_t xcl = 0., ycl = 0., zcl = 0.;
649 if (fSelectXYCalibration == 0)
650 fTOF2->get_hit_xyz(chamber, strip, dlrdiff, &xcl, &ycl,
651 &zcl);
652 else if (fSelectXYCalibration == 1)
653 fTOF2->get_hit_xyzp(chamber, strip, dlrdiff, &xcl, &ycl,
654 &zcl);
655 else if (fSelectXYCalibration == 2)
656 fTOF2->get_hit_xyzng(chamber, strip, dlrdiff, &xcl, &ycl,
657 &zcl);
658 else if (fSelectXYCalibration == 3)
659 fTOF2->get_hit_xyznl(chamber, strip, dlrdiff, &xcl, &ycl,
660 &zcl);
661 else
662 fTOF2->get_hit_xyzng(chamber, strip, dlrdiff, &xcl, &ycl,
663 &zcl);
664 if (zcl == 0.) {
665 fTOF2->get_hit_xyz(chamber, strip, dlrdiff, &xcl, &ycl,
666 &zcl);
667 }
668 if (zcl != 0.) {
669 crosspoint.SetXYZ(xcl, ycl, zcl);
671 AddHit(
672 UID, crosspoint, XYZ_err, -1, -1,
673 dtime + fMCTime[chamber] + tofcals[chamber][strip]);
674 else
675 AddHit(UID, crosspoint, XYZ_err, -1, -1,
676 dtime + fMCTime[chamber] + tofcalc[chamber]);
677 nSingleHits++;
678
679 if (fDoTest) {
680 h2TestXYSmeared2->Fill(crosspoint.X(), crosspoint.Y());
681 TVector3 stripCenter(pStrip->center);
682 h2TestRZ->Fill(stripCenter.X(), stripCenter.Y());
683 }
684 }
685 }
686 }
687 }
688 if (OCCUPANCY)
689 {
690 if (fUseMCData)
691 MergeHitsOnStripNew(); // simulation realistic response - several
692 // tracks hits in the strip
693 else if (fUseMCData)
694 MergeHitsOnStrip(); // save only the fastest hit in the strip
695 }
696
697 int nFinally = CompressHits(); // remove blank slotes
698
699 sw.Stop();
700 workTime += sw.RealTime();
701
702 if (fVerbose > 1)
703 cout << "BmnTof700HitProducer: single hits= " << nSingleHits
704 << ", double hits= " << nDoubleHits << ", final hits= " << nFinally
705 << endl;
706 if (fVerbose == 1)
707 cout << "BmnTof700HitProducer: " << nFinally << " hits" << endl;
708 if (fVerbose > 1)
709 cout << "======================== TOF700 exec finished "
710 "==================="
711 << endl;
712}
713//--------------------------------------------------------------------------------------------------------------------------------------
715 if (fDoTest) {
716 LOG(info) << "[BmnTof700HitProducer::Finish] Update "
717 << fTestFlnm.Data() << " file.";
718 TFile *ptr = gFile;
719 TFile file(fTestFlnm.Data(), "RECREATE");
720 fList.Write();
721 file.Close();
722 gFile = ptr;
723 }
724
725 printf("Work time of BmnTofHitProducer: %4.2f sec.\n", workTime);
726}
727//------------------------------------------------------------------------------------------------------------------------
728Int_t BmnTofHitProducer::MergeHitsOnStripNew(void) {
729 typedef map<Int_t, BmnTofHit *> hitsMapType;
730 hitsMapType fHits; // pair<detectorUID, BmnTofHit*> fastest hits map
731 hitsMapType::iterator it;
732 Int_t mergedNmb = 0;
733 Double_t tarrive[70000][2] = {{0.}};
734 Double_t tarrive0[70000][2] = {{0.}};
735 Double_t tarrivemin[70000] = {0.};
736 Double_t tarr[2] = {0.};
737 //Double_t tarr1[2] = {0.};
738
739 typedef multiset<Int_t> msUIDsType; // detectorUID for Hits
740 msUIDsType UIDs;
741
742 if (OCCUPANCY_DEBUG) printf(" *********** New event ****************\n");
743
744 BmnTofHit *fastHit, *slowHit;
745 for (Int_t hitIndex = 0, nHits = aTofHits->GetEntriesFast();
746 hitIndex < nHits; hitIndex++) // cycle by hits
747 {
748 BmnTofHit *pHit = (BmnTofHit *)aTofHits->UncheckedAt(hitIndex);
749 assert(nullptr != pHit);
750
751 Int_t UID = pHit->GetDetectorID();
752 if (UID >= 70000) continue;
753
754 if (fDoTest) UIDs.insert(UID);
755
756 const LStrip *pStrip = pGeoUtils->FindStrip(UID);
757 if (pStrip == NULL) continue;
758 TVector3 pos;
759 pHit->Position(pos);
760 //Int_t side;
761 Double_t distance1 = pStrip->DistanceFromPointToLineSegment(
762 &pos, pStrip->A, pStrip->D); // right side, [cm]
763 Double_t distance2 = pStrip->DistanceFromPointToLineSegment(
764 &pos, pStrip->B, pStrip->C); // left side, [cm]
765 tarr[0] = pHit->GetTimeStamp() +
766 distance1 * fSignalVelosity; // right side, [ns]
767 tarr[1] = pHit->GetTimeStamp() +
768 distance2 * fSignalVelosity; // left side, [ns]
769 Double_t tarrmin = tarr[0];
770 if (tarr[1] < tarrmin) tarrmin = tarr[1];
771 it = fHits.find(UID);
772
773 if (it != fHits.end()) // hit for this detectorUID already exist
774 {
775 mergedNmb++;
776 if (OCCUPANCY_DEBUG)
777 printf("Chamber %2d strip %2d before %f %f\n", UID >> 8,
778 UID & 0xFF, tarrive[UID][0], tarrive[UID][1]);
779 // printf(" distance %f %f\n",distance1, distance2);
780 if (tarrmin < tarrivemin[UID]) {
781 tarrivemin[UID] = tarrmin;
782 fastHit = pHit;
783 slowHit = it->second;
784 tarrive0[UID][0] = tarr[0];
785 tarrive0[UID][1] = tarr[1];
786 } else {
787 fastHit = it->second;
788 slowHit = pHit;
789 }
790 if (tarr[0] < tarrive[UID][0]) // faster hit found on side 0
791 {
792 tarrive[UID][0] = tarr[0];
793 fastHit->SetFlag(kFALSE);
794 }
795 if (tarr[1] < tarrive[UID][1]) // faster hit found on side 1
796 {
797 tarrive[UID][1] = tarr[1];
798 fastHit->SetFlag(kFALSE);
799 }
800 if (OCCUPANCY_DEBUG)
801 printf(" after %f %f\n", tarrive[UID][0],
802 tarrive[UID][1]);
803
804 if (fDoTest)
805 h2TestMergedTimes->Fill(fastHit->GetTimeStamp(),
806 slowHit->GetTimeStamp());
807
808 fastHit->AddLinks(slowHit->GetLinks()); // copy links
809 aTofHits->Remove(
810 slowHit); // remove old hit --> make blank slote !!
811 it->second = fastHit; // change pair value to current UID
812 } else // insert new detectorUID pair
813 {
814 fHits.insert(make_pair(UID, pHit));
815 tarrive[UID][0] = tarr[0];
816 tarrive[UID][1] = tarr[1];
817 tarrive0[UID][0] = tarr[0];
818 tarrive0[UID][1] = tarr[1];
819 if (tarr[0] < tarr[1])
820 tarrivemin[UID] = tarr[0];
821 else
822 tarrivemin[UID] = tarr[1];
823 if (OCCUPANCY_DEBUG)
824 printf("Chamber %2d strip %2d start %f %f\n", UID >> 8,
825 UID & 0xFF, tarrive[UID][0], tarrive[UID][1]);
826 }
827
828 } // cycle by hits
829
830 if (OCCUPANCY_DEBUG)
831 printf(" -------------------- Results ------------------\n");
832
833 for (Int_t hitIndex = 0, nHits = aTofHits->GetEntriesFast();
834 hitIndex < nHits; hitIndex++) // cycle by hits
835 {
836 BmnTofHit *pHit = (BmnTofHit *)aTofHits->UncheckedAt(hitIndex);
837 // BmnTofHit *pHit = (BmnTofHit*) aTofHits->At(hitIndex);
838 // assert(nullptr != pHit);
839 if (pHit == nullptr) continue;
840
841 Int_t UID = pHit->GetDetectorID();
842 if (UID >= 70000) continue;
843
844 // if (pHit->GetFlag()) continue;
845
846 const LStrip *pStrip = pGeoUtils->FindStrip(UID);
847 if (pStrip == NULL) continue;
848
849 Double_t ta1 = tarrive[UID][0];
850 Double_t ta2 = tarrive[UID][1];
851 Double_t ta = 0.5 * (ta1 + ta2);
852 Double_t lstrip = (pStrip->B - pStrip->A).X();
853 ta -= (0.5 * lstrip * fSignalVelosity);
854 Double_t dxh = 0.5 * (ta1 - ta2) / fSignalVelosity;
855 Double_t xh = pStrip->center.X() + dxh;
856 TVector3 pos;
857 pHit->Position(pos);
858 Double_t told = pHit->GetTimeStamp();
859 if (fDoTest && !(pHit->GetFlag()))
860 h1TestOccupancyTimeShift->Fill(ta - told);
861 if (fDoTest && !(pHit->GetFlag()))
862 h1TestOccupancyPositionShift->Fill(xh - pos.X());
863 if (OCCUPANCY_DEBUG) {
864 printf("Chamber %2d strip %2d result %f %f lstrip %f shift %f\n",
865 UID >> 8, UID & 0xFF, tarrive[UID][0], tarrive[UID][1],
866 lstrip, 0.5 * lstrip * fSignalVelosity);
867 printf(" time: old %f new %f\n", told, ta);
868 printf(" tim0: old %f old %f diff %f\n",
869 tarrive0[UID][0], tarrive0[UID][1],
870 tarrive0[UID][0] - tarrive0[UID][1]);
871 printf(" tim0: new %f new %f diff %f\n",
872 tarrive[UID][0], tarrive[UID][1],
873 tarrive[UID][0] - tarrive[UID][1]);
874 printf(" posx: old %f new %f\n", pos.X(), xh);
875 printf(" posy: old %f new %f\n", pos.Y(),
876 pos.Y());
877 printf(" posz: old %f new %f\n", pos.Z(),
878 pos.Z());
879 }
880 ta = pRandom->Gaus(ta, fTimeSigma); // time resolution in ns
881 pos.SetX(pRandom->Gaus(xh, fErrX));
882 pHit->SetPosition(pos);
883 pHit->SetTimeStamp(ta);
884 } // cycle by hits
885
886 // cycle by detector UIDs list
887 if (fDoTest)
888 for (msUIDsType::const_iterator it1 = UIDs.begin(), itEnd = UIDs.end();
889 it1 != itEnd; it1 = UIDs.upper_bound(*it1))
890 h1TestOccup->Fill(UIDs.count(*it1));
891
892 return mergedNmb;
893}
894//--------------------------------------------------------------------------------------------------------------------------------------
895// input- strip edge position & signal times; output- strip crosspoint; return
896// false, if crosspoint outside strip
897bool BmnTofHitProducer::GetCrossPoint(const TVector3 &p1, double time1,
898 const TVector3 &p2, double time2,
899 TVector3 &crossPoint) {
900 double stripLength = (p2 - p1).Mag();
901 double maxDelta =
902 (stripLength + 0.5) * fSignalVelosity; // + 5 mm on the strip edge
903 if (abs(time1 - time2) > maxDelta)
904 return false; // estimated position out the strip edge.
905 double dL = abs(time1 - time2) / fSignalVelosity;
906 double a2 = (stripLength - dL) / 2.;
907 if (time1 > time2)
908 crossPoint = p2 + (p1 - p2) * (a2 / stripLength);
909 else
910 crossPoint = p1 + (p2 - p1) * (a2 / stripLength);
911 return true;
912}
913
914bool BmnTofHitProducer::GetCrossPoint(const LStrip *pStrip, double dT,
915 TVector3 &crossPoint) {
916 TVector3 s1, s2, centr;
917 s1 = (pStrip->A + pStrip->D) * 0.5; // [cm] strip side1 end's position
918 s2 = (pStrip->B + pStrip->C) * 0.5; // [cm] strip side2 end's position
919 centr = pStrip->center;
920 double stripLength = (s2 - s1).Mag();
921 double maxDelta =
922 (stripLength + 1.0) * fSignalVelosity; // + 10 mm on the strip edge
923 if (abs(dT) > maxDelta)
924 return false; // estimated position out the strip edge.
925 double dL = dT / fSignalVelosity;
926 s1(0) = dL;
927 s1(1) = 0;
928 s1(2) = 0; // TMP ALIGMENT CORRECTIONS
929 crossPoint = centr + s1;
930 /*if (time1 > time2)
931 {
932 cout << "stripLength = " << stripLength << " dL = " << dL << endl;
933 cout << "centr.x = " << centr(0) << "; centr.y = " << centr(1) << ";
934 centr.z = " << centr(2) << endl; cout << "crossPoint.x = " <<
935 crossPoint(0) << "; crossPoint.y = " << crossPoint(1) << "; crossPoint.z
936 = " << crossPoint(2) << endl; getchar();
937 }//*/
938 return true;
939}
940//--------------------------------------------------------------------------------------------------------------------------------------
941void BmnTofHitProducer::SetSeed(UInt_t seed) { pRandom->SetSeed(seed); }
942//--------------------------------------------------------------------------------------------------------------------------------------
943
944Double_t BmnTofHitProducer::CalculateToF(BmnTof2Digit *d1, BmnTof2Digit *d2,
945 BmnTrigDigit *t0) {
946 Int_t CorrRPC_It1, CorrT0_It1;
947 Double_t CorrPlane7Coeff_It1[5][4] = {{12.24, -3.919, 0.2624, -0.005153},
948 {-122.9, 14.84, -0.6158, 0.008724},
949 {-12.34, 0.482, 0., 0.},
950 {-12.28, 0.479, 0., 0.},
951 {-13.14, 0.5034, 0., 0.}};
952 Double_t CorrT0Coeff_It1[3][4] = {{-5.486, 1.087, -0.07936, 0.00208},
953 {10.77, -2.635, 0.1984, -0.004631},
954 {0., 0., 0., 0.}};
955 Double_t timeRPC = (d1->GetTime() + d2->GetTime()) * 0.5;
956 Double_t ampRPC = d1->GetAmplitude() + d2->GetAmplitude();
957 Double_t timeT0 = t0->GetTime();
958 Double_t ampT0 = t0->GetAmp();
959 Double_t dt = timeRPC - timeT0;
960 if (ampRPC < 20.46)
961 CorrRPC_It1 = 0;
962 else if (ampRPC >= 20.46 && ampRPC < 27.25)
963 CorrRPC_It1 = 1;
964 else if (ampRPC >= 27.25 && ampRPC < 34.81)
965 CorrRPC_It1 = 2;
966 else if (ampRPC >= 34.81 && ampRPC < 37.11)
967 CorrRPC_It1 = 3;
968 else if (ampRPC >= 37.11)
969 CorrRPC_It1 = 4;
970 dt = dt - (CorrPlane7Coeff_It1[CorrRPC_It1][0] +
971 CorrPlane7Coeff_It1[CorrRPC_It1][1] * ampRPC +
972 CorrPlane7Coeff_It1[CorrRPC_It1][2] * ampRPC * ampRPC +
973 CorrPlane7Coeff_It1[CorrRPC_It1][3] * ampRPC * ampRPC * ampRPC);
974 if (ampT0 >= 6.15 && ampT0 < 12.3)
975 CorrT0_It1 = 0;
976 else if (ampT0 >= 12.3 && ampT0 < 17.14)
977 CorrT0_It1 = 1;
978 else
979 CorrT0_It1 = 2;
980 dt = dt - (CorrT0Coeff_It1[CorrT0_It1][0] +
981 CorrT0Coeff_It1[CorrT0_It1][1] * ampT0 +
982 CorrT0Coeff_It1[CorrT0_It1][2] * ampT0 * ampT0 +
983 CorrT0Coeff_It1[CorrT0_It1][3] * ampT0 * ampT0 * ampT0);
984 return dt + 14.; // 14 ns
985}
986
987//------------------------------------------------------------------------------------------------------------------------
988int BmnTofHitProducer::readMCTimeFile(const char *MCTimeFile) {
989 // cout << "readMCTimeFile: " << MCTimeFile << endl;
990 float idchambers[59] = {
991 27.1, 28.1, 3.1, 1.1, 29.1, 4.1, 33.1, 30.1, 5.1, 19.3,
992 31.1, 6.1, 2.1, 32.1, 15.2, 16.2, 17.2, 18.2, 19.2, 20.2,
993 7.1, 115.2, 113.1, 117.1, 35.1, 9.1, 37.1, 11.1, 39.1, 13.1,
994 34.1, 8.1, 36.1, 10.1, 38.1, 12.1, 21.2, 23.2, 25.2, 22.2,
995 24.2, 26.2, 107.2, 108.2, 109.2, 110.2, 111.2, 112.2, 114.1, 116.2,
996 118.1, 14.1, 40.1, 119.2, 120.2, 121.2, 122.2, 123.2, 124.2};
997 bool notused[59] = {true};
998 int order[59] = {-1};
999 int c = 0, cmin = -1, c0 = 0;
1000 float idmin = 200.f;
1001 for (c0 = 0; c0 < 59; c0++) {
1002 notused[c0] = true;
1003 order[c0] = -1;
1004 }
1005 for (c0 = 0; c0 < 59; c0++) {
1006 cmin = -1;
1007 idmin = 200.f;
1008 for (c = 0; c < 59; c++) {
1009 if (notused[c] && (idchambers[c] < idmin)) {
1010 idmin = idchambers[c];
1011 cmin = c;
1012 }
1013 }
1014 // printf("c0 %d cmin %d notused
1015 //%d\n",c0,cmin,(int)notused[cmin]);
1016 if (cmin >= 0) {
1017 notused[cmin] = false;
1018 order[c0] = cmin;
1019 }
1020 }
1021 char fname[128];
1022 FILE *ft = 0;
1023 float time = 0.f, timesigma = 0.f;
1024 if (MCTimeFile == NULL) {
1025 printf("TOF700 MC time-of-flight file name not defined!\n");
1026 return 0;
1027 }
1028 if (strlen(MCTimeFile) == 0) {
1029 printf("TOF700 MC time-of-flight file name not defined!\n");
1030 return 0;
1031 }
1032 TString dir = getenv("VMCWORKDIR");
1033 sprintf(fname, "%s/geometry/%s", dir.Data(), MCTimeFile);
1034 ft = fopen(fname, "r");
1035 if (ft == NULL) {
1036 printf("TOF700 MC time-of-flight file %s open error!\n", fname);
1037 return 0;
1038 }
1039 for (int i = 0; i < TOF2_MAX_CHAMBERS; i++) fMCTime[i] = 21.f;
1040 for (int i = 0; i < TOF2_MAX_CHAMBERS; i++) fMCTimeSigma[i] = 0.f;
1041 int cexp = 0, ic = -1;
1042 while (fscanf(ft, "%d %f %f\n", &ic, &time, &timesigma) == 3) {
1043 if (ic > 0 && ic <= 59) {
1044 cexp = order[ic - 1];
1045 fMCTime[cexp] = time;
1046 fMCTimeSigma[cexp] = timesigma;
1047 if (fVerbose == 1)
1048 printf(
1049 "Chamber %.1f (MC %d, EXP %d) average time-of-flight %f "
1050 "with sigma %f\n",
1051 idchambers[cexp], ic, cexp, time, timesigma);
1052 }
1053 }
1054 fclose(ft);
1055 return 1;
1056}
1057
1058void BmnTofHitProducer::OnlineWrite(const std::unique_ptr<TTree> &resultTree) {
1059 if (!IsActive()) return;
1060
1061 resultTree->Branch("BmnTof700Hit", &aTofHits);
1062 resultTree->Fill();
1063}
#define OCCUPANCY
#define OCCUPANCY_DEBUG
#define MAKE_CLUSTERS
#define CVERS
#define TOF2_MAX_CHAMBERS
#define LIST_STRIP_CORRECTIONS
#define STRIP_CORRECTIONS
#define LIST_CHAMBER_CORRECTIONS
int i
Definition P4_F32vec4.h:22
Bool_t GetFlag() const
Definition BmnHit.h:33
void SetFlag(Bool_t fl)
Definition BmnHit.h:49
Short_t GetPlane() const
Short_t GetStrip() const
Float_t GetTime() const
Float_t GetAmplitude() const
void get_hit_xyzp(int chamber, int strip, float diff, float *x, float *y, float *z)
int get_strip_xyz(int chamber, int strip, float *x, float *y, float *z)
void get_hit_xyzng(int chamber, int strip, float diff, float *x, float *y, float *z)
void get_hit_xyz(int chamber, int strip, float diff_corrected, float *x, float *y, float *z)
void get_hit_xyznl(int chamber, int strip, float diff, float *x, float *y, float *z)
BmnTofHitProducer(const char *name="TOF HitProducer", const char *geomFile="", Bool_t useMCdata=true, Int_t verbose=1, Bool_t DoTest=false)
virtual void OnlineWrite(const std::unique_ptr< TTree > &resultTree)
int readMCTimeFile(const char *)
void SetSeed(UInt_t seed=0)
virtual void Exec(Option_t *opt)
virtual InitStatus Init()
Double_t GetAmp() const
Double_t GetTime() const
Double_t CorrPlane7Coeff_It1[5][4]
Double_t CorrT0Coeff_It1[4][4]
STL namespace.