]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOFSDigitizer.h
Allowing coding conventions to be checked
[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 //-- Authors: F. Pierella, A. De Caro
11
12
13 #include "TTask.h"
14 #include "TString.h"
15 class AliRunLoader;
16 class AliLoader;
17
18 class TF1;
19
20 class AliTOFSDigitizer: public TTask {
21
22 public:
23   AliTOFSDigitizer() ;          // ctor
24   //AliTOFSDigitizer(const char* HeaderFile) ; // par ctor
25   AliTOFSDigitizer(const char* HeaderFile, Int_t evNumber1=-1, Int_t nEvents=0) ; // par ctor
26
27   virtual ~AliTOFSDigitizer() ; // dtor
28
29   virtual void  Exec(Option_t *verboseOption); 
30   void SetSDigitsFile(char * /*file*/ ) {;}
31   
32   void InitParameters();
33   virtual void PrintParameters() const ;
34   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);
35   virtual void Print(Option_t* opt) const ;
36   void  SetFirstEvent(Int_t event1)      {fEvent1 = event1;}
37   void  SetSecondEvent(Int_t event2)     {fEvent2 = event2;}
38   Int_t GetFirstEvent()  const {return fEvent1;}
39   Int_t GetSecondEvent() const {return fEvent2;}
40   Int_t GetNEvents() const {return (fEvent2-fEvent1);}
41   void  SelectSectorAndPlate(Int_t sector, Int_t plate);
42
43   // setters and getters for detector simulation
44   // it summarizes all it is known about TOF strip 
45   void  SetPadefficiency(Float_t padefficiency)      {fpadefficiency=padefficiency;}
46   void  SetEdgeEffect(Int_t   edgeEffect)            {fEdgeEffect=edgeEffect;}
47   void  SetEdgeTails(Int_t   edgeTails)              {fEdgeTails=edgeTails;}
48   void  SetHparameter(Float_t hparameter)            {fHparameter=hparameter;}
49   void  SetH2parameter(Float_t h2parameter)          {fH2parameter=h2parameter;}
50   void  SetKparameter(Float_t kparameter)            {fKparameter=kparameter;}
51   void  SetK2parameter(Float_t k2parameter)          {fK2parameter=k2parameter;}
52   void  SetEffCenter(Float_t effCenter)              {fEffCenter=effCenter;}
53   void  SetEffBoundary(Float_t effBoundary)          {fEffBoundary=effBoundary;}
54   void  SetEff2Boundary(Float_t eff2Boundary)        {fEff2Boundary=eff2Boundary;}
55   void  SetEff3Boundary(Float_t eff3Boundary)        {fEff3Boundary=eff3Boundary;}
56   void  SetResCenter (Float_t resCenter)             {fResCenter=resCenter;}
57   void  SetResBoundary(Float_t resBoundary)          {fResBoundary=resBoundary;}
58   void  SetResSlope(Float_t resSlope)                {fResSlope=resSlope;}
59   void  SetTimeWalkCenter(Float_t timeWalkCenter)    {fTimeWalkCenter=timeWalkCenter;}
60   void  SetTimeWalkBoundary(Float_t timeWalkBoundary){fTimeWalkBoundary=timeWalkBoundary;}
61   void  SetTimeWalkSlope(Float_t timeWalkSlope)      {fTimeWalkSlope=timeWalkSlope;}
62
63   void  SetTimeDelayFlag(Int_t timeDelayFlag)        {fTimeDelayFlag=timeDelayFlag;}
64   void  SetPulseHeightSlope(Float_t pulseHeightSlope){fPulseHeightSlope=pulseHeightSlope;}
65   void  SetTimeDelaySlope(Float_t timeDelaySlope)    {fTimeDelaySlope=timeDelaySlope;}
66   void  SetMinimumCharge(Float_t minimumCharge)      {fMinimumCharge=minimumCharge;}
67   void  SetChargeSmearing(Float_t chargeSmearing)    {fChargeSmearing=chargeSmearing;}
68   void  SetLogChargeSmearing(Float_t logChargeSmearing){fLogChargeSmearing=logChargeSmearing;}
69   void  SetTimeSmearing(Float_t timeSmearing)        {fTimeSmearing=timeSmearing;}
70   void  SetAverageTimeFlag(Int_t averageTimeFlag)    {fAverageTimeFlag=averageTimeFlag;}
71   void  SetTdcBin(Float_t tdcBin)                    {fTdcBin=tdcBin;}
72   void  SetAdcBin(Float_t adcBin)                    {fAdcBin=adcBin;}
73   void  SetAdcMean(Float_t adcMean)                  {fAdcMean=adcMean;}
74   void  SetAdcRms(Float_t adcRms)                    {fAdcRms=adcRms;}
75
76   Float_t  GetPadefficiency()    const {return fpadefficiency;}
77   Int_t    GetEdgeEffect()       const {return fEdgeEffect;}
78   Int_t    GetEdgeTails()        const {return fEdgeTails;}
79   Float_t  GetHparameter()       const {return fHparameter;}
80   Float_t  GetH2parameter()      const {return fH2parameter;}
81   Float_t  GetKparameter()       const {return fKparameter;}
82   Float_t  GetK2parameter()      const {return fK2parameter;}
83   Float_t  GetEffCenter()        const {return fEffCenter;}
84   Float_t  GetEffBoundary()      const {return fEffBoundary;}
85   Float_t  GetEff2Boundary()     const {return fEff2Boundary;}
86   Float_t  GetEff3Boundary()     const {return fEff3Boundary;}
87   Float_t  GetResCenter ()       const {return fResCenter;}
88   Float_t  GetResBoundary()      const {return fResBoundary;}
89   Float_t  GetResSlope()         const {return fResSlope;}
90   Float_t  GetTimeWalkCenter()   const {return fTimeWalkCenter;}
91   Float_t  GetTimeWalkBoundary() const {return fTimeWalkBoundary;}
92   Float_t  GetTimeWalkSlope()    const {return fTimeWalkSlope;}
93   Int_t    GetTimeDelayFlag()    const {return fTimeDelayFlag;}
94   Float_t  GetPulseHeightSlope() const {return fPulseHeightSlope;}
95   Float_t  GetTimeDelaySlope()   const {return fTimeDelaySlope;}
96   Float_t  GetMinimumCharge()    const {return fMinimumCharge;}
97   Float_t  GetChargeSmearing()   const {return fChargeSmearing;}
98   Float_t  GetLogChargeSmearing()const {return fLogChargeSmearing;}
99   Float_t  GetTimeSmearing()     const {return fTimeSmearing;}
100   Int_t    GetAverageTimeFlag()  const {return fAverageTimeFlag;}
101   Float_t  GetTdcBin()           const {return fTdcBin;}
102   Float_t  GetAdcBin()           const {return fAdcBin;}
103   Float_t  GetAdcMean()          const {return fAdcMean;}
104   Float_t  GetAdcRms()           const {return fAdcRms;}
105   
106
107 private:
108   Int_t   fEvent1;          // lower bound for events to sdigitize
109   Int_t   fEvent2;          // upper bound for events to sdigitize
110   TF1     *ftail;           // pointer to formula for time with tail
111   TString fHeadersFile;     // input file
112   AliRunLoader* fRunLoader; //! Run Loader
113   AliLoader* fTOFLoader;    //! Loader
114   
115
116   Int_t fSelectedSector;    // sector number for sdigitization
117   Int_t fSelectedPlate ;    // plate  number for sdigitization
118
119   // detector response simulation
120   // Intrisic MRPC time resolution and pad (edge effect) parameters
121   Float_t fTimeResolution;  // time resolution of the MRPC (ns)
122   Float_t fpadefficiency;   // intrinsic pad efficiency, used if fEdgeEffect==0
123   Int_t   fEdgeEffect;      // edge effects option
124   Int_t   fEdgeTails;       // edge tails option
125   Float_t fHparameter;      // sensitive edge (to produce hits on the neighbouring pads)
126                             //                 0.7 cm (old); 0.4 cm (new)
127   Float_t fH2parameter;     // parameter to fit the efficiency
128   Float_t fKparameter;      // sensitive edge (going ahead towards the center
129                             // no delay effects are suffered) 1.0 cm (old); 0.5 cm (new)
130   Float_t fK2parameter;     // parameter to fit the efficiency
131   // Pad Efficiency and Resolution parameters
132   Float_t fEffCenter;       // efficiency in the central region of the pad
133   Float_t fEffBoundary;     // efficiency at the boundary of the pad
134   Float_t fEff2Boundary;    // efficiency value at H2parameter
135   Float_t fEff3Boundary;    // efficiency value at K2parameter
136   Float_t fResCenter;       // resolution (ps) in the central region of the pad
137   Float_t fResBoundary;     // resolution (ps)  at the boundary of the pad
138   Float_t fResSlope;        // slope (ps/K) for neighbouring pad
139   // Time Walk parameters
140   Float_t fTimeWalkCenter;  // time walk (ps) in the central region of the pad
141   Float_t fTimeWalkBoundary;// time walk (ps) at the boundary of the pad
142   Float_t fTimeWalkSlope;   // slope (ps/K) for neighbouring pad
143   Int_t   fTimeDelayFlag;   // flag for delay due to the PulseHeightEffect
144   Float_t fPulseHeightSlope;// It determines the charge amount induced
145   // due to edge effect, using the formula
146   // qInduced=exp(-PulseHeightSlope*x)
147   Float_t fTimeDelaySlope;  // It determines the time delay. This is the slope
148   // in the T1-T2 vs log(q1/q2) plot
149   // ADC-TDC correlation parameters
150   Float_t fMinimumCharge;   // Minimum charge amount which could be induced
151   Float_t fChargeSmearing;  // Smearing in charge in (q1/q2) vs x plot
152   Float_t fLogChargeSmearing;// Smearing in log of charge ratio
153   Float_t fTimeSmearing;    // Smearing in time in time vs log(q1/q2) plot
154   Int_t   fAverageTimeFlag; // flag (see the setter for details)
155   Float_t fTdcBin;      // time-window for the TDC bins [ps]
156   Float_t fAdcBin;      // charge-window for the ADC bins [pC]
157   Float_t fAdcMean;     // mean value for the ADC spectrum [bins]
158   Float_t fAdcRms;      // rms value for the ADC spectrum [bins]
159
160  protected:
161
162
163   ClassDef(AliTOFSDigitizer,2)  // creates TOF SDigits
164
165 };
166
167 #endif // AliTOFSDigitizer_H