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

Simulator to create PndEmcMultiWaveform. More...

#include <PndEmcMultiWaveformSimulator.h>

Inheritance diagram for PndEmcMultiWaveformSimulator:
PndEmcFullStackedWaveformSimulator PndEmcAbsWaveformSimulator

Public Member Functions

 PndEmcMultiWaveformSimulator ()
 
 PndEmcMultiWaveformSimulator (Double_t sampleRate, PndEmcAbsPulseshape *pulseshape, Int_t wfMultiplicity)
 
virtual void AddModifier (PndEmcAbsWaveformModifier *wfModifier, Int_t wfIndex)
 Add a modifier (PndEmcAbsWaveformModifier) More...
 
virtual Double_t GetTotalScale (Int_t wfIndex)
 Return scale after all modifiers. More...
 
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 PndEmcWaveformCallModifiers (PndEmcWaveform *wf)
 Call modifiers on waveform wf. More...
 
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...
 
 ClassDef (PndEmcAbsWaveformSimulator, 3)
 
void SyncWithADCClock (Double_t &time)
 

Protected Attributes

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

Private Member Functions

PndEmcMultiWaveformMultiplyWaveform (const PndEmcWaveform *singleWaveform, TClonesArray *arrayToStore)
 Creates a PndEmcMultiWaveform from a PndEmcWaveform. More...
 

Private Attributes

Int_t fWfMultiplicity
 
std::vector< Int_t > fIndexList
 

Detailed Description

Simulator to create PndEmcMultiWaveform.

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

Definition at line 17 of file PndEmcMultiWaveformSimulator.h.

Constructor & Destructor Documentation

PndEmcMultiWaveformSimulator::PndEmcMultiWaveformSimulator ( )
PndEmcMultiWaveformSimulator::PndEmcMultiWaveformSimulator ( Double_t  sampleRate,
PndEmcAbsPulseshape pulseshape,
Int_t  wfMultiplicity 
)

Member Function Documentation

void PndEmcMultiWaveformSimulator::AddModifier ( PndEmcAbsWaveformModifier wfModifier,
Int_t  wfIndex 
)
virtual

Add a modifier (PndEmcAbsWaveformModifier)

wfIndex characterizes wf, the modifier will apllied on* If the modifier itself will work on the multiwaveform itself, pass a -1. In this case, the Modifier is considered to scale all waveforms equally.

pass wfIndex Modifier shall work on as second parameter

Parameters
wfModifier
wfIndex
Returns
void

Definition at line 52 of file PndEmcMultiWaveformSimulator.cxx.

References PndEmcAbsWaveformSimulator::AddModifier(), and fIndexList.

Referenced by PndEmcFWEndcapTimebasedWaveforms::Init().

53 {
54  fIndexList.push_back(wfIndex);
56 }
virtual void AddModifier(PndEmcAbsWaveformModifier *wfModifier)
virtual void PndEmcAbsWaveformSimulator::AddModifier ( PndEmcAbsWaveformModifier wfModifier)
inlinevirtualinherited
Double_t PndEmcFullStackedWaveformSimulator::CalcSingleWaveForTime ( Double_t  absoluteTime,
Double_t  energy,
Double_t  pulseTime 
)
protectedinherited

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 PndEmcFullStackedWaveformSimulator::fPulseshape, and PndEmcAbsPulseshape::value().

Referenced by PndEmcFullStackedWaveformSimulator::CalcWaveForTime(), PndEmcFullStackedWaveformSimulator::Init(), and PndEmcFullStackedWaveformSimulator::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 
)
protectedvirtualinherited

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 PndEmcFullStackedWaveformSimulator::CalcSingleWaveForTime(), Double_t, energy, and PndEmcWaveformData::GetHitMap().

Referenced by PndEmcFullStackedWaveformSimulator::GetAbsoluteTimeInterval(), and PndEmcFullStackedWaveformSimulator::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
PndEmcWaveform * PndEmcMultiWaveformSimulator::CallModifiers ( PndEmcWaveform wf)
protectedvirtual

Call modifiers on waveform wf.

Parameters
wfwaveform
Returns
PndEmcWaveform* wf

Reimplemented from PndEmcAbsWaveformSimulator.

Definition at line 64 of file PndEmcMultiWaveformSimulator.cxx.

References count, fIndexList, PndEmcAbsWaveformSimulator::fListOfWaveformModifiers, and PndEmcMultiWaveform::SetActiveWaveform().

