CMS 3D CMS Logo

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

Public Member Functions

void beginRun (edm::Run const &, edm::EventSetup const &es) final
 
 ConversionTrackCandidateProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &evt, const edm::EventSetup &es) override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void buildCollections (bool detector, const edm::Handle< edm::View< reco::CaloCluster >> &scHandle, const edm::Handle< edm::View< reco::CaloCluster >> &bcHandle, const EcalRecHitCollection &ecalRecHits, const EcalSeverityLevelAlgo *sevLev, ElectronHcalHelper const &hcalHelper, TrackCandidateCollection &outInTracks, TrackCandidateCollection &inOutTracks, std::vector< edm::Ptr< reco::CaloCluster >> &vecRecOI, std::vector< edm::Ptr< reco::CaloCluster >> &vecRecIO)
 
void setEventSetup (const edm::EventSetup &es)
 Initialize EventSetup objects at each event. More...
 

Private Attributes

edm::EDGetTokenT< EcalRecHitCollectionbarrelecalCollection_
 
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcBarrelCollection_
 
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcEndcapCollection_
 
std::vector< edm::Ptr< reco::CaloCluster > > caloPtrVecInOut_
 
std::vector< edm::Ptr< reco::CaloCluster > > caloPtrVecOutIn_
 
double ecalIsoCut_offset_
 
double ecalIsoCut_slope_
 
edm::EDGetTokenT< EcalRecHitCollectionendcapecalCollection_
 
std::vector< int > flagsexclEB_
 
std::vector< int > flagsexclEE_
 
edm::EDGetTokenT< HBHERecHitCollectionhbheRecHits_
 
std::unique_ptr< ElectronHcalHelperhcalHelper_
 
double hOverEConeSize_
 
InOutConversionSeedFinder inOutSeedFinder_
 
std::string InOutTrackCandidateCollection_
 
InOutConversionTrackFinder inOutTrackFinder_
 
std::string InOutTrackSCAssociationCollection_
 
double isoConeR_
 
double isoEMin_
 
double isoEtaSlice_
 
double isoEtMin_
 
double isoInnerConeR_
 
double maxHOverE_
 
edm::EDGetTokenT< MeasurementTrackerEventmeasurementTrkEvtToken_
 
double minSCEt_
 
const edm::ESGetToken< NavigationSchool, NavigationSchoolRecordnavToken_
 
OutInConversionSeedFinder outInSeedFinder_
 
std::string OutInTrackCandidateCollection_
 
OutInConversionTrackFinder outInTrackFinder_
 
std::string OutInTrackSCAssociationCollection_
 
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scHybridBarrelProducer_
 
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scIslandEndcapProducer_
 
std::vector< int > severitiesexclEB_
 
std::vector< int > severitiesexclEE_
 
const edm::ESGetToken< EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcdsevlvToken_
 
edm::ESHandle< CaloGeometrytheCaloGeom_
 
const edm::ESGetToken< CaloGeometry, CaloGeometryRecordtheCaloGeomToken_
 
std::unique_ptr< BaseCkfTrajectoryBuildertheTrajectoryBuilder_
 
bool useNumXtals_
 
std::vector< edm::Ref< reco::SuperClusterCollection > > vecOfSCRefForInOut
 
std::vector< edm::Ref< reco::SuperClusterCollection > > vecOfSCRefForOutIn
 
bool vetoClusteredHits_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Author
Nancy Marinelli, U. of Notre Dame, US

Definition at line 49 of file ConversionTrackCandidateProducer.cc.

Constructor & Destructor Documentation

◆ ConversionTrackCandidateProducer()

ConversionTrackCandidateProducer::ConversionTrackCandidateProducer ( const edm::ParameterSet ps)

Definition at line 138 of file ConversionTrackCandidateProducer.cc.

139  : bcBarrelCollection_{consumes(config.getParameter<edm::InputTag>("bcBarrelCollection"))},
140  bcEndcapCollection_{consumes(config.getParameter<edm::InputTag>("bcEndcapCollection"))},
141  scHybridBarrelProducer_{consumes(config.getParameter<edm::InputTag>("scHybridBarrelProducer"))},
142  scIslandEndcapProducer_{consumes(config.getParameter<edm::InputTag>("scIslandEndcapProducer"))},
143 
144  hbheRecHits_{consumes(config.getParameter<edm::InputTag>("hbheRecHits"))},
145  barrelecalCollection_{consumes(config.getParameter<edm::InputTag>("barrelEcalRecHitCollection"))},
146  endcapecalCollection_{consumes(config.getParameter<edm::InputTag>("endcapEcalRecHitCollection"))},
147  measurementTrkEvtToken_{consumes(edm::InputTag("MeasurementTrackerEvent"))},
148 
149  navToken_(esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", "SimpleNavigationSchool"))),
152 
153  theTrajectoryBuilder_(createBaseCkfTrajectoryBuilder(
154  config.getParameter<edm::ParameterSet>("TrajectoryBuilderPSet"), consumesCollector())),
155  outInSeedFinder_{config, consumesCollector()},
156  outInTrackFinder_{config, theTrajectoryBuilder_.get(), consumesCollector()},
157  inOutSeedFinder_{config, consumesCollector()},
158  inOutTrackFinder_{config, theTrajectoryBuilder_.get(), consumesCollector()} {
159  OutInTrackCandidateCollection_ = config.getParameter<std::string>("outInTrackCandidateCollection");
160  InOutTrackCandidateCollection_ = config.getParameter<std::string>("inOutTrackCandidateCollection");
161 
162  OutInTrackSCAssociationCollection_ = config.getParameter<std::string>("outInTrackCandidateSCAssociationCollection");
163  InOutTrackSCAssociationCollection_ = config.getParameter<std::string>("inOutTrackCandidateSCAssociationCollection");
164 
165  hOverEConeSize_ = config.getParameter<double>("hOverEConeSize");
166  maxHOverE_ = config.getParameter<double>("maxHOverE");
167  minSCEt_ = config.getParameter<double>("minSCEt");
168  isoConeR_ = config.getParameter<double>("isoConeR");
169  isoInnerConeR_ = config.getParameter<double>("isoInnerConeR");
170  isoEtaSlice_ = config.getParameter<double>("isoEtaSlice");
171  isoEtMin_ = config.getParameter<double>("isoEtMin");
172  isoEMin_ = config.getParameter<double>("isoEMin");
173  vetoClusteredHits_ = config.getParameter<bool>("vetoClusteredHits");
174  useNumXtals_ = config.getParameter<bool>("useNumXstals");
175  ecalIsoCut_offset_ = config.getParameter<double>("ecalIsoCut_offset");
176  ecalIsoCut_slope_ = config.getParameter<double>("ecalIsoCut_slope");
177 
178  //Flags and Severities to be excluded from photon calculations
179  auto const& flagnamesEB = config.getParameter<std::vector<std::string>>("RecHitFlagToBeExcludedEB");
180  auto const& flagnamesEE = config.getParameter<std::vector<std::string>>("RecHitFlagToBeExcludedEE");
181 
182  flagsexclEB_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEB);
183  flagsexclEE_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEE);
184 
185  auto const& severitynamesEB = config.getParameter<std::vector<std::string>>("RecHitSeverityToBeExcludedEB");
186  auto const& severitynamesEE = config.getParameter<std::vector<std::string>>("RecHitSeverityToBeExcludedEE");
187 
188  severitiesexclEB_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEB);
189  severitiesexclEE_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEE);
190 
191  // Register the product
192  produces<TrackCandidateCollection>(OutInTrackCandidateCollection_);
193  produces<TrackCandidateCollection>(InOutTrackCandidateCollection_);
194 
195  produces<reco::TrackCandidateCaloClusterPtrAssociation>(OutInTrackSCAssociationCollection_);
196  produces<reco::TrackCandidateCaloClusterPtrAssociation>(InOutTrackSCAssociationCollection_);
197 
200  if (cfgCone.hOverEConeSize > 0) {
201  cfgCone.onlyBehindCluster = false;
202  cfgCone.checkHcalStatus = false;
203 
204  cfgCone.hbheRecHits = hbheRecHits_;
205 
206  cfgCone.eThresHB = config.getParameter<EgammaHcalIsolation::arrayHB>("recHitEThresholdHB");
207  cfgCone.maxSeverityHB = config.getParameter<int>("maxHcalRecHitSeverity");
208  cfgCone.eThresHE = config.getParameter<EgammaHcalIsolation::arrayHE>("recHitEThresholdHE");
209  cfgCone.maxSeverityHE = cfgCone.maxSeverityHB;
210  }
211 
212  hcalHelper_ = std::make_unique<ElectronHcalHelper>(cfgCone, consumesCollector());
213 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scIslandEndcapProducer_
const edm::ESGetToken< NavigationSchool, NavigationSchoolRecord > navToken_
edm::EDGetTokenT< EcalRecHitCollection > endcapecalCollection_
Definition: config.py:1
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrkEvtToken_
std::unique_ptr< BaseCkfTrajectoryBuilder > theTrajectoryBuilder_
std::unique_ptr< ElectronHcalHelper > hcalHelper_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scHybridBarrelProducer_
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > theCaloGeomToken_
config
parse the configuration file
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcBarrelCollection_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcEndcapCollection_
edm::EDGetTokenT< HBHERecHitCollection > hbheRecHits_
std::array< double, 4 > arrayHB
edm::EDGetTokenT< EcalRecHitCollection > barrelecalCollection_
const edm::ESGetToken< EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd > sevlvToken_
std::array< double, 7 > arrayHE

