]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSCalibrator.cxx
Updated geometry including v11Hybrid ITS geometry
[u/mrichter/AliRoot.git] / PHOS / AliPHOSCalibrator.cxx
index 29f5de610f985b0eaf75553a6fee376680e2e4c9..a33b6a5e687d45666fb2f2fea16673c2ff4c31a9 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
+/* $Id$ */
+
+/* History of cvs commits:
+ *
+ * $Log$
+ * Revision 1.12  2006/09/07 18:31:08  kharlov
+ * Effective c++ corrections (T.Pocheptsov)
+ *
+ * Revision 1.11  2006/01/13 16:59:39  kharlov
+ * Rename classes to read raw data 2004
+ *
+ * Revision 1.10  2005/05/28 14:19:04  schutz
+ * Compilation warnings fixed by T.P.
+ *
+ */
 
 //_________________________________________________________________________
 // Class to calculate calibration parameters  from beam tests etc.
 #include "AliPHOSCalibrationData.h"
 #include "AliPHOSCalibrator.h"
 #include "AliPHOSConTableDB.h"
-#include "AliPHOSRawReaderDate.h"
-#include "AliPHOSRawStream.h"
+#include "AliRawReaderDate.h"
+#include "AliPHOSRawStream2004.h"
 #include "AliPHOSDigit.h"
 
+#include "AliRawEventHeaderBase.h"
+
 ClassImp(AliPHOSCalibrator)
 
 
 //____________________________________________________________________________ 
-  AliPHOSCalibrator::AliPHOSCalibrator():TTask("AliPHOSCalibrator","Default") 
+AliPHOSCalibrator::AliPHOSCalibrator() :
+  TTask("AliPHOSCalibrator","Default"),
+  fRunList(0),
+  fPedHistos(0),
+  fGainHistos(0),
+  fhPedestals(0),
+  fhPedestalsWid(0),
+  fhGains(0),
+  fhGainsWid(0),
+  fctdb(0),
+  fConTableDB("Beamtest2002"),
+  fConTableDBFile("ConTableDB.root"),
+  fBeamEnergy(0),
+  fGainAcceptCorr(0),
+  fAcceptCorr(0),
+  fGainMax(0),
+  fNGainBins(0),
+  fNch(0),
+  fNChan(0)  
 {
   //Default constuctor for root. Normally should not be used
-  fRunList=0 ;
-  fBeamEnergy = 0. ;
-  fNch = 0 ;
-  fPedHistos = 0 ;
-  fGainHistos = 0 ;
-  fhPedestals = 0 ;
-  fhPedestalsWid = 0 ;
-  fctdb = 0 ;
-  fConTableDB = "Beamtest2002" ;
-  fConTableDBFile = "ConTableDB.root" ;
 }
+
 //____________________________________________________________________________ 
 AliPHOSCalibrator::AliPHOSCalibrator(const char* file, const char* title):
-  TTask("AliPHOSCalibrator",title) 
+  TTask("AliPHOSCalibrator",title),
+  fRunList(new TList),
+  fPedHistos(0),
+  fGainHistos(0),
+  fhPedestals(0),
+  fhPedestalsWid(0),
+  fhGains(0),
+  fhGainsWid(0),
+  fctdb(0),
+  fConTableDB("Beamtest2002"),
+  fConTableDBFile("ConTableDB.root"),
+  fBeamEnergy(10.),
+  fGainAcceptCorr(5),
+  fAcceptCorr(10),
+  fGainMax(0.1),
+  fNGainBins(100),
+  fNch(0),
+  fNChan(100)
+
 { 
   //Constructor which should normally be used.
   //file: path/galice.root  - header file
   //title: branch name of PHOS reconstruction (e.g. "Default")
-
-  fRunList = new TList() ;
-  fRunList->SetOwner() ;
-  fRunList->Add(new TObjString(file)) ;
-  fNch = 0 ;
-  fBeamEnergy = 10. ;
-
-  fNChan  = 100 ;  
-  fGainMax = 0.1 ;
-  fNGainBins= 100 ;
-  fAcceptCorr = 10 ;     //Maximal deviation from mean, considered as normal 
-
-  fGainAcceptCorr = 5 ;  //Factor for gain deviation
-  fPedHistos = 0 ;
-  fGainHistos = 0 ;
-  fhPedestals = 0 ;
-  fhPedestalsWid = 0 ;
-  fctdb = 0 ;
-  fConTableDB = "Beamtest2002" ;
-  fConTableDBFile = "ConTableDB.root" ;
+  fRunList->SetOwner();
+  fRunList->Add(new TObjString(file));
+}
+
+//____________________________________________________________________________ 
+AliPHOSCalibrator::AliPHOSCalibrator(const AliPHOSCalibrator & ctor) : 
+  TTask(ctor),
+  fRunList(0),
+  fPedHistos(0),
+  fGainHistos(0),
+  fhPedestals(0),
+  fhPedestalsWid(0),
+  fhGains(0),
+  fhGainsWid(0),
+  fctdb(0),
+  fConTableDB("Beamtest2002"),
+  fConTableDBFile("ConTableDB.root"),
+  fBeamEnergy(0),
+  fGainAcceptCorr(0),
+  fAcceptCorr(0),
+  fGainMax(0),
+  fNGainBins(0),
+  fNch(0),
+  fNChan(0)  
+{
+  // cpy ctor: no implementation yet
+  // requested by the Coding Convention
+  Fatal("cpy ctor", "not implemented") ;
 }
 
 //____________________________________________________________________________ 
