CMS 3D CMS Logo

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

#include <ElectronSqPtTkIsolationProducer.h>

Inheritance diagram for ElectronSqPtTkIsolationProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ElectronSqPtTkIsolationProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~ElectronSqPtTkIsolationProducer () 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
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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

bool absolut_
 
edm::ParameterSet conf_
 
edm::InputTag electronProducer_
 
double extRadius_
 
double intRadius_
 
double maxVtxDist_
 
double ptMin_
 
edm::InputTag trackProducer_
 

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 wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
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 = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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 12 of file ElectronSqPtTkIsolationProducer.h.

Constructor & Destructor Documentation

◆ ElectronSqPtTkIsolationProducer()

ElectronSqPtTkIsolationProducer::ElectronSqPtTkIsolationProducer ( const edm::ParameterSet config)
explicit

Definition at line 15 of file ElectronSqPtTkIsolationProducer.cc.

15  : conf_(config) {
16  // use configuration file to setup input/output collection names
17  electronProducer_ = conf_.getParameter<edm::InputTag>("electronProducer");
18 
19  trackProducer_ = conf_.getParameter<edm::InputTag>("trackProducer");
20 
21  ptMin_ = conf_.getParameter<double>("ptMin");
22  intRadius_ = conf_.getParameter<double>("intRadius");
23  extRadius_ = conf_.getParameter<double>("extRadius");
24  maxVtxDist_ = conf_.getParameter<double>("maxVtxDist");
25 
26  absolut_ = conf_.getParameter<bool>("absolut");
27 
28  //register your products
29  produces<reco::CandViewDoubleAssociations>();
30 }

References absolut_, conf_, electronProducer_, extRadius_, edm::ParameterSet::getParameter(), intRadius_, maxVtxDist_, ptMin_, and trackProducer_.

◆ ~ElectronSqPtTkIsolationProducer()

ElectronSqPtTkIsolationProducer::~ElectronSqPtTkIsolationProducer ( )
override

Definition at line 32 of file ElectronSqPtTkIsolationProducer.cc.

32 {}

Member Function Documentation

◆ produce()

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

Implements edm::EDProducer.

Definition at line 34 of file ElectronSqPtTkIsolationProducer.cc.

34  {
35  // Get the filtered objects
37  iEvent.getByLabel(electronProducer_, electronHandle);
38 
39  //get the tracks
41  iEvent.getByLabel(trackProducer_, tracks);
42  const reco::TrackCollection* trackCollection = tracks.product();
43 
46 
48 
49  for (unsigned int i = 0; i < electronHandle->size(); ++i) {
50  double isoValue = myTkIsolation.getPtTracks(&(electronHandle->at(i)));
51  if (absolut_ == true) {
52  isoMap->setValue(i, isoValue);
53  } else {
54  reco::SuperClusterRef sc = (electronHandle->at(i)).superCluster();
55  double et = sc.get()->energy() * sin(2 * atan(exp(-sc.get()->eta())));
56  isoMap->setValue(i, isoValue / et);
57  }
58  }
59 
60  std::unique_ptr<reco::CandViewDoubleAssociations> isolMap(isoMap);
61  iEvent.put(std::move(isolMap));
62 }

References absolut_, electronProducer_, EgHLTOffHistBins_cfi::et, JetChargeProducer_cfi::exp, extRadius_, edm::Ref< C, T, F >::get(), ElectronSqPtTkIsolation::getPtTracks(), mps_fire::i, iEvent, intRadius_, maxVtxDist_, eostools::move(), ptMin_, edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::setValue(), funct::sin(), duplicaterechits_cfi::trackCollection, trackProducer_, and tracks.

Member Data Documentation

◆ absolut_

bool ElectronSqPtTkIsolationProducer::absolut_
private

Definition at line 28 of file ElectronSqPtTkIsolationProducer.h.

Referenced by ElectronSqPtTkIsolationProducer(), and produce().

◆ conf_

edm::ParameterSet ElectronSqPtTkIsolationProducer::conf_
private

