13 #include "G4NavigationHistory.hh"
14 #include "G4VPhysicalVolume.hh"
17 #include "CLHEP/Units/GlobalPhysicalConstants.h"
18 #include "CLHEP/Units/GlobalSystemOfUnits.h"
28 G4String attribute =
"ReadOutName";
31 DDValue ddv0(attribute,value,0);
40 edm::LogInfo(
"HFShower") <<
"HFShowerPMT: " << rTable.size()
42 for (
unsigned int ig=0; ig<rTable.size(); ig++)
43 edm::LogInfo(
"HFShower") <<
"HFShowerPMT: rTable[" << ig <<
"] = "
44 << rTable[ig]/cm <<
" cm";
46 edm::LogError(
"HFShower") <<
"HFShowerPMT: cannot get filtered "
47 <<
" view for " << attribute <<
" matching "
50 <<
"cannot match " << attribute <<
" to " << name <<
"\n";
56 DDValue ddv1(attribute,value,0);
62 std::vector<double> neta;
64 for (
unsigned int ii=0; ii<neta.size(); ii++) {
65 int index =
static_cast<int>(neta[ii]);
68 ir = index/10; ifib = index%10;
74 for (
unsigned int ii=0; ii<neta.size(); ii++) {
75 int index =
static_cast<int>(neta[ii]);
78 ir = index/10; ifib = index%10;
83 edm::LogInfo(
"HFShower") <<
"HFShowerPMT: gets the Index matches for "
84 << neta.size() <<
" PMTs";
85 for (
unsigned int ii=0; ii<neta.size(); ii++)
86 edm::LogInfo(
"HFShower") <<
"HFShowerPMT: rIndexR[" << ii <<
"] = "
87 <<
pmtR1[ii] <<
" fibreR[" << ii <<
"] = "
88 <<
pmtFib1[ii] <<
" rIndexL[" << ii <<
"] = "
89 <<
pmtR2[ii] <<
" fibreL[" << ii <<
"] = "
93 <<
" view for " << attribute <<
" matching "
108 G4StepPoint * preStepPoint = aStep->GetPreStepPoint();
109 const G4VTouchable* touch = preStepPoint->GetTouchable();
110 int boxNo = touch->GetReplicaNumber(2);
111 int pmtNo = touch->GetReplicaNumber(1);
121 double edep = aStep->GetTotalEnergyDeposit();
122 LogDebug(
"HFShower") <<
"HFShowerPMT: Box " << boxNo <<
" PMT "
123 << pmtNo <<
" Mapped Indices " <<
indexR <<
", "
124 <<
indexF <<
" Edeposit " << edep/MeV <<
" MeV; PE "
130 G4Track *aTrack = aStep->GetTrack();
131 G4ParticleDefinition *particleDef = aTrack->GetDefinition();
132 double stepl = aStep->GetStepLength();
133 double beta = preStepPoint->GetBeta();
134 G4ThreeVector pDir = aTrack->GetDynamicParticle()->GetMomentumDirection();
135 G4ThreeVector localMom = preStepPoint->GetTouchable()->GetHistory()->
136 GetTopTransform().TransformAxis(pDir);
138 localMom.y(), localMom.z(), stepl);
140 LogDebug(
"HFShower") <<
"HFShowerPMT::getHits: for particle "
141 << particleDef->GetParticleName() <<
" Step " << stepl
142 <<
" Beta " << beta <<
" Direction " << pDir
143 <<
" Local " << localMom <<
" p.e. " <<
photons;
160 if (indexF == 2) r =-
r;
162 LogDebug(
"HFShower") <<
"HFShowerPMT: Radius (" <<
indexR <<
"/" << indexF
172 LogDebug(
"HFShower") <<
"HFShowerPMT:getDDDArray called for " << str;
179 const std::vector<double> & fvec = value.
doubles();
180 int nval = fvec.size();
183 <<
" bins " << nval <<
" < 2 ==> illegal";
185 <<
"nval < 2 for array " << str <<
"\n";
190 edm::LogError(
"HFShower") <<
"HFShowerPMT: cannot get array " << str;
192 <<
"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 &, log_op op=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)
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 ...
void setCriteria(const DDValue &nameVal, comp_op, log_op l=AND, bool asString=true, bool merged=true)
HFShowerPMT(std::string &name, const DDCompactView &cpv, edm::ParameterSet const &p)
std::vector< int > pmtFib2
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.