CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
CSCRecHit2D Class Reference

#include <CSCRecHit2D.h>

Inheritance diagram for CSCRecHit2D:
RecHit2DLocalPos TrackingRecHit

Public Types

typedef edm::RangeMap< int,
std::vector< float > > 
ADCContainer
 
typedef std::vector< int > ChannelContainer
 
enum  SharedInputType {
  all = TrackingRecHit::all, some = TrackingRecHit::some, allWires, someWires,
  allStrips, someStrips
}
 
- Public Types inherited from RecHit2DLocalPos
typedef Surface::LocalPoint LocalPoint
 
- Public Types inherited from TrackingRecHit
typedef unsigned int id_type
 
enum  SharedInputType { all, some }
 definition of equality via shared input More...
 
enum  Type { valid = 0, missing = 1, inactive = 2, bad = 3 }
 

Public Member Functions

const ADCContaineradcs () const
 L1A. More...
 
short int badStrip () const
 flags for involvement of 'bad' channels More...
 
short int badWireGroup () const
 
const ChannelContainerchannels () const
 Extracting strip channel numbers comprising the rechit. More...
 
const ChannelContainerchannelsl1a () const
 const ChannelContainer& channels() const { return theStrips; } More...
 
const ChannelContainerchannelsTotal () const
 L1A. More...
 
CSCRecHit2Dclone () const
 RecHit2DLocalPos base class interface. More...
 
CSCDetId cscDetId () const
 
 CSCRecHit2D ()
 
 CSCRecHit2D (const CSCDetId &id, const LocalPoint &pos, const LocalError &err, const ChannelContainer &channels, const ADCContainer &adcs, const ChannelContainer &wgroups, float tpeak, float posInStrip, float errInStrip, int quality, short int badStrip=0, short int badWireGroup=0, int scaledWireTime=0)
 
float errorWithinStrip () const
 The uncertainty of the estimated position within the strip. More...
 
LocalPoint localPosition () const
 
LocalError localPositionError () const
 
float positionWithinStrip () const
 The estimated position within the strip. More...
 
void print () const
 Print the content of the RecHit2D including L1A (for debugging) More...
 
int quality () const
 quality flag of the reconstruction More...
 
virtual bool sharesInput (const TrackingRecHit *other, TrackingRecHit::SharedInputType what) const
 Returns true if the two TrackingRecHits are using the same input information, false otherwise. In this case, looks at the geographical ID and channel numbers for strips and wires. More...
 
bool sharesInput (const TrackingRecHit *other, CSCRecHit2D::SharedInputType what) const
 Returns true if the two TrackingRecHits are using the same input information, false otherwise. In this case, looks at the geographical ID and channel numbers for strips and wires. More...
 
bool sharesInput (const CSCRecHit2D *otherRecHit, CSCRecHit2D::SharedInputType what) const
 Returns true if the two CSCRecHits are using the same input information, false otherwise. In this case, looks at the geographical ID and channel numbers for strips and wires. More...
 
float tpeak () const
 Fitted peaking time. More...
 
ChannelContainer wgroups () const
 Container of wire groups comprising the rechit. More...
 
ChannelContainer wgroupsBX () const
 The BX number. More...
 
ChannelContainer wgroupsBXandWire () const
 The BX + wire group number. More...
 
float wireTime () const
 
 ~CSCRecHit2D ()
 
- Public Member Functions inherited from RecHit2DLocalPos
virtual int dimension () const
 
virtual AlgebraicVector parameters () const
 
virtual AlgebraicSymMatrix parametersError () const
 
virtual AlgebraicMatrix projectionMatrix () const
 
 RecHit2DLocalPos (DetId id)
 
 RecHit2DLocalPos (TrackingRecHit::id_type id=0)
 
virtual std::vector< const
TrackingRecHit * > 
recHits () const
 Access to component RecHits (if any) More...
 
virtual std::vector
< TrackingRecHit * > 
recHits ()
 Non-const access to component RecHits (if any) More...
 
virtual ~RecHit2DLocalPos ()
 
- Public Member Functions inherited from TrackingRecHit
DetId geographicalId () const
 
virtual void getKfComponents (KfComponentsHolder &holder) const
 
Type getType () const
 
