add profile for all samples and correct row numbering for EMCAL (Josh Hamblen/UT)
authordsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Dec 2008 20:31:41 +0000 (20:31 +0000)
committerdsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Dec 2008 20:31:41 +0000 (20:31 +0000)
EMCAL/AliCaloCalibPedestal.cxx
EMCAL/AliCaloCalibPedestal.h

index 14d5162..4dab139 100644 (file)
@@ -54,6 +54,8 @@ AliCaloCalibPedestal::AliCaloCalibPedestal(kDetType detectorType) :
   TObject(),
   fPedestalLowGain(),
   fPedestalHighGain(),
+  fSampleLowGain(),
+  fSampleHighGain(),
   fPeakMinusPedLowGain(),
   fPeakMinusPedHighGain(),
   fPedestalLowGainDiff(),
@@ -75,6 +77,9 @@ AliCaloCalibPedestal::AliCaloCalibPedestal(kDetType detectorType) :
   fColumns(0),
   fRows(0),
   fModules(0),
+  fRowMin(0),
+  fRowMax(0),
+  fRowMultiplier(0),
   fCaloString(),
   fMapping(NULL),
   fRunNumber(-1)
@@ -85,6 +90,9 @@ AliCaloCalibPedestal::AliCaloCalibPedestal(kDetType detectorType) :
     fRows = fgkPhosRows;
     fModules = fgkPhosModules;
     fCaloString = "PHOS";
+    fRowMin = -1*fRows;
+    fRowMax = 0;
+    fRowMultiplier = -1;
   } 
   else {
     //We'll just trust the enum to keep everything in line, so that if detectorType
@@ -94,6 +102,9 @@ AliCaloCalibPedestal::AliCaloCalibPedestal(kDetType detectorType) :
     fRows = fgkEmCalRows;
     fModules = fgkEmCalModules;
     fCaloString = "EMCAL";
+    fRowMin = 0;
+    fRowMax = fRows;
+    fRowMultiplier = 1;
   } 
   fDetType = detectorType;
  
@@ -107,7 +118,7 @@ AliCaloCalibPedestal::AliCaloCalibPedestal(kDetType detectorType) :
     title += i; 
     fPedestalLowGain.Add(new TProfile2D(name, title,
                                        fColumns, 0.0, fColumns, 
-                                       fRows, -fRows, 0.0));
+                                       fRows, fRowMin, fRowMax,"s"));
   
     //Pedestals, high gain
     name = "hPedhighgain";
@@ -116,7 +127,24 @@ AliCaloCalibPedestal::AliCaloCalibPedestal(kDetType detectorType) :
     title += i; 
     fPedestalHighGain.Add(new TProfile2D(name, title,
                                         fColumns, 0.0, fColumns, 
-                                        fRows, -fRows, 0.0));
+                                        fRows, fRowMin, fRowMax,"s"));
+    //All Samples, low gain
+    name = "hSamplelowgain";
+    name += i;
+    title = "All Samples, low gain, module ";
+    title += i; 
+    fSampleLowGain.Add(new TProfile2D(name, title,
+                                       fColumns, 0.0, fColumns, 
+                                       fRows, fRowMin, fRowMax,"s"));
+  
+    //All Samples, high gain
+    name = "hSamplehighgain";
+    name += i;
+    title = "All Samples, high gain, module ";
+    title += i; 
+    fSampleHighGain.Add(new TProfile2D(name, title,
+                                        fColumns, 0.0, fColumns, 
+                                        fRows, fRowMin, fRowMax,"s"));
   
     //Peak-Pedestals, low gain
     name = "hPeakMinusPedlowgain";
@@ -125,7 +153,7 @@ AliCaloCalibPedestal::AliCaloCalibPedestal(kDetType detectorType) :
     title += i; 
     fPeakMinusPedLowGain.Add(new TProfile2D(name, title,
                                            fColumns, 0.0, fColumns, 
-                                           fRows, -fRows, 0.0));
+                                           fRows, fRowMin, fRowMax,"s"));
   
     //Peak-Pedestals, high gain
     name = "hPeakMinusPedhighgain";
