CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions
DBSpecToDetUnit Class Reference

#include <DBSpecToDetUnit.h>

Public Member Functions

uint32_t operator() (const ChamberLocationSpec &location, const FebLocationSpec &feb)
 

Detailed Description

Definition at line 8 of file DBSpecToDetUnit.h.

Member Function Documentation

uint32_t DBSpecToDetUnit::operator() ( const ChamberLocationSpec location,
const FebLocationSpec feb 
)

Definition at line 13 of file DBSpecToDetUnit.cc.

References Reference_intrackfit_cff::barrel, ChamberLocationSpec::barrelOrEndcap, RPCDetId::buildfromDB(), ChamberLocationSpec::chamberLocationName(), ChamberLocationSpec::diskOrWheel, alignCSCRings::e, ChamberLocationSpec::layer, FebLocationSpec::localEtaPartition, LogDebug, DetId::rawId(), HLT_FULL_cff::region, ChamberLocationSpec::sector, and ChamberLocationSpec::subsector.

13  {
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
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
#define LogDebug(id)