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"
19 #include "AliESDEvent.h"
20 #include "AliMultiplicity.h"
21 #include "AliAnalysisManager.h"
22 #include "AliMCEventHandler.h"
23 #include "AliInputEventHandler.h"
24 #include "AliTriggerAnalysis.h"
25 #include "AliPhysicsSelection.h"
26 #include "AliAODForwardMult.h"
27 #include "AliForwardUtil.h"
28 #include "AliCentrality.h"
31 #include <TDirectory.h>
36 //====================================================================
37 AliFMDEventInspector::AliFMDEventInspector()
42 fHEventsAcceptedXY(0),
53 fCollisionSystem(kUnknown),
57 fUseFirstPhysicsVertex(true)
64 //____________________________________________________________________
65 AliFMDEventInspector::AliFMDEventInspector(const char* name)
66 : TNamed("fmdEventInspector", name),
70 fHEventsAcceptedXY(0),
81 fCollisionSystem(kUnknown),
85 fUseFirstPhysicsVertex(true)
91 // name Name of object
95 //____________________________________________________________________
96 AliFMDEventInspector::AliFMDEventInspector(const AliFMDEventInspector& o)
98 fHEventsTr(o.fHEventsTr),
99 fHEventsTrVtx(o.fHEventsTrVtx),
100 fHEventsAccepted(o.fHEventsAccepted),
101 fHEventsAcceptedXY(o.fHEventsAcceptedXY),
102 fHTriggers(o.fHTriggers),
106 fHCentVsQual(o.fHCentVsQual),
107 fLowFluxCut(o.fLowFluxCut),
108 fMaxVzErr(o.fMaxVzErr),
112 fCollisionSystem(o.fCollisionSystem),
115 fVtxAxis(o.fVtxAxis),
116 fUseFirstPhysicsVertex(o.fUseFirstPhysicsVertex)
122 // o Object to copy from
126 //____________________________________________________________________
127 AliFMDEventInspector::~AliFMDEventInspector()
132 if (fList) delete fList;
134 //____________________________________________________________________
135 AliFMDEventInspector&
136 AliFMDEventInspector::operator=(const AliFMDEventInspector& o)
139 // Assignement operator
142 // o Object to assign from
145 // Reference to this object
147 TNamed::operator=(o);
148 fHEventsTr = o.fHEventsTr;
149 fHEventsTrVtx = o.fHEventsTrVtx;
150 fHEventsAccepted = o.fHEventsAccepted;
151 fHEventsAcceptedXY = o.fHEventsAcceptedXY;
152 fHTriggers = o.fHTriggers;
156 fHCentVsQual = o.fHCentVsQual;
157 fLowFluxCut = o.fLowFluxCut;
158 fMaxVzErr = o.fMaxVzErr;
160 fList = (o.fList ? new TList : 0);
163 fCollisionSystem = o.fCollisionSystem;
164 fVtxAxis.Set(o.fVtxAxis.GetNbins(), o.fVtxAxis.GetXmin(),
165 o.fVtxAxis.GetXmax());
167 fUseFirstPhysicsVertex = o.fUseFirstPhysicsVertex;
170 fList->SetName(GetName());
171 if (fHEventsTr) fList->Add(fHEventsTr);
172 if (fHEventsTrVtx) fList->Add(fHEventsTrVtx);
173 if (fHTriggers) fList->Add(fHTriggers);
174 if (fHType) fList->Add(fHType);
175 if (fHWords) fList->Add(fHWords);
176 if (fHCent) fList->Add(fHCent);
177 if (fHCentVsQual) fList->Add(fHCentVsQual);
182 //____________________________________________________________________
184 AliFMDEventInspector::FetchHistograms(const TList* d,
187 TH1I*& hTriggers) const
190 // Fetch our histograms from the passed list
194 // hEventsTr On return, pointer to histogram, or null
195 // hEventsTrVtx On return, pointer to histogram, or null
196 // hTriggers On return, pointer to histogram, or null
199 // true on success, false otherwise
204 TList* dd = dynamic_cast<TList*>(d->FindObject(GetName()));
205 if (!dd) return kFALSE;
207 hEventsTr = dynamic_cast<TH1I*>(dd->FindObject("nEventsTr"));
208 hEventsTrVtx = dynamic_cast<TH1I*>(dd->FindObject("nEventsTrVtx"));
209 hTriggers = dynamic_cast<TH1I*>(dd->FindObject("triggers"));
211 if (!hEventsTr || !hEventsTrVtx || !hTriggers) return kFALSE;
214 //____________________________________________________________________
216 AliFMDEventInspector::Init(const TAxis& vtxAxis)
219 // Initialize the object
222 // vtxAxis Vertex axis in use
225 // -1.5 -0.5 0.5 1.5 ... 89.5 ... 100.5
226 // ----- 92 number --------- ---- 1 ---
228 for (Int_t i = 0; i < 92; i++) limits[i] = -1.5 + i;
231 fVtxAxis.Set(vtxAxis.GetNbins(), vtxAxis.GetXmin(), vtxAxis.GetXmax());
233 fCentAxis = new TAxis(limits.GetSize()-1, limits.GetArray());
234 fHEventsTr = new TH1I("nEventsTr", "Number of events w/trigger",
235 4*vtxAxis.GetNbins(),
237 2*vtxAxis.GetXmax());
238 fHEventsTr->SetXTitle("v_{z} [cm]");
239 fHEventsTr->SetYTitle("# of events");
240 fHEventsTr->SetFillColor(kRed+1);
241 fHEventsTr->SetFillStyle(3001);
242 fHEventsTr->SetDirectory(0);
243 // fHEventsTr->Sumw2();
244 fList->Add(fHEventsTr);
246 fHEventsTrVtx = static_cast<TH1I*>(fHEventsTr->Clone("nEventsTrVtx"));
247 fHEventsTrVtx->SetTitle("Number of events w/trigger and vertex");
248 fHEventsTrVtx->SetFillColor(kBlue+1);
249 fHEventsTrVtx->SetDirectory(0);
250 // fHEventsTrVtx->Sumw2();
251 fList->Add(fHEventsTrVtx);
253 fHEventsAccepted = new TH1I("nEventsAccepted",
254 "Number of events w/trigger and vertex in range",
255 2*vtxAxis.GetNbins(),
257 2*vtxAxis.GetXmax());
258 fHEventsAccepted->SetXTitle("v_{z} [cm]");
259 fHEventsAccepted->SetYTitle("# of events");
260 fHEventsAccepted->SetFillColor(kGreen+1);
261 fHEventsAccepted->SetFillStyle(3001);
262 fHEventsAccepted->SetDirectory(0);
263 // fHEventsAccepted->Sumw2();
264 fList->Add(fHEventsAccepted);
266 fHEventsAcceptedXY = new TH2D("nEventsAcceptedXY",
267 "XY vertex w/trigger and Z vertex in range",
268 1000,-1,1,1000,-1,1);
270 fHEventsAcceptedXY->SetXTitle("v_{x} [cm]");
271 fHEventsAcceptedXY->SetYTitle("v_{y} [cm]");
272 fHEventsAcceptedXY->SetDirectory(0);
273 // fHEventsAccepted->Sumw2();
274 fList->Add(fHEventsAcceptedXY);
277 fHTriggers = new TH1I("triggers", "Triggers", kOffline+1, 0, kOffline+1);
278 fHTriggers->SetFillColor(kRed+1);
279 fHTriggers->SetFillStyle(3001);
280 fHTriggers->SetStats(0);
281 fHTriggers->SetDirectory(0);
282 fHTriggers->GetXaxis()->SetBinLabel(kInel +1,"INEL");
283 fHTriggers->GetXaxis()->SetBinLabel(kInelGt0+1,"INEL>0");
284 fHTriggers->GetXaxis()->SetBinLabel(kNSD +1,"NSD");
285 fHTriggers->GetXaxis()->SetBinLabel(kEmpty +1,"Empty");
286 fHTriggers->GetXaxis()->SetBinLabel(kA +1,"A");
287 fHTriggers->GetXaxis()->SetBinLabel(kB +1,"B");
288 fHTriggers->GetXaxis()->SetBinLabel(kC +1,"C");
289 fHTriggers->GetXaxis()->SetBinLabel(kE +1,"E");
290 fHTriggers->GetXaxis()->SetBinLabel(kPileUp +1,"Pileup");
291 fHTriggers->GetXaxis()->SetBinLabel(kMCNSD +1,"NSD_{MC}");
292 fHTriggers->GetXaxis()->SetBinLabel(kOffline+1,"Offline");
293 fList->Add(fHTriggers);
295 fHType = new TH1I("type", Form("Event type (cut: SPD mult>%d)",
296 fLowFluxCut), 2, -.5, 1.5);
297 fHType->SetFillColor(kRed+1);
298 fHType->SetFillStyle(3001);
300 fHType->SetDirectory(0);
301 fHType->GetXaxis()->SetBinLabel(1,"Low-flux");
302 fHType->GetXaxis()->SetBinLabel(2,"High-flux");
306 // This histogram disabled as it causes problems in the merge
307 fHWords = new TH1I("words", "Trigger words seen", 1, 0, 0);
308 fHWords->SetFillColor(kBlue+1);
309 fHWords->SetFillStyle(3001);
310 fHWords->SetStats(0);
311 fHWords->SetDirectory(0);
312 fHWords->SetBit(TH1::kCanRebin);
316 fHCent = new TH1F("cent", "Centrality", limits.GetSize()-1,limits.GetArray());
317 fHCent->SetFillColor(kBlue+1);
318 fHCent->SetFillStyle(3001);
320 fHCent->SetDirectory(0);
321 fHCent->SetXTitle("Centrality [%]");
322 fHCent->SetYTitle("Events");
325 fHCentVsQual = new TH2F("centVsQuality", "Quality vs Centrality",
326 5, 0, 5, limits.GetSize()-1, limits.GetArray());
327 fHCentVsQual->SetXTitle("Quality");
328 fHCentVsQual->SetYTitle("Centrality [%]");
329 fHCentVsQual->SetZTitle("Events");
330 fHCentVsQual->GetXaxis()->SetBinLabel(1, "OK");
331 fHCentVsQual->GetXaxis()->SetBinLabel(2, "Outside v_{z} cut");
332 fHCentVsQual->GetXaxis()->SetBinLabel(3, "V0 vs SPD outlier");
333 fHCentVsQual->GetXaxis()->SetBinLabel(4, "V0 vs TPC outlier");
334 fHCentVsQual->GetXaxis()->SetBinLabel(5, "V0 vs ZDC outlier");
335 fList->Add(fHCentVsQual);
338 //____________________________________________________________________
340 AliFMDEventInspector::StoreInformation()
342 // Write TNamed objects to output list containing information about
343 // the running conditions
346 TNamed* sys = new TNamed("sys", "");
347 TNamed* sNN = new TNamed("sNN", "");
348 TNamed* fld = new TNamed("field", "");
349 sys->SetTitle(AliForwardUtil::CollisionSystemString(fCollisionSystem));
350 sNN->SetTitle(AliForwardUtil::CenterOfMassEnergyString(fEnergy));
351 fld->SetTitle(AliForwardUtil::MagneticFieldString(fField));
352 sys->SetUniqueID(fCollisionSystem);
353 sNN->SetUniqueID(fEnergy);
354 fld->SetUniqueID(fField);
361 //____________________________________________________________________
363 AliFMDEventInspector::DefineOutput(TList* dir)
366 // Define the output histograms. These are put in a sub list of the
367 // passed list. The histograms are merged before the parent task calls
368 // AliAnalysisTaskSE::Terminate
370 // dir Directory to add to
373 fList->SetName(GetName());
377 //____________________________________________________________________
379 AliFMDEventInspector::Process(const AliESDEvent* event,
392 // triggers On return, the triggers fired
393 // lowFlux On return, true if the event is considered a low-flux
394 // event (according to the setting of fLowFluxCut)
395 // ivz On return, the found vertex bin (1-based). A zero
396 // means outside of the defined vertex range
397 // vz On return, the z position of the interaction
398 // cent On return, the centrality - if not available < 0
401 // 0 (or kOk) on success, otherwise a bit mask of error codes
404 // --- Check that we have an event ---------------------------------
406 AliWarning("No ESD event found for input event");
410 // --- Read trigger information from the ESD and store in AOD object
411 if (!ReadTriggers(event, triggers, nClusters)) {
413 AliWarning("Failed to read triggers from ESD"); }
417 // --- Check if this is a high-flux event --------------------------
418 const AliMultiplicity* testmult = event->GetMultiplicity();
421 AliWarning("No central multiplicity object found"); }
424 lowFlux = testmult->GetNumberOfTracklets() < fLowFluxCut;
426 fHType->Fill(lowFlux ? 0 : 1);
428 // --- Read centrality information
431 if (!ReadCentrality(event, cent, qual)) {
433 AliWarning("Failed to get centrality");
436 if (qual == 0) fHCentVsQual->Fill(0., cent);
438 for (UShort_t i = 0; i < 4; i++)
439 if (qual & (1 << i)) fHCentVsQual->Fill(Double_t(i+1), cent);
442 // --- Get the vertex information ----------------------------------
448 Bool_t vzOk = ReadVertex(event, vz,vx,vy);
450 fHEventsTr->Fill(vz);
453 AliWarning("Failed to read vertex from ESD"); }
456 fHEventsTrVtx->Fill(vz);
458 // --- Get the vertex bin ------------------------------------------
459 ivz = fVtxAxis.FindBin(vz);
460 if (ivz <= 0 || ivz > fVtxAxis.GetNbins()) {
462 AliWarning(Form("Vertex @ %f outside of range [%f,%f]",
463 vz, fVtxAxis.GetXmin(), fVtxAxis.GetXmax()));
468 fHEventsAccepted->Fill(vz);
469 fHEventsAcceptedXY->Fill(vx,vy);
471 // --- Check the FMD ESD data --------------------------------------
472 if (!event->GetFMDData()) {
474 AliWarning("No FMD data found in ESD"); }
482 //____________________________________________________________________
484 AliFMDEventInspector::ReadCentrality(const AliESDEvent* esd,
486 UShort_t& qual) const
489 // Read centrality from event
493 // cent On return, the centrality or negative if not found
496 // False on error, true otherwise
500 AliCentrality* centObj = const_cast<AliESDEvent*>(esd)->GetCentrality();
501 if (!centObj) return true;
503 // AliInfo(Form("Got centrality object %p with quality %d",
504 // centObj, centObj->GetQuality()));
506 cent = centObj->GetCentralityPercentile("V0M");
507 //cent = centObj->GetCentralityPercentile("ZEMvsZDC");
508 qual = centObj->GetQuality();
513 //____________________________________________________________________
515 AliFMDEventInspector::ReadTriggers(const AliESDEvent* esd, UInt_t& triggers,
519 // Read the trigger information from the ESD event
523 // triggers On return, contains the trigger bits
526 // @c true on success, @c false otherwise
530 // Get the analysis manager - should always be there
531 AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager();
533 AliWarning("No analysis manager defined!");
537 // Get the input handler - should always be there
538 AliInputEventHandler* ih =
539 static_cast<AliInputEventHandler*>(am->GetInputEventHandler());
541 AliWarning("No input handler");
545 // Check if this is a collision candidate (MB)
546 // Note, that we should use the value cached in the input
547 // handler rather than calling IsCollisionCandiate directly
548 // on the AliPhysicsSelection obejct. If we called the latter
549 // then the AliPhysicsSelection object would overcount by a
551 Bool_t offline = ih->IsEventSelected() ;
552 Bool_t fastonly = (ih->IsEventSelected() & AliVEvent::kFastOnly);
553 TString trigStr = esd->GetFiredTriggerClasses();
555 //If we have the MC input handler, this must be MC
556 Bool_t isMC = am->GetMCtruthEventHandler() != 0;
558 // For the 2.76 TeV p+p run, the FMD ran in the slow partition
559 // so it received no triggers from the fast partition. Therefore
560 // the fast triggers are removed here but not for MC where all
561 // triggers are fast.
562 if(TMath::Abs(fEnergy - 2750.) < 20 &&
563 fCollisionSystem == AliForwardUtil::kPP &&
565 if (fastonly) offline = false;
568 // MUON triggers are not strictly minimum bias (MB) so they are removed (HHD)
570 if(offline && trigStr.Contains("CMUS1")) offline = false;
573 triggers |= AliAODForwardMult::kOffline;
574 triggers |= AliAODForwardMult::kInel;
575 fHTriggers->Fill(kOffline+0.5);
577 // If this is inel, see if we have a tracklet
578 const AliMultiplicity* spdmult = esd->GetMultiplicity();
580 AliWarning("No SPD multiplicity");
583 // Check if we have one or more tracklets
584 // in the range -1 < eta < 1 to set the INEL>0
587 // Also count tracklets as a single cluster
588 Int_t n = spdmult->GetNumberOfTracklets();
589 for (Int_t j = 0; j < n; j++) {
590 if(TMath::Abs(spdmult->GetEta(j)) < 1) {
591 triggers |= AliAODForwardMult::kInelGt0;
595 n = spdmult->GetNumberOfSingleClusters();
596 for (Int_t j = 0; j < n; j++) {
597 Double_t eta = -TMath::Log(TMath::Tan(spdmult->GetThetaSingle(j)/2.));
598 if (TMath::Abs(eta) < 1) nClusters++;
601 if (nClusters > 0) triggers |= AliAODForwardMult::kNClusterGt0;
604 // Analyse some trigger stuff
605 AliTriggerAnalysis ta;
606 if (ta.IsOfflineTriggerFired(esd, AliTriggerAnalysis::kNSD1))
607 triggers |= AliAODForwardMult::kNSD;
609 // Check for multiple vertices (pile-up) with at least 3
610 // contributors and at least 0.8cm from the primary vertex
611 Bool_t pileup = kFALSE;
612 if(fCollisionSystem == AliForwardUtil::kPP)
613 pileup = esd->IsPileupFromSPD(3,0.8);
615 triggers |= AliAODForwardMult::kPileUp;
616 fHTriggers->Fill(kPileUp+.5);
621 //TString trigStr = esd->GetFiredTriggerClasses();
622 // AliWarning(Form("Fired trigger classes: %s", trigStr.Data()));
623 if (fHWords) fHWords->Fill(trigStr.Data(), 1);
625 if (trigStr.Contains("MB1") || trigStr.Contains("MBBG3"))
626 triggers |= AliAOODForwardMult::kB;
627 if (trigStr.Contains("COTA"))
628 triggers |= AliAODForwardMult::kA;
629 if (trigStr.Contains("COTC"))
630 triggers |= AliAODForwardMult::kC;
632 if (trigStr.Contains("CBEAMB-ABCE-NOPF-ALL")) {
633 triggers |= AliAODForwardMult::kEmpty;
634 fHTriggers->Fill(kEmpty+.5);
637 // Check for B triggers
638 if (trigStr.Contains("CINT1B-ABCE-NOPF-ALL") || // Early pp
639 trigStr.Contains("CINT1-B-NOPF-ALLNOTRD") || // Late pp
640 trigStr.Contains("CINT1-B-NOPF-FASTNOTRD") || // Late pp
641 //trigStr.Contains("CMUS1-B-NOPF-MUON") || // Late pp -- HHD 160811
642 trigStr.Contains("CSMBB-ABCE-NOPF-ALL") || // pp
643 trigStr.Contains("CMBACS2-B-NOPF-ALL") || // PbPb
644 // trigStr.Contains("C0SMH-B-NOPF-ALL") || // PbPb - high mult
645 trigStr.Contains("CMBS2A-B-NOPF-ALL") || // PbPb
646 trigStr.Contains("CMBS2C-B-NOPF-ALL") || // PbPb
647 trigStr.Contains("CMBAC-B-NOPF-ALL") || // PbPb
648 // trigStr.Contains("C0SMH-B-NOPF-ALL") || // PbPb - high mult
649 trigStr.Contains("CMBACS2-B-NOPF-ALLNOTRD") // PbPb
650 // trigStr.Contains("C0SMH-B-NOPF-ALLNOTRD") // PbPb - high mult
652 Bool_t bTrigger = kTRUE;
653 if ( trigStr.Contains("CINT1-B-NOPF-FASTNOTRD") &&
654 !trigStr.Contains("CINT1-B-NOPF-ALLNOTRD") &&
655 TMath::Abs(fEnergy - 2750.) < 20 &&
656 fCollisionSystem == AliForwardUtil::kPP)
659 triggers |= AliAODForwardMult::kB;
660 fHTriggers->Fill(kB+.5);
664 // Check for A triggers
665 if (trigStr.Contains("CINT1A-ABCE-NOPF-ALL") || // Early pp
666 trigStr.Contains("CINT1-AC-NOPF-ALLNOTRD") || // Late pp
667 trigStr.Contains("CINT1-AC-NOPF-FASTNOTRD") || // Late pp
668 (trigStr.Contains("CSMBA-ABCE-NOPF-ALL") &&
669 !(triggers & AliAODForwardMult::kB)) || // pp
670 trigStr.Contains("CMBACS2-A-NOPF-ALL") || // PbPb
671 // trigStr.Contains("C0SMH-A-NOPF-ALL") || // PbPb - high mult
672 trigStr.Contains("CMBS2A-A-NOPF-ALL") || // PbPb
673 trigStr.Contains("CMBS2C-A-NOPF-ALL") || // PbPb
674 trigStr.Contains("CMBAC-A-NOPF-ALL") || // PbPb
675 // trigStr.Contains("C0SMH-A-NOPF-ALL") || // PbPb - high mult
676 trigStr.Contains("CMBACS2-A-NOPF-ALLNOTRD") // PbPb
677 // trigStr.Contains("C0SMH-A-NOPF-ALLNOTRD") // PbPb - high mult
679 triggers |= AliAODForwardMult::kA;
680 fHTriggers->Fill(kA+.5);
683 // Check for C triggers
684 if (trigStr.Contains("CINT1C-ABCE-NOPF-ALL") || // Early pp
685 (trigStr.Contains("CSMBC-ABCE-NOPF-ALL") &&
686 !(triggers & AliAODForwardMult::kB)) || // pp
687 trigStr.Contains("CMBACS2-C-NOPF-ALL") || // PbPb
688 // trigStr.Contains("C0SMH-B-NOPF-ALL") || // PbPb - high mult
689 trigStr.Contains("CMBS2A-C-NOPF-ALL") || // PbPb
690 trigStr.Contains("CMBS2C-C-NOPF-ALL") || // PbPb
691 trigStr.Contains("CMBAC-C-NOPF-ALL") || // PbPb
692 // trigStr.Contains("C0SMH-B-NOPF-ALL") || // PbPb - high mult
693 trigStr.Contains("CMBACS2-C-NOPF-ALLNOTRD") // PbPb
694 // trigStr.Contains("C0SMH-B-NOPF-ALLNOTRD") // PbPb - high mult
696 triggers |= AliAODForwardMult::kC;
697 fHTriggers->Fill(kC+.5);
700 // Check for E triggers
701 if (trigStr.Contains("CINT1-E-NOPF-ALL") || // Early pp
702 trigStr.Contains("CINT1-E-NOPF-ALLNOTRD") || // Late pp
703 trigStr.Contains("CINT1-E-NOPF-FASTNOTRD") || // Late pp
704 trigStr.Contains("CMBACS2-E-NOPF-ALL") || // PbPb
705 // trigStr.Contains("C0SMH-B-NOPF-ALL") || // PbPb - high mult
706 trigStr.Contains("CMBS2A-E-NOPF-ALL") || // PbPb
707 trigStr.Contains("CMBS2C-E-NOPF-ALL") || // PbPb
708 trigStr.Contains("CMBAC-E-NOPF-ALL") || // PbPb
709 // trigStr.Contains("C0SMH-B-NOPF-ALL") || // PbPb - high mult
710 trigStr.Contains("CMBACS2-E-NOPF-ALLNOTRD") // PbPb
711 // trigStr.Contains("C0SMH-B-NOPF-ALLNOTRD") // PbPb - high mult
713 triggers |= AliAODForwardMult::kE;
714 fHTriggers->Fill(kE+.5);
717 // Now check - if we have a collision - for offline triggers and
719 if (triggers & AliAODForwardMult::kB) {
720 if (triggers & AliAODForwardMult::kInel)
721 fHTriggers->Fill(kInel);
723 if (triggers & AliAODForwardMult::kInelGt0)
724 fHTriggers->Fill(kInelGt0+.5);
726 if (triggers & AliAODForwardMult::kNSD)
727 fHTriggers->Fill(kNSD+.5);
732 //____________________________________________________________________
734 AliFMDEventInspector::ReadVertex(const AliESDEvent* esd,
740 // Read the vertex information from the ESD event
744 // vz On return, the vertex Z position
747 // @c true on success, @c false otherwise
752 if(fUseFirstPhysicsVertex) {
753 // This is the code used by the 1st physics people
754 const AliESDVertex* vertex = esd->GetPrimaryVertex();
755 if (!vertex || !vertex->GetStatus()) {
757 AliWarning(Form("No primary vertex (%p) or bad status %d",
758 vertex, (vertex ? vertex->GetStatus() : -1)));
762 const AliESDVertex* vertexSPD = esd->GetPrimaryVertexSPD();
763 if (!vertexSPD || !vertexSPD->GetStatus()) {
765 AliWarning(Form("No primary SPD vertex (%p) or bad status %d",
766 vertexSPD, (vertexSPD ? vertexSPD->GetStatus() : -1)));
771 // if vertex is from SPD vertexZ, require more stringent cuts
772 if (vertex->IsFromVertexerZ()) {
773 if (vertex->GetDispersion() > fMaxVzErr ||
774 vertex->GetZRes() > 1.25 * fMaxVzErr) {
776 AliWarning(Form("Dispersion %f > %f or resolution %f > %f",
777 vertex->GetDispersion(), fMaxVzErr,
778 vertex->GetZRes(), 1.25 * fMaxVzErr));
785 if(!vertex->IsFromVertexerZ()) {
791 else { //Use standard SPD vertex (perhaps preferable for Pb+Pb)
794 const AliESDVertex* vertex = esd->GetPrimaryVertexSPD();
797 AliWarning("No SPD vertex found in ESD"); }
801 // Check that enough tracklets contributed
802 if(vertex->GetNContributors() <= 0) {
804 AliWarning(Form("Number of contributors to vertex is %d<=0",
805 vertex->GetNContributors())); }
809 // Check that the uncertainty isn't too large
810 if (vertex->GetZRes() > fMaxVzErr) {
812 AliWarning(Form("Uncertaintity in Z of vertex is too large %f > %f",
813 vertex->GetZRes(), fMaxVzErr)); }
817 // Get the z coordiante
819 const AliESDVertex* vertexXY = esd->GetPrimaryVertex();
821 if(!vertexXY->IsFromVertexerZ()) {
822 vx = vertexXY->GetX();
823 vy = vertexXY->GetY();
829 //____________________________________________________________________
831 AliFMDEventInspector::ReadRunDetails(const AliESDEvent* esd)
834 // Read the collision system, collision energy, and L3 field setting
838 // esd ESD to get information from
841 // true on success, false
843 // AliInfo(Form("Parameters from 1st ESD event: cms=%s, sNN=%f, field=%f",
844 // esd->GetBeamType(), 2*esd->GetBeamEnergy(),
845 // esd->GetMagneticField()));
847 AliForwardUtil::ParseCollisionSystem(esd->GetBeamType());
849 AliForwardUtil::ParseCenterOfMassEnergy(fCollisionSystem,
850 2 * esd->GetBeamEnergy());
852 AliForwardUtil::ParseMagneticField(esd->GetMagneticField());
855 if (fCollisionSystem == AliForwardUtil::kUnknown ||
857 TMath::Abs(fField) > 10)
863 //____________________________________________________________________
865 AliFMDEventInspector::Print(Option_t*) const
872 char ind[gROOT->GetDirLevel()+1];
873 for (Int_t i = 0; i < gROOT->GetDirLevel(); i++) ind[i] = ' ';
874 ind[gROOT->GetDirLevel()] = '\0';
875 TString sNN(AliForwardUtil::CenterOfMassEnergyString(fEnergy));
876 sNN.Strip(TString::kBoth, '0');
877 sNN.ReplaceAll("GeV", " GeV");
878 TString field(AliForwardUtil::MagneticFieldString(fField));
879 field.ReplaceAll("p", "+");
880 field.ReplaceAll("m", "-");
881 field.ReplaceAll("kG", " kG");
883 std::cout << ind << ClassName() << ": " << GetName() << '\n'
884 << ind << " Vertex bins: " << fVtxAxis.GetNbins() << '\n'
885 << ind << " Vertex range: [" << fVtxAxis.GetXmin()
886 << "," << fVtxAxis.GetXmax() << "]\n"
887 << ind << " Low flux cut: " << fLowFluxCut << '\n'
888 << ind << " Max(delta v_z): " << fMaxVzErr << " cm\n"
889 << ind << " System: "
890 << AliForwardUtil::CollisionSystemString(fCollisionSystem) << '\n'
891 << ind << " CMS energy per nucleon: " << sNN << '\n'
892 << ind << " Field: " << field << '\n';
893 if (!fCentAxis) { std::cout << std::flush; return; }
894 Int_t nBin = fCentAxis->GetNbins();
895 std::cout << ind << " Centrality axis: " << nBin << " bins"
897 for (Int_t i = 0; i < nBin; i++) {
898 if ((i % 10) == 0) std::cout << '\n' << ind << " ";
899 std::cout << std::setw(5) << fCentAxis->GetBinLowEdge(i+1) << '-';
901 std::cout << std::setw(5) << fCentAxis->GetBinUpEdge(nBin) << std::endl;