bool isValid () const
 
virtual void recHitsV (std::vector< const TrackingRecHit * > &) const
 
virtual void recHitsV (std::vector< TrackingRecHit * > &)
 
 TrackingRecHit (DetId id, Type type=valid)
 
 TrackingRecHit (id_type id=0, Type type=valid)
 
Type type () const
 
virtual float weight () const
 
virtual ~TrackingRecHit ()
 

Private Attributes

ADCContainer theADCs
 
short int theBadStrip
 
short int theBadWireGroup
 
float theErrorWithinStrip
 
LocalError theLocalError
 
LocalPoint theLocalPosition
 
float thePositionWithinStrip
 
int theQuality
 
int theScaledWireTime
 
ChannelContainer theStrips
 
ChannelContainer theStripsHighBits
 L1A. More...
 
ChannelContainer theStripsLowBits
 
float theTpeak
 
ChannelContainer theWgroupsHighBits
 L1A. More...
 
ChannelContainer theWgroupsLowBits
 BX. More...
 
ChannelContainer theWireGroups
 

Additional Inherited Members

- Protected Member Functions inherited from TrackingRecHit
void setId (id_type iid)
 
void setType (Type ttype)
 

Detailed Description

Describes a 2-dim reconstructed hit in one layer of an Endcap Muon CSC.

Author
Tim Cox et al.

Definition at line 18 of file CSCRecHit2D.h.

Member Typedef Documentation

typedef edm::RangeMap<int, std::vector<float> > CSCRecHit2D::ADCContainer

Definition at line 23 of file CSCRecHit2D.h.

typedef std::vector<int> CSCRecHit2D::ChannelContainer

Definition at line 22 of file CSCRecHit2D.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

CSCRecHit2D::CSCRecHit2D ( )

Extract low byte to account strip number

Extract middle byte to account L1A phase

To account BX in wgroups

Definition at line 4 of file CSCRecHit2D.cc.

References i, theStrips, theStripsHighBits, theStripsLowBits, theWgroupsHighBits, theWgroupsLowBits, and theWireGroups.

Referenced by clone().

4  :
5  theLocalPosition(0.,0.),
6  theLocalError(0.,0.,0.),
10  theTpeak( -999. ),
12  theErrorWithinStrip(-999.),
13  theQuality( 0 ), theBadStrip( 0 ), theBadWireGroup( 0 ),
15 {
16 
18 theStripsLowBits.clear();
19 for(int i=0; i<(int)theStrips.size(); i++){
20  theStripsLowBits.push_back(theStrips[i] & 0x000000FF);
21  }
23 theStripsHighBits.clear();
24 for(int i=0; i<(int)theStrips.size(); i++){
25  theStripsHighBits.push_back(theStrips[i] & 0x0000FF00);
26  }
27 
29 theWgroupsHighBits.clear();
30 for(int i=0; i<(int)theWireGroups.size(); i++)
31  theWgroupsHighBits.push_back((theWireGroups[i] >> 16) & 0x0000FFFF);
32 theWgroupsLowBits.clear();
33 for(int i=0; i<(int)theWireGroups.size(); i++)
34  theWgroupsLowBits.push_back(theWireGroups[i] & 0x0000FFFF);
35 
36 }
ChannelContainer theWgroupsLowBits
BX.
Definition: CSCRecHit2D.h:120
int i
Definition: DBlmapReader.cc:9
LocalPoint theLocalPosition
Definition: CSCRecHit2D.h:105
ChannelContainer theStrips
Definition: CSCRecHit2D.h:107
short int theBadStrip
Definition: CSCRecHit2D.h:114
edm::RangeMap< int, std::vector< float > > ADCContainer
Definition: CSCRecHit2D.h:23
ADCContainer theADCs
Definition: CSCRecHit2D.h:108
short int theBadWireGroup
Definition: CSCRecHit2D.h:115
LocalError theLocalError
Definition: CSCRecHit2D.h:106
float theTpeak
Definition: CSCRecHit2D.h:110
ChannelContainer theStripsLowBits
Definition: CSCRecHit2D.h:117
ChannelContainer theStripsHighBits
L1A.
Definition: CSCRecHit2D.h:118
int theScaledWireTime
Definition: CSCRecHit2D.h:116
float thePositionWithinStrip
Definition: CSCRecHit2D.h:111
float theErrorWithinStrip
Definition: CSCRecHit2D.h:112
ChannelContainer theWireGroups
Definition: CSCRecHit2D.h:109
ChannelContainer theWgroupsHighBits
L1A.
Definition: CSCRecHit2D.h:119
std::vector< int > ChannelContainer
Definition: CSCRecHit2D.h:22
CSCRecHit2D::CSCRecHit2D ( const CSCDetId id,
const LocalPoint pos,
const LocalError err,
const ChannelContainer channels,
const ADCContainer adcs,
const ChannelContainer wgroups,
float  tpeak,
float  posInStrip,
float  errInStrip,
int  quality,
short int  badStrip = 0,
short int  badWireGroup = 0,
int  scaledWireTime = 0 
)

