#include <L2TauJetsMerger.h>
Classes | |
class | SorterByPt |
Public Member Functions | |
L2TauJetsMerger (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
~L2TauJetsMerger () | |
Private Types | |
typedef std::vector < edm::InputTag > | vtag |
Private Attributes | |
vtag | jetSrc |
double | mEt_Min |
std::map< int, const reco::CaloJet > | myL2L1JetsMap |
Definition at line 19 of file L2TauJetsMerger.h.
typedef std::vector<edm::InputTag> L2TauJetsMerger::vtag [private] |
Definition at line 27 of file L2TauJetsMerger.h.
L2TauJetsMerger::L2TauJetsMerger | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 15 of file L2TauJetsMerger.cc.
References edm::ParameterSet::getParameter().
{ jetSrc = iConfig.getParameter<vtag>("JetSrc"); //l1ParticlesTau = iConfig.getParameter<InputTag>("L1ParticlesTau"); //l1ParticlesJet = iConfig.getParameter<InputTag>("L1ParticlesJet"); //tauTrigger = iConfig.getParameter<InputTag>("L1TauTrigger"); mEt_Min = iConfig.getParameter<double>("EtMin"); produces<CaloJetCollection>(); }
L2TauJetsMerger::~L2TauJetsMerger | ( | ) |
Definition at line 26 of file L2TauJetsMerger.cc.
{ }
void L2TauJetsMerger::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iES | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 28 of file L2TauJetsMerger.cc.
References edm::Event::getByLabel(), i, edm::Event::put(), dt_dqm_sourceclient_common_cff::reco, alignCSCRings::s, reco::LeafCandidate::setPdgId(), python::multivaluedict::sort(), MCScenario_CRAFT1_22X::sorter(), and tmp.
{ using namespace edm; using namespace std; using namespace reco; //Getting all the L1Seeds //Getting the Collections of L2ReconstructedJets from L1Seeds //and removing the collinear jets myL2L1JetsMap.clear(); CaloJetCollection myTmpJets; myTmpJets.clear(); int iL1Jet = 0; for( vtag::const_iterator s = jetSrc.begin(); s != jetSrc.end(); ++ s ) { edm::Handle<CaloJetCollection> tauJets; iEvent.getByLabel( * s, tauJets ); for(CaloJetCollection::const_iterator iTau = tauJets->begin();iTau !=tauJets->end();iTau++) { //Create a Map to associate to every Jet its L1SeedId, i.e. 0,1,2 or 3 if(iTau->et() > mEt_Min) { //Add the Pdg Id here CaloJet myJet = *iTau; myJet.setPdgId(15); myTmpJets.push_back(myJet); } } iL1Jet++; } std::auto_ptr<CaloJetCollection> tauL2jets(new CaloJetCollection); //Removing the collinear jets correctly! //First sort the jets you have merged SorterByPt sorter; std::sort(myTmpJets.begin(),myTmpJets.end(),sorter); //Remove Collinear Jets by prefering the highest ones! while(myTmpJets.size()>0) { tauL2jets->push_back(myTmpJets.at(0)); CaloJetCollection tmp; for(unsigned int i=1 ;i<myTmpJets.size();++i) { double DR = ROOT::Math::VectorUtil::DeltaR(myTmpJets.at(0).p4(),myTmpJets.at(i).p4()); if(DR>0.1) tmp.push_back(myTmpJets.at(i)); } myTmpJets.swap(tmp); tmp.clear(); } iEvent.put(tauL2jets); }
vtag L2TauJetsMerger::jetSrc [private] |
Definition at line 28 of file L2TauJetsMerger.h.
double L2TauJetsMerger::mEt_Min [private] |
Definition at line 29 of file L2TauJetsMerger.h.
std::map<int, const reco::CaloJet> L2TauJetsMerger::myL2L1JetsMap [private] |
Definition at line 30 of file L2TauJetsMerger.h.