]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSRaw2Digits.cxx
Time of samples is read from raw data
[u/mrichter/AliRoot.git] / PHOS / AliPHOSRaw2Digits.cxx
index b7dc922a6755e778a039c17b695068e07f5f906d..1325a7f53a32e8ee7126222e87fe89d1c29ba6ef 100644 (file)
 
 /* $Id$ */
 
+/* History of cvs commits:
+ *
+ * $Log$
+ * Revision 1.12  2005/05/28 14:19:04  schutz
+ * Compilation warnings fixed by T.P.
+ *
+ */
+
 //_________________________________________________________________________
 // Class designed to convert raw data to aliroot format. We assume, that
 // prototype is situated in the center of 3 PHOS module and convert prototype
 
 // --- Standard library ---
 
-#include <unistd.h>
+#include <stdio.h>
 
 // --- AliRoot header files ---
 #include "AliPHOSDigit.h"
 #include "AliPHOSConTableDB.h"
 #include "AliPHOSBeamTestEvent.h"
 #include "AliPHOSRaw2Digits.h"
-#include "AliPHOSv1.h"
-#include "../EVGEN/AliGenBox.h"
 #include "AliRun.h"
 
 ClassImp(AliPHOSRaw2Digits)
   
-  
 //____________________________________________________________________________ 
-  AliPHOSRaw2Digits::AliPHOSRaw2Digits():TTask() 
+AliPHOSRaw2Digits::AliPHOSRaw2Digits() : 
+  fDigits(0),
+  fPHOSHeader(0),
+  fctdb(0),
+  fHeaderFile(0),
+  fDigitsFile(0),
+  fBeamEnergy(0.f),
+  fMaxPerFile(20000),
+  fEvent(0),
+  fStatus(0),
+  fInName(""),
+  fDebug(kFALSE),
+  fIsInitialized(kFALSE),
+  fMK1(0x0123CDEF),
+  fMK2(0x80708070),
+  fMK3(0x4321ABCD),
+  fMK4(0x80618061),
+  fCKW(0x4640E400)
 {
   //As one can easily see, this is constructor.
-  fInName="";  
-  fMK1 = 0x0123CDEF ;
-  fMK2 = 0x80708070 ;
-  fMK3 = 0x4321ABCD ;
-  fMK4 = 0x80618061 ;
-  fCKW = 0x4640E400 ;
-  fDebug = kFALSE;             //  Debug flag
-  fIsInitialized = kFALSE ;
   fTarget[0] = 0 ;
   fTarget[1] = 0 ;
   fTarget[2] = 0 ;
-  fDigits = 0 ;
-  fHeaderFile = 0 ;
-  fDigitsFile = 0 ;
-  fPHOSHeader =0 ;
-  fMaxPerFile = 20000 ;  //Maximal number of events in root file.
-  fEvent = 0 ;
-  fctdb = 0;
 }
+
 //____________________________________________________________________________ 
-  AliPHOSRaw2Digits::AliPHOSRaw2Digits(const char * filename):TTask("Default","") 
+AliPHOSRaw2Digits::AliPHOSRaw2Digits(const char * filename) : 
+  TTask("Default",""),
+  fDigits(0),
+  fPHOSHeader(0),
+  fctdb(0),
+  fHeaderFile(0),
+  fDigitsFile(0),
+  fBeamEnergy(0.f),
+  fMaxPerFile(20000),
+  fEvent(0),
+  fStatus(0),
+  fInName(filename),
+  fDebug(kFALSE),
+  fIsInitialized(kFALSE),
+  fMK1(0x0123CDEF),
+  fMK2(0x80708070),
+  fMK3(0x4321ABCD),
+  fMK4(0x80618061),
+  fCKW(0x4640E400)
 {
-  //this constructor should be normally used. Parameters: imput file 
-  fInName=filename;
-  TString outname("") ;
-  outname =fInName ;
+  //this constructor should be normally used. Parameters: input file 
+  TString outname(fInName) ;
   outname.ToLower() ;
   outname.ReplaceAll(".fz",".root") ;
   outname.ReplaceAll(".gz","") ;
-  
-  SetTitle(outname) ;
-
-  fMK1 = 0x0123CDEF ;
-  fMK2 = 0x80708070 ;
-  fMK3 = 0x4321ABCD ;
-  fMK4 = 0x80618061 ;
-  fCKW = 0x4640E400 ;
-  fDebug = kFALSE;             //  Debug flag
-  fIsInitialized = kFALSE ;
+  SetTitle(outname);
+
   fTarget[0] = 0 ;
   fTarget[1] = 0 ;
   fTarget[2] = 0 ;
-  fDigits = 0 ;
-  fPHOSHeader =0 ;
-  fHeaderFile = 0 ;
-  fDigitsFile = 0 ;
-  fMaxPerFile = 20000 ;
-  fEvent = 0 ;
-  fctdb = 0;
 }
