1 /*************************************************************
3 Macro used for reading the information
4 recorded by ACORDE detector from ESD fles and test the
5 correction of ACORDE ESDs
9 Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch>
11 Created: Sep. 24th 2009 @ CERN
14 **************************************************************/
25 TH1D *h1 = new TH1D("h1","ACORDE - Single Muon Trigger Hits",60,-0.5,59.5);
26 TH1D *h2 = new TH1D("h2","ACORDE - Single Muon Trigger Hit Multiplicity",60,-1,60);
27 TH1D *h3 = new TH1D("h3","ACORDE - Multi Muon Trigger Hits",60,-0.5,59.5);
28 TH1D *h4 = new TH1D("h4","ACORDE - Multi Muon Trigger Hit Multiplicity",60,-1,60);
30 // Pointer to the ESD file
32 TFile *ef = TFile::Open("AliESDs.root");
34 // Check if the ESD file is OK
36 if (!ef || !ef->IsOpen())
38 cerr<<"Can't read AliESDs.root !\n";
42 // Pointer to the ESD event
44 AliESDEvent* fESD = new AliESDEvent();
46 // Pointer to the esdTree
48 TTree* tree = (TTree*) ef->Get("esdTree");
50 // Check if the esdTree is Ok
54 cerr<<"no ESD tree found\n";
58 fESD->ReadFromTree(tree);
62 // Loop over all events
64 while (tree->GetEvent(n))
69 cout<<endl<<"Processing event number : "<<n++<<endl;
71 // We select only events triggered by ACORDE
73 TString ActiveTriggerDetector = fESD->GetFiredTriggerClasses();
74 printf("Event:%d, Trigger:%s\n",fESD->GetEventNumberInFile(),ActiveTriggerDetector.Data());
76 // if ACORDE trigger is on
77 // else if ACORDE is working as readout just comment the condition
78 if (ActiveTriggerDetector.Contains("AMU") || ActiveTriggerDetector.Contains("SL0") )
81 cout<<endl<<"Processing event number : "<<n++<<endl;
82 printf("Trigger Mask:%s\n",ActiveTriggerDetector.Data());
84 AliESDACORDE *acordeESD = fESD->GetACORDEData();
86 for(Int_t i=0;i<60;i++)
88 if (acordeESD->GetHitChannel(i)==kTRUE)
89 //if (acordeESD->GetACORDEBitPattern(i))
96 } //Only acorde trigger
97 } // Loop over all events from AliESDs.root
99 TCanvas *c1 = new TCanvas();