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_
 
bool cutsFromDB
 
double ecalIsoCut_offset_
 
double ecalIsoCut_slope_
 
const edm::ESGetToken< EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcdecalPFRechitThresholdsToken_
 
edm::EDGetTokenT< EcalRecHitCollectionendcapecalCollection_
 
std::vector< int > flagsexclEB_
 
std::vector< int > flagsexclEE_
 
edm::EDGetTokenT< HBHERecHitCollectionhbheRecHits_
 
HcalPFCuts const * hcalCuts = nullptr
 
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcdhcalCutsToken_
 
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_
 
const EcalPFRecHitThresholdsthresholds = nullptr
 
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 50 of file ConversionTrackCandidateProducer.cc.

Constructor & Destructor Documentation

◆ ConversionTrackCandidateProducer()

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

Definition at line 145 of file ConversionTrackCandidateProducer.cc.

146  : bcBarrelCollection_{consumes(config.getParameter<edm::InputTag>("bcBarrelCollection"))},
147  bcEndcapCollection_{consumes(config.getParameter<edm::InputTag>("bcEndcapCollection"))},
148  scHybridBarrelProducer_{consumes(config.getParameter<edm::InputTag>("scHybridBarrelProducer"))},
149  scIslandEndcapProducer_{consumes(config.getParameter<edm::InputTag>("scIslandEndcapProducer"))},
150 
151  hbheRecHits_{consumes(config.getParameter<edm::InputTag>("hbheRecHits"))},
152  barrelecalCollection_{consumes(config.getParameter<edm::InputTag>("barrelEcalRecHitCollection"))},
153  endcapecalCollection_{consumes(config.getParameter<edm::InputTag>("endcapEcalRecHitCollection"))},
154  measurementTrkEvtToken_{consumes(edm::InputTag("MeasurementTrackerEvent"))},
155 
156  navToken_(esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", "SimpleNavigationSchool"))),
160  theTrajectoryBuilder_(createBaseCkfTrajectoryBuilder(
161  config.getParameter<edm::ParameterSet>("TrajectoryBuilderPSet"), consumesCollector())),
162  outInSeedFinder_{config, consumesCollector()},
163  outInTrackFinder_{config, theTrajectoryBuilder_.get(), consumesCollector()},
164  inOutSeedFinder_{config, consumesCollector()},
165  inOutTrackFinder_{config, theTrajectoryBuilder_.get(), consumesCollector()} {
166  OutInTrackCandidateCollection_ = config.getParameter<std::string>("outInTrackCandidateCollection");
167  InOutTrackCandidateCollection_ = config.getParameter<std::string>("inOutTrackCandidateCollection");
168 
169  OutInTrackSCAssociationCollection_ = config.getParameter<std::string>("outInTrackCandidateSCAssociationCollection");
170  InOutTrackSCAssociationCollection_ = config.getParameter<std::string>("inOutTrackCandidateSCAssociationCollection");
171 
172  cutsFromDB = config.getParameter<bool>("usePFThresholdsFromDB");
173  if (cutsFromDB) {
174  hcalCutsToken_ = esConsumes<HcalPFCuts, HcalPFCutsRcd, edm::Transition::BeginRun>(edm::ESInputTag("", "withTopo"));
175  }
176  hOverEConeSize_ = config.getParameter<double>("hOverEConeSize");
177  maxHOverE_ = config.getParameter<double>("maxHOverE");
178  minSCEt_ = config.getParameter<double>("minSCEt");
179  isoConeR_ = config.getParameter<double>("isoConeR");
180  isoInnerConeR_ = config.getParameter<double>("isoInnerConeR");
181  isoEtaSlice_ = config.getParameter<double>("isoEtaSlice");
182  isoEtMin_ = config.getParameter<double>("isoEtMin");
183  isoEMin_ = config.getParameter<double>("isoEMin");
184  vetoClusteredHits_ = config.getParameter<bool>("vetoClusteredHits");
185  useNumXtals_ = config.getParameter<bool>("useNumXstals");
186  ecalIsoCut_offset_ = config.getParameter<double>("ecalIsoCut_offset");
187  ecalIsoCut_slope_ = config.getParameter<double>("ecalIsoCut_slope");
188 
189  //Flags and Severities to be excluded from photon calculations
190  auto const& flagnamesEB = config.getParameter<std::vector<std::string>>("RecHitFlagToBeExcludedEB");
191  auto const& flagnamesEE = config.getParameter<std::vector<std::string>>("RecHitFlagToBeExcludedEE");
192 
193  flagsexclEB_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEB);
194  flagsexclEE_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEE);
195 
196  auto const& severitynamesEB = config.getParameter<std::vector<std::string>>("RecHitSeverityToBeExcludedEB");
197  auto const& severitynamesEE = config.getParameter<std::vector<std::string>>("RecHitSeverityToBeExcludedEE");
198 
199  severitiesexclEB_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEB);
200  severitiesexclEE_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEE);
201 
202  // Register the product
203  produces<TrackCandidateCollection>(OutInTrackCandidateCollection_);
204  produces<TrackCandidateCollection>(InOutTrackCandidateCollection_);
205 
206  produces<reco::TrackCandidateCaloClusterPtrAssociation>(OutInTrackSCAssociationCollection_);
207  produces<reco::TrackCandidateCaloClusterPtrAssociation>(InOutTrackSCAssociationCollection_);
208 
211  if (cfgCone.hOverEConeSize > 0) {
212  cfgCone.onlyBehindCluster = false;
213  cfgCone.checkHcalStatus = false;
214 
215  cfgCone.hbheRecHits = hbheRecHits_;
216 
217  cfgCone.eThresHB = config.getParameter<EgammaHcalIsolation::arrayHB>("recHitEThresholdHB");
218  cfgCone.maxSeverityHB = config.getParameter<int>("maxHcalRecHitSeverity");
219  cfgCone.eThresHE = config.getParameter<EgammaHcalIsolation::arrayHE>("recHitEThresholdHE");
220  cfgCone.maxSeverityHE = cfgCone.maxSeverityHB;
221  }
222 
223  hcalHelper_ = std::make_unique<ElectronHcalHelper>(cfgCone, consumesCollector());
224 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcd > hcalCutsToken_
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_
const edm::ESGetToken< EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcd > ecalPFRechitThresholdsToken_
std::unique_ptr< ElectronHcalHelper > hcalHelper_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scHybridBarrelProducer_
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > theCaloGeomToken_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcBarrelCollection_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcEndcapCollection_
edm::EDGetTokenT< HBHERecHitCollection > hbheRecHits_
dictionary config
Read in AllInOne config in JSON format.
Definition: DiMuonV_cfg.py:29
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 233 of file ConversionTrackCandidateProducer.cc.

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

