39 #include "G4SDManager.hh"
41 #include "G4HCofThisEvent.hh"
43 #include <CLHEP/Units/GlobalSystemOfUnits.h>
44 #include <CLHEP/Units/GlobalPhysicalConstants.h>
65 std::vector<TotemG4Hit*>
hits;
77 <<
"TotemTestGem:: Initialised as observer of begin of job, begin/end events and of G4step";
93 int iev = (*evt)()->GetEventID();
94 LogDebug(
"ForwardSim") <<
"TotemTestGem: Begin of event = " <<
iev;
99 evtnum = (*evt)()->GetEventID();
103 G4HCofThisEvent* allHC = (*evt)()->GetHCofThisEvent();
106 for (
unsigned int in = 0;
in <
names.size();
in++) {
107 int HCid = G4SDManager::GetSDMpointer()->GetCollectionID(
names[
in]);
109 LogDebug(
"ForwardSim") <<
"TotemTestGem :: Hit Collection for " <<
names[
in] <<
" of ID " << HCid
110 <<
" is obtained at " << theHC;
112 if (HCid >= 0 && theHC !=
nullptr) {
113 int nentries = theHC->entries();
114 LogDebug(
"ForwardSim") <<
"TotemTestGem :: " <<
names[
in] <<
" with " << nentries <<
" entries";
115 for (
int ihit = 0; ihit < nentries; ihit++) {
117 hits.push_back(aHit);
124 LogDebug(
"ForwardSim") <<
"TotemTestGem:: --- after fillTree with " << nhit <<
" Hits";
130 for (
unsigned ihit = 0; ihit <
hits.size(); ihit++) {
141 float vx = aHit->
getVx();
142 float vy = aHit->
getVy();
143 float vz = aHit->
getVz();
144 product.
fillHit(UID, Ptype, TID, PID, ELoss, PABS, vx, vy, vz, x, y, z);
Log< level::Info, true > LogVerbatim
#define DEFINE_SIMWATCHER(type)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void produce(edm::Event &, const edm::EventSetup &) override
void fillEvent(TotemTestHistoClass &)
float getEnergyLoss() const
void update(const BeginOfEvent *evt) override
This routine will be called when the appropriate signal arrives.
math::XYZPoint getEntry() const
std::vector< std::string > names
T getParameter(std::string const &) const
uint32_t getUnitID() const
std::vector< TotemG4Hit * > hits
void fillHit(int uID, int pType, int tID, int pID, float eLoss, float pAbs, float vX, float vY, float vZ, float x, float y, float z)
int getParticleType() const
HitContainer const *__restrict__ TkSoA const *__restrict__ Quality const *__restrict__ CAHitNtupletGeneratorKernelsGPU::HitToTuple const *__restrict__ int32_t int iev
TotemTestGem(const edm::ParameterSet &p)