FairRoot/PandaRoot
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
PndEmcFullStackedWaveformSimulator Class Reference

Waveform simulator. More...

#include <PndEmcFullStackedWaveformSimulator.h>

Inheritance diagram for PndEmcFullStackedWaveformSimulator:
PndEmcAbsWaveformSimulator PndEmcMultiWaveformSimulator

Public Member Functions

 PndEmcFullStackedWaveformSimulator ()
 
 PndEmcFullStackedWaveformSimulator (Double_t sampleRate, PndEmcAbsPulseshape *pulseShape)
 
virtual ~PndEmcFullStackedWaveformSimulator ()
 
virtual void Init (Double_t samplingBeforeFirstPulse, Double_t samplingAfterLastPulse, Double_t cutoff, Double_t activeTimeIncrement)
 Init the simulator. More...
 
virtual void GetAbsoluteTimeInterval (PndEmcWaveformData *wfData, Double_t &startTime, Double_t &activeTime)
 Get time interval for which the signal is above the cutoff. More...
 
virtual Double_t GetTimeBeforeFirstHit (PndEmcWaveformData *)
 
virtual Double_t GetScale ()
 
virtual PndEmcWaveformGet1GevWaveform ()
 
virtual Double_t GetPulseRiseTime ()
 
virtual PndEmcWaveformSimulate (PndEmcWaveformData *wfData, TClonesArray *arrayToStore=NULL)
 
virtual PndEmcWaveformSimulateSinglePulse (Double_t hitEnergy, Double_t hitTime, TClonesArray *arrayToStore=NULL, Int_t detId=-1, Int_t trackId=-1, Int_t hitIndex=-1)
 
virtual Double_t GetTotalScale ()
 
virtual Double_t GetSampleRate ()
 
virtual void AddModifier (PndEmcAbsWaveformModifier *wfModifier)
 

Protected Member Functions

virtual PndEmcWaveformMakeWaveform (PndEmcWaveformData *wfData, TClonesArray *arrayToStore=NULL)
 Create PndEmcWaveform. More...
 
virtual PndEmcWaveformMakeSingleWaveform (Double_t hitEnergy, Double_t hitTime, TClonesArray *arrayToStore=NULL, Int_t detId=-1, Int_t trackId=-1, Int_t hitIndex=-1)
 Create a PndEmcWaveform from the given parameters of a single hit. More...
 
virtual Double_t CalcWaveForTime (Double_t absoluteTime, PndEmcWaveformData *wfData)
 Calculate pulse value at given time. More...
 
Double_t CalcSingleWaveForTime (Double_t absoluteTime, Double_t energy, Double_t pulseTime)
 Return pulse at given time and for given energy. More...
 
void SyncWithADCClock (Double_t &time)
 
virtual PndEmcWaveformCallModifiers (PndEmcWaveform *wf)
 
 ClassDef (PndEmcAbsWaveformSimulator, 3)
 

Protected Attributes

TList fListOfWaveformModifiers
 
Double_t fSampleRate
 sampling rate of SADC. In 1/ns More...
 

Private Member Functions

 PndEmcFullStackedWaveformSimulator (const PndEmcFullStackedWaveformSimulator &)
 
PndEmcFullStackedWaveformSimulatoroperator= (const PndEmcFullStackedWaveformSimulator &)
 
 ClassDef (PndEmcFullStackedWaveformSimulator, 1)
 

Private Attributes

Double_t fSamplingBeforeFirstPulse
 in ns. additional time interval before waveform starts More...
 
Double_t fSamplingAfterLastPulse
 in ns. additional time interval after waveform falls below cutOff value More...
 
Double_t fCutoff
 
PndEmcAbsPulseshapefPulseshape
 
Double_t fScale
 Height of 1GeV pulse. More...
 
PndEmcWaveformf1GeVWaveform
 
Double_t fPulseRiseTime
 total rising time of pulse in ns More...
 
