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 = "
93 G4String 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";
113 edm::LogInfo(
"HcalTBSim") <<
"HcalTB02SD: updates numbering scheme for "
122 G4String attribute =
"ReadOutName";
133 const std::vector<double> & paras = sol.
parameters();
135 LogDebug(
"HcalTBSim") <<
"HcalTB02SD::initMap (for " << sd <<
"): Solid "
136 << name <<
" Shape " << sol.
shape()
137 <<
" Parameter 0 = " << paras[0];
139 double dz = 2*paras[0];
140 lengthMap.insert(std::pair<G4String,double>(name,dz));
144 LogDebug(
"HcalTBSim") <<
"HcalTB02SD: Length Table for " << attribute
145 <<
" = " << sd <<
":";
146 std::map<G4String,double>::const_iterator it =
lengthMap.begin();
148 for (; it !=
lengthMap.end(); it++, i++) {
149 LogDebug(
"HcalTBSim") <<
" " << i <<
" " << it->first <<
" L = "
157 G4ThreeVector localPoint =
setToLocal(stepPoint->GetPosition(),
158 stepPoint->GetTouchable());
160 double dapd = 0.5 * crlength - localPoint.z();
161 if (dapd >= -0.1 || dapd <= crlength+0.1) {
163 weight = 1.05 - dapd * 0.0005;
165 edm::LogWarning(
"HcalTBSim") <<
"HcalTB02SD: light coll curve : wrong "
166 <<
"distance to APD " << dapd <<
" crlength = "
167 << crlength <<
" crystal name = " <<nameVolume
168 <<
" z of localPoint = " << localPoint.z()
169 <<
" take weight = " <<
weight;
171 LogDebug(
"HcalTBSim") <<
"HcalTB02SD, light coll curve : " << dapd
172 <<
" crlength = " << crlength
173 <<
" crystal name = " << nameVolume
174 <<
" z of localPoint = " << localPoint.z()
175 <<
" take weight = " <<
weight;
181 double length = 230.;
182 std::map<G4String,double>::const_iterator it =
lengthMap.find(name);
183 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.
void addFilter(const DDFilter &, log_op op=AND)
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
type of data representation of DDCompactView
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)
bool next()
set current node to the next node in the filtered tree
HcalTB02SD(G4String, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
DDSolidShape shape(void) const
The type of the solid.
double crystalLength(G4String)
void initMap(G4String, const DDCompactView &)
double getAttenuation(G4Step *aStep, double birk1, double birk2, double birk3)
virtual uint32_t setDetUnitId(G4Step *step)
G4StepPoint * preStepPoint
void setNumberingScheme(HcalTB02NumberingScheme *scheme)
bool firstChild()
set the current node to the first child ...
void setCriteria(const DDValue &nameVal, comp_op, log_op l=AND, bool asString=true, bool merged=true)
virtual int getUnitID(const G4Step *aStep) const =0
double curve_LY(G4String &, G4StepPoint *)
const std::string & name() const
Returns the name.
virtual double getEnergyDeposit(G4Step *)
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.
G4ThreeVector setToLocal(const G4ThreeVector &, const G4VTouchable *)