CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
GenParticleProducer Class Reference
Inheritance diagram for GenParticleProducer:
edm::global::EDProducer< edm::RunCache< IDto3Charge > > edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

bool convertParticle (reco::GenParticle &cand, const HepMC::GenParticle *part, const IDto3Charge &id2Charge) const
 
bool fillDaughters (reco::GenParticleCollection &cand, const HepMC::GenParticle *part, reco::GenParticleRefProd const &ref, size_t index, std::unordered_map< int, size_t > &barcodes) const
 
bool fillIndices (const HepMC::GenEvent *mc, std::vector< const HepMC::GenParticle *> &particles, std::vector< int > &barCodeVector, int offset, std::unordered_map< int, size_t > &barcodes) const
 
 GenParticleProducer (const edm::ParameterSet &)
 constructor More...
 
std::shared_ptr< IDto3Charge > globalBeginRun (const edm::Run &, const edm::EventSetup &) const override
 
void globalEndRun (edm::Run const &, edm::EventSetup const &) const override
 
void produce (edm::StreamID, edm::Event &e, const edm::EventSetup &) const override
 process one event More...
 
 ~GenParticleProducer () override
 destructor More...
 
- Public Member Functions inherited from edm::global::EDProducer< edm::RunCache< IDto3Charge > >
 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

bool abortOnUnknownPDGCode_
 unknown code treatment flag More...
 
bool doSubEvent_
 input & output modes More...
 
MCTruthHelper< HepMC::GenParticle > mcTruthHelper_
 
MCTruthHelper< reco::GenParticlemcTruthHelperGenParts_
 
edm::EDGetTokenT< CrossingFrame< edm::HepMCProduct > > mixToken_
 
edm::ESGetToken< HepPDT::ParticleDataTable, edm::DefaultRecordparticleTableToken_
 
bool saveBarCodes_
 save bar-codes More...
 
edm::EDGetTokenT< edm::HepMCProductsrcToken_
 source collection name More...
 
bool useCF_
 
std::vector< edm::EDGetTokenT< edm::HepMCProduct > > vectorSrcTokens_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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
 
- 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 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 81 of file GenParticleProducer.cc.

Constructor & Destructor Documentation

◆ GenParticleProducer()

GenParticleProducer::GenParticleProducer ( const edm::ParameterSet cfg)

constructor

Definition at line 149 of file GenParticleProducer.cc.

References SiStripOfflineCRack_cfg::alias, looper::cfg, ProducerED_cfi::InputTag, mixToken_, particleTableToken_, saveBarCodes_, srcToken_, AlCaHLTBitMon_QueryRunRegistry::string, and useCF_.

150  : abortOnUnknownPDGCode_(false),
151  saveBarCodes_(cfg.getUntrackedParameter<bool>("saveBarCodes", false)),
152  doSubEvent_(cfg.getUntrackedParameter<bool>("doSubEvent", false)),
153  useCF_(cfg.getUntrackedParameter<bool>("useCrossingFrame", false)) {
154  particleTableToken_ = esConsumes<HepPDT::ParticleDataTable, edm::DefaultRecord, edm::Transition::BeginRun>();
155  produces<GenParticleCollection>();
156  produces<math::XYZPointF>("xyz0");
157  produces<float>("t0");
158  if (saveBarCodes_) {
159  std::string alias(cfg.getParameter<std::string>("@module_label"));
160  produces<vector<int>>().setBranchAlias(alias + "BarCodes");
161  }
162 
163  if (useCF_)
164  mixToken_ =
165  mayConsume<CrossingFrame<HepMCProduct>>(InputTag(cfg.getParameter<std::string>("mix"), "generatorSmeared"));
166  else
167  srcToken_ = mayConsume<HepMCProduct>(cfg.getParameter<InputTag>("src"));
168 }
bool abortOnUnknownPDGCode_
unknown code treatment flag
edm::ESGetToken< HepPDT::ParticleDataTable, edm::DefaultRecord > particleTableToken_
edm::EDGetTokenT< CrossingFrame< edm::HepMCProduct > > mixToken_
edm::EDGetTokenT< edm::HepMCProduct > srcToken_
source collection name
bool doSubEvent_
input & output modes
bool saveBarCodes_
save bar-codes

