21 uint32_t
detid =
id.det();
30 uint32_t subdet =
id.subdetId();
52 layer = ((
CSCDetId(
id.rawId()).station()-1)<<2) + (
CSCDetId(
id.rawId()).ring()-1);
81 uint32_t bit = (pattern >>
i) & 0x1;
90 uint32_t
detid =
id.det();
91 uint32_t subdet =
id.subdetId();
93 std::vector<const TrackingRecHit*> hits;
105 hits.push_back(&hit);
109 std::vector<const TrackingRecHit*> seg2D = hit.
recHits();
111 for(std::vector<const TrackingRecHit*>::const_iterator it = seg2D.begin(); it != seg2D.end(); ++it){
112 std::vector<const TrackingRecHit*> hits1D = (*it)->recHits();
113 copy(hits1D.begin(),hits1D.end(),back_inserter(hits));
122 hits.push_back(&hit);
130 hits.push_back(&hit);
135 for(std::vector<const TrackingRecHit*>::const_iterator it = hits.begin(); it != hits.end(); ++it)
161 uint16_t bitEndOffset = (position+1) *
HitSize;
162 uint8_t secondWord = (bitEndOffset >> 5);
163 uint8_t secondWordBits = bitEndOffset & (32-1);
164 if (secondWordBits >=
HitSize) {
165 uint8_t lowBitsToTrash = secondWordBits -
HitSize;
166 uint32_t myResult = (
hitPattern_[secondWord] >> lowBitsToTrash) & ((1 << HitSize)-1);
169 uint8_t firstWordBits =
HitSize - secondWordBits;
170 uint32_t firstWordBlock =
hitPattern_[secondWord-1] >> (32-firstWordBits);
171 uint32_t secondWordBlock =
hitPattern_[secondWord] & ((1<<secondWordBits)-1);
172 uint32_t myResult = firstWordBlock + (secondWordBlock << firstWordBits);
184 if (pattern == 0)
break;
199 if (pattern == 0)
break;
215 if (pattern == 0)
break;
225 memset(hasMono, 0,
sizeof(hasMono));
227 memset(hasStereo, 0,
sizeof(hasStereo));
229 for (
int i = 0;
i < nHits;
i++) {
231 if (pattern == 0)
break;
254 if (hasMono[
i][
j] && hasStereo[
i][
j])
260 uint32_t tk_substr_layer =
277 uint32_t layerCase = 999999;
281 if (pattern == 0)
break;
282 if ((pattern & mask) == tk_substr_layer) {
284 if (hitType < layerCase) {
286 if (hitType == 3) layerCase = 2;
295 uint32_t tk_substr_layer =
309 uint32_t monoStereo = 0;
313 if (pattern == 0)
break;
314 if ((pattern & mask) == tk_substr_layer)
339 uint32_t NPixBarrel = 4;
340 for (uint32_t layer=1; layer<=NPixBarrel; layer++) {
349 uint32_t NPixForward = 3;
350 for (uint32_t layer=1; layer<=NPixForward; layer++) {
359 for (uint32_t layer=1; layer<=4; layer++) {
368 for (uint32_t layer=1; layer<=3; layer++) {
377 for (uint32_t layer=1; layer<=6; layer++) {
386 for (uint32_t layer=1; layer<=9; layer++) {
396 uint32_t NPixBarrel = 4;
397 for (uint32_t layer=1; layer<=NPixBarrel; layer++) {
406 uint32_t NPixForward = 3;
407 for (uint32_t layer=1; layer<=NPixForward; layer++) {
416 for (uint32_t layer=1; layer<=4; layer++) {
425 for (uint32_t layer=1; layer<=3; layer++) {
434 for (uint32_t layer=1; layer<=6; layer++) {
443 for (uint32_t layer=1; layer<=9; layer++) {
453 uint32_t NPixBarrel = 4;
454 for (uint32_t layer=1; layer<=NPixBarrel; layer++) {
463 uint32_t NPixForward = 3;
464 for (uint32_t layer=1; layer<=NPixForward; layer++) {
473 for (uint32_t layer=1; layer<=4; layer++) {
482 for (uint32_t layer=1; layer<=3; layer++) {
491 for (uint32_t layer=1; layer<=6; layer++) {
500 for (uint32_t layer=1; layer<=9; layer++) {
510 uint32_t NPixBarrel = 4;
511 for (uint32_t layer=1; layer<=NPixBarrel; layer++) {
520 uint32_t NPixForward = 3;
521 for (uint32_t layer=1; layer<=NPixForward; layer++) {
530 for (uint32_t layer=1; layer<=4; layer++) {
539 for (uint32_t layer=1; layer<=3; layer++) {
548 for (uint32_t layer=1; layer<=6; layer++) {
557 for (uint32_t layer=1; layer<=9; layer++) {
577 stream <<
"\tcsc ring " <<
getCSCRing(pattern);
581 stream <<
"(UNKNOWN Muon SubStructure!) \tsubsubstructure " <<
getSubStructure(pattern);
584 stream <<
"\tlayer " <<
getLayer(pattern);
586 stream <<
"\thit type " <<
getHitType(pattern);
592 stream <<
"HitPattern" << std::endl;
595 std::ios_base::fmtflags
flags = stream.flags();
596 stream.setf ( std::ios_base::hex, std::ios_base::basefield );
597 stream.setf ( std::ios_base::showbase );
600 stream << pattern << std::endl;
616 return id.isStereo();
621 return id.isStereo();
626 return id.isStereo();
631 return id.isStereo();
646 if (pattern == 0)
break;
649 (hitType == -1 ||
int(
getHitType(pattern)) == hitType)) {
653 return stations[0]+stations[1]+stations[2]+stations[3];
661 if (pattern == 0)
break;
663 (hitType == -1 ||
int(
getHitType(pattern)) == hitType)) {
665 if (ret == 0 || stat < ret) ret = stat;
675 if (pattern == 0)
break;
677 (hitType == -1 ||
int(
getHitType(pattern)) == hitType)) {
679 if (ret == 0 || stat > ret) ret = stat;
690 if (pattern == 0)
break;
695 return stations[0]+stations[1]+stations[2]+stations[3];
702 if (pattern == 0)
break;
707 return stations[0]+stations[1]+stations[2]+stations[3];
711 int stations[4][2] = { {0,0}, {0,0}, {0,0}, {0,0} };
714 if (pattern == 0)
break;
719 return stations[0][0]*stations[0][1] + stations[1][0]*stations[1][1] + stations[2][0]*stations[2][1] + stations[3][0]*stations[3][1];
int stripTOBLayersWithMeasurement() const
virtual int dimension() const =0
static uint32_t getRPCLayer(uint32_t pattern)
RPC layer: for station 1 and 2, layer = 1(inner) or 2(outer); for station 3, 4 layer is always 0...
int outermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
static uint32_t getDTSuperLayer(uint32_t pattern)
DT superlayer (1-3). Where the "hit" was a DT segment, superlayer is 0. Only valid for muon DT patter...
int pixelBarrelLayersNull() const
int stripTIBLayersNull() const
unsigned int layer() const
layer id
static uint32_t getLayer(uint32_t pattern)
void appendHit(const TrackingRecHit &hit)
static uint32_t isStereo(DetId)
static uint32_t getCSCRing(uint32_t pattern)
CSC ring (1-4). Only valid for muon CSC patterns, of course.
uint32_t hitPattern_[PatternSize]
int stripTIBLayersWithMeasurement() const
int stripTECLayersNull() const
static const unsigned short SideOffset
int muonStations(int subdet, int hitType) const
subdet = 0(all), 1(DT), 2(CSC), 3(RPC); hitType=-1(all), 0=valid, 3=bad
static uint32_t getSubSubStructure(uint32_t pattern)
static bool muonDTHitFilter(uint32_t pattern)
static const unsigned short SubstrOffset
static bool trackerHitFilter(uint32_t pattern)
uint32_t getTrackerMonoStereo(uint32_t substr, uint32_t layer) const
int numberOfDTStationsWithRPhiView() const
static uint32_t getHitType(uint32_t pattern)
std::vector< Variable::Flags > flags
int stripTIDLayersWithoutMeasurement() const
static uint32_t getMuonStation(uint32_t pattern)
Muon station (1-4). Only valid for muon patterns, of course.
void set(const I &begin, const I &end)
void print(std::ostream &stream=std::cout) const
static const unsigned short PatternSize
int pixelBarrelLayersWithoutMeasurement() const
static const unsigned short HitTypeMask
int pixelEndcapLayersWithMeasurement() const
static int position[TOTALCHAMBERS][3]
unsigned int layer() const
layer id
bool hasValidHitInFirstPixelEndcap() const
static bool muonHitFilter(uint32_t pattern)
int stripTOBLayersTotallyOffOrBad() const
int stripTIDLayersTotallyOffOrBad() const
int stripTIDLayersWithMeasurement() const
static const unsigned short SubDetectorMask
int stripTECLayersTotallyOffOrBad() const
virtual std::vector< const TrackingRecHit * > recHits() const =0
Access to component RecHits (if any)
Abs< T >::type abs(const T &t)
static uint32_t getSubStructure(uint32_t pattern)
int stripTIBLayersWithoutMeasurement() const
int numberOfDTStationsWithRZView() const
static bool muonRPCHitFilter(uint32_t pattern)
static bool validHitFilter(uint32_t pattern)
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) ...
unsigned int disk() const
disk id
int numberOfDTStationsWithBothViews() const
static const unsigned short HitSize
static uint32_t getSide(uint32_t pattern)
int innermostMuonStationWithHits(int hitType) const
hitType=-1(all), 0=valid, 3=bad; 0 = no stations at all
static const unsigned short SideMask
int pixelEndcapLayersWithoutMeasurement() const
static const unsigned short SubDetectorOffset
int pixelBarrelLayersWithMeasurement() const
static uint32_t getRPCregion(uint32_t pattern)
RPC region: 0 = barrel, 1 = endcap. Only valid for muon RPC patterns, of course.
unsigned int wheel() const
wheel id
unsigned int layer() const
layer id
int stripTOBLayersNull() const
uint32_t getTrackerLayerCase(uint32_t substr, uint32_t layer) const
int pixelBarrelLayersTotallyOffOrBad() const
static const unsigned short SubstrMask
static const unsigned short LayerOffset
int stripTECLayersWithoutMeasurement() const
static bool stripHitFilter(uint32_t pattern)
int stripTECLayersWithMeasurement() const
int stripTOBLayersWithoutMeasurement() const
int pixelEndcapLayersTotallyOffOrBad() const
static bool pixelEndcapHitFilter(uint32_t pattern)
static bool muonCSCHitFilter(uint32_t pattern)
void printHitPattern(int position, std::ostream &stream) const
bool hasValidHitInFirstPixelBarrel() const
DetId geographicalId() const
int stripTIBLayersTotallyOffOrBad() const
static const unsigned short LayerMask
Detector det() const
get the detector field from this detid
uint32_t getHitPattern(int position) const
int numberOfValidStripLayersWithMonoAndStereo() const
static bool pixelBarrelHitFilter(uint32_t pattern)
unsigned int wheel() const
wheel id
int pixelEndcapLayersNull() const
void setHitPattern(int position, uint32_t pattern)
uint32_t encode(const TrackingRecHit &hit, unsigned int i)
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.