CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFJetMaker.cc
Go to the documentation of this file.
3 
5 
7 
8  PFJetCollection_ = iCollector.consumes<edm::View<reco::Jet> >(iConfig.getParameter<edm::InputTag>("pfJetsInputTag"));
9  BJetTags_ = iCollector.consumes<reco::JetFloatAssociation::Container>(iConfig.getParameter<edm::InputTag>("trackCountingHighEffBJetTags"));
10 
11 }
12 
13 void PFJetMaker::SetVars(HWW& hww, const edm::Event& iEvent, const edm::EventSetup& iSetup){
14 
15  hww.Load_pfjets_p4();
16  hww.Load_pfjets_area();
18 
19  bool validToken;
20 
21  edm::Handle<edm::View<reco::Jet> > pfjetsHandle;
22  validToken = iEvent.getByToken(PFJetCollection_, pfjetsHandle );
23  if(!validToken) return;
24 
26  validToken = iEvent.getByToken(BJetTags_, trackCountingHighEffBJetTags);
27  if(!validToken) return;
28 
29  for(edm::View<reco::Jet>::const_iterator jet_it = pfjetsHandle->begin(); jet_it != pfjetsHandle->end(); jet_it++) {
30 
31  if(jet_it->pt() <= 0.0 ) continue;
32 
33  hww.pfjets_p4() .push_back( LorentzVector( jet_it->p4() ) );
34  hww.pfjets_area() .push_back(jet_it->jetArea() );
35 
36  unsigned int idx = jet_it-pfjetsHandle->begin();
37  edm::RefToBase<reco::Jet> jetRef = pfjetsHandle->refAt(idx);
38 
39  hww.pfjets_trackCountingHighEffBJetTag().push_back( (*trackCountingHighEffBJetTags)[jetRef] );
40 
41  }
42 
43 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
void Load_pfjets_p4()
Definition: HWW.cc:1364
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
void Load_pfjets_trackCountingHighEffBJetTag()
Definition: HWW.cc:1379
void Load_pfjets_area()
Definition: HWW.cc:1370
void SetVars(HWW &, const edm::Event &, const edm::EventSetup &)
Definition: PFJetMaker.cc:13
edm::EDGetTokenT< reco::JetFloatAssociation::Container > BJetTags_
Definition: PFJetMaker.h:20
int iEvent
Definition: GenABIO.cc:230
edm::EDGetTokenT< edm::View< reco::Jet > > PFJetCollection_
Definition: PFJetMaker.h:19
Definition: HWW.h:12
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
std::vector< float > & pfjets_trackCountingHighEffBJetTag()
Definition: HWW.cc:789
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
PFJetMaker(const edm::ParameterSet &, edm::ConsumesCollector)
Definition: PFJetMaker.cc:6
std::vector< LorentzVector > & pfjets_p4()
Definition: HWW.cc:769
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< float > > XYZTLorentzVectorF
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:22
std::vector< float > & pfjets_area()
Definition: HWW.cc:777
math::PtEtaPhiELorentzVectorF LorentzVector