From 2cb0bb05f973431af33ea9e85b06f304ed5c04f1 Mon Sep 17 00:00:00 2001
From: Edward Diehl <diehl@umich.edu>
Date: Tue, 10 Feb 2015 16:22:19 +0100
Subject: [PATCH] Add BOE/BMG stations to MuonFixedIdUnpack.py
 (MuonCalibIdentifier-00-00-37)

        * tagging MuonCalibIdentifier-00-00-37

16-01-2015 Edward Diehl Add BOE/BMG stations for MuonFixedId
        *   Note: BOE3=BOL7 in offline, so no change needed, it will be handled as BOL
	*   Add BMG since it is defined in IdDictMuonSpectrometer_S.02.xml
        * tagging MuonCalibIdentifier-00-00-36
---
 .../MuonCalibIdentifier/MuonFixedId.h         | 114 ++----------------
 .../python/MuonFixedIdUnpack.py               |   8 +-
 .../MuonCalibIdentifier/src/MuonFixedId.cxx   |   9 +-
 3 files changed, 17 insertions(+), 114 deletions(-)

diff --git a/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/MuonCalibIdentifier/MuonFixedId.h b/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/MuonCalibIdentifier/MuonFixedId.h
index 5b15ef1cda68a..a7d28dee6c7f6 100644
--- a/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/MuonCalibIdentifier/MuonFixedId.h
+++ b/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/MuonCalibIdentifier/MuonFixedId.h
@@ -9,7 +9,9 @@
  *
  * Authors       : Martin Woudstra, Zdenko van Kesteren, Peter Kluit
  * Creation Date: 21 March 2005
- * Last Update  : 03 December 2007
+ * Updated : 03 December 2007
+ * Updated : 16 January  2015 E. Diehl Add BME/BOE/BMG chambers 
+ *   Note: BOE=BOL in offline, so do not need to explicitly add BOE, it will be handled as BOL
  ***************************************************************************/
 
 
@@ -446,7 +448,7 @@ private:
    static const unsigned int kStationPhiShift         = 13;
    static const unsigned int kStationPhiMin           = 1;
 
-   static const int kNumberOfStationNames = 34;
+   static const int kNumberOfStationNames = 35;
    static const char kStationNameStrings[kNumberOfStationNames][4];
 
    // the full station information for making a station identifier
@@ -736,98 +738,19 @@ inline int MuonFixedId::phiMax(){
    return kStationPhiMin + kStationPhiMask; 
 }
 
