]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSSDigitizer.h
Improved the mechanism to divert SDigits into a separate file.
[u/mrichter/AliRoot.git] / PHOS / AliPHOSSDigitizer.h
1 #ifndef ALIPHOSSDigitizer_H
2 #define ALIPHOSSDigitizer_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 //_________________________________________________________________________
9 //  Task Class for making SDigits in PHOS      
10 // A Summable Digits is the sum of all hits originating 
11 // from one primary in one active cell
12 //*--
13 //*-- Author: Dmitri Peressounko(SUBATECH & KI)
14
15
16 // --- ROOT system ---
17 #include "TTask.h"
18 #include "TString.h"
19 class TFile ; 
20
21 // --- Standard library ---
22
23 // --- AliRoot header files ---
24
25 class AliPHOSSDigitizer: public TTask {
26
27 public:
28   AliPHOSSDigitizer() ;          // ctor
29   AliPHOSSDigitizer(const char* HeaderFile,const char *SdigitsTitle = "Default") ; 
30   virtual ~AliPHOSSDigitizer() ; // dtor
31
32   Float_t  Calibrate(Int_t amp)const {return (amp - fA)/fB ; }
33   Int_t    Digitize(Float_t Energy)const { return (Int_t ) ( fA + Energy*fB); }
34   virtual void  Exec(Option_t *option); 
35   const char *   GetSDigitsBranch()const{return GetName();}  
36   const Int_t    GetSDigitsInRun() const {return fSDigitsInRun ;}  
37   virtual void Print(Option_t* option) const ;
38   void SetSDigitsBranch(const char * title ) ;
39   void SetSplitFile(const TString splitFileName = "PHOS.SDigits.root") ;
40   void UseHitsFrom(const char * filename) ;      
41   Bool_t operator == (const AliPHOSSDigitizer & sd) const ;
42
43 private:
44   void     Init() ;
45   void     PrintSDigits(Option_t * option) ;
46
47 private:
48
49   Float_t fA ;              // Pedestal parameter
50   Float_t fB ;              // Slope Digitizition parameters
51   Float_t fPrimThreshold ;  // To store primari if Elos > threshold
52   Int_t fSDigitsInRun ;     //! Total number of sdigits in one run
53   TFile * fSplitFile ;      //! file in which SDigits will eventually be stored
54
55   ClassDef(AliPHOSSDigitizer,1)  // description 
56
57 };
58
59 #endif // AliPHOSSDigitizer_H