21 #include "Randomize.hh"
22 #include "CLHEP/Units/GlobalSystemOfUnits.h"
23 #include "CLHEP/Units/GlobalPhysicalConstants.h"
26 #include "G4ParticleDefinition.hh"
27 #include "G4DynamicParticle.hh"
28 #include "G4DecayPhysics.hh"
29 #include "G4ParticleTable.hh"
30 #include "G4ParticleTypes.hh"
42 : fast(p), hcalDDDSimConstantsESToken_(iC.
esConsumes()), hcalSimulationConstantsESToken_(iC.
esConsumes()) {
48 edm::LogInfo(
"FastCalorimetry") <<
"initHFShowerLibrary::initialization";
60 G4DecayPhysics decays;
61 decays.ConstructParticle();
62 G4ParticleTable* partTable = G4ParticleTable::GetParticleTable();
63 partTable->SetReadiness();
71 G4Random::setTheEngine(&(rnd->
theEngine()));
72 LogDebug(
"FastHFShowerLibrary::recoHFShowerLibrary")
73 <<
"Begin of event " << G4UniformRand() <<
" " << rnd->
theEngine().name() <<
" " << rnd->
theEngine();
78 edm::LogInfo(
"FastCalorimetry") <<
"FastHFShowerLibrary: recoHFShowerLibrary ";
83 edm::LogInfo(
"FastCalorimetry") <<
"FastHFShowerLibrary: we should not be here ";
94 G4ThreeVector direction(
99 int parCode = myTrack.
type();
100 double tSlice = 0.1 * vertex.mag() / 29.98;
102 std::vector<HFShowerLibrary::Hit> hits =
103 hfshower->fillHits(vertex, direction, parCode, eGen, ok, weight, tSlice,
false);
105 for (
unsigned int i = 0;
i < hits.size(); ++
i) {
106 G4ThreeVector pos = hits[
i].position;
107 int depth = hits[
i].depth;
108 double time = hits[
i].time;
120 std::map<CaloHitID, float>::iterator cellitr;
121 cellitr =
hitMap.find(current_id);
122 if (cellitr ==
hitMap.end()) {
123 hitMap.insert(std::pair<CaloHitID, float>(current_id, 1.0));
125 cellitr->second += 1.0;
133 int ieta = (
id.zside == 0) ? -
id.etaR :
id.etaR;
136 if (G4UniformRand() > 0.5)
const edm::ESGetToken< HcalSimulationConstants, HcalSimNumberingRecord > hcalSimulationConstantsESToken_
std::map< CaloHitID, float > hitMap
XYZVector Vect() const
the momentum threevector
const RawParticle & vfcalEntrance() const
The particle at VFCAL entrance.
const edm::ParameterSet fast
void recoHFShowerLibrary(const FSimTrack &myTrack)
virtual uint32_t getUnitID(const HcalNumberingFromDDD::HcalID &id)
const HcalSimulationParameters * hcalsimpar() const
bool getData(T &iHolder) const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > XYZVectorD
spatial vector with cartesian internal representation
HcalNumberingScheme numberingScheme
double e() const
energy of the momentum
const edm::ESGetToken< HcalDDDSimConstants, HcalSimNumberingRecord > hcalDDDSimConstantsESToken_
FastHFShowerLibrary(edm::ParameterSet const &, edm::ConsumesCollector &&)
static std::once_flag initializeOnce
CLHEP::HepRandomEngine & theEngine() const
std::unique_ptr< HcalNumberingFromDDD > numberingFromDDD
const XYZTLorentzVector & vertex() const
the vertex fourvector
Log< level::Info, false > LogInfo
int PMTNumber(const G4ThreeVector &pe_effect)
void modifyDepth(HcalNumberingFromDDD::HcalID &id)
T getParameter(std::string const &) const
void SetRandom(const RandomEngineAndDistribution *)
int type() const
particle type (HEP PDT convension)
std::unique_ptr< HFShowerLibrary > hfshower
int id() const
the index in FBaseSimEvent and other vectors
const HcalDDDSimConstants * hcalConstants
void const initHFShowerLibrary(const edm::EventSetup &)
int maxHFDepth(const int &ieta, const int &iphi) const