233  {
234  const NavigationSchool* navigation = &theEventSetup.getData(navToken_);
235  theTrajectoryBuilder_->setNavigationSchool(navigation);
238 
239  if (cutsFromDB) {
240  hcalCuts = &theEventSetup.getData(hcalCutsToken_);
241  }
242 }
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcd > hcalCutsToken_
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 368 of file ConversionTrackCandidateProducer.cc.

References DetId::Ecal, run3scouting_cff::ecalIso, ecalIsoCut_offset_, ecalIsoCut_slope_, RecoTauCleanerPlugins::ecalIsolation, reco::CaloCluster::energy(), reco::CaloCluster::eta(), flagsexclEB_, flagsexclEE_, hcalCuts, ElectronHcalHelper::hcalESum(), inOutSeedFinder_, inOutTrackFinder_, PixelPluginsPhase0_cfi::isBarrel, isoConeR_, isoEMin_, isoEtaSlice_, isoEtMin_, isoInnerConeR_, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, OutInConversionSeedFinder::makeSeeds(), InOutConversionSeedFinder::makeSeeds(), maxHOverE_, minSCEt_, outInSeedFinder_, outInTrackFinder_, reco::CaloCluster::position(), ConversionSeedFinder::seeds(), ConversionSeedFinder::setCandidate(), InOutConversionSeedFinder::setTracks(), severitiesexclEB_, severitiesexclEE_, theCaloGeom_, thresholds, InOutConversionTrackFinder::tracks(), OutInConversionTrackFinder::tracks(), useNumXtals_, and vetoClusteredHits_.

Referenced by produce().

