CMS 3D CMS Logo

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

◆ PixelId

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

◆ attachedDets()

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.

189  {
190  using namespace SiPixelPI;
191  std::vector<uint32_t> out = {};
192  edm::FileInPath m_fp;
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  }

References COUT, ztail::d, detIdToPixelId(), mps_splice::entry, Exception, edm::FileInPath::fullPath(), SiPixelDetInfoFileReader::getAllDetIds(), SiPixelPI::one, MillePedeFileConverter_cfg::out, SiPixelPI::two, and SiPixelPI::zero.

Referenced by gainCalibHelper::SiPixelGainCalibrationValuesPerRegion< isBarrel, myType, PayloadType >::fill().

◆ calculateBPixID()

static const PixelId PixelRegions::calculateBPixID ( const unsigned int  layer)
static

Definition at line 122 of file PixelRegionContainers.h.

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  }

References phase1PixelTopology::layer.

Referenced by detIdToPixelId().

◆ calculateFPixID()

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.

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  }

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

Referenced by detIdToPixelId().

◆ detIdToPixelId()

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.

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  }

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

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

◆ getIDLabels()

static const std::vector<std::string> PixelRegions::getIDLabels ( const SiPixelPI::phase ph,
bool  isBarrel 
)
static

Definition at line 99 of file PixelRegionContainers.h.

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  }

References IDlabels, PixelPluginsPhase0_cfi::isBarrel, label, MillePedeFileConverter_cfg::out, and SiPixelPI::two.

◆ itoa()

std::string PixelRegions::itoa ( int  i)

Definition at line 18 of file PixelRegionContainers.h.

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

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

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

Variable Documentation

◆ IDlabels

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

◆ PixelIDs

const std::vector<PixelId> PixelRegions::PixelIDs
PixelRegions::L3
Definition: PixelRegionContainers.h:32
SiPixelDetInfoFileReader::getAllDetIds
const std::vector< uint32_t > & getAllDetIds() const
Definition: SiPixelDetInfoFileReader.cc:85
PixelRegions::L1
Definition: PixelRegionContainers.h:32
mps_fire.i
i
Definition: mps_fire.py:428
PixelRegions::L2
Definition: PixelRegionContainers.h:32
SiPixelPI::one
Definition: SiPixelPayloadInspectorHelper.h:39
PixelRegions::calculateFPixID
static const PixelId calculateFPixID(const SiPixelPI::phase &ph, const unsigned int side, const unsigned int disk, const unsigned int ring)
Definition: PixelRegionContainers.h:129
PixelRegions::Ph2FpR1
Definition: PixelRegionContainers.h:41
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
PixelRegions::Ph2FpR4
Definition: PixelRegionContainers.h:41
sistrip::disk_
static const char disk_[]
Definition: ConstantsForGranularity.h:33
TrackerTopology::pxfSide
unsigned int pxfSide(const DetId &id) const
Definition: TrackerTopology.h:192
SiPixelPI::ring
int ring(const DetId &detid, const TrackerTopology &tTopo_, bool phase_)
Definition: SiPixelPayloadInspectorHelper.h:163
SiPixelPI
Definition: SiPixelPayloadInspectorHelper.h:37
PixelRegions::Ph2EpR1
Definition: PixelRegionContainers.h:39
PixelRegions::Ph2EmR2
Definition: PixelRegionContainers.h:38
mps_splice.entry
entry
Definition: mps_splice.py:68
PixelRegions::Ph2EpR4
Definition: PixelRegionContainers.h:39
PixelRegions::Rm1l
Definition: PixelRegionContainers.h:34
PixelRegions::Rp1l
Definition: PixelRegionContainers.h:36
PixelRegions::Rp3u
Definition: PixelRegionContainers.h:36
PixelRegions::PixelId
PixelId
Definition: PixelRegionContainers.h:30
PixelRegions::Ph2FmR4
Definition: PixelRegionContainers.h:40
SiPixelPI::zero
Definition: SiPixelPayloadInspectorHelper.h:39
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
TrackerTopology::pxbLayer
unsigned int pxbLayer(const DetId &id) const
Definition: TrackerTopology.h:144
PixelRegions::Ph2FmR3
Definition: PixelRegionContainers.h:40
DetId
Definition: DetId.h:17
SiPixelDetInfoFileReader
Definition: SiPixelDetInfoFileReader.h:28
edm::FileInPath
Definition: FileInPath.h:64
PixelRegions::Rp1u
Definition: PixelRegionContainers.h:36
PixelRegions::Rp2u
Definition: PixelRegionContainers.h:36
PixelRegions::detIdToPixelId
static const PixelId detIdToPixelId(const unsigned int detid, const TrackerTopology *trackTopo, const SiPixelPI::phase &ph)
Definition: PixelRegionContainers.h:151
PixelRegions::Ph2EmR3
Definition: PixelRegionContainers.h:38
PixelRegions::Rm2l
Definition: PixelRegionContainers.h:34
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
PixelRegions::Ph2EmR1
Definition: PixelRegionContainers.h:38
PixelRegions::Rp3l
Definition: PixelRegionContainers.h:36
PixelPluginsPhase0_cfi.isBarrel
isBarrel
Definition: PixelPluginsPhase0_cfi.py:17
PixelRegions::Rm2u
Definition: PixelRegionContainers.h:34
align::ID
uint32_t ID
Definition: Definitions.h:24
PixelRegions::Ph2FmR5
Definition: PixelRegionContainers.h:40
PixelRegions::IDlabels
const std::vector< std::string > IDlabels
Definition: PixelRegionContainers.h:62
PixelRegions::Rm3u
Definition: PixelRegionContainers.h:34
PixelRegions::Ph2FmR1
Definition: PixelRegionContainers.h:40
PixelRegions::L4
Definition: PixelRegionContainers.h:32
TrackerTopology::pxfDisk
unsigned int pxfDisk(const DetId &id) const
Definition: TrackerTopology.h:446
PixelRegions::Rm1u
Definition: PixelRegionContainers.h:34
PixelRegions::Ph2EpR3
Definition: PixelRegionContainers.h:39
PixelRegions::calculateBPixID
static const PixelId calculateBPixID(const unsigned int layer)
Definition: PixelRegionContainers.h:122
PixelRegions::Rm3l
Definition: PixelRegionContainers.h:34
COUT
#define COUT
Definition: PVValidationHelpers.h:13
SiPixelPI::two
Definition: SiPixelPayloadInspectorHelper.h:39
PixelRegions::Ph2FpR2
Definition: PixelRegionContainers.h:41
PixelRegions::Ph2FpR5
Definition: PixelRegionContainers.h:41
PixelRegions::Ph2EmR4
Definition: PixelRegionContainers.h:38
Exception
Definition: hltDiff.cc:245
PixelRegions::Ph2FpR3
Definition: PixelRegionContainers.h:41
PixelRegions::End
Definition: PixelRegionContainers.h:42
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
ztail.d
d
Definition: ztail.py:151
TrackerTopology::pxfBlade
unsigned int pxfBlade(const DetId &id) const
Definition: TrackerTopology.h:447
PixelRegions::Ph2FmR2
Definition: PixelRegionContainers.h:40
PixelRegions::Rp2l
Definition: PixelRegionContainers.h:36
label
const char * label
Definition: PFTauDecayModeTools.cc:11
hcallasereventfilter2012_cfi.prefix
prefix
Definition: hcallasereventfilter2012_cfi.py:10
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:161
PixelRegions::Ph2EpR2
Definition: PixelRegionContainers.h:39