]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/EveDet/AliEveEMCALData.cxx
ea40eafe7d1c7559ecf5df6c9580b9d741a14cec
[u/mrichter/AliRoot.git] / EVE / EveDet / AliEveEMCALData.cxx
1 //
2 // Fill containers for visualisation of EMCAL data structures
3 //    - read and store MC Hits    - read and store digits from esds or runloader
4 //    - read and store clusters from esds or runloader 
5 //
6 // Author: Magali Estienne (magali.estienne@cern.ch)
7 // June 30 2008
8 //
9
10 //#include <Riostream.h>
11 //#include <vector>
12
13 #include <TTree.h>
14 #include <TBranch.h>
15 #include <TObjArray.h>
16 #include <TRefArray.h>
17 #include <TClonesArray.h>
18 #include <TMath.h>
19 #include <TLorentzVector.h>
20
21 #include "AliRunLoader.h"
22 #include "AliEMCAL.h"
23 #include "AliEMCALLoader.h"
24 #include "AliESDVertex.h"
25 #include "AliEMCALHit.h"
26 #include "AliEMCALDigit.h"
27
28 #include "AliEMCALRecPoint.h"
29 #include "AliESDCaloCells.h"
30 #include "AliESDCaloCluster.h"
31
32 #include "AliEveEMCALData.h"
33 #include "AliEveEMCALSModuleData.h"
34
35 class Riostream;
36 class TObject;
37 class TEveUtil;
38 class TEvePointSet;
39 class AliRun;
40 class AliESDEvent;
41 class AliEMCAL;
42 class AliEMCALGeometry;
43 class AliEveEMCALSModule;
44
45 using std::cout;
46 using std::endl;
47 ClassImp(AliEveEMCALData)
48
49 //______________________________________________________________________________
50 AliEveEMCALData::AliEveEMCALData():
51   TObject(),
52   TEveRefCnt(),
53   fEmcal(0x0),
54   fGeom(0x0),
55   fNode(0x0),
56   fHMatrix(0),
57   fTree(0x0),
58   fESD(0x0),
59   fNsm(12),
60   fNsmfull(10),
61   fNsmhalf(2),
62   fSM(12),
63   fSMfull(10),
64   fSMhalf(2),
65   fRunLoader(0),
66   fDebug(0),
67   fPoint(0)
68 {
69   
70   //
71   // Constructor
72   //
73   //   for(Int_t i=0; i<12; i++)
74   //     fSM[i] = 0x0;
75   //   for(Int_t i=0; i<10; i++)
76   //     fSMfull[i] = 0x0;
77   //   fSMhalf[0] = fSMhalf[1] = 0x0;
78   //  InitEMCALGeom();
79   CreateAllSModules();
80
81
82 }
83
84 //______________________________________________________________________________
85 AliEveEMCALData::AliEveEMCALData(AliRunLoader* rl, TGeoNode* node, TGeoHMatrix* m):
86   TObject(),
87   TEveRefCnt(),
88   fEmcal(0x0),
89   fGeom(0x0),
90   fNode(node),
91   fHMatrix(m),
92   fTree(0x0),
93   fESD(0x0),
94   fNsm(12),
95   fNsmfull(10),
96   fNsmhalf(2),
97   fSM(12),
98   fSMfull(10),
99   fSMhalf(2),
100   fRunLoader(rl),
101   fDebug(0),
102   fPoint(0)
103 {
104   
105   //
106   // Constructor
107   //
108 //   for(Int_t i=0; i<12; i++)
109 //     fSM[i] = 0x0;
110 //   for(Int_t i=0; i<10; i++)
111 //     fSMfull[i] = 0x0;
112 //   fSMhalf[0] = fSMhalf[1] = 0x0;
113   InitEMCALGeom(rl);
114   CreateAllSModules();
115
116
117 }
118
119 //______________________________________________________________________________
120 AliEveEMCALData::~AliEveEMCALData()
121 {
122   //
123   // Destructor
124   //
125
126   DeleteSuperModules();
127   delete fTree;
128   // delete fEmcal; // deleted by run-loader
129   delete fGeom;
130   delete fNode;
131   delete fHMatrix;
132   delete fPoint;
133 }
134
135 //______________________________________________________________________________
136 AliEveEMCALData::AliEveEMCALData(const AliEveEMCALData &edata) :
137   TObject(edata),
138   TEveRefCnt(edata),
139   fEmcal(edata.fEmcal),
140   fGeom(edata.fGeom),
141   fNode(edata.fNode),
142   fHMatrix(edata.fHMatrix),
143   fTree(edata.fTree),
144   fESD(edata.fESD),
145   fNsm(edata.fNsm),
146   fNsmfull(edata.fNsmfull),
147   fNsmhalf(edata.fNsmhalf),
148   fSM(edata.fSM),
149   fSMfull(edata.fSMfull),
150   fSMhalf(edata.fSMhalf),
151   fRunLoader(edata.fRunLoader),
152   fDebug(edata.fDebug),
153   fPoint(edata.fPoint)
154 {
155   //
156   // Copy constructor
157   //
158   InitEMCALGeom(edata.fRunLoader);
159   CreateAllSModules();
160 }
161
162 //______________________________________________________________________________
163 AliEveEMCALData& AliEveEMCALData::operator=(const AliEveEMCALData &edata)
164 {
165   //
166   // Assignment operator
167   //
168
169   if (this != &edata) {
170
171   }
172
173   return *this;
174
175 }
176
177 //______________________________________________________________________________
178 void AliEveEMCALData::SetTree(TTree* const tree)
179 {
180   //
181   // Set digit-tree to be used for digit retrieval. 
182   // Data is loaded on demand.
183   // 
184
185   fTree = tree;
186
187 }
188
189 //______________________________________________________________________________
190 void AliEveEMCALData::SetESD(AliESDEvent* const esd)
191 {
192   //
193   // Set esd
194   //
195
196   fESD = esd;
197 }
198
199 //______________________________________________________________________________
200 void AliEveEMCALData::SetNode(TGeoNode* const node)
201 {
202   //
203   // Set node
204   //
205
206   fNode = node;
207 }
208
209 //______________________________________________________________________________
210 void AliEveEMCALData::InitEMCALGeom(AliRunLoader* const rl)
211 {
212   //
213   // Set data members for EMCAL geometry
214   //
215
216   fEmcal = (AliEMCAL*) rl->GetAliRun()->GetDetector("EMCAL");
217   fGeom  = (AliEMCALGeometry*) fEmcal->GetGeometry();
218
219 }
220
221 //______________________________________________________________________________
222 void AliEveEMCALData::GetGeomInfo(Int_t id, Int_t &iSupMod, Double_t& x, Double_t& y, Double_t& z)
223 {
224   //
225   // Get geometrical information from hit/digit/cluster absolute id
226   //
227
228   Int_t iTower  =  0 ;
229   Int_t iIphi   =  0 ;
230   Int_t iIeta   =  0 ;
231
232   //Geometry methods
233   fGeom->GetCellIndex(id,iSupMod,iTower,iIphi,iIeta);
234   //Gives SuperModule and Tower numbers
235   fGeom->RelPosCellInSModule(id, x, y, z);
236
237 }
238
239 //______________________________________________________________________________
240 void  AliEveEMCALData::CreateAllSModules()
241 {
242   //
243   // Create all fNsm super modules
244   //
245
246   for(Int_t sm = 0; sm < fNsm; sm++)
247     CreateSModule(sm);
248
249 }
250
251 //______________________________________________________________________________
252 void  AliEveEMCALData::CreateSModule(Int_t sm)
253 {
254   //
255   // Create super-module-data for SM if it does not exist already.
256   //
257
258   if(fSM[sm] == 0) fSM[sm] = new AliEveEMCALSModuleData(sm,fGeom,fNode,fHMatrix);
259   if(fSMfull[sm] == 0 && sm < 10) fSMfull[sm] = new AliEveEMCALSModuleData(sm,fGeom,fNode,fHMatrix);
260   if(fSMhalf[sm-10] == 0 && sm > 10) fSMhalf[sm-10] = new AliEveEMCALSModuleData(sm,fGeom,fNode,fHMatrix);
261 }
262
263 //______________________________________________________________________________
264 void AliEveEMCALData::DropAllSModules()
265 {
266   //
267   // Drop data of all existing sectors.
268   //
269
270   for (Int_t sm = 0; sm < fNsm; sm++) {
271     if (fSM[sm] != 0)
272       fSM[sm]->DropData();
273   }
274 }
275
276 //______________________________________________________________________________
277 void AliEveEMCALData::DeleteSuperModules()
278 {
279   //
280   // Delete all super module data
281   //
282
283   for (Int_t sm = 0; sm < fNsm; sm++)
284     {
285       fSM[sm] = 0;
286       delete fSM[sm];
287     }
288
289   for(Int_t smf = 0; smf < fNsmfull; smf++) 
290     {
291       fSMfull[smf] = 0;
292       delete fSMfull[smf];
293     }
294
295   for(Int_t smh = 0; smh < fNsmhalf; smh++)
296     {
297       fSMhalf[smh] = 0;
298       delete fSMhalf[smh];
299     }
300   
301 }
302
303 //______________________________________________________________________________
304 void AliEveEMCALData::LoadHits(TTree* const t)
305 {
306   //
307   // Get hit information from RunLoader
308   //
309
310   /*
311   // These are global coordinates !
312   char form[1000];
313   const char *selection = "";
314   const char *varexp = "fX:fY:fZ";
315   sprintf(form,"EMCAL Hits '%s'", selection);
316   fPoint = new TEvePointSet(form);
317
318   TEvePointSelector ps(t, fPoint, varexp, selection);
319   ps.Select();
320
321   if (fPoint->Size() == 0) {
322     Warning("emcal_hits", Form("No hits match '%s'", selection));
323     delete fPoint;
324     //    return 0;
325   }
326   */
327
328   TObjArray *harr=NULL;
329   TBranch *hbranch=t->GetBranch("EMCAL");
330   hbranch->SetAddress(&harr);
331   
332   if(hbranch->GetEvent(0)) {
333     for(Int_t ih = 0; ih < harr->GetEntriesFast(); ih++) {
334       AliEMCALHit* hit =(AliEMCALHit*)harr->UncheckedAt(ih);
335       if(hit != 0){
336         if(fDebug>1) cout << "Hit info " << hit->GetId() << " " << hit->GetEnergy() << endl;
337         Int_t id = hit->GetId();
338         // These are local coordinates
339         Double_t xl = 0.; Double_t yl = 0.; Double_t zl = 0.;
340         // Get global coordinates
341         Double_t x = hit->X();
342         Double_t y = hit->Y();
343         Double_t z = hit->Z();
344         Double_t amp = hit->GetEnergy();
345         Int_t iSupMod = 0;
346         // Get SM Id
347         GetGeomInfo(id,iSupMod,xl,yl,zl);
348         fSM[iSupMod]->RegisterHit(id,iSupMod,amp,x,y,z);
349       }
350     }
351   }
352 }
353
354 //______________________________________________________________________________
355 void AliEveEMCALData::LoadHitsFromEMCALLoader(AliEMCALLoader* const emcl)
356 {
357   //
358   // Get hit information from EMCAL Loader
359   //
360
361         AliEMCALHit* hit;
362   
363         //Fill array of hits                                                                        
364         TClonesArray *hits = 0;//(TClonesArray*)emcl->Hits();
365         TTree *treeH = emcl->TreeH();   
366         if (treeH) {
367                 Int_t nTrack = treeH->GetEntries();  // TreeH has array of hits for every primary
368                 TBranch * branchH = treeH->GetBranch("EMCAL");
369                 //if(fHits)fHits->Clear();
370                 branchH->SetAddress(&hits);
371                 for (Int_t iTrack = 0; iTrack < nTrack; iTrack++) {
372                         branchH->GetEntry(iTrack);
373                         
374                         //Get hits from the list                                                                    
375                         for(Int_t ihit = 0; ihit< hits->GetEntries();ihit++){
376
377                                 hit = static_cast<AliEMCALHit *>(hits->At(ihit)) ;
378     
379                                 if(hit != 0){
380                                         if(fDebug>1) cout << "Hit info " << hit->GetId() << " " << hit->GetEnergy() << endl;
381
382                                         Int_t id = hit->GetId();
383                                         // These are local coordinates
384                                         Double_t xl = 0.; Double_t yl = 0.; Double_t zl = 0.;
385                                         // Get global coordinates
386                                         Double_t x = hit->X();
387                                         Double_t y = hit->Y();
388                                         Double_t z = hit->Z();
389                                         Double_t amp = hit->GetEnergy();
390                                         Int_t iSupMod = 0;
391                                         // Get SM Id
392                                         GetGeomInfo(id,iSupMod,xl,yl,zl);
393                                         fSM[iSupMod]->RegisterHit(id,iSupMod,amp,x,y,z);
394                                 }//hit exists
395                         }//hit loop
396                         hits->Clear();
397                 }// track loop
398         }//treeH exists
399 }
400
401 //______________________________________________________________________________
402 void AliEveEMCALData::LoadDigits(TTree *t)
403 {
404   //
405   // Get digit information from RunLoader
406   //
407
408   TClonesArray *digits = 0;
409   t->SetBranchAddress("EMCAL", &digits);
410   t->GetEntry(0);
411
412   Int_t nEnt = digits->GetEntriesFast();
413   cout << "nEnt: " << nEnt << endl;
414   AliEMCALDigit * dig;
415
416   //  Double_t amp   = -1 ;
417   Double_t ampFlo   = -1 ;
418   Int_t id      = -1 ;
419   Int_t iSupMod =  0 ;
420   Double_t x, y, z;
421
422   for (Int_t idig = 0; idig < nEnt; idig++)
423     {
424       dig = static_cast<AliEMCALDigit *>(digits->At(idig));
425       
426       if(dig != 0) {
427         id   = dig->GetId() ; //cell (digit) label
428         // adc
429         ampFlo  = dig->GetAmplitude(); //amplitude in cell (digit)
430         // GeV
431         //      amp = ampFlo*0.0153; // To be modified with correct OCDB conversion     
432
433         GetGeomInfo(id,iSupMod,x,y,z);
434
435 //      // GeV
436 //      fSM[iSupMod]->RegisterDigit(id,iSupMod,amp,x,y,z);
437 // //   fSM[iSupMod]->SaveDigit(dig);
438 // //   if(iSupMod<fNsmfull) fSMfull[iSupMod]->RegisterDigit(id,iSupMod,amp,x,y,z);
439 // //   if(iSupMod>fNsmfull) fSMhalf[iSupMod-10]->RegisterDigit(id,iSupMod,amp,x,y,z);
440         fSM[iSupMod]->RegisterDigit(id,iSupMod,ampFlo,x,y,z);
441 //      fSM[iSupMod]->SaveDigit(dig);
442 //      if(iSupMod<fNsmfull) fSMfull[iSupMod]->RegisterDigit(id,iSupMod,amp,x,y,z);
443 //      if(iSupMod>fNsmfull) fSMhalf[iSupMod-10]->RegisterDigit(id,iSupMod,amp,x,y,z);
444       }
445       else {
446         cout << "Digit object empty" << endl;
447         return;
448       }
449     } // end loop digits
450   cout << "after loop on digits !" << endl;
451 }
452
453 //______________________________________________________________________________
454 void AliEveEMCALData::LoadDigitsFromEMCALLoader(AliEMCALLoader* const emcl)
455 {
456
457   //
458   // Get digit information from EMCAL Loader
459   //
460
461   AliEMCALDigit* dig;
462   
463   //Fill array of digits                                                                        
464   TClonesArray *digits = (TClonesArray*)emcl->Digits();
465   
466   //Get digits from the list  
467   
468   //  Double_t amp   = -1 ;
469   Double_t ampFlo   = -1 ;
470   Int_t id      = -1 ;
471   Int_t iSupMod =  0 ;
472   Double_t x, y, z;
473                                                
474    for(Int_t idig = 0; idig< digits->GetEntries();idig++){
475
476      dig = static_cast<AliEMCALDigit *>(digits->At(idig)) ;
477
478      if(dig != 0){
479        if(fDebug>1) cout << "Digit info " << dig->GetId() << " " << dig->GetAmplitude() << endl;
480        id   = dig->GetId() ; //cell (digit) label
481        // adc
482        ampFlo  = dig->GetAmplitude(); //amplitude in cell (digit)
483        // GeV
484        //       amp = ampFlo*0.0153.; // To be modified with correct OCDB conversion
485
486        GetGeomInfo(id,iSupMod,x,y,z);
487        
488        //       // GeV
489        //       fSM[iSupMod]->RegisterDigit(id,iSupMod,amp,x,y,z);
490        // adc
491        fSM[iSupMod]->RegisterDigit(id,iSupMod,ampFlo,x,y,z);
492      }
493       else {
494         cout << "Digit object empty" << endl;
495         return;
496       }
497    } // end loop on digits
498    
499 }
500
501 //______________________________________________________________________________
502 void AliEveEMCALData::LoadDigitsFromESD()
503 {
504   //
505   // Get digit information from esd
506   //
507   
508   AliESDCaloCells &cells= *(fESD->GetEMCALCells());
509   Int_t ncell = cells.GetNumberOfCells() ;  
510   Int_t iSupMod =  0 ;
511   Double_t x, y, z;
512
513   // Extract digit information from the ESDs
514   for (Int_t icell=  0; icell <  ncell; icell++) 
515     {
516       Int_t id   = cells.GetCellNumber(icell);
517       // adc
518       Double_t ampFlo  = cells.GetAmplitude(icell);
519       // GeV
520       //      Double_t amp = ampFlo*0.0153; // To be modified with correct OCDB conversion
521
522       GetGeomInfo(id,iSupMod,x,y,z);
523
524 //       // GeV
525 //       fSM[iSupMod]->RegisterDigit(id,iSupMod,amp,x,y,z);
526 //       if(iSupMod<fNsmfull) fSMfull[iSupMod]->RegisterDigit(id,iSupMod,amp,x,y,z);
527 //       if(iSupMod>fNsmfull) fSMhalf[iSupMod-10]->RegisterDigit(id,iSupMod,amp,x,y,z);
528       // adc
529       fSM[iSupMod]->RegisterDigit(id,iSupMod,ampFlo,x,y,z);
530       if(iSupMod<fNsmfull) fSMfull[iSupMod]->RegisterDigit(id,iSupMod,ampFlo,x,y,z);
531       if(iSupMod>fNsmfull) fSMhalf[iSupMod-10]->RegisterDigit(id,iSupMod,ampFlo,x,y,z);
532
533     } // end loop cells
534 }
535
536 //______________________________________________________________________________
537 void AliEveEMCALData::LoadRecPoints(TTree* const t)
538 {
539   //
540   // Get rec point information from RunLoader
541   //
542
543   //*************************************************
544   // To be improved !!!!!
545   // Size and shape of cluster to be implemented
546   // 
547   //*************************************************
548         
549   // From TTreeR
550   TObjArray *carr=NULL;
551   TBranch *cbranch=t->GetBranch("EMCALECARP");
552   cbranch->SetAddress(&carr);
553   
554   if(cbranch->GetEvent(0)) {
555     for(Int_t ic = 0; ic < carr->GetEntriesFast(); ic++) {
556       AliEMCALRecPoint* rp =(AliEMCALRecPoint*)carr->UncheckedAt(ic);
557       if(rp){
558         if(fDebug>1) cout << "RecPoint info " << rp->GetAbsId() << " " << rp->GetEnergy() << endl;
559         Int_t iSupMod = rp->GetSuperModuleNumber();
560         // GeV
561         Double_t amp = (Double_t)rp->GetEnergy();
562         // adc
563         Double_t ampFlo = amp/0.0153; // To be modified with correct OCDB conversion
564         TVector3 lpos;
565         rp->GetLocalPosition(lpos);
566
567 //      // GeV
568 //      fSM[iSupMod]->RegisterCluster(iSupMod,amp,lpos[0],lpos[1],lpos[2]);
569         // adc
570         fSM[iSupMod]->RegisterCluster(iSupMod,ampFlo,lpos[0],lpos[1],lpos[2]);
571       }
572     }
573   }
574   
575 }
576
577 //______________________________________________________________________________
578 void AliEveEMCALData::LoadRecPointsFromEMCALLoader(AliEMCALLoader* const emcl)
579 {
580   //
581   // Get rec point information from EMCAL Loader
582   //
583
584   //*************************************************
585   // To be improved !!!!!
586   // Size and shape of cluster to be implemented
587   // 
588   //*************************************************
589
590   // From EMCALLoader
591   AliEMCALRecPoint* rp;
592   
593   //Fill array of clusters                                                                        
594   TClonesArray *clusters = (TClonesArray*)emcl->RecPoints();
595   
596   //Get clusters from the list                                                                    
597   for(Int_t iclu = 0; iclu< clusters->GetEntries();iclu++){
598
599     rp = static_cast<AliEMCALRecPoint *>(clusters->At(iclu)) ;
600     
601     if(rp){
602        if(fDebug>1) cout << "RecPoint info " << rp->GetAbsId() << " " << rp->GetEnergy() << endl;
603        Int_t iSupMod = rp->GetSuperModuleNumber();
604        Double_t amp = (Double_t)rp->GetEnergy();
605        Double_t ampFlo = amp/0.0153; // To be modified with correct OCDB conversion
606        TVector3 lpos;
607        rp->GetLocalPosition(lpos);
608        
609 //        // GeV
610 //        fSM[iSupMod]->RegisterCluster(iSupMod,amp,lpos[0],lpos[1],lpos[2]);
611        // adc
612        fSM[iSupMod]->RegisterCluster(iSupMod,ampFlo,lpos[0],lpos[1],lpos[2]);
613     }
614   }
615   
616 }
617
618 //______________________________________________________________________________
619 void AliEveEMCALData::LoadRecPointsFromESD()
620 {
621   //
622   // Get cluster information from esd
623   //
624
625  Int_t iSupMod =  0 ;
626   Double_t x, y, z;
627   Int_t iSM =  0 ;
628   Int_t iT  =  0 ;
629   Int_t iIp   =  0 ;
630   Int_t iIe   =  0 ;
631   Double_t xd, yd, zd;
632   Float_t pos[3] ; 
633   
634   // Get reconstructed vertex position
635   AliESDVertex* primVertex =(AliESDVertex*) fESD->GetVertex();
636   Double_t vertexPosition[3] ; 
637   primVertex->GetXYZ(vertexPosition) ; 
638
639   //Get the CaloClusters
640   //select EMCAL clusters only 
641   TRefArray * caloClusters  = new TRefArray();
642   fESD->GetEMCALClusters(caloClusters);
643   Int_t nclus = caloClusters->GetEntries();
644   cout << "nclus: " << nclus << endl; 
645   
646   for (Int_t iclus =  0; iclus <  nclus; iclus++) 
647     {
648       AliESDCaloCluster *clus = (AliESDCaloCluster *) caloClusters->At(iclus) ; 
649       //Get the cluster info
650       
651       Double_t energy = clus->E() ;
652       // adc
653       //      Int_t   eneInt = (Int_t)energy*500+0.5;
654       Double_t eneInt = energy/0.0153; // To be modified with correct OCDB conversion
655       Double_t disp   = clus->GetDispersion() ;
656       
657       clus->GetPosition(pos) ; // Global position
658       TVector3 vpos(pos[0],pos[1],pos[2]) ;
659       TLorentzVector p4 ;
660       TVector3 p3;
661       clus->GetMomentum(p4,vertexPosition);
662       p3.SetXYZ(p4[0],p4[1],p4[2]);
663       Double_t eta = p3.Eta();
664       Double_t phi = ( (p3.Phi()) < 0) ? (p3.Phi()) + 2. * TMath::Pi() : (p3.Phi());
665       
666       Int_t mult = clus->GetNCells() ;
667       if(fDebug>2) {
668         cout << "In cluster: " << iclus << ", ncells: " << mult << ", energy : " << energy << 
669           ", disp: " << disp << endl;
670         cout << "Cluster " << iclus << ", eta: " << eta << ", phi: " << phi << endl;
671       }
672
673       Int_t clusId = 0;
674       fGeom->GetAbsCellIdFromEtaPhi(eta,phi,clusId);
675       if(fDebug>2) {
676         cout << "Abs Cluster Id: " << clusId << ", xc: " << pos[0] << 
677           ", yc: " << pos[1] << ", zc: " << pos[2] << endl;
678       }
679
680       GetGeomInfo(clusId,iSupMod,x,y,z);
681       
682       //******** Not used yet but will come  ********
683       // AliESDCaloCells &cells= *(fESD->GetEMCALCells());
684       Int_t     digMult = clus->GetNCells() ;
685       UShort_t *digID   = clus->GetCellsAbsId() ;
686       for(Int_t i=0; i<digMult; i++){
687         // Float_t  digitAmp     = cells.GetCellAmplitude(digID[i]) ;
688         fGeom->RelPosCellInSModule(digID[i], xd, yd, zd);
689         //Geometry methods
690         fGeom->GetCellIndex(digID[i],iSM,iT,iIp,iIe);
691         //Gives SuperModule and Tower numbers
692
693       } // end digit loop
694       //*********************************************
695       //      // GeV
696       //      fSM[iSupMod]->RegisterCluster(iSM,energy,x,y,z);
697       // adc
698       fSM[iSupMod]->RegisterCluster(iSM,eneInt,x,y,z);
699
700     } // end cluster loop
701 }
702
703 //______________________________________________________________________________
704 AliEveEMCALSModuleData* AliEveEMCALData::GetSModuleData(Int_t sm)
705 {
706   //
707   // Return super module data
708   //
709
710   if (sm < 0 || sm > fNsm) 
711     {
712       printf("The number of super modules must be lower or equal to %d",fNsm);
713       return 0;
714     }
715   
716   return fSM[sm];
717 }
718
719 //______________________________________________________________________________
720 void AliEveEMCALData::LoadRaw() const
721 {
722   //
723   // Get raw information
724   //
725
726   // To be implemented !
727 }
728