Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phase2-hgx358B Modify the name of the class HGCPassive to HGCalTBPassive to separate the names of TB and non-TB classes of HGCal #45365

Merged
merged 2 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Geometry/HGCalTBCommonData/python/testTB181V0XML_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
'Geometry/HGCalTBCommonData/data/hgcalwafer/v7/hgcalwafer.xml',
'Geometry/HGCalTBCommonData/data/TB181/Oct181/hgcalsense.xml',
'Geometry/HGCalTBCommonData/data/TB181/hgcProdCuts.xml',
'Geometry/HGCalTBCommonData/data/TB181/Oct181/hgcalCons.xml'
'Geometry/HGCalTBCommonData/data/TB181/Oct181/hgcalCons.xml',
'Geometry/HcalSimData/data/CaloUtil/2026/v5c/CaloUtil.xml'
),
rootNodeName = cms.string('cms:OCMS')
)
Expand Down
4 changes: 3 additions & 1 deletion Geometry/HGCalTBCommonData/python/testTB181V1XML_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
'Geometry/HGCalTBCommonData/data/TB181/Oct181/hgcalEE.xml',
'Geometry/HGCalTBCommonData/data/TB181/Oct181/hgcalsense.xml',
'Geometry/HGCalTBCommonData/data/TB181/hgcProdCuts.xml',
'Geometry/HGCalTBCommonData/data/TB181/Oct181/hgcalCons.xml'
'Geometry/HGCalTBCommonData/data/TB181/Oct181/hgcalCons.xml',
'Geometry/HcalSimData/data/CaloUtil/2026/v5c/CaloUtil.xml'

),
rootNodeName = cms.string('cms:OCMS')
)
4 changes: 3 additions & 1 deletion Geometry/HGCalTBCommonData/python/testTB181V2XML_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
'Geometry/HGCalTBCommonData/data/hgcalwafer/v7/hgcalwafer.xml',
'Geometry/HGCalTBCommonData/data/TB181/Test/hgcalsense.xml',
'Geometry/HGCalTBCommonData/data/TB181/Test/hgcProdCuts.xml',
'Geometry/HGCalTBCommonData/data/TB181/Test/hgcalCons.xml'
'Geometry/HGCalTBCommonData/data/TB181/Test/hgcalCons.xml',
'Geometry/HcalSimData/data/CaloUtil/2026/v5c/CaloUtil.xml'

),
rootNodeName = cms.string('cms:OCMS')
)
4 changes: 3 additions & 1 deletion Geometry/HGCalTBCommonData/python/testTB181XML_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
'Geometry/HGCalTBCommonData/data/hgcalwafer/v7/hgcalwafer.xml',
'Geometry/HGCalTBCommonData/data/TB181/Oct181/hgcalsense.xml',
'Geometry/HGCalTBCommonData/data/TB181/hgcProdCuts.xml',
'Geometry/HGCalTBCommonData/data/TB181/Oct181/hgcalCons.xml'
'Geometry/HGCalTBCommonData/data/TB181/Oct181/hgcalCons.xml',
'Geometry/HcalSimData/data/CaloUtil/2026/v5c/CaloUtil.xml'

),
rootNodeName = cms.string('cms:OCMS')
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////////
// File: HGCPassive.cc
// File: HGCalTBPassive.cc
// copied from SimG4HGCalValidation
// Description: Main analysis class for HGCal Validation of G4 Hits
///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -33,15 +33,15 @@

//#define EDM_ML_DEBUG

