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

Use IsMaster() in BeginOfRunAction #55

Merged
merged 2 commits into from
Sep 4, 2023
Merged
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
24 changes: 12 additions & 12 deletions src/ATLTileCalTBRunAction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,6 @@ ATLTileCalTBRunAction::ATLTileCalTBRunAction( ATLTileCalTBEventAction* eventActi
//
auto analysisManager = G4AnalysisManager::Instance();

//Print useful information
//
if (IsMaster()) {
G4cout << "Using " << analysisManager->GetType() << G4endl;
#ifdef ATLTileCalTB_PulseOutput
G4cout << "Creating pulse plots" << G4endl;
#endif
#ifdef ATLTileCalTB_NoNoise
G4cout << "Electronic noise disabled" << G4endl;
#endif
}

analysisManager->SetVerboseLevel(1);
analysisManager->SetNtupleMerging(true);

Expand Down Expand Up @@ -102,6 +90,18 @@ void ATLTileCalTBRunAction::BeginOfRunAction(const G4Run* run) {
G4String fileName = "ATLTileCalTBout_Run" + runnumber + ".root";
analysisManager->OpenFile(fileName);

//Print useful information
//
if (IsMaster()) {
G4cout << "Using " << analysisManager->GetType() << G4endl;
#ifdef ATLTileCalTB_PulseOutput
G4cout << "Creating pulse plots" << G4endl;
#endif
#ifdef ATLTileCalTB_NoNoise
G4cout << "Electronic noise disabled" << G4endl;
#endif
}

auto pulse_run_path = std::filesystem::path("ATLTileCalTBpulse_Run" + runnumber);
std::filesystem::remove_all(pulse_run_path);
#ifdef ATLTileCalTB_PulseOutput
Expand Down