|
|
Go to the documentation of this file.
20 : hitCount(0), beginTrackHits(0), endTrackHits(0), beginInner(0), endInner(0), beginOuter(0), endOuter(0) {
25 : hitCount(
other.hitCount),
26 beginTrackHits(
other.beginTrackHits),
27 endTrackHits(
other.endTrackHits),
28 beginInner(
other.beginInner),
29 endInner(
other.endInner),
30 beginOuter(
other.beginOuter),
31 endOuter(
other.endOuter) {
75 return encode(
hit.geographicalId(),
hit.getType(), ttopo);
79 uint16_t encodeMuonLayer(
const DetId&
id) {
80 uint16_t detid =
id.det();
81 uint16_t subdet =
id.subdetId();
96 layer = ((rpcid.station() - 1) << 2);
97 layer |= (rpcid.station() <= 2) ? ((rpcid.layer() - 1) << 1) : 0x0;
102 layer = ((gemid.station() - 1) << 2);
110 layer = (me0id.roll());
116 uint16_t encodeTimingLayer(
const DetId&
id) {
117 uint16_t detid =
id.det();
118 uint16_t subdet =
id.subdetId();
119 uint16_t
layer = 0x0;
122 switch (mtdid.mtdSubDetector()) {
130 throw cms::Exception(
"HitPattern") <<
"Invalid MTD Subdetector " << mtdid.mtdSubDetector() <<
"!";
133 throw cms::Exception(
"HitPattern") <<
"Invalid DetId for FastTime det= " << detid <<
" subdet= " << subdet <<
"!";
140 uint16_t detid =
id.det();
141 uint16_t subdet =
id.subdetId();
144 uint16_t
layer = 0x0;
148 layer = encodeMuonLayer(
id);
150 layer = encodeTimingLayer(
id);
171 return encode(detid, subdet,
layer, side, hitType);
233 <<
" were stored on this object before hits of some other category were inserted "
234 <<
"but hits of the same category should be inserted in a row. "
235 <<
"Please rework the code so it inserts all "
246 <<
" were stored on this object before hits of some other category were inserted "
247 <<
"but hits of the same category should be inserted in a row. "
248 <<
"Please rework the code so it inserts all "
249 <<
"MISSING_INNER_HITS"
259 <<
" were stored on this object before hits of some other category were inserted "
260 <<
"but hits of the same category should be inserted in a row. "
261 <<
"Please rework the code so it inserts all "
262 <<
"MISSING_OUTER_HITS"
285 <<
"Got DetId from det " <<
id.det()
286 <<
" that is not Muon in appendMuonHit(), which should only be used for muon hits in the HitPattern IO rule";
289 uint16_t subdet =
id.subdetId();
319 uint8_t secondWord = (bitEndOffset >> 4);
320 uint8_t secondWordBits = bitEndOffset & (16 - 1);
322 uint8_t lowBitsToTrash = secondWordBits -
HIT_LENGTH;
326 uint8_t firstWordBits =
HIT_LENGTH - secondWordBits;
327 uint16_t firstWordBlock =
hitPattern[secondWord - 1] >> (16 - firstWordBits);
328 uint16_t secondWordBlock =
hitPattern[secondWord] & ((1 << secondWordBits) - 1);
329 uint16_t myResult = firstWordBlock + (secondWordBlock << firstWordBits);
348 memset(hasMono, 0,
sizeof(hasMono));
349 memset(hasStereo, 0,
sizeof(hasStereo));
357 if (stripdet != 0 && subStructure != stripdet) {
382 if (hasMono[
i][
j] && hasStereo[
i][
j]) {
392 std::bitset<128> side[2];
401 if (hitType != HIT_TYPE::VALID)
408 return (side[0] & side[1]).count();
428 uint16_t tk_substr_layer =
441 if ((
pattern & mask) == tk_substr_layer) {
443 if (hitType < layerCase) {
445 layerCase = (hitType ==
HIT_TYPE::BAD ? (uint32_t)HIT_TYPE::INACTIVE : hitType);
446 if (layerCase == HIT_TYPE::VALID) {
456 uint16_t tk_substr_layer =
464 uint16_t monoStereo = 0x0;
468 if ((
pattern & mask) == tk_substr_layer) {
470 if (hitType == HIT_TYPE::VALID) {
491 std::bitset<128> layerOk;
500 if (hitType != HIT_TYPE::VALID)
507 return layerOk.count();
512 std::bitset<128> layerOk;
519 if (hitType != HIT_TYPE::VALID)
526 return layerOk.count();
530 std::bitset<128> layerOk;
531 std::bitset<128> layerMissed;
540 if (hitType == HIT_TYPE::VALID)
542 if (hitType == HIT_TYPE::MISSING)
545 layerMissed &= ~layerOk;
549 return layerMissed.count();
554 uint16_t NPixBarrel = 4;
565 uint16_t NPixForward = 3;
616 uint16_t NPixBarrel = 4;
627 uint16_t NPixForward = 3;
678 uint16_t NPixBarrel = 4;
689 uint16_t NPixForward = 3;
740 uint16_t NPixBarrel = 4;
751 uint16_t NPixForward = 3;
837 stream <<
"HitPattern" << std::endl;
842 stream.setf(std::ios_base::hex, std::ios_base::basefield);
843 stream.setf(std::ios_base::showbase);
857 switch (
i.subdetId()) {
875 int stations[4] = {0, 0, 0, 0};
884 return stations[0] + stations[1] + stations[2] + stations[3];
917 int stations[4] = {0, 0, 0, 0};
925 return stations[0] + stations[1] + stations[2] + stations[3];
929 int stations[4] = {0, 0, 0, 0};
936 return stations[0] + stations[1] + stations[2] + stations[3];
940 int stations[4][2] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}};
948 return stations[0][0] * stations[0][1] + stations[1][0] * stations[1][1] + stations[2][0] * stations[2][1] +
949 stations[3][0] * stations[3][1];
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
ret
prodAgent to be discontinued
HitPattern & operator=(const HitPattern &other)
uint16_t getHitPattern(HitCategory category, int position) const
static uint32_t getSubStructure(uint16_t pattern)
const static unsigned short HIT_LENGTH
const static unsigned short LayerOffset
int pixelEndcapLayersWithMeasurement() const
int stripTOBLayersWithMeasurement() const
int trackerLayersWithoutMeasurement(HitCategory category) const
bool tobIsStereo(const DetId &id) const
int stripTIBLayersWithoutMeasurement(HitCategory category) const
static bool muonRPCHitFilter(uint16_t pattern)
int numberOfValidTOBLayersWithMonoAndStereo(uint32_t layer=0) const
const static unsigned short SideMask
static bool validHitFilter(uint16_t pattern)
const static unsigned short HitTypeOffset
static bool muonHitFilter(uint16_t pattern)
static bool trackerHitFilter(uint16_t pattern)
bool tecIsStereo(const DetId &id) const
uint32_t const T *__restrict__ const uint32_t *__restrict__ int32_t int Histo::index_type cudaStream_t stream
int stripTIBLayersNull() const
static uint16_t getGEMLayer(uint16_t pattern)
GEM layer: 1,2. Only valid for muon GEM patterns, of course.
unsigned int layer(const DetId &id) const
static bool muonGEMHitFilter(uint16_t pattern)
static uint16_t getCSCRing(uint16_t pattern)
CSC ring (1-4). Only valid for muon CSC patterns, of course.
static bool muonCSCHitFilter(uint16_t pattern)
Detector identifier class for the Endcap Timing Layer.
int superLayer() const
Return the superlayer number.
bool insertExpectedInnerHit(const uint16_t pattern)
const static unsigned short maxTrackerWord
static uint16_t getRPCLayer(uint16_t pattern)
RPC layer: for station 1 and 2, layer = 1(inner) or 2(outer); for station 3, 4 layer is always 0....
static uint32_t getHitType(uint16_t pattern)
static uint32_t getSide(uint16_t pattern)
int pixelLayersWithMeasurement() const
int stripTOBLayersWithoutMeasurement(HitCategory category) const
bool tidIsStereo(const DetId &id) const
int pixelBarrelLayersWithMeasurement() const
const static unsigned short minTrackerWord
int pixelBarrelLayersNull() const
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0,...
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
int trackerLayersWithMeasurement() const
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
static uint32_t getSubSubStructure(uint16_t pattern)
int stripTIDLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
void print(HitCategory category, std::ostream &stream=std::cout) const
const static unsigned short minStripWord
int pixelEndcapLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
static uint16_t getGEMStation(uint16_t pattern)
GEM station: 1,2. Only valid for muon GEM patterns, of course.
bool tibIsStereo(const DetId &id) const
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
bool hasValidHitInPixelLayer(enum PixelSubdetector::SubDetector, uint16_t layer) const
static constexpr auto TIB
int pixelBarrelLayersWithoutMeasurement(HitCategory category) const
void insertHit(const uint16_t pattern)
static uint16_t getRPCregion(uint16_t pattern)
RPC region: 0 = barrel, 1 = endcap. Only valid for muon RPC patterns, of course.
constexpr std::array< uint8_t, layerIndexSize > layer
const static unsigned short SideOffset
static bool pixelHitFilter(uint16_t pattern)
int stripTIBLayersWithMeasurement() const
int numberOfDTStationsWithBothViews() const
static uint32_t getLayer(uint16_t pattern)
void printHitPattern(HitCategory category, int position, std::ostream &stream) const
static bool pixelEndcapHitFilter(uint16_t pattern)
int stripTECLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
const static unsigned short SubstrMask
static bool timingHitFilter(uint16_t pattern)
static int position[264][3]
int numberOfValidTECLayersWithMonoAndStereo(uint32_t layer=0) const
static const uint16_t EMPTY_PATTERN
int stripTIDLayersWithoutMeasurement(HitCategory category) const
static uint16_t getMuonStation(uint16_t pattern)
Muon station (1-4). Only valid for muon patterns, of course. only for patterns from muon,...
uint16_t getHitPatternByAbsoluteIndex(int position) const
const static unsigned short SubDetectorMask
const static unsigned short LayerMask
static uint16_t isStereo(DetId i, const TrackerTopology &ttopo)
int pixelBarrelLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
const static unsigned short ARRAY_LENGTH
int pixelEndcapLayersNull() const
int stripTOBLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
int stripTIDLayersWithMeasurement() const
int numberOfAllHits(HitCategory category) const
static constexpr auto TEC
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC) 4(GEM); hitType=-1(all), 0=valid, 3=bad
bool appendMuonHit(const DetId &id, TrackingRecHit::Type hitType)
int innermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
Detector identifier base class for the MIP Timing Layer.
bool appendTrackerHit(uint16_t subdet, uint16_t layer, uint16_t stereo, TrackingRecHit::Type hitType)
static constexpr auto TOB
const static unsigned short HitTypeMask
int pixelEndcapLayersWithoutMeasurement(HitCategory category) const
int numberOfDTStationsWithRPhiView() const
static const uint32_t NULL_RETURN
const static unsigned short SubstrOffset
static bool pixelBarrelHitFilter(uint16_t pattern)
Abs< T >::type abs(const T &t)
int numberOfValidStripLayersWithMonoAndStereo() const
int numberOfValidTIDLayersWithMonoAndStereo(uint32_t layer=0) const
int stripTECLayersWithMeasurement() const
int outermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
bool insertExpectedOuterHit(const uint16_t pattern)
int stripTIBLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
const static unsigned short SubDetectorOffset
static bool stripHitFilter(uint16_t pattern)
const static unsigned short MaxHits
static bool muonDTHitFilter(uint16_t pattern)
uint16_t getTrackerMonoStereo(HitCategory category, uint16_t substr, uint16_t layer) const
int numberOfDTStationsWithRZView() const
static uint16_t getDTSuperLayer(uint16_t pattern)
DT superlayer (1-3). Where the "hit" was a DT segment, superlayer is 0. Only valid for muon DT patter...
uint16_t hitPattern[ARRAY_LENGTH]
int numberOfValidTIBLayersWithMonoAndStereo(uint32_t layer=0) const
static bool muonME0HitFilter(uint16_t pattern)
static constexpr auto TID
int stripTECLayersNull() const
int station() const
Return the station number.
int stripTECLayersWithoutMeasurement(HitCategory category) const
bool insertTrackHit(const uint16_t pattern)
int stripTOBLayersNull() const
int stripTIDLayersNull() const