13 #include "G4NavigationHistory.hh"
14 #include "G4VPhysicalVolume.hh"
17 #include "CLHEP/Units/GlobalPhysicalConstants.h"
18 #include "CLHEP/Units/GlobalSystemOfUnits.h"
32 DDValue ddv1(attribute,value,0);
38 std::vector<double> neta;
40 for (
unsigned int ii=0;
ii<neta.size();
ii++) {
41 int index =
static_cast<int>(neta[
ii]);
44 ir = index/10; ifib = index%10;
50 for (
unsigned int ii=0;
ii<neta.size();
ii++) {
51 int index =
static_cast<int>(neta[
ii]);
54 ir = index/10; ifib = index%10;
59 edm::LogInfo(
"HFShower") <<
"HFShowerPMT: gets the Index matches for "
60 << neta.size() <<
" PMTs";
61 for (
unsigned int ii=0;
ii<neta.size();
ii++)
62 edm::LogInfo(
"HFShower") <<
"HFShowerPMT: rIndexR[" <<
ii <<
"] = "
63 <<
pmtR1[
ii] <<
" fibreR[" <<
ii <<
"] = "
65 <<
pmtR2[
ii] <<
" fibreL[" <<
ii <<
"] = "
69 <<
" view for " << attribute <<
" matching "
86 for (
unsigned int ig=0; ig<
rTable.size(); ig++)
87 edm::LogInfo(
"HFShower") <<
"HFShowerPMT: rTable[" << ig <<
"] = "
95 G4StepPoint * preStepPoint = aStep->GetPreStepPoint();
96 const G4VTouchable* touch = preStepPoint->GetTouchable();
97 int boxNo = touch->GetReplicaNumber(2);
98 int pmtNo = touch->GetReplicaNumber(1);
108 double edep = aStep->GetTotalEnergyDeposit();
109 LogDebug(
"HFShower") <<
"HFShowerPMT: Box " << boxNo <<
" PMT "
110 << pmtNo <<
" Mapped Indices " <<
indexR <<
", "
111 <<
indexF <<
" Edeposit " << edep/
MeV <<
" MeV; PE "
117 G4Track *aTrack = aStep->GetTrack();
118 G4ParticleDefinition *particleDef = aTrack->GetDefinition();
119 double stepl = aStep->GetStepLength();
120 double beta = preStepPoint->GetBeta();
121 G4ThreeVector pDir = aTrack->GetDynamicParticle()->GetMomentumDirection();
122 G4ThreeVector localMom = preStepPoint->GetTouchable()->GetHistory()->
123 GetTopTransform().TransformAxis(pDir);
125 localMom.y(), localMom.z(), stepl);
127 LogDebug(
"HFShower") <<
"HFShowerPMT::getHits: for particle "
128 << particleDef->GetParticleName() <<
" Step " << stepl
129 <<
" Beta " << beta <<
" Direction " << pDir
130 <<
" Local " << localMom <<
" p.e. " <<
photons;
147 if (indexF == 2) r =-
r;
149 LogDebug(
"HFShower") <<
"HFShowerPMT: Radius (" <<
indexR <<
"/" << indexF
159 LogDebug(
"HFShower") <<
"HFShowerPMT:getDDDArray called for " << str;
166 const std::vector<double> & fvec = value.
doubles();
167 int nval = fvec.size();
170 <<
" bins " << nval <<
" < 2 ==> illegal";
172 <<
"nval < 2 for array " << str <<
"\n";
177 edm::LogError(
"HFShower") <<
"HFShowerPMT: cannot get array " << str;
179 <<
"cannot get array " << str <<
"\n";
T getParameter(std::string const &) const
const std::vector< double > & doubles() const
a reference to the double-valued values stored in the given instance of DDValue
void addFilter(const DDFilter &, DDLogOp op=DDLogOp::AND)
std::vector< double > rTable
std::vector< int > pmtFib1
type of data representation of DDCompactView
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
int computeNPEinPMT(G4ParticleDefinition *pDef, double pBeta, double u, double v, double w, double step_length)
void initRun(G4ParticleTable *, HcalDDDSimConstants *)
const std::vector< double > & getRTableHF() const
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::maps an index to a DDValue. The index corresponds to the index assigned to the name of the std::...
std::vector< double > getDDDArray(const std::string &, const DDsvalues_type &)
DDsvalues_type mergedSpecifics() const
double getHits(G4Step *aStep)
bool firstChild()
set the current node to the first child ...
HFShowerPMT(std::string &name, const DDCompactView &cpv, edm::ParameterSet const &p)
std::vector< int > pmtFib2
void setCriteria(const DDValue &nameVal, DDCompOp, DDLogOp l=DDLogOp::AND, bool asString=true, bool merged=true)
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.