CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
reco::modules::JetFlavourIdentifier Class Reference
Inheritance diagram for reco::modules::JetFlavourIdentifier:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

enum  DEFINITION_T {
  PHYSICS = 0, ALGO, NEAREST_STATUS2, NEAREST_STATUS3,
  HEAVIEST, N_DEFINITIONS, NULL_DEF
}
 
- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 JetFlavourIdentifier (const edm::ParameterSet &)
 
 ~JetFlavourIdentifier () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void fillLeptons (const std::vector< const reco::Candidate *> &, JetFlavour::Leptons &, int, int, math::XYZTLorentzVector const &thePartonLV) const
 
std::vector< const reco::Candidate * > findCandidates (const reco::Candidate *, int, math::XYZTLorentzVector const &thePartonLV) const
 
JetFlavour::Leptons findLeptons (const GenParticleRef &) const
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 

Static Private Member Functions

static int heaviestFlavour (int)
 

Private Attributes

DEFINITION_T definition
 
bool leptonInfo_
 
bool physDefinition
 
EDGetTokenT< JetMatchedPartonsCollectionsourceByReferToken_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 86 of file JetFlavourIdentifier.cc.

Member Enumeration Documentation

◆ DEFINITION_T

Constructor & Destructor Documentation

◆ JetFlavourIdentifier()

JetFlavourIdentifier::JetFlavourIdentifier ( const edm::ParameterSet iConfig)

Definition at line 118 of file JetFlavourIdentifier.cc.

References edm::ParameterSet::exists(), and edm::ParameterSet::getParameter().