◆ ~GenParticleProducer()

GenParticleProducer::~GenParticleProducer ( )
override

destructor

Definition at line 170 of file GenParticleProducer.cc.

170 {}

Member Function Documentation

◆ convertParticle()

bool GenParticleProducer::convertParticle ( reco::GenParticle cand,
const HepMC::GenParticle *  part,
const IDto3Charge &  id2Charge 
) const

Definition at line 318 of file GenParticleProducer.cc.

References MCTruthHelper< P >::fillGenStatusFlags(), mcTruthHelper_, mmToCm, EgammaValidation_cff::pdgId, findQualityFiles::v, bphysicsOniaDQM_cfi::vertex, and L1BJetProducer_cff::vtx.

Referenced by produce().

320  {
321  Candidate::LorentzVector p4(part->momentum());
322  int pdgId = part->pdg_id();
323  cand.setThreeCharge(id2Charge.chargeTimesThree(pdgId));
324  cand.setPdgId(pdgId);
325  cand.setStatus(part->status());
326  cand.setP4(p4);
327  cand.setCollisionId(0);
328  const GenVertex* v = part->production_vertex();
329  if (v != nullptr) {
330  ThreeVector vtx = v->point3d();
331  Candidate::Point vertex(vtx.x() * mmToCm, vtx.y() * mmToCm, vtx.z() * mmToCm);
332  cand.setVertex(vertex);
333  } else {
334  cand.setVertex(Candidate::Point(0, 0, 0));
335  }
336  mcTruthHelper_.fillGenStatusFlags(*part, cand.statusFlags());
337  return true;
338 }
MCTruthHelper< HepMC::GenParticle > mcTruthHelper_
static const double mmToCm
part
Definition: HCALResponse.h:20
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
void fillGenStatusFlags(const P &p, reco::GenStatusFlags &statusFlags) const
math::XYZPoint Point
point in the space
Definition: Candidate.h:40

◆ fillDaughters()

bool GenParticleProducer::fillDaughters ( reco::GenParticleCollection cand,
const HepMC::GenParticle *  part,
reco::GenParticleRefProd const &  ref,
size_t  index,
std::unordered_map< int, size_t > &  barcodes 
) const

Definition at line 340 of file GenParticleProducer.cc.

References HLT_2023v12_cff::cands, GenParticle::GenParticle, visualization-live-secondInstance_cfg::m, and edm::second().

Referenced by produce().

344  {
345  const GenVertex* productionVertex = part->production_vertex();
346  size_t numberOfMothers = productionVertex->particles_in_size();
347  if (numberOfMothers > 0) {
348  GenVertex::particles_in_const_iterator motherIt = productionVertex->particles_in_const_begin();
349  for (; motherIt != productionVertex->particles_in_const_end(); motherIt++) {
350  const HepMC::GenParticle* mother = *motherIt;
351  size_t m = barcodes.find(mother->barcode())->second;
352  cands[m].addDaughter(GenParticleRef(ref, index));
353  cands[index].addMother(GenParticleRef(ref, m));
354  }
355  }
356 
357  return true;
358 }
U second(std::pair< T, U > const &p)
part
Definition: HCALResponse.h:20
edm::Ref< edm::HepMCProduct, HepMC::GenParticle > GenParticleRef

◆ fillIndices()

bool GenParticleProducer::fillIndices ( const HepMC::GenEvent mc,
std::vector< const HepMC::GenParticle *> &  particles,
std::vector< int > &  barCodeVector,
int  offset,
std::unordered_map< int, size_t > &  barcodes 
) const

Definition at line 360 of file GenParticleProducer.cc.

References mps_fire::end, GenParticle::GenParticle, heavyIonCSV_trainingSettings::idx, CaloTowersParam_cfi::mc, hltrates_dqm_sourceclient-live_cfg::offset, AlCaHLTBitMon_ParallelJobs::p, and ecalTrigSettings_cff::particles.

Referenced by produce().

