add RMS of time shift distribution in OCDB
authoralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 28 Aug 2008 06:09:21 +0000 (06:09 +0000)
committeralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 28 Aug 2008 06:09:21 +0000 (06:09 +0000)
T0/AliT0CalibTimeEq.cxx
T0/AliT0CalibTimeEq.h

index 195ecc5..6cffddf 100644 (file)
 ClassImp(AliT0CalibTimeEq)
 
 //________________________________________________________________
-  AliT0CalibTimeEq::AliT0CalibTimeEq():TNamed()
+  AliT0CalibTimeEq::AliT0CalibTimeEq():TNamed(),
+                                      fMeanVertex(0),        
+                                      fRmsVertex(0)      
 {
   //
 
 }
 
 //________________________________________________________________
-AliT0CalibTimeEq::AliT0CalibTimeEq(const char* name):TNamed()
+AliT0CalibTimeEq::AliT0CalibTimeEq(const char* name):TNamed(),
+                                      fMeanVertex(0),        
+                                      fRmsVertex(0)      
 {
   //constructor
 
@@ -52,7 +56,9 @@ AliT0CalibTimeEq::AliT0CalibTimeEq(const char* name):TNamed()
 }
 
 //________________________________________________________________
-AliT0CalibTimeEq::AliT0CalibTimeEq(const AliT0CalibTimeEq& calibda):TNamed(calibda)            
+AliT0CalibTimeEq::AliT0CalibTimeEq(const AliT0CalibTimeEq& calibda):TNamed(calibda),           
+                                      fMeanVertex(0),        
+                                      fRmsVertex(0)      
 {
 // copy constructor
   SetName(calibda.GetName());
@@ -104,9 +110,10 @@ void AliT0CalibTimeEq::ComputeOnlineParams(const char* filePhys)
 {
   // compute online equalized time
   Double_t mean=0, meanver=0;
+  Double_t rms=0, rmsver=0;
+
   gFile = TFile::Open(filePhys);
-  
-  if(!gFile) {
+    if(!gFile) {
     AliError("No input PHYS data found ");
   }
   else
@@ -118,14 +125,22 @@ void AliT0CalibTimeEq::ComputeOnlineParams(const char* filePhys)
          TH1F *cfd = (TH1F*) gFile->Get(buf1);
          if(!cfd) AliWarning(Form("no histograms collected by PHYS DA for channel %i", i));
          //      printf(" i = %d buf1 = %s\n", i, buf1);
-         if(cfd) mean=cfd->GetMean();
-         SetTimeEq(i,mean);
+         if(cfd) {
+           mean=cfd->GetMean();
+           rms=cfd->GetRMS();
+         }
+          SetTimeEq(i,mean);
+          SetTimeEqRms(i,rms);
          if (cfd) delete cfd;
        }
       TH1F *ver = (TH1F*) gFile->Get("hVertex");
       if(!ver) AliWarning("no Vertex histograms collected by PHYS DA for Zvertex");
-      if(ver)  meanver = ver->GetMean();
+      if(ver) {
+       meanver = ver->GetMean();
+       rmsver = ver->GetRMS();
+      }
       SetMeanVertex(meanver);
+      SetRmsVertex(rmsver);
       
       gFile->Close();
       delete gFile;
index dd6e3ac..f4c29b5 100644 (file)
@@ -27,21 +27,29 @@ class AliT0CalibTimeEq: public TNamed {
   Float_t* GetCFDvalue()          const {return (float*)fCFDvalue;}
   Float_t  GetTimeEq(Int_t channel)        const {return fTimeEq[channel];}
   Float_t* GetTimeEq()          const {return (float*)fTimeEq;}
-  const Float_t  GetMeanT0() const {return 1.;} // WARNING: USED IN AliT0Parameters!!!!
+  Float_t  GetTimeEqRms(Int_t channel)        const {return fTimeEqRms[channel];}
+
+ const Float_t  GetMeanT0() const {return 1.;} // WARNING: USED IN AliT0Parameters!!!!
   void SetCFDvalue(Int_t channel, Int_t number, Float_t val) {fCFDvalue[channel][number]=val;}
   void SetTimeEq(Int_t channel, Float_t val) {fTimeEq[channel]=val;}
+  void  SetTimeEqRms(Int_t channel, Float_t rms)  { fTimeEqRms[channel]=rms;}
   
   void SetMeanVertex(Float_t mean=0) { fMeanVertex = mean; };
   Float_t GetMeanVertex () {return fMeanVertex;};
 
+  void SetRmsVertex(Float_t rms=0) { fRmsVertex = rms; };
+  Float_t GetRmsVertex () {return fRmsVertex;};
 
  protected:
 
   Float_t     fCFDvalue[24][5];       // CFD values
   Float_t     fTimeEq[24];           // Time Equalized for OCDB         
-  Float_t fMeanVertex;
+  Float_t     fTimeEqRms[24];        // RMS of Time Equalized for OCDB  
+  Float_t     fMeanVertex;            // mean of vertex distribution   
+  Float_t     fRmsVertex;            // RMS of vertex distribution   
   //
-  ClassDef(AliT0CalibTimeEq,3)    // T0 Sensor Calibration data
+  ClassDef(AliT0CalibTimeEq,4)    // T0 Sensor Calibration data
 };
 
 typedef AliT0CalibTimeEq AliSTARTCalibTimeEq; // for backward compatibility