Member Function Documentation

◆ beginRun()

void ConversionTrackCandidateProducer::beginRun ( edm::Run const &  r,
edm::EventSetup const &  es 
)
final

Definition at line 222 of file ConversionTrackCandidateProducer.cc.

References edm::EventSetup::getData(), inOutSeedFinder_, navToken_, outInSeedFinder_, ConversionSeedFinder::setNavigationSchool(), and theTrajectoryBuilder_.

222  {
223  const NavigationSchool* navigation = &theEventSetup.getData(navToken_);
224  theTrajectoryBuilder_->setNavigationSchool(navigation);
227 }
const edm::ESGetToken< NavigationSchool, NavigationSchoolRecord > navToken_
std::unique_ptr< BaseCkfTrajectoryBuilder > theTrajectoryBuilder_
void setNavigationSchool(const NavigationSchool *navigation)

◆ buildCollections()

void ConversionTrackCandidateProducer::buildCollections ( bool  detector,
const edm::Handle< edm::View< reco::CaloCluster >> &  scHandle,
const edm::Handle< edm::View< reco::CaloCluster >> &  bcHandle,
const EcalRecHitCollection ecalRecHits,
const EcalSeverityLevelAlgo sevLev,
ElectronHcalHelper const &  hcalHelper,
TrackCandidateCollection outInTracks,
TrackCandidateCollection inOutTracks,
std::vector< edm::Ptr< reco::CaloCluster >> &  vecRecOI,
std::vector< edm::Ptr< reco::CaloCluster >> &  vecRecIO 
)
private

Definition at line 351 of file ConversionTrackCandidateProducer.cc.

References EgammaRecHitIsolation::doFlagChecks(), EgammaRecHitIsolation::doSeverityChecks(), DetId::Ecal, ecalIsoCut_offset_, ecalIsoCut_slope_, RecoTauCleanerPlugins::ecalIsolation, reco::CaloCluster::energy(), reco::CaloCluster::eta(), flagsexclEB_, flagsexclEE_, EgammaRecHitIsolation::getEtSum(), ElectronHcalHelper::hcalESum(), inOutSeedFinder_, inOutTrackFinder_, PixelPluginsPhase0_cfi::isBarrel, isoConeR_, isoEMin_, isoEtaSlice_, isoEtMin_, isoInnerConeR_, OutInConversionSeedFinder::makeSeeds(), InOutConversionSeedFinder::makeSeeds(), maxHOverE_, minSCEt_, outInSeedFinder_, outInTrackFinder_, reco::CaloCluster::position(), ConversionSeedFinder::seeds(), ConversionSeedFinder::setCandidate(), InOutConversionSeedFinder::setTracks(), EgammaRecHitIsolation::setUseNumCrystals(), EgammaRecHitIsolation::setVetoClustered(), severitiesexclEB_, severitiesexclEE_, theCaloGeom_, InOutConversionTrackFinder::tracks(), OutInConversionTrackFinder::tracks(), useNumXtals_, and vetoClusteredHits_.

Referenced by produce().