364  {
365  size_t idx = offset;
366  HepMC::GenEvent::particle_const_iterator begin = mc->particles_begin(), end = mc->particles_end();
367  for (HepMC::GenEvent::particle_const_iterator p = begin; p != end; ++p) {
368  const HepMC::GenParticle* particle = *p;
369  size_t barCode_this_event = particle->barcode();
370  size_t barCode = barCode_this_event + offset;
371  if (barcodes.find(barCode) != barcodes.end())
372  throw cms::Exception("WrongReference") << "barcodes are duplicated! " << endl;
373  particles[idx] = particle;
374  barCodeVector[idx] = barCode;
375  barcodes.insert(make_pair(barCode_this_event, idx++));
376  }
377  return true;
378 }

◆ globalBeginRun()

std::shared_ptr< IDto3Charge > GenParticleProducer::globalBeginRun ( const edm::Run ,
const edm::EventSetup es 
) const
override

Definition at line 172 of file GenParticleProducer.cc.

References abortOnUnknownPDGCode_, edm::EventSetup::getHandle(), and particleTableToken_.

172  {
174  return std::make_shared<IDto3Charge>(*pdt, abortOnUnknownPDGCode_);
175 }
bool abortOnUnknownPDGCode_
unknown code treatment flag
edm::ESGetToken< HepPDT::ParticleDataTable, edm::DefaultRecord > particleTableToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130

◆ globalEndRun()

void GenParticleProducer::globalEndRun ( edm::Run const &  ,
edm::EventSetup const &   
) const
inlineoverride

Definition at line 91 of file GenParticleProducer.cc.

91 {};

◆ produce()

void GenParticleProducer::produce ( edm::StreamID  ,
edm::Event e,
const edm::EventSetup es 
) const
overridevirtual

process one event

fill indices

Implements edm::global::EDProducerBase.

Definition at line 177 of file GenParticleProducer.cc.

References HLT_2023v12_cff::cands, convertParticle(), ztail::d, doSubEvent_, Exception, f, fillDaughters(), fillIndices(), GenParticle::GenParticle, edm::Event::getByToken(), edm::HepMCProduct::GetEvent(), MixCollection< T >::getObject(), edm::Event::getRefBeforePut(), edm::Event::getRun(), mps_fire::i, edm::RefProd< C >::id(), edm::Run::index(), edm::errors::InvalidReference, dataCertificationJetMET_cfi::isHI, LogDebug, CaloTowersParam_cfi::mc, mixToken_, mmToCm, mmToNs, eostools::move(), nsub, hltrates_dqm_sourceclient-live_cfg::offset, ecalTrigSettings_cff::particles, position, edm::Handle< T >::product(), edm::Event::put(), saveBarCodes_, MixCollection< T >::size(), findQualityFiles::size, srcToken_, and useCF_.

