CMS 3D CMS Logo

Classes | Functions
SiStripMiscalibrate Namespace Reference

Classes

class  Entry
 
struct  Smearings
 

Functions

sistripsummary::TrackerRegion getRegionFromString (std::string region)
 
std::vector< sistripsummary::TrackerRegiongetRegionsFromDetId (const TrackerTopology *m_trackerTopo, DetId detid)
 
std::pair< float, float > getTruncatedRange (const TrackerMap *theMap)
 

Function Documentation

◆ getRegionFromString()

sistripsummary::TrackerRegion SiStripMiscalibrate::getRegionFromString ( std::string  region)

Definition at line 8 of file SiStripMiscalibrateHelper.cc.

References Exception, HPSPFTaus_cff::mapping, nano_mu_digi_cff::region, sistripsummary::TEC, sistripsummary::TECM, sistripsummary::TECM_1, sistripsummary::TECM_2, sistripsummary::TECM_3, sistripsummary::TECM_4, sistripsummary::TECM_5, sistripsummary::TECM_6, sistripsummary::TECM_7, sistripsummary::TECM_8, sistripsummary::TECM_9, sistripsummary::TECP, sistripsummary::TECP_1, sistripsummary::TECP_2, sistripsummary::TECP_3, sistripsummary::TECP_4, sistripsummary::TECP_5, sistripsummary::TECP_6, sistripsummary::TECP_7, sistripsummary::TECP_8, sistripsummary::TECP_9, sistripsummary::TIB, sistripsummary::TIB_1, sistripsummary::TIB_2, sistripsummary::TIB_3, sistripsummary::TIB_4, sistripsummary::TID, sistripsummary::TIDM, sistripsummary::TIDM_1, sistripsummary::TIDM_2, sistripsummary::TIDM_3, sistripsummary::TIDP, sistripsummary::TIDP_1, sistripsummary::TIDP_2, sistripsummary::TIDP_3, sistripsummary::TOB, sistripsummary::TOB_1, sistripsummary::TOB_2, sistripsummary::TOB_3, sistripsummary::TOB_4, sistripsummary::TOB_5, sistripsummary::TOB_6, and sistripsummary::TRACKER.

Referenced by SiStripChannelGainFromDBMiscalibrator::analyze(), and SiStripNoisesFromDBMiscalibrator::analyze().

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 }
Log< level::Error, false > LogError

◆ getRegionsFromDetId()

std::vector< sistripsummary::TrackerRegion > SiStripMiscalibrate::getRegionsFromDetId ( const TrackerTopology m_trackerTopo,
DetId  detid 
)

Definition at line 38 of file SiStripMiscalibrateHelper.cc.

References ALCARECOPPSCalTrackBasedSel_cff::detid, nano_mu_digi_cff::layer, runTheMatrix::ret, ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::barrel::side(), StripSubdetector::TEC, TrackerTopology::tecSide(), TrackerTopology::tecWheel(), StripSubdetector::TIB, TrackerTopology::tibLayer(), StripSubdetector::TID, TrackerTopology::tidSide(), TrackerTopology::tidWheel(), StripSubdetector::TOB, TrackerTopology::tobLayer(), and sistripsummary::TRACKER.

Referenced by SiStripChannelGainFromDBMiscalibrator::analyze(), and SiStripNoisesFromDBMiscalibrator::analyze().

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 }
static constexpr auto TEC
unsigned int tobLayer(const DetId &id) const
ret
prodAgent to be discontinued
unsigned int tidSide(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
unsigned int tecSide(const DetId &id) const
static constexpr auto TOB
static constexpr auto TIB
unsigned int tibLayer(const DetId &id) const
static constexpr auto TID

◆ getTruncatedRange()

std::pair< float, float > SiStripMiscalibrate::getTruncatedRange ( const TrackerMap theMap)

Definition at line 87 of file SiStripMiscalibrateHelper.cc.

References TrackerMap::firstRing, SiStripPI::getTheRange(), submitPVResolutionJobs::key, nano_mu_digi_cff::layer, genParticles_cff::map, mod(), callgraph::module, isotrackApplyRegressor::range, relativeConstraints::ring, and TrackerMap::smoduleMap.

Referenced by SiStripChannelGainFromDBMiscalibrator::endJob(), SiStripNoisesFromDBMiscalibrator::endJob(), and SiStripApvGainInspector::endJob().

87  {
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 }
SmoduleMap smoduleMap
Definition: TrackerMap.h:171
int firstRing[43]
Definition: TrackerMap.h:647
std::pair< float, float > getTheRange(std::map< uint32_t, float > values, const float nsigma)
key
prepare the HTCondor submission files and eventually submit them
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4