]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSCalibrator.cxx
Simulation of RAW data applies real mapping (B.Polichtchouk)
[u/mrichter/AliRoot.git] / PHOS / AliPHOSCalibrator.cxx
index 29f5de610f985b0eaf75553a6fee376680e2e4c9..950dc9a113d1bcd801ea0f7d80778412fa4a46ab 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
+/* $Id$ */
+
+/* History of cvs commits:
+ *
+ * $Log$
+ * 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"
 
+#ifdef ALI_DATE
+#include "event.h"
+#else
+#define PHYSICS_EVENT 7
+#endif
+
 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,8 +331,8 @@ 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 ;
@@ -401,8 +453,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) ;
@@ -681,7 +733,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")) ;