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),
65 //____________________________________________________________________
66 AliFMDEventInspector::AliFMDEventInspector(const char* name)
67 : TNamed("fmdEventInspector", name),
71 fHEventsAcceptedXY(0),
82 fCollisionSystem(kUnknown),
86 fUseFirstPhysicsVertex(true),
93 // name Name of object
97 //____________________________________________________________________
98 AliFMDEventInspector::AliFMDEventInspector(const AliFMDEventInspector& o)
100 fHEventsTr(o.fHEventsTr),
101 fHEventsTrVtx(o.fHEventsTrVtx),
102 fHEventsAccepted(o.fHEventsAccepted),
103 fHEventsAcceptedXY(o.fHEventsAcceptedXY),
104 fHTriggers(o.fHTriggers),
108 fHCentVsQual(o.fHCentVsQual),
109 fLowFluxCut(o.fLowFluxCut),
110 fMaxVzErr(o.fMaxVzErr),
114 fCollisionSystem(o.fCollisionSystem),
117 fVtxAxis(o.fVtxAxis),
118 fUseFirstPhysicsVertex(o.fUseFirstPhysicsVertex),
119 fUseV0AND(o.fUseV0AND)
125 // o Object to copy from
129 //____________________________________________________________________
130 AliFMDEventInspector::~AliFMDEventInspector()
135 if (fList) delete fList;
137 //____________________________________________________________________
138 AliFMDEventInspector&
139 AliFMDEventInspector::operator=(const AliFMDEventInspector& o)
142 // Assignement operator
145 // o Object to assign from
148 // Reference to this object
150 if (&o == this) return *this;
151 TNamed::operator=(o);
152 fHEventsTr = o.fHEventsTr;
153 fHEventsTrVtx = o.fHEventsTrVtx;
154 fHEventsAccepted = o.fHEventsAccepted;
155 fHEventsAcceptedXY = o.fHEventsAcceptedXY;
156 fHTriggers = o.fHTriggers;
160 fHCentVsQual = o.fHCentVsQual;
161 fLowFluxCut = o.fLowFluxCut;
162 fMaxVzErr = o.fMaxVzErr;
164 fList = (o.fList ? new TList : 0);
167 fCollisionSystem = o.fCollisionSystem;
168 fVtxAxis.Set(o.fVtxAxis.GetNbins(), o.fVtxAxis.GetXmin(),
169 o.fVtxAxis.GetXmax());
171 fUseFirstPhysicsVertex = o.fUseFirstPhysicsVertex;
172 fUseV0AND = o.fUseV0AND;
175 fList->SetName(GetName());
176 if (fHEventsTr) fList->Add(fHEventsTr);
177 if (fHEventsTrVtx) fList->Add(fHEventsTrVtx);
178 if (fHTriggers) fList->Add(fHTriggers);
179 if (fHType) fList->Add(fHType);
180 if (fHWords) fList->Add(fHWords);
181 if (fHCent) fList->Add(fHCent);
182 if (fHCentVsQual) fList->Add(fHCentVsQual);
187 //____________________________________________________________________
189 AliFMDEventInspector::FetchHistograms(const TList* d,
192 TH1I*& hTriggers) const
195 // Fetch our histograms from the passed list
199 // hEventsTr On return, pointer to histogram, or null
200 // hEventsTrVtx On return, pointer to histogram, or null
201 // hTriggers On return, pointer to histogram, or null
204 // true on success, false otherwise
209 TList* dd = dynamic_cast<TList*>(d->FindObject(GetName()));
210 if (!dd) return kFALSE;
212 hEventsTr = dynamic_cast<TH1I*>(dd->FindObject("nEventsTr"));
213 hEventsTrVtx = dynamic_cast<TH1I*>(dd->FindObject("nEventsTrVtx"));
214 hTriggers = dynamic_cast<TH1I*>(dd->FindObject("triggers"));
216 if (!hEventsTr || !hEventsTrVtx || !hTriggers) return kFALSE;
219 //____________________________________________________________________
221 AliFMDEventInspector::Init(const TAxis& vtxAxis)
224 // Initialize the object
227 // vtxAxis Vertex axis in use
230 // -1.5 -0.5 0.5 1.5 ... 89.5 ... 100.5
231 // ----- 92 number --------- ---- 1 ---
233 for (Int_t i = 0; i < 92; i++) limits[i] = -1.5 + i;
236 fVtxAxis.Set(vtxAxis.GetNbins(), vtxAxis.GetXmin(), vtxAxis.GetXmax());
238 fCentAxis = new TAxis(limits.GetSize()-1, limits.GetArray());
239 fHEventsTr = new TH1I("nEventsTr", "Number of events w/trigger",
240 4*vtxAxis.GetNbins(),
242 2*vtxAxis.GetXmax());
243 fHEventsTr->SetXTitle("v_{z} [cm]");
244 fHEventsTr->SetYTitle("# of events");
245 fHEventsTr->SetFillColor(kRed+1);
246 fHEventsTr->SetFillStyle(3001);
247 fHEventsTr->SetDirectory(0);
248 // fHEventsTr->Sumw2();
249 fList->Add(fHEventsTr);
251 fHEventsTrVtx = static_cast<TH1I*>(fHEventsTr->Clone("nEventsTrVtx"));
252 fHEventsTrVtx->SetTitle("Number of events w/trigger and vertex");
253 fHEventsTrVtx->SetFillColor(kBlue+1);
254 fHEventsTrVtx->SetDirectory(0);
255 // fHEventsTrVtx->Sumw2();
256 fList->Add(fHEventsTrVtx);
258 fHEventsAccepted = new TH1I("nEventsAccepted",
259 "Number of events w/trigger and vertex in range",
260 2*vtxAxis.GetNbins(),
262 2*vtxAxis.GetXmax());
263 fHEventsAccepted->SetXTitle("v_{z} [cm]");
264 fHEventsAccepted->SetYTitle("# of events");
265 fHEventsAccepted->SetFillColor(kGreen+1);
266 fHEventsAccepted->SetFillStyle(3001);
267 fHEventsAccepted->SetDirectory(0);
268 // fHEventsAccepted->Sumw2();
269 fList->Add(fHEventsAccepted);
271 fHEventsAcceptedXY = new TH2D("nEventsAcceptedXY",
272 "XY vertex w/trigger and Z vertex in range",
273 1000,-1,1,1000,-1,1);
275 fHEventsAcceptedXY->SetXTitle("v_{x} [cm]");
276 fHEventsAcceptedXY->SetYTitle("v_{y} [cm]");
277 fHEventsAcceptedXY->SetDirectory(0);
278 // fHEventsAccepted->Sumw2();
279 fList->Add(fHEventsAcceptedXY);
282 fHTriggers = new TH1I("triggers", "Triggers", kOffline+1, 0, kOffline+1);
283 fHTriggers->SetFillColor(kRed+1);
284 fHTriggers->SetFillStyle(3001);
285 fHTriggers->SetStats(0);
286 fHTriggers->SetDirectory(0);
287 fHTriggers->GetXaxis()->SetBinLabel(kInel +1,"INEL");
288 fHTriggers->GetXaxis()->SetBinLabel(kInelGt0+1,"INEL>0");
289 fHTriggers->GetXaxis()->SetBinLabel(kNSD +1,"NSD");
290 fHTriggers->GetXaxis()->SetBinLabel(kEmpty +1,"Empty");
291 fHTriggers->GetXaxis()->SetBinLabel(kA +1,"A");
292 fHTriggers->GetXaxis()->SetBinLabel(kB +1,"B");
293 fHTriggers->GetXaxis()->SetBinLabel(kC +1,"C");
294 fHTriggers->GetXaxis()->SetBinLabel(kE +1,"E");
295 fHTriggers->GetXaxis()->SetBinLabel(kPileUp +1,"Pileup");
296 fHTriggers->GetXaxis()->SetBinLabel(kMCNSD +1,"NSD_{MC}");
297 fHTriggers->GetXaxis()->SetBinLabel(kOffline+1,"Offline");
298 fList->Add(fHTriggers);
300 fHType = new TH1I("type", Form("Event type (cut: SPD mult>%d)",
301 fLowFluxCut), 2, -.5, 1.5);
302 fHType->SetFillColor(kRed+1);
303 fHType->SetFillStyle(3001);
305 fHType->SetDirectory(0);
306 fHType->GetXaxis()->SetBinLabel(1,"Low-flux");
307 fHType->GetXaxis()->SetBinLabel(2,"High-flux");
311 // This histogram disabled as it causes problems in the merge
312 fHWords = new TH1I("words", "Trigger words seen", 1, 0, 0);
313 fHWords->SetFillColor(kBlue+1);
314 fHWords->SetFillStyle(3001);
315 fHWords->SetStats(0);
316 fHWords->SetDirectory(0);
317 fHWords->SetBit(TH1::kCanRebin);
321 fHCent = new TH1F("cent", "Centrality", limits.GetSize()-1,limits.GetArray());
322 fHCent->SetFillColor(kBlue+1);
323 fHCent->SetFillStyle(3001);
325 fHCent->SetDirectory(0);
326 fHCent->SetXTitle("Centrality [%]");
327 fHCent->SetYTitle("Events");
330 fHCentVsQual = new TH2F("centVsQuality", "Quality vs Centrality",
331 5, 0, 5, limits.GetSize()-1, limits.GetArray());
332 fHCentVsQual->SetXTitle("Quality");
333 fHCentVsQual->SetYTitle("Centrality [%]");
334 fHCentVsQual->SetZTitle("Events");
335 fHCentVsQual->GetXaxis()->SetBinLabel(1, "OK");
336 fHCentVsQual->GetXaxis()->SetBinLabel(2, "Outside v_{z} cut");
337 fHCentVsQual->GetXaxis()->SetBinLabel(3, "V0 vs SPD outlier");
338 fHCentVsQual->GetXaxis()->SetBinLabel(4, "V0 vs TPC outlier");
339 fHCentVsQual->GetXaxis()->SetBinLabel(5, "V0 vs ZDC outlier");
340 fList->Add(fHCentVsQual);
343 //____________________________________________________________________
345 AliFMDEventInspector::StoreInformation(Int_t runNo)
347 // Write TNamed objects to output list containing information about
348 // the running conditions
351 TNamed* sys = new TNamed("sys", "");
352 TNamed* sNN = new TNamed("sNN", "");
353 TNamed* fld = new TNamed("field", "");
354 TNamed* run = new TNamed("runNo", Form("%d", runNo));
355 sys->SetTitle(AliForwardUtil::CollisionSystemString(fCollisionSystem));
356 sNN->SetTitle(AliForwardUtil::CenterOfMassEnergyString(fEnergy));
357 fld->SetTitle(AliForwardUtil::MagneticFieldString(fField));
358 sys->SetUniqueID(fCollisionSystem);
359 sNN->SetUniqueID(fEnergy);
360 fld->SetUniqueID(fField);
361 run->SetUniqueID(runNo);
369 //____________________________________________________________________
371 AliFMDEventInspector::DefineOutput(TList* dir)
374 // Define the output histograms. These are put in a sub list of the
375 // passed list. The histograms are merged before the parent task calls
376 // AliAnalysisTaskSE::Terminate
378 // dir Directory to add to
381 fList->SetName(GetName());
385 //____________________________________________________________________
387 AliFMDEventInspector::Process(const AliESDEvent* event,
400 // triggers On return, the triggers fired
401 // lowFlux On return, true if the event is considered a low-flux
402 // event (according to the setting of fLowFluxCut)
403 // ivz On return, the found vertex bin (1-based). A zero
404 // means outside of the defined vertex range
405 // vz On return, the z position of the interaction
406 // cent On return, the centrality - if not available < 0
409 // 0 (or kOk) on success, otherwise a bit mask of error codes
412 // --- Check that we have an event ---------------------------------
414 AliWarning("No ESD event found for input event");
418 // --- Read trigger information from the ESD and store in AOD object
419 if (!ReadTriggers(event, triggers, nClusters)) {
421 AliWarning("Failed to read triggers from ESD"); }
425 // --- Check if this is a high-flux event --------------------------
426 const AliMultiplicity* testmult = event->GetMultiplicity();
429 AliWarning("No central multiplicity object found"); }
432 lowFlux = testmult->GetNumberOfTracklets() < fLowFluxCut;
434 fHType->Fill(lowFlux ? 0 : 1);
436 // --- Read centrality information
439 if (!ReadCentrality(event, cent, qual)) {
441 AliWarning("Failed to get centrality");
444 if (qual == 0) fHCentVsQual->Fill(0., cent);
446 for (UShort_t i = 0; i < 4; i++)
447 if (qual & (1 << i)) fHCentVsQual->Fill(Double_t(i+1), cent);
450 // --- Get the vertex information ----------------------------------
456 Bool_t vzOk = ReadVertex(event, vz,vx,vy);
458 fHEventsTr->Fill(vz);
461 AliWarning("Failed to read vertex from ESD"); }
464 fHEventsTrVtx->Fill(vz);
466 // --- Get the vertex bin ------------------------------------------
467 ivz = fVtxAxis.FindBin(vz);
468 if (ivz <= 0 || ivz > fVtxAxis.GetNbins()) {
470 AliWarning(Form("Vertex @ %f outside of range [%f,%f]",
471 vz, fVtxAxis.GetXmin(), fVtxAxis.GetXmax()));
476 fHEventsAccepted->Fill(vz);
477 fHEventsAcceptedXY->Fill(vx,vy);
479 // --- Check the FMD ESD data --------------------------------------
480 if (!event->GetFMDData()) {
482 AliWarning("No FMD data found in ESD"); }
490 //____________________________________________________________________
492 AliFMDEventInspector::ReadCentrality(const AliESDEvent* esd,
494 UShort_t& qual) const
497 // Read centrality from event
501 // cent On return, the centrality or negative if not found
504 // False on error, true otherwise
508 AliCentrality* centObj = const_cast<AliESDEvent*>(esd)->GetCentrality();
509 if (!centObj) return true;
511 // AliInfo(Form("Got centrality object %p with quality %d",
512 // centObj, centObj->GetQuality()));
514 cent = centObj->GetCentralityPercentile("V0M");
515 //cent = centObj->GetCentralityPercentile("ZEMvsZDC");
516 qual = centObj->GetQuality();
521 //____________________________________________________________________
523 AliFMDEventInspector::ReadTriggers(const AliESDEvent* esd, UInt_t& triggers,
527 // Read the trigger information from the ESD event
531 // triggers On return, contains the trigger bits
534 // @c true on success, @c false otherwise
538 // Get the analysis manager - should always be there
539 AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager();
541 AliWarning("No analysis manager defined!");
545 // Get the input handler - should always be there
546 AliInputEventHandler* ih =
547 static_cast<AliInputEventHandler*>(am->GetInputEventHandler());
549 AliWarning("No input handler");
553 // Check if this is a collision candidate (MB)
554 // Note, that we should use the value cached in the input
555 // handler rather than calling IsCollisionCandiate directly
556 // on the AliPhysicsSelection obejct. If we called the latter
557 // then the AliPhysicsSelection object would overcount by a
559 Bool_t offline = ih->IsEventSelected() ;
560 Bool_t fastonly = (ih->IsEventSelected() & AliVEvent::kFastOnly);
561 TString trigStr = esd->GetFiredTriggerClasses();
563 //If we have the MC input handler, this must be MC
564 Bool_t isMC = am->GetMCtruthEventHandler() != 0;
566 // For the 2.76 TeV p+p run, the FMD ran in the slow partition
567 // so it received no triggers from the fast partition. Therefore
568 // the fast triggers are removed here but not for MC where all
569 // triggers are fast.
570 if(TMath::Abs(fEnergy - 2750.) < 20 &&
571 fCollisionSystem == AliForwardUtil::kPP &&
573 if (fastonly) offline = false;
576 // MUON triggers are not strictly minimum bias (MB) so they are removed (HHD)
578 if(offline && trigStr.Contains("CMUS1")) offline = false;
581 triggers |= AliAODForwardMult::kOffline;
582 triggers |= AliAODForwardMult::kInel;
583 fHTriggers->Fill(kOffline+0.5);
585 // If this is inel, see if we have a tracklet
586 const AliMultiplicity* spdmult = esd->GetMultiplicity();
588 AliWarning("No SPD multiplicity");
591 // Check if we have one or more tracklets
592 // in the range -1 < eta < 1 to set the INEL>0
595 // Also count tracklets as a single cluster
596 Int_t n = spdmult->GetNumberOfTracklets();
597 for (Int_t j = 0; j < n; j++) {
598 if(TMath::Abs(spdmult->GetEta(j)) < 1) {
599 triggers |= AliAODForwardMult::kInelGt0;
603 n = spdmult->GetNumberOfSingleClusters();
604 for (Int_t j = 0; j < n; j++) {
605 Double_t eta = -TMath::Log(TMath::Tan(spdmult->GetThetaSingle(j)/2.));
606 if (TMath::Abs(eta) < 1) nClusters++;
609 if (nClusters > 0) triggers |= AliAODForwardMult::kNClusterGt0;
612 // Analyse some trigger stuff
613 AliTriggerAnalysis ta;
615 if (ta.IsOfflineTriggerFired(esd, AliTriggerAnalysis::kV0AND))
616 triggers |= AliAODForwardMult::kNSD;
619 if (ta.IsOfflineTriggerFired(esd, AliTriggerAnalysis::kNSD1))
620 triggers |= AliAODForwardMult::kNSD;
623 // Check for multiple vertices (pile-up) with at least 3
624 // contributors and at least 0.8cm from the primary vertex
625 Bool_t pileup = kFALSE;
626 if(fCollisionSystem == AliForwardUtil::kPP)
627 pileup = esd->IsPileupFromSPD(3,0.8);
629 triggers |= AliAODForwardMult::kPileUp;
630 fHTriggers->Fill(kPileUp+.5);
635 //TString trigStr = esd->GetFiredTriggerClasses();
636 // AliWarning(Form("Fired trigger classes: %s", trigStr.Data()));
637 if (fHWords) fHWords->Fill(trigStr.Data(), 1);
639 if (trigStr.Contains("MB1") || trigStr.Contains("MBBG3"))
640 triggers |= AliAOODForwardMult::kB;
641 if (trigStr.Contains("COTA"))
642 triggers |= AliAODForwardMult::kA;
643 if (trigStr.Contains("COTC"))
644 triggers |= AliAODForwardMult::kC;
646 if (trigStr.Contains("CBEAMB-ABCE-NOPF-ALL")) {
647 triggers |= AliAODForwardMult::kEmpty;
648 fHTriggers->Fill(kEmpty+.5);
651 // Check for B triggers
652 if (trigStr.Contains("CINT1B-ABCE-NOPF-ALL") || // Early pp
653 trigStr.Contains("CINT1-B-NOPF-ALLNOTRD") || // Late pp
654 trigStr.Contains("CINT1-B-NOPF-FASTNOTRD") || // Late pp
655 //trigStr.Contains("CMUS1-B-NOPF-MUON") || // Late pp -- HHD 160811
656 trigStr.Contains("CSMBB-ABCE-NOPF-ALL") || // pp
657 trigStr.Contains("CMBACS2-B-NOPF-ALL") || // PbPb
658 // trigStr.Contains("C0SMH-B-NOPF-ALL") || // PbPb - high mult
659 trigStr.Contains("CMBS2A-B-NOPF-ALL") || // PbPb
660 trigStr.Contains("CMBS2C-B-NOPF-ALL") || // PbPb
661 trigStr.Contains("CMBAC-B-NOPF-ALL") || // PbPb
662 // trigStr.Contains("C0SMH-B-NOPF-ALL") || // PbPb - high mult
663 trigStr.Contains("CMBACS2-B-NOPF-ALLNOTRD") // PbPb
664 // trigStr.Contains("C0SMH-B-NOPF-ALLNOTRD") // PbPb - high mult
666 Bool_t bTrigger = kTRUE;
667 if ( trigStr.Contains("CINT1-B-NOPF-FASTNOTRD") &&
668 !trigStr.Contains("CINT1-B-NOPF-ALLNOTRD") &&
669 TMath::Abs(fEnergy - 2750.) < 20 &&
670 fCollisionSystem == AliForwardUtil::kPP)
673 triggers |= AliAODForwardMult::kB;
674 fHTriggers->Fill(kB+.5);
678 // Check for A triggers
679 if (trigStr.Contains("CINT1A-ABCE-NOPF-ALL") || // Early pp
680 trigStr.Contains("CINT1-AC-NOPF-ALLNOTRD") || // Late pp
681 trigStr.Contains("CINT1-AC-NOPF-FASTNOTRD") || // Late pp
682 (trigStr.Contains("CSMBA-ABCE-NOPF-ALL") &&
683 !(triggers & AliAODForwardMult::kB)) || // pp
684 trigStr.Contains("CMBACS2-A-NOPF-ALL") || // PbPb
685 // trigStr.Contains("C0SMH-A-NOPF-ALL") || // PbPb - high mult
686 trigStr.Contains("CMBS2A-A-NOPF-ALL") || // PbPb
687 trigStr.Contains("CMBS2C-A-NOPF-ALL") || // PbPb
688 trigStr.Contains("CMBAC-A-NOPF-ALL") || // PbPb
689 // trigStr.Contains("C0SMH-A-NOPF-ALL") || // PbPb - high mult
690 trigStr.Contains("CMBACS2-A-NOPF-ALLNOTRD") // PbPb
691 // trigStr.Contains("C0SMH-A-NOPF-ALLNOTRD") // PbPb - high mult
693 triggers |= AliAODForwardMult::kA;
694 fHTriggers->Fill(kA+.5);
697 // Check for C triggers
698 if (trigStr.Contains("CINT1C-ABCE-NOPF-ALL") || // Early pp
699 (trigStr.Contains("CSMBC-ABCE-NOPF-ALL") &&
700 !(triggers & AliAODForwardMult::kB)) || // pp
701 trigStr.Contains("CMBACS2-C-NOPF-ALL") || // PbPb
702 // trigStr.Contains("C0SMH-B-NOPF-ALL") || // PbPb - high mult
703 trigStr.Contains("CMBS2A-C-NOPF-ALL") || // PbPb
704 trigStr.Contains("CMBS2C-C-NOPF-ALL") || // PbPb
705 trigStr.Contains("CMBAC-C-NOPF-ALL") || // PbPb
706 // trigStr.Contains("C0SMH-B-NOPF-ALL") || // PbPb - high mult
707 trigStr.Contains("CMBACS2-C-NOPF-ALLNOTRD") // PbPb
708 // trigStr.Contains("C0SMH-B-NOPF-ALLNOTRD") // PbPb - high mult
710 triggers |= AliAODForwardMult::kC;
711 fHTriggers->Fill(kC+.5);
714 // Check for E triggers
715 if (trigStr.Contains("CINT1-E-NOPF-ALL") || // Early pp
716 trigStr.Contains("CINT1-E-NOPF-ALLNOTRD") || // Late pp
717 trigStr.Contains("CINT1-E-NOPF-FASTNOTRD") || // Late pp
718 trigStr.Contains("CMBACS2-E-NOPF-ALL") || // PbPb
719 // trigStr.Contains("C0SMH-B-NOPF-ALL") || // PbPb - high mult
720 trigStr.Contains("CMBS2A-E-NOPF-ALL") || // PbPb
721 trigStr.Contains("CMBS2C-E-NOPF-ALL") || // PbPb
722 trigStr.Contains("CMBAC-E-NOPF-ALL") || // PbPb
723 // trigStr.Contains("C0SMH-B-NOPF-ALL") || // PbPb - high mult
724 trigStr.Contains("CMBACS2-E-NOPF-ALLNOTRD") // PbPb
725 // trigStr.Contains("C0SMH-B-NOPF-ALLNOTRD") // PbPb - high mult
727 triggers |= AliAODForwardMult::kE;
728 fHTriggers->Fill(kE+.5);
731 // Now check - if we have a collision - for offline triggers and
733 if (triggers & AliAODForwardMult::kB) {
734 if (triggers & AliAODForwardMult::kInel)
735 fHTriggers->Fill(kInel);
737 if (triggers & AliAODForwardMult::kInelGt0)
738 fHTriggers->Fill(kInelGt0+.5);
740 if (triggers & AliAODForwardMult::kNSD)
741 fHTriggers->Fill(kNSD+.5);
746 //____________________________________________________________________
748 AliFMDEventInspector::ReadVertex(const AliESDEvent* esd,
754 // Read the vertex information from the ESD event
758 // vz On return, the vertex Z position
761 // @c true on success, @c false otherwise
766 if(fUseFirstPhysicsVertex) {
767 // This is the code used by the 1st physics people
768 const AliESDVertex* vertex = esd->GetPrimaryVertex();
769 if (!vertex || !vertex->GetStatus()) {
771 AliWarning(Form("No primary vertex (%p) or bad status %d",
772 vertex, (vertex ? vertex->GetStatus() : -1)));
776 const AliESDVertex* vertexSPD = esd->GetPrimaryVertexSPD();
777 if (!vertexSPD || !vertexSPD->GetStatus()) {
779 AliWarning(Form("No primary SPD vertex (%p) or bad status %d",
780 vertexSPD, (vertexSPD ? vertexSPD->GetStatus() : -1)));
785 // if vertex is from SPD vertexZ, require more stringent cuts
786 if (vertex->IsFromVertexerZ()) {
787 if (vertex->GetDispersion() > fMaxVzErr ||
788 vertex->GetZRes() > 1.25 * fMaxVzErr) {
790 AliWarning(Form("Dispersion %f > %f or resolution %f > %f",
791 vertex->GetDispersion(), fMaxVzErr,
792 vertex->GetZRes(), 1.25 * fMaxVzErr));
799 if(!vertex->IsFromVertexerZ()) {
805 else { //Use standard SPD vertex (perhaps preferable for Pb+Pb)
808 const AliESDVertex* vertex = esd->GetPrimaryVertexSPD();
811 AliWarning("No SPD vertex found in ESD"); }
815 // Check that enough tracklets contributed
816 if(vertex->GetNContributors() <= 0) {
818 AliWarning(Form("Number of contributors to vertex is %d<=0",
819 vertex->GetNContributors())); }
823 // Check that the uncertainty isn't too large
824 if (vertex->GetZRes() > fMaxVzErr) {
826 AliWarning(Form("Uncertaintity in Z of vertex is too large %f > %f",
827 vertex->GetZRes(), fMaxVzErr)); }
831 // Get the z coordiante
833 const AliESDVertex* vertexXY = esd->GetPrimaryVertex();
835 if(!vertexXY->IsFromVertexerZ()) {
836 vx = vertexXY->GetX();
837 vy = vertexXY->GetY();
843 //____________________________________________________________________
845 AliFMDEventInspector::ReadRunDetails(const AliESDEvent* esd)
848 // Read the collision system, collision energy, and L3 field setting
852 // esd ESD to get information from
855 // true on success, false
857 // AliInfo(Form("Parameters from 1st ESD event: cms=%s, sNN=%f, field=%f",
858 // esd->GetBeamType(), 2*esd->GetBeamEnergy(),
859 // esd->GetMagneticField()));
861 AliForwardUtil::ParseCollisionSystem(esd->GetBeamType());
863 AliForwardUtil::ParseCenterOfMassEnergy(fCollisionSystem,
864 2 * esd->GetBeamEnergy());
866 AliForwardUtil::ParseMagneticField(esd->GetMagneticField());
868 StoreInformation(esd->GetRunNumber());
869 if (fCollisionSystem == AliForwardUtil::kUnknown ||
871 TMath::Abs(fField) > 10)
877 //____________________________________________________________________
879 AliFMDEventInspector::Print(Option_t*) const
886 char ind[gROOT->GetDirLevel()+1];
887 for (Int_t i = 0; i < gROOT->GetDirLevel(); i++) ind[i] = ' ';
888 ind[gROOT->GetDirLevel()] = '\0';
889 TString sNN(AliForwardUtil::CenterOfMassEnergyString(fEnergy));
890 sNN.Strip(TString::kBoth, '0');
891 sNN.ReplaceAll("GeV", " GeV");
892 TString field(AliForwardUtil::MagneticFieldString(fField));
893 field.ReplaceAll("p", "+");
894 field.ReplaceAll("m", "-");
895 field.ReplaceAll("kG", " kG");
897 std::cout << ind << ClassName() << ": " << GetName() << '\n'
898 << ind << " Vertex bins: " << fVtxAxis.GetNbins() << '\n'
899 << ind << " Vertex range: [" << fVtxAxis.GetXmin()
900 << "," << fVtxAxis.GetXmax() << "]\n"
901 << ind << " Low flux cut: " << fLowFluxCut << '\n'
902 << ind << " Max(delta v_z): " << fMaxVzErr << " cm\n"
903 << ind << " System: "
904 << AliForwardUtil::CollisionSystemString(fCollisionSystem) << '\n'
905 << ind << " CMS energy per nucleon: " << sNN << '\n'
906 << ind << " Field: " << field << '\n';
907 if (!fCentAxis) { std::cout << std::flush; return; }
908 Int_t nBin = fCentAxis->GetNbins();
909 std::cout << ind << " Centrality axis: " << nBin << " bins"
911 for (Int_t i = 0; i < nBin; i++) {
912 if ((i % 10) == 0) std::cout << '\n' << ind << " ";
913 std::cout << std::setw(5) << fCentAxis->GetBinLowEdge(i+1) << '-';
915 std::cout << std::setw(5) << fCentAxis->GetBinUpEdge(nBin) << std::endl;