177  {
178  std::unordered_map<int, size_t> barcodes;
179 
180  size_t totalSize = 0;
181  const GenEvent* mc = nullptr;
182  MixCollection<HepMCProduct>* cfhepmcprod = nullptr;
183  size_t npiles = 1;
184 
185  if (useCF_) {
187  evt.getByToken(mixToken_, cf);
188  cfhepmcprod = new MixCollection<HepMCProduct>(cf.product());
189  npiles = cfhepmcprod->size();
190  LogDebug("GenParticleProducer") << "npiles : " << npiles << endl;
191  for (unsigned int icf = 0; icf < npiles; ++icf) {
192  LogDebug("GenParticleProducer") << "subSize : " << cfhepmcprod->getObject(icf).GetEvent()->particles_size()
193  << endl;
194  totalSize += cfhepmcprod->getObject(icf).GetEvent()->particles_size();
195  }
196  LogDebug("GenParticleProducer") << "totalSize : " << totalSize << endl;
197  } else {
199  evt.getByToken(srcToken_, mcp);
200  mc = mcp->GetEvent();
201  if (mc == nullptr)
202  throw edm::Exception(edm::errors::InvalidReference) << "HepMC has null pointer to GenEvent" << endl;
203  totalSize = mc->particles_size();
204  }
205 
206  // initialise containers
207  const size_t size = totalSize;
208  vector<const HepMC::GenParticle*> particles(size);
209  auto candsPtr = std::make_unique<GenParticleCollection>(size);
210  auto barCodeVector = std::make_unique<vector<int>>(size);
211  std::unique_ptr<math::XYZPointF> xyz0Ptr(new math::XYZPointF(0., 0., 0.));
212  std::unique_ptr<float> t0Ptr(new float(0.f));
213  reco::GenParticleRefProd ref = evt.getRefBeforePut<GenParticleCollection>();
214  GenParticleCollection& cands = *candsPtr;
215  size_t offset = 0;
216  size_t suboffset = 0;
217 
218  IDto3Charge const& id2Charge = *runCache(evt.getRun().index());
220  if (doSubEvent_ || useCF_) {
221  for (size_t ipile = 0; ipile < npiles; ++ipile) {
222  LogDebug("GenParticleProducer") << "mixed object ipile : " << ipile << endl;
223  barcodes.clear();
224  if (useCF_)
225  mc = cfhepmcprod->getObject(ipile).GetEvent();
226 
227  //Look whether heavy ion/signal event
228  bool isHI = false;
229  const HepMC::HeavyIon* hi = mc->heavy_ion();
230  if (hi && hi->Ncoll_hard() > 1)
231  isHI = true;
232  size_t num_particles = mc->particles_size();
233  LogDebug("GenParticleProducer") << "num_particles : " << num_particles << endl;
234  if (ipile == 0) {
235  auto origin = (*mc->vertices_begin())->position();
236  xyz0Ptr->SetXYZ(origin.x() * mmToCm, origin.y() * mmToCm, origin.z() * mmToCm);
237  *t0Ptr = origin.t() * mmToNs;
238  }
239  fillIndices(mc, particles, *barCodeVector, offset, barcodes);
240  // fill output collection and save association
241  for (size_t ipar = offset; ipar < offset + num_particles; ++ipar) {
242  const HepMC::GenParticle* part = particles[ipar];
243  reco::GenParticle& cand = cands[ipar];
244  // convert HepMC::GenParticle to new reco::GenParticle
245  convertParticle(cand, part, id2Charge);
246  cand.resetDaughters(ref.id());
247  }
248 
249  for (size_t d = offset; d < offset + num_particles; ++d) {
251  const GenVertex* productionVertex = part->production_vertex();
252  int sub_id = 0;
253  if (productionVertex != nullptr) {
254  sub_id = productionVertex->id();
255  if (!isHI)
256  sub_id = 0;
257  // search barcode map and attach daughters
258  fillDaughters(cands, part, ref, d, barcodes);
259  } else {
260  const GenVertex* endVertex = part->end_vertex();
261  if (endVertex != nullptr)
262  sub_id = endVertex->id();
263  else
264  throw cms::Exception("SubEventID")
265  << "SubEvent not determined. Particle has no production and no end vertex!" << endl;
266  }
267  if (sub_id < 0)
268  sub_id = 0;
269  int new_id = sub_id + suboffset;
270  GenParticleRef dref(ref, d);
271  cands[d].setCollisionId(new_id); // For new GenParticle
272  LogDebug("VertexId") << "SubEvent offset 3 : " << suboffset;
273  }
274  int nsub = -2;
275  if (isHI) {
276  nsub = hi->Ncoll_hard() + 1;
277  suboffset += nsub;
278  } else {
279  suboffset += 1;
280  }
281  offset += num_particles;
282  }
283  } else {
284  auto origin = (*mc->vertices_begin())->position();
285  xyz0Ptr->SetXYZ(origin.x() * mmToCm, origin.y() * mmToCm, origin.z() * mmToCm);
286  *t0Ptr = origin.t() * mmToNs;
287  fillIndices(mc, particles, *barCodeVector, 0, barcodes);
288 
289  // fill output collection and save association
290  for (size_t i = 0; i < particles.size(); ++i) {
293  // convert HepMC::GenParticle to new reco::GenParticle
294  convertParticle(cand, part, id2Charge);
295  cand.resetDaughters(ref.id());
296  }
297 
298  // fill references to daughters
299  for (size_t d = 0; d < cands.size(); ++d) {
301  const GenVertex* productionVertex = part->production_vertex();
302  // search barcode map and attach daughters
303  if (productionVertex != nullptr)
304  fillDaughters(cands, part, ref, d, barcodes);
305  cands[d].setCollisionId(0);
306  }
307  }
308 
309  evt.put(std::move(candsPtr));
310  if (saveBarCodes_)
311  evt.put(std::move(barCodeVector));
312  if (cfhepmcprod)
313  delete cfhepmcprod;
314  evt.put(std::move(xyz0Ptr), "xyz0");
315  evt.put(std::move(t0Ptr), "t0");
316 }
size
Write out results.
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
static const double mmToNs
const T & getObject(unsigned int ip) const
Definition: MixCollection.h:26
T const * product() const
Definition: Handle.h:70
edm::EDGetTokenT< CrossingFrame< edm::HepMCProduct > > mixToken_
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
Definition: Point3D.h:10
edm::EDGetTokenT< edm::HepMCProduct > srcToken_
source collection name
bool fillIndices(const HepMC::GenEvent *mc, std::vector< const HepMC::GenParticle *> &particles, std::vector< int > &barCodeVector, int offset, std::unordered_map< int, size_t > &barcodes) const
const int nsub
int size() const
Definition: MixCollection.h:19
Definition: EPCuts.h:4
double f[11][100]
d
Definition: ztail.py:151
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:37
ProductID id() const
Accessor for product ID.
Definition: RefProd.h:124
static const double mmToCm
part
Definition: HCALResponse.h:20
bool doSubEvent_
input & output modes
bool fillDaughters(reco::GenParticleCollection &cand, const HepMC::GenParticle *part, reco::GenParticleRefProd const &ref, size_t index, std::unordered_map< int, size_t > &barcodes) const
static int position[264][3]
Definition: ReadPGInfo.cc:289
bool saveBarCodes_
save bar-codes
def move(src, dest)
Definition: eostools.py:511
bool convertParticle(reco::GenParticle &cand, const HepMC::GenParticle *part, const IDto3Charge &id2Charge) const
#define LogDebug(id)

