55 dynamicphiroad_(pset.getParameter<bool>(
"dynamicPhiRoad")),
56 lowPtThreshold_(pset.getParameter<double>(
"LowPtThreshold")),
57 highPtThreshold_(pset.getParameter<double>(
"HighPtThreshold")),
58 sizeWindowENeg_(pset.getParameter<double>(
"SizeWindowENeg")),
59 phimin2_(pset.getParameter<double>(
"PhiMin2")),
60 phimax2_(pset.getParameter<double>(
"PhiMax2")),
61 deltaPhi1Low_(pset.getParameter<double>(
"DeltaPhi1Low")),
62 deltaPhi1High_(pset.getParameter<double>(
"DeltaPhi1High")),
63 deltaPhi2_(pset.getParameter<double>(
"DeltaPhi2")),
66 fromTrackerSeeds_(pset.getParameter<bool>(
"fromTrackerSeeds")),
67 theUpdator(0), thePropagator(0),
70 theSetup(0), theBeamSpot(beamSpot)
156 double sigmaZ=recoBeamSpotHandle->sigmaZ();
157 double sigmaZ0Error=recoBeamSpotHandle->sigmaZ0Error();
158 double sq=
sqrt(sigmaZ*sigmaZ+sigmaZ0Error*sigmaZ0Error);
162 std::cout <<
"Z Range for pixel matcher : " << zmin1 <<
" " <<
BSPosition_.z() <<
" " << zmax1 << std::endl;
167 std::map<unsigned,std::vector<reco::ElectronSeed> > myPixelSeeds;
170 if(theGSRecHits->
size() == 0)
return;
175 const std::vector<unsigned> theSimTrackIds = theGSRecHits->
ids();
178 for (
unsigned tkId=0; tkId != theSimTrackIds.size(); ++tkId ) {
180 unsigned simTrackId = theSimTrackIds[tkId];
181 const SimTrack& theSimTrack = (*theSimTracks)[simTrackId];
187 unsigned numberOfRecHits = 0;
193 std::vector<unsigned> layerHit(6,static_cast<unsigned>(0));
196 std::vector<TrajectorySeedHitCandidate> theHits;
205 for ( iterRecHit = theRecHitRangeIteratorBegin;
206 iterRecHit != theRecHitRangeIteratorEnd;
211 if ( ( currentHit.
subDetId() <= 2 ) ||
220 theHits.push_back(currentHit);
224 if ( numberOfRecHits < 3 )
continue;
227 if ( theHits.size() < 2 )
continue;
231 unsigned csize = sclRefs.
size();
232 for (
unsigned int i=0;
i<csize;++
i) {
235 LogDebug (
"run") <<
"new cluster, calling addAseedFromThisCluster";
246 std::cout <<
"We have " << seeds->size() <<
" tracker seeds!" << std::endl;
248 for (
unsigned int i=0;
i<seeds->size();++
i) {
251 std::vector<TrajectorySeedHitCandidate> theHits;
258 for ( ; theSeedItr != theSeedRangeIteratorEnd; ++theSeedItr ) {
262 theHits.push_back(currentHit);
266 unsigned csize = sclRefs.
size();
267 for (
unsigned int i=0;
i<csize;++
i) {
271 std::cout <<
"new cluster, calling addAseedFromThisCluster" << std::endl;
284 std::map<unsigned,std::vector<reco::ElectronSeed> >::const_iterator px = myPixelSeeds.begin();
285 std::map<unsigned,std::vector<reco::ElectronSeed> >::const_iterator pxEnd = myPixelSeeds.end();
286 for ( ; px!=pxEnd; ++px ) {
287 unsigned nSeeds = (px->second).
size();
288 for (
unsigned ipx = 0; ipx<nSeeds; ++ipx ) {
289 out.push_back((px->second)[ipx]);
295 LogDebug (
"run") <<
"Nr of superclusters: "<<sclRefs.
size()
296 <<
", no. of ElectronSeeds found = " << out.size();
300 <<
", no. of ElectronSeeds found = " << out.size() << std::endl;
307 std::vector<TrajectorySeedHitCandidate>& theHits,
309 std::vector<reco::ElectronSeed>&
result)
312 float clusterEnergy = seedCluster->energy();
313 GlobalPoint clusterPos(seedCluster->position().x(),
314 seedCluster->position().y(),
315 seedCluster->position().z());
319 std::cout <<
"[FastElectronSeedGenerator::seedsFromThisCluster] "
320 <<
"new supercluster with energy: " << clusterEnergy << std::endl;
321 std::cout <<
"[FastElectronSeedGenerator::seedsFromThisCluster] "
322 <<
"and position: " << clusterPos << std::endl;
323 std::cout <<
"Vertex position : " << vertexPos << std::endl;
328 float clusterEnergyT = clusterEnergy*
sin(seedCluster->position().theta()) ;
330 float deltaPhi1 = 0.875/clusterEnergyT + 0.055;
352 std::vector<std::pair<ConstRecHitPointer,ConstRecHitPointer> > compatPixelHits =
360 if (!compatPixelHits.empty() ) {
362 std::cout <<
"[FastElectronSeedGenerator::seedsFromThisCluster] "
363 <<
" electron compatible hits found " << std::endl;
368 std::vector<std::pair<ConstRecHitPointer,ConstRecHitPointer> >::iterator
v;
369 for (v = compatPixelHits.begin(); v != compatPixelHits.end(); ++
v ) {
392 std::cout <<
"[FastElectronSeedGenerator::seedsFromThisCluster] "
393 <<
" No electron compatible hits found " << std::endl;
408 LogDebug(
"") <<
"[FastElectronSeedGenerator::prepareElTrackSeed] "
409 <<
"inner PixelHit x,y,z "<<innerhit->globalPosition();
410 LogDebug(
"") <<
"[FastElectronSeedGenerator::prepareElTrackSeed] "
411 <<
"outer PixelHit x,y,z "<<outerhit->globalPosition();
416 float nomField = bfield->nominalValue();
419 FastHelix helix(outerhit->globalPosition(),innerhit->globalPosition(),vertexPos,nomField,&*bfield);
420 if ( !helix.isValid())
return false;
426 fts.setCurvilinearError(errorMatrix*100.);
429 if (!propagatedState.
isValid())
return false;
void setCaloCluster(const CaloClusterRef &, unsigned char hitsMask=0, int subDet2=0, int subDet1=0, float hoe1=std::numeric_limits< float >::infinity(), float hoe2=std::numeric_limits< float >::infinity())
PTrajectoryStateOnDet pts_
T getParameter(std::string const &) const
virtual FreeTrajectoryState propagate(const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest) const final
std::pair< const_iterator, const_iterator > range
iterator range
void setupES(const edm::EventSetup &setup)
size_t size() const
return number of contained object
ROOT::Math::SMatrixIdentity AlgebraicMatrixID
const edm::EventSetup * theSetup
Sin< T >::type sin(const T &t)
const MagneticFieldMap * theMagneticFieldMap
range get(ID id, CMP comparator) const
const TrackerInteractionGeometry * theTrackerInteractionGeometry
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
TrajectorySeedCollection * theInitialSeedColl
void set1stLayer(float ephimin, float ephimax, float pphimin, float pphimax)
void addASeedToThisCluster(edm::Ref< reco::SuperClusterCollection > seedCluster, std::vector< TrajectorySeedHitCandidate > &theHits, const TrajectorySeed &theTrackerSeed, std::vector< reco::ElectronSeed > &result)
PropagatorWithMaterial * thePropagator
C::const_iterator const_iterator
constant access iterator type
PRecHitContainer recHits_
void set1stLayerZRange(double zmin1, double zmax1)
std::vector< TrajectorySeed > TrajectorySeedCollection
FastElectronSeedGenerator(const edm::ParameterSet &pset, double pTMin, const edm::InputTag &beamSpot)
recHitContainer::const_iterator const_iterator
std::pair< const_iterator, const_iterator > range
const GeometricSearchTracker * theGeomSearchTracker
std::vector< ElectronSeed > ElectronSeedCollection
collection of ElectronSeed objects
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
FastPixelHitMatcher * myGSPixelMatcher
void run(edm::Event &e, const reco::SuperClusterRefVector &sclRefs, const SiTrackerGSMatchedRecHit2DCollection *theGSRecHits, const edm::SimTrackContainer *theSimTracks, TrajectorySeedCollection *seeds, const TrackerTopology *tTopo, reco::ElectronSeedCollection &out)
std::vector< std::pair< ConstRecHitPointer, ConstRecHitPointer > > compatibleHits(const GlobalPoint &xmeas, const GlobalPoint &vprim, float energy, std::vector< TrajectorySeedHitCandidate > &theHits)
bool prepareElTrackSeed(ConstRecHitPointer outerhit, ConstRecHitPointer innerhit, const GlobalPoint &vertexPos)
TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
math::XYZPoint BSPosition_
unsigned int ringNumber() const
The Ring Number.
ESHandle< TrackerGeometry > geometry
const math::XYZTLorentzVectorD & momentum() const
size_type size() const
Size of the RefVector.
void setES(const MagneticFieldMap *aFieldMap, const TrackerGeometry *aTrackerGeometry, const GeometricSearchTracker *geomSearchTracker, const TrackerInteractionGeometry *interactionGeometry)
unsigned int layerNumber() const
The Layer Number.
std::vector< ID > ids() const
indentifier vector
const MagneticField * theMagField
~FastElectronSeedGenerator()
unsigned int subDetId() const
The subdet Id.
const edm::InputTag theBeamSpot
std::vector< SimTrack > SimTrackContainer
void set2ndLayer(float phimin, float phimax)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
tuple size
Write out results.
const TrackerGeometry * theTrackerGeometry