40 uint8_t PixelHits = 0;
54 uint8_t SharedHits = PixShare + SCTShare;
67 if(TRTHits == 0 && PixelHits < 2)
return false;
70 if( PixelHits == 0 && SCTHits < 6 )
return false;
77 uint8_t PixelHits = 0;
85 if( trk->
pt() > 20.e3 )
return true;
89 if( fabs( trk->
eta() ) < 1.7 ) {
107 uint8_t nSiHits = npix + nsct ;
111 double dTheta = std::fabs(TMath::ATan2(std::fabs(trk->
d0()),trk->
z0())-2*std::atan(std::exp(-1*trk->
eta())));
112 bool geometric_cut = dTheta < 1. || std::fabs(trk->
z0()) < 200. ;
114 bool z0_cut = trk->
z0() <= 500. ;
116 bool NSiHits_cut = nSiHits >=8 ;
117 bool NSCTHits_cut = nsct >= 7 ;
118 bool NSCTHoles_cut = nSCTHoles <= 1;
120 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": z0_cut, chi2_cut, NSiHits_cut, NSCTHits_cut, NSCTHoles_cut = " <<z0_cut<<
", "<<chi2_cut<<
", "<<NSiHits_cut<<
", "<<NSCTHits_cut<<
", "<< NSCTHoles_cut );
121 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": npix, nsct, nSiHits, nSCTHoles, dTheta, z0, d0, chi2 = " <<
unsigned(npix)<<
", "<<
unsigned(nsct)<<
", "<<
unsigned(nSiHits)<<
", "<<
unsigned(nSCTHoles)<<
", "<< dTheta<<
", "<< trk->
z0()<<
", "<< trk->
d0()<<
", " <<trk->
chiSquared() ) ;
123 const std::bitset<xAOD::NumberOfTrackRecoInfo> patternReco = trk->
patternRecoInfo();
124 bool isLRT = patternReco.test(49) ;
125 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Track is LRT = " << isLRT ) ;
127 return (z0_cut && chi2_cut && NSiHits_cut && NSCTHits_cut && NSCTHoles_cut && geometric_cut);
165 std::vector<bool> cutBits;
171 m_hists[
"trkSelCuts"]->Fill( 0 );
172 for(
size_t ibit = 0; ibit < cutBits.size(); ibit++) {
173 if( cutBits.at(ibit) ) {
174 m_hists[
"trkSelCuts"]->Fill( ibit+1 );
182 bool isGood_standard = ( std::find( cutBits.begin(), cutBits.end(),
false ) == cutBits.end() );
184 if( isGood_standard ) {
202 (*m_decor_isSelected)( *trk ) =
true;
206 if (id_tr) { (*m_decor_isSelected)( *id_tr ) =
true; }
213 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": Track index " << trk->index() <<
" has been selected." );
214 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": Track index " << trk->index()
216 <<
" pt = " << trk->pt()
217 <<
" eta = " << trk->eta()
218 <<
" d0 = " << trk->d0()
219 <<
" z0 = " << trk->z0() <<
"." );
237 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Extracted xAOD::TrackParticle number=" << trackParticleContainer->
size() );
240 m_ntupleVars->get<
unsigned int>(
"NumAllTrks" ) =
static_cast<int>( trackParticleContainer->
size() );
244 for(
const auto *trk : *trackParticleContainer ) {
selectTrack( trk ); }
246 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Number of total ID tracks = " << trackParticleContainer->
size() );
249 return StatusCode::SUCCESS;
260 for(
const auto *
const muon : *muons ) {
261 const auto* trk = muon->trackParticle( xAOD::Muon::InnerDetectorTrackParticle );
266 if (muon->muonType() == xAOD::Muon::CaloTagged)
continue;
272 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Number of total muons = " << muons->
size() );
275 return StatusCode::SUCCESS;
285 for(
const auto *
const electron : *electrons ) {
286 if( 0 == electron->nTrackParticles() )
continue;
289 const auto* trk = electron->trackParticle(0);
295 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Number of total electrons = " << electrons->size() );
298 return StatusCode::SUCCESS;
322 std::vector<const xAOD::TrackParticle*> IDTrksFromEls;
325 for(
const auto *electron : *electrons ) {
326 if( 0 == electron->nTrackParticles() ) {
continue; }
328 const auto* el_trk = electron->trackParticle(0);
335 for(
const auto *trk : *IDtracks ) {
337 if ( std::find(IDTrksFromEls.begin(), IDTrksFromEls.end(), trk) != IDTrksFromEls.end() ) {
continue; }
342 for (
const auto *muon : *muons) {
344 const auto* mu_trk = muon->trackParticle( xAOD::Muon::InnerDetectorTrackParticle );
345 if(!mu_trk) {
continue; }
349 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Number of total ID tracks = " << IDtracks->
size() );
350 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Number of total electrons = " << electrons->size() );
353 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
size_type size() const noexcept
Returns the number of elements in the collection.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
Gaudi::Property< bool > m_doSelectIDAndGSFTracks
Gaudi::Property< bool > m_SAloneTRT
Gaudi::Property< double > m_d0TrkPVDstMinCut
bool selectTrack_pTCut(const xAOD::TrackParticle *) const
Gaudi::Property< double > m_TrkPtCut
Gaudi::Property< double > m_d0TrkErrorCut
Gaudi::Property< bool > m_doTRTPixCut
static const xAOD::TruthParticle * getTrkGenParticle(const xAOD::TrackParticle *)
Gaudi::Property< bool > m_do_d0Cut
Gaudi::Property< bool > m_do_z0errCut
SG::ReadHandleKey< xAOD::MuonContainer > m_MuonLocation
Gaudi::Property< int > m_CutSiHits
Gaudi::Property< bool > m_doRemoveCaloTaggedMuons
Gaudi::Property< bool > m_do_d0errCut
Gaudi::Property< int > m_CutBLayHits
bool selectTrack_chi2Cut(const xAOD::TrackParticle *) const
bool selectTrack_notPVassociated(const xAOD::TrackParticle *) const
track-by-track selection strategies
StatusCode selectTracksFromElectrons(const EventContext &ctx)
StatusCode selectTracksFromMuons(const EventContext &ctx)
Gaudi::Property< bool > m_do_PVvetoCut
void selectTrack(const xAOD::TrackParticle *)
Vertexing Algorithm Member Functions.
bool selectTrack_hitPatternTight(const xAOD::TrackParticle *) const
Gaudi::Property< bool > m_passThroughTrackSelection
static bool selectTrack_d0signifCut(const xAOD::TrackParticle *)
Gaudi::Property< double > m_z0TrkPVDstMaxCut
bool selectTrack_d0errCut(const xAOD::TrackParticle *) const
std::unique_ptr< NtupleVars > m_ntupleVars
Gaudi::Property< int > m_CutTightTRTHits
SG::ReadHandleKey< xAOD::ElectronContainer > m_ElectronLocation
bool selectTrack_hitPattern(const xAOD::TrackParticle *) const
Gaudi::Property< bool > m_doSelectTracksWithLRTCuts
Gaudi::Property< bool > m_do_z0Cut
Gaudi::Property< bool > m_doSelectTracksFromElectrons
Gaudi::Property< bool > m_FillHist
std::vector< CutFunc > m_trackSelectionFuncs
std::optional< SG::Decorator< char > > m_decor_isSelected
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_TrackLocation
Gaudi::Property< double > m_z0TrkErrorCut
std::map< std::string, TH1 * > m_hists
Gaudi::Property< int > m_CutSharedHits
Gaudi::Property< bool > m_FillNtuple
bool selectTrack_LRTR3Cut(const xAOD::TrackParticle *) const
Gaudi::Property< double > m_TrkChi2Cut
bool selectTrack_d0Cut(const xAOD::TrackParticle *) const
bool selectTrack_z0Cut(const xAOD::TrackParticle *) const
const xAOD::VertexContainer * m_primaryVertices
Gaudi::Property< int > m_CutSctHits
Gaudi::Property< double > m_d0TrkPVDstMaxCut
bool selectTrack_z0errCut(const xAOD::TrackParticle *) const
std::vector< const xAOD::TrackParticle * > m_selectedTracks
Gaudi::Property< int > m_CutPixelHits
static bool selectTrack_z0signifCut(const xAOD::TrackParticle *)
Gaudi::Property< std::string > m_augVerString
StatusCode selectTracksInDet(const EventContext &ctx)
std::vector< const xAOD::TrackParticle * > m_leptonicTracks
Gaudi::Property< double > m_z0TrkPVDstMinCut
Gaudi::Property< bool > m_doTruth
Gaudi::Property< int > m_CutTightSCTHits
StatusCode selectInDetAndGSFTracks(const EventContext &ctx)
float z0() const
Returns the parameter.
float numberDoF() const
Returns the number of degrees of freedom of the overall track or vertex fit as float.
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
std::bitset< NumberOfTrackRecoInfo > patternRecoInfo() const
Access method for pattern recognition algorithm.
float d0() const
Returns the parameter.
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
float chiSquared() const
Returns the of the overall track fit.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
constexpr int UNDEFINED_ID
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
constexpr double infinitesimal
bool isAssociatedToVertices(const xAOD::TrackParticle *trk, const xAOD::VertexContainer *vertices)
const xAOD::TrackParticle * getOriginalTrackParticleFromGSF(const xAOD::TrackParticle *trkPar)
Helper function for getting the "Original" Track Particle (i.e before GSF) via the GSF Track Particle...
const xAOD::TrackParticle * getOriginalTrackParticle(const xAOD::Electron *el)
Helper function for getting the "Original" Track Particle (i.e before GSF) via the electron.
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TruthParticle_v1 TruthParticle
Typedef to implementation.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
@ numberOfTRTHits
number of TRT hits [unit8_t].
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
@ numberOfSCTHoles
number of SCT holes [unit8_t].