Double_t fActiveTimeIncrement
 

Detailed Description

Waveform simulator.

Author
Ph. Mahlberg mahlb.nosp@m.erg@.nosp@m.hiskp.nosp@m..uni.nosp@m.-bonn.nosp@m..de

Definition at line 21 of file PndEmcFullStackedWaveformSimulator.h.

Constructor & Destructor Documentation

PndEmcFullStackedWaveformSimulator::PndEmcFullStackedWaveformSimulator ( )

Definition at line 18 of file PndEmcFullStackedWaveformSimulator.cxx.

19 {
20 }
Double_t fPulseRiseTime
total rising time of pulse in ns
Double_t fSamplingAfterLastPulse
in ns. additional time interval after waveform falls below cutOff value
Double_t fSamplingBeforeFirstPulse
in ns. additional time interval before waveform starts
PndEmcFullStackedWaveformSimulator::PndEmcFullStackedWaveformSimulator ( Double_t  sampleRate,
PndEmcAbsPulseshape pulseShape 
)

Definition at line 22 of file PndEmcFullStackedWaveformSimulator.cxx.

23 {
24 }
Double_t fPulseRiseTime
total rising time of pulse in ns
Double_t fSamplingAfterLastPulse
in ns. additional time interval after waveform falls below cutOff value
Double_t fSamplingBeforeFirstPulse
in ns. additional time interval before waveform starts
PndEmcFullStackedWaveformSimulator::~PndEmcFullStackedWaveformSimulator ( )
virtual

Definition at line 27 of file PndEmcFullStackedWaveformSimulator.cxx.

References f1GeVWaveform.

28 {
29  delete f1GeVWaveform;
30 }
PndEmcFullStackedWaveformSimulator::PndEmcFullStackedWaveformSimulator ( const PndEmcFullStackedWaveformSimulator )
private

Member Function Documentation

virtual void PndEmcAbsWaveformSimulator::AddModifier ( PndEmcAbsWaveformModifier wfModifier)
inlinevirtualinherited
Double_t PndEmcFullStackedWaveformSimulator::CalcSingleWaveForTime ( Double_t  absoluteTime,
Double_t  energy,
Double_t  pulseTime 
)
protected

Return pulse at given time and for given energy.

Time in the pulse is absoluteTime-pulseTime absoluteTime Time for which to calculate value.

Parameters
energyEnergy of the pulse.
pulseTimeTime when the pulse starts.
Returns
Double_t Pulse value.

Definition at line 152 of file PndEmcFullStackedWaveformSimulator.cxx.

References fPulseshape, and PndEmcAbsPulseshape::value().

Referenced by CalcWaveForTime(), Init(), and MakeSingleWaveform().

153 {
154  return fPulseshape->value(absoluteTime, energy, pulseTime);
155 }
virtual double value(const double t, const double amp, const double toffset) const
Double_t energy
Definition: plot_dirc.C:15
Double_t PndEmcFullStackedWaveformSimulator::CalcWaveForTime ( Double_t  absoluteTime,
PndEmcWaveformData wfData 
)
protectedvirtual

Calculate pulse value at given time.

Parameters
absoluteTimeTime for which to calculate value.
wfDataWaveform including the hit map.
Returns
Double_t Pulse value.

Definition at line 164 of file PndEmcFullStackedWaveformSimulator.cxx.

References CalcSingleWaveForTime(), Double_t, energy, and PndEmcWaveformData::GetHitMap().

Referenced by GetAbsoluteTimeInterval(), and MakeWaveform().

