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";
36 G4String attribute =
"ReadOutName";
39 DDValue ddv0(attribute,value,0);
48 edm::LogInfo(
"HFShower") <<
"HFShowerFibreBundle: " << rTable.size()
50 for (
unsigned int ig=0; ig<rTable.size(); ig++)
51 edm::LogInfo(
"HFShower") <<
"HFShowerFibreBundle: rTable[" << ig
52 <<
"] = " << rTable[ig]/cm <<
" cm";
54 edm::LogError(
"HFShower") <<
"HFShowerFibreBundle: cannot get filtered "
55 <<
" view for " << attribute <<
" matching "
58 <<
"cannot match " << attribute <<
" to " << name <<
"\n";
64 DDValue ddv1(attribute,value,0);
70 std::vector<double> neta;
72 for (
unsigned int ii=0;
ii<neta.size();
ii++) {
73 int index =
static_cast<int>(neta[
ii]);
76 ir = index/10; ifib = index%10;
82 for (
unsigned int ii=0;
ii<neta.size();
ii++) {
83 int index =
static_cast<int>(neta[
ii]);
86 ir = index/10; ifib = index%10;
91 edm::LogInfo(
"HFShower") <<
"HFShowerFibreBundle: gets the Index matches "
92 <<
"for " << neta.size() <<
" PMTs";
93 for (
unsigned int ii=0;
ii<neta.size();
ii++)
95 <<
"] = " <<
pmtR1[
ii] <<
" fibreR[" <<
ii
97 <<
"] = " <<
pmtR2[
ii] <<
" fibreL[" <<
ii
100 edm::LogWarning(
"HFShower") <<
"HFShowerFibreBundle: cannot get filtered "
101 <<
" view for " << attribute <<
" matching "
116 G4StepPoint * preStepPoint = aStep->GetPreStepPoint();
117 const G4VTouchable* touch = preStepPoint->GetTouchable();
118 int boxNo = touch->GetReplicaNumber(1);
119 int pmtNo = touch->GetReplicaNumber(0);
129 double edep = aStep->GetTotalEnergyDeposit();
130 LogDebug(
"HFShower") <<
"HFShowerFibreBundle: Box " << boxNo <<
" PMT "
131 << pmtNo <<
" Mapped Indices " <<
indexR <<
", "
132 <<
indexF <<
" Edeposit " << edep/
MeV <<
" MeV";
137 G4Track *aTrack = aStep->GetTrack();
138 G4ParticleDefinition *particleDef = aTrack->GetDefinition();
139 double stepl = aStep->GetStepLength();
140 double beta = preStepPoint->GetBeta();
141 G4ThreeVector pDir = aTrack->GetDynamicParticle()->GetMomentumDirection();
142 G4ThreeVector localMom = preStepPoint->GetTouchable()->GetHistory()->
143 GetTopTransform().TransformAxis(pDir);
146 localMom.x(), localMom.y(),
147 localMom.z(), stepl);
150 localMom.x(), localMom.y(),
151 localMom.z(), stepl);
154 LogDebug(
"HFShower") <<
"HFShowerFibreBundle::getHits: for particle "
155 << particleDef->GetParticleName() <<
" Step " << stepl
156 <<
" Beta " << beta <<
" Direction " << pDir
157 <<
" Local " << localMom <<
" p.e. " <<
photons;
171 LogDebug(
"HFShower") <<
"HFShowerFibreBundle::getRadius: R " <<
indexR
174 if (indexF == 2) r =-
r;
176 LogDebug(
"HFShower") <<
"HFShowerFibreBundle: Radius (" <<
indexR <<
"/"
177 << indexF <<
") " <<
r;
186 LogDebug(
"HFShower") <<
"HFShowerFibreBundle:getDDDArray called for " << str;
193 const std::vector<double> & fvec = value.
doubles();
194 int nval = fvec.size();
196 edm::LogError(
"HFShower") <<
"HFShowerFibreBundle: # of " << str
197 <<
" bins " << nval <<
" < 2 ==> illegal";
199 <<
"nval < 2 for array " << str <<
"\n";
204 edm::LogError(
"HFShower") <<
"HFShowerFibreBundle: cannot get array " <<str;
206 <<
"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)
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::...
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.