1 void triggerClusters(Float_t eClu=2., const char* file="AliESDs.root")
4 //Illustrates how to use trigger info in the ESD.
6 //Prints fired 4x4 TRUs and respective PHOS clusters with energy>eClu positions.
7 //For TRU this is bottom-left cell of 4x4 region,
8 //for cluster it is the cell with the max. energy deposition.
10 //Author: Boris Polishchuk (Boris.Polishchuk@cern.ch).
12 TChain* esdTree = new TChain("esdTree");
15 AliESDEvent *esd = new AliESDEvent;
16 esd->ReadFromTree(esdTree);
18 AliPHOSGeometry* geom = AliPHOSGeometry::GetInstance("IHEP");
20 for(Int_t iEvent=0; iEvent<esdTree->GetEntries(); iEvent++){
22 esdTree->GetEvent(iEvent);
23 TString trigClasses = esd->GetFiredTriggerClasses();
25 Int_t multClu = esd->GetNumberOfCaloClusters();
26 AliESDCaloCells *phsCells = esd->GetPHOSCells();
28 AliESDCaloTrigger* trgESD = esd->GetCaloTrigger("PHOS");
31 if(trgESD->GetEntries())
32 printf("\nEvent %d: %d non-zero trigger digits %s\n",
33 iEvent,trgESD->GetEntries(),trigClasses.Data());
35 //Loop over 4x4 fired regions
37 while(trgESD->Next()) {
39 Int_t tmod,tabsId; // "Online" module number, bottom-left 4x4 edge cell absId
40 trgESD->GetPosition(tmod,tabsId);
43 geom->AbsToRelNumbering(tabsId,trelid);
45 printf("\t4x4 position: (mod,X,Z)=(%d,%d,%d)\n",trelid[0],trelid[2],trelid[3]);
47 for (Int_t i=0; i<multClu; i++) {
49 AliESDCaloCluster *c1 = esd->GetCaloCluster(i);
50 if(!c1->IsPHOS()) continue;
52 Int_t maxId, relid[4];
53 MaxEnergyCellPos(phsCells,c1,maxId);
55 geom->AbsToRelNumbering(maxId, relid);
56 if(c1->E()>eClu) printf("\t\tCluster: (mod,X,Z)=(%d,%d,%d), E=%.3f GeV\n",
57 relid[0],relid[2],relid[3],c1->E());
67 void MaxEnergyCellPos(AliESDCaloCells *cells, AliESDCaloCluster* clu, Int_t& maxId)
71 for (Int_t iDig=0; iDig< clu->GetNCells(); iDig++) {
72 Int_t cellAbsId = clu->GetCellAbsId(iDig);
73 Double_t eCell = cells->GetCellAmplitude(cellAbsId)*clu->GetCellAmplitudeFraction(iDig);