29 #include "G4VProcess.hh"
49 if (name ==
"EcalHitsEB") {
52 }
else if (name ==
"HcalHits") {
55 }
else {
edm::LogWarning(
"HcalTBSim") <<
"HcalTB02SD: ReadoutName " << name
56 <<
" not supported\n";}
60 <<
"***************************************************"
64 <<
"* Constructing a HcalTB02SD with name " << GetName()
68 <<
"***************************************************" ;
69 edm::LogInfo(
"HcalTBSim") <<
"HcalTB02SD:: Use of Birks law is set to "
70 << useBirk <<
" with three constants kB = "
71 << birk1 <<
", C1 = " <<
birk2 <<
", C2 = "
92 G4String nameVolume =
preStepPoint->GetPhysicalVolume()->GetName();
98 double edep = aStep->GetTotalEnergyDeposit() *
weight;
99 LogDebug(
"HcalTBSim") <<
"HcalTB02SD:: " << nameVolume
100 <<
" Light Collection Efficiency " << weight
101 <<
" Weighted Energy Deposit " << edep/MeV <<
" MeV";
112 edm::LogInfo(
"HcalTBSim") <<
"HcalTB02SD: updates numbering scheme for "
121 G4String attribute =
"ReadOutName";
132 const std::vector<double> & paras = sol.
parameters();
134 LogDebug(
"HcalTBSim") <<
"HcalTB02SD::initMap (for " << sd <<
"): Solid "
135 << name <<
" Shape " << sol.
shape()
136 <<
" Parameter 0 = " << paras[0];
138 double dz = 2*paras[0];
139 lengthMap.insert(std::pair<G4String,double>(name,dz));
143 LogDebug(
"HcalTBSim") <<
"HcalTB02SD: Length Table for " << attribute
144 <<
" = " << sd <<
":";
145 std::map<G4String,double>::const_iterator it =
lengthMap.begin();
147 for (; it !=
lengthMap.end(); it++, i++) {
148 LogDebug(
"HcalTBSim") <<
" " << i <<
" " << it->first <<
" L = "
156 G4ThreeVector localPoint =
setToLocal(stepPoint->GetPosition(),
157 stepPoint->GetTouchable());
159 double dapd = 0.5 * crlength - localPoint.z();
160 if (dapd >= -0.1 || dapd <= crlength+0.1) {
162 weight = 1.05 - dapd * 0.0005;
164 edm::LogWarning(
"HcalTBSim") <<
"HcalTB02SD: light coll curve : wrong "
165 <<
"distance to APD " << dapd <<
" crlength = "
166 << crlength <<
" crystal name = " <<nameVolume
167 <<
" z of localPoint = " << localPoint.z()
168 <<
" take weight = " <<
weight;
170 LogDebug(
"HcalTBSim") <<
"HcalTB02SD, light coll curve : " << dapd
171 <<
" crlength = " << crlength
172 <<
" crystal name = " << nameVolume
173 <<
" z of localPoint = " << localPoint.z()
174 <<
" take weight = " <<
weight;
180 double length = 230.;
181 std::map<G4String,double>::const_iterator it =
lengthMap.find(name);
182 if (it !=
lengthMap.end()) length = it->second;
G4ThreeVector setToLocal(G4ThreeVector, const G4VTouchable *)
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)
HcalTB02SD(G4String, const DDCompactView &, SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
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
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.