11// /////////////////////////////////////////////////////////////////////////////
2- // File: HGCPassive .cc
2+ // File: HGCalTBPassive .cc
33// copied from SimG4HGCalValidation
44// Description: Main analysis class for HGCal Validation of G4 Hits
55// /////////////////////////////////////////////////////////////////////////////
3333
3434// #define EDM_ML_DEBUG
3535
36- class HGCPassive : public SimProducer ,
37- public Observer<const BeginOfRun *>,
38- public Observer<const BeginOfEvent *>,
39- public Observer<const G4Step *> {
36+ class HGCalTBPassive : public SimProducer ,
37+ public Observer<const BeginOfRun *>,
38+ public Observer<const BeginOfEvent *>,
39+ public Observer<const G4Step *> {
4040public:
41- HGCPassive (const edm::ParameterSet &p);
42- HGCPassive (const HGCPassive &) = delete ; // stop default
43- const HGCPassive &operator =(const HGCPassive &) = delete ;
44- ~HGCPassive () override ;
41+ HGCalTBPassive (const edm::ParameterSet &p);
42+ HGCalTBPassive (const HGCalTBPassive &) = delete ; // stop default
43+ const HGCalTBPassive &operator =(const HGCalTBPassive &) = delete ;
44+ ~HGCalTBPassive () override ;
4545
4646 void produce (edm::Event &, const edm::EventSetup &) override ;
4747
@@ -75,8 +75,8 @@ class HGCPassive : public SimProducer,
7575 std::map<std::pair<G4LogicalVolume *, unsigned int >, std::array<double , 3 >> store_;
7676};
7777
78- HGCPassive::HGCPassive (const edm::ParameterSet &p)
79- : m_Passive(p.getParameter<edm::ParameterSet>(" HGCPassive " )),
78+ HGCalTBPassive::HGCalTBPassive (const edm::ParameterSet &p)
79+ : m_Passive(p.getParameter<edm::ParameterSet>(" HGCalTBPassive " )),
8080 LVNames_(m_Passive.getParameter<std::vector<std::string>>(" LVNames" )),
8181 motherName_(m_Passive.getParameter<std::string>(" MotherName" )),
8282 addlevel_((m_Passive.getParameter<bool >(" IfDD4hep" )) ? 1 : 0),
@@ -97,17 +97,17 @@ HGCPassive::HGCPassive(const edm::ParameterSet &p)
9797 }
9898}
9999
100- HGCPassive ::~HGCPassive () {}
100+ HGCalTBPassive ::~HGCalTBPassive () {}
101101
102- void HGCPassive ::produce (edm::Event &e, const edm::EventSetup &) {
102+ void HGCalTBPassive ::produce (edm::Event &e, const edm::EventSetup &) {
103103 for (unsigned int k = 0 ; k < LVNames_.size (); ++k) {
104104 std::unique_ptr<edm::PassiveHitContainer> hgcPH (new edm::PassiveHitContainer);
105105 endOfEvent (*hgcPH, k);
106106 e.put (std::move (hgcPH), Form (" %sPassiveHits" , LVNames_[k].c_str ()));
107107 }
108108}
109109
110- void HGCPassive ::update (const BeginOfRun *run) {
110+ void HGCalTBPassive ::update (const BeginOfRun *run) {
111111 topPV_ = getTopPV ();
112112 if (topPV_ == nullptr ) {
113113 edm::LogWarning (" HGCSim" ) << " Cannot find top level volume\n " ;
@@ -119,7 +119,7 @@ void HGCPassive::update(const BeginOfRun *run) {
119119 }
120120
121121#ifdef EDM_ML_DEBUG
122- edm::LogVerbatim (" HGCSim" ) << " HGCPassive ::Finds " << mapLV_.size () << " logical volumes" ;
122+ edm::LogVerbatim (" HGCSim" ) << " HGCalTBPassive ::Finds " << mapLV_.size () << " logical volumes" ;
123123 unsigned int k (0 );
124124 for (const auto &lvs : mapLV_) {
125125 edm::LogVerbatim (" HGCSim" ) << " Entry[" << k << " ] " << lvs.first << " : (" << (lvs.second ).first << " , "
@@ -131,17 +131,17 @@ void HGCPassive::update(const BeginOfRun *run) {
131131}
132132
133133// =================================================================== per EVENT
134- void HGCPassive ::update (const BeginOfEvent *evt) {
134+ void HGCalTBPassive ::update (const BeginOfEvent *evt) {
135135 int iev = (*evt)()->GetEventID ();
136- edm::LogVerbatim (" HGCSim" ) << " HGCPassive : =====> Begin event = " << iev << std::endl;
136+ edm::LogVerbatim (" HGCSim" ) << " HGCalTBPassive : =====> Begin event = " << iev << std::endl;
137137
138138 ++count_;
139139 store_.clear ();
140140}
141141
142142// //=================================================================== each
143143// STEP
144- void HGCPassive ::update (const G4Step *aStep) {
144+ void HGCalTBPassive ::update (const G4Step *aStep) {
145145 if (aStep != nullptr ) {
146146 G4VSensitiveDetector *curSD = aStep->GetPreStepPoint ()->GetSensitiveDetector ();
147147 const G4VTouchable *touchable = aStep->GetPreStepPoint ()->GetTouchable ();
@@ -211,7 +211,7 @@ void HGCPassive::update(const G4Step *aStep) {
211211
212212// ================================================================ End of EVENT
213213
214- void HGCPassive ::endOfEvent (edm::PassiveHitContainer &hgcPH, unsigned int k) {
214+ void HGCalTBPassive ::endOfEvent (edm::PassiveHitContainer &hgcPH, unsigned int k) {
215215#ifdef EDM_ML_DEBUG
216216 unsigned int kount (0 );
217217#endif
@@ -224,19 +224,19 @@ void HGCPassive::endOfEvent(edm::PassiveHitContainer &hgcPH, unsigned int k) {
224224 (it->second ).second , (element.first ).second , (element.second )[1 ], (element.second )[2 ], (element.second )[0 ]);
225225 hgcPH.push_back (hit);
226226#ifdef EDM_ML_DEBUG
227- edm::LogVerbatim (" HGCSim" ) << " HGCPassive [" << k << " ] Hit[" << kount << " ] " << hit;
227+ edm::LogVerbatim (" HGCSim" ) << " HGCalTBPassive [" << k << " ] Hit[" << kount << " ] " << hit;
228228 ++kount;
229229#endif
230230 }
231231 }
232232 }
233233}
234234
235- G4VPhysicalVolume *HGCPassive ::getTopPV () {
235+ G4VPhysicalVolume *HGCalTBPassive ::getTopPV () {
236236 return G4TransportationManager::GetTransportationManager ()->GetNavigatorForTracking ()->GetWorldVolume ();
237237}
238238
239- HGCPassive ::volumeIterator HGCPassive ::findLV (G4LogicalVolume *plv) {
239+ HGCalTBPassive ::volumeIterator HGCalTBPassive ::findLV (G4LogicalVolume *plv) {
240240 auto itr = mapLV_.find (plv);
241241 if (itr == mapLV_.end ()) {
242242 std::string name = DD4hep2DDDName::noNameSpace (static_cast <std::string>(plv->GetName ()));
@@ -255,12 +255,12 @@ HGCPassive::volumeIterator HGCPassive::findLV(G4LogicalVolume *plv) {
255255 return itr;
256256}
257257
258- void HGCPassive ::storeInfo (const HGCPassive ::volumeIterator it,
259- G4LogicalVolume *plv,
260- unsigned int copy,
261- double time,
262- double energy,
263- bool flag) {
258+ void HGCalTBPassive ::storeInfo (const HGCalTBPassive ::volumeIterator it,
259+ G4LogicalVolume *plv,
260+ unsigned int copy,
261+ double time,
262+ double energy,
263+ bool flag) {
264264 std::pair<G4LogicalVolume *, unsigned int > key (plv, copy);
265265 auto itr = store_.find (key);
266266 double ee = (flag) ? energy : 0 ;
@@ -272,7 +272,7 @@ void HGCPassive::storeInfo(const HGCPassive::volumeIterator it,
272272 }
273273#ifdef EDM_ML_DEBUG
274274 itr = store_.find (key);
275- edm::LogVerbatim (" HGCSim" ) << " HGCPassive : Element " << (it->second ).first << " :" << (it->second ).second << " :"
275+ edm::LogVerbatim (" HGCSim" ) << " HGCalTBPassive : Element " << (it->second ).first << " :" << (it->second ).second << " :"
276276 << copy << " T " << (itr->second )[0 ] << " E " << (itr->second )[1 ] << " :"
277277 << (itr->second )[2 ];
278278#endif
@@ -281,4 +281,4 @@ void HGCPassive::storeInfo(const HGCPassive::volumeIterator it,
281281#include " SimG4Core/Watcher/interface/SimWatcherFactory.h"
282282#include " FWCore/PluginManager/interface/ModuleDef.h"
283283
284- DEFINE_SIMWATCHER (HGCPassive );
284+ DEFINE_SIMWATCHER (HGCalTBPassive );
0 commit comments