CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Enumerations | Functions | Variables
PixelRegions Namespace Reference

Classes

class  PixelRegionContainers
 

Enumerations

enum  PixelId {
  L1 = 1100, L2 = 1200, L3 = 1300, L4 = 1400,
  Rm1l = 2111, Rm1u = 2112, Rm2l = 2121, Rm2u = 2122,
  Rm3l = 2131, Rm3u = 2132, Rp1l = 2211, Rp1u = 2212,
  Rp2l = 2221, Rp2u = 2222, Rp3l = 2231, Rp3u = 2232,
  Ph2EmR1 = 3101, Ph2EmR2 = 3102, Ph2EmR3 = 3103, Ph2EmR4 = 3104,
  Ph2EpR1 = 3201, Ph2EpR2 = 3202, Ph2EpR3 = 3203, Ph2EpR4 = 3204,
  Ph2FmR1 = 4101, Ph2FmR2 = 4102, Ph2FmR3 = 4103, Ph2FmR4 = 4104,
  Ph2FmR5 = 4105, Ph2FpR1 = 4201, Ph2FpR2 = 4202, Ph2FpR3 = 4203,
  Ph2FpR4 = 4204, Ph2FpR5 = 4205, End = 99999
}
 

Functions

static const std::vector
< uint32_t > 
attachedDets (const PixelRegions::PixelId theId, const TrackerTopology *trackTopo, const SiPixelPI::phase &ph)
 
static const PixelId calculateBPixID (const unsigned int layer)
 
static const PixelId calculateFPixID (const SiPixelPI::phase &ph, const unsigned int side, const unsigned int disk, const unsigned int ring)
 
static const PixelId detIdToPixelId (const unsigned int detid, const TrackerTopology *trackTopo, const SiPixelPI::phase &ph)
 
static const std::vector
< std::string > 
getIDLabels (const SiPixelPI::phase &ph, bool isBarrel)
 
std::string itoa (int i)
 

Variables

const std::vector< std::string > IDlabels
 
const std::vector< PixelIdPixelIDs
 

Enumeration Type Documentation

Enumerator
L1 
L2 
L3 
L4 
Rm1l 
Rm1u 
Rm2l 
Rm2u 
Rm3l 
Rm3u 
Rp1l 
Rp1u 
Rp2l 
Rp2u 
Rp3l 
Rp3u 
Ph2EmR1 
Ph2EmR2 
Ph2EmR3 
Ph2EmR4 
Ph2EpR1 
Ph2EpR2 
Ph2EpR3 
Ph2EpR4 
Ph2FmR1 
Ph2FmR2 
Ph2FmR3 
Ph2FmR4 
Ph2FmR5 
Ph2FpR1 
Ph2FpR2 
Ph2FpR3 
Ph2FpR4 
Ph2FpR5 
End 

Definition at line 30 of file PixelRegionContainers.h.

30  {
31  // BPix
32  L1 = 1100, L2 = 1200, L3 = 1300, L4 = 1400, // common to phase1 and phase2
33  // FPix minus
34  Rm1l = 2111, Rm1u = 2112, Rm2l = 2121, Rm2u = 2122, Rm3l = 2131, Rm3u = 2132, // phase1-only
35  // FPix plus
36  Rp1l = 2211, Rp1u = 2212, Rp2l = 2221, Rp2u = 2222, Rp3l = 2231, Rp3u = 2232, // phase1-only
37  // Phase-2 endcaps
38  Ph2EmR1 = 3101, Ph2EmR2 = 3102, Ph2EmR3 = 3103, Ph2EmR4 = 3104, // phase-2 EPix
39  Ph2EpR1 = 3201, Ph2EpR2 = 3202, Ph2EpR3 = 3203, Ph2EpR4 = 3204,
40  Ph2FmR1 = 4101, Ph2FmR2 = 4102, Ph2FmR3 = 4103, Ph2FmR4 = 4104, Ph2FmR5 = 4105, //phase-2 FPix
41  Ph2FpR1 = 4201, Ph2FpR2 = 4202, Ph2FpR3 = 4203, Ph2FpR4 = 4204, Ph2FpR5 = 4205,
42  End = 99999
43  };

Function Documentation

static const std::vector<uint32_t> PixelRegions::attachedDets ( const PixelRegions::PixelId  theId,
const TrackerTopology trackTopo,
const SiPixelPI::phase ph 
)
static

Definition at line 187 of file PixelRegionContainers.h.

