Skip to content

Commit

Permalink
Merge pull request #75 from EmanuelPerez/master
Browse files Browse the repository at this point in the history
Fix vertex examples
  • Loading branch information
clementhelsens authored Feb 25, 2021
2 parents 235ce48 + 3bd922f commit fd80ca7
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 10 deletions.
1 change: 1 addition & 0 deletions analyzers/dataframe/VertexFitterActs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

using namespace VertexFitterActs;
using namespace Acts::UnitLiterals;
using namespace ReconstructedParticle2Track;


VertexingUtils::FCCAnalysesVertex VertexFitterActs::VertexFitterFullBilloir(ROOT::VecOps::RVec<edm4hep::ReconstructedParticleData> recoparticles,
Expand Down
3 changes: 3 additions & 0 deletions analyzers/dataframe/VertexFitterSimple.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

using namespace VertexFitterSimple;

using namespace ReconstructedParticle2Track;




TVector3 VertexFitterSimple::ParToP(TVectorD Par){
Expand Down
5 changes: 3 additions & 2 deletions examples/FCCee/vertex/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@


#
# Example file : /eos/experiment/fcc/ee/examples/p8_ecm91GeV_Zuds_IDEAtrkCov.root
# Example file :
# /eos/experiment/fcc/ee/examples/lowerTriangle/p8_ecm91GeV_Zuds_IDEAtrkCov.root
# ( these events were generated at (0,0,0) i.e. no vertex smearing
#

Expand All @@ -42,7 +43,7 @@ def run(self):
.Define("MC_PrimaryVertex", "MCParticle::get_EventPrimaryVertex(21)( Particle )" )

# number of tracks
.Define("ntracks","getTK_n(EFlowTrack_1)")
.Define("ntracks","ReconstructedParticle2Track::getTK_n(EFlowTrack_1)")

# Select tracks with d0 and z0 significance < 3 sigmas
# note: d0 and z0 are defined w.r.t. (0,0,0)
Expand Down
7 changes: 4 additions & 3 deletions examples/FCCee/vertex/analysis_acts.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
ROOT.gErrorIgnoreLevel = ROOT.kFatal
_edm = ROOT.edm4hep.ReconstructedParticleData()
_pod = ROOT.podio.ObjectID()
_fcc = ROOT.dummyloader
_fcc = ROOT.dummyLoader

print ('edm4hep ',_edm)
print ('podio ',_pod)
Expand Down Expand Up @@ -43,14 +43,15 @@ def run(self):
.Define("MC_PrimaryVertex", "MCParticle::get_EventPrimaryVertex(21)( Particle )" )

# number of tracks
.Define("ntracks","Vertexing::get_nTracks(EFlowTrack_1)")
#.Define("ntracks","Vertexing::get_nTracks(EFlowTrack_1)")
.Define("ntracks","ReconstructedParticle2Track::getTK_n(EFlowTrack_1)")

# Select tracks with d0 and z0 significance < 3 sigmas
# note: d0 and z0 are defined w.r.t. (0,0,0)
# hence do not use such criteria to select primary tracks
# if the events were generated with a vertex distribution
.Define("VertexObject","VertexingACTS::VertexFinder( EFlowTrack_1)")
.Define("Vertex", "Vertexing::get_VertexData( VertexObject )") # primary vertex, in mm
.Define("Vertex", "VertexingUtils::get_VertexData( VertexObject )") # primary vertex, in mm

#.Define("nSeltracks", "getRP_n(SelTracks)")
# Reconstruct the vertex from these tracks :
Expand Down
5 changes: 4 additions & 1 deletion examples/FCCee/vertex/validation_tkCovariance_plots.x
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{

gROOT->Reset();

//
// Validation of the off-diagonal terms of the covariance matrix
Expand Down Expand Up @@ -174,7 +177,7 @@ evts->Draw("RP_TRK_z0_tanlambda_cov / ( TMath::Sqrt(RP_TRK_Z0_cov) * TMath::Sqr
c1->SaveAs("validation_Cov_z0_tanlambda.pdf");



}



Expand Down
8 changes: 7 additions & 1 deletion examples/FCCee/vertex/validation_tkParam.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ROOT.gErrorIgnoreLevel = ROOT.kFatal
_edm = ROOT.edm4hep.ReconstructedParticleData()
_pod = ROOT.podio.ObjectID()
_fcc = ROOT.dummyloader
_fcc = ROOT.dummyLoader


print ('edm4hep ',_edm)
Expand All @@ -18,6 +18,12 @@
#ROOT.ROOT.EnableThreadSafety()
#ROOT.ROOT.EnableImplicitMT(1)
#ROOT.TTree.SetMaxTreeSize(100000000000)

#
# Example file:
# /eos/experiment/fcc/ee/examples/lowerTriangle/dummy_zmumu_for_covMat_events_IFSROFF.root
#

class analysis():

#__________________________________________________________
Expand Down
4 changes: 4 additions & 0 deletions examples/FCCee/vertex/validation_tkParam_plots.x
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{

gROOT->Reset();

TFile* f = new TFile("p8_Zmumu.root");
TTree* events = (TTree*)f->Get("events");
Expand Down Expand Up @@ -50,3 +53,4 @@ events->Draw(" ( TMath::Abs(RP_TRK_omega) - 1e-3*0.3*2*(1./RP_MC_tlv.Pt()) ) / T
// sigma = 1, OK


}
7 changes: 4 additions & 3 deletions examples/FCCee/vertex/vertex_plots.x
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
gROOT->Reset();

// processed :
// /eos/experiment/fcc/ee/generation/DelphesEvents/fcc_tmp/p8_ee_Zuds_ecm91/events_199980034.root
// /eos/experiment/fcc/ee/examples/lowerTriangle/p8_ecm91GeV_Zuds_IDEAtrkCov.root

TFile* f = new TFile("events_199980034.root");

TFile* f = new TFile("p8_ecm91GeV_Zuds_IDEAtrkCov.root") ;
TTree* events = (TTree*)f->Get("events");

//TString vtx = "Vertex"; // tracks selected based on d0 & z0 significance
Expand Down Expand Up @@ -56,7 +57,7 @@ events -> Draw( " ("+vtx+".position.x - MC_PrimaryVertex.x()) / TMath::Sqrt( "+v
px->Fit("gaus");

TH1F* py = new TH1F("py","; Pull y_{vtx}; Events",100,-5,5);
events -> Draw( "("+vtx+".position.y - MC_PrimaryVertex.y()) / TMath::Sqrt( "+vtx+".covMatrix[3] ) >> py",cut);
events -> Draw( "("+vtx+".position.y - MC_PrimaryVertex.y()) / TMath::Sqrt( "+vtx+".covMatrix[2] ) >> py",cut);
py->Fit("gaus");

TH1F* pz = new TH1F("pz","; Pull z_{vtx}; Events",100,-5,5);
Expand Down

0 comments on commit fd80ca7

Please sign in to comment.