CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
ConvBremSeedProducer Class Reference
Inheritance diagram for ConvBremSeedProducer:
edm::stream::EDProducer<>

Public Member Functions

 ConvBremSeedProducer (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
const DetLayerdetLayer (const TrackerLayer &layer, float zpos) const
 
void endRun (const edm::Run &, const edm::EventSetup &) override
 
int GoodCluster (const BaseParticlePropagator &bpg, const reco::PFClusterCollection &pfc, float minep, bool sec=false)
 
void initializeLayerMap ()
 
bool isGsfTrack (const reco::Track &, const TrackingRecHit *)
 
TrajectoryStateOnSurface makeTrajectoryState (const DetLayer *layer, const ParticlePropagator &pp, const MagneticField *field) const
 
void produce (edm::Event &, const edm::EventSetup &) override
 
std::vector< bool > sharedHits (const std::vector< std::pair< TrajectorySeed, std::pair< GlobalVector, float > > > &)
 

Private Attributes

math::XYZVector B_
 B field. More...
 
edm::ParameterSet conf_
 
const MagneticFieldMapfieldMap_
 
const TrackerInteractionGeometrygeometry_
 
const GeometricSearchTrackergeomSearchTracker_
 
const TransientTrackingRecHitBuilderhitBuilder_
 
const KFUpdatorkfUpdator_
 
std::vector< const DetLayer * > layerMap_
 
const MagneticFieldmagfield_
 
int negLayerOffset_
 
const PropagatorWithMaterialpropagator_
 
std::vector< const DetLayer * > theLayerMap
 
const TrackerGeometrytracker_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 54 of file ConvBremSeedProducer.cc.

Constructor & Destructor Documentation

◆ ConvBremSeedProducer()

ConvBremSeedProducer::ConvBremSeedProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 113 of file ConvBremSeedProducer.cc.

114  : conf_(iConfig), fieldMap_(nullptr), layerMap_(56, static_cast<const DetLayer*>(nullptr)), negLayerOffset_(27) {
115  produces<ConvBremSeedCollection>();
116 }

Member Function Documentation

◆ beginRun()

void ConvBremSeedProducer::beginRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 400 of file ConvBremSeedProducer.cc.

400  {
403  geomSearchTracker_ = track.product();
404 
405  ESHandle<TrackerInteractionGeometry> theTrackerInteractionGeometry;
406  iSetup.get<TrackerInteractionGeometryRecord>().get(theTrackerInteractionGeometry);
407  geometry_ = theTrackerInteractionGeometry.product();
408 
411  tracker_ = tracker.product();
412 
415  magfield_ = magfield.product();
416  B_ = magfield_->inTesla(GlobalPoint(0, 0, 0));
417 
419  iSetup.get<MagneticFieldMapRecord>().get(fieldMap);
420  fieldMap_ = fieldMap.product();
421 
423  iSetup.get<TransientRecHitRecord>().get(conf_.getParameter<string>("TTRHBuilder"), hitBuilder);
424  hitBuilder_ = hitBuilder.product();
425 
427  kfUpdator_ = new KFUpdator();
428 }

References alongMomentum, B_, conf_, fieldMap_, geometry_, geomSearchTracker_, edm::EventSetup::get(), get, edm::ParameterSet::getParameter(), hitBuilder_, MagneticField::inTesla(), kfUpdator_, volumeBasedMagneticField_160812_cfi::magfield, magfield_, edm::ESHandle< T >::product(), propagator_, HLT_FULL_cff::track, PbPb_ZMuSkimMuonDPG_cff::tracker, and tracker_.

◆ detLayer()

const DetLayer * ConvBremSeedProducer::detLayer ( const TrackerLayer layer,
float  zpos 
) const
private

Definition at line 510 of file ConvBremSeedProducer.cc.

510  {
511  if (zpos > 0 || !layer.forward())
512  return layerMap_[layer.layerNumber()];
513  else
514  return layerMap_[layer.layerNumber() + negLayerOffset_];
515 }

References phase1PixelTopology::layer, layerMap_, and negLayerOffset_.

Referenced by produce().

◆ endRun()

void ConvBremSeedProducer::endRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 430 of file ConvBremSeedProducer.cc.

430  {
431  delete propagator_;
432  delete kfUpdator_;
433 }

References kfUpdator_, and propagator_.

◆ fillDescriptions()

void ConvBremSeedProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 98 of file ConvBremSeedProducer.cc.

98  {
99  // convBremSeeds
101  desc.add<edm::InputTag>("pixelRecHits", edm::InputTag("gsPixelRecHits"));
102  desc.add<edm::InputTag>("matchedrecHits", edm::InputTag("gsStripRecHits", "matchedRecHit"));
103  desc.add<std::string>("TTRHBuilder", "WithTrackAngle");
104  desc.add<edm::InputTag>("rphirecHits", edm::InputTag("gsStripRecHits", "rphiRecHit"));
105  desc.add<edm::InputTag>("PFClusters", edm::InputTag("particleFlowClusterECAL"));
106  desc.add<edm::InputTag>("PFRecTrackLabel", edm::InputTag("pfTrackElec"));
107 }

References submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ GoodCluster()

int ConvBremSeedProducer::GoodCluster ( const BaseParticlePropagator bpg,
const reco::PFClusterCollection pfc,
float  minep,
bool  sec = false 
)
private

Definition at line 577 of file ConvBremSeedProducer.cc.

580  {
581  BaseParticlePropagator bpg = ubpg;
582  bpg.propagateToEcalEntrance(false);
583  float dr = 1000;
584  float de = 1000;
585  float df = 1000;
586  int ibest = -1;
587 
588  if (bpg.getSuccess() != 0) {
589  for (unsigned int i = 0; i < pfc.size(); i++) {
590  float tmp_ep = pfc[i].energy() / bpg.particle().momentum().e();
591  float tmp_phi = fabs(pfc[i].position().phi() - bpg.particle().vertex().phi());
592  if (tmp_phi > TMath::TwoPi())
593  tmp_phi -= TMath::TwoPi();
594  float tmp_eta = fabs(pfc[i].position().eta() - bpg.particle().vertex().eta());
595  float tmp_dr = sqrt(pow(tmp_phi, 2) + pow(tmp_eta, 2));
596  bool isBet = (tmp_dr < dr);
597  if (sec)
598  isBet = (tmp_phi < df);
599  if ((isBet) && (tmp_ep > minep) && (tmp_ep < 10)) {
600  dr = tmp_dr;
601  de = tmp_eta;
602  df = tmp_phi;
603  ibest = i;
604  }
605  }
606  bool isBad = (dr > 0.1);
607  if (sec)
608  isBad = ((df > 0.25) || (de > 0.5));
609 
610  if (isBad)
611  ibest = -1;
612  }
613  return ibest;
614 }

References hgcalPerformanceValidation::df, flavorHistoryFilter_cfi::dr, PVValHelper::eta, BaseParticlePropagator::getSuccess(), mps_fire::i, RawParticle::momentum(), BaseParticlePropagator::particle(), phi, position, funct::pow(), BaseParticlePropagator::propagateToEcalEntrance(), fileinputsource_cfi::sec, mathSSE::sqrt(), TwoPi, and RawParticle::vertex().

Referenced by produce().

◆ initializeLayerMap()

void ConvBremSeedProducer::initializeLayerMap ( )
private

ATTENTION: HARD CODED LOGIC! If Famos layer numbering changes this logic needs to be adapted to the new numbering!

Definition at line 435 of file ConvBremSeedProducer.cc.

435  {
436  // These are the BoundSurface&, the BoundDisk* and the BoundCylinder* for that layer
437  // const BoundSurface& theSurface = layer.surface();
438  // BoundDisk* theDisk = layer.disk(); // non zero for endcaps
439  // BoundCylinder* theCylinder = layer.cylinder(); // non zero for barrel
440  // int theLayer = layer.layerNumber(); // 1->3 PixB, 4->5 PixD,
441  // // 6->9 TIB, 10->12 TID,
442  // // 13->18 TOB, 19->27 TEC
443 
446 
447  const std::vector<const BarrelDetLayer*>& barrelLayers = geomSearchTracker_->barrelLayers();
448  LogDebug("FastTracker") << "Barrel DetLayer dump: ";
449  for (auto bl = barrelLayers.begin(); bl != barrelLayers.end(); ++bl) {
450  LogDebug("FastTracker") << "radius " << (**bl).specificSurface().radius();
451  }
452 
453  const std::vector<const ForwardDetLayer*>& posForwardLayers = geomSearchTracker_->posForwardLayers();
454  LogDebug("FastTracker") << "Positive Forward DetLayer dump: ";
455  for (auto fl = posForwardLayers.begin(); fl != posForwardLayers.end(); ++fl) {
456  LogDebug("FastTracker") << "Z pos " << (**fl).surface().position().z() << " radii "
457  << (**fl).specificSurface().innerRadius() << ", " << (**fl).specificSurface().outerRadius();
458  }
459 
460  const float rTolerance = 1.5;
461  const float zTolerance = 3.;
462 
463  LogDebug("FastTracker") << "Dump of TrackerInteractionGeometry cylinders:";
464  for (std::list<TrackerLayer>::const_iterator i = geometry_->cylinderBegin(); i != geometry_->cylinderEnd(); ++i) {
465  const BoundCylinder* cyl = i->cylinder();
466  const BoundDisk* disk = i->disk();
467 
468  LogDebug("FastTracker") << "Famos Layer no " << i->layerNumber() << " is sensitive? " << i->sensitive() << " pos "
469  << i->surface().position();
470  if (!i->sensitive())
471  continue;
472 
473  if (cyl != nullptr) {
474  LogDebug("FastTracker") << " cylinder radius " << cyl->radius();
475  bool found = false;
476 
477  for (auto bl = barrelLayers.begin(); bl != barrelLayers.end(); ++bl) {
478  if (fabs(cyl->radius() - (**bl).specificSurface().radius()) < rTolerance) {
479  layerMap_[i->layerNumber()] = *bl;
480  found = true;
481  LogDebug("FastTracker") << "Corresponding DetLayer found with radius " << (**bl).specificSurface().radius();
482 
483  break;
484  }
485  }
486  if (!found) {
487  LogError("FastTracker") << "FAILED to find a corresponding DetLayer!";
488  }
489  } else {
490  LogDebug("FastTracker") << " disk radii " << disk->innerRadius() << ", " << disk->outerRadius();
491 
492  bool found = false;
493 
494  for (auto fl = posForwardLayers.begin(); fl != posForwardLayers.end(); ++fl) {
495  if (fabs(disk->position().z() - (**fl).surface().position().z()) < zTolerance) {
496  layerMap_[i->layerNumber()] = *fl;
497  found = true;
498  LogDebug("FastTracker") << "Corresponding DetLayer found with Z pos " << (**fl).surface().position().z()
499  << " and radii " << (**fl).specificSurface().innerRadius() << ", "
500  << (**fl).specificSurface().outerRadius();
501  break;
502  }
503  }
504  if (!found) {
505  LogError("FastTracker") << "FAILED to find a corresponding DetLayer!";
506  }
507  }
508  }
509 }

References GeometricSearchTracker::barrelLayers(), TrackerInteractionGeometry::cylinderBegin(), TrackerInteractionGeometry::cylinderEnd(), newFWLiteAna::found, geometry_, geomSearchTracker_, mps_fire::i, layerMap_, LogDebug, and GeometricSearchTracker::posForwardLayers().

Referenced by produce().

◆ isGsfTrack()

bool ConvBremSeedProducer::isGsfTrack ( const reco::Track tkv,
const TrackingRecHit h 
)
private

Definition at line 528 of file ConvBremSeedProducer.cc.

528  {
529  bool istaken = false;
530  for (auto const& hit : tkv.recHits()) {
531  if (istaken || !hit->isValid())
532  continue;
533  istaken = hit->sharesInput(h, TrackingRecHit::all);
534  }
535  return istaken;
536 }

References TrackingRecHit::all, and reco::Track::recHits().

Referenced by produce().

◆ makeTrajectoryState()

TrajectoryStateOnSurface ConvBremSeedProducer::makeTrajectoryState ( const DetLayer layer,
const ParticlePropagator pp,
const MagneticField field 
) const
private

Definition at line 517 of file ConvBremSeedProducer.cc.

519  {
520  GlobalPoint pos(pp.particle().X(), pp.particle().Y(), pp.particle().Z());
521  GlobalVector mom(pp.particle().Px(), pp.particle().Py(), pp.particle().Pz());
522 
523  auto plane = layer->surface().tangentPlane(pos);
524 
525  return TrajectoryStateOnSurface(GlobalTrajectoryParameters(pos, mom, TrackCharge(pp.particle().charge()), field),
526  *plane);
527 }

References phase1PixelTopology::layer, and createTree::pp.

Referenced by produce().

◆ produce()

void ConvBremSeedProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

INPUT COLLECTIONS

PF CLUSTERS

PIXEL

STRIP

OUTPUT COLLECTION

INITIALIZE

LOOP OVER GSF TRACK COLLECTION

FIND THE CLUSTER ASSOCIATED TO THE GSF TRACK

LOOP OVER BREM PHOTONS

BREM SELECTION

LOOP OVER TRACKER LAYER

TRACKER LAYER SELECTION

FIND COMPATIBLE MODULES

MODULE TRIPLETS SELECTION

SEED CREATION

Definition at line 118 of file ConvBremSeedProducer.cc.

118  {
119  LogDebug("ConvBremSeedProducerProducer") << "START event: " << iEvent.id().event() << " in run " << iEvent.id().run();
120 
121  constexpr float pfmass = 0.0005;
122 
124 
127  iEvent.getByLabel(conf_.getParameter<InputTag>("PFClusters"), PfC);
128  const PFClusterCollection& PPP = *(PfC.product());
129 
132  iEvent.getByLabel(conf_.getParameter<InputTag>("pixelRecHits"), pixelHits);
133 
136  iEvent.getByLabel(conf_.getParameter<InputTag>("rphirecHits"), rphirecHits);
138  iEvent.getByLabel(conf_.getParameter<InputTag>("matchedrecHits"), matchedrecHits);
139 
140  //GSFPFRECTRACKS
141  Handle<GsfPFRecTrackCollection> thePfRecTrackCollection;
142  iEvent.getByLabel(conf_.getParameter<InputTag>("PFRecTrackLabel"), thePfRecTrackCollection);
143  const GsfPFRecTrackCollection PfRTkColl = *(thePfRecTrackCollection.product());
144 
146  auto output = std::make_unique<ConvBremSeedCollection>();
147 
149  vector<pair<TrajectorySeed, pair<GlobalVector, float> > > unclean;
150  //TRIPLET OF MODULES TO BE USED FOR SEEDING
151  vector<vector<long int> > tripl;
152  //LAYER MAP
154 
156 
157  for (unsigned int ipft = 0; ipft < PfRTkColl.size(); ipft++) {
158  GsfPFRecTrackRef pft(thePfRecTrackCollection, ipft);
159  LogDebug("ConvBremSeedProducerProducer") << "NEW GsfPFRecTRACK ";
160  float eta_br = 0;
161  unclean.clear();
162  tripl.clear();
163  vector<int> gc;
164  auto const& gsfRecHits = *pft->gsfTrackRef();
165  float pfoutenergy = sqrt((pfmass * pfmass) + pft->gsfTrackRef()->outerMomentum().Mag2());
166  XYZTLorentzVector mom = XYZTLorentzVector(pft->gsfTrackRef()->outerMomentum().x(),
167  pft->gsfTrackRef()->outerMomentum().y(),
168  pft->gsfTrackRef()->outerMomentum().z(),
169  pfoutenergy);
170  XYZTLorentzVector pos = XYZTLorentzVector(pft->gsfTrackRef()->outerPosition().x(),
171  pft->gsfTrackRef()->outerPosition().y(),
172  pft->gsfTrackRef()->outerPosition().z(),
173  0.);
174  BaseParticlePropagator theOutParticle =
175  BaseParticlePropagator(RawParticle(mom, pos, pft->gsfTrackRef()->charge()), 0, 0, B_.z());
176 
178  gc.push_back(GoodCluster(theOutParticle, PPP, 0.5));
179 
180  vector<PFBrem> brem = (*pft).PFRecBrem();
181  vector<PFBrem>::iterator ib = brem.begin();
182  vector<PFBrem>::iterator ib_end = brem.end();
183  LogDebug("ConvBremSeedProducerProducer") << "NUMBER OF BREMS " << brem.size();
184 
186  for (; ib != ib_end; ++ib) {
187  XYZTLorentzVector mom = pft->trajectoryPoint(ib->indTrajPoint()).momentum();
188  XYZTLorentzVector pos = XYZTLorentzVector(pft->trajectoryPoint(ib->indTrajPoint()).position().x(),
189  pft->trajectoryPoint(ib->indTrajPoint()).position().y(),
190  pft->trajectoryPoint(ib->indTrajPoint()).position().z(),
191  0);
192 
194  if (pos.Rho() > 80)
195  continue;
196  if ((pos.Rho() > 5) && (fabs(ib->SigmaDeltaP() / ib->DeltaP()) > 3))
197  continue;
198  if (fabs(ib->DeltaP()) < 3)
199  continue;
200  eta_br = mom.eta();
201  vector<vector<long int> > Idd;
202 
203  BaseParticlePropagator p(RawParticle(mom, pos, 0.), 0, 0, B_.z());
204  gc.push_back(GoodCluster(p, PPP, 0.2));
205 
206  ParticlePropagator PP(p, fieldMap_, nullptr);
207 
209  list<TrackerLayer>::const_iterator cyliter = geometry_->cylinderBegin();
210  for (; cyliter != geometry_->cylinderEnd(); ++cyliter) {
212  if (!(cyliter->sensitive()))
213  continue;
214  PP.setPropagationConditions(*cyliter);
215  PP.propagate();
216  if (PP.getSuccess() == 0)
217  continue;
218 
220  LocalMagneticField mf(PP.getMagneticField());
221  AnalyticalPropagator alongProp(&mf, anyDirection);
223  const DetLayer* tkLayer = detLayer(*cyliter, PP.particle().Z());
224  if (&(*tkLayer) == nullptr)
225  continue;
226  TrajectoryStateOnSurface trajState = makeTrajectoryState(tkLayer, PP, &mf);
227 
228  auto compat = tkLayer->compatibleDets(trajState, alongProp, est);
229  vector<long int> temp;
230  if (compat.empty())
231  continue;
232 
233  for (auto i = compat.begin(); i != compat.end(); i++) {
234  long int detid = i->first->geographicalId().rawId();
235 
237  auto DetMatch = (rphirecHits.product())->find((detid));
238  auto MDetMatch = (matchedrecHits.product())->find((detid));
239 
240  long int DetID = (DetMatch != rphirecHits->end()) ? detid : 0;
241 
242  if ((MDetMatch != matchedrecHits->end()) && !MDetMatch->empty()) {
243  long int pii = MDetMatch->begin()->monoId();
244  auto CDetMatch = (rphirecHits.product())->find((pii));
245  DetID = (CDetMatch != rphirecHits->end()) ? pii : 0;
246  }
247 
248  temp.push_back(DetID);
249 
250  } else {
251  auto DetMatch = (pixelHits.product())->find((detid));
252  long int DetID = (DetMatch != pixelHits->end()) ? detid : 0;
253  temp.push_back(DetID);
254  }
255  }
256 
257  Idd.push_back(temp);
258 
259  } //END TRACKER LAYER LOOP
260  if (Idd.size() < 2)
261  continue;
262 
264  for (unsigned int i = 0; i < Idd.size() - 2; i++) {
265  for (unsigned int i1 = 0; i1 < Idd[i].size(); i1++) {
266  for (unsigned int i2 = 0; i2 < Idd[i + 1].size(); i2++) {
267  for (unsigned int i3 = 0; i3 < Idd[i + 2].size(); i3++) {
268  if ((Idd[i][i1] != 0) && (Idd[i + 1][i2] != 0) && (Idd[i + 2][i3] != 0)) {
269  vector<long int> tmp;
270  tmp.push_back(Idd[i][i1]);
271  tmp.push_back(Idd[i + 1][i2]);
272  tmp.push_back(Idd[i + 2][i3]);
273 
274  bool newTrip = true;
275  for (unsigned int iv = 0; iv < tripl.size(); iv++) {
276  if ((tripl[iv][0] == tmp[0]) && (tripl[iv][1] == tmp[1]) && (tripl[iv][2] == tmp[2]))
277  newTrip = false;
278  }
279  if (newTrip) {
280  tripl.push_back(tmp);
281  }
282  }
283  }
284  }
285  }
286  }
287  } //END BREM LOOP
288 
289  float sineta_brem = sinh(eta_br);
290 
291  //OUTPUT COLLECTION
293  iSetup.get<IdealMagneticFieldRecord>().get(bfield);
294  float nomField = bfield->nominalValue();
295 
297  OwnVector<TrackingRecHit> loc_hits;
298  for (unsigned int i = 0; i < tripl.size(); i++) {
299  auto DetMatch1 = (rphirecHits.product())->find(tripl[i][0]);
300  auto DetMatch2 = (rphirecHits.product())->find(tripl[i][1]);
301  auto DetMatch3 = (rphirecHits.product())->find(tripl[i][2]);
302  if ((DetMatch1 == rphirecHits->end()) || (DetMatch2 == rphirecHits->end()) || (DetMatch3 == rphirecHits->end()))
303  continue;
304  auto DetSet1 = *DetMatch1;
305  auto DetSet2 = *DetMatch2;
306  auto DetSet3 = *DetMatch3;
307 
308  for (auto it1 = DetSet1.begin(); it1 != DetSet1.end(); ++it1) {
309  GlobalPoint gp1 = tracker_->idToDet(tripl[i][0])->surface().toGlobal(it1->localPosition());
310 
311  bool tak1 = isGsfTrack(gsfRecHits, &(*it1));
312 
313  for (auto it2 = DetSet2.begin(); it2 != DetSet2.end(); ++it2) {
314  GlobalPoint gp2 = tracker_->idToDet(tripl[i][1])->surface().toGlobal(it2->localPosition());
315  bool tak2 = isGsfTrack(gsfRecHits, &(*it2));
316 
317  for (auto it3 = DetSet3.begin(); it3 != DetSet3.end(); ++it3) {
318  // ips++;
319  GlobalPoint gp3 = tracker_->idToDet(tripl[i][2])->surface().toGlobal(it3->localPosition());
320  bool tak3 = isGsfTrack(gsfRecHits, &(*it3));
321 
322  FastHelix helix(gp3, gp2, gp1, nomField, &*bfield);
323  GlobalVector gv = helix.stateAtVertex().momentum();
324  GlobalVector gv_corr(gv.x(), gv.y(), gv.perp() * sineta_brem);
325  float ene = sqrt(gv_corr.mag2() + (pfmass * pfmass));
326 
327  GlobalPoint gp = helix.stateAtVertex().position();
328  float ch = helix.stateAtVertex().charge();
329 
330  XYZTLorentzVector mom = XYZTLorentzVector(gv.x(), gv.y(), gv_corr.z(), ene);
331  XYZTLorentzVector pos = XYZTLorentzVector(gp.x(), gp.y(), gp.z(), 0.);
332  BaseParticlePropagator theOutParticle(RawParticle(mom, pos, ch), 0, 0, B_.z());
333  int bgc = GoodCluster(theOutParticle, PPP, 0.3, true);
334 
335  if (gv.perp() < 0.5)
336  continue;
337 
338  if (tak1 + tak2 + tak3 > 2)
339  continue;
340 
341  if (bgc == -1)
342  continue;
343  bool clTak = false;
344  for (unsigned int igcc = 0; igcc < gc.size(); igcc++) {
345  if (clTak)
346  continue;
347  if (bgc == gc[igcc])
348  clTak = true;
349  }
350  if (clTak)
351  continue;
352 
353  GlobalTrajectoryParameters Gtp(gp1, gv, int(ch), &(*magfield_));
354  glob_hits.clear();
355  loc_hits.clear();
356  glob_hits.push_back(hitBuilder_->build(it1->clone()));
357  glob_hits.push_back(hitBuilder_->build(it2->clone()));
358  glob_hits.push_back(hitBuilder_->build(it3->clone()));
359 
361 
363  TrajectoryStateOnSurface updatedState;
364 
365  for (int ih = 0; ih < 3; ih++) {
367  (ih == 0) ? propagator_->propagate(CSeed, tracker_->idToDet(tripl[i][ih])->surface())
368  : propagator_->propagate(updatedState, tracker_->idToDet(tripl[i][ih])->surface());
369 
370  if (!state.isValid()) {
371  ih = 3;
372  continue;
373  }
374 
375  updatedState = kfUpdator_->update(state, *glob_hits[ih]);
376  loc_hits.push_back(glob_hits[ih]->hit()->clone());
377  if (ih == 2) {
378  PTrajectoryStateOnDet const& PTraj =
379  trajectoryStateTransform::persistentState(updatedState, tripl[i][2]);
380  // output->push_back(Trajectoryseed(PTraj,loc_hits,alongMomentum));
381  unclean.push_back(make_pair(TrajectorySeed(PTraj, loc_hits, alongMomentum), make_pair(gv_corr, ch)));
382  }
383  // }
384  }
385  }
386  }
387  }
388  }
389  vector<bool> inPhot = sharedHits(unclean);
390  for (unsigned int iu = 0; iu < unclean.size(); iu++) {
391  if (inPhot[iu])
392  output->push_back(ConvBremSeed(unclean[iu].first, pft));
393  }
394 
395  } //END GSF TRACK COLLECTION LOOP
396  LogDebug("ConvBremSeedProducerProducer") << "END";
397  iEvent.put(std::move(output));
398 }

