51 #ifdef COUNT_ElectronSeeds 56 ~Count() {
std::cout <<
"ElectronSeeds res " << s<<
'/'<<n << std::endl;}
67 : dynamicphiroad_(pset.getParameter<
bool>(
"dynamicPhiRoad")),
68 fromTrackerSeeds_(pset.getParameter<
bool>(
"fromTrackerSeeds")),
69 useRecoVertex_(
false),
70 verticesTag_(ts.token_vtx),
71 beamSpotTag_(ts.token_bs),
72 lowPtThreshold_(pset.getParameter<double>(
"LowPtThreshold")),
73 highPtThreshold_(pset.getParameter<double>(
"HighPtThreshold")),
74 nSigmasDeltaZ1_(pset.getParameter<double>(
"nSigmasDeltaZ1")),
75 deltaZ1WithVertex_(0.5),
76 sizeWindowENeg_(pset.getParameter<double>(
"SizeWindowENeg")),
77 deltaPhi1Low_(pset.getParameter<double>(
"DeltaPhi1Low")),
78 deltaPhi1High_(pset.getParameter<double>(
"DeltaPhi1High")),
79 deltaPhi1Coef1_(0.), deltaPhi1Coef2_(0.),
83 theMeasurementTrackerEventTag(ts.token_measTrkEvt),
85 cacheIDMagField_(0),cacheIDNavSchool_(0),cacheIDCkfComp_(0),cacheIDTrkGeom_(0)
114 phiMin2B_, phiMax2B_, phiMin2F_, phiMax2F_,
126 phiMin2B_, phiMax2B_, phiMin2F_, phiMax2F_,
210 for ( i1=r1.first, i2=
r2.first, nHits=0 ; i1!=r1.second ; ++i1, ++i2, ++nHits )
212 if ( !i1->isValid() || !i2->isValid() )
return false ;
213 if ( i1->geographicalId()!=i2->geographicalId() )
return false ;
214 if ( ! ( i1->localPosition()==i2->localPosition() ) )
return false ;
271 {
throw cms::Exception(
"NotSupported") <<
"Here in ElectronSeedGenerator " << __FILE__ <<
":" << __LINE__ <<
" I would like to do theMeasurementTracker->update(e); but that no longer makes sense.\n";
274 for (
unsigned int i=0;
i<sclRefs.
size();++
i) {
278 LogDebug (
"ElectronSeedGenerator") <<
"new cluster, calling seedsFromThisCluster";
282 LogDebug (
"ElectronSeedGenerator") <<
": For event "<<e.
id();
283 LogDebug (
"ElectronSeedGenerator") <<
"Nr of superclusters after filter: "<<sclRefs.
size()
284 <<
", no. of ElectronSeeds found = " << out.size();
286 #ifdef COUNT_ElectronSeeds 287 stcount.s+=sclRefs.
size();
288 stcount.n+=out.size();
295 float hoe1,
float hoe2,
298 float clusterEnergy = seedCluster->energy() ;
300 ( seedCluster->position().x(),
301 seedCluster->position().y(),
302 seedCluster->position().z() ) ;
343 double sq=
sqrt(sigmaZ*sigmaZ+sigmaZ0Error*sigmaZ0Error);
356 std::vector<std::pair<RecHitWithDist,ConstRecHitPointer> > elePixelHits
362 std::vector<std::pair<RecHitWithDist,ConstRecHitPointer> > posPixelHits
370 std::vector<SeedWithInfo> elePixelSeeds
374 std::vector<SeedWithInfo> posPixelSeeds
387 std::vector<reco::Vertex>::const_iterator vtxIter ;
388 for (vtxIter = vtxCollection->begin(); vtxIter != vtxCollection->end() ; vtxIter++)
391 GlobalPoint vertexPos(vtxIter->position().x(),vtxIter->position().y(),vtxIter->position().z());
392 double myZmin1, myZmax1 ;
397 double sq=
sqrt(sigmaZ*sigmaZ+sigmaZ0Error*sigmaZ0Error);
413 std::vector<std::pair<RecHitWithDist,ConstRecHitPointer> > elePixelHits
417 std::vector<std::pair<RecHitWithDist,ConstRecHitPointer> > posPixelHits
424 std::vector<SeedWithInfo> elePixelSeeds
428 std::vector<SeedWithInfo> posPixelSeeds
439 ( std::vector<std::pair<RecHitWithDist,ConstRecHitPointer> > &
pixelHits,
446 {
LogDebug(
"ElectronSeedGenerator") <<
"Compatible "<<(positron?
"positron":
"electron")<<
" hits found." ; }
448 std::vector<std::pair<RecHitWithDist,ConstRecHitPointer> >::iterator
v ;
452 { (*v).first.invert() ; }
457 addSeed(seed,
nullptr,positron,out) ;
462 (
const std::vector<SeedWithInfo> & pixelSeeds,
464 float hoe1,
float hoe2,
468 if (!pixelSeeds.empty())
469 {
LogDebug(
"ElectronSeedGenerator") <<
"Compatible "<<(positron?
"positron":
"electron")<<
" seeds found." ; }
471 std::vector<SeedWithInfo>::const_iterator
s;
472 for ( s = pixelSeeds.begin() ; s != pixelSeeds.end() ; s++ )
475 seed.setCaloCluster(cluster);
476 seed.initTwoHitSeed(s->hitsMask());
488 { out.emplace_back(seed) ;
return ; }
494 reco::ElectronSeedCollection::iterator resItr ;
495 for ( resItr=out.begin() ; resItr!=out.end() ; ++resItr )
498 (seed.
hitsMask()==resItr->hitsMask()) &&
507 seed.
setNegAttributes(resItr->dRz2(),resItr->dPhi2(),resItr->dRz1(),resItr->dPhi1()) ;
514 if ( resItr->dRz2Pos()!=seed.
dRz2Pos() )
517 <<
"this similar old seed already has another dRz2Pos" 518 <<
"\nold seed mask/dRz2/dPhi2/dRz2Pos/dPhi2Pos: "<<(
unsigned int)resItr->hitsMask()<<
"/"<<resItr->dRz2()<<
"/"<<resItr->dPhi2()<<
"/"<<resItr->dRz2Pos()<<
"/"<<resItr->dPhi2Pos()
544 seed.
setPosAttributes(resItr->dRz2Pos(),resItr->dPhi2Pos(),resItr->dRz1Pos(),resItr->dPhi1Pos()) ;
551 if (resItr->dRz2()!=seed.
dRz2())
554 <<
"this old seed already has another dRz2" 555 <<
"\nold seed mask/dRz2/dPhi2/dRz2Pos/dPhi2Pos: "<<(
unsigned int)resItr->hitsMask()<<
"/"<<resItr->dRz2()<<
"/"<<resItr->dPhi2()<<
"/"<<resItr->dRz2Pos()<<
"/"<<resItr->dPhi2Pos()
579 out.emplace_back(seed) ;
589 LogDebug(
"") <<
"[ElectronSeedGenerator::prepareElTrackSeed] inner PixelHit x,y,z "<<innerhit->globalPosition();
590 LogDebug(
"") <<
"[ElectronSeedGenerator::prepareElTrackSeed] outer PixelHit x,y,z "<<outerhit->globalPosition();
601 constpixhit = dynamic_cast <
const SiPixelRecHit *> (outerhit->hit());
621 FastHelix helix(outerhit->globalPosition(),innerhit->globalPosition(),vertexPos,nomField,&*bfield);
622 if ( !helix.isValid()) {
627 if (!propagatedState.isValid())
632 if (!propagatedState_out.
isValid())
PropagationDirection direction() const
T getParameter(std::string const &) const
unsigned long long cacheIdentifier() const
unsigned long long cacheIDNavSchool_
double sigmaZ0Error() const
error on sigma z
PixelHitMatcher * myMatchEle
void setupES(const edm::EventSetup &setup)
void setEvent(const MeasurementTrackerEvent &event)
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())
int nominalValue() const
The nominal field value for this map in kGauss.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
LocalPoint position() const
Local x and y position coordinates.
TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
void setES(const MagneticField *, const MeasurementTracker *theMeasurementTracker, const TrackerGeometry *trackerGeometry)
const NavigationSchool * theNavigationSchool
edm::EDGetTokenT< MeasurementTrackerEvent > theMeasurementTrackerEventTag
const edm::EventSetup * theSetup
def setup(process, global_tag, zero_tesla=False)
GlobalPoint globalPosition() const
const CaloClusterRef & caloCluster() const
unsigned long long cacheIDMagField_
edm::Handle< std::vector< reco::Vertex > > theVertices
unsigned long long cacheIDTrkGeom_
void set2ndLayer(float dummyphi2minB, float dummyphi2maxB, float dummyphi2minF, float dummyphi2maxF)
void set1stLayerZRange(float zmin1, float zmax1)
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const override
const SurfaceType & surface() const
PTrajectoryStateOnDet pts_
edm::ESHandle< TrackerGeometry > theTrackerGeometry
void seedsFromThisCluster(edm::Ref< reco::SuperClusterCollection > seedCluster, float hoe1, float hoe2, reco::ElectronSeedCollection &out, const TrackerTopology *tTopo)
PRecHitContainer recHits_
recHitContainer::const_iterator const_iterator
std::pair< const_iterator, const_iterator > range
unsigned int detId() const
PropagatorWithMaterial * thePropagator
edm::Handle< reco::BeamSpot > theBeamSpot
edm::EDGetTokenT< std::vector< reco::Vertex > > verticesTag_
LocalVector momentum() const
Momentum vector in the local frame.
std::vector< ElectronSeed > ElectronSeedCollection
collection of ElectronSeed objects
std::vector< SeedWithInfo > compatibleSeeds(const std::vector< const TrajectorySeedCollection * > &seedsV, const GlobalPoint &xmeas, const GlobalPoint &vprim, float energy, float charge)
PixelHitMatcher * myMatchPos
void seedsFromRecHits(std::vector< std::pair< RecHitWithDist, ConstRecHitPointer > > &elePixelHits, PropagationDirection &dir, const GlobalPoint &vertexPos, const reco::ElectronSeed::CaloClusterRef &cluster, reco::ElectronSeedCollection &out, bool positron)
bool prepareElTrackSeed(ConstRecHitPointer outerhit, ConstRecHitPointer innerhit, const GlobalPoint &vertexPos)
TrajectoryStateOnSurface TSOS
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
PTrajectoryStateOnDet const & startingState() const
T const * product() const
void set1stLayer(float dummyphi1min, float dummyphi1max)
void addSeed(reco::ElectronSeed &seed, const SeedWithInfo *info, bool positron, reco::ElectronSeedCollection &out)
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)
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
TrackCharge charge() const
Charge (-1, 0 or 1)
edm::ESHandle< MagneticField > theMagField
void setCaloCluster(const CaloClusterRef &clus)
bool equivalent(const TrajectorySeed &s1, const TrajectorySeed &s2)
unsigned int nHits() const
char data[epos_bytes_allocation]
GlobalVector globalMomentum() const
void display_seed(const std::string &title1, const std::string &title2, const reco::ElectronSeed &seed, edm::ESHandle< TrackerGeometry > trackerGeometry)
const MeasurementTracker * theMeasurementTracker
unsigned int hitsMask() const
size_type size() const
Size of the RefVector.
const Point & position() const
position
const std::vector< const TrajectorySeedCollection * > * theInitialSeedCollV
void run(edm::Event &, const edm::EventSetup &setup, const reco::SuperClusterRefVector &, const std::vector< float > &hoe1s, const std::vector< float > &hoe2s, const std::vector< const TrajectorySeedCollection * > &seedsV, reco::ElectronSeedCollection &)
std::vector< std::pair< RecHitWithDist, ConstRecHitPointer > > compatibleHits(const GlobalPoint &xmeas, const GlobalPoint &vprim, float energy, float charge, const TrackerTopology *tTopo, const NavigationSchool &navigationSchool)
void setUseRecoVertex(bool val)
T const * product() const
void seedsFromTrajectorySeeds(const std::vector< SeedWithInfo > &elePixelSeeds, const reco::ElectronSeed::CaloClusterRef &cluster, float hoe1, float hoe2, reco::ElectronSeedCollection &out, bool positron)
std::string theMeasurementTrackerName
const LocalTrajectoryParameters & parameters() const
unsigned long long cacheIDCkfComp_