46 for (i1 = r1.first, i2 =
r2.first, nHits = 0; i1 != r1.second; ++i1, ++i2, ++nHits) {
47 if (!i1->isValid() || !i2->isValid())
49 if (i1->geographicalId() != i2->geographicalId())
51 if (!(i1->localPosition() == i2->localPosition()))
60 out.emplace_back(seed);
69 for (
auto &
res : out) {
71 equivalent(seed,
res)) {
82 <<
"this similar old seed already has another dRz2Pos" 83 <<
"\nold seed mask/dRz2/dPhi2/dRz2Pos/dPhi2Pos: " << (
unsigned int)
res.hitsMask() <<
"/" 84 <<
res.dRZNeg(1) <<
"/" <<
res.dPhiNeg(1) <<
"/" <<
res.dRZPos(1) <<
"/" <<
res.dPhiPos(1)
85 <<
"\nnew seed mask/dRz2/dPhi2/dRz2Pos/dPhi2Pos: " << (
unsigned int)seed.
hitsMask() <<
"/" 100 <<
"this old seed already has another dRz2" 101 <<
"\nold seed mask/dRz2/dPhi2/dRz2Pos/dPhi2Pos: " << (
unsigned int)
res.hitsMask() <<
"/" 102 <<
res.dRZNeg(1) <<
"/" <<
res.dPhiNeg(1) <<
"/" <<
res.dRZPos(1) <<
"/" <<
res.dPhiPos(1)
103 <<
"\nnew seed mask/dRz2/dPhi2/dRz2Pos/dPhi2Pos: " << (
unsigned int)seed.
hitsMask() <<
"/" 112 out.emplace_back(seed);
115 void seedsFromTrajectorySeeds(
const std::vector<SeedWithInfo> &pixelSeeds,
119 if (!pixelSeeds.empty()) {
120 LogDebug(
"ElectronSeedGenerator") <<
"Compatible " << (positron ?
"positron" :
"electron") <<
" seeds found.";
123 std::vector<SeedWithInfo>::const_iterator
s;
124 for (s = pixelSeeds.begin(); s != pixelSeeds.end(); s++) {
128 addSeed(seed, &*s, positron, out);
135 : dynamicPhiRoad_(pset.getParameter<
bool>(
"dynamicPhiRoad")),
136 verticesTag_(ts.token_vtx),
137 beamSpotTag_(ts.token_bs),
138 lowPtThresh_(pset.getParameter<double>(
"LowPtThreshold")),
139 highPtThresh_(pset.getParameter<double>(
"HighPtThreshold")),
140 nSigmasDeltaZ1_(pset.getParameter<double>(
"nSigmasDeltaZ1")),
141 deltaZ1WithVertex_(pset.getParameter<double>(
"deltaZ1WithVertex")),
142 sizeWindowENeg_(pset.getParameter<double>(
"SizeWindowENeg")),
143 deltaPhi1Low_(pset.getParameter<double>(
"DeltaPhi1Low")),
144 deltaPhi1High_(pset.getParameter<double>(
"DeltaPhi1High")),
146 dPhi1Coef2_(dynamicPhiRoad_ ? (deltaPhi1Low_ - deltaPhi1High_) / (1. / lowPtThresh_ - 1. / highPtThresh_) : 0.),
147 dPhi1Coef1_(dynamicPhiRoad_ ? deltaPhi1Low_ - dPhi1Coef2_ / lowPtThresh_ : 0.),
150 useRecoVertex_(pset.getParameter<
bool>(
"useRecoVertex")),
152 deltaPhi2B_(pset.getParameter<double>(
"DeltaPhi2B")),
153 deltaPhi2F_(pset.getParameter<double>(
"DeltaPhi2F")),
154 phiMin2B_(pset.getParameter<double>(
"PhiMin2B")),
155 phiMin2F_(pset.getParameter<double>(
"PhiMin2F")),
156 phiMax2B_(pset.getParameter<double>(
"PhiMax2B")),
157 phiMax2F_(pset.getParameter<double>(
"PhiMax2F")),
158 electronMatcher_(pset.getParameter<double>(
"ePhiMin1"),
159 pset.getParameter<double>(
"ePhiMax1"),
164 pset.getParameter<double>(
"z2MinB"),
165 pset.getParameter<double>(
"z2MaxB"),
166 pset.getParameter<double>(
"r2MinF"),
167 pset.getParameter<double>(
"r2MaxF"),
168 pset.getParameter<double>(
"rMinI"),
169 pset.getParameter<double>(
"rMaxI"),
171 positronMatcher_(pset.getParameter<double>(
"pPhiMin1"),
172 pset.getParameter<double>(
"pPhiMax1"),
177 pset.getParameter<double>(
"z2MinB"),
178 pset.getParameter<double>(
"z2MaxB"),
179 pset.getParameter<double>(
"r2MinF"),
180 pset.getParameter<double>(
"r2MaxF"),
181 pset.getParameter<double>(
"rMinI"),
182 pset.getParameter<double>(
"rMaxI"),
187 bool tochange =
false;
211 const std::vector<const TrajectorySeedCollection *> &seedsV,
219 std::vector<reco::Vertex>
const *
vertices =
nullptr;
223 for (
unsigned int i = 0;
i < sclRefs.
size(); ++
i) {
225 LogDebug(
"ElectronSeedGenerator") <<
"new cluster, calling seedsFromThisCluster";
229 LogDebug(
"ElectronSeedGenerator") <<
": For event " << e.
id();
230 LogDebug(
"ElectronSeedGenerator") <<
"Nr of superclusters after filter: " << sclRefs.
size()
231 <<
", no. of ElectronSeeds found = " << out.size();
236 std::vector<reco::Vertex>
const *
vertices,
238 float clusterEnergy = seedCluster->energy();
239 GlobalPoint clusterPos(seedCluster->position().x(), seedCluster->position().y(), seedCluster->position().z());
274 double sq =
sqrt(sigmaZ * sigmaZ + sigmaZ0Error * sigmaZ0Error);
286 seedsFromTrajectorySeeds(elePixelSeeds, caloCluster, out,
false);
289 seedsFromTrajectorySeeds(posPixelSeeds, caloCluster, out,
true);
293 for (
auto const &
vertex : *vertices) {
295 double myZmin1, myZmax1;
296 if (vertexPos.z() == beamSpot.
position().z()) {
299 double sq =
sqrt(sigmaZ * sigmaZ + sigmaZ0Error * sigmaZ0Error);
312 seedsFromTrajectorySeeds(elePixelSeeds, caloCluster, out,
false);
315 seedsFromTrajectorySeeds(posPixelSeeds, caloCluster, out,
true);
unsigned long long cacheIdentifier() const
std::pair< const_iterator, const_iterator > range
void seedsFromThisCluster(edm::Ref< reco::SuperClusterCollection > seedCluster, reco::BeamSpot const &beamSpot, std::vector< reco::Vertex > const *vertices, reco::ElectronSeedCollection &out)
double sigmaZ0Error() const
error on sigma z
const edm::EDGetTokenT< std::vector< reco::Vertex > > verticesTag_
void setupES(const edm::EventSetup &setup)
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())
const bool useRecoVertex_
edm::ESHandle< TrackerGeometry > trackerGeometry_
const CaloClusterRef & caloCluster() const
unsigned long long cacheIDMagField_
const float nSigmasDeltaZ1_
unsigned long long cacheIDTrkGeom_
float dRZPos(size_t hitNr) const
void set2ndLayer(float dummyphi2minB, float dummyphi2maxB, float dummyphi2minF, float dummyphi2maxF)
const std::vector< const TrajectorySeedCollection * > * initialSeedCollectionVector_
void set1stLayerZRange(float zmin1, float zmax1)
void run(edm::Event &, const edm::EventSetup &setup, const reco::SuperClusterRefVector &, const std::vector< const TrajectorySeedCollection * > &seedsV, reco::ElectronSeedCollection &)
recHitContainer::const_iterator const_iterator
const edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
const float deltaZ1WithVertex_
const bool dynamicPhiRoad_
bool get(ProductID const &oid, Handle< PROD > &result) const
std::vector< ElectronSeed > ElectronSeedCollection
collection of ElectronSeed objects
const float deltaPhi1High_
std::unique_ptr< PropagatorWithMaterial > propagator_
PixelHitMatcher electronMatcher_
void set1stLayer(float dummyphi1min, float dummyphi1max)
PixelHitMatcher positronMatcher_
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())
double sigmaZ() const
sigma z
ElectronSeedGenerator(const edm::ParameterSet &, const Tokens &)
void ele_convert(const Type1 &obj1, Type2 &obj2)
void setCaloCluster(const CaloClusterRef &clus)
unsigned int nHits() const
unsigned int hitsMask() const
float dRZNeg(size_t hitNr) const
const float sizeWindowENeg_
size_type size() const
Size of the RefVector.
const Point & position() const
position
edm::ESHandle< MagneticField > magField_
float dPhiNeg(size_t hitNr) const
T const * product() const
const float highPtThresh_
void setES(const MagneticField *, const TrackerGeometry *trackerGeometry)
const float deltaPhi1Low_
float dPhiPos(size_t hitNr) const
void initTwoHitSeed(const unsigned char hitMask)