@@ -279,15 +330,15 @@ void AliPHOSCalibrator::ScanPedestals(Option_t * option )
       printf("Processing file %s \n ",file->String().Data()) ;
     
     //Now open data file
-    AliPHOSRawReaderDate *rawReader = new AliPHOSRawReaderDate(file->String().Data()) ; 
-    AliPHOSRawStream     *rawStream = new AliPHOSRawStream(rawReader) ;
+    AliRawReaderDate *rawReader = new AliRawReaderDate(file->String().Data()) ; 
+    AliPHOSRawStream2004     *rawStream = new AliPHOSRawStream2004(rawReader) ;
     rawStream->SetConTableDB(fctdb) ;
     TClonesArray * digits = new TClonesArray("AliPHOSDigit",300) ;
     Int_t nevents=0 ;
     //Scan all event in file
     while(rawReader->NextEvent()){
       //Is it PHYSICAL event
-      if(rawReader->GetType() == PHYSICS_EVENT){
+      if(rawReader->GetType() == AliRawEventHeaderBase::kPhysicsEvent){
        nevents++ ;
        if(rawStream->ReadDigits(digits)){
          if(rawStream->IsPEDevent()){
@@ -401,8 +452,8 @@ void AliPHOSCalibrator::ScanGains(Option_t * option)
   TObjString * file ;
   while((file = static_cast<TObjString *>(next()))){
     //Now open data file
-    AliPHOSRawReaderDate *rawReader = new AliPHOSRawReaderDate(file->String().Data()) ; 
-    AliPHOSRawStream     *rawStream = new AliPHOSRawStream(rawReader) ;
+    AliRawReaderDate *rawReader = new AliRawReaderDate(file->String().Data()) ; 
+    AliPHOSRawStream2004     *rawStream = new AliPHOSRawStream2004(rawReader) ;
     rawStream->SetConTableDB(fctdb) ;
   
     TClonesArray * digits = new TClonesArray("AliPHOSDigit",300) ;
@@ -410,7 +461,7 @@ void AliPHOSCalibrator::ScanGains(Option_t * option)
     //Scan all event in file
     while(rawReader->NextEvent()){
       //Is it PHYSICAL event
-      if(rawReader->GetType() == PHYSICS_EVENT){
+      if(rawReader->GetType() == AliRawEventHeaderBase::kPhysicsEvent){
        if(rawStream->ReadDigits(digits)){
          //Test trigger
          if(rawStream->IsNELevent() || rawStream->IsWELevent()){
@@ -681,7 +732,7 @@ void AliPHOSCalibrator::WriteGains(const char * version)
   cmngr->WriteData(gains) ;
 }      
 //_____________________________________________________________________________
-void AliPHOSCalibrator::Print()const 
+void AliPHOSCalibrator::Print(const Option_t *)const 
 {
   // prints everything
   AliInfo(Form("--------------PHOS Calibrator-----------------\n")) ;