28 hitCount(other.hitCount),
29 beginTrackHits(other.beginTrackHits),
30 endTrackHits(other.endTrackHits),
31 beginInner(other.beginInner),
32 endInner(other.endInner),
33 beginOuter(other.beginOuter),
34 endOuter(other.endOuter)
93 uint16_t
detid =
id.det();
99 uint16_t subdet =
id.subdetId();
103 uint16_t layer = 0x0;
128 layer = ((
DTLayerId(
id.rawId()).station() - 1) << 2);
129 layer |=
DTLayerId(
id.rawId()).superLayer();
132 layer = ((
CSCDetId(
id.rawId()).station() - 1) << 2);
133 layer |= (
CSCDetId(
id.rawId()).ring() - 1);
138 layer = ((rpcid.
station() - 1) << 2);
139 layer |= (rpcid.
station() <= 2) ? ((rpcid.
layer() - 1) << 1) : 0x0;
192 <<
" were stored on this object before hits of some other category were inserted "
193 <<
"but hits of the same category should be inserted in a row. "
194 <<
"Please rework the code so it inserts all "
204 <<
"MISSING_INNER_HITS"
205 <<
" were stored on this object before hits of some other category were inserted "
206 <<
"but hits of the same category should be inserted in a row. "
207 <<
"Please rework the code so it inserts all "
208 <<
"MISSING_INNER_HITS"
217 <<
"MISSING_OUTER_HITS"
218 <<
" were stored on this object before hits of some other category were inserted "
219 <<
"but hits of the same category should be inserted in a row. "
220 <<
"Please rework the code so it inserts all "
221 <<
"MISSING_OUTER_HITS"
258 uint16_t bitEndOffset = (position + 1) *
HIT_LENGTH;
259 uint8_t secondWord = (bitEndOffset >> 4);
260 uint8_t secondWordBits = bitEndOffset & (16 - 1);
262 uint8_t lowBitsToTrash = secondWordBits -
HIT_LENGTH;
263 uint16_t myResult = (
hitPattern[secondWord] >> lowBitsToTrash) & ((1 << HIT_LENGTH) - 1);
266 uint8_t firstWordBits =
HIT_LENGTH - secondWordBits;
267 uint16_t firstWordBlock =
hitPattern[secondWord - 1] >> (16 - firstWordBits);
268 uint16_t secondWordBlock =
hitPattern[secondWord] & ((1 << secondWordBits) - 1);
269 uint16_t myResult = firstWordBlock + (secondWordBlock << firstWordBits);
302 memset(hasMono, 0,
sizeof(hasMono));
303 memset(hasStereo, 0,
sizeof(hasStereo));
311 if (stripdet != 0 && subStructure != stripdet) {
321 hasMono[subStructure][
getLayer(pattern)] =
true;
324 hasStereo[subStructure][
getLayer(pattern)] =
true;
337 if (hasMono[
i][
j] && hasStereo[
i][
j]) {
386 for (
int i = range.first;
i < range.second; ++
i) {
388 if ((pattern & mask) == tk_substr_layer) {
390 if (hitType < layerCase) {
392 layerCase = (hitType ==
HIT_TYPE::BAD ? HIT_TYPE::INACTIVE : hitType);
393 if (layerCase == HIT_TYPE::VALID) {
415 uint16_t monoStereo = 0x0;
417 for (
int i = range.first;
i < range.second; ++
i) {
419 if ((pattern & mask) == tk_substr_layer) {
421 if (hitType == HIT_TYPE::VALID) {
443 uint16_t NPixBarrel = 4;
444 for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
455 uint16_t NPixForward = 3;
456 for (uint16_t layer = 1; layer <= NPixForward; layer++) {
467 for (uint16_t layer = 1; layer <= 4; layer++) {
478 for (uint16_t layer = 1; layer <= 3; layer++) {
489 for (uint16_t layer = 1; layer <= 6; layer++) {
500 for (uint16_t layer = 1; layer <= 9; layer++) {
511 uint16_t NPixBarrel = 4;
512 for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
523 uint16_t NPixForward = 3;
524 for (uint16_t layer = 1; layer <= NPixForward; layer++) {
535 for (uint16_t layer = 1; layer <= 4; layer++) {
546 for (uint16_t layer = 1; layer <= 3; layer++) {
557 for (uint16_t layer = 1; layer <= 6; layer++) {
568 for (uint16_t layer = 1; layer <= 9; layer++) {
580 uint16_t NPixBarrel = 4;
581 for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
592 uint16_t NPixForward = 3;
593 for (uint16_t layer = 1; layer <= NPixForward; layer++) {
604 for (uint16_t layer = 1; layer <= 4; layer++) {
615 for (uint16_t layer = 1; layer <= 3; layer++) {
626 for (uint16_t layer = 1; layer <= 6; layer++) {
638 for (uint16_t layer = 1; layer <= 9; layer++) {
649 uint16_t NPixBarrel = 4;
650 for (uint16_t layer = 1; layer <= NPixBarrel; layer++) {
661 uint16_t NPixForward = 3;
662 for (uint16_t layer = 1; layer <= NPixForward; layer++) {
673 for (uint16_t layer = 1; layer <= 4; layer++) {
684 for (uint16_t layer = 1; layer <= 3; layer++) {
695 for (uint16_t layer = 1; layer <= 6; layer++) {
706 for (uint16_t layer = 1; layer <= 9; layer++) {
730 stream <<
"\tcsc ring " <<
getCSCRing(pattern);
732 stream <<
"\trpc " << (
getRPCregion(pattern) ?
"endcaps" :
"barrel")
735 stream <<
"(UNKNOWN Muon SubStructure!) \tsubsubstructure "
739 stream <<
"\tlayer " <<
getLayer(pattern);
741 stream <<
"\thit type " <<
getHitType(pattern);
747 stream <<
"HitPattern" << std::endl;
751 std::ios_base::fmtflags
flags = stream.flags();
752 stream.setf(std::ios_base::hex, std::ios_base::basefield);
753 stream.setf(std::ios_base::showbase);
774 return id.isStereo();
778 return id.isStereo();
782 return id.isStereo();
786 return id.isStereo();
800 && (hitType == -1 ||
int(
getHitType(pattern)) == hitType)) {
805 return stations[0] + stations[1] + stations[2] + stations[3];
814 && (hitType == -1 ||
int(
getHitType(pattern)) == hitType)) {
816 if (ret == 0 || stat < ret) {
831 (hitType == -1 ||
int(
getHitType(pattern)) == hitType)) {
833 if (ret == 0 || stat > ret) {
852 return stations[0] + stations[1] + stations[2] + stations[3];
865 return stations[0] + stations[1] + stations[2] + stations[3];
870 int stations[4][2] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}};
878 return stations[0][0] * stations[0][1]
879 + stations[1][0] * stations[1][1]
880 + stations[2][0] * stations[2][1]
881 + stations[3][0] * stations[3][1];
888 int pos = offset +
i;
889 uint16_t bit = (pattern >>
i) & 0x1;
891 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 numberOfValidStripLayersWithMonoAndStereo() const
int pixelEndcapLayersWithoutMeasurement(HitCategory category) const
static const unsigned short HitTypeMask
static bool pixelBarrelHitFilter(uint16_t pattern)
int pixelEndcapLayersWithMeasurement() const
static uint16_t encode(const TrackingRecHit &hit)
static int position[TOTALCHAMBERS][3]
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
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
unsigned int offset(bool)
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
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)
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
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.