]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSDigitizer.h
Partial redesign of identification bits and coding rule corrections
[u/mrichter/AliRoot.git] / PHOS / AliPHOSDigitizer.h
index 89d133f4d26459a55df406115e51b2cfd56f41ce..a48108294315c27b34da85a3fdb134b405b85a89 100644 (file)
 
 //_________________________________________________________________________
 //  Task Class for making SDigits in PHOS      
+// Class performs digitization of Summable digits (in the PHOS case this is just
+// sum of contributions of all primary particles into given cell). 
+// In addition it performs mixing of summable digits from different events.
 //                  
 //*-- Author: Dmitri Peressounko(SUBATECH & KI)
 
 
 // --- ROOT system ---
-#include "TTask.h"
 #include "TObjString.h"
+class TArrayI ;
+class TClonesArray ; 
+class TFile ; 
+
 // --- Standard library ---
 
 // --- AliRoot header files ---
-
+#include "AliDigitizer.h"
 class AliPHOSSDigitizer ;
+class AliRunDigitizer ;
 
-class AliPHOSDigitizer: public TTask {
+class AliPHOSDigitizer: public AliDigitizer {
 
 public:
   AliPHOSDigitizer() ;          // ctor
-  AliPHOSDigitizer(char *HeaderFile,char * SDigitsBrancheFile = 0) ; 
+  AliPHOSDigitizer(const char *headerFile, const char * name = "Default", const Bool_t toSplit = kFALSE ) ; 
+  AliPHOSDigitizer(AliRunDigitizer * ard) ;
+  AliPHOSDigitizer(const AliPHOSDigitizer & dtizer) 
+                  {( (AliPHOSDigitizer &)dtizer ).Copy(*this) ;} 
   virtual ~AliPHOSDigitizer() ;       
-  Bool_t  Combinator() ;                         // makes all desirable combination sig+Bg
-  void    Exec(Option_t *option);                // Does the job
-  void    Digitize(Option_t *option);            // Digitizes SDigits stored in fSDigits
-  Float_t GetPinNoise()     const { return fPinNoise;}
-  Float_t GetEMCThreshold() const { return fEMCDigitThreshold;}
-  Float_t GetCPVNoise()     const { return fCPVNoise ;}
-  Float_t GetCPVThreshold() const { return fCPVDigitThreshold ;}
-  Float_t GetPPSDNoise()    const { return fPPSDNoise ;}
-  Float_t GetPPSDThreshold()const { return fPPSDDigitThreshold ;}
-  void    MixWith(char* HeaderFile, Int_t isOutFile = 1, char* SDigitsFile =0) ; // Add another one file to mix
-  void    Print(Option_t* option) ;
-  void    SetPinNoise(Float_t PinNoise )         {fPinNoise = PinNoise;}
-  void    SetEMCThreshold(Float_t EMCThreshold)  {fEMCDigitThreshold = EMCThreshold;}
+
+  void    Digitize(const Int_t event) ;            // Make Digits from SDigits 
+  void    Exec(Option_t *option);                  // Supervising method
+
+  //CPV parameters
+  const Float_t GetCPVNoise()     const { return fCPVNoise ;}
+  const Float_t GetCPVThreshold() const { return fCPVDigitThreshold ;}
+  const Float_t GetCPVchannel()   const { return fADCchanelCpv; }
+  const Float_t GetCPVpedestal()  const { return fADCpedestalCpv; }
+
   void    SetCPVNoise(Float_t CPVNoise)          {fCPVNoise = CPVNoise;}
   void    SetCPVThreshold(Float_t CPVThreshold)  {fCPVDigitThreshold= CPVThreshold;}
-  void    SetPPSDNoise(Float_t PPSDNoise)        {fPPSDNoise = PPSDNoise;}
-  void    SetPPSDThreshold(Float_t PPSDThreshold){fPPSDDigitThreshold = PPSDThreshold;}
+  void    SetNCPVchannels(Int_t n)     { fNADCcpv = n; }
+  void    SetCPVchannel(Float_t width) { fADCchanelCpv = width; }
+  void    SetCPVpedestal(Float_t ped)  { fADCpedestalCpv = ped; }
+
+
+  //EMC parameters
+  const Float_t GetEMCThreshold() const { return fEMCDigitThreshold;}
+  const Float_t GetEMCchannel()   const { return fADCchanelEmc; }
+  const Float_t GetEMCpedestal()  const { return fADCpedestalEmc; }  
+  const Float_t GetPinNoise()     const { return fPinNoise;}
+  const Float_t GetTimeResolution() const { return fTimeResolution ; }
+
+  void   SetEMCThreshold(Float_t EMCThreshold)  {fEMCDigitThreshold = EMCThreshold;}
+  void   SetPinNoise(Float_t PinNoise )         {fPinNoise = PinNoise;}
+  void   SetNEMCchannels(Int_t n)      { fNADCemc = n; }
+  void   SetEMCchannel(Float_t width)  { fADCchanelEmc = width; }
+  void   SetEMCpedestal(Float_t ped)   { fADCpedestalEmc = ped ; }  
+  void   SetTimeResolution(Float_t res){ fTimeResolution = res ; }  
+
+  //General
+  const Int_t   GetDigitsInRun()  const { return fDigitsInRun ;}  
+  void    MixWith(const char* HeaderFile,const char* brname = 0) ; // Add another one file to mix
+  void    Print(Option_t* option)const ;
+  AliPHOSDigitizer & operator = (const AliPHOSDigitizer & rvalue)  {
+    // assignement operator requested by coding convention but not needed
+    Fatal("operator =", "not implemented") ;
+    return *this ; 
+  }
 
 private:
-  void   Init(Int_t isOutFile);                   
-  Bool_t ReadSDigits() ;            // Read sdigits for particular events
-  void   WriteDigits() ;            // Writes Digits for particular event
+
+  Bool_t  Init() ; 
+  void    InitParameters() ; 
+  void    PrintDigits(Option_t * option) ;
+  void    WriteDigits(Int_t evt) ;            // Writes Digits for particular event
+  Float_t TimeOfNoise(void) const;            // Calculate time signal generated by noise
+  //Calculate the time of crossing of the threshold by front edge
+  Float_t FrontEdgeTime(TClonesArray * ticks) const ; 
+  //Calculate digitized signal with gived ADC parameters
+  Int_t   DigitizeEnergy(Float_t energy, Int_t absId) ;
 
 private:
-  TClonesArray * fSDigitsFiles ;    // Names of sdigits branches
-  TClonesArray * fHeaderFiles ;     // Names of files with headers to merge
-  TString        fDigitsFile ;      // Name of the Digits Branch  
-  Int_t          fOutFileNumber ;   // Number of the header file into which Digits are written
-  TClonesArray * fSDigits ;         // ! Lists of SDigits 
-  TClonesArray * fDigits ;          // ! Final list of digits
-  AliPHOSSDigitizer * fSDigitizer ; // ! SDigitizer to extarct some digitizing parameters
-  Int_t   fNinputs ;                // Number of input files
-  Bool_t  fInitialized ;            // if background file already read?
-  TArrayI * fIevent ;               // events to read at the next ReadSDigits() call
-  TArrayI * fIeventMax ;            // Maximal number of events in each input file
+
+  Bool_t  fDefaultInit;             //! Says if the task was created by defaut ctor (only parameters are initialized)
+  Int_t fDigitsInRun ;              //! Total number of digits in one run
+
+  Int_t   fEmcCrystals ;            // Number of EMC crystalls in the given geometry
 
   Float_t fPinNoise ;               // Electronics noise in EMC
   Float_t fEMCDigitThreshold  ;     // Threshold for storing digits in EMC
+
   Float_t fCPVNoise ;               // Noise in CPV
   Float_t fCPVDigitThreshold  ;     // Threshold for storing digits in CPV
-  Float_t fPPSDNoise ;              // Noise in PPSD
-  Float_t fPPSDDigitThreshold ;     // Threshold for storing digits in PPSD
+
+
+  Float_t fTimeResolution ;         // Time resolution of FEE electronics
+  Float_t fTimeThreshold ;          // Threshold to start timing for given crystall
+  Float_t fTimeSignalLength ;       // Length of the timing signal 
+
+  Float_t fADCchanelEmc ;           // width of one ADC channel in GeV
+  Float_t fADCpedestalEmc ;         // value of the EMC ADC pedestal
+  Int_t   fNADCemc ;                // number of channels in EMC ADC
+
+  Float_t fADCchanelCpv ;           // width of one ADC channel in CPV units
+  Float_t fADCpedestalCpv ;         // value of the CPV ADC pedestal in CPV units
+  Int_t   fNADCcpv ;                // number of channels in CPV ADC
+
+  Bool_t  fToSplit ;                //! Do we work in the split mode
+  TFile * fSplitFile ;              //! file in which Digits will eventually be stored
 
 
   ClassDef(AliPHOSDigitizer,1)  // description