CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::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 ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Types

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

Private Member Functions

bool match (const LorentzVector &, const LorentzVectorCollection &)
 

Private Attributes

std::vector< edm::InputTaginputColl_
 
double matchDeltaR_
 
std::string outName_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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

10 {
11  inputColl_ = iConfig.getParameter< std::vector<InputTag> >("InputCollections");
12  matchDeltaR_ = iConfig.getParameter<double>("MatchDeltaR");
13  outName_ = iConfig.getParameter<string>("OutputCollection");
14 
15  produces<LorentzVectorCollection> ( outName_);
16 }
T getParameter(std::string const &) const
std::vector< edm::InputTag > inputColl_
HLTTauRefCombiner::~HLTTauRefCombiner ( )

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 84 of file HLTTauRefCombiner.cc.

References delta.

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

Implements edm::EDProducer.

Definition at line 20 of file HLTTauRefCombiner.cc.

References edm::Event::getByLabel(), i, j, edm::match(), edm::Event::put(), findQualityFiles::size, and tmp.

21 {
22  auto_ptr<LorentzVectorCollection> out_product(new LorentzVectorCollection);
23 
24  //Create The Handles..
25  std::vector< Handle<LorentzVectorCollection> > handles;
26 
27  bool allCollectionsExist = true;
28  //Map the Handles to the collections if all collections exist
29  for(size_t i = 0;i<inputColl_.size();++i)
30  {
32  if(iEvent.getByLabel(inputColl_[i],tmp))
33  {
34  handles.push_back(tmp);
35  }
36  else
37  {
38  allCollectionsExist = false;
39  }
40 
41  }
42 
43  //The reference output object collection will be the first one..
44  if(allCollectionsExist)
45  {
46  //loop on the first collection
47  for(size_t i = 0; i < (handles[0])->size();++i)
48  {
49  bool MatchedObj = true;
50 
51  //get reference Vector
52  const LorentzVector lvRef = (*(handles[0]))[i];
53 
54  //Loop on all other collections and match
55  for(size_t j = 1; j < handles.size();++j)
56  {
57  if(!match(lvRef,*(handles[j])))
58  MatchedObj = false;
59 
60  }
61 
62  //If the Object is Matched Everywhere store
63  if(MatchedObj)
64  {
65  out_product->push_back(lvRef);
66  }
67 
68 
69  }
70 
71  //Put product to file
72  iEvent.put(out_product,outName_);
73 
74  }
75 
76 
77 
78 
79 }
int i
Definition: DBlmapReader.cc:9
bool match(const LorentzVector &, const LorentzVectorCollection &)
std::vector< edm::InputTag > inputColl_
math::XYZTLorentzVector LorentzVector
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
int j
Definition: DBlmapReader.cc:9
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
std::vector< LorentzVector > LorentzVectorCollection
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
tuple size
Write out results.

Member Data Documentation

std::vector<edm::InputTag> 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.