Loading [MathJax]/jax/output/SVG/config.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
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;
302 if (!eventInfo.isValid()) {
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 );
395 if( sc.isFailure() or !
m_thePV ) {
399 return StatusCode::SUCCESS;
416 ATH_MSG_DEBUG(
"execute: Too few (<2) selected reco tracks. Terminated reconstruction." );
420 return StatusCode::SUCCESS;
424 ATH_MSG_INFO(
"execute: Too many selected reco tracks. Terminated reconstruction." );
428 return StatusCode::SUCCESS;
440 std::vector<WrkVrt> workVerticesContainer;
446 auto&
name = itr->first;
447 auto alg = itr->second;
456 auto sec = std::chrono::duration_cast<std::chrono::microseconds>( t_end - t_start ).count();
485 return StatusCode::SUCCESS;
494 if (onlySelection)
return;
504 cont_nc->lockDecoration (
p.second.auxid());
512 if (dec.isAvailable (*cont)) {
541 if (
const xAOD::TrackParticle* trk = muon->trackParticle( xAOD::Muon::InnerDetectorTrackParticle ) ) {
555 if( electron->nTrackParticles() > 0 ) {
564 for(
const auto *trk : *IDtracks ) {
568 return StatusCode::SUCCESS;
bool doSelectTracksFromMuons
def retrieve(aClass, aKey=None)
virtual void setStore(SG::IAuxStore *store) override
Set a different internal store object.
std::map< std::string, TH1 * > m_hists
ToolHandle< IInDetConditionsTool > m_pixelCondSummaryTool
Condition service.
bool checkTrackHitPatternToVertexOuterOnly(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
A classical method with hard-coded geometry.
ToolHandle< Trk::IVertexMapper > m_vertexMapper
unsigned m_vertexingAlgorithmStep
void dumpTruthInformation()
bool doSelectIDAndGSFTracks
StatusCode setupNtupleVariables()
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
const xAOD::Vertex * m_thePV
std::string secondaryVerticesContainerName
std::vector< std::pair< std::string, vertexingAlg > > m_vertexingAlgorithms
bool checkTrackHitPatternToVertexByExtrapolationAssist(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
New method with track extrapolation.
std::vector< const xAOD::TrackParticle * > m_leptonicTracks
PatternBank m_extrapolatedPatternBank
std::unique_ptr< NtupleVars > m_ntupleVars
ToolHandle< Trk::IExtrapolator > m_extrapolator
StatusCode associateNonSelectedTracks(std::vector< WrkVrt > *)
in addition to selected tracks, associate as much tracks as possible
const PixelID * m_pixelId
StatusCode reassembleVertices(std::vector< WrkVrt > *)
attempt to merge vertices when all tracks of a vertex A is close to vertex B in terms of impact param...
void lockDecoration(SG::auxid_t auxid)
Explicitly lock a decoration.
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
StatusCode rearrangeTracks(std::vector< WrkVrt > *)
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Read/Write Handle Keys.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
bool FillIntermediateVertices
~VrtSecInclusive()
Default Destructor.
ToolHandle< Trk::ITruthToTrack > m_truthToTrack
StatusCode selectInDetAndGSFTracks()
ToolHandle< IInDetConditionsTool > m_sctCondSummaryTool
std::string ElectronLocation
ToolHandle< Trk::ITrackToVertexIPEstimator > m_trackToVertexIPEstimatorTool
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
ToolHandle< Trk::ITrkVKalVrtFitter > m_fitSvc
Helper class to provide type-safe access to aux data.
StatusCode extractIncompatibleTrackPairs(std::vector< WrkVrt > *)
related to the graph method and verte finding
VertexAuxContainer_v1 VertexAuxContainer
Definition of the current jet auxiliary container.
StatusCode mergeByShuffling(std::vector< WrkVrt > *)
attempt to merge splitted vertices when they are significantly distant due to the long-tail behavior ...
virtual StatusCode finalize()
std::string all2trksVerticesContainerName
unsigned int SelTrkMaxCutoff
::StatusCode StatusCode
StatusCode definition for legacy code.
StatusCode processPrimaryVertices()
Handle class for adding a decoration to an object.
bool doAssociateNonSelectedTracks
Handle class for adding a decoration to an object.
void lockLeptonDecorations(const SG::AuxVectorData *cont) const
std::vector< TrackSelectionAlg > m_trackSelectionAlgs
virtual StatusCode execute()
StatusCode selectTracksInDet()
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
StatusCode refitAndSelectGoodQualityVertices(std::vector< WrkVrt > *)
finalization of the vertex and store to xAOD::VertexContainer
const AtlasDetectorID * m_atlasId
std::map< std::string, PatternStrategyFunc > m_patternStrategyFuncs
ToolHandle< Reco::ITrackToVertex > m_trackToVertexTool
get a handle on the Track to Vertex tool
std::optional< SG::Decorator< char > > m_decor_isAssociated
std::size_t erase_if(T_container &container, T_Func pred)
bool doSelectTracksFromElectrons
SG::WriteDecorHandleKey< xAOD::EventInfo > m_vertexingStatusKey
std::optional< SG::Decorator< char > > m_decor_isSelected
StatusCode fillAANT_SelectedBaseTracks()
std::optional< SG::Decorator< char > > m_decor_is_svtrk_final
bool doMergeFinalVerticesDistance
bool doReassembleVertices
StatusCode selectTracksFromMuons()
unsigned nTracksTotal() const
StatusCode selectTracksFromElectrons()
void lockTrackDecorations(const xAOD::TrackParticle *trk, bool onlySelection) const
lock decorations at the end of the algorithm
std::vector< const xAOD::TrackParticle * > m_associatedTracks
bool checkTrackHitPatternToVertex(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
A classical method with hard-coded geometry.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
#define ATH_MSG_WARNING(x)
virtual StatusCode initEvent()
struct JobProperties m_jp
std::optional< VertexELType > m_decor_svLink
SG::OwnershipPolicy ownPolicy() const
Return the ownership policy setting for this container.
std::string TrackLocation
StatusCode monitorVertexingAlgorithmStep(std::vector< WrkVrt > *, const std::string &name, bool final=false)
monitor the intermediate status of vertexing
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
std::vector< const xAOD::TrackParticle * > m_selectedTracks
Manage lookup of vectors of auxiliary data.
#define ATLAS_THREAD_SAFE
Class describing a TrackParticle.
const SG::AuxVectorData * container() const
Return the container holding this element.
virtual StatusCode initialize()
bool checkTrackHitPatternToVertexByExtrapolation(const xAOD::TrackParticle *trk, const Amg::Vector3D &vertex)
New method with track extrapolation.
StatusCode mergeFinalVertices(std::vector< WrkVrt > *)
attempt to merge vertices by lookng at the distance between two vertices
StatusCode addEventInfo()
StatusCode findNtrackVertices(std::vector< WrkVrt > *)
std::map< unsigned, SG::Decorator< float > > m_trkDecors
StatusCode clearNtupleVariables()
std::vector< IPDecoratorType > m_ipDecors