1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 //_________________________________________________________________________
18 // Class utility for Calorimeter specific selection methods ///
22 //-- Author: Gustavo Conesa (LPSC-Grenoble)
23 //////////////////////////////////////////////////////////////////////////////
26 // --- ROOT system ---
27 #include "TGeoManager.h"
29 //---- ANALYSIS system ----
30 #include "AliCalorimeterUtils.h"
31 #include "AliVEvent.h"
32 #include "AliMCEvent.h"
34 #include "AliAODPWG4Particle.h"
35 #include "AliVCluster.h"
36 #include "AliVCaloCells.h"
37 #include "AliMixedEvent.h"
40 ClassImp(AliCalorimeterUtils)
43 //____________________________________________________________________________
44 AliCalorimeterUtils::AliCalorimeterUtils() :
46 fEMCALGeoName("EMCAL_FIRSTYEAR"),fPHOSGeoName("PHOSgeo"),
47 fEMCALGeo(0x0), fPHOSGeo(0x0),
48 fEMCALGeoMatrixSet(kFALSE), fPHOSGeoMatrixSet(kFALSE),
49 fRemoveBadChannels(kFALSE),
50 fEMCALBadChannelMap(0x0),fPHOSBadChannelMap(0x0),
51 fNCellsFromEMCALBorder(0), fNCellsFromPHOSBorder(0),
52 fNoEMCALBorderAtEta0(kFALSE),fRecalibration(kFALSE),
53 fEMCALRecalibrationFactors(), fPHOSRecalibrationFactors()
57 //Initialize parameters
61 //_________________________________
62 AliCalorimeterUtils::~AliCalorimeterUtils() {
65 //if(fPHOSGeo) delete fPHOSGeo ;
66 if(fEMCALGeo) delete fEMCALGeo ;
68 if(fEMCALBadChannelMap) {
69 fEMCALBadChannelMap->Clear();
70 delete fEMCALBadChannelMap;
72 if(fPHOSBadChannelMap) {
73 fPHOSBadChannelMap->Clear();
74 delete fPHOSBadChannelMap;
77 if(fEMCALRecalibrationFactors) {
78 fEMCALRecalibrationFactors->Clear();
79 delete fEMCALRecalibrationFactors;
81 if(fPHOSRecalibrationFactors) {
82 fPHOSRecalibrationFactors->Clear();
83 delete fPHOSRecalibrationFactors;
88 //_______________________________________________________________
89 Bool_t AliCalorimeterUtils::CheckCellFiducialRegion(AliVCluster* cluster, AliVCaloCells* cells, AliVEvent * event, Int_t iev) const {
91 // Given the list of AbsId of the cluster, get the maximum cell and
92 // check if there are fNCellsFromBorder from the calorimeter border
94 //If the distance to the border is 0 or negative just exit accept all clusters
95 if(cells->GetType()==AliVCaloCells::kEMCALCell && fNCellsFromEMCALBorder <= 0 ) return kTRUE;
96 if(cells->GetType()==AliVCaloCells::kPHOSCell && fNCellsFromPHOSBorder <= 0 ) return kTRUE;
101 AliMixedEvent * mixEvent = dynamic_cast<AliMixedEvent*> (event);
102 Int_t nMixedEvents = 0 ;
103 Int_t * cellsCumul = NULL ;
104 Int_t numberOfCells = 0 ;
106 nMixedEvents = mixEvent->GetNumberOfEvents() ;
107 if (cells->GetType()==AliVCaloCells::kEMCALCell) {
108 cellsCumul = mixEvent->GetEMCALCellsCumul() ;
109 numberOfCells = mixEvent->GetNumberOfEMCALCells() ;
112 else if (cells->GetType()==AliVCaloCells::kPHOSCell) {
113 cellsCumul = mixEvent->GetPHOSCellsCumul() ;
114 numberOfCells = mixEvent->GetNumberOfPHOSCells() ;
116 Int_t startCell = cellsCumul[iev] ;
117 Int_t endCell = (iev+1 < nMixedEvents)?cellsCumul[iev+1]:numberOfCells;
118 //Find cells with maximum amplitude
119 for(Int_t i = 0; i < cluster->GetNCells() ; i++){
120 Int_t absId = cluster->GetCellAbsId(i) ;
121 for (Int_t j = startCell; j < endCell ; j++) {
125 cells->GetCell(j, cellNumber, amp, time) ;
126 if (absId == cellNumber) {
135 for(Int_t i = 0; i < cluster->GetNCells() ; i++){
136 Int_t absId = cluster->GetCellAbsId(i) ;
137 Float_t amp = cells->GetCellAmplitude(absId);
146 printf("AliCalorimeterUtils::CheckCellFiducialRegion() - Cluster Max AbsId %d, Cell Energy %2.2f, Cluster Energy %2.2f\n",
147 absIdMax, ampMax, cluster->E());
149 if(absIdMax==-1) return kFALSE;
151 //Check if the cell is close to the borders:
152 Bool_t okrow = kFALSE;
153 Bool_t okcol = kFALSE;
155 if(cells->GetType()==AliVCaloCells::kEMCALCell){
157 Int_t iTower = -1, iIphi = -1, iIeta = -1, iphi = -1, ieta = -1, iSM = -1;
158 fEMCALGeo->GetCellIndex(absIdMax,iSM,iTower,iIphi,iIeta);
159 fEMCALGeo->GetCellPhiEtaIndexInSModule(iSM,iTower,iIphi, iIeta,iphi,ieta);
160 if(iSM < 0 || iphi < 0 || ieta < 0 ) {
161 Fatal("CheckCellFidutialRegion","Negative value for super module: %d, or cell ieta: %d, or cell iphi: %d, check EMCAL geometry name\n",iSM,ieta,iphi);
166 if(iphi >= fNCellsFromEMCALBorder && iphi < 24-fNCellsFromEMCALBorder) okrow =kTRUE;
169 if(iphi >= fNCellsFromEMCALBorder && iphi < 12-fNCellsFromEMCALBorder) okrow =kTRUE;
173 if(!fNoEMCALBorderAtEta0){
174 if(ieta > fNCellsFromEMCALBorder && ieta < 48-fNCellsFromEMCALBorder) okcol =kTRUE;
178 if(ieta >= fNCellsFromEMCALBorder) okcol = kTRUE;
181 if(ieta < 48-fNCellsFromEMCALBorder) okcol = kTRUE;
186 printf("AliCalorimeterUtils::CheckCellFiducialRegion() - EMCAL Cluster in %d cells fiducial volume: ieta %d, iphi %d, SM %d ?",
187 fNCellsFromEMCALBorder, ieta, iphi, iSM);
188 if (okcol && okrow ) printf(" YES \n");
189 else printf(" NO: column ok? %d, row ok? %d \n",okcol,okrow);
192 else if(cells->GetType()==AliVCaloCells::kPHOSCell){
194 Int_t irow = -1, icol = -1;
195 fPHOSGeo->AbsToRelNumbering(absIdMax,relId);
199 if(irow >= fNCellsFromPHOSBorder && irow < 64-fNCellsFromPHOSBorder) okrow =kTRUE;
200 if(icol >= fNCellsFromPHOSBorder && icol < 56-fNCellsFromPHOSBorder) okcol =kTRUE;
203 printf("AliCalorimeterUtils::CheckCellFiducialRegion() - PHOS Cluster in %d cells fiducial volume: icol %d, irow %d, Module %d?",
204 fNCellsFromPHOSBorder, icol, irow, relId[0]-1);
205 if (okcol && okrow ) printf(" YES \n");
206 else printf(" NO: column ok? %d, row ok? %d \n",okcol,okrow);
210 if (okcol && okrow) return kTRUE;
215 //_________________________________________________________________________________________________________
216 Bool_t AliCalorimeterUtils::ClusterContainsBadChannel(TString calorimeter,UShort_t* cellList, Int_t nCells){
217 // Check that in the cluster cells, there is no bad channel of those stored
218 // in fEMCALBadChannelMap or fPHOSBadChannelMap
220 if (!fRemoveBadChannels) return kFALSE;
221 //printf("fEMCALBadChannelMap %p, fPHOSBadChannelMap %p \n",fEMCALBadChannelMap,fPHOSBadChannelMap);
222 if(calorimeter == "EMCAL" && !fEMCALBadChannelMap) return kFALSE;
223 if(calorimeter == "PHOS" && !fPHOSBadChannelMap) return kFALSE;
228 for(Int_t iCell = 0; iCell<nCells; iCell++){
230 //Get the column and row
231 if(calorimeter == "EMCAL"){
232 Int_t iTower = -1, iIphi = -1, iIeta = -1;
233 fEMCALGeo->GetCellIndex(cellList[iCell],imod,iTower,iIphi,iIeta);
234 if(fEMCALBadChannelMap->GetEntries() <= imod) continue;
235 fEMCALGeo->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,irow,icol);
237 if(imod < 0 || irow < 0 || icol < 0 ) {
238 Fatal("ClusterContainsBadChannel","Negative value for super module: %d, or cell icol: %d, or cell irow: %d, check EMCAL geometry name\n",imod,icol,irow);
241 if(GetEMCALChannelStatus(imod, icol, irow))return kTRUE;
243 else if(calorimeter=="PHOS"){
245 fPHOSGeo->AbsToRelNumbering(cellList[iCell],relId);
249 if(fPHOSBadChannelMap->GetEntries() <= imod)continue;
250 if(GetPHOSChannelStatus(imod, icol, irow)) return kTRUE;
254 }// cell cluster loop
260 //____________________________________________________________________________________________________________________________________________________
261 Int_t AliCalorimeterUtils::GetModuleNumber(AliAODPWG4Particle * particle, AliVEvent * inputEvent) const
263 //Get the EMCAL/PHOS module number that corresponds to this particle
266 if(particle->GetDetector()=="EMCAL"){
267 fEMCALGeo->GetAbsCellIdFromEtaPhi(particle->Eta(),particle->Phi(), absId);
269 printf("AliCalorimeterUtils::GetModuleNumber(PWG4AOD) - EMCAL: cluster eta %f, phi %f, absid %d, SuperModule %d\n",
270 particle->Eta(), particle->Phi()*TMath::RadToDeg(),absId, fEMCALGeo->GetSuperModuleNumber(absId));
271 return fEMCALGeo->GetSuperModuleNumber(absId) ;
273 else if(particle->GetDetector()=="PHOS"){
274 // In case we use the MC reader, the input are TParticles,
275 // in this case use the corresponing method in PHOS Geometry to get the particle.
276 if(strcmp(inputEvent->ClassName(), "AliMCEvent") == 0 )
279 Double_t z = 0., x=0.;
280 TParticle* primary = 0x0;
281 AliStack * stack = ((AliMCEvent*)inputEvent)->Stack();
283 primary = stack->Particle(particle->GetCaloLabel(0));
286 Fatal("GetModuleNumber(PWG4AOD)", "Stack not available, stop!");
289 fPHOSGeo->ImpactOnEmc(primary,mod,z,x) ;
292 // Input are ESDs or AODs, get the PHOS module number like this.
294 AliVCluster *cluster = inputEvent->GetCaloCluster(particle->GetCaloLabel(0));
295 return GetModuleNumber(cluster);
302 //____________________________________________________________________________________________________________________________________________________
303 Int_t AliCalorimeterUtils::GetModuleNumber(AliVCluster * cluster) const
305 //Get the EMCAL/PHOS module number that corresponds to this cluster
307 Double_t v[]={0.,0.,0.}; //not necessary to pass the real vertex.
308 cluster->GetMomentum(lv,v);
309 Float_t phi = lv.Phi();
310 if(phi < 0) phi+=TMath::TwoPi();
312 if(cluster->IsEMCAL()){
313 fEMCALGeo->GetAbsCellIdFromEtaPhi(lv.Eta(),phi, absId);
315 printf("AliCalorimeterUtils::GetModuleNumber() - EMCAL: cluster eta %f, phi %f, absid %d, SuperModule %d\n",
316 lv.Eta(), phi*TMath::RadToDeg(),absId, fEMCALGeo->GetSuperModuleNumber(absId));
317 return fEMCALGeo->GetSuperModuleNumber(absId) ;
319 else if(cluster->IsPHOS()) {
321 if ( cluster->GetNCells() > 0) {
322 absId = cluster->GetCellAbsId(0);
324 printf("AliCalorimeterUtils::GetModuleNumber() - PHOS: cluster eta %f, phi %f, e %f, absId %d\n",
325 lv.Eta(), phi*TMath::RadToDeg(), lv.E(), absId);
330 fPHOSGeo->AbsToRelNumbering(absId,relId);
332 printf("AliCalorimeterUtils::GetModuleNumber() - PHOS: Module %d\n",relId[0]-1);
341 //_____________________________________________________________________________________________________________
342 Int_t AliCalorimeterUtils::GetModuleNumberCellIndexes(const Int_t absId, const TString calo, Int_t & icol, Int_t & irow, Int_t & iRCU) const
344 //Get the EMCAL/PHOS module, columns, row and RCU number that corresponds to this absId
348 Int_t iTower = -1, iIphi = -1, iIeta = -1;
349 fEMCALGeo->GetCellIndex(absId,imod,iTower,iIphi,iIeta);
350 fEMCALGeo->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,irow,icol);
351 if(imod < 0 || irow < 0 || icol < 0 ) {
352 Fatal("GetModuleNumberCellIndexes()","Negative value for super module: %d, or cell icol: %d, or cell irow: %d, check EMCAL geometry name\n",imod,icol,irow);
356 if (0<=irow&&irow<8) iRCU=0; // first cable row
357 else if (8<=irow&&irow<16 && 0<=icol&&icol<24) iRCU=0; // first half;
360 else if(8<=irow&&irow<16 && 24<=icol&&icol<48) iRCU=1; // second half;
362 else if(16<=irow&&irow<24) iRCU=1; // third cable row
364 if (imod%2==1) iRCU = 1 - iRCU; // swap for odd=C side, to allow us to cable both sides the same
366 Fatal("GetModuleNumberCellIndexes()","Wrong EMCAL RCU number = %d\n", iRCU);
373 fPHOSGeo->AbsToRelNumbering(absId,relId);
377 iRCU= (Int_t)(relId[2]-1)/16 ;
378 //Int_t iBranch= (Int_t)(relid[3]-1)/28 ; //0 to 1
380 Fatal("GetModuleNumberCellIndexes()","Wrong PHOS RCU number = %d\n", iRCU);
389 //_______________________________________________________________
390 //void AliCalorimeterUtils::Init()
392 // //Init reader. Method to be called in AliAnaPartCorrMaker
394 // fEMCALBadChannelMap->SetName(Form("EMCALBadMap_%s",fTaskName.Data()));
395 // fPHOSBadChannelMap->SetName(Form("PHOSBadMap_%s",fTaskName.Data()));
398 //_______________________________________________________________
399 void AliCalorimeterUtils::InitParameters()
401 //Initialize the parameters of the analysis.
402 fEMCALGeoName = "EMCAL_FIRSTYEAR";
403 fPHOSGeoName = "PHOSgeo";
405 if(gGeoManager) {// geoManager was set
406 if(fDebug > 2)printf("AliCalorimeterUtils::InitParameters() - Geometry manager available\n");
407 fEMCALGeoMatrixSet = kTRUE;
408 fPHOSGeoMatrixSet = kTRUE;
411 fEMCALGeoMatrixSet = kFALSE;
412 fPHOSGeoMatrixSet = kFALSE;
415 fRemoveBadChannels = kFALSE;
417 fNCellsFromEMCALBorder = 0;
418 fNCellsFromPHOSBorder = 0;
419 fNoEMCALBorderAtEta0 = kFALSE;
422 //________________________________________________________________
423 void AliCalorimeterUtils::InitEMCALBadChannelStatusMap(){
424 //Init EMCAL bad channels map
425 if(fDebug > 0 )printf("AliCalorimeterUtils::InitEMCALBadChannelStatusMap()\n");
426 //In order to avoid rewriting the same histograms
427 Bool_t oldStatus = TH1::AddDirectoryStatus();
428 TH1::AddDirectory(kFALSE);
430 fEMCALBadChannelMap = new TObjArray(12);
431 //TH2F * hTemp = new TH2I("EMCALBadChannelMap","EMCAL SuperModule bad channel map", 48, 0, 48, 24, 0, 24);
432 for (int i = 0; i < 12; i++) {
433 fEMCALBadChannelMap->Add(new TH2I(Form("EMCALBadChannelMap_Mod%d",i),Form("EMCALBadChannelMap_Mod%d",i), 48, 0, 48, 24, 0, 24));
434 //fEMCALBadChannelMap->Add((TH2I*)hTemp->Clone(Form("EMCALBadChannelMap_Mod%d",i)));
439 fEMCALBadChannelMap->SetOwner(kTRUE);
440 fEMCALBadChannelMap->Compress();
442 //In order to avoid rewriting the same histograms
443 TH1::AddDirectory(oldStatus);
446 //________________________________________________________________
447 void AliCalorimeterUtils::InitPHOSBadChannelStatusMap(){
448 //Init PHOS bad channels map
449 if(fDebug > 0 )printf("AliCalorimeterUtils::InitPHOSBadChannelStatusMap()\n");
450 //In order to avoid rewriting the same histograms
451 Bool_t oldStatus = TH1::AddDirectoryStatus();
452 TH1::AddDirectory(kFALSE);
454 fPHOSBadChannelMap = new TObjArray(5);
455 for (int i = 0; i < 5; i++)fPHOSBadChannelMap->Add(new TH2I(Form("PHOSBadChannelMap_Mod%d",i),Form("PHOSBadChannelMap_Mod%d",i), 56, 0, 56, 64, 0, 64));
457 fPHOSBadChannelMap->SetOwner(kTRUE);
458 fPHOSBadChannelMap->Compress();
460 //In order to avoid rewriting the same histograms
461 TH1::AddDirectory(oldStatus);
464 //________________________________________________________________
465 void AliCalorimeterUtils::InitEMCALRecalibrationFactors(){
466 //Init EMCAL recalibration factors
467 if(fDebug > 0 )printf("AliCalorimeterUtils::InitEMCALRecalibrationFactors()\n");
468 //In order to avoid rewriting the same histograms
469 Bool_t oldStatus = TH1::AddDirectoryStatus();
470 TH1::AddDirectory(kFALSE);
472 fEMCALRecalibrationFactors = new TObjArray(12);
473 for (int i = 0; i < 12; i++) fEMCALRecalibrationFactors->Add(new TH2F(Form("EMCALRecalFactors_SM%d",i),Form("EMCALRecalFactors_SM%d",i), 48, 0, 48, 24, 0, 24));
474 //Init the histograms with 1
475 for (Int_t sm = 0; sm < 12; sm++) {
476 for (Int_t i = 0; i < 48; i++) {
477 for (Int_t j = 0; j < 24; j++) {
478 SetEMCALChannelRecalibrationFactor(sm,i,j,1.);
482 fEMCALRecalibrationFactors->SetOwner(kTRUE);
483 fEMCALRecalibrationFactors->Compress();
485 //In order to avoid rewriting the same histograms
486 TH1::AddDirectory(oldStatus);
489 //________________________________________________________________
490 void AliCalorimeterUtils::InitPHOSRecalibrationFactors(){
491 //Init EMCAL recalibration factors
492 if(fDebug > 0 )printf("AliCalorimeterUtils::InitPHOSRecalibrationFactors()\n");
493 //In order to avoid rewriting the same histograms
494 Bool_t oldStatus = TH1::AddDirectoryStatus();
495 TH1::AddDirectory(kFALSE);
497 fPHOSRecalibrationFactors = new TObjArray(5);
498 for (int i = 0; i < 5; i++)fPHOSRecalibrationFactors->Add(new TH2F(Form("PHOSRecalFactors_Mod%d",i),Form("PHOSRecalFactors_Mod%d",i), 56, 0, 56, 64, 0, 64));
499 //Init the histograms with 1
500 for (Int_t m = 0; m < 5; m++) {
501 for (Int_t i = 0; i < 56; i++) {
502 for (Int_t j = 0; j < 64; j++) {
503 SetPHOSChannelRecalibrationFactor(m,i,j,1.);
507 fPHOSRecalibrationFactors->SetOwner(kTRUE);
508 fPHOSRecalibrationFactors->Compress();
510 //In order to avoid rewriting the same histograms
511 TH1::AddDirectory(oldStatus);
515 //________________________________________________________________
516 void AliCalorimeterUtils::InitEMCALGeometry()
518 //Initialize EMCAL geometry if it did not exist previously
520 fEMCALGeo = new AliEMCALGeoUtils(fEMCALGeoName);
522 printf("AliCalorimeterUtils::InitEMCALGeometry()");
523 if (!gGeoManager) printf(" - Careful!, gGeoManager not loaded, load misalign matrices");
529 //________________________________________________________________
530 void AliCalorimeterUtils::InitPHOSGeometry()
532 //Initialize PHOS geometry if it did not exist previously
534 fPHOSGeo = new AliPHOSGeoUtils(fPHOSGeoName);
536 printf("AliCalorimeterUtils::InitPHOSGeometry()");
537 if (!gGeoManager) printf(" - Careful!, gGeoManager not loaded, load misalign matrices");
543 //________________________________________________________________
544 void AliCalorimeterUtils::Print(const Option_t * opt) const
547 //Print some relevant parameters set for the analysis
551 printf("***** Print: %s %s ******\n", GetName(), GetTitle() ) ;
552 printf("Remove Clusters with bad channels? %d\n",fRemoveBadChannels);
553 printf("Remove Clusters with max cell at less than %d cells from EMCAL border and %d cells from PHOS border\n",
554 fNCellsFromEMCALBorder, fNCellsFromPHOSBorder);
555 if(fNoEMCALBorderAtEta0) printf("Do not remove EMCAL clusters at Eta = 0\n");
556 printf("Recalibrate Clusters? %d\n",fRecalibration);
561 //________________________________________________________________
562 Float_t AliCalorimeterUtils::RecalibrateClusterEnergy(AliVCluster * cluster, AliVCaloCells * cells){
563 // Recalibrate the cluster energy, considering the recalibration map and the energy of the cells that compose the cluster.
566 Fatal("RecalibrateClusterEnergy()","Cells pointer does not exist!");
568 //Get the cluster number of cells and list of absId, check what kind of cluster do we have.
569 UShort_t * index = cluster->GetCellsAbsId() ;
570 Double_t * fraction = cluster->GetCellsAmplitudeFraction() ;
571 Int_t ncells = cluster->GetNCells();
572 TString calo = "EMCAL";
573 if(cluster->IsPHOS()) calo = "PHOS";
574 //Initialize some used variables
577 Int_t icol = -1, irow = -1, iRCU = -1, module=1;
578 Float_t factor = 1, frac = 0;
580 //Loop on the cells, get the cell amplitude and recalibration factor, multiply and and to the new energy
581 for(Int_t icell = 0; icell < ncells; icell++){
582 absId = index[icell];
583 frac = fraction[icell];
584 if(frac < 1e-3) frac = 1; //in case of EMCAL, this is set as 0, not used.
585 module = GetModuleNumberCellIndexes(absId,calo,icol,irow,iRCU);
586 if(cluster->IsPHOS()) factor = GetPHOSChannelRecalibrationFactor (module,icol,irow);
587 else factor = GetEMCALChannelRecalibrationFactor(module,icol,irow);
589 printf("AliCalorimeterUtils::RecalibrateClusterEnergy() - recalibrate cell: %s, module %d, col %d, row %d, cell fraction %f, recalibration factor %f, cell energy %f\n",
590 calo.Data(),module,icol,irow,frac,factor,cells->GetCellAmplitude(absId));
592 energy += cells->GetCellAmplitude(absId)*factor*frac;
596 printf("AliCalorimeterUtils::RecalibrateClusterEnergy() - Energy before %f, after %f\n",cluster->E(),energy);
601 //________________________________________________________________
602 void AliCalorimeterUtils::SetGeometryTransformationMatrices(AliVEvent* inputEvent)
604 //Set the calorimeters transformation matrices
606 //Get the EMCAL transformation geometry matrices from ESD
607 if (!gGeoManager && fEMCALGeo && !fEMCALGeoMatrixSet) {
609 printf(" AliCalorimeterUtils::SetGeometryTransformationMatrices() - Load EMCAL misalignment matrices. \n");
610 if(!strcmp(inputEvent->GetName(),"AliESDEvent")) {
611 for(Int_t mod=0; mod < (fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++){
612 if(inputEvent->GetEMCALMatrix(mod)) {
613 //printf("EMCAL: mod %d, matrix %p\n",mod, ((AliESDEvent*)inputEvent)->GetEMCALMatrix(mod));
614 fEMCALGeo->SetMisalMatrix(inputEvent->GetEMCALMatrix(mod),mod) ;
615 fEMCALGeoMatrixSet = kTRUE;//At least one, so good
617 }// loop over super modules
621 printf("AliCalorimeterUtils::SetGeometryTransformationMatrices() - Setting of EMCAL transformation matrixes for AODs not implemented yet. \n Import geometry.root file\n");
623 }//EMCAL geo && no geoManager
625 //Get the PHOS transformation geometry matrices from ESD
626 if (!gGeoManager && fPHOSGeo && !fPHOSGeoMatrixSet) {
628 printf(" AliCalorimeterUtils::SetGeometryTransformationMatrices() - Load PHOS misalignment matrices. \n");
629 if(!strcmp(inputEvent->GetName(),"AliESDEvent")) {
630 for(Int_t mod=0; mod < 5; mod++){
631 if(inputEvent->GetPHOSMatrix(mod)) {
632 //printf("PHOS: mod %d, matrix %p\n",mod, ((AliESDEvent*)inputEvent)->GetPHOSMatrix(mod));
633 fPHOSGeo->SetMisalMatrix(inputEvent->GetPHOSMatrix(mod),mod) ;
634 fPHOSGeoMatrixSet = kTRUE; //At least one so good
636 }// loop over modules
640 printf("AliCalorimeterUtils::SetGeometryTransformationMatrices() - Setting of EMCAL transformation matrixes for AODs not implemented yet. \n Import geometry.root file\n");
642 }//PHOS geo and geoManager was not set