1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 // A. De Falco, H. Woehri, INFN Cagliari, July 2006
19 // base macro to read the trees generated with DecodeRecoCocktail.C
22 void ReadRecoCocktail(char* fname="./MuonLight.root"){
23 TFile *file = new TFile(fname);
24 TClonesArray *muonArray = new TClonesArray("AliMUONTrackLight",100);
25 TClonesArray *dimuonArray = new TClonesArray("AliMUONPairLight",100);
26 TTree *tree = (TTree*) file->Get("tree");
27 tree->SetBranchAddress("muons",&muonArray);
28 tree->SetBranchAddress("dimuons",&dimuonArray);
29 Int_t nev = tree->GetEntriesFast();
30 printf ("%d events in tree\n",nev);
32 for (Int_t iev=0; iev<nev; iev++) {
34 Int_t nmu = muonArray->GetEntries();
35 for (Int_t imu=0; imu<nmu; imu++) {
36 AliMUONTrackLight *mu = (AliMUONTrackLight*) muonArray->At(imu);
39 Int_t ndimu = dimuonArray->GetEntriesFast();
40 for (Int_t idimu=0; idimu<ndimu; idimu++) {
41 AliMUONPairLight *dimu = (AliMUONPairLight*) dimuonArray->At(idimu);
43 if (!dimu->IsCorrelated()) {
44 printf ("Event %d / %d; dimuon %d not correlated\n",iev,nev,idimu);
50 printf ("%d uncorrelated dimuons in file\n",ndimuUncorr);
51 TCanvas *c1=new TCanvas();
53 printf ("plotting the mass and pt spectra of opposite sign dimuons\n");
55 tree->Draw("dimuons.GetPRec().M()","dimuons.GetCharge()==0");
57 tree->Draw("dimuons.GetPRec().Pt()","dimuons.GetCharge()==0");