31 #include "G4VProcess.hh" 33 #include "G4SystemOfUnits.hh" 53 if (name ==
"EcalHitsEB") {
56 }
else if (name ==
"HcalHits") {
60 edm::LogWarning(
"HcalTBSim") <<
"HcalTB02SD: ReadoutName " << name <<
" not supported\n";
65 LogDebug(
"HcalTBSim") <<
"***************************************************" 69 <<
"* Constructing a HcalTB02SD with name " << GetName() <<
"\n" 72 <<
"***************************************************";
73 edm::LogInfo(
"HcalTBSim") <<
"HcalTB02SD:: Use of Birks law is set to " << useBirk
74 <<
" with three constants kB = " << birk1 <<
", C1 = " <<
birk2 75 <<
", C2 = " <<
birk3;
91 auto const preStepPoint = aStep->GetPreStepPoint();
92 auto const& nameVolume = preStepPoint->GetPhysicalVolume()->GetName();
97 weight *=
curve_LY(nameVolume, preStepPoint);
100 double edep = aStep->GetTotalEnergyDeposit() *
weight;
101 LogDebug(
"HcalTBSim") <<
"HcalTB02SD:: " << nameVolume <<
" Light Collection Efficiency " << weight
102 <<
" Weighted Energy Deposit " << edep /
MeV <<
" MeV";
111 if (scheme !=
nullptr) {
112 edm::LogInfo(
"HcalTBSim") <<
"HcalTB02SD: updates numbering scheme for " << GetName();
123 G4String attribute =
"ReadOutName";
131 const std::vector<double>& paras = sol.
parameters();
133 LogDebug(
"HcalTBSim") <<
"HcalTB02SD::initMap (for " << sd <<
"): Solid " << 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 <<
" = " << sd <<
":";
142 std::map<G4String, double>::const_iterator it =
lengthMap.begin();
144 for (; it !=
lengthMap.end(); it++, i++) {
145 LogDebug(
"HcalTBSim") <<
" " << i <<
" " << it->first <<
" L = " << it->second;
151 G4ThreeVector localPoint =
setToLocal(stepPoint->GetPosition(), 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 = " << crlength
160 <<
" crystal name = " << nameVolume <<
" z of localPoint = " << localPoint.z()
161 <<
" take weight = " <<
weight;
163 LogDebug(
"HcalTBSim") <<
"HcalTB02SD, light coll curve : " << dapd <<
" crlength = " << crlength
164 <<
" crystal name = " << nameVolume <<
" z of localPoint = " << localPoint.z()
165 <<
" take weight = " <<
weight;
170 double length = 230.;
171 std::map<G4String, double>::const_iterator it =
lengthMap.find(name);
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::map< G4String, double > lengthMap
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.
void initMap(const std::string &, const edm::EventSetup &)
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.
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
HcalTB02SD(const std::string &, const edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
A DDSolid represents the shape of a part.
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)
virtual int getUnitID(const G4Step *aStep) const =0
double getAttenuation(const G4Step *aStep, double birk1, double birk2, double birk3) const
bool firstChild()
set the current node to the first child ...
static TrackerG4SimHitNumberingScheme & numberingScheme(const GeometricDet &det)
const std::string & name() const
Returns the name.