HYDRA_development_version
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
htofhitf2.cc
Go to the documentation of this file.
1 #include "htofhitf2.h"
2 #include "hades.h"
3 #include "htofraw.h"
4 #include "htofrawsim.h"
5 #include "htofhit.h"
6 #include "htofhitsim.h"
7 #include "htofcalpar.h"
8 #include "htofwalkpar.h"
9 #include "hruntimedb.h"
10 #include "hcategory.h"
11 #include "hiterator.h"
12 #include "hdebug.h"
13 #include "tofdef.h"
14 #include "hevent.h"
15 #include "heventheader.h"
16 #include "hspectrometer.h"
17 #include "htofdetector.h"
18 #include "hgeomvolume.h"
19 #include "hgeomcompositevolume.h"
20 #include "hgeomtransform.h"
21 #include "htofgeompar.h"
22 #include "htofdigipar.h"
23 #include "hdetgeompar.h"
24 #include "hgeomvector.h"
25 #include "hspecgeompar.h"
26 #include "hstart2hit.h"
27 #include "hstartdef.h"
28 
29 
30 
31 #include "TMath.h"
32 
33 using namespace std;
34 
35 
36 #include <fstream>
37 #include <iomanip>
38 
40 
41 //*-- Author :
42 //*-- Modified : 4/2013 by O. Svoboda
43 //*-- Modified : 14/11/2004 by P. Tlusty -
44 //* tof hit lab position now related to [0,0,0]
45 //*-- Modified : 23/10/2002 by M. Sanchez
46 //*-- Modified : 09/05/2002 by D. Zovinec
47 //*-- Modified : 14/03/2002 by D. Zovinec
48 //*-- Modified : 21/09/2001 by D. Zovinec
49 //*-- Modified : 24/04/2001 by M. Sanchez
50 //*-- Modified : 08/03/2001 by M. Sanchez
51 //*-- Modified : 27/03/2000 by I. Koenig
52 //*-- Modified : 17/03/2000 by R. Holzmann
53 //*-- Modified : 30/11/99 by M. Sanchez
54 //*-- Modified : 02/11/99 by D. Vasiliev
55 //*-- Modified : 15/06/98 by M. Sanchez
56 
57 
58 //_HADES_CLASS_DESCRIPTION
59 /////////////////////////////////////////////////////////////////////////
60 // HTofHitF2 Tof hit finder
61 //
62 // adapted from /u/halo/packages/abase/new by Manuel Sanchez (17/06/98)
63 //
64 // HTofHitF2 is the reconstructor class that iterates over RAW data
65 // and finds the TOF hits.
66 // The HIT is only created and filled if both left and right TDC time
67 // is available.
68 //
69 // Left (right) TDC time is used to find xpos and tof of hit (see HTofHit).
70 // Then HIT coordinates in the LAB, phi, theta and distance from the
71 // target are calculated by using HTofGeomPar.
72 //
73 // Left (right) ADC amplitude is used to find xposAdc and energy
74 // deposited in the rod . Additional information amplL and amplR
75 // is calculated (see HTofHit).
76 // The flagAdc have been added to distinguish levels of ADC info
77 // available: no ADC - flagAdc = 0
78 // left ADC only - flagAdc = -1
79 // right ADC only - flagAdc = 1
80 // both ADC's - flagAdc = 2
81 // Important!!!: Note that if only one ADC is available (case flagAdc = -1 or 1)
82 // the xposAdc cannot be calculated. Also amplL (amplR) cannot be found
83 // when left (right) ADC has not provided the signal.
84 //
85 // Empirical dependence of tof on position along the rod included
86 // (see talk of P.Tlusty in Coll.Meeting XI at Smolenice, TOF detector performance.)
87 //
88 // Time walk correction is included in the tof reconstruction.
89 //
90 /////////////////////////////////////////////////////////////////////////
91 
92 Bool_t HTofHitF2::bforceKeepGeant=kFALSE;
93 
94 HTofHitF2::HTofHitF2(void)
95 {
96  fCalPar = NULL;
97  fCalParSim = NULL;
98  fTofWalkPar = NULL;
99  fRawCat = fHitCat = NULL;
100  fRawCatTmp = fHitCatTmp = NULL;
101  fStartHitCat = NULL;
102  fTofSimulation = kFALSE;
103  fLoc.set(3,0,0,0);
104  iter = NULL;
105  iterTmp = NULL;
106  fDigiPar = NULL;
107 
108 }
109 
110 HTofHitF2::HTofHitF2(const Text_t *name,const Text_t *title) : HReconstructor (name,title)
111 {
112  fCalPar = NULL;
113  fCalParSim = NULL;
114  fTofWalkPar = NULL;
115  fDigiPar = NULL;
116  fRawCat = fHitCat = NULL;
117  fRawCatTmp = fHitCatTmp = NULL;
118  fStartHitCat = NULL;
119  fTofSimulation = kFALSE;
120  fLoc.set(3,0,0,0);
121  iter = NULL;
122  iterTmp = NULL;
123 
124 }
125 
127 {
128  if(iter) delete iter;
129  if(iterTmp) delete iterTmp;
130 }
131 
133 {
134  // Adds to the runtime database "rtdb" the containers needed by the Hit Finder
135  //spec is used to get information of the spectrometer setup.
136 
137  fCalPar = (HTofCalPar *) rtdb->getContainer("TofCalPar");
138  fTofGeometry = (HTofGeomPar *) rtdb->getContainer("TofGeomPar");
139  fSpecGeometry = (HSpecGeomPar *)rtdb->getContainer("SpecGeomPar");
140  fDigiPar = (HTofDigiPar *) rtdb->getContainer("TofDigiPar");
141 
142 
144  // walk correction not needed for simulation
145  fTofWalkPar = (HTofWalkPar *) rtdb->getContainer("TofWalkPar");
146  fTofWalkPar->getContainers(); // need other container for calculation
147  }
148  return;
149 
150 }
151 
152 Bool_t HTofHitF2::init(void)
153 {
154  // Initializes data levels and container parameters for operation of the
155  //hit finder
156  Bool_t r=kTRUE; // return value
157  HSpectrometer *spec = gHades->getSetup();
158  HRuntimeDb *rtdb = gHades->getRuntimeDb();
159  HEvent *ev = gHades->getCurrentEvent(); // Event structure
160 
161  if (spec && rtdb && ev) {
162  HTofDetector *tof =(HTofDetector*) spec->getDetector("Tof");
163 
164  if(ev->getCategory(catGeantKine)) fTofSimulation=kTRUE;
165 
166  if (tof) {
167  // The real work starts here
168  initParContainer(spec,rtdb);
169 
170  //-------------------------------------------------
171  // input categories
173  if (!fRawCat) {
174  if (!fRawCat) return kFALSE;
175  }
176  iter=(HIterator*)fRawCat->MakeIterator("native");
177 
178  // Get Start Hit category. If StartHit is not defined
179  // a Warning is displayed and fStartHitCat is set to 0
181  if (!fStartHitCat) Warning("init","Start hit level not defined; setting start time to 0");
182 
183 
184  //-------------------------------------------------
185  // output categories
186  if(!fTofSimulation){ // real data
188  if (!fHitCat) {
190  if (!fHitCat) return kFALSE;
191  else ev->addCategory(catTofHit,fHitCat,"Tof");
192  }
193  } else { // simulation or embedding
195  if (!fHitCat) {
196  fHitCat=tof->buildMatrixCategory("HTofHitSim",0.5F);
197  if (!fHitCat) return kFALSE;
198  else ev->addCategory(catTofHit,fHitCat,"Tof");
199  } else {
200  if (fHitCat->getClass()!=HTofHitSim::Class()) {
201  Error("HTofHitfSim::init()","Misconfigured output category");
202  return kFALSE;
203  }
204  }
205  }
206 
208  { // embedding mode
210  if(!fRawCatTmp){
211  Error("init()","No catTofRawTmp in input! You are in embedding mode!");
212  return kFALSE;
213  }
214  iterTmp = (HIterator*)fRawCatTmp->MakeIterator(); // cannot be "native", because
215  // iter->getLocation() is used
216 
218  if (!fHitCatTmp) {
219  fHitCatTmp=tof->buildMatrixCategory("HTofHitSimTmp",0.5F);
220  if (!fHitCatTmp) {
221  Error("init()","Could no build catTofHitTmp !");
222  return kFALSE;
223  }
224  else ev->addCategory(catTofHitTmp,fHitCatTmp,"Tof");
225  fHitCatTmp->setPersistency(kFALSE);
226  }
227 
228  fCalParSim = new HTofCalPar("TofCalPar_Sim_Embedding","","TofCalProductionSimEmbedding");
230  else {
231  Error("init()","Could no create HTofCalPar for sim params, needed for embedding !");
232  }
233 
234  }
235  //-------------------------------------------------
236 
237 
238 
239  } else {
240  Error("init","TOF setup is not defined");
241  r = kFALSE; // Notify error to task manager
242  }
243 
244  } else {
245  Error("init","Setup, RuntimeDb or event structure not found");
246  r = kFALSE; // Notify error to task manager
247  }
248 
249  return r;
250 
251 }
252 
254 {
255  // Find the hits.
256  //See also HReconstructor::execute
257 #if DEBUG_LEVEL>2
258  gDebuger->enterFunc("HTofHitF2::execute");
259 #endif
260 
261  //---------------------------------------------
262  // read catTofRaw and create hits in catTofHit
263  Bool_t sim=kFALSE;
264  if ( fTofSimulation) sim=kTRUE;
265  else if (!fTofSimulation) sim=kFALSE;
266 
267  if( !( gHades->getEmbeddingMode()>0 && gHades->getEmbeddingDebug() == 1) ) fillHitCat(sim,kFALSE); // in sim or real or embeding allways fill here, only embedding+debug skipped
268  //---------------------------------------------
269 
270  //---------------------------------------------
271  // In embedding mode one has to
272  // read catTofRawTmp and create hits in catTofHitTmp
273  // in addition. Embedded Hits will be merged on hitlevel
274  // later
276  fillHitCat(kTRUE,kTRUE);
277  mergeHitCats(sim,kTRUE);
278  }
279  //---------------------------------------------
280 
281 #if DEBUG_LEVEL>2
282  gDebuger->leaveFunc("HTofHitF2::execute");
283 #endif
284  return 0;
285 }
286 
288  // Fills in the LAB position parameters for the given HTofHit.
289  //
290  // This is done by transforming the point (x,0,0) in the ROD coordinate
291  // system to the LAB coordinate system. Where x is the reconstructed
292  // x position inside the hit.
293 
294  HGeomVector rLocal,r;
295  Float_t d,phi,theta;
296  Float_t rad2deg = 180./TMath::Pi();
297 
298  HModGeomPar *module=fTofGeometry->getModule(hit->getSector(),hit->getModule());
299  HGeomTransform &trans = module->getLabTransform();
300  HGeomVolume *rodVol=module->getRefVolume()->getComponent(hit->getCell());
301  HGeomTransform &rodTrans=rodVol->getTransform();
302 
303  // Fill r with the hit coordinates in the ROD coordinate system
304  // Since we do not have information about y,z coordinates of impact
305  // y=0, z=0 is used. Note that (0,0,0) corresponds to the rod center.
306  r.setX(hit->getXpos());
307  r.setY(0.);
308  r.setZ(0.);
309  rLocal=rodTrans.transFrom(r); // transform to module coordinate system
310  r=trans.transFrom(rLocal); // transform from module to LAB system
312  if (tv) r -= tv->getTransform().getTransVector(); // correct for target position
313 
314  // Fill output
315  d = r.length();
316  theta = (d>0.) ? (rad2deg * TMath::ACos(r.getZ() / d)) : 0.;
317  phi = rad2deg * TMath::ATan2( r.getY(), r.getX());
318  if (phi < 0.) phi += 360.;
319  if (tv) r += tv->getTransform().getTransVector(); // correct for target position
320 
321  hit->setXYZLab(r.getX(), r.getY(), r.getZ());
322  hit->setDistance( d );
323  hit->setTheta(theta);
324  hit->setPhi(phi);
325 }
326 
327 void HTofHitF2::fillHitCat(Bool_t sim,Bool_t embed)
328 {
329 
330 
331  HTofRaw *raw=NULL;
332  HTofHit *hit=NULL;
333  HStart2Hit *sH=NULL;
334 
335  Float_t atof;
336  Float_t axpos;
337  Float_t startTime=0.0;
338  Float_t startTimeSmearing=0.0;
339  Float_t subCl=0.0; // raw left charge subtracted by left ADC pedestal
340  Float_t subCr=0.0; // raw right charge subtracted by right ADC pedestal
341  Float_t slopeAdcL; // left ADC slope
342  Float_t slopeAdcR; // right ADC slope
343  Float_t xposAdc;
344  Float_t depE;
345  Float_t leftA;
346  Float_t rightA;
347  Float_t twalk,twalk_pos;
348  Int_t flagadc;
349 
350  //--------------------------------------------------
351  // start time extraction. For embedding some workd has to
352  // be done
353  startTime = 0.0;
354  startTimeSmearing = 0.0; // for simulation/embedding of sim tracks pStartH->getResolution()
355  // startTime = startTimeSmearing for simulation
356  // startTime != startTimeSmearing for embedding
357  // startTimeSmearing == -1000 for real data
358  if (fStartHitCat && fStartHitCat->getEntries()>0) {
359  if((sH = (HStart2Hit *) fStartHitCat->getObject(0)) != NULL){
360  startTime = sH->getTime();
361  if(sH->getResolution()!=-1000) startTimeSmearing = sH->getResolution();
362  }
363  }
364  //--------------------------------------------------
365 
366  HIterator* iterLocal;
367  HCategory* catHitLocal;
368  HTofCalPar* calparLocal;
369 
370  //--------------------------------------------------
371  // Are we running on real or sim data?
372  //
373  // sim && !embed && gHades->getEmbeddingMode()==0 sim data 1. call
374  // sim && !embed && gHades->getEmbeddingMode() >0 real data 1. call embedding
375  // sim && embed sim data 2. call embedding
376  // !sim && !embed real data 1. call real data
377 
378  Bool_t isRealData = kFALSE;
379  if((sim && !embed && gHades->getEmbeddingMode() >0) ||
380  (!sim && !embed)) isRealData = kTRUE;
381  //--------------------------------------------------
382 
383  //--------------------------------------------------
384  // switch data pointer depending if running for
385  // sim or real data!
386  if(sim&&embed) iterLocal=iterTmp;
387  else iterLocal=iter;
388 
389  if(sim&&embed) catHitLocal=fHitCatTmp;
390  else catHitLocal=fHitCat;
391 
392  if(sim&&embed) calparLocal=fCalParSim;
393  else calparLocal=fCalPar;
394  //--------------------------------------------------
395 
396  Float_t startTimeLocal = startTime; // real works normal
397  if(!isRealData) startTimeLocal = startTimeSmearing;// embedded hist have to use the
398 
399 
400  // smearing since startTime is from real data
401  iterLocal->Reset();
402  while ( (raw=(HTofRaw *)iterLocal->Next())!=NULL) {
403  fLoc[0]=raw->getSector();
404  fLoc[1]=raw->getModule();
405  fLoc[2]=raw->getCell();
406 
407  // Hit level is only filled if both left and right time are set
408  if(raw->getLeftTime() && raw->getRightTime()){
409  hit = (HTofHit *)catHitLocal->getSlot(fLoc);
410  if (hit) {
411 
412  if(fTofSimulation) hit=new (hit) HTofHitSim;
413  else hit=new (hit) HTofHit;
414 
415  HTofCalParCell& cell =(*calparLocal)[fLoc[0]][fLoc[1]][fLoc[2]];
416 
417  // New calibration with 20 bins and two side walk correction
418  // The starting point starts at X=0 -> center of the rod.
419  // After 6 iteration value converged (usually already at the third
420  // iteration the minimum is reached.
421  if (isRealData) { // walk correction has to be perform
422  fTofWalkPar->getTofPos(raw, atof, axpos, 0., startTimeLocal);
423  Float_t postemp = axpos;
424  fTofWalkPar->getTofPos(raw, atof, axpos, postemp, startTimeLocal);
425  postemp = axpos;
426  fTofWalkPar->getTofPos(raw, atof, axpos, postemp, startTimeLocal);
427  postemp = axpos;
428  fTofWalkPar->getTofPos(raw, atof, axpos, postemp, startTimeLocal);
429  postemp = axpos;
430  fTofWalkPar->getTofPos(raw, atof, axpos, postemp, startTimeLocal);
431  postemp = axpos;
432  fTofWalkPar->getTofPos(raw, atof, axpos, postemp, startTimeLocal);
433  } else { // for sim hits no walk correction
434  // The TDC's data is elaborated here.
435  atof = (raw->getLeftTime() * cell.getLeftK() +
436  raw->getRightTime()*cell.getRightK())/2.0 - cell.getTimK();
437 
438  //Substract start time. Zero if no start hit level is filled
439  atof -= startTimeLocal;
440 
441  axpos = cell.getVGroup()*(raw->getRightTime() * cell.getRightK() -
442  raw->getLeftTime()*cell.getLeftK())/2.0 +cell.getPosK();
443  }
444 
445  // The ADC's data is elaborated here.
446  xposAdc=0.0;
447  depE=0.0;
448  leftA=0.0;
449  rightA=0.0;
450  flagadc=0;
451  //twalk=twoffT;
452  twalk=0.;
453  twalk_pos=0.;
454 
455  // If at least one ADC signal then preliminary calculations.
456  if (!isRealData) { // sim data
457  if (raw->getLeftCharge()) subCl = (raw->getLeftCharge() - cell.getPedestalL()); //original version
458  if (raw->getRightCharge()) subCr = (raw->getRightCharge() - cell.getPedestalR()); //original version
459  }
460 
461  if (isRealData) { // real data
462  subCl = tot2amp(raw->getLeftCharge() - cell.getPedestalL()); //modified O.S.
463  subCr = tot2amp(raw->getRightCharge() - cell.getPedestalR()); //modified O.S.
464  }
465  slopeAdcL = (cell.getEdepK())*(TMath::Exp((cell.getGainAsym())/(cell.getAttLen())));
466  slopeAdcR = (cell.getEdepK())*(TMath::Exp(-(cell.getGainAsym())/(cell.getAttLen())));
467 
468  leftA=subCl*slopeAdcL; //changed 25.4.2013
469  rightA=subCr*slopeAdcR;
470  // Individual cases.
471  if(subCl>0){
472  flagadc=-1;
473  depE=(subCl*cell.getEdepK())*(TMath::Exp((cell.getGainAsym()-axpos)/(cell.getAttLen())));
474  // leftA=subCl*slopeAdcL;
475  twalk=-(cell.getTimeWalkC1()/(TMath::Sqrt(leftA))); // time walk correction (left ADC)
476  twalk_pos=(cell.getTimeWalkC1()/(TMath::Sqrt(leftA))); // time walk correction for position (left ADC)
477  }
478  else {
479  twalk=-(cell.getTimeWalkC1()/(TMath::Sqrt(0.35)));
480  twalk_pos=(cell.getTimeWalkC1()/(TMath::Sqrt(0.35)));
481  }
482  if(subCr>0){
483  flagadc=1;
484  depE=(subCr*cell.getEdepK())*(TMath::Exp((axpos-cell.getGainAsym())/(cell.getAttLen())));
485  //rightA=subCr*slopeAdcR;
486  twalk=twalk-(cell.getTimeWalkC2()/(TMath::Sqrt(rightA))); // time walk correction (right ADC)
487  twalk_pos=twalk_pos-(cell.getTimeWalkC2()/(TMath::Sqrt(rightA))); // time walk correction for position (right ADC)
488  }
489  else {
490  twalk=twalk-(cell.getTimeWalkC2()/(TMath::Sqrt(0.35)));
491  twalk_pos=twalk_pos-(cell.getTimeWalkC2()/(TMath::Sqrt(0.35)));
492  }
493  if(subCl>0 && subCr>0) {
494  flagadc=2;
495  xposAdc=(cell.getAttLen()/2.0)*(TMath::Log(subCl/subCr)) + cell.getGainAsym();
496  depE=(cell.getEdepK())*(TMath::Sqrt(subCl*subCr));
497  }
498 
499 
500  hit->setSector((Char_t) fLoc[0]);
501  hit->setModule((Char_t) fLoc[1]);
502  hit->setCell((Char_t) fLoc[2]);
503  hit->setTof(atof);
504  hit->setXpos(axpos);
505  hit->setXposAdc(xposAdc);
506  hit->setEdep(depE);
507  hit->setLeftAmp(leftA);
508  hit->setRightAmp(rightA);
509  hit->setAdcFlag(flagadc);
510 
511  if(fTofSimulation) {
512  HTofHitSim *hs=(HTofHitSim *)hit;
513  HTofRawSim *rs=(HTofRawSim *)raw;
514  hs->setNTrack1(rs->getNTrack1());
515  hs->setNTrack2(rs->getNTrack2());
516  }
517 
518  fillGeometry(hit);
519  }
520  }
521  }
522 }
523 void HTofHitF2::mergeHitCats(Bool_t sim,Bool_t embed)
524 {
525  //--------------------------------------------------
526  HTofHitSim* hit;
527  HTofHitSim* hittmp;
528 
529  HTofCalPar* calparLocal;
530  if(sim&&embed) calparLocal=fCalParSim;
531  else calparLocal=fCalPar;
532 
533  TIterator* hititer=fHitCatTmp->MakeIterator("native"); // sim data in embedding
534  hititer->Reset();
535 
536  while ( (hittmp=(HTofHitSim *)hititer->Next())!=NULL)
537  {
538  fLoc[0]=hittmp->getSector();
539  fLoc[1]=hittmp->getModule();
540  fLoc[2]=hittmp->getCell();
541  hit= (HTofHitSim*) fHitCat->getObject(fLoc);
542 
543  if(hit)
544  { // real hit is existing already
545  // merging should be done here. At the moment
546  // sim hits will be always transported
547 
548 
550  {
551  HTofCalParCell& cell =(*calparLocal)[fLoc[0]][fLoc[1]][fLoc[2]];
552  HTofDigiParCell& celldigi=(*fDigiPar) [fLoc[0]][fLoc[1]][fLoc[2]];
553 
554  Float_t rTime1 = (celldigi.getHalfLen() + hit->getXpos())/cell.getVGroup() + hit->getTof();
555  Float_t lTime1 = (celldigi.getHalfLen() - hit->getXpos())/cell.getVGroup() + hit->getTof();
556 
557  Float_t rTime2 = (celldigi.getHalfLen() + hittmp->getXpos())/cell.getVGroup() + hittmp->getTof();
558  Float_t lTime2 = (celldigi.getHalfLen() - hittmp->getXpos())/cell.getVGroup() + hittmp->getTof();
559 
560  Float_t rTime = rTime1;
561  Float_t lTime = lTime1;
562 
563  if(rTime>rTime2) rTime = rTime2;
564  if(lTime>lTime2) lTime = lTime2;
565 
566  Float_t tof = (lTime + rTime)/2. - celldigi.getHalfLen()/cell.getVGroup();
567  Float_t xpos = cell.getVGroup() * (rTime - lTime)/2.;
568 
569 
570  hit->setTof(tof);
571  hit->setXpos(xpos);
572 
573  fillGeometry(hit); // fill lab pos again
574 
575  hit->setEdep (hit->getEdep() + hittmp->getEdep());
576  hit->setLeftAmp (hit->getLeftAmp() + hittmp->getLeftAmp());
577  hit->setRightAmp(hit->getRightAmp()+ hittmp->getRightAmp());
578 
579  if(hittmp->getNTrack1()==hittmp->getNTrack2()){ // first track id is real track , second geant id
580  hit->setNTrack2(hittmp->getNTrack1());
581  } else { // if we have 2 different numbers we want to keep it: drop real track id
582  hit->setNTrack1(hittmp->getNTrack1());
583  hit->setNTrack2(hittmp->getNTrack2());
584  }
585 
586  }
587  else if(gHades->getEmbeddingMode() == 2 || (gHades->getEmbeddingMode()==1 && bforceKeepGeant) ) { // let GEANT particle survive
588  new (hit) HTofHitSim(*hittmp);
589  } else {
590  Error("mergeHitCats()","Unknow embedding mode = %i",gHades->getEmbeddingMode()) ;
591  }
592  }
593  else
594  { // cell was not fired by real hit before
595  hit= (HTofHitSim*) fHitCat->getSlot(fLoc);
596  if(hit)
597  {
598  new (hit)HTofHitSim(*hittmp);
599  }
600  else
601  {
602  Error("mergeHitCats()","Could not retrieve slot in catTofHit!");
603  }
604  }
605 
606  }
607 
608  delete hititer;
609 }
610 
611 
612 Float_t HTofHitF2::tot2amp(Float_t tot)
613 {
614  Float_t amp = -1.;
615  if(tot<150) amp = 3.0 * tot;
616  else amp = 128. + 2.14 * tot;
617  return amp;
618 }
619 
620 
Char_t getSector(void)
Definition: htofhit.h:27
Float_t getTimeWalkC1()
Definition: htofcalpar.h:37
Float_t getTimK()
Definition: htofcalpar.h:31
virtual Bool_t addCategory(Cat_t aCat, HCategory *cat, Option_t opt[])=0
void setPhi(Float_t ph)
Definition: htofhit.h:54
void setXYZLab(Float_t x, Float_t y, Float_t z)
Definition: htofhit.h:51
HGeomTransform & getTransform()
Definition: hgeomvolume.h:22
void setAdcFlag(Int_t af)
Definition: htofhit.h:55
HCategory * fHitCatTmp
Pointer to the hits category.
Definition: htofhitf2.h:23
Definition: hevent.h:17
void setEdep(Float_t aedep)
Definition: htofhit.h:48
void setCell(Char_t c)
Definition: htofhit.h:44
Int_t getEmbeddingMode()
Definition: hades.h:98
HCategory * buildCategory(Cat_t cat)
Definition: htofdetector.cc:88
HGeomCompositeVolume * getRefVolume()
Definition: hdetgeompar.h:20
void fillGeometry(HTofHit *)
overwrite embedding mode from 1 to 2 if true (default : false)
Definition: htofhitf2.cc:287
void setSector(Char_t s)
Definition: htofhit.h:42
Float_t tot2amp(Float_t tot)
Definition: htofhitf2.cc:612
Double_t getZ() const
Definition: hgeomvector.h:24
HTofGeomPar * fTofGeometry
Definition: htofhitf2.h:31
Float_t getPedestalR()
Definition: htofcalpar.h:33
HModGeomPar * getModule(const Int_t, const Int_t)
Definition: hdetgeompar.cc:162
Float_t getTof(void)
Definition: htofhit.h:30
Int_t getEmbeddingDebug()
Definition: hades.h:100
Float_t getEdepK()
Definition: htofcalpar.h:36
const Cat_t catStart2Hit
Definition: hstartdef.h:8
Float_t getPedestalL()
Definition: htofcalpar.h:32
HRichPadSignal & raw
HCategory * buildMatrixCategory(const Text_t *classname, Float_t fillRate)
Definition: htofdetector.cc:67
Definition: htofraw.h:7
void setXpos(Float_t axpos)
Definition: htofhit.h:46
HCategory * fRawCatTmp
Raw data category.
Definition: htofhitf2.h:21
HRuntimeDb * getRuntimeDb(void)
Definition: hades.h:111
Float_t getRightK()
Definition: htofcalpar.h:28
HEvent *& getCurrentEvent(void)
Definition: hades.cc:422
const Cat_t catGeantKine
Definition: hgeantdef.h:8
void enterFunc(const Text_t *func)
Definition: hdebug.cc:23
Float_t getPosK()
Definition: htofcalpar.h:30
void setZ(const Double_t a)
Definition: hgeomvector.h:30
~HTofHitF2(void)
Definition: htofhitf2.cc:126
Float_t getLeftTime(void)
Definition: htofraw.h:49
Char_t getModule(void)
Definition: htofraw.h:25
Float_t getLeftAmp(void)
Definition: htofhit.h:34
Char_t getCell(void)
Definition: htofraw.h:26
Bool_t addContainer(HParSet *)
Definition: hruntimedb.cc:103
ClassImp(HDbColumn) HDbColumn
Definition: hdbcolumn.cc:18
HTofWalkPar * fTofWalkPar
Definition: htofhitf2.h:34
Int_t getNTrack2(void) const
Definition: htofrawsim.h:21
Double_t theta
Char_t getSector(void)
Definition: htofraw.h:24
HTofCalPar * fCalParSim
Calibration parameters.
Definition: htofhitf2.h:26
const Cat_t catTofRawTmp
Definition: tofdef.h:10
HCategory * fRawCat
Definition: htofhitf2.h:20
Int_t getNTrack1(void) const
Definition: htofhitsim.h:19
void setRightAmp(Float_t arAmp)
Definition: htofhit.h:50
Float_t getRightTime(void)
Definition: htofraw.h:45
HIterator * iter
Definition: htofhitf2.h:29
void setX(const Double_t a)
Definition: hgeomvector.h:28
HSpectrometer * getSetup(void)
Definition: hades.h:112
HDetector * getDetector(const Char_t *name)
const Cat_t catTofHitTmp
Definition: tofdef.h:11
const HGeomVector & getTransVector() const
Int_t getNTrack1(void) const
Definition: htofrawsim.h:20
HTofHitF2(void)
Double_t length() const
Definition: hgeomvector.h:53
HGeomVolume * getTarget(const Int_t n)
Definition: hspecgeompar.cc:82
HDebug * gDebuger
Definition: hdebug.cc:33
Float_t getRightAmp(void)
Definition: htofhit.h:35
const Cat_t catTofHit
Definition: tofdef.h:7
Float_t getResolution(void) const
Definition: hstart2hit.h:53
Hades * gHades
Definition: hades.cc:1213
Float_t getTime(void) const
Definition: hstart2hit.h:49
Float_t getHalfLen()
Definition: htofdigipar.h:26
Float_t getAttLen()
Definition: htofcalpar.h:34
void setNTrack1(const Int_t n)
Definition: htofhitsim.h:15
HParSet * getContainer(const Text_t *)
Definition: hruntimedb.cc:124
HGeomVector transFrom(const HGeomVector &p) const
Float_t getVGroup()
Definition: htofcalpar.h:29
Bool_t fTofSimulation
Definition: htofhitf2.h:33
void setTheta(Float_t th)
Definition: htofhit.h:53
Float_t getLeftK()
Definition: htofcalpar.h:27
void getTofPos(HTofRaw *tofraw, Float_t &tof, Float_t &pos, Float_t x, Float_t startTMP)
Definition: htofwalkpar.cc:213
Char_t getCell(void)
Definition: htofhit.h:29
void setY(const Double_t a)
Definition: hgeomvector.h:29
void getContainers()
Definition: htofwalkpar.cc:57
Int_t execute(void)
Definition: htofhitf2.cc:253
Float_t getTimeWalkC2()
Definition: htofcalpar.h:38
void setNTrack2(const Int_t n)
Definition: htofhitsim.h:16
void setLeftAmp(Float_t alAmp)
Definition: htofhit.h:49
Float_t getXpos(void)
Definition: htofhit.h:31
void setXposAdc(Float_t axposAdc)
Definition: htofhit.h:47
static Bool_t bforceKeepGeant
Definition: htofhitf2.h:36
Bool_t init(void)
Definition: htofhitf2.cc:152
Int_t getNTrack2(void) const
Definition: htofhitsim.h:20
const Cat_t catTofRaw
Definition: tofdef.h:6
void leaveFunc(const Text_t *func)
Definition: hdebug.cc:28
Float_t phi
Definition: drawAccCuts.C:15
virtual HCategory * getCategory(Cat_t aCat)=0
HGeomTransform & getLabTransform()
Definition: hdetgeompar.h:21
Float_t getGainAsym()
Definition: htofcalpar.h:35
HTofCalPar * fCalPar
Category with start hits.
Definition: htofhitf2.h:25
Double_t getX() const
Definition: hgeomvector.h:22
Char_t getModule(void)
Definition: htofhit.h:28
HCategory * fHitCat
Raw tmp data category.
Definition: htofhitf2.h:22
Definition: htofhit.h:6
void initParContainer(HSpectrometer *, HRuntimeDb *)
Definition: htofhitf2.cc:132
void fillHitCat(Bool_t sim=kFALSE, Bool_t embed=kFALSE)
Definition: htofhitf2.cc:327
Float_t getEdep(void)
Definition: htofhit.h:33
void mergeHitCats(Bool_t sim, Bool_t emb)
Definition: htofhitf2.cc:523
void setDistance(Float_t d)
Definition: htofhit.h:52
HTofDigiPar * fDigiPar
Calibration parameters of sim for embedding.
Definition: htofhitf2.h:27
Double_t getY() const
Definition: hgeomvector.h:23
HSpecGeomPar * fSpecGeometry
Container for TOF geometry.
Definition: htofhitf2.h:32
HIterator * iterTmp
Definition: htofhitf2.h:30
HLocation fLoc
Definition: htofhitf2.h:28
void setModule(Char_t m)
Definition: htofhit.h:43
void setTof(Float_t atof)
Definition: htofhit.h:45
Float_t getRightCharge(void)
Definition: htofraw.h:53
HCategory * fStartHitCat
Pointer to the tmp hits category.
Definition: htofhitf2.h:24
Float_t getLeftCharge(void)
Definition: htofraw.h:57
HGeomVolume * getComponent(const Int_t)