SPD services on the cones (A. Pulvirenti)
[u/mrichter/AliRoot.git] / ITS / AliITSOnlineSDDInjectors.h
CommitLineData
348f80b7 1#ifndef ALIITSONLINESDDINJECTORS_H
2#define ALIITSONLINESDDINJECTORS_H
3
4
5///////////////////////////////////////////////////////////////////
6// //
7// Class used for SDD injector analysis //
8// Origin: F.Prino, Torino, prino@to.infn.it //
9// //
10///////////////////////////////////////////////////////////////////
0e5e647a 11#include "AliITSOnlineSDD.h"
348f80b7 12
4ff6aa93 13/* $Id: */
348f80b7 14class TH2F;
15class TGraphErrors;
16class AliITSOnlineSDDInjectors : public AliITSOnlineSDD {
17
18 public:
19 AliITSOnlineSDDInjectors();
979b5a5f 20 AliITSOnlineSDDInjectors(Int_t nddl, Int_t ncarlos, Int_t sid);
348f80b7 21 virtual ~AliITSOnlineSDDInjectors();
22
23 void SetSide(Int_t sid){fSide=sid;}
24 void SetThreshold(Float_t thr=75.){fThreshold=thr;}
25 void SetRangeLine1(Int_t tbmin=40, Int_t tbmax=90){
26 fTbMin[0]=tbmin; fTbMax[0]=tbmax;
27 }
28 void SetRangeLine2(Int_t tbmin=90, Int_t tbmax=140){
29 fTbMin[1]=tbmin; fTbMax[1]=tbmax;
30 }
31 void SetRangeLine3(Int_t tbmin=170, Int_t tbmax=220){
32 fTbMin[2]=tbmin; fTbMax[2]=tbmax;
33 }
34 void SetPolOrder(Int_t n=3){fPolOrder=n;}
35 void SetMinDriftVel(Float_t vmin=4.){fMinDriftVel=vmin;}
36 void SetMaxDriftVel(Float_t vmax=9.){fMaxDriftVel=vmax;}
4ff6aa93 37 void SetTimeDiffTB(Float_t tbDiff=8.){fTimeDiffTB=tbDiff;}
348f80b7 38
4ff6aa93 39 TGraphErrors* GetLineGraph(Int_t jlin) const;
beb262b4 40 TGraphErrors* GetDriftVelocityGraph() const;
348f80b7 41 Float_t* GetDriftVelFitParam()const{ return fParam;}
42 Float_t GetDriftVelocity(Int_t jlin) const{return fDriftVel[jlin];}
43 Float_t GetSigmaDriftVelocity(Int_t jlin) const{return fSigmaDriftVel[jlin];}
44 Float_t GetTimeBinZero() const{return fTbZero;}
45 Float_t GetDriftCoordinate(Float_t cAnode, Float_t cTimeBin);
beb262b4 46 Int_t GetAnodeNumber(Int_t iInjLine) const;
84c6e6c0 47 Int_t GetLineNumberFromAnode(Int_t nAnode) const;
48 Int_t GetAnodeStatus(Int_t nAnode) const;
c668f182 49 Float_t GetCentroid(Int_t injnumb, Int_t injline) const {
50 if(injnumb<kNInjectors && injline<3) return fCentroid[injnumb][injline];
51 else return -9999.;
52 }
53 Bool_t IsInjectorGood(Int_t injnumb, Int_t injline) const {
54 if(injnumb<kNInjectors && injline<3) return fGoodInj[injnumb][injline];
55 else return 0;
56 }
348f80b7 57 void PrintInjMap();
58 void PrintCentroids();
4c82df4c 59 void WriteToASCII(Int_t evNumb, UInt_t timeStamp, Int_t optAppend=0);
348f80b7 60
61 void Reset();
62 void AnalyzeEvent(TH2F* his);
63 void FindGoodInjectors();
64 void FindCentroids();
65 void CalcDriftVelocity(Int_t jlin);
66 void CalcTimeBinZero();
67 void FitDriftVelocityVsAnode();
68
69 protected:
70 void SetPositions();
71 private:
72
73 enum {
74 kNInjectors = 33
75 };
76
77 AliITSOnlineSDDInjectors(const AliITSOnlineSDDInjectors& source);
78 AliITSOnlineSDDInjectors& operator = (const AliITSOnlineSDDInjectors& source);
4ff6aa93 79 static const Float_t fgkSaturation; // ADC saturation value (1008)
348f80b7 80
beb262b4 81 TH2F* fHisto; // histogram of module channel counts
82 Float_t fTbZero; // Time zero for injector event
83 Float_t fPosition[3]; // Coordinates of injector lines
84 UShort_t fTbMin[3]; // Minimum time bin for each line
85 UShort_t fTbMax[3]; // Maximum time bin for each line
86 Bool_t fGoodInj[kNInjectors][3]; // array of good injectors
87 Float_t fCentroid[kNInjectors][3]; // array of time centroids of injectors
88 Float_t fRMSCentroid[kNInjectors][3]; // array of time rms of injectors
89 Float_t fDriftVel[kNInjectors]; // drift velocity
90 Float_t fSigmaDriftVel[kNInjectors]; // error on drift velocity
91 Float_t *fParam; // parameters of polinomial fit
92 // of drift vel. vs. anode number
93 Int_t fPolOrder; // order of polinomial fit
94 Float_t fMinDriftVel; // Cut value for minimum drift speed
95 Float_t fMaxDriftVel; // Cut value for maximum drift speed
96 Float_t fThreshold; // Threshold for injector signal
348f80b7 97
4ff6aa93 98 Float_t fTimeDiffTB; // time difference (in TB) between injector trigger and particle trigger
99
100 ClassDef(AliITSOnlineSDDInjectors,2)
348f80b7 101};
102#endif