CMS 3D CMS Logo

DBSpecToDetUnit.cc
Go to the documentation of this file.
7 #include <iostream>
8 #include <string>
9 
10 using namespace std;
11 using namespace edm;
12 
14  // REGION
15  int region = -2;
16  bool barrel = (ch.barrelOrEndcap == 1);
17  if (barrel)
18  region = 0;
19  else if (ch.diskOrWheel < 0)
20  region = -1;
21  else if (ch.diskOrWheel > 0)
22  region = 1;
23 
24  //ROLL
25  string localEtaPartVal[6] = {"Forward", "Central", "Backward", "A", "B", "C"};
26  string nroll = localEtaPartVal[feb.localEtaPartition - 1];
27 
28  //SUBSECTOR
29  string subsecVal[5] = {"--", "-", "0", "+", "++"};
30  string subsec = subsecVal[ch.subsector + 2];
31 
32  // build RPCdetId
33  try {
34  RPCDetId dn;
35  dn.buildfromDB(region, ch.diskOrWheel, ch.layer, ch.sector, subsec, nroll, " ");
36  return dn.rawId();
37  } catch (cms::Exception& e) {
38  LogDebug("CondFormas/DBSpecToDetInit") << " Problem with RPCDetId, got exception!! "
39  << "DB Chamber " << ch.chamberLocationName() << " roll " << nroll << e;
40  return 0;
41  }
42 }
void buildfromDB(int region, int ring, int layer, int sector, const std::string &subsector, const std::string &roll, const std::string &dbname)
Definition: RPCDetId.cc:35
uint32_t operator()(const ChamberLocationSpec &location, const FebLocationSpec &feb)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::string chamberLocationName() const
HLT enums.
#define LogDebug(id)