References COUT, ztail::d, detIdToPixelId(), mps_splice::entry, Exception, SiPixelDetInfoFileReader::getAllDetIds(), m_fp(), SiPixelPI::one, submitPVResolutionJobs::out, SiPixelPI::two, and SiPixelPI::zero.

Referenced by gainCalibHelper::SiPixelGainCalibrationValuesPerRegion< isBarrel, myType, PayloadType >::fill(), and gainCalibHelper::SiPixelGainCalibrationValuesComparisonPerRegion< isBarrel, myType, nIOVs, ntags, PayloadType >::fill().

189  {
190  using namespace SiPixelPI;
191  std::vector<uint32_t> out = {};
193 
194  switch (ph) {
195  case phase::zero:
196  // phase-1 skimmed geometry from release
197  m_fp = edm::FileInPath("CalibTracker/SiPixelESProducers/data/PixelSkimmedGeometry.txt");
198  break;
199  case phase::one:
200  // phase-0 skimmed geometry from release
201  m_fp = edm::FileInPath("SLHCUpgradeSimulations/Geometry/data/PhaseI/PixelSkimmedGeometry_phase1.txt");
202  break;
203  case phase::two:
204  m_fp = edm::FileInPath("SLHCUpgradeSimulations/Geometry/data/PhaseII/Tilted/PixelSkimmedGeometryT14.txt");
205  break;
206  default:
207  throw cms::Exception("LogicalError") << " there is not such phase as " << ph;
208  }
209 
210  SiPixelDetInfoFileReader pxlreader(m_fp.fullPath());
211  const std::vector<uint32_t>& pxldetids = pxlreader.getAllDetIds();
212  for (const auto& d : pxldetids) {
213  auto ID = detIdToPixelId(d, trackTopo, ph);
214  if (ID == theId) {
215  out.push_back(d);
216  }
217  }
218 
219  // in case no DetIds are assigned, fill with UINT32_MAX
220  // in order to be able to tell a part the default case
221  // in SiPixelGainCalibHelper::fillTheHitsto
222  if (out.empty()) {
223  out.push_back(0xFFFFFFFF);
224  }
225 
226  COUT << "ID:" << theId << " ";
227  for (const auto& entry : out) {
228  COUT << entry << ",";
229  }
230  COUT << std::endl;
231 
232  return out;
233  }
const std::vector< uint32_t > & getAllDetIds() const
uint32_t ID
Definition: Definitions.h:24
tuple d
Definition: ztail.py:151
m_fp(iConfig.getUntrackedParameter< edm::FileInPath >("file", edm::FileInPath("CalibTracker/SiPixelESProducers/data/PixelSkimmedGeometry.txt")))
#define COUT
list entry
Definition: mps_splice.py:68
static const PixelId detIdToPixelId(const unsigned int detid, const TrackerTopology *trackTopo, const SiPixelPI::phase &ph)
static const PixelId PixelRegions::calculateBPixID ( const unsigned int  layer)
static

Definition at line 122 of file PixelRegionContainers.h.

References phase1PixelTopology::layer.

Referenced by detIdToPixelId().

122  {
123  // BPix: 1000*(subdetId=1) + 100*(layer=1,2,3,4)
124  PixelId bpixLayer = static_cast<PixelId>(1000 + 100 * layer);
125  return bpixLayer;
126  }
constexpr std::array< uint8_t, layerIndexSize > layer
static const PixelId PixelRegions::calculateFPixID ( const SiPixelPI::phase ph,
const unsigned int  side,
const unsigned int  disk,
const unsigned int  ring 
)
static

Definition at line 129 of file PixelRegionContainers.h.

References sistrip::disk_, SiPixelPI::one, PostProcessorHGCAL_cfi::prefix, and relativeConstraints::ring.

Referenced by detIdToPixelId().

