CMS 3D CMS Logo

CSCRecHit2D.h
Go to the documentation of this file.
1 #ifndef DataFormats_CSCRecHit2D_H
2 #define DataFormats_CSCRecHit2D_H
3 
14 #include <vector>
15 #include <map>
16 #include <iosfwd>
17 
18 class CSCRecHit2D final : public RecHit2DLocalPos {
19 public:
20  typedef std::vector<int> ChannelContainer;
22 
30  };
31 
32  static const unsigned int MAXSTRIPS = 3;
33  static const unsigned int MAXTIMEBINS = 4;
34  static const unsigned int N_ADC = MAXSTRIPS * MAXTIMEBINS;
35  CSCRecHit2D();
36 
37  CSCRecHit2D(const CSCDetId& id,
38  const LocalPoint& pos,
39  const LocalError& err,
41  const ADCContainer& adcs,
42  const ChannelContainer& wgroups,
43  float tpeak,
44  float posInStrip,
45  float errInStrip,
46  int quality,
47  short int badStrip = 0,
48  short int badWireGroup = 0,
49  int scaledWireTime = 0,
50  float energyDeposit = -995.);
51 
52  ~CSCRecHit2D() override;
53 
55  CSCRecHit2D* clone() const override { return new CSCRecHit2D(*this); }
56  LocalPoint localPosition() const override { return theLocalPosition; }
57  LocalError localPositionError() const override { return theLocalError; }
58  CSCDetId cscDetId() const { return geographicalId(); }
59 
61  int channels(unsigned int i) const { return theStrips_[i]; }
62  unsigned int nStrips() const { return nStrips_; }
63 
65  int channelsl1a(unsigned int i) const { return theL1APhaseBits_[i]; }
66 
68  short int hitWire() const { return hitWire_; }
69  short int wgroupsBX() const { return theWGroupsBX_; }
70 
71  unsigned int nWireGroups() const { return nWireGroups_; }
72 
74  float adcs(unsigned int strip, unsigned int timebin) const { return theADCs_[strip * MAXTIMEBINS + timebin]; }
75 
76  unsigned int nTimeBins() const { return nTimeBins_; }
77 
79  float tpeak() const { return theTpeak; }
80 
82  float positionWithinStrip() const { return thePositionWithinStrip; };
83 
85  float errorWithinStrip() const { return theErrorWithinStrip; };
86 
88  int quality() const { return theQuality; }
89 
91  short int badStrip() const { return theBadStrip; }
92  short int badWireGroup() const { return theBadWireGroup; }
93 
94  // Calculated wire time in ns
95  float wireTime() const { return (float)theScaledWireTime / 100.; }
96 
106  float energyDepositedInLayer() const { return theEnergyDeposit; }
107 
109  bool sharesInput(const TrackingRecHit* other, TrackingRecHit::SharedInputType what) const override;
110 
113 
115  bool sharesInput(const CSCRecHit2D* otherRecHit, CSCRecHit2D::SharedInputType what) const;
116 
118  void print() const;
119 
120 private:
121  float theTpeak;
127  short int hitWire_;
128  short int theWGroupsBX_;
129  short int theBadStrip;
130  short int theBadWireGroup;
131 
133 
134  unsigned char theL1APhaseBits_[MAXSTRIPS];
135  unsigned char theStrips_[MAXSTRIPS];
136  float theADCs_[N_ADC];
137 
140 };
141 
143 std::ostream& operator<<(std::ostream& os, const CSCRecHit2D& rh);
144 
145 #endif
SharedInputType
definition of equality via shared input
unsigned int nStrips() const
Definition: CSCRecHit2D.h:62
LocalPoint theLocalPosition
Definition: CSCRecHit2D.h:138
unsigned char nTimeBins_
Definition: CSCRecHit2D.h:132
unsigned char nWireGroups_
Definition: CSCRecHit2D.h:132
~CSCRecHit2D() override
Definition: CSCRecHit2D.cc:88
bool sharesInput(const TrackingRecHit *other, TrackingRecHit::SharedInputType what) const override
Returns true if the two TrackingRecHits are using the same input information, false otherwise...
Definition: CSCRecHit2D.cc:90
CSCRecHit2D * clone() const override
RecHit2DLocalPos base class interface.
Definition: CSCRecHit2D.h:55
CSCDetId cscDetId() const
Definition: CSCRecHit2D.h:58
void print() const
Print the content of the RecHit2D including L1A (for debugging)
Definition: CSCRecHit2D.cc:174
float errorWithinStrip() const
The uncertainty of the estimated position within the strip.
Definition: CSCRecHit2D.h:85
unsigned char nStrips_
Definition: CSCRecHit2D.h:132
unsigned int nWireGroups() const
Definition: CSCRecHit2D.h:71
short int hitWire_
Definition: CSCRecHit2D.h:127
static const unsigned int MAXSTRIPS
Definition: CSCRecHit2D.h:32
short int theBadStrip
Definition: CSCRecHit2D.h:129
short int badStrip() const
flags for involvement of &#39;bad&#39; channels
Definition: CSCRecHit2D.h:91
edm::RangeMap< int, std::vector< float > > ADCContainer
Definition: CSCRecHit2D.h:21
float wireTime() const
Definition: CSCRecHit2D.h:95
short int theBadWireGroup
Definition: CSCRecHit2D.h:130
static const unsigned int N_ADC
Definition: CSCRecHit2D.h:34
LocalError theLocalError
Definition: CSCRecHit2D.h:139
unsigned int nTimeBins() const
Definition: CSCRecHit2D.h:76
float theTpeak
Definition: CSCRecHit2D.h:121
float adcs(unsigned int strip, unsigned int timebin) const
Map of strip ADCs for strips comprising the rechit.
Definition: CSCRecHit2D.h:74
short int badWireGroup() const
Definition: CSCRecHit2D.h:92
std::ostream & operator<<(std::ostream &os, const CSCRecHit2D &rh)
Output operator for CSCRecHit2D.
Definition: CSCRecHit2D.cc:207
int theScaledWireTime
Definition: CSCRecHit2D.h:126
LocalError localPositionError() const override
Definition: CSCRecHit2D.h:57
float tpeak() const
Fitted peaking time.
Definition: CSCRecHit2D.h:79
LocalPoint localPosition() const override
Definition: CSCRecHit2D.h:56
float thePositionWithinStrip
Definition: CSCRecHit2D.h:122
float energyDepositedInLayer() const
Definition: CSCRecHit2D.h:106
DetId geographicalId() const
float theErrorWithinStrip
Definition: CSCRecHit2D.h:123
short int wgroupsBX() const
Definition: CSCRecHit2D.h:69
float positionWithinStrip() const
The estimated position within the strip.
Definition: CSCRecHit2D.h:82
int channelsl1a(unsigned int i) const
Extract the L1A phase bits from the StripChannelContainer - high.
Definition: CSCRecHit2D.h:65
float theEnergyDeposit
Definition: CSCRecHit2D.h:124
static const unsigned int MAXTIMEBINS
Definition: CSCRecHit2D.h:33
short int theWGroupsBX_
Definition: CSCRecHit2D.h:128
float theADCs_[N_ADC]
Definition: CSCRecHit2D.h:136
GloballyPositioned< float >::LocalPoint LocalPoint
int channels(unsigned int i) const
Extracting strip channel numbers comprising the rechit - low.
Definition: CSCRecHit2D.h:61
short int hitWire() const
L1A.
Definition: CSCRecHit2D.h:68
unsigned char theStrips_[MAXSTRIPS]
Definition: CSCRecHit2D.h:135
std::vector< int > ChannelContainer
Definition: CSCRecHit2D.h:20
int quality() const
quality flag of the reconstruction
Definition: CSCRecHit2D.h:88
unsigned char theL1APhaseBits_[MAXSTRIPS]
Definition: CSCRecHit2D.h:134