Skip to content

Commit

Permalink
Move cout msg to logging in DetectorConstruction, ParallelWorld, TS DQM
Browse files Browse the repository at this point in the history
  • Loading branch information
tvami committed Aug 27, 2024
1 parent 2e2dbd3 commit d74f8cc
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 15 deletions.
6 changes: 3 additions & 3 deletions DQM/src/DQM/TrigScintDQM.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ TrigScintDQM::TrigScintDQM(const std::string &name, framework::Process &process)
TrigScintDQM::~TrigScintDQM() {}

void TrigScintDQM::onProcessStart() {
std::cout << "Process starts!" << std::endl;
ldmx_log(debug) << "Process starts!";

getHistoDirectory();

Expand Down Expand Up @@ -42,8 +42,8 @@ void TrigScintDQM::configure(framework::config::Parameters &ps) {
hitCollectionName_ = ps.getParameter<std::string>("hit_collection");
padName_ = ps.getParameter<std::string>("pad");

std::cout << "In TrigScintDQM::configure, got parameters "
<< hitCollectionName_ << " and " << padName_ << std::endl;
ldmx_log(debug) << "In TrigScintDQM::configure, got parameters "
<< hitCollectionName_ << " and " << padName_;
}

void TrigScintDQM::analyze(const framework::Event &event) {
Expand Down
6 changes: 3 additions & 3 deletions DQM/src/DQM/TrigScintHitDQM.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TrigScintHitDQM::TrigScintHitDQM(const std::string &name,
TrigScintHitDQM::~TrigScintHitDQM() {}

void TrigScintHitDQM::onProcessStart() {
std::cout << "Process starts!" << std::endl;
ldmx_log(debug) << "Process starts!";

getHistoDirectory();

Expand Down Expand Up @@ -49,8 +49,8 @@ void TrigScintHitDQM::configure(framework::config::Parameters &ps) {
hitCollectionName_ = ps.getParameter<std::string>("hit_collection");
padName_ = ps.getParameter<std::string>("pad").c_str();

std::cout << "In TrigScintHitDQM::configure, got parameters "
<< hitCollectionName_ << " and " << padName_ << std::endl;
ldmx_log(debug) << "In TrigScintHitDQM::configure, got parameters "
<< hitCollectionName_ << " and " << padName_;
}

void TrigScintHitDQM::analyze(const framework::Event &event) {
Expand Down
3 changes: 3 additions & 0 deletions SimCore/include/SimCore/DetectorConstruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ class DetectorConstruction : public G4VUserDetectorConstruction {

/// interface to conditions to be passed to SDs
simcore::ConditionsInterface &conditions_interface_;

/// Enable logging
enableLogging("DetectorConstruction")
}; // DetectorConstruction
} // namespace simcore

Expand Down
3 changes: 3 additions & 0 deletions SimCore/include/SimCore/ParallelWorld.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ class ParallelWorld : public G4VUserParallelWorld {
/** The auxiliary GDML info reader. */
geo::AuxInfoReader* auxInfoReader_{nullptr};

/// Enable logging
enableLogging("ParallelWorld")

}; // ParallelWorld
} // namespace simcore

Expand Down
12 changes: 5 additions & 7 deletions SimCore/src/SimCore/DetectorConstruction.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,8 @@ void DetectorConstruction::ConstructSDandField() {
// attach to volumes
for (G4LogicalVolume* volume : *G4LogicalVolumeStore::GetInstance()) {
if (sd->isSensDet(volume)) {
std::cout << "[ DetectorConstruction ] : "
<< "Attaching " << sd->GetName() << " to "
<< volume->GetName() << std::endl;
ldmx_log(debug) << "Attaching " << sd->GetName() << " to "
<< volume->GetName();
volume->SetSensitiveDetector(sd);
}
}
Expand All @@ -149,7 +148,7 @@ void DetectorConstruction::ConstructSDandField() {
// Biasing operators were created in RunManager::setupPhysics
// which is called before G4RunManager::Initialize
// which is where this method ends up being called.
simcore::XsecBiasingOperator::Factory::get().apply([](auto bop) {
simcore::XsecBiasingOperator::Factory::get().apply([&](auto bop) {
logical_volume_tests::Test includeVolumeTest{nullptr};
if (bop->getVolumeToBias().compare("ecal") == 0) {
includeVolumeTest = &logical_volume_tests::isInEcal;
Expand All @@ -173,9 +172,8 @@ void DetectorConstruction::ConstructSDandField() {
auto volume_name = volume->GetName();
if (includeVolumeTest(volume, bop->getVolumeToBias())) {
bop->AttachTo(volume);
std::cout << "[ DetectorConstruction ]: "
<< "Attaching biasing operator " << bop->GetName()
<< " to volume " << volume->GetName() << std::endl;
ldmx_log(debug) << "Attaching biasing operator " << bop->GetName()
<< " to volume " << volume->GetName();
} // BOP attached to target or ecal
} // loop over volumes
}); // loop over biasing operators
Expand Down
4 changes: 2 additions & 2 deletions SimCore/src/SimCore/ParallelWorld.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ void ParallelWorld::ConstructSD() {

for (int index = 0; index < parallelWorldLogical->GetNoDaughters(); index++) {
G4VPhysicalVolume *physicalVol = parallelWorldLogical->GetDaughter(index);
std::cout << "[ ParallelWorld ]: Adding : " << physicalVol->GetName()
<< " to parallel world." << std::endl;
ldmx_log(debug) << "Adding : " << physicalVol->GetName()
<< " to parallel world.";
worldLogical->AddDaughter(physicalVol);
}

Expand Down

0 comments on commit d74f8cc

Please sign in to comment.