]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Add initial comment to trigger mapping methods.
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 20 Feb 2010 17:13:31 +0000 (17:13 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 20 Feb 2010 17:13:31 +0000 (17:13 +0000)
Remove AliFatal and AliError when gGeoManager does not exist in ImactOnEMCAL and GetGlobal, this was necessary for loading the transformation matrices before but now they can be provided externally. Remove all code that was commented related to the load of the matrices.

EMCAL/AliEMCALGeoUtils.cxx

index f15ea1e588f798fbf4b8cb4fd46b2b63916d79ae..c6c75c34cbcecbca782e65150dd0f7ca98c52d7e 100644 (file)
@@ -211,20 +211,6 @@ void AliEMCALGeoUtils::GetGlobal(const Double_t *loc, Double_t *glob, int ind) c
   // local numbering and the transformation
   // matrix stored by the geometry manager (allows for misaligned
   // geometry)
-
-//  if(ind>=0 && ind < fEMCGeometry->GetNumberOfSuperModules()) {
-//    TString volpath = "ALIC_1/XEN1_1/SMOD_";
-//    volpath += ind+1;
-//
-//    if(fKey110DEG && ind>=10) {
-//      volpath = "ALIC_1/XEN1_1/SM10_";
-//      volpath += ind-10+1;
-//    }
-//
-//    if(!gGeoManager->cd(volpath.Data()))
-//      AliFatal(Form("AliEMCALGeometry::GeoManager cannot find path %s!",volpath.Data()));
-//
-//    TGeoHMatrix* m = gGeoManager->GetCurrentMatrix();
        
        const TGeoHMatrix* m = GetMatrixForSuperModule(ind);
     if(m) {
@@ -232,7 +218,6 @@ void AliEMCALGeoUtils::GetGlobal(const Double_t *loc, Double_t *glob, int ind) c
     } else {
       AliFatal("Geo matrixes are not loaded \n") ;
     }
-//  }
 }
 
 //________________________________________________________________________________________________
@@ -255,26 +240,10 @@ void AliEMCALGeoUtils::GetGlobal(Int_t absId , double glob[3]) const
   static Int_t nSupMod, nModule, nIphi, nIeta;
   static double loc[3];
 