165 {
166  Double_t returnValue = 0;
167 
168  for(std::map<Double_t, Double_t>::const_iterator it = wfData->GetHitMap().begin(); it!=wfData->GetHitMap().end(); ++it) {
169  Double_t energy = it->second;
170  Double_t pulseTime = it->first;
171 
172  returnValue += CalcSingleWaveForTime(absoluteTime, energy, pulseTime);
173  }
174  return returnValue;
175 }
Double_t CalcSingleWaveForTime(Double_t absoluteTime, Double_t energy, Double_t pulseTime)
Return pulse at given time and for given energy.
const std::map< Double_t, Double_t > & GetHitMap()
Double_t
Double_t energy
Definition: plot_dirc.C:15
virtual PndEmcWaveform* PndEmcAbsWaveformSimulator::CallModifiers ( PndEmcWaveform wf)
inlineprotectedvirtualinherited

Reimplemented in PndEmcMultiWaveformSimulator.

Definition at line 82 of file PndEmcAbsWaveformSimulator.h.

References PndEmcAbsWaveformSimulator::fListOfWaveformModifiers.

Referenced by PndEmcAbsWaveformSimulator::Simulate(), and PndEmcAbsWaveformSimulator::SimulateSinglePulse().

82  {
83  TIter iterModifiers(&fListOfWaveformModifiers);
84  while(PndEmcAbsWaveformModifier* wfmod = (PndEmcAbsWaveformModifier*) iterModifiers()) {
85  wfmod->Modify(wf);
86  }
87  return wf;
88  }
interface for waveform modifiers
PndEmcFullStackedWaveformSimulator::ClassDef ( PndEmcFullStackedWaveformSimulator  ,
 
)
private
PndEmcAbsWaveformSimulator::ClassDef ( PndEmcAbsWaveformSimulator  ,
 
)
protectedinherited
virtual PndEmcWaveform* PndEmcFullStackedWaveformSimulator::Get1GevWaveform ( )
inlinevirtual

returns 1GeV equivalent waveform

might be used for calibration etc.

Implements PndEmcAbsWaveformSimulator.

Definition at line 35 of file PndEmcFullStackedWaveformSimulator.h.

References f1GeVWaveform.

void PndEmcFullStackedWaveformSimulator::GetAbsoluteTimeInterval ( PndEmcWaveformData wfData,
Double_t startTime,
Double_t activeTime 
)
virtual

Get time interval for which the signal is above the cutoff.

Parameters
wfDataWaveform
[out]startTimeStart time of waveform (adjusted by fSamplingBeforeFirstPulse)
[out]activeTimeActive time of waveform(s)
Returns
void

Implements PndEmcAbsWaveformSimulator.

Definition at line 126 of file PndEmcFullStackedWaveformSimulator.cxx.

References CAMath::Abs(), CalcWaveForTime(), fActiveTimeIncrement, fCutoff, fPulseRiseTime, fSamplingAfterLastPulse, fSamplingBeforeFirstPulse, fScale, PndEmcWaveformData::GetHitMap(), and PndEmcAbsWaveformSimulator::SyncWithADCClock().

127 {
128  const std::map<Double_t, Double_t>& hitMap = wfData->GetHitMap();
129  startTime = hitMap.begin()->first - fSamplingBeforeFirstPulse;
130 
131  activeTime = hitMap.rbegin()->first + fPulseRiseTime;
132  while (TMath::Abs(CalcWaveForTime(activeTime, wfData)) > fCutoff*fScale) {
133  activeTime += fActiveTimeIncrement;
134  }
135 
136  activeTime += fSamplingAfterLastPulse;
137 
138  SyncWithADCClock(startTime);
139  SyncWithADCClock(activeTime);
140 }
virtual Double_t CalcWaveForTime(Double_t absoluteTime, PndEmcWaveformData *wfData)
Calculate pulse value at given time.
const std::map< Double_t, Double_t > & GetHitMap()
static T Abs(const T &x)
Definition: PndCAMath.h:39
Double_t fPulseRiseTime
total rising time of pulse in ns
Double_t fSamplingAfterLastPulse
in ns. additional time interval after waveform falls below cutOff value
Double_t fSamplingBeforeFirstPulse
in ns. additional time interval before waveform starts
virtual Double_t PndEmcFullStackedWaveformSimulator::GetPulseRiseTime ( )
inlinevirtual

