]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOFSDigitizer.h
Sample program for using the simple fast cluster finder.
[u/mrichter/AliRoot.git] / TOF / AliTOFSDigitizer.h
1 #ifndef ALITOFSDigitizer_H
2 #define ALITOFSDigitizer_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6
7 //_________________________________________________________________________
8 //  Task Class for making SDigits in TOF      
9 //                  
10 //-- Author: F. Pierella
11
12
13 #include "TTask.h"
14 #include "TString.h"
15 #include "AliTOF.h"
16 #include "AliDetector.h"
17
18 class TF1;
19
20 class AliTOFSDigitizer: public TTask {
21
22 public:
23   AliTOFSDigitizer() ;          // ctor
24   AliTOFSDigitizer(char* HeaderFile, char *SdigitsFile = 0) ; 
25
26   virtual ~AliTOFSDigitizer() ; // dtor
27
28 //  char *GetSDigitsFile() const {return const_cast<char*>(fSDigitsFile.Data());}  
29   const char *GetSDigitsFile() const {return fSDigitsFile.Data();}  
30   virtual void  Exec(Option_t *option); 
31   void  SetNEvents(Int_t Nevents) {fNevents = Nevents;}
32   Int_t GetNEvents() const {return fNevents;}
33   void SetSDigitsFile(char * file ) ;
34   void InitParameters();
35   virtual void PrintParameters() const ;
36   virtual void  SimulateDetectorResponse(Float_t z0, Float_t x0, Float_t geantTime, Int_t& nActivatedPads, Int_t& nFiredPads, Bool_t* isFired, Int_t* nPlace, Float_t* qInduced, Float_t* tofTime, Float_t& averageTime);
37   virtual void Print(Option_t* option) const ;
38   TClonesArray *SDigits() const {return fSDigits;}
39   TClonesArray *Hits() const {return fHits;}
40
41   // setters and getters for detector simulation
42   // it summarizes all it is known about TOF strip 
43   void  SetPadefficiency(Float_t padefficiency)      {fpadefficiency=padefficiency;}
44   void  SetEdgeEffect(Int_t   edgeEffect)            {fEdgeEffect=edgeEffect;}
45   void  SetEdgeTails(Int_t   edgeTails)              {fEdgeTails=edgeTails;}
46   void  SetHparameter(Float_t hparameter)            {fHparameter=hparameter;}
47   void  SetH2parameter(Float_t h2parameter)          {fH2parameter=h2parameter;}
48   void  SetKparameter(Float_t kparameter)            {fKparameter=kparameter;}
49   void  SetK2parameter(Float_t k2parameter)          {fK2parameter=k2parameter;}
50   void  SetEffCenter(Float_t effCenter)              {fEffCenter=effCenter;}
51   void  SetEffBoundary(Float_t effBoundary)          {fEffBoundary=effBoundary;}
52   void  SetEff2Boundary(Float_t eff2Boundary)        {fEff2Boundary=eff2Boundary;}
53   void  SetEff3Boundary(Float_t eff3Boundary)        {fEff3Boundary=eff3Boundary;}
54   void  SetResCenter (Float_t resCenter)             {fResCenter=resCenter;}
55   void  SetResBoundary(Float_t resBoundary)          {fResBoundary=resBoundary;}
56   void  SetResSlope(Float_t resSlope)                {fResSlope=resSlope;}
57   void  SetTimeWalkCenter(Float_t timeWalkCenter)    {fTimeWalkCenter=timeWalkCenter;}
58   void  SetTimeWalkBoundary(Float_t timeWalkBoundary){fTimeWalkBoundary=timeWalkBoundary;}
59   void  SetTimeWalkSlope(Float_t timeWalkSlope)      {fTimeWalkSlope=timeWalkSlope;}
60
61   void  SetTimeDelayFlag(Int_t timeDelayFlag)        {fTimeDelayFlag=timeDelayFlag;}
62   void  SetPulseHeightSlope(Float_t pulseHeightSlope){fPulseHeightSlope=pulseHeightSlope;}
63   void  SetTimeDelaySlope(Float_t timeDelaySlope)    {fTimeDelaySlope=timeDelaySlope;}
64   void  SetMinimumCharge(Float_t minimumCharge)      {fMinimumCharge=minimumCharge;}
65   void  SetChargeSmearing(Float_t chargeSmearing)    {fChargeSmearing=chargeSmearing;}
66   void  SetLogChargeSmearing(Float_t logChargeSmearing){fLogChargeSmearing=logChargeSmearing;}
67   void  SetTimeSmearing(Float_t timeSmearing)        {fTimeSmearing=timeSmearing;}
68   void  SetAverageTimeFlag(Int_t averageTimeFlag)    {fAverageTimeFlag=averageTimeFlag;}
69
70   Float_t  GetPadefficiency()    const {return fpadefficiency;}
71   Int_t    GetEdgeEffect()       const {return fEdgeEffect;}
72   Int_t    GetEdgeTails()        const {return fEdgeTails;}
73   Float_t  GetHparameter()       const {return fHparameter;}
74   Float_t  GetH2parameter()      const {return fH2parameter;}
75   Float_t  GetKparameter()       const {return fKparameter;}
76   Float_t  GetK2parameter()      const {return fK2parameter;}
77   Float_t  GetEffCenter()        const {return fEffCenter;}
78   Float_t  GetEffBoundary()      const {return fEffBoundary;}
79   Float_t  GetEff2Boundary()     const {return fEff2Boundary;}
80   Float_t  GetEff3Boundary()     const {return fEff3Boundary;}
81   Float_t  GetResCenter ()       const {return fResCenter;}
82   Float_t  GetResBoundary()      const {return fResBoundary;}
83   Float_t  GetResSlope()         const {return fResSlope;}
84   Float_t  GetTimeWalkCenter()   const {return fTimeWalkCenter;}
85   Float_t  GetTimeWalkBoundary() const {return fTimeWalkBoundary;}
86   Float_t  GetTimeWalkSlope()    const {return fTimeWalkSlope;}
87   Int_t    GetTimeDelayFlag()    const {return fTimeDelayFlag;}
88   Float_t  GetPulseHeightSlope() const {return fPulseHeightSlope;}
89   Float_t  GetTimeDelaySlope()   const {return fTimeDelaySlope;}
90   Float_t  GetMinimumCharge()    const {return fMinimumCharge;}
91   Float_t  GetChargeSmearing()   const {return fChargeSmearing;}
92   Float_t  GetLogChargeSmearing()const {return fLogChargeSmearing;}
93   Float_t  GetTimeSmearing()     const {return fTimeSmearing;}
94   Int_t    GetAverageTimeFlag()  const {return fAverageTimeFlag;}
95   
96
97 private:
98   Int_t   fNevents;         // Number of events to digitize
99   TString fSDigitsFile;     // output file 
100   TClonesArray *fSDigits;   // array of summable digits
101   TClonesArray *fHits;      // array of summable digits
102   TF1     *ftail;           // pointer to formula for time with tail
103   TString fHeadersFile;     // input file
104
105   // detector response simulation
106   // Intrisic MRPC time resolution and pad (edge effect) parameters
107   Float_t fTimeResolution;  // time resolution of the MRPC (ns)
108   Float_t fpadefficiency;   // intrinsic pad efficiency, used if fEdgeEffect==0
109   Int_t   fEdgeEffect;      // edge effects option
110   Int_t   fEdgeTails;       // edge tails option
111   Float_t fHparameter;      // sensitive edge (to produce hits on the
112   // neighbouring pads) =0.7, new = 0.4 cm
113   Float_t fH2parameter;     // parameter to fit the efficiency
114   Float_t fKparameter;      // sensitive edge (going ahead towards the
115   // center no delay effects are suffered) =1.0, new = 0.5 cm
116   Float_t fK2parameter;     // parameter to fit the efficiency
117   // Pad Efficiency and Resolution parameters
118   Float_t fEffCenter;       // efficiency in the central region of the pad
119   Float_t fEffBoundary;     // efficiency at the boundary of the pad
120   Float_t fEff2Boundary;    // efficiency value at H2parameter
121   Float_t fEff3Boundary;    // efficiency value at K2parameter
122   Float_t fResCenter;       // resolution (ps) in the central region of the pad
123   Float_t fResBoundary;     // resolution (ps)  at the boundary of the pad
124   Float_t fResSlope;        // slope (ps/K) for neighbouring pad
125   // Time Walk parameters
126   Float_t fTimeWalkCenter;  // time walk (ps) in the central region of the pad
127   Float_t fTimeWalkBoundary;// time walk (ps) at the boundary of the pad
128   Float_t fTimeWalkSlope;   // slope (ps/K) for neighbouring pad
129   Int_t   fTimeDelayFlag;   // flag for delay due to the PulseHeightEffect
130   Float_t fPulseHeightSlope;// It determines the charge amount induced
131   // due to edge effect, using the formula
132   // qInduced=exp(-PulseHeightSlope*x)
133   Float_t fTimeDelaySlope;  // It determines the time delay. This is the slope
134   // in the T1-T2 vs log(q1/q2) plot
135   // ADC-TDC correlation parameters
136   Float_t fMinimumCharge;   // Minimum charge amount which could be induced
137   Float_t fChargeSmearing;  // Smearing in charge in (q1/q2) vs x plot
138   Float_t fLogChargeSmearing;// Smearing in log of charge ratio
139   Float_t fTimeSmearing;    // Smearing in time in time vs log(q1/q2) plot
140   Int_t   fAverageTimeFlag; // flag (see the setter for details)
141
142  protected:
143
144
145   ClassDef(AliTOFSDigitizer,1)  // creates TOF SDigits
146
147 };
148
149 #endif // AliTOFSDigitizer_H