]>
Commit | Line | Data |
---|---|---|
69656036 AB |
1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | ////////////////////////////////////////////////////////////////////////// | |
17 | // // | |
18 | // Check basic detector results at ESD level // | |
19 | // - Geometrical efficiency // | |
20 | // - Tracking efficiency // | |
21 | // - PID efficiency // | |
22 | // - Refit efficiency // | |
23 | // // | |
24 | // Author // | |
25 | // Alex Bercuci <A.Bercuci@gsi.de> // | |
26 | // Ionut Arsene <i.c.arsene@gsi.de> // | |
27 | // // | |
28 | // The analysis task fills AliCFContainer objects defined in the // | |
29 | // configuration macro using the AddCFContainer() method. // | |
30 | // The CF containers can be filled with any of the variables defined // | |
31 | // in ETrdCfVariables and at any of the steps defined in ETrdCfSteps. // | |
32 | // To define a new variable one needs to: // | |
33 | // 1. Add an entry in the ETrdCfVariables enumeration // | |
34 | // 2. Add the corresponding variable name (and in the correct order) // | |
35 | // in fgkVarNames // | |
36 | // 3. Define how the variable is filled in one of the Fill functions: // | |
37 | // FillEventInfo(), FillTrackInfo(), FillTrackletInfo(), // | |
38 | // FillTrackletSliceInfo(). // | |
39 | // To define a new step one needs to: // | |
40 | // 1. Add an entry in the ETrdCfSteps // | |
41 | // 2. Add the corresponding name in fgkStepNames // | |
42 | // 3. Define the track level cuts for this step in IsTrackSelected() // | |
43 | // // | |
44 | ////////////////////////////////////////////////////////////////////////// | |
45 | ||
46 | #include <TClonesArray.h> | |
47 | #include <TCanvas.h> | |
48 | #include <TObjArray.h> | |
49 | #include <TPad.h> | |
50 | #include <TLegend.h> | |
51 | #include <TLatex.h> | |
52 | #include <TLine.h> | |
53 | #include <TF1.h> | |
54 | #include <TH1D.h> | |
55 | #include <TH2D.h> | |
56 | #include <TH3D.h> | |
57 | #include <TH2I.h> | |
58 | #include <TH2F.h> | |
59 | #include <TH3S.h> | |
60 | #include <TH3F.h> | |
61 | #include <TProfile2D.h> | |
62 | #include <TProfile.h> | |
63 | #include <TGraphErrors.h> | |
64 | #include <TGraphAsymmErrors.h> | |
65 | #include <TFile.h> | |
66 | #include <TTree.h> | |
67 | #include <TROOT.h> | |
68 | #include <TChain.h> | |
69 | #include <TParticle.h> | |
70 | #include <TTimeStamp.h> | |
71 | #include <TRandom.h> | |
72 | #include <TString.h> | |
73 | ||
74 | #include "AliLog.h" | |
75 | #include "AliAnalysisManager.h" | |
76 | #include "AliAnalysisCuts.h" | |
77 | #include "AliPhysicsSelection.h" | |
78 | #include "AliESDEvent.h" | |
79 | #include "AliESDkink.h" | |
80 | #include "AliMCEvent.h" | |
81 | #include "AliESDInputHandler.h" | |
82 | #include "AliMCEventHandler.h" | |
83 | #include "AliESDpid.h" | |
84 | #include "AliExternalTrackParam.h" | |
85 | ||
86 | #include "AliESDtrack.h" | |
87 | #include "AliMCParticle.h" | |
88 | #include "AliPID.h" | |
89 | #include "AliStack.h" | |
90 | #include "AliTrackReference.h" | |
91 | #include "AliMultiplicity.h" | |
92 | #include "AliCFContainer.h" | |
93 | ||
94 | #include "AliTRDcheckESD.h" | |
95 | #include <iostream> | |
96 | using std::cout; | |
97 | using std::endl; | |
98 | ||
99 | ClassImp(AliTRDcheckESD) | |
100 | ||
101 | const Float_t AliTRDcheckESD::fgkxTPC = 290.; | |
102 | const Float_t AliTRDcheckESD::fgkxTOF = 365.; | |
103 | const Char_t* AliTRDcheckESD::fgkVarNames[AliTRDcheckESD::kNTrdCfVariables] = { | |
104 | "vtxZ", "multiplicity", "trigger", "BC", "TOFBC", "DCAxy", "DCAz", "charge", "OuterParam rad.", "phiVtx", "phi", | |
105 | "etaVtx", "eta", "pt", "ptTRD", "P", "PTRD", "TRDchi2", "tracklets", "clusters", "TrdQuality", | |
106 | "TrdBudget", "Qtot0", "ClustersPerRows", "Clusters/tracklet", "TrdP", "TrdPloss", "layer", "slice", "PH0" | |
107 | }; | |
108 | const Char_t* AliTRDcheckESD::fgkStepNames[AliTRDcheckESD::kNSteps] = {"TPC", "TRD", "TOF", "TOFin", "TOFout"}; | |
109 | ||
110 | FILE* AliTRDcheckESD::fgFile = NULL; | |
111 | ||
112 | //____________________________________________________________________ | |
113 | AliTRDcheckESD::AliTRDcheckESD(): | |
114 | AliAnalysisTaskSE() | |
115 | ,fStatus(0) | |
116 | ,fNRefFigures(0) | |
117 | ,fESD(NULL) | |
118 | ,fMC(NULL) | |
119 | ,fESDpid(new AliESDpid) | |
120 | ,fHistos(NULL) | |
121 | ,fReferenceTrackFilter(NULL) | |
122 | ,fPhysSelTriggersEnabled(kFALSE) | |
123 | ,fUserEnabledTriggers("") | |
124 | ,fNAssignedTriggers(0) | |
125 | { | |
126 | // | |
127 | // Default constructor | |
128 | // | |
129 | SetNameTitle("TRDcheckESD", "Check TRD @ ESD level"); | |
130 | SetMC(kTRUE); | |
131 | } | |
132 | ||
133 | //____________________________________________________________________ | |
134 | AliTRDcheckESD::AliTRDcheckESD(char* name): | |
135 | AliAnalysisTaskSE(name) | |
136 | ,fStatus(0) | |
137 | ,fNRefFigures(0) | |
138 | ,fESD(NULL) | |
139 | ,fMC(NULL) | |
140 | ,fESDpid(new AliESDpid) | |
141 | ,fHistos(NULL) | |
142 | ,fReferenceTrackFilter(NULL) | |
143 | ,fPhysSelTriggersEnabled(kFALSE) | |
144 | ,fUserEnabledTriggers("") | |
145 | ,fNAssignedTriggers(0) | |
146 | { | |
147 | // | |
148 | // Default constructor | |
149 | // | |
150 | SetMC(kTRUE); | |
151 | SetTitle("Check TRD @ ESD level"); | |
152 | DefineOutput(1, TObjArray::Class()); | |
153 | } | |
154 | ||
155 | //____________________________________________________________________ | |
156 | AliTRDcheckESD::~AliTRDcheckESD() | |
157 | { | |
158 | // Destructor | |
159 | if(fHistos && !(AliAnalysisManager::GetAnalysisManager() && AliAnalysisManager::GetAnalysisManager()->IsProofMode())){ | |
160 | if(fHistos->IsOwner()) fHistos->Delete(); | |
161 | delete fHistos; | |
162 | fHistos = NULL; | |
163 | } | |
164 | } | |
165 | ||
166 | //____________________________________________________________________ | |
167 | void AliTRDcheckESD::FillEventInfo(Double_t* values) { | |
168 | // | |
169 | // Fill event information | |
170 | // | |
171 | values[kEventVtxZ] = fESD->GetPrimaryVertex()->GetZv(); | |
172 | values[kEventBC] = fESD->GetBunchCrossNumber(); | |
173 | ||
174 | const AliMultiplicity* mult=fESD->GetMultiplicity(); | |
175 | Double_t itsNTracklets = mult->GetNumberOfTracklets(); | |
176 | values[kEventMult] = itsNTracklets; | |
177 | } | |
178 | ||
179 | //____________________________________________________________________ | |
180 | void AliTRDcheckESD::FillTrackInfo(Double_t* values, AliESDtrack* esdTrack) { | |
181 | // | |
182 | // Fill track information | |
183 | // | |
184 | Float_t dcaxy,dcaz; | |
185 | esdTrack->GetImpactParameters(dcaxy,dcaz); | |
186 | values[kTrackDCAxy] = dcaxy; | |
187 | values[kTrackDCAz] = dcaz; | |
188 | values[kTrackCharge] = esdTrack->Charge(); | |
189 | values[kTrackPt] = esdTrack->Pt(); | |
190 | values[kTrackPhi] = esdTrack->Phi(); | |
191 | values[kTrackEta] = esdTrack->Eta(); | |
192 | values[kTrackP] = esdTrack->P(); | |
193 | values[kTrackTrdTracklets] = esdTrack->GetTRDntracklets(); | |
194 | values[kTrackTrdClusters] = esdTrack->GetTRDncls(); | |
195 | values[kTrackTrdChi2] = esdTrack->GetTRDchi2()/(esdTrack->GetTRDntracklets()>0 ? esdTrack->GetTRDntracklets() : 1.0); | |
196 | values[kTrackTrdQuality] = esdTrack->GetTRDQuality(); | |
197 | values[kTrackTRDBudget] = esdTrack->GetTRDBudget(); | |
198 | values[kTrackTOFBC] = esdTrack->GetTOFBunchCrossing(fESD->GetMagneticField()); | |
199 | const AliExternalTrackParam *out=esdTrack->GetOuterParam(); | |
200 | Double_t p[3]; | |
201 | if(out->GetXYZ(p)) | |
202 | values[kTrackOuterParamRadius] = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]); | |
203 | else | |
204 | values[kTrackOuterParamRadius] = 0.0; | |
205 | } | |
206 | ||
207 | //____________________________________________________________________ | |
208 | void AliTRDcheckESD::FillTrackletInfo(Double_t* values, AliESDtrack* esdTrack, Int_t iPlane, | |
209 | Double_t* localSagitaPhi, Double_t localMom[][3], Bool_t* localMomGood) { | |
210 | // | |
211 | // Fill TRD tracklet info | |
212 | // | |
213 | values[kTrackletClustersVsRows] = esdTrack->GetTRDtrkltClCross(iPlane); | |
214 | values[kTrackletClusters] = esdTrack->GetTRDtrkltOccupancy(iPlane); | |
215 | values[kTrackletQtot] = esdTrack->GetTRDslice(iPlane, 0); | |
216 | values[kTrackletP] = esdTrack->GetTRDmomentum(iPlane); | |
217 | values[kTrackPlossTRDlayer] = esdTrack->P() - values[kTrackletP]; | |
218 | values[kTrackletLayer] = iPlane; | |
219 | values[kTrackPhiTRD] = localSagitaPhi[iPlane]; | |
220 | values[kTrackPtTRD] = (localMomGood[iPlane] ? TMath::Sqrt(localMom[iPlane][0]*localMom[iPlane][0]+ | |
221 | localMom[iPlane][1]*localMom[iPlane][1]) : values[kTrackPt]); | |
222 | values[kTrackPTRD] = (localMomGood[iPlane] ? TMath::Sqrt(values[kTrackPtTRD]*values[kTrackPtTRD]+ | |
223 | localMom[iPlane][2]*localMom[iPlane][2]) : values[kTrackP]); | |
224 | values[kTrackEtaTRD] = values[kTrackPTRD]-(localMomGood[iPlane] ? localMom[iPlane][2] : esdTrack->Pz()); | |
225 | values[kTrackEtaTRD] = (TMath::Abs(values[kTrackPTRD])>1.0e-8 ? (values[kTrackPTRD]+(localMomGood[iPlane] ? localMom[iPlane][2] : esdTrack->Pz()))/values[kTrackEtaTRD] : 0.0); | |
226 | values[kTrackEtaTRD] = (values[kTrackEtaTRD]>1.0e-8 ? 0.5*TMath::Log(values[kTrackEtaTRD]) : -999.); | |
227 | } | |
228 | ||
229 | //____________________________________________________________________ | |
230 | void AliTRDcheckESD::FillTrackletSliceInfo(Double_t* values, AliESDtrack* esdTrack, Int_t iSlice) { | |
231 | // | |
232 | // Fill TRD tracklet info | |
233 | // | |
234 | values[kTrackletPHslice] = esdTrack->GetTRDslice(Int_t(values[kTrackletLayer]), iSlice); | |
235 | values[kTrackletSlice] = iSlice; | |
236 | } | |
237 | ||
238 | //____________________________________________________________________ | |
239 | Bool_t AliTRDcheckESD::IsTrackSelected(AliESDtrack* track, Double_t* /*values*/, Int_t step) { | |
240 | // | |
241 | // Select tracks at each step | |
242 | // | |
243 | Bool_t referenceFilter = fReferenceTrackFilter->IsSelected(track); | |
244 | if(step==kTPCreference) { // reference track filter | |
245 | return referenceFilter; | |
246 | } | |
247 | if(step==kTRD) { // TRD reference track filter | |
248 | return (referenceFilter && track->GetTRDntracklets()>0); | |
249 | } | |
250 | if(step==kTOF) { // TOFpid request | |
251 | return (referenceFilter && track->GetTRDntracklets()>0 && (track->GetStatus() & AliESDtrack::kTOFpid)); | |
252 | } | |
253 | if(step==kTOFin) { // TOFin request | |
254 | return (referenceFilter && (track->GetStatus() & AliESDtrack::kTOFin)); | |
255 | } | |
256 | if(step==kTOFout) { // TOFout request | |
257 | return (referenceFilter && (track->GetStatus() & AliESDtrack::kTOFout)); | |
258 | } | |
259 | return kFALSE; | |
260 | } | |
261 | ||
262 | //____________________________________________________________________ | |
263 | void AliTRDcheckESD::UserCreateOutputObjects() | |
264 | { | |
265 | // | |
266 | // Create Output Containers (TObjectArray containing 1D histograms) | |
267 | // | |
268 | Histos(); | |
269 | PostData(1, fHistos); | |
270 | } | |
271 | ||
272 | //____________________________________________________________________ | |
273 | void AliTRDcheckESD::MakeSummaryFromCF(Double_t* trendValues, const Char_t* /*triggerName*/, Bool_t /*useIsolatedBC*/, Bool_t /*cutTOFbc*/){ | |
274 | // | |
275 | // Draw summary plots for the ESDcheck task using the CF container | |
276 | // | |
277 | ||
278 | cout << "Make summary from CF" << endl; | |
279 | TCanvas *cOut=0x0; | |
280 | if(gROOT->FindObject("trackingSummary")) delete gROOT->FindObject("trackingSummary"); | |
281 | cOut = new TCanvas("trackingSummary", "Tracking summary for the ESD task", 1600, 1200); | |
282 | cOut->cd(); | |
283 | //PlotTrackingSummaryFromCF(trendValues, triggerName, useIsolatedBC, cutTOFbc); | |
284 | PlotTrackingSummaryFromCF(trendValues); | |
285 | cOut->SaveAs("trackingSummary.gif"); | |
286 | ||
287 | if(gROOT->FindObject("pidSummary")) delete gROOT->FindObject("pidSummary"); | |
288 | cOut = new TCanvas("pidSummary", "PID summary for the ESD task", 1600, 1200); | |
289 | cOut->cd(); | |
290 | //PlotPidSummaryFromCF(trendValues, triggerName, useIsolatedBC, cutTOFbc); | |
291 | PlotPidSummaryFromCF(trendValues); | |
292 | cOut->SaveAs("pidSummary.gif"); | |
293 | ||
294 | if(gROOT->FindObject("centSummary")) delete gROOT->FindObject("centSummary"); | |
295 | cOut = new TCanvas("centSummary", "Centrality summary for the ESD task", 1600, 1200); | |
296 | cOut->cd(); | |
297 | //PlotCentSummaryFromCF(trendValues, triggerName, useIsolatedBC, cutTOFbc); | |
298 | PlotCentSummaryFromCF(trendValues); | |
299 | cOut->SaveAs("centSummary.gif"); | |
300 | ||
301 | PlotOtherSummaryFromCF(trendValues); | |
302 | ||
303 | if(trendValues) | |
304 | for(Int_t i=0;i<50;++i) cout << "trend #" << i << " :: " << trendValues[i] << endl; | |
305 | } | |
306 | ||
307 | ||
308 | //____________________________________________________________________ | |
309 | void AliTRDcheckESD::UserExec(Option_t *){ | |
310 | // | |
311 | // Run the Analysis | |
312 | // | |
313 | fESD = dynamic_cast<AliESDEvent*>(InputEvent()); | |
314 | fMC = MCEvent(); | |
315 | ||
316 | if(!fESD){ | |
317 | AliError("ESD event missing."); | |
318 | return; | |
319 | } | |
320 | ||
321 | AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager(); | |
322 | AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler()); | |
323 | if(!inputHandler) return; | |
324 | ||
325 | if(!fPhysSelTriggersEnabled) { | |
326 | InitializeCFContainers(); | |
327 | fPhysSelTriggersEnabled = kTRUE; | |
328 | } | |
329 | ||
330 | UInt_t isSelected = AliVEvent::kAny; | |
331 | if(inputHandler){ | |
332 | if(inputHandler->GetEventSelection()) { | |
333 | isSelected = inputHandler->IsEventSelected(); | |
334 | } | |
335 | } | |
336 | if(!isSelected) return; | |
337 | ||
338 | TString triggerClasses = fESD->GetFiredTriggerClasses(); | |
339 | //cout << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++triggers fired: " << triggerClasses.Data() << endl; | |
340 | TObjArray* triggers = triggerClasses.Tokenize(" "); | |
341 | TObjArray* userTriggers = fUserEnabledTriggers.Tokenize(";"); | |
342 | if(triggers->GetEntries()<1) {delete triggers; delete userTriggers; return;} | |
343 | Bool_t hasGoodTriggers = kFALSE; | |
344 | Int_t triggerIndices[kNMaxAssignedTriggers] = {0}; | |
345 | Int_t nTrigFired=0; | |
346 | Bool_t trigAlreadyChecked = kFALSE; | |
347 | Bool_t trigSelected = kFALSE; | |
348 | Int_t trigIdx = 0; | |
349 | for(Int_t i=0; i<triggers->GetEntries(); ++i) { | |
350 | TString trigStr=triggers->At(i)->GetName(); | |
351 | if(!trigStr.Contains("NOTRD") && !trigStr.Contains("MUON")) hasGoodTriggers = kTRUE; // check wheter TRD was read out in this event | |
352 | if(trigStr.Contains("NOTRD")) continue; | |
353 | if(trigStr.Contains("MUON")) continue; | |
354 | if(i>=kNMaxAssignedTriggers) continue; | |
355 | ||
356 | hasGoodTriggers = kTRUE; | |
357 | // enable the "All triggers" bit | |
358 | trigIdx = 1; | |
359 | trigAlreadyChecked = kFALSE; | |
360 | for(Int_t k=0;k<nTrigFired;++k) | |
361 | if(triggerIndices[k]==trigIdx) { | |
362 | trigAlreadyChecked = kTRUE; | |
363 | break; | |
364 | } | |
365 | if(!trigAlreadyChecked) triggerIndices[nTrigFired++] = trigIdx; | |
366 | ||
367 | trigSelected = kFALSE; | |
368 | // check whether this trigger matches any of the user defined trigger families | |
369 | for(Int_t j=0;j<userTriggers->GetEntries();++j) { | |
370 | TString userTrigStr=userTriggers->At(j)->GetName(); | |
371 | if(trigStr.Contains(userTrigStr.Data())) { | |
372 | trigSelected = kTRUE; | |
373 | trigIdx = GetTriggerIndex(userTrigStr.Data(), kFALSE); | |
374 | trigAlreadyChecked = kFALSE; | |
375 | for(Int_t k=0;k<nTrigFired;++k) | |
376 | if(triggerIndices[k]==trigIdx) { | |
377 | trigAlreadyChecked = kTRUE; | |
378 | break; | |
379 | } | |
380 | if(!trigAlreadyChecked) { // add trigger to the list of enabled triggers only if it was not added already | |
381 | triggerIndices[nTrigFired++] = trigIdx; | |
382 | } | |
383 | } | |
384 | } | |
385 | ||
386 | trigIdx = GetTriggerIndex(trigStr.Data(), kFALSE); | |
387 | if(trigIdx>0) trigSelected = kTRUE; | |
388 | if(trigIdx==-1) trigIdx=1; | |
389 | trigAlreadyChecked = kFALSE; | |
390 | for(Int_t k=0;k<nTrigFired;++k) | |
391 | if(triggerIndices[k]==trigIdx) { | |
392 | trigAlreadyChecked = kTRUE; | |
393 | break; | |
394 | } | |
395 | if(!trigAlreadyChecked) { | |
396 | triggerIndices[nTrigFired++]=1; // 0-assigned to all other triggers | |
397 | } | |
398 | } // end loop over triggers | |
399 | ||
400 | if(!trigSelected && hasGoodTriggers) { | |
401 | triggerIndices[nTrigFired++]=2; | |
402 | } | |
403 | ||
404 | TH1F* hTrig = (TH1F*)fHistos->FindObject("hTriggerDefs"); | |
405 | for(Int_t i=0; i<nTrigFired; ++i) | |
406 | hTrig->Fill(triggerIndices[i]); | |
407 | ||
408 | if(!hasGoodTriggers) { | |
409 | PostData(1, fHistos); | |
410 | delete triggers; | |
411 | delete userTriggers; | |
412 | return; | |
413 | } | |
414 | ||
415 | Int_t* trigFiredIdx=new Int_t[nTrigFired]; | |
416 | for(Int_t i=0;i<nTrigFired;++i) trigFiredIdx[i] = triggerIndices[i]; | |
417 | ||
418 | // Get MC information if available | |
419 | AliStack * fStack = NULL; | |
420 | if(HasMC()){ | |
421 | if(!fMC){ | |
422 | AliWarning("MC event missing"); | |
423 | SetMC(kFALSE); | |
424 | } else { | |
425 | if(!(fStack = fMC->Stack())){ | |
426 | AliWarning("MC stack missing"); | |
427 | SetMC(kFALSE); | |
428 | } | |
429 | } | |
430 | } | |
431 | ||
432 | Double_t values[kNTrdCfVariables]; // array where the CF container variables are stored | |
433 | for(Int_t i=0;i<kNTrdCfVariables; ++i) values[i] = -999.; | |
434 | FillEventInfo(values); | |
435 | ||
436 | Int_t multLimits[6] = {0, 700, 1400, 2100, 2800, 3500}; | |
437 | Int_t centralityClass = 0; | |
438 | for(Int_t iCent=0; iCent<5; ++iCent) { | |
439 | if(values[kEventMult]>=multLimits[iCent] && values[kEventMult]<multLimits[iCent+1]) | |
440 | centralityClass=iCent+1; | |
441 | } | |
442 | if(centralityClass == 0) return; | |
443 | ||
444 | // radius of TRD entrance plane in each layer | |
445 | Double_t rTRD[6] = {298.0, 311.0, 324.0, 337.0, 350.0, 363.0}; | |
446 | ||
447 | AliESDtrack *esdTrack(NULL); | |
448 | for(Int_t itrk = 0; itrk < fESD->GetNumberOfTracks(); itrk++){ | |
449 | esdTrack = fESD->GetTrack(itrk); | |
450 | ||
451 | Bool_t stepSelections[kNSteps]; | |
452 | for(Int_t is=0;is<kNSteps;++is) { | |
453 | stepSelections[is] = IsTrackSelected(esdTrack, values, is); | |
454 | } | |
455 | if(!stepSelections[0]) continue; | |
456 | ||
457 | FillTrackInfo(values, esdTrack); | |
458 | ||
459 | // find position and momentum of the track at entrance in TRD | |
460 | const AliExternalTrackParam *outerParam = esdTrack->GetOuterParam(); | |
461 | Double_t localCoord[6][3] = {{0.0}}; | |
462 | Bool_t localCoordGood[6]; | |
463 | for(Int_t il=0;il<6;++il) | |
464 | localCoordGood[il] = (outerParam ? outerParam : esdTrack)->GetXYZAt(rTRD[il], fESD->GetMagneticField(), localCoord[il]); | |
465 | Double_t localMom[6][3] = {{0.0}}; | |
466 | Bool_t localMomGood[6]; | |
467 | for(Int_t il=0; il<6; ++il) | |
468 | localMomGood[il] = (outerParam ? outerParam : esdTrack)->GetPxPyPzAt(rTRD[il], fESD->GetMagneticField(), localMom[il]); | |
469 | Double_t localSagitaPhi[6] = {-999.}; | |
470 | for(Int_t il=0; il<6; ++il) | |
471 | localSagitaPhi[il] = (localCoordGood[il] ? TMath::ATan2(localCoord[il][1], localCoord[il][0]) : -999.); | |
472 | if(!localMomGood[0]) continue; | |
473 | ||
474 | FillTrackletInfo(values, esdTrack, 0, localSagitaPhi, localMom, localMomGood); | |
475 | ||
476 | for(Int_t itrig=0; itrig<nTrigFired; ++itrig) { | |
477 | values[kEventTrigger] = Double_t(trigFiredIdx[itrig]); | |
478 | ||
479 | // check if cf needs tracklet or slice info | |
480 | FillGlobalTrackContainers(values, stepSelections, itrig); | |
481 | ||
482 | for(Int_t iPlane=0; iPlane<6; iPlane++) { | |
483 | FillTrackletInfo(values, esdTrack, iPlane, localSagitaPhi, localMom, localMomGood); | |
484 | if(values[kTrackletQtot]>20.0) FillTrdTrackletContainers(values, stepSelections, itrig); | |
485 | ||
486 | for(Int_t iSlice=0; iSlice<8; iSlice++) { | |
487 | FillTrackletSliceInfo(values, esdTrack, iSlice); | |
488 | if(values[kTrackletPHslice]>20.0) FillTrdSliceContainers(values, stepSelections, itrig); | |
489 | } // end loop over slices | |
490 | } // end loop over TRD layers | |
491 | } // end loop over triggers | |
492 | } // end loop over tracks | |
493 | ||
494 | delete triggers; | |
495 | delete userTriggers; | |
496 | delete [] trigFiredIdx; | |
497 | ||
498 | PostData(1, fHistos); | |
499 | } | |
500 | ||
501 | //____________________________________________________________________ | |
502 | TObjArray* AliTRDcheckESD::Histos() | |
503 | { | |
504 | // Retrieve histograms array if already build or build it | |
505 | if(!fHistos) { | |
506 | fHistos = new TObjArray(); | |
507 | fHistos->SetOwner(kTRUE); | |
508 | } | |
509 | ||
510 | TH1* h = 0x0; | |
511 | // Trigger definitions | |
512 | if(!(h=(TH1F*)gROOT->FindObject("hTriggerDefs"))) { | |
513 | h = new TH1F("hTriggerDefs", "Trigger definitions", kNMaxAssignedTriggers, 0.5, 0.5+Float_t(kNMaxAssignedTriggers)); | |
514 | } | |
515 | else h->Reset(); | |
516 | fHistos->Add(h); | |
517 | ||
518 | return fHistos; | |
519 | } | |
520 | ||
521 | ||
522 | //__________________________________________________________________________________________________________ | |
523 | void AliTRDcheckESD::InitializeCFContainers() { | |
524 | // | |
525 | // Initialize the CF container | |
526 | // | |
527 | AliAnalysisManager* man=AliAnalysisManager::GetAnalysisManager(); | |
528 | AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler()); | |
529 | if(!inputHandler) return; | |
530 | ||
531 | GetTriggerIndex("All triggers", kTRUE); | |
532 | GetTriggerIndex("Not specified triggers", kTRUE); | |
533 | ||
534 | AliPhysicsSelection* physSel = (AliPhysicsSelection*)inputHandler->GetEventSelection(); | |
535 | const TList* trigList = (physSel ? physSel->GetCollisionTriggerClasses() : 0x0); | |
536 | const TList* bgTrigList = (physSel ? physSel->GetBGTriggerClasses() : 0x0); | |
537 | ||
538 | // Add collision triggers from PhysicsSelection | |
539 | if(trigList) { | |
540 | for(Int_t it=0; it<trigList->GetEntries(); ++it) { | |
541 | TString trigName = trigList->At(it)->GetName(); | |
542 | TObjArray* arr = trigName.Tokenize(" "); | |
543 | trigName = arr->At(0)->GetName(); | |
544 | trigName.Remove(0,1); | |
545 | TObjArray* arr2 = trigName.Tokenize(","); | |
546 | for(Int_t jt=0; jt<arr2->GetEntries(); ++jt) { | |
547 | // Assign an index into the trigger histogram and the CF container for this trigger | |
548 | GetTriggerIndex(arr2->At(jt)->GetName(), kTRUE); | |
549 | } | |
550 | delete arr; | |
551 | } | |
552 | } | |
553 | // Add background triggers from PhysicsSelection | |
554 | if(bgTrigList) { | |
555 | for(Int_t it=0; it<bgTrigList->GetEntries(); ++it) { | |
556 | TString trigName = bgTrigList->At(it)->GetName(); | |
557 | TObjArray* arr = trigName.Tokenize(" "); | |
558 | trigName = arr->At(0)->GetName(); | |
559 | trigName.Remove(0,1); | |
560 | TObjArray* arr2 = trigName.Tokenize(","); | |
561 | for(Int_t jt=0; jt<arr2->GetEntries(); ++jt) { | |
562 | // Assign an index into the trigger histogram and the CF container for this trigger | |
563 | GetTriggerIndex(arr2->At(jt)->GetName(), kTRUE); | |
564 | } | |
565 | delete arr; | |
566 | } | |
567 | } | |
568 | ||
569 | // Add user enabled triggers | |
570 | TObjArray* arr = fUserEnabledTriggers.Tokenize(";"); | |
571 | for(Int_t it=0; it<arr->GetEntries(); ++it) { | |
572 | GetTriggerIndex(arr->At(it)->GetName(), kTRUE); | |
573 | } | |
574 | delete arr; | |
575 | } | |
576 | ||
577 | ||
578 | //__________________________________________________________________________________________________________ | |
579 | void AliTRDcheckESD::AddCFContainer(const Char_t* name, const Char_t* title, | |
580 | Int_t nSteps, Int_t* steps, | |
581 | Int_t nVars, UInt_t* vars, TArrayD* binLimits) { | |
582 | // | |
583 | // Add a CF container | |
584 | // | |
585 | if(!fHistos) { | |
586 | fHistos = new TObjArray(); | |
587 | fHistos->SetOwner(kTRUE); | |
588 | } | |
589 | // get number of bins for each variable | |
590 | Int_t* nBins = new Int_t[nVars]; | |
591 | for(Int_t iv=0;iv<nVars;++iv) | |
592 | nBins[iv] = binLimits[iv].GetSize()-1; | |
593 | // create the CF container | |
594 | AliCFContainer* cf = new AliCFContainer(name, title, nSteps, nVars, nBins); | |
595 | // set CF container variable binning and name | |
596 | for(Int_t iv=0;iv<nVars;++iv) { | |
597 | cf->SetBinLimits(iv, binLimits[iv].GetArray()); | |
598 | cf->SetVarTitle(iv, fgkVarNames[vars[iv]]); | |
599 | } | |
600 | // set the step names | |
601 | for(Int_t is=0; is<nSteps; ++is) { | |
602 | cf->SetStepTitle(is, fgkStepNames[steps[is]]); | |
603 | for(Int_t iv=0;iv<nVars;++iv) cf->GetAxis(iv, is)->SetUniqueID(vars[iv]); | |
604 | } | |
605 | fHistos->Add(cf); | |
606 | } | |
607 | ||
608 | //__________________________________________________________________________________________________ | |
609 | void AliTRDcheckESD::FillTrdSliceContainers(Double_t* values, Bool_t* stepSelections, Int_t itrig) { | |
610 | // | |
611 | // fill TRD slice info | |
612 | // | |
613 | if(!fHistos) return; | |
614 | for(Int_t i=0;i<fHistos->GetEntries();++i) { | |
615 | TString objType = fHistos->At(i)->IsA()->GetName(); | |
616 | if(!objType.Contains("AliCFContainer")) continue; | |
617 | AliCFContainer* cf = (AliCFContainer*)fHistos->At(i); | |
618 | if(cf->GetVar(fgkVarNames[kTrackletSlice])<0 && cf->GetVar(fgkVarNames[kTrackletPHslice])<0) continue; | |
619 | if((cf->GetVar(fgkVarNames[kEventTrigger])<0 && itrig==0) || (cf->GetVar(fgkVarNames[kEventTrigger])>=0)) | |
620 | FillCFContainer(cf, values, stepSelections); | |
621 | } | |
622 | } | |
623 | ||
624 | //__________________________________________________________________________________________________ | |
625 | void AliTRDcheckESD::FillTrdTrackletContainers(Double_t* values, Bool_t* stepSelections, Int_t itrig) { | |
626 | // | |
627 | // fill global track info | |
628 | // | |
629 | if(!fHistos) return; | |
630 | for(Int_t i=0;i<fHistos->GetEntries();++i) { | |
631 | TString objType = fHistos->At(i)->IsA()->GetName(); | |
632 | if(!objType.Contains("AliCFContainer")) continue; | |
633 | AliCFContainer* cf = (AliCFContainer*)fHistos->At(i); | |
634 | if(cf->GetVar(fgkVarNames[kTrackletSlice])>=0 || cf->GetVar(fgkVarNames[kTrackletPHslice])>=0) continue; | |
635 | if(cf->GetVar(fgkVarNames[kTrackletLayer])<0 && cf->GetVar(fgkVarNames[kTrackletQtot])<0) continue; | |
636 | if((cf->GetVar(fgkVarNames[kEventTrigger])<0 && itrig==0) || (cf->GetVar(fgkVarNames[kEventTrigger])>=0)) | |
637 | FillCFContainer(cf, values, stepSelections); | |
638 | } | |
639 | } | |
640 | ||
641 | //__________________________________________________________________________________________________ | |
642 | void AliTRDcheckESD::FillGlobalTrackContainers(Double_t* values, Bool_t* stepSelections, Int_t itrig) { | |
643 | // | |
644 | // fill global track info | |
645 | // | |
646 | if(!fHistos) return; | |
647 | for(Int_t i=0;i<fHistos->GetEntries();++i) { | |
648 | TString objType = fHistos->At(i)->IsA()->GetName(); | |
649 | if(!objType.Contains("AliCFContainer")) continue; | |
650 | AliCFContainer* cf = (AliCFContainer*)fHistos->At(i); | |
651 | if(cf->GetVar(fgkVarNames[kTrackletLayer])>=0 || | |
652 | cf->GetVar(fgkVarNames[kTrackletSlice])>=0 || | |
653 | cf->GetVar(fgkVarNames[kTrackletQtot])>=0 || | |
654 | cf->GetVar(fgkVarNames[kTrackletPHslice])>=0) continue; | |
655 | if((cf->GetVar(fgkVarNames[kEventTrigger])<0 && itrig==0) || | |
656 | (cf->GetVar(fgkVarNames[kEventTrigger])>=0)) | |
657 | FillCFContainer(cf, values, stepSelections); | |
658 | } | |
659 | } | |
660 | ||
661 | //__________________________________________________________________________________________________ | |
662 | void AliTRDcheckESD::FillCFContainer(AliCFContainer* cf, Double_t* values, Bool_t* stepSelections) { | |
663 | // | |
664 | // Fill CF container | |
665 | // | |
666 | Double_t* cfValues=new Double_t[cf->GetNVar()]; | |
667 | for(Int_t iv=0;iv<cf->GetNVar();++iv) | |
668 | cfValues[iv] = values[cf->GetAxis(iv,0)->GetUniqueID()]; | |
669 | ||
670 | for(Int_t istep=0; istep<cf->GetNStep(); ++istep) { | |
671 | TString stepTitle = cf->GetStepTitle(istep); | |
672 | Int_t stepNo = -1; | |
673 | for(Int_t is=0;is<kNSteps;++is) | |
674 | if(!stepTitle.CompareTo(fgkStepNames[is])) { | |
675 | stepNo = is; | |
676 | break; | |
677 | } | |
678 | if(stepSelections[stepNo]) cf->Fill(cfValues, istep); | |
679 | } // end loop over steps | |
680 | } | |
681 | ||
682 | //____________________________________________________________________ | |
683 | Bool_t AliTRDcheckESD::Load(const Char_t *file, const Char_t *dir, const Char_t *name) | |
684 | { | |
685 | // | |
686 | // Load data from performance file | |
687 | // | |
688 | if(!TFile::Open(file)){ | |
689 | AliWarning(Form("Couldn't open file %s.", file)); | |
690 | return kFALSE; | |
691 | } | |
692 | if(dir){ | |
693 | if(!gFile->cd(dir)){ | |
694 | AliWarning(Form("Couldn't cd to %s in %s.", dir, file)); | |
695 | return kFALSE; | |
696 | } | |
697 | } | |
698 | TObjArray *o(NULL); | |
699 | const Char_t *tn=(name ? name : GetName()); | |
700 | if(!(o = (TObjArray*)gDirectory->Get(tn))){ | |
701 | AliWarning(Form("Missing histogram container %s.", tn)); | |
702 | return kFALSE; | |
703 | } | |
704 | fHistos = (TObjArray*)o->Clone(GetName()); | |
705 | ||
706 | TH1F* trigHist = (TH1F*)fHistos->FindObject("hTriggerDefs"); | |
707 | for(Int_t i=1;i<=trigHist->GetXaxis()->GetNbins();++i) { | |
708 | if(trigHist->GetXaxis()->GetBinLabel(i)[0]!='\0') ++fNAssignedTriggers; | |
709 | } | |
710 | gFile->Close(); | |
711 | return kTRUE; | |
712 | } | |
713 | ||
714 | //_______________________________________________________ | |
715 | Bool_t AliTRDcheckESD::PutTrendValue(const Char_t *name, Double_t val) | |
716 | { | |
717 | // Dump trending value to default file | |
718 | ||
719 | if(!fgFile){ | |
720 | fgFile = fopen("TRD.Performance.txt", "at"); | |
721 | } | |
722 | fprintf(fgFile, "%s_%s %f\n", GetName(), name, val); | |
723 | return kTRUE; | |
724 | } | |
725 | ||
726 | //____________________________________________________________________ | |
727 | void AliTRDcheckESD::Terminate(Option_t *) | |
728 | { | |
729 | // Steer post-processing | |
730 | if(!fHistos){ | |
731 | fHistos = dynamic_cast<TObjArray *>(GetOutputData(1)); | |
732 | if(!fHistos){ | |
733 | AliError("Histogram container not found in output"); | |
734 | return; | |
735 | } | |
736 | } | |
737 | } | |
738 | ||
739 | //____________________________________________________________________ | |
740 | Int_t AliTRDcheckESD::Pdg2Idx(Int_t pdg) const | |
741 | { | |
742 | // | |
743 | // Helper function converting PDG code into AliPID index | |
744 | // | |
745 | switch(pdg){ | |
746 | case kElectron: | |
747 | case kPositron: return AliPID::kElectron; | |
748 | case kMuonPlus: | |
749 | case kMuonMinus: return AliPID::kMuon; | |
750 | case kPiPlus: | |
751 | case kPiMinus: return AliPID::kPion; | |
752 | case kKPlus: | |
753 | case kKMinus: return AliPID::kKaon; | |
754 | case kProton: | |
755 | case kProtonBar: return AliPID::kProton; | |
756 | } | |
757 | return -1; | |
758 | } | |
759 | ||
760 | ||
761 | //________________________________________________________ | |
762 | void AliTRDcheckESD::Process2D(TH2 * const h2, TGraphErrors **g) | |
763 | { | |
764 | // | |
765 | // Do the processing | |
766 | // | |
767 | ||
768 | Int_t n = 0; | |
769 | if((n=g[0]->GetN())) for(;n--;) g[0]->RemovePoint(n); | |
770 | if((n=g[1]->GetN())) for(;n--;) g[1]->RemovePoint(n); | |
771 | TF1 f("fg", "gaus", -3.,3.); | |
772 | for(Int_t ibin = 1; ibin <= h2->GetNbinsX(); ibin++){ | |
773 | Double_t x = h2->GetXaxis()->GetBinCenter(ibin); | |
774 | TH1D *h = h2->ProjectionY("py", ibin, ibin); | |
775 | if(h->GetEntries()<100) continue; | |
776 | //AdjustF1(h, f); | |
777 | ||
778 | h->Fit(&f, "QN"); | |
779 | Int_t ip = g[0]->GetN(); | |
780 | g[0]->SetPoint(ip, x, f.GetParameter(1)); | |
781 | g[0]->SetPointError(ip, 0., f.GetParError(1)); | |
782 | g[1]->SetPoint(ip, x, f.GetParameter(2)); | |
783 | g[1]->SetPointError(ip, 0., f.GetParError(2)); | |
784 | } | |
785 | return; | |
786 | } | |
787 | //____________________________________________________________________ | |
788 | void AliTRDcheckESD::PrintStatus(ULong_t status) | |
789 | { | |
790 | // Dump track status to stdout | |
791 | ||
792 | printf("ITS[i(%d) o(%d) r(%d)] TPC[i(%d) o(%d) r(%d) p(%d)] TRD[i(%d) o(%d) r(%d) p(%d) s(%d)] HMPID[o(%d) p(%d)]\n" | |
793 | ,Bool_t(status & AliESDtrack::kITSin) | |
794 | ,Bool_t(status & AliESDtrack::kITSout) | |
795 | ,Bool_t(status & AliESDtrack::kITSrefit) | |
796 | ,Bool_t(status & AliESDtrack::kTPCin) | |
797 | ,Bool_t(status & AliESDtrack::kTPCout) | |
798 | ,Bool_t(status & AliESDtrack::kTPCrefit) | |
799 | ,Bool_t(status & AliESDtrack::kTPCpid) | |
800 | ,Bool_t(status & AliESDtrack::kTRDin) | |
801 | ,Bool_t(status & AliESDtrack::kTRDout) | |
802 | ,Bool_t(status & AliESDtrack::kTRDrefit) | |
803 | ,Bool_t(status & AliESDtrack::kTRDpid) | |
804 | ,Bool_t(status & AliESDtrack::kTRDStop) | |
805 | ,Bool_t(status & AliESDtrack::kHMPIDout) | |
806 | ,Bool_t(status & AliESDtrack::kHMPIDpid) | |
807 | ); | |
808 | } | |
809 | ||
810 | //____________________________________________________________________ | |
811 | TH1D* AliTRDcheckESD::Proj2D(TH2* hist, TH1* mpvErr, TH1* widthErr, TH1* chi2) { | |
812 | // | |
813 | // project the PH vs Slice 2D-histo into a 1D histo with Landau MPV and widths | |
814 | // | |
815 | ||
816 | TH1D* hProjection = (TH1D*)hist->ProjectionX(Form("hProjection_%f", gRandom->Rndm())); | |
817 | hProjection->Reset(); | |
818 | ||
819 | TF1* fitLandau = new TF1("landauFunc","landau",20.,3000.); | |
820 | TH1D *hD; | |
821 | for(Int_t iBin=1;iBin<=hist->GetXaxis()->GetNbins();iBin++) { | |
822 | if(gROOT->FindObject("projection")) | |
823 | delete gROOT->FindObject("projection"); | |
824 | hD = (TH1D*)hist->ProjectionY("projection",iBin,iBin); | |
825 | //hD->Rebin(4); | |
826 | if(hD->Integral()>10) { | |
827 | fitLandau->SetParameter(1, hD->GetBinCenter(hD->GetMaximumBin())); | |
828 | fitLandau->SetParLimits(1, 0.2*hD->GetBinCenter(hD->GetMaximumBin()), 3.0*hD->GetBinCenter(hD->GetMaximumBin())); | |
829 | fitLandau->SetParameter(0, 1000.); | |
830 | fitLandau->SetParLimits(0, 1., 10000000.); | |
831 | fitLandau->SetParameter(2, 0.5*hD->GetBinCenter(hD->GetMaximumBin())); | |
832 | fitLandau->SetParLimits(2, 0.01*hD->GetBinCenter(hD->GetMaximumBin()), 1.0*hD->GetRMS()); | |
833 | hD->Fit(fitLandau, "Q0", "", hD->GetXaxis()->GetXmin(), hD->GetXaxis()->GetXmax()); | |
834 | hD->Fit(fitLandau, "Q0", "", hD->GetXaxis()->GetXmin(), hD->GetXaxis()->GetXmax()); | |
835 | hProjection->SetBinContent(iBin, fitLandau->GetParameter(1)); | |
836 | hProjection->SetBinError(iBin, fitLandau->GetParameter(2)); | |
837 | if(mpvErr) { | |
838 | mpvErr->SetBinContent(iBin, fitLandau->GetParameter(1)); | |
839 | mpvErr->SetBinError(iBin, fitLandau->GetParError(1)); | |
840 | } | |
841 | if(widthErr) { | |
842 | widthErr->SetBinContent(iBin, fitLandau->GetParameter(2)); | |
843 | widthErr->SetBinError(iBin, fitLandau->GetParError(2)); | |
844 | } | |
845 | if(chi2) { | |
846 | chi2->SetBinContent(iBin, (fitLandau->GetNDF()>0 ? fitLandau->GetChisquare()/Double_t(fitLandau->GetNDF()) : 0.0)); | |
847 | } | |
848 | } | |
849 | else{ | |
850 | hProjection->SetBinContent(iBin, 0); | |
851 | hProjection->SetBinError(iBin, 0); | |
852 | } | |
853 | } | |
854 | return hProjection; | |
855 | } | |
856 | ||
857 | //____________________________________________________________________ | |
858 | TH2F* AliTRDcheckESD::Proj3D(TH3* hist, TH2* accMap, Int_t zbinLow, Int_t zbinHigh, Float_t &entries) { | |
859 | // | |
860 | // Project a 3D histogram to a 2D histogram in the Z axis interval [zbinLow,zbinHigh] | |
861 | // Return the 2D histogram and also the number of entries into this projection (entries) | |
862 | ||
863 | Int_t nBinsX = hist->GetXaxis()->GetNbins(); // X and Y axis bins are assumed to be all equal | |
864 | Float_t minX = hist->GetXaxis()->GetXmin(); | |
865 | Float_t maxX = hist->GetXaxis()->GetXmax(); | |
866 | Int_t nBinsY = hist->GetYaxis()->GetNbins(); | |
867 | Float_t minY = hist->GetYaxis()->GetXmin(); | |
868 | Float_t maxY = hist->GetYaxis()->GetXmax(); | |
869 | Int_t nBinsZ = hist->GetZaxis()->GetNbins(); // Z axis bins (pt) might have different widths | |
870 | ||
871 | TH2F* projHisto = (TH2F*)gROOT->FindObject("projHisto"); | |
872 | if(projHisto) | |
873 | projHisto->Reset(); | |
874 | else | |
875 | projHisto = new TH2F("projHisto", "projection", nBinsX, minX, maxX, nBinsY, minY, maxY); | |
876 | ||
877 | for(Int_t iZ=1; iZ<=nBinsZ; iZ++) { | |
878 | if(iZ<zbinLow) continue; | |
879 | if(iZ>zbinHigh) continue; | |
880 | for(Int_t iX=1; iX<=nBinsX; iX++) { | |
881 | for(Int_t iY=1; iY<=nBinsY; iY++) { | |
882 | if(accMap) { | |
883 | if(accMap->GetBinContent(iX,iY)>0.1) | |
884 | projHisto->SetBinContent(iX, iY, projHisto->GetBinContent(iX, iY)+hist->GetBinContent(iX,iY,iZ)); | |
885 | } | |
886 | else // no acc. cut | |
887 | projHisto->SetBinContent(iX, iY, projHisto->GetBinContent(iX, iY)+hist->GetBinContent(iX,iY,iZ)); | |
888 | // count only the entries which are inside the acceptance map | |
889 | if(accMap) { | |
890 | if(accMap->GetBinContent(iX,iY)>0.1) | |
891 | entries+=hist->GetBinContent(iX,iY,iZ); | |
892 | } | |
893 | else // no acc. cut | |
894 | entries+=hist->GetBinContent(iX,iY,iZ); | |
895 | } | |
896 | } | |
897 | } | |
898 | return projHisto; | |
899 | } | |
900 | ||
901 | //____________________________________________________________________ | |
902 | void AliTRDcheckESD::CheckActiveSM(TH1D* phiProj, Bool_t activeSM[18]) { | |
903 | // | |
904 | // Check the active super-modules | |
905 | // | |
906 | Double_t entries[18] = {0.0}; | |
907 | Double_t smPhiLimits[19]; | |
908 | for(Int_t ism=0; ism<=18; ++ism) smPhiLimits[ism] = -TMath::Pi() + (2.0*TMath::Pi()/18.0)*ism; | |
909 | for(Int_t phiBin=1; phiBin<=phiProj->GetXaxis()->GetNbins(); ++phiBin) { | |
910 | Double_t phi = phiProj->GetBinCenter(phiBin); | |
911 | Int_t sm = -1; | |
912 | for(Int_t ism=0; ism<18; ++ism) | |
913 | if(phi>=smPhiLimits[ism] && phi<smPhiLimits[ism+1]) sm = ism; | |
914 | if(sm==-1) continue; | |
915 | entries[sm] += phiProj->GetBinContent(phiBin); | |
916 | } | |
917 | Double_t avEntries = Double_t(phiProj->Integral())/18.0; | |
918 | for(Int_t ism=0; ism<18; ++ism) | |
919 | if(entries[ism]>0.5*avEntries) activeSM[ism] = kTRUE; | |
920 | } | |
921 | ||
922 | ||
923 | //__________________________________________________________________________________________________ | |
924 | TH1F* AliTRDcheckESD::EfficiencyFromPhiPt(AliCFContainer* cf, Int_t minNtrkl, Int_t maxNtrkl, | |
925 | Int_t stepNom, Int_t stepDenom, Int_t var) { | |
926 | // | |
927 | // Use the CF container to extract the efficiency vs pt (other variable beside pt also posible) | |
928 | // | |
929 | Int_t varTrackPhi = cf->GetVar(fgkVarNames[kTrackPhiTRD]); | |
930 | Int_t otherVar = cf->GetVar(fgkVarNames[var]); | |
931 | ||
932 | TH1D* phiProj = (TH1D*)cf->Project(kTRD, varTrackPhi); | |
933 | Bool_t activeSM[18] = {kFALSE}; | |
934 | CheckActiveSM(phiProj, activeSM); delete phiProj; | |
935 | Double_t smPhiLimits[19]; | |
936 | for(Int_t ism=0; ism<=18; ++ism) smPhiLimits[ism] = -TMath::Pi() + (2.0*TMath::Pi()/18.0)*ism; | |
937 | ||
938 | if((stepNom==kTRD || stepDenom==kTRD) && | |
939 | (minNtrkl>-1 && minNtrkl<7 && maxNtrkl>-1 && maxNtrkl<7)) | |
940 | cf->SetRangeUser(cf->GetVar(fgkVarNames[kTrackTrdTracklets]), Double_t(minNtrkl), Double_t(maxNtrkl)); | |
941 | ||
942 | TH2D* hNomPhiVar = (TH2D*)cf->Project(stepNom, otherVar, varTrackPhi); | |
943 | TH2D* hDenomPhiVar = (TH2D*)cf->Project(stepDenom, otherVar, varTrackPhi); | |
944 | if((stepNom==kTRD || stepDenom==kTRD) && | |
945 | (minNtrkl>-1 && minNtrkl<7 && maxNtrkl>-1 && maxNtrkl<7)) | |
946 | cf->SetRangeUser(cf->GetVar(fgkVarNames[kTrackTrdTracklets]), 0.0,6.0); | |
947 | ||
948 | TH1F* hEff = new TH1F(Form("hEff%s_%d_%d_%f", fgkVarNames[var], stepNom, stepDenom, gRandom->Rndm()), "", | |
949 | hNomPhiVar->GetXaxis()->GetNbins(), hNomPhiVar->GetXaxis()->GetXbins()->GetArray()); | |
950 | for(Int_t ib=1;ib<=hNomPhiVar->GetXaxis()->GetNbins();++ib) | |
951 | hEff->GetXaxis()->SetBinLabel(ib, hNomPhiVar->GetXaxis()->GetBinLabel(ib)); | |
952 | ||
953 | for(Int_t ivar=1; ivar<=hEff->GetXaxis()->GetNbins(); ++ivar) { | |
954 | Double_t nom = 0.0; Double_t denom = 0.0; | |
955 | Double_t eff = 0.0; Double_t err = 0.0; | |
956 | for(Int_t iphi=1; iphi<=hNomPhiVar->GetYaxis()->GetNbins(); ++iphi) { | |
957 | Double_t phi = hNomPhiVar->GetYaxis()->GetBinCenter(iphi); | |
958 | Bool_t isActive = kFALSE; | |
959 | for(Int_t ism=0; ism<18; ++ism) | |
960 | if(phi>=smPhiLimits[ism] && phi<smPhiLimits[ism+1] && activeSM[ism]) | |
961 | isActive = kTRUE; | |
962 | if(!isActive) continue; | |
963 | nom += hNomPhiVar->GetBinContent(ivar, iphi); | |
964 | denom += hDenomPhiVar->GetBinContent(ivar, iphi); | |
965 | } | |
966 | eff = (denom>0.001 ? nom/denom : 0.0); | |
967 | err = (denom>0.001 && (denom-nom)>0.001 && nom>0.001 ? (TMath::Sqrt(nom*(denom-nom)/denom/denom/denom)) : 0.0); | |
968 | hEff->SetBinContent(ivar, eff); | |
969 | hEff->SetBinError(ivar, err); | |
970 | } // end loop over pt bins | |
971 | delete hNomPhiVar; delete hDenomPhiVar; | |
972 | return hEff; | |
973 | } | |
974 | ||
975 | ||
976 | //____________________________________________________________________ | |
977 | TH1F* AliTRDcheckESD::EfficiencyTRD(TH3* tpc3D, TH3* trd3D, Bool_t useAcceptance) { | |
978 | // | |
979 | // Calculate the TRD-TPC matching efficiency as function of pt | |
980 | // | |
981 | ||
982 | if(!tpc3D || !trd3D) return NULL; | |
983 | Int_t nBinsZ = trd3D->GetZaxis()->GetNbins(); | |
984 | // project everything on the eta-phi map to obtain an acceptance map | |
985 | Float_t nada = 0.; | |
986 | TH2F *trdAcc = (useAcceptance ? (TH2F*)Proj3D(trd3D, 0x0, 1, nBinsZ, nada)->Clone(Form("trdAcc%f", gRandom->Rndm())) : 0x0); | |
987 | TH1D *phiProj = (trdAcc ? trdAcc->ProjectionY(Form("phiProj%f", gRandom->Rndm())) : 0x0); | |
988 | ||
989 | // prepare the acceptance map | |
990 | Bool_t activeSM[18] = {kFALSE}; | |
991 | Double_t smPhiLimits[19]; | |
992 | for(Int_t ism=0; ism<=18; ++ism) smPhiLimits[ism] = -TMath::Pi() + (2.0*TMath::Pi()/18.0)*ism; | |
993 | if(phiProj) { | |
994 | CheckActiveSM(phiProj, activeSM); // get the active SMs | |
995 | trdAcc->Reset(); | |
996 | // Put 1 entry in every bin which belongs to an active SM | |
997 | for(Int_t iY=1; iY<=trdAcc->GetYaxis()->GetNbins(); ++iY) { | |
998 | Double_t phi = trdAcc->GetYaxis()->GetBinCenter(iY); | |
999 | Bool_t isActive = kFALSE; | |
1000 | for(Int_t ism=0; ism<18; ++ism) { | |
1001 | if(phi>=smPhiLimits[ism] && phi<smPhiLimits[ism+1] && activeSM[ism]) { | |
1002 | isActive = kTRUE; | |
1003 | } | |
1004 | } | |
1005 | if(!isActive) continue; | |
1006 | for(Int_t iX=1; iX<=trdAcc->GetXaxis()->GetNbins(); ++iX) | |
1007 | if(trdAcc->GetXaxis()->GetBinCenter(iX)>=-0.85 && trdAcc->GetXaxis()->GetBinCenter(iX)<=0.85) trdAcc->SetBinContent(iX, iY, 1.0); | |
1008 | } // end for over Y(phi) bins | |
1009 | } // end if phiProj | |
1010 | ||
1011 | // get the bin limits from the Z axis of 3D histos | |
1012 | Float_t *ptBinLimits = new Float_t[nBinsZ+1]; | |
1013 | for(Int_t i=1; i<=nBinsZ; i++) { | |
1014 | ptBinLimits[i-1] = trd3D->GetZaxis()->GetBinLowEdge(i); | |
1015 | } | |
1016 | ptBinLimits[nBinsZ] = trd3D->GetZaxis()->GetBinUpEdge(nBinsZ); | |
1017 | ||
1018 | TH1F *efficiency = new TH1F(Form("eff%d", Int_t(1000000.0*gRandom->Rndm())), "TRD-TPC matching efficiency", nBinsZ, ptBinLimits); | |
1019 | ||
1020 | // loop over Z bins | |
1021 | Bool_t effGood = kFALSE; | |
1022 | for(Int_t i=1; i<=nBinsZ; i++) { | |
1023 | Float_t tpcEntries = 0.0; Float_t trdEntries = 0.0; | |
1024 | Proj3D(tpc3D, trdAcc, i, i, tpcEntries); | |
1025 | Proj3D(trd3D, trdAcc, i, i, trdEntries); | |
1026 | Float_t ratio = 0; | |
1027 | if(tpcEntries>0) ratio = trdEntries/tpcEntries; | |
1028 | Float_t error = 0; | |
1029 | if(tpcEntries>0 && trdEntries>0 && (tpcEntries-trdEntries)>=0.0) | |
1030 | error = TMath::Sqrt(trdEntries*(tpcEntries-trdEntries)/tpcEntries/tpcEntries/tpcEntries); | |
1031 | if(ratio>0.001) { | |
1032 | efficiency->SetBinContent(i,ratio); | |
1033 | efficiency->SetBinError(i,error); | |
1034 | effGood = kTRUE; | |
1035 | } | |
1036 | } // end loop over Z bins | |
1037 | if(!effGood) return 0x0; | |
1038 | ||
1039 | return efficiency; | |
1040 | } | |
1041 | ||
1042 | ||
1043 | //__________________________________________________________________________________________________ | |
1044 | void AliTRDcheckESD::PlotCentSummaryFromCF(Double_t* /*trendValues*/, const Char_t* /*triggerName*/, Bool_t /*useIsolatedBC*/, Bool_t /*cutTOFbc*/) { | |
1045 | // | |
1046 | // Make the centrality summary figure from the CF container | |
1047 | // | |
1048 | if(!fHistos) return; | |
1049 | AliCFContainer* matchPt=(AliCFContainer*)fHistos->FindObject("MatchingPt"); | |
1050 | if(!matchPt) return; | |
1051 | AliCFContainer* centCF=(AliCFContainer*)fHistos->FindObject("CentralityCF"); | |
1052 | if(!centCF) return; | |
1053 | ||
1054 | TLatex* lat=new TLatex(); | |
1055 | lat->SetTextSize(0.06); | |
1056 | lat->SetTextColor(2); | |
1057 | ||
1058 | gPad->SetTopMargin(0.05); gPad->SetBottomMargin(0.001); gPad->SetLeftMargin(0.001); gPad->SetRightMargin(0.001); | |
1059 | gPad->Divide(3,3,0.,0.); | |
1060 | TList* l=gPad->GetListOfPrimitives(); | |
1061 | TVirtualPad* pad=0x0; | |
1062 | ||
1063 | if(gROOT->FindObject("rangeEffPt")) delete gROOT->FindObject("rangeEffPt"); | |
1064 | TH2F* rangeEffPt=new TH2F("rangeEffPt", "",10,0.,10.,10,0.,1.3); | |
1065 | rangeEffPt->SetStats(kFALSE); | |
1066 | SetStyle(rangeEffPt->GetXaxis(), "p_{T} [GeV/c]", 0.07, 0.8, kTRUE, 0.05); | |
1067 | SetStyle(rangeEffPt->GetYaxis(), "efficiency", 0.07, 0.8, kTRUE, 0.05); | |
1068 | ||
1069 | Int_t padsForEffs[5] = {0,3,6,1,4}; | |
1070 | for(Int_t iCent=1; iCent<6; ++iCent) { | |
1071 | pad = ((TVirtualPad*)l->At(padsForEffs[iCent-1])); pad->cd(); | |
1072 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.02); pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15); | |
1073 | pad->SetGridx(kFALSE); pad->SetGridy(kFALSE); | |
1074 | rangeEffPt->Draw(); | |
1075 | TLine line; | |
1076 | line.SetLineStyle(2); | |
1077 | line.SetLineWidth(2); | |
1078 | line.DrawLine(rangeEffPt->GetXaxis()->GetXmin(), 0.7, rangeEffPt->GetXaxis()->GetXmax(), 0.7); | |
1079 | line.DrawLine(rangeEffPt->GetXaxis()->GetXmin(), 0.9, rangeEffPt->GetXaxis()->GetXmax(), 0.9); | |
1080 | ||
1081 | matchPt->SetRangeUser(matchPt->GetVar(fgkVarNames[kEventMult]), Double_t(iCent), Double_t(iCent), kTRUE); | |
1082 | ||
1083 | matchPt->SetRangeUser(matchPt->GetVar(fgkVarNames[kTrackCharge]), +1.0, +1.0); | |
1084 | TH1F* hEffPosAll = EfficiencyFromPhiPt(matchPt, 0, 6, 1, 0); | |
1085 | TH1F* hEffPosTrk4 = EfficiencyFromPhiPt(matchPt, 4, 4, 1, 0); | |
1086 | TH1F* hEffPosTrk5 = EfficiencyFromPhiPt(matchPt, 5, 5, 1, 0); | |
1087 | TH1F* hEffPosTrk6 = EfficiencyFromPhiPt(matchPt, 6, 6, 1, 0); | |
1088 | ||
1089 | matchPt->SetRangeUser(matchPt->GetVar(fgkVarNames[kTrackCharge]), -1.0, -1.0); | |
1090 | TH1F* hEffNegAll = EfficiencyFromPhiPt(matchPt, 0, 6, 1, 0); | |
1091 | TH1F* hEffNegTrk4 = EfficiencyFromPhiPt(matchPt, 4, 4, 1, 0); | |
1092 | TH1F* hEffNegTrk5 = EfficiencyFromPhiPt(matchPt, 5, 5, 1, 0); | |
1093 | TH1F* hEffNegTrk6 = EfficiencyFromPhiPt(matchPt, 6, 6, 1, 0); | |
1094 | matchPt->SetRangeUser(matchPt->GetVar(fgkVarNames[kTrackTrdTracklets]), 0.0, 6.0); | |
1095 | matchPt->SetRangeUser(matchPt->GetVar(fgkVarNames[kTrackCharge]), -1.0, +1.0); | |
1096 | ||
1097 | SetStyle(hEffPosAll, 1, kRed, 1, 24, kRed, 1); | |
1098 | SetStyle(hEffPosTrk4, 1, kRed, 1, 25, kRed, 1); | |
1099 | SetStyle(hEffPosTrk5, 1, kRed, 1, 26, kRed, 1); | |
1100 | SetStyle(hEffPosTrk6, 1, kRed, 1, 27, kRed, 1); | |
1101 | SetStyle(hEffNegAll, 1, kBlue, 1, 24, kBlue, 1); | |
1102 | SetStyle(hEffNegTrk4, 1, kBlue, 1, 25, kBlue, 1); | |
1103 | SetStyle(hEffNegTrk5, 1, kBlue, 1, 26, kBlue, 1); | |
1104 | SetStyle(hEffNegTrk6, 1, kBlue, 1, 27, kBlue, 1); | |
1105 | hEffPosAll->Draw("same"); | |
1106 | hEffNegAll->Draw("same"); | |
1107 | hEffPosTrk4->Draw("same"); | |
1108 | hEffNegTrk4->Draw("same"); | |
1109 | hEffPosTrk5->Draw("same"); | |
1110 | hEffNegTrk5->Draw("same"); | |
1111 | hEffPosTrk6->Draw("same"); | |
1112 | hEffNegTrk6->Draw("same"); | |
1113 | ||
1114 | TLegend* leg=new TLegend(0.18, 0.7, 0.77, 0.89); | |
1115 | if(iCent==1) { | |
1116 | leg->SetFillColor(0); | |
1117 | leg->SetNColumns(2); | |
1118 | leg->SetMargin(0.1); | |
1119 | leg->SetBorderSize(0); | |
1120 | leg->AddEntry(hEffPosAll, "pos. (#geq 1 tracklet)", "p"); | |
1121 | leg->AddEntry(hEffNegAll, "neg. (#geq 1 tracklet)", "p"); | |
1122 | leg->AddEntry(hEffPosTrk4, "pos. (4 tracklets)", "p"); | |
1123 | leg->AddEntry(hEffNegTrk4, "neg. (4 tracklets)", "p"); | |
1124 | leg->AddEntry(hEffPosTrk5, "pos. (5 tracklets)", "p"); | |
1125 | leg->AddEntry(hEffNegTrk5, "neg. (5 tracklets)", "p"); | |
1126 | leg->AddEntry(hEffPosTrk6, "pos. (6 tracklets)", "p"); | |
1127 | leg->AddEntry(hEffNegTrk6, "neg. (6 tracklets)", "p"); | |
1128 | leg->Draw(); | |
1129 | } | |
1130 | lat->DrawLatex(0.2, 1.32, Form("%.0f < SPD tracklets < %.0f", matchPt->GetAxis(matchPt->GetVar(fgkVarNames[kEventMult]),0)->GetBinLowEdge(iCent), matchPt->GetAxis(matchPt->GetVar(fgkVarNames[kEventMult]),0)->GetBinUpEdge(iCent))); | |
1131 | } // end for loop over multiplicity classes | |
1132 | ||
1133 | // Reset the modified user ranges of the CF container | |
1134 | matchPt->SetRangeUser(matchPt->GetVar(fgkVarNames[kEventMult]), 0., 3500.); | |
1135 | ||
1136 | // Cluster distributions in all multiplicity classes | |
1137 | pad = ((TVirtualPad*)l->At(2)); pad->cd(); | |
1138 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.02); | |
1139 | pad->SetTopMargin(0.02); pad->SetBottomMargin(0.15); | |
1140 | pad->SetGridx(kFALSE); pad->SetGridy(kFALSE); | |
1141 | if(gROOT->FindObject("rangeNcls")) delete gROOT->FindObject("rangeNcls"); | |
1142 | TH2F* rangeNcls = new TH2F("rangeNcls", "", 10, 0.0, 199.9, 10, 0.0, 1.199); | |
1143 | SetStyle(rangeNcls->GetXaxis(), "# TRD clusters", 0.07, 0.8, kTRUE, 0.05); | |
1144 | SetStyle(rangeNcls->GetYaxis(), "entries (a.u.)", 0.07, 0.8, kTRUE, 0.05); | |
1145 | rangeNcls->SetStats(kFALSE); | |
1146 | rangeNcls->Draw(); | |
1147 | ||
1148 | TH1D* hNcls[6]={0x0}; | |
1149 | TLegend* legCls=new TLegend(0.7, 0.75, 0.97, 0.97); | |
1150 | legCls->SetBorderSize(0); | |
1151 | legCls->SetFillColor(0); | |
1152 | legCls->SetMargin(0.15); | |
1153 | ||
1154 | for(Int_t iCent=0; iCent<6; ++iCent) { | |
1155 | if(iCent>0) | |
1156 | centCF->SetRangeUser(centCF->GetVar(fgkVarNames[kEventMult]), Double_t(iCent), Double_t(iCent), kTRUE); | |
1157 | hNcls[iCent] = (TH1D*)centCF->Project(0, centCF->GetVar(fgkVarNames[kTrackTrdClusters])); | |
1158 | if(!hNcls[iCent]) continue; | |
1159 | ||
1160 | hNcls[iCent]->SetLineColor(iCent<4 ? iCent+1 : iCent+2); | |
1161 | Double_t maximum = hNcls[iCent]->GetMaximum(); | |
1162 | if(maximum>1.0) | |
1163 | hNcls[iCent]->Scale(1.0/maximum); | |
1164 | hNcls[iCent]->SetStats(kFALSE); | |
1165 | hNcls[iCent]->SetTitle(""); | |
1166 | hNcls[iCent]->SetLineWidth(2); | |
1167 | ||
1168 | if(hNcls[iCent]->Integral()>0.01) { | |
1169 | hNcls[iCent]->Draw("same"); | |
1170 | legCls->AddEntry(hNcls[iCent], (iCent==0 ? "all centralities" : Form("%.0f < SPD tracklets < %.0f", centCF->GetAxis(centCF->GetVar(fgkVarNames[kEventMult]),0)->GetBinLowEdge(iCent), | |
1171 | centCF->GetAxis(centCF->GetVar(fgkVarNames[kEventMult]),0)->GetBinUpEdge(iCent))), "l"); | |
1172 | } | |
1173 | } | |
1174 | legCls->Draw(); | |
1175 | centCF->SetRangeUser(centCF->GetVar(fgkVarNames[kEventMult]), 0.0, 6.0, kTRUE); | |
1176 | ||
1177 | // Qtot vs P | |
1178 | pad = ((TVirtualPad*)l->At(5)); pad->cd(); | |
1179 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.02); | |
1180 | pad->SetTopMargin(0.02); pad->SetBottomMargin(0.15); | |
1181 | pad->SetGridx(kFALSE); pad->SetGridy(kFALSE); | |
1182 | if(gROOT->FindObject("rangeQtot")) delete gROOT->FindObject("rangeQtot"); | |
1183 | TH2F* rangeQtot = new TH2F("rangeQtot", "", 10, 0.0, 9.999, 10, 0.0, 1.199); | |
1184 | SetStyle(rangeQtot->GetXaxis(), "Q_{tot} (a.u.)", 0.07, 0.8, kTRUE, 0.05); | |
1185 | SetStyle(rangeQtot->GetYaxis(), "entries (a.u.)", 0.07, 0.8, kTRUE, 0.05); | |
1186 | rangeQtot->SetStats(kFALSE); | |
1187 | rangeQtot->Draw(); | |
1188 | ||
1189 | TH1D* hQtot[6]={0x0}; | |
1190 | TLegend* leg2=new TLegend(0.6, 0.7, 0.9, 0.97); | |
1191 | leg2->SetFillColor(0); | |
1192 | leg2->SetBorderSize(0); | |
1193 | ||
1194 | for(Int_t iCent=0; iCent<6; ++iCent) { | |
1195 | if(iCent>0) | |
1196 | centCF->SetRangeUser(centCF->GetVar(fgkVarNames[kEventMult]), Double_t(iCent), Double_t(iCent), kTRUE); | |
1197 | ||
1198 | hQtot[iCent] = (TH1D*)centCF->Project(0, centCF->GetVar(fgkVarNames[kTrackletQtot])); | |
1199 | if(!hQtot[iCent]) continue; | |
1200 | hQtot[iCent]->SetBinContent(1, 0); | |
1201 | ||
1202 | Double_t maximum = hQtot[iCent]->GetMaximum(); | |
1203 | if(maximum>1.0) | |
1204 | hQtot[iCent]->Scale(1.0/maximum); | |
1205 | hQtot[iCent]->SetLineColor(iCent<4 ? iCent+1 : iCent+2); | |
1206 | hQtot[iCent]->SetStats(kFALSE); | |
1207 | hQtot[iCent]->SetTitle(""); | |
1208 | hQtot[iCent]->SetLineWidth(2); | |
1209 | if(hQtot[iCent]->Integral()>0.01) { | |
1210 | hQtot[iCent]->Draw(iCent==0 ? "" : "same"); | |
1211 | leg2->AddEntry(hQtot[iCent], (iCent==0 ? "all centralities" : Form("%.0f < SPD tracklets < %.0f", centCF->GetAxis(centCF->GetVar(fgkVarNames[kEventMult]),0)->GetBinLowEdge(iCent), | |
1212 | centCF->GetAxis(centCF->GetVar(fgkVarNames[kEventMult]),0)->GetBinUpEdge(iCent))), "l"); | |
1213 | } | |
1214 | } | |
1215 | leg2->Draw(); | |
1216 | centCF->SetRangeUser(centCF->GetVar(fgkVarNames[kEventMult]), 0.0, 5.0, kTRUE); | |
1217 | } | |
1218 | ||
1219 | ||
1220 | ||
1221 | //_________________________________________________________________ | |
1222 | void AliTRDcheckESD::PlotTrackingSummaryFromCF(Double_t* trendValues, const Char_t* /*triggerName*/, Bool_t /*useIsolatedBC*/, Bool_t /*cutTOFbc*/) { | |
1223 | // | |
1224 | // Plot tracking summary | |
1225 | // | |
1226 | if(!fHistos) return; | |
1227 | AliCFContainer* matchPhiEta=(AliCFContainer*)fHistos->FindObject("MatchingPhiEta"); | |
1228 | if(!matchPhiEta) return; | |
1229 | AliCFContainer* matchPt=(AliCFContainer*)fHistos->FindObject("MatchingPt"); | |
1230 | if(!matchPt) return; | |
1231 | AliCFContainer* clustersCF=(AliCFContainer*)fHistos->FindObject("CentralityCF"); | |
1232 | if(!clustersCF) return; | |
1233 | AliCFContainer* bcCF=(AliCFContainer*)fHistos->FindObject("BunchCrossingsCF"); | |
1234 | if(!bcCF) return; | |
1235 | ||
1236 | TLatex *lat=new TLatex(); | |
1237 | lat->SetTextSize(0.06); | |
1238 | lat->SetTextColor(2); | |
1239 | lat->SetTextFont(42); | |
1240 | ||
1241 | gPad->SetTopMargin(0.05); gPad->SetBottomMargin(0.001); | |
1242 | gPad->SetLeftMargin(0.001); gPad->SetRightMargin(0.001); | |
1243 | gPad->Divide(3,3,0.,0.); | |
1244 | TList* l=gPad->GetListOfPrimitives(); | |
1245 | ||
1246 | // eta-phi distr. for positive TPC tracks | |
1247 | TVirtualPad* pad = ((TVirtualPad*)l->At(0)); pad->cd(); | |
1248 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1); | |
1249 | pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15); | |
1250 | pad->SetGridx(kFALSE); pad->SetGridy(kFALSE); | |
1251 | ||
1252 | TH2D* hTPCrefPos = 0x0; TH2D* hTRDrefPos = 0x0; TH2D* hTOFrefPos = 0x0; | |
1253 | TH2D* hTPCrefNeg = 0x0; TH2D* hTRDrefNeg = 0x0; TH2D* hTOFrefNeg = 0x0; | |
1254 | matchPhiEta->SetRangeUser(matchPhiEta->GetVar(fgkVarNames[kTrackTrdTracklets]), 0.0, 6.0); | |
1255 | matchPhiEta->SetRangeUser(matchPhiEta->GetVar(fgkVarNames[kTrackCharge]), +1.0, +1.0); // positive charges | |
1256 | hTPCrefPos = (TH2D*)matchPhiEta->Project(0, matchPhiEta->GetVar(fgkVarNames[kTrackEtaTRD]), matchPhiEta->GetVar(fgkVarNames[kTrackPhiTRD])); | |
1257 | hTRDrefPos = (TH2D*)matchPhiEta->Project(1, matchPhiEta->GetVar(fgkVarNames[kTrackEtaTRD]), matchPhiEta->GetVar(fgkVarNames[kTrackPhiTRD])); | |
1258 | hTOFrefPos = (TH2D*)matchPhiEta->Project(2, matchPhiEta->GetVar(fgkVarNames[kTrackEtaTRD]), matchPhiEta->GetVar(fgkVarNames[kTrackPhiTRD])); | |
1259 | matchPhiEta->SetRangeUser(matchPhiEta->GetVar(fgkVarNames[kTrackCharge]), -1.0, -1.0); // negative charges | |
1260 | hTPCrefNeg = (TH2D*)matchPhiEta->Project(0, matchPhiEta->GetVar(fgkVarNames[kTrackEtaTRD]), matchPhiEta->GetVar(fgkVarNames[kTrackPhiTRD])); | |
1261 | hTRDrefNeg = (TH2D*)matchPhiEta->Project(1, matchPhiEta->GetVar(fgkVarNames[kTrackEtaTRD]), matchPhiEta->GetVar(fgkVarNames[kTrackPhiTRD])); | |
1262 | hTOFrefNeg = (TH2D*)matchPhiEta->Project(2, matchPhiEta->GetVar(fgkVarNames[kTrackEtaTRD]), matchPhiEta->GetVar(fgkVarNames[kTrackPhiTRD])); | |
1263 | matchPhiEta->SetRangeUser(matchPhiEta->GetVar(fgkVarNames[kTrackCharge]), -1.0, +1.0); // reset charge cut | |
1264 | ||
1265 | if(gROOT->FindObject("rangeEtaPhi")) delete gROOT->FindObject("rangeEtaPhi"); | |
1266 | TH2F* rangeEtaPhi = new TH2F("rangeEtaPhi", "", 10, -0.99, +0.99, 10, -3.15, 3.15); | |
1267 | SetStyle(rangeEtaPhi->GetXaxis(), "#eta", 0.07, 0.8, kTRUE, 0.05); | |
1268 | SetStyle(rangeEtaPhi->GetYaxis(), "detector #varphi", 0.07, 0.8, kTRUE, 0.05); | |
1269 | rangeEtaPhi->SetStats(kFALSE); | |
1270 | ||
1271 | //---------------------------------------------- | |
1272 | // eta-phi efficiency for positive TRD tracks | |
1273 | pad = ((TVirtualPad*)l->At(0)); pad->cd(); | |
1274 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1); | |
1275 | pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15); | |
1276 | pad->SetGridx(kFALSE); pad->SetGridy(kFALSE); | |
1277 | rangeEtaPhi->Draw(); | |
1278 | ||
1279 | TH2D* hTRDeffPos = (hTRDrefPos ? (TH2D*)hTRDrefPos->Clone("hTRDeffPos") : 0x0); | |
1280 | if(hTRDeffPos) { | |
1281 | hTRDeffPos->Reset(); | |
1282 | hTRDeffPos->SetStats(kFALSE); | |
1283 | hTRDeffPos->Divide(hTRDrefPos, hTPCrefPos); | |
1284 | hTRDeffPos->SetMaximum(1.0); | |
1285 | hTRDeffPos->Draw("samecolz"); | |
1286 | lat->DrawLatex(-0.9, 3.3, "TPC-TRD matching for positive tracks"); | |
1287 | DrawTRDGrid(); | |
1288 | } | |
1289 | ||
1290 | //---------------------------------------------- | |
1291 | // eta-phi efficiency for negative TRD tracks | |
1292 | pad = ((TVirtualPad*)l->At(3)); pad->cd(); | |
1293 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1); | |
1294 | pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15); | |
1295 | pad->SetGridx(kFALSE); pad->SetGridy(kFALSE); | |
1296 | rangeEtaPhi->Draw(); | |
1297 | ||
1298 | TH2D* hTRDeffNeg = (hTRDrefNeg ? (TH2D*)hTRDrefNeg->Clone("hTRDeffNeg") : 0x0); | |
1299 | if(hTRDeffNeg) { | |
1300 | hTRDeffNeg->Reset(); | |
1301 | hTRDeffNeg->SetStats(kFALSE); | |
1302 | hTRDeffNeg->Divide(hTRDrefNeg, hTPCrefNeg); | |
1303 | hTRDeffNeg->SetMaximum(1.0); | |
1304 | hTRDeffNeg->Draw("samecolz"); | |
1305 | lat->DrawLatex(-0.9, 3.3, "TPC-TRD matching for negative tracks"); | |
1306 | DrawTRDGrid(); | |
1307 | } | |
1308 | ||
1309 | //---------------------------------------------- | |
1310 | // eta-phi TRD-TOF matching efficiency for positive tracks | |
1311 | pad = ((TVirtualPad*)l->At(1)); pad->cd(); | |
1312 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1); | |
1313 | pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15); | |
1314 | pad->SetGridx(kFALSE); pad->SetGridy(kFALSE); | |
1315 | rangeEtaPhi->Draw(); | |
1316 | ||
1317 | TH2D* hTOFeffPos = (hTOFrefPos ? (TH2D*)hTOFrefPos->Clone("hTOFeffPos") : 0x0); | |
1318 | if(hTOFeffPos) { | |
1319 | hTOFeffPos->Reset(); | |
1320 | hTOFeffPos->SetStats(kFALSE); | |
1321 | hTOFeffPos->Divide(hTOFrefPos, hTRDrefPos); | |
1322 | hTOFeffPos->SetMaximum(1.0); | |
1323 | hTOFeffPos->Draw("samecolz"); | |
1324 | lat->DrawLatex(-0.9, 3.3, "TRD-TOF matching for positive tracks"); | |
1325 | DrawTRDGrid(); | |
1326 | } | |
1327 | ||
1328 | //---------------------------------------------- | |
1329 | // eta-phi TRD-TOF matching efficiency for negative tracks | |
1330 | pad = ((TVirtualPad*)l->At(4)); pad->cd(); | |
1331 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1); | |
1332 | pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15); | |
1333 | pad->SetGridx(kFALSE); pad->SetGridy(kFALSE); | |
1334 | rangeEtaPhi->Draw(); | |
1335 | ||
1336 | TH2D* hTOFeffNeg = (hTOFrefNeg ? (TH2D*)hTOFrefNeg->Clone("hTOFeffNeg") : 0x0); | |
1337 | if(hTOFeffNeg) { | |
1338 | hTOFeffNeg->Reset(); | |
1339 | hTOFeffNeg->SetStats(kFALSE); | |
1340 | hTOFeffNeg->Divide(hTOFrefNeg, hTRDrefNeg); | |
1341 | hTOFeffNeg->SetMaximum(1.0); | |
1342 | hTOFeffNeg->Draw("samecolz"); | |
1343 | lat->DrawLatex(-0.9, 3.3, "TRD-TOF matching for negative tracks"); | |
1344 | DrawTRDGrid(); | |
1345 | } | |
1346 | ||
1347 | if(hTRDrefPos) delete hTRDrefPos; if(hTPCrefPos) delete hTPCrefPos; if(hTOFrefPos) delete hTOFrefPos; | |
1348 | if(hTRDrefNeg) delete hTRDrefNeg; if(hTPCrefNeg) delete hTPCrefNeg; if(hTOFrefNeg) delete hTOFrefNeg; | |
1349 | ||
1350 | // switch to the Pt cf container | |
1351 | matchPt->SetRangeUser(matchPt->GetVar(fgkVarNames[kTrackCharge]), +1.0, +1.0); | |
1352 | TH1F* hTRDEffPtPosAll = EfficiencyFromPhiPt(matchPt, 0, 6, 1, 0); | |
1353 | TH1F* hTOFEffPtPosAll = EfficiencyFromPhiPt(matchPt, 0, 6, 2, 1); | |
1354 | TH1F* hTRDEffPtPosTrk4 = EfficiencyFromPhiPt(matchPt, 4, 4, 1, 0); | |
1355 | TH1F* hTOFEffPtPosTrk4 = EfficiencyFromPhiPt(matchPt, 4, 4, 2, 1); | |
1356 | TH1F* hTRDEffPtPosTrk5 = EfficiencyFromPhiPt(matchPt, 5, 5, 1, 0); | |
1357 | TH1F* hTOFEffPtPosTrk5 = EfficiencyFromPhiPt(matchPt, 5, 5, 2, 1); | |
1358 | TH1F* hTRDEffPtPosTrk6 = EfficiencyFromPhiPt(matchPt, 6, 6, 1, 0); | |
1359 | TH1F* hTOFEffPtPosTrk6 = EfficiencyFromPhiPt(matchPt, 6, 6, 2, 1); | |
1360 | ||
1361 | matchPt->SetRangeUser(matchPt->GetVar(fgkVarNames[kTrackCharge]), -1.0, -1.0); | |
1362 | TH1F* hTRDEffPtNegAll = EfficiencyFromPhiPt(matchPt, 0, 6, 1, 0); | |
1363 | TH1F* hTOFEffPtNegAll = EfficiencyFromPhiPt(matchPt, 0, 6, 2, 1); | |
1364 | TH1F* hTRDEffPtNegTrk4 = EfficiencyFromPhiPt(matchPt, 4, 4, 1, 0); | |
1365 | TH1F* hTOFEffPtNegTrk4 = EfficiencyFromPhiPt(matchPt, 4, 4, 2, 1); | |
1366 | TH1F* hTRDEffPtNegTrk5 = EfficiencyFromPhiPt(matchPt, 5, 5, 1, 0); | |
1367 | TH1F* hTOFEffPtNegTrk5 = EfficiencyFromPhiPt(matchPt, 5, 5, 2, 1); | |
1368 | TH1F* hTRDEffPtNegTrk6 = EfficiencyFromPhiPt(matchPt, 6, 6, 1, 0); | |
1369 | TH1F* hTOFEffPtNegTrk6 = EfficiencyFromPhiPt(matchPt, 6, 6, 2, 1); | |
1370 | matchPt->SetRangeUser(matchPt->GetVar(fgkVarNames[kTrackCharge]), -1.0, +1.0); | |
1371 | ||
1372 | TF1* funcConst = new TF1("constFunc", "[0]", 1.0, 3.0); | |
1373 | if(trendValues) { | |
1374 | if(hTRDEffPtPosAll && hTRDEffPtPosAll->Integral()>0.1) { | |
1375 | hTRDEffPtPosAll->Fit(funcConst, "Q0ME", "goff", 1.0, 3.0); | |
1376 | trendValues[0] = funcConst->GetParameter(0); | |
1377 | trendValues[1] = funcConst->GetParError(0); | |
1378 | } | |
1379 | } | |
1380 | if(trendValues) { | |
1381 | if(hTRDEffPtNegAll && hTRDEffPtNegAll->Integral()>0.1) { | |
1382 | hTRDEffPtNegAll->Fit(funcConst, "Q0ME", "goff", 1.0, 3.0); | |
1383 | trendValues[2] = funcConst->GetParameter(0); | |
1384 | trendValues[3] = funcConst->GetParError(0); | |
1385 | } | |
1386 | } | |
1387 | if(trendValues) { | |
1388 | if(hTOFEffPtPosAll && hTOFEffPtPosAll->Integral()>0.1) { | |
1389 | hTOFEffPtPosAll->Fit(funcConst, "Q0ME", "goff", 1.0, 3.0); | |
1390 | trendValues[4] = funcConst->GetParameter(0); | |
1391 | trendValues[5] = funcConst->GetParError(0); | |
1392 | } | |
1393 | } | |
1394 | if(trendValues) { | |
1395 | if(hTOFEffPtNegAll && hTOFEffPtNegAll->Integral()>0.1) { | |
1396 | hTOFEffPtNegAll->Fit(funcConst, "Q0ME", "goff", 1.0, 3.0); | |
1397 | trendValues[6] = funcConst->GetParameter(0); | |
1398 | trendValues[7] = funcConst->GetParError(0); | |
1399 | } | |
1400 | } | |
1401 | ||
1402 | //--------------------------------------------------------- | |
1403 | // TPC-TRD matching efficiency vs pt | |
1404 | pad = ((TVirtualPad*)l->At(6)); pad->cd(); | |
1405 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.02); | |
1406 | pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15); | |
1407 | pad->SetGridx(kFALSE); pad->SetGridy(kFALSE); | |
1408 | ||
1409 | if(gROOT->FindObject("rangeEffPt2")) delete gROOT->FindObject("rangeEffPt2"); | |
1410 | TH2F* rangeEffPt=new TH2F("rangeEffPt2", "",10,0.,10.,10,0.,1.4); | |
1411 | rangeEffPt->SetStats(kFALSE); | |
1412 | SetStyle(rangeEffPt->GetXaxis(), "p_{T} [GeV/c]", 0.07, 0.8, kTRUE, 0.05); | |
1413 | SetStyle(rangeEffPt->GetYaxis(), "efficiency", 0.07, 0.8, kTRUE, 0.05); | |
1414 | rangeEffPt->Draw(); | |
1415 | lat->DrawLatex(0.2, 1.44, "TPC-TRD matching efficiency"); | |
1416 | //++++++++++++++++++ | |
1417 | TLine line; | |
1418 | line.SetLineStyle(2); | |
1419 | line.SetLineWidth(2); | |
1420 | line.DrawLine(rangeEffPt->GetXaxis()->GetXmin(), 0.7, rangeEffPt->GetXaxis()->GetXmax(), 0.7); | |
1421 | line.DrawLine(rangeEffPt->GetXaxis()->GetXmin(), 0.9, rangeEffPt->GetXaxis()->GetXmax(), 0.9); | |
1422 | TLegend* leg=new TLegend(0.2, 0.7, 0.7, 0.89); | |
1423 | leg->SetNColumns(2); | |
1424 | leg->SetMargin(0.15); | |
1425 | leg->SetBorderSize(0); | |
1426 | leg->SetFillColor(0); | |
1427 | ||
1428 | SetStyle(hTRDEffPtPosAll, 1, kRed, 1, 24, kRed, 1); | |
1429 | SetStyle(hTRDEffPtNegAll, 1, kBlue, 1, 24, kBlue, 1); | |
1430 | SetStyle(hTRDEffPtPosTrk4, 1, kRed, 1, 25, kRed, 1); | |
1431 | SetStyle(hTRDEffPtNegTrk4, 1, kBlue, 1, 25, kBlue, 1); | |
1432 | SetStyle(hTRDEffPtPosTrk5, 1, kRed, 1, 26, kRed, 1); | |
1433 | SetStyle(hTRDEffPtNegTrk5, 1, kBlue, 1, 26, kBlue, 1); | |
1434 | SetStyle(hTRDEffPtPosTrk6, 1, kRed, 1, 27, kRed, 1); | |
1435 | SetStyle(hTRDEffPtNegTrk6, 1, kBlue, 1, 27, kBlue, 1); | |
1436 | if(hTRDEffPtPosAll) {hTRDEffPtPosAll->Draw("same"); leg->AddEntry(hTRDEffPtPosAll, "pos. (#geq 1 tracklet)", "p");} | |
1437 | if(hTRDEffPtNegAll) {hTRDEffPtNegAll->Draw("same"); leg->AddEntry(hTRDEffPtNegAll, "neg. (#geq 1 tracklet)", "p");} | |
1438 | hTRDEffPtPosTrk4->Draw("same"); leg->AddEntry(hTRDEffPtPosTrk4, "pos. (4 tracklets)", "p"); | |
1439 | hTRDEffPtNegTrk4->Draw("same"); leg->AddEntry(hTRDEffPtNegTrk4, "neg. (4 tracklets)", "p"); | |
1440 | hTRDEffPtPosTrk5->Draw("same"); leg->AddEntry(hTRDEffPtPosTrk5, "pos. (5 tracklets)", "p"); | |
1441 | hTRDEffPtNegTrk5->Draw("same"); leg->AddEntry(hTRDEffPtNegTrk5, "neg. (5 tracklets)", "p"); | |
1442 | hTRDEffPtPosTrk6->Draw("same"); leg->AddEntry(hTRDEffPtPosTrk6, "pos. (6 tracklets)", "p"); | |
1443 | hTRDEffPtNegTrk6->Draw("same"); leg->AddEntry(hTRDEffPtNegTrk6, "neg. (6 tracklets)", "p"); | |
1444 | ||
1445 | leg->Draw(); | |
1446 | ||
1447 | //--------------------------------------------------------- | |
1448 | // TRD-TOF matching efficiency vs pt | |
1449 | pad = ((TVirtualPad*)l->At(7)); pad->cd(); | |
1450 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.02); | |
1451 | pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15); | |
1452 | pad->SetGridx(kFALSE); pad->SetGridy(kFALSE); | |
1453 | ||
1454 | rangeEffPt->Draw(); | |
1455 | lat->DrawLatex(0.2, 1.44, "TRD-TOF matching efficiency"); | |
1456 | SetStyle(hTOFEffPtPosAll, 1, kRed, 1, 24, kRed, 1); | |
1457 | SetStyle(hTOFEffPtPosTrk4, 1, kRed, 1, 25, kRed, 1); | |
1458 | SetStyle(hTOFEffPtPosTrk5, 1, kRed, 1, 26, kRed, 1); | |
1459 | SetStyle(hTOFEffPtPosTrk6, 1, kRed, 1, 27, kRed, 1); | |
1460 | SetStyle(hTOFEffPtNegAll, 1, kBlue, 1, 24, kBlue, 1); | |
1461 | SetStyle(hTOFEffPtNegTrk4, 1, kBlue, 1, 25, kBlue, 1); | |
1462 | SetStyle(hTOFEffPtNegTrk5, 1, kBlue, 1, 26, kBlue, 1); | |
1463 | SetStyle(hTOFEffPtNegTrk6, 1, kBlue, 1, 27, kBlue, 1); | |
1464 | if(hTOFEffPtPosAll) hTOFEffPtPosAll->Draw("same"); | |
1465 | hTOFEffPtPosTrk4->Draw("same"); | |
1466 | hTOFEffPtPosTrk5->Draw("same"); | |
1467 | hTOFEffPtPosTrk6->Draw("same"); | |
1468 | if(hTOFEffPtNegAll) hTOFEffPtNegAll->Draw("same"); | |
1469 | hTOFEffPtNegTrk4->Draw("same"); | |
1470 | hTOFEffPtNegTrk5->Draw("same"); | |
1471 | hTOFEffPtNegTrk6->Draw("same"); | |
1472 | ||
1473 | //----------------------------------------------------- | |
1474 | // <ntracklets> vs (phi,eta) | |
1475 | pad = ((TVirtualPad*)l->At(2)); pad->cd(); | |
1476 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1); | |
1477 | pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15); | |
1478 | pad->SetGridx(kFALSE); pad->SetGridy(kFALSE); | |
1479 | ||
1480 | rangeEtaPhi->Draw(); | |
1481 | lat->DrawLatex(-0.9, 3.3, "TRD <N_{tracklets}>"); | |
1482 | ||
1483 | TH3D* hNtracklets = (TH3D*)matchPhiEta->Project(kTRD, matchPhiEta->GetVar(fgkVarNames[kTrackPhiTRD]), matchPhiEta->GetVar(fgkVarNames[kTrackEtaTRD]), matchPhiEta->GetVar(fgkVarNames[kTrackTrdTracklets])); | |
1484 | ||
1485 | TProfile2D* hNtrackletsProf = hNtracklets->Project3DProfile(); | |
1486 | delete hNtracklets; | |
1487 | if(hNtrackletsProf) { | |
1488 | hNtrackletsProf->SetStats(kFALSE); | |
1489 | hNtrackletsProf->SetMinimum(0.); | |
1490 | hNtrackletsProf->SetMaximum(6.); | |
1491 | hNtrackletsProf->Draw("samecolz"); | |
1492 | DrawTRDGrid(); | |
1493 | } | |
1494 | ||
1495 | // calculate the trend value for tracklets/track | |
1496 | TH2D* hNtrackletsVsP = (TH2D*)matchPt->Project(kTRD, matchPt->GetVar(fgkVarNames[kTrackPt]), matchPt->GetVar(fgkVarNames[kTrackTrdTracklets])); | |
1497 | if(trendValues && hNtrackletsVsP && hNtrackletsVsP->GetEntries()>0.1) { | |
1498 | TProfile* hNtrackletsVsPprof = hNtrackletsVsP->ProfileX("hNtrackletsVsPprof"); | |
1499 | hNtrackletsVsPprof->Fit(funcConst, "QME0", "goff", 1.0, 3.0); | |
1500 | trendValues[8] = funcConst->GetParameter(0); | |
1501 | trendValues[9] = funcConst->GetParError(0); | |
1502 | delete hNtrackletsVsP; | |
1503 | } | |
1504 | ||
1505 | //-------------------------------------------------------------- | |
1506 | // Nclusters per TRD track vs momentum | |
1507 | pad = ((TVirtualPad*)l->At(5)); pad->cd(); | |
1508 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.12); | |
1509 | pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15); | |
1510 | pad->SetGridx(kFALSE); pad->SetGridy(kFALSE); | |
1511 | pad->SetLogz(); | |
1512 | ||
1513 | if(gROOT->FindObject("rangeNclsP")) delete gROOT->FindObject("rangeNclsP"); | |
1514 | TH2F* rangeNclsP = new TH2F("rangeNclsP", "", 10, 0.0, 11.99, 10, 0.0, 199.0); | |
1515 | SetStyle(rangeNclsP->GetXaxis(), "p [GeV/c]", 0.07, 0.8, kTRUE, 0.05); | |
1516 | SetStyle(rangeNclsP->GetYaxis(), "#clusters", 0.07, 0.8, kTRUE, 0.05); | |
1517 | rangeNclsP->SetStats(kFALSE); | |
1518 | rangeNclsP->Draw(); | |
1519 | lat->DrawLatex(1.0, 205., "TRD Clusters / track"); | |
1520 | ||
1521 | TH2D* hNclsVsP = (TH2D*)clustersCF->Project(0, clustersCF->GetVar(fgkVarNames[kTrackP]), clustersCF->GetVar(fgkVarNames[kTrackTrdClusters])); | |
1522 | if(hNclsVsP) { | |
1523 | hNclsVsP->SetStats(kFALSE); | |
1524 | hNclsVsP->Draw("samecolz"); | |
1525 | } | |
1526 | ||
1527 | if(trendValues && hNclsVsP && hNclsVsP->GetEntries()>10) { | |
1528 | TProfile* hNclsVsPprof = hNclsVsP->ProfileX("hNclsVsPprof"); | |
1529 | hNclsVsPprof->Fit(funcConst, "QME0", "goff", 1.0, 3.0); | |
1530 | trendValues[10] = funcConst->GetParameter(0); | |
1531 | trendValues[11] = funcConst->GetParError(0); | |
1532 | } | |
1533 | ||
1534 | //-------------------------------------------------------------- | |
1535 | // TRD-TPC and TOF-TRD matching efficiency vs bunch crossing | |
1536 | pad = ((TVirtualPad*)l->At(8)); pad->cd(); | |
1537 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.02); | |
1538 | pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15); | |
1539 | pad->SetGridx(kFALSE); pad->SetGridy(kFALSE); | |
1540 | ||
1541 | TH1F* hTRDEffBC = EfficiencyFromPhiPt(bcCF, -1, -1, 1, 0, kEventBC); | |
1542 | TH1F* hTOFEffBC = EfficiencyFromPhiPt(bcCF, -1, -1, 2, 1, kEventBC); | |
1543 | ||
1544 | if(gROOT->FindObject("rangeBC")) delete gROOT->FindObject("rangeBC"); | |
1545 | TH2F* rangeBC = new TH2F("rangeBC", "", 10, -0.5, 3499.5, 10, 0.0, 1.4); | |
1546 | rangeBC->SetStats(kFALSE); | |
1547 | SetStyle(rangeBC->GetXaxis(), "Bunch crossing", 0.07, 0.8, kTRUE, 0.05); | |
1548 | SetStyle(rangeBC->GetYaxis(), "efficiency", 0.07, 0.8, kTRUE, 0.05); | |
1549 | rangeBC->Draw(); | |
1550 | ||
1551 | TLegend* legBC=new TLegend(0.8, 0.7, 0.95, 0.89); | |
1552 | legBC->SetBorderSize(0); | |
1553 | legBC->SetMargin(0.15); | |
1554 | legBC->SetFillColor(0); | |
1555 | if(hTRDEffBC) { | |
1556 | hTRDEffBC->SetStats(kFALSE); | |
1557 | SetStyle(hTRDEffBC, 1, kRed, 2, 24, kRed, 1); legBC->AddEntry(hTRDEffBC, "TPC-TRD", "p"); | |
1558 | SetStyle(hTOFEffBC, 1, kBlue, 2, 24, kBlue, 1); legBC->AddEntry(hTOFEffBC, "TRD-TOF", "p"); | |
1559 | hTRDEffBC->Draw("same"); | |
1560 | hTOFEffBC->Draw("same"); | |
1561 | legBC->Draw(); | |
1562 | lat->DrawLatex(200., 1.44, "Matching efficiency at 1<p_{T}<3 GeV/c"); | |
1563 | } | |
1564 | ||
1565 | delete funcConst; | |
1566 | } | |
1567 | ||
1568 | ||
1569 | ||
1570 | //_________________________________________________________________ | |
1571 | void AliTRDcheckESD::PlotPidSummaryFromCF(Double_t* trendValues, const Char_t* /*triggerName*/, Bool_t /*useIsolatedBC*/, Bool_t /*cutTOFbc*/) { | |
1572 | // | |
1573 | // PID summary | |
1574 | // | |
1575 | if(!fHistos) return; | |
1576 | AliCFContainer* qtotCF = (AliCFContainer*)fHistos->FindObject("QtotCF"); | |
1577 | if(!qtotCF) return; | |
1578 | AliCFContainer* phCF = (AliCFContainer*)fHistos->FindObject("PulseHeightCF"); | |
1579 | if(!phCF) return; | |
1580 | AliCFContainer* centCF = (AliCFContainer*)fHistos->FindObject("CentralityCF"); | |
1581 | if(!centCF) return; | |
1582 | ||
1583 | TLatex *lat=new TLatex(); | |
1584 | lat->SetTextSize(0.07); | |
1585 | lat->SetTextColor(2); | |
1586 | lat->SetTextFont(42); | |
1587 | gPad->SetTopMargin(0.05); gPad->SetBottomMargin(0.001); | |
1588 | gPad->SetLeftMargin(0.001); gPad->SetRightMargin(0.001); | |
1589 | gPad->Divide(3,3,0.,0.); | |
1590 | TList* l=gPad->GetListOfPrimitives(); | |
1591 | ||
1592 | if(gROOT->FindObject("rangeEtaPhi2")) delete gROOT->FindObject("rangeEtaPhi2"); | |
1593 | TH2F* rangeEtaPhi = new TH2F("rangeEtaPhi2", "", 10, -0.99, +0.99, 10, -3.15, 3.15); | |
1594 | SetStyle(rangeEtaPhi->GetXaxis(), "#eta", 0.07, 0.8, kTRUE, 0.05); | |
1595 | SetStyle(rangeEtaPhi->GetYaxis(), "detector #varphi", 0.07, 0.8, kTRUE, 0.05); | |
1596 | rangeEtaPhi->SetStats(kFALSE); | |
1597 | ||
1598 | // eta-phi distr. for <Qtot> in layer 0 | |
1599 | TVirtualPad* pad; | |
1600 | TProfile2D* hProf2D; | |
1601 | TH1D* hqtot = (TH1D*)qtotCF->Project(0, qtotCF->GetVar(fgkVarNames[kTrackletQtot])); | |
1602 | for(Int_t iLayer=0; iLayer<6; ++iLayer) { | |
1603 | pad = ((TVirtualPad*)l->At((iLayer<3 ? iLayer*3 : (iLayer-3)*3+1))); pad->cd(); | |
1604 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1); | |
1605 | pad->SetTopMargin(0.1); pad->SetBottomMargin(0.15); | |
1606 | pad->SetGridx(kFALSE); pad->SetGridy(kFALSE); | |
1607 | rangeEtaPhi->Draw(); | |
1608 | qtotCF->SetRangeUser(qtotCF->GetVar(fgkVarNames[kTrackletLayer]), Double_t(iLayer), Double_t(iLayer)); | |
1609 | TH3D* hQtotEtaPhi = (TH3D*)qtotCF->Project(0, qtotCF->GetVar(fgkVarNames[kTrackPhiTRD]), qtotCF->GetVar(fgkVarNames[kTrackEtaTRD]), qtotCF->GetVar(fgkVarNames[kTrackletQtot])); | |
1610 | hProf2D = (hQtotEtaPhi ? hQtotEtaPhi->Project3DProfile() : 0x0); | |
1611 | if(hQtotEtaPhi) delete hQtotEtaPhi; | |
1612 | ||
1613 | if(hProf2D) { | |
1614 | hProf2D->SetName(Form("Qtot_layer%d",iLayer)); | |
1615 | hProf2D->SetStats(kFALSE); | |
1616 | hProf2D->SetMinimum(0.); | |
1617 | hProf2D->SetMaximum((hqtot->GetMean()<10 ? 4.0 : 2000.)); | |
1618 | hProf2D->Draw("samecolz"); | |
1619 | } | |
1620 | lat->DrawLatex(-0.9, 3.3, Form("TRD <Q_{tot}> Layer %d", iLayer)); | |
1621 | DrawTRDGrid(); | |
1622 | } | |
1623 | qtotCF->SetRangeUser(qtotCF->GetVar(fgkVarNames[kTrackletLayer]), 0.0, 5.0); | |
1624 | // PH versus slice number | |
1625 | pad = ((TVirtualPad*)l->At(2)); pad->cd(); | |
1626 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1); | |
1627 | pad->SetTopMargin(0.03); pad->SetBottomMargin(0.15); | |
1628 | pad->SetGridx(kFALSE); pad->SetGridy(kFALSE); | |
1629 | ||
1630 | if(gROOT->FindObject("rangePHslice")) delete gROOT->FindObject("rangePHslice"); | |
1631 | TH2F* rangePHslice=new TH2F("rangePHslice", "", 8, -0.5, 7.5, 10, 0.0, (hqtot->GetMean()<10.0 ? 6.0 : 3000.)); | |
1632 | rangePHslice->SetStats(kFALSE); | |
1633 | SetStyle(rangePHslice->GetXaxis(), "slice", 0.07, 0.8, kTRUE, 0.05); | |
1634 | SetStyle(rangePHslice->GetYaxis(), "PH", 0.07, 0.8, kTRUE, 0.05); | |
1635 | rangePHslice->Draw(); | |
1636 | ||
1637 | TF1* funcPol1 = new TF1("funcPol1", "[0]+[1]*x", 2.9, 6.4); | |
1638 | ||
1639 | TH2D* hPH = (TH2D*)phCF->Project(0, phCF->GetVar(fgkVarNames[kTrackletSlice]), phCF->GetVar(fgkVarNames[kTrackletPHslice])); | |
1640 | TH1D* hSliceErr = new TH1D(Form("hSliceErr%f", gRandom->Rndm()), "", hPH->GetXaxis()->GetNbins(), hPH->GetXaxis()->GetXbins()->GetArray()); | |
1641 | TH1D* hLandauFit = Proj2D(hPH, hSliceErr); | |
1642 | hPH->SetStats(kFALSE); | |
1643 | hPH->Draw("samecolz"); | |
1644 | const Double_t kQx = 0.002; | |
1645 | if(trendValues) { | |
1646 | hSliceErr->Fit(funcPol1, "QME0", "goff", 2.9, 6.4); | |
1647 | trendValues[12] = kQx*funcPol1->GetParameter(0); // PH plateau | |
1648 | trendValues[13] = kQx*funcPol1->GetParError(0); // PH plateau | |
1649 | trendValues[14] = kQx*funcPol1->GetParameter(1); // PH slope | |
1650 | trendValues[15] = kQx*funcPol1->GetParError(1); // PH slope | |
1651 | } | |
1652 | hLandauFit->SetLineWidth(2); | |
1653 | hLandauFit->SetLineStyle(2); | |
1654 | hLandauFit->Draw("same"); | |
1655 | ||
1656 | delete funcPol1; delete hSliceErr; | |
1657 | // Qtot vs P | |
1658 | pad = ((TVirtualPad*)l->At(5)); pad->cd(); | |
1659 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1); | |
1660 | pad->SetTopMargin(0.03); pad->SetBottomMargin(0.15); | |
1661 | pad->SetGridx(kFALSE); pad->SetGridy(kFALSE); | |
1662 | pad->SetLogz(); | |
1663 | ||
1664 | if(gROOT->FindObject("rangeQtotP")) delete gROOT->FindObject("rangeQtotP"); | |
1665 | TH2F* rangeQtotP = new TH2F("rangeQtotP", "", 10, 0.0, 11.99, 10, 0.0, (hqtot->GetMean()<10.0 ? 11.99 : 5999.)); | |
1666 | SetStyle(rangeQtotP->GetXaxis(), "P [GeV/c]", 0.07, 0.8, kTRUE, 0.05); | |
1667 | SetStyle(rangeQtotP->GetYaxis(), "Q_{tot}", 0.07, 0.8, kTRUE, 0.05); | |
1668 | rangeQtotP->SetStats(kFALSE); | |
1669 | rangeQtotP->Draw(); | |
1670 | ||
1671 | Int_t pVar = centCF->GetVar(fgkVarNames[kTrackP]); | |
1672 | if(pVar<0) pVar = centCF->GetVar(fgkVarNames[kTrackletP]); | |
1673 | TH2D* hQtotP = (TH2D*)centCF->Project(0, pVar, centCF->GetVar(fgkVarNames[kTrackletQtot])); | |
1674 | TH1D* mpvErr=new TH1D("mpvErr", "Landau MPV error vs. P", hQtotP->GetXaxis()->GetNbins(), hQtotP->GetXaxis()->GetXbins()->GetArray()); | |
1675 | TH1D* widthErr=new TH1D("widthErr", "Landau width error vs. P", hQtotP->GetXaxis()->GetNbins(), hQtotP->GetXaxis()->GetXbins()->GetArray()); | |
1676 | TH1D* landauChi2=new TH1D("landauChi2", "Landau fit #chi^{2} vs. P", hQtotP->GetXaxis()->GetNbins(), hQtotP->GetXaxis()->GetXbins()->GetArray()); | |
1677 | if(hQtotP) | |
1678 | for(Int_t i=1; i<=hQtotP->GetXaxis()->GetNbins(); ++i) | |
1679 | hQtotP->SetBinContent(i, 1, 0.0); | |
1680 | TH1D* hQtotProj = (hQtotP ? Proj2D(hQtotP, mpvErr, widthErr, landauChi2) : 0x0); | |
1681 | //landauChi2->Scale(0.001); | |
1682 | if(hQtotProj) SetStyle(hQtotProj, 2, kBlue, 2, 1, kBlue, 1); | |
1683 | if(trendValues && hQtotProj && hQtotProj->GetEntries()>2) { | |
1684 | trendValues[16] = kQx*hQtotProj->GetBinContent(hQtotProj->FindBin(1.0)); // Landau MPV at 1GeV/c | |
1685 | trendValues[17] = kQx*hQtotProj->GetBinError(hQtotProj->FindBin(1.0)); // Landau width at 1 GeV/c | |
1686 | } | |
1687 | if(hQtotP) { | |
1688 | hQtotP->SetStats(kFALSE); | |
1689 | hQtotP->Draw("samecolz"); | |
1690 | hQtotProj->Draw("same"); | |
1691 | } | |
1692 | ||
1693 | // Qtot vs P (fit results) | |
1694 | pad = ((TVirtualPad*)l->At(8)); pad->cd(); | |
1695 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1); | |
1696 | pad->SetTopMargin(0.03); pad->SetBottomMargin(0.15); | |
1697 | pad->SetGridx(kFALSE); pad->SetGridy(kFALSE); | |
1698 | pad->SetLogz(); | |
1699 | ||
1700 | if(gROOT->FindObject("rangeQtotPfit")) delete gROOT->FindObject("rangeQtotPfit"); | |
1701 | TH2F* rangeQtotPfit = new TH2F("rangeQtotPfit", "", 100, 0.0, 11.99, 100, 0.0, (hqtot->GetMean()<10.0 ? 6.0 : 3999.)); | |
1702 | SetStyle(rangeQtotPfit->GetXaxis(), "P [GeV/c]", 0.07, 0.8, kTRUE, 0.05); | |
1703 | SetStyle(rangeQtotPfit->GetYaxis(), "Q_{tot}", 0.07, 0.8, kTRUE, 0.05); | |
1704 | rangeQtotPfit->SetStats(kFALSE); | |
1705 | rangeQtotPfit->Draw(); | |
1706 | ||
1707 | if(mpvErr) SetStyle(mpvErr, 1, kBlue, 2, 1, kBlue, 1); | |
1708 | if(widthErr) SetStyle(widthErr, 2, kRed, 2, 1, kRed, 1); | |
1709 | if(mpvErr) { | |
1710 | mpvErr->SetStats(kFALSE); | |
1711 | mpvErr->Draw("same"); | |
1712 | } | |
1713 | if(widthErr) { | |
1714 | widthErr->SetStats(kFALSE); | |
1715 | widthErr->Draw("same"); | |
1716 | } | |
1717 | TLegend* leg=new TLegend(0.2,0.6,0.5,0.9); | |
1718 | leg->SetFillColor(0); | |
1719 | leg->SetBorderSize(0); | |
1720 | leg->AddEntry("mpvErr","Landau MPV","l"); | |
1721 | leg->AddEntry("widthErr","Landau width","l"); | |
1722 | leg->Draw(); | |
1723 | } | |
1724 | ||
1725 | ||
1726 | //__________________________________________________________________________________________________ | |
1727 | void AliTRDcheckESD::PlotOtherSummaryFromCF(Double_t* trendValues) { | |
1728 | // | |
1729 | // | |
1730 | // | |
1731 | if(!fHistos) return; | |
1732 | AliCFContainer* matchPhiEta = (AliCFContainer*)fHistos->FindObject("MatchingPhiEta"); | |
1733 | AliCFContainer* trdQuality = (AliCFContainer*)fHistos->FindObject("trdQuality"); | |
1734 | AliCFContainer* trdChi2 = (AliCFContainer*)fHistos->FindObject("trdChi2"); | |
1735 | AliCFContainer* trdBudget = (AliCFContainer*)fHistos->FindObject("trdBudget"); | |
1736 | AliCFContainer* ploss = (AliCFContainer*)fHistos->FindObject("Ploss"); | |
1737 | AliCFContainer* clusters = (AliCFContainer*)fHistos->FindObject("clustersPerTracklet"); | |
1738 | AliCFContainer* clsRows = (AliCFContainer*)fHistos->FindObject("clustersVsRows"); | |
1739 | AliCFContainer* tpcTofMatch = (AliCFContainer*)fHistos->FindObject("MatchingPhiEta_TPCTOF"); | |
1740 | ||
1741 | TLatex *lat=new TLatex(); | |
1742 | lat->SetTextSize(0.06); | |
1743 | lat->SetTextColor(2); | |
1744 | lat->SetNDC(); | |
1745 | lat->SetTextFont(42); | |
1746 | TCanvas* c1 = new TCanvas("ESDsummary", "ESD summary 1", 1600, 1200); | |
1747 | gPad->SetTopMargin(0.05); gPad->SetBottomMargin(0.001); | |
1748 | gPad->SetLeftMargin(0.001); gPad->SetRightMargin(0.001); | |
1749 | gPad->Divide(3,3,0.,0.); | |
1750 | TList* l=gPad->GetListOfPrimitives(); | |
1751 | TVirtualPad* pad=0x0; | |
1752 | ||
1753 | // matching as a function of trigger class | |
1754 | if(matchPhiEta) { | |
1755 | matchPhiEta->SetRangeUser(matchPhiEta->GetVar(fgkVarNames[kTrackCharge]), -1.0, -1.0); | |
1756 | TH1F* hTRDEffTriggerNeg = EfficiencyFromPhiPt(matchPhiEta, -1, -1, 1, 0, kEventTrigger); | |
1757 | matchPhiEta->SetRangeUser(matchPhiEta->GetVar(fgkVarNames[kTrackCharge]), +1.0, +1.0); | |
1758 | TH1F* hTRDEffTriggerPos = EfficiencyFromPhiPt(matchPhiEta, -1, -1, 1, 0, kEventTrigger); | |
1759 | ||
1760 | pad = ((TVirtualPad*)l->At(0)); pad->cd(); | |
1761 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.01); | |
1762 | pad->SetTopMargin(0.06); pad->SetBottomMargin(0.15); | |
1763 | hTRDEffTriggerNeg->SetStats(kFALSE); | |
1764 | SetStyle(hTRDEffTriggerNeg->GetYaxis(), "efficiency", 0.06, 1.0, kTRUE, 0.06); | |
1765 | hTRDEffTriggerNeg->GetXaxis()->SetRange(1,fNAssignedTriggers); | |
1766 | hTRDEffTriggerPos->GetXaxis()->SetRange(1,fNAssignedTriggers); | |
1767 | SetStyle(hTRDEffTriggerNeg, 1, 2, 2, 20, 2, 1); | |
1768 | SetStyle(hTRDEffTriggerPos, 1, 4, 2, 20, 4, 1); | |
1769 | hTRDEffTriggerNeg->Draw(); | |
1770 | hTRDEffTriggerPos->Draw("same"); | |
1771 | TLegend* legEff=new TLegend(0.5,0.5,0.7,0.7); | |
1772 | legEff->SetFillColor(0); | |
1773 | legEff->SetBorderSize(0); | |
1774 | legEff->AddEntry(hTRDEffTriggerNeg, "negatives", "l"); | |
1775 | legEff->AddEntry(hTRDEffTriggerPos, "positives", "l"); | |
1776 | legEff->Draw(); | |
1777 | lat->DrawLatex(0.2, 0.95, "TPC-TRD matching efficiency"); | |
1778 | } | |
1779 | ||
1780 | if(trdQuality) { | |
1781 | // Track TRD quality vs (eta,phi) and vs TRD n-clusters | |
1782 | TH3D* trdQuality3D = (TH3D*)trdQuality->Project(0, trdQuality->GetVar(fgkVarNames[kTrackEtaTRD]), | |
1783 | trdQuality->GetVar(fgkVarNames[kTrackPhiTRD]), | |
1784 | trdQuality->GetVar(fgkVarNames[kTrackTrdQuality])); | |
1785 | trdQuality3D->GetZaxis()->SetRangeUser(0.1,100.0); | |
1786 | trdQuality3D->SetName("trdQuality3D"); | |
1787 | TProfile2D* prof2DQuality = trdQuality3D->Project3DProfile("yx"); | |
1788 | prof2DQuality->SetName("prof2DQuality"); | |
1789 | trdQuality->SetRangeUser(trdQuality->GetVar(fgkVarNames[kTrackCharge]), -1.5,-0.5); | |
1790 | TH2D* trdQualityPneg = (TH2D*)trdQuality->Project(0, trdQuality->GetVar(fgkVarNames[kTrackP]), | |
1791 | trdQuality->GetVar(fgkVarNames[kTrackTrdQuality])); | |
1792 | trdQualityPneg->SetName("trdQualityPneg"); | |
1793 | trdQuality->SetRangeUser(trdQuality->GetVar(fgkVarNames[kTrackCharge]), +0.5,1.5); | |
1794 | TH2D* trdQualityPpos = (TH2D*)trdQuality->Project(0, trdQuality->GetVar(fgkVarNames[kTrackP]), | |
1795 | trdQuality->GetVar(fgkVarNames[kTrackTrdQuality])); | |
1796 | trdQualityPpos->SetName("trdQualityPpos"); | |
1797 | trdQualityPneg->GetYaxis()->SetRangeUser(0.1,100.0); | |
1798 | TProfile* trdQualityPnegprof = trdQualityPneg->ProfileX(); | |
1799 | trdQualityPnegprof->SetName("trdQualityPnegprof"); | |
1800 | trdQualityPpos->GetYaxis()->SetRangeUser(0.1,100.0); | |
1801 | TProfile* trdQualityPposprof = trdQualityPpos->ProfileX(); | |
1802 | trdQualityPposprof->SetName("trdQualityPposprof"); | |
1803 | pad = ((TVirtualPad*)l->At(3)); pad->cd(); | |
1804 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1); | |
1805 | pad->SetTopMargin(0.06); pad->SetBottomMargin(0.15); | |
1806 | prof2DQuality->SetStats(kFALSE); | |
1807 | prof2DQuality->SetTitle(""); | |
1808 | SetStyle(prof2DQuality->GetXaxis(), "#eta", 0.06, 1.0, kTRUE, 0.06); | |
1809 | SetStyle(prof2DQuality->GetYaxis(), "#varphi (rad.)", 0.06, 1.0, kTRUE, 0.06); | |
1810 | prof2DQuality->SetMaximum(1.6); prof2DQuality->SetMinimum(0.4); | |
1811 | prof2DQuality->Draw("colz"); | |
1812 | lat->DrawLatex(0.2, 0.95, "TRD quality"); | |
1813 | pad = ((TVirtualPad*)l->At(6)); pad->cd(); | |
1814 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.01); | |
1815 | pad->SetTopMargin(0.06); pad->SetBottomMargin(0.15); | |
1816 | trdQualityPnegprof->SetStats(kFALSE); | |
1817 | trdQualityPnegprof->SetTitle(""); | |
1818 | SetStyle(trdQualityPnegprof->GetXaxis(), "P (GeV/c)", 0.06, 1.0, kTRUE, 0.06); | |
1819 | SetStyle(trdQualityPnegprof->GetYaxis(), "<TRD quality>", 0.06, 1.0, kTRUE, 0.06); | |
1820 | SetStyle(trdQualityPnegprof, 1, 2, 2, 20, 2, 1); | |
1821 | SetStyle(trdQualityPposprof, 1, 4, 2, 20, 4, 1); | |
1822 | trdQualityPnegprof->GetYaxis()->SetRangeUser(0.5, 1.39); | |
1823 | trdQualityPnegprof->Draw(); | |
1824 | trdQualityPposprof->Draw("same"); | |
1825 | lat->DrawLatex(0.2, 0.95, "TRD quality"); | |
1826 | } | |
1827 | ||
1828 | if(trdChi2) { | |
1829 | // Track TRD chi2 vs (eta,phi) | |
1830 | TH3D* trdChi23D = (TH3D*)trdChi2->Project(0, trdChi2->GetVar(fgkVarNames[kTrackEtaTRD]), | |
1831 | trdChi2->GetVar(fgkVarNames[kTrackPhiTRD]), | |
1832 | trdChi2->GetVar(fgkVarNames[kTrackTrdChi2])); | |
1833 | trdChi23D->SetName("trdChi23D"); | |
1834 | TProfile2D* prof2DChi2 = trdChi23D->Project3DProfile("yx"); | |
1835 | prof2DChi2->SetName("prof2DChi2"); | |
1836 | pad = ((TVirtualPad*)l->At(1)); pad->cd(); | |
1837 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1); | |
1838 | pad->SetTopMargin(0.06); pad->SetBottomMargin(0.15); | |
1839 | prof2DChi2->SetStats(kFALSE); | |
1840 | prof2DChi2->SetTitle(""); | |
1841 | SetStyle(prof2DChi2->GetXaxis(), "#eta", 0.06, 1.0, kTRUE, 0.06); | |
1842 | SetStyle(prof2DChi2->GetYaxis(), "#varphi (rad.)", 0.06, 1.0, kTRUE, 0.06); | |
1843 | prof2DChi2->SetMaximum(2.9); | |
1844 | prof2DChi2->Draw("colz"); | |
1845 | lat->DrawLatex(0.2, 0.95, "TRD #chi^{2}"); | |
1846 | ||
1847 | // Track TRD chi2 vs pt and charge | |
1848 | trdChi2->SetRangeUser(trdChi2->GetVar(fgkVarNames[kTrackCharge]), -1.0, -1.0); | |
1849 | TH2D* trdChi2VsPtNeg = (TH2D*)trdChi2->Project(0, trdChi2->GetVar(fgkVarNames[kTrackPt]), | |
1850 | trdChi2->GetVar(fgkVarNames[kTrackTrdChi2])); | |
1851 | trdChi2VsPtNeg->SetName("trdChi2VsPtNeg"); | |
1852 | TProfile* trdChi2VsPtNegProf = trdChi2VsPtNeg->ProfileX(); | |
1853 | trdChi2VsPtNegProf->SetName("trdChi2VsPtNegProf"); | |
1854 | trdChi2->SetRangeUser(trdChi2->GetVar(fgkVarNames[kTrackCharge]), 1.0, 1.0); | |
1855 | TH2D* trdChi2VsPtPos = (TH2D*)trdChi2->Project(0, trdChi2->GetVar(fgkVarNames[kTrackPt]), | |
1856 | trdChi2->GetVar(fgkVarNames[kTrackTrdChi2])); | |
1857 | trdChi2VsPtPos->SetName("trdChi2VsPtPos"); | |
1858 | TProfile* trdChi2VsPtPosProf = trdChi2VsPtPos->ProfileX(); | |
1859 | trdChi2VsPtPosProf->SetName("trdChi2VsPtPosProf"); | |
1860 | pad = ((TVirtualPad*)l->At(4)); pad->cd(); | |
1861 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.01); | |
1862 | pad->SetTopMargin(0.06); pad->SetBottomMargin(0.15); | |
1863 | trdChi2VsPtNegProf->SetStats(kFALSE); | |
1864 | trdChi2VsPtNegProf->SetTitle(""); | |
1865 | SetStyle(trdChi2VsPtNegProf->GetXaxis(), "p_{T} (GeV/c)", 0.06, 1.0, kTRUE, 0.06); | |
1866 | SetStyle(trdChi2VsPtNegProf->GetYaxis(), "<TRD #chi^{2}>", 0.06, 1.0, kTRUE, 0.06); | |
1867 | SetStyle(trdChi2VsPtNegProf, 1, 2, 2, 20, 2, 1); | |
1868 | SetStyle(trdChi2VsPtPosProf, 1, 4, 2, 20, 4, 1); | |
1869 | trdChi2VsPtNegProf->Draw(); | |
1870 | trdChi2VsPtPosProf->Draw("same"); | |
1871 | lat->DrawLatex(0.2, 0.95, "TRD #chi^{2}"); | |
1872 | } | |
1873 | ||
1874 | if(trdBudget) { | |
1875 | // Track TRD budget vs (eta,phi) | |
1876 | TH3D* trdBudget3D = (TH3D*)trdBudget->Project(0, trdBudget->GetVar(fgkVarNames[kTrackEtaTRD]), | |
1877 | trdBudget->GetVar(fgkVarNames[kTrackPhiTRD]), | |
1878 | trdBudget->GetVar(fgkVarNames[kTrackTRDBudget])); | |
1879 | trdBudget3D->SetName("trdBudget3D"); | |
1880 | TProfile2D* prof2DBudget = trdBudget3D->Project3DProfile("yx"); | |
1881 | prof2DBudget->SetName("prof2DBudget"); | |
1882 | pad = ((TVirtualPad*)l->At(7)); pad->cd(); | |
1883 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1); | |
1884 | pad->SetTopMargin(0.06); pad->SetBottomMargin(0.15); | |
1885 | prof2DBudget->SetStats(kFALSE); | |
1886 | prof2DBudget->SetTitle(""); | |
1887 | SetStyle(prof2DBudget->GetXaxis(), "#eta", 0.06, 1.0, kTRUE, 0.06); | |
1888 | SetStyle(prof2DBudget->GetYaxis(), "#varphi (rad.)", 0.06, 1.0, kTRUE, 0.06); | |
1889 | prof2DBudget->Draw("colz"); | |
1890 | lat->DrawLatex(0.2, 0.95, "TRD budget"); | |
1891 | } | |
1892 | ||
1893 | if(ploss) { | |
1894 | // momentum loss | |
1895 | ploss->SetRangeUser(ploss->GetVar(fgkVarNames[kTrackCharge]), -1.0, -1.0); | |
1896 | TH2D* plossLayerNeg = (TH2D*)ploss->Project(0, ploss->GetVar(fgkVarNames[kTrackletLayer]), | |
1897 | ploss->GetVar(fgkVarNames[kTrackPlossTRDlayer])); | |
1898 | plossLayerNeg->SetName("plossLayerNeg"); | |
1899 | TProfile* plossLayerNegProf = plossLayerNeg->ProfileX(); | |
1900 | plossLayerNegProf->SetName("plossLayerNegProf"); | |
1901 | ploss->SetRangeUser(ploss->GetVar(fgkVarNames[kTrackCharge]), +1.0, +1.0); | |
1902 | TH2D* plossLayerPos = (TH2D*)ploss->Project(0, ploss->GetVar(fgkVarNames[kTrackletLayer]), | |
1903 | ploss->GetVar(fgkVarNames[kTrackPlossTRDlayer])); | |
1904 | plossLayerPos->SetName("plossLayerPos"); | |
1905 | TProfile* plossLayerPosProf = plossLayerPos->ProfileX(); | |
1906 | plossLayerPosProf->SetName("plossLayerPosProf"); | |
1907 | ploss->SetRangeUser(ploss->GetVar(fgkVarNames[kTrackCharge]), -1.5, +1.5); | |
1908 | ||
1909 | ploss->SetRangeUser(ploss->GetVar(fgkVarNames[kTrackletLayer]), 0.0, 0.0); | |
1910 | TH3D* ploss3Dl0 = (TH3D*)ploss->Project(0, ploss->GetVar(fgkVarNames[kTrackEtaTRD]), | |
1911 | ploss->GetVar(fgkVarNames[kTrackPhiTRD]), | |
1912 | ploss->GetVar(fgkVarNames[kTrackPlossTRDlayer])); | |
1913 | ploss3Dl0->SetName("ploss3Dl0"); | |
1914 | TProfile2D* plossEtaPhiL0Prof = ploss3Dl0->Project3DProfile("yx"); | |
1915 | plossEtaPhiL0Prof->SetName("plossEtaPhiL0Prof"); | |
1916 | ploss->SetRangeUser(ploss->GetVar(fgkVarNames[kTrackletLayer]), 5.0, 5.0); | |
1917 | TH3D* ploss3Dl5 = (TH3D*)ploss->Project(0, ploss->GetVar(fgkVarNames[kTrackEtaTRD]), | |
1918 | ploss->GetVar(fgkVarNames[kTrackPhiTRD]), | |
1919 | ploss->GetVar(fgkVarNames[kTrackPlossTRDlayer])); | |
1920 | ploss3Dl5->SetName("ploss3Dl5"); | |
1921 | TProfile2D* plossEtaPhiL5Prof = ploss3Dl5->Project3DProfile("yx"); | |
1922 | plossEtaPhiL5Prof->SetName("plossEtaPhiL5Prof"); | |
1923 | pad = ((TVirtualPad*)l->At(2)); pad->cd(); | |
1924 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1); | |
1925 | pad->SetTopMargin(0.06); pad->SetBottomMargin(0.15); | |
1926 | plossEtaPhiL0Prof->SetStats(kFALSE); | |
1927 | plossEtaPhiL0Prof->SetTitle(""); | |
1928 | SetStyle(plossEtaPhiL0Prof->GetXaxis(), "#eta", 0.06, 1.0, kTRUE, 0.06); | |
1929 | SetStyle(plossEtaPhiL0Prof->GetYaxis(), "#varphi (rad.)", 0.06, 1.0, kTRUE, 0.06); | |
1930 | plossEtaPhiL0Prof->SetMaximum(0.08); | |
1931 | plossEtaPhiL0Prof->SetMinimum(-0.02); | |
1932 | plossEtaPhiL0Prof->Draw("colz"); | |
1933 | lat->DrawLatex(0.2, 0.95, "P_{loss} at layer 0"); | |
1934 | pad = ((TVirtualPad*)l->At(5)); pad->cd(); | |
1935 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1); | |
1936 | pad->SetTopMargin(0.06); pad->SetBottomMargin(0.15); | |
1937 | plossEtaPhiL5Prof->SetStats(kFALSE); | |
1938 | plossEtaPhiL5Prof->SetTitle(""); | |
1939 | SetStyle(plossEtaPhiL5Prof->GetXaxis(), "#eta", 0.06, 1.0, kTRUE, 0.06); | |
1940 | SetStyle(plossEtaPhiL5Prof->GetYaxis(), "#varphi (rad.)", 0.06, 1.0, kTRUE, 0.06); | |
1941 | plossEtaPhiL5Prof->SetMaximum(0.08); | |
1942 | plossEtaPhiL5Prof->SetMinimum(-0.02); | |
1943 | plossEtaPhiL5Prof->Draw("colz"); | |
1944 | lat->DrawLatex(0.2, 0.95, "P_{loss} at layer 5"); | |
1945 | pad = ((TVirtualPad*)l->At(8)); pad->cd(); | |
1946 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.01); | |
1947 | pad->SetTopMargin(0.06); pad->SetBottomMargin(0.15); | |
1948 | plossLayerNegProf->SetStats(kFALSE); | |
1949 | plossLayerNegProf->SetTitle(""); | |
1950 | SetStyle(plossLayerNegProf->GetYaxis(), "#Delta P (GeV/c)", 0.06, 1.0, kTRUE, 0.06); | |
1951 | SetStyle(plossLayerNegProf->GetXaxis(), "TRD layer", 0.06, 1.0, kTRUE, 0.06); | |
1952 | SetStyle(plossLayerNegProf, 1, 2, 2, 20, 2, 1); | |
1953 | SetStyle(plossLayerPosProf, 1, 4, 2, 20, 4, 1); | |
1954 | plossLayerNegProf->GetYaxis()->SetRangeUser(TMath::Min(plossLayerNegProf->GetMinimum(),plossLayerPosProf->GetMinimum()-0.01), | |
1955 | TMath::Max(plossLayerNegProf->GetMaximum(),plossLayerPosProf->GetMaximum())+0.01); | |
1956 | plossLayerNegProf->Draw(); | |
1957 | plossLayerPosProf->Draw("same"); | |
1958 | lat->DrawLatex(0.2, 0.95, "P_{loss} vs layer"); | |
1959 | } | |
1960 | ||
1961 | // clusters/tracklet and clusters/crossed rows | |
1962 | TH3D* clustersEtaPhi[6]={0x0}; | |
1963 | TH3D* clsRowsEtaPhi[6]={0x0}; | |
1964 | for(Int_t il=0;il<6;++il) { | |
1965 | if(clusters) { | |
1966 | clusters->SetRangeUser(clusters->GetVar(fgkVarNames[kTrackletLayer]), Double_t(il), Double_t(il)); | |
1967 | clustersEtaPhi[il]=(TH3D*)clusters->Project(0, clusters->GetVar(fgkVarNames[kTrackEtaTRD]), | |
1968 | clusters->GetVar(fgkVarNames[kTrackPhiTRD]), | |
1969 | clusters->GetVar(fgkVarNames[kTrackletClusters])); | |
1970 | clustersEtaPhi[il]->SetName(Form("clustersEtaPhi%d",il)); | |
1971 | } | |
1972 | if(clsRows) { | |
1973 | clsRows->SetRangeUser(clsRows->GetVar(fgkVarNames[kTrackletLayer]), Double_t(il), Double_t(il)); | |
1974 | clsRowsEtaPhi[il]=(TH3D*)clsRows->Project(0, clsRows->GetVar(fgkVarNames[kTrackEtaTRD]), | |
1975 | clsRows->GetVar(fgkVarNames[kTrackPhiTRD]), | |
1976 | clsRows->GetVar(fgkVarNames[kTrackletClustersVsRows])); | |
1977 | clsRowsEtaPhi[il]->SetName(Form("clsRowsEtaPhi%d",il)); | |
1978 | } | |
1979 | } | |
1980 | ||
1981 | lat->SetTextSize(0.05); | |
1982 | Int_t layerPads[6] = {0, 2, 4, 1, 3, 5}; | |
1983 | ||
1984 | TCanvas* c2=0x0; | |
1985 | if(clusters) { | |
1986 | c2 = new TCanvas("ESDsummary2", "ESD summary 2", 1600, 1200); | |
1987 | gPad->SetTopMargin(0.05); gPad->SetBottomMargin(0.001); | |
1988 | gPad->SetLeftMargin(0.001); gPad->SetRightMargin(0.001); | |
1989 | gPad->Divide(3,2,0.,0.); | |
1990 | l=gPad->GetListOfPrimitives(); | |
1991 | for(Int_t il=0;il<6;++il) { | |
1992 | TProfile2D* clustersEtaPhiProf = clustersEtaPhi[il]->Project3DProfile("yx"); | |
1993 | pad = ((TVirtualPad*)l->At(layerPads[il])); pad->cd(); | |
1994 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1); | |
1995 | pad->SetTopMargin(0.06); pad->SetBottomMargin(0.15); | |
1996 | clustersEtaPhiProf->SetStats(kFALSE); | |
1997 | clustersEtaPhiProf->SetTitle(""); | |
1998 | SetStyle(clustersEtaPhiProf->GetXaxis(), "#eta", 0.06, 1.0, kTRUE, 0.06); | |
1999 | SetStyle(clustersEtaPhiProf->GetYaxis(), "#varphi (rad.)", 0.06, 1.0, kTRUE, 0.06); | |
2000 | clustersEtaPhiProf->Draw("colz"); | |
2001 | lat->DrawLatex(0.2, 0.95, Form("Clusters / tracklet, layer %d", il)); | |
2002 | } | |
2003 | } | |
2004 | ||
2005 | TCanvas* c3=0x0; | |
2006 | if(clsRows) { | |
2007 | c3 = new TCanvas("ESDsummary3", "ESD summary 3", 1600, 1200); | |
2008 | gPad->SetTopMargin(0.05); gPad->SetBottomMargin(0.001); | |
2009 | gPad->SetLeftMargin(0.001); gPad->SetRightMargin(0.001); | |
2010 | gPad->Divide(3,2,0.,0.); | |
2011 | l=gPad->GetListOfPrimitives(); | |
2012 | for(Int_t il=0;il<6;++il) { | |
2013 | TProfile2D* clsRowsEtaPhiProf = clsRowsEtaPhi[il]->Project3DProfile("yx"); | |
2014 | pad = ((TVirtualPad*)l->At(layerPads[il])); pad->cd(); | |
2015 | pad->SetLeftMargin(0.15); pad->SetRightMargin(0.1); | |
2016 | pad->SetTopMargin(0.06); pad->SetBottomMargin(0.15); | |
2017 | clsRowsEtaPhiProf->SetStats(kFALSE); | |
2018 | clsRowsEtaPhiProf->SetTitle(""); | |
2019 | SetStyle(clsRowsEtaPhiProf->GetXaxis(), "#eta", 0.06, 1.0, kTRUE, 0.06); | |
2020 | SetStyle(clsRowsEtaPhiProf->GetYaxis(), "#varphi (rad.)", 0.06, 1.0, kTRUE, 0.06); | |
2021 | clsRowsEtaPhiProf->Draw("colz"); | |
2022 | lat->DrawLatex(0.2, 0.95, Form("Clusters / crossed rows, layer %d", il)); | |
2023 | } | |
2024 | } | |
2025 | ||
2026 | TCanvas* c4=0x0; | |
2027 | if(tpcTofMatch) { | |
2028 | TH2D* tpcRef = (TH2D*)tpcTofMatch->Project(0, tpcTofMatch->GetVar(fgkVarNames[kTrackEtaTRD]), | |
2029 | tpcTofMatch->GetVar(fgkVarNames[kTrackPhiTRD])); | |
2030 | TH2D* tpcPhiPt = (TH2D*)tpcTofMatch->Project(0, tpcTofMatch->GetVar(fgkVarNames[kTrackPt]), | |
2031 | tpcTofMatch->GetVar(fgkVarNames[kTrackPhiTRD])); | |
2032 | TH2D* tofin = (TH2D*)tpcTofMatch->Project(1, tpcTofMatch->GetVar(fgkVarNames[kTrackEtaTRD]), | |
2033 | tpcTofMatch->GetVar(fgkVarNames[kTrackPhiTRD])); | |
2034 | TH2D* tofinPhiPt = (TH2D*)tpcTofMatch->Project(1, tpcTofMatch->GetVar(fgkVarNames[kTrackPt]), | |
2035 | tpcTofMatch->GetVar(fgkVarNames[kTrackPhiTRD])); | |
2036 | TH2D* tofout = (TH2D*)tpcTofMatch->Project(2, tpcTofMatch->GetVar(fgkVarNames[kTrackEtaTRD]), | |
2037 | tpcTofMatch->GetVar(fgkVarNames[kTrackPhiTRD])); | |
2038 | TH2D* tofoutPhiPt = (TH2D*)tpcTofMatch->Project(2, tpcTofMatch->GetVar(fgkVarNames[kTrackPt]), | |
2039 | tpcTofMatch->GetVar(fgkVarNames[kTrackPhiTRD])); | |
2040 | tofin->Divide(tpcRef); | |
2041 | tofout->Divide(tpcRef); | |
2042 | tofinPhiPt->Divide(tpcPhiPt); | |
2043 | tofoutPhiPt->Divide(tpcPhiPt); | |
2044 | ||
2045 | c4=new TCanvas("ESDsummary4", "TPC - TOF matching", 1600., 1200.); | |
2046 | c4->SetLeftMargin(0.01); c4->SetRightMargin(0.01); | |
2047 | c4->SetTopMargin(0.01); c4->SetBottomMargin(0.01); | |
2048 | c4->Divide(2,2,0.,0.); | |
2049 | pad=c4->cd(1); | |
2050 | pad->SetLeftMargin(0.12); pad->SetRightMargin(0.12); | |
2051 | pad->SetTopMargin(0.07); pad->SetBottomMargin(0.12); | |
2052 | tofin->SetTitle(""); tofin->SetStats(kFALSE); | |
2053 | tofin->Draw("colz"); | |
2054 | lat->DrawLatex(0.1, 0.94, "TPC - TOFin matching"); | |
2055 | pad=c4->cd(2); | |
2056 | pad->SetLeftMargin(0.12); pad->SetRightMargin(0.12); | |
2057 | pad->SetTopMargin(0.07); pad->SetBottomMargin(0.12); | |
2058 | tofout->SetTitle(""); tofout->SetStats(kFALSE); | |
2059 | tofout->Draw("colz"); | |
2060 | lat->DrawLatex(0.1, 0.94, "TPC - TOFout matching"); | |
2061 | pad=c4->cd(3); | |
2062 | pad->SetLeftMargin(0.12); pad->SetRightMargin(0.12); | |
2063 | pad->SetTopMargin(0.07); pad->SetBottomMargin(0.12); | |
2064 | tofinPhiPt->SetTitle(""); tofinPhiPt->SetStats(kFALSE); | |
2065 | tofinPhiPt->Draw("colz"); | |
2066 | lat->DrawLatex(0.1, 0.94, "TPC - TOFin matching"); | |
2067 | pad=c4->cd(4); | |
2068 | pad->SetLeftMargin(0.12); pad->SetRightMargin(0.12); | |
2069 | pad->SetTopMargin(0.07); pad->SetBottomMargin(0.12); | |
2070 | tofoutPhiPt->SetTitle(""); tofoutPhiPt->SetStats(kFALSE); | |
2071 | tofoutPhiPt->Draw("colz"); | |
2072 | lat->DrawLatex(0.1, 0.94, "TPC - TOFout matching"); | |
2073 | } | |
2074 | ||
2075 | if(matchPhiEta || trdQuality || trdChi2 || trdBudget || ploss) c1->SaveAs("esdSummary1.gif"); | |
2076 | if(clusters) c2->SaveAs("esdSummary2.gif"); | |
2077 | if(clsRows) c3->SaveAs("esdSummary3.gif"); | |
2078 | if(tpcTofMatch) c4->SaveAs("esdSummary4.gif"); | |
2079 | } | |
2080 | ||
2081 | ||
2082 | //__________________________________________________________________________________________________ | |
2083 | void AliTRDcheckESD::DrawTRDGrid() { | |
2084 | // | |
2085 | // Draw a grid of lines showing the TRD supermodule and stack structure in (eta,phi) coordinates. | |
2086 | // The canvas on which to draw must already exist. | |
2087 | // | |
2088 | TLine line; | |
2089 | line.SetLineColor(2); | |
2090 | line.SetLineWidth(1); | |
2091 | line.SetLineStyle(2); | |
2092 | for(Int_t i=-9; i<=9; ++i) { | |
2093 | line.DrawLine(-1.0, 2.0*TMath::Pi()/18.0*i, +1.0, 2.0*TMath::Pi()/18.0*i); | |
2094 | } | |
2095 | line.DrawLine(-0.85, -3.15, -0.85, 3.15); | |
2096 | line.DrawLine(-0.54, -3.15, -0.54, 3.15); | |
2097 | line.DrawLine(-0.16, -3.15, -0.16, 3.15); | |
2098 | line.DrawLine(+0.16, -3.15, +0.16, 3.15); | |
2099 | line.DrawLine(+0.54, -3.15, +0.54, 3.15); | |
2100 | line.DrawLine(+0.85, -3.15, +0.85, 3.15); | |
2101 | } | |
2102 | ||
2103 | //_________________________________________________________________ | |
2104 | void AliTRDcheckESD::SetStyle(TH1* hist, | |
2105 | Int_t lineStyle, Int_t lineColor, Int_t lineWidth, | |
2106 | Int_t markerStyle, Int_t markerColor, Int_t markerSize) { | |
2107 | // | |
2108 | // Set style settings for histograms | |
2109 | // | |
2110 | if(!hist) return; | |
2111 | hist->SetLineStyle(lineStyle); | |
2112 | hist->SetLineColor(lineColor); | |
2113 | hist->SetLineWidth(lineWidth); | |
2114 | hist->SetMarkerStyle(markerStyle); | |
2115 | hist->SetMarkerColor(markerColor); | |
2116 | hist->SetMarkerSize(markerSize); | |
2117 | } | |
2118 | ||
2119 | //____________________________________________________________________ | |
2120 | void AliTRDcheckESD::SetStyle(TAxis* axis, const Char_t* title, Float_t titleSize, Float_t titleOffset, Bool_t centerTitle, | |
2121 | Float_t labelSize) { | |
2122 | // | |
2123 | // Set style settings for axes | |
2124 | // | |
2125 | if(!axis) return; | |
2126 | axis->SetTitle(title); | |
2127 | axis->SetTitleSize(titleSize); | |
2128 | axis->SetTitleOffset(titleOffset); | |
2129 | axis->CenterTitle(centerTitle); | |
2130 | axis->SetLabelSize(labelSize); | |
2131 | axis->SetTitleFont(42); | |
2132 | axis->SetLabelFont(42); | |
2133 | axis->SetNdivisions(507); | |
2134 | } | |
2135 | ||
2136 | //____________________________________________________________________ | |
2137 | void AliTRDcheckESD::FindIsolatedBCs(TH1D* bcHist, Bool_t isIsolated[3500]) { | |
2138 | // | |
2139 | // Find the isolated bunch crossings | |
2140 | // | |
2141 | Int_t isolationSize = 5; // number of free bunches in both directions | |
2142 | for(Int_t bcBin=1; bcBin<=bcHist->GetXaxis()->GetNbins(); ++bcBin) { | |
2143 | Int_t bc = TMath::Nint(bcHist->GetBinCenter(bcBin)); | |
2144 | if(bc<-0.001 || bc>3499.01) { | |
2145 | isIsolated[bc] = kFALSE; | |
2146 | continue; | |
2147 | } | |
2148 | Double_t entries = bcHist->GetBinContent(bcBin); | |
2149 | if(entries<0.001) { | |
2150 | isIsolated[bc] = kFALSE; | |
2151 | continue; // no entries | |
2152 | } | |
2153 | ||
2154 | // check isolation | |
2155 | isIsolated[bc] = kTRUE; | |
2156 | for(Int_t ibc = TMath::Max(1,bcBin-isolationSize); ibc<=TMath::Min(3499, bcBin+isolationSize); ++ibc) { | |
2157 | if(ibc==bcBin) continue; | |
2158 | if(bcHist->GetBinContent(ibc)>0.01) { | |
2159 | isIsolated[bc] = kFALSE; | |
2160 | break; | |
2161 | } | |
2162 | } | |
2163 | } // end loop over BC bins | |
2164 | ||
2165 | cout << "Isolated bunches: " << endl; | |
2166 | for(Int_t ibc=0; ibc<3500; ++ibc) | |
2167 | if(isIsolated[ibc]) cout << "BC #" << ibc << endl; | |
2168 | } | |
2169 | ||
2170 | ||
2171 | //__________________________________________________________________________________________________ | |
2172 | Int_t AliTRDcheckESD::GetTriggerIndex(const Char_t* name, Bool_t createNew/*=kTRUE*/) { | |
2173 | // | |
2174 | // Return the index of trigger "name" in the trigger histogram. | |
2175 | // If the index for this trigger does not exist yet, then assign one if createNew is set to TRUE | |
2176 | // | |
2177 | //cout << "GetTriggerIndex for " << name << endl; | |
2178 | TH1F* triggerHist = (TH1F*)fHistos->FindObject("hTriggerDefs"); | |
2179 | TString nameStr=name; | |
2180 | for(Int_t i=1; i<=triggerHist->GetXaxis()->GetNbins(); ++i) { | |
2181 | if(!nameStr.CompareTo(triggerHist->GetXaxis()->GetBinLabel(i))) { | |
2182 | //cout << " index found: " << i << endl; | |
2183 | return i; | |
2184 | } | |
2185 | } | |
2186 | if(createNew) { | |
2187 | triggerHist->GetXaxis()->SetBinLabel(fNAssignedTriggers+1, name); | |
2188 | for(Int_t i=1;i<fHistos->GetEntries();++i) { | |
2189 | TString objType = fHistos->At(i)->IsA()->GetName(); | |
2190 | if(!objType.Contains("AliCFContainer")) continue; | |
2191 | AliCFContainer* cf=(AliCFContainer*)fHistos->At(i); | |
2192 | Int_t trigVar = cf->GetVar(fgkVarNames[kEventTrigger]); | |
2193 | if(trigVar>=0) | |
2194 | for(Int_t istep=0;istep<cf->GetNStep();++istep) | |
2195 | cf->GetAxis(trigVar, istep)->SetBinLabel(fNAssignedTriggers+1, name); | |
2196 | } // end loop over histograms and CFs | |
2197 | ||
2198 | ++fNAssignedTriggers; | |
2199 | return fNAssignedTriggers+1; | |
2200 | } | |
2201 | else { | |
2202 | return -1; | |
2203 | } | |
2204 | } | |
2205 | ||
2206 | //__________________________________________________________________________________________________ | |
2207 | void AliTRDcheckESD::PrintTriggers() const { | |
2208 | // | |
2209 | // Print the available triggers for this run | |
2210 | // | |
2211 | if(!fHistos) { | |
2212 | cout << "Warning in AliTRDcheckESD::PrintTriggers(): No file loaded!" << endl; | |
2213 | return; | |
2214 | } | |
2215 | TH1F* hTriggers = (TH1F*)fHistos->FindObject("hTriggerDefs"); | |
2216 | cout << "Triggers found in this run" << endl; | |
2217 | cout << "==========================" << endl; | |
2218 | cout << "Name Index Entries " << endl; | |
2219 | for(Int_t it=1; it<hTriggers->GetXaxis()->GetNbins(); ++it) { | |
2220 | if(hTriggers->GetXaxis()->GetBinLabel(it)[0]!='\0') { | |
2221 | cout << hTriggers->GetXaxis()->GetBinLabel(it) << " " << hTriggers->GetXaxis()->GetBinCenter(it) << " " << hTriggers->GetBinContent(it) << endl; | |
2222 | } | |
2223 | } | |
2224 | } | |
2225 | ||
2226 | ||
2227 | //__________________________________________________________________________________________________ | |
2228 | Int_t AliTRDcheckESD::GetTriggerCounter(const Char_t* triggerName) const { | |
2229 | // | |
2230 | // Get the number of events for a given trigger name | |
2231 | // | |
2232 | if(!fHistos) { | |
2233 | cout << "Warning in AliTRDcheckESD::PrintTriggers(): No file loaded!" << endl; | |
2234 | return -1; | |
2235 | } | |
2236 | TH1F* hTriggers = (TH1F*)fHistos->FindObject("hTriggerDefs"); | |
2237 | Int_t counter = -1; | |
2238 | for(Int_t it=1; it<hTriggers->GetXaxis()->GetNbins(); ++it) { | |
2239 | TString trgString = hTriggers->GetXaxis()->GetBinLabel(it); | |
2240 | if(!trgString.CompareTo(triggerName)) | |
2241 | counter = (Int_t)hTriggers->GetBinContent(it); | |
2242 | } | |
2243 | if(counter<0) {cout << "AliTRDcheckESD::GetTriggerCounter() Trigger not found !!";} | |
2244 | return counter; | |
2245 | } | |
2246 | ||
2247 | ||
2248 | //__________________________________________________________________________________________________________ | |
2249 | Int_t AliTRDcheckESD::GetNAssignedTriggers() { | |
2250 | // | |
2251 | // Return the number of assigned triggers | |
2252 | // | |
2253 | return fNAssignedTriggers; | |
2254 | } |