30 hitCount(other.hitCount),
31 beginTrackHits(other.beginTrackHits),
32 endTrackHits(other.endTrackHits),
33 beginInner(other.beginInner),
34 endInner(other.endInner),
35 beginOuter(other.beginOuter),
36 endOuter(other.endOuter)
95 uint16_t
detid =
id.det();
101 uint16_t subdet =
id.subdetId();
105 uint16_t layer = 0x0;
130 layer = ((
DTLayerId(
id.rawId()).station() - 1) << 2);
131 layer |=
DTLayerId(
id.rawId()).superLayer();
134 layer = ((
CSCDetId(
id.rawId()).station() - 1) << 2);
135 layer |= (
CSCDetId(
id.rawId()).ring() - 1);
140 layer = ((rpcid.
station() - 1) << 2);
141 layer |= (rpcid.
station() <= 2) ? ((rpcid.
layer() - 1) << 1) : 0x0;
194 <<
" were stored on this object before hits of some other category were inserted "
195 <<
"but hits of the same category should be inserted in a row. "
196 <<
"Please rework the code so it inserts all "
206 <<
"MISSING_INNER_HITS"
207 <<
" were stored on this object before hits of some other category were inserted "
208 <<
"but hits of the same category should be inserted in a row. "
209 <<
"Please rework the code so it inserts all "
210 <<
"MISSING_INNER_HITS"
219 <<
"MISSING_OUTER_HITS"
220 <<
" were stored on this object before hits of some other category were inserted "
221 <<
"but hits of the same category should be inserted in a row. "
222 <<
"Please rework the code so it inserts all "
223 <<
"MISSING_OUTER_HITS"
260 uint16_t bitEndOffset = (position + 1) *
HIT_LENGTH;
261 uint8_t secondWord = (bitEndOffset >> 4);
262 uint8_t secondWordBits = bitEndOffset & (16 - 1);
264 uint8_t lowBitsToTrash = secondWordBits -
HIT_LENGTH;
265 uint16_t myResult = (
hitPattern[secondWord] >> lowBitsToTrash) & ((1 << HIT_LENGTH) - 1);
268 uint8_t firstWordBits =
HIT_LENGTH - secondWordBits;
269 uint16_t firstWordBlock =
hitPattern[secondWord - 1] >> (16 - firstWordBits);
270 uint16_t secondWordBlock =
hitPattern[secondWord] & ((1 << secondWordBits) - 1);
271 uint16_t myResult = firstWordBlock + (secondWordBlock << firstWordBits);
304 memset(hasMono, 0,
sizeof(hasMono));
305 memset(hasStereo, 0,
sizeof(hasStereo));
313 if (stripdet != 0 && subStructure != stripdet) {
323 hasMono[subStructure][
getLayer(pattern)] =
true;
326 hasStereo[subStructure][
getLayer(pattern)] =
true;
339 if (hasMono[
i][
j] && hasStereo[
i][
j]) {
350 std::bitset<128> side[2];
352 for (
int i = range.first;
i < range.second; ++
i) {
356 if (hitType != HIT_TYPE::VALID)
continue;
362 return (side[0]&side[1]).count();
403 for (
int i = range.first;
i < range.second; ++
i) {
405 if ((pattern & mask) == tk_substr_layer) {
407 if (hitType < layerCase) {
409 layerCase = (hitType ==
HIT_TYPE::BAD ? HIT_TYPE::INACTIVE : hitType);
410 if (layerCase == HIT_TYPE::VALID) {
432 uint16_t monoStereo = 0x0;
434 for (
int i = range.first;
i < range.second; ++
i) {
436 if ((pattern & mask) == tk_substr_layer) {
438 if (hitType == HIT_TYPE::VALID) {
460 std::bitset<128> layerOk;
462 for (
int i = range.first;
i < range.second; ++
i) {
467 if (hitType != HIT_TYPE::VALID)
continue;
473 return layerOk.count();
479 std::bitset<128> layerOk;
481 for (
int i = range.first;
i < range.second; ++
i) {
485 if (hitType != HIT_TYPE::VALID)
continue;
491 return layerOk.count();
495 std::bitset<128> layerOk;
496 std::bitset<128> layerMissed;
498 for (
int i = range.first;
i < range.second; ++
i) {
504 if (hitType == HIT_TYPE::VALID) layerOk.set(
pattern);
505 if (hitType == HIT_TYPE::MISSING) layerMissed.set(
pattern);
507 layerMissed &= ~layerOk;
511 return layerMissed.count();
520 uint16_t NPixBarrel = 4;
521 for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
532 uint16_t NPixForward = 3;
533 for (uint16_t layer = 1; layer <= NPixForward; layer++) {
544 for (uint16_t layer = 1; layer <= 4; layer++) {
555 for (uint16_t layer = 1; layer <= 3; layer++) {
566 for (uint16_t layer = 1; layer <= 6; layer++) {
577 for (uint16_t layer = 1; layer <= 9; layer++) {
588 uint16_t NPixBarrel = 4;
589 for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
600 uint16_t NPixForward = 3;
601 for (uint16_t layer = 1; layer <= NPixForward; layer++) {
612 for (uint16_t layer = 1; layer <= 4; layer++) {
623 for (uint16_t layer = 1; layer <= 3; layer++) {
634 for (uint16_t layer = 1; layer <= 6; layer++) {
645 for (uint16_t layer = 1; layer <= 9; layer++) {
657 uint16_t NPixBarrel = 4;
658 for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
669 uint16_t NPixForward = 3;
670 for (uint16_t layer = 1; layer <= NPixForward; layer++) {
681 for (uint16_t layer = 1; layer <= 4; layer++) {
692 for (uint16_t layer = 1; layer <= 3; layer++) {
703 for (uint16_t layer = 1; layer <= 6; layer++) {
715 for (uint16_t layer = 1; layer <= 9; layer++) {
726 uint16_t NPixBarrel = 4;
727 for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
738 uint16_t NPixForward = 3;
739 for (uint16_t layer = 1; layer <= NPixForward; layer++) {
750 for (uint16_t layer = 1; layer <= 4; layer++) {
761 for (uint16_t layer = 1; layer <= 3; layer++) {
772 for (uint16_t layer = 1; layer <= 6; layer++) {
783 for (uint16_t layer = 1; layer <= 9; layer++) {
807 stream <<
"\tcsc ring " <<
getCSCRing(pattern);
809 stream <<
"\trpc " << (
getRPCregion(pattern) ?
"endcaps" :
"barrel")
812 stream <<
"(UNKNOWN Muon SubStructure!) \tsubsubstructure "
816 stream <<
"\tlayer " <<
getLayer(pattern);
818 stream <<
"\thit type " <<
getHitType(pattern);
824 stream <<
"HitPattern" << std::endl;
828 std::ios_base::fmtflags
flags = stream.flags();
829 stream.setf(std::ios_base::hex, std::ios_base::basefield);
830 stream.setf(std::ios_base::showbase);
851 return id.isStereo();
855 return id.isStereo();
859 return id.isStereo();
863 return id.isStereo();
877 && (hitType == -1 ||
int(
getHitType(pattern)) == hitType)) {
882 return stations[0] + stations[1] + stations[2] + stations[3];
891 && (hitType == -1 ||
int(
getHitType(pattern)) == hitType)) {
893 if (ret == 0 || stat < ret) {
908 (hitType == -1 ||
int(
getHitType(pattern)) == hitType)) {
910 if (ret == 0 || stat > ret) {
929 return stations[0] + stations[1] + stations[2] + stations[3];
942 return stations[0] + stations[1] + stations[2] + stations[3];
947 int stations[4][2] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}};
955 return stations[0][0] * stations[0][1]
956 + stations[1][0] * stations[1][1]
957 + stations[2][0] * stations[2][1]
958 + stations[3][0] * stations[3][1];
965 int pos = offset +
i;
966 uint16_t bit = (pattern >>
i) & 0x1;
968 hitPattern[pos >> 4] += bit << ((offset +
i) & (16 - 1));
int stripTOBLayersWithMeasurement() const
static uint16_t getCSCRing(uint16_t pattern)
CSC ring (1-4). Only valid for muon CSC patterns, of course.
int pixelBarrelLayersWithoutMeasurement(HitCategory category) const
static uint32_t getLayer(uint16_t pattern)
void insertHit(const uint16_t pattern)
int outermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
static const unsigned short HIT_LENGTH
static const unsigned short ARRAY_LENGTH
static const uint32_t NULL_RETURN
int pixelBarrelLayersNull() const
int stripTIBLayersNull() const
unsigned int layer() const
layer id
int stripTIBLayersWithMeasurement() const
int stripTECLayersNull() const
static const unsigned short SideOffset
static const uint16_t EMPTY_PATTERN
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC); hitType=-1(all), 0=valid, 3=bad
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...
static const unsigned short SubstrOffset
int stripTOBLayersWithoutMeasurement(HitCategory category) const
int numberOfDTStationsWithRPhiView() const
HitPattern & operator=(const HitPattern &other)
uint16_t getTrackerMonoStereo(HitCategory category, uint16_t substr, uint16_t layer) const
static const unsigned short MaxHits
uint32_t getTrackerLayerCase(HitCategory category, uint16_t substr, uint16_t layer) const
std::vector< Variable::Flags > flags
int pixelLayersWithMeasurement() const
int numberOfValidStripLayersWithMonoAndStereo() const
int pixelEndcapLayersWithoutMeasurement(HitCategory category) const
int trackerLayersWithMeasurement() const
static const unsigned short HitTypeMask
static bool pixelBarrelHitFilter(uint16_t pattern)
int pixelEndcapLayersWithMeasurement() const
static uint16_t encode(const TrackingRecHit &hit)
unsigned int layer() const
layer id
bool insertExpectedOuterHit(const uint16_t pattern)
static bool pixelEndcapHitFilter(uint16_t pattern)
1: Failed selection (without additional info)
bool hasValidHitInFirstPixelEndcap() const
static bool validHitFilter(uint16_t pattern)
void printHitPattern(HitCategory category, int position, std::ostream &stream) const
int stripTOBLayersTotallyOffOrBad() const
static const unsigned short minTrackerWord
uint16_t hitPattern[ARRAY_LENGTH]
int stripTIDLayersTotallyOffOrBad() const
static bool muonCSCHitFilter(uint16_t pattern)
static uint32_t getHitType(uint16_t pattern)
int numberOfValidTECLayersWithMonoAndStereo(uint32_t layer=0) const
int stripTIDLayersWithMeasurement() const
static const unsigned short SubDetectorMask
static bool stripHitFilter(uint16_t pattern)
int stripTECLayersTotallyOffOrBad() const
Abs< T >::type abs(const T &t)
int numberOfDTStationsWithRZView() const
int stripTIDLayersNull() const
static const unsigned short HitTypeOffset
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
int numberOfValidTIDLayersWithMonoAndStereo(uint32_t layer=0) const
unsigned int disk() const
disk id
static uint32_t getSubStructure(uint16_t pattern)
int numberOfDTStationsWithBothViews() const
int numberOfValidTIBLayersWithMonoAndStereo(uint32_t layer=0) const
static uint16_t getRPCregion(uint16_t pattern)
RPC region: 0 = barrel, 1 = endcap. Only valid for muon RPC patterns, of course.
int stripTIDLayersWithoutMeasurement(HitCategory category) const
int innermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
static bool muonHitFilter(uint16_t pattern)
static bool trackerHitFilter(uint16_t pattern)
static const unsigned short SideMask
static const unsigned short minStripWord
std::pair< uint8_t, uint8_t > getCategoryIndexRange(HitCategory category) const
static const unsigned short SubDetectorOffset
int pixelBarrelLayersWithMeasurement() const
unsigned int wheel() const
wheel id
unsigned int layer() const
layer id
uint16_t getHitPatternByAbsoluteIndex(int position) const
static uint32_t getSide(uint16_t pattern)
int stripTOBLayersNull() const
static bool muonDTHitFilter(uint16_t pattern)
int trackerLayersWithoutMeasurement(HitCategory category) const
bool insertExpectedInnerHit(const uint16_t pattern)
int pixelBarrelLayersTotallyOffOrBad() const
static const unsigned short SubstrMask
static uint16_t isStereo(DetId i)
static const unsigned short LayerOffset
static int position[264][3]
bool insertTrackHit(const uint16_t pattern)
int stripTECLayersWithMeasurement() const
int stripTECLayersWithoutMeasurement(HitCategory category) const
int pixelEndcapLayersTotallyOffOrBad() const
bool appendHit(const TrackingRecHit &hit)
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...
void print(HitCategory category, std::ostream &stream=std::cout) const
int numberOfValidTOBLayersWithMonoAndStereo(uint32_t layer=0) const
bool hasValidHitInFirstPixelBarrel() const
DetId geographicalId() const
static uint32_t getSubSubStructure(uint16_t pattern)
uint16_t getHitPattern(HitCategory category, int position) const
int stripTIBLayersTotallyOffOrBad() const
static const unsigned short LayerMask
Detector det() const
get the detector field from this detid
static bool muonRPCHitFilter(uint16_t pattern)
int numberOfHits(HitCategory category) const
unsigned int wheel() const
wheel id
int stripTIBLayersWithoutMeasurement(HitCategory category) const
int pixelEndcapLayersNull() const
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.