Extract second byte to account strip number

Extract middle byte to account L1A phase

To account BX in wgroups

Definition at line 38 of file CSCRecHit2D.cc.

References i, theStrips, theStripsHighBits, theStripsLowBits, theWgroupsHighBits, theWgroupsLowBits, and theWireGroups.

48  :
49  RecHit2DLocalPos( id ),
50  theLocalPosition( pos ),
51  theLocalError( err ),
53  theADCs( adcs ),
55  theTpeak( tpeak ),
56  thePositionWithinStrip( posInStrip ),
57  theErrorWithinStrip( errInStrip ),
59  theScaledWireTime ( scaledWireTime )
60 {
61 
63 theStripsLowBits.clear();
64 for(int i=0; i<(int)theStrips.size(); i++){
65  theStripsLowBits.push_back(theStrips[i] & 0x000000FF);
66  }
68 theStripsHighBits.clear();
69 for(int i=0; i<(int)theStrips.size(); i++){
70  theStripsHighBits.push_back(theStrips[i] & 0x0000FF00);
71  }
72 
74 theWgroupsHighBits.clear();
75 for(int i=0; i<(int)theWireGroups.size(); i++)
76  theWgroupsHighBits.push_back((theWireGroups[i] >> 16) & 0x0000FFFF);
77 theWgroupsLowBits.clear();
78 for(int i=0; i<(int)theWireGroups.size(); i++)
79  theWgroupsLowBits.push_back(theWireGroups[i] & 0x0000FFFF);
80 
81 }
ChannelContainer theWgroupsLowBits
BX.
Definition: CSCRecHit2D.h:120
int i
Definition: DBlmapReader.cc:9
LocalPoint theLocalPosition
Definition: CSCRecHit2D.h:105
RecHit2DLocalPos(DetId id)
ChannelContainer wgroups() const
Container of wire groups comprising the rechit.
Definition: CSCRecHit2D.h:64
float tpeak() const
Fitted peaking time.
Definition: CSCRecHit2D.h:73
ChannelContainer theStrips
Definition: CSCRecHit2D.h:107
short int badStrip() const
flags for involvement of &#39;bad&#39; channels
Definition: CSCRecHit2D.h:85
short int theBadStrip
Definition: CSCRecHit2D.h:114
const ADCContainer & adcs() const
L1A.
Definition: CSCRecHit2D.h:60
ADCContainer theADCs
Definition: CSCRecHit2D.h:108
short int theBadWireGroup
Definition: CSCRecHit2D.h:115
LocalError theLocalError
Definition: CSCRecHit2D.h:106
float theTpeak
Definition: CSCRecHit2D.h:110
ChannelContainer theStripsLowBits
Definition: CSCRecHit2D.h:117
ChannelContainer theStripsHighBits
L1A.
Definition: CSCRecHit2D.h:118
int theScaledWireTime
Definition: CSCRecHit2D.h:116
float thePositionWithinStrip
Definition: CSCRecHit2D.h:111
float theErrorWithinStrip
Definition: CSCRecHit2D.h:112
ChannelContainer theWireGroups
Definition: CSCRecHit2D.h:109
int quality() const
quality flag of the reconstruction
Definition: CSCRecHit2D.h:82
const ChannelContainer & channels() const
Extracting strip channel numbers comprising the rechit.
Definition: CSCRecHit2D.h:50
short int badWireGroup() const
Definition: CSCRecHit2D.h:86
ChannelContainer theWgroupsHighBits
L1A.
Definition: CSCRecHit2D.h:119
CSCRecHit2D::~CSCRecHit2D ( )

