CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
IPProducerHelpers::FromJetAndCands Class Reference

#include <IPProducer.h>

Public Member Functions

 FromJetAndCands (const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iC)
 
std::vector< reco::JetTagInfomakeBaseVector (edm::Event &iEvent)
 
std::vector< reco::CandidatePtrtracks (edm::Event &, const reco::JetTagInfo &it)
 

Public Attributes

std::vector< std::vector
< reco::CandidatePtr > > 
m_map
 
double maxDeltaR
 
edm::EDGetTokenT< edm::View
< reco::Candidate > > 
token_cands
 
edm::EDGetTokenT< edm::View
< reco::Jet > > 
token_jets
 

Detailed Description

Definition at line 84 of file IPProducer.h.

Constructor & Destructor Documentation

IPProducerHelpers::FromJetAndCands::FromJetAndCands ( const edm::ParameterSet iConfig,
edm::ConsumesCollector &&  iC 
)
inline

Definition at line 86 of file IPProducer.h.

87  token_cands(iC.consumes<edm::View<reco::Candidate> >(iConfig.getParameter<edm::InputTag>("candidates"))), maxDeltaR(iConfig.getParameter<double>("maxDeltaR")){}
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::View< reco::Jet > > token_jets
Definition: IPProducer.h:117
edm::EDGetTokenT< edm::View< reco::Candidate > > token_cands
Definition: IPProducer.h:118

Member Function Documentation

std::vector<reco::JetTagInfo> IPProducerHelpers::FromJetAndCands::makeBaseVector ( edm::Event iEvent)
inline

Definition at line 93 of file IPProducer.h.

References edm::Event::getByToken(), i, j, fwrapper::jets, and p4.

93  {
95  iEvent.getByToken(token_jets, jets);
96  std::vector<reco::JetTagInfo> bases;
97 
99  iEvent.getByToken(token_cands, cands);
100  m_map.clear();
101  m_map.resize(jets->size());
102  size_t i = 0;
103  for(edm::View<reco::Jet>::const_iterator it = jets->begin();
104  it != jets->end(); it++, i++) {
105  edm::RefToBase<reco::Jet> jRef(jets, i);
106  bases.push_back(jRef);
107  //FIXME: add deltaR or any other requirement here
108  for(size_t j=0;j<cands->size();j++) {
109  if((*cands)[j].bestTrack()!=0 && ROOT::Math::VectorUtil::DeltaR((*cands)[j].p4(),(*jets)[i].p4()) < maxDeltaR && (*cands)[j].charge() !=0 ){
110  m_map[i].push_back(cands->ptrAt(j));
111  }
112  }
113  }
114  return bases;
115  }
int i
Definition: DBlmapReader.cc:9
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
std::vector< std::vector< reco::CandidatePtr > > m_map
Definition: IPProducer.h:116
double p4[4]
Definition: TauolaWrapper.h:92
vector< PseudoJet > jets
int j
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< edm::View< reco::Jet > > token_jets
Definition: IPProducer.h:117
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
edm::EDGetTokenT< edm::View< reco::Candidate > > token_cands
Definition: IPProducer.h:118
std::vector<reco::CandidatePtr> IPProducerHelpers::FromJetAndCands::tracks ( edm::Event ,
const reco::JetTagInfo it 
)
inline

Definition at line 89 of file IPProducer.h.

References reco::JetTagInfo::jet(), and edm::RefToBase< T >::key().

90  {
91  return m_map[it.jet().key()];
92  }
virtual edm::RefToBase< Jet > jet(void) const
returns a polymorphic reference to the tagged jet
Definition: JetTagInfo.h:22
std::vector< std::vector< reco::CandidatePtr > > m_map
Definition: IPProducer.h:116
size_t key() const
Definition: RefToBase.h:229

Member Data Documentation

std::vector<std::vector<reco::CandidatePtr> > IPProducerHelpers::FromJetAndCands::m_map

Definition at line 116 of file IPProducer.h.

double IPProducerHelpers::FromJetAndCands::maxDeltaR

Definition at line 119 of file IPProducer.h.

edm::EDGetTokenT<edm::View<reco::Candidate> > IPProducerHelpers::FromJetAndCands::token_cands

Definition at line 118 of file IPProducer.h.

edm::EDGetTokenT<edm::View<reco::Jet> > IPProducerHelpers::FromJetAndCands::token_jets

Definition at line 117 of file IPProducer.h.