55 produces<ConvBremSeedCollection>();
61 LogDebug(
"ConvBremSeedProducerProducer") <<
"START event: " << iEvent.
id().
event() <<
" in run " << iEvent.
id().
run();
63 float pfmass = 0.0005;
90 auto output = std::make_unique<ConvBremSeedCollection>();
93 vector<pair<TrajectorySeed, pair<GlobalVector, float> > > unclean;
95 vector<vector<long int> > tripl;
101 for (
unsigned int ipft = 0; ipft < PfRTkColl.size(); ipft++) {
103 LogDebug(
"ConvBremSeedProducerProducer") <<
"NEW GsfPFRecTRACK ";
108 auto const& gsfRecHits = *pft->gsfTrackRef();
109 float pfoutenergy =
sqrt((pfmass * pfmass) + pft->gsfTrackRef()->outerMomentum().Mag2());
111 pft->gsfTrackRef()->outerMomentum().y(),
112 pft->gsfTrackRef()->outerMomentum().z(),
115 pft->gsfTrackRef()->outerPosition().y(),
116 pft->gsfTrackRef()->outerPosition().z(),
122 gc.push_back(
GoodCluster(theOutParticle, PPP, 0.5));
124 vector<PFBrem> brem = (*pft).PFRecBrem();
125 vector<PFBrem>::iterator
ib = brem.begin();
126 vector<PFBrem>::iterator ib_end = brem.end();
127 LogDebug(
"ConvBremSeedProducerProducer") <<
"NUMBER OF BREMS " << brem.size();
130 for (; ib != ib_end; ++
ib) {
133 pft->trajectoryPoint(ib->indTrajPoint()).
position().y(),
134 pft->trajectoryPoint(ib->indTrajPoint()).
position().z(),
140 if ((pos.Rho() > 5) && (fabs(ib->SigmaDeltaP() / ib->DeltaP()) > 3))
142 if (fabs(ib->DeltaP()) < 3)
145 vector<vector<long int> > Idd;
156 if (!(cyliter->sensitive()))
168 if (&(*tkLayer) ==
nullptr)
172 std::vector<DetWithState> compat = tkLayer->
compatibleDets(trajState, alongProp, est);
173 vector<long int>
temp;
177 for (std::vector<DetWithState>::const_iterator
i = compat.begin();
i != compat.end();
i++) {
178 long int detid =
i->first->geographicalId().rawId();
184 long int DetID = (DetMatch != rphirecHits->
end()) ? detid : 0;
186 if ((MDetMatch != matchedrecHits->
end()) && !MDetMatch->empty()) {
187 long int pii = MDetMatch->begin()->monoId();
189 DetID = (CDetMatch != rphirecHits->
end()) ? pii : 0;
192 temp.push_back(DetID);
196 long int DetID = (DetMatch != pixelHits->
end()) ? detid : 0;
197 temp.push_back(DetID);
208 for (
unsigned int i = 0;
i < Idd.size() - 2;
i++) {
209 for (
unsigned int i1 = 0;
i1 < Idd[
i].size();
i1++) {
210 for (
unsigned int i2 = 0;
i2 < Idd[
i + 1].size();
i2++) {
211 for (
unsigned int i3 = 0;
i3 < Idd[
i + 2].size();
i3++) {
212 if ((Idd[
i][
i1] != 0) && (Idd[
i + 1][
i2] != 0) && (Idd[
i + 2][
i3] != 0)) {
213 vector<long int>
tmp;
214 tmp.push_back(Idd[
i][
i1]);
215 tmp.push_back(Idd[
i + 1][
i2]);
216 tmp.push_back(Idd[
i + 2][
i3]);
219 for (
unsigned int iv = 0; iv < tripl.size(); iv++) {
220 if ((tripl[iv][0] == tmp[0]) && (tripl[iv][1] == tmp[1]) && (tripl[iv][2] == tmp[2]))
224 tripl.push_back(tmp);
233 float sineta_brem = sinh(eta_br);
242 for (
unsigned int i = 0;
i < tripl.size();
i++) {
246 if ((DetMatch1 == rphirecHits->
end()) || (DetMatch2 == rphirecHits->
end()) || (DetMatch3 == rphirecHits->
end()))
266 FastHelix helix(gp3, gp2, gp1, nomField, &*bfield);
269 float ene =
sqrt(gv_corr.mag2() + (pfmass * pfmass));
277 int bgc =
GoodCluster(theOutParticle, PPP, 0.3,
true);
282 if (tak1 + tak2 + tak3 > 2)
288 for (
unsigned int igcc = 0; igcc < gc.size(); igcc++) {
309 for (
int ih = 0; ih < 3; ih++) {
334 for (
unsigned int iu = 0; iu < unclean.size(); iu++) {
340 LogDebug(
"ConvBremSeedProducerProducer") <<
"END";
392 LogDebug(
"FastTracker") <<
"Barrel DetLayer dump: ";
393 for (
auto bl = barrelLayers.begin(); bl != barrelLayers.end(); ++bl) {
394 LogDebug(
"FastTracker") <<
"radius " << (**bl).specificSurface().radius();
398 LogDebug(
"FastTracker") <<
"Positive Forward DetLayer dump: ";
399 for (
auto fl = posForwardLayers.begin(); fl != posForwardLayers.end(); ++fl) {
400 LogDebug(
"FastTracker") <<
"Z pos " << (**fl).surface().position().z() <<
" radii " 401 << (**fl).specificSurface().innerRadius() <<
", " << (**fl).specificSurface().outerRadius();
404 const float rTolerance = 1.5;
405 const float zTolerance = 3.;
407 LogDebug(
"FastTracker") <<
"Dump of TrackerInteractionGeometry cylinders:";
412 LogDebug(
"FastTracker") <<
"Famos Layer no " <<
i->layerNumber() <<
" is sensitive? " <<
i->sensitive() <<
" pos " 413 <<
i->surface().position();
417 if (cyl !=
nullptr) {
418 LogDebug(
"FastTracker") <<
" cylinder radius " << cyl->radius();
421 for (
auto bl = barrelLayers.begin(); bl != barrelLayers.end(); ++bl) {
422 if (fabs(cyl->radius() - (**bl).specificSurface().radius()) < rTolerance) {
425 LogDebug(
"FastTracker") <<
"Corresponding DetLayer found with radius " << (**bl).specificSurface().radius();
431 LogError(
"FastTracker") <<
"FAILED to find a corresponding DetLayer!";
434 LogDebug(
"FastTracker") <<
" disk radii " << disk->innerRadius() <<
", " << disk->outerRadius();
438 for (
auto fl = posForwardLayers.begin(); fl != posForwardLayers.end(); ++fl) {
439 if (fabs(disk->position().z() - (**fl).surface().position().z()) < zTolerance) {
442 LogDebug(
"FastTracker") <<
"Corresponding DetLayer found with Z pos " << (**fl).surface().position().z()
443 <<
" and radii " << (**fl).specificSurface().innerRadius() <<
", " 444 << (**fl).specificSurface().outerRadius();
449 LogError(
"FastTracker") <<
"FAILED to find a corresponding DetLayer!";
455 if (zpos > 0 || !layer.
forward())
473 bool istaken =
false;
475 if (istaken || !
hit->isValid())
482 vector<bool> goodseed;
484 if (unclean.size() < 2) {
485 for (
unsigned int i = 0;
i < unclean.size();
i++)
486 goodseed.push_back(
true);
488 for (
unsigned int i = 0;
i < unclean.size();
i++)
489 goodseed.push_back(
true);
491 for (
unsigned int iu = 0; iu < unclean.size() - 1; iu++) {
494 for (
unsigned int iu2 = iu + 1; iu2 < unclean.size(); iu2++) {
504 unsigned int shar = 0;
505 for (; sh != sh_end; ++sh) {
508 for (; sh2 != sh2_end; ++sh2) {
515 if (unclean[iu].
second.first.perp() < unclean[iu2].second.first.perp())
516 goodseed[iu] =
false;
518 goodseed[iu2] =
false;
538 for (
unsigned int i = 0;
i < pfc.size();
i++) {
544 float tmp_dr =
sqrt(
pow(tmp_phi, 2) +
pow(tmp_eta, 2));
545 bool isBet = (tmp_dr <
dr);
547 isBet = (tmp_phi < df);
548 if ((isBet) && (tmp_ep > minep) && (tmp_ep < 10)) {
555 bool isBad = (dr > 0.1);
557 isBad = ((df > 0.25) || (de > 0.5));
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
const MagneticField * magfield_
T getParameter(std::string const &) const
EventNumber_t event() const
const GeometricSearchTracker * geomSearchTracker_
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const TransientTrackingRecHitBuilder * hitBuilder_
~ConvBremSeedProducer() override
ConvBremSeedProducer(const edm::ParameterSet &)
const_iterator end(bool update=false) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
virtual ConstReferenceCountingPointer< TangentPlane > tangentPlane(const GlobalPoint &) const =0
SiStripMatchedRecHit2DCollection::const_iterator MatDetMatch
std::vector< ForwardDetLayer const * > const & posForwardLayers() const
unsigned int layerNumber() const
Returns the layer number.
int nominalValue() const
The nominal field value for this map in kGauss.
bool forward() const
Is the layer forward ?
ROOT::Math::SMatrixIdentity AlgebraicMatrixID
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
Global3DPoint GlobalPoint
const PropagatorWithMaterial * propagator_
std::list< TrackerLayer >::const_iterator cylinderEnd() const
Returns the last pointer in the cylinder list.
int getSuccess() const
Has propagation been performed and was barrel or endcap reached ?
TrajectoryStateOnSurface makeTrajectoryState(const DetLayer *layer, const ParticlePropagator &pp, const MagneticField *field) const
data_type const * const_iterator
RawParticle const & particle() const
The particle being propagated.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const Plane & surface() const
The nominal surface of the GeomDet.
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
SiPixelRecHitCollection::const_iterator PiDetMatch
const KFUpdator * kfUpdator_
const TrackerInteractionGeometry * geometry_
const MagneticFieldMap * fieldMap_
U second(std::pair< T, U > const &p)
bool isGsfTrack(const reco::Track &, const TrackingRecHit *)
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const override
const XYZTLorentzVector & momentum() const
the momentum fourvector
math::XYZVector B_
B field.
std::vector< GsfPFRecTrack > GsfPFRecTrackCollection
collection of GsfPFRecTrack objects
void produce(edm::Event &, const edm::EventSetup &) override
recHitContainer::const_iterator const_iterator
GlobalVector momentum() const
double Y() const
y of vertex
double Py() const
y of the momentum
double Z() const
z of vertex
auto recHits() const
Access to reconstructed hits on the track.
void setPropagationConditions(const TrackerLayer &, bool firstLoop=true)
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
double Pz() const
z of the momentum
double charge() const
get the MEASURED charge
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
bool propagateToEcalEntrance(bool first=true)
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
std::vector< const DetLayer * > layerMap_
GlobalPoint position() const
std::vector< ConstRecHitPointer > ConstRecHitContainer
const XYZTLorentzVector & vertex() const
the vertex fourvector
std::vector< bool > sharedHits(const std::vector< std::pair< TrajectorySeed, std::pair< GlobalVector, float > > > &)
T const * product() const
const DetLayer * detLayer(const TrackerLayer &layer, float zpos) const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
std::list< TrackerLayer >::const_iterator cylinderBegin() const
Returns the first pointer in the cylinder list.
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
void beginRun(const edm::Run &, const edm::EventSetup &) override
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
double X() const
x of vertex
void endRun(const edm::Run &, const edm::EventSetup &) override
double getMagneticField() const
Get the magnetic field.
static int position[264][3]
double Px() const
x of the momentum
SiStripRecHit2DCollection::const_iterator StDetMatch
const TrackerGeomDet * idToDet(DetId) const override
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
GlobalTrajectoryParameters stateAtVertex() const
int GoodCluster(const BaseParticlePropagator &bpg, const reco::PFClusterCollection &pfc, float minep, bool sec=false)
const TrackerGeometry * tracker_
TrackCharge charge() const
void initializeLayerMap()
T const * product() const
Power< A, B >::type pow(const A &a, const B &b)
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
math::XYZTLorentzVector XYZTLorentzVector
std::vector< BarrelDetLayer const * > const & barrelLayers() const