Definition at line 37 of file PndEmcFullStackedWaveformSimulator.h.

References fPulseRiseTime.

Referenced by PndEmcFWEndcapTimebasedWaveforms::Init().

37 { return fPulseRiseTime; };
Double_t fPulseRiseTime
total rising time of pulse in ns
virtual Double_t PndEmcAbsWaveformSimulator::GetSampleRate ( )
inlinevirtualinherited

Definition at line 66 of file PndEmcAbsWaveformSimulator.h.

References PndEmcAbsWaveformSimulator::fSampleRate.

Referenced by Init(), MakeSingleWaveform(), and MakeWaveform().

66 { return fSampleRate; }
Double_t fSampleRate
sampling rate of SADC. In 1/ns
virtual Double_t PndEmcFullStackedWaveformSimulator::GetScale ( )
inlinevirtual

Get 1GeV pulse height equivalient of simulator generated waveform

Implements PndEmcAbsWaveformSimulator.

Definition at line 34 of file PndEmcFullStackedWaveformSimulator.h.

References fScale.

Referenced by PndEmcMultiWaveformSimulator::GetTotalScale().

34 { return fScale; }
virtual Double_t PndEmcFullStackedWaveformSimulator::GetTimeBeforeFirstHit ( PndEmcWaveformData )
inlinevirtual

maximum timeinterval generated waveforms are ahead of causal detector hits

Information is needed by timebased simulation framework. E.g. provokeed by simulation of preceding baseline samples

Reimplemented from PndEmcAbsWaveformSimulator.

Definition at line 32 of file PndEmcFullStackedWaveformSimulator.h.

References fSamplingBeforeFirstPulse.

32 { return fSamplingBeforeFirstPulse; } //in ns //wfData //[R.K.03/2017] unused variable(s)
Double_t fSamplingBeforeFirstPulse
in ns. additional time interval before waveform starts
virtual Double_t PndEmcAbsWaveformSimulator::GetTotalScale ( )
inlinevirtualinherited

Get 1GeV pulse height equivalent of waveform at end of modification chain

Definition at line 55 of file PndEmcAbsWaveformSimulator.h.

References Double_t, PndEmcAbsWaveformSimulator::fListOfWaveformModifiers, and PndEmcAbsWaveformSimulator::GetScale().

55  {
56  Double_t totalScale = GetScale();
57 
58  TIter iterModifiers(&fListOfWaveformModifiers);
59  while(PndEmcAbsWaveformModifier* wfmod = (PndEmcAbsWaveformModifier*) iterModifiers()) {
60  totalScale *= wfmod->GetScale();
61  }
62 
63  return totalScale;
64  }
interface for waveform modifiers
Double_t
virtual Double_t GetScale()=0
void PndEmcFullStackedWaveformSimulator::Init ( Double_t  samplingBeforeFirstPulse,
Double_t  samplingAfterLastPulse,
Double_t  cutoff,
Double_t  activeTimeIncrement 
)
virtual

Init the simulator.

Parameters
samplingBeforeFirstPulseTime to start sampling before first pulse, in ns
samplingAfterLastPulseTime to stop sampling after last pulse, in ns
cutoffThreshold under which signal is considered to have stopped, in GeV
activeTimeIncrementIncrement when checking if pulse is over cutoff, in ns
Returns
void

Definition at line 41 of file PndEmcFullStackedWaveformSimulator.cxx.

References Bool_t, CalcSingleWaveForTime(), Double_t, f1GeVWaveform, fActiveTimeIncrement, fCutoff, fPulseRiseTime, fSamplingAfterLastPulse, fSamplingBeforeFirstPulse, fScale, PndEmcAbsWaveformSimulator::GetSampleRate(), and MakeSingleWaveform().

Referenced by PndEmcFWEndcapTimebasedWaveforms::Init().