Definition at line 30 of file ElectronSqPtTkIsolationProducer.h.

Referenced by ElectronSqPtTkIsolationProducer().

◆ electronProducer_

edm::InputTag ElectronSqPtTkIsolationProducer::electronProducer_
private

Definition at line 20 of file ElectronSqPtTkIsolationProducer.h.

Referenced by ElectronSqPtTkIsolationProducer(), and produce().

◆ extRadius_

double ElectronSqPtTkIsolationProducer::extRadius_
private

Definition at line 25 of file ElectronSqPtTkIsolationProducer.h.

Referenced by ElectronSqPtTkIsolationProducer(), and produce().

◆ intRadius_

double ElectronSqPtTkIsolationProducer::intRadius_
private

Definition at line 24 of file ElectronSqPtTkIsolationProducer.h.

Referenced by ElectronSqPtTkIsolationProducer(), and produce().

◆ maxVtxDist_

double ElectronSqPtTkIsolationProducer::maxVtxDist_
private

Definition at line 26 of file ElectronSqPtTkIsolationProducer.h.

Referenced by ElectronSqPtTkIsolationProducer(), and produce().

◆ ptMin_

double ElectronSqPtTkIsolationProducer::ptMin_
private

Definition at line 23 of file ElectronSqPtTkIsolationProducer.h.

Referenced by ElectronSqPtTkIsolationProducer(), and produce().

◆ trackProducer_

edm::InputTag ElectronSqPtTkIsolationProducer::trackProducer_
private

Definition at line 21 of file ElectronSqPtTkIsolationProducer.h.

Referenced by ElectronSqPtTkIsolationProducer(), and produce().

edm::RefProd
Definition: EDProductfwd.h:25
mps_fire.i
i
Definition: mps_fire.py:428
ElectronSqPtTkIsolationProducer::conf_
edm::ParameterSet conf_
Definition: ElectronSqPtTkIsolationProducer.h:30
reco::CandViewDoubleAssociations
edm::AssociationVector< CandidateBaseRefProd, std::vector< double > > CandViewDoubleAssociations
Definition: CandAssociation.h:36
edm::Ref::get
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
edm::Handle< reco::GsfElectronCollection >
edm::Ref< SuperClusterCollection >
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
config
Definition: config.py:1
ElectronSqPtTkIsolationProducer::electronProducer_
edm::InputTag electronProducer_
Definition: ElectronSqPtTkIsolationProducer.h:20
edm::AssociationVector::setValue
void setValue(size_type i, typename CVal::value_type const &val)
Definition: AssociationVector.h:216
edm::AssociationVector
Definition: AssociationVector.h:67
ElectronSqPtTkIsolationProducer::ptMin_
double ptMin_
Definition: ElectronSqPtTkIsolationProducer.h:23
duplicaterechits_cfi.trackCollection
trackCollection
Definition: duplicaterechits_cfi.py:4
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:159
iEvent
int iEvent
Definition: GenABIO.cc:224
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
ElectronSqPtTkIsolationProducer::trackProducer_
edm::InputTag trackProducer_
Definition: ElectronSqPtTkIsolationProducer.h:21
ElectronSqPtTkIsolationProducer::extRadius_
double extRadius_
Definition: ElectronSqPtTkIsolationProducer.h:25
eostools.move
def move(src, dest)
Definition: eostools.py:511
ElectronSqPtTkIsolationProducer::absolut_
bool absolut_
Definition: ElectronSqPtTkIsolationProducer.h:28
ElectronSqPtTkIsolationProducer::intRadius_
double intRadius_
Definition: ElectronSqPtTkIsolationProducer.h:24
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ElectronSqPtTkIsolation
Definition: ElectronSqPtTkIsolation.h:16
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
ElectronSqPtTkIsolationProducer::maxVtxDist_
double maxVtxDist_
Definition: ElectronSqPtTkIsolationProducer.h:26
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
edm::RefToBaseProd
Definition: RefToBase.h:65