1 #if !defined(__CINT__) || defined(__MAKECINT__)
14 #include "AliAODEvent.h"
15 #include "AliAODHeader.h"
16 #include "AliAODEventInfo.h"
17 #include "AliAODVertex.h"
18 #include "AliAODTrack.h"
19 #include "AliAODCluster.h"
20 #include "AliAODDimuon.h"
24 void ReadSpecAOD(const char *fileName = "AliMuonAOD.root") {
26 gSystem->Load("libTree");
27 gSystem->Load("libGeom");
28 gSystem->Load("libSTEERBase");
29 gSystem->Load("libAOD");
30 gSystem->Load("libANALYSIS");
31 gSystem->Load("libPWG3base.so");
35 gStyle->SetOptStat(111111);
36 gStyle->SetFrameFillColor(10);
37 gStyle->SetCanvasColor(10);
38 gStyle->SetOptStat(0);
39 TH1F *mass=new TH1F("mass","Invariant mass",100,0.,20.);
40 TH1F *rap=new TH1F("rap","Rapidity",100,-5.,0.);
41 TH1F *cost=new TH1F("cost","Cost_CS",100,-1.,1.);
42 TH1F *pt=new TH1F("pt","Pt",100,0.,50.);
43 TH1F *ptmuon=new TH1F("ptmuon","single muon Pt",100,0.,50.);
45 // open input file and get the TTree
46 TFile inFile(fileName, "READ");
47 TTree *aodTree = (TTree*)inFile.Get("AOD");
49 AliAODEvent *aod = (AliAODEvent*)aodTree->GetUserInfo()->FindObject("AliAODEvent");
51 TClonesArray *Dimuons;
53 TClonesArray *vertices;
54 AliAODEventInfo *MuonInfos;
56 aodTree->SetBranchAddress("Dimuons",&Dimuons);
57 aodTree->SetBranchAddress("tracks",&tracks);
58 aodTree->SetBranchAddress("vertices",&vertices);
59 aodTree->SetBranchAddress("MuonInfos",&MuonInfos);
62 Int_t nEvents = aodTree->GetEntries();
63 for (Int_t nEv = 0; nEv < nEvents; nEv++) {
64 cout << "Event: " << nEv+1 << "/" << nEvents << endl;
65 aodTree->GetEntry(nEv);
67 Int_t nTracks = tracks->GetEntries();
68 for (Int_t nTr = 0; nTr < nTracks; nTr++) {
69 AliAODTrack *tr = (AliAODTrack *)tracks->At(nTr);
70 ptmuon->Fill(tr->Pt());
72 cout << nTr+1 << "/" << nTracks << ": track pt: " << tr->Pt();
73 if (tr->GetProdVertex()) {
74 cout << ", vertex z of this track: " << tr->GetProdVertex()->GetZ();
80 Int_t nDimuons = Dimuons->GetEntries();
81 cout << nDimuons << " dimuon(s)" << endl;
82 for(Int_t nDi=0; nDi < nDimuons; nDi++){
83 AliAODDimuon *di=(AliAODDimuon*)Dimuons->At(nDi);
84 if((MuonInfos->MUON_Unlike_HPt_L0())){
88 cost->Fill(di->CostCS());
89 cout << "Dimuon: " << nDi << " q: " << di->Charge()
90 << " m: " << di->M() << " Y: " << di->Y() << " Pt: " << di->Pt()<< " CostCS: " << di->CostCS() << endl ;
93 // // loop over vertices
94 // Int_t nVtxs = vertices->GetEntries();
95 // for (Int_t nVtx = 0; nVtx < nVtxs; nVtx++) {
97 // // print track info
98 // cout << nVtx+1 << "/" << nVtxs << ": vertex z position: " <<vertices->At(nVtx)->GetZ() << endl;
102 TCanvas *c1=new TCanvas();
115 TCanvas *c2 = new TCanvas();