1 #if !defined(__CINT__) || defined(__MAKECINT__)
6 #include "AliCDBManager.h"
7 #include "AliGeomManager.h"
8 #include "AliRunLoader.h"
9 #include "AliESDEvent.h"
10 #include "AliESDCaloCluster.h"
11 #include "AliPHOSGeometry.h"
13 void scanESD(Int_t irun=7727)
15 //This macro scans ESD and fills 3D histogram:
16 //spectrum of clusters with center in each cristall
17 //this histogram can be used e.g. in bad modules selection
18 //Author: D.Peressounko Dmitri.Peressounko@cern.ch
20 //Uncomment the following if misalignement should be applied
21 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
22 // AliCDBManager::Instance()->SetDefaultStorage("local://./");
23 // AliCDBManager::Instance()->SetSpecificStorage("PHOS/*","local:///data/prsnko/");
24 AliCDBManager::Instance()->SetRun(irun) ;
27 TH3D * hEsd = new TH3D("hEsd","Energy of all clusters",64,0.,64.,56,0.,56.,2000,0.,10.) ;
29 //Reading/creation of Geometry
30 AliGeomManager::LoadGeometry("geometry.root");
31 AliPHOSGeometry *phosgeom = AliPHOSGeometry::GetInstance("IHEP","") ;
33 //Create list of ESD files
34 TChain * chain = new TChain("esdTree") ;
36 for(Int_t sec=1; sec<=17; sec++){
37 sprintf(filename,"Seq_%d0/AliESDs.root/esdTree",sec) ;
38 chain->AddFile(filename);
41 AliESDEvent *event = new AliESDEvent();
42 event->ReadFromTree(chain);
44 for(Int_t iEvent=1; iEvent<chain->GetEntries(); iEvent++){
46 printf("Event %d \n",iEvent) ;
48 chain->GetEvent(iEvent);
49 Int_t multClu = event->GetNumberOfCaloClusters();
50 for (Int_t i0=0; i0<multClu; i0++) {
51 AliESDCaloCluster * clu1 = event->GetCaloCluster(i0);
52 Float_t xyz[3] = {0,0,0};
53 clu1->GetPosition(xyz); //Gloabal position in ALICE system
55 phosgeom->RelPosToAbsId(3,xyz[0],xyz[2],absId) ; //Here we assume that data taken with 3 module
57 phosgeom->AbsToRelNumbering(absId,relid) ;
58 hEsd->Fill(relid[2]*1.-0.5, relid[3]*1.-0.5,clu1->E()) ;
62 TFile *ff = new TFile("scan.root","recreate") ;