]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliCaloCalibSignal.h
correct mask for V0 charge decoding in STU payload
[u/mrichter/AliRoot.git] / EMCAL / AliCaloCalibSignal.h
index 72eb53f82548bdcf430e290d808a5283c8580eab..7c8b81f8a8f293d9c777e67fa9332bd4c59191e0 100644 (file)
@@ -28,7 +28,6 @@
 class AliCaloRawStreamV3;
 class AliCaloAltroMapping;
 class AliRawReader;
-class AliRawEventHeaderBase;
 
 class AliCaloCalibSignal : public TObject {
   
@@ -38,20 +37,27 @@ class AliCaloCalibSignal : public TObject {
   
   AliCaloCalibSignal(kDetType detectorType = kPhos); //ctor
   virtual ~AliCaloCalibSignal(); //dtor
-
-  // copy ctor, and '=' operator, are not fully tested/debugged yet
-  AliCaloCalibSignal(const AliCaloCalibSignal &sig); // copy ctor
-  AliCaloCalibSignal& operator = (const  AliCaloCalibSignal &source); //!
   
+private:
+  //Just declare them, avoid compilation warning
+  AliCaloCalibSignal(const AliCaloCalibSignal & /*sig*/); // copy ctor
+  AliCaloCalibSignal& operator = (const  AliCaloCalibSignal &/*source*/); // assing operator
+  
+public:
   // Event processing methods:
   Bool_t ProcessEvent(AliRawReader *rawReader);
-  Bool_t ProcessEvent(AliCaloRawStreamV3 *in, AliRawEventHeaderBase *aliHeader); // added header for time info
-  Bool_t CheckFractionAboveAmp(int *AmpVal, int resultArray[]); // check fraction of signals to check for LED events
+  Bool_t ProcessEvent(AliCaloRawStreamV3 *in, UInt_t Timestamp); // added header for time info
+  Bool_t CheckFractionAboveAmp(const int *AmpVal, int resultArray[]); // check fraction of signals to check for LED events
+  Bool_t CheckLEDRefAboveAmp(const int *AmpVal, int resultArray[]); // check if LED Ref is also above cut
 
   // Mapping handling
-  AliCaloAltroMapping **GetAltroMapping() { return fMapping; };
+  AliCaloAltroMapping **GetAltroMapping() const { return fMapping; };
   void  SetAltroMapping(AliCaloAltroMapping **mapp) { fMapping = mapp; };
 
+  // Parameter/cut handling
+  void SetParametersFromFile(const char *parameterFile);
+  void WriteParametersToFile(const char *parameterFile);
+
   ////////////////////////////
   //Simple getters
   // for TTree
@@ -69,7 +75,7 @@ class AliCaloCalibSignal : public TObject {
   int GetNLowGain(int towId) const { return fNLowGain[towId];};        //!
 
   // also for LED reference
-  int GetNRef(int imod, int istripMod, int igain) const //!
+  int GetNRef(const int imod, const int istripMod, const int igain) //!
     { int refId = GetRefNum(imod, istripMod, igain); return fNRef[refId];}; //!
   int GetNRef(int refId) const { return fNRef[refId];}; //!
 
@@ -81,27 +87,19 @@ class AliCaloCalibSignal : public TObject {
   int GetRows() const {return fRows;}; //The number of rows per module
   int GetLEDRefs() const {return fLEDRefs;}; //The number of LED references/monitors per module
   int GetModules() const {return fModules;}; //The number of modules
-  int GetTowerNum(int imod, int icol, int irow) const { return (imod*fColumns*fRows + icol*fRows + irow);}; // help index
 
-  int GetChannelNum(int imod, int icol, int irow, int igain) const { return (igain*fModules*fColumns*fRows + imod*fColumns*fRows + icol*fRows + irow);}; // channel number with gain included
+  int GetTowerNum(const int imod, const int icol, const int irow) const { return (imod*fColumns*fRows + icol*fRows + irow);}; // help index
 
-  Bool_t DecodeChannelNum(int chanId, int *imod, int *icol, int *irow, int *igain) const {
-    *igain = chanId/(fModules*fColumns*fRows);
-    *imod = (chanId/(fColumns*fRows)) % fModules;
-    *icol = (chanId/fRows) % fColumns;
-    *irow = chanId % fRows;
-    return kTRUE;
-  }; // return the module, column, row, and gain for a given channel number
+  int GetChannelNum(const int imod, const int icol, const int irow, const int igain) const { return (igain*fModules*fColumns*fRows + imod*fColumns*fRows + icol*fRows + irow);}; // channel number with gain included
+
+  Bool_t DecodeChannelNum(const int chanId, 
+                         int *imod, int *icol, int *irow, int *igain) const; // return the module, column, row, and gain for a given channel number
 
   // LED reference indexing
-  int GetRefNum(int imod, int istripMod, int igain) const { return (igain*fModules*fLEDRefs + imod*fLEDRefs + istripMod);}; // channel number with gain included
+  int GetRefNum(const int imod, const int istripMod, const int igain) const { return (igain*fModules*fLEDRefs + imod*fLEDRefs + istripMod);}; // channel number with gain included
 
-  Bool_t DecodeRefNum(int refId, int *imod, int *istripMod, int *igain) const {
-    *igain = refId/(fModules*fLEDRefs);
-    *imod = (refId/(fLEDRefs)) % fModules;
-    *istripMod = refId % fLEDRefs;
-    return kTRUE;
-  }; // return the module, stripModule, and gain for a given reference number
+  Bool_t DecodeRefNum(const int refId, 
+                     int *imod, int *istripMod, int *igain) const; // return the module, stripModule, and gain for a given reference number
 
   // Basic Counters
   int GetNEvents() const {return fNEvents;};
@@ -116,6 +114,11 @@ class AliCaloCalibSignal : public TObject {
   double GetReqFractionAboveAmpCutVal() const { return fReqFractionAboveAmpCutVal; }; //!
   void SetReqFractionAboveAmp(bool b) { fReqFractionAboveAmp = b; } //!
   bool GetReqFractionAboveAmp() const { return fReqFractionAboveAmp; }; //!
+  // also for LED Reference/Mon channels
+  void SetAmpCutLEDRef(double d) { fAmpCutLEDRef = d; } //!
+  double GetAmpCutLEDRef() const { return fAmpCutLEDRef; }; //!
+  void SetReqLEDRefAboveAmpCutVal(bool b) { fReqLEDRefAboveAmpCutVal = b; } //!
+  bool GetReqLEDRefAboveAmpCutVal() const { return fReqLEDRefAboveAmpCutVal; }; //!
 
   // We may select to get averaged info
   void SetUseAverage(bool b) { fUseAverage = b; } //!
@@ -169,6 +172,9 @@ class AliCaloCalibSignal : public TObject {
   double fReqFractionAboveAmpCutVal; // required fraction that should be above cut
   bool fReqFractionAboveAmp; // flag to select if we should do some event selection based on amplitudes
 
+  double fAmpCutLEDRef; // amplitude cut value for LED reference
+  bool fReqLEDRefAboveAmpCutVal; // flag to select if we should require that signal is also seen in LED Reference/Monitoring channel
+
   double fHour; // fraction of hour since beginning of run, for amp vs. time graphs, for current event
   double fLatestHour; // largest fraction of hour since beginning of run, for amp vs. time graphs
   bool fUseAverage; // flag to average graph points into over a time interval
@@ -203,7 +209,7 @@ class AliCaloCalibSignal : public TObject {
   int fNLowGain[fgkMaxTowers]; // same, for low gain
   int fNRef[fgkMaxRefs * 2]; // same, for LED refs; *2 for both gains
   
-  ClassDef(AliCaloCalibSignal, 4) // don't forget to change version if you change class member list..
+  ClassDef(AliCaloCalibSignal, 6) // don't forget to change version if you change class member list..
     
 };