MarlinTPC  1.2.0
TPCElectronicsProcessor.h
1 #ifndef TPCElectronicsProcessor_h
2 #define TPCElectronicsProcessor_h 1
3 
4 //MARLIN
5 #include <marlin/Processor.h>
6 
7 //LCIO
8 #include <lcio.h>
9 #include <IMPL/LCCollectionVec.h>
10 #include <EVENT/TrackerRawData.h>
11 
12 //C++
13 #include <string>
14 #include <list>
15 
16 //GEAR
17 #include <gear/PadRowLayout2D.h>
18 
19 //MARLINTPC
20 #include "VoxelTPC.h"
21 #include "ADCPulse.h"
22 
23 namespace marlintpc
24 {
25 
72 class TPCElectronicsProcessor : public marlin::Processor
73 {
74 
75  public:
76 
77  virtual Processor* newProcessor()
78  {
79  return new TPCElectronicsProcessor ;
80  }
81 
83  virtual ~TPCElectronicsProcessor();
84 
85  /* Instantiate the ADCPulse with the parameters from the steering file.
86  */
87  virtual void init() ;
88 
91  virtual void processRunHeader(lcio::LCRunHeader* run) ;
92 
95  virtual void processEvent(lcio::LCEvent* evt) ;
96 
97 
98 
99 
100  protected:
101 
104  static bool voxelPadComp(const std::pair< VoxelTPC::VoxelIndex, int >& left,
105  const std::pair< VoxelTPC::VoxelIndex , int >& right)
106  {
107  return(left.first.moduleID == right.first.moduleID ?
108  (left.first.padIndex == right.first.padIndex ?
109  left.first.zBin < right.first.zBin :
110  left.first.padIndex < right.first.padIndex) :
111  left.first.moduleID < right.first.moduleID);
112  }
113 
114 
117  static bool voxelTimeComp(const std::pair< VoxelTPC::VoxelIndex, int >& left,
118  const std::pair< VoxelTPC::VoxelIndex , int >& right)
119  {
120  return(left.first.zBin == right.first.zBin ?
121  (left.first.moduleID == right.first.moduleID ?
122  left.first.padIndex < right.first.padIndex :
123  left.first.moduleID < right.first.moduleID) :
124  left.first.zBin < right.first.zBin);
125  }
126 
127  bool _outputIsPersistent;
128 
129  //Input-/output collection names
130  std::string _inputColName;
131  std::string _outputColName;
132 
133  double _frequency;
134  double _riseTime;
135  double _asym;//asymmetry of pulse shape: width left = _asym*width right
138  double _voxelZLength;
142 
144  double _peakingTime;
146  // to be implemented later
147  // int _ADCThreshold; // /<Threshold of the ADC
148  // double _cutOff; // /<Cut off value for the integration
149 
151 
153  double _clockJitter;
154  std::map<int, double> _timeJitter; // map of time (zBin) and the clock jitter for that bin
155 
156  double _noiseLevel;
157 
158  double _noiseWidth;
159 
160  double _noiseCutoff;
161 
164 
166 
168 };
169 
170 
171 
172 } //end of namespace marlintpc
173 
174 #endif
virtual void processRunHeader(lcio::LCRunHeader *run)
Called for every run.
Definition: TPCElectronicsProcessor.cc:198
int _noiseSwitch
Switch between different noise model for pedestal width distribution:
Definition: TPCElectronicsProcessor.h:150
std::string _outputColName
Name of output collection.
Definition: TPCElectronicsProcessor.h:131
double _peakingTime
Peaking time ALTRO electronics (time from start of pulse to maximum)
Definition: TPCElectronicsProcessor.h:145
double _voxelZLength
Length of a voxel in ns.
Definition: TPCElectronicsProcessor.h:139
int _ADCThreshold
The threshold of the ADC (in ADC counts)
Definition: TPCElectronicsProcessor.h:140
double _noiseWidth
Width of the pedestal width distribution used to add noise to the ADC spectrum.
Definition: TPCElectronicsProcessor.h:158
This processor applies the electronics shaping to the incoming electron signals.
Definition: TPCElectronicsProcessor.h:72
double _integrationTime
IntegrationTime of the electronics. Voxel within this time window will be shaped in one go...
Definition: TPCElectronicsProcessor.h:167
int _nElectronsDynamicRange
The number of electrons which correspond.
Definition: TPCElectronicsProcessor.h:137
int _ADCMaxValue
The maximum of the dynamic range in ADC counts.
Definition: TPCElectronicsProcessor.h:136
double _riseTime
Rise time of the signal.
Definition: TPCElectronicsProcessor.h:134
int _minimumPulseHeight
The minimal value for the highest sample value in a pulse.
Definition: TPCElectronicsProcessor.h:141
int _electronicsSwitch
Switch between different electronics implementations:
Definition: TPCElectronicsProcessor.h:143
A base class interface which holds the raw data of the pulse and represents the ADC and its shaping a...
Definition: ADCPulse.h:16
bool _improveMemoryFootprint
Flag whether to use the memory saving shortcut.
Definition: TPCElectronicsProcessor.h:165
double _frequency
Readout frequency of the ADC.
Definition: TPCElectronicsProcessor.h:133
ADCPulse * pulse
The instance of the ADCPulse, as pointer since it can only be initialised in the init() ...
Definition: TPCElectronicsProcessor.h:163
double _noiseLevel
Central value of the pedestal width used to add noise to the ADC spectrum.
Definition: TPCElectronicsProcessor.h:156
static bool voxelPadComp(const std::pair< VoxelTPC::VoxelIndex, int > &left, const std::pair< VoxelTPC::VoxelIndex, int > &right)
function to sort the list of std::pair< VoxelTPC::VoxelIndex, int > by pad index, then time ...
Definition: TPCElectronicsProcessor.h:104
std::string _inputColName
Name of input collection.
Definition: TPCElectronicsProcessor.h:130
static bool voxelTimeComp(const std::pair< VoxelTPC::VoxelIndex, int > &left, const std::pair< VoxelTPC::VoxelIndex, int > &right)
function to sort the list of std::pair< VoxelTPC::VoxelIndex, int > by time, then pad index ...
Definition: TPCElectronicsProcessor.h:117
virtual void processEvent(lcio::LCEvent *evt)
Called for every event - the working horse.
Definition: TPCElectronicsProcessor.cc:212
double _noiseCutoff
Cutoff for random pedestal width - e.g. to discard tails from the Landau distribution, since really noisy channels probably wouldn't be used in the data either. (default: 4)
Definition: TPCElectronicsProcessor.h:160
double _clockJitter
Time jitter for the digitisation in nanoseconds.
Definition: TPCElectronicsProcessor.h:153