Definition at line 83 of file CSCRecHit2D.cc.

83 {}

Member Function Documentation

const ADCContainer& CSCRecHit2D::adcs ( ) const
inline

L1A.

Map of strip ADCs for strips comprising the rechit

Definition at line 60 of file CSCRecHit2D.h.

References theADCs.

Referenced by MuonTruth::analyze().

60 { return theADCs; }
ADCContainer theADCs
Definition: CSCRecHit2D.h:108
short int CSCRecHit2D::badStrip ( ) const
inline

flags for involvement of 'bad' channels

Definition at line 85 of file CSCRecHit2D.h.

References theBadStrip.

85 { return theBadStrip; }
short int theBadStrip
Definition: CSCRecHit2D.h:114
short int CSCRecHit2D::badWireGroup ( ) const
inline

Definition at line 86 of file CSCRecHit2D.h.

References theBadWireGroup.

86 { return theBadWireGroup; }
short int theBadWireGroup
Definition: CSCRecHit2D.h:115
const ChannelContainer& CSCRecHit2D::channels ( ) const
inline

Extracting strip channel numbers comprising the rechit.

Definition at line 50 of file CSCRecHit2D.h.

References theStripsLowBits.

Referenced by MuonTruth::analyze(), MuonTruth::associateCSCHitId(), MuonTruth::associateHitId(), operator<<(), print(), and sharesInput().

50 { return theStripsLowBits; }
ChannelContainer theStripsLowBits
Definition: CSCRecHit2D.h:117
const ChannelContainer& CSCRecHit2D::channelsl1a ( ) const
inline

const ChannelContainer& channels() const { return theStrips; }

L1AExtract the L1A phase bits from the StripChannelContainer

Definition at line 54 of file CSCRecHit2D.h.

References theStripsHighBits.

Referenced by print().

54 { return theStripsHighBits; }
ChannelContainer theStripsHighBits
L1A.
Definition: CSCRecHit2D.h:118
const ChannelContainer& CSCRecHit2D::channelsTotal ( ) const
inline

L1A.

Container of the L1A+Channels comprising the rechit

Definition at line 57 of file CSCRecHit2D.h.

References theStrips.

Referenced by print().

57 { return theStrips; }
ChannelContainer theStrips
Definition: CSCRecHit2D.h:107
CSCRecHit2D* CSCRecHit2D::clone ( void  ) const
inlinevirtual

RecHit2DLocalPos base class interface.

Implements RecHit2DLocalPos.

Definition at line 44 of file CSCRecHit2D.h.

References CSCRecHit2D().

44 { return new CSCRecHit2D( *this ); }
CSCDetId CSCRecHit2D::cscDetId ( ) const
inline
float CSCRecHit2D::errorWithinStrip ( ) const
inline

The uncertainty of the estimated position within the strip.

Definition at line 79 of file CSCRecHit2D.h.

References theErrorWithinStrip.

Referenced by operator<<().

79 { return theErrorWithinStrip;} ;
float theErrorWithinStrip
Definition: CSCRecHit2D.h:112
LocalPoint CSCRecHit2D::localPosition ( ) const
inlinevirtual

Implements RecHit2DLocalPos.

Definition at line 45 of file CSCRecHit2D.h.

References theLocalPosition.

