56 dynamicphiroad_(pset.getParameter<bool>(
"dynamicPhiRoad")),
57 lowPtThreshold_(pset.getParameter<double>(
"LowPtThreshold")),
58 highPtThreshold_(pset.getParameter<double>(
"HighPtThreshold")),
59 sizeWindowENeg_(pset.getParameter<double>(
"SizeWindowENeg")),
60 phimin2_(pset.getParameter<double>(
"PhiMin2")),
61 phimax2_(pset.getParameter<double>(
"PhiMax2")),
62 deltaPhi1Low_(pset.getParameter<double>(
"DeltaPhi1Low")),
63 deltaPhi1High_(pset.getParameter<double>(
"DeltaPhi1High")),
64 deltaPhi2_(pset.getParameter<double>(
"DeltaPhi2")),
67 fromTrackerSeeds_(pset.getParameter<bool>(
"fromTrackerSeeds")),
68 theUpdator(0), thePropagator(0),
71 theSetup(0), theBeamSpot(beamSpot)
157 double sigmaZ=recoBeamSpotHandle->sigmaZ();
158 double sigmaZ0Error=recoBeamSpotHandle->sigmaZ0Error();
159 double sq=
sqrt(sigmaZ*sigmaZ+sigmaZ0Error*sigmaZ0Error);
163 std::cout <<
"Z Range for pixel matcher : " << zmin1 <<
" " <<
BSPosition_.z() <<
" " << zmax1 << std::endl;
168 std::map<unsigned,std::vector<reco::ElectronSeed> > myPixelSeeds;
171 if(theGSRecHits->
size() == 0)
return;
176 const std::vector<unsigned> theSimTrackIds = theGSRecHits->
ids();
179 for (
unsigned tkId=0; tkId != theSimTrackIds.size(); ++tkId ) {
181 unsigned simTrackId = theSimTrackIds[tkId];
182 const SimTrack& theSimTrack = (*theSimTracks)[simTrackId];
188 unsigned numberOfRecHits = 0;
194 std::vector<unsigned> layerHit(6,static_cast<unsigned>(0));
197 std::vector<TrackerRecHit> theHits;
206 for ( iterRecHit = theRecHitRangeIteratorBegin;
207 iterRecHit != theRecHitRangeIteratorEnd;
212 if ( ( currentHit.
subDetId() <= 2 ) ||
221 theHits.push_back(currentHit);
225 if ( numberOfRecHits < 3 )
continue;
228 if ( theHits.size() < 2 )
continue;
232 unsigned csize = sclRefs.
size();
233 for (
unsigned int i=0;
i<csize;++
i) {
236 LogDebug (
"run") <<
"new cluster, calling addAseedFromThisCluster";
247 std::cout <<
"We have " << seeds->size() <<
" tracker seeds!" << std::endl;
249 for (
unsigned int i=0;
i<seeds->size();++
i) {
252 std::vector<TrackerRecHit> theHits;
259 for ( ; theSeedItr != theSeedRangeIteratorEnd; ++theSeedItr ) {
263 theHits.push_back(currentHit);
267 unsigned csize = sclRefs.
size();
268 for (
unsigned int i=0;
i<csize;++
i) {
272 std::cout <<
"new cluster, calling addAseedFromThisCluster" << std::endl;
285 std::map<unsigned,std::vector<reco::ElectronSeed> >::const_iterator px = myPixelSeeds.begin();
286 std::map<unsigned,std::vector<reco::ElectronSeed> >::const_iterator pxEnd = myPixelSeeds.end();
287 for ( ; px!=pxEnd; ++px ) {
288 unsigned nSeeds = (px->second).
size();
289 for (
unsigned ipx = 0; ipx<nSeeds; ++ipx ) {
290 out.push_back((px->second)[ipx]);
296 LogDebug (
"run") <<
"Nr of superclusters: "<<sclRefs.
size()
297 <<
", no. of ElectronSeeds found = " << out.size();
301 <<
", no. of ElectronSeeds found = " << out.size() << std::endl;
308 std::vector<TrackerRecHit>& theHits,
310 std::vector<reco::ElectronSeed>&
result)
313 float clusterEnergy = seedCluster->energy();
314 GlobalPoint clusterPos(seedCluster->position().x(),
315 seedCluster->position().y(),
316 seedCluster->position().z());
320 std::cout <<
"[FastElectronSeedGenerator::seedsFromThisCluster] "
321 <<
"new supercluster with energy: " << clusterEnergy << std::endl;
322 std::cout <<
"[FastElectronSeedGenerator::seedsFromThisCluster] "
323 <<
"and position: " << clusterPos << std::endl;
324 std::cout <<
"Vertex position : " << vertexPos << std::endl;
329 float clusterEnergyT = clusterEnergy*
sin(seedCluster->position().theta()) ;
331 float deltaPhi1 = 0.875/clusterEnergyT + 0.055;
353 std::vector<std::pair<ConstRecHitPointer,ConstRecHitPointer> > compatPixelHits =
361 if (!compatPixelHits.empty() ) {
363 std::cout <<
"[FastElectronSeedGenerator::seedsFromThisCluster] "
364 <<
" electron compatible hits found " << std::endl;
369 std::vector<std::pair<ConstRecHitPointer,ConstRecHitPointer> >::iterator
v;
370 for (v = compatPixelHits.begin(); v != compatPixelHits.end(); ++
v ) {
393 std::cout <<
"[FastElectronSeedGenerator::seedsFromThisCluster] "
394 <<
" No electron compatible hits found " << std::endl;
409 LogDebug(
"") <<
"[FastElectronSeedGenerator::prepareElTrackSeed] "
410 <<
"inner PixelHit x,y,z "<<innerhit->globalPosition();
411 LogDebug(
"") <<
"[FastElectronSeedGenerator::prepareElTrackSeed] "
412 <<
"outer PixelHit x,y,z "<<outerhit->globalPosition();
417 float nomField = bfield->nominalValue();
420 FastHelix helix(outerhit->globalPosition(),innerhit->globalPosition(),vertexPos,nomField,&*bfield);
421 if ( !helix.isValid())
return false;
427 fts.setCurvilinearError(errorMatrix*100.);
430 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
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
unsigned int ringNumber() const
The Ring Number.
void set1stLayer(float ephimin, float ephimax, float pphimin, float pphimax)
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)
std::vector< std::pair< ConstRecHitPointer, ConstRecHitPointer > > compatibleHits(const GlobalPoint &xmeas, const GlobalPoint &vprim, float energy, std::vector< TrackerRecHit > &theHits)
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 addASeedToThisCluster(edm::Ref< reco::SuperClusterCollection > seedCluster, std::vector< TrackerRecHit > &theHits, const TrajectorySeed &theTrackerSeed, std::vector< reco::ElectronSeed > &result)
void run(edm::Event &e, const reco::SuperClusterRefVector &sclRefs, const SiTrackerGSMatchedRecHit2DCollection *theGSRecHits, const edm::SimTrackContainer *theSimTracks, TrajectorySeedCollection *seeds, const TrackerTopology *tTopo, reco::ElectronSeedCollection &out)
bool prepareElTrackSeed(ConstRecHitPointer outerhit, ConstRecHitPointer innerhit, const GlobalPoint &vertexPos)
TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
math::XYZPoint BSPosition_
unsigned int layerNumber() const
The Layer Number.
return(e1-e2)*(e1-e2)+dp *dp
ESHandle< TrackerGeometry > geometry
const math::XYZTLorentzVectorD & momentum() const
particle info...
unsigned int subDetId() const
The subdet Id.
size_type size() const
Size of the RefVector.
void setES(const MagneticFieldMap *aFieldMap, const TrackerGeometry *aTrackerGeometry, const GeometricSearchTracker *geomSearchTracker, const TrackerInteractionGeometry *interactionGeometry)
std::vector< ID > ids() const
indentifier vector
const MagneticField * theMagField
~FastElectronSeedGenerator()
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