65 {
66  PndEmcMultiWaveform* multiWaveform = dynamic_cast<PndEmcMultiWaveform*>(wf);
67  Int_t count = 0;
68  TIter iterModifiers(&fListOfWaveformModifiers);
69 
70  while(PndEmcAbsWaveformModifier* wfmod = (PndEmcAbsWaveformModifier*) iterModifiers()) {
71  if(fIndexList[count]>=0) {
72  multiWaveform->SetActiveWaveform(fIndexList[count]);
73  }
74  wfmod->Modify(wf);
75  ++count;
76  }
77  return wf;
78 }
interface for waveform modifiers
Class to hold multiple waveforms from one Emc Hit / ADC readout.
int count
void SetActiveWaveform(Int_t active=1)
PndEmcAbsWaveformSimulator::ClassDef ( PndEmcAbsWaveformSimulator  ,
 
)
protectedinherited
virtual PndEmcWaveform* PndEmcFullStackedWaveformSimulator::Get1GevWaveform ( )
inlinevirtualinherited

returns 1GeV equivalent waveform

might be used for calibration etc.

Implements PndEmcAbsWaveformSimulator.

Definition at line 35 of file PndEmcFullStackedWaveformSimulator.h.

References PndEmcFullStackedWaveformSimulator::f1GeVWaveform.

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

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(), PndEmcFullStackedWaveformSimulator::CalcWaveForTime(), PndEmcFullStackedWaveformSimulator::fActiveTimeIncrement, PndEmcFullStackedWaveformSimulator::fCutoff, PndEmcFullStackedWaveformSimulator::fPulseRiseTime, PndEmcFullStackedWaveformSimulator::fSamplingAfterLastPulse, PndEmcFullStackedWaveformSimulator::fSamplingBeforeFirstPulse, PndEmcFullStackedWaveformSimulator::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 ( )
inlinevirtualinherited
virtual Double_t PndEmcAbsWaveformSimulator::GetSampleRate ( )
inlinevirtualinherited
virtual Double_t PndEmcFullStackedWaveformSimulator::GetScale ( )
inlinevirtualinherited

Get 1GeV pulse height equivalient of simulator generated waveform

Implements PndEmcAbsWaveformSimulator.

Definition at line 34 of file PndEmcFullStackedWaveformSimulator.h.

References PndEmcFullStackedWaveformSimulator::fScale.

Referenced by GetTotalScale().

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

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 PndEmcFullStackedWaveformSimulator::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
Double_t PndEmcMultiWaveformSimulator::GetTotalScale ( Int_t  wfIndex)
virtual

Return scale after all modifiers.

Parameters
wfIndexWaveform index.
Returns
Double_t The Scale.

Definition at line 86 of file PndEmcMultiWaveformSimulator.cxx.

References count, Double_t, fIndexList, PndEmcAbsWaveformSimulator::fListOfWaveformModifiers, and PndEmcFullStackedWaveformSimulator::GetScale().

Referenced by PndEmcFWEndcapTimebasedWaveforms::Init().

87 {
88  Double_t totalScale = GetScale();
89 
90  TIter iterModifiers(&fListOfWaveformModifiers);
91  Int_t count = 0;
92 
93  while(PndEmcAbsWaveformModifier* wfmod = (PndEmcAbsWaveformModifier*) iterModifiers()) {
94  if(fIndexList[count] == wfIndex || fIndexList[count]<0) {
95  totalScale *= wfmod->GetScale();
96  }
97  ++count;
98  }
99  return totalScale;
100 }
interface for waveform modifiers
Double_t
int count
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 
)
virtualinherited

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, PndEmcFullStackedWaveformSimulator::CalcSingleWaveForTime(), Double_t, PndEmcFullStackedWaveformSimulator::f1GeVWaveform, PndEmcFullStackedWaveformSimulator::fActiveTimeIncrement, PndEmcFullStackedWaveformSimulator::fCutoff, PndEmcFullStackedWaveformSimulator::fPulseRiseTime, PndEmcFullStackedWaveformSimulator::fSamplingAfterLastPulse, PndEmcFullStackedWaveformSimulator::fSamplingBeforeFirstPulse, PndEmcFullStackedWaveformSimulator::fScale, PndEmcAbsWaveformSimulator::GetSampleRate(), and PndEmcFullStackedWaveformSimulator::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 * PndEmcMultiWaveformSimulator::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*

Reimplemented from PndEmcFullStackedWaveformSimulator.

Definition at line 33 of file PndEmcMultiWaveformSimulator.cxx.

References PndEmcFullStackedWaveformSimulator::MakeSingleWaveform(), and MultiplyWaveform().

