FairRoot/PandaRoot
PndEmcWaveformToDigi.cxx
Go to the documentation of this file.
1 //----------------------------------------------------------------------
2 // File and Version Information:
3 // $Id: //
4 // Description:
5 // Class PndEmcWaveformToDigi. Module to take the ADC waveforms and produces digi.
6 //
7 // Software developed for the BaBar Detector at the SLAC B-Factory.
8 // Adapted for the PANDA experiment at GSI
9 //
10 // Author List:
11 // Phil Strother Original Author
12 // Dima Melnichuk - adaption for PANDA
13 // Copyright Information:
14 // Copyright (C) 1996 Imperial College
15 //
16 //----------------------------------------------------------------------
17 
18 #include "PndEmcWaveformToDigi.h"
19 #include "PndEmcMapper.h"
20 #include "PndEmcWaveform.h"
21 #include "PndEmcDigi.h"
22 #include "PndEmcDigiPar.h"
23 #include "PndEmcRecoPar.h"
24 #include "PndEmcFpgaPar.h"
25 #include "PndEmcAsicPulseshape.h"
26 #include "PndEmcPSAParabolic.h"
28 #include "FairEventHeader.h"
29 #include "FairRootManager.h"
30 #include "FairFileSource.h"
31 #include "FairRunAna.h"
32 #include "FairRuntimeDb.h"
34 #include "TClonesArray.h"
35 #include "TStopwatch.h"
36 #include "PndEmcStructure.h"
37 #include "PndEmcXtal.h"
38 #include "PndMCTrack.h"
39 #include <iostream>
42 #include "TCanvas.h"
43 #include "TGraphErrors.h"
44 #include "TRandom.h"
45 
46 using std::cout;
47 using std::endl;
48 using std::fstream;
49 
51  : fWaveformArray(0)
52  , fDigiArray(0)
53  , fSampleRate(0)
54  , fSampleRate_PMT(0)
55  , fEnergyDigiThreshold(0)
56  , fASIC_Shaping_int_time(0)
57  , fPMT_Shaping_int_time(0)
58  , fPMT_Shaping_diff_time(0)
59  , fCrystal_time_constant(0)
60  , fShashlyk_time_constant(0)
61  , fNumber_of_samples_in_waveform(0)
62  , fNumber_of_samples_in_waveform_pmt(0)
63  , fDigiPosMethod(0)
64  , fEmcDigiRescaleFactor(0)
65  , fEmcDigiPositionDepthPWO(0)
66  , fEmcDigiPositionDepthShashlyk(0)
67  , fPulseshape(0)
68  , fPulseshape_pmt(0)
69  , fpsaAlgorithm(0)
70  , fpsaAlgorithm_pmt(0)
71  , fpsaAlgorithm_fwd(0)
72  , fCalibrator()
73  , fDigiPar(new PndEmcDigiPar())
74  , fRecoPar(new PndEmcRecoPar())
75  , fFpgaPar(new PndEmcFpgaPar())
76  , fVerbose(verbose)
77  , fTimeOrderedDigi(kFALSE)
78  , fWfNormalisation(0)
79  , fWfNormalisation_fwd(0)
80  , fWfNormalisation_pmt(0)
81  , fDigitizationVersion2(kFALSE)
82  , fFakeOnline(false)
83 {
84  fDigiPosMethod="depth";// "surface" or "depth"
86  SetPersistency(storedigis);
87  //fPndEmcDigiPositionDepth=6.2;
88 }
89 
90 //--------------
91 // Destructor --
92 //--------------
94 {
95  delete fPulseshape;
96  delete fPulseshape_pmt;
97  delete fPulseshape_fwd;
98 
99 }
100 
101 
113 {
115  // Get RootManager
116  FairRootManager* ioman = FairRootManager::Instance();
117  if ( ! ioman )
118  {
119  cout << "-E- PndEmcWaveformToDigi::Init: "
120  << "RootManager not instantiated!" << endl;
121  return kFATAL;
122  }
123 
124  // Get input array
125  if(fTimeOrderedDigi){
126  fWaveformArray = dynamic_cast<TClonesArray *>( ioman->GetObject("EmcSortedWaveform"));
127  if (!FairRunAna::Instance()->IsTimeStamp()) {
128  cout << "-W- PndEmcWaveformToDigi::Init: "
129  << "Task running timebased, but run not running timebased" << endl;
130  }
131  }else{
132  fWaveformArray =dynamic_cast<TClonesArray *> (ioman->GetObject("EmcWaveform"));
133  }
134 // fWaveformArrayOrg = (TClonesArray*) ioman->GetObject("EmcWaveform");
135  //fEvtHeaderArray = (TClonesArray*) ioman->GetObject("EventHeader.");
136 
137  if ( ! fWaveformArray ) {
138  cout << "-W- PndEmcWaveformToDigi::Init: "
139  << "No PndEmcWaveform array!" << endl;
140  return kERROR;
141  }
142 
143  // Create and register output array
144  fDigiArray = new TClonesArray("PndEmcDigi");
145  ioman->Register("EmcDigi","Emc",fDigiArray,GetPersistency());
146 
147 
164 
165  if(fVerbose>2){
166  cout<<"fEnergyDigiThreshold: "<<fEnergyDigiThreshold<<endl;
167  cout<<"fEmcDigiPositionDepthPWO: "<<fEmcDigiPositionDepthPWO<<endl;
168  cout<<"fEmcDigiPositionDepthShashlyk: "<<fEmcDigiPositionDepthShashlyk<<endl;
169  }
170 
171  if (!fDigiPosMethod.CompareTo("surface"))
172  {
174  }
175  else if (!fDigiPosMethod.CompareTo("depth"))
176  {
179  }
180  else
181  {
182  cout << "-W- PndEmcWaveformToDigi::Init: "
183  << "Unknown digi position method!" << endl;
184  return kERROR;
185  }
186 
189  fPulseshape_fwd =new PndEmcAsicPulseshape(fFWD_Shaping_int_time, fFWD_time_constant);//LNP raw signal, decay time constant 25 microseconds
190 
191  // Determine normalisation constant for PndEmcWaveform
194  PndEmcWaveform *tmpwaveform3=new PndEmcWaveform(0,101010001, fSampleRate_FWD, fNumber_of_samples_in_waveform_fwd);//length 10
195 
196  PndEmcHit *gevHit=new PndEmcHit();
197  gevHit->SetEnergy(1.0);
198  gevHit->SetTime(0.);
199  tmpwaveform1->UpdateWaveform(gevHit, 0, false, 1., 0., fSampleRate, fPulseshape);
200  tmpwaveform2->UpdateWaveform(gevHit, 0, false, 1., 0., fSampleRate_PMT, fPulseshape_pmt);
201  tmpwaveform3->UpdateWaveform(gevHit, 0, false, 1., 0., fSampleRate_FWD, fPulseshape_fwd);
202 
203  fWfNormalisation = tmpwaveform1->Max();
204  fWfNormalisation_pmt = tmpwaveform2->Max();
205  fWfNormalisation_fwd = tmpwaveform3->Max();
206 
207  fFpgaPar->printParams();
208  if(fVerbose > 2){
209  cout<<"fWfNormalisation#"<<fWfNormalisation<<", I/A ="<<(tmpwaveform1->Integral()/fWfNormalisation)<<endl;
210  cout<<"fWfNormalisation#"<<fWfNormalisation<<", I ="<<tmpwaveform1->Integral()<<endl;
211  cout<<"fWfNormalisation_pmt#"<<fWfNormalisation_pmt<<", I/A ="<<(tmpwaveform2->Integral()/fWfNormalisation_pmt)<<endl;
212  cout<<"fWfNormalisation_fwd#"<<fWfNormalisation_fwd<<", I ="<<(tmpwaveform3->Integral())<<endl;
213  cout<<"fWfNormalisation_fwd#"<<fWfNormalisation_fwd<<", I/A ="<<(tmpwaveform3->Integral()/fWfNormalisation_fwd)<<endl;
214  }
215  //setup barrel backward
226  newParams.clock_unit = 1./fSampleRate*1.e9;//in unit of ns
227  newParams.iafactor = tmpwaveform1->Integral()/fWfNormalisation;//31.4166;
229  theAlg2->init(newParams);
230  theAlg2->setBaselineInterval(0,0);
231  fpsaAlgorithm= theAlg2;
232  //setup forward digital filter
234  //PndEmcPSAFPGASampleAnalyser::SampleAnalyserParams newParams;
242  newParams.hit_threshold = fFpgaPar->GetForwardPulseThreshold()*fWfNormalisation_fwd*0.001;//five times larger than noise,
243  newParams.clock_unit = 1./fSampleRate_FWD*1.e9;//in unit of ns
244  newParams.iafactor = tmpwaveform3->Integral()/fWfNormalisation_fwd;//151.408;
246  theAlg1->init(newParams);
247  theAlg1->setBaselineInterval(0,0);
248  fpsaAlgorithm_fwd = theAlg1;
249 
250  //setup shashylik
252  //PndEmcPSAFPGASampleAnalyser::SampleAnalyserParams newParams;
261  newParams.clock_unit = 1./fSampleRate_PMT*1.e9;//in unit of ns
262  newParams.iafactor = tmpwaveform2->Integral()/fWfNormalisation_pmt;//5.08306;//this factor depends on the pulseshape function
264  theAlg3->init(newParams);
265  theAlg3->setBaselineInterval(0,0);
266  fpsaAlgorithm_pmt = theAlg3;
267 
268  //Int_t iMapperVersion;
269  //PndEmcMapper::Init(iMapperVersion=1);
271 
272  fFunctor = new StopTime();
273  fEventNo = 0;
274 
276  // Matched digital filter
277  // Parameters of the filter are hardcoded at the moment
278  // For different pulseshape in barrel and endcaps different filters should be implemented
279  std::vector<Double_t> params;
280  params.push_back(30); // width
281  params.push_back(fSampleRate); // Sample rate
284  // Pulse shape analysis algorithm.
285  // Simple parabolic fit.
287  }
288 
289  if(fCalibrator == NULL){
291  // Determine normalisation constant for PndEmcWaveform
292  Double_t tmpPeakPosition;
293  Double_t WfNormalisation;
294  fpsaAlgorithm->Process(tmpwaveform1);
295  fpsaAlgorithm->GetHit(0, WfNormalisation, tmpPeakPosition);
296  SimCalibrator->SetCalibration(1,WfNormalisation); // Barrel
297  SimCalibrator->SetCalibration(2,WfNormalisation); // Barrel
298  SimCalibrator->SetCalibration(4,WfNormalisation); // Backward endcap
299  fpsaAlgorithm_pmt->Process(tmpwaveform2);
300  fpsaAlgorithm_pmt->GetHit(0, WfNormalisation, tmpPeakPosition);
301  SimCalibrator->SetCalibration(5,WfNormalisation); // Shashlyk
302  fpsaAlgorithm_fwd->Process(tmpwaveform3);
303  fpsaAlgorithm_fwd->GetHit(0, WfNormalisation, tmpPeakPosition);
304  SimCalibrator->SetCalibration(3,WfNormalisation); // Forward endcap
305  fCalibrator=SimCalibrator;
306  }
307  fCalibrator->Init();
308 
309 
310  delete tmpwaveform1;
311  delete tmpwaveform2;
312  delete tmpwaveform3;
313  //delete tmpwaveform4;
314  delete gevHit;
315 
317  totHits = 0;
318  totExpHits = 0;
319  totNumOfWave = 0;
320 
321  cout << "-I- PndEmcWaveformToDigi: Intialization successfull" << endl;
322  return kSUCCESS;
323 }
324 
335 {
336  TStopwatch timer;
337  if (fVerbose>2){
338  timer.Start();
339  }
340 
341  fDigiArray->Delete();
342 
343  Double_t fevtTime = FairRootManager::Instance()->GetEventTime();
344 
345  if(fVerbose>0){
346  cout<<endl;
347  cout<<"=======================PndEmcWaveformToDigi======================="<<endl;
348  std::cout<<"Event NO. #"<<fEventNo<<", event time # "<<fevtTime <<std::endl;
349  }
350  if(fTimeOrderedDigi){
351  if(FairRunAna::Instance()->IsTimeStamp()){
352  fWaveformArray->Delete();
353  Double_t time_length = 40.;//99.98%
354  if(fVerbose >0)
355  cout<<"--I-- time-based simulation, read data to later #"<<time_length<<" ns"<<endl;
356  fWaveformArray = FairRootManager::Instance()->GetData("EmcSortedWaveform"
357  , fFunctor
358  , fevtTime + time_length);
359  }
360  if(fVerbose>0)
361  std::cout<<"fDigiArrayTBD size #"<<PndEmcDigi::fDigiArrayTBD->GetEntriesFast()<<std::endl;
362  }
363  Int_t nWaveforms = fWaveformArray->GetEntriesFast();
364  if(fVerbose>0){
365  std::cout<<"fWaveformArray size #"<<nWaveforms<<std::endl;
366  }
367  //std::cout<<"fEvtHeaderArray size #"<<fEvtHeaderArray->GetEntriesFast()<<std::endl;
368  //Int_t evtNo = FairRunAna::Instance()->GetEventHeader()->GetMCEntryNumber();
369  //for(Int_t iheader=0;iheader<fEvtHeaderArray->GetEntriesFast();++iheader){
370  // FairEventHeader* evtHeader= (FairEventHeader*) fEvtHeaderArray->At(iheader);
371  // cout<<"===> Event NO. #"<<evtHeader->GetMCEntryNumber()<<", event time#"<<evtHeader->GetEventTime()<<endl;
372  //}
373 
374 
375  Double_t fdigiEnergy(0.), fdigiTime(0.), theSampleRate, minT(1e10), maxT(-1e10);
376  Int_t hitIndex, nHits, detId, trackId, i_digi(0), fMod;
377  PndEmcAbsPSA *thePSA(0);
378 
379  totNumOfWave += nWaveforms;
380  for (Int_t iWaveform=0; iWaveform<nWaveforms; iWaveform++)
381  {
382  PndEmcWaveform* theWaveform = (PndEmcWaveform*) fWaveformArray->At(iWaveform);
383  hitIndex=theWaveform->GetHitIndex();
384  detId=theWaveform->GetDetectorId();
385  trackId=theWaveform->GetTrackId();
386  fMod=theWaveform->GetModule();
387 
388  if(theWaveform->GetTimeStamp() < minT ) minT = theWaveform->GetTimeStamp();
389  if(theWaveform->GetTimeStamp() > maxT ) maxT = theWaveform->GetTimeStamp();
390  //Double_t timeshift; // how maximum is shifted
391  if(fMod== 5){
392  thePSA = fpsaAlgorithm_pmt;
393  theSampleRate = fSampleRate_PMT;
394  } else if(fMod == 3){
395  thePSA = fpsaAlgorithm_fwd;
396  theSampleRate = fSampleRate_FWD;
397  }else
398  {
399  thePSA = fpsaAlgorithm;
400  theSampleRate = fSampleRate;
401  }
402  //cout<<endl;
403  const std::vector<Int_t>& evtList = theWaveform->GetEvtList();
404  if(fVerbose > 1){
405  cout<<endl;
406  std::cout<<"The wave#"<<iWaveform<<" includes "<<evtList.size()<<" events #";
407  for(size_t i=0; i< evtList.size(); ++i){
408  std::cout<<evtList[i]<<" ";
409  }
410  cout<<endl;
411  }
412 
413  nHits = thePSA->Process(theWaveform);
414 
415  if(fVerbose > 1){
416  std::cout<<"detID#"<<theWaveform->GetDetectorId()<<", hits#"<<nHits<<std::endl;
417  }
418  totHits += nHits;
419  totExpHits += evtList.size();
420 
421  for(Int_t i = 0 ; i< nHits; i++)
422  {
423  thePSA->GetHit(i, fdigiEnergy, fTimeShift);
425  continue;
426  }
427  fdigiTime = theWaveform->GetTimeStamp();// + fTimeShift/theSampleRate*1.e9;//translate position to global time //TS: I do not unerstand this line waveform time is in ns and the tof of the particle but TimeShift is divided by samplingtime??
428 
429  if(fVerbose>1){
430  //if(fdigiTime-fevtTime>200. || fdigiTime - fevtTime < 0.)
431  {
432  cout<<"wave #"<<iWaveform<<", WaveformTime#" << theWaveform->GetTimeStamp() << ", mod#"<<fMod<<", theSampleRate#"<<theSampleRate<<", shift#"<<fTimeShift<<endl;
433  cout<<"fdigiEnergy#"<<fdigiEnergy<<", fdigiTime#"<<fdigiTime<<", evtTime#"<<fevtTime<<", diffT#"<<(fdigiTime-fevtTime)<<endl;
434  }
435  }
436  // [R.K.] Assume there is either time based or non-time based, so smearung runs only once
437  if(fFakeOnline) fdigiEnergy = SmearFakeOnline(fdigiEnergy);
438 
439  if (fdigiEnergy>fEnergyDigiThreshold)
440  {
442 
443  PndEmcDigi* myDigi(0);
444  //std::cout<<"PndEmcWaveformToDigi::trackId #"<<trackId<<endl;
445  myDigi = new((*fDigiArray)[i_digi++]) PndEmcDigi(trackId,detId, fdigiEnergy, fdigiTime, hitIndex);
446  myDigi->fEvtNo = evtList[i];//fEventNo;
447 
448  myDigi->AddLink(FairLink("EmcWaveform", iWaveform));
449  }
450  }
451  }
452  Int_t nOldSize = fDigiArray->GetEntriesFast();
453  Int_t nDigi = PndEmcDigi::fDigiArrayTBD->GetEntriesFast();
454  if(fTimeOrderedDigi){
455  for(Int_t iDigi = 0; iDigi < nDigi; ++iDigi)
456  { // [R.K.] Assume there is either time based or non-time based, so smearung runs only once
458  if(fFakeOnline) copy->SetEnergy(SmearFakeOnline(copy->GetEnergy()));
459  new((*fDigiArray)[i_digi++]) PndEmcDigi(*copy);
460  }
461  //free buffer
462  PndEmcDigi::fDigiArrayTBD->Delete();
463  }
464  if(fVerbose >0){
465  Int_t nNewSize = fDigiArray->GetEntriesFast();
466  std::cout<<nNewSize<<" digis, "<<nOldSize<<" <--waveform, "<<nDigi<<" <--previous event."<<std::endl;
467  cout<<"=======================PndEmcWaveformToDigi======================="<<endl;
468  }
469 
470  //if(fVerbose >1){
471  // cout<<"=======================PndEmcWaveformToDigi======================="<<endl;
472  // cout<<"time region #"<<minT<<", "<<maxT<<endl;
473  // cout<<"=================================================================="<<endl;
474  //}
475 
476  if (fVerbose>2){
477  timer.Stop();
478  Double_t rtime = timer.RealTime();
479  Double_t ctime = timer.CpuTime();
480  cout << "PndEmcWaveformToDigi, Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
481  }
482  fEventNo ++;
483 }
484 
486 
487  // Get run and runtime database
488  FairRun* run = FairRun::Instance();
489  if ( ! run ) Fatal("SetParContainers", "No analysis run");
490 
491  FairRuntimeDb* db = run->GetRuntimeDb();
492  if ( ! db ) Fatal("SetParContainers", "No runtime database");
493 
494  // Get Emc digitisation parameter container
495  fDigiPar = (PndEmcDigiPar*) db->getContainer("PndEmcDigiPar");
496 
497  // Get Emc reconstruction parameter container
498  fRecoPar = (PndEmcRecoPar*) db->getContainer("PndEmcRecoPar");
499 
500  // Get Emc FPGA parameter container
501  fFpgaPar = (PndEmcFpgaPar*) db->getContainer("PndEmcFpgaPar");
502 }
503 
505 {
506  SetPersistency(val);
507  return;
508 }
509 
518 {
519 
520  //unmatchCount += fBufferofDigisToBeDetermined.size();
521  std::cout<<"========================================================="<<std::endl;
522  std::cout<<"PndEmcWaveformToDigi::FinishTask"<<std::endl;
523  std::cout<<"========================================================="<<std::endl;
524  std::cout<<"Total waveforms# "<<totNumOfWave<<std::endl;
525  std::cout<<"Total expected hits# "<<totExpHits<<std::endl;
526  std::cout<<"Total fpga hits# "<<totHits<<std::endl;
527  std::cout<<"Total digis Above th. #"<<totDigisAboveThreshold<<", threshold# "<<fEnergyDigiThreshold<<std::endl;
528  std::cout<<"========================================================="<<std::endl;
529  //fpsaAlgorithm->Print();
530  //fpsaAlgorithm_pmt->Print();
531  //std::cout<<"pileup events #"<<PileupEventSet.size()<<std::endl;
532  //std::cout<<"Correct Ana#"<<CorrectAna<<std::endl;
533  //std::cout<<"UnCorrect Ana#"<<unCorrectAna<<std::endl;
534  //std::set<Int_t>::iterator it = PileupEventSet.begin();
535  //std::set<Int_t>::iterator end = PileupEventSet.end();
536  //Int_t LineNo= 0;
537  //for(; it != end; ++it){
538  // std::cout<<(*it)<<' ';
539  // if(++LineNo % 10 == 0)
540  // std::cout<<std::endl;
541  //}
542  //std::cout<<std::endl;
543 
544 }
545 
546 /*Double_t PndEmcWaveformToDigi::GetEventTimebyDigiTime(Double_t digiT, Double_t digiE, Int_t detID, bool PrintOut) const
547  {
548  PndEmcTwoCoordIndex* _tci = PndEmcMapper::Instance()->GetTCI(detID);
549  PndEmcTciXtalMap& map = const_cast<PndEmcTciXtalMap&> ( PndEmcStructure::Instance()->GetTciXtalMap());
550  TVector3 Where = PndEmcDigi::algPointer()(map.find(_tci)->second);
551  Double_t path = Where.Mag();
552 //Double_t path = map[_tci]->frontCentre().Mag();
553 
554 
555 TVectorD vFunc(6);
556 vFunc[0]=1.;
557 vFunc[1]=path;
558 vFunc[2]=1./TMath::Sqrt(digiE);
559 vFunc[3]=1./digiE;
560 vFunc[4]=vFunc[3]*vFunc[3];
561 vFunc[5]=vFunc[4]*vFunc[3];
562 
563 Double_t corrT(0.);
564 Int_t mod = detID/100000000;
565 
566 if(mod == 3){
567 corrT = CoeffMod3*vFunc;
568 }else if( mod == 5){
569 corrT = CoeffMod5*vFunc;
570 }else{
571 corrT = CoeffModo*vFunc;
572 }
573 if(PrintOut){
574 //if(mod == 5){
575 // vFunc.Print();
576 // CoeffMod5.Print();
577 //}
578 cout<<"path = "<<path<<", mod = "<<mod<<", corrT = "<<corrT<<endl;
579 }
580 return digiT - corrT;
581 }
582 Int_t PndEmcWaveformToDigi::GetIdxByEnergy(Double_t energy) const
583 {
584 if(energy < 0.006) return 0;
585 if(energy < 0.008) return 1;
586 if(energy < 0.010) return 2;
587 if(energy < 0.1)
588 return 2 + Int_t(energy/0.01);//energy step 0.01GeV
589 if(energy >= 0.1){
590 //Int_t idx = Int_t(energy/0.1);
591 //if(idx > 2) idx = 2;
592 return 12;
593 }
594 }*/
595 
596 
598 { // Additional fake energy resolution to get about a factor 2 worse
599  // dE/E =~ 1% + 1.63%/(E/GeV)
600  if(!fFakeOnline) return energy;
601  Float_t resolution=0.01*energy+0.0163*sqrt(energy);
602  return gRandom->Gaus(energy,resolution);
603 }
604 
605 
Int_t GetBarrelMAFilterLength()
Definition: PndEmcFpgaPar.h:11
virtual void init(PndEmcPSAFPGASampleAnalyser::SampleAnalyserParams &params)
Int_t GetForwardMWDFilterUsed()
Definition: PndEmcFpgaPar.h:26
int fVerbose
Definition: poormantracks.C:24
Double_t Integral() const
Double_t GetEmcDigiPositionDepthShashlyk()
Definition: PndEmcRecoPar.h:25
Double_t GetSampleRate()
Definition: PndEmcDigiPar.h:39
Int_t GetForwardCFDelayLength()
Definition: PndEmcFpgaPar.h:25
Double_t GetPMT_Shaping_diff_time()
Definition: PndEmcDigiPar.h:33
static void selectDigiPositionMethod(PositionMethod, double positionDepthPWO=0., double positionDepthShahslyk=0., double rescaleFactor=1.)
Definition: PndEmcDigi.cxx:153
static TClonesArray * fDigiArrayTBD
Definition: PndEmcDigi.h:52
Int_t run
Definition: autocutx.C:47
Int_t GetForwardCFFitterLength()
Definition: PndEmcFpgaPar.h:24
Int_t GetNumber_of_samples_in_waveform()
Definition: PndEmcDigiPar.h:44
Pulseshape analysis for ADC waveforms.
virtual Double_t GetEnergy() const
Definition: PndEmcDigi.cxx:296
represents the reconstructed hit of one emc crystal
Definition: PndEmcDigi.h:40
virtual void FinishTask()
Called at end of task.
Int_t i
Definition: run_full.C:25
Int_t GetShashylikCFFitterLength()
Definition: PndEmcFpgaPar.h:34
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
PndEmcAbsPulseshape * fPulseshape
Double_t val[nBoxes][nFEBox]
Definition: createCalib.C:11
#define verbose
Int_t GetShashylikMWDFilterUsed()
Definition: PndEmcFpgaPar.h:36
Double_t GetBarrelPulseThreshold()
Definition: PndEmcFpgaPar.h:19
virtual Int_t Process(const PndEmcWaveform *waveform)=0
Find Hits in Waveform.
Double_t GetCrystal_time_constant()
Definition: PndEmcDigiPar.h:36
Int_t GetHitIndex() const
void SetPersistency(Bool_t val=kTRUE)
Pulseshape analysis for ADC waveforms.
Double_t GetForwardMWDFilterLifeT()
Definition: PndEmcFpgaPar.h:28
Double_t GetShashylikCFFilterRatio()
Definition: PndEmcFpgaPar.h:33
Double_t GetBarrelCFFilterRatio()
Definition: PndEmcFpgaPar.h:13
Int_t GetBarrelMWDFilterUsed()
Definition: PndEmcFpgaPar.h:16
virtual void GetHit(Int_t i, Double_t &energy, Double_t &time)=0
Get energy and time of hit.
static void InitDigiArrayTBD()
Definition: PndEmcDigi.cxx:89
Double_t GetASIC_Shaping_int_time()
Definition: PndEmcDigiPar.h:31
Pulseshape from an CRRC-Shaper.
Double_t GetEnergyDigiThreshold()
Definition: PndEmcDigiPar.h:42
Double_t GetSampleRate_FWD()
Definition: PndEmcDigiPar.h:41
cout<< "blue = Monte Carlo "<< endl;cout<< "red = Helix Hit "<< endl;cout<< "green = Center Of Tubes "<< endl;for(Int_t k=0;k< track->GetEntriesFast();k++){PndSttTrack *stttrack=(PndSttTrack *) track-> At(k)
Definition: checkhelixhit.C:56
Int_t GetBarrelMWDFilterLength()
Definition: PndEmcFpgaPar.h:17
Int_t GetForwardCFFilterLength()
Definition: PndEmcFpgaPar.h:22
virtual CalibrationStatus_t Calibrate(Double_t &Energy, Long_t detId, Int_t SignalNr=1)=0
Apply CrystalCalibration to Energy of Crystal derId.
void SetEnergy(Double32_t energy)
Definition: PndEmcDigi.h:84
int nHits
Definition: RiemannTest.C:16
Int_t GetShashylikCFFilterLength()
Definition: PndEmcFpgaPar.h:32
Int_t GetShashylikCFDelayLength()
Definition: PndEmcFpgaPar.h:35
Pulseshape from an APFEL ASIC preamplifier shaper.
Double_t
int GetTrackId() const
Int_t GetShashylikMWDFilterLength()
Definition: PndEmcFpgaPar.h:37
Int_t GetBarrelCFFilterLength()
Definition: PndEmcFpgaPar.h:12
virtual void SetCalibration(Int_t ModId, Double_t cal, Int_t SignalNr=1, Double_t overflow=-1)
Set Calibration for a Module.
const std::vector< Int_t > & GetEvtList() const
TStopwatch timer
Definition: hit_dirc.C:51
virtual void setBaselineInterval(int anl_start, int bl_stop)
PndEmcWaveformToDigi(Int_t verbose=0, Bool_t storedigis=kTRUE)
parameter set of Emc digitisation
Definition: PndEmcDigiPar.h:12
Double_t GetShashylikPulseThreshold()
Definition: PndEmcFpgaPar.h:39
Double_t GetFWD_Shaping_int_time()
Definition: PndEmcDigiPar.h:34
Double_t GetShashylikMWDFilterLifeT()
Definition: PndEmcFpgaPar.h:38
Int_t GetBarrelCFDelayLength()
Definition: PndEmcFpgaPar.h:14
Int_t GetForwardMWDFilterLength()
Definition: PndEmcFpgaPar.h:27
Class to simulate a Calibration.
void UpdateWaveform(PndEmcHit *hit, Double_t pePerMeV, Bool_t usePhotonStatistic, Double_t excessNoiseFactor, Double_t firstADCBinTime, Double_t sampleRate, PndEmcAbsPulseshape *pulseshape, Double_t=0)
virtual void SetEnergy(Double32_t energy)
Definition: PndEmcHit.h:50
void SetStorageOfData(Bool_t val)
Int_t GetShashylikMAFilterLength()
Definition: PndEmcFpgaPar.h:31
Int_t GetForwardMAFilterLength()
Definition: PndEmcFpgaPar.h:21
long GetDetectorId() const
represents a simulated waveform in an emc crystal
Double_t ctime
Definition: hit_dirc.C:114
Baseclass for pulseshapeanalysis ( featureextraction )
Definition: PndEmcAbsPSA.h:21
Int_t GetNumber_of_samples_in_waveform_fwd()
Definition: PndEmcDigiPar.h:46
represents the deposited energy of one emc crystal from simulation
Definition: PndEmcHit.h:26
Int_t fEvtNo
Definition: PndEmcDigi.h:118
PndEmcAbsPSA * fpsaAlgorithm_pmt
virtual InitStatus Init()
Init Task.
Double_t GetFWD_time_constant()
Definition: PndEmcDigiPar.h:35
Float_t SmearFakeOnline(Float_t energy)
ClassImp(PndAnaContFact)
Short_t GetModule() const
Takes list of PndEmcWaveform and creates PndEmcDigi.
Double_t GetForwardCFFilterRatio()
Definition: PndEmcFpgaPar.h:23
virtual void Exec(Option_t *opt)
Runs the task.
Double_t GetSampleRate_PMT()
Definition: PndEmcDigiPar.h:40
static PndEmcStructure * Instance()
PndEmcAbsPulseshape * fPulseshape_fwd
Double_t rtime
Definition: hit_dirc.C:113
virtual void SetTime(Double32_t time)
Definition: PndEmcHit.h:51
Double_t GetBarrelMWDFilterLifeT()
Definition: PndEmcFpgaPar.h:18
PndEmcAbsCrystalCalibrator * fCalibrator
Double_t GetShashlyk_time_constant()
Definition: PndEmcDigiPar.h:37
Bool_t fTimeOrderedDigi
set to kTRUE to use the time ordering of the output data.
Int_t GetBarrelCFFitterLength()
Definition: PndEmcFpgaPar.h:15
Int_t GetNumber_of_samples_in_waveform_pmt()
Definition: PndEmcDigiPar.h:45
PndEmcAbsPSA * fpsaAlgorithm_fwd
Double_t GetPMT_Shaping_int_time()
Definition: PndEmcDigiPar.h:32
PndEmcAbsPulseshape * fPulseshape_pmt
Parameter set for Emc Reco.
Definition: PndEmcRecoPar.h:12
Double_t GetForwardPulseThreshold()
Definition: PndEmcFpgaPar.h:29
Double_t energy
Definition: plot_dirc.C:15
Double_t GetEmcDigiPositionDepthPWO()
Definition: PndEmcRecoPar.h:24