Member Data Documentation

◆ abortOnUnknownPDGCode_

bool GenParticleProducer::abortOnUnknownPDGCode_
private

unknown code treatment flag

Definition at line 113 of file GenParticleProducer.cc.

Referenced by globalBeginRun().

◆ doSubEvent_

bool GenParticleProducer::doSubEvent_
private

input & output modes

Definition at line 118 of file GenParticleProducer.cc.

Referenced by produce().

◆ mcTruthHelper_

MCTruthHelper<HepMC::GenParticle> GenParticleProducer::mcTruthHelper_
private

Definition at line 121 of file GenParticleProducer.cc.

Referenced by convertParticle().

◆ mcTruthHelperGenParts_

MCTruthHelper<reco::GenParticle> GenParticleProducer::mcTruthHelperGenParts_
private

Definition at line 122 of file GenParticleProducer.cc.

◆ mixToken_

edm::EDGetTokenT<CrossingFrame<edm::HepMCProduct> > GenParticleProducer::mixToken_
private

Definition at line 109 of file GenParticleProducer.cc.

Referenced by GenParticleProducer(), and produce().

◆ particleTableToken_

edm::ESGetToken<HepPDT::ParticleDataTable, edm::DefaultRecord> GenParticleProducer::particleTableToken_
private

Definition at line 110 of file GenParticleProducer.cc.

Referenced by GenParticleProducer(), and globalBeginRun().

◆ saveBarCodes_

bool GenParticleProducer::saveBarCodes_
private

save bar-codes

Definition at line 115 of file GenParticleProducer.cc.

Referenced by GenParticleProducer(), and produce().

◆ srcToken_

edm::EDGetTokenT<edm::HepMCProduct> GenParticleProducer::srcToken_
private

source collection name

Definition at line 107 of file GenParticleProducer.cc.

Referenced by GenParticleProducer(), and produce().

◆ useCF_

bool GenParticleProducer::useCF_
private

Definition at line 119 of file GenParticleProducer.cc.

Referenced by GenParticleProducer(), and produce().

◆ vectorSrcTokens_

std::vector<edm::EDGetTokenT<edm::HepMCProduct> > GenParticleProducer::vectorSrcTokens_
private

Definition at line 108 of file GenParticleProducer.cc.