-  if (!gGeoManager || !gGeoManager->IsClosed()) {
-    AliError("Can't get the global coordinates! gGeoManager doesn't exist or it is still open!");
-    return;
-  }
-
   glob[0]=glob[1]=glob[2]=0.0; // bad case
   if(RelPosCellInSModule(absId, loc)) {
     GetCellIndex(absId, nSupMod, nModule, nIphi, nIeta);
 
-//    TString volpath = "ALIC_1/XEN1_1/SMOD_";
-//    volpath += (nSupMod+1);
-//
-//    if(fKey110DEG && nSupMod>=10) {
-//      volpath = "ALIC_1/XEN1_1/SM10_";
-//      volpath += (nSupMod-10+1);
-//    }
-//    if(!gGeoManager->cd(volpath.Data()))
-//      AliFatal(Form("GeoManager cannot find path %s!",volpath.Data()));
-//
-//    TGeoHMatrix* m = gGeoManager->GetCurrentMatrix();
          const TGeoHMatrix* m = GetMatrixForSuperModule(nSupMod);
          if(m) {
       m->LocalToMaster(loc, glob);
@@ -847,9 +816,6 @@ void AliEMCALGeoUtils::ImpactOnEmcal(TVector3 vtx, Double_t theta, Double_t phi,
    Double_t factor = (fIPDistance-vtx[1])/p[1];
   direction = vtx + factor*p;
 
-  if (!gGeoManager){
-    AliFatal("Geo manager not initialized\n");
-  }
   //from particle direction -> tower hitted
   GetAbsCellIdFromEtaPhi(direction.Eta(),direction.Phi(),absId);
   
@@ -878,18 +844,7 @@ void AliEMCALGeoUtils::ImpactOnEmcal(TVector3 vtx, Double_t theta, Double_t phi,
   //3rd point on emcal cell plane
   if(!RelPosCellInSModule(absId3,loc3)) return;
     
-//  TString volpath = "ALIC_1/XEN1_1/SMOD_";
-//  volpath += (nSupMod+1);
-//  
-//  if(fKey110DEG && nSupMod>=10) {
-//    volpath = "ALIC_1/XEN1_1/SM10_";
-//    volpath += (nSupMod-10+1);
-//  }
-//  if(!gGeoManager->cd(volpath.Data())){
-//    AliFatal(Form("GeoManager cannot find path %s!",volpath.Data()))
-//    return;
-//  }
-//  TGeoHMatrix* m = gGeoManager->GetCurrentMatrix();
+  // Get Matrix
   const TGeoHMatrix* m = GetMatrixForSuperModule(nSupMod);
   if(m) {
     m->LocalToMaster(loc, glob);
@@ -980,6 +935,8 @@ Int_t AliEMCALGeoUtils::GetAbsTRUNumberFromNumberInSm(const Int_t row, const Int
 //________________________________________________________________________________________________
 Bool_t AliEMCALGeoUtils::GetAbsFastORIndexFromTRU(const Int_t iTRU, const Int_t iADC, Int_t& id) const
 {
+       //Trigger mapping method, get  FastOr Index from TRU
+
     if (iTRU > 31 || iTRU < 0 || iADC > 95 || iADC < 0) 
        {
                AliError("TRU out of range!");
@@ -994,6 +951,9 @@ Bool_t AliEMCALGeoUtils::GetAbsFastORIndexFromTRU(const Int_t iTRU, const Int_t
 //________________________________________________________________________________________________
 Bool_t AliEMCALGeoUtils::GetTRUFromAbsFastORIndex(const Int_t id, Int_t& iTRU, Int_t& iADC) const
 {
+
+       //Trigger mapping method, get TRU number from FastOr Index
+
        if (id > 3071 || id < 0)
        {
                AliError("Id out of range!");
@@ -1009,6 +969,8 @@ Bool_t AliEMCALGeoUtils::GetTRUFromAbsFastORIndex(const Int_t id, Int_t& iTRU, I
 //________________________________________________________________________________________________
 Bool_t AliEMCALGeoUtils::GetPositionInTRUFromAbsFastORIndex(const Int_t id, Int_t& iTRU, Int_t& iEta, Int_t& iPhi) const
 {
+       //Trigger mapping method, get position in TRU from FasOr Index
+       
        Int_t iADC;
        
        Bool_t isOK = GetTRUFromAbsFastORIndex(id, iTRU, iADC);
@@ -1035,6 +997,8 @@ Bool_t AliEMCALGeoUtils::GetPositionInTRUFromAbsFastORIndex(const Int_t id, Int_
 //________________________________________________________________________________________________
 Bool_t AliEMCALGeoUtils::GetPositionInSMFromAbsFastORIndex(const Int_t id, Int_t& iSM, Int_t& iEta, Int_t& iPhi) const
 {
+       //Trigger mapping method, get position in Super Module from FasOr Index
+
        Int_t iTRU;
        Bool_t isOK = GetPositionInTRUFromAbsFastORIndex(id, iTRU, iEta, iPhi);
        
@@ -1057,6 +1021,8 @@ Bool_t AliEMCALGeoUtils::GetPositionInSMFromAbsFastORIndex(const Int_t id, Int_t
 //________________________________________________________________________________________________
 Bool_t AliEMCALGeoUtils::GetAbsFastORIndexFromPositionInTRU(const Int_t iTRU, const Int_t iEta, const Int_t iPhi, Int_t& id) const
 {
+       //Trigger mapping method, get Index if FastOr from Position in TRU
+
        if (iTRU < 0 || iTRU > 31 || iEta < 0 || iEta > 23 || iPhi < 0 || iPhi > 3) return kFALSE;
        
        if ( int( iTRU / 3 ) % 2 ) // C side
@@ -1073,6 +1039,7 @@ Bool_t AliEMCALGeoUtils::GetAbsFastORIndexFromPositionInTRU(const Int_t iTRU, co
 
 //____________________________________________________________________________
 const TGeoHMatrix * AliEMCALGeoUtils::GetMatrixForSuperModule(Int_t smod) const {
+
        //Provides shift-rotation matrix for EMCAL
        
        if(smod < 0 || smod > fEMCGeometry->GetNumberOfSuperModules()) 
@@ -1105,15 +1072,16 @@ const TGeoHMatrix * AliEMCALGeoUtils::GetMatrixForSuperModule(Int_t smod) const
                }
                return gGeoManager->GetCurrentMatrix();
        }
-       
+
        if(fkSModuleMatrix[smod]){
                return fkSModuleMatrix[smod] ;
        }
        else{
-               printf("Can not find EMCAL misalignment matrixes\n") ;
-               printf("Either import TGeoManager from geometry.root or \n");
-               printf("read stored matrixes from AliESD Header:  \n") ;   
-               printf("AliEMCALGeoUtils::SetMisalMatrixes(header->GetEMCALMisalMatrix()) \n") ;
+               AliInfo("Stop:");
+               printf("\t Can not find EMCAL misalignment matrixes\n") ;
+               printf("\t Either import TGeoManager from geometry.root or \n");
+               printf("\t read stored matrixes from AliESD Header:  \n") ;   
+               printf("\t AliEMCALGeoUtils::SetMisalMatrixes(header->GetEMCALMisalMatrix()) \n") ;
                abort() ;
        }
        return 0 ;