18 #include "AliCollisionGeometry.h" 22 #include "AliCentrality.h" 23 #include "AliESDEvent.h" 24 #include "AliMCEvent.h" 26 #include "AliGenPythiaEventHeader.h" 27 #include "AliGenDPMjetEventHeader.h" 28 #include "AliGenHijingEventHeader.h" 30 #include "AliGenEposEventHeader.h" 31 #include "AliGenHerwigEventHeader.h" 32 #include "AliGenGeVSimEventHeader.h" 33 #include "AliAnalysisManager.h" 34 #include "AliMCEventHandler.h" 35 #include "AliHeader.h" 38 #include <TParticle.h> 40 #include <TParameter.h> 161 if (vtxAxis.GetXbins() && vtxAxis.GetXbins()->GetArray())
162 fHVertex =
new TH1F(
"vertex",
"True vertex distribution",
163 vtxAxis.GetNbins(), vtxAxis.GetXbins()->GetArray());
165 fHVertex =
new TH1F(
"vertex",
"True vertex distribution",
166 vtxAxis.GetNbins(), vtxAxis.GetXmin(),
177 100, -1, 1, 100, -1, 1);
183 fHPhiR =
new TH1F(
"phiR",
"Event plane", 120, 0, 2*TMath::Pi());
184 fHPhiR->SetXTitle(
"#Phi_{R} [radians]");
185 fHPhiR->SetYTitle(
"# of events");
186 fHPhiR->SetFillColor(kGreen+1);
187 fHPhiR->SetFillStyle(3001);
191 fHB =
new TH1F(
"b",
"Impact parameter", 5*maxB, 0, maxB);
192 fHB->SetXTitle(
"b [fm]");
193 fHB->SetYTitle(
"# of events");
194 fHB->SetFillColor(kGreen+1);
195 fHB->SetFillStyle(3001);
196 fHB->SetDirectory(0);
200 fHMcC->SetFillColor(kCyan+2);
201 fHMcC->SetDirectory(0);
204 fHBvsPart =
new TH2F(
"bVsParticipants",
"Impact parameter vs Participants",
205 5*maxB, 0, maxB, maxPart, -.5, maxPart-.5);
207 fHBvsPart->SetYTitle(
"# of participants");
212 fHBvsBin =
new TH2F(
"bVsBinary",
"Impact parameter vs Binary Collisions",
213 5*maxB, 0, maxB, maxBin, -.5, maxBin-.5);
215 fHBvsBin->SetYTitle(
"# of binary collisions");
220 fHBvsCent =
new TH2F(
"bVsCentrality",
"Impact parameter vs Centrality",
231 if (vtxAxis.GetXbins() && vtxAxis.GetXbins()->GetArray())
232 fHVzComp =
new TH2F(
"vzComparison",
"v_{z} truth vs reconstructed",
233 vtxAxis.GetNbins(), vtxAxis.GetXbins()->GetArray(),
234 vtxAxis.GetNbins(), vtxAxis.GetXbins()->GetArray());
236 fHVzComp =
new TH2F(
"vzComparison",
"v_{z} truth vs reconstructed",
237 10*vtxAxis.GetNbins(), vtxAxis.GetXmin(),
238 vtxAxis.GetXmax(), 10*vtxAxis.GetNbins(),
239 vtxAxis.GetXmin(), vtxAxis.GetXmax());
240 fHVzComp->SetXTitle(
"True v_{z} [cm]");
241 fHVzComp->SetYTitle(
"Reconstructed v_{z} [cm]");
247 "# of participants vs Centrality",
248 maxPart, -.5, maxPart-.5,
fCentAxis->GetNbins(),
257 "# of binary collisions vs Centrality",
258 maxBin, -.5, maxBin-.5,
fCentAxis->GetNbins(),
270 "Centrality from reconstruction vs MC derived",
271 nC, cL, cH, nC, cL, cH);
275 fHCentVsMcC->SetYTitle(
"Centralty derived from Impact Par. [%]");
287 if (!s.IsNull()) s.Append(
",");
298 AliHeader* header =
event->Header();
299 AliGenEventHeader* genHeader = header->GenEventHeader();
300 AliCollisionGeometry* colGeometry =
301 dynamic_cast<AliCollisionGeometry*
>(genHeader);
302 AliGenPythiaEventHeader* pythiaHeader =
303 dynamic_cast<AliGenPythiaEventHeader*
>(genHeader);
304 AliGenDPMjetEventHeader* dpmHeader =
305 dynamic_cast<AliGenDPMjetEventHeader*
>(genHeader);
306 AliGenGeVSimEventHeader* gevHeader =
307 dynamic_cast<AliGenGeVSimEventHeader*
>(genHeader);
308 AliGenHerwigEventHeader* herwigHeader =
309 dynamic_cast<AliGenHerwigEventHeader*
>(genHeader);
310 AliGenHijingEventHeader* hijingHeader =
311 dynamic_cast<AliGenHijingEventHeader*
>(genHeader);
314 AliGenEposEventHeader* eposHeader =
315 dynamic_cast<AliGenEposEventHeader*
>(genHeader);
358 AliWarning(
"No MC event found for input event");
364 AliHeader* header =
event->Header();
365 AliGenEventHeader* genHeader = header->GenEventHeader();
366 AliCollisionGeometry* colGeometry =
367 dynamic_cast<AliCollisionGeometry*
>(genHeader);
368 AliGenPythiaEventHeader* pythiaHeader =
369 dynamic_cast<AliGenPythiaEventHeader*
>(genHeader);
370 AliGenDPMjetEventHeader* dpmHeader =
371 dynamic_cast<AliGenDPMjetEventHeader*
>(genHeader);
372 AliGenGeVSimEventHeader* gevHeader =
373 dynamic_cast<AliGenGeVSimEventHeader*
>(genHeader);
374 AliGenHerwigEventHeader* herwigHeader =
375 dynamic_cast<AliGenHerwigEventHeader*
>(genHeader);
393 b = colGeometry->ImpactParameter();
394 phi = colGeometry->ReactionPlaneAngle();
395 npart = (colGeometry->ProjectileParticipants() +
396 colGeometry->TargetParticipants());
397 nbin = colGeometry->NN();
399 if (
fDebug && !colGeometry) {
400 AliWarningF(
"Collision header of class %s is not a CollisionHeader",
401 genHeader->ClassName());
405 Int_t pythiaType = pythiaHeader->ProcessType();
407 if (pythiaType <= 100) {
411 if (pythiaType==92 || pythiaType==93) sd =
true;
415 if (pythiaType==103 || pythiaType==104) sd =
true;
417 b = pythiaHeader->GetImpactParameter();
423 if (b < 3.5) c = 2.5;
424 else if (b < 4.95) c = 7.5;
425 else if (b < 6.98) c = 15;
426 else if (b < 8.55) c = 25;
427 else if (b < 9.88) c = 35;
428 else if (b < 11.04) c = 45;
435 if (0.00 >= b && b < 1.57) { c=0.5; np=403.8; nc=1861; }
436 else if (1.57 >= b && b < 2.22) { c=1.5; np=393.6; nc=1766; }
437 else if (2.22 >= b && b < 2.71) { c=2.5; np=382.9; nc=1678; }
438 else if (2.71 >= b && b < 3.13) { c=3.5; np=372; nc=1597; }
439 else if (3.13 >= b && b < 3.50) { c=4.5; np=361.1; nc=1520; }
440 else if (3.50 >= b && b < 4.94) { c=7.5; np=329.4; nc=1316; }
441 else if (4.94 >= b && b < 6.05) { c=12.5; np=281.2; nc=1032; }
442 else if (6.05 >= b && b < 6.98) { c=17.5; np=239; nc=809.8; }
443 else if (6.98 >= b && b < 7.81) { c=22.5; np=202.1; nc=629.6; }
444 else if (7.81 >= b && b < 8.55) { c=27.5; np=169.5; nc=483.7; }
445 else if (8.55 >= b && b < 9.23) { c=32.5; np=141; nc=366.7; }
446 else if (9.23 >= b && b < 9.88) { c=37.5; np=116; nc=273.4; }
447 else if (9.88 >= b && b < 10.47) { c=42.5; np=94.11; nc=199.4; }
448 else if (10.47 >= b && b < 11.04) { c=47.5; np=75.3; nc=143.1; }
449 else if (11.04 >= b && b < 11.58) { c=52.5; np=59.24; nc=100.1; }
450 else if (11.58 >= b && b < 12.09) { c=57.5; np=45.58; nc=68.46; }
451 else if (12.09 >= b && b < 12.58) { c=62.5; np=34.33; nc=45.79; }
452 else if (12.58 >= b && b < 13.05) { c=67.5; np=25.21; nc=29.92; }
453 else if (13.05 >= b && b < 13.52) { c=72.5; np=17.96; nc=19.08; }
454 else if (13.52 >= b && b < 13.97) { c=77.5; np=12.58; nc=12.07; }
455 else if (13.97 >= b && b < 14.43) { c=82.5; np=8.812; nc=7.682; }
456 else if (14.43 >= b && b < 14.96) { c=87.5; np=6.158; nc=4.904; }
457 else if (14.96 >= b && b < 15.67) { c=92.5; np=4.376; nc=3.181; }
458 else if (15.67 >= b && b < 20.00) { c=97.5; np=3.064; nc=1.994; }
460 if (npart <= 0) npart =
Int_t(np+.5);
461 if (nbin <= 0) nbin =
Int_t(nc+.5)/2;
471 if (processType == 5 || processType == 6) sd = kTRUE;
480 Int_t nsd1=0, nsd2=0, ndd=0;
481 Int_t npP = dpmHeader->ProjectileParticipants();
482 Int_t npT = dpmHeader->TargetParticipants();
484 dpmHeader->GetNDiffractive(nsd1,nsd2,ndd);
486 if ((ndd == 0) && ((npP == nsd1) || (npT == nsd2))) sd =
true;
493 phi = gevHeader->GetEventPlane();
496 Int_t processType = herwigHeader->ProcessType();
499 if (processType == 5 || processType == 6) sd = kTRUE;
517 if (phi <= -1111) phiR = -1;
520 if (phi < 0) phi += 2*TMath::Pi();
521 else if (phi > 2*TMath::Pi()) phi -= 2*TMath::Pi();
539 genHeader->PrimaryVertex(vtx);
540 ip.SetXYZ(vtx[0], vtx[1], vtx[2]);
542 DMSG(
fDebug, 1,
"ip=(%f,%f,%f), phiR=%f, b=%f, npart=%d, nbin=%d",
543 vtx[0], vtx[1], vtx[2], phiR, b, npart, nbin);
558 if(ratio > 0) ratio = ratio + 0.5;
559 if(ratio < 0) ratio = ratio - 0.5;
562 if(TMath::Abs(zvtx) > 999)
573 if (ivz <= 0 || ivz >
fHEventsTr->GetXaxis()->GetNbins()) {
575 AliWarning(Form(
"Vertex @ %f outside of range [%f,%f]",
602 AliCentrality* centObj =
const_cast<AliESDEvent&
>(esd).GetCentrality();
603 if (!centObj)
return ret;
606 cent = centObj->GetCentralityPercentileUnchecked(
fCentMethod);
617 Double_t ee = TMath::Sqrt(pt*pt+pz*pz+mass*mass);
618 if (TMath::Abs(ee - TMath::Abs(pz)) < 1e-9)
return TMath::Sign(1e30, pz);
619 return .5 * TMath::Log((ee + pz) / (ee - pz));
638 for (
Int_t i = 0; i < stack->GetNprimary(); i++) {
639 TParticle* p = stack->Particle(i);
642 Int_t pdg = TMath::Abs(p->GetPdgCode());
643 Int_t c1 = p->GetFirstDaughter();
644 Int_t s = p->GetStatusCode();
648 if (c1 > -1 || s != 1) mfl = 0;
652 if (!(stack->IsPhysicalPrimary(i) ||
658 Int_t m1 = p->GetFirstMother();
660 TParticle* pm1 = stack->Particle(m1);
661 Int_t mpdg = TMath::Abs(pm1->GetPdgCode());
663 if (mpdg == 111 || mpdg == 3124 || mpdg == 3212)
continue;
667 Double_t mm = (pdg != 3124 && p->GetPDG() ? p->GetMass() : 1.5195);
681 if (!p1 || !p2)
return false;
684 y1 = TMath::Abs(
rapidity(p1, 0.938));
685 y2 = TMath::Abs(
rapidity(p2, 0.938));
688 Int_t pdg1 = p1->GetPdgCode();
689 Int_t pdg2 = p2->GetPdgCode();
691 if (pdg1 == 2212 && pdg2 == 2212)
692 arm = (y1 > y2 ? 0 : 1);
693 else if (pdg1 == 2212)
695 else if (pdg2 == 2212)
704 if (arm == 0 && m02s > xiMin && m02s < xiMax)
return true;
705 if (arm == 1 && m12s > xiMin && m12s < xiMax)
return true;
UShort_t fEnergy
Histogram container.
virtual Bool_t CompareResults(Double_t vz, Double_t trueVz, Double_t cent, Double_t mcC, Double_t b, Int_t npart, Int_t nbin)
virtual Bool_t ReadCentrality(const AliESDEvent &esd, Double_t ¢, UShort_t &qual) const
TH1I * fHTriggers
XY vtx with trigger and Z vertex in range.
#define DMSG(L, N, F,...)
AliFMDEventInspector & operator=(const AliFMDEventInspector &)
Various utilities used in PWGLF/FORWARD.
void SetVertexMethod(EVtxType t)
Bool_t ProcessMC(const AliMCEvent *mcevent)
virtual Bool_t ReadCentrality(const AliESDEvent &esd, Double_t ¢, UShort_t &qual) const
virtual void ReadProductionDetails(AliMCEvent *event)
TString fCentMethod
Configured background words.
void SetupForData(const TAxis &vtxAxis)
AliDisplacedVertexSelection fDisplacedVertex
AliFMDMCEventInspector & operator=(const AliFMDMCEventInspector &)
UInt_t ProcessMC(AliMCEvent *event, UInt_t &triggers, UShort_t &ivz, TVector3 &ip, Double_t &b, Double_t &c, Int_t &npart, Int_t &nbin, Double_t &phiR)
Bool_t IsSingleDiffractive(AliStack *stack, Double_t xiMin=0, Double_t xiMax=1./81) const
void test(int runnumber=195345)
TH1F * fHCent
Trigger words.
Double_t GetVertexZ() const
void SetupForData(TList *l, const char *name=0, Bool_t mc=false)
Bool_t IsSatellite() const
Bool_t AllowDisplaced() const
virtual ~AliFMDMCEventInspector()
virtual void SetupForData(const TAxis &vtxAxis)