35 #ifndef STETOFCALIBMAKER_H
36 #define STETOFCALIBMAKER_H
68 Int_t InitRun( Int_t );
69 Int_t FinishRun( Int_t );
78 void setFileNameElectronicsMap(
const char* fileName );
79 void setFileNameStatusMap(
const char* fileName );
80 void setFileNameTimingWindow(
const char* fileName );
81 void setFileNameSignalVelocity(
const char* fileName );
82 void setFileNameCalibHistograms(
const char* fileName );
83 void setFileNameOffsetHistograms(
const char* fileName );
84 void setFileNameResetTimeCorr(
const char* fileName );
85 void setFileNamePulserTotPeak(
const char* fileName );
86 void setFileNamePulserTimeDiffGbtx(
const char* fileName );
88 void setDoQA(
const bool doQA );
89 void setDebug(
const bool debug );
90 void setStrictPulserHandling(
const bool debug );
91 void setReferencePulserIndex(
const int index );
102 return geomId == r.geomId && fabs( time - r.time ) < 1.e-5 && fabs( tot - r.tot ) < 1.e-5;
108 bool isFileExisting(
const std::string fileName );
112 void flagPulserDigis (
StETofDigi* aDigi,
unsigned int index, std::map<
unsigned int, std::vector< unsigned int > >& pulserCandMap );
118 void flagPulserDigis (
StMuETofDigi* aDigi,
unsigned int index, std::map<
unsigned int, std::vector< unsigned int > >& pulserCandMap );
121 void calculatePulserOffsets( std::map<
unsigned int, std::vector< unsigned int > >& pulserCandMap );
126 double slewingTimeOffset(
StETofDigi* aDigi );
127 double applyPulserOffset(
StETofDigi* aDigi );
129 double resetTimeCorr()
const;
134 unsigned int channelToKey(
const unsigned int channelId );
135 unsigned int detectorToKey(
const unsigned int detectorId );
136 unsigned int sideToKey(
const unsigned int sideId );
139 void bookHistograms();
140 void setHistFileName();
141 void writeHistograms();
143 void readGet4State(
int fileNr,
short forward);
144 void checkGet4State(
unsigned long int eventNr);
150 std::string mFileNameCalibParam;
151 std::string mFileNameElectronicsMap;
152 std::string mFileNameStatusMap;
153 std::string mFileNameTimingWindow;
154 std::string mFileNameSignalVelocity;
155 std::string mFileNameCalibHistograms;
156 std::string mFileNameOffsetHistograms;
157 std::string mFileNameResetTimeCorr;
158 std::string mFileNamePulserTotPeak;
159 std::string mFileNamePulserTimeDiffGbtx;
162 Float_t mGet4TotBinWidthNs;
163 Int_t mMinDigisPerSlewBin;
164 Float_t mResetTimeCorr;
166 Double_t mTriggerTime;
170 Float_t mPulserPeakTime;
171 Int_t mReferencePulserIndex;
173 std::map< UInt_t, std::pair< Float_t, Float_t > > mTimingWindow;
174 std::map< UInt_t, std::pair< Float_t, Float_t > > mPulserWindow;
175 std::map< UInt_t, UInt_t > mStatus;
176 std::map< UInt_t, Float_t > mSignalVelocity;
178 std::map< UInt_t, TH1F* > mDigiTotCorr;
179 std::map< UInt_t, TH1F* > mDigiTimeCorr;
180 std::map< UInt_t, TProfile* > mDigiSlewCorr;
182 std::map< UInt_t, Float_t > mPulserPeakTot;
183 std::map< UInt_t, Double_t > mPulserTimeDiff;
184 std::map< UInt_t, Double_t > mPulserTimeDiffGbtx;
185 std::map< UInt_t, UInt_t > mNPulsersCounter;
186 std::map< UInt_t, UInt_t > mNStatusBitsCounter;
187 std::map< UInt_t, Bool_t > mPulserPresent;
189 std::map< UInt_t, Int_t > mJumpingPulsers;
191 std::map< UInt_t, Int_t > mUnlockPulserState;
193 std::vector< StructStuckFwDigi > mStuckFwDigi;
195 Bool_t mStrictPulserHandling;
196 Bool_t mUsePulserGbtxDiff;
199 std::string mHistFileName;
200 std::map< std::string, TH1* > mHistograms;
203 std::string mFileNameGet4State;
204 std::vector<short> mStateVec[1728];
205 std::vector<unsigned long int> mStartVec[1728];
206 std::vector<unsigned long int> mMasterStartVec;
207 std::map<int , short> mGet4StateMap;
208 std::map<int , short> mGet4ZeroStateMap;
209 unsigned long int mStateMapStart;
210 unsigned long int mStateMapStop;
211 unsigned long int mDbEntryStart;
212 unsigned long int mDbEntryStop;
215 void decodeInt( std::vector<unsigned long int> intVec ,std::map<int , short>& mGet4StateMap ,std::map<int , short>& mGet4ZeroStateMap ,std::vector<unsigned long int>& startVec ,std::vector<unsigned long int>& mMasterStartVec ,std::map<
unsigned long int,vector<int>>& stateVec ,std::map<
unsigned long int,vector<int>>& get4IdVec);
217 virtual const Char_t *GetCVS()
const {
static const char cvs[]=
"Tag $Name: $Id: built " __DATE__
" " __TIME__ ;
return cvs; }
221 inline short StETofCalibMaker::GetState(
int get4 ) {
return mGet4StateMap.at(get4); }
223 inline void StETofCalibMaker::setFileNameElectronicsMap(
const char* fileName ) { mFileNameElectronicsMap = fileName; }
224 inline void StETofCalibMaker::setFileNameStatusMap(
const char* fileName ) { mFileNameStatusMap = fileName; }
225 inline void StETofCalibMaker::setFileNameTimingWindow(
const char* fileName ) { mFileNameTimingWindow = fileName; }
226 inline void StETofCalibMaker::setFileNameSignalVelocity(
const char* fileName ) { mFileNameSignalVelocity = fileName; }
227 inline void StETofCalibMaker::setFileNameCalibHistograms(
const char* fileName ) { mFileNameCalibHistograms = fileName; }
228 inline void StETofCalibMaker::setFileNameOffsetHistograms(
const char* fileName ) { mFileNameOffsetHistograms = fileName; }
229 inline void StETofCalibMaker::setFileNameResetTimeCorr(
const char* fileName ) { mFileNameResetTimeCorr = fileName; }
230 inline void StETofCalibMaker::setFileNamePulserTotPeak(
const char* fileName ) { mFileNamePulserTotPeak = fileName; }
231 inline void StETofCalibMaker::setFileNamePulserTimeDiffGbtx(
const char* fileName ) { mFileNamePulserTimeDiffGbtx = fileName; }
234 inline double StETofCalibMaker::resetTimeCorr()
const {
return mResetTimeCorr; }
236 inline void StETofCalibMaker::setStrictPulserHandling(
const bool StrictPulserHandling ) { mStrictPulserHandling = StrictPulserHandling; }
237 inline void StETofCalibMaker::setDoQA(
const bool doQA ) { mDoQA = doQA; }
238 inline void StETofCalibMaker::setDebug(
const bool debug ) { mDebug = debug; }
239 inline void StETofCalibMaker::setReferencePulserIndex(
const int index ) { mReferencePulserIndex = index; }
241 #endif // STETOFCALIBMAKER_H
void setFileNameCalibParam(const char *fileName)
read calibration parameters from file
StETofCalibMaker(const char *name="etofCalib")
default constructor