]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCAL.h
Removing AliMUONTransientDigit and adding AliMUONObjectPair class (Laurent)
[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 //  holds all geant information of
11 //  materials, etc.
12 //                  
13 //*-- Author: Yves Schutz (SUBATECH)
14
15 // --- ROOT system ---
16
17 class TString ;
18 class TTask ;
19 class TFolder ;
20 class TRandom ; 
21 class TGraph;
22 class TF1;
23
24 // --- AliRoot header files ---
25 class AliRawReader;
26 #include "AliDetector.h"
27 #include "AliEMCALGeometry.h" 
28 #include "AliEMCALTrigger.h" 
29
30 class AliEMCAL : public AliDetector {
31
32  public:
33   
34   AliEMCAL(); 
35   AliEMCAL(const char* name, const char* title="");
36   AliEMCAL(const AliEMCAL& emcal);
37
38   virtual ~AliEMCAL() ; 
39   virtual void   AddHit(Int_t, Int_t*, Float_t *) {
40     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 )") ;  
41   }
42   virtual void  Copy(TObject & emcal) const 
43     { Copy(dynamic_cast<AliEMCAL&>(emcal)); }
44   virtual void  Copy(AliEMCAL & emcal) const; 
45   virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const;
46   virtual void  CreateMaterials() ;   
47   //  virtual void  
48   virtual void  Digits2Raw();
49   
50   using AliDetector::Raw2Digits;
51   virtual void  Raw2Digits(AliRawReader *reader);
52   
53   virtual void  FinishRun() {}                  
54   virtual AliEMCALGeometry * GetGeometry() const 
55     {return AliEMCALGeometry::GetInstance(GetTitle(),"") ;  }   
56   virtual void    Hits2SDigits();
57   virtual Int_t   IsVersion(void) const = 0 ;   
58   
59   virtual AliTriggerDetector* CreateTriggerDetector() const 
60     { return new AliEMCALTrigger(); }
61
62   // Raw Read Out
63   Double_t GetRawFormatCapa() const { return fgCapa ; }   
64   Double_t GetRawFormatHighCharge() const { return fHighCharge ; }  
65   Double_t GetRawFormatHighGain() const { return fHighGain ; }  
66   Double_t GetRawFormatHighLowGainFactor() const { return fHighLowGainFactor ; }  
67   Double_t GetRawFormatLowCharge() const { return ( fHighCharge *  fHighLowGainFactor ) ; }  
68   Double_t GetRawFormatLowGain() const { return ( fHighGain / fHighLowGainFactor ) ; }  
69   Int_t GetRawFormatLowGainOffset() const { return fLowGainOffset ; }  
70   Int_t GetRawFormatOrder() const { return fgOrder ; }   
71   Int_t GetRawFormatTimeBins() const { return fgkTimeBins ; }    
72   Double_t GetRawFormatTimeMax() const { return fgTimeMax ; }   
73   Double_t GetRawFormatTimePeak() const { return fgTimePeak ; }    
74   Double_t GetRawFormatTimeTrigger() const { return fgTimeTrigger ; }
75   Int_t GetRawFormatThreshold() const { return fgThreshold ; }       
76   Int_t GetRawFormatChannelsPerDDL() const { return fgChannelsPerDDL ; }       
77   static Double_t RawResponseFunctionMax(Double_t charge, Double_t gain) ;
78   Bool_t   RawSampledResponse(Double_t dtime, Double_t damp, Int_t * adcH, Int_t * adcL) const ; 
79   //  
80   virtual AliLoader* MakeLoader(const char* topfoldername);
81   virtual const TString Version() const {return TString(" ") ; }   
82   AliEMCAL & operator = (const AliEMCAL & /*rvalue*/)  {
83     Fatal("operator =", "not implemented") ;  return *this ; }
84
85 protected:
86   
87   static Double_t RawResponseFunction(Double_t *x, Double_t *par) ; 
88   void FitRaw(Bool_t lowGainFlag, TGraph * gLowGain, TGraph * gHighGain, TF1* signalF, Double_t & energy, Double_t & time) ;
89
90   void Init(void);  //initializes some params
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 fgkTimeBins = 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 fgThreshold;             // threshold
107   static Int_t fgChannelsPerDDL;        // number of channels per DDL
108
109   ClassDef(AliEMCAL,9) // Electromagnetic calorimeter (base class)
110     
111     } ;
112
113 #endif // ALIEMCAL_H