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():
43 fHInvMassAllvsPt(0x0),
49 /*********************************************************/
50 AliMuonAnalysis::~AliMuonAnalysis()
61 delete fHRapResonance;
63 delete fHInvMassAllvsPt;
65 /*********************************************************/
67 Int_t AliMuonAnalysis::Init()
70 Info("Init","Histo initialized for MUON Analysis");
72 fHistoFile = new TFile("MUONmassPlot.root", "RECREATE");
73 fHPtMuon = new TH1F("hPtMuon", "Muon Pt (GeV/c)", 100, 0., 20.);
74 fHPMuon = new TH1F("hPMuon", "Muon P (GeV/c)", 100, 0., 200.);
75 fHPtMuonPlus = new TH1F("hPtMuonPlus", "Muon+ Pt (GeV/c)", 100, 0., 20.);
76 fHPtMuonMinus = new TH1F("hPtMuonMinus", "Muon- Pt (GeV/c)", 100, 0., 20.);
77 fHInvMassAll = new TH1F("hInvMassAll", "Mu+Mu- invariant mass (GeV/c2)", 480, 0., 12.);
78 fHRapMuon = new TH1F("hRapMuon"," Muon Rapidity",50,-4.5,-2);
79 fHRapResonance = new TH1F("hRapResonance"," Resonance Rapidity",50,-4.5,-2);
80 fHPtResonance = new TH1F("hPtResonance", "Resonance Pt (GeV/c)", 100, 0., 20.);
81 fHInvMassAllvsPt = new TH2F("hInvMassAll_vs_Pt","hInvMassAll_vs_Pt",480,0.,12.,80,0.,20.);
85 /*********************************************************/
87 Int_t AliMuonAnalysis::ProcessEvent(AliAOD* aodrec, AliAOD* aodsim)
94 // Info("ProcessEvent","Inv Mass Rec");
98 // Info("ProcessEvent","aodsim not implemented");
105 /*********************************************************/
107 Int_t AliMuonAnalysis::Finish()
109 //Finish analysis and writes results
110 Info("Finish","Histo writing for MUON Analysis");
117 /*********************************************************/
119 void AliMuonAnalysis::GetInvMass(AliAOD* aod)
121 // get the invariant mass distribution
122 // from the oad events
124 TLorentzVector lorV1, lorV2, lorVtot;
125 Float_t massMin = 9.17;
126 Float_t massMax = 9.77;
127 Int_t charge1, charge2;
129 //returns flow parameters: v2 and event plane
131 Error("AliMuonAnalysis::GetInvMass","Pointer to AOD is NULL");
135 Int_t nPart = aod->GetNumberOfParticles();
137 for (Int_t iPart1 = 0; iPart1 < nPart; iPart1++) {
138 AliAODParticle* aodPart1 = (AliAODParticle*)aod->GetParticle(iPart1);
140 if (aodPart1 == 0x0) {
141 Error("AliMuonAnalysis::GetInvMass","Cannot get particle %d", iPart1);
145 lorV1.SetPxPyPzE(aodPart1->Px(),
150 fHPtMuon->Fill(lorV1.Pt());
151 fHPMuon->Fill(lorV1.P());
153 charge1 = TMath::Sign(1,aodPart1->GetPdgCode());
156 fHPtMuonPlus->Fill(lorV1.Pt());
158 fHPtMuonMinus->Fill(lorV1.Pt());
160 fHRapMuon->Fill(lorV1.Rapidity());
161 for (Int_t iPart2 = iPart1 + 1; iPart2 < nPart; iPart2++) {
163 AliAODParticle* aodPart2 = (AliAODParticle*)aod->GetParticle(iPart2);
165 lorV2.SetPxPyPzE(aodPart2->Px(),
170 charge2 = TMath::Sign(1,aodPart2->GetPdgCode());
172 if ((charge1 * charge2) == -1) {
176 Float_t invMass = lorVtot.M();
178 fHInvMassAll->Fill(invMass);
179 fHInvMassAllvsPt->Fill(invMass,lorVtot.Pt());
181 if (invMass > massMin && invMass < massMax) {
182 fHRapResonance->Fill(lorVtot.Rapidity());
183 fHPtResonance->Fill(lorVtot.Pt());