CMS 3D CMS Logo

List of all members | Public Member Functions
GenParticleInfoExtractor Class Reference

#include <GenParticleInfoExtractor.h>

Public Member Functions

const GenParticleInfooperator() (const G4PrimaryParticle *p) const
 

Detailed Description

Definition at line 8 of file GenParticleInfoExtractor.h.

Member Function Documentation

◆ operator()()

const GenParticleInfo & GenParticleInfoExtractor::operator() ( const G4PrimaryParticle *  p) const

Definition at line 4 of file GenParticleInfoExtractor.cc.

References AlCaHLTBitMon_ParallelJobs::p, and up.

4  {
5  G4VUserPrimaryParticleInformation *up = p->GetUserInformation();
6  GenParticleInfo *gpi = dynamic_cast<GenParticleInfo *>(up);
7  if (up == nullptr) {
8  G4Exception("SimG4Core/Notification",
9  "mc001",
10  FatalException,
11  "GenParticleInfoExtractor: G4PrimaryParticle has no user information");
12  } else if (gpi == nullptr) {
13  G4Exception("SimG4Core/Notification",
14  "mc001",
15  FatalException,
16  "GenParticleInfoExtractor: user information in G4PrimaryParticle is not of GenParticleInfo type");
17  }
18  return *gpi;
19 }
Definition: BitonicSort.h:7