CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HighPtTrackEcalDetIdProducer Class Reference
Inheritance diagram for HighPtTrackEcalDetIdProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
 HighPtTrackEcalDetIdProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~HighPtTrackEcalDetIdProducer () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

const CaloTopologycaloTopology_
 
edm::EDGetTokenT< reco::TrackCollectioninputCollectionToken_
 
TrackAssociatorParameters parameters_
 
double ptcut_
 
TrackDetectorAssociator trackAssociator_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 56 of file Skim_HighPtTrackEcalDetIdProducer.cc.

Constructor & Destructor Documentation

◆ HighPtTrackEcalDetIdProducer()

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

Definition at line 83 of file Skim_HighPtTrackEcalDetIdProducer.cc.

83  {
84  inputCollectionToken_ = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("inputCollection"));
85  ptcut_ = iConfig.getParameter<double>("TrackPt");
86 
87  produces<DetIdCollection>();
88  // TrackAssociator parameters
89  edm::ParameterSet parameters = iConfig.getParameter<edm::ParameterSet>("TrackAssociatorParameters");
93 }

References edm::EDConsumerBase::consumesCollector(), edm::ParameterSet::getParameter(), inputCollectionToken_, TrackAssociatorParameters::loadParameters(), parameters_, ptcut_, trackAssociator_, and TrackDetectorAssociator::useDefaultPropagator().

◆ ~HighPtTrackEcalDetIdProducer()

HighPtTrackEcalDetIdProducer::~HighPtTrackEcalDetIdProducer ( )
override

Definition at line 95 of file Skim_HighPtTrackEcalDetIdProducer.cc.

95  {
96  // do anything here that needs to be done at desctruction time
97  // (e.g. close files, deallocate resources etc.)
98 }

Member Function Documentation

◆ beginRun()

void HighPtTrackEcalDetIdProducer::beginRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
overridevirtual

Reimplemented from edm::EDProducer.

Definition at line 104 of file Skim_HighPtTrackEcalDetIdProducer.cc.

104  {
105  edm::ESHandle<CaloTopology> theCaloTopology;
106  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
107  caloTopology_ = &(*theCaloTopology);
108 }

References caloTopology_, edm::EventSetup::get(), and get.

◆ produce()

void HighPtTrackEcalDetIdProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::EDProducer.

Definition at line 111 of file Skim_HighPtTrackEcalDetIdProducer.cc.

111  {
112  using namespace edm;
113  using reco::TrackCollection;
114  // if(!iSetup) continue;
115  Handle<TrackCollection> tkTracks;
116  iEvent.getByToken(inputCollectionToken_, tkTracks);
117  std::unique_ptr<DetIdCollection> interestingDetIdCollection(new DetIdCollection());
118  for (TrackCollection::const_iterator itTrack = tkTracks->begin(); itTrack != tkTracks->end(); ++itTrack) {
119  if (itTrack->pt() > ptcut_) {
122  if (info.crossedEcalIds.empty())
123  break;
124 
125  if (!info.crossedEcalIds.empty()) {
126  DetId centerId = info.crossedEcalIds.front();
127 
130  const std::vector<DetId>& ids = topology->getWindow(centerId, 5, 5);
131  for (std::vector<DetId>::const_iterator id = ids.begin(); id != ids.end(); ++id)
134  interestingDetIdCollection->push_back(*id);
135  }
136  }
137  }
139 }

References TrackDetectorAssociator::associate(), caloTopology_, DetId::Ecal, spr::find(), CaloTopology::getSubdetectorTopology(), CaloTopology::getWindow(), triggerObjects_cff::id, iEvent, info(), inputCollectionToken_, TrackDetectorAssociator::InsideOut, interestingDetIdCollectionProducer_cfi::interestingDetIdCollection, eostools::move(), parameters_, ptcut_, DetId::subdetId(), ecaldqm::topology(), and trackAssociator_.

Member Data Documentation

◆ caloTopology_

