13 #include "G4NavigationHistory.hh"
14 #include "G4VPhysicalVolume.hh"
17 #include "CLHEP/Units/GlobalPhysicalConstants.h"
18 #include "CLHEP/Units/GlobalSystemOfUnits.h"
32 edm::LogInfo(
"HFShower") <<
"HFShowerFibreBundle intialized with factors: "
33 << facTube <<
" for the straight portion and "
34 << facCone <<
" for the curved portion";
40 DDValue ddv1(attribute,value,0);
46 std::vector<double> neta;
48 for (
unsigned int ii=0;
ii<neta.size();
ii++) {
49 int index =
static_cast<int>(neta[
ii]);
52 ir = index/10; ifib = index%10;
58 for (
unsigned int ii=0;
ii<neta.size();
ii++) {
59 int index =
static_cast<int>(neta[
ii]);
62 ir = index/10; ifib = index%10;
67 edm::LogInfo(
"HFShower") <<
"HFShowerFibreBundle: gets the Index matches "
68 <<
"for " << neta.size() <<
" PMTs";
69 for (
unsigned int ii=0;
ii<neta.size();
ii++)
71 <<
"] = " <<
pmtR1[
ii] <<
" fibreR[" <<
ii
73 <<
"] = " <<
pmtR2[
ii] <<
" fibreL[" <<
ii
76 edm::LogWarning(
"HFShower") <<
"HFShowerFibreBundle: cannot get filtered "
77 <<
" view for " << attribute <<
" matching "
94 for (
unsigned int ig=0; ig<
rTable.size(); ig++)
95 edm::LogInfo(
"HFShower") <<
"HFShowerFibreBundle: rTable[" << ig <<
"] = "
103 G4StepPoint * preStepPoint = aStep->GetPreStepPoint();
104 const G4VTouchable* touch = preStepPoint->GetTouchable();
105 int boxNo = touch->GetReplicaNumber(1);
106 int pmtNo = touch->GetReplicaNumber(0);
116 double edep = aStep->GetTotalEnergyDeposit();
117 LogDebug(
"HFShower") <<
"HFShowerFibreBundle: Box " << boxNo <<
" PMT "
118 << pmtNo <<
" Mapped Indices " <<
indexR <<
", "
119 <<
indexF <<
" Edeposit " << edep/
MeV <<
" MeV";
124 G4Track *aTrack = aStep->GetTrack();
125 G4ParticleDefinition *particleDef = aTrack->GetDefinition();
126 double stepl = aStep->GetStepLength();
127 double beta = preStepPoint->GetBeta();
128 G4ThreeVector pDir = aTrack->GetDynamicParticle()->GetMomentumDirection();
129 G4ThreeVector localMom = preStepPoint->GetTouchable()->GetHistory()->
130 GetTopTransform().TransformAxis(pDir);
133 localMom.x(), localMom.y(),
134 localMom.z(), stepl);
137 localMom.x(), localMom.y(),
138 localMom.z(), stepl);
141 LogDebug(
"HFShower") <<
"HFShowerFibreBundle::getHits: for particle "
142 << particleDef->GetParticleName() <<
" Step " << stepl
143 <<
" Beta " << beta <<
" Direction " << pDir
144 <<
" Local " << localMom <<
" p.e. " <<
photons;
158 LogDebug(
"HFShower") <<
"HFShowerFibreBundle::getRadius: R " <<
indexR
161 if (indexF == 2) r =-
r;
163 LogDebug(
"HFShower") <<
"HFShowerFibreBundle: Radius (" <<
indexR <<
"/"
164 << indexF <<
") " <<
r;
173 LogDebug(
"HFShower") <<
"HFShowerFibreBundle:getDDDArray called for " << str;
180 const std::vector<double> & fvec = value.
doubles();
181 int nval = fvec.size();
183 edm::LogError(
"HFShower") <<
"HFShowerFibreBundle: # of " << str
184 <<
" bins " << nval <<
" < 2 ==> illegal";
186 <<
"nval < 2 for array " << str <<
"\n";
191 edm::LogError(
"HFShower") <<
"HFShowerFibreBundle: cannot get array " <<str;
193 <<
"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
virtual ~HFShowerFibreBundle()
std::vector< int > pmtFib1
void addFilter(const DDFilter &, DDLogOp op=DDLogOp::AND)
std::vector< double > rTable
double getHits(G4Step *aStep, bool type)
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)
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::...
void initRun(G4ParticleTable *, HcalDDDSimConstants *)
HFShowerFibreBundle(std::string &name, const DDCompactView &cpv, edm::ParameterSet const &p)
DDsvalues_type mergedSpecifics() const
bool firstChild()
set the current node to the first child ...
std::vector< int > pmtFib2
void setCriteria(const DDValue &nameVal, DDCompOp, DDLogOp l=DDLogOp::AND, bool asString=true, bool merged=true)
std::vector< double > getDDDArray(const std::string &, const DDsvalues_type &)
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.