CMS 3D CMS Logo

JetChargeProducer.cc
Go to the documentation of this file.
2 
4  : srcToken_(consumes<reco::JetTracksAssociationCollection>(cfg.getParameter<edm::InputTag>("src"))), algo_(cfg) {
5  produces<JetChargeCollection>();
6 }
7 
10  iEvent.getByToken(srcToken_, hJTAs);
13 
14  if (hJTAs->keyProduct().isNull()) {
15  // need to work around this bug someway, altough it's not stricly my fault
16  iEvent.put(std::make_unique<JetChargeCollection>());
17  return;
18  }
19  auto ret = std::make_unique<JetChargeCollection>(hJTAs->keyProduct());
20  for (IT it = hJTAs->begin(), ed = hJTAs->end(); it != ed; ++it) {
21  const JetRef &jet = it->first;
22  const reco::TrackRefVector &tracks = it->second;
23  float val = static_cast<float>(algo_.charge(jet->p4(), tracks));
25  }
26 
27  iEvent.put(std::move(ret));
28 }
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:373
edm::StreamID
Definition: StreamID.h:30
JetChargeProducer::produce
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Definition: JetChargeProducer.cc:8
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
JetChargeProducer::srcToken_
const edm::EDGetTokenT< reco::JetTracksAssociationCollection > srcToken_
Definition: JetChargeProducer.h:21
edm::RefVector< TrackCollection >
JetChargeProducer::algo_
const JetCharge algo_
Definition: JetChargeProducer.h:22
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle
Definition: AssociativeIterator.h:50
JetChargeProducer::JetChargeProducer
JetChargeProducer(const edm::ParameterSet &cfg)
Definition: JetChargeProducer.cc:3
edm::AssociationVector::begin
const_iterator begin() const
Definition: AssociationVector.h:108
edm::AssociationVector::end
const_iterator end() const
Definition: AssociationVector.h:109
edm::AssociationVector::keyProduct
KeyRefProd const & keyProduct() const
Definition: AssociationVector.h:100
JetCharge::charge
double charge(const LorentzVector &lv, const reco::TrackCollection &vec) const
Definition: JetCharge.cc:7
reco::JetFloatAssociation::setValue
bool setValue(Container &, const reco::JetBaseRef &, float)
associate jet with value
Definition: JetFloatAssociation.cc:9
reco::JetTracksAssociationCollection
JetTracksAssociation::Container JetTracksAssociationCollection
typedefs for backward compatibility
Definition: JetTracksAssociation.h:60
edm::ParameterSet
Definition: ParameterSet.h:47
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::AssociationVector::const_iterator
transient_vector_type::const_iterator const_iterator
Definition: AssociationVector.h:106
edm::EventSetup
Definition: EventSetup.h:57
IT
std::vector< LinkConnSpec >::const_iterator IT
Definition: TriggerBoardSpec.cc:5
l1t::JetRef
edm::Ref< JetBxCollection > JetRef
Definition: Jet.h:12
looper.cfg
cfg
Definition: looper.py:297
heppy_batch.val
val
Definition: heppy_batch.py:351
eostools.move
def move(src, dest)
Definition: eostools.py:511
JetChargeProducer.h
metsig::jet
Definition: SignAlgoResolutions.h:47
edm::RefToBase< reco::Jet >
edm::Event
Definition: Event.h:73