]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOS.h
Set geom parameters from CDB
[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  * Revision 1.63  2005/07/26 13:32:39  kharlov
11  * Restoring raw data fit from version of 29-Aug-2004
12  *
13  * Revision 1.62  2005/07/06 10:10:32  hristov
14  * Moving the functions used to initialize TF1 and TF2 to the pivate part of the class
15  *
16  * Revision 1.61  2005/05/28 12:10:07  schutz
17  * Copy constructor is corrected (by T.P.)
18  *
19  */
20
21
22 //_________________________________________________________________________
23 //  Base Class for PHOS     
24 //                  
25 //*-- Author: Laurent Aphecetche & Yves Schutz (SUBATECH)
26
27
28 // --- ROOT system ---
29 class TString ; 
30 class TTask ;
31 class TFolder ;
32 class TTree ; 
33 class TRandom ; 
34
35 // --- AliRoot header files ---
36 #include "AliDetector.h" 
37 #include "AliLog.h"
38 #include "AliPHOSGeometry.h" 
39
40 class AliPHOS : public AliDetector {
41
42 public:
43
44   AliPHOS() ;
45   AliPHOS(const char* name, const char* title="") ;  
46   AliPHOS(AliPHOS & phos) : AliDetector(phos) {
47     //Copy(*this) ; 
48     phos.Copy(*this);
49   }
50   virtual ~AliPHOS() ; 
51   virtual void   AddHit(Int_t, Int_t*, Float_t *) {
52     // do not use this definition but the one below
53     AliFatal(Form("do not use")) ;
54     
55   }
56   virtual void   AddHit( Int_t shunt, Int_t primary, Int_t track, 
57                          Int_t id, Float_t *hits ) = 0 ;   
58   virtual void Copy(TObject &phos)const; 
59   virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const;
60   virtual void  CreateMaterials() ;            
61   virtual void  Digits2Raw();
62   virtual void  FinishRun() {;}
63   virtual AliPHOSGeometry * GetGeometry() const 
64   {return AliPHOSGeometry::GetInstance(GetTitle(),"") ;  }
65   virtual void    Hits2SDigits();
66   virtual Int_t   IsVersion(void) const = 0 ;  
67   // Raw Read Out
68   Double_t GetRawFormatCapa() const { return fgCapa ; }   
69   Double_t GetRawFormatHighCharge() const { return fHighCharge ; }  
70   Double_t GetRawFormatHighGain() const { return fHighGain ; }  
71   Double_t GetRawFormatHighLowGainFactor() const { return fHighLowGainFactor ; }  
72   Double_t GetRawFormatLowCharge() const { return ( fHighCharge *  fHighLowGainFactor ) ; }  
73   Double_t GetRawFormatLowGain() const { return ( fHighGain / fHighLowGainFactor ) ; }  
74   Int_t GetRawFormatLowGainOffset() const { return fLowGainOffset ; }  
75   Int_t GetRawFormatOrder() const { return fgOrder ; }   
76   Int_t GetRawFormatTimeBins() const { return fkTimeBins ; }    
77   Double_t GetRawFormatTimeMax() const { return fgTimeMax ; }   
78   Double_t GetRawFormatTimePeak() const { return fgTimePeak ; }    
79   Double_t GetRawFormatTimeTrigger() const { return fgTimeTrigger ; }   
80   static Double_t RawResponseFunctionMax(Double_t charge, Double_t gain) ;
81   static Double_t RawResponseFunction(Double_t *x, Double_t *par) ; 
82   Bool_t   RawSampledResponse(Double_t dtime, Double_t damp, Int_t * adcH, Int_t * adcL) const ; 
83   //
84   virtual AliLoader* MakeLoader(const char* topfoldername);
85   virtual void    SetTreeAddress();   
86   virtual const TString Version() const {return TString(" ") ; } 
87   AliPHOS & operator = (const AliPHOS & /*rvalue*/)  {
88     Fatal("operator =", "not implemented") ; return *this ; }
89
90
91 protected:
92
93   
94   
95   static Double_t fgCapa ;              // capacitor of the preamplifier for the raw RO signal
96   Double_t fHighCharge ;                // high charge (to convert energy to charge) for the raw RO signal
97   Double_t fHighGain ;                  // high gain for the raw RO signal
98   Double_t fHighLowGainFactor ;         // high to low gain factor for the raw RO signal
99   Int_t    fLowGainOffset ;             // to separate high from low gain in the DDL
100   static Int_t fgOrder ;                // order of the gamma function for the RO signal
101   static const Int_t fkTimeBins = 256 ; // number of sampling bins of the raw RO signal  
102   static Double_t fgTimeMax ;           // maximum sampled time of the raw RO signal                             
103   static Double_t fgTimePeak ;          // peaking time of the raw RO signal                                    
104   static Double_t fgTimeTrigger ;       // time of the trigger for the RO signal 
105                                         
106   ClassDef(AliPHOS,5) // Photon Spectrometer Detector (base class)
107 } ;
108
109 #endif // ALIPHOS_H