40 for (
auto i1 = r1.
begin(), i2 = r2.
begin(); i1 != r1.
end(); ++i1, ++i2) {
41 if (!i1->isValid() || !i2->isValid())
43 if (i1->geographicalId() != i2->geographicalId())
45 if (!(i1->localPosition() == i2->localPosition()))
54 out.emplace_back(seed);
63 for (
auto &res : out) {
65 equivalent(seed, res)) {
70 seed.
setNegAttributes(res.dRZNeg(1), res.dPhiNeg(1), res.dRZNeg(0), res.dPhiNeg(0));
74 if (res.dRZPos(1) != seed.
dRZPos(1)) {
76 <<
"this similar old seed already has another dRz2Pos"
77 <<
"\nold seed mask/dRz2/dPhi2/dRz2Pos/dPhi2Pos: " << (
unsigned int)res.hitsMask() <<
"/"
78 << res.dRZNeg(1) <<
"/" << res.dPhiNeg(1) <<
"/" << res.dRZPos(1) <<
"/" << res.dPhiPos(1)
79 <<
"\nnew seed mask/dRz2/dPhi2/dRz2Pos/dPhi2Pos: " << (
unsigned int)seed.
hitsMask() <<
"/"
88 seed.
setPosAttributes(res.dRZPos(1), res.dPhiPos(1), res.dRZPos(0), res.dPhiPos(0));
92 if (res.dRZNeg(1) != seed.
dRZNeg(1)) {
94 <<
"this old seed already has another dRz2"
95 <<
"\nold seed mask/dRz2/dPhi2/dRz2Pos/dPhi2Pos: " << (
unsigned int)res.hitsMask() <<
"/"
96 << res.dRZNeg(1) <<
"/" << res.dPhiNeg(1) <<
"/" << res.dRZPos(1) <<
"/" << res.dPhiPos(1)
97 <<
"\nnew seed mask/dRz2/dPhi2/dRz2Pos/dPhi2Pos: " << (
unsigned int)seed.
hitsMask() <<
"/"
106 out.emplace_back(seed);
109 void seedsFromTrajectorySeeds(
const std::vector<SeedWithInfo> &pixelSeeds,
113 if (!pixelSeeds.empty()) {
114 LogDebug(
"ElectronSeedGenerator") <<
"Compatible " << (positron ?
"positron" :
"electron") <<
" seeds found.";
117 std::vector<SeedWithInfo>::const_iterator
s;
118 for (s = pixelSeeds.begin(); s != pixelSeeds.end(); s++) {
122 addSeed(seed, &*s, positron, out);
131 : dynamicPhiRoad_(pset.getParameter<bool>(
"dynamicPhiRoad")),
134 magFieldToken_{cc.esConsumes()},
136 lowPtThresh_(
pset.getParameter<
double>(
"LowPtThreshold")),
137 highPtThresh_(
pset.getParameter<
double>(
"HighPtThreshold")),
138 nSigmasDeltaZ1_(
pset.getParameter<
double>(
"nSigmasDeltaZ1")),
139 deltaZ1WithVertex_(
pset.getParameter<
double>(
"deltaZ1WithVertex")),
140 sizeWindowENeg_(
pset.getParameter<
double>(
"SizeWindowENeg")),
141 deltaPhi1Low_(
pset.getParameter<
double>(
"DeltaPhi1Low")),
142 deltaPhi1High_(
pset.getParameter<
double>(
"DeltaPhi1High")),
144 dPhi1Coef2_(dynamicPhiRoad_ ? (deltaPhi1Low_ - deltaPhi1High_) / (1. / lowPtThresh_ - 1. / highPtThresh_) : 0.),
145 dPhi1Coef1_(dynamicPhiRoad_ ? deltaPhi1Low_ - dPhi1Coef2_ / lowPtThresh_ : 0.),
147 useRecoVertex_(
pset.getParameter<
bool>(
"useRecoVertex")),
149 deltaPhi2B_(
pset.getParameter<
double>(
"DeltaPhi2B")),
150 deltaPhi2F_(
pset.getParameter<
double>(
"DeltaPhi2F")),
151 phiMin2B_(-
pset.getParameter<
double>(
"PhiMax2B")),
152 phiMin2F_(-
pset.getParameter<
double>(
"PhiMax2F")),
153 phiMax2B_(
pset.getParameter<
double>(
"PhiMax2B")),
154 phiMax2F_(
pset.getParameter<
double>(
"PhiMax2F")),
156 pset.getParameter<
double>(
"ePhiMax1"),
161 pset.getParameter<
double>(
"z2MaxB"),
162 pset.getParameter<
double>(
"r2MaxF"),
163 pset.getParameter<
double>(
"rMaxI"),
174 const std::vector<const TrajectorySeedCollection *> &seedsV,
182 std::vector<reco::Vertex>
const *
vertices =
nullptr;
186 for (
unsigned int i = 0;
i < sclRefs.
size(); ++
i) {
188 LogDebug(
"ElectronSeedGenerator") <<
"new cluster, calling seedsFromThisCluster";
192 LogDebug(
"ElectronSeedGenerator") <<
": For event " << e.
id();
193 LogDebug(
"ElectronSeedGenerator") <<
"Nr of superclusters after filter: " << sclRefs.
size()
194 <<
", no. of ElectronSeeds found = " << out.size();
199 std::vector<reco::Vertex>
const *
vertices,
201 float clusterEnergy = seedCluster->energy();
202 GlobalPoint clusterPos(seedCluster->position().x(), seedCluster->position().y(), seedCluster->position().z());
225 double sq =
sqrt(sigmaZ * sigmaZ + sigmaZ0Error * sigmaZ0Error);
236 seedsFromTrajectorySeeds(elePixelSeeds, caloCluster, out,
false);
239 seedsFromTrajectorySeeds(posPixelSeeds, caloCluster, out,
true);
243 for (
auto const &vertex : *vertices) {
244 GlobalPoint vertexPos(vertex.position().x(), vertex.position().y(), vertex.position().z());
245 double myZmin1, myZmax1;
246 if (vertexPos.z() == beamSpot.
position().z()) {
249 double sq =
sqrt(sigmaZ * sigmaZ + sigmaZ0Error * sigmaZ0Error);
261 seedsFromTrajectorySeeds(elePixelSeeds, caloCluster, out,
false);
264 seedsFromTrajectorySeeds(posPixelSeeds, caloCluster, out,
true);
void seedsFromThisCluster(edm::Ref< reco::SuperClusterCollection > seedCluster, reco::BeamSpot const &beamSpot, std::vector< reco::Vertex > const *vertices, reco::ElectronSeedCollection &out)
void run(edm::Event &, const reco::SuperClusterRefVector &, const std::vector< const TrajectorySeedCollection * > &seedsV, reco::ElectronSeedCollection &)
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 edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
const bool useRecoVertex_
const CaloClusterRef & caloCluster() const
const float nSigmasDeltaZ1_
float dRZPos(size_t hitNr) const
void set2ndLayer(float dummyphi2minB, float dummyphi2maxB, float dummyphi2minF, float dummyphi2maxF)
bool getData(T &iHolder) const
const std::vector< const TrajectorySeedCollection * > * initialSeedCollectionVector_
void set1stLayerZRange(float zmin1, float zmax1)
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_
RecHitRange recHits() const
void set1stLayer(float dummyphi1min, float dummyphi1max)
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
void ele_convert(const Type1 &obj1, Type2 &obj2)
bool check(const edm::EventSetup &iSetup)
void setCaloCluster(const CaloClusterRef &clus)
unsigned int nHits() const
ElectronSeedGenerator(const edm::ParameterSet &, const Tokens &, edm::ConsumesCollector &&)
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
trackerGeometryToken_(iC.esConsumes())
Log< level::Warning, false > LogWarning
edm::ESWatcher< TrackerDigiGeometryRecord > trackerGeometryWatcher_
float dPhiNeg(size_t hitNr) const
edm::ESWatcher< IdealMagneticFieldRecord > magneticFieldWatcher_
const float highPtThresh_
const float deltaPhi1Low_
float dPhiPos(size_t hitNr) const
void initTwoHitSeed(const unsigned char hitMask)
void setES(MagneticField const &, TrackerGeometry const &trackerGeometry)