class HGCPassive : public SimProducer,
public Observer<const BeginOfRun *>,
public Observer<const BeginOfEvent *>,
public Observer<const G4Step *> {
class HGCalTBPassive : public SimProducer,
public Observer<const BeginOfRun *>,
public Observer<const BeginOfEvent *>,
public Observer<const G4Step *> {
public:
HGCPassive(const edm::ParameterSet &p);
HGCPassive(const HGCPassive &) = delete; // stop default
const HGCPassive &operator=(const HGCPassive &) = delete;
~HGCPassive() override;
HGCalTBPassive(const edm::ParameterSet &p);
HGCalTBPassive(const HGCalTBPassive &) = delete; // stop default
const HGCalTBPassive &operator=(const HGCalTBPassive &) = delete;
~HGCalTBPassive() override;

void produce(edm::Event &, const edm::EventSetup &) override;

Expand Down Expand Up @@ -75,8 +75,8 @@ class HGCPassive : public SimProducer,
std::map<std::pair<G4LogicalVolume *, unsigned int>, std::array<double, 3>> store_;
};

HGCPassive::HGCPassive(const edm::ParameterSet &p)
: m_Passive(p.getParameter<edm::ParameterSet>("HGCPassive")),
HGCalTBPassive::HGCalTBPassive(const edm::ParameterSet &p)
: m_Passive(p.getParameter<edm::ParameterSet>("HGCalTBPassive")),
LVNames_(m_Passive.getParameter<std::vector<std::string>>("LVNames")),
motherName_(m_Passive.getParameter<std::string>("MotherName")),
addlevel_((m_Passive.getParameter<bool>("IfDD4hep")) ? 1 : 0),
Expand All @@ -97,17 +97,17 @@ HGCPassive::HGCPassive(const edm::ParameterSet &p)
}
}

HGCPassive::~HGCPassive() {}
HGCalTBPassive::~HGCalTBPassive() {}

