Skip to content
Snippets Groups Projects
Commit e579dbb5 authored by James Beacham's avatar James Beacham Committed by Atlas Nightlybuild
Browse files

Merge branch '21.0' into '21.0'

VrtSecInclusive : debug and optimization for r21 DAOD_RPVLL production

See merge request atlas/athena!8709

(cherry picked from commit fe7572a4 [formerly d4cc91084fe9ce3dd5d0e35564c93ea6271663e0])

3415178c VrtSecInclusive: reorganizing debug messages
8c055919 VrtSecInclusive: using IP significance for associating tracks
adf4ad47 VrtSecInclusive: fixing the problem of fake rejection using extrapolation by…
aa110fbb VrtSecInclusive: extrapolation cache cleaning
975a9067 VrtSecInclusive: adding fail-safe from crazy fitting result
3d3c1f3e VrtSecInclusive: limiting vertex seeds to have at least one track to satisfy the…
91a95617 VrtSecInclusive: fixing the N-track vertex finding strategy switch, and vertex…
bb7e52b9 VrtSecInclusive: added a more decent requirement in hit pattern (requiring >=6…
8160ac77 VrtSecInclusive: miscellaneous code brushups
a52015e4 VrtSecInclusive: changed the default DV configuration parameters
2181fcdc VrtSecInclusive: various code cleanup
a2c88c2a added a new job property to enable track-decoration variable names can be varied…
cf810990 use ID tracks for the case of selecting muons option
81a3ba03 Merge remote-tracking branch 'refs/remotes/origin/21.0' into 21.0
d254bbd9 VrtSecInclusive: introduced a preselection in 2-track vertex finding before VKalVrt fit
dd7856a1 VrtSecInclusive: relaxing the extrapolation pattern matching condition by…
ac602c9a VrtSecInclusive: refining the final vertex augmentations
c334dfb5 VrtSecInclusive: updated python/VrtSecInclusive.py to allow multiple instances…
7db7e485 VrtSecInclusive: comissioning the augVerString option
305eefcb VrtSecInclusive: directly fetching the TrackParticle pointer instead of using…
4b412e86 VrtSecInclusive: commissioning of multiple VrtSecInclusive instances with…
aff7ec67 VrtSecInclusive: VrtSecInclusive_DV_configuration.py: default(InDet) and leptons…
a2620ac2 VrtSecInclusive: protection of not to have duplication of an identical track in the selection
8964c632 tuning the algorithm details by MC samples; refining the monitoring histograms and debug messages.
af1d23ca VrtSecInclusive: truth vertex tracer
0d93f220 VrtSecInclusive: introducing hit pattern fake rejection with extrapolator…
c86245d8 VrtSecInclusive: retuning VrtSecInclusive_DV_Configuration.py
859a9058 VrtSecInclusive: bugfix and minor code cleanup
eabcf6f7 VrtSecInclusive: limiting the phase space of vertex forming within IBL
9365240c VrtSecInclusive: limiting the phase space of vertex forming 2-trk vertices for PV compatibility
3504d6fb VrtSecInclusive: more tuning on MC signal efficiency
daf7d496 VrtSecInclusive: adding tight track selection handles
b1f71e92 VrtSecInclusive: finalizing optimization for rel21. detailed performance report:…
74a495dc VrtSecInclusive: switching off storing intermediate vertices
4f1cb3f8 Merge branch 'feature-VrtSecInclusive-newFeaturesIntegrated-21.0' into '21.0'

Former-commit-id: 000554f10a3538e18864ad816a9295b8f1a5ac5c
parent cd983289
No related branches found
No related tags found
No related merge requests found
Showing
with 2223 additions and 917 deletions
......@@ -112,6 +112,8 @@ namespace VKalVrtAthena {
std::string PrimVrtLocation;
std::string truthParticleContainerName;
std::string mcEventContainerName;
std::string augVerString;
std::string truthParticleFilter;
std::string all2trksVerticesContainerName;
std::string secondaryVerticesContainerName;
......@@ -147,6 +149,7 @@ namespace VKalVrtAthena {
double z0TrkPVSignifCut;
double d0TrkErrorCut;
double z0TrkErrorCut;
double twoTrkVtxFormingD0Cut;
/* pT anc chi2 */
double TrkChi2Cut;
......@@ -160,6 +163,8 @@ namespace VKalVrtAthena {
int CutBLayHits;
int CutSharedHits;
int CutTRTHits; // Kazuki
int CutTightSCTHits;
int CutTightTRTHits;
// Vertex reconstruction
bool doPVcompatibilityCut;
......@@ -182,8 +187,8 @@ namespace VKalVrtAthena {
double associateMinDistanceToPV;
double associateMaxD0;
double associateMaxZ0;
double associateMaxD0Signif;
double associateMaxZ0Signif;
double associatePtCut;
double associateChi2Cut;
......@@ -244,6 +249,23 @@ namespace VKalVrtAthena {
using PatternStrategyFunc = bool (VrtSecInclusive::*) ( const xAOD::TrackParticle *trk, const Amg::Vector3D& vertex );
std::map<std::string, PatternStrategyFunc> m_patternStrategyFuncs;
// AuxElement decorators
std::unique_ptr< SG::AuxElement::Decorator< char > > m_decor_isSelected;
std::unique_ptr< SG::AuxElement::Decorator< char > > m_decor_isAssociated;
std::unique_ptr< SG::AuxElement::Decorator< char > > m_decor_is_svtrk_final;
std::map< unsigned, SG::AuxElement::Decorator<float> > m_trkDecors;
using IPDecoratorType = SG::AuxElement::Decorator< std::vector< std::vector<float> > >;
std::unique_ptr< IPDecoratorType > m_decor_d0_wrtSVs;
std::unique_ptr< IPDecoratorType > m_decor_z0_wrtSVs;
std::unique_ptr< IPDecoratorType > m_decor_pt_wrtSVs;
std::unique_ptr< IPDecoratorType > m_decor_eta_wrtSVs;
std::unique_ptr< IPDecoratorType > m_decor_phi_wrtSVs;
std::unique_ptr< IPDecoratorType > m_decor_d0err_wrtSVs;
std::unique_ptr< IPDecoratorType > m_decor_z0err_wrtSVs;
using VertexELType = SG::AuxElement::Decorator< std::vector<ElementLink< xAOD::VertexContainer > > >;
std::unique_ptr< VertexELType > m_decor_svLink;
//////////////////////////////////////////////////////////////////////////////////////
//
......@@ -284,6 +306,7 @@ namespace VKalVrtAthena {
TLorentzVector vertexMom; //! VKalVrt fit vertex 4-momentum
std::vector<double> vertexCov; //! VKalVrt fit covariance
double Chi2; //! VKalVrt fit chi2 result
double Chi2_core; //! VKalVrt fit chi2 result
std::vector<double> Chi2PerTrk; //! list of VKalVrt fit chi2 for each track
long int Charge; //! total charge of the vertex
std::vector< std::vector<double> > TrkAtVrt; //! list of track parameters wrt the reconstructed vertex
......@@ -291,7 +314,9 @@ namespace VKalVrtAthena {
double closestWrkVrtValue; //! stores the value of some observable to the closest WrkVrt ( observable = e.g. significance )
inline double ndof() const { return 2.0*( selectedTrackIndices.size() + associatedTrackIndices.size() ) - 3.0; }
inline double ndof_core() const { return 2.0*( selectedTrackIndices.size() ) - 3.0; }
inline unsigned nTracksTotal() const { return selectedTrackIndices.size() + associatedTrackIndices.size(); }
inline double fitQuality() const { return Chi2 / ndof(); }
};
......@@ -301,6 +326,9 @@ namespace VKalVrtAthena {
using Flag = int;
using ExtrapolatedPoint = std::tuple<const TVector3, Detector, Bec, Layer, Flag>;
using ExtrapolatedPattern = std::vector< ExtrapolatedPoint >;
using PatternBank = std::map<const xAOD::TrackParticle*, std::pair< std::unique_ptr<ExtrapolatedPattern>, std::unique_ptr<ExtrapolatedPattern> > >;
PatternBank m_extrapolatedPatternBank;
std::vector< std::pair<int, int> > m_incomp;
......@@ -311,18 +339,24 @@ namespace VKalVrtAthena {
///
/** select tracks which become seeds for vertex finding */
StatusCode selectTracks();
void selectTrack( const xAOD::TrackParticle* );
StatusCode selectTracksInDet();
StatusCode selectTracksFromMuons();
StatusCode selectTracksFromElectrons();
using TrackSelectionAlg = StatusCode (VrtSecInclusive::*)();
std::vector<TrackSelectionAlg> m_trackSelectionAlgs;
/** track selection */
using CutFunc = bool (VrtSecInclusive::*) ( const xAOD::TrackParticle* ) const;
std::vector<CutFunc> m_trackSelectionFuncs;
/** track-by-track selection strategies */
bool selectTrack_notPVassociated ( const xAOD::TrackParticle* ) const;
bool selectTrack_pTCut ( const xAOD::TrackParticle* ) const;
bool selectTrack_chi2Cut ( const xAOD::TrackParticle* ) const;
bool selectTrack_hitPattern ( const xAOD::TrackParticle* ) const;
bool selectTrack_hitPatternTight ( const xAOD::TrackParticle* ) const;
bool selectTrack_d0Cut ( const xAOD::TrackParticle* ) const;
bool selectTrack_z0Cut ( const xAOD::TrackParticle* ) const;
bool selectTrack_d0errCut ( const xAOD::TrackParticle* ) const;
......@@ -430,14 +464,28 @@ namespace VKalVrtAthena {
/** cretrieve the track hit information */
void fillTrackSummary( track_summary& summary, const xAOD::TrackParticle *trk );
ExtrapolatedPattern* extrapolatedPattern( const xAOD::TrackParticle* );
ExtrapolatedPattern* extrapolatedPattern( const xAOD::TrackParticle*, enum Trk::PropDirection );
bool patternCheck ( const uint32_t& pattern, const Amg::Vector3D& vertex );
bool patternCheckRun1( const uint32_t& pattern, const Amg::Vector3D& vertex );
bool patternCheckRun2( const uint32_t& pattern, const Amg::Vector3D& vertex );
bool patternCheckOuterOnly ( const uint32_t& pattern, const Amg::Vector3D& vertex );
bool patternCheckRun1OuterOnly( const uint32_t& pattern, const Amg::Vector3D& vertex );
bool patternCheckRun2OuterOnly( const uint32_t& pattern, const Amg::Vector3D& vertex );
/** A classical method with hard-coded geometry */
bool checkTrackHitPatternToVertex( const xAOD::TrackParticle *trk, const Amg::Vector3D& vertex );
/** A classical method with hard-coded geometry */
bool checkTrackHitPatternToVertexOuterOnly( const xAOD::TrackParticle *trk, const Amg::Vector3D& vertex );
/** New method with track extrapolation */
bool checkTrackHitPatternToVertexByExtrapolation( const xAOD::TrackParticle *trk, const Amg::Vector3D& vertex );
/** New method with track extrapolation */
bool checkTrackHitPatternToVertexByExtrapolationAssist( const xAOD::TrackParticle *trk, const Amg::Vector3D& vertex );
/** Flag false if the consistituent tracks are not consistent with the vertex position */
bool passedFakeReject( const Amg::Vector3D& FitVertex, const xAOD::TrackParticle *itrk, const xAOD::TrackParticle *jtrk );
......@@ -460,6 +508,10 @@ namespace VKalVrtAthena {
StatusCode categorizeVertexTruthTopology( xAOD::Vertex *vertex );
void dumpTruthInformation();
std::vector<const xAOD::TruthVertex*> m_tracingTruthVertices;
////////////////////////////////////////////////////////////////////////////////////////
//
// Additional augmentation
......
......@@ -111,20 +111,19 @@ namespace VKalVrtAthena {
const LeptonContainer *leptonContainer( nullptr );
ATH_CHECK( evtStore()->retrieve( leptonContainer, containerName ) );
using IPDecoratorType = SG::AuxElement::Decorator< std::vector< std::vector<float> > >;
static IPDecoratorType decor_d0wrtSV ( "d0_wrtSVs" );
static IPDecoratorType decor_z0wrtSV ( "z0_wrtSVs" );
static IPDecoratorType decor_ptwrtSV ( "pt_wrtSVs" );
static IPDecoratorType decor_etawrtSV ( "eta_wrtSVs" );
static IPDecoratorType decor_phiwrtSV ( "phi_wrtSVs" );
static IPDecoratorType decor_d0errWrtSV ( "d0err_wrtSVs" );
static IPDecoratorType decor_z0errWrtSV ( "z0err_wrtSVs" );
if( !m_decor_d0_wrtSVs ) m_decor_d0_wrtSVs = std::make_unique<IPDecoratorType>( "d0_wrtSVs" + m_jp.augVerString );
if( !m_decor_z0_wrtSVs ) m_decor_z0_wrtSVs = std::make_unique<IPDecoratorType>( "z0_wrtSVs" + m_jp.augVerString );
if( !m_decor_pt_wrtSVs ) m_decor_pt_wrtSVs = std::make_unique<IPDecoratorType>( "pt_wrtSVs" + m_jp.augVerString );
if( !m_decor_eta_wrtSVs ) m_decor_eta_wrtSVs = std::make_unique<IPDecoratorType>( "eta_wrtSVs" + m_jp.augVerString );
if( !m_decor_phi_wrtSVs ) m_decor_phi_wrtSVs = std::make_unique<IPDecoratorType>( "phi_wrtSVs" + m_jp.augVerString );
if( !m_decor_d0err_wrtSVs ) m_decor_d0err_wrtSVs = std::make_unique<IPDecoratorType>( "d0err_wrtSVs" + m_jp.augVerString );
if( !m_decor_z0err_wrtSVs ) m_decor_z0err_wrtSVs = std::make_unique<IPDecoratorType>( "z0err_wrtSVs" + m_jp.augVerString );
// Grouping decorators
std::vector< IPDecoratorType > decor_ipWrtSVs { decor_d0wrtSV, decor_z0wrtSV, decor_ptwrtSV, decor_etawrtSV, decor_phiwrtSV, decor_d0errWrtSV, decor_z0errWrtSV };
std::vector< IPDecoratorType* > decor_ipWrtSVs { m_decor_d0_wrtSVs.get(), m_decor_z0_wrtSVs.get(), m_decor_pt_wrtSVs.get(), m_decor_eta_wrtSVs.get(), m_decor_phi_wrtSVs.get(), m_decor_d0err_wrtSVs.get(), m_decor_z0err_wrtSVs.get() };
enum { k_ip_d0, k_ip_z0, k_ip_pt, k_ip_eta, k_ip_phi, k_ip_d0err, k_ip_z0err };
static SG::AuxElement::Decorator< std::vector<ElementLink< xAOD::VertexContainer > > > decor_svLink("svLinks");
if( !m_decor_svLink ) m_decor_svLink = std::make_unique< VertexELType >( "svLinks" + m_jp.augVerString );
// Loop over leptons
for( const auto& lepton : *leptonContainer ) {
......@@ -186,7 +185,7 @@ namespace VKalVrtAthena {
// The linking to the vertices need to be done only once
if( !linkFlag ) {
decor_svLink ( *lepton ) = links;
( *m_decor_svLink )( *lepton ) = links;
linkFlag = true;
}
......@@ -195,7 +194,7 @@ namespace VKalVrtAthena {
} // end of track type loop
// decoration
for( size_t ipar = 0; ipar < decor_ipWrtSVs.size(); ipar++ ) decor_ipWrtSVs.at( ipar )( *lepton ) = ip_wrtSVs.at( ipar );
for( size_t ipar = 0; ipar < decor_ipWrtSVs.size(); ipar++ ) ( *( decor_ipWrtSVs.at( ipar ) ) )( *lepton ) = ip_wrtSVs.at( ipar );
} // end of lepton container loop
......
......@@ -26,5 +26,5 @@ class VrtSecInclusive ( VKalVrtAthena__VrtSecInclusive ) :
ToolSvc += AtlasTrackSummaryTool
VKalVrtAthena__VrtSecInclusive.__init__( self,name="VrtSecInclusive")
VKalVrtAthena__VrtSecInclusive.__init__( self, name )
......@@ -9,51 +9,106 @@ topSequence = AlgSequence()
# instantiate the vertexing alg
from VrtSecInclusive.VrtSecInclusive import VrtSecInclusive
topSequence.insert(-1, VrtSecInclusive())
VrtSecInclusive_InDet = VrtSecInclusive("VrtSecInclusive_InDet")
VrtSecInclusive_leptons = VrtSecInclusive("VrtSecInclusive_leptons")
topSequence.insert(-1, VrtSecInclusive_InDet)
topSequence.insert(-1, VrtSecInclusive_leptons)
# set options for vertexing
topSequence.VrtSecInclusive.do_PVvetoCut = True
topSequence.VrtSecInclusive.do_d0Cut = False
topSequence.VrtSecInclusive.do_z0Cut = False
topSequence.VrtSecInclusive.do_d0errCut = False
topSequence.VrtSecInclusive.do_z0errCut = False
topSequence.VrtSecInclusive.do_d0signifCut = False
topSequence.VrtSecInclusive.do_z0signifCut = False
topSequence.VrtSecInclusive.doTRTPixCut = True
topSequence.VrtSecInclusive.DoSAloneTRT = False
topSequence.VrtSecInclusive.ImpactWrtBL = True
topSequence.VrtSecInclusive.doPVcompatibilityCut = False
topSequence.VrtSecInclusive.RemoveFake2TrkVrt = True
topSequence.VrtSecInclusive.CheckHitPatternStrategy = 'Extrapolation' # Classical or Extrapolation
topSequence.VrtSecInclusive.doReassembleVertices = True
topSequence.VrtSecInclusive.doMergeByShuffling = True
topSequence.VrtSecInclusive.doMergeFinalVerticesDistance = True
topSequence.VrtSecInclusive.doAssociateNonSelectedTracks = True
topSequence.VrtSecInclusive.doFinalImproveChi2 = True
topSequence.VrtSecInclusive.DoTruth = (globalflags.DataSource == 'geant4' and globalflags.InputFormat == "pool")
topSequence.VrtSecInclusive.FillHist = True
topSequence.VrtSecInclusive.FillIntermediateVertices = False
topSequence.VrtSecInclusive.CutPixelHits = 0
topSequence.VrtSecInclusive.CutSctHits = 2
topSequence.VrtSecInclusive.TrkA0ErrCut = 200000
topSequence.VrtSecInclusive.TrkZErrCut = 200000
topSequence.VrtSecInclusive.a0TrkPVDstMinCut = 2.0 # track d0 min
topSequence.VrtSecInclusive.a0TrkPVDstMaxCut = 300.0 # track d0 max: default is 1000.0
topSequence.VrtSecInclusive.zTrkPVDstMinCut = 0.0 # track z0 min: default is 0.0, just for clarification
topSequence.VrtSecInclusive.zTrkPVDstMaxCut = 1500.0 # track z0 max: default is 1000.0
topSequence.VrtSecInclusive.TrkPtCut = 1000
topSequence.VrtSecInclusive.SelVrtChi2Cut = 100
topSequence.VrtSecInclusive.CutSharedHits = 2
topSequence.VrtSecInclusive.TrkChi2Cut = 50
topSequence.VrtSecInclusive.TruthTrkLen = 1
topSequence.VrtSecInclusive.SelTrkMaxCutoff = 300
topSequence.VrtSecInclusive.mergeByShufflingAllowance = 5.
topSequence.VrtSecInclusive.associatePtCut = 1000.
topSequence.VrtSecInclusive.MergeFinalVerticesDist = 1.
topSequence.VrtSecInclusive.MergeFinalVerticesScaling = 0.
topSequence.VrtSecInclusive.improveChi2ProbThreshold = 0.00001
topSequence.VrtSecInclusive.doAugmentDVimpactParametersToMuons = True
topSequence.VrtSecInclusive.doAugmentDVimpactParametersToElectrons = True
VrtSecInclusive_InDet.do_PVvetoCut = True
VrtSecInclusive_InDet.do_d0Cut = False
VrtSecInclusive_InDet.do_z0Cut = False
VrtSecInclusive_InDet.do_d0errCut = False
VrtSecInclusive_InDet.do_z0errCut = False
VrtSecInclusive_InDet.do_d0signifCut = False
VrtSecInclusive_InDet.do_z0signifCut = False
VrtSecInclusive_InDet.doTRTPixCut = True
VrtSecInclusive_InDet.DoSAloneTRT = False
VrtSecInclusive_InDet.ImpactWrtBL = True
VrtSecInclusive_InDet.doPVcompatibilityCut = False
VrtSecInclusive_InDet.RemoveFake2TrkVrt = True
VrtSecInclusive_InDet.CheckHitPatternStrategy = 'ExtrapolationAssist' # Either 'Classical', 'Extrapolation' or 'ExtrapolationAssist'
VrtSecInclusive_InDet.doReassembleVertices = True
VrtSecInclusive_InDet.doMergeByShuffling = True
VrtSecInclusive_InDet.doMergeFinalVerticesDistance = True
VrtSecInclusive_InDet.doAssociateNonSelectedTracks = True
VrtSecInclusive_InDet.doFinalImproveChi2 = False
VrtSecInclusive_InDet.DoTruth = (globalflags.DataSource == 'geant4' and globalflags.InputFormat == "pool")
VrtSecInclusive_InDet.FillHist = True
VrtSecInclusive_InDet.FillIntermediateVertices = False
VrtSecInclusive_InDet.CutPixelHits = 0
VrtSecInclusive_InDet.CutSctHits = 2
VrtSecInclusive_InDet.TrkA0ErrCut = 200000
VrtSecInclusive_InDet.TrkZErrCut = 200000
VrtSecInclusive_InDet.a0TrkPVDstMinCut = 2.0 # track d0 min
VrtSecInclusive_InDet.a0TrkPVDstMaxCut = 300.0 # track d0 max: default is 1000.0
VrtSecInclusive_InDet.zTrkPVDstMinCut = 0.0 # track z0 min: default is 0.0, just for clarification
VrtSecInclusive_InDet.zTrkPVDstMaxCut = 1500.0 # track z0 max: default is 1000.0
VrtSecInclusive_InDet.twoTrkVtxFormingD0Cut = 2.0
VrtSecInclusive_InDet.TrkPtCut = 1000
VrtSecInclusive_InDet.SelVrtChi2Cut = 5.
VrtSecInclusive_InDet.CutSharedHits = 2
VrtSecInclusive_InDet.TrkChi2Cut = 50
VrtSecInclusive_InDet.TruthTrkLen = 1
VrtSecInclusive_InDet.SelTrkMaxCutoff = 2000
VrtSecInclusive_InDet.mergeByShufflingAllowance = 10.
VrtSecInclusive_InDet.associatePtCut = 1000.
VrtSecInclusive_InDet.associateMinDistanceToPV = 2.
VrtSecInclusive_InDet.associateMaxD0Signif = 5.
VrtSecInclusive_InDet.associateMaxZ0Signif = 5.
VrtSecInclusive_InDet.MergeFinalVerticesDist = 1.
VrtSecInclusive_InDet.MergeFinalVerticesScaling = 0.
VrtSecInclusive_InDet.improveChi2ProbThreshold = 0.0001
VrtSecInclusive_InDet.doAugmentDVimpactParametersToMuons = True
VrtSecInclusive_InDet.doAugmentDVimpactParametersToElectrons = True
VrtSecInclusive_leptons.doSelectTracksFromMuons = True
VrtSecInclusive_leptons.doSelectTracksFromElectrons = True
VrtSecInclusive_leptons.AugmentingVersionString = "_Leptons"
VrtSecInclusive_leptons.do_PVvetoCut = True
VrtSecInclusive_leptons.do_d0Cut = True
VrtSecInclusive_leptons.do_z0Cut = False
VrtSecInclusive_leptons.do_d0errCut = False
VrtSecInclusive_leptons.do_z0errCut = False
VrtSecInclusive_leptons.do_d0signifCut = False
VrtSecInclusive_leptons.do_z0signifCut = False
VrtSecInclusive_leptons.doTRTPixCut = False
VrtSecInclusive_leptons.DoSAloneTRT = False
VrtSecInclusive_leptons.ImpactWrtBL = False
VrtSecInclusive_leptons.doPVcompatibilityCut = False
VrtSecInclusive_leptons.RemoveFake2TrkVrt = True
VrtSecInclusive_leptons.CheckHitPatternStrategy = 'ExtrapolationAssist' # Either 'Classical', 'Extrapolation' or 'ExtrapolationAssist'
VrtSecInclusive_leptons.doReassembleVertices = True
VrtSecInclusive_leptons.doMergeByShuffling = True
VrtSecInclusive_leptons.doMergeFinalVerticesDistance = True
VrtSecInclusive_leptons.doAssociateNonSelectedTracks = False
VrtSecInclusive_leptons.doFinalImproveChi2 = False
VrtSecInclusive_leptons.DoTruth = (globalflags.DataSource == 'geant4' and globalflags.InputFormat == "pool")
VrtSecInclusive_leptons.FillHist = True
VrtSecInclusive_leptons.FillIntermediateVertices = False
VrtSecInclusive_leptons.CutPixelHits = 0
VrtSecInclusive_leptons.CutSctHits = 2
VrtSecInclusive_leptons.TrkA0ErrCut = 200000
VrtSecInclusive_leptons.TrkZErrCut = 200000
VrtSecInclusive_leptons.a0TrkPVDstMinCut = 0.0 # track d0 min
VrtSecInclusive_leptons.a0TrkPVDstMaxCut = 300.0 # track d0 max: default is 1000.0
VrtSecInclusive_leptons.zTrkPVDstMinCut = 0.0 # track z0 min: default is 0.0, just for clarification
VrtSecInclusive_leptons.zTrkPVDstMaxCut = 1500.0 # track z0 max: default is 1000.0
VrtSecInclusive_leptons.twoTrkVtxFormingD0Cut = 0.0
VrtSecInclusive_leptons.TrkPtCut = 1000
VrtSecInclusive_leptons.SelVrtChi2Cut = 5.
VrtSecInclusive_leptons.CutSharedHits = 2
VrtSecInclusive_leptons.TrkChi2Cut = 50
VrtSecInclusive_leptons.TruthTrkLen = 1
VrtSecInclusive_leptons.SelTrkMaxCutoff = 2000
VrtSecInclusive_leptons.mergeByShufflingAllowance = 5.
VrtSecInclusive_leptons.associatePtCut = 1000.
VrtSecInclusive_leptons.MergeFinalVerticesDist = 1.
VrtSecInclusive_leptons.MergeFinalVerticesScaling = 0.
VrtSecInclusive_leptons.improveChi2ProbThreshold = 0.0001
# set options related to the vertex fitter
from TrkVKalVrtFitter.TrkVKalVrtFitterConf import Trk__TrkVKalVrtFitter
......@@ -64,13 +119,20 @@ InclusiveVxFitterTool = Trk__TrkVKalVrtFitter(name = "InclusiveVx
)
ToolSvc += InclusiveVxFitterTool;
InclusiveVxFitterTool.OutputLevel = INFO
topSequence.VrtSecInclusive.VertexFitterTool=InclusiveVxFitterTool
topSequence.VrtSecInclusive.Extrapolator = ToolSvc.AtlasExtrapolator
VrtSecInclusive_InDet.VertexFitterTool=InclusiveVxFitterTool
VrtSecInclusive_InDet.Extrapolator = ToolSvc.AtlasExtrapolator
VrtSecInclusive_leptons.VertexFitterTool=InclusiveVxFitterTool
VrtSecInclusive_leptons.Extrapolator = ToolSvc.AtlasExtrapolator
# tell VrtSecInclusive the interface name for Trk::IVertexMapper
from TrkDetDescrTestTools.TrkDetDescrTestToolsConf import Trk__VertexMapper
HadronicVertexMapper = Trk__VertexMapper("HadronicVertexMapper")
ToolSvc += HadronicVertexMapper
topSequence.VrtSecInclusive.VertexMapper = HadronicVertexMapper
VrtSecInclusive_InDet.VertexMapper = HadronicVertexMapper
VrtSecInclusive_leptons.VertexMapper = HadronicVertexMapper
include("VrtSecInclusive/VrtSecInclusive_DV_postInclude.py")
......@@ -2,6 +2,17 @@ StreamESD.ItemList+=["xAOD::TrackParticleContainer#VrtSecInclusive*"]
StreamESD.ItemList+=["xAOD::VertexContainer#VrtSecInclusive*"]
StreamESD.ItemList+=["xAOD::VertexAuxContainer#VrtSecInclusive*"]
# Monitoring histograms writing out
ServiceMgr += THistSvc()
ServiceMgr.THistSvc.Output = ["AANT DATAFILE='HIST.VrtSecInclusive.root' OPT='RECREATE'"]
from AnalysisTools.AthAnalysisToolsConf import AANTupleStream
topSequence += AANTupleStream()
topSequence.AANTupleStream.ExtraRefNames = [ "StreamESD" ]
topSequence.AANTupleStream.OutputName = 'HIST.VrtSecInclusive.root'
topSequence.AANTupleStream.WriteInputDataHeader = True
topSequence.AANTupleStream.OutputLevel = INFO
ToolSvc.EGammaAmbiguityTool.minNoSiHits = 2
ToolSvc.EGammaAmbiguityTool.minNoPixHits = 0
......
......@@ -35,26 +35,26 @@ namespace VKalVrtAthena {
bool VrtSecInclusive::selectTrack_hitPattern( const xAOD::TrackParticle* trk ) const {
uint8_t PixelHits = 0;
uint8_t SctHits = 0;
uint8_t SCTHits = 0;
uint8_t BLayHits = 0;
uint8_t PixShare = 0;
uint8_t SctShare = 0;
uint8_t SCTShare = 0;
uint8_t TRTHits = 0;
if( !(trk->summaryValue( PixelHits, xAOD::numberOfPixelHits ) ) ) PixelHits =0;
if( !(trk->summaryValue( SctHits, xAOD::numberOfSCTHits ) ) ) SctHits =0;
if( !(trk->summaryValue( SCTHits, xAOD::numberOfSCTHits ) ) ) SCTHits =0;
if( !(trk->summaryValue( BLayHits, xAOD::numberOfInnermostPixelLayerHits ) ) ) BLayHits =0;
if( !(trk->summaryValue( PixShare, xAOD::numberOfPixelSharedHits ) ) ) PixShare =0;
if( !(trk->summaryValue( SctShare, xAOD::numberOfSCTSharedHits ) ) ) SctShare =0;
if( !(trk->summaryValue( SCTShare, xAOD::numberOfSCTSharedHits ) ) ) SCTShare =0;
if( !(trk->summaryValue( TRTHits, xAOD::numberOfTRTHits ) ) ) TRTHits =0;
uint8_t SharedHits = PixShare + SctShare;
uint8_t SharedHits = PixShare + SCTShare;
// do Pixel/SCT/SiHits only if we exclude StandAlone TRT hits
if( !m_jp.SAloneTRT ) {
if(PixelHits < m_jp.CutPixelHits) return false;
if(SctHits < m_jp.CutSctHits) return false;
if((PixelHits+SctHits) < m_jp.CutSiHits) return false;
if(SCTHits < m_jp.CutSctHits) return false;
if((PixelHits+SCTHits) < m_jp.CutSiHits) return false;
if(BLayHits < m_jp.CutBLayHits) return false;
if(SharedHits > m_jp.CutSharedHits) return false;
}
......@@ -64,6 +64,29 @@ namespace VKalVrtAthena {
if(TRTHits == 0 && PixelHits < 2) return false;
}
if( PixelHits == 0 && SCTHits < 6 ) return false;
return true;
}
//____________________________________________________________________________________________________
bool VrtSecInclusive::selectTrack_hitPatternTight( const xAOD::TrackParticle* trk ) const {
uint8_t PixelHits = 0;
uint8_t SCTHits = 0;
uint8_t TRTHits = 0;
if( !(trk->summaryValue( PixelHits, xAOD::numberOfPixelHits ) ) ) PixelHits =0;
if( !(trk->summaryValue( SCTHits, xAOD::numberOfSCTHits ) ) ) SCTHits =0;
if( !(trk->summaryValue( TRTHits, xAOD::numberOfTRTHits ) ) ) TRTHits =0;
if( trk->pt() > 20.e3 ) return true;
if( SCTHits < m_jp.CutTightSCTHits ) return false;
if( fabs( trk->eta() ) < 1.7 ) {
if( TRTHits < m_jp.CutTightTRTHits ) return false;
}
return true;
}
......@@ -74,109 +97,110 @@ namespace VKalVrtAthena {
//____________________________________________________________________________________________________
StatusCode VrtSecInclusive::selectTracks() {
void VrtSecInclusive::selectTrack( const xAOD::TrackParticle* trk ) {
ATH_MSG_DEBUG( " > selectTracks: begin" );
if( !m_decor_isSelected ) m_decor_isSelected = std::make_unique< SG::AuxElement::Decorator< char > >( "is_selected" + m_jp.augVerString );
//--------------------------------------------------------
// Extract tracks from xAOD::TrackParticle container
//
const xAOD::TrackParticleContainer* trackParticleContainer ( nullptr );
ATH_CHECK( evtStore()->retrieve( trackParticleContainer, m_jp.TrackLocation) );
ATH_MSG_DEBUG( "Extracted xAOD::TrackParticle number=" << trackParticleContainer->size() );
if( m_jp.FillNtuple )
m_ntupleVars->get<unsigned int>( "NumAllTrks" ) = static_cast<int>( trackParticleContainer->size() );
//-----------------------------------------------------------
// Track selection
//
static SG::AuxElement::Decorator< char > decor_isSelected( "is_selected" );
// Setup cut functions
using cutFunc = bool (VrtSecInclusive::*) ( const xAOD::TrackParticle* ) const;
std::vector<cutFunc> cuts;
// These cuts are optional. Specified by JobProperty
if( m_jp.do_PVvetoCut ) cuts.emplace_back( &VrtSecInclusive::selectTrack_notPVassociated );
if( m_jp.do_d0Cut ) cuts.emplace_back( &VrtSecInclusive::selectTrack_d0Cut );
if( m_jp.do_z0Cut ) cuts.emplace_back( &VrtSecInclusive::selectTrack_d0Cut );
if( m_jp.do_d0errCut ) cuts.emplace_back( &VrtSecInclusive::selectTrack_d0errCut );
if( m_jp.do_z0errCut ) cuts.emplace_back( &VrtSecInclusive::selectTrack_z0errCut );
//if( m_jp.do_d0signifCut ) cuts.emplace_back( &VrtSecInclusive::selectTrack_d0signifCut ); // not implemented yet
//if( m_jp.do_z0signifCut ) cuts.emplace_back( &VrtSecInclusive::selectTrack_z0signifCut ); // not implemented yet
if( 0 == m_trackSelectionFuncs.size() ) {
// These cuts are optional. Specified by JobProperty
if( m_jp.do_PVvetoCut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_notPVassociated );
if( m_jp.do_d0Cut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_d0Cut );
if( m_jp.do_z0Cut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_d0Cut );
if( m_jp.do_d0errCut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_d0errCut );
if( m_jp.do_z0errCut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_z0errCut );
//if( m_jp.do_d0signifCut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_d0signifCut ); // not implemented yet
//if( m_jp.do_z0signifCut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_z0signifCut ); // not implemented yet
// These cuts are used by default
m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_hitPattern );
m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_hitPatternTight );
m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_chi2Cut );
m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_pTCut );
}
// These cuts are used by default
cuts.emplace_back( &VrtSecInclusive::selectTrack_hitPattern );
cuts.emplace_back( &VrtSecInclusive::selectTrack_chi2Cut );
cuts.emplace_back( &VrtSecInclusive::selectTrack_pTCut );
if( std::find( m_selectedTracks->begin(), m_selectedTracks->end(), trk ) != m_selectedTracks->end() ) return;
std::vector<bool> cutBits;
// Loop over tracks
for( auto *trk : *trackParticleContainer ) {
std::vector<bool> cutBits;
for( auto func : m_trackSelectionFuncs ) cutBits.emplace_back( (this->*func)( trk ) );
for( auto func : cuts ) cutBits.emplace_back( (this->*func)( trk ) );
if( m_jp.FillHist ) {
m_hists["trkSelCuts"]->Fill( 0 );
for( size_t ibit = 0; ibit < cutBits.size(); ibit++) {
if( cutBits.at(ibit) ) {
m_hists["trkSelCuts"]->Fill( ibit+1 );
} else {
break;
}
if( m_jp.FillHist ) {
m_hists["trkSelCuts"]->Fill( 0 );
for( size_t ibit = 0; ibit < cutBits.size(); ibit++) {
if( cutBits.at(ibit) ) {
m_hists["trkSelCuts"]->Fill( ibit+1 );
} else {
break;
}
}
}
// Good track should not find any false bit
bool isGood_standard = ( std::find( cutBits.begin(), cutBits.end(), false ) == cutBits.end() );
// Good track should not find any false bit
bool isGood_standard = ( std::find( cutBits.begin(), cutBits.end(), false ) == cutBits.end() );
if( isGood_standard ) {
if( isGood_standard ) {
// Store the selected track to the new m_selectedTracks
// Here we firstly need to register the empty pointer to the m_selectedTracks,
// then need to do deep copy after then. This is the feature of xAOD.
// Store the selected track to the new m_selectedTracks
// Here we firstly need to register the empty pointer to the m_selectedTracks,
// then need to do deep copy after then. This is the feature of xAOD.
unsigned long barcode=0;
unsigned long barcode=0;
if( m_jp.doTruth ) {
const auto* truth = getTrkGenParticle(trk);
if( m_jp.doTruth ) {
if ( truth ) {
barcode = truth->barcode();
}
const auto* truth = getTrkGenParticle(trk);
if ( truth ) {
barcode = truth->barcode();
}
}
decor_isSelected( *trk ) = true;
(*m_decor_isSelected)( *trk ) = true;
m_selectedTracks->emplace_back( trk );
m_selectedTracks->emplace_back( trk );
if( m_jp.FillNtuple ) m_ntupleVars->get< vector<int> >( "SelTrk_barcode" ).emplace_back(barcode); // will need this later
if( m_jp.FillNtuple ) m_ntupleVars->get< vector<int> >( "SelTrk_barcode" ).emplace_back(barcode); // will need this later
ATH_MSG_VERBOSE( " > selectTracks: Track index " << trk->index() << " has been selected." );
ATH_MSG_VERBOSE( " > selectTracks: Track index " << trk->index()
<< " parameter:"
<< " pt = " << trk->pt()
<< " eta = " << trk->eta()
<< " d0 = " << trk->d0()
<< " z0 = " << trk->z0() << "." );
ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": Track index " << trk->index() << " has been selected." );
ATH_MSG_VERBOSE( " > " << __FUNCTION__ << ": Track index " << trk->index()
<< " parameter:"
<< " pt = " << trk->pt()
<< " eta = " << trk->eta()
<< " d0 = " << trk->d0()
<< " z0 = " << trk->z0() << "." );
}
}
}
//____________________________________________________________________________________________________
StatusCode VrtSecInclusive::selectTracksInDet() {
ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": begin" );
//--------------------------------------------------------
// Extract tracks from xAOD::TrackParticle container
//
ATH_MSG_DEBUG( "execute: Number of total tracks = " << trackParticleContainer->size() );
ATH_MSG_DEBUG( "execute: Number of selected tracks = " << m_selectedTracks->size() );
const xAOD::TrackParticleContainer* trackParticleContainer ( nullptr );
ATH_CHECK( evtStore()->retrieve( trackParticleContainer, m_jp.TrackLocation) );
ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Extracted xAOD::TrackParticle number=" << trackParticleContainer->size() );
if( m_jp.FillNtuple )
m_ntupleVars->get<unsigned int>( "NumAllTrks" ) = static_cast<int>( trackParticleContainer->size() );
// Loop over tracks
for( auto *trk : *trackParticleContainer ) { selectTrack( trk ); }
ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of total ID tracks = " << trackParticleContainer->size() );
ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of selected tracks = " << m_selectedTracks->size() );
return StatusCode::SUCCESS;
}
......@@ -188,39 +212,44 @@ namespace VKalVrtAthena {
const xAOD::MuonContainer* muons ( nullptr );
ATH_CHECK( evtStore()->retrieve( muons, "Muons") );
static SG::AuxElement::Decorator< char > decor_isSelected( "is_selected" );
for( const auto& muon : *muons ) {
const auto& primaryTrackLink = muon->primaryTrackParticleLink();
const auto* trk = *primaryTrackLink;
if( trk ) {
decor_isSelected( *trk ) = true;
m_selectedTracks->emplace_back( trk );
}
const auto* trk = muon->trackParticle( xAOD::Muon::InnerDetectorTrackParticle );
if( !trk ) continue;
selectTrack( trk );
}
ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of total muons = " << muons->size() );
ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of selected tracks = " << m_selectedTracks->size() );
return StatusCode::SUCCESS;
}
//____________________________________________________________________________________________________
StatusCode VrtSecInclusive::selectTracksFromElectrons() {
const xAOD::ElectronContainer *electrons( nullptr );
ATH_CHECK( evtStore()->retrieve( electrons, "Electrons" ) );
static SG::AuxElement::Decorator< char > decor_isSelected( "is_selected" );
for( const auto& electron : *electrons ) {
if( 0 == electron->nTrackParticles() ) continue;
// The first track is the best-matched track
const auto* trk = electron->trackParticle(0);
if( trk ) {
decor_isSelected( *trk ) = true;
m_selectedTracks->emplace_back( trk );
}
if( !trk ) continue;
selectTrack( trk );
}
ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of total electrons = " << electrons->size() );
ATH_MSG_DEBUG( " > " << __FUNCTION__ << ": Number of selected tracks = " << m_selectedTracks->size() );
return StatusCode::SUCCESS;
}
......
This diff is collapsed.
......@@ -22,6 +22,7 @@
#include <iostream>
#include <tuple>
#include <functional>
#include <chrono>
using namespace std;
......@@ -62,8 +63,10 @@ namespace VKalVrtAthena {
{
m_patternStrategyFuncs["Classical"] = &VrtSecInclusive::checkTrackHitPatternToVertex;
m_patternStrategyFuncs["Extrapolation"] = &VrtSecInclusive::checkTrackHitPatternToVertexByExtrapolation;
m_patternStrategyFuncs["Classical"] = &VrtSecInclusive::checkTrackHitPatternToVertex;
m_patternStrategyFuncs["ClassicalOuter"] = &VrtSecInclusive::checkTrackHitPatternToVertexOuterOnly;
m_patternStrategyFuncs["Extrapolation"] = &VrtSecInclusive::checkTrackHitPatternToVertexByExtrapolation;
m_patternStrategyFuncs["ExtrapolationAssist"] = &VrtSecInclusive::checkTrackHitPatternToVertexByExtrapolationAssist;
this->declareProperties();
......@@ -150,21 +153,13 @@ namespace VKalVrtAthena {
}
// Track selection algorithm configuration
if( m_jp.doSelectTracksFromMuons ) {
m_trackSelectionAlgs.emplace_back( &VrtSecInclusive::selectTracksFromMuons );
}
if( m_jp.doSelectTracksFromElectrons ) {
m_trackSelectionAlgs.emplace_back( &VrtSecInclusive::selectTracksFromElectrons );
}
if( m_jp.doSelectTracksFromMuons ) { m_trackSelectionAlgs.emplace_back( &VrtSecInclusive::selectTracksFromMuons ); }
if( m_jp.doSelectTracksFromElectrons ) { m_trackSelectionAlgs.emplace_back( &VrtSecInclusive::selectTracksFromElectrons ); }
// if none of the above two flags are activated, use ID tracks (default)
if( !m_jp.doSelectTracksFromMuons && !m_jp.doSelectTracksFromElectrons ) {
m_trackSelectionAlgs.emplace_back( &VrtSecInclusive::selectTracks );
m_trackSelectionAlgs.emplace_back( &VrtSecInclusive::selectTracksInDet );
}
......@@ -179,21 +174,17 @@ namespace VKalVrtAthena {
}
if( m_jp.doMergeByShuffling ) {
m_vertexingAlgorithms.emplace_back( std::pair<std::string, vertexingAlg>( "mergeByShuffling", &VrtSecInclusive::mergeByShuffling ) );
}
if( m_jp.doAssociateNonSelectedTracks ) {
m_vertexingAlgorithms.emplace_back( std::pair<std::string, vertexingAlg>( "associateNonSelectedTracks", &VrtSecInclusive::associateNonSelectedTracks ) );
}
if( m_jp.doMergeByShuffling ) {
m_vertexingAlgorithms.emplace_back( std::pair<std::string, vertexingAlg>( "mergeByShuffling2", &VrtSecInclusive::mergeByShuffling ) );
m_vertexingAlgorithms.emplace_back( std::pair<std::string, vertexingAlg>( "mergeByShuffling", &VrtSecInclusive::mergeByShuffling ) );
}
if ( m_jp.doMergeFinalVerticesDistance ) {
m_vertexingAlgorithms.emplace_back( std::pair<std::string, vertexingAlg>( "mergeFinalVertices", &VrtSecInclusive::mergeFinalVertices ) );
}
if( m_jp.doAssociateNonSelectedTracks ) {
m_vertexingAlgorithms.emplace_back( std::pair<std::string, vertexingAlg>( "associateNonSelectedTracks", &VrtSecInclusive::associateNonSelectedTracks ) );
}
m_vertexingAlgorithms.emplace_back( std::pair<std::string, vertexingAlg>( "refitAndSelect", &VrtSecInclusive::refitAndSelectGoodQualityVertices ) );
......@@ -211,10 +202,15 @@ namespace VKalVrtAthena {
ATH_MSG_INFO("initialize: Filling Histograms");
//
m_hists["trkSelCuts"] = new TH1F("trkSelCuts", ";Cut Order;Tracks", 10, -0.5, 10-0.5 );
m_hists["selTracksDist"] = new TH1F("selTracksDist", ";Selected Tracks;Events", 2000, -0.5, 2000-0.5 );
m_hists["initVertexDispD0"] = new TH2F("initVertexDispD0", ";Rough d0 wrt init [mm];r [mm];Vertices", 1000, -100, 100, rbins.size()-1, &(rbins[0]) );
m_hists["initVertexDispZ0"] = new TH2F("initVertexDispZ0", ";Rough z0 wrt init [mm];z [mm];Vertices", 1000, -100, 100, 100, -1000, 1000 );
m_hists["incompMonitor"] = new TH1F("incompMonitor", ";Setp;Track Pairs", 10, -0.5, 10-0.5 );
m_hists["2trkVerticesDist"] = new TH1F("2trkVerticesDist", ";2-track Vertices;Events", 1000, -0.5, 1000-0.5 );
m_hists["2trkChi2Dist"] = new TH1F("2trkChi2Dist", ";log10(#chi^{2}/N_{dof});Entries", 100, -3, 7 );
m_hists["NtrkChi2Dist"] = new TH1F("NtrkChi2Dist", ";log10(#chi^{2}/N_{dof});Entries", 100, -3, 7 );
m_hists["vPosDist"] = new TH2F("vPosDist", ";r;#vec{x}*#vec{p}/p_{T} [mm]", rbins.size()-1, &(rbins[0]), 200, -1000, 1000 );
m_hists["vPosMomAngTDist"] = new TH2F("vPosMomAngDistT", ";r;cos(#vec{r},#vec{p}_{T})", rbins.size()-1, &(rbins[0]), 200, -1.0, 1.0 );
m_hists["disabledCount"] = new TH1F("disabledCount", ";N_{modules};Tracks", 20, -0.5, 10-0.5 );
m_hists["vertexYield"] = new TH1F("vertexYield", ";Algorithm Step;Vertices", nAlgs, -0.5, nAlgs-0.5 );
m_hists["vertexYieldNtrk"] = new TH2F("vertexYieldNtrk", ";Ntrk;Algorithm Step;Vertices", 100, 0, 100, nAlgs, -0.5, nAlgs-0.5 );
......@@ -226,10 +222,12 @@ namespace VKalVrtAthena {
m_hists["shuffleMinSignif3"] = new TH1F("shuffleMinSignif3", ";Min( log_{10}( Significance ) );Vertices", 100, -3, 5 );
m_hists["finalCutMonitor"] = new TH1F("finalCutMonitor", ";Step;Vertices", 6, -0.5, 6-0.5 );
m_hists["finalVtxNtrk"] = new TH1F("finalVtxNtrk", ";N_{trk};Vertices", nbins.size()-1, &(nbins[0]) );
m_hists["finalVtxR"] = new TH1F("finalVtxR", ";r [mm];Vertices", rbins.size()-1, &(rbins[0]) );
m_hists["finalVtxR"] = new TH1F("finalVtxR", ";r [mm];Vertices", 600, 0, 600 );
m_hists["finalVtxNtrkR"] = new TH2F("finalVtxNtrkR", ";N_{trk};r [mm];Vertices", nbins.size()-1, &(nbins[0]), rbins.size()-1, &(rbins[0]) );
m_hists["CPUTime"] = new TH1F("CPUTime", ";Step;Accum. CPU Time [s]", 10, -0.5, 10-0.5 );
m_hists["nMatchedTruths"] = new TH2F("nMatchedTruths", ";Step;;r [mm];Matched truth vertices", 11, -0.5, 11-0.5, rbins.size()-1, &(rbins[0]) );
std::string histDir("/AANT/VrtSecInclusive/");
std::string histDir("/AANT/VrtSecInclusive" + m_jp.augVerString + "/");
for( auto& pair : m_hists ) {
ATH_CHECK( hist_root->regHist( histDir + pair.first, pair.second ) );
......@@ -321,8 +319,8 @@ namespace VKalVrtAthena {
secondaryVertexContainer ->setStore( secondaryVertexAuxContainer );
ATH_CHECK( evtStore()->record( secondaryVertexContainer, "VrtSecInclusive_" + m_jp.secondaryVerticesContainerName ) );
ATH_CHECK( evtStore()->record( secondaryVertexAuxContainer, "VrtSecInclusive_" + m_jp.secondaryVerticesContainerName + "Aux." ) );
ATH_CHECK( evtStore()->record( secondaryVertexContainer, "VrtSecInclusive_" + m_jp.secondaryVerticesContainerName + m_jp.augVerString ) );
ATH_CHECK( evtStore()->record( secondaryVertexAuxContainer, "VrtSecInclusive_" + m_jp.secondaryVerticesContainerName + m_jp.augVerString + "Aux." ) );
if( m_jp.FillIntermediateVertices ) {
auto *twoTrksVertexContainer = new xAOD::VertexContainer;
......@@ -330,8 +328,8 @@ namespace VKalVrtAthena {
twoTrksVertexContainer ->setStore( twoTrksVertexAuxContainer );
ATH_CHECK( evtStore()->record( twoTrksVertexContainer, "VrtSecInclusive_" + m_jp.all2trksVerticesContainerName ) );
ATH_CHECK( evtStore()->record( twoTrksVertexAuxContainer, "VrtSecInclusive_" + m_jp.all2trksVerticesContainerName + "Aux." ) );
ATH_CHECK( evtStore()->record( twoTrksVertexContainer, "VrtSecInclusive_" + m_jp.all2trksVerticesContainerName + m_jp.augVerString ) );
ATH_CHECK( evtStore()->record( twoTrksVertexAuxContainer, "VrtSecInclusive_" + m_jp.all2trksVerticesContainerName + m_jp.augVerString + "Aux." ) );
for( auto itr = m_vertexingAlgorithms.begin(); itr!=m_vertexingAlgorithms.end(); ++itr ) {
......@@ -342,16 +340,21 @@ namespace VKalVrtAthena {
intermediateVertexContainer ->setStore( intermediateVertexAuxContainer );
ATH_CHECK( evtStore()->record( intermediateVertexContainer, "VrtSecInclusive_IntermediateVertices_" + name ) );
ATH_CHECK( evtStore()->record( intermediateVertexAuxContainer, "VrtSecInclusive_IntermediateVertices_" + name + "Aux." ) );
ATH_CHECK( evtStore()->record( intermediateVertexContainer, "VrtSecInclusive_IntermediateVertices_" + name + m_jp.augVerString ) );
ATH_CHECK( evtStore()->record( intermediateVertexAuxContainer, "VrtSecInclusive_IntermediateVertices_" + name + m_jp.augVerString + "Aux." ) );
}
}
dumpTruthInformation();
// Later use elsewhere in the algorithm
m_selectedTracks.reset ( new std::vector<const xAOD::TrackParticle*> );
m_associatedTracks.reset( new std::vector<const xAOD::TrackParticle*> );
m_extrapolatedPatternBank.clear();
///////////////////////////////////////////////////////////////////////////
//
// now start algorithm
......@@ -407,11 +410,20 @@ namespace VKalVrtAthena {
auto& name = itr->first;
auto alg = itr->second;
auto t_start = std::chrono::system_clock::now();
ATH_CHECK( (this->*alg)( workVerticesContainer ) );
auto t_end = std::chrono::system_clock::now();
if( m_jp.FillHist ) {
auto sec = std::chrono::duration_cast<std::chrono::microseconds>( t_end - t_start ).count();
m_hists["CPUTime"]->Fill( m_vertexingAlgorithmStep, sec/1.e6 );
}
auto end = std::remove_if( workVerticesContainer->begin(), workVerticesContainer->end(),
[]( WrkVrt& wrkvrt ) {
return wrkvrt.isGood == false || wrkvrt.nTracksTotal() < 2; }
return ( wrkvrt.isGood == false || wrkvrt.nTracksTotal() < 2 ); }
);
workVerticesContainer->erase( end, workVerticesContainer->end() );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment