diff --git a/analyzers/dataframe/VertexFitterActs.cc b/analyzers/dataframe/VertexFitterActs.cc index 322741fcd7..d88451a8d2 100644 --- a/analyzers/dataframe/VertexFitterActs.cc +++ b/analyzers/dataframe/VertexFitterActs.cc @@ -18,7 +18,6 @@ using namespace VertexFitterActs; using namespace Acts::UnitLiterals; -using namespace ReconstructedParticle2Track; VertexingUtils::FCCAnalysesVertex VertexFitterActs::VertexFitterFullBilloir(ROOT::VecOps::RVec recoparticles, @@ -134,18 +133,6 @@ VertexingUtils::FCCAnalysesVertex VertexFitterActs::VertexFitterFullBilloir(ROOT tracksPtr.push_back(&trk); } - - Acts::Vertex fittedVertex = - billoirFitter.fit(tracksPtr, linearizer, vfOptions, state).value(); - //Acts::Vertex fittedVertexConstraint = - // billoirFitter.fit(tracksPtr, linearizer, vfOptionsConstr, state).value(); - - - //std::cout << "Fitting nTracks: " << Ntr << std::endl; - // std::cout << "Fitted Vertex: " << fittedVertex.position() << std::endl; - // std::cout << "Fitted constraint Vertex: " - // << fittedVertexConstraint.position() << std::endl; - VertexingUtils::FCCAnalysesVertex TheVertex; edm4hep::VertexData edm4hep_vertex; ROOT::VecOps::RVec reco_chi2; @@ -162,6 +149,23 @@ VertexingUtils::FCCAnalysesVertex VertexFitterActs::VertexFitterFullBilloir(ROOT TheVertex.updated_track_momentum_at_vertex = updated_track_momentum_at_vertex; + TheVertex.ntracks = Ntr; + if ( Ntr <= 1) return TheVertex; // can not reconstruct a vertex with only one track... + + + Acts::Vertex fittedVertex = + billoirFitter.fit(tracksPtr, linearizer, vfOptions, state).value(); + //Acts::Vertex fittedVertexConstraint = + // billoirFitter.fit(tracksPtr, linearizer, vfOptionsConstr, state).value(); + + + //std::cout << "Fitting nTracks: " << Ntr << std::endl; + // std::cout << "Fitted Vertex: " << fittedVertex.position() << std::endl; + // std::cout << "Fitted constraint Vertex: " + // << fittedVertexConstraint.position() << std::endl; + + + TheVertex.ntracks = Ntr; edm4hep_vertex.chi2 = fittedVertex.fitQuality().first/ fittedVertex.fitQuality().second ; edm4hep_vertex.position = edm4hep::Vector3f( fittedVertex.position()[0], diff --git a/analyzers/dataframe/VertexFitterSimple.cc b/analyzers/dataframe/VertexFitterSimple.cc index 050813d5aa..c518dbacc2 100644 --- a/analyzers/dataframe/VertexFitterSimple.cc +++ b/analyzers/dataframe/VertexFitterSimple.cc @@ -7,8 +7,6 @@ using namespace VertexFitterSimple; -using namespace ReconstructedParticle2Track; - diff --git a/examples/FCCee/vertex/analysis.py b/examples/FCCee/vertex/analysis.py index 9f0a38da39..2ff9829186 100644 --- a/examples/FCCee/vertex/analysis.py +++ b/examples/FCCee/vertex/analysis.py @@ -30,14 +30,14 @@ def __init__(self, inputlist, outname, ncpu): if ".root" not in outname: self.outname+=".root" - #ROOT.ROOT.EnableImplicitMT(ncpu) + ROOT.ROOT.EnableImplicitMT(ncpu) self.df = ROOT.RDataFrame("events", inputlist) print (" done") #__________________________________________________________ def run(self): - df2 = (self.df.Range(0,5000) - #df2 = (self.df + #df2 = (self.df.Range(0,5000) + df2 = (self.df # MC event primary vertex .Define("MC_PrimaryVertex", "MCParticle::get_EventPrimaryVertex(21)( Particle )" ) @@ -117,7 +117,7 @@ def run(self): import os os.system("mkdir -p {}".format(outDir)) outfile = outDir+infile.split('/')[-1] - ncpus = 1 + ncpus = 0 analysis = analysis(infile, outfile, ncpus) analysis.run()