+
 //____________________________________________________________________________ 
-AliPHOSRaw2Digits::AliPHOSRaw2Digits(AliPHOSRaw2Digits & r2d):TTask(r2d.GetName(), r2d.GetTitle()) 
+AliPHOSRaw2Digits::AliPHOSRaw2Digits(AliPHOSRaw2Digits & r2d) :
+  TTask(r2d.GetName(), r2d.GetTitle()),
+  fDigits(r2d.fDigits),
+  fPHOSHeader(r2d.fPHOSHeader),
+  fctdb(new AliPHOSConTableDB(*r2d.fctdb)),
+  fHeaderFile(new TFile(r2d.fHeaderFile->GetName(), "new" )),
+  fDigitsFile(new TFile(r2d.fDigitsFile->GetName(), "new" )),
+  fBeamEnergy(r2d.fBeamEnergy),
+  fMaxPerFile(r2d.fMaxPerFile),
+  fEvent(r2d.fEvent),
+  fStatus(r2d.fStatus),
+  fInName(r2d.fInName),
+  fDebug(kFALSE),
+  fIsInitialized(kFALSE),
+  fMK1(r2d.fMK1),
+  fMK2(r2d.fMK2),
+  fMK3(r2d.fMK3),
+  fMK4(r2d.fMK4),
+  fCKW(r2d.fCKW)
 {
-  fInName=r2d.fInName ;
-
-  fMK1 =  r2d.fMK1 ;
-  fMK2 =  r2d.fMK2 ;
-  fMK3 =  r2d.fMK3 ;
-  fMK4 =  r2d.fMK4 ;
-  fCKW =  r2d.fCKW ;
-  fDebug =  kFALSE;             //  Debug flag
-  fIsInitialized =  kFALSE ;
+  // cpy ctor. wrong. because dtor can delete fDigits twice (or n times you copy AliPHOSRaw2Digits)
+  //because fHeaderFile and fDigitsFile will recreate existing files etc.
   fTarget[0] = r2d.fTarget[0] ;
   fTarget[1] = r2d.fTarget[1] ;
   fTarget[2] = r2d.fTarget[2] ;
-  fDigits = r2d.fDigits ;
-  fPHOSHeader = r2d.fPHOSHeader  ;
-  fHeaderFile = new TFile( (r2d.fHeaderFile)->GetName(), "new" ) ;
-  fDigitsFile = new TFile( (r2d.fDigitsFile)->GetName(), "new" ) ;
-  fMaxPerFile = r2d.fMaxPerFile ;
-  fEvent = r2d.fEvent ;
-  fctdb =  new AliPHOSConTableDB( *(r2d.fctdb) ) ;
 }
 
 //____________________________________________________________________________ 
@@ -167,7 +180,7 @@ AliPHOSRaw2Digits::~AliPHOSRaw2Digits()
   
 }
 //____________________________________________________________________________ 
-void AliPHOSRaw2Digits::Exec(Option_t * option){
+void AliPHOSRaw2Digits::Exec(const Option_t *){
   //This is steering method performing all the conversion
 
   if(!fIsInitialized) //need initialization
@@ -192,7 +205,7 @@ Bool_t AliPHOSRaw2Digits::Init(void){
 
 }
 //____________________________________________________________________________ 
-Bool_t AliPHOSRaw2Digits::StartRootFiles(void ){
+Bool_t AliPHOSRaw2Digits::StartRootFiles(void ) const {
 //   //Create PHOS geometry, sets magnetic field to zero, 
 //   //create Generator - to store target position, 
 //   //opens out file, creates TreeE 
@@ -634,7 +647,7 @@ void AliPHOSRaw2Digits::WriteDigits(void){
   gAlice->TreeE()->Fill();
 }
 //____________________________________________________________________________ 
-void AliPHOSRaw2Digits::Print(Option_t * option)const{
+void AliPHOSRaw2Digits::Print(const Option_t *)const{
   //prints current configuration and status.
 
   printf("----------AliPHOSRaw2Digits---------- \n") ;