References alongMomentum, AnalyticalPropagator_cfi::AnalyticalPropagator, anyDirection, B_, TransientTrackingRecHitBuilder::build(), GlobalTrajectoryParameters::charge(), edm::OwnVector< T, P >::clear(), clone(), GeometricSearchDet::compatibleDets(), conf_, TrackerInteractionGeometry::cylinderBegin(), TrackerInteractionGeometry::cylinderEnd(), detLayer(), edmNew::DetSetVector< T >::end(), fieldMap_, spr::find(), first, geometry_, edm::EventSetup::get(), get, BaseParticlePropagator::getMagneticField(), edm::ParameterSet::getParameter(), BaseParticlePropagator::getSuccess(), GoodCluster(), runTauDisplay::gp, hitBuilder_, mps_fire::i, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, cuy::ib, TrackerGeometry::idToDet(), iEvent, initializeLayerMap(), isGsfTrack(), GeomDetEnumerators::isTrackerPixel(), gpuVertexFinder::iv, kfUpdator_, LogDebug, magfield_, makeTrajectoryState(), AlignmentTrackSelector_cfi::matchedrecHits, GlobalTrajectoryParameters::momentum(), eostools::move(), MagneticField::nominalValue(), convertSQLitetoXML_cfg::output, AlCaHLTBitMon_ParallelJobs::p, BaseParticlePropagator::particle(), PV3DBase< T, PVType, FrameType >::perp(), trajectoryStateTransform::persistentState(), GlobalTrajectoryParameters::position(), position, edm::Handle< T >::product(), PropagatorWithMaterial::propagate(), BaseParticlePropagator::propagate(), propagator_, edm::OwnVector< T, P >::push_back(), AlignmentTrackSelector_cfi::rphirecHits, ParticlePropagator::setPropagationConditions(), sharedHits(), mathSSE::sqrt(), FastHelix::stateAtVertex(), DetLayer::subDetector(), GeomDet::surface(), groupFilesInBlocks::temp, createJobs::tmp, Surface::toGlobal(), tracker_, KFUpdator::update(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and RawParticle::Z().

◆ sharedHits()

vector< bool > ConvBremSeedProducer::sharedHits ( const std::vector< std::pair< TrajectorySeed, std::pair< GlobalVector, float > > > &  unclean)
private

Definition at line 537 of file ConvBremSeedProducer.cc.

537  {
538  vector<bool> goodseed;
539  goodseed.clear();
540  if (unclean.size() < 2) {
541  for (unsigned int i = 0; i < unclean.size(); i++)
542  goodseed.push_back(true);
543  } else {
544  for (unsigned int i = 0; i < unclean.size(); i++)
545  goodseed.push_back(true);
546 
547  for (unsigned int iu = 0; iu < unclean.size() - 1; iu++) {
548  if (!goodseed[iu])
549  continue;
550  for (unsigned int iu2 = iu + 1; iu2 < unclean.size(); iu2++) {
551  if (!goodseed[iu])
552  continue;
553  if (!goodseed[iu2])
554  continue;
555  // if (unclean[iu].second.second *unclean[iu2].second.second >0)continue;
556 
557  unsigned int shar = 0;
558  for (auto const& sh : unclean[iu].first.recHits()) {
559  for (auto const& sh2 : unclean[iu2].first.recHits()) {
560  if (sh.sharesInput(&sh2, TrackingRecHit::all))
561 
562  shar++;
563  }
564  }
565  if (shar >= 2) {
566  if (unclean[iu].second.first.perp() < unclean[iu2].second.first.perp())
567  goodseed[iu] = false;
568  else
569  goodseed[iu2] = false;
570  }
571  }
572  }
573  }
574  return goodseed;
575 }

References TrackingRecHit::all, first, mps_fire::i, and edm::second().

Referenced by produce().

Member Data Documentation

◆ B_

math::XYZVector ConvBremSeedProducer::B_
private

B field.

Definition at line 92 of file ConvBremSeedProducer.cc.

Referenced by beginRun(), and produce().

◆ conf_

edm::ParameterSet ConvBremSeedProducer::conf_
private

Definition at line 80 of file ConvBremSeedProducer.cc.

Referenced by beginRun(), and produce().

◆ fieldMap_

const MagneticFieldMap* ConvBremSeedProducer::fieldMap_
private

Definition at line 85 of file ConvBremSeedProducer.cc.

Referenced by beginRun(), and produce().

◆ geometry_

const TrackerInteractionGeometry* ConvBremSeedProducer::geometry_
private

Definition at line 82 of file ConvBremSeedProducer.cc.

Referenced by beginRun(), initializeLayerMap(), and produce().

◆ geomSearchTracker_

const GeometricSearchTracker* ConvBremSeedProducer::geomSearchTracker_
private

Definition at line 81 of file ConvBremSeedProducer.cc.

Referenced by beginRun(), and initializeLayerMap().

◆ hitBuilder_

const TransientTrackingRecHitBuilder* ConvBremSeedProducer::hitBuilder_
private

Definition at line 88 of file ConvBremSeedProducer.cc.

Referenced by beginRun(), and produce().

◆ kfUpdator_

const KFUpdator* ConvBremSeedProducer::kfUpdator_
private

Definition at line 87 of file ConvBremSeedProducer.cc.

Referenced by beginRun(), endRun(), and produce().

◆ layerMap_

std::vector<const DetLayer*> ConvBremSeedProducer::layerMap_
private

Definition at line 89 of file ConvBremSeedProducer.cc.

Referenced by detLayer(), and initializeLayerMap().

◆ magfield_

const MagneticField* ConvBremSeedProducer::magfield_
private

Definition at line 84 of file ConvBremSeedProducer.cc.

Referenced by beginRun(), and produce().

◆ negLayerOffset_

int ConvBremSeedProducer::negLayerOffset_
private

Definition at line 90 of file ConvBremSeedProducer.cc.

Referenced by detLayer().

◆ propagator_

const PropagatorWithMaterial* ConvBremSeedProducer::propagator_
private

Definition at line 86 of file ConvBremSeedProducer.cc.

Referenced by beginRun(), endRun(), and produce().

◆ theLayerMap

std::vector<const DetLayer*> ConvBremSeedProducer::theLayerMap
private

Definition at line 65 of file ConvBremSeedProducer.cc.

◆ tracker_

const TrackerGeometry* ConvBremSeedProducer::tracker_
private

Definition at line 83 of file ConvBremSeedProducer.cc.

Referenced by beginRun(), and produce().

Vector3DBase
Definition: Vector3DBase.h:8
reco::ConvBremSeed
Definition: ConvBremSeed.h:24
reco::PFClusterCollection
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
Definition: PFClusterFwd.h:9
TrackerGeometry::idToDet
const TrackerGeomDet * idToDet(DetId) const override
Definition: TrackerGeometry.cc:193
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
KFUpdator::update
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const override
Definition: KFUpdator.cc:177
testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
ConvBremSeedProducer::makeTrajectoryState
TrajectoryStateOnSurface makeTrajectoryState(const DetLayer *layer, const ParticlePropagator &pp, const MagneticField *field) const
Definition: ConvBremSeedProducer.cc:517
MagneticField::inTesla
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
testProducerWithPsetDescEmpty_cfi.i3
i3
Definition: testProducerWithPsetDescEmpty_cfi.py:47
RawParticle
Definition: RawParticle.h:37
anyDirection
Definition: PropagationDirection.h:4
mps_fire.i
i
Definition: mps_fire.py:428
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
BaseParticlePropagator::propagateToEcalEntrance
bool propagateToEcalEntrance(bool first=true)
Definition: BaseParticlePropagator.cc:450
TwoPi
const double TwoPi
Definition: CosmicMuonParameters.h:19
TrackCharge
int TrackCharge
Definition: TrackCharge.h:4
BaseParticlePropagator::particle
RawParticle const & particle() const
The particle being propagated.
Definition: BaseParticlePropagator.h:164
edm::Handle::product
T const * product() const
Definition: Handle.h:70
reco::GsfPFRecTrackCollection
std::vector< GsfPFRecTrack > GsfPFRecTrackCollection
collection of GsfPFRecTrack objects
Definition: GsfPFRecTrackFwd.h:9
DetLayer::subDetector
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel,...
ConvBremSeedProducer::magfield_
const MagneticField * magfield_
Definition: ConvBremSeedProducer.cc:84
DetLayer
Definition: DetLayer.h:21
RawParticle::momentum
const XYZTLorentzVector & momentum() const
the momentum fourvector
Definition: RawParticle.h:321
PropagatorWithMaterial::propagate
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
FastHelix
Definition: FastHelix.h:26
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
TrackerInteractionGeometry::cylinderEnd
std::list< TrackerLayer >::const_iterator cylinderEnd() const
Returns the last pointer in the cylinder list.
Definition: TrackerInteractionGeometry.h:40
TrackerInteractionGeometryRecord
Definition: TrackerInteractionGeometryRecord.h:26
RawParticle::vertex
const XYZTLorentzVector & vertex() const
the vertex fourvector
Definition: RawParticle.h:320
ConvBremSeedProducer::hitBuilder_
const TransientTrackingRecHitBuilder * hitBuilder_
Definition: ConvBremSeedProducer.cc:88
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
gpuVertexFinder::iv
int32_t *__restrict__ iv
Definition: gpuClusterTracksDBSCAN.h:42
trajectoryStateTransform::persistentState
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
Definition: TrajectoryStateTransform.cc:14
pos
Definition: PixelAliasList.h:18
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition: testProducerWithPsetDescEmpty_cfi.py:45
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89281
AlignmentTrackSelector_cfi.matchedrecHits
matchedrecHits
Definition: AlignmentTrackSelector_cfi.py:64
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
TransientRecHitRecord
Definition: TransientRecHitRecord.h:14
ConvBremSeedProducer::geomSearchTracker_
const GeometricSearchTracker * geomSearchTracker_
Definition: ConvBremSeedProducer.cc:81
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
GeometricSearchDet::compatibleDets
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
Definition: GeometricSearchDet.cc:35
BaseParticlePropagator::getSuccess
int getSuccess() const
Has propagation been performed and was barrel or endcap reached ?
Definition: BaseParticlePropagator.h:296
ConvBremSeedProducer::initializeLayerMap
void initializeLayerMap()
Definition: ConvBremSeedProducer.cc:435
TrackerRecoGeometryRecord
Definition: TrackerRecoGeometryRecord.h:14
XYZTLorentzVector
math::XYZTLorentzVector XYZTLorentzVector
Definition: RawParticle.h:25
TransientTrackingRecHitBuilder::build
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
edm::Handle
Definition: AssociativeIterator.h:50
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
BoundDisk
ConvBremSeedProducer::fieldMap_
const MagneticFieldMap * fieldMap_
Definition: ConvBremSeedProducer.cc:85
BaseParticlePropagator
Definition: BaseParticlePropagator.h:82
edm::Ref< GsfPFRecTrackCollection >
ConvBremSeedProducer::geometry_
const TrackerInteractionGeometry * geometry_
Definition: ConvBremSeedProducer.cc:82
AlgebraicMatrixID
ROOT::Math::SMatrixIdentity AlgebraicMatrixID
Definition: AlgebraicROOTObjects.h:72
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
PropagatorWithMaterial
Definition: PropagatorWithMaterial.h:25
h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
CurvilinearTrajectoryError
Definition: CurvilinearTrajectoryError.h:27
clone
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
PVValHelper::eta
Definition: PVValidationHelpers.h:70
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
Surface::toGlobal
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
edm::ESHandle< GeometricSearchTracker >
MagneticField::nominalValue
int nominalValue() const
The nominal field value for this map in kGauss.
Definition: MagneticField.h:49
ConvBremSeedProducer::GoodCluster
int GoodCluster(const BaseParticlePropagator &bpg, const reco::PFClusterCollection &pfc, float minep, bool sec=false)
Definition: ConvBremSeedProducer.cc:577
GeometricSearchTracker::barrelLayers
std::vector< BarrelDetLayer const * > const & barrelLayers() const
Definition: GeometricSearchTracker.h:38
reco::Track::recHits
auto recHits() const
Access to reconstructed hits on the track.
Definition: Track.h:85
GlobalTrajectoryParameters
Definition: GlobalTrajectoryParameters.h:15
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
ConvBremSeedProducer::tracker_
const TrackerGeometry * tracker_
Definition: ConvBremSeedProducer.cc:83
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:112
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
AnalyticalPropagator_cfi.AnalyticalPropagator
AnalyticalPropagator
Definition: AnalyticalPropagator_cfi.py:3
ConvBremSeedProducer::detLayer
const DetLayer * detLayer(const TrackerLayer &layer, float zpos) const
Definition: ConvBremSeedProducer.cc:510
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
ConvBremSeedProducer::kfUpdator_
const KFUpdator * kfUpdator_
Definition: ConvBremSeedProducer.cc:87
ConvBremSeedProducer::negLayerOffset_
int negLayerOffset_
Definition: ConvBremSeedProducer.cc:90
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
TrackingRecHit::all
Definition: TrackingRecHit.h:59
TrackingRecHit::ConstRecHitContainer
std::vector< ConstRecHitPointer > ConstRecHitContainer
Definition: TrackingRecHit.h:32
ConvBremSeedProducer::sharedHits
std::vector< bool > sharedHits(const std::vector< std::pair< TrajectorySeed, std::pair< GlobalVector, float > > > &)
Definition: ConvBremSeedProducer.cc:537
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
ParticlePropagator
Definition: ParticlePropagator.h:28
GeomDetEnumerators::isTrackerPixel
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
Definition: GeomDetEnumerators.cc:68
iEvent
int iEvent
Definition: GenABIO.cc:224
TrackerInteractionGeometry::cylinderBegin
std::list< TrackerLayer >::const_iterator cylinderBegin() const
Returns the first pointer in the cylinder list.
Definition: TrackerInteractionGeometry.h:37
ConvBremSeedProducer::B_
math::XYZVector B_
B field.
Definition: ConvBremSeedProducer.cc:92
cuy.ib
ib
Definition: cuy.py:662
MagneticFieldMapRecord
Definition: MagneticFieldMapRecord.h:27
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
get
#define get
fileinputsource_cfi.sec
sec
Definition: fileinputsource_cfi.py:87
ConvBremSeedProducer::isGsfTrack
bool isGsfTrack(const reco::Track &, const TrackingRecHit *)
Definition: ConvBremSeedProducer.cc:528
DDAxes::phi
InsideBoundsMeasurementEstimator
Definition: InsideBoundsMeasurementEstimator.h:6
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
RunInfoPI::state
state
Definition: RunInfoPayloadInspectoHelper.h:16
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
hgcalPerformanceValidation.df
df
Definition: hgcalPerformanceValidation.py:733
edmNew::DetSetVector::end
const_iterator end(bool update=false) const
Definition: DetSetVectorNew.h:535
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
GeometricSearchTracker::posForwardLayers
std::vector< ForwardDetLayer const * > const & posForwardLayers() const
Definition: GeometricSearchTracker.h:42
AlignmentTrackSelector_cfi.rphirecHits
rphirecHits
Definition: AlignmentTrackSelector_cfi.py:63
ConvBremSeedProducer::layerMap_
std::vector< const DetLayer * > layerMap_
Definition: ConvBremSeedProducer.cc:89
ConvBremSeedProducer::conf_
edm::ParameterSet conf_
Definition: ConvBremSeedProducer.cc:80
TrajectorySeed
Definition: TrajectorySeed.h:18
BoundCylinder
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::OwnVector::push_back
void push_back(D *&d)
Definition: OwnVector.h:326
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
PTrajectoryStateOnDet
Definition: PTrajectoryStateOnDet.h:10
createTree.pp
pp
Definition: createTree.py:17
AlgebraicSymMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
Definition: AlgebraicROOTObjects.h:23
volumeBasedMagneticField_160812_cfi.magfield
magfield
Definition: volumeBasedMagneticField_160812_cfi.py:11
edm::OwnVector::clear
void clear()
Definition: OwnVector.h:481
LocalMagneticField
Definition: LocalMagneticField.h:15
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
edm::InputTag
Definition: InputTag.h:15
alongMomentum
Definition: PropagationDirection.h:4
KFUpdator
Definition: KFUpdator.h:32
hit
Definition: SiStripHitEffFromCalibTree.cc:88
edm::OwnVector< TrackingRecHit >
ConvBremSeedProducer::propagator_
const PropagatorWithMaterial * propagator_
Definition: ConvBremSeedProducer.cc:86