-inline int MuonFixedId::stationStringToFixedStationNumber(const std::string& station )
-{
+inline int MuonFixedId::stationStringToFixedStationNumber(const std::string& station ) {
   for ( int i = 0; i < kNumberOfStationNames; ++i ) {
     if ( station == kStationNameStrings[i] ) return i + kStationNameMin;
   }
-  // not found
-  return -1;
-
-/*// old stuff
-  if(station == "BIL" ) return 1;
-  if(station == "BIS" ) return 2;
-  if(station == "BML" ) return 3;
-  if(station == "BMS" ) return 4;
-  if(station == "BOL" ) return 5;
-  if(station == "BOS" ) return 6;
-  if(station == "BEE" ) return 7;
-  if(station == "BIR" ) return 8;
-  if(station == "BMF" ) return 9;
-  if(station == "BOF" ) return 10;
-  if(station == "BOG" ) return 11;
-  if(station == "BOH" ) return 12;
-  if(station == "BIM" ) return 13;
-  if(station == "EIC" ) return 14;
-  if(station == "EIL" ) return 15;
-  if(station == "EEL" ) return 16;
-  if(station == "EES" ) return 17;
-  if(station == "EMC" ) return 18;
-  if(station == "EML" ) return 19;
-  if(station == "EMS" ) return 20;
-  if(station == "EOC" ) return 21;
-  if(station == "EOL" ) return 22;
-  if(station == "EOS" ) return 23;
-  if(station == "EIS" ) return 24;
-  if(station == "T1F" ) return 25;
-  if(station == "T1E" ) return 26;
-  if(station == "T2F" ) return 27;
-  if(station == "T2E" ) return 28;
-  if(station == "T3F" ) return 29;
-  if(station == "T3E" ) return 30;
-  if(station == "T4F" ) return 31;
-  if(station == "T4E" ) return 32;
-  if(station == "CSS" ) return 33;
-  if(station == "CSL" ) return 34;
-  if(station == "XXX" ) return -1;
-  return -1; */
-}
-
-inline std::string MuonFixedId::stationNumberToFixedStationString(const int station)
-{
+  return -1;  // signal error if not found
+}
+
+inline std::string MuonFixedId::stationNumberToFixedStationString(const int station) {
   int index = station - kStationNameMin;
-  if ( index < 0 || index >= kNumberOfStationNames ) {
-    return "XXX";
-  } else {
+  if ( index >= 0 && index < kNumberOfStationNames ) {
     return kStationNameStrings[index];
   }
-
-/*// old stuff
-  if(station ==  1 ) return "BIL" ;
-  if(station ==  2 ) return "BIS" ;
-  if(station ==  3 ) return "BML" ;
-  if(station ==  4 ) return "BMS" ;
-  if(station ==  5 ) return "BOL" ;
-  if(station ==  6 ) return "BOS" ;
-  if(station ==  7 ) return "BEE" ;
-  if(station ==  8 ) return "BIR" ;
-  if(station ==  9 ) return "BMF" ;
-  if(station == 10 ) return "BOF" ;
-  if(station == 11 ) return "BOG" ;
-  if(station == 12 ) return "BOH" ;
-  if(station == 13 ) return "BIM" ;
-  if(station == 14 ) return "EIC" ;
-  if(station == 15 ) return "EIL" ;
-  if(station == 16 ) return "EEL" ;
-  if(station == 17 ) return "EES" ;
-  if(station == 18 ) return "EMC" ;
-  if(station == 19 ) return "EML" ;
-  if(station == 20 ) return "EMS" ;
-  if(station == 21 ) return "EOC" ;
-  if(station == 22 ) return "EOL" ;
-  if(station == 23 ) return "EOS" ;
-  if(station == 24 ) return "EIS" ;
-  if(station == 25 ) return "T1F" ;
-  if(station == 26 ) return "T1E" ;
-  if(station == 27 ) return "T2F" ;
-  if(station == 28 ) return "T2E" ;
-  if(station == 29 ) return "T3F" ;
-  if(station == 30 ) return "T3E" ;
-  if(station == 31 ) return "T4F" ;
-  if(station == 32 ) return "T4E" ;
-  if(station == 33 ) return "CSS" ;
-  if(station == 34 ) return "CSL" ;
-  else return "XXX" ; */
+  return "XXX";   // signal error if not found
 }
 
 // Mdt specific methods
@@ -874,8 +797,6 @@ inline int MuonFixedId::mdtMezzanine() const {
    return Imezz ;
 }
 
-
-
 inline bool MuonFixedId::setMdtTubeLayerIndex( unsigned int idx ) {
   if ( idx > kMdtTubeLayerMask ) {
       clear();
@@ -898,7 +819,6 @@ inline int MuonFixedId::mdtTubeLayer() const {
    return mdtTubeLayerIndex() + kMdtTubeLayerMin;
 }
 
-
 inline bool MuonFixedId::setMdtMultilayerIndex( unsigned int idx ) {
   if ( idx > kMdtMultilayerMask ) {
       clear();
@@ -1003,7 +923,6 @@ inline int MuonFixedId::cscWireLayer() const {
    return cscWireLayerIndex() + kCscWireLayerMin;
 }
 
-
 inline bool MuonFixedId::setCscMeasuresPhiIndex( unsigned int idx ) {
   if ( idx > kCscMeasuresPhiMask ) {
       clear();
@@ -1026,7 +945,6 @@ inline int MuonFixedId::cscMeasuresPhi() const {
    return cscMeasuresPhiIndex() + kCscMeasuresPhiMin;
 }
 
-
 inline bool MuonFixedId::setCscStripIndex( unsigned int idx ) {
   if ( idx > kCscStripMask ) {
       clear();
@@ -1080,8 +998,8 @@ inline int MuonFixedId::cscStripMin(){
 inline int MuonFixedId::cscStripMax(){
   return kCscStripMin + kCscStripMask;
 }
-// Rpc specific methods
 
+// Rpc specific methods
 inline bool MuonFixedId::setRpcDoubletRIndex( unsigned int idx ) {
   if ( idx > kRpcDoubletRMask ) {
       clear();
@@ -1104,7 +1022,6 @@ inline int MuonFixedId::rpcDoubletR() const {
    return rpcDoubletRIndex() + kRpcDoubletRMin;
 }
 
-
 inline bool MuonFixedId::setRpcDoubletZIndex( unsigned int idx ) {
   if ( idx > kRpcDoubletZMask ) {
       clear();
@@ -1127,7 +1044,6 @@ inline int MuonFixedId::rpcDoubletZ() const {
    return rpcDoubletZIndex() + kRpcDoubletZMin;
 }
 
-
 inline bool MuonFixedId::setRpcDoubletPhiIndex( unsigned int idx ) {
   if ( idx > kRpcDoubletPhiMask ) {
       clear();
@@ -1150,7 +1066,6 @@ inline int MuonFixedId::rpcDoubletPhi() const {
    return rpcDoubletPhiIndex() + kRpcDoubletPhiMin;
 }
 
-
 inline bool MuonFixedId::setRpcGasGapIndex( unsigned int idx ) {
   if ( idx > kRpcGasGapMask ) {
       clear();
@@ -1173,7 +1088,6 @@ inline int MuonFixedId::rpcGasGap() const {
    return rpcGasGapIndex() + kRpcGasGapMin;
 }
 
-
 inline bool MuonFixedId::setRpcMeasuresPhiIndex( unsigned int idx ) {
   if ( idx > kRpcMeasuresPhiMask ) {
       clear();
@@ -1196,7 +1110,6 @@ inline int MuonFixedId::rpcMeasuresPhi() const {
    return rpcMeasuresPhiIndex() + kRpcMeasuresPhiMin;
 }
 
-
 inline bool MuonFixedId::setRpcStripIndex( unsigned int idx ) {
   if ( idx > kRpcStripMask ) {
       clear();
@@ -1221,7 +1134,6 @@ inline int MuonFixedId::rpcStrip() const {
 
 
 //  Tgc specific methods
-
 inline bool MuonFixedId::setTgcGasGapIndex( unsigned int idx ) {
   if ( idx > kTgcGasGapMask ) {
       clear();
@@ -1303,5 +1215,3 @@ inline std::istream& operator>>( std::istream& is, MuonCalib::MuonFixedId& id){
 }
 */
 #endif // MUONCALIBIDENTIFIER_MUONFIXEDID_H
-
-
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/python/MuonFixedIdUnpack.py b/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/python/MuonFixedIdUnpack.py
index 640c0a43a28df..e6aa0a2b294f6 100644
--- a/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/python/MuonFixedIdUnpack.py
+++ b/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/python/MuonFixedIdUnpack.py
@@ -121,12 +121,8 @@ class MuonFixedIdUnpack:
 	__kStationPhiMin           = 1;
 	
 	
-	__kStationNameStrings = [ "BIL", "BIS", "BML", "BMS", "BOL", "BOS", "BEE", "BIR", "BMF", "BOF", "BOG", "BOH", "BIM", "EIC", "EIL", "EEL", "EES", "EMC", "EML", "EMS", "EOC", "EOL", "EOS", "EIS", "T1F", "T1E", "T2F", "T2E", "T3F", "T3E", "T4F", "T4E", "CSS", "CSL" ]
+	__kStationNameStrings = [ "BIL", "BIS", "BML", "BMS", "BOL", "BOS", "BEE", "BIR", "BMF", "BOF", "BOG", "BME", "BIM", "EIC", "EIL", "EEL", "EES", "EMC", "EML", "EMS", "EOC", "EOL", "EOS", "EIS", "T1F", "T1E", "T2F", "T2E", "T3F", "T3E", "T4F", "T4E", "CSS", "CSL", "BMG" ]
 	
 	
-	__kStationNameStringsMap = { "BIL" : 0,"BIS" : 1,"BML" : 2,"BMS" : 3,"BOL" : 4,"BOS" : 5,"BEE" : 6,"BIR" : 7,"BMF" : 8,"BOF" : 9,"BOG" : 10,"BOH" : 11,"BIM" : 12,"EIC" : 13,"EIL" : 14,"EEL" : 15,"EES" : 16,"EMC" : 17,"EML" : 18,"EMS" : 19,"EOC" : 20,"EOL" : 21,"EOS" : 22,"EIS" : 23,"T1F" : 24,"T1E" : 25,"T2F" : 26,"T2E" : 27,"T3F" : 28,"T3E" : 29,"T4F" : 30,"T4E" : 31,"CSS" : 32,"CSL" : 33 }
-
-	
-	
-
+	__kStationNameStringsMap = { "BIL" : 0,"BIS" : 1,"BML" : 2,"BMS" : 3,"BOL" : 4,"BOS" : 5,"BEE" : 6,"BIR" : 7,"BMF" : 8,"BOF" : 9,"BOG" : 10,"BME" : 11,"BIM" : 12,"EIC" : 13,"EIL" : 14,"EEL" : 15,"EES" : 16,"EMC" : 17,"EML" : 18,"EMS" : 19,"EOC" : 20,"EOL" : 21,"EOS" : 22,"EIS" : 23,"T1F" : 24,"T1E" : 25,"T2F" : 26,"T2E" : 27,"T3F" : 28,"T3E" : 29,"T4F" : 30,"T4E" : 31,"CSS" : 32,"CSL" : 33, "BMG" : 34 }
 
diff --git a/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/src/MuonFixedId.cxx b/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/src/MuonFixedId.cxx
index a9c1d513aa119..8191a71e1689e 100644
--- a/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/src/MuonFixedId.cxx
+++ b/MuonSpectrometer/MuonCalib/MuonCalibIdentifier/src/MuonFixedId.cxx
@@ -6,8 +6,7 @@
 
 namespace MuonCalib {
 
-std::ostream& MuonFixedId::dump(std::ostream& os) const
-{
+std::ostream& MuonFixedId::dump(std::ostream& os) const {
   os << technology() << ": stnEta " << eta() << ", stnPhi " << phi() << " " 
      << technologyString() << ": " << stationNameString() ;
   if( is_mdt() ){
@@ -29,14 +28,13 @@ std::ostream& MuonFixedId::dump(std::ostream& os) const
   return os;
 }
 
-
 const char MuonFixedId::kStationNameStrings[MuonFixedId::kNumberOfStationNames][4] = { 
      // 1      2      3      4      5      6      7      8      9     10     11     12     13
      "BIL", "BIS", "BML", "BMS", "BOL", "BOS", "BEE", "BIR", "BMF", "BOF", "BOG", "BME", "BIM",
      //14     15      16    17     18     19     20     21     22     23     24
      "EIC", "EIL", "EEL", "EES", "EMC", "EML", "EMS", "EOC", "EOL", "EOS", "EIS",
-     //25     26     27     28     29     30     31     32     33     34
-     "T1F", "T1E", "T2F", "T2E", "T3F", "T3E", "T4F", "T4E", "CSS", "CSL" 
+     //25     26     27     28     29     30     31     32     33     34     35 
+     "T1F", "T1E", "T2F", "T2E", "T3F", "T3E", "T4F", "T4E", "CSS", "CSL", "BMG" 
 };
 
 const char MuonFixedId::kTechnologyStrings[MuonFixedId::kNumberOfTechnologies][4] = {
@@ -44,4 +42,3 @@ const char MuonFixedId::kTechnologyStrings[MuonFixedId::kNumberOfTechnologies][4
 };
 
 } // end of namespace MuonCalib
-
-- 
GitLab