1 #include "AliMuonAnalysis.h"
2 //________________________________
3 ///////////////////////////////////////////////////////////
5 // class AliMuonAnalysis
11 // finck@subatech.in2p3.fr
13 ///////////////////////////////////////////////////////////
14 /*********************************************************/
17 #include <TParticle.h>
21 #include <AliAODParticle.h>
22 #include <AliAODParticleCut.h>
24 #include <AliESDtrack.h>
31 ClassImp(AliMuonAnalysis)
33 AliMuonAnalysis::AliMuonAnalysis():
39 /*********************************************************/
40 AliMuonAnalysis::~AliMuonAnalysis()
51 delete fHRapResonance;
53 delete fHInvMassAllvsPt;
55 /*********************************************************/
57 Int_t AliMuonAnalysis::Init()
60 Info("Init","Histo initialized for MUON Analysis");
62 fHistoFile = new TFile("MUONmassPlot.root", "RECREATE");
63 fHPtMuon = new TH1F("hPtMuon", "Muon Pt (GeV/c)", 100, 0., 20.);
64 fHPMuon = new TH1F("hPMuon", "Muon P (GeV/c)", 100, 0., 200.);
65 fHPtMuonPlus = new TH1F("hPtMuonPlus", "Muon+ Pt (GeV/c)", 100, 0., 20.);
66 fHPtMuonMinus = new TH1F("hPtMuonMinus", "Muon- Pt (GeV/c)", 100, 0., 20.);
67 fHInvMassAll = new TH1F("hInvMassAll", "Mu+Mu- invariant mass (GeV/c2)", 480, 0., 12.);
68 fHRapMuon = new TH1F("hRapMuon"," Muon Rapidity",50,-4.5,-2);
69 fHRapResonance = new TH1F("hRapResonance"," Resonance Rapidity",50,-4.5,-2);
70 fHPtResonance = new TH1F("hPtResonance", "Resonance Pt (GeV/c)", 100, 0., 20.);
71 fHInvMassAllvsPt = new TH2F("hInvMassAll_vs_Pt","hInvMassAll_vs_Pt",480,0.,12.,80,0.,20.);
75 /*********************************************************/
77 Int_t AliMuonAnalysis::ProcessEvent(AliAOD* aodrec, AliAOD* aodsim)
84 // Info("ProcessEvent","Inv Mass Rec");
88 // Info("ProcessEvent","aodsim not implemented");
95 /*********************************************************/
97 Int_t AliMuonAnalysis::Finish()
99 //Finish analysis and writes results
100 Info("Finish","Histo writing for MUON Analysis");
107 /*********************************************************/
109 void AliMuonAnalysis::GetInvMass(AliAOD* aod)
111 // get the invariant mass distribution
112 // from the oad events
114 TLorentzVector lorV1, lorV2, lorVtot;
115 Float_t massMin = 9.17;
116 Float_t massMax = 9.77;
117 Int_t charge1, charge2;
119 //returns flow parameters: v2 and event plane
121 Error("AliMuonAnalysis::GetInvMass","Pointer to AOD is NULL");
125 Int_t nPart = aod->GetNumberOfParticles();
127 for (Int_t iPart1 = 0; iPart1 < nPart; iPart1++) {
128 AliAODParticle* aodPart1 = (AliAODParticle*)aod->GetParticle(iPart1);
130 if (aodPart1 == 0x0) {
131 Error("AliMuonAnalysis::GetInvMass","Cannot get particle %d", iPart1);
135 lorV1.SetPxPyPzE(aodPart1->Px(),
140 fHPtMuon->Fill(lorV1.Pt());
141 fHPMuon->Fill(lorV1.P());
143 charge1 = TMath::Sign(1,aodPart1->GetPdgCode());
146 fHPtMuonPlus->Fill(lorV1.Pt());
148 fHPtMuonMinus->Fill(lorV1.Pt());
150 fHRapMuon->Fill(lorV1.Rapidity());
151 for (Int_t iPart2 = iPart1 + 1; iPart2 < nPart; iPart2++) {
153 AliAODParticle* aodPart2 = (AliAODParticle*)aod->GetParticle(iPart2);
155 lorV2.SetPxPyPzE(aodPart2->Px(),
160 charge2 = TMath::Sign(1,aodPart2->GetPdgCode());
162 if ((charge1 * charge2) == -1) {
166 Float_t invMass = lorVtot.M();
168 fHInvMassAll->Fill(invMass);
169 fHInvMassAllvsPt->Fill(invMass,lorVtot.Pt());
171 if (invMass > massMin && invMass < massMax) {
172 fHRapResonance->Fill(lorVtot.Rapidity());
173 fHPtResonance->Fill(lorVtot.Pt());