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 //====================================================================
48 AliPhysicsSelection* GetPhysicsSelection()
50 AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager();
52 // Get the input handler - should always be there
53 AliInputEventHandler* ih =
54 dynamic_cast<AliInputEventHandler*>(am->GetInputEventHandler());
56 Warning("GetPhysicsSelection", "No input handler");
59 // Get the physics selection - should always be there
60 AliPhysicsSelection* ps =
61 dynamic_cast<AliPhysicsSelection*>(ih->GetEventSelection());
63 Warning("GetPhysicsSelection", "No physics selection");
70 //====================================================================
71 const char* AliFMDEventInspector::fgkFolderName = "fmdEventInspector";
73 //____________________________________________________________________
74 AliFMDEventInspector::AliFMDEventInspector()
79 fHEventsAcceptedXY(0),
95 fCollisionSystem(kUnknown),
100 // fUseFirstPhysicsVertex(false),
103 fMinPileupContrib(3),
104 fMinPileupDistance(0.8),
105 // fUseDisplacedVertices(false),
109 fCentMethod("default"),
112 // fUsepA2012Vertex(false),
124 DGUARD(fDebug,1,"Default CTOR of AliFMDEventInspector");
127 //____________________________________________________________________
128 AliFMDEventInspector::AliFMDEventInspector(const char* name)
129 : TNamed(fgkFolderName, name),
133 fHEventsAcceptedXY(0),
149 fCollisionSystem(kUnknown),
154 // fUseFirstPhysicsVertex(false),
157 fMinPileupContrib(3),
158 fMinPileupDistance(0.8),
159 // fUseDisplacedVertices(false),
163 fCentMethod("default"),
166 // fUsepA2012Vertex(false),
179 // name Name of object
181 DGUARD(fDebug,1,"Named CTOR of AliFMDEventInspector: %s", name);
182 if (!GetPhysicsSelection()) {
183 AliFatal("No physics selection defined in manager\n"
184 "=======================================================\n"
185 " The use of AliFMDEventInspector _requires_ a valid\n"
186 " AliPhysicsSelection registered with the input handler.\n\n"
187 " Please check our train setup\n"
188 "=======================================================\n");
192 //____________________________________________________________________
193 AliFMDEventInspector::~AliFMDEventInspector()
198 DGUARD(fDebug,1,"DTOR of AliFMDEventInspector");
199 // if (fList) delete fList;
202 //____________________________________________________________________
204 AliFMDEventInspector::SetCentralityMethod(ECentMethod m)
207 case kV0Multiplicity: fCentMethod = "VOM"; break; // VZERO multiplicity
208 case kV0Amplitude: fCentMethod = "V0A"; break; // VZERO amplitude
209 case kV0Charge: fCentMethod = "V0C"; break; // VZERO charge
210 case kFMDRough: fCentMethod = "FMD"; break; // FMD scaled energy l
211 case kNTracks: fCentMethod = "TRK"; break; // Number of tracks
212 case kLTracks: fCentMethod = "TKL"; break; // Number of tracks
213 case kCL0: fCentMethod = "CL0"; break; //
214 case kCL1: fCentMethod = "CL1"; break; //
215 case kCND: fCentMethod = "CND"; break; //
216 case kNParticles: fCentMethod = "NPA"; break; // Neutral particles
217 case kNeutrons: fCentMethod = "ZNA"; break; // ZDC neutron amplitu
218 case kV0vsFMD: fCentMethod = "V0MvsFMD"; break; // VZERO versus FMD
219 case kV0vsNTracks: fCentMethod = "TKLvsVOM"; break; // Tracks versus VZERO
220 case kZEMvsZDC: fCentMethod = "ZEMvsZDC"; break; // ZDC
221 default: fCentMethod = "default"; break;
225 //____________________________________________________________________
227 AliFMDEventInspector::SetMinCentrality(Double_t minCent)
230 "*******************************************************\n"
231 "* Setting centrality cuts in this stage is deprecated *\n"
232 "*******************************************************");
235 //____________________________________________________________________
237 AliFMDEventInspector::SetMaxCentrality(Double_t maxCent)
240 "*******************************************************\n"
241 "* Setting centrality cuts in this stage is deprecated *\n"
242 "*******************************************************");
246 //____________________________________________________________________
248 AliFMDEventInspector::FetchHistograms(const TList* d,
252 TH1I*& hTriggers) const
255 // Fetch our histograms from the passed list
259 // hEventsTr On return, pointer to histogram, or null
260 // hEventsTrVtx On return, pointer to histogram, or null
261 // hTriggers On return, pointer to histogram, or null
264 // true on success, false otherwise
266 DGUARD(fDebug,3,"Fetch histograms in AliFMDEventInspector");
271 TList* dd = dynamic_cast<TList*>(d->FindObject(GetName()));
272 if (!dd) return kFALSE;
274 hEventsTr = dynamic_cast<TH1I*>(dd->FindObject("nEventsTr"));
275 hEventsTrVtx = dynamic_cast<TH1I*>(dd->FindObject("nEventsTrVtx"));
276 hEventsAcc = dynamic_cast<TH1I*>(dd->FindObject("nEventsAccepted"));
277 hTriggers = dynamic_cast<TH1I*>(dd->FindObject("triggers"));
282 !hTriggers) return kFALSE;
285 //____________________________________________________________________
287 AliFMDEventInspector::CacheConfiguredTriggerClasses(TList& cache,
288 const TList* classes,
289 AliOADBPhysicsSelection* o)
291 TIter nextClass(classes);
292 TObjString* trigClass = 0;
293 // Loop over all trigger classes. Trigger classes have the format
295 // class := positive_words SPACE(s) negative_words
303 while ((trigClass = static_cast<TObjString*>(nextClass()))) {
304 // Tokenize on space to get positive and negative parts
305 TString side = o->GetBeamSide(trigClass->String());
306 TObjArray* parts = trigClass->String().Tokenize(" ");
307 TObjString* part = 0;
308 TIter nextPart(parts);
309 while ((part = static_cast<TObjString*>(nextPart()))) {
310 // We only care about the positive ones
311 if (part->GetName()[0] != '+') continue;
312 part->String().Remove(0,1);
314 // Tokenize on a comma to get the words
315 TObjArray* words = part->String().Tokenize(",");
316 TObjString* word = 0;
317 TIter nextWord(words);
318 while ((word = static_cast<TObjString*>(nextWord()))) {
319 TNamed* store = new TNamed(word->String(), side);
321 DMSG(fDebug,3,"Caching %s trigger word %s",
322 store->GetTitle(), store->GetName());
330 //____________________________________________________________________
332 AliFMDEventInspector::SetupForData(const TAxis& vtxAxis)
335 // Initialize the object - this is called on the first seen event.
338 // vtxAxis Vertex axis in use
340 DGUARD(fDebug,1,"Initialize in AliFMDEventInspector");
342 // Get the physics selection - should always be there
343 AliPhysicsSelection* ps = GetPhysicsSelection();
345 AliWarning("No physics selection");
348 // Get the configured triggers
349 AliOADBPhysicsSelection* oadb =
350 const_cast<AliOADBPhysicsSelection*>(ps->GetOADBPhysicsSelection());
352 AliWarning("No OADB physics selection object");
355 // Get the configured trigger words from the physics selection
356 const TList* collTriggClasses = ps->GetCollisionTriggerClasses();
357 const TList* bgTriggClasses = ps->GetBGTriggerClasses();
358 if (!collTriggClasses) {
359 AliWarning("No configured collision trigger classes");
362 if (!bgTriggClasses) {
363 AliWarning("No configured background trigger classes");
366 CacheConfiguredTriggerClasses(fCollWords, collTriggClasses, oadb);
367 CacheConfiguredTriggerClasses(fBgWords, bgTriggClasses, oadb);
373 if ((fMinCent < 0 && fMaxCent < 0) || fMaxCent <= fMinCent) {
375 // -1.5 -0.5 0.5 1.5 ... 89.5 ... 100.5
376 // ----- 92 number --------- ---- 1 ---
378 // -0.5 0.5 1.5 ... 89.5 ... 100.5
379 // ----- 91 number ---- ---- 1 ---
381 for (Int_t i = 0; i < 91; i++) limits[i] = -.5 + i;
385 Int_t n = Int_t(fMaxCent-fMinCent+2);
387 for (Int_t i = 0; i < n; i++) {
388 limits[i] = fMinCent + i - .5;
392 fVtxAxis.Set(vtxAxis.GetNbins(), vtxAxis.GetXmin(), vtxAxis.GetXmax());
394 fCentAxis = new TAxis(limits.GetSize()-1, limits.GetArray());
395 fHEventsTr = new TH1I("nEventsTr", "Number of events w/trigger",
396 4*vtxAxis.GetNbins(),
398 2*vtxAxis.GetXmax());
399 fHEventsTr->SetXTitle("v_{z} [cm]");
400 fHEventsTr->SetYTitle("# of events");
401 fHEventsTr->SetFillColor(kRed+1);
402 fHEventsTr->SetFillStyle(3001);
403 fHEventsTr->SetDirectory(0);
404 // fHEventsTr->Sumw2();
405 fList->Add(fHEventsTr);
407 fHEventsTrVtx = static_cast<TH1I*>(fHEventsTr->Clone("nEventsTrVtx"));
408 fHEventsTrVtx->SetTitle("Number of events w/trigger and vertex");
409 fHEventsTrVtx->SetFillColor(kBlue+1);
410 fHEventsTrVtx->SetDirectory(0);
411 // fHEventsTrVtx->Sumw2();
412 fList->Add(fHEventsTrVtx);
414 fHEventsAccepted = new TH1I("nEventsAccepted",
415 "Number of events w/trigger and vertex in range",
416 2*vtxAxis.GetNbins(),
418 2*vtxAxis.GetXmax());
419 fHEventsAccepted->SetXTitle("v_{z} [cm]");
420 fHEventsAccepted->SetYTitle("# of events");
421 fHEventsAccepted->SetFillColor(kGreen+1);
422 fHEventsAccepted->SetFillStyle(3001);
423 fHEventsAccepted->SetDirectory(0);
424 // fHEventsAccepted->Sumw2();
425 fList->Add(fHEventsAccepted);
427 fHEventsAcceptedXY = new TH2D("nEventsAcceptedXY",
428 "XY vertex w/trigger and Z vertex in range",
429 1000,-1,1,1000,-1,1);
431 fHEventsAcceptedXY->SetXTitle("v_{x} [cm]");
432 fHEventsAcceptedXY->SetYTitle("v_{y} [cm]");
433 fHEventsAcceptedXY->SetDirectory(0);
434 // fHEventsAccepted->Sumw2();
435 fList->Add(fHEventsAcceptedXY);
438 fHTriggers = new TH1I("triggers", "Triggers", kOffline+1, 0, kOffline+1);
439 fHTriggers->SetFillColor(kRed+1);
440 fHTriggers->SetFillStyle(3001);
441 fHTriggers->SetStats(0);
442 fHTriggers->SetDirectory(0);
444 fHTriggerCorr = new TH2I("triggerCorr", "Trigger correlation",
445 kOffline+1, 0, kOffline+1,
446 kOffline+1, 0, kOffline+1);
447 fHTriggerCorr->SetStats(0);
448 fHTriggerCorr->SetDirectory(0);
449 fHTriggerCorr->SetXTitle("Requirement");
450 fHTriggerCorr->SetYTitle("Companion");
452 Int_t binNum[] = { kInel +1,
466 const char* binLbl[] = { "INEL",
480 for (Int_t i = 0; i < kOffline+1; i++) {
481 fHTriggers->GetXaxis()->SetBinLabel(binNum[i], binLbl[i]);
482 fHTriggerCorr->GetXaxis()->SetBinLabel(binNum[i], binLbl[i]);
483 fHTriggerCorr->GetYaxis()->SetBinLabel(binNum[i], binLbl[i]);
485 fList->Add(fHTriggers);
486 fList->Add(fHTriggerCorr);
489 fHType = new TH1I("type", Form("Event type (cut: SPD mult>%d)",
490 fLowFluxCut), 2, -.5, 1.5);
491 fHType->SetFillColor(kRed+1);
492 fHType->SetFillStyle(3001);
494 fHType->SetDirectory(0);
495 fHType->GetXaxis()->SetBinLabel(1,"Low-flux");
496 fHType->GetXaxis()->SetBinLabel(2,"High-flux");
500 // This histogram disabled as it causes problems in the merge
501 fHWords = new TH1I("words", "Trigger words seen", 1, 0, 0);
502 fHWords->SetFillColor(kBlue+1);
503 fHWords->SetFillStyle(3001);
504 fHWords->SetStats(0);
505 fHWords->SetDirectory(0);
506 fHWords->SetBit(TH1::kCanRebin);
510 fHCent = new TH1F("cent", "Centrality", limits.GetSize()-1,limits.GetArray());
511 fHCent->SetFillColor(kBlue+1);
512 fHCent->SetFillStyle(3001);
514 fHCent->SetDirectory(0);
515 fHCent->SetXTitle("Centrality [%]");
516 fHCent->SetYTitle("Events");
519 fHCentVsQual = new TH2F("centVsQuality", "Quality vs Centrality",
520 5, 0, 5, limits.GetSize()-1, limits.GetArray());
521 fHCentVsQual->SetXTitle("Quality");
522 fHCentVsQual->SetYTitle("Centrality [%]");
523 fHCentVsQual->SetZTitle("Events");
524 fHCentVsQual->GetXaxis()->SetBinLabel(1, "OK");
525 fHCentVsQual->GetXaxis()->SetBinLabel(2, "Outside v_{z} cut");
526 fHCentVsQual->GetXaxis()->SetBinLabel(3, "V0 vs SPD outlier");
527 fHCentVsQual->GetXaxis()->SetBinLabel(4, "V0 vs TPC outlier");
528 fHCentVsQual->GetXaxis()->SetBinLabel(5, "V0 vs ZDC outlier");
529 fHCentVsQual->SetDirectory(0);
530 fList->Add(fHCentVsQual);
532 fHStatus = new TH1I("status", "Status", 8, 1, 9);
533 fHStatus->SetFillColor(kBlue+1);
534 fHStatus->SetFillStyle(3001);
535 fHStatus->SetStats(0);
536 fHStatus->SetDirectory(0);
537 TAxis* xAxis = fHStatus->GetXaxis();
538 xAxis->SetBinLabel(1, "OK");
539 xAxis->SetBinLabel(2, "No event");
540 xAxis->SetBinLabel(3, "No triggers");
541 xAxis->SetBinLabel(4, "No SPD");
542 xAxis->SetBinLabel(5, "No FMD");
543 xAxis->SetBinLabel(6, "No vertex");
544 xAxis->SetBinLabel(7, "Bad vertex");
545 xAxis->SetBinLabel(8, "No centrality");
546 fList->Add(fHStatus);
548 fHVtxStatus = new TH1I("vtxStatus","Vertex Status",
549 kNotVtxZ,kVtxOK,kNotVtxZ+1);
550 fHVtxStatus->SetFillColor(kGreen+1);
551 fHVtxStatus->SetFillStyle(3001);
552 fHVtxStatus->SetStats(0);
553 fHVtxStatus->SetDirectory(0);
554 xAxis = fHVtxStatus->GetXaxis();
555 xAxis->SetBinLabel(kVtxOK, "OK");
556 xAxis->SetBinLabel(kNoVtx, "None/bad status");
557 xAxis->SetBinLabel(kNoSPDVtx, "No SPD/bad status");
558 xAxis->SetBinLabel(kFewContrib, "N_{contrib} <= 0");
559 xAxis->SetBinLabel(kUncertain, Form("#delta z > %4.2f", fMaxVzErr));
560 xAxis->SetBinLabel(kNotVtxZ, "Not Z vertexer");
561 fList->Add(fHVtxStatus);
563 fHTrgStatus = new TH1I("trgStatus", "Trigger Status",
564 kOther, kNoTrgWords, kOther+1);
565 fHTrgStatus->SetFillColor(kMagenta+1);
566 fHTrgStatus->SetFillStyle(3001);
567 fHTrgStatus->SetStats(0);
568 fHTrgStatus->SetDirectory(0);
569 xAxis = fHTrgStatus->GetXaxis();
570 xAxis->SetBinLabel(kNoTrgWords, "No words");
571 xAxis->SetBinLabel(kPP2760Fast, "FAST in pp@#sqrt{s}=2.76TeV");
572 xAxis->SetBinLabel(kMUON, "Muon trigger");
573 xAxis->SetBinLabel(kTriggered, "Triggered");
574 xAxis->SetBinLabel(kMinBias, "CINT1 (V0A||V0C||FASTOR)");
575 xAxis->SetBinLabel(kMinBiasNoSPD, "CINT5 (V0A||V0C)");
576 xAxis->SetBinLabel(kV0AndTrg, "CINT7 (V0A&&V0C)");
577 xAxis->SetBinLabel(kHighMult, "N>>0");
578 xAxis->SetBinLabel(kCentral, "Central");
579 xAxis->SetBinLabel(kSemiCentral, "Semi-central");
580 xAxis->SetBinLabel(kDiffractive, "Diffractive");
581 xAxis->SetBinLabel(kUser, "User");
582 xAxis->SetBinLabel(kOther, "Other");
583 fList->Add(fHTrgStatus);
585 fHPileup = new TH1I("pileupStatus", "Pile-up status", 3, 0, 3);
586 fHPileup->SetFillColor(kYellow+2);
587 fHPileup->SetFillStyle(3001);
588 fHPileup->SetStats(0);
589 fHPileup->SetDirectory(0);
590 xAxis = fHPileup->GetXaxis();
591 xAxis->SetBinLabel(1, "SPD tracklets");
592 xAxis->SetBinLabel(2, "Tracks");
593 xAxis->SetBinLabel(3, "Out-of-bunch");
594 fList->Add(fHPileup);
596 if (AllowDisplaced()) fDisplacedVertex.SetupForData(fList, "", false);
599 //____________________________________________________________________
601 AliFMDEventInspector::StoreInformation()
603 // Write TNamed objects to output list containing information about
604 // the running conditions
605 DGUARD(fDebug,2,"Store information from AliFMDEventInspector");
609 fList->Add(AliForwardUtil::MakeParameter("sys", fCollisionSystem));
610 fList->Add(AliForwardUtil::MakeParameter("sNN", fEnergy));
611 fList->Add(AliForwardUtil::MakeParameter("field", fField));
612 fList->Add(AliForwardUtil::MakeParameter("runNo", fRunNumber));
613 fList->Add(AliForwardUtil::MakeParameter("lowFlux", fLowFluxCut));
614 fList->Add(AliForwardUtil::MakeParameter("ipMethod", fVtxMethod));
615 //fList->Add(AliForwardUtil::MakeParameter("fpVtx",fUseFirstPhysicsVertex));
616 fList->Add(AliForwardUtil::MakeParameter("v0and",fUseV0AND));
617 fList->Add(AliForwardUtil::MakeParameter("pileup", fPileupFlags));
618 fList->Add(AliForwardUtil::MakeParameter("nPileUp", fMinPileupContrib));
619 fList->Add(AliForwardUtil::MakeParameter("dPileup", fMinPileupDistance));
620 fList->Add(AliForwardUtil::MakeParameter("satellite", AllowDisplaced()));
621 fList->Add(AliForwardUtil::MakeParameter("alirootRev",
622 AliForwardUtil::AliROOTRevision()));
623 fList->Add(AliForwardUtil::MakeParameter("alirootBranch",
624 AliForwardUtil::AliROOTBranch()));
625 fList->Add(AliForwardUtil::MakeParameter("mc", fMC));
629 //____________________________________________________________________
631 AliFMDEventInspector::StoreProduction()
635 AliAnalysisManager *mgr=AliAnalysisManager::GetAnalysisManager();
636 AliVEventHandler *inputHandler=mgr->GetInputEventHandler();
638 AliWarning("Got no input handler");
641 TList *uiList = inputHandler->GetUserInfo();
643 AliWarning("Got no user list from input tree");
647 AliProdInfo p(uiList);
649 if (p.GetAlirootSvnVersion() <= 0) return;
651 // Make our output list
652 TList* out = new TList;
654 out->SetName("production");
655 // out->SetTitle("ESD production details");
658 TString period = p.GetLHCPeriod();
659 // TString aliROOTVersion = p.GetAlirootVersion();
660 fProdSVN = p.GetAlirootSvnVersion();
661 // TString rootVersion = p.GetRootVersion();
662 Int_t rootSVN = p.GetRootSvnVersion();
663 fProdPass = p.GetRecoPass();
666 if (period.Length() > 0) {
667 TObjArray* pp = TPRegexp("LHC([0-9]+)([a-z]+)").MatchS(period);
668 fProdYear = static_cast<TObjString*>(pp->At(1))->String().Atoi();
669 fProdLetter = static_cast<TObjString*>(pp->At(2))->String()[0];
673 out->Add(AliForwardUtil::MakeParameter("year", fProdYear));
674 out->Add(AliForwardUtil::MakeParameter("letter", Int_t(fProdLetter)));
675 out->Add(AliForwardUtil::MakeParameter("alirootSVN", fProdSVN));
676 out->Add(AliForwardUtil::MakeParameter("rootSVN", rootSVN));
677 out->Add(AliForwardUtil::MakeParameter("pass", fProdPass));
678 out->Add(AliForwardUtil::MakeParameter("mc", fProdMC));
684 //____________________________________________________________________
686 AliFMDEventInspector::CreateOutputObjects(TList* dir)
689 // Define the output histograms. These are put in a sub list of the
690 // passed list. The histograms are merged before the parent task calls
691 // AliAnalysisTaskSE::Terminate
693 // dir Directory to add to
695 DGUARD(fDebug,1,"Define output from AliFMDEventInspector");
697 fList->SetName(GetName());
702 //____________________________________________________________________
704 AliFMDEventInspector::Process(const AliESDEvent* event,
717 // triggers On return, the triggers fired
718 // lowFlux On return, true if the event is considered a low-flux
719 // event (according to the setting of fLowFluxCut)
720 // ivz On return, the found vertex bin (1-based). A zero
721 // means outside of the defined vertex range
722 // vz On return, the z position of the interaction
723 // cent On return, the centrality - if not available < 0
726 // 0 (or kOk) on success, otherwise a bit mask of error codes
728 DGUARD(fDebug,1,"Process event in AliFMDEventInspector");
729 // --- Check that we have an event ---------------------------------
731 AliWarning("No ESD event found for input event");
736 // --- Process satellite event information is requested ------------
737 if (AllowDisplaced()) {
738 if (!fDisplacedVertex.Process(event))
739 AliWarning("Failed to process satellite event");
742 // --- Read trigger information from the ESD and store in AOD object
743 if (!ReadTriggers(*event, triggers, nClusters)) {
745 AliWarning("Failed to read triggers from ESD"); }
750 // --- Check if this is a high-flux event --------------------------
751 const AliMultiplicity* testmult = event->GetMultiplicity();
754 AliWarning("No central multiplicity object found"); }
757 lowFlux = testmult->GetNumberOfTracklets() < fLowFluxCut;
759 fHType->Fill(lowFlux ? 0 : 1);
761 // --- Get the interaction point -----------------------------------
762 Bool_t vzOk = ReadVertex(*event, ip);
763 fHEventsTr->Fill(ip.Z());
766 AliWarning("Failed to read vertex from ESD"); }
771 // --- Read centrality information
774 if (!ReadCentrality(*event, cent, qual)) {
776 AliWarning("Failed to get centrality");
778 // --- check centrality cut
780 if(fMinCent > -0.0001 && cent < fMinCent) return kNoEvent;
781 if(fMaxCent > -0.0001 && cent > fMaxCent) return kNoEvent;
782 if (cent >= 0) fHCent->Fill(cent);
783 if (qual == 0) fHCentVsQual->Fill(0., cent);
786 for (UShort_t i = 0; i < 4; i++)
787 if (qual & (1 << i)) fHCentVsQual->Fill(Double_t(i+1), cent);
791 fHEventsTrVtx->Fill(ip.Z());
793 // --- Get the vertex bin ------------------------------------------
794 ivz = fVtxAxis.FindBin(ip.Z());
795 if (ivz <= 0 || ivz > fVtxAxis.GetNbins()) {
797 AliWarning(Form("Vertex @ %f outside of range [%f,%f]",
798 ip.Z(), fVtxAxis.GetXmin(), fVtxAxis.GetXmax()));
804 fHEventsAccepted->Fill(ip.Z());
805 fHEventsAcceptedXY->Fill(ip.X(),ip.Y());
807 // --- Check the FMD ESD data --------------------------------------
808 if (!event->GetFMDData()) {
810 AliWarning("No FMD data found in ESD"); }
819 //____________________________________________________________________
821 AliFMDEventInspector::ReadCentrality(const AliESDEvent& esd,
823 UShort_t& qual) const
826 // Read centrality from event
830 // cent On return, the centrality or negative if not found
833 // False on error, true otherwise
835 DGUARD(fDebug,2,"Read the centrality in AliFMDEventInspector");
839 AliCentrality* centObj = const_cast<AliESDEvent&>(esd).GetCentrality();
841 cent = centObj->GetCentralityPercentile(fCentMethod);
842 qual = centObj->GetQuality();
845 // We overwrite with satellite events, so we can be sure to get the
846 // centrality determination from the satellite vertex selection
847 if (AllowDisplaced() && fDisplacedVertex.IsSatellite()) {
848 cent = fDisplacedVertex.GetCentralityPercentile();
855 //____________________________________________________________________
857 AliFMDEventInspector::CheckpAExtraV0(const AliESDEvent& esd) const
859 if (fCollisionSystem != AliForwardUtil::kPPb) return true;
861 AliVVZERO* esdV0 = esd.GetVZEROData();
862 if ((esdV0->GetV0ADecision()!=1) || (esdV0->GetV0CDecision()!=1))
867 //____________________________________________________________________
869 AliFMDEventInspector::ReadTriggers(const AliESDEvent& esd, UInt_t& triggers,
873 // Read the trigger information from the ESD event
877 // triggers On return, contains the trigger bits
880 // @c true on success, @c false otherwise
882 DGUARD(fDebug,2,"Read the triggers in AliFMDEventInspector");
885 // Get the analysis manager - should always be there
886 AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager();
887 DMSG(fDebug,10,"Got analysis manager %p", am);
889 AliWarning("No analysis manager defined!");
893 // Get the input handler - should always be there
894 AliInputEventHandler* ih =
895 static_cast<AliInputEventHandler*>(am->GetInputEventHandler());
896 DMSG(fDebug,10,"Got input handler %p", ih);
898 AliWarning("No input handler");
902 // Check if this is a collision candidate (MB)
904 // Historic remark: Note, that we should use the value cached in the
905 // input handler rather than calling IsCollisionCandiate directly
906 // on the AliPhysicsSelection obejct. If we called the latter
907 // then the AliPhysicsSelection object would overcount by a factor
909 UInt_t trgMask = ih->IsEventSelected();
910 Bool_t offline = trgMask;
911 Bool_t fastonly = (trgMask & AliVEvent::kFastOnly);
912 TString trigStr = esd.GetFiredTriggerClasses();
914 if (trigStr.IsNull()) fHTrgStatus->Fill(kNoTrgWords);
915 if (fHWords) fHWords->Fill(trigStr.Data(), 1);
917 if(AllowDisplaced()) {
918 DMSG(fDebug,3,"Using displaced vertex stuff");
919 // if (TMath::Abs(fDisplacedVertex.GetVertexZ()) >= 999) offline = false;
920 if (fDisplacedVertex.IsSatellite())
921 triggers |= AliAODForwardMult::kSatellite;
924 if (CheckFastPartition(fastonly)) {
925 fHTrgStatus->Fill(kPP2760Fast);
929 if (offline && CheckCosmics(trigStr)) {
930 fHTrgStatus->Fill(kMUON);
933 if (offline) fHTrgStatus->Fill(kTriggered);
935 if (trgMask & AliVEvent::kMB) f += fHTrgStatus->Fill(kMinBias);
936 if (trgMask & AliVEvent::kCINT5) f += fHTrgStatus->Fill(kMinBiasNoSPD);
937 if (trgMask & AliVEvent::kINT7) f += fHTrgStatus->Fill(kV0AndTrg);
938 if (trgMask & AliVEvent::kHighMult) f += fHTrgStatus->Fill(kHighMult);
939 if (trgMask & AliVEvent::kCentral) f += fHTrgStatus->Fill(kCentral);
940 if (trgMask & AliVEvent::kSemiCentral) f += fHTrgStatus->Fill(kSemiCentral);
941 if (trgMask & AliVEvent::kDG5) f += fHTrgStatus->Fill(kDiffractive);
942 if (trgMask & AliVEvent::kUserDefined) f += fHTrgStatus->Fill(kUser);
943 if (f <= 0) fHTrgStatus->Fill(kOther);
945 // if (!CheckpAExtraV0(esd)) offline = false;
947 DMSG(fDebug,2,"Event is %striggered by off-line", offline ? "" : "NOT ");
949 if (offline) triggers |= AliAODForwardMult::kOffline;
950 // Only flag as in-elastic if a min-bias trigger is here
951 if (trgMask & AliVEvent::kMB) {
952 triggers |= AliAODForwardMult::kInel;
953 CheckINELGT0(esd, nClusters, triggers);
956 AliTriggerAnalysis ta;
957 if (ta.IsSPDClusterVsTrackletBG(&esd, false))
959 triggers |= AliAODForwardMult::kSPDOutlier;
961 CheckNSD(esd,triggers);
962 CheckPileup(esd, triggers);
963 CheckEmpty(trigStr, triggers);
964 // if (CheckPileup(esd, triggers)) fHTriggers->Fill(kPileUp+.5);
965 // if (CheckEmpty(trigStr, triggers)) fHTriggers->Fill(kEmpty+.5);
967 CheckWords(esd, triggers);
969 #define TEST_TRIG_BIN(RET,BIN,TRIGGERS) \
970 do { switch (BIN) { \
971 case kInel: RET = triggers & AliAODForwardMult::kInel; break; \
972 case kInelGt0: RET = triggers & AliAODForwardMult::kInelGt0; break; \
973 case kNSD: RET = triggers & AliAODForwardMult::kNSD; break; \
974 case kV0AND: RET = triggers & AliAODForwardMult::kV0AND; break; \
975 case kEmpty: RET = triggers & AliAODForwardMult::kEmpty; break; \
976 case kA: RET = triggers & AliAODForwardMult::kA; break; \
977 case kB: RET = triggers & AliAODForwardMult::kB; break; \
978 case kC: RET = triggers & AliAODForwardMult::kC; break; \
979 case kE: RET = triggers & AliAODForwardMult::kE; break; \
980 case kPileUp: RET = triggers & AliAODForwardMult::kPileUp; break; \
981 case kMCNSD: RET = triggers & AliAODForwardMult::kMCNSD; break; \
982 case kSatellite: RET = triggers & AliAODForwardMult::kSatellite; break; \
983 case kSpdOutlier:RET = triggers & AliAODForwardMult::kSPDOutlier; break; \
984 case kOffline: RET = triggers & AliAODForwardMult::kOffline; break; \
985 default: RET = false; } } while(false)
988 AliWarning("Histogram of triggers not defined - has init been called");
992 for (Int_t i = 0; i < kOffline+1; i++) {
994 TEST_TRIG_BIN(hasX, i, triggers);
996 fHTriggers->Fill(i+.5);
997 for (Int_t j = 0; j < kOffline+1; j++) {
999 TEST_TRIG_BIN(hasY, j, triggers);
1000 if (!hasY) continue;
1002 fHTriggerCorr->Fill(i+.5, j+.5);
1008 //____________________________________________________________________
1010 AliFMDEventInspector::CheckFastPartition(bool fastonly) const
1012 // For the 2.76 TeV p+p run (LHC11a), the FMD ran in the slow partition
1013 // so it received no triggers from the fast partition. Therefore
1014 // the fast triggers are removed here but not for MC where all
1015 // triggers are fast.
1016 if (TMath::Abs(fEnergy - 2750.) > 20) return false;
1017 if (fCollisionSystem != AliForwardUtil::kPP) return false;
1018 if (fMC) return false; // All MC events for pp @ 2.76TeV are `fast'
1020 // DMSG(fDebug,1,"Fast trigger in pp @ sqrt(s)=2.76TeV removed");
1025 //____________________________________________________________________
1027 AliFMDEventInspector::CheckCosmics(const TString& trigStr) const
1029 // MUON triggers are not strictly minimum bias (MB) so they are
1031 if(trigStr.Contains("CMUS1")) {
1032 DMSG(fDebug,1,"Cosmic trigger ins't min-bias, removed");
1038 //____________________________________________________________________
1040 AliFMDEventInspector::CheckINELGT0(const AliESDEvent& esd,
1041 UShort_t& nClusters,
1042 UInt_t& triggers) const
1044 Int_t nTracklets = 0;
1047 // If this is inel, see if we have a tracklet
1048 const AliMultiplicity* spdmult = esd.GetMultiplicity();
1050 AliWarning("No SPD multiplicity");
1054 // Check if we have one or more tracklets
1055 // in the range -1 < eta < 1 to set the INEL>0
1058 // Also count tracklets as a single cluster
1059 Int_t n = spdmult->GetNumberOfTracklets();
1060 for (Int_t j = 0; j < n; j++) {
1061 if(TMath::Abs(spdmult->GetEta(j)) < 1) nTracklets++;
1063 // If we at this point had non-zero nClusters, it's INEL>0
1064 if (nTracklets > 0) triggers |= AliAODForwardMult::kInelGt0;
1065 nClusters = nTracklets;
1067 // Loop over single clusters
1068 n = spdmult->GetNumberOfSingleClusters();
1069 for (Int_t j = 0; j < n; j++) {
1070 Double_t eta = -TMath::Log(TMath::Tan(spdmult->GetThetaSingle(j)/2.));
1071 if (TMath::Abs(eta) < 1) nClusters++;
1073 if (nClusters > 0) triggers |= AliAODForwardMult::kNClusterGt0;
1075 return triggers & AliAODForwardMult::kNClusterGt0;
1078 //____________________________________________________________________
1080 AliFMDEventInspector::CheckNSD(const AliESDEvent& esd, UInt_t& triggers) const
1082 // Analyse some trigger stuff
1083 AliTriggerAnalysis ta;
1084 if (ta.IsOfflineTriggerFired(&esd, AliTriggerAnalysis::kV0AND)) {
1085 triggers |= AliAODForwardMult::kV0AND;
1087 triggers |= AliAODForwardMult::kNSD;
1089 if (ta.IsOfflineTriggerFired(&esd, AliTriggerAnalysis::kNSD1))
1090 triggers |= AliAODForwardMult::kNSD;
1091 return triggers & AliAODForwardMult::kNSD;
1093 //____________________________________________________________________
1095 AliFMDEventInspector::CheckPileup(const AliESDEvent& esd,
1096 UInt_t& triggers) const
1098 // Check for multiple vertices (pile-up) with at least 3
1099 // contributors and at least 0.8cm from the primary vertex
1100 // if(fCollisionSystem != AliForwardUtil::kPP) return false;
1103 // Check for standard SPD pile-up
1104 if ((fPileupFlags & kSPD) &&
1105 esd.IsPileupFromSPD(fMinPileupContrib,fMinPileupDistance)) {
1106 fHPileup->Fill(0.5, 1);
1107 locTrig |= AliAODForwardMult::kPileupSPD;
1110 // Check for multi-vertex pileup
1111 if ((fPileupFlags & kTracks) && CheckMultiVertex(esd)) {
1112 fHPileup->Fill(1.5, 1);
1113 locTrig |= AliAODForwardMult::kPileupTrack;
1116 // Check for out-of-bunch pileup
1117 if ((fPileupFlags & kOutOfBunch) &&
1118 (esd.GetHeader()->GetIRInt2ClosestInteractionMap() != 0 ||
1119 esd.GetHeader()->GetIRInt1ClosestInteractionMap() != 0)) {
1120 fHPileup->Fill(2.5, 1);
1121 locTrig |= AliAODForwardMult::kPileupBC;
1125 triggers |= locTrig;
1126 Bool_t pileup = locTrig != 0;
1127 if (pileup) triggers |= AliAODForwardMult::kPileUp;
1131 //____________________________________________________________________
1133 AliFMDEventInspector::CheckMultiVertex(const AliESDEvent& esd,
1134 Bool_t checkOtherBC) const
1136 // Adapted from AliAnalysisUtils
1139 const Double_t maxChi2nu = 5;
1141 // Number of vertices
1142 Int_t n = esd.GetNumberOfPileupVerticesTracks();
1144 // No additional vertices from tracks -> no pileup
1148 const AliESDVertex* primary = esd.GetPrimaryVertexTracks();
1149 if (primary->GetStatus() != 1)
1150 // No good primary vertex, but many candidates -> pileup
1153 // Bunch crossing number
1154 Int_t bcPrimary = primary->GetBC();
1156 for (Int_t i = 0; i < n; i++) {
1157 const AliESDVertex* other = esd.GetPileupVertexTracks(i);
1159 if (other->GetNContributors() < fMinPileupContrib)
1160 // Not enough contributors to this vertex
1163 if (other->GetChi2perNDF() > maxChi2nu)
1164 // Poorly determined vertex
1167 Int_t bcOther = other->GetBC();
1168 if (bcOther != AliVTrack::kTOFBCNA && TMath::Abs(bcOther-bcPrimary) > 2)
1169 // Pile-up from other BC
1172 // Calculate the distance
1174 Double_t dx = primary->GetX() - other->GetX();
1175 Double_t dy = primary->GetY() - other->GetY();
1176 Double_t dz = primary->GetZ() - other->GetZ();
1177 Double_t covPrimary[6], covOther[6];
1178 primary->GetCovarianceMatrix(covPrimary);
1179 other->GetCovarianceMatrix(covOther);
1181 v(0,0) = covPrimary[0] + covOther[0]; // diagonal
1182 v(1,1) = covPrimary[2] + covOther[2]; // diagonal
1183 v(2,2) = covPrimary[5] + covOther[5]; // diagonal
1184 v(1,0) = v(0,1) = covPrimary[1]+covOther[1]; // Band
1185 v(0,2) = v(1,2) = v(2,0) = v(2,1) = 0; // Off-diagonal+band
1189 // Question if kStatus bit is every set after InvertFast?
1191 d = (v(0,0) * dx * dx + v(1,1) * dy * dy + v(2,2) * dz * dz +
1192 2 * (v(0,1) * dx * dy + v(0,2) * dx * dz + v(1,2) * dy * dz));
1194 if (d < 0 || TMath::Sqrt(d) < fMinPileupDistance)
1195 // Bad distance, or not fare enough from each other
1198 // Well separated vertices -> pileup
1204 //____________________________________________________________________
1206 AliFMDEventInspector::CheckEmpty(const TString& trigStr, UInt_t& triggers) const
1208 if (trigStr.Contains("CBEAMB-ABCE-NOPF-ALL")||
1209 trigStr.Contains("CBEAMB-B-NOPF-ALLNOTRD")) {
1210 triggers |= AliAODForwardMult::kEmpty;
1215 //____________________________________________________________________
1217 AliFMDEventInspector::CheckWords(const AliESDEvent& esd, UInt_t& triggers) const
1220 TIter nextColl(&fCollWords);
1221 while ((word = nextColl())) {
1222 DMSG(fDebug,10,"Checking if %s trigger %s is fired",
1223 word->GetTitle(), word->GetName());
1224 if (!esd.IsTriggerClassFired(word->GetName())) continue;
1226 TString beamSide = word->GetTitle();
1227 DMSG(fDebug,10,"Found it - this is a %s trigger", beamSide.Data());
1229 if (!beamSide.EqualTo("B")) continue;
1230 triggers |= AliAODForwardMult::kB;
1231 break; // No more to do here
1233 TIter nextBg(&fBgWords);
1234 UInt_t all = (AliAODForwardMult::kA |
1235 AliAODForwardMult::kC |
1236 AliAODForwardMult::kE);
1237 while ((word = nextBg())) {
1238 DMSG(fDebug,10,"Checking if %s trigger %s is fired",
1239 word->GetTitle(), word->GetName());
1240 if (!esd.IsTriggerClassFired(word->GetName())) continue;
1242 TString beamSide = word->GetTitle();
1243 DMSG(fDebug,10,"Found it - this is a %s trigger", beamSide.Data());
1245 if (beamSide.Contains("A")) triggers |= AliAODForwardMult::kA;
1246 if (beamSide.Contains("C")) triggers |= AliAODForwardMult::kC;
1247 if (beamSide.Contains("E")) triggers |= AliAODForwardMult::kE;
1249 if ((triggers & all) == all) break; // No more to do
1255 //____________________________________________________________________
1257 AliFMDEventInspector::ReadVertex(const AliESDEvent& esd, TVector3& ip)
1260 // Read the vertex information from the ESD event
1264 // vz On return, the vertex Z position
1267 // @c true on success, @c false otherwise
1269 DGUARD(fDebug,2,"Read the vertex in AliFMDEventInspector");
1270 ip.SetXYZ(1024, 1024, 0);
1272 EVtxStatus s = kNoVtx;
1273 if (AllowDisplaced() && fDisplacedVertex.IsSatellite()) {
1275 ip.SetZ(fDisplacedVertex.GetVertexZ());
1277 else if (fVtxMethod == kPWGUD)
1278 s = CheckPWGUDVertex(esd, ip);
1279 else if (fVtxMethod == kpA2012)
1280 s = CheckpA2012Vertex(esd,ip);
1281 else if (fVtxMethod == kpA2013)
1282 s = CheckpA2013Vertex(esd,ip);
1284 s = CheckVertex(esd, ip);
1286 fHVtxStatus->Fill(s);
1291 //____________________________________________________________________
1292 AliFMDEventInspector::EVtxStatus
1293 AliFMDEventInspector::CheckPWGUDVertex(const AliESDEvent& esd,
1296 // This is the code used by the 1st physics people
1297 const AliESDVertex* vertex = esd.GetPrimaryVertex();
1298 if (!vertex || !vertex->GetStatus()) {
1299 DMSG(fDebug,2,"No primary vertex (%p) or bad status %d",
1300 vertex, (vertex ? vertex->GetStatus() : -1));
1303 const AliESDVertex* vertexSPD = esd.GetPrimaryVertexSPD();
1304 if (!vertexSPD || !vertexSPD->GetStatus()) {
1305 DMSG(fDebug,2,"No primary SPD vertex (%p) or bad status %d",
1306 vertexSPD, (vertexSPD ? vertexSPD->GetStatus() : -1));
1310 // if vertex is from SPD vertexZ, require more stringent cuts
1311 if (vertex->IsFromVertexerZ()) {
1312 if (vertex->GetDispersion() > fMaxVzErr ||
1313 vertex->GetZRes() > 1.25 * fMaxVzErr) {
1314 DMSG(fDebug,2,"Dispersion %f > %f or resolution %f > %f",
1315 vertex->GetDispersion(), fMaxVzErr,
1316 vertex->GetZRes(), 1.25 * fMaxVzErr);
1320 ip.SetZ(vertex->GetZ());
1322 if(!vertex->IsFromVertexerZ()) {
1323 ip.SetX(vertex->GetX());
1324 ip.SetY(vertex->GetY());
1328 //____________________________________________________________________
1329 AliFMDEventInspector::EVtxStatus
1330 AliFMDEventInspector::CheckpA2012Vertex(const AliESDEvent& esd,
1333 const Int_t nMinContrib = 0;
1334 const AliESDVertex *vertex = esd.GetPrimaryVertexSPD();
1335 if (!vertex) return kNoSPDVtx;
1336 if (vertex->GetNContributors() <= nMinContrib) return kFewContrib;
1338 TString vtxTyp = vertex->GetTitle();
1339 if (vtxTyp.Contains("vertexer: Z")) return kNotVtxZ;
1341 if (vertex->GetDispersion() >= 0.04 || vertex->GetZRes()>=0.25)
1344 ip.SetX(vertex->GetX());
1345 ip.SetY(vertex->GetY());
1346 ip.SetZ(vertex->GetZ());
1350 //____________________________________________________________________
1351 AliFMDEventInspector::EVtxStatus
1352 AliFMDEventInspector::CheckpA2013Vertex(const AliESDEvent& esd,
1355 // This code is adopted from
1357 // AliAnalysisUtils::IsVertexSelected2013pA(AliVEvent *event)
1359 const Int_t nMinContrib = 0;
1360 const AliESDVertex* primVtx = esd.GetPrimaryVertex();
1361 if (!primVtx) return kNoVtx;
1362 if (primVtx->GetNContributors() <= nMinContrib) return kFewContrib;
1364 const AliESDVertex* spdVtx = esd.GetPrimaryVertexSPD();
1365 if (!spdVtx) return kNoSPDVtx;
1366 if (spdVtx->GetNContributors() <= nMinContrib) return kFewContrib;
1368 // TString vtxTyp = spdVtx->GetTitle();
1369 // if (vtxTyp.Contains("vertexer:Z")) {
1370 if (spdVtx->IsFromVertexerZ() && spdVtx->GetZRes()>0.25) return kUncertain;
1372 Bool_t correlateVtx = true;
1374 if (TMath::Abs(spdVtx->GetZ() - primVtx->GetZ()) > 0.5) return kUncertain;
1377 ip.SetX(primVtx->GetX());
1378 ip.SetY(primVtx->GetY());
1379 ip.SetZ(primVtx->GetZ());
1384 //____________________________________________________________________
1385 AliFMDEventInspector::EVtxStatus
1386 AliFMDEventInspector::CheckVertex(const AliESDEvent& esd,
1389 // Use standard SPD vertex (perhaps preferable for Pb+Pb)
1391 const AliESDVertex* vertex = esd.GetPrimaryVertexSPD();
1394 AliWarning("No SPD vertex found in ESD"); }
1398 // #if 0 // Check disabled - seem to kill a lot of PbPb events
1399 // Check that enough tracklets contributed
1400 if(vertex->GetNContributors() <= 0) {
1401 DMSG(fDebug,2,"Number of contributors to vertex is %d<=0",
1402 vertex->GetNContributors());
1408 // Check that the uncertainty isn't too large
1409 if (vertex->GetZRes() > fMaxVzErr) {
1410 DMSG(fDebug,2,"Uncertaintity in Z of vertex is too large %f > %f",
1411 vertex->GetZRes(), fMaxVzErr);
1415 // Get the z coordiante
1416 ip.SetZ(vertex->GetZ());
1417 const AliESDVertex* vertexXY = esd.GetPrimaryVertex();
1420 if(!vertexXY->IsFromVertexerZ()) {
1421 ip.SetX(vertexXY->GetX());
1422 ip.SetY(vertexXY->GetY());
1427 //____________________________________________________________________
1429 AliFMDEventInspector::ReadRunDetails(const AliESDEvent* esd)
1432 // Read the collision system, collision energy, and L3 field setting
1436 // esd ESD to get information from
1439 // true on success, false
1441 // AliInfo(Form("Parameters from 1st ESD event: cms=%s, sNN=%f, field=%f",
1442 // esd->GetBeamType(), 2*esd->GetBeamEnergy(),
1443 // esd->GetMagneticField()));
1444 DGUARD(fDebug,2,"Read the run details in AliFMDEventInspector");
1445 const char* sys = esd->GetBeamType();
1446 Float_t cms = 2 * esd->GetBeamEnergy();
1447 Float_t fld = esd->GetMagneticField();
1448 fCollisionSystem = AliForwardUtil::ParseCollisionSystem(sys);
1449 fEnergy = AliForwardUtil::ParseCenterOfMassEnergy(fCollisionSystem,
1451 fField = AliForwardUtil::ParseMagneticField(fld);
1452 fRunNumber = esd->GetRunNumber();
1454 Int_t a0 = esd->GetBeamParticleA(0);
1455 Int_t a1 = esd->GetBeamParticleA(1);
1456 Int_t z0 = esd->GetBeamParticleZ(0);
1457 Int_t z1 = esd->GetBeamParticleZ(1);
1458 if (fCentMethod.EqualTo("default", TString::kIgnoreCase)) {
1459 if (fCollisionSystem == 1 || fCollisionSystem == 2)
1460 SetCentralityMethod("V0M");
1461 if (fCollisionSystem == 3) {
1462 if (a0 != 0 && a1 != 0)
1463 SetCentralityMethod(a0 > a1 ? "ZNC" : "ZNA");
1465 SetCentralityMethod("V0M");
1468 // store the beam species
1469 fList->Add(AliForwardUtil::MakeParameter("beam0a", a0));
1470 fList->Add(AliForwardUtil::MakeParameter("beam0z", z0));
1471 fList->Add(AliForwardUtil::MakeParameter("beam1a", a1));
1472 fList->Add(AliForwardUtil::MakeParameter("beam1z", z1));
1476 if (fCollisionSystem == AliForwardUtil::kUnknown) {
1477 AliWarningF("Unknown collision system: %s - please check", sys);
1481 AliWarningF("Unknown CMS energy: %f (%d) - please check", cms, fEnergy);
1484 if (TMath::Abs(fField) > 10) {
1485 AliWarningF("Unknown L3 field setting: %f (%d) - please check", fld,fField);
1493 //____________________________________________________________________
1495 AliFMDEventInspector::CodeString(UInt_t code)
1499 if (code & kNoEvent) s.Append("NOEVENT ");
1500 if (code & kNoTriggers) s.Append("NOTRIGGERS ");
1501 if (code & kNoSPD) s.Append("NOSPD ");
1502 if (code & kNoFMD) s.Append("NOFMD ");
1503 if (code & kNoVertex) s.Append("NOVERTEX ");
1504 if (code & kBadVertex) s.Append("BADVERTEX ");
1507 #define PF(N,V,...) \
1508 AliForwardUtil::PrintField(N,V, ## __VA_ARGS__)
1509 #define PFB(N,FLAG) \
1511 AliForwardUtil::PrintName(N); \
1512 std::cout << std::boolalpha << (FLAG) << std::noboolalpha << std::endl; \
1514 #define PFV(N,VALUE) \
1516 AliForwardUtil::PrintName(N); \
1517 std::cout << (VALUE) << std::endl; } while(false)
1519 //____________________________________________________________________
1521 AliFMDEventInspector::Print(Option_t*) const
1524 // Print information
1528 AliForwardUtil::PrintTask(*this);
1529 TString sNN(AliForwardUtil::CenterOfMassEnergyString(fEnergy));
1530 sNN.Strip(TString::kBoth, '0');
1531 sNN.ReplaceAll("GeV", " GeV");
1532 TString field(AliForwardUtil::MagneticFieldString(fField));
1533 field.ReplaceAll("p", "+");
1534 field.ReplaceAll("m", "-");
1535 field.ReplaceAll("kG", " kG");
1537 gROOT->IncreaseDirLevel();
1538 PFV("Production", "");
1539 gROOT->IncreaseDirLevel();
1540 PF("Period", "LHC%02d%c", fProdYear, fProdLetter);
1541 PFB("MC anchor", fProdMC);
1542 PFV("AliROOT Revision", fProdSVN);
1543 gROOT->DecreaseDirLevel();
1544 PFV("Vertex bins", fVtxAxis.GetNbins());
1545 PF("Vertex Range", "[%+6.1f,%+6.1f]", fVtxAxis.GetXmin(), fVtxAxis.GetXmax());
1546 PFV("Low flux cut", fLowFluxCut );
1547 PFV("Max(delta v_z)", fMaxVzErr );
1548 PF("Pile-up methods", "spd:%s,tracks:%s,out-of-bunch:%s",
1549 (fPileupFlags & kSPD ? "yes" : "no"),
1550 (fPileupFlags & kTracks ? "yes" : "no"),
1551 (fPileupFlags & kOutOfBunch ? "yes" : "no"));
1552 PFV("Min(nContrib_pileup)", fMinPileupContrib );
1553 PFV("Min(v-pileup)", fMinPileupDistance );
1554 PFV("System", AliForwardUtil::CollisionSystemString(fCollisionSystem));
1555 PFV("CMS energy per nucleon", sNN);
1556 PFV("Field", field);
1557 PFB("Satellite events", AllowDisplaced());
1558 // PFB("Use 2012 pA vertex", fUsepA2012Vertex );
1559 // PFB("Use PWG-UD vertex", fUseFirstPhysicsVertex);
1560 TString vtxMethod("normal");
1561 switch(fVtxMethod) {
1562 case kNormal: vtxMethod = "normal" ; break;
1563 case kpA2012: vtxMethod = "pA 2012"; break;
1564 case kpA2013: vtxMethod = "pA 2013"; break;
1565 case kPWGUD: vtxMethod = "PWG-UD"; break;
1566 case kDisplaced: vtxMethod = "Satellite"; break;
1568 PFV("IP method", vtxMethod);
1569 PFB("Simulation input", fMC );
1570 PFV("Centrality method", fCentMethod);
1571 PFV("Centrality axis", (!fCentAxis ? "none" : ""));
1572 if (!fCentAxis) {return; }
1573 Int_t nBin = fCentAxis->GetNbins();
1574 for (Int_t i = 0; i < nBin; i++) {
1575 if (i != 0 && (i % 10) == 0) std::cout << '\n';
1576 if ((i % 10) == 0) std::cout << " ";
1577 std::cout << std::setw(5) << fCentAxis->GetBinLowEdge(i+1) << '-';
1579 std::cout << std::setw(5) << fCentAxis->GetBinUpEdge(nBin) << std::endl;
1580 gROOT->DecreaseDirLevel();