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::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTTauRefCombiner (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~HLTTauRefCombiner () 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
 
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)
 
 ~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
 
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
 
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 &)
 

Private Attributes

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

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::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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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

Definition at line 21 of file HLTTauRefCombiner.h.

Member Typedef Documentation

Definition at line 29 of file HLTTauRefCombiner.h.

Definition at line 30 of file HLTTauRefCombiner.h.

Constructor & Destructor Documentation

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

Definition at line 7 of file HLTTauRefCombiner.cc.

References edm::ParameterSet::getParameter(), and cuy::ii.

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

Definition at line 18 of file HLTTauRefCombiner.cc.

18 {}

Member Function Documentation

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

Definition at line 63 of file HLTTauRefCombiner.cc.

References delta, HiRegitMuonDetachedTripletStep_cff::DeltaR, and electrons_cff::matched.

63  {
64  bool matched = false;
65 
66  if (!lvcol.empty())
67  for (LorentzVectorCollection::const_iterator it = lvcol.begin(); it != lvcol.end(); ++it) {
68  double delta = ROOT::Math::VectorUtil::DeltaR(lv, *it);
69  if (delta < matchDeltaR_) {
70  matched = true;
71  }
72  }
73 
74  return matched;
75 }
dbl * delta
Definition: mlp_gen.cc:36
void HLTTauRefCombiner::produce ( edm::Event iEvent,
const edm::EventSetup iES 
)
override

Definition at line 20 of file HLTTauRefCombiner.cc.

References edm::Event::getByToken(), mps_fire::i, edm::match(), eostools::move(), edm::Event::put(), findQualityFiles::size, and tmp.

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

Member Data Documentation

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

Definition at line 32 of file HLTTauRefCombiner.h.

double HLTTauRefCombiner::matchDeltaR_
private

Definition at line 33 of file HLTTauRefCombiner.h.

std::string HLTTauRefCombiner::outName_
private

Definition at line 34 of file HLTTauRefCombiner.h.