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 fHInvMassAll_vs_Pt;
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 fHInvMassAll_vs_Pt = new TH2F("hInvMassAll_vs_Pt","hInvMassAll_vs_Pt",480,0.,12.,80,0.,20.);
75 /*********************************************************/
77 Int_t AliMuonAnalysis::ProcessEvent(AliAOD* aodrec, AliAOD* aodsim)
82 // Info("ProcessEvent","Inv Mass Rec");
86 // Info("ProcessEvent","aodsim not implemented");
93 /*********************************************************/
95 Int_t AliMuonAnalysis::Finish()
97 //Finish analysis and writes results
98 Info("Finish","Histo writing for MUON Analysis");
105 /*********************************************************/
107 void AliMuonAnalysis::GetInvMass(AliAOD* aod)
110 TLorentzVector lorV1, lorV2, lorVtot;
111 Float_t massMin = 9.17;
112 Float_t massMax = 9.77;
113 Int_t charge1, charge2;
115 //returns flow parameters: v2 and event plane
117 Error("AliMuonAnalysis::GetInvMass","Pointer to AOD is NULL");
121 Int_t nPart = aod->GetNumberOfParticles();
123 for (Int_t iPart1 = 0; iPart1 < nPart; iPart1++) {
124 AliAODParticle* aodPart1 = (AliAODParticle*)aod->GetParticle(iPart1);
126 if (aodPart1 == 0x0) {
127 Error("AliMuonAnalysis::GetInvMass","Cannot get particle %d", iPart1);
131 lorV1 = aodPart1->FourMomentum();
133 fHPtMuon->Fill(lorV1.Pt());
134 fHPMuon->Fill(lorV1.P());
136 charge1 = TMath::Sign(1,aodPart1->GetPdgCode());
139 fHPtMuonPlus->Fill(lorV1.Pt());
141 fHPtMuonMinus->Fill(lorV1.Pt());
143 fHRapMuon->Fill(lorV1.Rapidity());
144 for (Int_t iPart2 = iPart1 + 1; iPart2 < nPart; iPart2++) {
146 AliAODParticle* aodPart2 = (AliAODParticle*)aod->GetParticle(iPart2);
148 lorV2 = aodPart2->FourMomentum();
149 charge2 = TMath::Sign(1,aodPart2->GetPdgCode());
151 if ((charge1 * charge2) == -1) {
153 lorVtot = lorV1 + lorV2;
154 Float_t invMass = lorVtot.M();
156 fHInvMassAll->Fill(invMass);
157 fHInvMassAll_vs_Pt->Fill(invMass,lorVtot.Pt());
159 if (invMass > massMin && invMass < massMax) {
160 fHRapResonance->Fill(lorVtot.Rapidity());
161 fHPtResonance->Fill(lorVtot.Pt());