CMS 3D CMS Logo

L1HLTJetsMatching.cc
Go to the documentation of this file.
2 #include "Math/GenVector/VectorUtil.h"
7 //
8 // class decleration
9 //
10 using namespace reco;
11 using namespace std;
12 using namespace edm;
13 using namespace l1extra;
14 
16  jetSrc = consumes<edm::View<reco::Candidate> >(iConfig.getParameter<InputTag>("JetSrc"));
17  tauTrigger = consumes<trigger::TriggerFilterObjectWithRefs>(iConfig.getParameter<InputTag>("L1TauTrigger"));
18  mEt_Min = iConfig.getParameter<double>("EtMin");
19 
20  produces<CaloJetCollection>();
21 }
22 
24 
26  using namespace edm;
27  using namespace std;
28  using namespace reco;
29  using namespace trigger;
30  using namespace l1extra;
31 
32  typedef std::vector<LeafCandidate> LeafCandidateCollection;
33 
34  unique_ptr<CaloJetCollection> tauL2jets(new CaloJetCollection);
35 
36  double deltaR = 1.0;
37  double matchingR = 0.5;
38  //Getting HLT jets to be matched
40  iEvent.getByToken(jetSrc, tauJets);
41 
42  // std::cout <<"Size of input jet collection "<<tauJets->size()<<std::endl;
43 
45  iEvent.getByToken(tauTrigger, l1TriggeredTaus);
46 
47  tauCandRefVec.clear();
48  jetCandRefVec.clear();
49 
50  l1TriggeredTaus->getObjects(trigger::TriggerL1TauJet, tauCandRefVec);
51  l1TriggeredTaus->getObjects(trigger::TriggerL1CenJet, jetCandRefVec);
52  math::XYZPoint a(0., 0., 0.);
54 
55  for (unsigned int iL1Tau = 0; iL1Tau < tauCandRefVec.size(); iL1Tau++) {
56  for (unsigned int iJet = 0; iJet < tauJets->size(); iJet++) {
57  //Find the relative L2TauJets, to see if it has been reconstructed
58  const Candidate& myJet = (*tauJets)[iJet];
59  deltaR = ROOT::Math::VectorUtil::DeltaR(myJet.p4().Vect(), (tauCandRefVec[iL1Tau]->p4()).Vect());
60  if (deltaR < matchingR) {
61  // LeafCandidate myLC(myJet);
62  CaloJet myCaloJet(myJet.p4(), a, f);
63  if (myJet.pt() > mEt_Min) {
64  // tauL2LC->push_back(myLC);
65  tauL2jets->push_back(myCaloJet);
66  }
67  break;
68  }
69  }
70  }
71 
72  for (unsigned int iL1Tau = 0; iL1Tau < jetCandRefVec.size(); iL1Tau++) {
73  for (unsigned int iJet = 0; iJet < tauJets->size(); iJet++) {
74  const Candidate& myJet = (*tauJets)[iJet];
75  //Find the relative L2TauJets, to see if it has been reconstructed
76  deltaR = ROOT::Math::VectorUtil::DeltaR(myJet.p4().Vect(), (jetCandRefVec[iL1Tau]->p4()).Vect());
77  if (deltaR < matchingR) {
78  // LeafCandidate myLC(myJet);
79  CaloJet myCaloJet(myJet.p4(), a, f);
80  if (myJet.pt() > mEt_Min) {
81  //tauL2LC->push_back(myLC);
82  tauL2jets->push_back(myCaloJet);
83  }
84  break;
85  }
86  }
87  }
88 
89  //std::cout <<"Size of L1HLT matched jets "<<tauL2jets->size()<<std::endl;
90 
91  iEvent.put(std::move(tauL2jets));
92  // iEvent.put(std::move(tauL2LC));
93 }
reco::CaloJet
Jets made from CaloTowers.
Definition: CaloJet.h:27
L1HLTJetsMatching.h
L1HLTJetsMatching::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: L1HLTJetsMatching.cc:25
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
edm
HLT enums.
Definition: AlignableModifier.h:19
reco::Candidate::pt
virtual double pt() const =0
transverse momentum
TriggerTypeDefs.h
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle
Definition: AssociativeIterator.h:50
trigger::TriggerRefsCollections::getObjects
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
Definition: TriggerRefsCollections.h:590
EDMException.h
L1JetParticleFwd.h
edm::ParameterSet
Definition: ParameterSet.h:47
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
a
double a
Definition: hdecay.h:119
L1HLTJetsMatching::~L1HLTJetsMatching
~L1HLTJetsMatching() override
Definition: L1HLTJetsMatching.cc:23
iEvent
int iEvent
Definition: GenABIO.cc:224
reco::CaloJetCollection
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects
Definition: CaloJetCollection.h:15
edm::EventSetup
Definition: EventSetup.h:58
electronAnalyzer_cfi.DeltaR
DeltaR
Definition: electronAnalyzer_cfi.py:33
L1HLTJetsMatching::L1HLTJetsMatching
L1HLTJetsMatching(const edm::ParameterSet &)
Definition: L1HLTJetsMatching.cc:15
reco::Candidate
Definition: Candidate.h:27
HLT_FULL_cff.matchingR
matchingR
Definition: HLT_FULL_cff.py:68699
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
trigger::TriggerL1TauJet
Definition: TriggerTypeDefs.h:35
reco::deltaR
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
reco::Candidate::p4
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
trigger
Definition: HLTPrescaleTableCond.h:8
trigger::TriggerL1CenJet
Definition: TriggerTypeDefs.h:33
l1extra
Definition: L1EmParticle.h:26
reco::CaloJet::Specific
Definition: CaloJet.h:32
edm::Event
Definition: Event.h:73
L1JetParticle.h
DisplacedJet_Monitor_cff.jetSrc
jetSrc
Definition: DisplacedJet_Monitor_cff.py:79
edm::InputTag
Definition: InputTag.h:15