42 {
43  fSamplingBeforeFirstPulse = samplingBeforeFirstPulse;
44  fSamplingAfterLastPulse = samplingAfterLastPulse;
45  fCutoff = cutoff;
46  fActiveTimeIncrement = activeTimeIncrement;
47 
48  //generate signal with:
49  Double_t tmpSamlingRate = 1.0; // in ns^-1
50  Int_t tmpLength = 100; //in samples
51  Int_t emergencyStop = 10000000;
52 
53  std::vector<Double_t> tmpSignal;
54 
55  Bool_t maxFound = kFALSE;
56  Bool_t cutoffFound = kFALSE;
57 
58  Int_t maxSample;
59  Int_t cutoffSample;
60 
61  do {
62  tmpLength*=2;
63  tmpSignal.resize(tmpLength);
64  if(tmpLength>=emergencyStop) {
65  std::cout << "-E PndEmcFullStackedWaveformSimulator: no maximum in pulse during " << emergencyStop/tmpSamlingRate << " ns found. WaveformGeneration might fail." << std::endl;
66  break;
67  }
68 
69  for(Int_t iSample=0; iSample<tmpLength; iSample++) {
70  tmpSignal[iSample] = CalcSingleWaveForTime(iSample/tmpSamlingRate, 1.0, 0.);
71  }
72 
73 
74  if(!maxFound) { //search for maximum
75  std::vector<Double_t>::const_iterator begin_constIt = tmpSignal.begin();
76  std::vector<Double_t>::const_iterator end_constIt = tmpSignal.end();
77  std::vector<Double_t>::const_iterator max_constIt = std::max_element(begin_constIt, end_constIt);
78  maxSample = std::distance(begin_constIt, max_constIt);
79 
80  //generated pusle might be to short for proper maximum detection
81  maxFound = (maxSample < tmpLength-1) ? kTRUE : kFALSE;
82 
83  fScale = (*max_constIt);
84  fPulseRiseTime = maxSample * tmpSamlingRate;
85  }
86 
87  if(maxFound) { //search for cutOff
88  for(Int_t iSample=maxSample; iSample<tmpLength; iSample++) {
89  if(tmpSignal[iSample] < fCutoff*fScale) {
90  cutoffFound = kTRUE;
91  cutoffSample = iSample;
92  break;
93  }
94  }
95  }
96 
97  } while(!(maxFound && cutoffFound)); //maximum inside signal, i.e. signal covers tail (at least partially)
98 
99  //generate 1GeV signal again..now with correct sampling rate
100  Double_t totalTime = (cutoffSample/tmpSamlingRate + fSamplingBeforeFirstPulse + fSamplingAfterLastPulse);
101 
102  try{
103  std::vector<Double_t> signal((Int_t) TMath::Floor(totalTime*GetSampleRate() + 0.5), 0.);
104  } catch(...) {
105  std::cerr << "catched error" << std::endl;
106  std::cerr << "sampleRate:" << GetSampleRate() << std::endl;
107  std::cerr << "total Time:" << totalTime << std::endl;
108  abort();
109  }
110 
112 
113  std::cerr << "finishing init" << std::endl;
114 }
Double_t CalcSingleWaveForTime(Double_t absoluteTime, Double_t energy, Double_t pulseTime)
Return pulse at given time and for given energy.
Double_t
virtual PndEmcWaveform * MakeSingleWaveform(Double_t hitEnergy, Double_t hitTime, TClonesArray *arrayToStore=NULL, Int_t detId=-1, Int_t trackId=-1, Int_t hitIndex=-1)
Create a PndEmcWaveform from the given parameters of a single hit.
Double_t fPulseRiseTime
total rising time of pulse in ns
Double_t fSamplingAfterLastPulse
in ns. additional time interval after waveform falls below cutOff value
Double_t fSamplingBeforeFirstPulse
in ns. additional time interval before waveform starts
PndEmcWaveform * PndEmcFullStackedWaveformSimulator::MakeSingleWaveform ( Double_t  hitEnergy,
Double_t  hitTime,
TClonesArray *  arrayToStore = NULL,
Int_t  detId = -1,
Int_t  trackId = -1,
Int_t  hitIndex = -1 
)
protectedvirtual

