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 &&)=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::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 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
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<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 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.

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 }

References edm::ParameterSet::getParameter().

Member Function Documentation

◆ match()

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

Definition at line 61 of file HLTTauRefCombiner.cc.

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 }

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

Referenced by produce().

◆ 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.

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 }

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

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().

muonTagProbeFilters_cff.matched
matched
Definition: muonTagProbeFilters_cff.py:62
mps_fire.i
i
Definition: mps_fire.py:428
HLTTauRefCombiner::outName_
const std::string outName_
Definition: HLTTauRefCombiner.h:33
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
edm::Handle
Definition: AssociativeIterator.h:50
HLTTauRefCombiner::match
bool match(const LorentzVector &, const LorentzVectorCollection &) const
Definition: HLTTauRefCombiner.cc:61
magneticfield::handles
std::vector< BaseVolumeHandle * > handles
Definition: BaseVolumeHandle.h:154
dumpMFGeometry_cfg.delta
delta
Definition: dumpMFGeometry_cfg.py:25
HLTTauRefCombiner::inputColl_
std::vector< edm::EDGetTokenT< LorentzVectorCollection > > inputColl_
Definition: HLTTauRefCombiner.h:31
iEvent
int iEvent
Definition: GenABIO.cc:224
LorentzVectorCollection
std::vector< LorentzVector > LorentzVectorCollection
Definition: HLTTauMCProducer.h:31
electronAnalyzer_cfi.DeltaR
DeltaR
Definition: electronAnalyzer_cfi.py:33
eostools.move
def move(src, dest)
Definition: eostools.py:511
LorentzVector
math::XYZTLorentzVector LorentzVector
Definition: HLTMuonMatchAndPlot.h:49
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
cuy.ii
ii
Definition: cuy.py:590
HLTTauRefCombiner::matchDeltaR_
const double matchDeltaR_
Definition: HLTTauRefCombiner.h:32
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443