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