]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALv2.cxx
updates for Effective C++ compiler flags
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALv2.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-2004, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /* $Id$ */
17
18 //_________________________________________________________________________
19 //*-- Implementation version v2 of EMCAL Manager class; SHASHLYK version
20 //*-- An object of this class does not produce digits
21 //*-- It is the one to use if you do want to produce outputs in TREEH 
22 //*--                  
23 //*-- Author : Aleksei Pavlinov (WSU)
24
25 // This Class not stores information on all particles prior to EMCAL entry - in order to facilitate analysis.
26 // This is done by setting fIShunt =2, and flagging all parents of particles entering the EMCAL.
27
28 // --- ROOT system ---
29 #include <TParticle.h>
30 #include <TVirtualMC.h>
31 #include <TBrowser.h>
32 #include <TH1.h>
33 #include <TH2.h>
34
35 // --- Standard library ---
36
37 // --- AliRoot header files ---
38 #include "AliEMCALv2.h"
39 #include "AliEMCALHit.h"
40 #include "AliEMCALGeometry.h"
41 #include "AliRun.h"
42 #include "AliHeader.h"
43 #include "AliMC.h"
44 #include "AliPoints.h"
45 // for TRD1 case only; May 31,2006
46
47 ClassImp(AliEMCALv2)
48
49 //______________________________________________________________________
50 AliEMCALv2::AliEMCALv2()
51   : AliEMCALv1(), 
52     fGeometry(0),
53     fHDe(0),
54     fHNhits(0)
55 {
56   // ctor
57 }
58
59 //______________________________________________________________________
60 AliEMCALv2::AliEMCALv2(const char *name, const char *title)
61   : AliEMCALv1(name,title),
62     fGeometry(0),
63     fHDe(0),
64     fHNhits(0)
65 {
66     // Standard Creator.
67
68     fHits= new TClonesArray("AliEMCALHit",1000);
69     gAlice->GetMCApp()->AddHitList(fHits);
70
71     fNhits    = 0;
72     fIshunt   = 2; // All hits are associated with particles entering the calorimeter
73     fTimeCut  = 30e-09;
74
75     fGeometry = GetGeometry(); 
76     fHDe = fHNhits = 0;
77     //    if (gDebug>0){
78     if (1){
79       TH1::AddDirectory(0);
80       fHDe = new TH1F("fHDe","De in EMCAL", 1000, 0., 1.);
81       fHNhits = new TH1F("fHNhits","#hits in EMCAL", 2001, -0.5, 2000.5);
82       fHistograms->Add(fHDe);
83       fHistograms->Add(fHNhits);
84       TH1::AddDirectory(1);
85     }
86 }
87
88 //______________________________________________________________________
89 AliEMCALv2::AliEMCALv2(const AliEMCALv2 & emcal)
90   : AliEMCALv1(emcal),
91     fGeometry(emcal.fGeometry),
92     fHDe(emcal.fHDe),
93     fHNhits(emcal.fHNhits)
94 {
95   //copy ctor
96
97 }
98
99 //______________________________________________________________________
100 AliEMCALv2::~AliEMCALv2(){
101     // dtor
102
103     if ( fHits) {
104         fHits->Delete();
105         delete fHits;
106         fHits = 0;
107     }
108 }
109
110 //______________________________________________________________________
111 void AliEMCALv2::AddHit(Int_t shunt, Int_t primary, Int_t tracknumber, Int_t iparent, Float_t ienergy, 
112                         Int_t id, Float_t * hits,Float_t * p){
113     // Add a hit to the hit list.
114     // An EMCAL hit is the sum of all hits in a tower section
115     //   originating from the same entering particle 
116     static Int_t hitCounter;
117     static AliEMCALHit *newHit, *curHit;
118     static Bool_t deja;
119
120     deja = kFALSE;
121
122     newHit = new AliEMCALHit(shunt, primary, tracknumber, iparent, ienergy, id, hits, p);
123     for ( hitCounter = fNhits-1; hitCounter >= 0 && !deja; hitCounter-- ) {
124         curHit = (AliEMCALHit*) (*fHits)[hitCounter];
125         // We add hits with the same tracknumber, while GEANT treats
126         // primaries succesively
127         if(curHit->GetPrimary() != primary) 
128           break;
129         if( *curHit == *newHit ) {
130             *curHit = *curHit + *newHit;
131             deja = kTRUE;
132             //            break; // 30-aug-04 by PAI 
133         } // end if
134     } // end for hitCounter
135     
136     if ( !deja ) {
137         new((*fHits)[fNhits]) AliEMCALHit(*newHit);
138         fNhits++;
139     }
140     //    printf(" fNhits %i \n", fNhits); 
141     delete newHit;
142 }
143 //______________________________________________________________________
144 void AliEMCALv2::StepManager(void){
145   // Accumulates hits as long as the track stays in a tower
146
147   // position wrt MRS and energy deposited
148   static Float_t        xyzte[5]={0.,0.,0.,0.,0.};// position wrt MRS, time and energy deposited
149   static Float_t        pmom[4]={0.,0.,0.,0.};
150   static TLorentzVector pos; // Lorentz vector of the track current position.
151   static TLorentzVector mom; // Lorentz vector of the track current momentum.
152   static Float_t ienergy = 0;
153   static TString curVolName;
154   static int supModuleNumber, moduleNumber, yNumber, xNumber, absid;
155   static int keyGeom=1;
156   static char *vn = "SCMX"; // Apr 13, 2006 - only TRD1 case now
157   //  static char *vn = "SX"; // 15-mar-05
158   static int nSMOP[7]={1,3,5,7,9,11}; // 30-mar-05
159   static int nSMON[7]={2,4,6,8,10,12};
160   static Float_t depositedEnergy=0.0; 
161
162   if(keyGeom == 0) {
163     keyGeom = 2;
164     if(gMC->VolId("PBMO")==0 || gMC->VolId("WSUC")==1) {
165       vn      = "SCMX";   // old TRD2(TRD1) or WSUC
166       keyGeom = 1;
167     }    
168     printf("AliEMCALv2::StepManager():  keyGeom %i : Sensetive volume %s \n", 
169     keyGeom, vn); 
170     if(gMC->VolId("WSUC")==1) printf(" WSUC - cosmic ray stand geometry \n");
171   }
172   Int_t tracknumber =  gAlice->GetMCApp()->GetCurrentTrackNumber();
173
174   curVolName = gMC->CurrentVolName();
175   if(curVolName.Contains(vn)) { // We are in a scintillator layer
176     //    printf(" keyGeom %i : Sensetive volume %s (%s) \n", keyGeom, curVolName.Data(), vn); 
177     
178     if( ((depositedEnergy = gMC->Edep()) > 0.)  && (gMC->TrackTime() < fTimeCut)){// Track is inside a scintillator and deposits some energy
179       //       Info("StepManager "," entry %i DE %f",++ientry, depositedEnergy); // for testing
180        if (fCurPrimary==-1) 
181         fCurPrimary=gAlice->GetMCApp()->GetPrimary(tracknumber);
182
183       if (fCurParent==-1 || tracknumber != fCurTrack) {
184         // Check parentage
185         Int_t parent=tracknumber;
186         if (fCurParent != -1) {
187           while (parent != fCurParent && parent != -1) {
188             TParticle *part=gAlice->GetMCApp()->Particle(parent);
189             parent=part->GetFirstMother();
190           }
191         }
192         if (fCurParent==-1 || parent==-1) {
193           Int_t parent=tracknumber;
194           TParticle *part=gAlice->GetMCApp()->Particle(parent);
195           while (parent != -1 && fGeometry->IsInEMCAL(part->Vx(),part->Vy(),part->Vz())) {
196             parent=part->GetFirstMother();
197             if (parent!=-1) 
198               part=gAlice->GetMCApp()->Particle(parent);
199           } 
200           fCurParent=parent;
201           if (fCurParent==-1)
202             Error("StepManager","Cannot find parent");
203           else {
204             TParticle *part=gAlice->GetMCApp()->Particle(fCurParent);
205             ienergy = part->Energy(); 
206           }
207           while (parent != -1) {
208             part=gAlice->GetMCApp()->Particle(parent);
209             part->SetBit(kKeepBit);
210             parent=part->GetFirstMother();
211           }
212         }
213         fCurTrack=tracknumber;
214       }    
215       gMC->TrackPosition(pos);
216       xyzte[0] = pos[0];
217       xyzte[1] = pos[1];
218       xyzte[2] = pos[2];
219       xyzte[3] = gMC->TrackTime() ;       
220       
221       gMC->TrackMomentum(mom);
222       pmom[0] = mom[0];
223       pmom[1] = mom[1];
224       pmom[2] = mom[2];
225       pmom[3] = mom[3];
226       
227       //      if(ientry%200 > 0) return; // testing
228       supModuleNumber = moduleNumber = yNumber = xNumber = absid = 0;
229       if(keyGeom >= 1) { // old style
230         gMC->CurrentVolOffID(4, supModuleNumber);
231         gMC->CurrentVolOffID(3, moduleNumber);
232         gMC->CurrentVolOffID(1, yNumber);
233         gMC->CurrentVolOffID(0, xNumber); // really x number now
234         if(strcmp(gMC->CurrentVolOffName(4),"SM10")==0) supModuleNumber += 10; // 13-oct-05
235       } else {
236         gMC->CurrentVolOffID(5, supModuleNumber);
237         gMC->CurrentVolOffID(4, moduleNumber);
238         gMC->CurrentVolOffID(1, yNumber);
239         gMC->CurrentVolOffID(0, xNumber);
240         if     (strcmp(gMC->CurrentVolOffName(5),"SMOP")==0) supModuleNumber = nSMOP[supModuleNumber-1];
241         else if(strcmp(gMC->CurrentVolOffName(5),"SMON")==0) supModuleNumber = nSMON[supModuleNumber-1];
242         else   assert(0); // something wrong
243       }
244       absid = fGeometry->GetAbsCellId(supModuleNumber-1, moduleNumber-1, yNumber-1, xNumber-1);
245     
246       if (absid < 0) Fatal("StepManager()", "Wrong id ") ;
247
248       Float_t lightYield =  depositedEnergy ;
249       // Apply Birk's law (copied from G3BIRK)
250
251       if (gMC->TrackCharge()!=0) { // Check
252           Float_t birkC1Mod = 0;
253         if (fBirkC0==1){ // Apply correction for higher charge states
254           if (TMath::Abs(gMC->TrackCharge())>=2) birkC1Mod = fBirkC1*7.2/12.6;
255           else                                   birkC1Mod = fBirkC1;
256         }
257
258         Float_t dedxcm;
259         if (gMC->TrackStep()>0)  dedxcm=1000.*gMC->Edep()/gMC->TrackStep();
260         else                     dedxcm=0;
261         lightYield=lightYield/(1.+birkC1Mod*dedxcm+fBirkC2*dedxcm*dedxcm);
262       } 
263
264       // use sampling fraction to get original energy --HG
265       //      xyzte[4] = lightYield * fGeometry->GetSampling();
266       xyzte[4] = lightYield; // 15-dec-04
267         
268       if (gDebug == -2) 
269       printf("#sm %2i #m %3i #x %1i #z %1i -> absid %i : xyzte[4] = %f\n",
270       supModuleNumber,moduleNumber,yNumber,xNumber,absid, xyzte[4]);
271
272       AddHit(fIshunt, fCurPrimary,tracknumber, fCurParent, ienergy, absid,  xyzte, pmom);
273     } // there is deposited energy
274   }
275 }
276
277 void AliEMCALv2::FinishEvent()
278
279   // Calculate deposit energy and fill control histogram; 26-may-05
280   static double de=0.;
281   fHNhits->Fill(double(fHits->GetEntries()));
282   de = GetDepositEnergy(0);
283   if(fHDe) fHDe->Fill(de);
284 }
285
286 Double_t AliEMCALv2::GetDepositEnergy(int print)
287
288   // 23-mar-05 - for testing
289   if(fHits == 0) return 0.;
290   AliEMCALHit  *hit=0;
291   Double_t de=0.;
292   for(int ih=0; ih<fHits->GetEntries(); ih++) {
293     hit = (AliEMCALHit*)fHits->UncheckedAt(ih);
294     de += hit->GetEnergy();
295   }
296   if(print>0) {
297     cout<<"AliEMCALv2::GetDepositEnergy() : fHits "<<fHits<<endl; 
298     printf(" #hits %i de %f \n", fHits->GetEntries(), de);
299     if(print>1) {
300       printf(" #primary particles %i\n", gAlice->GetHeader()->GetNprimary()); 
301     }
302   }
303   return de;
304 }
305
306 void AliEMCALv2::Browse(TBrowser* b)
307 {
308   TObject::Browse(b);
309 }
310
311 void AliEMCALv2::DrawCalorimeterCut(const char *name, int axis, double dcut)
312
313   // Size of tower is 5.6x5.6x24.8 (25.0); cut on Z axiz
314   TString g(fGeometry->GetName());
315   g.ToUpper();
316   gMC->Gsatt("*", "seen", 0);
317
318   int fill = 1;
319
320   if(axis!=1) SetVolumeAttributes("STPL", 1, 1, fill);
321
322   int colo=4;
323   TString sn(name);
324   if(sn.Contains("SCM")) colo=5;
325   SetVolumeAttributes(name, 1, colo, fill);
326   if(g.Contains("110DEG") && sn=="SMOD") SetVolumeAttributes("SM10", 1, colo, fill);
327
328   TString st(GetTitle());
329   st += ", zcut, ";
330   st += name;
331
332   char *optShad = "on", *optHide="on";
333   double cxy=0.02;
334   if     (axis==1) {
335     dcut = 0.;
336     //    optHide = optShad = "off";
337   } else if(axis==2){
338     if(dcut==0.) SetVolumeAttributes("SCM0", 1, 5, fill); // yellow    
339   }
340
341   gMC->Gdopt("hide", optHide);
342   gMC->Gdopt("shad", optShad);
343
344   gROOT->ProcessLine("TGeant3 *g3 = (TGeant3*)gMC");
345   char cmd[200];
346   sprintf(cmd,"g3->Gdrawc(\"XEN1\", %i, %5.1f, 12., 8., %3.2f, %3.2f)\n", axis, dcut, cxy,cxy);
347   printf("\n%s\n",cmd); gROOT->ProcessLine(cmd);
348
349   sprintf(cmd,"gMC->Gdhead(1111, \"%s\")\n", st.Data());
350   printf("%s\n",cmd); gROOT->ProcessLine(cmd);
351 }
352
353 void AliEMCALv2::DrawSuperModuleCut(const char *name, int axis, double dcut, int fill)
354
355  // Size of tower is 5.6x5.6x24.8 (25.0); cut on Z axiz
356   TString sn(GetGeometry()->GetName());
357   sn.ToUpper();
358   char *tit[3]={"xcut", "ycut", "zcut"};
359   if(axis<1) axis=1; if(axis>3) axis=3;
360
361   gMC->Gsatt("*", "seen", 0);
362   //  int fill = 6;
363
364   // SetVolumeAttributes("SMOD", 1, 1, fill);  // black
365   SetVolumeAttributes(name, 1, 5, fill);    // yellow 
366
367   double cxy=0.055, x0=10., y0=10.;
368   char *optShad = "on", *optHide="on";
369   if(sn.Contains("TRD1")) {
370     SetVolumeAttributes("STPL", 1, 3, fill);  // green 
371     if     (axis==1) {
372       gMC->Gsatt("STPL", "seen", 0);
373       dcut = 0.;
374       optHide = "off";
375       optShad = "off";
376     } else if(axis==3) cxy = 0.1;
377   } else if(sn.Contains("TRD2")) {
378     y0 = -10.;
379     if (axis==2) cxy=0.06;
380   }
381   gMC->Gdopt("hide", optHide);
382   gMC->Gdopt("shad", optShad);
383
384   TString st("Shish-Kebab, Compact, SMOD, ");
385   if(sn.Contains("TWIST")) st = "Shish-Kebab, Twist, SMOD, ";
386   st += tit[axis-1];;
387
388   gROOT->ProcessLine("TGeant3 *g3 = (TGeant3*)gMC");
389   char cmd[200];
390   sprintf(cmd,"g3->Gdrawc(\"SMOD\", %i, %6.3f, %5.1f, %5.1f, %5.3f, %5.3f)\n",axis,dcut,x0,y0,cxy,cxy);
391   printf("\n%s\n",cmd); gROOT->ProcessLine(cmd);
392
393   sprintf(cmd,"gMC->Gdhead(1111, \"%s\")\n", st.Data());
394   printf("%s\n",cmd); gROOT->ProcessLine(cmd);
395   // hint for testing
396   if(sn.Contains("TRD1")){
397     printf("Begin of super module\n");
398     printf("g3->Gdrawc(\"SMOD\", 2,  0.300, 89., 10., 0.5, 0.5)\n");
399     printf("Center of super modules\n");
400     printf("g3->Gdrawc(\"SMOD\", 2,  0.300, 0., 10., 0.5, 0.5)\n");
401     printf("end of super modules\n");
402     printf("g3->Gdrawc(\"SMOD\", 2,  0.300, -70., 10., 0.5, 0.5)\n");
403   } else if(sn.Contains("TRD2")){
404     printf("Begin of super module  ** TRD2 ** \n");
405     printf("g3->Gdrawc(\"SMOD\", 2,  0.00,  40., -80, 0.2, 0.2)\n");
406     printf("end of super modules\n");
407     printf("g3->Gdrawc(\"SMOD\", 2,  0.00, -20., -80, 0.2, 0.2)\n");
408
409     printf(" ***  Z cut (Y|X plane)\n scale 0.4\n");
410     printf("g3->Gdrawc(\"SMOD\", 3,  -170.,-165.,10.,0.4,0.4)\n");
411     printf(" scale 0.2\n");
412     printf("g3->Gdrawc(\"SMOD\", 3,  -170.,-80.,10.,0.2,0.2)\n");
413     printf(" scale 0.12\n");
414     printf("g3->Gdrawc(\"SMOD\", 3,   -170.,-45.,10.,0.12,0.12)\n");
415   }
416 }
417
418 void AliEMCALv2::DrawTowerCut(const char *name, int axis, double dcut, int fill, char *optShad)
419
420   // Size of tower is 5.6x5.6x24.8 (25.0); cut on Z axiz
421   if(axis<1) axis=1; if(axis>3) axis=3;
422   TString mn(name); mn.ToUpper();
423   TString sn(GetGeometry()->GetName());
424
425   gMC->Gsatt("*", "seen", 0);
426   gMC->Gsatt("*", "fill", fill);
427
428   // int mainColo=5; // yellow
429   if(mn == "EMOD") {
430     SetVolumeAttributes(mn.Data(), 1, 1, fill);
431     SetVolumeAttributes("SCM0", 1, 5, fill); // yellow
432     SetVolumeAttributes("SCPA", 1, 3, fill); // green - 13-may-05
433   } else if(mn == "SCM0") { // first division 
434     SetVolumeAttributes(mn.Data(), 1, 1, fill);
435     SetVolumeAttributes("SCMY", 1, 5, fill); // yellow
436   } else if(mn == "SCMY") { // first division 
437     SetVolumeAttributes(mn.Data(), 1, 1, fill); 
438     if(sn.Contains("TEST") && sn.Contains("3X3")) {
439       SetVolumeAttributes("SCX1", 1, 5, fill); // yellow
440       SetVolumeAttributes("SCX2", 1, 2, fill); // red
441       SetVolumeAttributes("SCX3", 1, 3, fill); // green
442     } else {
443       SetVolumeAttributes("SCMX", 1, 5, fill); // yellow
444     }
445   } else if(mn == "SCMX" || mn.Contains("SCX")) {
446     SetVolumeAttributes(mn.Data(), 1, 5, fill);// yellow
447     SetVolumeAttributes("PBTI", 1, 4, fill);
448   } else {
449     printf("<W> for volume |%s| did not defined volume attributes\n", mn.Data());
450   }
451
452   //  TString st("Shish-Kebab, 2x2 mm sampling, 62 layers, ");
453   TString st("Shashlyk, 2x2 mm sampling, 62 layers, ");
454   if    (sn.Contains("25"))   st = "Shish-Kebab, 5x5 mm sampling, 25 layers, ";
455   else if(sn.Contains("MAY05"))   st = "Shish-Kebab, 5x5 mm sampling, 77 layers, ";
456   if(sn.Contains("TRD1")) st += " TRD1, ";
457   if(sn.Contains("3X3"))  st += " 3x3, ";
458   st += name;
459
460   gROOT->ProcessLine("TGeant3 *g3 = (TGeant3*)gMC");
461   double cx=0.78, cy=2.;
462   if     (axis==1 && sn.Contains("TRD")==0) {
463    cx = cy = 1.;
464    gMC->Gsatt("PBTI", "seen", 0);
465   } else if (sn.Contains("TEST") && sn.Contains("3X3")) {
466     cx = cy = 0.7;
467     if (axis==3) cx = cy = 1.;
468   } else if (sn.Contains("TRD2")) {
469     if (axis==3) cx = cy = 2.;
470   } else if (mn.Contains("EMOD")) {
471     cx = cy = 0.5;
472   }
473   char cmd[200];
474
475   gMC->Gdopt("hide", optShad);
476   gMC->Gdopt("shad", optShad);
477
478   sprintf(cmd,"g3->Gdrawc(\"%s\", %i, %6.2f, 10., 10., %5.3f, %5.3f)\n",name, axis,dcut,cx,cy);
479   printf("\n%s\n",cmd); gROOT->ProcessLine(cmd);
480
481   sprintf(cmd,"gMC->Gdhead(1111, \"%s\")\n", st.Data());
482   printf("%s\n",cmd); gROOT->ProcessLine(cmd);
483 }
484   
485 void AliEMCALv2::DrawAlicWithHits(int mode)
486
487  // 20-sep-04; does not work now
488   static TH2F *h2;
489   if(h2==0) h2 = new TH2F("h2","test fo hits", 60,0.5,60.5, 28,0.5,28.5);
490   else      h2->Reset();
491   if(mode==0) {
492     gROOT->ProcessLine("TGeant3 *g3 = (TGeant3*)gMC");
493     gMC->Gsatt("*","seen",0);
494     gMC->Gsatt("scm0","seen",5);
495
496     gROOT->ProcessLine("g3->Gdrawc(\"ALIC\", 1,   2.0, 12., -130, 0.3, 0.3)");
497     // g3->Gdrawc("ALIC", 1,   2.0, 10., -14, 0.05, 0.05)
498   }
499
500   TClonesArray *hits = Hits();
501   Int_t nhits = hits->GetEntries(), absId, nSupMod, nTower, nIphi, nIeta, iphi, ieta;
502   AliEMCALHit *hit = 0;
503   Double_t de, des=0.;
504   for(Int_t i=0; i<nhits; i++) {
505     hit   = (AliEMCALHit*)hits->UncheckedAt(i);
506     absId = hit->GetId();
507     de    = hit->GetEnergy();
508     des += de;
509     if(fGeometry->GetCellIndex(absId, nSupMod, nTower, nIphi, nIeta)){
510       //      printf(" de %f abs id %i smod %i tower %i | cell iphi %i : ieta %i\n",
511       // de, absId, nSupMod, nTower, nIphi, nIeta); 
512       if(nSupMod==3) {
513         fGeometry->GetCellPhiEtaIndexInSModule(nSupMod,nTower,nIphi,nIeta, iphi,ieta);
514         // printf(" iphi %i : ieta %i\n", iphi,ieta);
515         h2->Fill(double(ieta),double(iphi), de);
516       }
517     }
518     //    hit->Dump();
519   }
520   printf(" #hits %i : sum de %f -> %f \n", nhits, des, h2->Integral());
521   if(mode>0 && h2->Integral()>0.) h2->Draw();
522 }
523
524 void AliEMCALv2::SetVolumeAttributes(const char *name, int seen, int color, int fill)
525 {
526  /* seen=-2:volume is visible but none of its descendants;
527          -1:volume is not visible together with all its descendants;
528           0:volume is not visible;
529           1:volume is     visible. */
530   gMC->Gsatt(name, "seen", seen);
531   gMC->Gsatt(name, "colo", color);
532   gMC->Gsatt(name, "fill", fill); 
533   printf(" %s : seen %i color %i fill %i \n", name, seen, color, fill);
534
535
536 void AliEMCALv2::TestIndexTransition(int pri, int idmax)
537
538  // Test for EMCAL_SHISH geometry
539   TString sn(fGeometry->GetName());
540   if(!sn.Contains("SHISH")) {
541     printf("Wrong geometry |%s| ! Bye \n", sn.Data());
542     return; 
543   }
544
545   Int_t nSupMod, nTower, nIphi, nIeta, idNew, nGood=0;
546   if(idmax==0) idmax = fGeometry->GetNCells();
547   for(Int_t id=1; id<=idmax; id++) {
548     if(!fGeometry->GetCellIndex(id, nSupMod, nTower, nIphi, nIeta)){
549       printf(" Wrong abs ID %i : #cells %i\n", id, fGeometry->GetNCells());
550       break;  
551     }
552     idNew = fGeometry->GetAbsCellId(nSupMod, nTower, nIphi, nIeta);
553     if(id != idNew || pri>0) {
554       printf(" ID %i : %i <- new id\n", id, idNew);
555       printf(" nSupMod   %i ",  nSupMod);
556       printf(" nTower    %i ", nTower);
557       printf(" nIphi     %i ", nIphi);
558       printf(" nIeta     %i \n", nIeta);
559      
560     } else nGood++;
561   }
562   printf(" Good decoding %i : %i <- #cells \n", nGood, fGeometry->GetNCells());
563 }