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

Run3-sim100 Update a few dumping code and several cfg's in SimG4CMS/Calo #36394

Merged
merged 2 commits into from
Dec 9, 2021
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
27 changes: 9 additions & 18 deletions SimG4CMS/Calo/src/EcalDumpGeometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

#include <iostream>

//#define EDM_ML_DEBUG

EcalDumpGeometry::EcalDumpGeometry(const std::vector<std::string_view>& names,
const std::string& name1,
const std::string& name2,
Expand All @@ -19,31 +17,31 @@ EcalDumpGeometry::EcalDumpGeometry(const std::vector<std::string_view>& names,
std::stringstream ss;
for (const auto& lvname : names)
ss << " " << lvname;
edm::LogVerbatim("EcalGeom") << " Type: " << type << " Depth Names " << name1_ << ":" << name2_ << " with "
<< names.size() << " LVs: " << ss.str();
G4cout << " Type: " << type << " Depth Names " << name1_ << ":" << name2_ << " with " << names.size()
<< " LVs: " << ss.str() << G4endl;
for (const auto& name : names) {
std::string namex = (static_cast<std::string>(dd4hep::dd::noNamespace(name))).substr(0, 4);
if (std::find(names_.begin(), names_.end(), namex) == names_.end())
names_.emplace_back(namex);
}
edm::LogVerbatim("EcalGeom") << "EcalDumpGeometry:: dump geometry information for detector of type " << type_
<< " with " << names_.size() << " elements:";
G4cout << "EcalDumpGeometry:: dump geometry information for detector of type " << type_ << " with " << names_.size()
<< " elements:" << G4endl;
for (unsigned int k = 0; k < names_.size(); ++k)
edm::LogVerbatim("EcalGeom") << "[" << k << "] : " << names_[k];
G4cout << "[" << k << "] : " << names_[k] << G4endl;
}

void EcalDumpGeometry::update() {
G4VPhysicalVolume* theTopPV =
G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume();
edm::LogVerbatim("EcalGeom") << "EcalDumpGeometry entered with entry of top PV at " << theTopPV;
G4cout << "EcalDumpGeometry entered with entry of top PV at " << theTopPV << G4endl;

dumpTouch(theTopPV, 0);
fHistory_.SetFirstEntry(theTopPV);
edm::LogVerbatim("EcalGeom") << "EcalDumpGeometry finds " << infoVec_.size() << " touchables";
G4cout << "EcalDumpGeometry finds " << infoVec_.size() << " touchables" << G4endl;
sort(infoVec_.begin(), infoVec_.end(), CaloDetInfoLess());
unsigned int k(0);
for (const auto& info : infoVec_) {
edm::LogVerbatim("EcalGeom") << "[" << k << "] " << info;
G4cout << "[" << k << "] " << info << G4endl;
if (info.flag() && (info.solid() != nullptr)) {
info.solid()->DumpInfo();
G4cout << G4endl;
Expand Down Expand Up @@ -73,15 +71,11 @@ void EcalDumpGeometry::dumpTouch(G4VPhysicalVolume* pv, unsigned int leafDepth)
theBaseNumber.reset();
if (theBaseNumber.getCapacity() < theSize + 1)
theBaseNumber.setSize(theSize + 1);
#ifdef EDM_ML_DEBUG
std::stringstream ss;
#endif
for (int ii = theSize; ii >= 0; --ii) {
std::string_view name = dd4hep::dd::noNamespace(fHistory_.GetVolume(ii)->GetName());
theBaseNumber.addLevel(static_cast<std::string>(name), fHistory_.GetVolume(ii)->GetCopyNo());
#ifdef EDM_ML_DEBUG
ss << " " << ii << " " << name << ":" << fHistory_.GetVolume(ii)->GetCopyNo();
#endif
}
uint32_t id = (((type_ % 10) == 0) ? ebNumbering_.getUnitID(theBaseNumber)
: (((type_ % 10) == 1) ? eeNumbering_.getUnitID(theBaseNumber)
Expand All @@ -92,10 +86,7 @@ void EcalDumpGeometry::dumpTouch(G4VPhysicalVolume* pv, unsigned int leafDepth)
if ((!name2_.empty()) && (namex == name2_))
depth = 2;
double r = globalpoint.rho();
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("EcalGeom") << " Field: " << ss.str() << " ID " << std::hex << id << std::dec << ":" << depth
<< ":" << r;
#endif
G4cout << " Field: " << ss.str() << " ID " << std::hex << id << std::dec << ":" << depth << ":" << r << G4endl;
G4VSolid* solid = (lv->GetSolid());
if (((type_ / 100) % 10) != 0)
infoVec_.emplace_back(CaloDetInfo(id, depth, r, noRefl(lvname), globalpoint, solid, flag));
Expand Down
24 changes: 9 additions & 15 deletions SimG4CMS/Calo/src/HcalDumpGeometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#include <iostream>
#include <memory>

//#define EDM_ML_DEBUG

HcalDumpGeometry::HcalDumpGeometry(const std::vector<std::string_view>& names,
const HcalNumberingFromDDD* hcn,
bool test,
Expand All @@ -19,7 +17,7 @@ HcalDumpGeometry::HcalDumpGeometry(const std::vector<std::string_view>& names,
std::stringstream ss;
for (const auto& lvname : names)
ss << " " << lvname;
edm::LogVerbatim("HCalGeom") << " Testmode: " << test << " with " << names.size() << " LVs: " << ss.str();
G4cout << " Testmode: " << test << " with " << names.size() << " LVs: " << ss.str() << G4endl;
const std::vector<std::string> namg = {"HBS", "HES", "HTS", "HVQ"};
for (const auto& name : names) {
std::string namex = (getNameNoNS(static_cast<std::string>(name))).substr(0, 3);
Expand All @@ -28,24 +26,23 @@ HcalDumpGeometry::HcalDumpGeometry(const std::vector<std::string_view>& names,
names_.emplace_back(namex);
}
}
edm::LogVerbatim("HCalGeom") << "HcalDumpGeometry:: dump geometry information for Hcal with " << names_.size()
<< " elements:";
G4cout << "HcalDumpGeometry:: dump geometry information for Hcal with " << names_.size() << " elements:" << G4endl;
for (unsigned int k = 0; k < names_.size(); ++k)
edm::LogVerbatim("HCalGeom") << "[" << k << "] : " << names_[k];
G4cout << "[" << k << "] : " << names_[k] << G4endl;
}

void HcalDumpGeometry::update() {
G4VPhysicalVolume* theTopPV =
G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume();
edm::LogVerbatim("HCalGeom") << "HcalDumpGeometry entered with entry of top PV at " << theTopPV;
G4cout << "HcalDumpGeometry entered with entry of top PV at " << theTopPV << G4endl;

dumpTouch(theTopPV, 0);
fHistory_.SetFirstEntry(theTopPV);
edm::LogVerbatim("HCalGeom") << "HcalDumpGeometry finds " << infoVec_.size() << " touchables";
G4cout << "HcalDumpGeometry finds " << infoVec_.size() << " touchables" << G4endl;
sort(infoVec_.begin(), infoVec_.end(), CaloDetInfoLess());
unsigned int k(0);
for (const auto& info : infoVec_) {
edm::LogVerbatim("HCalGeom") << "[" << k << "] " << info;
G4cout << "[" << k << "] " << info << G4endl;
if (info.flag() && (info.solid() != nullptr)) {
info.solid()->DumpInfo();
G4cout << G4endl;
Expand Down Expand Up @@ -76,12 +73,9 @@ void HcalDumpGeometry::dumpTouch(G4VPhysicalVolume* pv, unsigned int leafDepth)
HcalNumberingFromDDD::HcalID tmp = numberingFromDDD_->unitID(
det, math::XYZVectorD(globalpoint.x(), globalpoint.y(), globalpoint.z()), depth, lay);
uint32_t id = numberingScheme_->getUnitID(tmp);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HCalGeom") << "Det " << det << " Layer " << lay << ":" << depth << " Volume "
<< fHistory_.GetVolume(theSize)->GetName() << ":"
<< fHistory_.GetVolume(theSize - 1)->GetName() << " ID " << std::hex << id
<< std::dec;
#endif
G4cout << "Det " << det << " Layer " << lay << ":" << depth << " Volume "
<< fHistory_.GetVolume(theSize)->GetName() << ":" << fHistory_.GetVolume(theSize - 1)->GetName()
<< " ID " << std::hex << id << std::dec << G4endl;

G4VSolid* solid = lv->GetSolid();
infoVec_.emplace_back(CaloDetInfo(id, 0, 0, getNameNoNS(lvname), globalpoint, solid, flag_));
Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/Calo/test/python/ddd_SingleMuon_Step1_cfg.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import FWCore.ParameterSet.Config as cms

from Configuration.Eras.Era_Run3_cff import Run3
from Configuration.Eras.Era_Run3_DDD_cff import Run3_DDD

process = cms.Process('SIM',Run3)
process = cms.Process('SIM',Run3_DDD)

# import of standard configurations
process.load('Configuration.StandardSequences.Services_cff')
Expand Down
5 changes: 3 additions & 2 deletions SimG4CMS/Calo/test/python/runEcalGeom_cfg.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FWCore.ParameterSet.Config as cms

#from Configuration.Eras.Era_Run3_cff import Run3
#process = cms.Process('Dump',Run3)
#from Configuration.Eras.Era_Run3_DDD_cff import Run3_DDD
#process = cms.Process('Dump',Run3_DDD)
from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep
process = cms.Process('Dump',Run3_dd4hep)

Expand All @@ -24,6 +24,7 @@
process.MessageLogger.EcalGeom = dict()
process.MessageLogger.EcalSim = dict()
process.MessageLogger.G4cout = dict()
process.MessageLogger.cout = dict()

process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1),
Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/Calo/test/python/runEcalSimHitStudy_cfg.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FWCore.ParameterSet.Config as cms

from Configuration.Eras.Era_Run3_cff import Run3
process = cms.Process('Dump',Run3)
from Configuration.Eras.Era_Run3_DDD_cff import Run3_DDD
process = cms.Process('Dump',Run3_DDD)
#from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep
#process = cms.Process('Dump',Run3_dd4hep)

Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/Calo/test/python/runEta13_cfg.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FWCore.ParameterSet.Config as cms

from Configuration.Eras.Era_Run3_cff import Run3
process = cms.Process("PROD",Run3)
from Configuration.Eras.Era_Run3_DDD_cff import Run3_DDD
process = cms.Process("PROD",Run3_DDD)
process.load("Configuration.Geometry.GeometryExtended2021Reco_cff")

#from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep
Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/Calo/test/python/runEta2_cfg.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FWCore.ParameterSet.Config as cms

from Configuration.Eras.Era_Run3_cff import Run3
process = cms.Process("PROD",Run3)
from Configuration.Eras.Era_Run3_DDD_cff import Run3_DDD
process = cms.Process("PROD",Run3_DDD)
process.load("Configuration.Geometry.GeometryExtended2021Reco_cff")

#from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep
Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/Calo/test/python/runEta37_cfg.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FWCore.ParameterSet.Config as cms

from Configuration.Eras.Era_Run3_cff import Run3
process = cms.Process("PROD",Run3)
from Configuration.Eras.Era_Run3_DDD_cff import Run3_DDD
process = cms.Process("PROD",Run3_DDD)
process.load("Configuration.Geometry.GeometryExtended2021Reco_cff")

#from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep
Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/Calo/test/python/runEta7_cfg.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FWCore.ParameterSet.Config as cms

from Configuration.Eras.Era_Run3_cff import Run3
process = cms.Process("PROD",Run3)
from Configuration.Eras.Era_Run3_DDD_cff import Run3_DDD
process = cms.Process("PROD",Run3_DDD)
process.load("Configuration.Geometry.GeometryExtended2021Reco_cff")

#from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep
Expand Down
5 changes: 2 additions & 3 deletions SimG4CMS/Calo/test/python/runHF6_cfg.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import FWCore.ParameterSet.Config as cms

from Configuration.Eras.Era_Run3_cff import Run3
from Configuration.ProcessModifiers.dd4hep_cff import dd4hep
from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep
from Configuration.Eras.Modifier_run3_HFSL_cff import run3_HFSL

process = cms.Process('SIM',Run3,dd4hep,run3_HFSL)
process = cms.Process('SIM',Run3_dd4hep,run3_HFSL)

# import of standard configurations
process.load('Configuration.StandardSequences.Services_cff')
Expand Down
5 changes: 2 additions & 3 deletions SimG4CMS/Calo/test/python/runHFDDD_cfg.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import FWCore.ParameterSet.Config as cms
from Configuration.Eras.Era_Run3_DDD_cff import Run3_DDD

from Configuration.Eras.Era_Run3_cff import Run3

process = cms.Process('SIM',Run3)
process = cms.Process('SIM',Run3_DDD)

# import of standard configurations
process.load('Configuration.StandardSequences.Services_cff')
Expand Down
14 changes: 8 additions & 6 deletions SimG4CMS/Calo/test/python/runHcalGeom_cfg.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import FWCore.ParameterSet.Config as cms

from Configuration.Eras.Era_Run3_cff import Run3
process = cms.Process('Dump',Run3)
#from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep
#process = cms.Process('Dump',Run3_dd4hep)
#from Configuration.Eras.Era_Run3_DDD_cff import Run3_DDD
#process = cms.Process('Dump',Run3_DDD)
from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep
process = cms.Process('Dump',Run3_dd4hep)

# import of standard configurations
process.load('FWCore.MessageService.MessageLogger_cfi')
process.load('Configuration.Geometry.GeometryExtended2021Reco_cff')
#process.load('Configuration.Geometry.GeometryDD4hepExtended2021Reco_cff')
#process.load('Configuration.Geometry.GeometryExtended2021Reco_cff')
process.load('Configuration.Geometry.GeometryDD4hepExtended2021Reco_cff')
process.load('Configuration.StandardSequences.Services_cff')
process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
process.load('Configuration.EventContent.EventContent_cff')
Expand All @@ -23,6 +23,8 @@
if hasattr(process,'MessageLogger'):
process.MessageLogger.HCalGeom=dict()
process.MessageLogger.HcalSim=dict()
process.MessageLogger.G4cout=dict()
process.MessageLogger.cout=dict()

process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1),
Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/Calo/test/python/runHcalSimHitAnalysis_cfg.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FWCore.ParameterSet.Config as cms

#from Configuration.Eras.Era_Run3_cff import Run3
#process = cms.Process('Dump',Run3)
#from Configuration.Eras.Era_Run3_DDD_cff import Run3_DDD
#process = cms.Process('Dump',Run3_DDD)
from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep
process = cms.Process('Dump',Run3_dd4hep)

Expand Down