24 #include "G4VProcess.hh"
26 #include "G4SystemOfUnits.hh"
39 :
CaloSD(
name, clg,
p, manager), hcalTB02Parameters_(es) {
49 if (
name ==
"EcalHitsEB") {
52 }
else if (
name ==
"HcalHits") {
62 edm::LogVerbatim(
"HcalTBSim") <<
"***************************************************\n"
64 <<
"* Constructing a HcalTB02SD with name " << GetName() <<
"\n"
66 <<
"***************************************************";
68 <<
" with three constants kB = " <<
birk1_ <<
", C1 = " <<
birk2_
80 auto const preStepPoint = aStep->GetPreStepPoint();
81 std::string nameVolume = static_cast<std::string>(preStepPoint->GetPhysicalVolume()->GetName());
89 double edep = aStep->GetTotalEnergyDeposit() *
weight;
91 edm::LogVerbatim(
"HcalTBSim") <<
"HcalTB02SD:: " << nameVolume <<
" Light Collection Efficiency " <<
weight
92 <<
" Weighted Energy Deposit " << edep /
CLHEP::MeV <<
" MeV";
103 edm::LogVerbatim(
"HcalTBSim") <<
"HcalTB02SD: updates numbering scheme for " << GetName();
110 G4ThreeVector localPoint =
setToLocal(stepPoint->GetPosition(), stepPoint->GetTouchable());
112 double dapd = 0.5 * crlength - localPoint.z();
113 if (dapd >= -0.1 || dapd <= crlength + 0.1) {
115 weight = 1.05 - dapd * 0.0005;
117 edm::LogWarning(
"HcalTBSim") <<
"HcalTB02SD: light coll curve : wrong "
118 <<
"distance to APD " << dapd <<
" crlength = " << crlength
119 <<
" crystal name = " << nameVolume <<
" z of localPoint = " << localPoint.z()
120 <<
" take weight = " <<
weight;
123 edm::LogVerbatim(
"HcalTBSim") <<
"HcalTB02SD, light coll curve : " << dapd <<
" crlength = " << crlength
124 <<
" crystal name = " << nameVolume <<
" z of localPoint = " << localPoint.z()
125 <<
" take weight = " <<
weight;
131 double length = 230.;