379 {
380  // Loop over SC in the barrel and reconstruct converted photons
381  for (auto const& aClus : scHandle->ptrs()) {
382  // preselection based in Et and H/E cut.
383  if (aClus->energy() / cosh(aClus->eta()) <= minSCEt_)
384  continue;
385  if (aClus->eta() > 1.479 && aClus->eta() < 1.556)
386  continue;
387 
388  const reco::CaloCluster* pClus = &(*aClus);
389  const reco::SuperCluster* sc = dynamic_cast<const reco::SuperCluster*>(pClus);
390  double scEt = sc->energy() / cosh(sc->eta());
391  double HoE = hcalHelper.hcalESum(*sc, 0, hcalCuts) / sc->energy();
392  if (HoE >= maxHOverE_)
393  continue;
394 
398 
399  ecalIso.setVetoClustered(vetoClusteredHits_);
400  ecalIso.setUseNumCrystals(useNumXtals_);
401  if (isBarrel) {
402  ecalIso.doFlagChecks(flagsexclEB_);
403  ecalIso.doSeverityChecks(&ecalRecHits, severitiesexclEB_);
404  } else {
405  ecalIso.doFlagChecks(flagsexclEE_);
406  ecalIso.doSeverityChecks(&ecalRecHits, severitiesexclEE_);
407  }
408 
409  double ecalIsolation = ecalIso.getEtSum(sc, *thresholds);
411  continue;
412 
413  // Now launch the seed finding
415  GlobalPoint(pClus->position().x(), pClus->position().y(), pClus->position().z()));
416  outInSeedFinder_.makeSeeds(bcHandle);
417 
418  std::vector<Trajectory> theOutInTracks = outInTrackFinder_.tracks(outInSeedFinder_.seeds(), outInTrackCandidates);
419 
421  GlobalPoint(pClus->position().x(), pClus->position().y(), pClus->position().z()));
422  inOutSeedFinder_.setTracks(theOutInTracks);
423  inOutSeedFinder_.makeSeeds(bcHandle);
424 
425  std::vector<Trajectory> theInOutTracks = inOutTrackFinder_.tracks(inOutSeedFinder_.seeds(), inOutTrackCandidates);
426 
427  // Debug
428  // 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";
429 
431  for (auto it = theOutInTracks.begin(); it != theOutInTracks.end(); ++it) {
432  vecRecOI.push_back(aClus);
433  // std::cout << "ConversionTrackCandidateProducer Barrel OutIn Tracks Number of hits " << (*it).foundHits() << "\n";
434  }
435 
436  for (auto it = theInOutTracks.begin(); it != theInOutTracks.end(); ++it) {
437  vecRecIO.push_back(aClus);
438  // std::cout << "ConversionTrackCandidateProducer Barrel InOut Tracks Number of hits " << (*it).foundHits() << "\n";
439  }
440  }
441 }
std::vector< Trajectory > tracks(const TrajectorySeedCollection &seeds, TrackCandidateCollection &candidates) const override
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:153
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:148
virtual void setCandidate(float e, GlobalPoint pos)
TrajectorySeedCollection & seeds()
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:180
std::vector< Trajectory > tracks(const TrajectorySeedCollection &seeds, TrackCandidateCollection &candidate) const override

◆ fillDescriptions()

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

Definition at line 443 of file ConversionTrackCandidateProducer.cc.

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

