CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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(), debug, edm::MessageDrop::debugEnabled, ChamberLocationSpec::diskOrWheel, alignCSCRings::e, edm::MessageDrop::instance(), ChamberLocationSpec::layer, FebLocationSpec::localEtaPartition, LogDebug, DetId::rawId(), ChamberLocationSpec::sector, and ChamberLocationSpec::subsector.

15 {
17  // REGION
18  int region = -2;
19  bool barrel = (ch.barrelOrEndcap==1);
20  if (barrel) region = 0;
21  else if (ch.diskOrWheel<0) region = -1;
22  else if (ch.diskOrWheel>0) 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,
36  subsec, nroll, " ");
37  return dn.rawId();
38  }
39  catch(cms::Exception & e) {
40  if (debug) LogDebug ("CondFormas/DBSpecToDetInit")
41  <<" Problem with RPCDetId, got exception!! "
42  <<"DB Chamber "<<ch.chamberLocationName()<<" roll "<<nroll
43  <<e;
44  return 0;
45  }
46 }
#define LogDebug(id)
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:46
static MessageDrop * instance()
Definition: MessageDrop.cc:65
static bool debugEnabled
Definition: MessageDrop.h:105
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
#define debug
Definition: MEtoEDMFormat.h:34