@@ -134,20 +162,22 @@ AliCaloCalibPedestal::AliCaloCalibPedestal(kDetType detectorType) :
     title += i; 
     fPeakMinusPedHighGain.Add(new TProfile2D(name, title,
                                             fColumns, 0.0, fColumns, 
-                                            fRows, -fRows, 0.0));
+                                            fRows, fRowMin, fRowMax,"s"));
   
     name = "hDeadMap";
     name += i;
     title = "Dead map, module ";
     title += i;
     fDeadMap.Add(new TH2D(name, title, fColumns, 0.0, fColumns, 
-                         fRows, -fRows, 0.0));
+                         fRows, fRowMin, fRowMax));
   
   }//end for nModules create the histograms
  
   //Compress the arrays, in order to remove the empty objects (a 16 slot array is created by default)
   fPedestalLowGain.Compress();
   fPedestalHighGain.Compress();
+  fSampleLowGain.Compress();
+  fSampleHighGain.Compress();
   fPeakMinusPedLowGain.Compress();
   fPeakMinusPedHighGain.Compress();
   fDeadMap.Compress();
@@ -173,6 +203,8 @@ AliCaloCalibPedestal::AliCaloCalibPedestal(const AliCaloCalibPedestal &ped) :
   TObject(ped),
   fPedestalLowGain(),
   fPedestalHighGain(),
+  fSampleLowGain(),
+  fSampleHighGain(),
   fPeakMinusPedLowGain(),
   fPeakMinusPedHighGain(),
   fPedestalLowGainDiff(),
@@ -194,6 +226,9 @@ AliCaloCalibPedestal::AliCaloCalibPedestal(const AliCaloCalibPedestal &ped) :
   fColumns(ped.GetColumns()),
   fRows(ped.GetRows()),
   fModules(ped.GetModules()),
+  fRowMin(ped.GetRowMin()),
+  fRowMax(ped.GetRowMax()),
+  fRowMultiplier(ped.GetRowMultiplier()),
   fCaloString(ped.GetCaloString()),
   fMapping(NULL), //! note that we are not copying the map info
   fRunNumber(ped.GetRunNumber())