443  {
444  // conversionTrackCandidates
446 
447  desc.add<edm::InputTag>("bcBarrelCollection", {"particleFlowSuperClusterECAL", "particleFlowBasicClusterECALBarrel"});
448  desc.add<edm::InputTag>("bcEndcapCollection", {"particleFlowSuperClusterECAL", "particleFlowBasicClusterECALEndcap"});
449  desc.add<edm::InputTag>("scHybridBarrelProducer",
450  {"particleFlowSuperClusterECAL", "particleFlowSuperClusterECALBarrel"});
451  desc.add<edm::InputTag>("scIslandEndcapProducer",
452  {"particleFlowSuperClusterECAL", "particleFlowSuperClusterECALEndcapWithPreshower"});
453 
454  desc.add<std::string>("outInTrackCandidateSCAssociationCollection", "outInTrackCandidateSCAssociationCollection");
455  desc.add<std::string>("inOutTrackCandidateSCAssociationCollection", "inOutTrackCandidateSCAssociationCollection");
456  desc.add<std::string>("outInTrackCandidateCollection", "outInTracksFromConversions");
457  desc.add<std::string>("inOutTrackCandidateCollection", "inOutTracksFromConversions");
458 
459  desc.add<edm::InputTag>("barrelEcalRecHitCollection", {"ecalRecHit", "EcalRecHitsEB"});
460  desc.add<edm::InputTag>("endcapEcalRecHitCollection", {"ecalRecHit", "EcalRecHitsEE"});
461  desc.add<std::string>("MeasurementTrackerName", "");
462  desc.add<std::string>("OutInRedundantSeedCleaner", "CachingSeedCleanerBySharedInput");
463  desc.add<std::string>("InOutRedundantSeedCleaner", "CachingSeedCleanerBySharedInput");
464  desc.add<bool>("useHitsSplitting", false);
465  desc.add<int>("maxNumOfSeedsOutIn", 50);
466  desc.add<int>("maxNumOfSeedsInOut", 50);
467  desc.add<double>("bcEtCut", 1.5);
468  desc.add<double>("bcECut", 1.5);
469  desc.add<bool>("useEtCut", true);
470 
471  desc.add<edm::InputTag>("hbheRecHits", {"hbhereco"});
472  desc.add<std::vector<double>>("recHitEThresholdHB", {0., 0., 0., 0.});
473  desc.add<std::vector<double>>("recHitEThresholdHE", {0., 0., 0., 0., 0., 0., 0.});
474  desc.add<bool>("usePFThresholdsFromDB", false);
475  desc.add<int>("maxHcalRecHitSeverity", 999999);
476 
477  desc.add<double>("minSCEt", 20.0);
478  desc.add<double>("hOverEConeSize", 0.15);
479  desc.add<double>("maxHOverE", 0.15);
480  desc.add<double>("isoInnerConeR", 3.5);
481  desc.add<double>("isoConeR", 0.4);
482  desc.add<double>("isoEtaSlice", 2.5);
483  desc.add<double>("isoEtMin", 0.0);
484  desc.add<double>("isoEMin", 0.08);
485  desc.add<bool>("vetoClusteredHits", false);
486  desc.add<bool>("useNumXstals", true);
487  desc.add<double>("ecalIsoCut_offset", 999999999); // alternative value: 4.2
488  desc.add<double>("ecalIsoCut_slope", 0.0); // alternative value: 0.003
489 
490  desc.add<std::vector<std::string>>("RecHitFlagToBeExcludedEB", {});
491  desc.add<std::vector<std::string>>("RecHitSeverityToBeExcludedEB", {});
492  desc.add<std::vector<std::string>>("RecHitFlagToBeExcludedEE", {});
493  desc.add<std::vector<std::string>>("RecHitSeverityToBeExcludedEE", {});
494 
495  desc.add<double>("fractionShared", 0.5);
496  desc.add<std::string>("TrajectoryBuilder", "TrajectoryBuilderForConversions");
497  {
499  psd0.setUnknown();
500  desc.add<edm::ParameterSetDescription>("TrajectoryBuilderPSet", psd0);
501  }
502  {
504  psd0.add<std::string>("propagatorAlongTISE", "alongMomElePropagator");
505  psd0.add<int>("numberMeasurementsForFit", 4);
506  psd0.add<std::string>("propagatorOppositeTISE", "oppositeToMomElePropagator");
507  desc.add<edm::ParameterSetDescription>("TransientInitialStateEstimatorParameters", psd0);
508  }
509  desc.add<bool>("allowSharedFirstHit", true);
510  desc.add<double>("ValidHitBonus", 5.0);
511  desc.add<double>("MissingHitPenalty", 20.0);
512 
513  descriptions.add("conversionTrackCandidatesDefault", desc);
514  // or use the following to generate the label from the module's C++ type
515  //descriptions.addWithDefaultLabel(desc);
516 }
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 244 of file ConversionTrackCandidateProducer.cc.

References barrelecalCollection_, bcBarrelCollection_, bcEndcapCollection_, buildCollections(), caloPtrVecInOut_, caloPtrVecOutIn_, ConversionSeedFinder::clear(), ecalPFRechitThresholdsToken_, 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_, theTrajectoryBuilder_, and thresholds.

244  {
245  // get the trajectory builder and initialize it with the data
246  theTrajectoryBuilder_->setEvent(theEvent, theEventSetup, &theEvent.get(measurementTrkEvtToken_));
247 
248  // this need to be done after the initialization of the TrajectoryBuilder!
249  setEventSetup(theEventSetup);
250 
251  outInSeedFinder_.setEvent(theEvent);
252  inOutSeedFinder_.setEvent(theEvent);
253 
254  //
255  // create empty output collections
256  //
257  // Out In Track Candidates
258  auto outInTrackCandidate_p = std::make_unique<TrackCandidateCollection>();
259  // In Out Track Candidates
260  auto inOutTrackCandidate_p = std::make_unique<TrackCandidateCollection>();
261  // Track Candidate calo Cluster Association
262  auto outInAssoc_p = std::make_unique<reco::TrackCandidateCaloClusterPtrAssociation>();
263  auto inOutAssoc_p = std::make_unique<reco::TrackCandidateCaloClusterPtrAssociation>();
264 
265  // Get the basic cluster collection in the Barrel
266  bool validBarrelBCHandle = true;
267  auto bcBarrelHandle = theEvent.getHandle(bcBarrelCollection_);
268  if (!bcBarrelHandle.isValid()) {
269  edm::LogError("ConversionTrackCandidateProducer") << "Error! Can't get the Barrel Basic Clusters!";
270  validBarrelBCHandle = false;
271  }
272 
273  // Get the basic cluster collection in the Endcap
274  bool validEndcapBCHandle = true;
275  auto bcEndcapHandle = theEvent.getHandle(bcEndcapCollection_);
276  if (!bcEndcapHandle.isValid()) {
277  edm::LogError("CoonversionTrackCandidateProducer") << "Error! Can't get the Endcap Basic Clusters";
278  validEndcapBCHandle = false;
279  }
280 
281  // Get the Super Cluster collection in the Barrel
282  bool validBarrelSCHandle = true;
283  auto scBarrelHandle = theEvent.getHandle(scHybridBarrelProducer_);
284  if (!scBarrelHandle.isValid()) {
285  edm::LogError("CoonversionTrackCandidateProducer") << "Error! Can't get the barrel superclusters!";
286  validBarrelSCHandle = false;
287  }
288 
289  // Get the Super Cluster collection in the Endcap
290  bool validEndcapSCHandle = true;
291  auto scEndcapHandle = theEvent.getHandle(scIslandEndcapProducer_);
292  if (!scEndcapHandle.isValid()) {
293  edm::LogError("CoonversionTrackCandidateProducer") << "Error! Can't get the endcap superclusters!";
294  validEndcapSCHandle = false;
295  }
296 
297  thresholds = &theEventSetup.getData(ecalPFRechitThresholdsToken_);
298 
299  // get the geometry from the event setup:
300  theCaloGeom_ = theEventSetup.getHandle(theCaloGeomToken_);
301 
302  hcalHelper_->beginEvent(theEvent, theEventSetup);
303 
304  auto const& ecalhitsCollEB = theEvent.get(barrelecalCollection_);
305  auto const& ecalhitsCollEE = theEvent.get(endcapecalCollection_);
306 
307  const EcalSeverityLevelAlgo* sevLevel = &theEventSetup.getData(sevlvToken_);
308 
309  caloPtrVecOutIn_.clear();
310  caloPtrVecInOut_.clear();
311 
312  bool isBarrel = true;
313  if (validBarrelBCHandle && validBarrelSCHandle)
315  scBarrelHandle,
316  bcBarrelHandle,
317  ecalhitsCollEB,
318  sevLevel,
319  *hcalHelper_,
320  *outInTrackCandidate_p,
321  *inOutTrackCandidate_p,
324 
325  if (validEndcapBCHandle && validEndcapSCHandle) {
326  isBarrel = false;
328  scEndcapHandle,
329  bcEndcapHandle,
330  ecalhitsCollEE,
331  sevLevel,
332  *hcalHelper_,
333  *outInTrackCandidate_p,
334  *inOutTrackCandidate_p,
337  }
338 
339  // std::cout << " ConversionTrackCandidateProducer caloPtrVecOutIn_ size " << caloPtrVecOutIn_.size() << " caloPtrVecInOut_ size " << caloPtrVecInOut_.size() << "\n";
340 
341  // put all products in the event
342  // Barrel
343  //std::cout << "ConversionTrackCandidateProducer Putting in the event " << (*outInTrackCandidate_p).size() << " Out In track Candidates " << "\n";
344  auto const refprodOutInTrackC = theEvent.put(std::move(outInTrackCandidate_p), OutInTrackCandidateCollection_);
345  //std::cout << "ConversionTrackCandidateProducer refprodOutInTrackC size " << (*(refprodOutInTrackC.product())).size() << "\n";
346  //
347  //std::cout << "ConversionTrackCandidateProducer Putting in the event " << (*inOutTrackCandidate_p).size() << " In Out track Candidates " << "\n";
348  auto const refprodInOutTrackC = theEvent.put(std::move(inOutTrackCandidate_p), InOutTrackCandidateCollection_);
349  //std::cout << "ConversionTrackCandidateProducer refprodInOutTrackC size " << (*(refprodInOutTrackC.product())).size() << "\n";
350 
351  edm::ValueMap<reco::CaloClusterPtr>::Filler fillerOI(*outInAssoc_p);
352  fillerOI.insert(refprodOutInTrackC, caloPtrVecOutIn_.begin(), caloPtrVecOutIn_.end());
353  fillerOI.fill();
354  edm::ValueMap<reco::CaloClusterPtr>::Filler fillerIO(*inOutAssoc_p);
355  fillerIO.insert(refprodInOutTrackC, caloPtrVecInOut_.begin(), caloPtrVecInOut_.end());
356  fillerIO.fill();
357 
358  // std::cout << "ConversionTrackCandidateProducer Putting in the event OutIn track - SC association: size " << (*outInAssoc_p).size() << "\n";
359  theEvent.put(std::move(outInAssoc_p), OutInTrackSCAssociationCollection_);
360 
361  // std::cout << "ConversionTrackCandidateProducer Putting in the event InOut track - SC association: size " << (*inOutAssoc_p).size() << "\n";
362  theEvent.put(std::move(inOutAssoc_p), InOutTrackSCAssociationCollection_);
363 
366 }
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_
const edm::ESGetToken< EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcd > ecalPFRechitThresholdsToken_
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 226 of file ConversionTrackCandidateProducer.cc.

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

Referenced by produce().

226  {
227  outInSeedFinder_.setEventSetup(theEventSetup);
228  inOutSeedFinder_.setEventSetup(theEventSetup);
229  outInTrackFinder_.setEventSetup(theEventSetup);
230  inOutTrackFinder_.setEventSetup(theEventSetup);
231 }
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 74 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ bcBarrelCollection_

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

Definition at line 69 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ bcEndcapCollection_

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

Definition at line 70 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ caloPtrVecInOut_

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

Definition at line 113 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ caloPtrVecOutIn_

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

Definition at line 112 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ cutsFromDB

bool ConversionTrackCandidateProducer::cutsFromDB
private

Definition at line 121 of file ConversionTrackCandidateProducer.cc.

Referenced by beginRun().

◆ ecalIsoCut_offset_

double ConversionTrackCandidateProducer::ecalIsoCut_offset_
private

Definition at line 100 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ ecalIsoCut_slope_

double ConversionTrackCandidateProducer::ecalIsoCut_slope_
private

Definition at line 101 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ ecalPFRechitThresholdsToken_

const edm::ESGetToken<EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcd> ConversionTrackCandidateProducer::ecalPFRechitThresholdsToken_
private

Definition at line 81 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ endcapecalCollection_

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

Definition at line 75 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ flagsexclEB_

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

Definition at line 95 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ flagsexclEE_

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

Definition at line 96 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ hbheRecHits_

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

Definition at line 73 of file ConversionTrackCandidateProducer.cc.

◆ hcalCuts

HcalPFCuts const* ConversionTrackCandidateProducer::hcalCuts = nullptr
private

Definition at line 122 of file ConversionTrackCandidateProducer.cc.