const CaloTopology* HighPtTrackEcalDetIdProducer::caloTopology_
private

Definition at line 65 of file Skim_HighPtTrackEcalDetIdProducer.cc.

Referenced by beginRun(), and produce().

◆ inputCollectionToken_

edm::EDGetTokenT<reco::TrackCollection> HighPtTrackEcalDetIdProducer::inputCollectionToken_
private

Definition at line 64 of file Skim_HighPtTrackEcalDetIdProducer.cc.

Referenced by HighPtTrackEcalDetIdProducer(), and produce().

◆ parameters_

TrackAssociatorParameters HighPtTrackEcalDetIdProducer::parameters_
private

◆ ptcut_

double HighPtTrackEcalDetIdProducer::ptcut_
private

Definition at line 68 of file Skim_HighPtTrackEcalDetIdProducer.cc.

Referenced by HighPtTrackEcalDetIdProducer(), and produce().

◆ trackAssociator_

TrackDetectorAssociator HighPtTrackEcalDetIdProducer::trackAssociator_
private

Definition at line 66 of file Skim_HighPtTrackEcalDetIdProducer.cc.

Referenced by HighPtTrackEcalDetIdProducer(), and produce().

edm
HLT enums.
Definition: AlignableModifier.h:19
TrackDetectorAssociator::useDefaultPropagator
void useDefaultPropagator()
use the default propagator
Definition: TrackDetectorAssociator.cc:120
CaloTopology::getWindow
std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
Get the neighbors of the given cell in a window of given size.
Definition: CaloTopology.cc:64
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:71
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:152
CaloTopologyRecord
Definition: CaloTopologyRecord.h:10
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
edm::Handle
Definition: AssociativeIterator.h:50
parameters
parameters
Definition: BeamSpot_PayloadInspector.cc:14
DetId
Definition: DetId.h:17
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
HighPtTrackEcalDetIdProducer::inputCollectionToken_
edm::EDGetTokenT< reco::TrackCollection > inputCollectionToken_
Definition: Skim_HighPtTrackEcalDetIdProducer.cc:64
ecaldqm::topology
const CaloTopology * topology(nullptr)
edm::ESHandle< CaloTopology >
TrackAssociatorParameters::loadParameters
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
Definition: TrackAssociatorParameters.cc:18
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
edm::ParameterSet
Definition: ParameterSet.h:36
CaloTopology::getSubdetectorTopology
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:17
iEvent
int iEvent
Definition: GenABIO.cc:224
HighPtTrackEcalDetIdProducer::parameters_
TrackAssociatorParameters parameters_
Definition: Skim_HighPtTrackEcalDetIdProducer.cc:67
CaloSubdetectorTopology
Definition: CaloSubdetectorTopology.h:17
TrackDetectorAssociator::InsideOut
Definition: TrackDetectorAssociator.h:55
DetId::Ecal
Definition: DetId.h:27
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
TrackDetMatchInfo
Definition: TrackDetMatchInfo.h:14
eostools.move
def move(src, dest)
Definition: eostools.py:511
DetIdCollection
edm::EDCollection< DetId > DetIdCollection
Definition: DetIdCollection.h:7
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
TrackDetectorAssociator::associate
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
Definition: TrackDetectorAssociator.cc:154
HighPtTrackEcalDetIdProducer::ptcut_
double ptcut_
Definition: Skim_HighPtTrackEcalDetIdProducer.cc:68
HighPtTrackEcalDetIdProducer::caloTopology_
const CaloTopology * caloTopology_
Definition: Skim_HighPtTrackEcalDetIdProducer.cc:65
interestingDetIdCollectionProducer_cfi.interestingDetIdCollection
interestingDetIdCollection
Definition: interestingDetIdCollectionProducer_cfi.py:11
HighPtTrackEcalDetIdProducer::trackAssociator_
TrackDetectorAssociator trackAssociator_
Definition: Skim_HighPtTrackEcalDetIdProducer.cc:66
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
edm::ConsumesCollector
Definition: ConsumesCollector.h:39