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 if (aStep ==
nullptr) {
92 auto const preStepPoint = aStep->GetPreStepPoint();
93 auto const & nameVolume = preStepPoint->GetPhysicalVolume()->GetName();
99 double edep = aStep->GetTotalEnergyDeposit() *
weight;
100 LogDebug(
"HcalTBSim") <<
"HcalTB02SD:: " << nameVolume
101 <<
" Light Collection Efficiency " << weight
102 <<
" Weighted Energy Deposit " << edep/
MeV <<
" MeV";
112 if (scheme !=
nullptr) {
113 edm::LogInfo(
"HcalTBSim") <<
"HcalTB02SD: updates numbering scheme for " 122 G4String attribute =
"ReadOutName";
130 const std::vector<double> & paras = sol.
parameters();
132 LogDebug(
"HcalTBSim") <<
"HcalTB02SD::initMap (for " << sd <<
"): Solid " 133 << name <<
" Shape " << sol.
shape()
134 <<
" Parameter 0 = " << paras[0];
136 double dz = 2*paras[0];
137 lengthMap.insert(std::pair<G4String,double>(name,dz));
141 LogDebug(
"HcalTBSim") <<
"HcalTB02SD: Length Table for " << attribute
142 <<
" = " << sd <<
":";
143 std::map<G4String,double>::const_iterator it =
lengthMap.begin();
145 for (; it !=
lengthMap.end(); it++, i++) {
146 LogDebug(
"HcalTBSim") <<
" " << i <<
" " << it->first <<
" L = " 154 G4ThreeVector localPoint =
setToLocal(stepPoint->GetPosition(),
155 stepPoint->GetTouchable());
157 double dapd = 0.5 * crlength - localPoint.z();
158 if (dapd >= -0.1 || dapd <= crlength+0.1) {
160 weight = 1.05 - dapd * 0.0005;
162 edm::LogWarning(
"HcalTBSim") <<
"HcalTB02SD: light coll curve : wrong " 163 <<
"distance to APD " << dapd <<
" crlength = " 164 << crlength <<
" crystal name = " <<nameVolume
165 <<
" z of localPoint = " << localPoint.z()
166 <<
" take weight = " <<
weight;
168 LogDebug(
"HcalTBSim") <<
"HcalTB02SD, light coll curve : " << dapd
169 <<
" crlength = " << crlength
170 <<
" crystal name = " << nameVolume
171 <<
" z of localPoint = " << localPoint.z()
172 <<
" take weight = " <<
weight;
178 double length = 230.;
179 std::map<G4String,double>::const_iterator it =
lengthMap.find(name);
180 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.