CbmRoot
CbmTofTBClusterizer.cxx
Go to the documentation of this file.
1 /*
2  * To change this license header, choose License Headers in Project Properties.
3  * To change this template file, choose Tools | Templates
4  * and open the template in the editor.
5  */
6 
7 #include "CbmTofTBClusterizer.h"
8 #include "CbmDefs.h"
9 #include "CbmMatch.h"
10 #include "CbmTofGeoHandler.h"
11 #include "CbmTofHit.h"
12 #include "CbmTofPoint.h"
13 #include "FairEventHeader.h"
14 #include "FairLogger.h"
15 #include "FairMCEventHeader.h"
16 #include "FairRunAna.h"
17 #include "FairRunSim.h"
18 #include "FairRuntimeDb.h"
19 #include "TClonesArray.h"
20 #include "TGeoManager.h"
21 #include "TH1.h"
22 
23 #ifdef __MACH__
24 #include <mach/mach_time.h>
25 #include <sys/time.h>
26 #ifndef CLOCK_REALTIME
27 #define CLOCK_REALTIME 0
28 #endif
29 #ifndef CLOCK_MONOTONIC
30 #define CLOCK_MONOTONIC 0
31 #endif
32 inline int clock_gettime(int clk_id, struct timespec* t) {
33  mach_timebase_info_data_t timebase;
34  mach_timebase_info(&timebase);
35  uint64_t time;
36  time = mach_absolute_time();
37  double nseconds =
38  ((double) time * (double) timebase.numer) / ((double) timebase.denom);
39  double seconds =
40  ((double) time * (double) timebase.numer) / ((double) timebase.denom * 1e9);
41  t->tv_sec = seconds;
42  t->tv_nsec = nseconds;
43  return 0;
44 }
45 #else
46 #include <time.h>
47 #endif
48 
50 
51  const Int_t nbClWalkBinX = 20;
52 const Int_t nbClDelTofBinX = 50;
53 const Int_t iNTrg = 1;
54 extern Double_t TOTMax;
55 extern Double_t TOTMin;
56 
57 using std::cout;
58 using std::endl;
59 using std::list;
60 using std::map;
61 using std::pair;
62 using std::set;
63 using std::vector;
64 
66  : fGeoHandler(0)
67  , fTofId(0)
68  , fDigiPar(0)
69  , fChannelInfo(0)
70  , fDigiBdfPar(0)
71  , fvCPSigPropSpeed()
72  , fvCPDelTof()
73  , fvCPTOff()
74  , fvCPTotGain()
75  , fvCPWalk()
76  , fTofDigis(0)
77  , fTofPoints(0)
78  , fTofHits(0)
79  , fTofDigiMatchs(0)
80  , fStorDigiExp()
81  , fStorDigiExpOld()
82  , fOutTimeFactor(1) {}
83 
85  // dimension and initialize calib parameter
86  //
87  Int_t iNbSmTypes = fDigiBdfPar->GetNbSmTypes();
88 
89  fvCPSigPropSpeed.resize(iNbSmTypes);
90  for (Int_t iT = 0; iT < iNbSmTypes; iT++) {
91  Int_t iNbRpc = fDigiBdfPar->GetNbRpc(iT);
92  fvCPSigPropSpeed[iT].resize(iNbRpc);
93  for (Int_t iRpc = 0; iRpc < iNbRpc; iRpc++)
94  if (0.0 < fDigiBdfPar->GetSigVel(iT, 0, iRpc))
95  fvCPSigPropSpeed[iT][iRpc] = /*1000.0 * */ fDigiBdfPar->GetSigVel(
96  iT, 0, iRpc); // convert in cm/ns
97  else
99  } // for (Int_t iT=0; iT<iNbSmTypes; iT++)
100 
101  fvCPTOff.resize(iNbSmTypes);
102  fvCPTotGain.resize(iNbSmTypes);
103  fvCPWalk.resize(iNbSmTypes);
104  fvCPDelTof.resize(iNbSmTypes);
105  for (Int_t iSmType = 0; iSmType < iNbSmTypes; iSmType++) {
106  Int_t iNbSm = fDigiBdfPar->GetNbSm(iSmType);
107  Int_t iNbRpc = fDigiBdfPar->GetNbRpc(iSmType);
108  fvCPTOff[iSmType].resize(iNbSm * iNbRpc);
109  fvCPTotGain[iSmType].resize(iNbSm * iNbRpc);
110  fvCPWalk[iSmType].resize(iNbSm * iNbRpc);
111  fvCPDelTof[iSmType].resize(iNbSm * iNbRpc);
112  for (Int_t iSm = 0; iSm < iNbSm; iSm++) {
113  for (Int_t iRpc = 0; iRpc < iNbRpc; iRpc++) {
114  // LOG(info)<<Form(" fvCPDelTof resize for SmT %d, R %d, B %d ",iSmType,iNbSm*iNbRpc,nbClDelTofBinX)
115  // ;
116  fvCPDelTof[iSmType][iSm * iNbRpc + iRpc].resize(nbClDelTofBinX);
117  for (Int_t iBx = 0; iBx < nbClDelTofBinX; iBx++) {
118  // LOG(info)<<Form(" fvCPDelTof for SmT %d, R %d, B %d",iSmType,iSm*iNbRpc+iRpc,iBx);
119  fvCPDelTof[iSmType][iSm * iNbRpc + iRpc][iBx].resize(iNTrg);
120  for (Int_t iTrg = 0; iTrg < iNTrg; iTrg++)
121  fvCPDelTof[iSmType][iSm * iNbRpc + iRpc][iBx][iTrg] =
122  0.; // initialize
123  }
124 
125  Int_t iNbChan = fDigiBdfPar->GetNbChan(iSmType, iRpc);
126  fvCPTOff[iSmType][iSm * iNbRpc + iRpc].resize(iNbChan);
127  fvCPTotGain[iSmType][iSm * iNbRpc + iRpc].resize(iNbChan);
128  fvCPWalk[iSmType][iSm * iNbRpc + iRpc].resize(iNbChan);
129  Int_t nbSide = 2 - fDigiBdfPar->GetChanType(iSmType, iRpc);
130  for (Int_t iCh = 0; iCh < iNbChan; iCh++) {
131  fvCPTOff[iSmType][iSm * iNbRpc + iRpc][iCh].resize(nbSide);
132  fvCPTotGain[iSmType][iSm * iNbRpc + iRpc][iCh].resize(nbSide);
133  fvCPWalk[iSmType][iSm * iNbRpc + iRpc][iCh].resize(nbSide);
134  for (Int_t iSide = 0; iSide < nbSide; iSide++) {
135  fvCPTOff[iSmType][iSm * iNbRpc + iRpc][iCh][iSide] =
136  0.; //initialize
137  fvCPTotGain[iSmType][iSm * iNbRpc + iRpc][iCh][iSide] =
138  1.; //initialize
139  fvCPWalk[iSmType][iSm * iNbRpc + iRpc][iCh][iSide].resize(
140  nbClWalkBinX);
141  for (Int_t iWx = 0; iWx < nbClWalkBinX; iWx++) {
142  fvCPWalk[iSmType][iSm * iNbRpc + iRpc][iCh][iSide][iWx] = 0.;
143  }
144  }
145  }
146  }
147  }
148  }
149 
150  LOG(info) << "CbmTofSimpClusterizer::InitCalibParameter: defaults set";
151 
152  TDirectory* oldir =
153  gDirectory; // <= To prevent histos from being sucked in by the param file of the TRootManager!
154  /*
155  gROOT->cd(); // <= To prevent histos from being sucked in by the param file of the TRootManager !
156  */
157 
158 #if 0
159  if(0<fCalMode){
160  LOG(info) << "CbmTofSimpClusterizer::InitCalibParameter: read histos from "
161  << "file " << fCalParFileName ;
162 
163  // read parameter from histos
164  if(fCalParFileName.IsNull()) return kTRUE;
165 
166  fCalParFile = new TFile(fCalParFileName,"");
167  if(NULL == fCalParFile) {
168  LOG(error) << "CbmTofSimpClusterizer::InitCalibParameter: "
169  << "file " << fCalParFileName << " does not exist!" ;
170  return kTRUE;
171  }
172  /*
173  gDirectory->Print();
174  fCalParFile->cd();
175  fCalParFile->ls();
176  */
177 
178  for( Int_t iSmType = 0; iSmType < iNbSmTypes; iSmType++ )
179  {
180  Int_t iNbSm = fDigiBdfPar->GetNbSm( iSmType );
181  Int_t iNbRpc = fDigiBdfPar->GetNbRpc( iSmType );
182  for( Int_t iSm = 0; iSm < iNbSm; iSm++ )
183  for( Int_t iRpc = 0; iRpc < iNbRpc; iRpc++ )
184  {
185  TH2F *htempPos_pfx =(TH2F*) gDirectory->FindObjectAny( Form("cl_CorSmT%01d_sm%03d_rpc%03d_Pos_pfx",iSmType,iSm,iRpc));
186  TH2F *htempTOff_pfx=(TH2F*) gDirectory->FindObjectAny( Form("cl_CorSmT%01d_sm%03d_rpc%03d_TOff_pfx",iSmType,iSm,iRpc));
187  TH2F *htempTot_pfx =(TH2F*) gDirectory->FindObjectAny( Form("cl_CorSmT%01d_sm%03d_rpc%03d_Tot_pfx",iSmType,iSm,iRpc));
188  if(NULL != htempPos_pfx && NULL != htempTOff_pfx && NULL != htempTot_pfx)
189  {
190  Int_t iNbCh = fDigiBdfPar->GetNbChan( iSmType, iRpc );
191  Int_t iNbinTot = htempTot_pfx->GetNbinsX();
192  for( Int_t iCh = 0; iCh < iNbCh; iCh++ )
193  {
194  Double_t YMean=((TProfile *)htempPos_pfx)->GetBinContent(iCh+1); //nh +1 empirical(?)
195  Double_t TMean=((TProfile *)htempTOff_pfx)->GetBinContent(iCh+1);
196  Double_t dTYOff=YMean/fvCPSigPropSpeed[iSmType][iRpc] ;
197  fvCPTOff[iSmType][iSm*iNbRpc+iRpc][iCh][0] += -dTYOff + TMean ;
198  fvCPTOff[iSmType][iSm*iNbRpc+iRpc][iCh][1] += +dTYOff + TMean ;
199 
200  Double_t TotMean=((TProfile *)htempTot_pfx)->GetBinContent(iCh+1); //nh +1 empirical(?)
201  if(1<TotMean){
202  fvCPTotGain[iSmType][iSm*iNbRpc+iRpc][iCh][0] *= TTotMean / TotMean;
203  fvCPTotGain[iSmType][iSm*iNbRpc+iRpc][iCh][1] *= TTotMean / TotMean;
204  }
205  LOG(debug1)<<"CbmTofSimpClusterizer::InitCalibParameter:"
206  <<" SmT "<< iSmType<<" Sm "<<iSm<<" Rpc "<<iRpc<<" Ch "<<iCh
207  <<": YMean "<<YMean<<", TMean "<< TMean
208  <<" -> " << fvCPTOff[iSmType][iSm*iNbRpc+iRpc][iCh][0]
209  <<", " << fvCPTOff[iSmType][iSm*iNbRpc+iRpc][iCh][1]
210  <<", " << fvCPTotGain[iSmType][iSm*iNbRpc+iRpc][iCh][0]
211  <<", NbinTot "<< iNbinTot
212  ;
213 
214  TH1D *htempWalk0=(TH1D*)gDirectory->FindObjectAny(
215  Form("Cor_SmT%01d_sm%03d_rpc%03d_Ch%03d_S0_Walk_px", iSmType, iSm, iRpc, iCh ));
216  TH1D *htempWalk1=(TH1D*)gDirectory->FindObjectAny(
217  Form("Cor_SmT%01d_sm%03d_rpc%03d_Ch%03d_S1_Walk_px", iSmType, iSm, iRpc, iCh ));
218  if(NULL != htempWalk0 && NULL != htempWalk1 ) { // reinitialize Walk array
219  LOG(info)<<"Initialize Walk correction for "
220  <<Form(" SmT%01d_sm%03d_rpc%03d_Ch%03d",iSmType, iSm, iRpc, iCh)
221  ;
222  if(htempWalk0->GetNbinsX() != nbClWalkBinX)
223  LOG(error)<<"CbmTofSimpClusterizer::InitCalibParameter: Inconsistent Walk histograms"
224  ;
225  for( Int_t iBin = 0; iBin < nbClWalkBinX; iBin++ )
226  {
227  fvCPWalk[iSmType][iSm*iNbRpc+iRpc][iCh][0][iBin]=htempWalk0->GetBinContent(iBin+1);
228  fvCPWalk[iSmType][iSm*iNbRpc+iRpc][iCh][1][iBin]=htempWalk1->GetBinContent(iBin+1);
229  LOG(debug1)<<Form(" SmT%01d_sm%03d_rpc%03d_Ch%03d bin %d walk %f ",iSmType, iSm, iRpc, iCh, iBin,
230  fvCPWalk[iSmType][iSm*iNbRpc+iRpc][iCh][0][iBin])
231  ;
232 
233  }
234  }
235  }
236  }
237  else {
238  LOG(error)<<" Histos " << Form("cl_SmT%01d_sm%03d_rpc%03d_XXX", iSmType, iSm, iRpc) << " not found. "
239  ;
240  }
241  for(Int_t iTrg=0; iTrg<iNTrg; iTrg++){
242  TH1D *htmpDelTof =(TH1D*) gDirectory->FindObjectAny( Form("cl_CorSmT%01d_sm%03d_rpc%03d_Trg%02d_DelTof",iSmType,iSm,iRpc,iTrg));
243  if (NULL==htmpDelTof) {
244  LOG(info)<<" Histos " << Form("cl_CorSmT%01d_sm%03d_rpc%03d_Trg%02d_DelTof", iSmType, iSm, iRpc, iTrg) << " not found. "
245  ;
246  continue;
247  }
248  LOG(info)<<" Load DelTof from histos "<< Form("cl_CorSmT%01d_sm%03d_rpc%03d_Trg%02d_DelTof",iSmType,iSm,iRpc,iTrg)<<"."
249  ;
250  for(Int_t iBx=0; iBx<nbClDelTofBinX; iBx++){
251  fvCPDelTof[iSmType][iSm*iNbRpc+iRpc][iBx][iTrg] += htmpDelTof->GetBinContent(iBx+1);
252  }
253 
254  // copy Histo to memory
255  TDirectory * curdir = gDirectory;
256  gDirectory->cd( oldir->GetPath() );
257  TH1D *h1DelTof=(TH1D *)htmpDelTof->Clone(Form("cl_CorSmT%01d_sm%03d_rpc%03d_Trg%02d_DelTof",iSmType,iSm,iRpc,iTrg));
258 
259  LOG(info)<<" copy histo "
260  <<h1DelTof->GetName()
261  <<" to directory "
262  <<oldir->GetName()
263  ;
264 
265  gDirectory->cd( curdir->GetPath() );
266  }
267  }
268  }
269  }
270 #endif //0
271  // fCalParFile->Delete();
272  gDirectory->cd(
273  oldir
274  ->GetPath()); // <= To prevent histos from being sucked in by the param file of the TRootManager!
275  LOG(info) << "CbmTofSimpClusterizer::InitCalibParameter: initialization done";
276  return kTRUE;
277 }
278 
279 static TH1F* deltaChannelTHisto = 0;
280 static TH1F* deltaPointTHisto = 0;
281 static TH1F* nofChannelsTHisto = 0;
282 static TH1F* digiTimeHisto = 0;
283 
285  if (0 == fDigiBdfPar) LOG(fatal) << "No CbmTofDigiBdfPar found";
286 
287  FairRootManager* ioman = FairRootManager::Instance();
288 
289  if (0 == ioman) LOG(fatal) << "No FairRootManager";
290 
291  fTofDigis = static_cast<TClonesArray*>(ioman->GetObject("TofDigiExp"));
292 
293  if (0 == fTofDigis) LOG(fatal) << "No TofDigi array found";
294 
296  Bool_t isSimulation = kFALSE;
297  Int_t iGeoVersion = fGeoHandler->Init(isSimulation);
298 
299  switch (iGeoVersion) {
300  case k12b: fTofId = new CbmTofDetectorId_v12b(); break;
301 
302  case k14a: fTofId = new CbmTofDetectorId_v14a(); break;
303 
304  default: LOG(fatal) << "Invalid geometry!!";
305  }
306 
307  Int_t iNrOfCells = fDigiPar->GetNrOfModules();
309 
310  for (Int_t icell = 0; icell < iNrOfCells; ++icell) {
311  Int_t cellId =
312  fDigiPar->GetCellId(icell); // cellId is assigned in CbmTofCreateDigiPar
313  fChannelInfo = fDigiPar->GetCell(cellId);
314 
315  Int_t smtype = fGeoHandler->GetSMType(cellId);
316  Int_t smodule = fGeoHandler->GetSModule(cellId);
317  Int_t module = fGeoHandler->GetCounter(cellId);
318  Int_t cell = fGeoHandler->GetCell(cellId);
319 
320  Double_t x = fChannelInfo->GetX();
321  Double_t y = fChannelInfo->GetY();
322  Double_t z = fChannelInfo->GetZ();
323  Double_t dx = fChannelInfo->GetSizex();
324  Double_t dy = fChannelInfo->GetSizey();
325  }
326 
327  if (!InitCalibParameter()) LOG(fatal) << "Failed to read calib parameters";
328 
329  Int_t iNbSmTypes = fDigiBdfPar->GetNbSmTypes();
330  fStorDigiExp.resize(iNbSmTypes);
331  LOG(info) << "Number of supermodule types is " << iNbSmTypes;
332 
333  for (Int_t iSmType = 0; iSmType < iNbSmTypes; ++iSmType) {
334  Int_t iNbSm = fDigiBdfPar->GetNbSm(iSmType);
335  Int_t iNbRpc = fDigiBdfPar->GetNbRpc(iSmType);
336  fStorDigiExp[iSmType].resize(iNbSm * iNbRpc);
337  LOG(info) << "For the supermodule with the type: " << iSmType
338  << ", the number of such supermodules is: " << iNbSm
339  << ", and the number of Rpc is: " << iNbRpc;
340 
341  for (Int_t iSm = 0; iSm < iNbSm; ++iSm) {
342  for (Int_t iRpc = 0; iRpc < iNbRpc; ++iRpc) {
343  Int_t iNbChan = fDigiBdfPar->GetNbChan(iSmType, iRpc);
344  fStorDigiExp[iSmType][iSm * iNbRpc + iRpc].resize(iNbChan);
345  }
346  }
347  }
348 
350  new TH1F("deltaChannelTHisto", "deltaChannelTHisto", 100, 0., 10.);
352  new TH1F("deltaPointTHisto", "deltaPointTHisto", 100, 0., 1.);
354  new TH1F("nofChannelsTHisto", "nofChannelsTHisto", 20, 0., 20.);
355  digiTimeHisto =
356  new TH1F("digiTimeHisto", "digiTimeHisto", 10100, -100., 10000.);
357 
358  fTofHits = new TClonesArray("CbmTofHit");
359  ioman->Register(
360  "TofHit", "Tof", fTofHits, IsOutputBranchPersistent("TofHit"));
361  fTofDigiMatchs = new TClonesArray("CbmMatch", 100);
362  ioman->Register("TofDigiMatch",
363  "Tof",
365  IsOutputBranchPersistent("TofDigiMatch"));
366 
367  return kSUCCESS;
368 }
369 
371  FairRunAna* ana = FairRunAna::Instance();
372  FairRuntimeDb* rtdb = ana->GetRuntimeDb();
373 
374  fDigiPar = static_cast<CbmTofDigiPar*>(rtdb->getContainer("CbmTofDigiPar"));
375  fDigiBdfPar =
376  static_cast<CbmTofDigiBdfPar*>(rtdb->getContainer("CbmTofDigiBdfPar"));
377 }
378 
379 static void AddPts(set<pair<Int_t, Int_t>>& sPtsRef,
380  const CbmTofDigiExp* digi) {
381  CbmMatch* match = digi->GetMatch();
382  assert(match);
383  Int_t nofLinks = match->GetNofLinks();
384 
385  for (int i = 0; i < nofLinks; ++i) {
386  const CbmLink& link = match->GetLink(i);
387  sPtsRef.insert(pair<Int_t, Int_t>(link.GetEntry(), link.GetIndex()));
388  }
389 }
390 
391 static Int_t currentEvN = 0;
392 static long fullDuration = 0;
393 
394 void CbmTofTBClusterizer::Exec(Option_t* option) {
395  timespec ts;
396  clock_gettime(CLOCK_REALTIME, &ts);
397  long beginTime = ts.tv_sec * 1000000000 + ts.tv_nsec;
398  // --- MC Event info (input file, entry number, start time)
399  Int_t iInputNr = 0;
400  Int_t iEventNr = 0;
401  Double_t dEventTime = 0.;
402  GetEventInfo(iInputNr, iEventNr, dEventTime);
403  LOG(debug) << GetName() << ": Input " << iInputNr << ", event " << iEventNr
404  << ", event time " << dEventTime << " ns";
405 
406  fTofHits->Clear("C");
407  //fTofHits->Delete();
408  fTofDigiMatchs->Delete();
409  //fTofDigiMatchs->Clear("C");
410  //Double_t dMaxTimeDist = fDigiBdfPar->GetMaxTimeDist();
411  Double_t dMaxPairTimeDist = 3.2;
412  Double_t dMaxClustTimeDist = 0.2;
413  Double_t dMaxSpaceDist = fDigiBdfPar->GetMaxDistAlongCh();
414  Int_t iNbTofDigi = fTofDigis->GetEntries();
415 
416  LOG(debug) << GetName() << ": Input " << iInputNr << ", event " << iEventNr
417  << ", event time " << dEventTime << " ns"
418  << ", TOF digis: " << iNbTofDigi;
419  /*map<pair<Int_t, Int_t>, list<Int_t> > tofPointDigiInds;
420 
421  Int_t nofTofPoints = fTofPoints->GetEntries();
422 
423  for(Int_t iDigInd = 0; iDigInd < iNbTofDigi; ++iDigInd)
424  {
425  CbmTofDigiExp* pDigi = static_cast<CbmTofDigiExp*> (fTofDigis->At(iDigInd));
426  const CbmMatch* pMatch = pDigi->GetMatch();
427  Int_t nofLinks = pMatch->GetNofLinks();
428 
429  for (Int_t iLink = 0; iLink < nofLinks; ++iLink)
430  {
431  const CbmLink& link = pMatch->GetLink(iLink);
432  Int_t tpi = link.GetIndex();
433  Int_t tpe = link.GetEntry();
434 
435  //if (tpi < nofTofPoints)
436  tofPointDigiInds[pair<Int_t, Int_t> (tpe, tpi)].push_back(iDigInd);
437  }
438  }
439 
440  for (map<pair<Int_t, Int_t>, list<Int_t> >::const_iterator i = tofPointDigiInds.begin(); i != tofPointDigiInds.end(); ++i)
441  {
442  //const CbmTofPoint* pTofPoint = static_cast<const CbmTofPoint*> (fTofPoints->At(i->first));
443  const list<Int_t>& pointDigis = i->second;
444  set<Int_t> firedChannels;
445  map<Int_t, pair<Double_t, Double_t> > channelDigis;
446 
447  for (list<Int_t>::const_iterator j = i->second.begin(); j != i->second.end(); ++j)
448  {
449  const CbmTofDigiExp* pTofDigi = static_cast<const CbmTofDigiExp*> (fTofDigis->At(*j));
450  firedChannels.insert(pTofDigi->GetChannel());
451 
452  if (0 == pTofDigi->GetSide())
453  channelDigis[pTofDigi->GetChannel()].first = pTofDigi->GetTime();
454  else
455  channelDigis[pTofDigi->GetChannel()].second = pTofDigi->GetTime();
456 
457  //Double_t deltaT = pTofDigi->GetTime() - pTofPoint->GetTime();
458  //deltaTHisto->Fill(deltaT);
459  }
460 
461  Double_t minDigiTime = std::numeric_limits<Double_t>::max();
462  Double_t maxDigiTime = std::numeric_limits<Double_t>::min();
463 
464  for (map<Int_t, pair<Double_t, Double_t> >::iterator j = channelDigis.begin(); j != channelDigis.end(); ++j)
465  {
466  if (0 == j->second.first || 0 == j->second.second)
467  continue;
468 
469  Double_t channelDelta = TMath::Abs(j->second.first - j->second.second);
470  deltaChannelTHisto->Fill(channelDelta);
471  Double_t channelTime = (j->second.first + j->second.second) / 2;
472 
473  if (channelTime < minDigiTime)
474  minDigiTime = channelTime;
475 
476  if (channelTime > maxDigiTime)
477  maxDigiTime = channelTime;
478  }
479 
480  if (maxDigiTime > minDigiTime)
481  deltaPointTHisto->Fill(maxDigiTime - minDigiTime);
482 
483  nofChannelsTHisto->Fill(firedChannels.size());
484  }
485 
486  return;*/
487 
488  for (Int_t iDigInd = 0; iDigInd < iNbTofDigi; ++iDigInd) {
489  CbmTofDigiExp* pDigi = static_cast<CbmTofDigiExp*>(fTofDigis->At(iDigInd));
490  LOG(debug) << GetName() << ": digi " << iDigInd << " pointer " << pDigi;
491  digiTimeHisto->Fill(pDigi->GetTime());
492 
493  if (0 == pDigi->GetSide()) { // 0 - top side
494  LOG(debug) << "top side";
495  LOG(debug) << "Type" << pDigi->GetType();
496  LOG(debug) << "RPC" << pDigi->GetRpc();
497  LOG(debug) << "Channel" << pDigi->GetChannel();
498  LOG(debug) << "Time" << pDigi->GetTime();
499  LOG(debug) << "SM " << pDigi->GetSm();
500  LOG(debug) << "NbRpc " << fDigiBdfPar->GetNbRpc(pDigi->GetType());
501  Int_t type = pDigi->GetType();
502  Int_t superModule = pDigi->GetSm();
503  Int_t rpc = pDigi->GetRpc();
504  Int_t nofRpc = fDigiBdfPar->GetNbRpc(type + rpc);
505  Int_t channel = pDigi->GetChannel();
506  Double_t time = pDigi->GetTime();
507  Int_t index1 = type;
508  Int_t index2 = superModule * nofRpc;
509  Int_t index3 = channel;
510  LOG(debug) << "Index 1 " << index1;
511  LOG(debug) << "Index 2 " << index2;
512  LOG(debug) << "Index 2 " << index3;
513 
514  LOG(debug) << "Size 1 " << fStorDigiExp.size();
515  LOG(debug) << "Size 2 " << fStorDigiExp[index1].size();
516  LOG(debug) << "Size 3 " << fStorDigiExp[index1][index2].size();
517 
518 
519  fStorDigiExp[pDigi->GetType()]
520  [pDigi->GetSm() * fDigiBdfPar->GetNbRpc(pDigi->GetType())
521  + pDigi->GetRpc()][pDigi->GetChannel()]
522  .topDigis[pDigi->GetTime()] = {pDigi, iDigInd};
523  LOG(debug) << "done";
524  } else {
525  LOG(debug) << "bottom side";
526  fStorDigiExp[pDigi->GetType()]
527  [pDigi->GetSm() * fDigiBdfPar->GetNbRpc(pDigi->GetType())
528  + pDigi->GetRpc()][pDigi->GetChannel()]
529  .bottomDigis[pDigi->GetTime()] = {pDigi, iDigInd};
530  }
531 
532  // apply calibration vectors
533  /*pDigi->SetTime(pDigi->GetTime() - // calibrate Digi Time
534  fvCPTOff[pDigi->GetType()]
535  [pDigi->GetSm() * fDigiBdfPar->GetNbRpc(pDigi->GetType()) + pDigi->GetRpc()]
536  [pDigi->GetChannel()]
537  [pDigi->GetSide()]);
538 
539  pDigi->SetTot(pDigi->GetTot() * // calibrate Digi ToT
540  fvCPTotGain[pDigi->GetType()]
541  [pDigi->GetSm() * fDigiBdfPar->GetNbRpc(pDigi->GetType()) + pDigi->GetRpc()]
542  [pDigi->GetChannel()]
543  [pDigi->GetSide()]);
544 
545  // walk correction
546  Double_t dTotBinSize = (TOTMax - TOTMin) / 2. / nbClWalkBinX;
547  Int_t iWx = (Int_t) ((pDigi->GetTot() - TOTMin / 2.) / dTotBinSize);
548 
549  if (0 > iWx)
550  iWx = 0;
551 
552  if (iWx > nbClWalkBinX)
553  iWx = nbClWalkBinX - 1;
554 
555  Double_t dDTot = (pDigi->GetTot() - TOTMin / 2.) / dTotBinSize - (Double_t) iWx - 0.5;
556  Double_t dWT = fvCPWalk[pDigi->GetType()]
557  [pDigi->GetSm() * fDigiBdfPar->GetNbRpc(pDigi->GetType()) + pDigi->GetRpc()]
558  [pDigi->GetChannel()]
559  [pDigi->GetSide()]
560  [iWx];
561 
562  if (dDTot > 0)
563  { // linear interpolation to next bin
564  dWT += dDTot * (fvCPWalk[pDigi->GetType()]
565  [pDigi->GetSm() * fDigiBdfPar->GetNbRpc(pDigi->GetType()) + pDigi->GetRpc()]
566  [pDigi->GetChannel()]
567  [pDigi->GetSide()]
568  [iWx + 1]
569  - fvCPWalk[pDigi->GetType()]
570  [pDigi->GetSm() * fDigiBdfPar->GetNbRpc(pDigi->GetType()) + pDigi->GetRpc()]
571  [pDigi->GetChannel()]
572  [pDigi->GetSide()]
573  [iWx]);
574  }
575  else // dDTot < 0, linear interpolation to next bin
576  {
577  dWT -= dDTot * (fvCPWalk[pDigi->GetType()]
578  [pDigi->GetSm() * fDigiBdfPar->GetNbRpc(pDigi->GetType()) + pDigi->GetRpc()]
579  [pDigi->GetChannel()]
580  [pDigi->GetSide()]
581  [iWx - 1]
582  - fvCPWalk[pDigi->GetType()]
583  [pDigi->GetSm() * fDigiBdfPar->GetNbRpc(pDigi->GetType()) + pDigi->GetRpc()]
584  [pDigi->GetChannel()]
585  [pDigi->GetSide()]
586  [iWx]);
587  }
588 
589  pDigi->SetTime(pDigi->GetTime() - dWT); // calibrate Digi Time*/
590  } // iDigiInd
591 
592  LOG(debug) << GetName() << ": TOF digis sorted";
593 
594  Double_t hitpos_local[3];
595  Double_t hitpos[3];
596  Int_t fiNbHits = 0;
597  Int_t iNbSmTypes = fDigiBdfPar->GetNbSmTypes();
598 
599  for (Int_t iSmType = 0; iSmType < iNbSmTypes; ++iSmType) {
600  vector<vector<ChannelDigis>>& digisOfType = fStorDigiExp[iSmType];
601  Int_t iNbSm = fDigiBdfPar->GetNbSm(iSmType);
602  Int_t iNbRpc = fDigiBdfPar->GetNbRpc(iSmType);
603 
604  for (Int_t iSm = 0; iSm < iNbSm; ++iSm) {
605  for (Int_t iRpc = 0; iRpc < iNbRpc; ++iRpc) {
606  vector<ChannelDigis>& digisOfRpc =
607  digisOfType[iSm * fDigiBdfPar->GetNbRpc(iSmType) + iRpc];
608  Int_t iNbCh = fDigiBdfPar->GetNbChan(iSmType, iRpc);
609 
610  // Vertical strips => Y comes from bottom top time difference
611  for (Int_t iCh = 0; iCh < iNbCh; ++iCh) {
612  ChannelDigis& digisOfChannel = digisOfRpc[iCh];
613  map<Double_t, ChannelDigis::DigiDesc>& topDigis =
614  digisOfChannel.topDigis;
615  map<Double_t, ChannelDigis::DigiDesc>& bottomDigis =
616  digisOfChannel.bottomDigis;
617 
618  if (bottomDigis.empty()) {
619  topDigis.clear();
620  continue;
621  }
622 
623  map<Double_t, ChannelDigis::DigiPair>& digiPairs =
624  digisOfChannel.digiPairs;
625 
626  for (map<Double_t, ChannelDigis::DigiDesc>::iterator topDigiIter =
627  topDigis.begin();
628  topDigiIter != topDigis.end();
629  ++topDigiIter) {
630  Double_t topTime = topDigiIter->first;
631  map<Double_t, ChannelDigis::DigiDesc>::iterator bottomDigiIter =
632  bottomDigis.lower_bound(topTime);
633 
634  if (bottomDigiIter == bottomDigis.end())
635  --bottomDigiIter;
636  else if (bottomDigiIter->first > topTime) {
637  Double_t deltaT = bottomDigiIter->first - topTime;
638 
639  if (deltaT > dMaxPairTimeDist
640  && bottomDigiIter != bottomDigis.begin())
641  --bottomDigiIter;
642  else {
643  map<Double_t, ChannelDigis::DigiDesc>::iterator
644  bottomDigiIter2 = bottomDigiIter;
645  --bottomDigiIter2;
646 
647  Double_t deltaT2 = topTime - bottomDigiIter2->first;
648 
649  if (deltaT2 < deltaT) bottomDigiIter = bottomDigiIter2;
650  }
651  }
652 
653  if (TMath::Abs(bottomDigiIter->first - topTime) > dMaxPairTimeDist)
654  continue;
655 
656  Double_t y = fvCPSigPropSpeed[iSmType][iRpc]
657  * (bottomDigiIter->first - topTime) / 2;
658 
659  CbmTofDetectorInfo xDetInfo(kTof, iSmType, iSm, iRpc, 0, iCh);
660  Int_t iChId = fTofId->SetDetectorInfo(xDetInfo);
661  fChannelInfo = fDigiPar->GetCell(iChId);
662 
663  if (0 == fChannelInfo) continue;
664 
665  if (TMath::Abs(y) > fChannelInfo->GetSizey() / 2) continue;
666 
667  Double_t digiPairTime = (topTime + bottomDigiIter->first) / 2;
668  digiPairs[digiPairTime] = {
669  y, topDigiIter->second, bottomDigiIter->second};
670  } // for (map<Double_t, CbmTofDigiExp*>::iterator topDigiIter = topDigis.begin(); topDigiIter != topDigis.end(); ++topDigiIter)
671 
672  topDigis.clear();
673  bottomDigis.clear();
674  } // for (Int_t iCh = 0; iCh < iNbCh; ++iCh)
675 
676  gGeoManager->FindNode(
678  gGeoManager->GetCurrentMatrix();
679  gGeoManager->CdUp();
680  gGeoManager->GetCurrentMatrix();
681 
682  for (Int_t iCh = 0; iCh < iNbCh; ++iCh) // 2
683  {
684  map<Double_t, ChannelDigis::DigiPair>& digiPairs =
685  digisOfRpc[iCh].digiPairs;
686 
687  for (map<Double_t, ChannelDigis::DigiPair>::iterator chIter =
688  digiPairs.begin();
689  chIter != digiPairs.end();
690  ++chIter) {
691  Double_t chTime = chIter->first;
692  Double_t chY = chIter->second.y;
693  Double_t dTotS = chIter->second.topDigi.pDigi->GetTot()
694  + chIter->second.bottomDigi.pDigi->GetTot();
695  Double_t dWeightedTime = chTime * dTotS;
696  Double_t dWeightedPosY = chY * dTotS;
697  Double_t dWeightedPosX =
698  (iCh - Double_t(iNbCh) / 2) * fChannelInfo->GetSizex() * dTotS;
699  Double_t dWeightedTimeErrorS =
700  chIter->second.topDigi.pDigi->GetTot()
701  * chIter->second.topDigi.pDigi->GetTot()
702  + chIter->second.bottomDigi.pDigi->GetTot()
703  * chIter->second.bottomDigi.pDigi->GetTot();
704  Double_t dWeightsSum = dTotS;
705  CbmMatch* digiMatch = new CbmMatch;
706  digiMatch->AddLink(
707  CbmLink(0., chIter->second.topDigi.digiInd, iEventNr, iInputNr));
708  digiMatch->AddLink(CbmLink(
709  0., chIter->second.bottomDigi.digiInd, iEventNr, iInputNr));
710  set<pair<Int_t, Int_t>> sPtsRef;
711  AddPts(sPtsRef, chIter->second.topDigi.pDigi);
712  AddPts(sPtsRef, chIter->second.bottomDigi.pDigi);
713 
714  for (Int_t iNeighCh = iCh + 1;
715  iNeighCh < iNbCh /* && iNeighCh - iCh < 4*/;
716  ++iNeighCh) {
717  map<Double_t, ChannelDigis::DigiPair>& neighDigiPairs =
718  digisOfRpc[iNeighCh].digiPairs;
719 
720  if (neighDigiPairs.empty()) break;
721 
722  map<Double_t, ChannelDigis::DigiPair>::iterator neighIter =
723  neighDigiPairs.lower_bound(chTime);
724 
725  if (neighIter == neighDigiPairs.end())
726  --neighIter;
727  else if (neighIter->first > chTime
728  && neighIter != neighDigiPairs.begin()) {
729  Double_t deltaTHigh = neighIter->first - chTime;
730  map<Double_t, ChannelDigis::DigiPair>::iterator neighIter_1 =
731  neighIter;
732  --neighIter_1;
733  Double_t deltaTLow = chTime - neighIter_1->first;
734 
735  if (deltaTLow < deltaTHigh) neighIter = neighIter_1;
736  }
737 
738  if (TMath::Abs(neighIter->first - chTime) > dMaxClustTimeDist
739  || TMath::Abs(neighIter->second.y - chY) > dMaxSpaceDist)
740  break;
741 
742  Double_t dTotNeighS =
743  neighIter->second.topDigi.pDigi->GetTot()
744  + neighIter->second.bottomDigi.pDigi->GetTot();
745  dWeightedTimeErrorS +=
746  neighIter->second.topDigi.pDigi->GetTot()
747  * neighIter->second.topDigi.pDigi->GetTot()
748  + neighIter->second.bottomDigi.pDigi->GetTot()
749  * neighIter->second.bottomDigi.pDigi->GetTot();
750  dWeightedTime += neighIter->first * dTotNeighS;
751  dWeightedPosY += neighIter->second.y * dTotNeighS;
752  dWeightedPosX += (iNeighCh - Double_t(iNbCh) / 2)
753  * fChannelInfo->GetSizex() * dTotNeighS;
754  dWeightsSum += dTotNeighS;
755 
756  digiMatch->AddLink(CbmLink(
757  0., neighIter->second.topDigi.digiInd, iEventNr, iInputNr));
758  digiMatch->AddLink(CbmLink(
759  0., neighIter->second.bottomDigi.digiInd, iEventNr, iInputNr));
760  AddPts(sPtsRef, neighIter->second.topDigi.pDigi);
761  AddPts(sPtsRef, neighIter->second.bottomDigi.pDigi);
762  neighDigiPairs.erase(neighIter);
763  } // for (Int_t iNeighCh = iCh + 1; iNeighCh < iNbCh; ++iNeighCh)
764 
765  Double_t clusterTime = dWeightedTime / dWeightsSum;
766  Double_t timeRes = fDigiBdfPar->GetFeeTimeRes();
767  Double_t clusterTimeError =
768  TMath::Sqrt(dWeightedTimeErrorS) * timeRes / dWeightsSum;
769  Double_t clusterY = dWeightedPosY / dWeightsSum;
770  Double_t clusterX = dWeightedPosX / dWeightsSum;
771  hitpos_local[0] = clusterX;
772  hitpos_local[1] = clusterY;
773  hitpos_local[2] = 0;
774  hitpos[0] = 0;
775  hitpos[1] = 0;
776  hitpos[2] = 0;
777  gGeoManager->LocalToMaster(hitpos_local, hitpos);
778  TVector3 hitPos(hitpos[0], hitpos[1], hitpos[2]);
779  // Simple errors, not properly done at all for now
780  // Right way of doing it should take into account the weight distribution
781  // and real system time resolution
782  TVector3 hitPosErr(
784  / sqrt(12.0), // Single strips approximation
786  * fvCPSigPropSpeed[iSmType]
787  [iRpc], // Use the electronics resolution
788  fDigiBdfPar->GetNbGaps(iSmType, iRpc)
789  * fDigiBdfPar->GetGapSize(iSmType, iRpc) / 10.0
790  / // Change gap size in cm
791  sqrt(12.0)); // Use full RPC thickness as "Channel" Z size
792  Int_t iChm = floor((clusterX + Double_t(iNbCh) / 2)
793  / fChannelInfo->GetSizex());
794  Int_t iDetId =
795  CbmTofAddress::GetUniqueAddress(iSm, iRpc, iChm, 0, iSmType);
796  new ((*fTofHits)[fiNbHits]) CbmTofHit(
797  iDetId,
798  hitPos,
799  hitPosErr, //local detector coordinates
800  fiNbHits,
801  clusterTime * fOutTimeFactor,
802  sPtsRef
803  .size(), // flag = number of TofPoints generating the cluster
804  0);
805  static_cast<CbmTofHit*>(fTofHits->At(fiNbHits))
806  ->SetTimeError(clusterTimeError);
807  new ((*fTofDigiMatchs)[fiNbHits]) CbmMatch(*digiMatch);
808  delete digiMatch;
809  ++fiNbHits;
810  } // for (map<Double_t, pair<CbmTofDigiExp*, CbmTofDigiExp*> >::iterator chIter = digiPairs.begin(); chIter != digiPairs.end(); ++chIter)
811 
812  digiPairs.clear();
813  } // for (Int_t iCh = 0; iCh < iNbCh; ++iCh) 2
814  } // for (Int_t iRpc = 0; iRpc < iNbRpc; ++iRpc)
815  } // for (Int_t iSm = 0; iSm < iNbSm; ++iSm)
816  } // for (Int_t iSmType = 0; iSmType < iNbSmTypes; ++iSmType)
817 
818  ++currentEvN;
819  clock_gettime(CLOCK_REALTIME, &ts);
820  long endTime = ts.tv_sec * 1000000000 + ts.tv_nsec;
821  fullDuration += endTime - beginTime;
822 }
823 
824 static void SaveHisto(TH1* histo) {
825  TFile* curFile = TFile::CurrentFile();
826  TString histoName = histo->GetName();
827  histoName += ".root";
828  TFile fh(histoName.Data(), "RECREATE");
829  histo->Write();
830  fh.Close();
831  delete histo;
832  TFile::CurrentFile() = curFile;
833 }
834 
840  cout << "ToF Time Based clustering runtime: " << fullDuration << endl;
841 }
842 
844  Int_t& eventNr,
845  Double_t& eventTime) {
846 
847  // --- In a FairRunAna, take the information from FairEventHeader
848  if (FairRunAna::Instance()) {
849  FairEventHeader* event = FairRunAna::Instance()->GetEventHeader();
850  inputNr = event->GetInputFileId();
851  eventNr = event->GetMCEntryNumber();
852  eventTime = event->GetEventTime();
853  }
854 
855  // --- In a FairRunSim, the input number and event time are always zero;
856  // --- only the event number is retrieved.
857  else {
858  if (!FairRunSim::Instance())
859  LOG(fatal) << GetName() << ": neither SIM nor ANA run.";
860  FairMCEventHeader* event = FairRunSim::Instance()->GetMCEventHeader();
861  inputNr = 0;
862  eventNr = event->GetEventID();
863  eventTime = 0.;
864  }
865 }
CbmTofCell::GetZ
Double_t GetZ() const
Definition: CbmTofCell.h:38
CbmMatch
Definition: CbmMatch.h:22
CbmTofCell::GetSizex
Double_t GetSizex() const
Definition: CbmTofCell.h:40
CbmTofGeoHandler::GetCounter
Int_t GetCounter(Int_t uniqueId)
Definition: CbmTofGeoHandler.cxx:469
CbmMatch::GetLink
const CbmLink & GetLink(Int_t i) const
Definition: CbmMatch.h:35
CbmMatch::GetNofLinks
Int_t GetNofLinks() const
Definition: CbmMatch.h:38
TOTMax
Double_t TOTMax
Definition: CbmTofSimpClusterizer.cxx:55
CbmTofTBClusterizer::fTofDigis
TClonesArray * fTofDigis
Definition: CbmTofTBClusterizer.h:74
CbmTofTBClusterizer::fOutTimeFactor
Double_t fOutTimeFactor
Definition: CbmTofTBClusterizer.h:92
sqrt
friend F32vec4 sqrt(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:41
CbmTofDigiBdfPar::GetNbChan
Int_t GetNbChan(Int_t iSmType, Int_t iRpc) const
Definition: CbmTofDigiBdfPar.cxx:570
CbmTofDigiPar::GetNrOfModules
Int_t GetNrOfModules()
Definition: CbmTofDigiPar.h:44
ClassImp
ClassImp(CbmTofTBClusterizer) const Int_t nbClWalkBinX
CbmTofTBClusterizer::fvCPTotGain
std::vector< std::vector< std::vector< std::vector< Double_t > > > > fvCPTotGain
Definition: CbmTofTBClusterizer.h:71
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmTofDigiBdfPar::GetNbRpc
Int_t GetNbRpc(Int_t iSmType) const
Definition: CbmTofDigiBdfPar.cxx:519
CbmTofDetectorId_v12b
Definition: CbmTofDetectorId_v12b.h:33
CbmTofDigiBdfPar::GetSigVel
Double_t GetSigVel(Int_t iSmType, Int_t iSm, Int_t iRpc) const
Definition: CbmTofDigiBdfPar.cxx:546
CbmTofDigiBdfPar::GetNbSmTypes
Int_t GetNbSmTypes() const
Definition: CbmTofDigiBdfPar.h:56
ECbmModuleId::kTof
@ kTof
Time-of-flight Detector.
CbmMatch.h
CbmTofGeoHandler::CheckGeometryVersion
Int_t CheckGeometryVersion()
Definition: CbmTofGeoHandler.cxx:61
CbmTofTBClusterizer::CbmTofTBClusterizer
CbmTofTBClusterizer()
Definition: CbmTofTBClusterizer.cxx:65
CbmTofTBClusterizer::fTofId
CbmTofDetectorId * fTofId
Definition: CbmTofTBClusterizer.h:61
CbmTofDigiPar::GetCell
CbmTofCell * GetCell(Int_t i)
Definition: CbmTofDigiPar.h:48
CbmTofGeoHandler::GetSModule
Int_t GetSModule(Int_t uniqueId)
Definition: CbmTofGeoHandler.cxx:464
CbmTofGeoHandler.h
CbmTofTBClusterizer::fGeoHandler
CbmTofGeoHandler * fGeoHandler
Definition: CbmTofTBClusterizer.h:60
digiTimeHisto
static TH1F * digiTimeHisto
Definition: CbmTofTBClusterizer.cxx:282
CbmTofTBClusterizer::InitCalibParameter
Bool_t InitCalibParameter()
Definition: CbmTofTBClusterizer.cxx:84
CbmTofGeoHandler
Definition: CbmTofGeoHandler.h:30
CbmTofTBClusterizer::fChannelInfo
CbmTofCell * fChannelInfo
Definition: CbmTofTBClusterizer.h:63
k12b
@ k12b
Definition: CbmTofGeoHandler.h:17
CbmTofCell::GetX
Double_t GetX() const
Definition: CbmTofCell.h:36
CbmTofTBClusterizer.h
nofChannelsTHisto
static TH1F * nofChannelsTHisto
Definition: CbmTofTBClusterizer.cxx:281
k14a
@ k14a
Definition: CbmTofGeoHandler.h:17
CbmMatch::AddLink
void AddLink(const CbmLink &newLink)
Definition: CbmMatch.cxx:42
CbmTofTBClusterizer::Init
InitStatus Init()
Definition: CbmTofTBClusterizer.cxx:284
CbmTofTBClusterizer::GetEventInfo
void GetEventInfo(Int_t &inputNr, Int_t &eventNr, Double_t &eventTime)
Definition: CbmTofTBClusterizer.cxx:843
CbmTofDetectorId_v14a
Definition: CbmTofDetectorId_v14a.h:36
CbmTofTBClusterizer::fDigiBdfPar
CbmTofDigiBdfPar * fDigiBdfPar
Definition: CbmTofTBClusterizer.h:64
CbmTofGeoHandler::Init
Int_t Init(Bool_t isSimulation=kFALSE)
Definition: CbmTofGeoHandler.cxx:39
TTotMean
const Double_t TTotMean
Definition: CbmTofSimpClusterizer.cxx:57
CbmTofDigiBdfPar::GetChanType
Int_t GetChanType(Int_t iSmType, Int_t iRpc) const
Definition: CbmTofDigiBdfPar.cxx:580
CbmTofTBClusterizer::ChannelDigis::bottomDigis
std::map< Double_t, DigiDesc > bottomDigis
Definition: CbmTofTBClusterizer.h:45
CbmTofDigiBdfPar
Parameters class for the CBM ToF digitizer using beam data distributions.
Definition: CbmTofDigiBdfPar.h:30
CbmTofDigiBdfPar::GetFeeTimeRes
Double_t GetFeeTimeRes() const
Definition: CbmTofDigiBdfPar.h:49
CbmTofDetectorId::SetDetectorInfo
virtual Int_t SetDetectorInfo(const CbmTofDetectorInfo detectorInfo)=0
CbmTofDetectorInfo
Definition: CbmTofDetectorId.h:20
CbmTofTBClusterizer::ChannelDigis::digiPairs
std::map< Double_t, DigiPair > digiPairs
Definition: CbmTofTBClusterizer.h:46
CbmTofTBClusterizer::fTofHits
TClonesArray * fTofHits
Definition: CbmTofTBClusterizer.h:76
CbmTofCell::GetSizey
Double_t GetSizey() const
Definition: CbmTofCell.h:41
CbmTofDigiBdfPar::GetGapSize
Double_t GetGapSize(Int_t iSmType, Int_t iRpc) const
Definition: CbmTofDigiBdfPar.cxx:535
deltaPointTHisto
static TH1F * deltaPointTHisto
Definition: CbmTofTBClusterizer.cxx:280
CbmTofTBClusterizer::fDigiPar
CbmTofDigiPar * fDigiPar
Definition: CbmTofTBClusterizer.h:62
CbmTofGeoHandler::GetCell
Int_t GetCell(Int_t uniqueId)
Definition: CbmTofGeoHandler.cxx:479
CbmTofTBClusterizer::SetParContainers
void SetParContainers()
Definition: CbmTofTBClusterizer.cxx:370
CbmTofTBClusterizer::fTofDigiMatchs
TClonesArray * fTofDigiMatchs
Definition: CbmTofTBClusterizer.h:77
TOTMin
Double_t TOTMin
Definition: CbmTofSimpClusterizer.cxx:56
CbmTofTBClusterizer::Finish
void Finish()
Definition: CbmTofTBClusterizer.cxx:835
iNTrg
const Int_t iNTrg
Definition: CbmTofTBClusterizer.cxx:53
nbClWalkBinX
const Int_t nbClWalkBinX
Definition: CbmTofClusterizersDef.h:44
SaveHisto
static void SaveHisto(TH1 *histo)
Definition: CbmTofTBClusterizer.cxx:824
x
Double_t x
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmTofDigiPar
Definition: CbmTofDigiPar.h:18
CbmTofPoint.h
deltaChannelTHisto
static TH1F * deltaChannelTHisto
Definition: CbmTofTBClusterizer.cxx:279
CbmTofGeoHandler::GetSMType
Int_t GetSMType(Int_t uniqueId)
Definition: CbmTofGeoHandler.cxx:459
y
Double_t y
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmTofDigiPar::GetCellId
Int_t GetCellId(Int_t i)
Definition: CbmTofDigiPar.h:45
CbmTofTBClusterizer
Definition: CbmTofTBClusterizer.h:28
AddPts
static void AddPts(set< pair< Int_t, Int_t >> &sPtsRef, const CbmTofDigiExp *digi)
Definition: CbmTofTBClusterizer.cxx:379
CbmTofTBClusterizer::fvCPWalk
std::vector< std::vector< std::vector< std::vector< std::vector< Double_t > > > > > fvCPWalk
Definition: CbmTofTBClusterizer.h:73
CbmTofTBClusterizer::fvCPDelTof
std::vector< std::vector< std::vector< std::vector< Double_t > > > > fvCPDelTof
Definition: CbmTofTBClusterizer.h:67
CbmTofTBClusterizer::ChannelDigis
Definition: CbmTofTBClusterizer.h:30
CbmTofHit
Definition: core/data/tof/CbmTofHit.h:26
CbmTofDigiBdfPar::GetSignalSpeed
Double_t GetSignalSpeed() const
Definition: CbmTofDigiBdfPar.h:55
CbmTofCell::GetY
Double_t GetY() const
Definition: CbmTofCell.h:37
fullDuration
static long fullDuration
Definition: CbmTofTBClusterizer.cxx:392
CbmTofAddress::GetUniqueAddress
static UInt_t GetUniqueAddress(UInt_t Sm, UInt_t Rpc, UInt_t Channel, UInt_t Side=0, UInt_t SmType=0)
Definition: CbmTofAddress.h:124
CbmTofDigiBdfPar::GetMaxDistAlongCh
Double_t GetMaxDistAlongCh() const
Definition: CbmTofDigiBdfPar.h:97
CbmTofTBClusterizer::Exec
void Exec(Option_t *option)
Definition: CbmTofTBClusterizer.cxx:394
currentEvN
static Int_t currentEvN
Definition: CbmTofTBClusterizer.cxx:391
CbmTofTBClusterizer::ChannelDigis::topDigis
std::map< Double_t, DigiDesc > topDigis
Definition: CbmTofTBClusterizer.h:44
CbmTofTBClusterizer::fStorDigiExp
std::vector< std::vector< std::vector< ChannelDigis > > > fStorDigiExp
Definition: CbmTofTBClusterizer.h:81
CbmTofTBClusterizer::fvCPTOff
std::vector< std::vector< std::vector< std::vector< Double_t > > > > fvCPTOff
Definition: CbmTofTBClusterizer.h:69
nbClDelTofBinX
const Int_t nbClDelTofBinX
Definition: CbmTofTBClusterizer.cxx:52
CbmTofDigiBdfPar::GetNbGaps
Int_t GetNbGaps(Int_t iSmType, Int_t iRpc) const
Definition: CbmTofDigiBdfPar.cxx:525
CbmDefs.h
CbmTofDigiBdfPar::GetNbSm
Int_t GetNbSm(Int_t iSmType) const
Definition: CbmTofDigiBdfPar.cxx:513
CbmTofTBClusterizer::fvCPSigPropSpeed
std::vector< std::vector< Double_t > > fvCPSigPropSpeed
Definition: CbmTofTBClusterizer.h:65