]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCAL.h
RawSampledResponse() made public because it is needed by the trigger (Gustavo)
[u/mrichter/AliRoot.git] / EMCAL / AliEMCAL.h
1 #ifndef ALIEMCAL_H
2 #define ALIEMCAL_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 //  Base Class for EMCAL     
10 //                  
11 //*-- Author: Yves Schutz (SUBATECH)
12
13 // --- ROOT system ---
14
15 class TString ;
16 class TTask ;
17 class TFolder ;
18 class TRandom ; 
19 class TGraph;
20 class TF1;
21
22 // --- AliRoot header files ---
23 class AliRawReader;
24 #include "AliDetector.h"
25 #include "AliEMCALGeometry.h" 
26 #include "AliEMCALTrigger.h" 
27
28 class AliEMCAL : public AliDetector {
29
30  public:
31   
32   AliEMCAL(); 
33   AliEMCAL(const char* name, const char* title="");
34   AliEMCAL(const AliEMCAL& emcal) : AliDetector(emcal) {
35     // cpy ctor: no implementation yet
36     // requested by the Coding Convention
37     Fatal("cpy ctor", "not implemented") ;  
38   }
39   virtual ~AliEMCAL() ; 
40   virtual void   AddHit(Int_t, Int_t*, Float_t *) {
41     Fatal("AddHit(Int_t, Int_t*, Float_t *", "not to be used: use AddHit( Int_t shunt, Int_t primary, Int_t track,Int_t id, Float_t *hits )") ;  
42   }
43   virtual void  Copy(TObject & emcal) const 
44     { Copy(dynamic_cast<AliEMCAL&>(emcal)); }
45   virtual void  Copy(AliEMCAL & emcal) const; 
46   virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const;
47   virtual void  CreateMaterials() ;   
48   //  virtual void  
49   virtual void  Digits2Raw();
50   
51   using AliDetector::Raw2Digits;
52   virtual void  Raw2Digits(AliRawReader *reader);
53   
54   virtual void  FinishRun() {}                  
55   virtual AliEMCALGeometry * GetGeometry() const 
56     {return AliEMCALGeometry::GetInstance(GetTitle(),"") ;  }   
57   virtual void    Hits2SDigits();
58   virtual Int_t   IsVersion(void) const = 0 ;   
59   
60   virtual AliTriggerDetector* CreateTriggerDetector() const 
61     { return new AliEMCALTrigger(); }
62   
63   // Raw Read Out
64   Double_t GetRawFormatCapa() const { return fgCapa ; }   
65   Double_t GetRawFormatHighCharge() const { return fHighCharge ; }  
66   Double_t GetRawFormatHighGain() const { return fHighGain ; }  
67   Double_t GetRawFormatHighLowGainFactor() const { return fHighLowGainFactor ; }  
68   Double_t GetRawFormatLowCharge() const { return ( fHighCharge *  fHighLowGainFactor ) ; }  
69   Double_t GetRawFormatLowGain() const { return ( fHighGain / fHighLowGainFactor ) ; }  
70   Int_t GetRawFormatLowGainOffset() const { return fLowGainOffset ; }  
71   Int_t GetRawFormatOrder() const { return fgOrder ; }   
72   Int_t GetRawFormatTimeBins() const { return fkTimeBins ; }    
73   Double_t GetRawFormatTimeMax() const { return fgTimeMax ; }   
74   Double_t GetRawFormatTimePeak() const { return fgTimePeak ; }    
75   Double_t GetRawFormatTimeTrigger() const { return fgTimeTrigger ; }
76   Int_t GetRawFormatDDLOffset() const { return fgDDLOffset ; }       
77   Int_t GetRawFormatThreshold() const { return fgThreshold ; }       
78   Int_t GetRawFormatChannelsPerDDL() const { return fgChannelsPerDDL ; }       
79   static Double_t RawResponseFunctionMax(Double_t charge, Double_t gain) ;
80   Bool_t   RawSampledResponse(const Double_t dtime, const Double_t damp, Int_t * adcH, Int_t * adcL) const ; 
81   //  
82   virtual AliLoader* MakeLoader(const char* topfoldername);
83   virtual const TString Version() const {return TString(" ") ; }   
84   AliEMCAL & operator = (const AliEMCAL & /*rvalue*/)  {
85     Fatal("operator =", "not implemented") ;  return *this ; }
86
87 protected:
88   
89   static Double_t RawResponseFunction(Double_t *x, Double_t *par) ; 
90   void FitRaw(Bool_t lowGainFlag, TGraph * gLowGain, TGraph * gHighGain, TF1* signalF, Double_t & energy, Double_t & time) ;
91
92   Int_t fBirkC0;    // constants for Birk's Law implementation
93   Double_t fBirkC1; // constants for Birk's Law implementation
94   Double_t fBirkC2; // constants for Birk's Law implementation
95
96   static Double_t fgCapa ;              // capacitor of the preamplifier for the raw RO signal
97   Double_t fHighCharge ;                // high charge (to convert energy to charge) for the raw RO signal
98   Double_t fHighGain ;                  // high gain for the raw RO signal
99   Double_t fHighLowGainFactor ;         // high to low gain factor for the raw RO signal
100   Int_t    fLowGainOffset ;             // to separate high from low gain in the DDL
101   static Int_t fgOrder ;                // order of the gamma function for the RO signal
102   static const Int_t fkTimeBins = 256 ; // number of sampling bins of the raw RO signal  
103   static Double_t fgTimeMax ;           // maximum sampled time of the raw RO signal                             
104   static Double_t fgTimePeak ;          // peaking time of the raw RO signal                                    
105   static Double_t fgTimeTrigger ;       // time of the trigger for the RO signal 
106   static Int_t fgDDLOffset;
107   static Int_t fgThreshold;
108   static Int_t fgChannelsPerDDL;
109
110   ClassDef(AliEMCAL,9) // Electromagnetic calorimeter (base class)
111     
112     } ;
113
114 #endif // ALIEMCAL_H