@@ -203,6 +238,8 @@ AliCaloCalibPedestal::AliCaloCalibPedestal(const AliCaloCalibPedestal &ped) :
   for (int i = 0; i < fModules; i++) {
     fPedestalLowGain.Add( ped.GetPedProfileLowGain(i) );
     fPedestalHighGain.Add( ped.GetPedProfileHighGain(i) );
+    fSampleLowGain.Add( ped.GetSampleProfileLowGain(i) );
+    fSampleHighGain.Add( ped.GetSampleProfileHighGain(i) );
     fPeakMinusPedLowGain.Add( ped.GetPeakProfileLowGain(i) );
     fPeakMinusPedHighGain.Add( ped.GetPeakProfileHighGain(i) );
 
@@ -212,6 +249,8 @@ AliCaloCalibPedestal::AliCaloCalibPedestal(const AliCaloCalibPedestal &ped) :
   //Compress the arrays, in order to remove the empty objects (a 16 slot array is created by default)
   fPedestalLowGain.Compress();
   fPedestalHighGain.Compress();
+  fSampleLowGain.Compress();
+  fSampleHighGain.Compress();
   fPeakMinusPedLowGain.Compress();
   fPeakMinusPedHighGain.Compress();
   fDeadMap.Compress();
@@ -322,12 +361,14 @@ Bool_t AliCaloCalibPedestal::ProcessEvent(AliCaloRawStream *in)
       //NOTE: coordinates are (column, row) for the profiles
       if (gain == 0) {
        //fill the low gain histograms
-       ((TProfile2D*)fPedestalLowGain[arrayPos])->Fill(in->GetColumn(), -in->GetRow() - 1, min);
-       ((TProfile2D*)fPeakMinusPedLowGain[arrayPos])->Fill(in->GetColumn(), -in->GetRow() - 1, max - min);
+       ((TProfile2D*)fPedestalLowGain[arrayPos])->Fill(in->GetColumn(), fRowMultiplier*in->GetRow(), min);
+       ((TProfile2D*)fPeakMinusPedLowGain[arrayPos])->Fill(in->GetColumn(), fRowMultiplier*in->GetRow(), max - min);
+       ((TProfile2D*)fSampleLowGain[arrayPos])->Fill(in->GetColumn(), fRowMultiplier*in->GetRow(), sample);
       } 
       else {//fill the high gain ones
-       ((TProfile2D*)fPedestalHighGain[arrayPos])->Fill(in->GetColumn(), -in->GetRow() - 1, min);
-       ((TProfile2D*)fPeakMinusPedHighGain[arrayPos])->Fill(in->GetColumn(), -in->GetRow() - 1, max - min);
+       ((TProfile2D*)fPedestalHighGain[arrayPos])->Fill(in->GetColumn(), fRowMultiplier*in->GetRow(), min);
+       ((TProfile2D*)fPeakMinusPedHighGain[arrayPos])->Fill(in->GetColumn(), fRowMultiplier*in->GetRow(), max - min);
+       ((TProfile2D*)fSampleHighGain[arrayPos])->Fill(in->GetColumn(), fRowMultiplier*in->GetRow(), sample);
       }//end if gain
 
       max = fgkSampleMin; min = fgkSampleMax;
@@ -366,6 +407,12 @@ Bool_t AliCaloCalibPedestal::SaveHistograms(TString fileName, Bool_t saveEmptyHi
     if( ((TProfile2D *)fPedestalHighGain[i])->GetEntries() || saveEmptyHistos) {
       fPedestalHighGain[i]->Write();
     }
+    if( ((TProfile2D *)fSampleLowGain[i])->GetEntries() || saveEmptyHistos) {
+      fSampleLowGain[i]->Write();
+    }
+    if( ((TProfile2D *)fSampleHighGain[i])->GetEntries() || saveEmptyHistos) {
+      fSampleHighGain[i]->Write();
+    }
   } 
   
   destFile.Close();
@@ -423,7 +470,7 @@ void AliCaloCalibPedestal::ValidateComparisonProfiles()
     title += i; 
     fPedestalLowGainDiff.Add(new TProfile2D(name, title,
                                            fColumns, 0.0, fColumns, 
-                                           fRows, -fRows, 0.0));
+                                           fRows, fRowMin, fRowMax,"s"));
   
     //Pedestals, high gain
     name = "hPedhighgainDiff";
@@ -432,17 +479,8 @@ void AliCaloCalibPedestal::ValidateComparisonProfiles()
     title += i; 
     fPedestalHighGainDiff.Add(new TProfile2D(name, title,
                                             fColumns, 0.0, fColumns, 
-                                            fRows, -fRows, 0.0));
-  
-    //Peak-Pedestals, low gain
-    name = "hPeakMinusPedlowgainDiff";
-    name += i;
-    title = "Peak-Pedestal difference, low gain, module ";
-    title += i; 
-    fPeakMinusPedLowGainDiff.Add(new TProfile2D(name, title,
-                                               fColumns, 0.0, fColumns, 
-                                               fRows, -fRows, 0.0));
-  
+                                            fRows, fRowMin, fRowMax,"s"));
+
     //Peak-Pedestals, high gain
     name = "hPeakMinusPedhighgainDiff";
     name += i;
@@ -450,7 +488,7 @@ void AliCaloCalibPedestal::ValidateComparisonProfiles()
     title += i; 
     fPeakMinusPedHighGainDiff.Add(new TProfile2D(name, title,
                                                 fColumns, 0.0, fColumns, 
-                                                fRows, -fRows, 0.0));
+                                                fRows, fRowMin, fRowMax,"s"));
   
     //Pedestals, low gain
     name = "hPedlowgainRatio";
@@ -459,7 +497,7 @@ void AliCaloCalibPedestal::ValidateComparisonProfiles()
     title += i; 
     fPedestalLowGainRatio.Add(new TProfile2D(name, title,
                                             fColumns, 0.0, fColumns, 
-                                            fRows, -fRows, 0.0));
+                                            fRows, fRowMin, fRowMax,"s"));
   
     //Pedestals, high gain
     name = "hPedhighgainRatio";
@@ -468,7 +506,7 @@ void AliCaloCalibPedestal::ValidateComparisonProfiles()
     title += i; 
     fPedestalHighGainRatio.Add(new TProfile2D(name, title,
                                              fColumns, 0.0, fColumns, 
-                                             fRows, -fRows, 0.0));
+                                             fRows, fRowMin, fRowMax,"s"));
   
     //Peak-Pedestals, low gain
     name = "hPeakMinusPedlowgainRatio";
