2 // This class inspects the event
5 // - AliESDFMD object possibly corrected for sharing
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
12 // Note, that these are added to the master output list
17 #include "AliFMDEventInspector.h"
18 #include "AliProdInfo.h"
20 #include "AliESDEvent.h"
21 #include "AliMultiplicity.h"
22 #include "AliAnalysisManager.h"
23 #include "AliMCEventHandler.h"
24 #include "AliInputEventHandler.h"
25 #include "AliTriggerAnalysis.h"
26 #include "AliPhysicsSelection.h"
27 #include "AliOADBPhysicsSelection.h"
28 #include "AliAODForwardMult.h"
29 #include "AliForwardUtil.h"
30 #include "AliCentrality.h"
33 #include <TDirectory.h>
35 #include <TParameter.h>
36 #include <TMatrixDSym.h>
40 #include "AliMCEvent.h"
41 #include "AliHeader.h"
42 #include "AliGenEventHeader.h"
43 #include "AliCollisionGeometry.h"
44 #include "AliVVZERO.h"
46 //====================================================================
47 const char* AliFMDEventInspector::fgkFolderName = "fmdEventInspector";
49 //____________________________________________________________________
50 AliFMDEventInspector::AliFMDEventInspector()
55 fHEventsAcceptedXY(0),
70 fCollisionSystem(kUnknown),
74 fUseFirstPhysicsVertex(false),
77 fMinPileupDistance(0.8),
78 fUseDisplacedVertices(false),
85 fUsepA2012Vertex(false),
92 DGUARD(fDebug,1,"Default CTOR of AliFMDEventInspector");
95 //____________________________________________________________________
96 AliFMDEventInspector::AliFMDEventInspector(const char* name)
97 : TNamed(fgkFolderName, name),
101 fHEventsAcceptedXY(0),
116 fCollisionSystem(kUnknown),
120 fUseFirstPhysicsVertex(false),
122 fMinPileupContrib(3),
123 fMinPileupDistance(0.8),
124 fUseDisplacedVertices(false),
131 fUsepA2012Vertex(false),
139 // name Name of object
141 DGUARD(fDebug,1,"Named CTOR of AliFMDEventInspector: %s", name);
144 //____________________________________________________________________
145 AliFMDEventInspector::AliFMDEventInspector(const AliFMDEventInspector& o)
147 fHEventsTr(o.fHEventsTr),
148 fHEventsTrVtx(o.fHEventsTrVtx),
149 fHEventsAccepted(o.fHEventsAccepted),
150 fHEventsAcceptedXY(o.fHEventsAcceptedXY),
151 fHTriggers(o.fHTriggers),
152 fHTriggerCorr(o.fHTriggerCorr),
156 fHCentVsQual(o.fHCentVsQual),
157 fHStatus(o.fHStatus),
158 fHVtxStatus(o.fHVtxStatus),
159 fHTrgStatus(o.fHTrgStatus),
160 fLowFluxCut(o.fLowFluxCut),
161 fMaxVzErr(o.fMaxVzErr),
165 fCollisionSystem(o.fCollisionSystem),
168 fVtxAxis(o.fVtxAxis),
169 fUseFirstPhysicsVertex(o.fUseFirstPhysicsVertex),
170 fUseV0AND(o.fUseV0AND),
171 fMinPileupContrib(o.fMinPileupContrib),
172 fMinPileupDistance(o.fMinPileupDistance),
173 fUseDisplacedVertices(o.fUseDisplacedVertices),
174 fDisplacedVertex(o.fDisplacedVertex),
177 fCentMethod(o.fCentMethod),
178 fMinCent(o.fMinCent),
179 fMaxCent(o.fMaxCent),
180 fUsepA2012Vertex(o.fUsepA2012Vertex),
181 fRunNumber(o.fRunNumber),
189 // o Object to copy from
191 DGUARD(fDebug,1,"Copy CTOR of AliFMDEventInspector");
194 //____________________________________________________________________
195 AliFMDEventInspector::~AliFMDEventInspector()
200 DGUARD(fDebug,1,"DTOR of AliFMDEventInspector");
201 // if (fList) delete fList;
203 //____________________________________________________________________
204 AliFMDEventInspector&
205 AliFMDEventInspector::operator=(const AliFMDEventInspector& o)
208 // Assignement operator
211 // o Object to assign from
214 // Reference to this object
216 DGUARD(fDebug,3,"Assignment of AliFMDEventInspector");
217 if (&o == this) return *this;
218 TNamed::operator=(o);
219 fHEventsTr = o.fHEventsTr;
220 fHEventsTrVtx = o.fHEventsTrVtx;
221 fHEventsAccepted = o.fHEventsAccepted;
222 fHEventsAcceptedXY = o.fHEventsAcceptedXY;
223 fHTriggers = o.fHTriggers;
224 fHTriggerCorr = o.fHTriggerCorr;
228 fHCentVsQual = o.fHCentVsQual;
229 fHStatus = o.fHStatus;
230 fHVtxStatus = o.fHVtxStatus;
231 fHTrgStatus = o.fHTrgStatus;
232 fLowFluxCut = o.fLowFluxCut;
233 fMaxVzErr = o.fMaxVzErr;
235 fList = (o.fList ? new TList : 0);
238 fCollisionSystem = o.fCollisionSystem;
239 fVtxAxis.Set(o.fVtxAxis.GetNbins(), o.fVtxAxis.GetXmin(),
240 o.fVtxAxis.GetXmax());
242 fUseFirstPhysicsVertex = o.fUseFirstPhysicsVertex;
243 fUseV0AND = o.fUseV0AND;
244 fMinPileupContrib = o.fMinPileupContrib;
245 fMinPileupDistance = o.fMinPileupDistance;
246 fUseDisplacedVertices = o.fUseDisplacedVertices;
247 fDisplacedVertex = o.fDisplacedVertex;
248 fCentMethod = o.fCentMethod;
249 fMinCent = o.fMinCent;
250 fMaxCent = o.fMaxCent;
251 fUsepA2012Vertex = o.fUsepA2012Vertex;
252 fRunNumber = o.fRunNumber;
256 fList->SetName(GetName());
257 if (fHEventsTr) fList->Add(fHEventsTr);
258 if (fHEventsTrVtx) fList->Add(fHEventsTrVtx);
259 if (fHTriggers) fList->Add(fHTriggers);
260 if (fHTriggerCorr) fList->Add(fHTriggerCorr);
261 if (fHType) fList->Add(fHType);
262 if (fHWords) fList->Add(fHWords);
263 if (fHCent) fList->Add(fHCent);
264 if (fHCentVsQual) fList->Add(fHCentVsQual);
265 if (fHStatus) fList->Add(fHStatus);
266 if (fHVtxStatus) fList->Add(fHVtxStatus);
267 if (fHTrgStatus) fList->Add(fHTrgStatus);
272 //____________________________________________________________________
274 AliFMDEventInspector::SetCentralityMethod(ECentMethod m)
277 case kV0Multiplicity: fCentMethod = "VOM"; break; // VZERO multiplicity
278 case kV0Amplitude: fCentMethod = "V0A"; break; // VZERO amplitude
279 case kV0Charge: fCentMethod = "V0C"; break; // VZERO charge
280 case kFMDRough: fCentMethod = "FMD"; break; // FMD scaled energy l
281 case kNTracks: fCentMethod = "TRK"; break; // Number of tracks
282 case kLTracks: fCentMethod = "TKL"; break; // Number of tracks
283 case kCL0: fCentMethod = "CL0"; break; //
284 case kCL1: fCentMethod = "CL1"; break; //
285 case kCND: fCentMethod = "CND"; break; //
286 case kNParticles: fCentMethod = "NPA"; break; // Neutral particles
287 case kNeutrons: fCentMethod = "ZNA"; break; // ZDC neutron amplitu
288 case kV0vsFMD: fCentMethod = "V0MvsFMD"; break; // VZERO versus FMD
289 case kV0vsNTracks: fCentMethod = "TKLvsVOM"; break; // Tracks versus VZERO
290 case kZEMvsZDC: fCentMethod = "ZEMvsZDC"; break; // ZDC
291 default: fCentMethod = "V0M"; break;
295 //____________________________________________________________________
297 AliFMDEventInspector::SetMinCentrality(Double_t minCent)
300 "*******************************************************\n"
301 "* Setting centrality cuts in this stage is deprecated *\n"
302 "*******************************************************");
305 //____________________________________________________________________
307 AliFMDEventInspector::SetMaxCentrality(Double_t maxCent)
310 "*******************************************************\n"
311 "* Setting centrality cuts in this stage is deprecated *\n"
312 "*******************************************************");
316 //____________________________________________________________________
318 AliFMDEventInspector::FetchHistograms(const TList* d,
322 TH1I*& hTriggers) const
325 // Fetch our histograms from the passed list
329 // hEventsTr On return, pointer to histogram, or null
330 // hEventsTrVtx On return, pointer to histogram, or null
331 // hTriggers On return, pointer to histogram, or null
334 // true on success, false otherwise
336 DGUARD(fDebug,3,"Fetch histograms in AliFMDEventInspector");
341 TList* dd = dynamic_cast<TList*>(d->FindObject(GetName()));
342 if (!dd) return kFALSE;
344 hEventsTr = dynamic_cast<TH1I*>(dd->FindObject("nEventsTr"));
345 hEventsTrVtx = dynamic_cast<TH1I*>(dd->FindObject("nEventsTrVtx"));
346 hEventsAcc = dynamic_cast<TH1I*>(dd->FindObject("nEventsAccepted"));
347 hTriggers = dynamic_cast<TH1I*>(dd->FindObject("triggers"));
352 !hTriggers) return kFALSE;
355 //____________________________________________________________________
357 AliFMDEventInspector::CacheConfiguredTriggerClasses(TList& cache,
358 const TList* classes,
359 AliOADBPhysicsSelection* o)
361 TIter nextClass(classes);
362 TObjString* trigClass = 0;
363 // Loop over all trigger classes. Trigger classes have the format
365 // class := positive_words SPACE(s) negative_words
373 while ((trigClass = static_cast<TObjString*>(nextClass()))) {
374 // Tokenize on space to get positive and negative parts
375 TString side = o->GetBeamSide(trigClass->String());
376 TObjArray* parts = trigClass->String().Tokenize(" ");
377 TObjString* part = 0;
378 TIter nextPart(parts);
379 while ((part = static_cast<TObjString*>(nextPart()))) {
380 // We only care about the positive ones
381 if (part->GetName()[0] != '+') continue;
382 part->String().Remove(0,1);
384 // Tokenize on a comma to get the words
385 TObjArray* words = part->String().Tokenize(",");
386 TObjString* word = 0;
387 TIter nextWord(words);
388 while ((word = static_cast<TObjString*>(nextWord()))) {
389 TNamed* store = new TNamed(word->String(), side);
391 DMSG(fDebug,3,"Caching %s trigger word %s",
392 store->GetTitle(), store->GetName());
400 //____________________________________________________________________
402 AliFMDEventInspector::SetupForData(const TAxis& vtxAxis)
405 // Initialize the object - this is called on the first seen event.
408 // vtxAxis Vertex axis in use
410 DGUARD(fDebug,1,"Initialize in AliFMDEventInspector");
412 AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager();
414 // Get the input handler - should always be there
415 AliInputEventHandler* ih =
416 static_cast<AliInputEventHandler*>(am->GetInputEventHandler());
418 AliWarning("No input handler");
421 // Get the physics selection - should always be there
422 AliPhysicsSelection* ps =
423 static_cast<AliPhysicsSelection*>(ih->GetEventSelection());
425 AliWarning("No physics selection");
428 // Get the configured triggers
429 AliOADBPhysicsSelection* oadb =
430 const_cast<AliOADBPhysicsSelection*>(ps->GetOADBPhysicsSelection());
432 AliWarning("No OADB physics selection object");
435 // Get the configured trigger words from the physics selection
436 const TList* collTriggClasses = ps->GetCollisionTriggerClasses();
437 const TList* bgTriggClasses = ps->GetBGTriggerClasses();
438 if (!collTriggClasses) {
439 AliWarning("No configured collision trigger classes");
442 if (!bgTriggClasses) {
443 AliWarning("No configured background trigger classes");
446 CacheConfiguredTriggerClasses(fCollWords, collTriggClasses, oadb);
447 CacheConfiguredTriggerClasses(fBgWords, bgTriggClasses, oadb);
453 if ((fMinCent < 0 && fMaxCent < 0) || fMaxCent <= fMinCent) {
454 // -1.5 -0.5 0.5 1.5 ... 89.5 ... 100.5
455 // ----- 92 number --------- ---- 1 ---
457 for (Int_t i = 0; i < 92; i++) limits[i] = -1.5 + i;
461 Int_t n = fMaxCent-fMinCent+2;
463 for (Int_t i = 0; i < n; i++) {
464 limits[i] = fMinCent + i - .5;
468 fVtxAxis.Set(vtxAxis.GetNbins(), vtxAxis.GetXmin(), vtxAxis.GetXmax());
470 fCentAxis = new TAxis(limits.GetSize()-1, limits.GetArray());
471 fHEventsTr = new TH1I("nEventsTr", "Number of events w/trigger",
472 4*vtxAxis.GetNbins(),
474 2*vtxAxis.GetXmax());
475 fHEventsTr->SetXTitle("v_{z} [cm]");
476 fHEventsTr->SetYTitle("# of events");
477 fHEventsTr->SetFillColor(kRed+1);
478 fHEventsTr->SetFillStyle(3001);
479 fHEventsTr->SetDirectory(0);
480 // fHEventsTr->Sumw2();
481 fList->Add(fHEventsTr);
483 fHEventsTrVtx = static_cast<TH1I*>(fHEventsTr->Clone("nEventsTrVtx"));
484 fHEventsTrVtx->SetTitle("Number of events w/trigger and vertex");
485 fHEventsTrVtx->SetFillColor(kBlue+1);
486 fHEventsTrVtx->SetDirectory(0);
487 // fHEventsTrVtx->Sumw2();
488 fList->Add(fHEventsTrVtx);
490 fHEventsAccepted = new TH1I("nEventsAccepted",
491 "Number of events w/trigger and vertex in range",
492 2*vtxAxis.GetNbins(),
494 2*vtxAxis.GetXmax());
495 fHEventsAccepted->SetXTitle("v_{z} [cm]");
496 fHEventsAccepted->SetYTitle("# of events");
497 fHEventsAccepted->SetFillColor(kGreen+1);
498 fHEventsAccepted->SetFillStyle(3001);
499 fHEventsAccepted->SetDirectory(0);
500 // fHEventsAccepted->Sumw2();
501 fList->Add(fHEventsAccepted);
503 fHEventsAcceptedXY = new TH2D("nEventsAcceptedXY",
504 "XY vertex w/trigger and Z vertex in range",
505 1000,-1,1,1000,-1,1);
507 fHEventsAcceptedXY->SetXTitle("v_{x} [cm]");
508 fHEventsAcceptedXY->SetYTitle("v_{y} [cm]");
509 fHEventsAcceptedXY->SetDirectory(0);
510 // fHEventsAccepted->Sumw2();
511 fList->Add(fHEventsAcceptedXY);
514 fHTriggers = new TH1I("triggers", "Triggers", kOffline+1, 0, kOffline+1);
515 fHTriggers->SetFillColor(kRed+1);
516 fHTriggers->SetFillStyle(3001);
517 fHTriggers->SetStats(0);
518 fHTriggers->SetDirectory(0);
520 fHTriggerCorr = new TH2I("triggerCorr", "Trigger correlation",
521 kOffline+1, 0, kOffline+1,
522 kOffline+1, 0, kOffline+1);
523 fHTriggerCorr->SetStats(0);
524 fHTriggerCorr->SetDirectory(0);
525 fHTriggerCorr->SetXTitle("Requirement");
526 fHTriggerCorr->SetYTitle("Companion");
528 Int_t binNum[] = { kInel +1,
541 const char* binLbl[] = { "INEL",
554 for (Int_t i = 0; i < kOffline+1; i++) {
555 fHTriggers->GetXaxis()->SetBinLabel(binNum[i], binLbl[i]);
556 fHTriggerCorr->GetXaxis()->SetBinLabel(binNum[i], binLbl[i]);
557 fHTriggerCorr->GetYaxis()->SetBinLabel(binNum[i], binLbl[i]);
559 fList->Add(fHTriggers);
560 fList->Add(fHTriggerCorr);
563 fHType = new TH1I("type", Form("Event type (cut: SPD mult>%d)",
564 fLowFluxCut), 2, -.5, 1.5);
565 fHType->SetFillColor(kRed+1);
566 fHType->SetFillStyle(3001);
568 fHType->SetDirectory(0);
569 fHType->GetXaxis()->SetBinLabel(1,"Low-flux");
570 fHType->GetXaxis()->SetBinLabel(2,"High-flux");
574 // This histogram disabled as it causes problems in the merge
575 fHWords = new TH1I("words", "Trigger words seen", 1, 0, 0);
576 fHWords->SetFillColor(kBlue+1);
577 fHWords->SetFillStyle(3001);
578 fHWords->SetStats(0);
579 fHWords->SetDirectory(0);
580 fHWords->SetBit(TH1::kCanRebin);
584 fHCent = new TH1F("cent", "Centrality", limits.GetSize()-1,limits.GetArray());
585 fHCent->SetFillColor(kBlue+1);
586 fHCent->SetFillStyle(3001);
588 fHCent->SetDirectory(0);
589 fHCent->SetXTitle("Centrality [%]");
590 fHCent->SetYTitle("Events");
593 fHCentVsQual = new TH2F("centVsQuality", "Quality vs Centrality",
594 5, 0, 5, limits.GetSize()-1, limits.GetArray());
595 fHCentVsQual->SetXTitle("Quality");
596 fHCentVsQual->SetYTitle("Centrality [%]");
597 fHCentVsQual->SetZTitle("Events");
598 fHCentVsQual->GetXaxis()->SetBinLabel(1, "OK");
599 fHCentVsQual->GetXaxis()->SetBinLabel(2, "Outside v_{z} cut");
600 fHCentVsQual->GetXaxis()->SetBinLabel(3, "V0 vs SPD outlier");
601 fHCentVsQual->GetXaxis()->SetBinLabel(4, "V0 vs TPC outlier");
602 fHCentVsQual->GetXaxis()->SetBinLabel(5, "V0 vs ZDC outlier");
603 fHCentVsQual->SetDirectory(0);
604 fList->Add(fHCentVsQual);
606 fHStatus = new TH1I("status", "Status", 7, 1, 8);
607 fHStatus->SetFillColor(kBlue+1);
608 fHStatus->SetFillStyle(3001);
609 fHStatus->SetStats(0);
610 fHStatus->SetDirectory(0);
611 TAxis* xAxis = fHStatus->GetXaxis();
612 xAxis->SetBinLabel(1, "OK");
613 xAxis->SetBinLabel(2, "No event");
614 xAxis->SetBinLabel(3, "No triggers");
615 xAxis->SetBinLabel(4, "No SPD");
616 xAxis->SetBinLabel(5, "No FMD");
617 xAxis->SetBinLabel(6, "No vertex");
618 xAxis->SetBinLabel(7, "Bad vertex");
619 fList->Add(fHStatus);
621 fHVtxStatus = new TH1I("vtxStatus","Vertex Status",
622 kNotVtxZ,kVtxOK,kNotVtxZ+1);
623 fHVtxStatus->SetFillColor(kGreen+1);
624 fHVtxStatus->SetFillStyle(3001);
625 fHVtxStatus->SetStats(0);
626 fHVtxStatus->SetDirectory(0);
627 xAxis = fHVtxStatus->GetXaxis();
628 xAxis->SetBinLabel(kVtxOK, "OK");
629 xAxis->SetBinLabel(kNoVtx, "None/bad status");
630 xAxis->SetBinLabel(kNoSPDVtx, "No SPD/bad status");
631 xAxis->SetBinLabel(kFewContrib, "N_{contrib} <= 0");
632 xAxis->SetBinLabel(kUncertain, Form("#delta z > %4.2f", fMaxVzErr));
633 xAxis->SetBinLabel(kNotVtxZ, "Not Z vertexer");
634 fList->Add(fHVtxStatus);
636 fHTrgStatus = new TH1I("trgStatus", "Trigger Status",
637 kOther, kNoTrgWords, kOther+1);
638 fHTrgStatus->SetFillColor(kMagenta+1);
639 fHTrgStatus->SetFillStyle(3001);
640 fHTrgStatus->SetStats(0);
641 fHTrgStatus->SetDirectory(0);
642 xAxis = fHTrgStatus->GetXaxis();
643 xAxis->SetBinLabel(kNoTrgWords, "No words");
644 xAxis->SetBinLabel(kPP2760Fast, "FAST in pp@#sqrt{s}=2.76TeV");
645 xAxis->SetBinLabel(kMUON, "Muon trigger");
646 xAxis->SetBinLabel(kTriggered, "Triggered");
647 xAxis->SetBinLabel(kMinBias, "CINT1 (V0A||V0C||FASTOR)");
648 xAxis->SetBinLabel(kMinBiasNoSPD, "CINT5 (V0A||V0C)");
649 xAxis->SetBinLabel(kV0AndTrg, "CINT7 (V0A&&V0C)");
650 xAxis->SetBinLabel(kHighMult, "N>>0");
651 xAxis->SetBinLabel(kCentral, "Central");
652 xAxis->SetBinLabel(kSemiCentral, "Semi-central");
653 xAxis->SetBinLabel(kDiffractive, "Diffractive");
654 xAxis->SetBinLabel(kUser, "User");
655 xAxis->SetBinLabel(kOther, "Other");
656 fList->Add(fHTrgStatus);
658 if (fUseDisplacedVertices) fDisplacedVertex.SetupForData(fList, "", false);
661 //____________________________________________________________________
663 AliFMDEventInspector::StoreInformation()
665 // Write TNamed objects to output list containing information about
666 // the running conditions
667 DGUARD(fDebug,2,"Store information from AliFMDEventInspector");
671 fList->Add(AliForwardUtil::MakeParameter("sys", fCollisionSystem));
672 fList->Add(AliForwardUtil::MakeParameter("sNN", fEnergy));
673 fList->Add(AliForwardUtil::MakeParameter("field", fField));
674 fList->Add(AliForwardUtil::MakeParameter("runNo", fRunNumber));
675 fList->Add(AliForwardUtil::MakeParameter("lowFlux", fLowFluxCut));
676 fList->Add(AliForwardUtil::MakeParameter("fpVtx",fUseFirstPhysicsVertex));
677 fList->Add(AliForwardUtil::MakeParameter("v0and",fUseV0AND));
678 fList->Add(AliForwardUtil::MakeParameter("nPileUp", fMinPileupContrib));
679 fList->Add(AliForwardUtil::MakeParameter("dPileup", fMinPileupDistance));
680 fList->Add(AliForwardUtil::MakeParameter("satellite", fUseDisplacedVertices));
681 fList->Add(AliForwardUtil::MakeParameter("alirootRev",
682 AliForwardUtil::AliROOTRevision()));
683 fList->Add(AliForwardUtil::MakeParameter("alirootBranch",
684 AliForwardUtil::AliROOTBranch()));
685 fList->Add(AliForwardUtil::MakeParameter("mc", fMC));
689 //____________________________________________________________________
691 AliFMDEventInspector::StoreProduction()
695 AliAnalysisManager *mgr=AliAnalysisManager::GetAnalysisManager();
696 AliVEventHandler *inputHandler=mgr->GetInputEventHandler();
698 AliWarning("Got no input handler");
701 TList *uiList = inputHandler->GetUserInfo();
703 AliWarning("Got no user list from input tree");
707 AliProdInfo p(uiList);
709 if (p.GetAlirootSvnVersion() <= 0) return;
711 // Make our output list
712 TList* out = new TList;
714 out->SetName("production");
715 // out->SetTitle("ESD production details");
718 TString period = p.GetLHCPeriod();
719 // TString aliROOTVersion = p.GetAlirootVersion();
720 Int_t aliROOTSVN = p.GetAlirootSvnVersion();
721 // TString rootVersion = p.GetRootVersion();
722 Int_t rootSVN = p.GetRootSvnVersion();
723 Int_t pass = p.GetRecoPass();
724 Bool_t mc = p.IsMC();
726 TObjArray* pp = TPRegexp("LHC([0-9]+)([a-z]+)").MatchS(period);
727 Int_t yy = static_cast<TObjString*>(pp->At(1))->String().Atoi();
728 Char_t ll = static_cast<TObjString*>(pp->At(2))->String()[0];
731 out->Add(AliForwardUtil::MakeParameter("year", yy));
732 out->Add(AliForwardUtil::MakeParameter("letter", Int_t(ll)));
733 out->Add(AliForwardUtil::MakeParameter("alirootSVN", aliROOTSVN));
734 out->Add(AliForwardUtil::MakeParameter("rootSVN", rootSVN));
735 out->Add(AliForwardUtil::MakeParameter("pass", pass));
736 out->Add(AliForwardUtil::MakeParameter("mc", mc));
742 //____________________________________________________________________
744 AliFMDEventInspector::CreateOutputObjects(TList* dir)
747 // Define the output histograms. These are put in a sub list of the
748 // passed list. The histograms are merged before the parent task calls
749 // AliAnalysisTaskSE::Terminate
751 // dir Directory to add to
753 DGUARD(fDebug,1,"Define output from AliFMDEventInspector");
755 fList->SetName(GetName());
760 //____________________________________________________________________
762 AliFMDEventInspector::Process(const AliESDEvent* event,
775 // triggers On return, the triggers fired
776 // lowFlux On return, true if the event is considered a low-flux
777 // event (according to the setting of fLowFluxCut)
778 // ivz On return, the found vertex bin (1-based). A zero
779 // means outside of the defined vertex range
780 // vz On return, the z position of the interaction
781 // cent On return, the centrality - if not available < 0
784 // 0 (or kOk) on success, otherwise a bit mask of error codes
786 DGUARD(fDebug,1,"Process event in AliFMDEventInspector");
787 // --- Check that we have an event ---------------------------------
789 AliWarning("No ESD event found for input event");
794 // --- Process satellite event information is requested ------------
795 if (fUseDisplacedVertices) {
796 if (!fDisplacedVertex.Process(event))
797 AliWarning("Failed to process satellite event");
800 // --- Read trigger information from the ESD and store in AOD object
801 if (!ReadTriggers(*event, triggers, nClusters)) {
803 AliWarning("Failed to read triggers from ESD"); }
808 // --- Check if this is a high-flux event --------------------------
809 const AliMultiplicity* testmult = event->GetMultiplicity();
812 AliWarning("No central multiplicity object found"); }
815 lowFlux = testmult->GetNumberOfTracklets() < fLowFluxCut;
817 fHType->Fill(lowFlux ? 0 : 1);
819 // --- Get the interaction point -----------------------------------
820 Bool_t vzOk = ReadVertex(*event, ip);
821 fHEventsTr->Fill(ip.Z());
824 AliWarning("Failed to read vertex from ESD"); }
829 // --- Read centrality information
832 if (!ReadCentrality(*event, cent, qual)) {
834 AliWarning("Failed to get centrality");
836 // --- check centrality cut
838 if(fMinCent > -0.0001 && cent < fMinCent) return kNoEvent;
839 if(fMaxCent > -0.0001 && cent > fMaxCent) return kNoEvent;
841 if (qual == 0) fHCentVsQual->Fill(0., cent);
843 for (UShort_t i = 0; i < 4; i++)
844 if (qual & (1 << i)) fHCentVsQual->Fill(Double_t(i+1), cent);
848 fHEventsTrVtx->Fill(ip.Z());
850 // --- Get the vertex bin ------------------------------------------
851 ivz = fVtxAxis.FindBin(ip.Z());
852 if (ivz <= 0 || ivz > fVtxAxis.GetNbins()) {
854 AliWarning(Form("Vertex @ %f outside of range [%f,%f]",
855 ip.Z(), fVtxAxis.GetXmin(), fVtxAxis.GetXmax()));
861 fHEventsAccepted->Fill(ip.Z());
862 fHEventsAcceptedXY->Fill(ip.X(),ip.Y());
864 // --- Check the FMD ESD data --------------------------------------
865 if (!event->GetFMDData()) {
867 AliWarning("No FMD data found in ESD"); }
876 //____________________________________________________________________
878 AliFMDEventInspector::ReadCentrality(const AliESDEvent& esd,
880 UShort_t& qual) const
883 // Read centrality from event
887 // cent On return, the centrality or negative if not found
890 // False on error, true otherwise
892 DGUARD(fDebug,2,"Read the centrality in AliFMDEventInspector");
896 AliCentrality* centObj = const_cast<AliESDEvent&>(esd).GetCentrality();
898 cent = centObj->GetCentralityPercentile(fCentMethod);
899 qual = centObj->GetQuality();
902 // We overwrite with satellite events, so we can be sure to get the
903 // centrality determination from the satellite vertex selection
904 if (fUseDisplacedVertices && fDisplacedVertex.IsSatellite()) {
905 cent = fDisplacedVertex.GetCentralityPercentile();
912 //____________________________________________________________________
914 AliFMDEventInspector::CheckpAExtraV0(const AliESDEvent& esd) const
916 if (fCollisionSystem != AliForwardUtil::kPPb) return true;
918 AliVVZERO* esdV0 = esd.GetVZEROData();
919 if ((esdV0->GetV0ADecision()!=1) || (esdV0->GetV0CDecision()!=1))
924 //____________________________________________________________________
926 AliFMDEventInspector::ReadTriggers(const AliESDEvent& esd, UInt_t& triggers,
930 // Read the trigger information from the ESD event
934 // triggers On return, contains the trigger bits
937 // @c true on success, @c false otherwise
939 DGUARD(fDebug,2,"Read the triggers in AliFMDEventInspector");
942 // Get the analysis manager - should always be there
943 AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager();
944 DMSG(fDebug,10,"Got analysis manager %p", am);
946 AliWarning("No analysis manager defined!");
950 // Get the input handler - should always be there
951 AliInputEventHandler* ih =
952 static_cast<AliInputEventHandler*>(am->GetInputEventHandler());
953 DMSG(fDebug,10,"Got input handler %p", ih);
955 AliWarning("No input handler");
959 // Check if this is a collision candidate (MB)
961 // Historic remark: Note, that we should use the value cached in the
962 // input handler rather than calling IsCollisionCandiate directly
963 // on the AliPhysicsSelection obejct. If we called the latter
964 // then the AliPhysicsSelection object would overcount by a factor
966 UInt_t trgMask = ih->IsEventSelected();
967 Bool_t offline = trgMask;
968 Bool_t fastonly = (trgMask & AliVEvent::kFastOnly);
969 TString trigStr = esd.GetFiredTriggerClasses();
971 if (trigStr.IsNull()) fHTrgStatus->Fill(kNoTrgWords);
972 if (fHWords) fHWords->Fill(trigStr.Data(), 1);
974 if(fUseDisplacedVertices) {
975 DMSG(fDebug,3,"Using displaced vertex stuff");
976 // if (TMath::Abs(fDisplacedVertex.GetVertexZ()) >= 999) offline = false;
977 if (fDisplacedVertex.IsSatellite())
978 triggers |= AliAODForwardMult::kSatellite;
981 if (CheckFastPartition(fastonly)) {
982 fHTrgStatus->Fill(kPP2760Fast);
986 if (offline && CheckCosmics(trigStr)) {
987 fHTrgStatus->Fill(kMUON);
990 if (offline) fHTrgStatus->Fill(kTriggered);
992 if (trgMask & AliVEvent::kMB) f += fHTrgStatus->Fill(kMinBias);
993 if (trgMask & AliVEvent::kCINT5) f += fHTrgStatus->Fill(kMinBiasNoSPD);
994 if (trgMask & AliVEvent::kINT7) f += fHTrgStatus->Fill(kV0AndTrg);
995 if (trgMask & AliVEvent::kHighMult) f += fHTrgStatus->Fill(kHighMult);
996 if (trgMask & AliVEvent::kCentral) f += fHTrgStatus->Fill(kCentral);
997 if (trgMask & AliVEvent::kSemiCentral) f += fHTrgStatus->Fill(kSemiCentral);
998 if (trgMask & AliVEvent::kDG5) f += fHTrgStatus->Fill(kDiffractive);
999 if (trgMask & AliVEvent::kUserDefined) f += fHTrgStatus->Fill(kUser);
1000 if (f <= 0) fHTrgStatus->Fill(kOther);
1002 // if (!CheckpAExtraV0(esd)) offline = false;
1004 DMSG(fDebug,2,"Event is %striggered by off-line", offline ? "" : "NOT ");
1006 if (offline) triggers |= AliAODForwardMult::kOffline;
1007 // Only flag as in-elastic if a min-bias trigger is here
1008 if (trgMask & AliVEvent::kMB) {
1009 triggers |= AliAODForwardMult::kInel;
1010 CheckINELGT0(esd, nClusters, triggers);
1013 CheckNSD(esd,triggers);
1014 CheckPileup(esd, triggers);
1015 CheckEmpty(trigStr, triggers);
1016 // if (CheckPileup(esd, triggers)) fHTriggers->Fill(kPileUp+.5);
1017 // if (CheckEmpty(trigStr, triggers)) fHTriggers->Fill(kEmpty+.5);
1019 CheckWords(esd, triggers);
1021 #define TEST_TRIG_BIN(RET,BIN,TRIGGERS) \
1022 do { switch (BIN) { \
1023 case kInel: RET = triggers & AliAODForwardMult::kInel; break; \
1024 case kInelGt0: RET = triggers & AliAODForwardMult::kInelGt0; break; \
1025 case kNSD: RET = triggers & AliAODForwardMult::kNSD; break; \
1026 case kV0AND: RET = triggers & AliAODForwardMult::kV0AND; break; \
1027 case kEmpty: RET = triggers & AliAODForwardMult::kEmpty; break; \
1028 case kA: RET = triggers & AliAODForwardMult::kA; break; \
1029 case kB: RET = triggers & AliAODForwardMult::kB; break; \
1030 case kC: RET = triggers & AliAODForwardMult::kC; break; \
1031 case kE: RET = triggers & AliAODForwardMult::kE; break; \
1032 case kPileUp: RET = triggers & AliAODForwardMult::kPileUp; break; \
1033 case kMCNSD: RET = triggers & AliAODForwardMult::kMCNSD; break; \
1034 case kSatellite:RET = triggers & AliAODForwardMult::kSatellite; break; \
1035 case kOffline: RET = triggers & AliAODForwardMult::kOffline; break; \
1036 default: RET = false; } } while(false)
1039 AliWarning("Histogram of triggers not defined - has init been called");
1043 for (Int_t i = 0; i < kOffline+1; i++) {
1044 Bool_t hasX = false;
1045 TEST_TRIG_BIN(hasX, i, triggers);
1046 if (!hasX) continue;
1047 fHTriggers->Fill(i+.5);
1048 for (Int_t j = 0; j < kOffline+1; j++) {
1049 Bool_t hasY = false;
1050 TEST_TRIG_BIN(hasY, j, triggers);
1051 if (!hasY) continue;
1053 fHTriggerCorr->Fill(i+.5, j+.5);
1059 //____________________________________________________________________
1061 AliFMDEventInspector::CheckFastPartition(bool fastonly) const
1063 // For the 2.76 TeV p+p run, the FMD ran in the slow partition
1064 // so it received no triggers from the fast partition. Therefore
1065 // the fast triggers are removed here but not for MC where all
1066 // triggers are fast.
1067 if (TMath::Abs(fEnergy - 2750.) > 20) return false;
1068 if (fCollisionSystem != AliForwardUtil::kPP) return false;
1069 if (fMC) return false; // All MC events for pp @ 2.76TeV are `fast'
1071 DMSG(fDebug,1,"Fast trigger in pp @ sqrt(s)=2.76TeV removed");
1076 //____________________________________________________________________
1078 AliFMDEventInspector::CheckCosmics(const TString& trigStr) const
1080 // MUON triggers are not strictly minimum bias (MB) so they are
1082 if(trigStr.Contains("CMUS1")) {
1083 DMSG(fDebug,1,"Cosmic trigger ins't min-bias, removed");
1089 //____________________________________________________________________
1091 AliFMDEventInspector::CheckINELGT0(const AliESDEvent& esd,
1092 UShort_t& nClusters,
1093 UInt_t& triggers) const
1097 // If this is inel, see if we have a tracklet
1098 const AliMultiplicity* spdmult = esd.GetMultiplicity();
1100 AliWarning("No SPD multiplicity");
1104 // Check if we have one or more tracklets
1105 // in the range -1 < eta < 1 to set the INEL>0
1108 // Also count tracklets as a single cluster
1109 Int_t n = spdmult->GetNumberOfTracklets();
1110 for (Int_t j = 0; j < n; j++) {
1111 if(TMath::Abs(spdmult->GetEta(j)) < 1) nClusters++;
1113 // If we at this point had non-zero nClusters, it's INEL>0
1114 if (nClusters > 0) triggers |= AliAODForwardMult::kInelGt0;
1116 // Loop over single clusters
1117 n = spdmult->GetNumberOfSingleClusters();
1118 for (Int_t j = 0; j < n; j++) {
1119 Double_t eta = -TMath::Log(TMath::Tan(spdmult->GetThetaSingle(j)/2.));
1120 if (TMath::Abs(eta) < 1) nClusters++;
1122 if (nClusters > 0) triggers |= AliAODForwardMult::kNClusterGt0;
1124 return triggers & AliAODForwardMult::kNClusterGt0;
1127 //____________________________________________________________________
1129 AliFMDEventInspector::CheckNSD(const AliESDEvent& esd, UInt_t& triggers) const
1131 // Analyse some trigger stuff
1132 AliTriggerAnalysis ta;
1133 if (ta.IsOfflineTriggerFired(&esd, AliTriggerAnalysis::kV0AND)) {
1134 triggers |= AliAODForwardMult::kV0AND;
1136 triggers |= AliAODForwardMult::kNSD;
1138 if (ta.IsOfflineTriggerFired(&esd, AliTriggerAnalysis::kNSD1))
1139 triggers |= AliAODForwardMult::kNSD;
1140 return triggers & AliAODForwardMult::kNSD;
1142 //____________________________________________________________________
1144 AliFMDEventInspector::CheckPileup(const AliESDEvent& esd,
1145 UInt_t& triggers) const
1147 // Check for multiple vertices (pile-up) with at least 3
1148 // contributors and at least 0.8cm from the primary vertex
1149 // if(fCollisionSystem != AliForwardUtil::kPP) return false;
1151 // Check for standard SPD pile-up
1152 Bool_t spdPileup = esd.IsPileupFromSPD(fMinPileupContrib,fMinPileupDistance);
1154 // Check for multi-vertex pileup
1155 Bool_t mvPileup = false; // CheckMultiVertex(esd);
1157 // Check for out-of-bunch pileup
1158 Bool_t outPileup = (esd.GetHeader()->GetIRInt2ClosestInteractionMap() != 0 ||
1159 esd.GetHeader()->GetIRInt1ClosestInteractionMap() != 0);
1162 Bool_t pileup = spdPileup || mvPileup || outPileup;
1163 if (pileup) triggers |= AliAODForwardMult::kPileUp;
1167 //____________________________________________________________________
1169 AliFMDEventInspector::CheckMultiVertex(const AliESDEvent& esd,
1170 Bool_t checkOtherBC) const
1172 // Adapted from AliAnalysisUtils
1175 const Double_t maxChi2nu = 5;
1177 // Number of vertices
1178 Int_t n = esd.GetNumberOfPileupVerticesTracks();
1180 // No additional vertices from tracks -> no pileup
1184 const AliESDVertex* primary = esd.GetPrimaryVertexTracks();
1185 if (primary->GetStatus() != 1)
1186 // No good primary vertex, but many candidates -> pileup
1189 // Bunch crossing number
1190 Int_t bcPrimary = primary->GetBC();
1192 for (Int_t i = 0; i < n; i++) {
1193 const AliESDVertex* other = esd.GetPileupVertexTracks(i);
1195 if (other->GetNContributors() < fMinPileupContrib)
1196 // Not enough contributors to this vertex
1199 if (other->GetChi2perNDF() > maxChi2nu)
1200 // Poorly determined vertex
1203 Int_t bcOther = other->GetBC();
1204 if (bcOther != AliVTrack::kTOFBCNA && TMath::Abs(bcOther-bcPrimary) > 2)
1205 // Pile-up from other BC
1208 // Calculate the distance
1210 Double_t dx = primary->GetX() - other->GetX();
1211 Double_t dy = primary->GetY() - other->GetY();
1212 Double_t dz = primary->GetZ() - other->GetZ();
1213 Double_t covPrimary[6], covOther[6];
1214 primary->GetCovarianceMatrix(covPrimary);
1215 other->GetCovarianceMatrix(covOther);
1217 v(0,0) = covPrimary[0] + covOther[0]; // diagonal
1218 v(1,1) = covPrimary[2] + covOther[2]; // diagonal
1219 v(2,2) = covPrimary[5] + covOther[5]; // diagonal
1220 v(1,0) = v(0,1) = covPrimary[1]+covOther[1]; // Band
1221 v(0,2) = v(1,2) = v(2,0) = v(2,1) = 0; // Off-diagonal+band
1225 // Question if kStatus bit is every set after InvertFast?
1227 d = (v(0,0) * dx * dx + v(1,1) * dy * dy + v(2,2) * dz * dz +
1228 2 * (v(0,1) * dx * dy + v(0,2) * dx * dz + v(1,2) * dy * dz));
1230 if (d < 0 || TMath::Sqrt(d) < fMinPileupDistance)
1231 // Bad distance, or not fare enough from each other
1234 // Well separated vertices -> pileup
1240 //____________________________________________________________________
1242 AliFMDEventInspector::CheckEmpty(const TString& trigStr, UInt_t& triggers) const
1244 if (trigStr.Contains("CBEAMB-ABCE-NOPF-ALL")) {
1245 triggers |= AliAODForwardMult::kEmpty;
1250 //____________________________________________________________________
1252 AliFMDEventInspector::CheckWords(const AliESDEvent& esd, UInt_t& triggers) const
1255 TIter nextColl(&fCollWords);
1256 while ((word = nextColl())) {
1257 DMSG(fDebug,10,"Checking if %s trigger %s is fired",
1258 word->GetTitle(), word->GetName());
1259 if (!esd.IsTriggerClassFired(word->GetName())) continue;
1261 TString beamSide = word->GetTitle();
1262 DMSG(fDebug,10,"Found it - this is a %s trigger", beamSide.Data());
1264 if (!beamSide.EqualTo("B")) continue;
1265 triggers |= AliAODForwardMult::kB;
1266 break; // No more to do here
1268 TIter nextBg(&fBgWords);
1269 UInt_t all = (AliAODForwardMult::kA |
1270 AliAODForwardMult::kC |
1271 AliAODForwardMult::kE);
1272 while ((word = nextBg())) {
1273 DMSG(fDebug,10,"Checking if %s trigger %s is fired",
1274 word->GetTitle(), word->GetName());
1275 if (!esd.IsTriggerClassFired(word->GetName())) continue;
1277 TString beamSide = word->GetTitle();
1278 DMSG(fDebug,10,"Found it - this is a %s trigger", beamSide.Data());
1280 if (beamSide.Contains("A")) triggers |= AliAODForwardMult::kA;
1281 if (beamSide.Contains("C")) triggers |= AliAODForwardMult::kC;
1282 if (beamSide.Contains("E")) triggers |= AliAODForwardMult::kE;
1284 if ((triggers & all) == all) break; // No more to do
1290 //____________________________________________________________________
1292 AliFMDEventInspector::ReadVertex(const AliESDEvent& esd, TVector3& ip)
1295 // Read the vertex information from the ESD event
1299 // vz On return, the vertex Z position
1302 // @c true on success, @c false otherwise
1304 DGUARD(fDebug,2,"Read the vertex in AliFMDEventInspector");
1305 ip.SetXYZ(1024, 1024, 0);
1307 EVtxStatus s = kNoVtx;
1308 if (fUseDisplacedVertices && fDisplacedVertex.IsSatellite()) {
1310 ip.SetZ(fDisplacedVertex.GetVertexZ());
1312 else if (fUseFirstPhysicsVertex)
1313 s = CheckPWGUDVertex(esd, ip);
1314 else if (fUsepA2012Vertex)
1315 s = CheckpA2012Vertex(esd,ip);
1317 s = CheckVertex(esd, ip);
1319 fHVtxStatus->Fill(s);
1324 //____________________________________________________________________
1325 AliFMDEventInspector::EVtxStatus
1326 AliFMDEventInspector::CheckPWGUDVertex(const AliESDEvent& esd,
1329 // This is the code used by the 1st physics people
1330 const AliESDVertex* vertex = esd.GetPrimaryVertex();
1331 if (!vertex || !vertex->GetStatus()) {
1332 DMSG(fDebug,2,"No primary vertex (%p) or bad status %d",
1333 vertex, (vertex ? vertex->GetStatus() : -1));
1336 const AliESDVertex* vertexSPD = esd.GetPrimaryVertexSPD();
1337 if (!vertexSPD || !vertexSPD->GetStatus()) {
1338 DMSG(fDebug,2,"No primary SPD vertex (%p) or bad status %d",
1339 vertexSPD, (vertexSPD ? vertexSPD->GetStatus() : -1));
1343 // if vertex is from SPD vertexZ, require more stringent cuts
1344 if (vertex->IsFromVertexerZ()) {
1345 if (vertex->GetDispersion() > fMaxVzErr ||
1346 vertex->GetZRes() > 1.25 * fMaxVzErr) {
1347 DMSG(fDebug,2,"Dispersion %f > %f or resolution %f > %f",
1348 vertex->GetDispersion(), fMaxVzErr,
1349 vertex->GetZRes(), 1.25 * fMaxVzErr);
1353 ip.SetZ(vertex->GetZ());
1355 if(!vertex->IsFromVertexerZ()) {
1356 ip.SetX(vertex->GetX());
1357 ip.SetY(vertex->GetY());
1361 //____________________________________________________________________
1362 AliFMDEventInspector::EVtxStatus
1363 AliFMDEventInspector::CheckpA2012Vertex(const AliESDEvent& esd,
1366 const AliESDVertex *vertex = esd.GetPrimaryVertexSPD();
1367 if (!vertex) return kNoSPDVtx;
1368 if (vertex->GetNContributors() <= 0) return kFewContrib;
1370 TString vtxTyp = vertex->GetTitle();
1371 if (vtxTyp.Contains("vertexer: Z")) return kNotVtxZ;
1373 if (vertex->GetDispersion() >= 0.04 || vertex->GetZRes()>=0.25)
1376 ip.SetX(vertex->GetX());
1377 ip.SetY(vertex->GetY());
1378 ip.SetZ(vertex->GetZ());
1383 //____________________________________________________________________
1384 AliFMDEventInspector::EVtxStatus
1385 AliFMDEventInspector::CheckVertex(const AliESDEvent& esd,
1388 // Use standard SPD vertex (perhaps preferable for Pb+Pb)
1390 const AliESDVertex* vertex = esd.GetPrimaryVertexSPD();
1393 AliWarning("No SPD vertex found in ESD"); }
1397 // #if 0 // Check disabled - seem to kill a lot of PbPb events
1398 // Check that enough tracklets contributed
1399 if(vertex->GetNContributors() <= 0) {
1400 DMSG(fDebug,2,"Number of contributors to vertex is %d<=0",
1401 vertex->GetNContributors());
1407 // Check that the uncertainty isn't too large
1408 if (vertex->GetZRes() > fMaxVzErr) {
1409 DMSG(fDebug,2,"Uncertaintity in Z of vertex is too large %f > %f",
1410 vertex->GetZRes(), fMaxVzErr);
1414 // Get the z coordiante
1415 ip.SetZ(vertex->GetZ());
1416 const AliESDVertex* vertexXY = esd.GetPrimaryVertex();
1419 if(!vertexXY->IsFromVertexerZ()) {
1420 ip.SetX(vertexXY->GetX());
1421 ip.SetY(vertexXY->GetY());
1426 //____________________________________________________________________
1428 AliFMDEventInspector::ReadRunDetails(const AliESDEvent* esd)
1431 // Read the collision system, collision energy, and L3 field setting
1435 // esd ESD to get information from
1438 // true on success, false
1440 // AliInfo(Form("Parameters from 1st ESD event: cms=%s, sNN=%f, field=%f",
1441 // esd->GetBeamType(), 2*esd->GetBeamEnergy(),
1442 // esd->GetMagneticField()));
1443 DGUARD(fDebug,2,"Read the run details in AliFMDEventInspector");
1444 const char* sys = esd->GetBeamType();
1445 Float_t cms = 2 * esd->GetBeamEnergy();
1446 Float_t fld = esd->GetMagneticField();
1447 fCollisionSystem = AliForwardUtil::ParseCollisionSystem(sys);
1448 fEnergy = AliForwardUtil::ParseCenterOfMassEnergy(fCollisionSystem,
1450 fField = AliForwardUtil::ParseMagneticField(fld);
1451 fRunNumber = esd->GetRunNumber();
1454 if (fCollisionSystem == AliForwardUtil::kUnknown) {
1455 AliWarningF("Unknown collision system: %s - please check", sys);
1459 AliWarningF("Unknown CMS energy: %f (%d) - please check", cms, fEnergy);
1462 if (TMath::Abs(fField) > 10) {
1463 AliWarningF("Unknown L3 field setting: %f (%d) - please check", fld,fField);
1471 //____________________________________________________________________
1473 AliFMDEventInspector::CodeString(UInt_t code)
1477 if (code & kNoEvent) s.Append("NOEVENT ");
1478 if (code & kNoTriggers) s.Append("NOTRIGGERS ");
1479 if (code & kNoSPD) s.Append("NOSPD ");
1480 if (code & kNoFMD) s.Append("NOFMD ");
1481 if (code & kNoVertex) s.Append("NOVERTEX ");
1482 if (code & kBadVertex) s.Append("BADVERTEX ");
1485 #define PF(N,V,...) \
1486 AliForwardUtil::PrintField(N,V, ## __VA_ARGS__)
1487 #define PFB(N,FLAG) \
1489 AliForwardUtil::PrintName(N); \
1490 std::cout << std::boolalpha << (FLAG) << std::noboolalpha << std::endl; \
1492 #define PFV(N,VALUE) \
1494 AliForwardUtil::PrintName(N); \
1495 std::cout << (VALUE) << std::endl; } while(false)
1497 //____________________________________________________________________
1499 AliFMDEventInspector::Print(Option_t*) const
1502 // Print information
1506 AliForwardUtil::PrintTask(*this);
1507 TString sNN(AliForwardUtil::CenterOfMassEnergyString(fEnergy));
1508 sNN.Strip(TString::kBoth, '0');
1509 sNN.ReplaceAll("GeV", " GeV");
1510 TString field(AliForwardUtil::MagneticFieldString(fField));
1511 field.ReplaceAll("p", "+");
1512 field.ReplaceAll("m", "-");
1513 field.ReplaceAll("kG", " kG");
1515 gROOT->IncreaseDirLevel();
1516 PFV("Vertex bins", fVtxAxis.GetNbins());
1517 PF("Vertex Range", "[%+6.1f,%+6.1f]", fVtxAxis.GetXmin(), fVtxAxis.GetXmax());
1518 PFV("Low flux cut", fLowFluxCut );
1519 PFV("Max(delta v_z)", fMaxVzErr );
1520 PFV("Min(nContrib_pileup)", fMinPileupContrib );
1521 PFV("Min(v-pileup)", fMinPileupDistance );
1522 PFV("System", AliForwardUtil::CollisionSystemString(fCollisionSystem));
1523 PFV("CMS energy per nucleon", sNN);
1524 PFV("Field", field);
1525 PFB("Satellite events", fUseDisplacedVertices);
1526 PFB("Use 2012 pA vertex", fUsepA2012Vertex );
1527 PFB("Use PWG-UD vertex", fUseFirstPhysicsVertex);
1528 PFB("Simulation input", fMC );
1529 PFV("Centrality method", fCentMethod);
1530 PFV("Centrality axis", (!fCentAxis ? "none" : ""));
1531 if (!fCentAxis) {return; }
1532 Int_t nBin = fCentAxis->GetNbins();
1533 for (Int_t i = 0; i < nBin; i++) {
1534 if (i != 0 && (i % 10) == 0) std::cout << '\n' << " ";
1535 std::cout << std::setw(5) << fCentAxis->GetBinLowEdge(i+1) << '-';
1537 std::cout << std::setw(5) << fCentAxis->GetBinUpEdge(nBin) << std::endl;
1538 gROOT->DecreaseDirLevel();