]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDclusterErrors.h
Added a commented out version with new digitizers.
[u/mrichter/AliRoot.git] / TRD / AliTRDclusterErrors.h
CommitLineData
d8d3b5b8 1#if !defined(__CINT__) || defined(__MAKECINT__)
289478c7 2#include "AliTrackReference.h"
d8d3b5b8 3#endif
289478c7 4
aec95541 5AliTRDclusterCorrection * gCorrection;
6
7void ReadCorrection(){
8 TFile f("TRDcorrection.root");
9 gCorrection= (AliTRDclusterCorrection *)f.Get("TRDcorrection");
10 if (gCorrection==0){
11 printf("Correction not found");
12 }
13}
14
15
289478c7 16class AliTRDExactPoint: public TObject {
17 public :
18 AliTRDExactPoint();
19 Float_t fTX; //x in rotated coordinate in the center of time bin
20 Float_t fTY; //y
21 Float_t fTZ; //z
22 Float_t fTAY; //angle y
23 Float_t fTAZ; //angle z
24 Float_t fGx;
25 Float_t fGy;
26 Float_t fGz;
27 //
28 void SetReference(AliTrackReference *ref);
29 Float_t fTRefAngleY;
30 Float_t fRefPos[3];
31 Float_t fRefMom[3];
32 //
33 Int_t fDetector; // detector (chamber)
34 Int_t fLocalTimeBin; // local time bin
35 Int_t fPlane; // plane (layer)
36 Int_t fSector; // segment
37 Int_t fPlaneMI;
38 //
39 Float_t fTQ;
40 Float_t fTPrim;
41 //
42 ClassDef(AliTRDExactPoint,1)
43};
44
289478c7 45class AliTRDCI: public TObject {
46 public :
47 AliTRDCI(){;}
48 virtual ~AliTRDCI(){;}
49 //
50 AliTRDclusterMI fCl;
51 AliTRDExactPoint fEp;
52 TParticle fP;
53 Char_t fStatus;
f007cb5f 54 Int_t fNClusters;
289478c7 55 //
56 Float_t fDYtilt;
57 Float_t fTDistZ;
58 //
59 Int_t fNTracks;
60 Float_t fPt;
61 Float_t fCharge;
62 Bool_t fIsPrim;
aec95541 63 Float_t fCorrection;
289478c7 64 void Update();
65 ClassDef(AliTRDCI,1)
66};
67
289478c7 68class AliTRDClusterErrAnal: public TObject{
69public:
70 AliTRDClusterErrAnal(Char_t *chloader = "galice.root");
71 void SetIO(Int_t event);
72 Int_t Analyze(Int_t trackmax);
73 void LoadClusters();
74 void MakeExactPoints(Int_t trackmax);
75 void SortReferences();
76 AliTrackReference * FindNearestReference(Int_t lab, Float_t pos[3], Float_t dmax=10.);
77public:
78 AliRunLoader * fRunLoader;
79 AliLoader * fTRDLoader;
80 AliTRDparameter *fParam;
81 AliTRDgeometry *fGeometry;
82 TTree * fHitTree;
83 TTree * fClusterTree;
84 TTree * fReferenceTree;
85 AliTRDv1 * fTRD;
86 //
87 TTree * fTreeA;
88 TFile * fFileA;
89 AliTRDtracker *fTracker;
90 AliStack *fStack;
91 TObjArray fClusters[12][100][18]; //first plane, second time bin
92 TObjArray fExactPoints;
93 TObjArray *fReferences;
94
95 ClassDef(AliTRDClusterErrAnal,1)
96};
97
98
99class AliTRDClusterErrDraw: public TObject{
100public:
f007cb5f 101 TTree * fTree;
aec95541 102 AliTRDclusterCorrection* MakeCorrection(TTree * tree, Float_t offset);
289478c7 103 static TH1F * ResDyVsAmp(TTree* tree, const char* selection, Float_t t0, Float_t ampmin=10, Float_t ampmax=300);
104 static TH1F * ResDyVsRelPos(TTree* tree, const char* selection, Float_t t0, Float_t min=-0.5, Float_t max=0.5);
105 static TH1F * ResDyVsAngleY(TTree* tree, const char* selection, Float_t t0, Float_t min=-1., Float_t max=1.);
f007cb5f 106 static void AliLabelAxes(TH1* histo, const char* xAxisTitle, const char* yAxisTitle);
107 static TH1F* CreateEffHisto(TH1F* hGen, TH1F* hRec);
108 static TH1F* CreateResHisto(TH2F* hRes2, Bool_t draw = kTRUE, Bool_t drawBinFits = kTRUE,
289478c7 109 Bool_t overflowBinFits = kFALSE);
289478c7 110 ClassDef(AliTRDClusterErrDraw,1)
111};
112
113
114
115
aec95541 116AliTRDExactPoint::AliTRDExactPoint()
117{
118 fTX=fTY=fTZ=fTAZ=fTAY=fGx=fGy=fGz=fTRefAngleY=0;
119 fRefPos[0]=fRefPos[1]=fRefPos[2]=fRefMom[0]=fRefMom[1]=fRefMom[2]=0;
120 fDetector=fLocalTimeBin=fPlane=fSector=fPlaneMI=0;
121 fTQ=fTPrim=0;
122}
123
124void AliTRDExactPoint::SetReference(AliTrackReference *ref){
125 fRefPos[0] = ref->X();
126 fRefPos[1] = ref->Y();
127 fRefPos[2] = ref->Z();
128 //
129 fRefMom[0] = ref->Px();
130 fRefMom[1] = ref->Py();
131 fRefMom[2] = ref->Pz();
132}
133
134
135void AliTRDCI::Update()
136{
137 //
138 //thanks to root
139 fPt = fP.Pt();
140 fCharge = fP.GetPDG()->Charge();
141 fIsPrim = (fP.GetMother(0)>0)? kFALSE :kTRUE;
142 fCorrection = gCorrection->GetCorrection(fEp.fPlane,fCl.fTimeBin,fEp.fTAY);
143}
144
f007cb5f 145
146/*
147//example seesion
148
149.L AliGenInfo.C+
150.L AliTRDclusterErrors.C+
151gCorrection = AliTRDclusterCorrection::GetCorrection();
152AliTRDClusterErrAnal ana;
153ana.Analyze(10000000)
154
155
156
157.L AliGenInfo.C+
158.L AliTRDclusterErrors.C+
159TFile f("trdclusteranal.root");
160TTree* tree = (TTree*)f.Get("trdcl");
161AliComparisonDraw comp;
162comp->fTree = tree;
163
164
165tree->SetAlias("shapef","(1.-(0.8+0.06*(6-fEp.fPlane))*(fCl.fSigmaY2/(0.17+0.027*abs(fEp.fTAY))))");
166tree->SetAlias("shapes","0.08+0.3/sqrt(fCl.fQ)");
167tree->SetAlias("sfactor","shapef/shapes");
168
169tree->SetAlias("shapen","(fCl.fNPads-2.7-0.9*abs(fEp.fTAY))");
170
171tree->SetAlias("gshape","sfactor>-2&&fCl.fNPads<6&&shapen<1");
172
173
174tree->SetAlias("dy" , "fEp.fTY-fCl.fY-fDYtilt");
175tree->SetAlias("angle","abs(fEp.fTAY)");
176TCut cbase("cbase","(abs(fP.fPdgCode)!=11||fPt>0.2)&&fPt>0.1&&angle<2");
177
178tree->SetAlias("erry0","(0.028+0.07*angle)");
179tree->SetAlias("erry1","erry0*(0.9+15./fCl.fQ)");
180tree->SetAlias("erry2","erry1*(0.8+0.5*max(-sfactor,0))");
181
182
183
184
185TH1F his("resy","resy",100,-0.2,0.2);
186comp->fTree->Draw("dy:0.028*fEp.fTAY","fStatus==0 && abs(dy)<1.0&&fNTracks<2&&angle<2&&gshape","")
187comp->DrawXY("sqrt(fCl.fQ)","dy","fStatus==0"+cbase,"gshape",10,0,20,-0.7,0.7);
188
189comp->DrawXY("angle","dy/erry1","fStatus==0"+cbase,"gshape",10,0,2,-5.7,5.7);
190comp->DrawXY("sqrt(cl->fQ)","dy/err1","fStatus==0"+cbase,"gshape",10,2,20,-5.7,5.7);
191
192
193
194AliTRDClusterErrDraw::ResDyVsAmp(tree,"abs(dy)<0.4&&abs(fEp.fTAY)<0.2&&fNTracks<2&&fPt>0.1"+cbase,-0.03);
195AliTRDClusterErrDraw::ResDyVsRelPos(tree,"abs(dy)<0.4&&abs(fEp.fTAY)<0.2&&fNTracks<2&&fPt>0.2"+cbase,-0.03);
196AliTRDClusterErrDraw::ResDyVsAngleY(tree,"abs(fEp.fTY-fCl.fY+fDYtilt)<0.4",0.);
197
198AliTRDclusterCorrection * cor = AliTRDClusterErrDraw::MakeCorrection(tree,0.134);
199tree->Draw("sqrt(fCl.fRmsY)","fStatus==0&&abs(fEp.fTY-fCl.fY+fDYtilt)<0.4&&abs(fEp.fTAY)<0.2&&fNTracks<2&&fPt>0.2&&fCl.fNPads==0");
200
201tree->Draw("fEp.fTY-fCl.fY+fDYtilt:fCl.fTimeBin","fStatus==0&&abs(fEp.fTY-fCl.fY+fDYtilt)<0.5&&abs(fEp.fTAY)<0.3&&fEp.fTAY>0.13","prof")
202
203
204*/
205