]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOS.h
bd4e93dc5087563265d35e0027099237d247de85
[u/mrichter/AliRoot.git] / PHOS / AliPHOS.h
1 #ifndef ALIPHOS_H
2 #define ALIPHOS_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice     */
5 /* $Id$ */
6
7 /* History of cvs commits:
8  *
9  * $Log$
10  */
11
12
13 //_________________________________________________________________________
14 //  Base Class for PHOS     
15 //                  
16 //*-- Author: Laurent Aphecetche & Yves Schutz (SUBATECH)
17
18
19 // --- ROOT system ---
20 class TString ; 
21 class TTask ;
22 class TFolder ;
23 class TTree ; 
24 class TRandom ; 
25
26 // --- AliRoot header files ---
27 #include "AliDetector.h" 
28 #include "AliLog.h"
29 #include "AliPHOSGeometry.h" 
30
31 class AliPHOS : public AliDetector {
32
33 public:
34
35   AliPHOS() ;
36   AliPHOS(const char* name, const char* title="") ;  
37   AliPHOS(AliPHOS & phos) : AliDetector(phos) {
38     //Copy(*this) ; 
39     phos.Copy(*this);
40   }
41   virtual ~AliPHOS() ; 
42   virtual void   AddHit(Int_t, Int_t*, Float_t *) {
43     // do not use this definition but the one below
44     AliFatal(Form("do not use")) ;
45     
46   }
47   virtual void   AddHit( Int_t shunt, Int_t primary, Int_t track, 
48                          Int_t id, Float_t *hits ) = 0 ;   
49   virtual void Copy(TObject &phos)const; 
50   virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const;
51   virtual void  CreateMaterials() ;            
52   virtual void  Digits2Raw();
53   virtual void  FinishRun() {;}
54   virtual AliPHOSGeometry * GetGeometry() const 
55   {return AliPHOSGeometry::GetInstance(GetTitle(),"") ;  }
56   virtual void    Hits2SDigits();
57   virtual Int_t   IsVersion(void) const = 0 ;  
58   // Raw Read Out
59   Double_t GetRawFormatCapa() const { return fgCapa ; }   
60   Double_t GetRawFormatHighCharge() const { return fHighCharge ; }  
61   Double_t GetRawFormatHighGain() const { return fHighGain ; }  
62   Double_t GetRawFormatHighLowGainFactor() const { return fHighLowGainFactor ; }  
63   Double_t GetRawFormatLowCharge() const { return ( fHighCharge *  fHighLowGainFactor ) ; }  
64   Double_t GetRawFormatLowGain() const { return ( fHighGain / fHighLowGainFactor ) ; }  
65   Int_t GetRawFormatLowGainOffset() const { return fLowGainOffset ; }  
66   Int_t GetRawFormatOrder() const { return fgOrder ; }   
67   Int_t GetRawFormatTimeBins() const { return fkTimeBins ; }    
68   Double_t GetRawFormatTimeMax() const { return fgTimeMax ; }   
69   Double_t GetRawFormatTimePeak() const { return fgTimePeak ; }    
70   Double_t GetRawFormatTimeTrigger() const { return fgTimeTrigger ; }   
71   static Double_t RawResponseFunction(Double_t *x, Double_t *par) ; 
72   static Double_t RawResponseFunctionMax(Double_t charge, Double_t gain) ;
73   //
74   virtual AliLoader* MakeLoader(const char* topfoldername);
75   virtual void    SetTreeAddress();   
76   virtual const TString Version() const {return TString(" ") ; } 
77   AliPHOS & operator = (const AliPHOS & /*rvalue*/)  {
78     Fatal("operator =", "not implemented") ; return *this ; }
79
80
81 protected:
82
83   Bool_t   RawSampledResponse(const Double_t dtime, const Double_t damp, Int_t * adcH, Int_t * adcL) const ; 
84   
85   
86   static Double_t fgCapa ;              // capacitor of the preamplifier for the raw RO signal
87   Double_t fHighCharge ;                // high charge (to convert energy to charge) for the raw RO signal
88   Double_t fHighGain ;                  // high gain for the raw RO signal
89   Double_t fHighLowGainFactor ;         // high to low gain factor for the raw RO signal
90   Int_t    fLowGainOffset ;             // to separate high from low gain in the DDL
91   static Int_t fgOrder ;                // order of the gamma function for the RO signal
92   static const Int_t fkTimeBins = 256 ; // number of sampling bins of the raw RO signal  
93   static Double_t fgTimeMax ;           // maximum sampled time of the raw RO signal                             
94   static Double_t fgTimePeak ;          // peaking time of the raw RO signal                                    
95   static Double_t fgTimeTrigger ;       // time of the trigger for the RO signal 
96                                         
97   ClassDef(AliPHOS,5) // Photon Spectrometer Detector (base class)
98 } ;
99
100 #endif // ALIPHOS_H