Skip to content

Commit d37d464

Browse files
authored
Updating analysis_V0 example to use latest EDM4hep (#495)
1 parent 763cb48 commit d37d464

File tree

3 files changed

+53
-38
lines changed

3 files changed

+53
-38
lines changed

analyzers/dataframe/FCCAnalyses/LinkDef.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,13 @@
4242
#pragma link C++ class std::vector<std::vector<float>>+;
4343
#pragma link C++ class std::vector<std::vector<double>>+;
4444

45+
#pragma link C++ class FCCAnalyses::VertexingUtils::FCCAnalysesVertex+;
4546
#pragma link C++ class ROOT::VecOps::RVec<FCCAnalyses::VertexingUtils::FCCAnalysesVertex>+;
47+
#pragma link C++ class std::vector<FCCAnalyses::VertexingUtils::FCCAnalysesVertex>+;
4648
#pragma link C++ class ROOT::VecOps::RVec<ROOT::VecOps::RVec<FCCAnalyses::VertexingUtils::FCCAnalysesVertex>>+;
49+
#pragma link C++ class FCCAnalyses::VertexingUtils::FCCAnalysesV0+;
50+
#pragma link C++ class ROOT::VecOps::RVec<FCCAnalyses::VertexingUtils::FCCAnalysesV0>+;
51+
#pragma link C++ class std::vector<FCCAnalyses::VertexingUtils::FCCAnalysesV0>+;
4752

4853
// To load all functions
4954
#pragma link C++ function dummyLoader;

analyzers/dataframe/FCCAnalyses/VertexingUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ namespace VertexingUtils{
5353
ROOT::VecOps::RVec<double> invM; // invariant mass
5454
ROOT::VecOps::RVec<int> nSV_jet; // no of V0s per jet
5555
};
56-
56+
5757
/// Structure to keep useful track information that is related to the vertex
5858
struct FCCAnalysesVertexMC{
5959
TVector3 vertex;

examples/FCCee/vertex_lcfiplus/analysis_V0.py

Lines changed: 47 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
testFile="root://eospublic.cern.ch//eos/experiment/fcc/ee/generation/DelphesEvents/winter2023/IDEA/p8_ee_Zbb_ecm91/events_066726720.root"
1+
testFile = 'https://fccsw.web.cern.ch/fccsw/analysis/' \
2+
'test-samples/edm4hep099/p8_ee_Zbb_ecm91_edm4hep.root'
23

34
#Mandatory: List of processes
45
processList = {
@@ -31,56 +32,65 @@ class RDFanalysis():
3132
def analysers(df):
3233
df2 = (
3334
df
34-
.Alias("Particle1", "Particle#1.index")
35-
36-
# get all the MC particles to check for Ks
35+
.Alias("Particle1", "_Particle_daughters.index")
36+
37+
# get all the MC particles to check for Ks
3738
.Define("MC_pdg", "FCCAnalyses::MCParticle::get_pdg(Particle)")
38-
# get momenta & mass of all particles
39+
# get momenta & mass of all particles
3940
.Define("MC_p4", "FCCAnalyses::MCParticle::get_tlv(Particle)")
4041
.Define("MC_mass", "FCCAnalyses::MCParticle::get_mass(Particle)")
41-
42-
# Ks -> pi+pi-
43-
.Define("K0spipi_indices", "FCCAnalyses::MCParticle::get_indices_ExclusiveDecay(310, {211, -211}, true, true) (Particle, Particle1)")
44-
# Lambda0 -> p+pi-
45-
.Define("Lambda0ppi_indices", "FCCAnalyses::MCParticle::get_indices_ExclusiveDecay(3122, {2212, -211}, true, true) (Particle, Particle1)")
46-
47-
# determime the primary (and secondary) tracks without using the MC-matching:
48-
49-
# Select the tracks that are reconstructed as primaries
50-
.Define("RecoedPrimaryTracks", "VertexFitterSimple::get_PrimaryTracks( EFlowTrack_1, true, 4.5, 20e-3, 300, 0., 0., 0.)")
51-
52-
.Define("n_RecoedPrimaryTracks", "ReconstructedParticle2Track::getTK_n( RecoedPrimaryTracks )")
53-
# the final primary vertex :
54-
.Define("PrimaryVertexObject", "VertexFitterSimple::VertexFitter_Tk ( 1, RecoedPrimaryTracks, true, 4.5, 20e-3, 300) ")
55-
.Define("PrimaryVertex", "VertexingUtils::get_VertexData( PrimaryVertexObject )")
56-
57-
# the secondary tracks
58-
.Define("SecondaryTracks", "VertexFitterSimple::get_NonPrimaryTracks( EFlowTrack_1, RecoedPrimaryTracks )")
59-
.Define("n_SecondaryTracks", "ReconstructedParticle2Track::getTK_n( SecondaryTracks )" )
60-
61-
# which of the tracks are primary according to the reco algprithm
62-
.Define("IsPrimary_based_on_reco", "VertexFitterSimple::IsPrimary_forTracks( EFlowTrack_1, RecoedPrimaryTracks )")
42+
43+
# Ks -> pi+pi-
44+
.Define("K0spipi_indices",
45+
"FCCAnalyses::MCParticle::get_indices_ExclusiveDecay(310, {211, -211}, true, true) (Particle, Particle1)")
46+
# Lambda0 -> p+pi-
47+
.Define("Lambda0ppi_indices",
48+
"FCCAnalyses::MCParticle::get_indices_ExclusiveDecay(3122, {2212, -211}, true, true) (Particle, Particle1)")
49+
50+
# determime the primary (and secondary) tracks without using the MC-matching:
51+
52+
# Select the tracks that are reconstructed as primaries
53+
.Define("RecoedPrimaryTracks",
54+
"VertexFitterSimple::get_PrimaryTracks(_EFlowTrack_trackStates, true, 4.5, 20e-3, 300, 0., 0., 0.)")
55+
56+
.Define("n_RecoedPrimaryTracks",
57+
"ReconstructedParticle2Track::getTK_n(RecoedPrimaryTracks)")
58+
# the final primary vertex:
59+
.Define("PrimaryVertexObject",
60+
"VertexFitterSimple::VertexFitter_Tk(1, RecoedPrimaryTracks, true, 4.5, 20e-3, 300)")
61+
.Define("PrimaryVertex",
62+
"VertexingUtils::get_VertexData(PrimaryVertexObject)")
63+
64+
# the secondary tracks
65+
.Define("SecondaryTracks",
66+
"VertexFitterSimple::get_NonPrimaryTracks(_EFlowTrack_trackStates, RecoedPrimaryTracks)")
67+
.Define("n_SecondaryTracks",
68+
"ReconstructedParticle2Track::getTK_n(SecondaryTracks)")
69+
70+
# which of the tracks are primary according to the reco algprithm
71+
.Define("IsPrimary_based_on_reco",
72+
"VertexFitterSimple::IsPrimary_forTracks(_EFlowTrack_trackStates, RecoedPrimaryTracks)")
6373

6474
# jet clustering
65-
.Define("RP_px", "ReconstructedParticle::get_px(ReconstructedParticles)")
66-
.Define("RP_py", "ReconstructedParticle::get_py(ReconstructedParticles)")
67-
.Define("RP_pz", "ReconstructedParticle::get_pz(ReconstructedParticles)")
68-
.Define("RP_m", "ReconstructedParticle::get_mass(ReconstructedParticles)")
75+
.Define("RP_px", "ReconstructedParticle::get_px(ReconstructedParticles)")
76+
.Define("RP_py", "ReconstructedParticle::get_py(ReconstructedParticles)")
77+
.Define("RP_pz", "ReconstructedParticle::get_pz(ReconstructedParticles)")
78+
.Define("RP_m", "ReconstructedParticle::get_mass(ReconstructedParticles)")
6979
# build psedo-jets with the Reconstructed final particles
70-
.Define("pseudo_jets", "JetClusteringUtils::set_pseudoJets_xyzm(RP_px, RP_py, RP_pz, RP_m)")
80+
.Define("pseudo_jets", "JetClusteringUtils::set_pseudoJets_xyzm(RP_px, RP_py, RP_pz, RP_m)")
7181
# run jet clustering with all reco particles. ee_kt_algorithm, exclusive clustering, exactly 2 jets, E-scheme
7282
.Define("FCCAnalysesJets_ee_kt", "JetClustering::clustering_ee_kt(2, 2, 1, 0)(pseudo_jets)")
7383
# get the jets out of the structure
7484
.Define("jets_ee_kt", "JetClusteringUtils::get_pseudoJets(FCCAnalysesJets_ee_kt)")
7585
# get the jet constituents out of the structure
7686
.Define("jetconstituents", "JetClusteringUtils::get_constituents(FCCAnalysesJets_ee_kt)")
7787

78-
7988
# find V0s
8089
#.Define("V0_evt", "VertexFinderLCFIPlus::get_V0s(SecondaryTracks, PrimaryVertexObject, true)")
81-
.Define("V0", "VertexFinderLCFIPlus::get_V0s_jet(ReconstructedParticles, EFlowTrack_1, IsPrimary_based_on_reco, jets_ee_kt, jetconstituents, PrimaryVertexObject)")
90+
.Define("V0",
91+
"VertexFinderLCFIPlus::get_V0s_jet(ReconstructedParticles, _EFlowTrack_trackStates, IsPrimary_based_on_reco, jets_ee_kt, jetconstituents, PrimaryVertexObject)")
8292
.Define("V0_jet", "VertexingUtils::get_svInJets(V0.vtx, V0.nSV_jet)")
83-
# get pdg vector out
93+
# get pdg vector out
8494
#.Define("V0_pdg", "VertexingUtils::get_pdg_V0(V0)")
8595
.Define("V0_pdg", "VertexingUtils::get_pdg_V0(V0.pdgAbs, V0.nSV_jet)")
8696
# get invariant mass vector out
@@ -119,11 +129,11 @@ def output():
119129
# Ks -> pi+pi- & Lambda0->p+pi-
120130
"K0spipi_indices",
121131
"Lambda0ppi_indices",
122-
132+
123133
# primary vertex and primary tracks w/o any MC-matching :
124134
"IsPrimary_based_on_reco",
125135
"PrimaryVertex",
126-
136+
127137
# V0 object
128138
"V0",
129139
"V0_jet",

0 commit comments

Comments
 (0)