Diana Software
MJitterByCoincidence.hh
Go to the documentation of this file.
1 #ifndef _M_JITTERBYCOINCIDENCE_HH_
2 #define _M_JITTERBYCOINCIDENCE_HH_
3 
54 #include "QEventLabel.hh"
55 #include "QModule.hh"
56 #include "QDetChannelCollectionHandle.hh"
57 #include "QDetChannelCollection.hh"
58 #include <map>
59 #include <set>
60 #include <string>
61 #include <vector>
62 
63 class MJitterByCoincidence : public Diana::QModule {
64 
65  public:
66 
68  void Init(Diana::QEvent& ev);
69 
71  void Do(Diana::QEvent& ev);
72 
74  void Done();
75 
76  private:
77 
79  std::string fOutput;
80  std::string fCoincidenceDataOwner;
81  std::string fJitterByDelaySource;
82 
84  int fDataset;
85  int fRun;
86  int fTower;
87 
89  int fRefCh;
90 
92  bool fLastFloor;
93 
94  Diana::QEventLabel fEnergyLabel; // label of energy variable
95 
97  std::map<int,std::map<int,std::vector<double> > > fDeltaT;
98 
100  std::map<int,std::map<int,double > > fJitter;
101 
103  std::map<int,std::map<int,double > > fJitterRMS;
104 
106  std::set<int> fGoodChannels;
107 
109  double fJitterSum;
110 
113 
115  void SaveJitter(int ch, double jitter, double jitter_error);
116 
118  double FindJitter(int ch, int o_ch);
119 
121  double FindJitterRMS(int ch, int o_ch);
122 
124  int FindChanWithPosInTowerFloor(int pos, int tower, int floor);
125 
127  int ProcessFloor(int pos, int tower, int floor);
128 
129 };
130 
131 #endif
132 
Calculates time jitter between couples of channels using coincident events.
Diana::QEventLabel fEnergyLabel
double FindJitter(int ch, int o_ch)
FindJitter function.
double FindJitterRMS(int ch, int o_ch)
FindJitterRMS function.
double fJitterSum
Stores sum of jitters between floors as the floors are being processed.
double fJitterErrorSum
Stores sum of jitters errors (in quadrature) between floors as the floors are being processed.
std::map< int, std::map< int, std::vector< double > > > fDeltaT
Map of vectors containing deltaT between couples of channels in coincident events.
std::map< int, std::map< int, double > > fJitter
Map of Jitter between couples of channels, calculated from deltaT above.
int fRefCh
Reference Channel.
void Done()
Done method.
void Init(Diana::QEvent &ev)
Init method.
void Do(Diana::QEvent &ev)
Do method
void SaveJitter(int ch, double jitter, double jitter_error)
SaveJitter function.
int FindChanWithPosInTowerFloor(int pos, int tower, int floor)
FindPos function.
std::set< int > fGoodChannels
Stores the channels with thermistor ranking >=1 as the floors are being processed.
std::string fOutput
Jitter output (file or DB, for the moment only file works)
std::map< int, std::map< int, double > > fJitterRMS
Map of JitterRMS/N between couples of channels, calculated from deltaT above.
int ProcessFloor(int pos, int tower, int floor)
ProcessFloor function.