132  {
133  // FPix: 1000*(subdetId=2) + 100*(side=1,2) + 10*(disk=1,2,3) + 1*(ring=1,2)
134  using namespace SiPixelPI;
135  unsigned int prefix(2000);
136  unsigned int disk_(0); // if that's phase-2 set the disk n. to zero
137  if (ph > phase::one) {
138  if (disk < 9) {
139  prefix += 1000; // if that's EPix id starts with 3k
140  } else {
141  prefix += 2000; // if that's FPix id starts with 4k
142  }
143  } else {
144  disk_ = disk; // if that's not phase-2 set the disk to real disk n.
145  }
146  PixelId fpixRing = static_cast<PixelId>(prefix + 100 * side + 10 * disk_ + ring);
147  return fpixRing;
148  }
int ring(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
static const char disk_[]
static const PixelId PixelRegions::detIdToPixelId ( const unsigned int  detid,
const TrackerTopology trackTopo,
const SiPixelPI::phase ph 
)
static

Definition at line 151 of file PixelRegionContainers.h.

References calculateBPixID(), calculateFPixID(), Exception, phase1PixelTopology::layer, SiPixelPI::one, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, TrackerTopology::pxbLayer(), TrackerTopology::pxfBlade(), TrackerTopology::pxfDisk(), TrackerTopology::pxfSide(), relativeConstraints::ring, SiPixelPI::ring(), SiPixelPI::two, and SiPixelPI::zero.

Referenced by attachedDets(), and PixelRegions::PixelRegionContainers::fill().

153  {
154  using namespace SiPixelPI;
155  DetId detId = DetId(detid);
156  unsigned int subid = detId.subdetId();
157  unsigned int pixid = 0;
158  if (subid == PixelSubdetector::PixelBarrel) {
159  int layer = trackTopo->pxbLayer(detId); // 1, 2, 3, 4
160  pixid = calculateBPixID(layer);
161  } else if (subid == PixelSubdetector::PixelEndcap) {
162  int side = trackTopo->pxfSide(detId); // 1 (-z), 2 for (+z)
163  int disk = trackTopo->pxfDisk(detId); // 1, 2, 3
164  int ring(0);
165  switch (ph) {
166  case phase::zero:
167  ring = SiPixelPI::ring(detid, *trackTopo, false); // 1 (lower), 2 (upper)
168  break;
169  case phase::one:
170  ring = SiPixelPI::ring(detid, *trackTopo, true); // 1 (lower), 2 (upper)
171  break;
172  case phase::two:
173  // I know, that's funny but go look at:
174  // https://github.com/cms-sw/cmssw/blob/master/Geometry/TrackerNumberingBuilder/README.md
175  ring = trackTopo->pxfBlade(detId);
176  break;
177  default:
178  throw cms::Exception("LogicalError") << " there is not such phase as " << ph;
179  }
180  pixid = calculateFPixID(ph, side, disk, ring);
181  }
182  PixelId pixID = static_cast<PixelId>(pixid);
183  return pixID;
184  }
unsigned int pxfDisk(const DetId &id) const
constexpr std::array< uint8_t, layerIndexSize > layer
unsigned int pxbLayer(const DetId &id) const
int ring(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
Definition: DetId.h:17
static const PixelId calculateFPixID(const SiPixelPI::phase &ph, const unsigned int side, const unsigned int disk, const unsigned int ring)
unsigned int pxfSide(const DetId &id) const
unsigned int pxfBlade(const DetId &id) const
static const PixelId calculateBPixID(const unsigned int layer)
static const std::vector<std::string> PixelRegions::getIDLabels ( const SiPixelPI::phase ph,
bool  isBarrel 
)
static

Definition at line 99 of file PixelRegionContainers.h.

References IDlabels, label, submitPVResolutionJobs::out, and SiPixelPI::two.

99  {
100  std::vector<std::string> out;
101  for (const auto& label : IDlabels) {
102  if (isBarrel) {
103  if (label.find("Barrel") != std::string::npos) {
104  out.push_back(label);
105  }
106  } else {
107  if (ph == SiPixelPI::phase::two) {
108  if (label.find("Ring") != std::string::npos) {
109  out.push_back(label);
110  }
111  } else {
112  if (label.find("ring") != std::string::npos) {
113  out.push_back(label);
114  }
115  }
116  }
117  }
118  return out;
119  }
const std::vector< std::string > IDlabels
char const * label
std::string PixelRegions::itoa ( int  i)
inline

Definition at line 18 of file PixelRegionContainers.h.

References AlCaHLTBitMon_QueryRunRegistry::string, and groupFilesInBlocks::temp.

Referenced by PixelRegions::PixelRegionContainers::bookAll().

18  {
19  char temp[20];
20  sprintf(temp, "%d", i);
21  return ((std::string)temp);
22  }

Variable Documentation

const std::vector<std::string> PixelRegions::IDlabels
const std::vector<PixelId> PixelRegions::PixelIDs
Initial value:
= {
}

Definition at line 45 of file PixelRegionContainers.h.

Referenced by PixelRegions::PixelRegionContainers::bookAll(), PixelRegions::PixelRegionContainers::draw(), gainCalibHelper::SiPixelGainCalibrationValuesPerRegion< isBarrel, myType, PayloadType >::fill(), and gainCalibHelper::SiPixelGainCalibrationValuesComparisonPerRegion< isBarrel, myType, nIOVs, ntags, PayloadType >::fill().