src
CondFormats
RPCObjects
src
DBSpecToDetUnit.cc
Go to the documentation of this file.
1
#include "
CondFormats/RPCObjects/interface/DBSpecToDetUnit.h
"
2
#include "
DataFormats/MuonDetId/interface/RPCDetId.h
"
3
#include "
CondFormats/RPCObjects/interface/ChamberLocationSpec.h
"
4
#include "
CondFormats/RPCObjects/interface/FebLocationSpec.h
"
5
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
6
#include "
FWCore/Utilities/interface/Exception.h
"
7
#include <iostream>
8
#include <string>
9
10
using namespace
std
;
11
using namespace
edm
;
12
13
uint32_t
DBSpecToDetUnit::operator()
(
const
ChamberLocationSpec
& ch,
const
FebLocationSpec
& feb) {
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
}
ChamberLocationSpec
Definition:
ChamberLocationSpec.h:11
RPCDetId::buildfromDB
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
MessageLogger.h
FebLocationSpec.h
RPCDetId.h
ChamberLocationSpec::layer
int layer
Definition:
ChamberLocationSpec.h:13
ChamberLocationSpec::barrelOrEndcap
char barrelOrEndcap
Definition:
ChamberLocationSpec.h:18
std
Definition:
JetResolutionObject.h:76
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
ChamberLocationSpec::sector
int sector
Definition:
ChamberLocationSpec.h:14
DBSpecToDetUnit::operator()
uint32_t operator()(const ChamberLocationSpec &location, const FebLocationSpec &feb)
Definition:
DBSpecToDetUnit.cc:13
RPCDetId
Definition:
RPCDetId.h:16
ChamberLocationSpec::diskOrWheel
int diskOrWheel
Definition:
ChamberLocationSpec.h:12
Exception.h
FebLocationSpec::localEtaPartition
char localEtaPartition
Definition:
FebLocationSpec.h:15
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition:
DetId.h:57
cms::Exception
Definition:
Exception.h:59
ChamberLocationSpec::chamberLocationName
std::string chamberLocationName() const
Definition:
ChamberLocationSpec.cc:20
ChamberLocationSpec.h
edm
HLT enums.
Definition:
AlignableModifier.h:19
ChamberLocationSpec::subsector
char subsector
Definition:
ChamberLocationSpec.h:15
FebLocationSpec
Definition:
FebLocationSpec.h:12
nano_mu_digi_cff.region
region
Definition:
nano_mu_digi_cff.py:45
Reference_intrackfit_cff.barrel
list barrel
Definition:
Reference_intrackfit_cff.py:37
DBSpecToDetUnit.h
LogDebug
#define LogDebug(id)
Definition:
MessageLogger.h:241
Generated for CMSSW Reference Manual by
1.8.14