CMS 3D CMS Logo

SiStripMiscalibrateHelper.cc
Go to the documentation of this file.
6 
7 /*--------------------------------------------------------------------*/
9 /*--------------------------------------------------------------------*/
10 {
11  std::map<std::string, sistripsummary::TrackerRegion> mapping = {
12  {"Tracker", sistripsummary::TRACKER}, {"TIB", sistripsummary::TIB}, {"TIB_1", sistripsummary::TIB_1},
13  {"TIB_2", sistripsummary::TIB_2}, {"TIB_3", sistripsummary::TIB_3}, {"TIB_4", sistripsummary::TIB_4},
14  {"TID", sistripsummary::TID}, {"TIDP", sistripsummary::TIDP}, {"TIDP_1", sistripsummary::TIDP_1},
15  {"TIDP_2", sistripsummary::TIDP_2}, {"TIDP_3", sistripsummary::TIDP_3}, {"TIDM", sistripsummary::TIDM},
16  {"TIDM_1", sistripsummary::TIDM_1}, {"TIDM_2", sistripsummary::TIDM_2}, {"TIDM_3", sistripsummary::TIDM_3},
17  {"TOB", sistripsummary::TOB}, {"TOB_1", sistripsummary::TOB_1}, {"TOB_2", sistripsummary::TOB_2},
18  {"TOB_3", sistripsummary::TOB_3}, {"TOB_4", sistripsummary::TOB_4}, {"TOB_5", sistripsummary::TOB_5},
19  {"TOB_6", sistripsummary::TOB_6}, {"TEC", sistripsummary::TEC}, {"TECP", sistripsummary::TECP},
20  {"TECP_1", sistripsummary::TECP_1}, {"TECP_2", sistripsummary::TECP_2}, {"TECP_3", sistripsummary::TECP_3},
21  {"TECP_4", sistripsummary::TECP_4}, {"TECP_5", sistripsummary::TECP_5}, {"TECP_6", sistripsummary::TECP_6},
22  {"TECP_7", sistripsummary::TECP_7}, {"TECP_8", sistripsummary::TECP_8}, {"TECP_9", sistripsummary::TECP_9},
23  {"TECM", sistripsummary::TECM}, {"TECM_1", sistripsummary::TECM_1}, {"TECM_2", sistripsummary::TECM_2},
24  {"TECM_3", sistripsummary::TECM_3}, {"TECM_4", sistripsummary::TECM_4}, {"TECM_5", sistripsummary::TECM_5},
25  {"TECM_6", sistripsummary::TECM_6}, {"TECM_7", sistripsummary::TECM_7}, {"TECM_8", sistripsummary::TECM_8},
26  {"TECM_9", sistripsummary::TECM_9}};
27 
28  if (mapping.find(region) == mapping.end()) {
29  edm::LogError("SiStripMiscalibrate") << "@SUB=analyze"
30  << "Unknown partition: " << region;
31  throw cms::Exception("Invalid Partition passed");
32  } else {
33  return mapping[region];
34  }
35 }
36 
37 /*--------------------------------------------------------------------*/
38 std::vector<sistripsummary::TrackerRegion> SiStripMiscalibrate::getRegionsFromDetId(
39  const TrackerTopology* m_trackerTopo, DetId detid)
40 /*--------------------------------------------------------------------*/
41 {
42  int layer = 0;
43  int side = 0;
44  int subdet = 0;
45  int detCode = 0;
46 
47  std::vector<sistripsummary::TrackerRegion> ret;
48 
49  switch (detid.subdetId()) {
51  layer = m_trackerTopo->tibLayer(detid);
52  subdet = 1;
53  break;
55  layer = m_trackerTopo->tobLayer(detid);
56  subdet = 2;
57  break;
59  // is this module in TID+ or TID-?
60  layer = m_trackerTopo->tidWheel(detid);
61  side = m_trackerTopo->tidSide(detid);
62  subdet = 3 * 10 + side;
63  break;
65  // is this module in TEC+ or TEC-?
66  layer = m_trackerTopo->tecWheel(detid);
67  side = m_trackerTopo->tecSide(detid);
68  subdet = 4 * 10 + side;
69  break;
70  }
71 
72  detCode = (subdet * 10) + layer;
73 
74  ret.push_back(static_cast<sistripsummary::TrackerRegion>(detCode));
75 
76  if (subdet / 10 > 0) {
77  ret.push_back(static_cast<sistripsummary::TrackerRegion>(subdet / 10));
78  }
79 
80  ret.push_back(static_cast<sistripsummary::TrackerRegion>(subdet));
81  ret.push_back(sistripsummary::TRACKER);
82 
83  return ret;
84 }
85 
86 /*--------------------------------------------------------------------*/
87 std::pair<float, float> SiStripMiscalibrate::getTruncatedRange(const TrackerMap* theMap) {
88  /*--------------------------------------------------------------------*/
89 
90  // ------------ trim the tracker map ------------
91 
92  auto map = theMap->smoduleMap;
93  std::map<unsigned int, float> info_per_detid;
94  for (int layer = 1; layer < 44; layer++) {
95  for (int ring = theMap->firstRing[layer - 1]; ring < theMap->ntotRing[layer - 1] + theMap->firstRing[layer - 1];
96  ring++) {
97  for (int module = 1; module < 200; module++) {
98  int key = layer * 100000 + ring * 1000 + module;
99  TmModule* mod = map[key];
100  if (mod != nullptr && !mod->notInUse() && mod->count > 0) {
101  info_per_detid[key] = mod->value;
102  }
103  } // loop on modules
104  } // loop on ring
105  } // loop on layers
106 
107  auto range = SiStripPI::getTheRange(info_per_detid, 2);
108  return range;
109 }
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:542
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
TmModule
Definition: TmModule.h:4
MessageLogger.h
sistripsummary::TIDM_3
Definition: SiStripSummary.h:38
sistripsummary::TOB_3
Definition: SiStripSummary.h:29
TrackerTopology
Definition: TrackerTopology.h:16
sistripsummary::TOB_6
Definition: SiStripSummary.h:32
sistripsummary::TOB
Definition: SiStripSummary.h:26
mod
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
sistripsummary::TOB_1
Definition: SiStripSummary.h:27
sistripsummary::TIB_3
Definition: SiStripSummary.h:24
sistripsummary::TIDP
Definition: SiStripSummary.h:35
sistripsummary::TECP_1
Definition: SiStripSummary.h:54
sistripsummary::TOB_2
Definition: SiStripSummary.h:28
sistripsummary::TECM_5
Definition: SiStripSummary.h:49
TrackerTopology::tidWheel
unsigned int tidWheel(const DetId &id) const
Definition: TrackerTopology.h:201
DetId
Definition: DetId.h:17
sistripsummary::TECP_3
Definition: SiStripSummary.h:56
sistripsummary::TECP_9
Definition: SiStripSummary.h:62
sistripsummary::TIDP_3
Definition: SiStripSummary.h:41
sistripsummary::TECP
Definition: SiStripSummary.h:44
sistripsummary::TrackerRegion
TrackerRegion
Definition: SiStripSummary.h:19
TmModule.h
sistripsummary::TECP_2
Definition: SiStripSummary.h:55
sistripsummary::TIB_2
Definition: SiStripSummary.h:23
sistripsummary::TOB_5
Definition: SiStripSummary.h:31
StripSubdetector::TIB
static constexpr auto TIB
Definition: StripSubdetector.h:16
sistripsummary::TIB
Definition: SiStripSummary.h:21
TrackerMap
Definition: TrackerMap.h:76
sistripsummary::TECP_8
Definition: SiStripSummary.h:61
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
sistripsummary::TIDP_2
Definition: SiStripSummary.h:40
sistripsummary::TECP_5
Definition: SiStripSummary.h:58
SiStripMiscalibrate::getTruncatedRange
std::pair< float, float > getTruncatedRange(const TrackerMap *theMap)
Definition: SiStripMiscalibrateHelper.cc:87
SiStripSummary.h
TrackerTopology::tidSide
unsigned int tidSide(const DetId &id) const
Definition: TrackerTopology.h:190
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88271
sistripsummary::TECM_8
Definition: SiStripSummary.h:52
sistripsummary::TECM_7
Definition: SiStripSummary.h:51
TrackerMap::firstRing
int firstRing[43]
Definition: TrackerMap.h:655
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
sistripsummary::TIDM
Definition: SiStripSummary.h:34
SiStripMiscalibrateHelper.h
sistripsummary::TID
Definition: SiStripSummary.h:33
sistripsummary::TECM_1
Definition: SiStripSummary.h:45
SiStripPayloadInspectorHelper.h
sistripsummary::TIB_1
Definition: SiStripSummary.h:22
TrackerTopology::tobLayer
unsigned int tobLayer(const DetId &id) const
Definition: TrackerTopology.h:147
sistripsummary::TEC
Definition: SiStripSummary.h:42
StripSubdetector::TEC
static constexpr auto TEC
Definition: StripSubdetector.h:19
Exception
Definition: hltDiff.cc:245
sistripsummary::TECM_6
Definition: SiStripSummary.h:50
sistripsummary::TECM_4
Definition: SiStripSummary.h:48
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
StripSubdetector::TOB
static constexpr auto TOB
Definition: StripSubdetector.h:18
TrackerMap::smoduleMap
SmoduleMap smoduleMap
Definition: TrackerMap.h:172
sistripsummary::TRACKER
Definition: SiStripSummary.h:20
sistripsummary::TOB_4
Definition: SiStripSummary.h:30
SiStripMiscalibrate::getRegionFromString
sistripsummary::TrackerRegion getRegionFromString(std::string region)
Definition: SiStripMiscalibrateHelper.cc:8
genParticles_cff.map
map
Definition: genParticles_cff.py:11
sistripsummary::TECP_4
Definition: SiStripSummary.h:57
sistripsummary::TECM_2
Definition: SiStripSummary.h:46
sistripsummary::TIDP_1
Definition: SiStripSummary.h:39
sistripsummary::TECP_7
Definition: SiStripSummary.h:60
sistripsummary::TECM
Definition: SiStripSummary.h:43
crabWrapper.key
key
Definition: crabWrapper.py:19
sistripsummary::TECM_9
Definition: SiStripSummary.h:53
TrackerTopology::tecWheel
unsigned int tecWheel(const DetId &id) const
Definition: TrackerTopology.h:198
sistripsummary::TECP_6
Definition: SiStripSummary.h:59
SiStripPI::getTheRange
std::pair< float, float > getTheRange(std::map< uint32_t, float > values, const float nsigma)
Definition: SiStripPayloadInspectorHelper.h:340
sistripsummary::TECM_3
Definition: SiStripSummary.h:47
taus_updatedMVAIds_cff.mapping
mapping
Definition: taus_updatedMVAIds_cff.py:29
sistripsummary::TIDM_1
Definition: SiStripSummary.h:36
StripSubdetector::TID
static constexpr auto TID
Definition: StripSubdetector.h:17
sistripsummary::TIDM_2
Definition: SiStripSummary.h:37
SiStripMiscalibrate::getRegionsFromDetId
std::vector< sistripsummary::TrackerRegion > getRegionsFromDetId(const TrackerTopology *m_trackerTopo, DetId detid)
Definition: SiStripMiscalibrateHelper.cc:38
TrackerTopology::tibLayer
unsigned int tibLayer(const DetId &id) const
Definition: TrackerTopology.h:150
sistripsummary::TIB_4
Definition: SiStripSummary.h:25
TrackerTopology::tecSide
unsigned int tecSide(const DetId &id) const
Definition: TrackerTopology.h:184