Create a PndEmcWaveform from the given parameters of a single hit.

Parameters
hitEnergy...
hitTime...
arrayToStore...
detId...
trackId...
hitIndex...
Returns
PndEmcWaveform*

Implements PndEmcAbsWaveformSimulator.

Reimplemented in PndEmcMultiWaveformSimulator.

Definition at line 231 of file PndEmcFullStackedWaveformSimulator.cxx.

References CalcSingleWaveForTime(), Double_t, fCutoff, fPulseRiseTime, PndEmcAbsWaveformSimulator::fSampleRate, fSamplingAfterLastPulse, fSamplingBeforeFirstPulse, fScale, PndEmcAbsWaveformSimulator::GetSampleRate(), PndEmcWaveform::SetSampleRate(), and PndEmcAbsWaveformSimulator::SyncWithADCClock().

Referenced by Init(), and PndEmcMultiWaveformSimulator::MakeSingleWaveform().

232 {
233  std::vector<Double_t> signal;
234 
235  Double_t startTime = hitTime - fSamplingBeforeFirstPulse;
236  SyncWithADCClock(startTime);
237 
238  Int_t nRising = (Int_t) ((fSamplingBeforeFirstPulse + fPulseRiseTime) * GetSampleRate());
239  Int_t iSample =0;
240 
241  for(;iSample<nRising; ++iSample) { //time before pulse + rising edge
242  signal.push_back(CalcSingleWaveForTime(startTime + iSample/GetSampleRate(), hitEnergy, hitTime));
243  }
244 
245  do { //falling edge..check weather pulse undergoes cutoff value
246  signal.push_back(CalcSingleWaveForTime(startTime + iSample/GetSampleRate(), hitEnergy, hitTime));
247  } while (signal[iSample++] > fCutoff*fScale);
248 
249  Int_t addSamples = (Int_t) (fSamplingAfterLastPulse*GetSampleRate());
250 
251  for(addSamples += iSample; iSample<addSamples; iSample++) {
252  signal.push_back(CalcSingleWaveForTime(startTime + iSample/GetSampleRate(), hitEnergy, hitTime));
253  }
254 
255  PndEmcWaveform* wave;
256  if(arrayToStore) {
257  wave = new ((*arrayToStore)[arrayToStore->GetEntriesFast()]) PndEmcWaveform(trackId, detId, signal, hitIndex);
258  } else {
259  wave = new PndEmcWaveform(trackId, detId, signal, hitIndex);
260  }
261 
262  Double_t timestamp = startTime;
263  wave->SetTimeStamp(timestamp);
264  wave->SetSampleRate(fSampleRate*1.0e9); //converting form ns into s;
265 
266  return wave;
267 }
Double_t CalcSingleWaveForTime(Double_t absoluteTime, Double_t energy, Double_t pulseTime)
Return pulse at given time and for given energy.
Double_t fSampleRate
sampling rate of SADC. In 1/ns
Double_t
represents a simulated waveform in an emc crystal
Double_t fPulseRiseTime
total rising time of pulse in ns
Double_t fSamplingAfterLastPulse
in ns. additional time interval after waveform falls below cutOff value
Double_t fSamplingBeforeFirstPulse
in ns. additional time interval before waveform starts
void SetSampleRate(Double_t rate)
PndEmcWaveform * PndEmcFullStackedWaveformSimulator::MakeWaveform ( PndEmcWaveformData wfData,
TClonesArray *  arrayToStore = NULL 
)
protectedvirtual

Create PndEmcWaveform.

