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

Added jets_TwoHemispheres to Algorithms. #241

Merged
merged 2 commits into from
Feb 23, 2023

Conversation

EmanuelPerez
Copy link
Contributor

@EmanuelPerez EmanuelPerez commented Feb 20, 2023

It splits an event in two hemispheres based on the thrust axis, and gathers together all reco'ed particles that belong to each hemisphere into a "jet", in the format of JetClustering::FCCAnalysesJet, such that algorithms (e.g. tagging) developed on JetClustering::FCCAnalysesJet's can be used.

On Z -> had events, the resulting jets are very similar to jets from Durham exclusive, N = 2, although a few particles occasionnaly get clustered differently in the two approaches.

Example usage:

        ~~.Define("FCCAnalysesJets_hemispheres",  "Algorithms::jets_TwoHemispheres( 1, 0) ( ReconstructedParticles )")~~

    .Define("RP_px", "ReconstructedParticle::get_px(ReconstructedParticles) ")
    .Define("RP_py", "ReconstructedParticle::get_py(ReconstructedParticles) ")
    .Define("RP_pz", "ReconstructedParticle::get_pz(ReconstructedParticles) ")
    .Define("RP_e", "ReconstructedParticle::get_e(ReconstructedParticles) ")

    .Define("thrust",  'Algorithms::minimize_thrust("Minuit2","Migrad")(RP_px, RP_py, RP_pz)')
    .Define("RP_costheta",  "Algorithms::getAxisCosTheta( thrust, RP_px, RP_py, RP_pz)" )

    .Define("FCCAnalysesJets_hemispheres",  "Algorithms::jets_TwoHemispheres( 1, 0) ( RP_px, RP_py, RP_pz, RP_e, RP_costheta )")

        .Define("jets_hemispheres", "JetClusteringUtils::get_pseudoJets( FCCAnalysesJets_hemispheres )")
        .Define("jets_hemispheres_px",  " JetClusteringUtils::get_px( jets_hemispheres )")

It splits an event in two hemispheres based on the thrust axis, and gathers together all reco'ed particles
that belong to each hemisphere into a "jet", in the format of JetClustering::FCCAnalysesJet, such
that algorithms (e.g. tagging) developed on JetClustering::FCCAnalysesJet's can be used.

On Z -> had events, the resulting jets are very similar to jets from Durham exclusive, N = 2, although
a few particles occasionnaly get clustered differently in the two approaches.

Example usage:
            .Define("FCCAnalysesJets_hemispheres",  "Algorithms::jets_TwoHemispheres( 1, 0) ( ReconstructedParticles )")
            .Define("jets_hemispheres", "JetClusteringUtils::get_pseudoJets( FCCAnalysesJets_hemispheres )")
            .Define("jets_hemispheres_px",  " JetClusteringUtils::get_px( jets_hemispheres )")
@@ -6,6 +6,9 @@

#include "edm4hep/ReconstructedParticleData.h"

#include "FCCAnalyses/JetClusteringUtils.h"
#include "FCCAnalyses/ReconstructedParticle.h"

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you move those includes to the .cc file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I've updated the implementation. I still need JetClustering.h, though.


ROOT::VecOps::RVec<float> mt = minimize_thrust("Minuit2","Migrad")(RP_px, RP_py, RP_pz) ;
ROOT::VecOps::RVec<float> costheta = getAxisCosTheta( mt, RP_px, RP_py, RP_pz) ;

Copy link
Contributor

Choose a reason for hiding this comment

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

These should be inputs to the function. Maybe then the additional includes won't be needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had chosen the implementation that maximally hides the complexity to the user. But OK, I have updated the implementation along the lines you suggested.

Here is the new usage:

        .Define("RP_px", "ReconstructedParticle::get_px(ReconstructedParticles) ")
        .Define("RP_py", "ReconstructedParticle::get_py(ReconstructedParticles) ")
        .Define("RP_pz", "ReconstructedParticle::get_pz(ReconstructedParticles) ")
        .Define("RP_e", "ReconstructedParticle::get_e(ReconstructedParticles) ")

        .Define("thrust",  'Algorithms::minimize_thrust("Minuit2","Migrad")(RP_px, RP_py, RP_pz)')
        .Define("RP_costheta",  "Algorithms::getAxisCosTheta( thrust, RP_px, RP_py, RP_pz)" )

        .Define("FCCAnalysesJets_hemispheres",  "Algorithms::jets_TwoHemispheres( 1, 0) ( RP_px, RP_py, RP_pz, RP_e, RP_costheta )")

@kjvbrt
Copy link
Contributor

kjvbrt commented Feb 23, 2023

looks good to me :)

@kjvbrt kjvbrt merged commit da3f531 into HEP-FCC:master Feb 23, 2023
@EmanuelPerez EmanuelPerez deleted the jets_hemisphere branch February 23, 2023 13:14
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.

None yet

2 participants