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