Parameters
wfDataPndEmcWaveformData containing the hits.
arrayToStoreIf not null, the new PndEmcWaveform is created in this TClonesArray.
Returns
PndEmcWaveform*

Implements PndEmcAbsWaveformSimulator.

Reimplemented in PndEmcMultiWaveformSimulator.

Definition at line 184 of file PndEmcFullStackedWaveformSimulator.cxx.

References CalcWaveForTime(), Double_t, PndEmcAbsWaveformSimulator::fSampleRate, PndEmcWaveformData::GetDetectorId(), PndEmcAbsWaveformSimulator::GetSampleRate(), PndEmcWaveformData::GetTimeOfLastSample(), and PndEmcWaveform::SetSampleRate().

Referenced by PndEmcMultiWaveformSimulator::MakeWaveform().

185 {
186  Int_t nSamples = static_cast<Int_t>((wfData->GetTimeOfLastSample()-wfData->GetTimeStamp())*GetSampleRate() + 0.5);
187  //cout << "TimeOfLastSample: " << wfData->GetTimeOfLastSample() << endl;
188  //cout << "Timestamp: " << wfData->GetTimeStamp() << endl;
189  //cout << "sampleRate: " << GetSampleRate() << endl;
190  //cout << "calculted " << nSamples << " samples" << endl;
191  std::vector<Double_t> signal(nSamples, 0.0);
192 
193  for(Int_t iSample=0; iSample<nSamples; ++iSample) {
194  signal[iSample] = CalcWaveForTime(wfData->GetTimeStamp() + iSample*1/GetSampleRate(), wfData);
195  }
196 
197  Int_t hitIndex = -1;
198  if(wfData->GetNLinks()) {
199  hitIndex = wfData->GetLink(0).GetIndex();
200  }
201 
202  PndEmcWaveform* wave;
203  if(arrayToStore) {
204  wave = new ((*arrayToStore)[arrayToStore->GetEntriesFast()]) PndEmcWaveform(-1, wfData->GetDetectorId(), signal, hitIndex);
205  wave->ResetLinks();
206  } else {
207  wave = new PndEmcWaveform(-1, wfData->GetDetectorId(), signal, hitIndex);
208  }
209  wave->SetLinks(wfData->GetLinksWithType(FairRootManager::Instance()->GetBranchId("EmcHit")));
210  wave->AddInterfaceData(wfData);
211 
212  Double_t timeStamp = wfData->GetTimeStamp();
213  wave->SetTimeStamp(timeStamp);
214  wave->SetSampleRate(fSampleRate*1.0e9); //converting form ns into s;
215 
216  return wave;
217 
218 }
virtual Double_t CalcWaveForTime(Double_t absoluteTime, PndEmcWaveformData *wfData)
Calculate pulse value at given time.
Double_t fSampleRate
sampling rate of SADC. In 1/ns
Double_t
represents a simulated waveform in an emc crystal
Double_t GetTimeOfLastSample()
void SetSampleRate(Double_t rate)
PndEmcFullStackedWaveformSimulator& PndEmcFullStackedWaveformSimulator::operator= ( const PndEmcFullStackedWaveformSimulator )
private
virtual PndEmcWaveform* PndEmcAbsWaveformSimulator::Simulate ( PndEmcWaveformData wfData,
TClonesArray *  arrayToStore = NULL 
)
inlinevirtualinherited

Simulate Waveform based on wfData object

The PndEmcWaveformData object is used by the emc timebased simulation

Definition at line 31 of file PndEmcAbsWaveformSimulator.h.

References PndEmcAbsWaveformSimulator::CallModifiers(), and PndEmcAbsWaveformSimulator::MakeWaveform().

Referenced by PndEmcWaveformBuffer::AddNewDataToTClonesArray().

