28 #include "G4VProcess.hh" 30 #include "G4SystemOfUnits.hh" 50 if (name ==
"EcalHitsEB") {
53 }
else if (name ==
"HcalHits") {
56 }
else {
edm::LogWarning(
"HcalTBSim") <<
"HcalTB02SD: ReadoutName " << name
57 <<
" not supported\n";}
61 <<
"***************************************************" 65 <<
"* Constructing a HcalTB02SD with name " << GetName()
69 <<
"***************************************************" ;
70 edm::LogInfo(
"HcalTBSim") <<
"HcalTB02SD:: Use of Birks law is set to " 71 << useBirk <<
" with three constants kB = " 72 << birk1 <<
", C1 = " <<
birk2 <<
", C2 = " 89 auto const preStepPoint = aStep->GetPreStepPoint();
90 auto const & nameVolume = preStepPoint->GetPhysicalVolume()->GetName();
96 double edep = aStep->GetTotalEnergyDeposit() *
weight;
97 LogDebug(
"HcalTBSim") <<
"HcalTB02SD:: " << nameVolume
98 <<
" Light Collection Efficiency " << weight
99 <<
" Weighted Energy Deposit " << edep/
MeV <<
" MeV";
108 if (scheme !=
nullptr) {
109 edm::LogInfo(
"HcalTBSim") <<
"HcalTB02SD: updates numbering scheme for " 118 G4String attribute =
"ReadOutName";
126 const std::vector<double> & paras = sol.
parameters();
128 LogDebug(
"HcalTBSim") <<
"HcalTB02SD::initMap (for " << sd <<
"): Solid " 129 << name <<
" Shape " << sol.
shape()
130 <<
" Parameter 0 = " << paras[0];
132 double dz = 2*paras[0];
133 lengthMap.insert(std::pair<G4String,double>(name,dz));
137 LogDebug(
"HcalTBSim") <<
"HcalTB02SD: Length Table for " << attribute
138 <<
" = " << sd <<
":";
139 std::map<G4String,double>::const_iterator it =
lengthMap.begin();
141 for (; it !=
lengthMap.end(); it++, i++) {
142 LogDebug(
"HcalTBSim") <<
" " << i <<
" " << it->first <<
" L = " 150 G4ThreeVector localPoint =
setToLocal(stepPoint->GetPosition(),
151 stepPoint->GetTouchable());
153 double dapd = 0.5 * crlength - localPoint.z();
154 if (dapd >= -0.1 || dapd <= crlength+0.1) {
156 weight = 1.05 - dapd * 0.0005;
158 edm::LogWarning(
"HcalTBSim") <<
"HcalTB02SD: light coll curve : wrong " 159 <<
"distance to APD " << dapd <<
" crlength = " 160 << crlength <<
" crystal name = " <<nameVolume
161 <<
" z of localPoint = " << localPoint.z()
162 <<
" take weight = " <<
weight;
164 LogDebug(
"HcalTBSim") <<
"HcalTB02SD, light coll curve : " << dapd
165 <<
" crlength = " << crlength
166 <<
" crystal name = " << nameVolume
167 <<
" z of localPoint = " << localPoint.z()
168 <<
" take weight = " <<
weight;
174 double length = 230.;
175 std::map<G4String,double>::const_iterator it =
lengthMap.find(name);
176 if (it !=
lengthMap.end()) length = it->second;
std::map< G4String, double > lengthMap
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
HcalTB02NumberingScheme * numberingScheme
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
double crystalLength(const G4String &)
double getEnergyDeposit(const G4Step *) override
uint32_t setDetUnitId(const G4Step *step) override
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Compact representation of the geometrical detector hierarchy.
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
A DDSolid represents the shape of a part.
static TrackerG4SimHitNumberingScheme & numberingScheme(const DDCompactView &cpv, const GeometricDet &det)
double curve_LY(const G4String &, const G4StepPoint *)
bool next()
set current node to the next node in the filtered tree
DDSolidShape shape(void) const
The type of the solid.
G4ThreeVector setToLocal(const G4ThreeVector &, const G4VTouchable *) const
void setNumberingScheme(HcalTB02NumberingScheme *scheme)
void initMap(const std::string &, const DDCompactView &)
virtual int getUnitID(const G4Step *aStep) const =0
double getAttenuation(const G4Step *aStep, double birk1, double birk2, double birk3) const
HcalTB02SD(const std::string &, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
bool firstChild()
set the current node to the first child ...
const std::string & name() const
Returns the name.