Coverity
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AliFMDEventInspector.cxx
CommitLineData
7984e5f7 1//
2// This class inspects the event
3//
4// Input:
5// - AliESDFMD object possibly corrected for sharing
6//
7// Output:
8// - A histogram of v_z of events with triggers.
9// - A histogram of v_z of events with vertex and triggers
10// - A histogram of trigger counters
11//
12// Note, that these are added to the master output list
13//
14// Corrections used:
15// - None
16//
8565b10b 17#include "AliFMDEventInspector.h"
18#include "AliLog.h"
19#include "AliESDEvent.h"
20#include "AliMultiplicity.h"
21#include "AliAnalysisManager.h"
22#include "AliInputEventHandler.h"
23#include "AliTriggerAnalysis.h"
24#include "AliPhysicsSelection.h"
25#include "AliAODForwardMult.h"
0bd4b00f 26#include "AliForwardUtil.h"
5e4d905e 27#include "AliCentrality.h"
8565b10b 28#include <TH1.h>
29#include <TList.h>
30#include <TDirectory.h>
0bd4b00f 31#include <TROOT.h>
32#include <iostream>
33#include <iomanip>
e1f47419 34
8565b10b 35//====================================================================
36AliFMDEventInspector::AliFMDEventInspector()
37 : TNamed(),
38 fHEventsTr(0),
39 fHEventsTrVtx(0),
40 fHTriggers(0),
0bd4b00f 41 fHType(0),
fe52e455 42 fHWords(0),
5e4d905e 43 fHCent(0),
e308a636 44 fHCentVsQual(0),
8565b10b 45 fLowFluxCut(1000),
9d05ffeb 46 fMaxVzErr(0.2),
8565b10b 47 fList(0),
0bd4b00f 48 fEnergy(0),
49 fField(999),
50 fCollisionSystem(kUnknown),
e308a636 51 fDebug(0),
52 fCentAxis(0)
8565b10b 53{
7984e5f7 54 //
55 // Constructor
56 //
8565b10b 57}
58
59//____________________________________________________________________
60AliFMDEventInspector::AliFMDEventInspector(const char* name)
61 : TNamed("fmdEventInspector", name),
62 fHEventsTr(0),
63 fHEventsTrVtx(0),
64 fHTriggers(0),
0bd4b00f 65 fHType(0),
fe52e455 66 fHWords(0),
5e4d905e 67 fHCent(0),
e308a636 68 fHCentVsQual(0),
8565b10b 69 fLowFluxCut(1000),
9d05ffeb 70 fMaxVzErr(0.2),
8565b10b 71 fList(0),
0bd4b00f 72 fEnergy(0),
73 fField(999),
74 fCollisionSystem(kUnknown),
e308a636 75 fDebug(0),
76 fCentAxis(0)
8565b10b 77{
7984e5f7 78 //
79 // Constructor
80 //
81 // Parameters:
82 // name Name of object
83 //
8565b10b 84}
85
86//____________________________________________________________________
87AliFMDEventInspector::AliFMDEventInspector(const AliFMDEventInspector& o)
88 : TNamed(o),
89 fHEventsTr(o.fHEventsTr),
90 fHEventsTrVtx(o.fHEventsTrVtx),
91 fHTriggers(o.fHTriggers),
0bd4b00f 92 fHType(o.fHType),
fe52e455 93 fHWords(o.fHWords),
5e4d905e 94 fHCent(o.fHCent),
e308a636 95 fHCentVsQual(o.fHCentVsQual),
6feacd76 96 fLowFluxCut(o.fLowFluxCut),
8565b10b 97 fMaxVzErr(o.fMaxVzErr),
98 fList(o.fList),
0bd4b00f 99 fEnergy(o.fEnergy),
100 fField(o.fField),
101 fCollisionSystem(o.fCollisionSystem),
e308a636 102 fDebug(0),
103 fCentAxis(0)
8565b10b 104{
7984e5f7 105 //
106 // Copy constructor
107 //
108 // Parameters:
109 // o Object to copy from
110 //
8565b10b 111}
112
113//____________________________________________________________________
114AliFMDEventInspector::~AliFMDEventInspector()
115{
7984e5f7 116 //
117 // Destructor
118 //
8565b10b 119 if (fList) delete fList;
120}
121//____________________________________________________________________
122AliFMDEventInspector&
123AliFMDEventInspector::operator=(const AliFMDEventInspector& o)
124{
7984e5f7 125 //
126 // Assignement operator
127 //
128 // Parameters:
129 // o Object to assign from
130 //
131 // Return:
132 // Reference to this object
133 //
8565b10b 134 TNamed::operator=(o);
135 fHEventsTr = o.fHEventsTr;
136 fHEventsTrVtx = o.fHEventsTrVtx;
137 fHTriggers = o.fHTriggers;
0bd4b00f 138 fHType = o.fHType;
fe52e455 139 fHWords = o.fHWords;
5e4d905e 140 fHCent = o.fHCent;
e308a636 141 fHCentVsQual = o.fHCentVsQual;
8565b10b 142 fLowFluxCut = o.fLowFluxCut;
143 fMaxVzErr = o.fMaxVzErr;
144 fDebug = o.fDebug;
145 fList = (o.fList ? new TList : 0);
0bd4b00f 146 fEnergy = o.fEnergy;
147 fField = o.fField;
148 fCollisionSystem = o.fCollisionSystem;
8565b10b 149 if (fList) {
150 fList->SetName(GetName());
151 if (fHEventsTr) fList->Add(fHEventsTr);
152 if (fHEventsTrVtx) fList->Add(fHEventsTrVtx);
153 if (fHTriggers) fList->Add(fHTriggers);
0bd4b00f 154 if (fHType) fList->Add(fHType);
fe52e455 155 if (fHWords) fList->Add(fHWords);
5e4d905e 156 if (fHCent) fList->Add(fHCent);
e308a636 157 if (fHCentVsQual) fList->Add(fHCentVsQual);
8565b10b 158 }
159 return *this;
160}
161
162//____________________________________________________________________
163Bool_t
fb3430ac 164AliFMDEventInspector::FetchHistograms(const TList* d,
8565b10b 165 TH1I*& hEventsTr,
166 TH1I*& hEventsTrVtx,
167 TH1I*& hTriggers) const
168{
7984e5f7 169 //
170 // Fetch our histograms from the passed list
171 //
172 // Parameters:
173 // d Input
174 // hEventsTr On return, pointer to histogram, or null
175 // hEventsTrVtx On return, pointer to histogram, or null
176 // hTriggers On return, pointer to histogram, or null
177 //
178 // Return:
179 // true on success, false otherwise
180 //
8565b10b 181 hEventsTr = 0;
182 hEventsTrVtx = 0;
183 hTriggers = 0;
184 TList* dd = dynamic_cast<TList*>(d->FindObject(GetName()));
185 if (!dd) return kFALSE;
186
187 hEventsTr = dynamic_cast<TH1I*>(dd->FindObject("nEventsTr"));
188 hEventsTrVtx = dynamic_cast<TH1I*>(dd->FindObject("nEventsTrVtx"));
189 hTriggers = dynamic_cast<TH1I*>(dd->FindObject("triggers"));
190
191 if (!hEventsTr || !hEventsTrVtx || !hTriggers) return kFALSE;
192 return kTRUE;
193}
194//____________________________________________________________________
195void
196AliFMDEventInspector::Init(const TAxis& vtxAxis)
197{
7984e5f7 198 //
199 // Initialize the object
200 //
201 // Parameters:
202 // vtxAxis Vertex axis in use
203 //
e308a636 204
205 // -1.5 -0.5 0.5 1.5 ... 89.5 ... 100.5
206 // ----- 92 number --------- ---- 1 ---
207 TArrayD limits(93);
208 for (Int_t i = 0; i < 92; i++) limits[i] = -1.5 + i;
209
210 fCentAxis = new TAxis(limits.GetSize()-1, limits.GetArray());
8565b10b 211 fHEventsTr = new TH1I("nEventsTr", "Number of events w/trigger",
212 vtxAxis.GetNbins(),
213 vtxAxis.GetXmin(),
214 vtxAxis.GetXmax());
215 fHEventsTr->SetXTitle("v_{z} [cm]");
216 fHEventsTr->SetYTitle("# of events");
217 fHEventsTr->SetFillColor(kRed+1);
218 fHEventsTr->SetFillStyle(3001);
219 fHEventsTr->SetDirectory(0);
220 // fHEventsTr->Sumw2();
221 fList->Add(fHEventsTr);
222
223 fHEventsTrVtx = new TH1I("nEventsTrVtx",
224 "Number of events w/trigger and vertex",
225 vtxAxis.GetNbins(),
226 vtxAxis.GetXmin(),
227 vtxAxis.GetXmax());
228 fHEventsTrVtx->SetXTitle("v_{z} [cm]");
229 fHEventsTrVtx->SetYTitle("# of events");
230 fHEventsTrVtx->SetFillColor(kBlue+1);
231 fHEventsTrVtx->SetFillStyle(3001);
232 fHEventsTrVtx->SetDirectory(0);
233 // fHEventsTrVtx->Sumw2();
234 fList->Add(fHEventsTrVtx);
235
236
0be6c8cd 237 fHTriggers = new TH1I("triggers", "Triggers", kOffline+1, 0, kOffline+1);
8565b10b 238 fHTriggers->SetFillColor(kRed+1);
239 fHTriggers->SetFillStyle(3001);
240 fHTriggers->SetStats(0);
241 fHTriggers->SetDirectory(0);
242 fHTriggers->GetXaxis()->SetBinLabel(kInel +1,"INEL");
243 fHTriggers->GetXaxis()->SetBinLabel(kInelGt0+1,"INEL>0");
244 fHTriggers->GetXaxis()->SetBinLabel(kNSD +1,"NSD");
245 fHTriggers->GetXaxis()->SetBinLabel(kEmpty +1,"Empty");
246 fHTriggers->GetXaxis()->SetBinLabel(kA +1,"A");
247 fHTriggers->GetXaxis()->SetBinLabel(kB +1,"B");
248 fHTriggers->GetXaxis()->SetBinLabel(kC +1,"C");
249 fHTriggers->GetXaxis()->SetBinLabel(kE +1,"E");
e58000b7 250 fHTriggers->GetXaxis()->SetBinLabel(kPileUp +1,"Pileup");
0be6c8cd 251 fHTriggers->GetXaxis()->SetBinLabel(kMCNSD +1,"NSD_{MC}");
252 fHTriggers->GetXaxis()->SetBinLabel(kOffline+1,"Offline");
8565b10b 253 fList->Add(fHTriggers);
0bd4b00f 254
255 fHType = new TH1I("type", Form("Event type (cut: SPD mult>%d)",
256 fLowFluxCut), 2, -.5, 1.5);
257 fHType->SetFillColor(kRed+1);
258 fHType->SetFillStyle(3001);
259 fHType->SetStats(0);
260 fHType->SetDirectory(0);
261 fHType->GetXaxis()->SetBinLabel(1,"Low-flux");
262 fHType->GetXaxis()->SetBinLabel(2,"High-flux");
263 fList->Add(fHType);
fe52e455 264
265
266 fHWords = new TH1I("words", "Trigger words seen", 1, 0, 0);
267 fHWords->SetFillColor(kBlue+1);
268 fHWords->SetFillStyle(3001);
269 fHWords->SetStats(0);
270 fHWords->SetDirectory(0);
271 fHWords->SetBit(TH1::kCanRebin);
272 fList->Add(fHWords);
5e4d905e 273
e308a636 274 fHCent = new TH1F("cent", "Centrality", limits.GetSize()-1,limits.GetArray());
5e4d905e 275 fHCent->SetFillColor(kBlue+1);
276 fHCent->SetFillStyle(3001);
277 fHCent->SetStats(0);
278 fHCent->SetDirectory(0);
279 fHCent->SetXTitle("Centrality [%]");
280 fHCent->SetYTitle("Events");
281 fList->Add(fHCent);
e308a636 282
283 fHCentVsQual = new TH2F("centVsQuality", "Quality vs Centrality",
284 5, 0, 5, limits.GetSize()-1, limits.GetArray());
285 fHCentVsQual->SetXTitle("Quality");
286 fHCentVsQual->SetYTitle("Centrality [%]");
287 fHCentVsQual->SetZTitle("Events");
288 fHCentVsQual->GetXaxis()->SetBinLabel(1, "OK");
289 fHCentVsQual->GetXaxis()->SetBinLabel(2, "Outside v_{z} cut");
290 fHCentVsQual->GetXaxis()->SetBinLabel(3, "V0 vs SPD outlier");
291 fHCentVsQual->GetXaxis()->SetBinLabel(4, "V0 vs TPC outlier");
292 fHCentVsQual->GetXaxis()->SetBinLabel(5, "V0 vs ZDC outlier");
293 fList->Add(fHCentVsQual);
8565b10b 294}
295
296//____________________________________________________________________
297void
298AliFMDEventInspector::DefineOutput(TList* dir)
299{
7984e5f7 300 //
301 // Define the output histograms. These are put in a sub list of the
302 // passed list. The histograms are merged before the parent task calls
303 // AliAnalysisTaskSE::Terminate
304 //
305 // dir Directory to add to
306 //
8565b10b 307 fList = new TList;
308 fList->SetName(GetName());
309 dir->Add(fList);
310}
311
312//____________________________________________________________________
313UInt_t
314AliFMDEventInspector::Process(const AliESDEvent* event,
315 UInt_t& triggers,
316 Bool_t& lowFlux,
0bd4b00f 317 UShort_t& ivz,
5e4d905e 318 Double_t& vz,
319 Double_t& cent)
8565b10b 320{
7984e5f7 321 //
322 // Process the event
323 //
324 // Parameters:
325 // event Input event
326 // triggers On return, the triggers fired
327 // lowFlux On return, true if the event is considered a low-flux
328 // event (according to the setting of fLowFluxCut)
329 // ivz On return, the found vertex bin (1-based). A zero
330 // means outside of the defined vertex range
331 // vz On return, the z position of the interaction
5e4d905e 332 // cent On return, the centrality - if not available < 0
7984e5f7 333 //
334 // Return:
335 // 0 (or kOk) on success, otherwise a bit mask of error codes
336 //
337
e1f47419 338 // --- Check that we have an event ---------------------------------
8565b10b 339 if (!event) {
340 AliWarning("No ESD event found for input event");
341 return kNoEvent;
342 }
343
e1f47419 344 // --- Read trigger information from the ESD and store in AOD object
8565b10b 345 if (!ReadTriggers(event, triggers)) {
0bd4b00f 346 if (fDebug > 2) {
347 AliWarning("Failed to read triggers from ESD"); }
8565b10b 348 return kNoTriggers;
349 }
350
e1f47419 351 // --- Check if this is a high-flux event --------------------------
8565b10b 352 const AliMultiplicity* testmult = event->GetMultiplicity();
353 if (!testmult) {
0bd4b00f 354 if (fDebug > 3) {
355 AliWarning("No central multiplicity object found"); }
8565b10b 356 }
e1f47419 357 else
358 lowFlux = testmult->GetNumberOfTracklets() < fLowFluxCut;
5e4d905e 359
0bd4b00f 360 fHType->Fill(lowFlux ? 0 : 1);
5e4d905e 361
e1f47419 362 // --- Read centrality information
e308a636 363 cent = -10;
364 UShort_t qual = 0;
365 if (!ReadCentrality(event, cent, qual)) {
e1f47419 366 if (fDebug > 3)
367 AliWarning("Failed to get centrality");
8565b10b 368 }
e308a636 369 fHCent->Fill(cent);
370 if (qual == 0) fHCentVsQual->Fill(0., cent);
371 else {
372 for (UShort_t i = 0; i < 4; i++)
373 if (qual & (1 << i)) fHCentVsQual->Fill(Double_t(i+1), cent);
374 }
8565b10b 375
e1f47419 376 // --- Get the vertex information ----------------------------------
8565b10b 377 vz = 0;
378 Bool_t vzOk = ReadVertex(event, vz);
379
380 fHEventsTr->Fill(vz);
381 if (!vzOk) {
0bd4b00f 382 if (fDebug > 3) {
383 AliWarning("Failed to read vertex from ESD"); }
8565b10b 384 return kNoVertex;
385 }
386 fHEventsTrVtx->Fill(vz);
387
e1f47419 388 // --- Get the vertex bin ------------------------------------------
0bd4b00f 389 ivz = fHEventsTr->GetXaxis()->FindBin(vz);
390 if (ivz <= 0 || ivz > fHEventsTr->GetXaxis()->GetNbins()) {
391 if (fDebug > 3) {
8565b10b 392 AliWarning(Form("Vertex @ %f outside of range [%f,%f]",
393 vz, fHEventsTr->GetXaxis()->GetXmin(),
0bd4b00f 394 fHEventsTr->GetXaxis()->GetXmax())); }
395 ivz = 0;
8565b10b 396 return kBadVertex;
397 }
e58000b7 398
e1f47419 399 // --- Check the FMD ESD data --------------------------------------
400 if (!event->GetFMDData()) {
401 if (fDebug > 3) {
402 AliWarning("No FMD data found in ESD"); }
403 return kNoFMD;
404 }
405
e58000b7 406
8565b10b 407 return kOk;
408}
409
e1f47419 410//____________________________________________________________________
411Bool_t
e308a636 412AliFMDEventInspector::ReadCentrality(const AliESDEvent* esd,
413 Double_t& cent,
414 UShort_t& qual) const
e1f47419 415{
416 //
417 // Read centrality from event
418 //
419 // Parameters:
420 // esd Event
421 // cent On return, the centrality or negative if not found
422 //
423 // Return:
424 // False on error, true otherwise
425 //
e308a636 426 cent = -1;
427 qual = 0;
e1f47419 428 AliCentrality* centObj = const_cast<AliESDEvent*>(esd)->GetCentrality();
e308a636 429 if (!centObj) return true;
430
431 // AliInfo(Form("Got centrality object %p with quality %d",
432 // centObj, centObj->GetQuality()));
433 // centObj->Print();
434 cent = centObj->GetCentralityPercentile("V0M");
435 qual = centObj->GetQuality();
e1f47419 436
437 return true;
438}
439
8565b10b 440//____________________________________________________________________
441Bool_t
442AliFMDEventInspector::ReadTriggers(const AliESDEvent* esd, UInt_t& triggers)
443{
7984e5f7 444 //
445 // Read the trigger information from the ESD event
446 //
447 // Parameters:
448 // esd ESD event
449 // triggers On return, contains the trigger bits
450 //
451 // Return:
452 // @c true on success, @c false otherwise
453 //
8565b10b 454 triggers = 0;
455
456 // Get the analysis manager - should always be there
457 AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager();
458 if (!am) {
459 AliWarning("No analysis manager defined!");
460 return kFALSE;
461 }
462
463 // Get the input handler - should always be there
464 AliInputEventHandler* ih =
465 static_cast<AliInputEventHandler*>(am->GetInputEventHandler());
466 if (!ih) {
467 AliWarning("No input handler");
468 return kFALSE;
469 }
e58000b7 470
e1f47419 471 // Check if this is a collision candidate (MB)
e333578d 472 // Note, that we should use the value cached in the input
473 // handler rather than calling IsCollisionCandiate directly
474 // on the AliPhysicsSelection obejct. If we called the latter
475 // then the AliPhysicsSelection object would overcount by a
476 // factor of 2! :-(
0be6c8cd 477 Bool_t offline = ih->IsEventSelected();
478 if (offline) {
479 triggers |= AliAODForwardMult::kOffline;
8565b10b 480 triggers |= AliAODForwardMult::kInel;
0be6c8cd 481 fHTriggers->Fill(kOffline+0.5);
8565b10b 482
0be6c8cd 483 // If this is inel, see if we have a tracklet
8565b10b 484 const AliMultiplicity* spdmult = esd->GetMultiplicity();
485 if (!spdmult) {
486 AliWarning("No SPD multiplicity");
487 }
488 else {
e333578d 489 // Check if we have one or more tracklets
490 // in the range -1 < eta < 1 to set the INEL>0
491 // trigger flag.
8565b10b 492 Int_t n = spdmult->GetNumberOfTracklets();
493 for (Int_t j = 0; j < n; j++) {
494 if(TMath::Abs(spdmult->GetEta(j)) < 1) {
495 triggers |= AliAODForwardMult::kInelGt0;
8565b10b 496 break;
497 }
498 }
499 }
500 }
501
502 // Analyse some trigger stuff
503 AliTriggerAnalysis ta;
0be6c8cd 504 if (ta.IsOfflineTriggerFired(esd, AliTriggerAnalysis::kNSD1))
8565b10b 505 triggers |= AliAODForwardMult::kNSD;
0be6c8cd 506
507
e58000b7 508 //Check pileup
509 Bool_t pileup = esd->IsPileupFromSPD(3,0.8);
510 if (pileup) {
511 triggers |= AliAODForwardMult::kPileUp;
512 fHTriggers->Fill(kPileUp+.5);
513 }
0be6c8cd 514
e58000b7 515
8565b10b 516 // Get trigger stuff
517 TString trigStr = esd->GetFiredTriggerClasses();
fe52e455 518 // AliWarning(Form("Fired trigger classes: %s", trigStr.Data()));
519 fHWords->Fill(trigStr.Data(), 1);
520#if 0
521 if (trigStr.Contains("MB1") || trigStr.Contains("MBBG3"))
0be6c8cd 522 triggers |= AliAOODForwardMult::kB;
fe52e455 523 if (trigStr.Contains("COTA"))
524 triggers |= AliAODForwardMult::kA;
525 if (trigStr.Contains("COTC"))
526 triggers |= AliAODForwardMult::kC;
527#endif
8565b10b 528 if (trigStr.Contains("CBEAMB-ABCE-NOPF-ALL")) {
529 triggers |= AliAODForwardMult::kEmpty;
530 fHTriggers->Fill(kEmpty+.5);
531 }
532
0be6c8cd 533 if (trigStr.Contains("CINT1A-ABCE-NOPF-ALL") ||
534 trigStr.Contains("CINT1-AC_NOPF-ALLNOTRD")) {
8565b10b 535 triggers |= AliAODForwardMult::kA;
536 fHTriggers->Fill(kA+.5);
537 }
538
0be6c8cd 539 if (trigStr.Contains("CINT1B-ABCE-NOPF-ALL") ||
540 trigStr.Contains("CINT1-B-NOPF-ALLNOTRD")) {
8565b10b 541 triggers |= AliAODForwardMult::kB;
542 fHTriggers->Fill(kB+.5);
543 }
544
545
546 if (trigStr.Contains("CINT1C-ABCE-NOPF-ALL")) {
547 triggers |= AliAODForwardMult::kC;
548 fHTriggers->Fill(kC+.5);
549 }
550
0be6c8cd 551 if (trigStr.Contains("CINT1-E-NOPF-ALL") ||
552 trigStr.Contains("CINT1-E-NOPF-ALLNOTRD")) {
8565b10b 553 triggers |= AliAODForwardMult::kE;
554 fHTriggers->Fill(kE+.5);
555 }
556
0be6c8cd 557 if (triggers & AliAODForwardMult::kB) {
558 if (triggers & AliAODForwardMult::kInel)
559 fHTriggers->Fill(kInel);
560
561 if (triggers & AliAODForwardMult::kInelGt0)
562 fHTriggers->Fill(kInelGt0+.5);
563
564 if (triggers & AliAODForwardMult::kNSD)
565 fHTriggers->Fill(kNSD+.5);
566 }
567
8565b10b 568 return kTRUE;
569}
570//____________________________________________________________________
571Bool_t
572AliFMDEventInspector::ReadVertex(const AliESDEvent* esd, Double_t& vz)
573{
7984e5f7 574 //
575 // Read the vertex information from the ESD event
576 //
577 // Parameters:
578 // esd ESD event
579 // vz On return, the vertex Z position
580 //
581 // Return:
582 // @c true on success, @c false otherwise
583 //
8565b10b 584 vz = 0;
585 // Get the vertex
586 const AliESDVertex* vertex = esd->GetPrimaryVertexSPD();
587 if (!vertex) {
0bd4b00f 588 if (fDebug > 2) {
589 AliWarning("No SPD vertex found in ESD"); }
8565b10b 590 return kFALSE;
591 }
592
593 // Check that enough tracklets contributed
594 if(vertex->GetNContributors() <= 0) {
0bd4b00f 595 if (fDebug > 2) {
8565b10b 596 AliWarning(Form("Number of contributors to vertex is %d<=0",
0bd4b00f 597 vertex->GetNContributors())); }
8565b10b 598 vz = 0;
599 return kFALSE;
0be6c8cd 600 }
8565b10b 601 // Check that the uncertainty isn't too large
602 if (vertex->GetZRes() > fMaxVzErr) {
0bd4b00f 603 if (fDebug > 2) {
8565b10b 604 AliWarning(Form("Uncertaintity in Z of vertex is too large %f > %f",
0bd4b00f 605 vertex->GetZRes(), fMaxVzErr)); }
8565b10b 606 return kFALSE;
607 }
0be6c8cd 608
8565b10b 609 // Get the z coordiante
610 vz = vertex->GetZ();
611 return kTRUE;
612}
0be6c8cd 613
0bd4b00f 614//____________________________________________________________________
615Bool_t
616AliFMDEventInspector::ReadRunDetails(const AliESDEvent* esd)
617{
7984e5f7 618 //
619 // Read the collision system, collision energy, and L3 field setting
620 // from the ESD
621 //
622 // Parameters:
623 // esd ESD to get information from
624 //
625 // Return:
626 // true on success, false
627 //
cc83fca2 628 // AliInfo(Form("Parameters from 1st ESD event: cms=%s, sNN=%f, field=%f",
629 // esd->GetBeamType(), 2*esd->GetBeamEnergy(),
630 // esd->GetMagneticField()));
0bd4b00f 631 fCollisionSystem =
632 AliForwardUtil::ParseCollisionSystem(esd->GetBeamType());
633 fEnergy =
634 AliForwardUtil::ParseCenterOfMassEnergy(fCollisionSystem,
0be6c8cd 635 2 * esd->GetBeamEnergy());
0bd4b00f 636 fField =
637 AliForwardUtil::ParseMagneticField(esd->GetMagneticField());
638
639 if (fCollisionSystem == AliForwardUtil::kUnknown ||
640 fEnergy <= 0 ||
641 TMath::Abs(fField) > 10)
642 return kFALSE;
643
644 return kTRUE;
645}
646
647//____________________________________________________________________
648void
649AliFMDEventInspector::Print(Option_t*) const
650{
7984e5f7 651 //
652 // Print information
653 //
654 // option Not used
655 //
0bd4b00f 656 char ind[gROOT->GetDirLevel()+1];
657 for (Int_t i = 0; i < gROOT->GetDirLevel(); i++) ind[i] = ' ';
658 ind[gROOT->GetDirLevel()] = '\0';
659 TString sNN(AliForwardUtil::CenterOfMassEnergyString(fEnergy));
660 sNN.Strip(TString::kBoth, '0');
661 sNN.ReplaceAll("GeV", " GeV");
662 TString field(AliForwardUtil::MagneticFieldString(fField));
663 field.ReplaceAll("p", "+");
664 field.ReplaceAll("m", "-");
665 field.ReplaceAll("kG", " kG");
666
e1f47419 667 std::cout << ind << ClassName() << ": " << GetName() << '\n'
0bd4b00f 668 << ind << " Low flux cut: " << fLowFluxCut << '\n'
669 << ind << " Max(delta v_z): " << fMaxVzErr << " cm\n"
670 << ind << " System: "
671 << AliForwardUtil::CollisionSystemString(fCollisionSystem) << '\n'
672 << ind << " CMS energy per nucleon: " << sNN << '\n'
673 << ind << " Field: " << field << std::endl;
674}
675
676
8565b10b 677//
678// EOF
679//
680