Referenced by CSCSegAlgoSK::areHitsCloseInGlobalPhi(), CSCSegAlgoTC::areHitsCloseInGlobalPhi(), CSCSegAlgoSK::areHitsCloseInLocalX(), CSCSegAlgoTC::areHitsCloseInLocalX(), FWCSCRecHitProxyBuilder::build(), CSCSegAlgoDF::buildSegments(), CSCSegAlgoTC::buildSegments(), CSCSegAlgoSK::buildSegments(), CSCSegAlgoST::correctTheCovX(), CSCSegAlgoHitPruning::derivativeMatrix(), CSCSegAlgoShowering::derivativeMatrix(), CSCSegAlgoTC::derivativeMatrix(), CSCSegAlgoST::derivativeMatrix(), CSCSegAlgoDF::derivativeMatrix(), CSCSegAlgoSK::derivativeMatrix(), CSCSegAlgoHitPruning::fillChiSquared(), CSCSegAlgoST::fillChiSquared(), CSCSegAlgoSK::fillChiSquared(), CSCSegAlgoTC::fillChiSquared(), CSCSegAlgoHitPruning::fitSlopes(), CSCSegAlgoST::fitSlopes(), CSCSegAlgoSK::fitSlopes(), CSCSegAlgoTC::fitSlopes(), CSCMake2DRecHit::isHitInFiducial(), CSCSegAlgoShowering::isHitNearSegment(), CSCSegAlgoSK::isHitNearSegment(), CSCSegAlgoTC::isHitNearSegment(), CSCSegAlgoDF::isHitNearSegment(), CSCValidation::ltrh::operator()(), operator<<(), CSCRecHit2DValidation::plotResolution(), GlobalRecHitsAnalyzer::plotResolution(), GlobalRecHitsProducer::plotResolution(), print(), CSCSegAlgoShowering::pruneFromResidual(), CSCSegAlgoDF::pruneFromResidual(), CSCSegAlgoShowering::showerSeg(), CSCSegAlgoSK::tryAddingHitsToSegment(), CSCSegAlgoTC::tryAddingHitsToSegment(), CSCSegAlgoShowering::updateParameters(), CSCSegAlgoSK::updateParameters(), CSCSegAlgoDF::updateParameters(), and CSCSegAlgoTC::updateParameters().

45 { return theLocalPosition; }
LocalPoint theLocalPosition
Definition: CSCRecHit2D.h:105
LocalError CSCRecHit2D::localPositionError ( ) const
inlinevirtual
float CSCRecHit2D::positionWithinStrip ( ) const
inline

The estimated position within the strip.

Definition at line 76 of file CSCRecHit2D.h.

References thePositionWithinStrip.

Referenced by operator<<().

76 { return thePositionWithinStrip; };
float thePositionWithinStrip
Definition: CSCRecHit2D.h:111
void CSCRecHit2D::print ( void  ) const

Print the content of the RecHit2D including L1A (for debugging)

Prefered to have this version of print() for debugging; will be removed soon

L1A

L1A

Definition at line 214 of file CSCRecHit2D.cc.

