Using static variables to access the volume ID avoiding search by name. This reduces...
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 13 Oct 2004 08:19:22 +0000 (08:19 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 13 Oct 2004 08:19:22 +0000 (08:19 +0000)
EMCAL/AliEMCALv1.cxx
PHOS/AliPHOSDebug.cxx
PHOS/AliPHOSv1.cxx
PHOS/AliPHOSvImpacts.cxx
RICH/AliRICHv0.cxx
RICH/AliRICHv1.cxx
VZERO/AliVZEROv2.cxx
VZERO/AliVZEROv3.cxx
VZERO/AliVZEROv4.cxx
VZERO/AliVZEROv5.cxx

index 739cd6e5af4adcdc8b66245b7f5f5b26d6732573..48e3ca0baef48dc21e35e2f91dcc304b28630ecd 100644 (file)
@@ -123,7 +123,8 @@ void AliEMCALv1::StepManager(void){
   
   AliEMCALGeometry * geom = GetGeometry() ; 
 
-  if(gMC->CurrentVolID(copy) == gMC->VolId("XPHI") ) { // We are in a Scintillator Layer 
+  static Int_t idXPHI = gMC->VolId("XPHI");
+  if(gMC->CurrentVolID(copy) == idXPHI ) { // We are in a Scintillator Layer 
     Float_t depositedEnergy ; 
     
     if( ((depositedEnergy = gMC->Edep()) > 0.)  && (gMC->TrackTime() < fTimeCut)){// Track is inside a scintillator and deposits some energy
index 4b420344dee3a3a052d1ac220d229e1ce39d02c6..ed5d8599683b7d03ccf35545f9db1b70dc8caaf1 100644 (file)
@@ -545,7 +545,8 @@ void AliPHOSv1::StepManager(void)
 
     // Yuri Kharlov, 28 September 2000
 
-    if( gMC->CurrentVolID(copy) == gMC->VolId("PCPQ") &&
+    static Int_t idPCPQ = gMC->VolId("PCPQ");
+    if( gMC->CurrentVolID(copy) == idPCPQ &&
        entered &&
        gMC->TrackCharge() != 0) {      
       
index 2e6a0be2459e72b53ea7c52675ed056cc84fa5bd..d8cc5f0d9dce57d17248f06ca5f0f7242fca3997 100644 (file)
@@ -292,7 +292,8 @@ void AliPHOSv1::StepManager(void)
 
   Int_t moduleNumber ;
   
-  if( gMC->CurrentVolID(copy) == gMC->VolId("PCPQ") &&
+  static Int_t idPCPQ = gMC->VolId("PCPQ");
+  if( gMC->CurrentVolID(copy) == idPCPQ &&
       (gMC->IsTrackEntering() ) &&
       gMC->TrackCharge() != 0) {      
     
@@ -387,8 +388,8 @@ void AliPHOSv1::StepManager(void)
   }
 
  
-  
-  if(gMC->CurrentVolID(copy) == gMC->VolId("PXTL") ) { //  We are inside a PBWO crystal
+  static Int_t idPXTL = gMC->VolId("PXTL");  
+  if(gMC->CurrentVolID(copy) == idPXTL ) { //  We are inside a PBWO crystal
 
     gMC->TrackPosition(pos) ;
     xyzte[0] = pos[0] ;
index 805364b2230e70807c5a88a905048f4c3b2c0372..2669b48cf732c7d27e9b3c7a81febf9e076d0317 100644 (file)
@@ -206,7 +206,8 @@ void AliPHOSvImpacts::StepManager(void)
 
   // Add impact to EMC
 
-  if( gMC->CurrentVolID(copy) == gMC->VolId("PXTL") &&
+  static Int_t idPXTL = gMC->VolId("PXTL");
+  if( gMC->CurrentVolID(copy) == idPXTL &&
       gMC->IsTrackEntering() ) {
     gMC->TrackMomentum(pmom);
     gMC->TrackPosition(pos) ;
@@ -235,7 +236,8 @@ void AliPHOSvImpacts::StepManager(void)
 
   // Add impact to CPV
 
-  if( gMC->CurrentVolID(copy) == gMC->VolId("PCPQ") &&
+  static Int_t idPCPQ = gMC->VolId("PCPQ");
+  if( gMC->CurrentVolID(copy) == idPCPQ &&
       gMC->IsTrackEntering() ) {
     gMC->TrackMomentum(pmom);
     gMC->TrackPosition(pos) ;
index 06adbc84857cd65633798fdd836cb13b6dba8f7a..bced7debefe0bf7b3451a6b6b47d6536bd189faa 100644 (file)
@@ -110,7 +110,8 @@ void AliRICHv0::StepManager()
   Info("X4 glo","(x,y,z)=(%+8.3f,%+8.3f,%+8.3f) (r,theta,phi)=(%8.3f,%8.3f,%8.3f)",
                       glo[0],glo[1],glo[2],x4.Rho(),x4.Theta()*TMath::RadToDeg(),x4.Phi()*TMath::RadToDeg());  
   Info("X4 loc","(x,y,z)=(%+8.3f,%+8.3f,%8.3f) by gMC->Gmtod()",loc[0],loc[1],loc[2]);  
-  if(gMC->VolId("GAP ")==gMC->CurrentVolID(copy0)){
+  static Int_t idGAP = gMC->VolId("GAP ");
+  if(idGAP==gMC->CurrentVolID(copy0)){
     Int_t iChamber;
     gMC->CurrentVolOffID(2,iChamber);
     TVector2 x2=C(iChamber)->Mrs2Pc(x4);
index cca590608b9046ec5d081dfa738077c07f1be174..b4f3765c211efcf3feb6c34710613f9d60dd467a 100644 (file)
@@ -38,17 +38,22 @@ void AliRICHv1::StepManager()
          
   Int_t          copy;
   static Int_t   iCurrentChamber;
+  static Int_t idRRAD = gMC->VolId("RRAD");
+  static Int_t idRRWI = gMC->VolId("RRWI");
+  static Int_t idRICH = gMC->VolId("RICH");
+  static Int_t idRPC  = gMC->VolId("RPC ");
+  static Int_t idRGAP = gMC->VolId("RGAP");
 //history of Cerenkovs
   if(gMC->TrackPid()==kCerenkov){
-    if( gMC->IsNewTrack()   && gMC->CurrentVolID(copy)==gMC->VolId("RRAD")) fCounters(0)++;// 0- Ckovs produced in radiator
-    if(!gMC->IsTrackAlive() && gMC->CurrentVolID(copy)==gMC->VolId("RRAD")) fCounters(1)++;// 1- Ckovs absorbed in radiator
-    if(!gMC->IsTrackAlive() && gMC->CurrentVolID(copy)==gMC->VolId("RRWI")) fCounters(2)++;// 2- Ckovs absorbed in radiator window
-    if(!gMC->IsTrackAlive() && gMC->CurrentVolID(copy)==gMC->VolId("RICH")) fCounters(4)++;// 4- Ckovs absorbed in CH4
+    if( gMC->IsNewTrack()   && gMC->CurrentVolID(copy)==idRRAD) fCounters(0)++;// 0- Ckovs produced in radiator
+    if(!gMC->IsTrackAlive() && gMC->CurrentVolID(copy)==idRRAD) fCounters(1)++;// 1- Ckovs absorbed in radiator
+    if(!gMC->IsTrackAlive() && gMC->CurrentVolID(copy)==idRRWI) fCounters(2)++;// 2- Ckovs absorbed in radiator window
+    if(!gMC->IsTrackAlive() && gMC->CurrentVolID(copy)==idRICH) fCounters(4)++;// 4- Ckovs absorbed in CH4
   }
           
 //Treat photons    
   static TLorentzVector cerX4;
-  if((gMC->TrackPid()==kCerenkov||gMC->TrackPid()==kFeedback)&&gMC->CurrentVolID(copy)==gMC->VolId("RPC ")){//photon in PC
+  if((gMC->TrackPid()==kCerenkov||gMC->TrackPid()==kFeedback)&&gMC->CurrentVolID(copy)==idRPC){//photon in PC
     if(gMC->Edep()>0){//photon in PC +DE
       if(IsLostByFresnel()){ 
         if(gMC->TrackPid()==kCerenkov) fCounters(7)++;// 7- Ckovs reflected from CsI
@@ -66,7 +71,7 @@ void AliRICHv1::StepManager()
 //Treat charged particles  
   static Float_t eloss;
   static TLorentzVector mipInX4,mipOutX4;
-  if(gMC->TrackCharge() && gMC->CurrentVolID(copy)==gMC->VolId("RGAP")){//MIP in GAP
+  if(gMC->TrackCharge() && gMC->CurrentVolID(copy)==idRGAP){//MIP in GAP
     gMC->CurrentVolOffID(1,iCurrentChamber);//RICH-RGAP
     if(gMC->IsTrackEntering()||gMC->IsNewTrack()) {//MIP in GAP entering or newly created
       eloss=0;                                                           
index 68d6e75d0c8a78024f4c612d748e22ca2f013ac2..b165ed13ebed2384aae3049b537ab8029ebeb860 100755 (executable)
@@ -1010,23 +1010,35 @@ void AliVZEROv2::StepManager()
      vol[2]    = gMC->CurrentVolID(copy);
      vol[3]    = copy;
      
-
-     if      ( gMC->CurrentVolID(copy) == gMC->VolId("V0R1") ||
-               gMC->CurrentVolID(copy) == gMC->VolId("V0L1") )
+     static Int_t idV0R1 = gMC->VolId("V0R1");
+     static Int_t idV0L1 = gMC->VolId("V0L1");
+     static Int_t idV0R2 = gMC->VolId("V0R2");
+     static Int_t idV0L2 = gMC->VolId("V0L2");
+     static Int_t idV0R3 = gMC->VolId("V0R3");
+     static Int_t idV0L3 = gMC->VolId("V0L3");
+     static Int_t idV0R4 = gMC->VolId("V0R4");
+     static Int_t idV0L4 = gMC->VolId("V0L4");
+     static Int_t idV0R5 = gMC->VolId("V0R5");
+     static Int_t idV0L5 = gMC->VolId("V0L5");
+     static Int_t idV0R6 = gMC->VolId("V0R6");
+     static Int_t idV0L6 = gMC->VolId("V0L6");
+
+     if      ( gMC->CurrentVolID(copy) == idV0R1 ||
+               gMC->CurrentVolID(copy) == idV0L1 )
               ringNumber = 1.0;
-     else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R2") ||
-               gMC->CurrentVolID(copy) == gMC->VolId("V0L2") ) 
+     else if ( gMC->CurrentVolID(copy) == idV0R2 ||
+               gMC->CurrentVolID(copy) == idV0L2 ) 
               ringNumber = 2.0;  
-     else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R3") ||
-               gMC->CurrentVolID(copy) == gMC->VolId("V0L3") )
+     else if ( gMC->CurrentVolID(copy) == idV0R3 ||
+               gMC->CurrentVolID(copy) == idV0L3 )
               ringNumber = 3.0;
-     else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R4") ||
-               gMC->CurrentVolID(copy) == gMC->VolId("V0L4") )          
+     else if ( gMC->CurrentVolID(copy) == idV0R4 ||
+               gMC->CurrentVolID(copy) == idV0L4 )      
               ringNumber = 4.0; 
-     else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R5") ||
-               gMC->CurrentVolID(copy) == gMC->VolId("V0L5") ||
-              gMC->CurrentVolID(copy) == gMC->VolId("V0L6") ||
-              gMC->CurrentVolID(copy) == gMC->VolId("V0R6") )    
+     else if ( gMC->CurrentVolID(copy) == idV0R5 ||
+               gMC->CurrentVolID(copy) == idV0L5 ||
+              gMC->CurrentVolID(copy) == idV0R6 ||
+              gMC->CurrentVolID(copy) == idV0L6 )        
                ringNumber = 5.0; 
      else
               ringNumber = 0.0;
index a32948cb444974eaed9089910c2f5278adab16e4..dc685d9061f5dbee2b40f6d86b060cd18c63992a 100755 (executable)
@@ -846,18 +846,25 @@ void AliVZEROv3::StepManager()
      
      if ( !gMC->TrackCharge() || !gMC->IsTrackAlive() ) return; 
 
+     static Int_t idV0R1 = gMC->VolId("V0R1");
+     static Int_t idV0L1 = gMC->VolId("V0L1");
+     static Int_t idV0R2 = gMC->VolId("V0R2");
+     static Int_t idV0L2 = gMC->VolId("V0L2");
+     static Int_t idV0R3 = gMC->VolId("V0R3");
+     static Int_t idV0L3 = gMC->VolId("V0L3");
+
      vol[0]    = gMC->CurrentVolOffID(1, vol[1]);
      vol[2]    = gMC->CurrentVolID(copy);
      vol[3]    = copy;
      
-     if      ( gMC->CurrentVolID(copy) == gMC->VolId("V0R1") ||
-               gMC->CurrentVolID(copy) == gMC->VolId("V0L1") )
+     if      ( gMC->CurrentVolID(copy) == idV0R1 ||
+               gMC->CurrentVolID(copy) == idV0L1 )
               ringNumber = 1.0;
-     else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R2") ||
-               gMC->CurrentVolID(copy) == gMC->VolId("V0L2") ) 
+     else if ( gMC->CurrentVolID(copy) == idV0R2 ||
+               gMC->CurrentVolID(copy) == idV0L2 ) 
               ringNumber = 2.0;  
-     else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R3") ||
-               gMC->CurrentVolID(copy) == gMC->VolId("V0L3") )
+     else if ( gMC->CurrentVolID(copy) == idV0R3 ||
+               gMC->CurrentVolID(copy) == idV0L3 )
               ringNumber = 3.0;
      else
               ringNumber = 0.0;
index c5f221974fa0e22570ce4de4bb02caadc1aab50c..9fadfb5e4acaa638dd9b4261097459c120295dd2 100755 (executable)
@@ -888,17 +888,26 @@ void AliVZEROv4::StepManager()
      vol[2]    = gMC->CurrentVolID(copy);
      vol[3]    = copy;
      
-     if      ( gMC->CurrentVolID(copy) == gMC->VolId("V0R1") ||
-               gMC->CurrentVolID(copy) == gMC->VolId("V0L1") )
+     static Int_t idV0R1 = gMC->VolId("V0R1");
+     static Int_t idV0L1 = gMC->VolId("V0L1");
+     static Int_t idV0R2 = gMC->VolId("V0R2");
+     static Int_t idV0L2 = gMC->VolId("V0L2");
+     static Int_t idV0R3 = gMC->VolId("V0R3");
+     static Int_t idV0L3 = gMC->VolId("V0L3");
+     static Int_t idV0R4 = gMC->VolId("V0R4");
+     static Int_t idV0L4 = gMC->VolId("V0L4");
+
+     if      ( gMC->CurrentVolID(copy) == idV0R1 ||
+               gMC->CurrentVolID(copy) == idV0L1 )
               ringNumber = 1.0;
-     else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R2") ||
-               gMC->CurrentVolID(copy) == gMC->VolId("V0L2") ) 
+     else if ( gMC->CurrentVolID(copy) == idV0R2 ||
+               gMC->CurrentVolID(copy) == idV0L2 ) 
               ringNumber = 2.0;  
-     else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R3") ||
-               gMC->CurrentVolID(copy) == gMC->VolId("V0L3") )
+     else if ( gMC->CurrentVolID(copy) == idV0R3 ||
+               gMC->CurrentVolID(copy) == idV0L3 )
               ringNumber = 3.0;
-     else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R4") ||
-               gMC->CurrentVolID(copy) == gMC->VolId("V0L4") )
+     else if ( gMC->CurrentVolID(copy) == idV0R4 ||
+               gMC->CurrentVolID(copy) == idV0L4 )
               ringNumber = 4.0;               
      else
               ringNumber = 0.0;
index b9f4ae747eab772804853af35a394afd152b59d3..bc96f87503912eeb014d398cede5abfbfca6fe8e 100755 (executable)
@@ -938,19 +938,30 @@ void AliVZEROv5::StepManager()
      vol[2]    = gMC->CurrentVolID(copy);
      vol[3]    = copy;
      
-     if      ( gMC->CurrentVolID(copy) == gMC->VolId("V0R1") ||
-               gMC->CurrentVolID(copy) == gMC->VolId("V0L1") )
+     static Int_t idV0R1 = gMC->VolId("V0R1");
+     static Int_t idV0L1 = gMC->VolId("V0L1");
+     static Int_t idV0R2 = gMC->VolId("V0R2");
+     static Int_t idV0L2 = gMC->VolId("V0L2");
+     static Int_t idV0R3 = gMC->VolId("V0R3");
+     static Int_t idV0L3 = gMC->VolId("V0L3");
+     static Int_t idV0R4 = gMC->VolId("V0R4");
+     static Int_t idV0L4 = gMC->VolId("V0L4");
+     static Int_t idV0R5 = gMC->VolId("V0R5");
+     static Int_t idV0R6 = gMC->VolId("V0R6");
+
+     if      ( gMC->CurrentVolID(copy) == idV0R1 ||
+               gMC->CurrentVolID(copy) == idV0L1 )
               ringNumber = 1.0;
-     else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R2") ||
-               gMC->CurrentVolID(copy) == gMC->VolId("V0L2") ) 
+     else if ( gMC->CurrentVolID(copy) == idV0R2 ||
+               gMC->CurrentVolID(copy) == idV0L2 ) 
               ringNumber = 2.0;  
-     else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R3") ||
-               gMC->CurrentVolID(copy) == gMC->VolId("V0R4") ||
-               gMC->CurrentVolID(copy) == gMC->VolId("V0L3") )
+     else if ( gMC->CurrentVolID(copy) == idV0R3 ||
+               gMC->CurrentVolID(copy) == idV0R4 ||
+               gMC->CurrentVolID(copy) == idV0L3 )
               ringNumber = 3.0;
-     else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R5") ||
-               gMC->CurrentVolID(copy) == gMC->VolId("V0R6") ||
-               gMC->CurrentVolID(copy) == gMC->VolId("V0L4") )
+     else if ( gMC->CurrentVolID(copy) == idV0R5 ||
+               gMC->CurrentVolID(copy) == idV0R6 ||
+               gMC->CurrentVolID(copy) == idV0L4 )
               ringNumber = 4.0;               
      else
               ringNumber = 0.0;