39 VrtSecInclusive::VrtSecInclusive(
const std::string&
name, ISvcLocator* pSvcLocator):
42 m_primaryVertices ( nullptr ),
46 m_fitSvc (
"Trk::TrkVKalVrtFitter", this ),
47 m_truthToTrack (
"Trk::TruthToTrack/InDetTruthToTrack" ),
48 m_trackToVertexTool (
"Reco::TrackToVertex" ),
49 m_trackToVertexIPEstimatorTool (
"Trk::TrackToVertexIPEstimator/TrackToVertexIPEstimator" ),
50 m_extrapolator (
"Trk::Extrapolator/AtlasExtrapolator" ),
51 m_vertexMapper (
"" ),
53 m_checkPatternStrategy (
"Classical" ),
56 m_tree_Vert ( nullptr ),
57 m_ntupleVars ( nullptr )
91 if (
m_fitSvc.retrieve().isFailure()) {
92 ATH_MSG_ERROR(
"initialize: Can't find Trk::TrkVKalVrtFitter");
93 return StatusCode::SUCCESS;
101 ATH_MSG_INFO(
"initialize: Cannot retrieve Trk::TruthToTrack Tool!");
102 return StatusCode::FAILURE;
110 ATH_MSG_ERROR(
"initialize: failed to retrieve trackToVertex tool ");
111 return StatusCode::SUCCESS;
118 ATH_MSG_ERROR(
"initialize: failed to retrieve trackToVertexIPEstimator tool ");
119 return StatusCode::SUCCESS;
130 ATH_MSG_ERROR(
"initialize: failed to retrieve PixelConditionsSummaryTool");
131 return StatusCode::SUCCESS;
137 ATH_MSG_ERROR(
"initialize: failed to retrieve SCTConditionsSummaryTool");
138 return StatusCode::SUCCESS;
195 std::vector<double> rbins = { 0.1, 0.3, 0.5, 1, 2, 3, 5, 7, 10, 14, 20, 28, 38, 50, 64, 80, 100, 130, 170, 220, 280, 350, 450, 600 };
196 std::vector<double>
nbins = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 20, 24, 28, 38, 50, 70, 100, 150 };
202 m_hists[
"trkSelCuts"] =
new TH1F(
"trkSelCuts",
";Cut Order;Tracks", 10, -0.5, 10-0.5 );
203 m_hists[
"selTracksDist"] =
new TH1F(
"selTracksDist",
";Selected Tracks;Events", 2000, -0.5, 2000-0.5 );
204 m_hists[
"initVertexDispD0"] =
new TH2F(
"initVertexDispD0",
";Rough d0 wrt init [mm];r [mm];Vertices", 1000, -100, 100, rbins.size()-1, &(rbins[0]) );
205 m_hists[
"initVertexDispZ0"] =
new TH2F(
"initVertexDispZ0",
";Rough z0 wrt init [mm];z [mm];Vertices", 1000, -100, 100, 100, -1000, 1000 );
206 m_hists[
"incompMonitor"] =
new TH1F(
"incompMonitor",
";Setp;Track Pairs", 10, -0.5, 10-0.5 );
207 m_hists[
"2trkVerticesDist"] =
new TH1F(
"2trkVerticesDist",
";2-track Vertices;Events", 1000, -0.5, 1000-0.5 );
208 m_hists[
"2trkChi2Dist"] =
new TH1F(
"2trkChi2Dist",
";log10(#chi^{2}/N_{dof});Entries", 100, -3, 7 );
209 m_hists[
"NtrkChi2Dist"] =
new TH1F(
"NtrkChi2Dist",
";log10(#chi^{2}/N_{dof});Entries", 100, -3, 7 );
210 m_hists[
"vPosDist"] =
new TH2F(
"vPosDist",
";r;#vec{x}*#vec{p}/p_{T} [mm]", rbins.size()-1, &(rbins[0]), 200, -1000, 1000 );
211 m_hists[
"vPosMomAngTDist"] =
new TH2F(
"vPosMomAngDistT",
";r;cos(#vec{r},#vec{p}_{T})", rbins.size()-1, &(rbins[0]), 200, -1.0, 1.0 );
212 m_hists[
"disabledCount"] =
new TH1F(
"disabledCount",
";N_{modules};Tracks", 20, -0.5, 10-0.5 );
213 m_hists[
"vertexYield"] =
new TH1F(
"vertexYield",
";Algorithm Step;Vertices",
nAlgs, -0.5,
nAlgs-0.5 );
214 m_hists[
"vertexYieldNtrk"] =
new TH2F(
"vertexYieldNtrk",
";Ntrk;Algorithm Step;Vertices", 100, 0, 100,
nAlgs, -0.5,
nAlgs-0.5 );
215 m_hists[
"vertexYieldChi2"] =
new TH2F(
"vertexYieldChi2",
";#chi^{2}/N_{dof};Algorithm Step;Vertices", 100, 0, 100,
nAlgs, -0.5,
nAlgs-0.5 );
216 m_hists[
"mergeType"] =
new TH1F(
"mergeType",
";Merge Algorithm Type;Entries", 10, -0.5, 10-0.5 );
217 m_hists[
"associateMonitor"] =
new TH1F(
"associateMonitor",
";Step;Vertices", 10, -0.5, 10-0.5 );
218 m_hists[
"shuffleMinSignif1"] =
new TH1F(
"shuffleMinSignif1",
";Min( log_{10}( Significance ) );Vertices", 100, -3, 5 );
219 m_hists[
"shuffleMinSignif2"] =
new TH1F(
"shuffleMinSignif2",
";Min( log_{10}( Significance ) );Vertices", 100, -3, 5 );
220 m_hists[
"shuffleMinSignif3"] =
new TH1F(
"shuffleMinSignif3",
";Min( log_{10}( Significance ) );Vertices", 100, -3, 5 );
221 m_hists[
"finalCutMonitor"] =
new TH1F(
"finalCutMonitor",
";Step;Vertices", 6, -0.5, 6-0.5 );
222 m_hists[
"finalVtxNtrk"] =
new TH1F(
"finalVtxNtrk",
";N_{trk};Vertices",
nbins.size()-1, &(
nbins[0]) );
223 m_hists[
"finalVtxR"] =
new TH1F(
"finalVtxR",
";r [mm];Vertices", 600, 0, 600 );
224 m_hists[
"finalVtxNtrkR"] =
new TH2F(
"finalVtxNtrkR",
";N_{trk};r [mm];Vertices",
nbins.size()-1, &(
nbins[0]), rbins.size()-1, &(rbins[0]) );
225 m_hists[
"CPUTime"] =
new TH1F(
"CPUTime",
";Step;Accum. CPU Time [s]", 10, -0.5, 10-0.5 );
226 m_hists[
"nMatchedTruths"] =
new TH2F(
"nMatchedTruths",
";Step;;r [mm];Matched truth vertices", 11, -0.5, 11-0.5, rbins.size()-1, &(rbins[0]) );
227 m_hists[
"vPosMomAngT"] =
new TH1F(
"vPosMomAngT",
";cos(#vec{r},#vec{p}_{T}", 200, -1.0, 1.0 );
228 m_hists[
"vPosMomAng3D"] =
new TH1F(
"vPosMomAng3D",
";cos(#vec{r},#vec{p})", 200, -1.0, 1.0 );
229 m_hists[
"2trkVtxDistFromPV"] =
new TH1F(
"2trkVtDistFromPV",
";2tr vertex distance from PV;Events", 100, 0, 3 );
235 ATH_CHECK( hist_root->regHist( histDir + pair.first, pair.second ) );
244 m_tree_Vert =
new TTree(
"tree_VrtSecInclusive",
"TTree of VrtSecInclusive");
261 ATH_MSG_INFO(
"initialize: Exit VrtSecInclusive::initialize()");
262 return StatusCode::SUCCESS;
272 return StatusCode::SUCCESS;
288 return StatusCode::SUCCESS;
304 return StatusCode::FAILURE;
314 return StatusCode::SUCCESS;
320 if (
sc.isFailure() ) {
323 return StatusCode::SUCCESS;
335 std::set<std::string> userContainerNamesSet;
336 for(
auto&
name : userContainerNames ) userContainerNamesSet.insert(
name );
337 if( userContainerNamesSet.size() != userContainerNames.size() ) {
338 ATH_MSG_ERROR(
" > " << __FUNCTION__ <<
": detected duplicated user-specified container name. Please check your job property" );
339 return StatusCode::FAILURE;
346 secondaryVertexContainer ->
setStore( secondaryVertexAuxContainer );
355 twoTrksVertexContainer ->
setStore( twoTrksVertexAuxContainer );
362 auto&
name = itr->first;
367 intermediateVertexContainer ->
setStore( intermediateVertexAuxContainer );
379 m_selectedTracks = std::make_unique<std::vector<const xAOD::TrackParticle*>> ( );
381 m_leptonicTracks = std::make_unique<std::vector<const xAOD::TrackParticle*>> ( );
395 if( sc.isFailure() or !
m_thePV ) {
399 return StatusCode::SUCCESS;
411 ATH_MSG_WARNING(
" > " << __FUNCTION__ <<
": some other error is detected in the track selection scope." );
414 return StatusCode::SUCCESS;
428 ATH_MSG_DEBUG(
"execute: Too few (<2) selected reco tracks. Terminated reconstruction." );
431 return StatusCode::SUCCESS;
435 ATH_MSG_INFO(
"execute: Too many selected reco tracks. Terminated reconstruction." );
438 return StatusCode::SUCCESS;
450 auto* workVerticesContainer =
new std::vector<WrkVrt>;
456 auto&
name = itr->first;
457 auto alg = itr->second;
466 auto sec = std::chrono::duration_cast<std::chrono::microseconds>( t_end - t_start ).count();
470 auto end =
std::remove_if( workVerticesContainer->begin(), workVerticesContainer->end(),
472 return ( !wrkvrt.isGood || wrkvrt.nTracksTotal() < 2 ); }
475 workVerticesContainer->erase(
end, workVerticesContainer->end() );
483 delete workVerticesContainer;
487 ATH_MSG_WARNING(
" > " << __FUNCTION__ <<
": exception detected in the vertexing scope: " <<
e.what() );
491 return StatusCode::SUCCESS;
507 return StatusCode::SUCCESS;