void HGCPassive::produce(edm::Event &e, const edm::EventSetup &) {
void HGCalTBPassive::produce(edm::Event &e, const edm::EventSetup &) {
for (unsigned int k = 0; k < LVNames_.size(); ++k) {
std::unique_ptr<edm::PassiveHitContainer> hgcPH(new edm::PassiveHitContainer);
endOfEvent(*hgcPH, k);
e.put(std::move(hgcPH), Form("%sPassiveHits", LVNames_[k].c_str()));
}
}

void HGCPassive::update(const BeginOfRun *run) {
void HGCalTBPassive::update(const BeginOfRun *run) {
topPV_ = getTopPV();
if (topPV_ == nullptr) {
edm::LogWarning("HGCSim") << "Cannot find top level volume\n";
Expand All @@ -119,7 +119,7 @@ void HGCPassive::update(const BeginOfRun *run) {
}

#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCSim") << "HGCPassive::Finds " << mapLV_.size() << " logical volumes";
edm::LogVerbatim("HGCSim") << "HGCalTBPassive::Finds " << mapLV_.size() << " logical volumes";
unsigned int k(0);
for (const auto &lvs : mapLV_) {
edm::LogVerbatim("HGCSim") << "Entry[" << k << "] " << lvs.first << ": (" << (lvs.second).first << ", "
Expand All @@ -131,17 +131,17 @@ void HGCPassive::update(const BeginOfRun *run) {
}

//=================================================================== per EVENT
void HGCPassive::update(const BeginOfEvent *evt) {
void HGCalTBPassive::update(const BeginOfEvent *evt) {
int iev = (*evt)()->GetEventID();
edm::LogVerbatim("HGCSim") << "HGCPassive: =====> Begin event = " << iev << std::endl;
edm::LogVerbatim("HGCSim") << "HGCalTBPassive: =====> Begin event = " << iev << std::endl;

++count_;
store_.clear();
}

// //=================================================================== each
// STEP
void HGCPassive::update(const G4Step *aStep) {
void HGCalTBPassive::update(const G4Step *aStep) {
if (aStep != nullptr) {
G4VSensitiveDetector *curSD = aStep->GetPreStepPoint()->GetSensitiveDetector();
const G4VTouchable *touchable = aStep->GetPreStepPoint()->GetTouchable();
Expand Down Expand Up @@ -211,7 +211,7 @@ void HGCPassive::update(const G4Step *aStep) {

//================================================================ End of EVENT

void HGCPassive::endOfEvent(edm::PassiveHitContainer &hgcPH, unsigned int k) {
void HGCalTBPassive::endOfEvent(edm::PassiveHitContainer &hgcPH, unsigned int k) {
#ifdef EDM_ML_DEBUG
unsigned int kount(0);
#endif
Expand All @@ -224,19 +224,19 @@ void HGCPassive::endOfEvent(edm::PassiveHitContainer &hgcPH, unsigned int k) {
(it->second).second, (element.first).second, (element.second)[1], (element.second)[2], (element.second)[0]);
hgcPH.push_back(hit);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCSim") << "HGCPassive[" << k << "] Hit[" << kount << "] " << hit;
edm::LogVerbatim("HGCSim") << "HGCalTBPassive[" << k << "] Hit[" << kount << "] " << hit;
++kount;
#endif
}
}
}
}

G4VPhysicalVolume *HGCPassive::getTopPV() {
G4VPhysicalVolume *HGCalTBPassive::getTopPV() {
return G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume();
}

HGCPassive::volumeIterator HGCPassive::findLV(G4LogicalVolume *plv) {
HGCalTBPassive::volumeIterator HGCalTBPassive::findLV(G4LogicalVolume *plv) {
auto itr = mapLV_.find(plv);
if (itr == mapLV_.end()) {
std::string name = DD4hep2DDDName::noNameSpace(static_cast<std::string>(plv->GetName()));
Expand All @@ -255,12 +255,12 @@ HGCPassive::volumeIterator HGCPassive::findLV(G4LogicalVolume *plv) {
return itr;
}

void HGCPassive::storeInfo(const HGCPassive::volumeIterator it,
G4LogicalVolume *plv,
unsigned int copy,
double time,
double energy,
bool flag) {
void HGCalTBPassive::storeInfo(const HGCalTBPassive::volumeIterator it,
G4LogicalVolume *plv,
unsigned int copy,
double time,
double energy,
bool flag) {
std::pair<G4LogicalVolume *, unsigned int> key(plv, copy);
auto itr = store_.find(key);
double ee = (flag) ? energy : 0;
Expand All @@ -272,7 +272,7 @@ void HGCPassive::storeInfo(const HGCPassive::volumeIterator it,
}
#ifdef EDM_ML_DEBUG
itr = store_.find(key);
edm::LogVerbatim("HGCSim") << "HGCPassive: Element " << (it->second).first << ":" << (it->second).second << ":"
edm::LogVerbatim("HGCSim") << "HGCalTBPassive: Element " << (it->second).first << ":" << (it->second).second << ":"
<< copy << " T " << (itr->second)[0] << " E " << (itr->second)[1] << ":"
<< (itr->second)[2];
#endif
Expand All @@ -281,4 +281,4 @@ void HGCPassive::storeInfo(const HGCPassive::volumeIterator it,
#include "SimG4Core/Watcher/interface/SimWatcherFactory.h"
#include "FWCore/PluginManager/interface/ModuleDef.h"

DEFINE_SIMWATCHER(HGCPassive);
DEFINE_SIMWATCHER(HGCalTBPassive);
4 changes: 2 additions & 2 deletions SimG4CMS/HGCalTestBeam/test/HGCalTBCERN170_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@
process.g4SimHits.HGCSD.RejectMouseBite = True
process.g4SimHits.HGCSD.RotatedWafer = True
process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
HGCPassive = cms.PSet(
HGCalTBPassive = cms.PSet(
LVNames = cms.vstring('HGCalEE','HGCalHE','HGCalAH', 'HGCalBeam', 'CMSE'),
MotherName = cms.string('OCMS'),
IfDD4hep = cms.bool(False),
),
type = cms.string('HGCPassive'),
type = cms.string('HGCalTBPassive'),
)
)
process.HGCalTBAnalyzer.doDigis = False
Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/HGCalTestBeam/test/HGCalTBCERN181Oct1DD4hep_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@
process.DDDetectorESProducer.confGeomXMLFiles = cms.FileInPath("SimG4CMS/HGCalTestBeam/data/dd4hep/HGCalTB181Oct1.xml")

process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
HGCPassive = cms.PSet(
HGCalTBPassive = cms.PSet(
LVNames = cms.vstring('HGCalEE','HGCalHE','HGCalAH', 'HGCalBeam', 'CMSE'),
MotherName = cms.string('OCMS'),
IfDD4hep = cms.bool(True),
),
type = cms.string('HGCPassive'),
type = cms.string('HGCalTBPassive'),
)
)
process.HGCalTBAnalyzer.doDigis = False
Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/HGCalTestBeam/test/HGCalTBCERN181Oct1PC1mm_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@
process.g4SimHits.HGCSD.RejectMouseBite = True
process.g4SimHits.HGCSD.RotatedWafer = True
process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
HGCPassive = cms.PSet(
HGCalTBPassive = cms.PSet(
LVNames = cms.vstring('HGCalEE','HGCalHE','HGCalAH', 'HGCalBeam', 'CMSE'),
MotherName = cms.string('OCMS'),
IfDD4hep = cms.bool(False),
),
type = cms.string('HGCPassive'),
type = cms.string('HGCalTBPassive'),
)
)
process.HGCalTBAnalyzer.doDigis = False
Expand Down
5 changes: 3 additions & 2 deletions SimG4CMS/HGCalTestBeam/test/HGCalTBCERN181Oct1_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
process.load('Geometry.HGCalTBCommonData.hgcalTBNumberingInitialization_cfi')
process.load('Geometry.HGCalTBCommonData.hgcalTBParametersInitialization_cfi')
process.load('Geometry.HcalTestBeamData.hcalTB06Parameters_cff')
process.load('Geometry.HcalCommonData.caloSimulationParameters_cff')
process.load('Geometry.CaloEventSetup.HGCalTBTopology_cfi')
process.load('Geometry.HGCalGeometry.HGCalTBGeometryESProducer_cfi')
process.load('Configuration.StandardSequences.MagneticField_0T_cff')
Expand Down Expand Up @@ -101,12 +102,12 @@
process.g4SimHits.G4CheckOverlap.gdmlFlag = True
process.g4SimHits.FileNameGDML = "TBHGCal181Oct.gdml"
process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
HGCPassive = cms.PSet(
HGCalTBPassive = cms.PSet(
LVNames = cms.vstring('HGCalEE','HGCalHE','HGCalAH', 'HGCalBeam', 'CMSE'),
MotherName = cms.string('OCMS'),
IfDD4hep = cms.bool(False),
),
type = cms.string('HGCPassive'),
type = cms.string('HGCalTBPassive'),
)
)
process.HGCalTBAnalyzer.doDigis = False
Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/HGCalTestBeam/test/HGCalTBCERN181Oct1el100_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@
process.g4SimHits.HGCSD.RotatedWafer = True

process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
HGCPassive = cms.PSet(
HGCalTBPassive = cms.PSet(
LVNames = cms.vstring('HGCalEE','HGCalHE','HGCalAH', 'HGCalBeam', 'CMSE'),
MotherName = cms.string('OCMS'),
IfDD4hep = cms.bool(False),
),
type = cms.string('HGCPassive'),
type = cms.string('HGCalTBPassive'),
)
)
process.HGCalTBAnalyzer.doDigis = False
Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/HGCalTestBeam/test/HGCalTBCERN181Oct2_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@
process.g4SimHits.HGCSD.RejectMouseBite = True
process.g4SimHits.HGCSD.RotatedWafer = True
process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
HGCPassive = cms.PSet(
HGCalTBPassive = cms.PSet(
LVNames = cms.vstring('HGCalEE','HGCalHE','HGCalAH', 'HGCalBeam', 'CMSE'),
MotherName = cms.string('OCMS'),
IfDD4hep = cms.bool(False),
),
type = cms.string('HGCPassive'),
type = cms.string('HGCalTBPassive'),
)
)
process.HGCalTBAnalyzer.doDigis = False
Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/HGCalTestBeam/test/HGCalTBCERN181Oct3_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@
process.g4SimHits.HGCSD.RejectMouseBite = True
process.g4SimHits.HGCSD.RotatedWafer = True
process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
HGCPassive = cms.PSet(
HGCalTBPassive = cms.PSet(
LVNames = cms.vstring('HGCalEE','HGCalHE','HGCalAH', 'HGCalBeam', 'CMSE'),
MotherName = cms.string('OCMS'),
IfDD4hep = cms.bool(False),
),
type = cms.string('HGCPassive'),
type = cms.string('HGCalTBPassive'),
)
)
process.HGCalTBAnalyzer.doDigis = False
Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/HGCalTestBeam/test/HGCalTBCERN181Oct4_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@
process.g4SimHits.HGCSD.RejectMouseBite = True
process.g4SimHits.HGCSD.RotatedWafer = True
process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
HGCPassive = cms.PSet(
HGCalTBPassive = cms.PSet(
LVNames = cms.vstring('HGCalEE','HGCalHE','HGCalAH', 'HGCalBeam', 'CMSE'),
MotherName = cms.string('OCMS'),
IfDD4hep = cms.bool(False),
),
type = cms.string('HGCPassive'),
type = cms.string('HGCalTBPassive'),
)
)
process.HGCalTBAnalyzer.doDigis = False
Expand Down