20 #include "G4Material.hh" 21 #include "CLHEP/Units/GlobalSystemOfUnits.h" 30 CaloSD(name, cpv, clg, p, manager) {
39 edm::LogInfo(
"HcalTB06BeamSD") <<
"HcalTB06BeamSD:: Use of Birks law is set " 40 <<
"to " << useBirk <<
" with three " 41 <<
"constants kB = " << birk1 <<
", C1 = " 42 << birk2 <<
", C2 = " <<
birk3;
48 value =
"WireChamber";
52 edm::LogInfo(
"HcalTB06BeamSD") <<
"HcalTB06BeamSD:: Names to be tested for " 53 << attribute <<
" = " << value <<
": " 56 edm::LogInfo(
"HcalTB06BeamSD") <<
"HcalTB06BeamSD:: (" <<
i <<
") " 60 attribute =
"ReadOutName";
65 std::vector<G4String> matNames;
66 std::vector<int> nocc;
71 for (
unsigned int i=0;
i<matNames.size();
i++) {
72 if (
matName == matNames[
i]) {notIn =
false; nocc[
i]++;}
80 if (!matNames.empty()) {
83 for (
unsigned int i = 0;
i < matNames.size();
i++) {
93 edm::LogInfo(
"HcalTB06BeamSD") <<
"HcalTB06BeamSD: Material name for " 94 << attribute <<
" = " << name <<
":" 102 double destep = aStep->GetTotalEnergyDeposit();
104 if (
useBirk &&
matName == aStep->GetPreStepPoint()->GetMaterial()->GetName())
108 << aStep->GetPreStepPoint()->GetTouchable()->GetVolume()->GetName()
111 return weight*destep;
116 const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
117 const G4VTouchable* touch = preStepPoint->GetTouchable();
118 G4String
name = preStepPoint->GetPhysicalVolume()->GetName();
121 int lay = 0,
x = 0,
y = 0;
123 lay = (touch->GetReplicaNumber(0));
126 lay = (touch->GetReplicaNumber(1));
127 G4ThreeVector localPoint =
setToLocal(preStepPoint->GetPosition(), touch);
128 x = (
int)(localPoint.x()/(0.2*mm));
129 y = (
int)(localPoint.y()/(0.2*mm));
137 std::vector<G4String>
tmp;
143 for (
unsigned int i=0;
i<tmp.size();
i++)
144 if (name == tmp[
i]) ok =
false;
145 if (ok) tmp.push_back(name);
153 std::vector<G4String>::const_iterator it =
wcNames.begin();
154 for (; it !=
wcNames.end(); it++)
155 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.