30 #include "G4SDManager.hh"
34 #include "G4PrimaryVertex.hh"
35 #include "G4VProcess.hh"
36 #include "G4HCofThisEvent.hh"
37 #include "G4UserEventAction.hh"
39 #include <CLHEP/Units/GlobalSystemOfUnits.h>
40 #include <CLHEP/Units/GlobalPhysicalConstants.h>
41 #include <CLHEP/Random/Randomize.h>
50 #include "TLorentzVector.h"
51 #include "TUnixSystem.h"
71 public Observer<const BeginOfEvent *>,
116 edm::LogVerbatim(
"ForwardSim") <<
"============================================================================";
117 edm::LogVerbatim(
"ForwardSim") <<
"DoCastorAnalysis:: Initialized as observer";
124 edm::LogVerbatim(
"ForwardSim") <<
"============================================================================";
128 edm::LogVerbatim(
"ForwardSim") <<
"DoCastorAnalysis: output event root file created";
165 edm::LogVerbatim(
"ForwardSim") << std::endl <<
"DoCastorAnalysis: end of process";
179 edm::LogVerbatim(
"ForwardSim") << std::endl <<
"DoCastorAnalysis: Starting Run";
199 G4HCofThisEvent *allHC = (*evt)()->GetHCofThisEvent();
201 int CAFIid = G4SDManager::GetSDMpointer()->GetCollectionID(
"CastorFI");
206 unsigned int volumeID = 0;
209 int nentries = theCAFI->entries();
250 for (
int ihit = 0; ihit < nentries; ihit++) {
255 int zside, sector, zmodule;
257 theCastorNumScheme->
unpackIndex(volumeID, zside, sector, zmodule);
263 double theta = pos.theta();
265 double phi = pos.phi();
281 edm::LogVerbatim(
"ForwardSim") <<
"hit " << ihit + 1 <<
" : x = " << (*psimhit_x)[ihit]
282 <<
" , eta = " << (*psimhit_eta)[ihit] <<
" , phi = " << (*psimhit_phi)[ihit]
283 <<
" , energy = " << (*psimhit_energy)[ihit];
294 delete theCastorNumScheme;
Log< level::Info, true > LogVerbatim
std::vector< double > * psimhit_z
#define DEFINE_SIMWATCHER(type)
math::XYZPoint getPosition() const
static std::vector< std::string > checklist log
std::vector< double > simhit_eta
std::vector< double > * psimhit_x
std::vector< double > * psimhit_energy
std::vector< double > simhit_x
void update(const BeginOfJob *run) override
This routine will be called when the appropriate signal arrives.
std::vector< double > * psimhit_phi
Geom::Theta< T > theta() const
DoCastorAnalysis(const edm::ParameterSet &p)
~DoCastorAnalysis() override
std::vector< double > simhit_phi
static void unpackIndex(const uint32_t &idx, int &z, int §or, int &zmodule)
std::vector< double > * psimhit_y
std::vector< double > simhit_y
std::vector< double > * psimhit_eta
Tan< T >::type tan(const T &t)
TFile * CastorOutputEventFile
std::vector< int > simhit_sector
XYZPointD XYZPoint
point in space with cartesian internal representation
std::vector< int > * psimhit_sector
T getParameter(std::string const &) const
G4THitsCollection< CaloG4Hit > CaloG4HitCollection
std::vector< double > simhit_energy
uint32_t getUnitID() const
std::vector< int > * psimhit_module
double getEnergyDeposit() const
std::vector< int > simhit_module
std::vector< double > simhit_z