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 &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~HLTTauRefCombiner ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- 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 ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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 & itemsToGetFromEvent () 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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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
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)
 
- 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 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 30 of file HLTTauRefCombiner.h.

Definition at line 31 of file HLTTauRefCombiner.h.

Constructor & Destructor Documentation

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

Definition at line 9 of file HLTTauRefCombiner.cc.

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

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

Definition at line 22 of file HLTTauRefCombiner.cc.

22 { }

Member Function Documentation

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

Definition at line 88 of file HLTTauRefCombiner.cc.

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

89 {
90  bool matched=false;
91 
92  if(lvcol.size()>0)
93  for(LorentzVectorCollection::const_iterator it = lvcol.begin();it!=lvcol.end();++it)
94  {
95  double delta = ROOT::Math::VectorUtil::DeltaR(lv,*it);
96  if(delta<matchDeltaR_)
97  {
98  matched=true;
99 
100  }
101  }
102 
103 
104 
105  return matched;
106 }
dbl * delta
Definition: mlp_gen.cc:36
void HLTTauRefCombiner::produce ( edm::Event iEvent,
const edm::EventSetup iES 
)
virtual

Definition at line 24 of file HLTTauRefCombiner.cc.

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

25 {
26  unique_ptr<LorentzVectorCollection> out_product(new LorentzVectorCollection);
27 
28  //Create The Handles..
29  std::vector< Handle<LorentzVectorCollection> > handles;
30 
31  bool allCollectionsExist = true;
32  //Map the Handles to the collections if all collections exist
33  for(size_t i = 0;i<inputColl_.size();++i)
34  {
36  if(iEvent.getByToken(inputColl_[i],tmp))
37  {
38  handles.push_back(tmp);
39  }
40  else
41  {
42  allCollectionsExist = false;
43  }
44 
45  }
46 
47  //The reference output object collection will be the first one..
48  if(allCollectionsExist)
49  {
50  //loop on the first collection
51  for(size_t i = 0; i < (handles[0])->size();++i)
52  {
53  bool MatchedObj = true;
54 
55  //get reference Vector
56  const LorentzVector lvRef = (*(handles[0]))[i];
57 
58  //Loop on all other collections and match
59  for(size_t j = 1; j < handles.size();++j)
60  {
61  if(!match(lvRef,*(handles[j])))
62  MatchedObj = false;
63 
64  }
65 
66  //If the Object is Matched Everywhere store
67  if(MatchedObj)
68  {
69  out_product->push_back(lvRef);
70  }
71 
72 
73  }
74 
75  //Put product to file
76  iEvent.put(std::move(out_product),outName_);
77 
78  }
79 
80 
81 
82 
83 }
size
Write out results.
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool match(const LorentzVector &, const LorentzVectorCollection &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
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:510

Member Data Documentation

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

Definition at line 33 of file HLTTauRefCombiner.h.

double HLTTauRefCombiner::matchDeltaR_
private

Definition at line 34 of file HLTTauRefCombiner.h.

std::string HLTTauRefCombiner::outName_
private

Definition at line 35 of file HLTTauRefCombiner.h.