CMS 3D CMS Logo

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, MillePedeFileConverter_cfg::e, ChamberLocationSpec::layer, FebLocationSpec::localEtaPartition, LogDebug, DetId::rawId(), ChamberLocationSpec::sector, and ChamberLocationSpec::subsector.

15 {
16  // REGION
17  int region = -2;
18  bool barrel = (ch.barrelOrEndcap==1);
19  if (barrel) region = 0;
20  else if (ch.diskOrWheel<0) region = -1;
21  else if (ch.diskOrWheel>0) region = 1;
22 
23  //ROLL
24  string localEtaPartVal[6]={"Forward","Central","Backward","A","B","C"};
25  string nroll = localEtaPartVal[feb.localEtaPartition-1];
26 
27  //SUBSECTOR
28  string subsecVal[5]={"--","-","0","+","++"};
29  string subsec=subsecVal[ch.subsector+2];
30 
31  // build RPCdetId
32  try {
33  RPCDetId dn;
34  dn.buildfromDB(region, ch.diskOrWheel, ch.layer, ch.sector,
35  subsec, nroll, " ");
36  return dn.rawId();
37  }
38  catch(cms::Exception & e) {
39  LogDebug ("CondFormas/DBSpecToDetInit")
40  <<" Problem with RPCDetId, got exception!! "
41  <<"DB Chamber "<<ch.chamberLocationName()<<" roll "<<nroll
42  <<e;
43  return 0;
44  }
45 }
#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:45
uint32_t rawId() const
get the raw id
Definition: DetId.h:43