MarlinTPC  1.2.0
ADCPulseConverterProcessor.h
1 #ifndef ADCPulseConverterProcessor_h
2 #define ADCPulseConverterProcessor_h 1
3 
4 //C++
5 #include <string>
6 
7 //LCIO
8 #include "lcio.h"
9 #include "EVENT/LCCollection.h"
10 #include "EVENT/TrackerData.h"
11 #include "EVENT/TrackerPulse.h"
12 #include "IMPL/LCCollectionVec.h"
13 //Marlin
14 #include "marlin/Processor.h"
15 
16 
17 namespace marlintpc
18 {
19 
41 class ADCPulseConverterProcessor : public marlin::Processor
42 {
43 
44  public:
45 
46  virtual Processor* newProcessor()
47  {
48  return new ADCPulseConverterProcessor ;
49  }
50 
53 
54  virtual void init() ;
55 
56  virtual void processRunHeader(lcio::LCRunHeader* run) ;
57 
58  virtual void processEvent(lcio::LCEvent * evt) ;
59 
60  virtual void check(lcio::LCEvent * evt) ;
61 
62  virtual void end() ;
63 
64 
65  protected:
66 
67  // int _nRun ; ///< run counter
68  // int _nEvt ; ///< event counter
69 
70  std::string _inputColName;
71  // std::string _outputDataColName; ///< name of the collection, where TrackerData are stored
72  std::string _outputPulseColName;
73 
78 
84 
85  /* the minmal bin per pulse
86  * = _saveNBinsBeforeStart + _saveNBinsAfterStart
87  */
88  int _minPulseDataSize;
89 
90  // this has to be taken in dependence on the module, cannot be a global parameter
91  // double _ReadoutFrequency; ///< readout frequency in Hz (node: the time will be stored in ns)
92 
96  int findPulses(lcio::TrackerData* thisData, lcio::LCCollectionVec* thisCollection,
97  float StartThreshold);
98 
101  float calcPulseTime(lcio::TrackerData* thisPulse);
102 
106  float calcPulseCharge(lcio::TrackerData* thisPulse);
107 
108 };
109 
110 }// namespace marlintpc
111 #endif //ADCPulseConverterProcessor_h
std::string _inputColName
name of the collection, where input data are stored
Definition: ADCPulseConverterProcessor.h:70
float calcPulseCharge(lcio::TrackerData *thisPulse)
calculate the integrated charge of the given pulse by sum up all bins of the ADC spectrum ...
Definition: ADCPulseConverterProcessor.cc:188
Convert zero-suppressed ADC raw data to pulses.
Definition: ADCPulseConverterProcessor.h:41
std::string _outputPulseColName
name of the collection, where TrackerPulse are stored
Definition: ADCPulseConverterProcessor.h:72
int _outputIsTransient
set the status which is set to the transient flag of the output collection it is an int instead of a ...
Definition: ADCPulseConverterProcessor.h:77
int _forceSpectrumSave
if not 0 the ADC spectrum will be saved for all pulses instead of only for pulses with quality !=0 it...
Definition: ADCPulseConverterProcessor.h:83
int findPulses(lcio::TrackerData *thisData, lcio::LCCollectionVec *thisCollection, float StartThreshold)
find pulses by threshold in the ADC information
float calcPulseTime(lcio::TrackerData *thisPulse)
The time is just the centre of gravity of the pulse.
Definition: ADCPulseConverterProcessor.cc:151
ADCPulseConverterProcessor()
constructor
Definition: ADCPulseConverterProcessor.cc:29