31 { return CallModifiers(MakeWaveform(wfData, arrayToStore)); }
virtual PndEmcWaveform * MakeWaveform(PndEmcWaveformData *wfData, TClonesArray *arrayToStore=NULL)=0
virtual PndEmcWaveform * CallModifiers(PndEmcWaveform *wf)
virtual PndEmcWaveform* PndEmcAbsWaveformSimulator::SimulateSinglePulse ( Double_t  hitEnergy,
Double_t  hitTime,
TClonesArray *  arrayToStore = NULL,
Int_t  detId = -1,
Int_t  trackId = -1,
Int_t  hitIndex = -1 
)
inlinevirtualinherited

Simulate waveform consisting of single pusle

Definition at line 34 of file PndEmcAbsWaveformSimulator.h.

References PndEmcAbsWaveformSimulator::CallModifiers(), and PndEmcAbsWaveformSimulator::MakeSingleWaveform().

34 { return CallModifiers(MakeSingleWaveform(hitEnergy, hitTime, arrayToStore, detId, trackId, hitIndex)); }
virtual PndEmcWaveform * CallModifiers(PndEmcWaveform *wf)
virtual PndEmcWaveform * MakeSingleWaveform(Double_t hitEnergy, Double_t hitTime, TClonesArray *arrayToStore=NULL, Int_t detId=-1, Int_t trackId=-1, Int_t hitIndex=-1)=0
void PndEmcAbsWaveformSimulator::SyncWithADCClock ( Double_t time)
inlineprotectedinherited

Definition at line 78 of file PndEmcAbsWaveformSimulator.h.

References PndEmcAbsWaveformSimulator::fSampleRate.

Referenced by GetAbsoluteTimeInterval(), and MakeSingleWaveform().

78  {
79  time = TMath::Floor(time * fSampleRate) / fSampleRate;
80  };
Double_t fSampleRate
sampling rate of SADC. In 1/ns

Member Data Documentation

PndEmcWaveform* PndEmcFullStackedWaveformSimulator::f1GeVWaveform
private
Double_t PndEmcFullStackedWaveformSimulator::fActiveTimeIncrement
private

Definition at line 63 of file PndEmcFullStackedWaveformSimulator.h.

Referenced by GetAbsoluteTimeInterval(), and Init().

Double_t PndEmcFullStackedWaveformSimulator::fCutoff
private
TList PndEmcAbsWaveformSimulator::fListOfWaveformModifiers
protectedinherited
Double_t PndEmcFullStackedWaveformSimulator::fPulseRiseTime
private

total rising time of pulse in ns

Definition at line 61 of file PndEmcFullStackedWaveformSimulator.h.

Referenced by GetAbsoluteTimeInterval(), GetPulseRiseTime(), Init(), and MakeSingleWaveform().

PndEmcAbsPulseshape* PndEmcFullStackedWaveformSimulator::fPulseshape
private

Definition at line 56 of file PndEmcFullStackedWaveformSimulator.h.

Referenced by CalcSingleWaveForTime().

Double_t PndEmcAbsWaveformSimulator::fSampleRate
protectedinherited
Double_t PndEmcFullStackedWaveformSimulator::fSamplingAfterLastPulse
private

in ns. additional time interval after waveform falls below cutOff value

Definition at line 53 of file PndEmcFullStackedWaveformSimulator.h.

Referenced by GetAbsoluteTimeInterval(), Init(), and MakeSingleWaveform().

Double_t PndEmcFullStackedWaveformSimulator::fSamplingBeforeFirstPulse
private

in ns. additional time interval before waveform starts

Definition at line 52 of file PndEmcFullStackedWaveformSimulator.h.

Referenced by GetAbsoluteTimeInterval(), GetTimeBeforeFirstHit(), Init(), and MakeSingleWaveform().

Double_t PndEmcFullStackedWaveformSimulator::fScale
private

Height of 1GeV pulse.

Definition at line 58 of file PndEmcFullStackedWaveformSimulator.h.

Referenced by GetAbsoluteTimeInterval(), GetScale(), Init(), and MakeSingleWaveform().


The documentation for this class was generated from the following files: