CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ConversionTrackCandidateProducer Class Reference

#include <ConversionTrackCandidateProducer.h>

Inheritance diagram for ConversionTrackCandidateProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginRun (edm::Run const &, edm::EventSetup const &es) override final
 
 ConversionTrackCandidateProducer (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &evt, const edm::EventSetup &es) override
 
 ~ConversionTrackCandidateProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void buildCollections (bool detector, const edm::Handle< edm::View< reco::CaloCluster > > &scHandle, const edm::Handle< edm::View< reco::CaloCluster > > &bcHandle, edm::Handle< EcalRecHitCollection > ecalRecHitHandle, const EcalRecHitCollection &ecalRecHits, const EcalSeverityLevelAlgo *sevLev, const edm::Handle< CaloTowerCollection > &hcalTowersHandle, 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< CaloTowerCollectionhcalTowers_
 
double hOverEConeSize_
 
std::string InOutTrackCandidateCollection_
 
std::string InOutTrackSuperClusterAssociationCollection_
 
double isoConeR_
 
double isoEMin_
 
double isoEtaSlice_
 
double isoEtMin_
 
double isoInnerConeR_
 
double maxHOverE_
 
edm::EDGetTokenT< MeasurementTrackerEventmeasurementTrkEvtToken_
 
double minSCEt_
 
int nEvt_
 
std::string OutInTrackCandidateCollection_
 
std::string OutInTrackSuperClusterAssociationCollection_
 
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scHybridBarrelProducer_
 
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scIslandEndcapProducer_
 
std::vector< int > severitiesexclEB_
 
std::vector< int > severitiesexclEE_
 
edm::ESHandle< CaloGeometrytheCaloGeom_
 
std::unique_ptr< InOutConversionSeedFindertheInOutSeedFinder_
 
std::unique_ptr< InOutConversionTrackFindertheInOutTrackFinder_
 
std::unique_ptr< OutInConversionSeedFindertheOutInSeedFinder_
 
std::unique_ptr< OutInConversionTrackFindertheOutInTrackFinder_
 
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<>
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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Author
Nancy Marinelli, U. of Notre Dame, US

Definition at line 37 of file ConversionTrackCandidateProducer.h.

Constructor & Destructor Documentation

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

Definition at line 55 of file ConversionTrackCandidateProducer.cc.

References barrelecalCollection_, bcBarrelCollection_, bcEndcapCollection_, ecalIsoCut_offset_, ecalIsoCut_slope_, endcapecalCollection_, flagsexclEB_, flagsexclEE_, edm::ParameterSet::getParameter(), hcalTowers_, hOverEConeSize_, InOutTrackCandidateCollection_, InOutTrackSuperClusterAssociationCollection_, isoConeR_, isoEMin_, isoEtaSlice_, isoEtMin_, isoInnerConeR_, maxHOverE_, measurementTrkEvtToken_, minSCEt_, nEvt_, OutInTrackCandidateCollection_, OutInTrackSuperClusterAssociationCollection_, scHybridBarrelProducer_, scIslandEndcapProducer_, severitiesexclEB_, severitiesexclEE_, AlCaHLTBitMon_QueryRunRegistry::string, useNumXtals_, and vetoClusteredHits_.

55  :
56  theTrajectoryBuilder_(createBaseCkfTrajectoryBuilder(config.getParameter<edm::ParameterSet>("TrajectoryBuilderPSet"), consumesCollector())),
61 {
62  //std::cout << "ConversionTrackCandidateProducer CTOR " << "\n";
63  nEvt_=0;
64 
65  // use onfiguration file to setup input/output collection names
66 
67 
69  consumes<edm::View<reco::CaloCluster> >(config.getParameter<edm::InputTag>("bcBarrelCollection"));
71  consumes<edm::View<reco::CaloCluster> >(config.getParameter<edm::InputTag>("bcEndcapCollection"));
72 
74  consumes<edm::View<reco::CaloCluster> >(config.getParameter<edm::InputTag>("scHybridBarrelProducer"));
76  consumes<edm::View<reco::CaloCluster> >(config.getParameter<edm::InputTag>("scIslandEndcapProducer"));
77 
78  OutInTrackCandidateCollection_ = config.getParameter<std::string>("outInTrackCandidateCollection");
79  InOutTrackCandidateCollection_ = config.getParameter<std::string>("inOutTrackCandidateCollection");
80 
81 
82  OutInTrackSuperClusterAssociationCollection_ = config.getParameter<std::string>("outInTrackCandidateSCAssociationCollection");
83  InOutTrackSuperClusterAssociationCollection_ = config.getParameter<std::string>("inOutTrackCandidateSCAssociationCollection");
84 
86  consumes<EcalRecHitCollection>(config.getParameter<edm::InputTag>("barrelEcalRecHitCollection"));
88  consumes<EcalRecHitCollection>(config.getParameter<edm::InputTag>("endcapEcalRecHitCollection"));
89  hcalTowers_ =
90  consumes<CaloTowerCollection>(config.getParameter<edm::InputTag>("hcalTowers"));
92  consumes<MeasurementTrackerEvent>(edm::InputTag("MeasurementTrackerEvent"));
93  hOverEConeSize_ = config.getParameter<double>("hOverEConeSize");
94  maxHOverE_ = config.getParameter<double>("maxHOverE");
95  minSCEt_ = config.getParameter<double>("minSCEt");
96  isoConeR_ = config.getParameter<double>("isoConeR");
97  isoInnerConeR_ = config.getParameter<double>("isoInnerConeR");
98  isoEtaSlice_ = config.getParameter<double>("isoEtaSlice");
99  isoEtMin_ = config.getParameter<double>("isoEtMin");
100  isoEMin_ = config.getParameter<double>("isoEMin");
101  vetoClusteredHits_ = config.getParameter<bool>("vetoClusteredHits");
102  useNumXtals_ = config.getParameter<bool>("useNumXstals");
103  ecalIsoCut_offset_ = config.getParameter<double>("ecalIsoCut_offset");
104  ecalIsoCut_slope_ = config.getParameter<double>("ecalIsoCut_slope");
105 
106  //Flags and Severities to be excluded from photon calculations
107  const std::vector<std::string> flagnamesEB =
108  config.getParameter<std::vector<std::string> >("RecHitFlagToBeExcludedEB");
109 
110  const std::vector<std::string> flagnamesEE =
111  config.getParameter<std::vector<std::string> >("RecHitFlagToBeExcludedEE");
112 
113  flagsexclEB_=
114  StringToEnumValue<EcalRecHit::Flags>(flagnamesEB);
115 
116  flagsexclEE_=
117  StringToEnumValue<EcalRecHit::Flags>(flagnamesEE);
118 
119  const std::vector<std::string> severitynamesEB =
120  config.getParameter<std::vector<std::string> >("RecHitSeverityToBeExcludedEB");
121 
123  StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEB);
124 
125  const std::vector<std::string> severitynamesEE =
126  config.getParameter<std::vector<std::string> >("RecHitSeverityToBeExcludedEE");
127 
129  StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEE);
130 
131  // Register the product
132  produces< TrackCandidateCollection > (OutInTrackCandidateCollection_);
133  produces< TrackCandidateCollection > (InOutTrackCandidateCollection_);
134 
135  produces< reco::TrackCandidateCaloClusterPtrAssociation > ( OutInTrackSuperClusterAssociationCollection_);
136  produces< reco::TrackCandidateCaloClusterPtrAssociation > ( InOutTrackSuperClusterAssociationCollection_);
137 
138 
139 }
std::unique_ptr< OutInConversionSeedFinder > theOutInSeedFinder_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scIslandEndcapProducer_
edm::EDGetTokenT< EcalRecHitCollection > endcapecalCollection_
Definition: config.py:1
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrkEvtToken_
std::unique_ptr< BaseCkfTrajectoryBuilder > theTrajectoryBuilder_
std::unique_ptr< OutInConversionTrackFinder > theOutInTrackFinder_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< CaloTowerCollection > hcalTowers_
std::unique_ptr< InOutConversionSeedFinder > theInOutSeedFinder_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scHybridBarrelProducer_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcBarrelCollection_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcEndcapCollection_
std::unique_ptr< InOutConversionTrackFinder > theInOutTrackFinder_
edm::EDGetTokenT< EcalRecHitCollection > barrelecalCollection_
ConversionTrackCandidateProducer::~ConversionTrackCandidateProducer ( )

Definition at line 141 of file ConversionTrackCandidateProducer.cc.

141 {}

Member Function Documentation

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

Reimplemented from edm::stream::EDProducerBase.

Definition at line 151 of file ConversionTrackCandidateProducer.cc.

References edm::EventSetup::get(), edm::ESHandle< T >::product(), theInOutSeedFinder_, theOutInSeedFinder_, and theTrajectoryBuilder_.

151  {
152 
154  theEventSetup.get<NavigationSchoolRecord>().get("SimpleNavigationSchool", nav);
155  const NavigationSchool *navigation = nav.product();
156  theTrajectoryBuilder_->setNavigationSchool(navigation);
157  theOutInSeedFinder_->setNavigationSchool(navigation);
158  theInOutSeedFinder_->setNavigationSchool(navigation);
159 }
std::unique_ptr< OutInConversionSeedFinder > theOutInSeedFinder_
std::unique_ptr< BaseCkfTrajectoryBuilder > theTrajectoryBuilder_
std::unique_ptr< InOutConversionSeedFinder > theInOutSeedFinder_
T const * product() const
Definition: ESHandle.h:86
void ConversionTrackCandidateProducer::buildCollections ( bool  detector,
const edm::Handle< edm::View< reco::CaloCluster > > &  scHandle,
const edm::Handle< edm::View< reco::CaloCluster > > &  bcHandle,
edm::Handle< EcalRecHitCollection ecalRecHitHandle,
const EcalRecHitCollection ecalRecHits,
const EcalSeverityLevelAlgo sevLev,
const edm::Handle< CaloTowerCollection > &  hcalTowersHandle,
TrackCandidateCollection outInTracks,
TrackCandidateCollection inOutTracks,
std::vector< edm::Ptr< reco::CaloCluster > > &  vecRecOI,
std::vector< edm::Ptr< reco::CaloCluster > > &  vecRecIO 
)
private

Definition at line 308 of file ConversionTrackCandidateProducer.cc.

References caloPtrVecInOut_, caloPtrVecOutIn_, EgammaRecHitIsolation::doFlagChecks(), EgammaRecHitIsolation::doSeverityChecks(), DetId::Ecal, ecalIsoCut_offset_, ecalIsoCut_slope_, RecoTauCleanerPlugins::ecalIsolation, reco::CaloCluster::energy(), reco::CaloCluster::eta(), flagsexclEB_, flagsexclEE_, EgammaRecHitIsolation::getEtSum(), EgammaTowerIsolation::getTowerESum(), hOverEConeSize_, mps_fire::i, isoConeR_, isoEMin_, isoEtaSlice_, isoEtMin_, isoInnerConeR_, maxHOverE_, minSCEt_, reco::CaloCluster::position(), edm::Handle< T >::product(), SimDataFormats::CaloAnalysis::sc, EgammaRecHitIsolation::setUseNumCrystals(), EgammaRecHitIsolation::setVetoClustered(), severitiesexclEB_, severitiesexclEE_, theCaloGeom_, theInOutSeedFinder_, theInOutTrackFinder_, theOutInSeedFinder_, theOutInTrackFinder_, useNumXtals_, and vetoClusteredHits_.

Referenced by produce().

322 {
323 
324  //std::cout << "ConversionTrackCandidateProducer is barrel " << isBarrel << "\n";
325  //std::cout << "ConversionTrackCandidateProducer builcollections sc size " << scHandle->size() << "\n";
326  //std::cout << "ConversionTrackCandidateProducer builcollections bc size " << bcHandle->size() << "\n";
327  //const CaloGeometry* geometry = theCaloGeom_.product();
328 
329  // Loop over SC in the barrel and reconstruct converted photons
330  for (unsigned i = 0; i < scHandle->size(); ++i ) {
331 
332  reco::CaloClusterPtr aClus= scHandle->ptrAt(i);
333 
334  // preselection based in Et and H/E cut.
335  if (aClus->energy()/cosh(aClus->eta()) <= minSCEt_) continue;
336  if (aClus->eta() > 1.479 && aClus->eta() < 1.556 ) continue;
337 
338  const reco::CaloCluster* pClus=&(*aClus);
339  const reco::SuperCluster* sc=dynamic_cast<const reco::SuperCluster*>(pClus);
340  double scEt = sc->energy()/cosh(sc->eta());
341  const CaloTowerCollection* hcalTowersColl = hcalTowersHandle.product();
342  EgammaTowerIsolation towerIso(hOverEConeSize_,0.,0.,-1,hcalTowersColl) ;
343  double HoE = towerIso.getTowerESum(sc)/sc->energy();
344  if (HoE >= maxHOverE_) continue;
345 
349  isoEtaSlice_,
350  isoEtMin_,
351  isoEMin_,
352  theCaloGeom_,
353  ecalRecHits,
354  sevLevel,
355  DetId::Ecal);
356 
357  ecalIso.setVetoClustered(vetoClusteredHits_);
358  ecalIso.setUseNumCrystals(useNumXtals_);
359  if (isBarrel) {
360  ecalIso.doFlagChecks(flagsexclEB_);
361  ecalIso.doSeverityChecks(ecalRecHitHandle.product(), severitiesexclEB_);
362  } else {
363  ecalIso.doFlagChecks(flagsexclEE_);
364  ecalIso.doSeverityChecks(ecalRecHitHandle.product(), severitiesexclEE_);
365  }
366 
367  double ecalIsolation = ecalIso.getEtSum(sc);
368  if ( ecalIsolation > ecalIsoCut_offset_ + ecalIsoCut_slope_*scEt ) continue;
369 
370  // Now launch the seed finding
371  theOutInSeedFinder_->setCandidate(pClus->energy(), GlobalPoint(pClus->position().x(),pClus->position().y(),pClus->position().z() ) );
372  theOutInSeedFinder_->makeSeeds( bcHandle );
373 
374  std::vector<Trajectory> theOutInTracks= theOutInTrackFinder_->tracks(theOutInSeedFinder_->seeds(), outInTrackCandidates);
375 
376  theInOutSeedFinder_->setCandidate(pClus->energy(), GlobalPoint(pClus->position().x(),pClus->position().y(),pClus->position().z() ) );
377  theInOutSeedFinder_->setTracks( theOutInTracks );
378  theInOutSeedFinder_->makeSeeds( bcHandle);
379 
380  std::vector<Trajectory> theInOutTracks= theInOutTrackFinder_->tracks(theInOutSeedFinder_->seeds(), inOutTrackCandidates);
381 
382  // Debug
383  // 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";
384 
385 
387  for (std::vector<Trajectory>::const_iterator it = theOutInTracks.begin(); it != theOutInTracks.end(); ++it) {
388  caloPtrVecOutIn_.push_back(aClus);
389  // std::cout << "ConversionTrackCandidateProducer Barrel OutIn Tracks Number of hits " << (*it).foundHits() << "\n";
390  }
391 
392  for (std::vector<Trajectory>::const_iterator it = theInOutTracks.begin(); it != theInOutTracks.end(); ++it) {
393  caloPtrVecInOut_.push_back(aClus);
394  // std::cout << "ConversionTrackCandidateProducer Barrel InOut Tracks Number of hits " << (*it).foundHits() << "\n";
395  }
396  }
397 }
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:129
std::unique_ptr< OutInConversionSeedFinder > theOutInSeedFinder_
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::vector< edm::Ptr< reco::CaloCluster > > caloPtrVecInOut_
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:166
std::unique_ptr< OutInConversionTrackFinder > theOutInTrackFinder_
double energy() const
cluster energy
Definition: CaloCluster.h:124
std::unique_ptr< InOutConversionSeedFinder > theInOutSeedFinder_
std::vector< edm::Ptr< reco::CaloCluster > > caloPtrVecOutIn_
T const * product() const
Definition: Handle.h:81
std::unique_ptr< InOutConversionTrackFinder > theInOutTrackFinder_
void ConversionTrackCandidateProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
overridevirtual

Definition at line 162 of file ConversionTrackCandidateProducer.cc.

References barrelecalCollection_, bcBarrelCollection_, bcEndcapCollection_, buildCollections(), caloPtrVecInOut_, caloPtrVecOutIn_, data, endcapecalCollection_, edm::helper::Filler< Map >::fill(), edm::EventSetup::get(), edm::Event::getByToken(), hcalTowers_, InOutTrackCandidateCollection_, InOutTrackSuperClusterAssociationCollection_, edm::helper::Filler< Map >::insert(), gedGsfElectrons_cfi::isBarrel, edm::HandleBase::isValid(), measurementTrkEvtToken_, eostools::move(), nEvt_, OutInTrackCandidateCollection_, OutInTrackSuperClusterAssociationCollection_, edm::ESHandle< T >::product(), edm::Event::put(), scHybridBarrelProducer_, scIslandEndcapProducer_, setEventSetup(), theCaloGeom_, theInOutSeedFinder_, theOutInSeedFinder_, and theTrajectoryBuilder_.

162  {
163 
164  using namespace edm;
165  nEvt_++;
166  // std::cout << "ConversionTrackCandidateProducer Analyzing event number " << theEvent.id() << " Global Counter " << nEvt_ << "\n";
167 
168 
169 
170  // get the trajectory builder and initialize it with the data
172  theEvent.getByToken( measurementTrkEvtToken_, data);
173  theTrajectoryBuilder_->setEvent(theEvent, theEventSetup, &*data);
174 
175 
176  // this need to be done after the initialization of the TrajectoryBuilder!
177  setEventSetup( theEventSetup );
178 
179 
180 
181  theOutInSeedFinder_->setEvent(theEvent);
182  theInOutSeedFinder_->setEvent(theEvent);
183 
184  //
185  // create empty output collections
186  //
187  // Out In Track Candidates
188  auto outInTrackCandidate_p = std::make_unique<TrackCandidateCollection>();
189  // In Out Track Candidates
190  auto inOutTrackCandidate_p = std::make_unique<TrackCandidateCollection>();
191  // Track Candidate calo Cluster Association
192  auto outInAssoc_p = std::make_unique<reco::TrackCandidateCaloClusterPtrAssociation>();
193  auto inOutAssoc_p = std::make_unique<reco::TrackCandidateCaloClusterPtrAssociation>();
194 
195  // Get the basic cluster collection in the Barrel
196  bool validBarrelBCHandle=true;
198  theEvent.getByToken(bcBarrelCollection_, bcBarrelHandle);
199  if (!bcBarrelHandle.isValid()) {
200  edm::LogError("ConversionTrackCandidateProducer")
201  << "Error! Can't get the Barrel Basic Clusters!";
202  validBarrelBCHandle=false;
203  }
204 
205 
206  // Get the basic cluster collection in the Endcap
207  bool validEndcapBCHandle=true;
209  theEvent.getByToken(bcEndcapCollection_, bcEndcapHandle);
210  if (!bcEndcapHandle.isValid()) {
211  edm::LogError("CoonversionTrackCandidateProducer")
212  << "Error! Can't get the Endcap Basic Clusters";
213  validEndcapBCHandle=false;
214  }
215 
216 
217 
218  // Get the Super Cluster collection in the Barrel
219  bool validBarrelSCHandle=true;
221  theEvent.getByToken(scHybridBarrelProducer_,scBarrelHandle);
222  if (!scBarrelHandle.isValid()) {
223  edm::LogError("CoonversionTrackCandidateProducer")
224  << "Error! Can't get the barrel superclusters!";
225  validBarrelSCHandle=false;
226  }
227 
228 
229  // Get the Super Cluster collection in the Endcap
230  bool validEndcapSCHandle=true;
232  theEvent.getByToken(scIslandEndcapProducer_,scEndcapHandle);
233  if (!scEndcapHandle.isValid()) {
234  edm::LogError("CoonversionTrackCandidateProducer")
235  << "Error! Can't get the endcap superclusters!";
236  validEndcapSCHandle=false;
237  }
238 
239 
240  // get the geometry from the event setup:
241  theEventSetup.get<CaloGeometryRecord>().get(theCaloGeom_);
242 
243  // get Hcal towers collection
244  Handle<CaloTowerCollection> hcalTowersHandle;
245  theEvent.getByToken(hcalTowers_, hcalTowersHandle);
246 
247  edm::Handle<EcalRecHitCollection> ecalhitsCollEB;
248  edm::Handle<EcalRecHitCollection> ecalhitsCollEE;
249 
250  theEvent.getByToken(endcapecalCollection_, ecalhitsCollEE);
251  theEvent.getByToken(barrelecalCollection_, ecalhitsCollEB);
252 
254  theEventSetup.get<EcalSeverityLevelAlgoRcd>().get(sevlv);
255  const EcalSeverityLevelAlgo* sevLevel = sevlv.product();
256 
257  caloPtrVecOutIn_.clear();
258  caloPtrVecInOut_.clear();
259 
260  bool isBarrel=true;
261  if ( validBarrelBCHandle && validBarrelSCHandle )
262  buildCollections(isBarrel, scBarrelHandle, bcBarrelHandle, ecalhitsCollEB, *ecalhitsCollEB, sevLevel, hcalTowersHandle, *outInTrackCandidate_p, *inOutTrackCandidate_p, caloPtrVecOutIn_, caloPtrVecInOut_);
263 
264  if ( validEndcapBCHandle && validEndcapSCHandle ) {
265  isBarrel=false;
266  buildCollections(isBarrel, scEndcapHandle, bcEndcapHandle, ecalhitsCollEE, *ecalhitsCollEE, sevLevel, hcalTowersHandle, *outInTrackCandidate_p, *inOutTrackCandidate_p, caloPtrVecOutIn_, caloPtrVecInOut_);
267  }
268 
269 
270  // std::cout << " ConversionTrackCandidateProducer caloPtrVecOutIn_ size " << caloPtrVecOutIn_.size() << " caloPtrVecInOut_ size " << caloPtrVecInOut_.size() << "\n";
271 
272 
273 
274  // put all products in the event
275  // Barrel
276  //std::cout << "ConversionTrackCandidateProducer Putting in the event " << (*outInTrackCandidate_p).size() << " Out In track Candidates " << "\n";
277  const edm::OrphanHandle<TrackCandidateCollection> refprodOutInTrackC = theEvent.put(std::move(outInTrackCandidate_p), OutInTrackCandidateCollection_ );
278  //std::cout << "ConversionTrackCandidateProducer refprodOutInTrackC size " << (*(refprodOutInTrackC.product())).size() << "\n";
279  //
280  //std::cout << "ConversionTrackCandidateProducer Putting in the event " << (*inOutTrackCandidate_p).size() << " In Out track Candidates " << "\n";
281  const edm::OrphanHandle<TrackCandidateCollection> refprodInOutTrackC = theEvent.put(std::move(inOutTrackCandidate_p), InOutTrackCandidateCollection_ );
282  //std::cout << "ConversionTrackCandidateProducer refprodInOutTrackC size " << (*(refprodInOutTrackC.product())).size() << "\n";
283 
284 
285  edm::ValueMap<reco::CaloClusterPtr>::Filler fillerOI(*outInAssoc_p);
286  fillerOI.insert(refprodOutInTrackC, caloPtrVecOutIn_.begin(), caloPtrVecOutIn_.end());
287  fillerOI.fill();
288  edm::ValueMap<reco::CaloClusterPtr>::Filler fillerIO(*inOutAssoc_p);
289  fillerIO.insert(refprodInOutTrackC, caloPtrVecInOut_.begin(), caloPtrVecInOut_.end());
290  fillerIO.fill();
291 
292 
293 
294  // std::cout << "ConversionTrackCandidateProducer Putting in the event OutIn track - SC association: size " << (*outInAssoc_p).size() << "\n";
295  theEvent.put(std::move(outInAssoc_p), OutInTrackSuperClusterAssociationCollection_);
296 
297  // std::cout << "ConversionTrackCandidateProducer Putting in the event InOut track - SC association: size " << (*inOutAssoc_p).size() << "\n";
298  theEvent.put(std::move(inOutAssoc_p), InOutTrackSuperClusterAssociationCollection_);
299 
300  theOutInSeedFinder_->clear();
301  theInOutSeedFinder_->clear();
302 
303 
304 
305 }
std::unique_ptr< OutInConversionSeedFinder > theOutInSeedFinder_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scIslandEndcapProducer_
edm::EDGetTokenT< EcalRecHitCollection > endcapecalCollection_
std::vector< edm::Ptr< reco::CaloCluster > > caloPtrVecInOut_
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrkEvtToken_
std::unique_ptr< BaseCkfTrajectoryBuilder > theTrajectoryBuilder_
edm::EDGetTokenT< CaloTowerCollection > hcalTowers_
bool isValid() const
Definition: HandleBase.h:74
std::unique_ptr< InOutConversionSeedFinder > theInOutSeedFinder_
std::vector< edm::Ptr< reco::CaloCluster > > caloPtrVecOutIn_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scHybridBarrelProducer_
void setEventSetup(const edm::EventSetup &es)
Initialize EventSetup objects at each event.
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcBarrelCollection_
HLT enums.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcEndcapCollection_
void buildCollections(bool detector, const edm::Handle< edm::View< reco::CaloCluster > > &scHandle, const edm::Handle< edm::View< reco::CaloCluster > > &bcHandle, edm::Handle< EcalRecHitCollection > ecalRecHitHandle, const EcalRecHitCollection &ecalRecHits, const EcalSeverityLevelAlgo *sevLev, const edm::Handle< CaloTowerCollection > &hcalTowersHandle, TrackCandidateCollection &outInTracks, TrackCandidateCollection &inOutTracks, std::vector< edm::Ptr< reco::CaloCluster > > &vecRecOI, std::vector< edm::Ptr< reco::CaloCluster > > &vecRecIO)
T const * product() const
Definition: ESHandle.h:86
edm::EDGetTokenT< EcalRecHitCollection > barrelecalCollection_
def move(src, dest)
Definition: eostools.py:510
void ConversionTrackCandidateProducer::setEventSetup ( const edm::EventSetup es)
private

Initialize EventSetup objects at each event.

Definition at line 143 of file ConversionTrackCandidateProducer.cc.

References theInOutSeedFinder_, theInOutTrackFinder_, theOutInSeedFinder_, and theOutInTrackFinder_.

Referenced by produce().

143  {
144  theOutInSeedFinder_->setEventSetup(theEventSetup);
145  theInOutSeedFinder_->setEventSetup(theEventSetup);
146  theOutInTrackFinder_->setEventSetup(theEventSetup);
147  theInOutTrackFinder_->setEventSetup(theEventSetup);
148 }
std::unique_ptr< OutInConversionSeedFinder > theOutInSeedFinder_
std::unique_ptr< OutInConversionTrackFinder > theOutInTrackFinder_
std::unique_ptr< InOutConversionSeedFinder > theInOutSeedFinder_
std::unique_ptr< InOutConversionTrackFinder > theInOutTrackFinder_

Member Data Documentation

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

Definition at line 66 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

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

Definition at line 61 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

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

Definition at line 62 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

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

Definition at line 101 of file ConversionTrackCandidateProducer.h.

Referenced by buildCollections(), and produce().

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

Definition at line 100 of file ConversionTrackCandidateProducer.h.

Referenced by buildCollections(), and produce().

double ConversionTrackCandidateProducer::ecalIsoCut_offset_
private
double ConversionTrackCandidateProducer::ecalIsoCut_slope_
private
edm::EDGetTokenT<EcalRecHitCollection> ConversionTrackCandidateProducer::endcapecalCollection_
private

Definition at line 67 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

std::vector<int> ConversionTrackCandidateProducer::flagsexclEB_
private
std::vector<int> ConversionTrackCandidateProducer::flagsexclEE_
private
edm::EDGetTokenT<CaloTowerCollection> ConversionTrackCandidateProducer::hcalTowers_
private

Definition at line 65 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

double ConversionTrackCandidateProducer::hOverEConeSize_
private
std::string ConversionTrackCandidateProducer::InOutTrackCandidateCollection_
private

Definition at line 55 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

std::string ConversionTrackCandidateProducer::InOutTrackSuperClusterAssociationCollection_
private

Definition at line 59 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

double ConversionTrackCandidateProducer::isoConeR_
private
double ConversionTrackCandidateProducer::isoEMin_
private
double ConversionTrackCandidateProducer::isoEtaSlice_
private
double ConversionTrackCandidateProducer::isoEtMin_
private
double ConversionTrackCandidateProducer::isoInnerConeR_
private
double ConversionTrackCandidateProducer::maxHOverE_
private
edm::EDGetTokenT<MeasurementTrackerEvent> ConversionTrackCandidateProducer::measurementTrkEvtToken_
private

Definition at line 68 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

double ConversionTrackCandidateProducer::minSCEt_
private
int ConversionTrackCandidateProducer::nEvt_
private

Definition at line 49 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

std::string ConversionTrackCandidateProducer::OutInTrackCandidateCollection_
private

Definition at line 54 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

std::string ConversionTrackCandidateProducer::OutInTrackSuperClusterAssociationCollection_
private

Definition at line 58 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

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

Definition at line 63 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

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

Definition at line 64 of file ConversionTrackCandidateProducer.h.

Referenced by ConversionTrackCandidateProducer(), and produce().

std::vector<int> ConversionTrackCandidateProducer::severitiesexclEB_
private
std::vector<int> ConversionTrackCandidateProducer::severitiesexclEE_
private
edm::ESHandle<CaloGeometry> ConversionTrackCandidateProducer::theCaloGeom_
private

Definition at line 90 of file ConversionTrackCandidateProducer.h.

Referenced by buildCollections(), and produce().

std::unique_ptr<InOutConversionSeedFinder> ConversionTrackCandidateProducer::theInOutSeedFinder_
private
std::unique_ptr<InOutConversionTrackFinder> ConversionTrackCandidateProducer::theInOutTrackFinder_
private

Definition at line 97 of file ConversionTrackCandidateProducer.h.

Referenced by buildCollections(), and setEventSetup().

std::unique_ptr<OutInConversionSeedFinder> ConversionTrackCandidateProducer::theOutInSeedFinder_
private
std::unique_ptr<OutInConversionTrackFinder> ConversionTrackCandidateProducer::theOutInTrackFinder_
private

Definition at line 95 of file ConversionTrackCandidateProducer.h.

Referenced by buildCollections(), and setEventSetup().

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

Definition at line 92 of file ConversionTrackCandidateProducer.h.

Referenced by beginRun(), and produce().

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

Definition at line 104 of file ConversionTrackCandidateProducer.h.

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

Definition at line 103 of file ConversionTrackCandidateProducer.h.

bool ConversionTrackCandidateProducer::vetoClusteredHits_
private