20 #include "G4Material.hh" 21 #include "CLHEP/Units/GlobalSystemOfUnits.h" 27 CaloSD(name, cpv, clg, p, manager) {
36 edm::LogInfo(
"HcalTB06BeamSD") <<
"HcalTB06BeamSD:: Use of Birks law is set to " 37 << useBirk <<
" with three constants kB = " 38 << birk1 <<
", C1 = " <<birk2 <<
", C2 = " <<
birk3;
44 value =
"WireChamber";
49 <<
"HcalTB06BeamSD:: Names to be tested for " 50 << attribute <<
" = " << value <<
": " <<
wcNames.size() <<
" paths";
52 edm::LogInfo(
"HcalTB06BeamSD") <<
"HcalTB06BeamSD:: (" <<
i <<
") " 56 attribute =
"ReadOutName";
61 std::vector<G4String> matNames;
62 std::vector<int> nocc;
67 for (
unsigned int i=0;
i<matNames.size();
i++) {
68 if (
matName == matNames[
i]) {notIn =
false; nocc[
i]++;}
76 if (!matNames.empty()) {
79 for (
unsigned int i = 0;
i < matNames.size();
i++) {
90 <<
"HcalTB06BeamSD: Material name for " 91 << attribute <<
" = " << name <<
":" <<
matName;
98 double destep = aStep->GetTotalEnergyDeposit();
100 if (
useBirk &&
matName == aStep->GetPreStepPoint()->GetMaterial()->GetName()) {
104 <<
"HcalTB06BeamSD: Detector " 105 << aStep->GetPreStepPoint()->GetTouchable()->GetVolume()->GetName()
107 return weight*destep;
112 const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
113 const G4VTouchable* touch = preStepPoint->GetTouchable();
114 G4String
name = preStepPoint->GetPhysicalVolume()->GetName();
117 int lay = 0,
x = 0,
y = 0;
119 lay = (touch->GetReplicaNumber(0));
122 lay = (touch->GetReplicaNumber(1));
123 G4ThreeVector localPoint =
setToLocal(preStepPoint->GetPosition(), touch);
124 x = (
int)(localPoint.x()/(0.2*mm));
125 y = (
int)(localPoint.y()/(0.2*mm));
133 std::vector<G4String>
tmp;
139 for (
unsigned int i=0;
i<tmp.size();
i++)
140 if (name == tmp[
i]) ok =
false;
141 if (ok) tmp.push_back(name);
149 std::vector<G4String>::const_iterator it =
wcNames.begin();
150 for (; it !=
wcNames.end(); it++)
151 if (name == *it)
return true;
T getParameter(std::string const &) const
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
std::vector< G4String > wcNames
double getEnergyDeposit(const G4Step *) override
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
static uint32_t packIndex(int det, int lay, int x, int y)
bool isItWireChamber(const G4String &)
HcalTB06BeamSD(const std::string &, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
bool next()
set current node to the next node in the filtered tree
const std::vector< std::string > & getNames() const
uint32_t setDetUnitId(const G4Step *step) override
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
~HcalTB06BeamSD() override
G4ThreeVector setToLocal(const G4ThreeVector &, const G4VTouchable *) const
double getAttenuation(const G4Step *aStep, double birk1, double birk2, double birk3) const
std::vector< std::vector< double > > tmp
bool firstChild()
set the current node to the first child ...
const std::string & name() const
Returns the name.
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.