#include <HLTTauRefCombiner.h>
Public Member Functions | |
HLTTauRefCombiner (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
~HLTTauRefCombiner () | |
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::InputTag > | inputColl_ |
double | matchDeltaR_ |
std::string | outName_ |
Definition at line 21 of file HLTTauRefCombiner.h.
typedef math::XYZTLorentzVectorD HLTTauRefCombiner::LorentzVector [private] |
Definition at line 30 of file HLTTauRefCombiner.h.
typedef std::vector<LorentzVector> HLTTauRefCombiner::LorentzVectorCollection [private] |
Definition at line 31 of file HLTTauRefCombiner.h.
HLTTauRefCombiner::HLTTauRefCombiner | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 9 of file HLTTauRefCombiner.cc.
References edm::ParameterSet::getParameter().
{ inputColl_ = iConfig.getParameter< std::vector<InputTag> >("InputCollections"); matchDeltaR_ = iConfig.getParameter<double>("MatchDeltaR"); outName_ = iConfig.getParameter<string>("OutputCollection"); produces<LorentzVectorCollection> ( outName_); }
HLTTauRefCombiner::~HLTTauRefCombiner | ( | ) |
Definition at line 18 of file HLTTauRefCombiner.cc.
{ }
bool HLTTauRefCombiner::match | ( | const LorentzVector & | lv, |
const LorentzVectorCollection & | lvcol | ||
) | [private] |
Definition at line 84 of file HLTTauRefCombiner.cc.
References delta.
{ bool matched=false; if(lvcol.size()>0) for(LorentzVectorCollection::const_iterator it = lvcol.begin();it!=lvcol.end();++it) { double delta = ROOT::Math::VectorUtil::DeltaR(lv,*it); if(delta<matchDeltaR_) { matched=true; } } return matched; }
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.
{ auto_ptr<LorentzVectorCollection> out_product(new LorentzVectorCollection); //Create The Handles.. std::vector< Handle<LorentzVectorCollection> > handles; bool allCollectionsExist = true; //Map the Handles to the collections if all collections exist for(size_t i = 0;i<inputColl_.size();++i) { edm::Handle<LorentzVectorCollection> tmp; if(iEvent.getByLabel(inputColl_[i],tmp)) { handles.push_back(tmp); } else { allCollectionsExist = false; } } //The reference output object collection will be the first one.. if(allCollectionsExist) { //loop on the first collection for(size_t i = 0; i < (handles[0])->size();++i) { bool MatchedObj = true; //get reference Vector const LorentzVector lvRef = (*(handles[0]))[i]; //Loop on all other collections and match for(size_t j = 1; j < handles.size();++j) { if(!match(lvRef,*(handles[j]))) MatchedObj = false; } //If the Object is Matched Everywhere store if(MatchedObj) { out_product->push_back(lvRef); } } //Put product to file iEvent.put(out_product,outName_); } }
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.