Go to the documentation of this file.00001 #ifndef DataFormats_CSCRecHit2D_H
00002 #define DataFormats_CSCRecHit2D_H
00003
00011 #include "DataFormats/Common/interface/RangeMap.h"
00012 #include <DataFormats/TrackingRecHit/interface/RecHit2DLocalPos.h>
00013 #include <DataFormats/MuonDetId/interface/CSCDetId.h>
00014 #include <vector>
00015 #include <map>
00016 #include <iosfwd>
00017
00018 class CSCRecHit2D GCC11_FINAL : public RecHit2DLocalPos {
00019
00020 public:
00021
00022 typedef std::vector<int> ChannelContainer;
00023 typedef edm::RangeMap<int, std::vector<float> > ADCContainer;
00024
00025 enum SharedInputType {all = TrackingRecHit::all, some = TrackingRecHit::some, allWires, someWires, allStrips, someStrips};
00026
00027 static const unsigned int MAXSTRIPS=3;
00028 static const unsigned int MAXTIMEBINS=4;
00029 static const unsigned int N_ADC=MAXSTRIPS*MAXTIMEBINS;
00030 CSCRecHit2D();
00031
00032 CSCRecHit2D( const CSCDetId& id,
00033 const LocalPoint& pos, const LocalError& err,
00034 const ChannelContainer& channels,
00035 const ADCContainer& adcs,
00036 const ChannelContainer& wgroups,
00037 float tpeak,
00038 float posInStrip,
00039 float errInStrip,
00040 int quality,
00041 short int badStrip=0, short int badWireGroup=0,
00042 int scaledWireTime=0,
00043 float energyDeposit=-995.);
00044
00045 ~CSCRecHit2D();
00046
00047
00049 CSCRecHit2D* clone() const { return new CSCRecHit2D( *this ); }
00050 LocalPoint localPosition() const { return theLocalPosition; }
00051 LocalError localPositionError() const { return theLocalError; }
00052 CSCDetId cscDetId() const { return geographicalId(); }
00053
00055 int channels(unsigned int i) const { return theStrips_[i]; }
00056 unsigned int nStrips() const {return nStrips_;}
00057
00059 int channelsl1a(unsigned int i) const { return theL1APhaseBits_[i]; }
00060
00062 short int hitWire() const { return hitWire_;}
00063 short int wgroupsBX() const {return theWGroupsBX_;}
00064
00065 unsigned int nWireGroups() const {return nWireGroups_;}
00066
00068 float adcs(unsigned int strip, unsigned int timebin) const { return theADCs_[strip*MAXTIMEBINS+timebin]; }
00069
00070 unsigned int nTimeBins() const {return nTimeBins_;}
00071
00073 float tpeak() const { return theTpeak; }
00074
00076 float positionWithinStrip() const { return thePositionWithinStrip; };
00077
00079 float errorWithinStrip() const { return theErrorWithinStrip;} ;
00080
00082 int quality() const { return theQuality;}
00083
00085 short int badStrip() const { return theBadStrip; }
00086 short int badWireGroup() const { return theBadWireGroup; }
00087
00088
00089 float wireTime() const { return (float)theScaledWireTime/100.; }
00090
00100 float energyDepositedInLayer() const { return theEnergyDeposit; }
00101
00103 virtual bool sharesInput(const TrackingRecHit *other, TrackingRecHit::SharedInputType what) const;
00104
00106 bool sharesInput(const TrackingRecHit *other, CSCRecHit2D::SharedInputType what) const;
00107
00109 bool sharesInput(const CSCRecHit2D *otherRecHit, CSCRecHit2D::SharedInputType what) const;
00110
00112 void print() const;
00113
00114 private:
00115
00116 float theTpeak;
00117 float thePositionWithinStrip;
00118 float theErrorWithinStrip;
00119 float theEnergyDeposit;
00120 int theQuality;
00121 int theScaledWireTime;
00122 short int hitWire_;
00123 short int theWGroupsBX_;
00124 short int theBadStrip;
00125 short int theBadWireGroup;
00126
00127 unsigned char nStrips_, nWireGroups_, nTimeBins_;
00128
00129 unsigned char theL1APhaseBits_[MAXSTRIPS];
00130 unsigned char theStrips_[MAXSTRIPS];
00131 float theADCs_[N_ADC];
00132
00133 LocalPoint theLocalPosition;
00134 LocalError theLocalError;
00135
00136 };
00137
00139 std::ostream& operator<<(std::ostream& os, const CSCRecHit2D& rh);
00140
00141 #endif
00142