@@ -477,7 +515,7 @@ void AliCaloCalibPedestal::ValidateComparisonProfiles()
     title += i; 
     fPeakMinusPedLowGainRatio.Add(new TProfile2D(name, title,
                                                 fColumns, 0.0, fColumns, 
-                                                fRows, -fRows, 0.0));
+                                                fRows, fRowMin, fRowMax,"s"));
   
     //Peak-Pedestals, high gain
     name = "hPeakMinusPedhighgainRatio";
@@ -486,7 +524,7 @@ void AliCaloCalibPedestal::ValidateComparisonProfiles()
     title += i; 
     fPeakMinusPedHighGainRatio.Add(new TProfile2D(name, title,
                                                  fColumns, 0.0, fColumns, 
-                                                 fRows, -fRows, 0.0));
+                                                 fRows, fRowMin, fRowMax,"s"));
     
   }//end for nModules create the histograms
 }
index ff12c92..1daf865 100644 (file)
@@ -62,6 +62,8 @@ class AliCaloCalibPedestal : public TObject {
   // 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
+  TProfile2D * GetSampleProfileLowGain(int i) const {return (TProfile2D*)fSampleLowGain[i];};  // Return a pointer to the low-gain profile of all samples
+  TProfile2D * GetSampleProfileHighGain(int i) const {return (TProfile2D*)fSampleHighGain[i];};        // Return a pointer to the high-gain profile of all samples
   TProfile2D * GetPeakProfileLowGain(int i) const {return (TProfile2D*)fPeakMinusPedLowGain[i];};      // Return a pointer to the low-gain pedestal profile
   TProfile2D * GetPeakProfileHighGain(int i) const {return (TProfile2D*)fPeakMinusPedHighGain[i];};    // Return a pointer to the high-gain pedestal profile
   
@@ -86,6 +88,9 @@ class AliCaloCalibPedestal : public TObject {
   int GetColumns() const {return fColumns;}; //The number of columns per module
   int GetRows() const {return fRows;}; //The number of rows per module
   int GetModules() const {return fModules;}; //The number of modules
+  int GetRowMin() const {return fRowMin;}; //for histo def.
+  int GetRowMax() const {return fRowMax;}; //for histo def.
+  int GetRowMultiplier() const {return fRowMultiplier;}; //for histo filling
 
   // RunNumbers : setters and getters
   void SetRunNumber(int runNo) {fRunNumber = runNo;};
@@ -126,6 +131,8 @@ class AliCaloCalibPedestal : public TObject {
   //since we have only around 12 objects (maximum) in the array anyway.
   TObjArray fPedestalLowGain; // pedestal info for low gain
   TObjArray fPedestalHighGain; // pedestal info for high gain
+  TObjArray fSampleLowGain; // all sample info for low gain
+  TObjArray fSampleHighGain; // all sample info for high gain
   TObjArray fPeakMinusPedLowGain; // (peak-pedestal) info for low gain
   TObjArray fPeakMinusPedHighGain; // (peak-pedestal) info for high gain
   
@@ -158,6 +165,9 @@ class AliCaloCalibPedestal : public TObject {
   int fColumns;        //The number of columns per module
   int fRows;   //The number of rows per module
   int fModules;        //The number of modules
+  int fRowMin; // Mimimum Row number
+  int fRowMax; // Maximum now number
+  int fRowMultiplier; // Multiplication factor to get proper row range between PHOS and EMCAL
   TString fCaloString; // id for which detector type we have 
   AliCaloAltroMapping **fMapping;    //! Altro Mapping object
   int fRunNumber; //The run number. Needs to be set by the user.
@@ -174,7 +184,7 @@ class AliCaloCalibPedestal : public TObject {
   static const int fgkEmCalCols = 48; // number of columns per module for EMCAL
   static const int fgkEmCalModules = 12; // number of modules for EMCAL
   
-  ClassDef(AliCaloCalibPedestal,1)
+  ClassDef(AliCaloCalibPedestal,2)
 
 };