Referenced by beginRun(), and buildCollections().

◆ hcalCutsToken_

edm::ESGetToken<HcalPFCuts, HcalPFCutsRcd> ConversionTrackCandidateProducer::hcalCutsToken_
private

Definition at line 120 of file ConversionTrackCandidateProducer.cc.

Referenced by beginRun().

◆ hcalHelper_

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

Definition at line 118 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ hOverEConeSize_

double ConversionTrackCandidateProducer::hOverEConeSize_
private

Definition at line 84 of file ConversionTrackCandidateProducer.cc.

◆ inOutSeedFinder_

InOutConversionSeedFinder ConversionTrackCandidateProducer::inOutSeedFinder_
private

◆ InOutTrackCandidateCollection_

std::string ConversionTrackCandidateProducer::InOutTrackCandidateCollection_
private

Definition at line 64 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ inOutTrackFinder_

InOutConversionTrackFinder ConversionTrackCandidateProducer::inOutTrackFinder_
private

Definition at line 110 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections(), and setEventSetup().

◆ InOutTrackSCAssociationCollection_

std::string ConversionTrackCandidateProducer::InOutTrackSCAssociationCollection_
private

Definition at line 67 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ isoConeR_

double ConversionTrackCandidateProducer::isoConeR_
private

Definition at line 87 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ isoEMin_

double ConversionTrackCandidateProducer::isoEMin_
private

Definition at line 91 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ isoEtaSlice_

double ConversionTrackCandidateProducer::isoEtaSlice_
private

Definition at line 89 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ isoEtMin_

double ConversionTrackCandidateProducer::isoEtMin_
private

Definition at line 90 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ isoInnerConeR_

double ConversionTrackCandidateProducer::isoInnerConeR_
private

Definition at line 88 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ maxHOverE_

double ConversionTrackCandidateProducer::maxHOverE_
private

Definition at line 85 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ measurementTrkEvtToken_

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

Definition at line 76 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ minSCEt_

double ConversionTrackCandidateProducer::minSCEt_
private

Definition at line 86 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ navToken_

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

Definition at line 78 of file ConversionTrackCandidateProducer.cc.

Referenced by beginRun().

◆ outInSeedFinder_

OutInConversionSeedFinder ConversionTrackCandidateProducer::outInSeedFinder_
private

◆ OutInTrackCandidateCollection_

std::string ConversionTrackCandidateProducer::OutInTrackCandidateCollection_
private

Definition at line 63 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ outInTrackFinder_

OutInConversionTrackFinder ConversionTrackCandidateProducer::outInTrackFinder_
private

Definition at line 108 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections(), and setEventSetup().

◆ OutInTrackSCAssociationCollection_

std::string ConversionTrackCandidateProducer::OutInTrackSCAssociationCollection_
private

Definition at line 66 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ scHybridBarrelProducer_

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

Definition at line 71 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ scIslandEndcapProducer_

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

Definition at line 72 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ severitiesexclEB_

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

Definition at line 97 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ severitiesexclEE_

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

Definition at line 98 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ sevlvToken_

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

Definition at line 80 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ theCaloGeom_

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

Definition at line 103 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections(), and produce().

◆ theCaloGeomToken_

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

Definition at line 79 of file ConversionTrackCandidateProducer.cc.

Referenced by produce().

◆ theTrajectoryBuilder_

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

Definition at line 105 of file ConversionTrackCandidateProducer.cc.

Referenced by beginRun(), and produce().

◆ thresholds

const EcalPFRecHitThresholds* ConversionTrackCandidateProducer::thresholds = nullptr
private

Definition at line 82 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections(), and produce().

◆ useNumXtals_

bool ConversionTrackCandidateProducer::useNumXtals_
private

Definition at line 93 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().

◆ vecOfSCRefForInOut

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

Definition at line 116 of file ConversionTrackCandidateProducer.cc.

◆ vecOfSCRefForOutIn

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

Definition at line 115 of file ConversionTrackCandidateProducer.cc.

◆ vetoClusteredHits_

bool ConversionTrackCandidateProducer::vetoClusteredHits_
private

Definition at line 92 of file ConversionTrackCandidateProducer.cc.

Referenced by buildCollections().