34 {
35  PndEmcWaveform* singleWaveform = PndEmcFullStackedWaveformSimulator::MakeSingleWaveform(hitEnergy, hitTime, NULL, detId, trackId, hitIndex);
36  PndEmcMultiWaveform* multiWaveform = MultiplyWaveform(singleWaveform, arrayToStore);
37 
38  delete singleWaveform;
39  return multiWaveform;
40 }
represents a simulated waveform in an emc crystal
Class to hold multiple waveforms from one Emc Hit / ADC readout.
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.
PndEmcMultiWaveform * MultiplyWaveform(const PndEmcWaveform *singleWaveform, TClonesArray *arrayToStore)
Creates a PndEmcMultiWaveform from a PndEmcWaveform.
PndEmcWaveform * PndEmcMultiWaveformSimulator::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*

Reimplemented from PndEmcFullStackedWaveformSimulator.

Definition at line 23 of file PndEmcMultiWaveformSimulator.cxx.

References PndEmcFullStackedWaveformSimulator::MakeWaveform(), and MultiplyWaveform().

24 {
26  PndEmcMultiWaveform* multiWaveform = MultiplyWaveform(singleWaveform, arrayToStore);
27 
28  delete singleWaveform;
29  return multiWaveform;
30 }
virtual PndEmcWaveform * MakeWaveform(PndEmcWaveformData *wfData, TClonesArray *arrayToStore=NULL)
Create PndEmcWaveform.
represents a simulated waveform in an emc crystal
Class to hold multiple waveforms from one Emc Hit / ADC readout.
PndEmcMultiWaveform * MultiplyWaveform(const PndEmcWaveform *singleWaveform, TClonesArray *arrayToStore)
Creates a PndEmcMultiWaveform from a PndEmcWaveform.
PndEmcMultiWaveform * PndEmcMultiWaveformSimulator::MultiplyWaveform ( const PndEmcWaveform singleWaveform,
TClonesArray *  arrayToStore 
)
private

Creates a PndEmcMultiWaveform from a PndEmcWaveform.

Parameters
singleWaveformThe single waveform from which to create the multi-waveform.
arrayToStoreIf not null, the new PndEmcMultiWaveform is created in this TClonesArray.
Returns
PndEmcMultiWaveform*

Definition at line 110 of file PndEmcMultiWaveformSimulator.cxx.

References fWfMultiplicity, PndEmcWaveform::GetDetectorId(), PndEmcWaveform::GetHitIndex(), PndEmcWaveform::GetSampleRate(), PndEmcWaveform::GetSignal(), PndEmcWaveform::GetTrackId(), PndEmcWaveform::SetSampleRate(), and PndEmcMultiWaveform::SetWaveform().

Referenced by MakeSingleWaveform(), and MakeWaveform().

111 {
112  const std::vector<Double_t>& signal = singleWaveform->GetSignal();
113 
114  PndEmcMultiWaveform* multiWaveform = NULL;
115 
116  if(NULL!=arrayToStore) {
117  multiWaveform = new ((*arrayToStore)[arrayToStore->GetEntriesFast()]) PndEmcMultiWaveform(singleWaveform->GetTrackId(), singleWaveform->GetDetectorId(), signal.size(), singleWaveform->GetHitIndex());
118  } else {
119  multiWaveform = new PndEmcMultiWaveform(singleWaveform->GetTrackId(), singleWaveform->GetDetectorId(), signal.size(), singleWaveform->GetHitIndex());
120  }
121 
122  for(Int_t iWf = 0; iWf<fWfMultiplicity; ++iWf) {
123  multiWaveform->SetWaveform(signal, signal.size(), iWf);
124  }
125 
126  multiWaveform->SetLinks(singleWaveform->GetLinks());
127  multiWaveform->SetTimeStamp(singleWaveform->GetTimeStamp());
128  multiWaveform->SetSampleRate(singleWaveform->GetSampleRate()); //converting form ns into s;
129 
130  return multiWaveform;
131 }
virtual std::vector< double > GetSignal() const
Int_t GetHitIndex() const
void SetWaveform(const std::vector< Double_t > &signal, Int_t length, Int_t Waveform)
int GetTrackId() const
long GetDetectorId() const
Class to hold multiple waveforms from one Emc Hit / ADC readout.
Double_t GetSampleRate() const
void SetSampleRate(Double_t rate)
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

Member Data Documentation

std::vector<Int_t> PndEmcMultiWaveformSimulator::fIndexList
private

Definition at line 38 of file PndEmcMultiWaveformSimulator.h.

Referenced by AddModifier(), CallModifiers(), and GetTotalScale().

TList PndEmcAbsWaveformSimulator::fListOfWaveformModifiers
protectedinherited
Double_t PndEmcAbsWaveformSimulator::fSampleRate
protectedinherited
Int_t PndEmcMultiWaveformSimulator::fWfMultiplicity
private

Definition at line 37 of file PndEmcMultiWaveformSimulator.h.

Referenced by MultiplyWaveform().


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