10 #include "CLHEP/Units/GlobalPhysicalConstants.h"
11 #include "CLHEP/Units/GlobalSystemOfUnits.h"
12 #include "G4TransportationManager.hh"
32 produces<edm::PassiveHitContainer>(Form(
"%sPassiveHits",
name.c_str()));
43 for (
unsigned int k = 0;
k <
LVNames_.size(); ++
k) {
56 const G4LogicalVolumeStore* lvs = G4LogicalVolumeStore::GetInstance();
57 for (
auto lvcite : *lvs) {
64 for (
const auto& lvs :
mapLV_) {
66 << (lvs.second).second <<
")";
75 int iev = (*evt)()->GetEventID();
85 if (aStep !=
nullptr) {
86 G4VSensitiveDetector* curSD = aStep->GetPreStepPoint()->GetSensitiveDetector();
87 const G4VTouchable* touchable = aStep->GetPreStepPoint()->GetTouchable();
89 if (curSD ==
nullptr) {
90 G4LogicalVolume* plv = touchable->GetVolume()->GetLogicalVolume();
92 double time = aStep->GetTrack()->GetGlobalTime();
96 if (((aStep->GetPostStepPoint() ==
nullptr) || (aStep->GetTrack()->GetNextVolume() ==
nullptr)) &&
97 (aStep->IsLastStepInVolume())) {
99 edm::LogVerbatim(
"HGCSim") << plv->GetName() <<
" F|L Step " << aStep->IsFirstStepInVolume() <<
":"
100 << aStep->IsLastStepInVolume() <<
" Position"
101 << aStep->GetPreStepPoint()->GetPosition() <<
" Track "
102 << aStep->GetTrack()->GetDefinition()->GetParticleName() <<
" at"
103 << aStep->GetTrack()->GetPosition() <<
" Volume " << aStep->GetTrack()->GetVolume()
104 <<
":" << aStep->GetTrack()->GetNextVolume() <<
" Status "
105 << aStep->GetTrack()->GetTrackStatus() <<
" KE "
106 << aStep->GetTrack()->GetKineticEnergy() <<
" Deposit "
107 << aStep->GetTotalEnergyDeposit() <<
" Map " << (it !=
mapLV_.end());
111 time = (aStep->GetPostStepPoint()->GetGlobalTime());
112 copy = (
unsigned int)(touchable->GetReplicaNumber(0) + 1000 * touchable->GetReplicaNumber(1));
116 }
else if (
topLV_ !=
nullptr) {
118 if (itr !=
mapLV_.end()) {
125 int level = (touchable->GetHistoryDepth());
128 double time = (aStep->GetTrack()->GetGlobalTime());
131 G4LogicalVolume* plv = touchable->GetVolume(
i)->GetLogicalVolume();
134 edm::LogVerbatim(
"HGCSim") <<
"Level: " <<
level <<
":" <<
i <<
" " << plv->GetName() <<
" flag in the List "
140 : (
unsigned int)(touchable->GetReplicaNumber(
i) + 1000 * touchable->GetReplicaNumber(
i + 1));
153 unsigned int kount(0);
155 for (
const auto& element :
store_) {
156 G4LogicalVolume* lv = (element.first).
first;
157 auto it =
mapLV_.find(lv);
159 if ((it->second).first ==
k) {
161 (it->second).second, (element.first).second, (element.second)[1], (element.second)[2], (element.second)[0]);
162 hgcPH.push_back(
hit);
173 return G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume();
177 auto itr =
mapLV_.find(plv);
178 if (itr ==
mapLV_.end()) {
180 for (
unsigned int k = 0;
k <
LVNames_.size(); ++
k) {
182 mapLV_[plv] = std::pair<unsigned int, std::string>(
k,
name);
196 G4LogicalVolume* plv,
201 std::pair<G4LogicalVolume*, unsigned int>
key(plv,
copy);
204 if (itr ==
store_.end()) {
207 (itr->second)[1] += ee;
208 (itr->second)[2] +=
energy;
212 edm::LogVerbatim(
"HGCSim") <<
"HGCPassive: Element " << (it->second).
first <<
":" << (it->second).second <<
":"
213 <<
copy <<
" T " << (itr->second)[0] <<
" E " << (itr->second)[1] <<
":"