]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - ITS/AliITSOnlineSDDInjectors.h
adding arguments to AddTaskPhysicsSelection for MC and BG identification (Antonin)
[u/mrichter/AliRoot.git] / ITS / AliITSOnlineSDDInjectors.h
... / ...
CommitLineData
1#ifndef ALIITSONLINESDDINJECTORS_H
2#define ALIITSONLINESDDINJECTORS_H
3
4
5/* $Id$ */
6
7///////////////////////////////////////////////////////////////////
8// //
9// Class used for SDD injector analysis //
10// Origin: F.Prino, Torino, prino@to.infn.it //
11// //
12///////////////////////////////////////////////////////////////////
13
14#include "AliITSOnlineSDD.h"
15
16
17class TH1F;
18class TH2F;
19class TGraphErrors;
20class AliITSOnlineSDDInjectors : public AliITSOnlineSDD {
21
22 public:
23 AliITSOnlineSDDInjectors();
24 AliITSOnlineSDDInjectors(Int_t nddl, Int_t ncarlos, Int_t sid);
25 virtual ~AliITSOnlineSDDInjectors();
26
27
28 void SetThresholds(Float_t tl, Float_t th){
29 fLowThreshold=tl;
30 fHighThreshold=th;
31 }
32 void SetInjLineRange(Int_t jlin, Int_t tbmin, Int_t tbmax){
33 fTbMin[jlin]=tbmin;
34 fTbMax[jlin]=tbmax;
35 }
36 void Set20MHzConfig(){
37 SetInjLineRange(0,10,20);
38 SetInjLineRange(1,50,70);
39 SetInjLineRange(2,100,120);
40 SetTimeStep(50.);
41 }
42 void Set40MHzConfig(){
43 SetInjLineRange(0,20,50);
44 SetInjLineRange(1,90,160);
45 SetInjLineRange(2,170,240);
46 SetTimeStep(25.);
47 }
48 void SetPolOrder(Int_t n){fPolOrder=n;}
49 void SetMinDriftSpeed(Float_t vmin){fMinDriftSpeed=vmin;}
50 void SetMaxDriftSpeed(Float_t vmax){fMaxDriftSpeed=vmax;}
51 void SetMaxDriftSpeedErr(Float_t maxval){
52 fMaxDriftSpeedErr=maxval;
53 }
54 void SetFitLimits(Int_t firstpad,Int_t lastpad){
55 fFirstPadForFit=firstpad;
56 fLastPadForFit=lastpad;
57 }
58 void SetPadStatusCutForFit(Int_t cutval=1){
59 fPadStatusCutForFit=cutval;
60 }
61 void SetDefaults();
62 void SetTimeStep(Double_t tstep) {
63 fTimeStep=tstep;
64 }
65 void SetUseTimeZeroSignal(Bool_t useTZ=kTRUE){
66 fUseTimeZeroSignal=useTZ;
67 }
68 TH1F* GetMeanDriftSpeedVsPadHisto() const;
69 TGraphErrors* GetTimeVsDistGraph(Int_t jpad) const;
70 TGraphErrors* GetDriftSpeedGraph() const;
71 TGraphErrors* GetSelectedDriftSpeedGraph(Int_t minAcceptStatus) const;
72 Double_t* GetDriftSpeedFitParam()const{ return fParam;}
73 Double_t GetDriftSpeed(Int_t jpad) const{return fDriftSpeed[jpad];}
74 Double_t GetDriftSpeedErr(Int_t jpad) const{return fDriftSpeedErr[jpad];}
75 Double_t GetTimeBinZero() const{return fTbZero;}
76
77 Double_t GetTimeStep() const{return fTimeStep;}
78 Int_t GetAnodeNumber(Int_t iInjPad) const;
79 Int_t GetInjPadNumberFromAnode(Int_t nAnode) const;
80 Int_t GetInjPadStatus(Int_t jpad) const;
81 Int_t GetAnodeStatus(Int_t nAnode) const{
82 Int_t jpad=GetInjPadNumberFromAnode(nAnode);
83 return GetInjPadStatus(jpad);
84 }
85 Double_t GetCentroid(Int_t jpad, Int_t jlin) const {
86 if(jpad<kInjPads && jlin<kInjLines) return fCentroid[jpad][jlin];
87 else return -9999.;
88 }
89 Bool_t IsInjectorGood(Int_t jpad, Int_t jlin) const {
90 if(jpad<kInjPads && jlin<kInjLines) return fGoodInj[jpad][jlin];
91 else return 0;
92 }
93 void PrintInjectorStatus();
94 void PrintCentroids();
95 void WriteToASCII(Int_t evNumb, UInt_t timeStamp, Int_t optAppend=0);
96 void WriteInjectorStatusToASCII();
97 Bool_t WriteToROOT(TFile *fil) const;
98
99 void Reset();
100 void AnalyzeEvent(TH2F* his);
101 void AddEvent(TH2F* his);
102 void FindGoodInjectors();
103 void FindCentroids();
104 void CalcDriftSpeed(Int_t jpad);
105 void CalcTimeBinZero();
106 void FitDriftSpeedVsAnode();
107 Double_t GetMeanDriftSpeed(Int_t ipad) const{
108 if(fNEvents==0) return 0.;
109 return fSumDriftSpeed[ipad]/(Double_t)fNEvents;
110 }
111 Double_t GetRMSDriftSpeed(Int_t ipad) const;
112 void FitMeanDriftSpeedVsAnode();
113
114 protected:
115 void SetPositions();
116 private:
117
118 enum {kInjPads = 33};
119 enum {kInjLines = 3};
120
121 AliITSOnlineSDDInjectors(const AliITSOnlineSDDInjectors& source);
122 AliITSOnlineSDDInjectors& operator = (const AliITSOnlineSDDInjectors& source);
123 static const Float_t fgkSaturation; // ADC saturation value (1008)
124 static const Float_t fgkDefaultLThreshold; // Default for fLowThreshold
125 static const Float_t fgkDefaultHThreshold; // Default for fHighThreshold
126 static const Float_t fgkDefaultMinSpeed; // Default for fMinDriftSpeed
127 static const Float_t fgkDefaultMaxSpeed; // Default for fMaxDriftSpeed
128 static const Float_t fgkDefaultMaxErr; // Default for fMaxDriftSpeedErr
129 static const Int_t fgkDefaultPolOrder; // Default for fPolOrder
130 static const Float_t fgkDefaultTimeStep; // Default for fTimeStep
131 static const UShort_t fgkDefaultTbMin[kInjLines]; // Defaults for fTbMin
132 static const UShort_t fgkDefaultTbMax[kInjLines]; // Defaults for fTbMax
133
134
135 TH2F* fHisto; // histogram of channel counts
136 Double_t fTbZero; // Time zero for injector event
137 Double_t fRMSTbZero; // Error on time zero
138 Double_t fPosition[kInjLines]; // Coordinates of injector lines
139 UShort_t fTbMin[kInjLines]; // Minimum time bin for each line
140 UShort_t fTbMax[kInjLines]; // Maximum time bin for each line
141 Bool_t fGoodInj[kInjPads][kInjLines]; // array of good injectors
142 Double_t fCentroid[kInjPads][kInjLines]; // array of time bin centroids
143 Double_t fRMSCentroid[kInjPads][kInjLines]; // array of time rms of injectors
144 Double_t fDriftSpeed[kInjPads]; // drift speed
145 Double_t fDriftSpeedErr[kInjPads]; // error on drift speed
146 Int_t fNEvents; // number of events
147 Double_t fSumDriftSpeed[kInjPads]; // drift speed summed over events
148 Double_t fSumSqDriftSpeed[kInjPads]; // drift speed^2 sum
149
150 Double_t *fParam; // parameters of polinomial fit to
151 // drift speed vs. anode number
152 Int_t fPolOrder; // order of polinomial fit
153 Float_t fMinDriftSpeed; // Minimum value for drift speed
154 Float_t fMaxDriftSpeed; // Maximum value for drift speed
155 Float_t fMaxDriftSpeedErr; // Maximum value for error on drift speed
156 Float_t fLowThreshold; // Low threshold for injector signal
157 Float_t fHighThreshold; // High threshold for injector signal
158
159 Int_t fFirstPadForFit; // first injector pad used in fit
160 Int_t fLastPadForFit; // last injector pad used in fit
161 Int_t fPadStatusCutForFit; // minimum value of pad status for fit
162
163 Double_t fTimeStep; // time bin value (25 or 50 ns)
164 Bool_t fUseTimeZeroSignal; // flag for usage of time zero signal
165 // in drift speed calculation
166
167 ClassDef(AliITSOnlineSDDInjectors,6)
168};
169#endif