362 {
363  // Loop over SC in the barrel and reconstruct converted photons
364  for (auto const& aClus : scHandle->ptrs()) {
365  // preselection based in Et and H/E cut.
366  if (aClus->energy() / cosh(aClus->eta()) <= minSCEt_)
367  continue;
368  if (aClus->eta() > 1.479 && aClus->eta() < 1.556)
369  continue;
370 
371  const reco::CaloCluster* pClus = &(*aClus);
372  const reco::SuperCluster* sc = dynamic_cast<const reco::SuperCluster*>(pClus);
373  double scEt = sc->energy() / cosh(sc->eta());
374  double HoE = hcalHelper.hcalESum(*sc, 0) / sc->energy();
375  if (HoE >= maxHOverE_)
376  continue;
377 
379  EgammaRecHitIsolation ecalIso(
381 
382  ecalIso.setVetoClustered(vetoClusteredHits_);
383  ecalIso.setUseNumCrystals(useNumXtals_);
384  if (isBarrel) {
385  ecalIso.doFlagChecks(flagsexclEB_);
386  ecalIso.doSeverityChecks(&ecalRecHits, severitiesexclEB_);
387  } else {
388  ecalIso.doFlagChecks(flagsexclEE_);
389  ecalIso.doSeverityChecks(&ecalRecHits, severitiesexclEE_);
390  }
391 
392  double ecalIsolation = ecalIso.getEtSum(sc);
394  continue;
395 
396  // Now launch the seed finding
398  GlobalPoint(pClus->position().x(), pClus->position().y(), pClus->position().z()));
399  outInSeedFinder_.makeSeeds(bcHandle);
400 
401  std::vector<Trajectory> theOutInTracks = outInTrackFinder_.tracks(outInSeedFinder_.seeds(), outInTrackCandidates);
402 
404  GlobalPoint(pClus->position().x(), pClus->position().y(), pClus->position().z()));
405  inOutSeedFinder_.setTracks(theOutInTracks);
406  inOutSeedFinder_.makeSeeds(bcHandle);
407 
408  std::vector<Trajectory> theInOutTracks = inOutTrackFinder_.tracks(inOutSeedFinder_.seeds(), inOutTrackCandidates);
409 
410  // Debug
411  // std::cout << "ConversionTrackCandidateProducer theOutInTracks.size() " << theOutInTracks.size() << " theInOutTracks.size() " << theInOutTracks.size() << " Event pointer to out in track size barrel " << outInTrackCandidates.size() << " in out track size " << inOutTrackCandidates.size() << "\n";
412 
414  for (auto it = theOutInTracks.begin(); it != theOutInTracks.end(); ++it) {
415  vecRecOI.push_back(aClus);
416  // std::cout << "ConversionTrackCandidateProducer Barrel OutIn Tracks Number of hits " << (*it).foundHits() << "\n";
417  }
418 
419  for (auto it = theInOutTracks.begin(); it != theInOutTracks.end(); ++it) {
420  vecRecIO.push_back(aClus);
421  // std::cout << "ConversionTrackCandidateProducer Barrel InOut Tracks Number of hits " << (*it).foundHits() << "\n";
422  }
423  }
424 }
std::vector< Trajectory > tracks(const TrajectorySeedCollection &seeds, TrackCandidateCollection &candidates) const override
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:154
void setTracks(std::vector< Trajectory > const &in)
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
void makeSeeds(const edm::Handle< edm::View< reco::CaloCluster > > &allBc) override
void makeSeeds(const edm::Handle< edm::View< reco::CaloCluster > > &allBc) override
double energy() const
cluster energy
Definition: CaloCluster.h:149
virtual void setCandidate(float e, GlobalPoint pos)
TrajectorySeedCollection & seeds()
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:181
std::vector< Trajectory > tracks(const TrajectorySeedCollection &seeds, TrackCandidateCollection &candidate) const override

◆ fillDescriptions()

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

Definition at line 426 of file ConversionTrackCandidateProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, edm::ParameterSetDescription::setUnknown(), and AlCaHLTBitMon_QueryRunRegistry::string.

