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.size() > 0) {
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 hitPoint = preStepPoint->GetPosition();
124 G4ThreeVector localPoint =
setToLocal(hitPoint, touch);
125 x = (
int)(localPoint.x()/(0.2*mm));
126 y = (
int)(localPoint.y()/(0.2*mm));
134 std::vector<G4String>
tmp;
140 for (
unsigned int i=0;
i<tmp.size();
i++)
141 if (name == tmp[
i]) ok =
false;
142 if (ok) tmp.push_back(name);
150 std::vector<G4String>::const_iterator it =
wcNames.begin();
151 for (; it !=
wcNames.end(); it++)
152 if (name == *it)
return true;
virtual double getEnergyDeposit(G4Step *)
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
HcalTB06BeamSD(G4String, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
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)
virtual ~HcalTB06BeamSD()
bool next()
set current node to the next node in the filtered tree
virtual uint32_t setDetUnitId(G4Step *step)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
double getAttenuation(G4Step *aStep, double birk1, double birk2, double birk3)
virtual std::vector< std::string > getNames()
G4StepPoint * preStepPoint
std::vector< std::vector< double > > tmp
bool firstChild()
set the current node to the first child ...
bool isItWireChamber(G4String)
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 *)