CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
JetChargeProducer.cc
Go to the documentation of this file.
2 
4 srcToken_(consumes<reco::JetTracksAssociationCollection>(cfg.getParameter<edm::InputTag>("src"))),
5 algo_(cfg) {
6  produces<JetChargeCollection>();
7 }
8 
11  iEvent.getByToken(srcToken_, hJTAs);
14 
15  if (hJTAs->keyProduct().isNull()) {
16  // need to work around this bug someway, altough it's not stricly my fault
17  iEvent.put(std::make_unique<JetChargeCollection>());
18  return;
19  }
20  auto ret = std::make_unique<JetChargeCollection>(hJTAs->keyProduct());
21  for (IT it = hJTAs->begin(), ed = hJTAs->end(); it != ed; ++it) {
22  const JetRef &jet = it->first;
23  const reco::TrackRefVector &tracks = it->second;
24  float val = static_cast<float>( algo_.charge(jet->p4(), tracks) );
26  }
27 
28  iEvent.put(std::move(ret));
29 }
tuple ret
prodAgent to be discontinued
double charge(const LorentzVector &lv, const reco::TrackCollection &vec) const
Definition: JetCharge.cc:7
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
algo_(conf.existsAs< bool >("Correct")?conf.getParameter< bool >("Correct"):true, conf.getParameter< double >("e9e25Cut"), conf.getParameter< double >("intercept2DCut"), conf.existsAs< bool >("intercept2DSlope")?conf.getParameter< double >("intercept2DSlope"):defaultSlope2D_, conf.getParameter< std::vector< double > >("e1e9Cut"), conf.getParameter< std::vector< double > >("eCOREe9Cut"), conf.getParameter< std::vector< double > >("eSeLCut"), hfvars_)
tuple cfg
Definition: looper.py:293
transient_vector_type::const_iterator const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
JetTracksAssociation::Container JetTracksAssociationCollection
typedefs for backward compatibility
const edm::EDGetTokenT< reco::JetTracksAssociationCollection > srcToken_
edm::Ref< JetBxCollection > JetRef
Definition: Jet.h:12
const JetCharge algo_
int iEvent
Definition: GenABIO.cc:230
virtual void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const
def move
Definition: eostools.py:510
std::vector< LinkConnSpec >::const_iterator IT
bool setValue(Container &, const reco::JetBaseRef &, float)
associate jet with value
JetChargeProducer(const edm::ParameterSet &cfg)
tuple tracks
Definition: testEve_cfg.py:39