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;
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
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
static uint32_t packIndex(int det, int lay, int x, int y)
bool next()
set current node to the next node in the filtered tree
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
HcalTB06BeamSD(const G4String &, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
double getAttenuation(G4Step *aStep, double birk1, double birk2, double birk3)
virtual std::vector< std::string > getNames()
~HcalTB06BeamSD() override
G4StepPoint * preStepPoint
std::vector< std::vector< double > > tmp
bool firstChild()
set the current node to the first child ...
bool isItWireChamber(G4String)
double getEnergyDeposit(G4Step *) override
uint32_t setDetUnitId(G4Step *step) override
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.
G4ThreeVector setToLocal(const G4ThreeVector &, const G4VTouchable *)