118  {
119  produces<JetFlavourMatchingCollection>();
120  sourceByReferToken_ = consumes<JetMatchedPartonsCollection>(iConfig.getParameter<InputTag>("srcByReference"));
121  physDefinition = iConfig.getParameter<bool>("physicsDefinition");
122  leptonInfo_ = iConfig.exists("leptonInfo") ? iConfig.getParameter<bool>("leptonInfo") : false;
123  // If we have a definition of which parton to identify, use it,
124  // otherwise we default to the "old" behavior of either "physics" or "algorithmic".
125  // Furthermore, if the specified definition is not sensible for the given jet,
126  // then the "physDefinition" switch is used to identify the flavour of the jet.
127  if (iConfig.exists("definition")) {
128  definition = static_cast<DEFINITION_T>(iConfig.getParameter<int>("definition"));
129  } else {
131  }
132 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
bool exists(std::string const &parameterName) const
checks if a parameter exists
EDGetTokenT< JetMatchedPartonsCollection > sourceByReferToken_

◆ ~JetFlavourIdentifier()

JetFlavourIdentifier::~JetFlavourIdentifier ( )
override

Definition at line 136 of file JetFlavourIdentifier.cc.

136 {}

Member Function Documentation

◆ fillLeptons()

void JetFlavourIdentifier::fillLeptons ( const std::vector< const reco::Candidate *> &  cands,
JetFlavour::Leptons leptons,
int  rank,
int  flavour,
math::XYZTLorentzVector const &  thePartonLV 
) const
private

test for neutrinos because of conversions and dalitz pions

Definition at line 342 of file JetFlavourIdentifier.cc.

References funct::abs(), HLT_2022v14_cff::cands, mps_fire::i, dqmiolumiharvest::j, HLT_2022v14_cff::leptons, SiStripPI::max, and EgammaValidation_cff::pdgId.

346  {
347  for (unsigned int j = 0; j < cands.size(); j++) {
348  for (unsigned int i = 0; i < cands[j]->numberOfDaughters(); i++) {
349  int pdgId = std::abs(cands[j]->daughter(i)->pdgId());
350 
351  // for(int z = 1; z <= rank; z *= 10) std::cout << " ------ ";
352  // std::cout << pdgId << std::endl;
353 
355  if (pdgId == 12)
356  leptons.electron += rank;
357  else if (pdgId == 14)
358  leptons.muon += rank;
359  else if (pdgId == 16)
360  leptons.tau += rank;
361  else {
362  int heaviest = heaviestFlavour(pdgId);
363  int heaviest_ = heaviest < 10 ? heaviest : 0;
364  if (!heaviest || (flavour < 4 ? (heaviest_ < 4) : (heaviest >= 4))) {
365  std::vector<const reco::Candidate*> newcands = findCandidates(cands[j]->daughter(i), heaviest, thePartonLV);
366  if (pdgId <= 110)
367  newcands.push_back(cands[j]->daughter(i));
368  fillLeptons(newcands, leptons, rank * 10, std::max(heaviest_, flavour), thePartonLV);
369  }
370  }
371  }
372  }
373 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void fillLeptons(const std::vector< const reco::Candidate *> &, JetFlavour::Leptons &, int, int, math::XYZTLorentzVector const &thePartonLV) const
std::vector< const reco::Candidate * > findCandidates(const reco::Candidate *, int, math::XYZTLorentzVector const &thePartonLV) const
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:21

◆ findCandidates()

std::vector< const reco::Candidate * > JetFlavourIdentifier::findCandidates ( const reco::Candidate cand,
int  partonFlavour,
math::XYZTLorentzVector const &  thePartonLV 
) const
private

Definition at line 307 of file JetFlavourIdentifier.cc.

References funct::abs(), HLT_2022v14_cff::cands, filterCSVwithJSON::copy, electronAnalyzer_cfi::DeltaR, mps_fire::i, jetMC_cff::partonFlavour, and EgammaValidation_cff::pdgId.

308  {
309  std::vector<const reco::Candidate*> cands;
310  if (!cand)
311  return cands;
312 
313  for (unsigned int i = 0; i < cand->numberOfDaughters(); i++) {
314  /*
315  std::cout << "DeltaR - " << partonFlavour << " ";
316  if (DeltaR(thePartonLV, cand->daughter(i)->p4()) > 0.7) std::cout << "(";
317  std::cout << cand->daughter(i)->pdgId() << ": " << DeltaR(thePartonLV, cand->daughter(i)->p4());
318  if (DeltaR(thePartonLV, cand->daughter(i)->p4()) > 0.7) std::cout << ")";
319  std::cout << std::endl;
320 */
321  if (DeltaR(thePartonLV, cand->daughter(i)->p4()) < 0.7) {
322  int pdgId = std::abs(cand->daughter(i)->pdgId());
324  if (flavour == partonFlavour || (flavour >= 10 && partonFlavour >= 10)) {
325  // std::cout << "<------- " << std::endl;
326  std::vector<const reco::Candidate*> newcands = findCandidates(cand->daughter(i), partonFlavour, thePartonLV);
327  // std::cout << " ------->" << std::endl;
328  std::copy(newcands.begin(), newcands.end(), std::back_inserter(cands));
329  }
330  if (partonFlavour >= 10)
331  cands.push_back(cand->daughter(i));
332  }
333  }
334 
335  if (cands.empty() && std::abs(cand->pdgId()) > 110 &&
336  !(partonFlavour >= 4 && partonFlavour < 10 && heaviestFlavour(cand->pdgId()) < 4))
337  cands.push_back(cand);
338 
339  return cands;
340 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< const reco::Candidate * > findCandidates(const reco::Candidate *, int, math::XYZTLorentzVector const &thePartonLV) const
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:21

◆ findLeptons()

JetFlavour::Leptons JetFlavourIdentifier::findLeptons ( const GenParticleRef parton) const
private

first daughter of the parton should be an MC particle (pdgId==92,93)

lookup particles with parton flavour and weak decay

count leptons of candidates

Definition at line 286 of file JetFlavourIdentifier.cc.

References funct::abs(), HLT_2022v14_cff::candidates, and jetMC_cff::partonFlavour.

286  {
287  JetFlavour::Leptons theLeptons;
288 
289  auto const& thePartonLV = parton->p4();
290 
292  const reco::Candidate* mcstring = parton->daughter(0);
293  int partonFlavour = std::abs(parton->pdgId());
294  // std::cout << "parton DeltaR: " << DeltaR(thePartonLV, parton->p4()) << std::endl;
295 
297  std::vector<const reco::Candidate*> candidates = findCandidates(mcstring, partonFlavour, parton->p4());
298  // std::cout << "Candidates are:" << std::endl;
299  // for(unsigned int j = 0; j < candidates.size(); j++) std::cout << " --> " << candidates[j]->pdgId() << std::endl;
300 
302  fillLeptons(candidates, theLeptons, 1, partonFlavour, thePartonLV);
303 
304  return theLeptons;
305 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
lepton info struct
Definition: JetFlavour.h:23
void fillLeptons(const std::vector< const reco::Candidate *> &, JetFlavour::Leptons &, int, int, math::XYZTLorentzVector const &thePartonLV) const
std::vector< const reco::Candidate * > findCandidates(const reco::Candidate *, int, math::XYZTLorentzVector const &thePartonLV) const

◆ heaviestFlavour()

int JetFlavourIdentifier::heaviestFlavour ( int  pdgId)
staticprivate

Definition at line 375 of file JetFlavourIdentifier.cc.

References funct::abs(), and EgammaValidation_cff::pdgId.

375  {
376  int flavour = 0;
377 
378  pdgId = std::abs(pdgId) % 100000;
379  if (pdgId > 110) {
380  while (pdgId % 10 > 0 && pdgId % 10 < 6) {
381  pdgId /= 10;
382  if (pdgId % 10 > flavour)
383  flavour = pdgId % 10;
384  }
385  } else
386  flavour = pdgId;
387 
388  return flavour;
389 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:21

◆ produce()

void JetFlavourIdentifier::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iEs 
) const
overrideprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 140 of file JetFlavourIdentifier.cc.

References lumi::ALGO, reco::MatchedPartons::algoDefinitionParton(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::begin(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::empty(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::end(), edm::Ref< C, T, F >::get(), reco::MatchedPartons::heaviest(), iEvent, edm::Ref< C, T, F >::isNonnull(), dqmiolumiharvest::j, findQualityFiles::jj, edm::makeRefToBaseProdFrom(), eostools::move(), reco::MatchedPartons::nearest_status2(), reco::MatchedPartons::nearest_status3(), sistrip::PHYSICS, and reco::MatchedPartons::physicsDefinitionParton().

140  {
141  // Get the JetMatchedPartons
143  iEvent.getByToken(sourceByReferToken_, theTagByRef);
144 
145  // Create a JetFlavourMatchingCollection
147  if (!theTagByRef->empty()) {
148  RefToBase<Jet> jj = theTagByRef->begin()->first;
150  } else {
151  jfmc = new JetFlavourMatchingCollection();
152  }
153  std::unique_ptr<reco::JetFlavourMatchingCollection> jetFlavMatching(jfmc);
154 
155  // Loop over the matched partons and see which match.
156  for (JetMatchedPartonsCollection::const_iterator j = theTagByRef->begin(); j != theTagByRef->end(); j++) {
157  // Consider this match.
158  const MatchedPartons aMatch = (*j).second;
159 
160  // This will hold the 4-vector, vertex, flavour and the leptonian decays (0: no lepton, xyz: x leptons in layer 2, y in layer 1 and z in layer 0) of the requested object.
161  math::XYZTLorentzVector thePartonLorentzVector(0, 0, 0, 0);
162  math::XYZPoint thePartonVertex(0, 0, 0);
163  int thePartonFlavour = 0;
164  JetFlavour::Leptons theLeptons;
165 
166  // get the partons based on which definition to use.
167  switch (definition) {
168  case PHYSICS: {
169  const GenParticleRef& aPartPhy = aMatch.physicsDefinitionParton();
170  if (aPartPhy.isNonnull()) {
171  thePartonLorentzVector = aPartPhy.get()->p4();
172  thePartonVertex = aPartPhy.get()->vertex();
173  thePartonFlavour = aPartPhy.get()->pdgId();
174  if (leptonInfo_)
175  theLeptons = findLeptons(aPartPhy);
176  }
177  break;
178  }
179  case ALGO: {
180  const GenParticleRef& aPartAlg = aMatch.algoDefinitionParton();
181  if (aPartAlg.isNonnull()) {
182  thePartonLorentzVector = aPartAlg.get()->p4();
183  thePartonVertex = aPartAlg.get()->vertex();
184  thePartonFlavour = aPartAlg.get()->pdgId();
185  if (leptonInfo_)
186  theLeptons = findLeptons(aPartAlg);
187  }
188  break;
189  }
190  case NEAREST_STATUS2: {
191  const GenParticleRef& aPartN2 = aMatch.nearest_status2();
192  if (aPartN2.isNonnull()) {
193  thePartonLorentzVector = aPartN2.get()->p4();
194  thePartonVertex = aPartN2.get()->vertex();
195  thePartonFlavour = aPartN2.get()->pdgId();
196  if (leptonInfo_)
197  theLeptons = findLeptons(aPartN2);
198  }
199  break;
200  }
201  case NEAREST_STATUS3: {
202  const GenParticleRef& aPartN3 = aMatch.nearest_status3();
203  if (aPartN3.isNonnull()) {
204  thePartonLorentzVector = aPartN3.get()->p4();
205  thePartonVertex = aPartN3.get()->vertex();
206  thePartonFlavour = aPartN3.get()->pdgId();
207  if (leptonInfo_)
208  theLeptons = findLeptons(aPartN3);
209  }
210  break;
211  }
212  case HEAVIEST: {
213  const GenParticleRef aPartHeaviest = aMatch.heaviest();
214  if (aPartHeaviest.isNonnull()) {
215  thePartonLorentzVector = aPartHeaviest.get()->p4();
216  thePartonVertex = aPartHeaviest.get()->vertex();
217  thePartonFlavour = aPartHeaviest.get()->pdgId();
218  if (leptonInfo_)
219  theLeptons = findLeptons(aPartHeaviest);
220  }
221  break;
222  }
223  // Default case is backwards-compatible
224  default: {
225  if (physDefinition) {
226  const GenParticleRef& aPartPhy = aMatch.physicsDefinitionParton();
227  if (aPartPhy.isNonnull()) {
228  thePartonLorentzVector = aPartPhy.get()->p4();
229  thePartonVertex = aPartPhy.get()->vertex();
230  thePartonFlavour = aPartPhy.get()->pdgId();
231  if (leptonInfo_)
232  theLeptons = findLeptons(aPartPhy);
233  }
234  } else {
235  const GenParticleRef& aPartAlg = aMatch.algoDefinitionParton();
236  if (aPartAlg.isNonnull()) {
237  thePartonLorentzVector = aPartAlg.get()->p4();
238  thePartonVertex = aPartAlg.get()->vertex();
239  thePartonFlavour = aPartAlg.get()->pdgId();
240  if (leptonInfo_)
241  theLeptons = findLeptons(aPartAlg);
242  }
243  }
244  } break;
245  } // end switch on definition
246 
247  // Now make sure we have a match. If the user specified "heaviest", for instance,
248  // and there is no b- or c-quarks, then fall back to the "physDefinition" switch.
249 
250  if (thePartonFlavour == 0) {
251  if (physDefinition) {
252  const GenParticleRef& aPartPhy = aMatch.physicsDefinitionParton();
253  if (aPartPhy.isNonnull()) {
254  thePartonLorentzVector = aPartPhy.get()->p4();
255  thePartonVertex = aPartPhy.get()->vertex();
256  thePartonFlavour = aPartPhy.get()->pdgId();
257  if (leptonInfo_)
258  theLeptons = findLeptons(aPartPhy);
259  }
260  } else {
261  const GenParticleRef& aPartAlg = aMatch.algoDefinitionParton();
262  if (aPartAlg.isNonnull()) {
263  thePartonLorentzVector = aPartAlg.get()->p4();
264  thePartonVertex = aPartAlg.get()->vertex();
265  thePartonFlavour = aPartAlg.get()->pdgId();
266  if (leptonInfo_)
267  theLeptons = findLeptons(aPartAlg);
268  }
269  }
270  }
271 
272  /*
273  std::cout << "Leptons of " <<thePartonFlavour << " Jet: " << std::endl;
274  std::cout << " electrons: " <<theLeptons.electron << std::endl;
275  std::cout << " muons : " <<theLeptons.muon << std::endl;
276  std::cout << " tau : " <<theLeptons.tau << std::endl;
277 */
278  // Add the jet->flavour match to the map.
279  (*jetFlavMatching)[(*j).first] = JetFlavour(thePartonLorentzVector, thePartonVertex, thePartonFlavour, theLeptons);
280  } // end loop over jets
281 
282  // Put the object into the event.
283  iEvent.put(std::move(jetFlavMatching));
284 }
JetFlavour::Leptons findLeptons(const GenParticleRef &) const
transient_vector_type::const_iterator const_iterator
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
const_iterator begin() const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
int iEvent
Definition: GenABIO.cc:224
const GenParticleRef & nearest_status3() const
const GenParticleRef & nearest_status2() const
const GenParticleRef & physicsDefinitionParton() const
const GenParticleRef & algoDefinitionParton() const
const_iterator end() const
lepton info struct
Definition: JetFlavour.h:23
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
const GenParticleRef heaviest() const
RefToBaseProd< T > makeRefToBaseProdFrom(RefToBase< T > const &iRef, Event const &iEvent)
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
EDGetTokenT< JetMatchedPartonsCollection > sourceByReferToken_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ definition

DEFINITION_T reco::modules::JetFlavourIdentifier::definition
private

Definition at line 110 of file JetFlavourIdentifier.cc.

◆ leptonInfo_

bool reco::modules::JetFlavourIdentifier::leptonInfo_
private

Definition at line 109 of file JetFlavourIdentifier.cc.

◆ physDefinition

bool reco::modules::JetFlavourIdentifier::physDefinition
private

Definition at line 108 of file JetFlavourIdentifier.cc.

◆ sourceByReferToken_

EDGetTokenT<JetMatchedPartonsCollection> reco::modules::JetFlavourIdentifier::sourceByReferToken_
private

Definition at line 107 of file JetFlavourIdentifier.cc.