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) {
36 : hitCount(
other.hitCount),
37 beginTrackHits(
other.beginTrackHits),
38 endTrackHits(
other.endTrackHits),
39 beginInner(
other.beginInner),
40 endInner(
other.endInner),
41 beginOuter(
other.beginOuter),
42 endOuter(
other.endOuter) {
43 const unsigned short max_vector_length =
88 return encode(
hit.geographicalId(),
hit.getType(), ttopo);
92 uint16_t encodeMuonLayer(
const DetId&
id) {
93 uint16_t
detid =
id.det();
94 uint16_t subdet =
id.subdetId();
109 layer = ((rpcid.station() - 1) << 2);
110 layer |= (rpcid.station() <= 2) ? ((rpcid.layer() - 1) << 1) : 0x0;
111 layer |=
abs(rpcid.region());
116 uint16_t st = gemid.station();
117 uint16_t la = gemid.layer();
122 layer |= (st - 1) << 2;
132 layer = (me0id.roll());
138 uint16_t encodeTimingLayer(
const DetId&
id) {
139 uint16_t
detid =
id.det();
140 uint16_t subdet =
id.subdetId();
141 uint16_t
layer = 0x0;
144 switch (mtdid.mtdSubDetector()) {
152 throw cms::Exception(
"HitPattern") <<
"Invalid MTD Subdetector " << mtdid.mtdSubDetector() <<
"!";
155 throw cms::Exception(
"HitPattern") <<
"Invalid DetId for FastTime det= " <<
detid <<
" subdet= " << subdet <<
"!";
162 uint16_t
detid =
id.det();
163 uint16_t subdet =
id.subdetId();
166 uint16_t layer = 0x0;
168 layer = ttopo.
layer(
id);
170 layer = encodeMuonLayer(
id);
172 layer = encodeTimingLayer(
id);
256 <<
" were stored on this object before hits of some other category were inserted " 257 <<
"but hits of the same category should be inserted in a row. " 258 <<
"Please rework the code so it inserts all " 269 <<
" were stored on this object before hits of some other category were inserted " 270 <<
"but hits of the same category should be inserted in a row. " 271 <<
"Please rework the code so it inserts all " 272 <<
"MISSING_INNER_HITS" 282 <<
" were stored on this object before hits of some other category were inserted " 283 <<
"but hits of the same category should be inserted in a row. " 284 <<
"Please rework the code so it inserts all " 285 <<
"MISSING_OUTER_HITS" 308 <<
"Got DetId from det " <<
id.det()
309 <<
" that is not Muon in appendMuonHit(), which should only be used for muon hits in the HitPattern IO rule";
312 uint16_t subdet =
id.subdetId();
342 uint8_t secondWord = (bitEndOffset >> 4);
343 uint8_t secondWordBits = bitEndOffset & (16 - 1);
345 uint8_t lowBitsToTrash = secondWordBits -
HIT_LENGTH;
349 uint8_t firstWordBits =
HIT_LENGTH - secondWordBits;
350 uint16_t firstWordBlock =
hitPattern[secondWord - 1] >> (16 - firstWordBits);
351 if (secondWordBits == 0)
352 return firstWordBlock;
353 uint16_t secondWordBlock =
hitPattern[secondWord] & ((1 << secondWordBits) - 1);
354 uint16_t myResult = firstWordBlock + (secondWordBlock << firstWordBits);
373 memset(hasMono, 0,
sizeof(hasMono));
374 memset(hasStereo, 0,
sizeof(hasStereo));
382 if (stripdet != 0 && subStructure != stripdet) {
407 if (hasMono[
i][
j] && hasStereo[
i][
j]) {
417 std::bitset<128>
side[2];
426 if (hitType != HIT_TYPE::VALID)
453 uint16_t tk_substr_layer =
468 if (hitType < layerCase) {
470 layerCase = (hitType ==
HIT_TYPE::BAD ? (uint32_t)HIT_TYPE::INACTIVE : hitType);
471 if (layerCase == HIT_TYPE::VALID) {
481 uint16_t tk_substr_layer =
489 uint16_t monoStereo = 0x0;
495 if (hitType == HIT_TYPE::VALID) {
516 std::bitset<128> layerOk;
525 if (hitType != HIT_TYPE::VALID)
532 return layerOk.count();
537 std::bitset<128> layerOk;
544 if (hitType != HIT_TYPE::VALID)
551 return layerOk.count();
555 std::bitset<128> layerOk;
556 std::bitset<128> layerMissed;
565 if (hitType == HIT_TYPE::VALID)
567 if (hitType == HIT_TYPE::MISSING)
570 layerMissed &= ~layerOk;
574 return layerMissed.count();
579 uint16_t NPixBarrel = 4;
580 for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
590 uint16_t NPixForward = 3;
591 for (uint16_t layer = 1; layer <= NPixForward; layer++) {
601 for (uint16_t layer = 1; layer <= 4; layer++) {
611 for (uint16_t layer = 1; layer <= 3; layer++) {
621 for (uint16_t layer = 1; layer <= 6; layer++) {
631 for (uint16_t layer = 1; layer <= 9; layer++) {
641 uint16_t NPixBarrel = 4;
642 for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
652 uint16_t NPixForward = 3;
653 for (uint16_t layer = 1; layer <= NPixForward; layer++) {
663 for (uint16_t layer = 1; layer <= 4; layer++) {
673 for (uint16_t layer = 1; layer <= 3; layer++) {
683 for (uint16_t layer = 1; layer <= 6; layer++) {
693 for (uint16_t layer = 1; layer <= 9; layer++) {
703 uint16_t NPixBarrel = 4;
704 for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
714 uint16_t NPixForward = 3;
715 for (uint16_t layer = 1; layer <= NPixForward; layer++) {
725 for (uint16_t layer = 1; layer <= 4; layer++) {
735 for (uint16_t layer = 1; layer <= 3; layer++) {
745 for (uint16_t layer = 1; layer <= 6; layer++) {
755 for (uint16_t layer = 1; layer <= 9; layer++) {
765 uint16_t NPixBarrel = 4;
766 for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
776 uint16_t NPixForward = 3;
777 for (uint16_t layer = 1; layer <= NPixForward; layer++) {
787 for (uint16_t layer = 1; layer <= 4; layer++) {
797 for (uint16_t layer = 1; layer <= 3; layer++) {
807 for (uint16_t layer = 1; layer <= 6; layer++) {
817 for (uint16_t layer = 1; layer <= 9; layer++) {
862 stream <<
"\tdisc/disc side/sector " <<
disc <<
" " << discside <<
" " <<
sector;
877 stream <<
"HitPattern" << std::endl;
882 stream.setf(std::ios_base::hex, std::ios_base::basefield);
883 stream.setf(std::ios_base::showbase);
897 switch (
i.subdetId()) {
980 int stations[4][2] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}};
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
int station() const
Return the station number.
static uint16_t getCSCRing(uint16_t pattern)
CSC ring (1-4). Only valid for muon CSC patterns, of course.
static constexpr auto TEC
static uint32_t getLayer(uint16_t pattern)
void insertHit(const uint16_t pattern)
int numberOfValidStripLayersWithMonoAndStereo() const
int pixelEndcapLayersWithoutMeasurement(HitCategory category) const
static const unsigned short HIT_LENGTH
static const unsigned short ARRAY_LENGTH
int stripTECLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
static const uint32_t NULL_RETURN
static bool timingHitFilter(uint16_t pattern)
static bool pixelHitFilter(uint16_t pattern)
int numberOfValidTECLayersWithMonoAndStereo(uint32_t layer=0) const
int superLayer() const
Return the superlayer number.
static uint16_t isStereo(DetId i, const TrackerTopology &ttopo)
static const unsigned short SideOffset
static const uint16_t EMPTY_PATTERN
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 getHitPatternByAbsoluteIndex(int position) const
static bool muonME0HitFilter(uint16_t pattern)
ret
prodAgent to be discontinued
static const unsigned short SubstrOffset
int trackerLayersWithMeasurement() const
int numberOfAllHits(HitCategory category) const
HitPattern & operator=(const HitPattern &other)
static const unsigned short MaxHits
ALPAKA_FN_ACC int side(int ieta, int iphi)
int stripTOBLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
int stripTIDLayersWithMeasurement() const
int pixelEndcapLayersWithMeasurement() const
int mtdSubDetector() const
static const unsigned short maxTrackerWord
int innermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
int stripTIBLayersWithoutMeasurement(HitCategory category) const
int pixelEndcapLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
static const unsigned short HitTypeMask
static bool pixelBarrelHitFilter(uint16_t pattern)
int numberOfDTStationsWithBothViews() const
bool tibIsStereo(const DetId &id) const
int stripTECLayersWithMeasurement() const
unsigned int layer(const DetId &id) const
Detector identifier base class for the MIP Timing Layer.
bool insertExpectedOuterHit(const uint16_t pattern)
static bool pixelEndcapHitFilter(uint16_t pattern)
int stripTIBLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
int stripTIBLayersNull() const
Run3ScoutingHitPatternPOD run3ScoutingHitPatternPOD() const
static bool validHitFilter(uint16_t pattern)
bool tobIsStereo(const DetId &id) const
int outermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
int numberOfDTStationsWithRPhiView() const
static uint16_t getGEMLayer(uint16_t pattern)
GEM layer: 1-6 for station 0, 1-2 for stations 1 and 2. Only valid for muon GEM patterns, of course.
static const unsigned short minTrackerWord
uint16_t hitPattern[ARRAY_LENGTH]
static bool muonCSCHitFilter(uint16_t pattern)
static uint32_t getHitType(uint16_t pattern)
static const unsigned short SubDetectorMask
static bool stripHitFilter(uint16_t pattern)
uint16_t getTrackerMonoStereo(HitCategory category, uint16_t substr, uint16_t layer) const
int numberOfDTStationsWithRZView() const
int stripTOBLayersWithoutMeasurement(HitCategory category) const
Abs< T >::type abs(const T &t)
int pixelEndcapLayersNull() const
int numberOfValidTIBLayersWithMonoAndStereo(uint32_t layer=0) const
int stripTOBLayersWithMeasurement() const
bool appendHit(const TrackingRecHit &hit, const TrackerTopology &ttopo)
int stripTECLayersWithoutMeasurement(HitCategory category) const
int stripTOBLayersNull() const
static constexpr auto TOB
static const unsigned short HitTypeOffset
uint16_t getHitPattern(HitCategory category, int position) const
bool appendTrackerHit(uint16_t subdet, uint16_t layer, uint16_t stereo, TrackingRecHit::Type hitType)
static uint32_t getSubStructure(uint16_t pattern)
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
int stripTIDLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
static uint16_t getRPCregion(uint16_t pattern)
RPC region: 0 = barrel, 1 = endcap. Only valid for muon RPC patterns, of course.
static bool muonGEMHitFilter(uint16_t pattern)
static uint16_t getGEMStation(uint16_t pattern)
GEM station: 1,2. Only valid for muon GEM patterns, of course.
static bool muonHitFilter(uint16_t pattern)
static bool trackerHitFilter(uint16_t pattern)
int trackerLayersWithoutMeasurement(HitCategory category) const
static constexpr auto TIB
static const unsigned short SideMask
static const unsigned short minStripWord
int numberOfValidTIDLayersWithMonoAndStereo(uint32_t layer=0) const
static const unsigned short SubDetectorOffset
void printHitPattern(HitCategory category, int position, std::ostream &stream) const
bool tecIsStereo(const DetId &id) const
int stripTECLayersNull() const
bool tidIsStereo(const DetId &id) const
static uint32_t getSide(uint16_t pattern)
static bool muonDTHitFilter(uint16_t pattern)
bool insertExpectedInnerHit(const uint16_t pattern)
int pixelBarrelLayersNull() const
Detector identifier class for the Endcap Timing Layer.
static const unsigned short SubstrMask
static const unsigned short LayerOffset
static int position[264][3]
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0...
bool insertTrackHit(const uint16_t pattern)
int stripTIDLayersNull() const
int pixelBarrelLayersWithMeasurement() const
int stripTIDLayersWithoutMeasurement(HitCategory category) const
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 uint16_t getMuonStation(uint16_t pattern)
Muon station (1-4). Only valid for muon patterns, of course. only for patterns from muon...
int pixelLayersWithMeasurement() const
static void decodeSector(const uint32_t rr, uint32_t &nDisc, uint32_t &discSide, uint32_t §or)
static uint32_t getSubSubStructure(uint16_t pattern)
static const unsigned short LayerMask
int pixelBarrelLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
static bool muonRPCHitFilter(uint16_t pattern)
static constexpr auto TID
static uint16_t encode(const TrackingRecHit &hit, const TrackerTopology &ttopo)
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
bool hasValidHitInPixelLayer(enum PixelSubdetector::SubDetector, uint16_t layer) const
int numberOfValidTOBLayersWithMonoAndStereo(uint32_t layer=0) const
int pixelBarrelLayersWithoutMeasurement(HitCategory category) const
bool appendMuonHit(const DetId &id, TrackingRecHit::Type hitType)
int stripTIBLayersWithMeasurement() const
void print(HitCategory category, std::ostream &stream=std::cout) const