13 nrLayersAlongTraj_(0),
15 isTrackerDriven_(
false)
24 nrLayersAlongTraj_(0),
26 isTrackerDriven_(
false) {}
33 nrLayersAlongTraj_(0),
35 isTrackerDriven_(
false) {}
49 for (
size_t hitNr = 0; hitNr <
nHits(); hitNr++) {
50 int bitNr = 0x1 << hitNr;
51 int hitDetId = (
recHits().
begin() + hitNr)->geographicalId().rawId();
64 if (hitNrs.size() != 2) {
66 <<
"in ElectronSeed::" << __FUNCTION__ <<
"," << __LINE__ <<
": number of hits in hit mask is " << hitNrs.size()
68 <<
"pre-2017 pixel upgrade ecalDriven ElectronSeeds should have exactly 2 hits\n " 69 <<
"mask " <<
static_cast<unsigned int>(hitMask) << std::endl;
71 if (hitNrs[0] >=
nHits() || hitNrs[1] >=
nHits()) {
72 throw cms::Exception(
"LogicError") <<
"in ElectronSeed::" << __FUNCTION__ <<
"," << __LINE__ <<
": hits are " 73 << hitNrs[0] <<
" and " << hitNrs[1] <<
" while number of hits are " <<
nHits()
75 <<
"this means there was a bug in storing or creating the electron seeds " 76 <<
"mask " <<
static_cast<unsigned int>(hitMask) << std::endl;
78 for (
size_t hitNr = 0; hitNr <
hitInfo_.size(); hitNr++) {
82 info.setDet((
recHits().begin() + hitNrs[hitNr])->geographicalId(), -1);
89 <<
"ElectronSeed::setNegAttributes should only operate on seeds with exactly two hits. This is because it is a " 90 "legacy function to preverse backwards compatiblity and should not be used on new code which matches " 91 "variable number of hits";
102 <<
"ElectronSeed::setPosAttributes should only operate on seeds with exactly two hits. This is because it is a " 103 "legacy function to preverse backwards compatiblity and should not be used on new code which matches " 104 "variable number of hits";
113 std::vector<unsigned int> hitNrs;
114 for (
size_t bitNr = 0; bitNr <
sizeof(hitMask) * CHAR_BIT; bitNr++) {
115 char bit = 0x1 << bitNr;
116 if ((hitMask &
bit) != 0)
117 hitNrs.push_back(bitNr);
123 const float dPhi1Neg,
126 const float dPhi2Pos,
127 const float dPhi2Neg,
133 return std::vector<ElectronSeed::PMVars>();
138 if (hitNrs.size() != 2) {
139 throw cms::Exception(
"LogicError") <<
"in ElectronSeed::" << __FUNCTION__ <<
"," << __LINE__
140 <<
": number of hits in hit mask is " << nrRecHits <<
"\n" 141 <<
"pre-2017 pixel upgrade ecalDriven ElectronSeeds should have exactly 2 hits\n" 142 <<
"mask " <<
static_cast<unsigned int>(hitMask) << std::endl;
144 if (hitNrs[0] >= nrRecHits || hitNrs[1] >= nrRecHits) {
145 throw cms::Exception(
"LogicError") <<
"in ElectronSeed::" << __FUNCTION__ <<
"," << __LINE__ <<
": hits are " 146 << hitNrs[0] <<
" and " << hitNrs[1] <<
" while number of hits are " << nrRecHits
148 <<
"this means there was a bug in storing or creating the electron seeds " 149 <<
"mask " <<
static_cast<unsigned int>(hitMask) << std::endl;
152 std::vector<PMVars>
hitInfo(2);
153 hitInfo[0].setDPhi(dPhi1Pos, dPhi1Neg);
154 hitInfo[0].setDRZ(dRZ1Pos, dRZ1Neg);
158 hitInfo[1].setDPhi(dPhi2Pos, dPhi2Neg);
159 hitInfo[1].setDRZ(dRZ2Pos, dRZ2Neg);
float dRZPos(size_t hitNr) const
unsigned int hitsMask() const
const CtfTrackRef & ctfTrack() const
Accessors.
std::vector< PMVars > hitInfo_
int layerOrDiskNr(size_t hitNr) const
const std::vector< PMVars > & hitInfo() const
void setPosAttributes(const float dRZ2=std::numeric_limits< float >::infinity(), const float dPhi2=std::numeric_limits< float >::infinity(), const float dRZ1=std::numeric_limits< float >::infinity(), const float dPhi1=std::numeric_limits< float >::infinity())
RecHitRange recHits() const
void setDPhi(float pos, float neg)
void setCtfTrack(const CtfTrackRef &)
Set additional info.
static const double pts[33]
int detId(size_t hitNr) const
ElectronSeed()
Construction of base attributes.
float dPhiPos(size_t hitNr) const
unsigned int nHits() const
void setDet(int iDetId, int iLayerOrDiskNr)
float dRZNeg(size_t hitNr) const
float dPhiNeg(size_t hitNr) const
void setNegAttributes(const float dRZ2=std::numeric_limits< float >::infinity(), const float dPhi2=std::numeric_limits< float >::infinity(), const float dRZ1=std::numeric_limits< float >::infinity(), const float dPhi1=std::numeric_limits< float >::infinity())
static std::vector< PMVars > createHitInfo(const float dPhi1Pos, const float dPhi1Neg, const float dRZ1Pos, const float dRZ1Neg, const float dPhi2Pos, const float dPhi2Neg, const float dRZ2Pos, const float dRZ2Neg, const char hitMask, TrajectorySeed::RecHitRange const &recHits)
void setDRZ(float pos, float neg)
static std::vector< unsigned int > hitNrsFromMask(unsigned int hitMask)
void initTwoHitSeed(const unsigned char hitMask)