CMS 3D CMS Logo

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

#include <HLTTauRefCombiner.h>

Inheritance diagram for HLTTauRefCombiner:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTTauRefCombiner (const edm::ParameterSet &)
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 
- Public Member Functions inherited from edm::global::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
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

typedef math::XYZTLorentzVectorD LorentzVector
 
typedef std::vector< LorentzVectorLorentzVectorCollection
 

Private Member Functions

bool match (const LorentzVector &, const LorentzVectorCollection &) const
 

Private Attributes

std::vector< edm::EDGetTokenT< LorentzVectorCollection > > inputColl_
 
const double matchDeltaR_
 
const std::string outName_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
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)
 
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 ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 21 of file HLTTauRefCombiner.h.

Member Typedef Documentation

◆ LorentzVector

Definition at line 28 of file HLTTauRefCombiner.h.

◆ LorentzVectorCollection

Definition at line 29 of file HLTTauRefCombiner.h.

Constructor & Destructor Documentation

◆ HLTTauRefCombiner()

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

Definition at line 7 of file HLTTauRefCombiner.cc.

References edm::ParameterSet::getParameter().

8  : matchDeltaR_{iConfig.getParameter<double>("MatchDeltaR")},
9  outName_{iConfig.getParameter<string>("OutputCollection")} {
10  std::vector<edm::InputTag> inputCollVector_ = iConfig.getParameter<std::vector<InputTag>>("InputCollections");
11  for (unsigned int ii = 0; ii < inputCollVector_.size(); ++ii) {
12  inputColl_.push_back(consumes<LorentzVectorCollection>(inputCollVector_[ii]));
13  }
14 
15  produces<LorentzVectorCollection>(outName_);
16 }
const double matchDeltaR_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const std::string outName_
ii
Definition: cuy.py:589
std::vector< edm::EDGetTokenT< LorentzVectorCollection > > inputColl_

Member Function Documentation

◆ match()

bool HLTTauRefCombiner::match ( const LorentzVector lv,
const LorentzVectorCollection lvcol 
) const
private

Definition at line 61 of file HLTTauRefCombiner.cc.

References dumpMFGeometry_cfg::delta, electronAnalyzer_cfi::DeltaR, matchDeltaR_, and muonTagProbeFilters_cff::matched.

Referenced by produce().

61  {
62  bool matched = false;
63 
64  if (!lvcol.empty())
65  for (LorentzVectorCollection::const_iterator it = lvcol.begin(); it != lvcol.end(); ++it) {
66  double delta = ROOT::Math::VectorUtil::DeltaR(lv, *it);
67  if (delta < matchDeltaR_) {
68  matched = true;
69  }
70  }
71 
72  return matched;
73 }
const double matchDeltaR_

◆ produce()

void HLTTauRefCombiner::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iES 
) const
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 18 of file HLTTauRefCombiner.cc.

References mps_fire::i, iEvent, inputColl_, dqmiolumiharvest::j, match(), eostools::move(), outName_, findQualityFiles::size, and createJobs::tmp.

18  {
19  unique_ptr<LorentzVectorCollection> out_product(new LorentzVectorCollection);
20 
21  // Create The Handles..
22  std::vector<Handle<LorentzVectorCollection>> handles;
23 
24  bool allCollectionsExist = true;
25  // Map the Handles to the collections if all collections exist
26  for (size_t i = 0; i < inputColl_.size(); ++i) {
28  if (iEvent.getByToken(inputColl_[i], tmp)) {
29  handles.push_back(tmp);
30  } else {
31  allCollectionsExist = false;
32  }
33  }
34 
35  // The reference output object collection will be the first one..
36  if (allCollectionsExist) {
37  // loop on the first collection
38  for (size_t i = 0; i < (handles[0])->size(); ++i) {
39  bool MatchedObj = true;
40 
41  // get reference Vector
42  const LorentzVector lvRef = (*(handles[0]))[i];
43 
44  // Loop on all other collections and match
45  for (size_t j = 1; j < handles.size(); ++j) {
46  if (!match(lvRef, *(handles[j])))
47  MatchedObj = false;
48  }
49 
50  // If the Object is Matched Everywhere store
51  if (MatchedObj) {
52  out_product->push_back(lvRef);
53  }
54  }
55 
56  // Put product to file
57  iEvent.put(std::move(out_product), outName_);
58  }
59 }
size
Write out results.
const std::string outName_
bool match(const LorentzVector &, const LorentzVectorCollection &) const
int iEvent
Definition: GenABIO.cc:224
std::vector< BaseVolumeHandle * > handles
math::XYZTLorentzVector LorentzVector
std::vector< LorentzVector > LorentzVectorCollection
std::vector< edm::EDGetTokenT< LorentzVectorCollection > > inputColl_
tmp
align.sh
Definition: createJobs.py:716
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ inputColl_

std::vector<edm::EDGetTokenT<LorentzVectorCollection> > HLTTauRefCombiner::inputColl_
private

Definition at line 31 of file HLTTauRefCombiner.h.

Referenced by produce().

◆ matchDeltaR_

const double HLTTauRefCombiner::matchDeltaR_
private

Definition at line 32 of file HLTTauRefCombiner.h.

Referenced by match().

◆ outName_

const std::string HLTTauRefCombiner::outName_
private

Definition at line 33 of file HLTTauRefCombiner.h.

Referenced by produce().