426  {
427  // conversionTrackCandidates
429 
430  desc.add<edm::InputTag>("bcBarrelCollection", {"particleFlowSuperClusterECAL", "particleFlowBasicClusterECALBarrel"});
431  desc.add<edm::InputTag>("bcEndcapCollection", {"particleFlowSuperClusterECAL", "particleFlowBasicClusterECALEndcap"});
432  desc.add<edm::InputTag>("scHybridBarrelProducer",
433  {"particleFlowSuperClusterECAL", "particleFlowSuperClusterECALBarrel"});
434  desc.add<edm::InputTag>("scIslandEndcapProducer",
435  {"particleFlowSuperClusterECAL", "particleFlowSuperClusterECALEndcapWithPreshower"});
436 
437  desc.add<std::string>("outInTrackCandidateSCAssociationCollection", "outInTrackCandidateSCAssociationCollection");
438  desc.add<std::string>("inOutTrackCandidateSCAssociationCollection", "inOutTrackCandidateSCAssociationCollection");
439  desc.add<std::string>("outInTrackCandidateCollection", "outInTracksFromConversions");
440  desc.add<std::string>("inOutTrackCandidateCollection", "inOutTracksFromConversions");
441 
442  desc.add<edm::InputTag>("barrelEcalRecHitCollection", {"ecalRecHit", "EcalRecHitsEB"});
443  desc.add<edm::InputTag>("endcapEcalRecHitCollection", {"ecalRecHit", "EcalRecHitsEE"});
444  desc.add<std::string>("MeasurementTrackerName", "");
445  desc.add<std::string>("OutInRedundantSeedCleaner", "CachingSeedCleanerBySharedInput");
446  desc.add<std::string>("InOutRedundantSeedCleaner", "CachingSeedCleanerBySharedInput");
447  desc.add<bool>("useHitsSplitting", false);
448  desc.add<int>("maxNumOfSeedsOutIn", 50);
449  desc.add<int>("maxNumOfSeedsInOut", 50);
450  desc.add<double>("bcEtCut", 1.5);
451  desc.add<double>("bcECut", 1.5);
452  desc.add<bool>("useEtCut", true);
453 
454  desc.add<edm::InputTag>("hbheRecHits", {"hbhereco"});
455  desc.add<std::vector<double>>("recHitEThresholdHB", {0., 0., 0., 0.});
456  desc.add<std::vector<double>>("recHitEThresholdHE", {0., 0., 0., 0., 0., 0., 0.});
457  desc.add<int>("maxHcalRecHitSeverity", 999999);
458 
459  desc.add<double>("minSCEt", 20.0);
460  desc.add<double>("hOverEConeSize", 0.15);
461  desc.add<double>("maxHOverE", 0.15);
462  desc.add<double>("isoInnerConeR", 3.5);
463  desc.add<double>("isoConeR", 0.4);
464  desc.add<double>("isoEtaSlice", 2.5);
465  desc.add<double>("isoEtMin", 0.0);
466  desc.add<double>("isoEMin", 0.08);
467  desc.add<bool>("vetoClusteredHits", false);
468  desc.add<bool>("useNumXstals", true);
469  desc.add<double>("ecalIsoCut_offset", 999999999); // alternative value: 4.2
470  desc.add<double>("ecalIsoCut_slope", 0.0); // alternative value: 0.003
471 
472  desc.add<std::vector<std::string>>("RecHitFlagToBeExcludedEB", {});
473  desc.add<std::vector<std::string>>("RecHitSeverityToBeExcludedEB", {});
474  desc.add<std::vector<std::string>>("RecHitFlagToBeExcludedEE", {});
475  desc.add<std::vector<std::string>>("RecHitSeverityToBeExcludedEE", {});
476 
477  desc.add<double>("fractionShared", 0.5);
478  desc.add<std::string>("TrajectoryBuilder", "TrajectoryBuilderForConversions");
479  {
481  psd0.setUnknown();
482  desc.add<edm::ParameterSetDescription>("TrajectoryBuilderPSet", psd0);
483  }
484  {
486  psd0.add<std::string>("propagatorAlongTISE", "alongMomElePropagator");
487  psd0.add<int>("numberMeasurementsForFit", 4);
488  psd0.add<std::string>("propagatorOppositeTISE", "oppositeToMomElePropagator");
489  desc.add<edm::ParameterSetDescription>("TransientInitialStateEstimatorParameters", psd0);
490  }
491  desc.add<bool>("allowSharedFirstHit", true);
492  desc.add<double>("ValidHitBonus", 5.0);
493  desc.add<double>("MissingHitPenalty", 20.0);
494 
495  descriptions.add("conversionTrackCandidatesDefault", desc);
496  // or use the following to generate the label from the module's C++ type
497  //descriptions.addWithDefaultLabel(desc);
498 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void ConversionTrackCandidateProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
override

Definition at line 229 of file ConversionTrackCandidateProducer.cc.

References barrelecalCollection_, bcBarrelCollection_, bcEndcapCollection_, buildCollections(), caloPtrVecInOut_, caloPtrVecOutIn_, ConversionSeedFinder::clear(), endcapecalCollection_, edm::helper::Filler< Map >::fill(), edm::Event::get(), edm::EventSetup::getData(), edm::EventSetup::getHandle(), edm::Event::getHandle(), hcalHelper_, inOutSeedFinder_, InOutTrackCandidateCollection_, InOutTrackSCAssociationCollection_, edm::helper::Filler< Map >::insert(), PixelPluginsPhase0_cfi::isBarrel, measurementTrkEvtToken_, eostools::move(), outInSeedFinder_, OutInTrackCandidateCollection_, OutInTrackSCAssociationCollection_, edm::Event::put(), scHybridBarrelProducer_, scIslandEndcapProducer_, ConversionSeedFinder::setEvent(), setEventSetup(), sevlvToken_, theCaloGeom_, theCaloGeomToken_, and theTrajectoryBuilder_.

229  {
230  // get the trajectory builder and initialize it with the data
231  theTrajectoryBuilder_->setEvent(theEvent, theEventSetup, &theEvent.get(measurementTrkEvtToken_));
232 
233  // this need to be done after the initialization of the TrajectoryBuilder!
234  setEventSetup(theEventSetup);
235 
236  outInSeedFinder_.setEvent(theEvent);
237  inOutSeedFinder_.setEvent(theEvent);
238 
239  //
240  // create empty output collections
241  //
242  // Out In Track Candidates
243  auto outInTrackCandidate_p = std::make_unique<TrackCandidateCollection>();
244  // In Out Track Candidates
245  auto inOutTrackCandidate_p = std::make_unique<TrackCandidateCollection>();
246  // Track Candidate calo Cluster Association
247  auto outInAssoc_p = std::make_unique<reco::TrackCandidateCaloClusterPtrAssociation>();
248  auto inOutAssoc_p = std::make_unique<reco::TrackCandidateCaloClusterPtrAssociation>();
249 
250  // Get the basic cluster collection in the Barrel
251  bool validBarrelBCHandle = true;
252  auto bcBarrelHandle = theEvent.getHandle(bcBarrelCollection_);
253  if (!bcBarrelHandle.isValid()) {
254  edm::LogError("ConversionTrackCandidateProducer") << "Error! Can't get the Barrel Basic Clusters!";
255  validBarrelBCHandle = false;
256  }
257 
258  // Get the basic cluster collection in the Endcap
259  bool validEndcapBCHandle = true;
260  auto bcEndcapHandle = theEvent.getHandle(bcEndcapCollection_);
261  if (!bcEndcapHandle.isValid()) {
262  edm::LogError("CoonversionTrackCandidateProducer") << "Error! Can't get the Endcap Basic Clusters";
263  validEndcapBCHandle = false;
264  }
265 
266  // Get the Super Cluster collection in the Barrel
267  bool validBarrelSCHandle = true;
268  auto scBarrelHandle = theEvent.getHandle(scHybridBarrelProducer_);
269  if (!scBarrelHandle.isValid()) {
270  edm::LogError("CoonversionTrackCandidateProducer") << "Error! Can't get the barrel superclusters!";
271  validBarrelSCHandle = false;
272  }
273 
274  // Get the Super Cluster collection in the Endcap
275  bool validEndcapSCHandle = true;
276  auto scEndcapHandle = theEvent.getHandle(scIslandEndcapProducer_);
277  if (!scEndcapHandle.isValid()) {
278  edm::LogError("CoonversionTrackCandidateProducer") << "Error! Can't get the endcap superclusters!";
279  validEndcapSCHandle = false;
280  }
281 
282  // get the geometry from the event setup:
283  theCaloGeom_ = theEventSetup.getHandle(theCaloGeomToken_);
284 
285  hcalHelper_->beginEvent(theEvent, theEventSetup);
286 
287  auto const& ecalhitsCollEB = theEvent.get(barrelecalCollection_);
288  auto const& ecalhitsCollEE = theEvent.get(endcapecalCollection_);
289 
290  const EcalSeverityLevelAlgo* sevLevel = &theEventSetup.getData(sevlvToken_);
291 
292  caloPtrVecOutIn_.clear();
293  caloPtrVecInOut_.clear();
294 
295  bool isBarrel = true;
296  if (validBarrelBCHandle && validBarrelSCHandle)
298  scBarrelHandle,
299  bcBarrelHandle,
300  ecalhitsCollEB,
301  sevLevel,
302  *hcalHelper_,
303  *outInTrackCandidate_p,
304  *inOutTrackCandidate_p,
307 
308  if (validEndcapBCHandle && validEndcapSCHandle) {
309  isBarrel = false;
311  scEndcapHandle,
312  bcEndcapHandle,
313  ecalhitsCollEE,
314  sevLevel,
315  *hcalHelper_,
316  *outInTrackCandidate_p,
317  *inOutTrackCandidate_p,
320  }
321 
322  // std::cout << " ConversionTrackCandidateProducer caloPtrVecOutIn_ size " << caloPtrVecOutIn_.size() << " caloPtrVecInOut_ size " << caloPtrVecInOut_.size() << "\n";
323 
324  // put all products in the event
325  // Barrel
326  //std::cout << "ConversionTrackCandidateProducer Putting in the event " << (*outInTrackCandidate_p).size() << " Out In track Candidates " << "\n";
327  auto const refprodOutInTrackC = theEvent.put(std::move(outInTrackCandidate_p), OutInTrackCandidateCollection_);
328  //std::cout << "ConversionTrackCandidateProducer refprodOutInTrackC size " << (*(refprodOutInTrackC.product())).size() << "\n";
329  //
330  //std::cout << "ConversionTrackCandidateProducer Putting in the event " << (*inOutTrackCandidate_p).size() << " In Out track Candidates " << "\n";
331  auto const refprodInOutTrackC = theEvent.put(std::move(inOutTrackCandidate_p), InOutTrackCandidateCollection_);
332  //std::cout << "ConversionTrackCandidateProducer refprodInOutTrackC size " << (*(refprodInOutTrackC.product())).size() << "\n";
333 
334  edm::ValueMap<reco::CaloClusterPtr>::Filler fillerOI(*outInAssoc_p);
335  fillerOI.insert(refprodOutInTrackC, caloPtrVecOutIn_.begin(), caloPtrVecOutIn_.end());
336  fillerOI.fill();
337  edm::ValueMap<reco::CaloClusterPtr>::Filler fillerIO(*inOutAssoc_p);
338  fillerIO.insert(refprodInOutTrackC, caloPtrVecInOut_.begin(), caloPtrVecInOut_.end());
339  fillerIO.fill();
340 
341  // std::cout << "ConversionTrackCandidateProducer Putting in the event OutIn track - SC association: size " << (*outInAssoc_p).size() << "\n";
342  theEvent.put(std::move(outInAssoc_p), OutInTrackSCAssociationCollection_);
343 
344  // std::cout << "ConversionTrackCandidateProducer Putting in the event InOut track - SC association: size " << (*inOutAssoc_p).size() << "\n";
345  theEvent.put(std::move(inOutAssoc_p), InOutTrackSCAssociationCollection_);
346 
349 }
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scIslandEndcapProducer_
edm::EDGetTokenT< EcalRecHitCollection > endcapecalCollection_
std::vector< edm::Ptr< reco::CaloCluster > > caloPtrVecInOut_
Log< level::Error, false > LogError
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrkEvtToken_
std::unique_ptr< BaseCkfTrajectoryBuilder > theTrajectoryBuilder_
void buildCollections(bool detector, const edm::Handle< edm::View< reco::CaloCluster >> &scHandle, const edm::Handle< edm::View< reco::CaloCluster >> &bcHandle, const EcalRecHitCollection &ecalRecHits, const EcalSeverityLevelAlgo *sevLev, ElectronHcalHelper const &hcalHelper, TrackCandidateCollection &outInTracks, TrackCandidateCollection &inOutTracks, std::vector< edm::Ptr< reco::CaloCluster >> &vecRecOI, std::vector< edm::Ptr< reco::CaloCluster >> &vecRecIO)
std::unique_ptr< ElectronHcalHelper > hcalHelper_
std::vector< edm::Ptr< reco::CaloCluster > > caloPtrVecOutIn_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scHybridBarrelProducer_
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > theCaloGeomToken_
void setEvent(const edm::Event &e)
void setEventSetup(const edm::EventSetup &es)
Initialize EventSetup objects at each event.
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcBarrelCollection_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcEndcapCollection_
edm::EDGetTokenT< EcalRecHitCollection > barrelecalCollection_
const edm::ESGetToken< EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd > sevlvToken_
def move(src, dest)
Definition: eostools.py:511

◆ setEventSetup()

void ConversionTrackCandidateProducer::setEventSetup ( const edm::EventSetup es)
private

Initialize EventSetup objects at each event.

Definition at line 215 of file ConversionTrackCandidateProducer.cc.

References inOutSeedFinder_, inOutTrackFinder_, outInSeedFinder_, outInTrackFinder_, ConversionTrackFinder::setEventSetup(), and ConversionSeedFinder::setEventSetup().

Referenced by produce().

215  {
216  outInSeedFinder_.setEventSetup(theEventSetup);
217  inOutSeedFinder_.setEventSetup(theEventSetup);
218  outInTrackFinder_.setEventSetup(theEventSetup);
219  inOutTrackFinder_.setEventSetup(theEventSetup);
220 }
void setEventSetup(const edm::EventSetup &es)
Initialize EventSetup objects at each event.
void setEventSetup(const edm::EventSetup &es)
Initialize EventSetup objects at each event.

Member Data Documentation

◆ barrelecalCollection_

edm::EDGetTokenT<EcalRecHitCollection> ConversionTrackCandidateProducer::barrelecalCollection_
private

Definition at line 73 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ bcBarrelCollection_

edm::EDGetTokenT<edm::View<reco::CaloCluster> > ConversionTrackCandidateProducer::bcBarrelCollection_
private

Definition at line 68 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ bcEndcapCollection_

edm::EDGetTokenT<edm::View<reco::CaloCluster> > ConversionTrackCandidateProducer::bcEndcapCollection_
private

Definition at line 69 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ caloPtrVecInOut_

std::vector<edm::Ptr<reco::CaloCluster> > ConversionTrackCandidateProducer::caloPtrVecInOut_
private

Definition at line 110 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ caloPtrVecOutIn_

std::vector<edm::Ptr<reco::CaloCluster> > ConversionTrackCandidateProducer::caloPtrVecOutIn_
private

Definition at line 109 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ ecalIsoCut_offset_

double ConversionTrackCandidateProducer::ecalIsoCut_offset_
private

Definition at line 97 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ ecalIsoCut_slope_

double ConversionTrackCandidateProducer::ecalIsoCut_slope_
private

Definition at line 98 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ endcapecalCollection_

edm::EDGetTokenT<EcalRecHitCollection> ConversionTrackCandidateProducer::endcapecalCollection_
private

Definition at line 74 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ flagsexclEB_

std::vector<int> ConversionTrackCandidateProducer::flagsexclEB_
private

Definition at line 92 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ flagsexclEE_

std::vector<int> ConversionTrackCandidateProducer::flagsexclEE_
private

Definition at line 93 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ hbheRecHits_

edm::EDGetTokenT<HBHERecHitCollection> ConversionTrackCandidateProducer::hbheRecHits_
private

Definition at line 72 of file ConversionTrackCandidateProducer.cc.

◆ hcalHelper_

std::unique_ptr<ElectronHcalHelper> ConversionTrackCandidateProducer::hcalHelper_
private

Definition at line 115 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ hOverEConeSize_

double ConversionTrackCandidateProducer::hOverEConeSize_
private

Definition at line 81 of file ConversionTrackCandidateProducer.cc.

◆ inOutSeedFinder_

InOutConversionSeedFinder ConversionTrackCandidateProducer::inOutSeedFinder_
private

◆ InOutTrackCandidateCollection_

std::string ConversionTrackCandidateProducer::InOutTrackCandidateCollection_
private

Definition at line 63 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ inOutTrackFinder_

InOutConversionTrackFinder ConversionTrackCandidateProducer::inOutTrackFinder_
private

Definition at line 107 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections(), and setEventSetup().

◆ InOutTrackSCAssociationCollection_

std::string ConversionTrackCandidateProducer::InOutTrackSCAssociationCollection_
private

Definition at line 66 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ isoConeR_

double ConversionTrackCandidateProducer::isoConeR_
private

Definition at line 84 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ isoEMin_

double ConversionTrackCandidateProducer::isoEMin_
private

Definition at line 88 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ isoEtaSlice_

double ConversionTrackCandidateProducer::isoEtaSlice_
private

Definition at line 86 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ isoEtMin_

double ConversionTrackCandidateProducer::isoEtMin_
private

Definition at line 87 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ isoInnerConeR_

double ConversionTrackCandidateProducer::isoInnerConeR_
private

Definition at line 85 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ maxHOverE_

double ConversionTrackCandidateProducer::maxHOverE_
private

Definition at line 82 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ measurementTrkEvtToken_

edm::EDGetTokenT<MeasurementTrackerEvent> ConversionTrackCandidateProducer::measurementTrkEvtToken_
private

Definition at line 75 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ minSCEt_

double ConversionTrackCandidateProducer::minSCEt_
private

Definition at line 83 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ navToken_

const edm::ESGetToken<NavigationSchool, NavigationSchoolRecord> ConversionTrackCandidateProducer::navToken_
private

Definition at line 77 of file ConversionTrackCandidateProducer.cc.

Referenced by beginRun().

◆ outInSeedFinder_

OutInConversionSeedFinder ConversionTrackCandidateProducer::outInSeedFinder_
private

◆ OutInTrackCandidateCollection_

std::string ConversionTrackCandidateProducer::OutInTrackCandidateCollection_
private

Definition at line 62 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ outInTrackFinder_

OutInConversionTrackFinder ConversionTrackCandidateProducer::outInTrackFinder_
private

Definition at line 105 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections(), and setEventSetup().

◆ OutInTrackSCAssociationCollection_

std::string ConversionTrackCandidateProducer::OutInTrackSCAssociationCollection_
private

Definition at line 65 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ scHybridBarrelProducer_

edm::EDGetTokenT<edm::View<reco::CaloCluster> > ConversionTrackCandidateProducer::scHybridBarrelProducer_
private

Definition at line 70 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ scIslandEndcapProducer_

edm::EDGetTokenT<edm::View<reco::CaloCluster> > ConversionTrackCandidateProducer::scIslandEndcapProducer_
private

Definition at line 71 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ severitiesexclEB_

std::vector<int> ConversionTrackCandidateProducer::severitiesexclEB_
private

Definition at line 94 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ severitiesexclEE_

std::vector<int> ConversionTrackCandidateProducer::severitiesexclEE_
private

Definition at line 95 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ sevlvToken_

const edm::ESGetToken<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd> ConversionTrackCandidateProducer::sevlvToken_
private

Definition at line 79 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ theCaloGeom_

edm::ESHandle<CaloGeometry> ConversionTrackCandidateProducer::theCaloGeom_
private

Definition at line 100 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections(), and produce().

◆ theCaloGeomToken_

const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> ConversionTrackCandidateProducer::theCaloGeomToken_
private

Definition at line 78 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ theTrajectoryBuilder_

std::unique_ptr<BaseCkfTrajectoryBuilder> ConversionTrackCandidateProducer::theTrajectoryBuilder_
private

Definition at line 102 of file ConversionTrackCandidateProducer.cc.

Referenced by beginRun(), and produce().

◆ useNumXtals_

bool ConversionTrackCandidateProducer::useNumXtals_
private

Definition at line 90 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ vecOfSCRefForInOut

std::vector<edm::Ref<reco::SuperClusterCollection> > ConversionTrackCandidateProducer::vecOfSCRefForInOut
private

Definition at line 113 of file ConversionTrackCandidateProducer.cc.

◆ vecOfSCRefForOutIn

std::vector<edm::Ref<reco::SuperClusterCollection> > ConversionTrackCandidateProducer::vecOfSCRefForOutIn
private

Definition at line 112 of file ConversionTrackCandidateProducer.cc.

◆ vetoClusteredHits_

bool ConversionTrackCandidateProducer::vetoClusteredHits_
private

Definition at line 89 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().