container for season time shift
authoralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 22 Nov 2010 20:30:25 +0000 (20:30 +0000)
committeralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 22 Nov 2010 20:30:25 +0000 (20:30 +0000)
T0/AliT0CalibSeasonTimeShift.cxx [new file with mode: 0644]
T0/AliT0CalibSeasonTimeShift.h [new file with mode: 0644]
T0/T0recLinkDef.h
T0/libT0rec.pkg

diff --git a/T0/AliT0CalibSeasonTimeShift.cxx b/T0/AliT0CalibSeasonTimeShift.cxx
new file mode 100644 (file)
index 0000000..d4f71a6
--- /dev/null
@@ -0,0 +1,139 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id: AliT0CalibSeasonTimeShift.cxx 42881 2010-08-16 10:59:14Z alla $ */
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+// class for T0 calibration                       TM-AC-AM_6-02-2006  
+// equalize time shift for each time CFD channel
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "AliT0CalibSeasonTimeShift.h"
+#include "AliLog.h"
+#include <TFile.h>
+#include <TMath.h>
+#include <TF1.h>
+#include <TProfile.h>
+#include <iostream>
+
+ClassImp(AliT0CalibSeasonTimeShift)
+
+//________________________________________________________________
+  AliT0CalibSeasonTimeShift::AliT0CalibSeasonTimeShift():TNamed()
+{
+  //
+
+}
+
+//________________________________________________________________
+AliT0CalibSeasonTimeShift::AliT0CalibSeasonTimeShift(const char* name):TNamed()
+{
+    //constructor
+    
+  TString namst = "Calib_";
+  namst += name;
+  SetName(namst.Data());
+  SetTitle(namst.Data());
+}
+
+//________________________________________________________________
+AliT0CalibSeasonTimeShift::AliT0CalibSeasonTimeShift(const AliT0CalibSeasonTimeShift& calibda):TNamed(calibda)         
+
+{
+// copy constructor
+  SetName(calibda.GetName());
+  SetTitle(calibda.GetName());
+
+
+}
+
+//________________________________________________________________
+AliT0CalibSeasonTimeShift &AliT0CalibSeasonTimeShift::operator =(const AliT0CalibSeasonTimeShift& calibda)
+{
+// assignment operator
+  SetName(calibda.GetName());
+  SetTitle(calibda.GetName());
+  return *this;
+}
+
+//________________________________________________________________
+AliT0CalibSeasonTimeShift::~AliT0CalibSeasonTimeShift()
+{
+  //
+  // destrictor
+}
+
+
+//________________________________________________________________
+void  AliT0CalibSeasonTimeShift::Print(Option_t*) const
+{
+  // print time values
+
+  printf("\n   ----    T0 results      ----\n\n");
+  printf(" (T0A+T0C)/2 = %f; T0A = %f; T0C = %f; resolution = %f  \n", fMeanPar[0], fMeanPar[1],fMeanPar[2],fMeanPar[3]);
+  printf(" sigma(T0A+T0C)/2 = %f; sigma(T0 = %f; sigma(T0C) = %f; sigma(resolution) = %f  \n" , fSigmaPar[0], fSigmaPar[1], fSigmaPar[2],fSigmaPar[3]);
+} 
+
+//________________________________________________________________
+void  AliT0CalibSeasonTimeShift::SetT0Par(Float_t par[4],Float_t spar[4])
+{
+  for (Int_t i=0; i<4; i++)
+    {
+      fMeanPar[i] = par[i];
+      fSigmaPar[i] = spar[i];
+    }
+
+}
+
+//________________________________________________________________
+void AliT0CalibSeasonTimeShift::SetT0Par(const char* filePhys)
+{
+  // compute online equalized time
+  Float_t mean[4], sigma[4];
+
+  gFile = TFile::Open(filePhys);
+  if(!gFile) {
+    AliError("No input PHYS data found ");
+  }
+  else
+    {
+      gFile->ls();
+      TString histname[4]={"meanAC", "meanA", "meanC", "resolution"};
+       for (Int_t i=0; i<4; i++)
+       {
+         TH1F *cfd = (TH1F*) gFile->Get(histname[i].Data());
+         if(!cfd) AliWarning(Form("no histograms collected for %s", histname[i].Data()));
+         if(cfd) {
+           TF1 *g = new TF1("g", "gaus",-2,2);
+           cfd->Fit("g"," ","Q",-2,2);
+           Double_t par[3];
+           g->GetParameters(&par[0]);
+           fMeanPar[i] = par[1];
+           fSigmaPar[i]=par[2];
+
+         }
+       } 
+
+         gFile->Close();
+         delete gFile;
+         
+    }
+  
+}
diff --git a/T0/AliT0CalibSeasonTimeShift.h b/T0/AliT0CalibSeasonTimeShift.h
new file mode 100644 (file)
index 0000000..c85b71c
--- /dev/null
@@ -0,0 +1,55 @@
+#ifndef AliT0CalibSeasonTimeShift_H
+#define AliT0CalibSeasonTimeShift_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+////////////////////////////////////////////////
+//  class for T0 calibration                 //
+////////////////////////////////////////////////
+
+#include "TNamed.h"
+
+class AliT0CalibSeasonTimeShift: public TNamed {
+
+ public:
+  AliT0CalibSeasonTimeShift();
+  AliT0CalibSeasonTimeShift(const char* name);
+  AliT0CalibSeasonTimeShift(const AliT0CalibSeasonTimeShift &calibda);
+   AliT0CalibSeasonTimeShift & operator= (const AliT0CalibSeasonTimeShift &calibda);
+  virtual ~AliT0CalibSeasonTimeShift();
+   virtual void  Print(Option_t* option= "") const; 
+  Float_t  MeanAC()        const {return fMeanPar[0];}
+  Float_t  MeanA()        const {return fMeanPar[1];}
+  Float_t  MeanC()        const {return fMeanPar[2];}
+  Float_t  T0resolution()        const {return fMeanPar[3];}
+
+  Float_t  SigmaAC()        const {return fSigmaPar[0];}
+  Float_t  SigmaA()        const {return fSigmaPar[01];}
+  Float_t  SigmaC()        const {return fSigmaPar[2];}
+  Float_t  SigmaT0resolution()        const {return fSigmaPar[3];}
+  Float_t *GetT0Means() { return fMeanPar;}
+  Float_t *GetT0Sigmas() { return fSigmaPar;};
+  void SetT0Par(Float_t par[4],Float_t spar[4] );
+  void SetT0Par(const char* filePhys );
+   
+ protected:
+  Float_t  fMeanPar[4];     
+// [0] (T0A+T0C)/2; 
+// [1] T0A corrected by primary vertex
+// [2] T0A corrected by primary vertex
+// [3] T0resolution
+   Float_t  fSigmaPar[4];     
+// [0] sigma (T0A+T0C)/2; 
+// [1] sigma T0A corrected by primary vertex
+// [2]sigma T0A corrected by primary vertex
+// [3]sigma T0resolution
+
+
+  ClassDef(AliT0CalibSeasonTimeShift,1)    // T0 Sensor Calibration data
+};
+
+
+#endif
+
index 9c921e9..2aa6a5a 100644 (file)
@@ -13,6 +13,8 @@
 #pragma link C++ class  AliT0CalibLaserData+;
 #pragma link C++ class  AliT0QADataMakerRec+;
 #pragma link C++ class  AliT0RecoParam+;
+#pragma link C++ class  AliT0QARefData+;
+#pragma link C++ class  AliT0CalibSeasonTimeShift+;
 
 
 #endif
index 600d396..092f6b6 100644 (file)
@@ -1,8 +1,7 @@
 #-*- Mode: Makefile -*-
 # $Id$
 
-SRCS= AliT0Reconstructor.cxx AliT0Calibrator.cxx AliT0CalibLaserData.cxx AliT0QADataMakerRec.cxx AliT0RecoParam.cxx
-
+SRCS= AliT0Reconstructor.cxx AliT0Calibrator.cxx AliT0CalibLaserData.cxx AliT0QADataMakerRec.cxx AliT0RecoParam.cxx AliT0QARefData.cxx AliT0CalibSeasonTimeShift.cxx
 HDRS= $(SRCS:.cxx=.h)