Skip to content
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
17 changes: 15 additions & 2 deletions SamplesTutorial/SampleHandlerTutorial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,17 @@ SampleHandlerTutorial::~SampleHandlerTutorial() {
void SampleHandlerTutorial::Init() {
// ************************************************
if (CheckNodeExists(SampleManager->raw(), "POT")) {
pot = SampleManager->raw()["POT"].as<double>();
M3::float_t pot = SampleManager->raw()["POT"].as<M3::float_t>();
// HW: Nominal POT, taken from the default YAML
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wuseless-cast"

const M3::float_t nominal_pot = static_cast<M3::float_t>(2.1428e+21);

#pragma GCC diagnostic pop
pot_w = pot / nominal_pot;


} else{
MACH3LOG_ERROR("POT not defined in {}, please add this!", SampleManager->GetFileName());
throw MaCh3Exception(__FILE__, __LINE__);
Expand Down Expand Up @@ -86,6 +96,9 @@ void SampleHandlerTutorial::SetupSplines() {
// ************************************************
void SampleHandlerTutorial::AddAdditionalWeightPointers() {
// ************************************************
for (size_t i = 0; i < TutorialSamples.size(); ++i) {
MCEvents[i].total_weight_pointers.push_back(&(pot_w));
}

}

Expand Down Expand Up @@ -356,4 +369,4 @@ void SampleHandlerTutorial::SetupMC() {
MCEvents[iEvent].NominalSample = TutorialSamples[iEvent].Sample;
if(isATM) MCEvents[iEvent].coszenith_true = TutorialSamples[iEvent].TrueCosZenith;
}
}
}
2 changes: 1 addition & 1 deletion SamplesTutorial/SampleHandlerTutorial.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class SampleHandlerTutorial : public SampleHandlerBase
};
// =============================================

double pot;
M3::float_t pot_w;
bool isATM;

// === HH: Functional parameters ===
Expand Down
Loading