References channels(), channelsl1a(), channelsTotal(), gather_cfg::cout, cscDetId(), i, gen::k, localPosition(), localPositionError(), mathSSE::sqrt(), wgroups(), wgroupsBX(), wgroupsBXandWire(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

214  {
215 std::cout << "CSCRecHit in CSC Detector: " << cscDetId() << std::endl;
216 std::cout << " local x = " << localPosition().x() << " +/- " << sqrt( localPositionError().xx() ) << " y = " << localPosition().y() << " +/- " << sqrt( localPositionError().yy() ) << std::endl;
217 
219 std::cout << " L1A+Channels: ";
220 for (int i=0; i<(int)channelsTotal().size(); i++) {std::cout
221  << std::hex << channelsTotal()[i] << " ";}
222 std::cout << std::endl;
223 
224 std::cout << " Channels: ";
225 for (int i=0; i<(int)channels().size(); i++) {std::cout << std::dec << channels()[i] << " "
226  << " (" << "HEX: " << std::hex << channels()[i] << ")" << " ";
227  }
228  std::cout << std::endl;
229 
230 
232 std::cout << " L1APhase: ";
233  for (int i=0; i<(int)channelsl1a().size(); i++) {
234  std::cout << "|";
235  for (int k=0; k<8 ; k++){
236  std::cout << ((channelsl1a()[i] >> (15-k)) & 0x1) << " ";}
237  std::cout << "| ";
238  }
239  std::cout << std::endl;
240 
241 std::cout << " BX + WireGroups combined: ";
242  for (int i=0; i<(int)wgroupsBXandWire().size(); i++) {std::cout //std::dec << wgroups()[i]
243  << "HEX: " << std::hex << wgroupsBXandWire()[i] << std::hex << " | ";
244  }
245 
246 std::cout << " WireGroups: ";
247 for (int i=0; i<(int)wgroups().size(); i++) {std::cout << std::dec << wgroups()[i]
248  << " | ";}
249 std::cout << " BX#: ";
250  for (int i=0; i<(int)wgroupsBX().size(); i++) {std::cout << std::dec << wgroupsBX()[i]
251  << " (" << "HEX: " << std::hex << wgroupsBX()[i] << ")" << " | ";
252  }
253 
254  std::cout << std::endl;
255 }
int i
Definition: DBlmapReader.cc:9
ChannelContainer wgroupsBXandWire() const
The BX + wire group number.
Definition: CSCRecHit2D.h:70
CSCDetId cscDetId() const
Definition: CSCRecHit2D.h:47
ChannelContainer wgroups() const
Container of wire groups comprising the rechit.
Definition: CSCRecHit2D.h:64
T y() const
Definition: PV3DBase.h:57
const ChannelContainer & channelsl1a() const
const ChannelContainer&amp; channels() const { return theStrips; }
Definition: CSCRecHit2D.h:54
const ChannelContainer & channelsTotal() const
L1A.
Definition: CSCRecHit2D.h:57
LocalError localPositionError() const
Definition: CSCRecHit2D.h:46
T sqrt(T t)
Definition: SSEVec.h:28
int k[5][pyjets_maxn]
const ChannelContainer & channels() const
Extracting strip channel numbers comprising the rechit.
Definition: CSCRecHit2D.h:50
tuple cout
Definition: gather_cfg.py:41
LocalPoint localPosition() const
Definition: CSCRecHit2D.h:45
T x() const
Definition: PV3DBase.h:56
ChannelContainer wgroupsBX() const
The BX number.
Definition: CSCRecHit2D.h:67
int CSCRecHit2D::quality ( ) const
inline

quality flag of the reconstruction

Definition at line 82 of file CSCRecHit2D.h.

References theQuality.

Referenced by operator<<().

82 { return theQuality;}
bool CSCRecHit2D::sharesInput ( const TrackingRecHit other,
TrackingRecHit::SharedInputType  what 
) const
virtual

Returns true if the two TrackingRecHits are using the same input information, false otherwise. In this case, looks at the geographical ID and channel numbers for strips and wires.

Reimplemented from TrackingRecHit.

Definition at line 85 of file CSCRecHit2D.cc.

Referenced by sharesInput().

85  {
86 
87  // This is to satisfy the base class virtual function
88 
89  // @@ Cast the enum (!) But what if the TRH::SIT changes?!
91  return sharesInput(other, cscWhat);
92 }
virtual bool sharesInput(const TrackingRecHit *other, TrackingRecHit::SharedInputType what) const
Returns true if the two TrackingRecHits are using the same input information, false otherwise...
Definition: CSCRecHit2D.cc:85
bool CSCRecHit2D::sharesInput ( const TrackingRecHit other,
CSCRecHit2D::SharedInputType  what 
) const

Returns true if the two TrackingRecHits are using the same input information, false otherwise. In this case, looks at the geographical ID and channel numbers for strips and wires.

Definition at line 94 of file CSCRecHit2D.cc.

References MuonSubdetId::CSC, TrackingRecHit::geographicalId(), sharesInput(), and DetId::subdetId().

94  {
95 
96  // Check to see if the TrackingRecHit is actually a CSCRecHit2D.
97  if (other->geographicalId().subdetId() != MuonSubdetId::CSC) return false;
98 
99  // Now I can static cast, because the previous guarantees that this is a CSCRecHit2D
100  const CSCRecHit2D *otherRecHit = static_cast<const CSCRecHit2D *>(other);
101 
102  return sharesInput(otherRecHit, what);
103 }
virtual bool sharesInput(const TrackingRecHit *other, TrackingRecHit::SharedInputType what) const
Returns true if the two TrackingRecHits are using the same input information, false otherwise...
Definition: CSCRecHit2D.cc:85
static const int CSC
Definition: MuonSubdetId.h:15
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
DetId geographicalId() const
bool CSCRecHit2D::sharesInput ( const CSCRecHit2D otherRecHit,
CSCRecHit2D::SharedInputType  what 
) const

Returns true if the two CSCRecHits are using the same input information, false otherwise. In this case, looks at the geographical ID and channel numbers for strips and wires.

Definition at line 105 of file CSCRecHit2D.cc.

References all, allStrips, allWires, CSCDetId::channel(), channels(), cscDetId(), newFWLiteAna::found, TrackingRecHit::geographicalId(), some, someStrips, someWires, theStrips, theWireGroups, and wgroups().

105  {
106 
107  // Check to see if the geographical ID of the two are the same
108  if (geographicalId() != otherRecHit->geographicalId()) return false;
109 
110  // Trivial cases
111  const ChannelContainer otherStrips = otherRecHit->channels();
112  const ChannelContainer otherWireGroups = otherRecHit->wgroups();
113  if (theStrips.size() == 0 && otherStrips.size() == 0 && theWireGroups.size() == 0 && otherWireGroups.size() == 0) return true;
114  if ((what == allWires || what == someWires) && theWireGroups.size() == 0 && otherWireGroups.size() == 0) return true;
115  if ((what == allStrips || what == someStrips) && theStrips.size() == 0 && otherStrips.size() == 0) return true;
116 
117  // Check to see if the wire containers are the same length
118  if ((what == all || what == allWires) && theWireGroups.size() != otherWireGroups.size()) return false;
119 
120  // Check to see if the strip containers are the same length
121  if ((what == all || what == allStrips) && theStrips.size() != otherStrips.size()) return false;
122 
123  bool foundWire = false;
124  // Check to see if the wires are the same
125  if (what != allStrips && what != someStrips) {
126  for (ChannelContainer::const_iterator iWire = theWireGroups.begin(); iWire != theWireGroups.end(); ++iWire) {
127  bool found = false;
128  for (ChannelContainer::const_iterator jWire = otherWireGroups.begin(); jWire != otherWireGroups.end(); ++jWire) {
129  if (*iWire == *jWire) {
130  if (what == some || what == someWires) return true;
131  else {
132  found = true;
133  foundWire = true;
134  break;
135  }
136  }
137  }
138  if ((what == all || what == allWires) && !found) return false;
139  }
140  if (what == someWires && !foundWire) return false;
141  }
142 
143  // Check to see if the wires are the same
144  bool foundStrip = false;
145  if (what != allWires && what != someWires) {
146  for (ChannelContainer::const_iterator iStrip = theStrips.begin(); iStrip != theStrips.end(); ++iStrip) {
147  bool found = false;
148  for (ChannelContainer::const_iterator jStrip = otherStrips.begin(); jStrip != otherStrips.end(); ++jStrip) {
149  //a strip is a channel for all but ME1/1a chambers (where 3 ganged strips are a channel)
150  if(cscDetId().channel(*iStrip)==otherRecHit->cscDetId().channel(*jStrip)){
151  if (what == some || what == someStrips) return true;
152  else {
153  found = true;
154  foundStrip = true;
155  break;
156  }
157  }
158  }
159  if ((what == all || what == allStrips) && !found) return false;
160  }
161  if (what == someStrips && !foundStrip) return false;
162  }
163 
164  // In case we were looking for "some" and found absolutely nothing.
165  if (!foundWire && !foundStrip) return false;
166 
167  // If we made it this far, then:
168  // 1) the detector IDs are the same
169  // 2) the channel containers have the same number of entries
170  // 3) for each entry in my channel container, I can find the same value in the other RecHit's corresponding channel container
171  // I think that means we are the same.
172  return true;
173 }
CSCDetId cscDetId() const
Definition: CSCRecHit2D.h:47
ChannelContainer wgroups() const
Container of wire groups comprising the rechit.
Definition: CSCRecHit2D.h:64
ChannelContainer theStrips
Definition: CSCRecHit2D.h:107
int channel(int istrip)
Definition: CSCDetId.h:120
ChannelContainer theWireGroups
Definition: CSCRecHit2D.h:109
const ChannelContainer & channels() const
Extracting strip channel numbers comprising the rechit.
Definition: CSCRecHit2D.h:50
DetId geographicalId() const
std::vector< int > ChannelContainer
Definition: CSCRecHit2D.h:22
float CSCRecHit2D::tpeak ( ) const
inline

Fitted peaking time.

Definition at line 73 of file CSCRecHit2D.h.

References theTpeak.

73 { return theTpeak; }
float theTpeak
Definition: CSCRecHit2D.h:110
ChannelContainer CSCRecHit2D::wgroups ( ) const
inline

Container of wire groups comprising the rechit.

Definition at line 64 of file CSCRecHit2D.h.

References theWgroupsLowBits.

Referenced by operator<<(), print(), and sharesInput().

64 { return theWgroupsLowBits; }
ChannelContainer theWgroupsLowBits
BX.
Definition: CSCRecHit2D.h:120
ChannelContainer CSCRecHit2D::wgroupsBX ( ) const
inline

The BX number.

Definition at line 67 of file CSCRecHit2D.h.

References theWgroupsHighBits.

Referenced by print().

67 { return theWgroupsHighBits; }
ChannelContainer theWgroupsHighBits
L1A.
Definition: CSCRecHit2D.h:119
ChannelContainer CSCRecHit2D::wgroupsBXandWire ( ) const
inline

The BX + wire group number.

Definition at line 70 of file CSCRecHit2D.h.

References theWireGroups.

Referenced by print().

70 { return theWireGroups; }
ChannelContainer theWireGroups
Definition: CSCRecHit2D.h:109
float CSCRecHit2D::wireTime ( ) const
inline

Definition at line 89 of file CSCRecHit2D.h.

References theScaledWireTime.

89 { return (float)theScaledWireTime/100.; }
int theScaledWireTime
Definition: CSCRecHit2D.h:116

Member Data Documentation

ADCContainer CSCRecHit2D::theADCs
private

Definition at line 108 of file CSCRecHit2D.h.

Referenced by adcs().

short int CSCRecHit2D::theBadStrip
private

Definition at line 114 of file CSCRecHit2D.h.

Referenced by badStrip().

short int CSCRecHit2D::theBadWireGroup
private

Definition at line 115 of file CSCRecHit2D.h.

Referenced by badWireGroup().

float CSCRecHit2D::theErrorWithinStrip
private

Definition at line 112 of file CSCRecHit2D.h.

Referenced by errorWithinStrip().

LocalError CSCRecHit2D::theLocalError
private

Definition at line 106 of file CSCRecHit2D.h.

Referenced by localPositionError().

LocalPoint CSCRecHit2D::theLocalPosition
private

Definition at line 105 of file CSCRecHit2D.h.

Referenced by localPosition().

float CSCRecHit2D::thePositionWithinStrip
private

Definition at line 111 of file CSCRecHit2D.h.

Referenced by positionWithinStrip().

int CSCRecHit2D::theQuality
private

Definition at line 113 of file CSCRecHit2D.h.

Referenced by quality().

int CSCRecHit2D::theScaledWireTime
private

Definition at line 116 of file CSCRecHit2D.h.

Referenced by wireTime().

ChannelContainer CSCRecHit2D::theStrips
private

Definition at line 107 of file CSCRecHit2D.h.

Referenced by channelsTotal(), CSCRecHit2D(), and sharesInput().

ChannelContainer CSCRecHit2D::theStripsHighBits
private

L1A.

Definition at line 118 of file CSCRecHit2D.h.

Referenced by channelsl1a(), and CSCRecHit2D().

ChannelContainer CSCRecHit2D::theStripsLowBits
private

Definition at line 117 of file CSCRecHit2D.h.

Referenced by channels(), and CSCRecHit2D().

float CSCRecHit2D::theTpeak
private

Definition at line 110 of file CSCRecHit2D.h.

Referenced by tpeak().

ChannelContainer CSCRecHit2D::theWgroupsHighBits
private

L1A.

Definition at line 119 of file CSCRecHit2D.h.

Referenced by CSCRecHit2D(), and wgroupsBX().

ChannelContainer CSCRecHit2D::theWgroupsLowBits
private

BX.

Definition at line 120 of file CSCRecHit2D.h.

Referenced by CSCRecHit2D(), and wgroups().

ChannelContainer CSCRecHit2D::theWireGroups
private

Definition at line 109 of file CSCRecHit2D.h.

Referenced by CSCRecHit2D(), sharesInput(), and wgroupsBXandWire().