]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCAL.h
updates to read raw data format and convert to digits
[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 class AliEMCAL : public AliDetector {
27
28  public:
29
30   AliEMCAL(); 
31   AliEMCAL(const char* name, const char* title="");
32   AliEMCAL(const AliEMCAL& emcal) : AliDetector(emcal) {
33     // cpy ctor: no implementation yet
34     // requested by the Coding Convention
35     Fatal("cpy ctor", "not implemented") ;  
36   }
37   virtual ~AliEMCAL() ; 
38   virtual void   AddHit(Int_t, Int_t*, Float_t *) {
39     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 )") ;  
40   }
41   virtual void  Copy(TObject & emcal) const 
42     { Copy(dynamic_cast<AliEMCAL&>(emcal)); }
43   virtual void  Copy(AliEMCAL & emcal) const; 
44   virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const;
45   virtual void  CreateMaterials() ;   
46   //  virtual void  
47   virtual void  Digits2Raw();
48   virtual void  Raw2Digits(AliRawReader *reader);
49   virtual void  FinishRun() {}                  
50   virtual AliEMCALGeometry * GetGeometry() const 
51   {return AliEMCALGeometry::GetInstance(GetTitle(),"") ;  }   
52   virtual void    Hits2SDigits();
53   virtual Int_t   IsVersion(void) const = 0 ;   
54   // Raw Read Out
55   Double_t GetRawFormatCapa() const { return fgCapa ; }   
56   Double_t GetRawFormatHighCharge() const { return fHighCharge ; }  
57   Double_t GetRawFormatHighGain() const { return fHighGain ; }  
58   Double_t GetRawFormatHighLowGainFactor() const { return fHighLowGainFactor ; }  
59   Double_t GetRawFormatLowCharge() const { return ( fHighCharge *  fHighLowGainFactor ) ; }  
60   Double_t GetRawFormatLowGain() const { return ( fHighGain / fHighLowGainFactor ) ; }  
61   Int_t GetRawFormatLowGainOffset() const { return fLowGainOffset ; }  
62   Int_t GetRawFormatOrder() const { return fgOrder ; }   
63   Int_t GetRawFormatTimeBins() const { return fkTimeBins ; }    
64   Double_t GetRawFormatTimeMax() const { return fgTimeMax ; }   
65   Double_t GetRawFormatTimePeak() const { return fgTimePeak ; }    
66   Double_t GetRawFormatTimeTrigger() const { return fgTimeTrigger ; }
67   Int_t GetRawFormatDDLOffset() const { return fgDDLOffset ; }       
68   Int_t GetRawFormatThreshold() const { return fgThreshold ; }       
69   Int_t GetRawFormatChannelsPerDDL() const { return fgChannelsPerDDL ; }       
70   static Double_t RawResponseFunctionMax(Double_t charge, Double_t gain) ;
71   //  
72   virtual AliLoader* MakeLoader(const char* topfoldername);
73   virtual const TString Version() const {return TString(" ") ; }   
74   AliEMCAL & operator = (const AliEMCAL & /*rvalue*/)  {
75     Fatal("operator =", "not implemented") ;  return *this ; }
76
77 protected:
78   
79   static Double_t RawResponseFunction(Double_t *x, Double_t *par) ; 
80   Bool_t   RawSampledResponse(const Double_t dtime, const Double_t damp, Int_t * adcH, Int_t * adcL) const ; 
81   void FitRaw(Bool_t lowGainFlag, TGraph * gLowGain, TGraph * gHighGain, TF1* signalF, Double_t & energy, Double_t & time) ;
82
83   Int_t fBirkC0;    // constants for Birk's Law implementation
84   Double_t fBirkC1; // constants for Birk's Law implementation
85   Double_t fBirkC2; // constants for Birk's Law implementation
86
87   static Double_t fgCapa ;              // capacitor of the preamplifier for the raw RO signal
88   Double_t fHighCharge ;                // high charge (to convert energy to charge) for the raw RO signal
89   Double_t fHighGain ;                  // high gain for the raw RO signal
90   Double_t fHighLowGainFactor ;         // high to low gain factor for the raw RO signal
91   Int_t    fLowGainOffset ;             // to separate high from low gain in the DDL
92   static Int_t fgOrder ;                // order of the gamma function for the RO signal
93   static const Int_t fkTimeBins = 256 ; // number of sampling bins of the raw RO signal  
94   static Double_t fgTimeMax ;           // maximum sampled time of the raw RO signal                             
95   static Double_t fgTimePeak ;          // peaking time of the raw RO signal                                    
96   static Double_t fgTimeTrigger ;       // time of the trigger for the RO signal 
97   static Int_t fgDDLOffset;
98   static Int_t fgThreshold;
99   static Int_t fgChannelsPerDDL;
100
101   ClassDef(AliEMCAL,9) // Electromagnetic calorimeter (base class)
102     
103     } ;
104
105 #endif // ALIEMCAL_H