]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALDigitizer.h
Trigger maximum amplitude patch value and postion stored in ESDs, possibility to...
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALDigitizer.h
1 #ifndef ALIEMCALDigitizer_H
2 #define ALIEMCALDigitizer_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 Digits in EMCAL      
10 //                  
11 //*-- Author: Sahal Yacoob (LBL)
12 // based on : AliPHOSDigit
13 // July     2003 Yves Schutz : NewIO 
14 // November 2003 Aleksei Pavlinov : Shish-Kebab geometry 
15 //_________________________________________________________________________ 
16
17
18 // --- ROOT system ---
19 #include "TObjString.h"
20 class TArrayI ;
21 class TClonesArray ; 
22 class TList;
23 class TBrowser;
24
25 // --- Standard library ---
26
27 // --- AliRoot header files ---
28 #include "AliDigitizer.h"
29 #include "AliConfig.h"
30 #include "AliEMCALCalibData.h"
31 class AliEMCALSDigitizer ;
32 class AliRunDigitizer ;
33
34 class AliEMCALDigitizer: public AliDigitizer {
35
36 public:
37   AliEMCALDigitizer() ;          // ctor
38   AliEMCALDigitizer(TString alirunFileNameFile, TString eventFolderName = AliConfig::GetDefaultEventFolderName()) ;  
39   AliEMCALDigitizer(const AliEMCALDigitizer & dtizer) ;
40   AliEMCALDigitizer(AliRunDigitizer * manager) ;
41   virtual ~AliEMCALDigitizer() ;       
42
43   void    Digitize(Int_t event);          // Make Digits from SDigits stored in fSDigits
44   void    Exec(Option_t *option);               // Supervising method
45
46   Float_t GetDigitThreshold() const { return fDigitThreshold;}
47   Float_t GetPedestal()       const { return fPedestal; }
48   Float_t GetPinNoise()       const { return fPinNoise;}
49   Float_t GetSlope()          const { return fSlope; }
50   Float_t GetTimeResolution() const { return fTimeResolution ; }
51   Float_t GetECAchannel()     const { return fADCchannelEC ; }
52   Float_t GetECApedestal()    const { return fADCpedestalEC ; }
53  void   SetEventRange(Int_t first=0, Int_t last=-1) {fFirstEvent=first; fLastEvent=last; }
54   void    SetDigitThreshold(Float_t EMCThreshold)  {fDigitThreshold = EMCThreshold;}
55   void    SetPinNoise(Float_t PinNoise )         {fPinNoise = PinNoise;}
56
57   //General
58   Int_t   GetDigitsInRun()  const { return fDigitsInRun; } 
59   void  MixWith(TString alirunFileName, 
60                 TString eventFolderName = AliConfig::GetDefaultEventFolderName()) ; // Add another one file to mix
61   void  Print(Option_t* option="") const ;
62   void  Print1(Option_t * option); // *MENU*
63  
64   AliEMCALDigitizer & operator = (const AliEMCALDigitizer & /*rvalue*/)  {
65     // assignement operator requested by coding convention but not needed
66    Fatal("operator =", "not implemented") ;  
67    return *this ; 
68   }
69
70   virtual void Browse(TBrowser* b);
71   // hists
72   void   SetControlHists(Int_t var=0) {fControlHists=var;}
73   Int_t  GetControlHist() const {return fControlHists;}
74   TList *GetListOfHists() {return fHists;}
75   TList* BookControlHists(int var=0);
76   void   SaveHists(const char* name="RF/TRD1/Digitizations/DigiVar?",
77   Bool_t kSingleKey=kTRUE, const char* opt="RECREATE"); // *MENU*
78
79 private:
80
81   Bool_t  Init();                   
82   void    InitParameters() ; 
83   void    PrintDigits(Option_t * option) ;
84   void    Unload() ; 
85   void    WriteDigits() ;         // Writes Digits the current event
86   Float_t TimeOfNoise(void) ;     // Calculate time signal generated by noise
87
88   //Calculate the time of crossing of the threshold by front edge
89   Float_t FrontEdgeTime(TClonesArray * ticks) ;
90   Int_t   DigitizeEnergy(Float_t energy, Int_t AbsId) ;
91
92 private:
93   
94   Bool_t  fDefaultInit;           //! Says if the task was created by defaut ctor (only parameters are initialized)
95   Int_t   fDigitsInRun ;          //! Total number of digits in one run
96   Bool_t  fInit ;                 //! To avoid overwriting existing files
97
98   Int_t   fInput ;                // Number of files to merge
99   TString * fInputFileNames ;     //[fInput] List of file names to merge 
100   TString * fEventNames ;         //[fInput] List of event names to merge
101
102   Float_t fDigitThreshold  ;      // Threshold for storing digits in EMC
103   Int_t   fMeanPhotonElectron ;   // number of photon electrons per GeV deposited energy 
104   Float_t fPedestal ;             // Calibration parameters 
105   Float_t fSlope ;                // read from SDigitizer
106   Float_t fPinNoise ;             // Electronics noise in EMC
107   Float_t fTimeResolution ;       // Time resolution of FEE electronics
108   Float_t fTimeThreshold ;        // Threshold to start timing for given crystall
109   Float_t fTimeSignalLength ;     // Length of the timing signal 
110   Float_t fADCchannelEC ;         // width of one ADC channel in EC section (GeV)
111   Float_t fADCpedestalEC ;        // pedestal for one ADC channel
112   Int_t   fNADCEC ;               // number of channels in EC section ADC
113
114   TString fEventFolderName;         // skowron: name of EFN to read data from in stand alone mode
115   Int_t   fFirstEvent;        // first event to process
116   Int_t   fLastEvent;         // last  event to process
117   // Control hists
118   Int_t   fControlHists;          //!
119   TList  *fHists;                 //!
120   AliEMCALCalibData * fCalibData; //Calibration data pointer
121
122   ClassDef(AliEMCALDigitizer,6)  // description 
123 };
124
125
126 #endif // AliEMCALDigitizer_H