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

Dev/d meson #74

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Conversation

MiaochenJin
Copy link

No description provided.

Copy link
Collaborator

@nickkamp1 nickkamp1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, just need to remove some debug printouts and a few files that are used for analysis of d meson events. I will merge after testing this locally, but @austinschneider feel free to take a look and leave comments if you would like

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nickkamp1 be sure to update this when you merge your HNL branch

projects/injection/private/Injector.cxx Show resolved Hide resolved
projects/injection/private/Weighter.cxx Outdated Show resolved Hide resolved
projects/interactions/private/CharmDISFromSpline.cxx Outdated Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nickkamp1 update with the HNL PR

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nickkamp1 verify that SaveWeighter works

resources/Examples/DMesonExample/make_plots.py Outdated Show resolved Hide resolved
resources/Examples/DMesonExample/paper.mplstyle Outdated Show resolved Hide resolved
resources/Examples/DMesonExample/parse_output.py Outdated Show resolved Hide resolved
@MiaochenJin MiaochenJin requested a review from nickkamp1 August 22, 2024 21:48
@MiaochenJin
Copy link
Author

Made changes! made request of new round of review, please check if the changes are made

@austinschneider
Copy link
Collaborator

I'm starting to take a look now. I'll provide detailed comments sometime today :)

@austinschneider
Copy link
Collaborator

It is not clear to me that we need this Hadronization class or any of the specialized logic for hadronization that has been added to other classes.

In the way that it has been implemented here, can't the hadronization process just be implemented as a new decay process with decay_length=0?

@austinschneider
Copy link
Collaborator

Regardless of if we keep the Hadronization class and the related pieces, it seems odd to me that the way these hadronization checks/cases are coded is such that it short circuits most of the existing logic. It seems that this has been written with the expectation that if an injection contains a hadronization process at all that the rest of the interactions should be ignored. Whatever solution we land on it should integrate with the rest of the interaction logic without short-circuiting things.

@@ -683,7 +683,7 @@ double DetectorModel::GetInteractionDensity(Geometry::IntersectionList const & i
std::vector<double> const & total_cross_sections,
double const & total_decay_length) const {
Vector3D direction = p0 - intersections.position;
if(direction.magnitude() == 0) {
if(direction.magnitude() == 0 || direction.magnitude() <= 1e-5) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(direction.magnitude() == 0 || direction.magnitude() <= 1e-5) {
// Check that direction is approximately zero
if(direction.magnitude() <= 1e-5) {

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a specific issue that the distance.magnitude() <= 1e-5 checks fixed?

I'm wondering if there is another underlying issue that this is covering up, or if we really need this fix.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the direction.magnitude() <= 1e-5 checks, you should put the 1e-5 constant into the projects/detector/public/SIREN/detector/DetectorModel.h header

class DetectorModel {
public:
    constexpr static double distance_threshold = 1e-5;

and then use this constant to perform the checks in the .cxx file.

Comment on lines 987 to +993
if(distance == 0.0) {
return 0.0;
}
if(direction.magnitude() <= 1e-5) {
direction = intersections.direction;
// return 1e-05; // I have to do this to ensure that it works
}
Copy link
Collaborator

@austinschneider austinschneider Aug 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(distance == 0.0) {
return 0.0;
}
if(direction.magnitude() <= 1e-5) {
direction = intersections.direction;
// return 1e-05; // I have to do this to ensure that it works
}
if(direction.magnitude() <= 1e-5) {
return 0.0;
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding special login in this class checks for a hadronization interaction to change the class behavior, you should implement a new secondary vertex distribution that has the appropriate behavior for hadronization.

@@ -12,6 +12,8 @@
#include "SIREN/interactions/DarkNewsCrossSection.h"
#include "SIREN/interactions/InteractionCollection.h"
#include "SIREN/interactions/Decay.h"
#include "SIREN/interactions/Hadronization.h"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@@ -22,6 +22,8 @@

#include "SIREN/interactions/CrossSection.h"
#include "SIREN/interactions/Decay.h"
#include "SIREN/interactions/Hadronization.h"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@@ -23,6 +23,8 @@
#include "SIREN/interactions/InteractionCollection.h"
#include "SIREN/interactions/CrossSection.h"
#include "SIREN/interactions/Decay.h"
#include "SIREN/interactions/Hadronization.h"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@@ -23,6 +23,8 @@
#include "SIREN/interactions/InteractionCollection.h"
#include "SIREN/interactions/CrossSection.h"
#include "SIREN/interactions/Decay.h"
#include "SIREN/interactions/Hadronization.h"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@@ -21,6 +21,8 @@
#include "SIREN/interactions/InteractionCollection.h"
#include "SIREN/interactions/CrossSection.h"
#include "SIREN/interactions/Decay.h"
#include "SIREN/interactions/Hadronization.h"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants