2 #include "Math/GenVector/VectorUtil.h"
13 using namespace l1extra;
18 for( vtag::const_iterator
s =
jetSrc.begin();
s !=
jetSrc.end(); ++
s ) {
20 jetSrcToken.push_back(aToken);
22 l1ParticlesTau = consumes<L1JetParticleCollection>(iConfig.
getParameter<
InputTag>(
"L1ParticlesTau"));
23 l1ParticlesJet = consumes<L1JetParticleCollection>(iConfig.
getParameter<
InputTag>(
"L1ParticlesJet"));
24 tauTrigger = consumes<trigger::TriggerFilterObjectWithRefs>(iConfig.
getParameter<
InputTag>(
"L1TauTrigger"));
27 produces<CaloJetCollection>();
38 using namespace trigger;
39 using namespace l1extra;
47 myL2L1JetsMap.clear();
49 typedef std::vector<edm::EDGetTokenT<reco::CaloJetCollection> > vtag_token;
50 for( vtag_token::const_iterator
s = jetSrcToken.begin();
s != jetSrcToken.end(); ++
s ) {
53 CaloJetCollection::const_iterator iTau = tauJets->begin();
54 if(iTau != tauJets->end()){
56 myL2L1JetsMap.insert(std::pair<int, const CaloJet>(iL1Jet, *(iTau)));
65 double matchingR = 0.01;
82 for(
unsigned int i=0;
i<myL1Tau.size();
i++)
84 myL1Obj.push_back(myL1Tau[
i]);
86 for(
unsigned int j=0;
j<myL1Jet.size();
j++)
88 myL1Obj.push_back(myL1Jet[
j]);
93 if(iEvent.
getByToken(tauTrigger,l1TriggeredTaus)){
96 tauCandRefVec.
clear();
97 jetCandRefVec.clear();
102 for(
unsigned int iL1Tau=0; iL1Tau <tauCandRefVec.size();iL1Tau++)
104 for(
unsigned int iJet=0;iJet<myL1Obj.size();iJet++)
107 std::map<int, const reco::CaloJet>::const_iterator myL2itr = myL2L1JetsMap.find(iJet);
108 if(myL2itr!=myL2L1JetsMap.end()){
110 if(&tauCandRefVec[iL1Tau])
114 const CaloJet myL2TauJet = myL2itr->second;
115 if(myL2TauJet.
pt() > mEt_Min) tauL2jets->push_back(myL2TauJet);
116 myL2L1JetsMap.erase(myL2itr->first);
125 for(
unsigned int iL1Tau=0; iL1Tau <jetCandRefVec.size();iL1Tau++)
127 for(
unsigned int iJet=0;iJet<myL1Obj.size();iJet++)
130 std::map<int, const reco::CaloJet>::const_iterator myL2itr = myL2L1JetsMap.find(iJet);
131 if(myL2itr!=myL2L1JetsMap.end()){
133 if(&jetCandRefVec[iL1Tau])
137 const CaloJet myL2TauJet = myL2itr->second;
139 if(myL2TauJet.
pt() > mEt_Min) tauL2jets->push_back(myL2TauJet);
140 myL2L1JetsMap.erase(myL2itr->first);
152 iEvent.
put(tauL2jets);
T getParameter(std::string const &) const
Jets made from CaloTowers.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
double deltaR(const T1 &t1, const T2 &t2)
virtual double pt() const
transverse momentum
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
L2TauJetsProvider(const edm::ParameterSet &)
virtual void produce(edm::Event &, const edm::EventSetup &) override
std::vector< edm::InputTag > vtag
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects