12 #if !defined(__CINT__) || defined(__MAKECINT__) 14 #include <Riostream.h> 17 #include <TParticle.h> 20 #include <TObjArray.h> 25 #include <TParticle.h> 26 #include <TRefArray.h> 47 const TString dirName,
48 const TString esdTreeName,
54 TChain * cESDTree =
new TChain(esdTreeName) ;
57 void * from = gSystem->OpenDirectory(dirName) ;
65 while( (subdir = gSystem->GetDirEntry(from)) &&
66 (cESDTree->GetEntries() < eventsToRead))
68 if ( strstr(subdir, pattern) != 0 ) {
70 sprintf(file,
"%s%s/AliESDs.root", dirName.Data(), subdir);
86 const TString dirName,
87 const TString esdTreeName,
93 if ( esdTreeName ==
"" )
95 else if ( strcmp(pattern,
"") == 0 )
114 TString det =
"EMCAL",
const UInt_t eventsToProcess = 5,
115 TString dirName =
"./",
116 const TString esdTreeName =
"esdTree",
117 const char * pattern =
"." 120 if(det !=
"EMCAL" && det !=
"PHOS" )
122 cout <<
"Wrong detector name "<<det<<endl;
128 TChain * t =
AliReadESD(eventsToProcess, dirName,esdTreeName,pattern) ;
136 TString alirunName =
"" ;
141 for (event = 0;
event < eventsToProcess;
event++)
144 Int_t nbytes = t->GetEntry(event);
149 if (alirunName != t->GetFile()->GetName())
151 alirunName = t->GetFile()->GetName() ;
152 alirunName.ReplaceAll(
"galice.root",
"AliESDs.root") ;
163 Double_t vertex_position[3] ;
176 cout<<
">>> Event "<<
event<<
" ncells "<<ncell<<
" type "<<type<<endl;
189 TRefArray * caloClusters =
new TRefArray();
194 Int_t nclus = caloClusters->GetEntries() ;
196 cout<<
"Event: "<<
event<<
"; Number of clusters "<<nclus<<endl;
199 for (Int_t iclus = 0; iclus < nclus; iclus++)
206 Float_t energy = clus->
E() ;
211 TVector3 vpos(pos[0],pos[1],pos[2]) ;
220 cout<<
"Cluster "<<iclus <<
"; digits mult "<<mult<<
"; type "<<(Int_t )clus->
GetType()
221 <<
"; Energy "<<energy
222 <<
"; Phi "<<(vpos.Phi()*180/TMath::Pi())<<
"; Eta "<<vpos.Eta()
223 <<
"; label "<<iprim<<endl;
226 if(iprim>=0 && iprim < sta->GetNtrack())
230 cout<<
" Primary: "<<particle->GetName()<<
"; Energy "<<particle->Energy()<<endl;
233 cout <<
"PROBLEM, label is too large : "<<iprim
234 <<
" >= particles in stack "<< sta->
GetNtrack() <<endl;
236 cout<<
"Negative label!!! : "<<iprim<<endl;
239 for(Int_t i = 0; i < mult ; i++)
241 Int_t absId = index[i];
242 Double_t ampFract = fraction[i];
246 cout<<
"AbsID : "<< absId <<
"; Amplitude "<< amp
247 <<
"; Fraction "<<ampFract<<
"; Time " <<time<<endl;
static const TString & GetDefaultEventFolderName()
void TestESDCaloClusterAndCell(TString det="EMCAL", const UInt_t eventsToProcess=5, TString dirName="./", const TString esdTreeName="esdTree", const char *pattern=".")
virtual void GetXYZ(Double_t position[3]) const
static AliRunLoader * Open(const char *filename="galice.root", const char *eventfoldername=AliConfig::GetDefaultEventFolderName(), Option_t *option="READ")
UShort_t * GetCellsAbsId()
void GetMomentum(TLorentzVector &p, const Double_t *vertexPosition) const
virtual Int_t GetNtrack() const
TChain * AliReadESDfromdisk(const UInt_t eventsToRead, const TString dirName, const TString esdTreeName, const char *pattern)
AliESDCaloCells * GetPHOSCells() const
AliESDCaloCells * GetEMCALCells() const
Int_t GetEMCALClusters(TRefArray *clusters) const
Double_t GetCellAmplitude(Short_t cellNumber)
Calorimeter cluster data container.
Int_t GetEvent(Int_t evno)
TParticle * Particle(Int_t id, Bool_t useInEmbedding=kFALSE)
void ReadFromTree(TTree *tree, Option_t *opt="")
const AliESDVertex * GetVertex() const
Short_t GetNumberOfCells() const
Class for calorimeter cell ESD data handling.
Double32_t * GetCellsAmplitudeFraction()
void GetPosition(Float_t *x) const
Int_t LoadKinematics(Option_t *option="READ")
Double_t GetCellTime(Short_t cellNumber)
TChain * AliReadESD(const UInt_t eventsToRead, const TString dirName, const TString esdTreeName, const char *pattern)
Read AliESDs files and return a Chain of events.
Int_t GetPHOSClusters(TRefArray *clusters) const