28 bool VrtSecInclusive::selectTrack_d0Cut (
const xAOD::TrackParticle* trk )
const {
return ( fabs( trk->
d0() ) > m_jp.d0TrkPVDstMinCut && fabs( trk->
d0() ) < m_jp.d0TrkPVDstMaxCut ); }
29 bool VrtSecInclusive::selectTrack_z0Cut (
const xAOD::TrackParticle* trk )
const {
return ( fabs( trk->
z0() ) > m_jp.z0TrkPVDstMinCut && fabs( trk->
z0() ) < m_jp.z0TrkPVDstMaxCut ); }
34 bool VrtSecInclusive::selectTrack_pTCut (
const xAOD::TrackParticle* trk )
const {
return trk->
pt() > m_jp.TrkPtCut; }
54 uint8_t SharedHits = PixShare + SCTShare;
57 if( !m_jp.SAloneTRT ) {
58 if(PixelHits < m_jp.CutPixelHits)
return false;
59 if(SCTHits < m_jp.CutSctHits)
return false;
60 if((PixelHits+SCTHits) < m_jp.CutSiHits)
return false;
61 if(BLayHits < m_jp.CutBLayHits)
return false;
62 if(SharedHits > m_jp.CutSharedHits)
return false;
66 if( m_jp.doTRTPixCut ) {
67 if(TRTHits == 0 && PixelHits < 2)
return false;
70 if( PixelHits == 0 && SCTHits < 6 )
return false;
85 if( trk->
pt() > 20.e3 )
return true;
87 if( SCTHits < m_jp.CutTightSCTHits )
return false;
89 if( fabs( trk->
eta() ) < 1.7 ) {
90 if( TRTHits < m_jp.CutTightTRTHits )
return false;
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 ;
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) ;
127 return (z0_cut && chi2_cut && NSiHits_cut && NSCTHits_cut && NSCTHoles_cut && geometric_cut);
138 if( !m_decor_isSelected ) m_decor_isSelected = std::make_unique< SG::AuxElement::Decorator< char > >(
"is_selected" + m_jp.augVerString );
141 if( m_trackSelectionFuncs.empty() && !m_jp.passThroughTrackSelection ) {
144 if( m_jp.do_PVvetoCut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_notPVassociated );
145 if( m_jp.do_d0Cut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_d0Cut );
146 if( m_jp.do_z0Cut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_z0Cut );
147 if( m_jp.do_d0errCut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_d0errCut );
148 if( m_jp.do_z0errCut ) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_z0errCut );
149 if (m_jp.doSelectTracksWithLRTCuts) m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_LRTR3Cut );
154 m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_hitPattern );
155 m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_hitPatternTight );
156 m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_chi2Cut );
157 m_trackSelectionFuncs.emplace_back( &VrtSecInclusive::selectTrack_pTCut );
161 if(
std::find( m_selectedTracks->begin(), m_selectedTracks->end(), trk ) != m_selectedTracks->end() )
return;
163 std::vector<bool> cutBits;
165 cutBits.reserve(m_trackSelectionFuncs.size());
166 for(
auto func : m_trackSelectionFuncs ) cutBits.emplace_back( (this->*func)( trk ) );
168 if( m_jp.FillHist ) {
169 m_hists[
"trkSelCuts"]->Fill( 0 );
170 for(
size_t ibit = 0; ibit < cutBits.size(); ibit++) {
171 if( cutBits.at(ibit) ) {
172 m_hists[
"trkSelCuts"]->Fill( ibit+1 );
180 bool isGood_standard = (
std::find( cutBits.begin(), cutBits.end(),
false ) == cutBits.end() );
182 if( isGood_standard ) {
200 (*m_decor_isSelected)( *trk ) =
true;
201 if (m_jp.doSelectTracksFromElectrons || m_jp.doSelectIDAndGSFTracks) {
204 if (id_tr !=
nullptr){
205 (*m_decor_isSelected)( *id_tr ) =
true; }
208 m_selectedTracks->emplace_back( trk );
210 if( m_jp.FillNtuple ) m_ntupleVars->get< vector<int> >(
"SelTrk_barcode" ).emplace_back(
barcode);
212 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": Track index " << trk->index() <<
" has been selected." );
213 ATH_MSG_VERBOSE(
" > " << __FUNCTION__ <<
": Track index " << trk->index()
215 <<
" pt = " << trk->pt()
216 <<
" eta = " << trk->eta()
217 <<
" d0 = " << trk->d0()
218 <<
" z0 = " << trk->z0() <<
"." );
236 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Extracted xAOD::TrackParticle number=" << trackParticleContainer->
size() );
238 if( m_jp.FillNtuple )
239 m_ntupleVars->get<
unsigned int>(
"NumAllTrks" ) =
static_cast<int>( trackParticleContainer->
size() );
243 for(
const auto *trk : *trackParticleContainer ) { selectTrack( trk ); }
245 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Number of total ID tracks = " << trackParticleContainer->size() );
246 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Number of selected tracks = " << m_selectedTracks->size() );
248 return StatusCode::SUCCESS;
259 for(
const auto *
const muon : *muons ) {
260 const auto* trk =
muon->trackParticle( xAOD::Muon::InnerDetectorTrackParticle );
264 if (m_jp.doRemoveCaloTaggedMuons) {
265 if (
muon->muonType() == xAOD::Muon::CaloTagged)
continue;
271 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Number of total muons = " << muons->size() );
272 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Number of selected tracks = " << m_selectedTracks->size() );
274 return StatusCode::SUCCESS;
285 if( 0 ==
electron->nTrackParticles() )
continue;
288 const auto* trk =
electron->trackParticle(0);
295 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Number of selected tracks = " << m_selectedTracks->size() );
297 return StatusCode::SUCCESS;
319 std::vector<const xAOD::TrackParticle*> IDTrksFromEls;
323 if( 0 ==
electron->nTrackParticles() ) {
continue; }
327 m_leptonicTracks->emplace_back(
el_trk);
332 for(
const auto *trk : *IDtracks ) {
334 if (
std::find(IDTrksFromEls.begin(), IDTrksFromEls.end(), trk) != IDTrksFromEls.end() ) {
continue; }
339 for (
const auto *
muon : *muons) {
340 if (m_jp.doRemoveCaloTaggedMuons &&
muon->muonType() == xAOD::Muon::CaloTagged) {
continue; }
341 const auto*
mu_trk =
muon->trackParticle( xAOD::Muon::InnerDetectorTrackParticle );
343 m_leptonicTracks->emplace_back(
mu_trk);
346 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Number of total ID tracks = " << IDtracks->size() );
348 ATH_MSG_DEBUG(
" > " << __FUNCTION__ <<
": Number of selected tracks = " << m_selectedTracks->size() );
350 return StatusCode::SUCCESS;