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