]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliCaloCalibPedestal.h
Fixing a little overlap. Adding flags to perform material budget studies (Mario)
[u/mrichter/AliRoot.git] / EMCAL / AliCaloCalibPedestal.h
index 74727634dbf7a4f9bfce43ded7725c4573c1f960..0b68fabd70dc3e7afa9a859bf77b944b14af09c8 100644 (file)
@@ -44,8 +44,8 @@ class AliCaloCalibPedestal : public TObject {
 
   // copy ctor, and '=' operator, are not fully tested/debugged yet
   // at least for now; the reference info is not copied from one to the other
-  AliCaloCalibPedestal(const AliCaloCalibPedestal &ped); 
-  AliCaloCalibPedestal& operator = (const  AliCaloCalibPedestal &source);
+  AliCaloCalibPedestal(AliCaloCalibPedestal &ped); 
+  AliCaloCalibPedestal& operator = (AliCaloCalibPedestal &source);
   
   // Event processing methods:  
   Bool_t ProcessEvent(AliRawReader *rawReader);
@@ -62,12 +62,12 @@ class AliCaloCalibPedestal : public TObject {
   ////////////////////////////
   //Simple getters
   // Main profiles:
-  TProfile2D * GetPedProfileLowGain(int i) const {return (TProfile2D*)fPedestalLowGain[i];};   // Return a pointer to the low-gain pedestal profile
-  TProfile2D * GetPedProfileHighGain(int i) const {return (TProfile2D*)fPedestalHighGain[i];}; // Return a pointer to the high-gain pedestal profile
-  TProfile * GetPedLEDRefProfileLowGain(int i) const {return (TProfile*)fPedestalLEDRefLowGain[i];};   // Return a pointer to the low-gain LEDRef profile 
-  TProfile * GetPedLEDRefProfileHighGain(int i) const {return (TProfile*)fPedestalLEDRefHighGain[i];}; // Return a pointer to the high-gain LEDRef profile 
-  TProfile2D * GetPeakProfileLowGain(int i) const {return (TProfile2D*)fPeakMinusPedLowGain[i];};      // Return a pointer to the low-gain peak-pedestal profile
-  TProfile2D * GetPeakProfileHighGain(int i) const {return (TProfile2D*)fPeakMinusPedHighGain[i];};    // Return a pointer to the high-gain peak-pedestal profile
+  TProfile2D * GetPedProfileLowGain(int i) {ValidateProfiles(); return (TProfile2D*)fPedestalLowGain[i];};     // Return a pointer to the low-gain pedestal profile
+  TProfile2D * GetPedProfileHighGain(int i) {ValidateProfiles(); return (TProfile2D*)fPedestalHighGain[i];};   // Return a pointer to the high-gain pedestal profile
+  TProfile * GetPedLEDRefProfileLowGain(int i) {ValidateProfiles(); return (TProfile*)fPedestalLEDRefLowGain[i];};     // Return a pointer to the low-gain LEDRef profile 
+  TProfile * GetPedLEDRefProfileHighGain(int i) {ValidateProfiles(); return (TProfile*)fPedestalLEDRefHighGain[i];};   // Return a pointer to the high-gain LEDRef profile 
+  TProfile2D * GetPeakProfileLowGain(int i) {ValidateProfiles(); return (TProfile2D*)fPeakMinusPedLowGain[i];};        // Return a pointer to the low-gain peak-pedestal profile
+  TProfile2D * GetPeakProfileHighGain(int i) {ValidateProfiles(); return (TProfile2D*)fPeakMinusPedHighGain[i];};      // Return a pointer to the high-gain peak-pedestal profile
   
   // Differences to references:
   TProfile2D * GetPedProfileLowGainDiff(int i){ValidateComparisonProfiles(); return (TProfile2D*)fPedestalLowGainDiff[i];};    // Return a pointer to the low-gain pedestal profile difference
@@ -85,16 +85,17 @@ class AliCaloCalibPedestal : public TObject {
   TProfile2D * GetPeakProfileLowGainRatio(int i){ValidateComparisonProfiles(); return (TProfile2D*)fPeakMinusPedLowGainRatio[i];};     // Return a pointer to the low-gain peak-pedestal profile ratio
   TProfile2D * GetPeakProfileHighGainRatio(int i){ValidateComparisonProfiles(); return (TProfile2D*)fPeakMinusPedHighGainRatio[i];};   // Return a pointer to the high-gain peak-pedestal profile ratio
   
-  TH2F * GetPeakHighGainHisto(int i) const {return (TH2F*)fPeakMinusPedHighGainHisto[i];};     // Return a pointer to the high-gain peak-pedestal histo
+  TH2F * GetPeakHighGainHisto(int i) {ValidateProfiles(); return (TH2F*)fPeakMinusPedHighGainHisto[i];};       // Return a pointer to the high-gain peak-pedestal histo
 
 
-  TH2D * GetDeadMap(int i) const {return (TH2D*)fDeadMap[i];}
+  TH2D * GetDeadMap(int i) {ValidateProfiles(); return (TH2D*)fDeadMap[i];}
   //void SetDeadMap(int i, TH2D *h) const {((TH2D*)fDeadMap[i])=h;}
        
   Bool_t IsBadChannel(int imod, int icol, int irow) const; 
-  void SetChannelStatus(int imod, int icol, int irow, int status); 
+  void  SetChannelStatus(int imod, int icol, int irow, int status); 
+  Int_t GetChannelStatus(int imod, int icol, int irow) const { return  (Int_t)((TH2D*)fDeadMap[imod])->GetBinContent(icol, irow);      }
        
-  TObjArray GetDeadMap()  const {return fDeadMap;}
+  TObjArray GetDeadMap()  {ValidateProfiles(); return fDeadMap;}
   void SetDeadMap(TObjArray map) {fDeadMap = map;}
        
   // Basic info: getters  
@@ -146,7 +147,7 @@ class AliCaloCalibPedestal : public TObject {
   int GetDeadTowerResurrected() const {return fResurrectedTowers;}; //The the towers resurrected since the reference run
 
   void Reset();//Resets the whole class.
-  Bool_t AddInfo(const AliCaloCalibPedestal *ped);//picks up new info from supplied argument
+  Bool_t AddInfo(AliCaloCalibPedestal *ped);//picks up new info from supplied argument
   
   //////////////////////////////////////////////////////
   //Functions related to comparing this with another (reference) run.
@@ -159,14 +160,18 @@ class AliCaloCalibPedestal : public TObject {
 
   //Saving functions
   Bool_t SaveHistograms(TString fileName, Bool_t saveEmptyHistos = kFALSE); //Saves the histograms to a .root file
-  
+
+  void Init() { ValidateProfiles(); } // do basic setup
+
  private:
   
+  void ValidateProfiles(); //Makes sure that basic histos/profiles exist
+  void CompressAndSetOwner(); //Makes sure that basic histos/profiles exist
   void ValidateComparisonProfiles(); //Makes sure that fPe..Diff and fPe..Ratio profiles exist
   
   //The histograms. We use a TObjArray instead of a simple array,because this gives automatic streaming properties for the
   //class. A TClonesArray would be more efficient, but it's a bit more difficult to use and it doesn't matter too much
-  //since we have only around 12 objects (maximum) in the array anyway.
+  //since we have only one object per module in the array anyway.
   TObjArray fPedestalLowGain; // pedestal info for low gain
   TObjArray fPedestalHighGain; // pedestal info for high gain
   TObjArray fPedestalLEDRefLowGain; // pedestal LEDRef info for low gain