]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
removed string operation and coverity fix.
authorfronchet <fronchet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 28 Jun 2011 13:56:56 +0000 (13:56 +0000)
committerfronchet <fronchet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 28 Jun 2011 13:56:56 +0000 (13:56 +0000)
HLT/CALO/AliHLTCaloMapper.cxx

index 93fecff7bf09a7b5cfa78c4baa54dbccfb93b110..26b996c99a9a1e3a77858b04a9f5f0976cbcbea6 100644 (file)
@@ -167,8 +167,12 @@ AliHLTCaloMapper::GetModuleFromSpec(UInt_t specification)
 {
 
   Int_t module = -1;
-
-  if (fCaloDet.CompareTo("PHOS") == 0) {
+  // get rid of too much string operations
+  
+  //  if (fCaloDet.CompareTo("PHOS") == 0) {
+  
+  if (fCaloDet[0]=='P') {  
+    // P = is the short for PHOS
     // 1 module = 4 bits
     if(specification & 0xf) module = 0;
     else if((specification >> 4) & 0xf) module = 1;
@@ -181,7 +185,10 @@ AliHLTCaloMapper::GetModuleFromSpec(UInt_t specification)
     
     return module;
   }
-  else if (fCaloDet.CompareTo("EMCAL") == 0) {
+    //else if (fCaloDet.CompareTo("EMCAL") == 0) {
+  else if (fCaloDet[0]=='E') {  
+
+    // E = is the short for EMCAL 
     // 1 module = 2 bits
     if(specification & 0x3) module = 0;
     else if((specification >> 2) & 0x3) module = 1;
@@ -201,7 +208,7 @@ AliHLTCaloMapper::GetModuleFromSpec(UInt_t specification)
   } else {
     HLTDebug("Specification 0x%X not consistent with single module in EMCAL or PHOS", specification);
   }
-
+  return module;
 }