-
Notifications
You must be signed in to change notification settings - Fork 6
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
Re-add get1DVarHist back into samplePDFFDBase #172
Conversation
Hi @dbarrow257, thank you for contributing to MaCh3! Please wait for MaCh3 developers to review your PR. If no one answers within a week, please message people from this list: https://github.com/orgs/mach3-software/teams/mach3admin . While waiting, please enjoy this Use this action on your projects. Use jokes on issues instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is your first PR, thank you for contributing to MaCh3!
@@ -7,7 +7,8 @@ struct fdmc_base { | |||
int nupdg; | |||
int nupdgUnosc; | |||
bool signal; // true if signue | |||
int nEvents; // how many MC events are there | |||
int nEvents; // how many MC events are there | |||
double ChannelIndex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is ChannelIndex
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In FD code, there is the concept of oscillation channels. Each oscillation channel has an associated FDMCStruct object. These channels' indexing depends entirely on the ordering defined in the sample YAML.
If you want to loop over each oscillation channel and make an event rate breakdown by oscChan, you need some way to select events in oscillationChannel j (j=6, for example). To do this from ReturnKinematicParameter, we need to store the index of the oscillation channel somewhere in it's memory, thus ChannelIndex.
You can get name of the j'th oscillationChannel index from FDMCStruct.flavourName
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In DUNE code for example:
const double* samplePDFDUNEAtm::GetPointerToKinematicParameter(KinematicTypes KinPar, int iSample, int iEvent) {
double* KinematicValue;
switch (KinPar) {
case kTrueNeutrinoEnergy:
KinematicValue = &(dunemcSamples[iSample].rw_etru[iEvent]);
break;
case kRecoNeutrinoEnergy:
KinematicValue = &(dunemcSamples[iSample].rw_erec[iEvent]);
break;
case kTrueCosZ:
KinematicValue = &(dunemcSamples[iSample].rw_truecz[iEvent]);
break;
case kRecoCosZ:
KinematicValue = &(dunemcSamples[iSample].rw_theta[iEvent]);
break;
case kOscChannel:
KinematicValue = &(MCSamples[iSample].ChannelIndex);
break;
case kMode:
KinematicValue = MCSamples[iSample].mode[iEvent];
break;
default:
MACH3LOG_ERROR("Unknown KinPar: {}",KinPar);
throw MaCh3Exception(__FILE__, __LINE__);
}
return KinematicValue;
}
Pull request description
During the previous merge, get1DVarHist was dropped. This was likely because of getting interaction mode information back from the ReturnKinematicVariable[ByReference] as it returns a double and mode was defined as an integer. Add this function back in whilst also defining the getNSamples and getNMCEvent functions.
Changes or fixes
Examples