]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSDigitizer.h
cluster information
[u/mrichter/AliRoot.git] / PHOS / AliPHOSDigitizer.h
1 #ifndef ALIPHOSDigitizer_H
2 #define ALIPHOSDigitizer_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 //_________________________________________________________________________
9 //  Task Class for making SDigits in PHOS      
10 // Class performs digitization of Summable digits (in the PHOS case this is just
11 // sum of contributions of all primary particles into given cell). 
12 // In addition it performs mixing of summable digits from different events.
13 //                  
14 //*-- Author: Dmitri Peressounko(SUBATECH & KI)
15
16
17 // --- ROOT system ---
18 #include "TObjString.h"
19 class TArrayI ;
20 class TClonesArray ; 
21
22 // --- Standard library ---
23
24 // --- AliRoot header files ---
25 #include "AliDigitizer.h"
26 class AliPHOSSDigitizer ;
27 class AliRunDigitizer ;
28
29 class AliPHOSDigitizer: public AliDigitizer {
30
31 public:
32   AliPHOSDigitizer() ;          // ctor
33   AliPHOSDigitizer(const TString alirunFileNameFile, const TString eventFolderName = AliConfig::fgkDefaultEventFolderName) ; 
34   AliPHOSDigitizer(const AliPHOSDigitizer & dtizer) ;
35   AliPHOSDigitizer(AliRunDigitizer * manager) ;
36   virtual ~AliPHOSDigitizer() ;       
37
38   void    Digitize(const Int_t event) ;            // Make Digits from SDigits 
39   void    Exec(Option_t *option);                  // Supervising method
40
41   //CPV parameters
42   const Float_t GetCPVNoise()     const { return fCPVNoise ;}
43   const Float_t GetCPVThreshold() const { return fCPVDigitThreshold ;}
44   const Float_t GetCPVchannel()   const { return fADCchanelCpv; }
45   const Float_t GetCPVpedestal()  const { return fADCpedestalCpv; }
46
47   void    SetCPVNoise(Float_t CPVNoise)          {fCPVNoise = CPVNoise;}
48   void    SetCPVThreshold(Float_t CPVThreshold)  {fCPVDigitThreshold= CPVThreshold;}
49   void    SetNCPVchannels(Int_t n)     { fNADCcpv = n; }
50   void    SetCPVchannel(Float_t width) { fADCchanelCpv = width; }
51   void    SetCPVpedestal(Float_t ped)  { fADCpedestalCpv = ped; }
52
53
54   //EMC parameters
55   const Float_t GetEMCThreshold() const { return fEMCDigitThreshold;}
56   const Float_t GetEMCchannel()   const { return fADCchanelEmc; }
57   const Float_t GetEMCpedestal()  const { return fADCpedestalEmc; }  
58   const Float_t GetPinNoise()     const { return fPinNoise;}
59   const Float_t GetTimeResolution() const { return fTimeResolution ; }
60
61   void   SetEMCThreshold(Float_t EMCThreshold)  {fEMCDigitThreshold = EMCThreshold;}
62   void   SetPinNoise(Float_t PinNoise )         {fPinNoise = PinNoise;}
63   void   SetNEMCchannels(Int_t n)      { fNADCemc = n; }
64   void   SetEMCchannel(Float_t width)  { fADCchanelEmc = width; }
65   void   SetEMCpedestal(Float_t ped)   { fADCpedestalEmc = ped ; }  
66   void   SetEventFolderName(TString name) { fEventFolderName = name ; }
67   void   SetTimeResolution(Float_t res){ fTimeResolution = res ; }  
68
69   //General
70   const Int_t   GetDigitsInRun()  const { return fDigitsInRun ;}  
71   void    MixWith(const TString alirunFileName, 
72                   const TString eventFolderName = AliConfig::fgkDefaultEventFolderName) ; // Add another one file to mix
73   void    Print()const ;
74  
75   AliPHOSDigitizer & operator = (const AliPHOSDigitizer & rvalue)  {
76     // assignement operator requested by coding convention but not needed
77     Fatal("operator =", "not implemented") ;
78     return *this ; 
79   }
80
81 private:
82
83   virtual Bool_t Init() ; 
84   void    InitParameters() ; 
85   void    PrintDigits(Option_t * option) ;
86   void    Unload() ; 
87   void    WriteDigits() ;                     // Writes Digits for the current event
88   Float_t TimeOfNoise(void) const;            // Calculate time signal generated by noise
89
90   //Calculate the time of crossing of the threshold by front edge
91   Float_t FrontEdgeTime(TClonesArray * ticks) const ; 
92   //Calculate digitized signal with gived ADC parameters
93   Int_t   DigitizeEnergy(Float_t energy, Int_t absId) ;
94
95 private:
96
97   Bool_t  fDefaultInit;             //! Says if the task was created by defaut ctor (only parameters are initialized)
98   Int_t   fDigitsInRun ;            //! Total number of digits in one run
99   Bool_t  fInit ;                   //! To avoid overwriting existing files
100
101   Int_t   fInput ;                  // Number of files to merge
102   TString * fInputFileNames ;       //[fInput] List of file names to merge 
103   TString * fEventNames ;           //[fInput] List of event names to merge
104
105   Int_t   fEmcCrystals ;            // Number of EMC crystalls in the given geometry
106
107   Float_t fPinNoise ;               // Electronics noise in EMC
108   Float_t fEMCDigitThreshold  ;     // Threshold for storing digits in EMC
109
110   Float_t fCPVNoise ;               // Noise in CPV
111   Float_t fCPVDigitThreshold  ;     // Threshold for storing digits in CPV
112
113
114   Float_t fTimeResolution ;         // Time resolution of FEE electronics
115   Float_t fTimeThreshold ;          // Threshold to start timing for given crystall
116   Float_t fTimeSignalLength ;       // Length of the timing signal 
117
118   Float_t fADCchanelEmc ;           // width of one ADC channel in GeV
119   Float_t fADCpedestalEmc ;         // value of the EMC ADC pedestal
120   Int_t   fNADCemc ;                // number of channels in EMC ADC
121
122   Float_t fADCchanelCpv ;           // width of one ADC channel in CPV units
123   Float_t fADCpedestalCpv ;         // value of the CPV ADC pedestal in CPV units
124   Int_t   fNADCcpv ;                // number of channels in CPV ADC
125
126   TString fEventFolderName;         // skowron: name of EFN to read data from in stand alone mode
127   
128   ClassDef(AliPHOSDigitizer,2)  // description 
129
130 };
131
132
133 #endif // AliPHOSDigitizer_H