12#include "CLHEP/GenericFunctions/CumulativeChiSquare.hh"
14#include "GaudiKernel/IToolSvc.h"
24 const std::string& name,
const IInterface* parent) :
30 declareInterface<TrackSelector>(
this);
77 return StatusCode::FAILURE;
85 ATH_MSG_INFO(
"Using InDetEtaDependentCutsSvc. Track selections from config not used");
94 m_pTMin = 0.4*Gaudi::Units::GeV;
99 msg(MSG::DEBUG) <<
"#BTAG# TrackSelector " << name() <<
" cuts: " <<
endmsg;
124 msg(MSG::DEBUG) <<
"#BTAG# using conddb for b-layer hit requirements " <<
endmsg;
135 msg(MSG::DEBUG) <<
"#BTAG# - nbHitsSi+nbDeadPix+nbDeadSct >= " << nhsi <<
endmsg;
137 msg(MSG::DEBUG) <<
"#BTAG# - nbHitsSi+nbDeadPix >= " << nhsi <<
endmsg;
141 msg(MSG::DEBUG) <<
"#BTAG# - nbHitsSi+nbDeadSct >= " << nhsi <<
endmsg;
143 msg(MSG::DEBUG) <<
"#BTAG# - nbHitsSi >= " << nhsi <<
endmsg;
157 return StatusCode::SUCCESS;
165 return StatusCode::SUCCESS;
173 std::bitset<17> failedCuts;
179 std::bitset<17>& failedCuts,
187 trackD0 = track->d0();
188 trackZ0 = track->z0() - pv.z();
189 tracksigD0 = std::sqrt(track->definingParametersCovMatrix()(0,0));
190 tracksigZ0 = std::sqrt(track->definingParametersCovMatrix()(1,1));
193 auto ctx = Gaudi::Hive::currentContext();
195 if (perigee==
nullptr) {
199 trackD0 = perigee->parameters()[
Trk::d0];
200 trackZ0 = perigee->parameters()[
Trk::z0];
201 tracksigD0 = std::sqrt((*perigee->covariance())(
Trk::d0,
Trk::d0));
202 tracksigZ0 = std::sqrt((*perigee->covariance())(
Trk::z0,
Trk::z0));
206 <<
" Eta= " << track->eta() <<
" Phi= " << track->phi() <<
" pT= " <<track->pt()
207 <<
" d0= " << trackD0
208 <<
" z0= " << trackZ0 <<
" sigd0= " << tracksigD0 <<
" sigz0: " << tracksigZ0 );
211 double eta = track->eta();
214 if(track->pt() < pTMin_cut) {
216 failedCuts.set(
pTMin);
219 failedCuts.set(
pTMin);
223 if(std::abs(trackD0)>d0_cut) {
225 failedCuts.set(
d0Max);
229 if(std::abs(trackZ0*sin(track->theta()))>z0_cut) {
231 failedCuts.set(
z0Max);
250 if(std::abs(track->eta())>eta_cut) {
266 ATH_MSG_WARNING(
"#BTAG# expectInnermostPixelLayerHit not computed in TrackSummary: assuming true");
279 if(nhp>=PixHole_cut) {
289 np += std::max((
int)ndead, 0);
303 ns += std::max((
int)ndead,0);
306 if(ns < SCTStrip_cut) {
312 if((np+ns) < Si_cut) {
339 bool innerHitsCrit = ((nibl+nnibl)>0);
340 bool lowetaCrit = fabs(track->eta())> 1.65 && (ns+np)>=11;
341 bool highetaCrit = fabs(track->eta())<=1.65 && (ns+np)>=9 ;
342 bool pixholeCrit = (nhp==0) ;
343 bool isTight = innerHitsCrit && pixholeCrit && (lowetaCrit || highetaCrit);
353 double chi2 = track->chiSquared();
354 int ndf = track->numberDoF();
356 if(ndf>0 &&
chi2>=0.) {
357 Genfun::CumulativeChiSquare myCumulativeChiSquare(ndf);
358 proba = 1.-myCumulativeChiSquare(
chi2);
379 if(
msgLvl(MSG::VERBOSE) ){
382 int passl = ~failedCuts[(
m_Cuts)i];
384 msg(MSG::VERBOSE) << passl;
Scalar eta() const
pseudorapidity method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
static const Attributes_t empty
virtual StatusCode initialize() override
double m_antiPileUpSigZ0Cut
bool m_useTrackingTightDefinition
int m_antiPileUpNHitSiCut
double m_pTMin
if true use perigee parameters instead of parameters w.r.t. primary vertex
int m_antiPileUpNHolePixCut
bool m_useTrackSummaryInfo
max. pseudo-rapidity
virtual StatusCode finalize() override
int m_nHitSct
at least n hits in pixels
double m_fitChi2
if false the following cuts are ignored
ServiceHandle< InDet::IInDetEtaDependentCutsSvc > m_etaDependentCutsSvc
service to get cut values depending on different variable
static const InterfaceID & interfaceID()
std::string m_inputTrackCollection
double m_fitChi2OnNdfMax
min. fit chi2 probability
std::atomic< int > m_ntrc[numCuts]
bool m_usePerigeeParameters
Properties for V0 finding: not yet implemented.
bool m_useDeadPixInfo
at least n transition hits in TRT
bool m_useEtaDependentCuts
int m_nHitTrt
at least n hits in pixels+SCT
double m_z0Max
max. d0: |d0|<d0Max
int m_nHitPix
at least n hits in Blayer
double m_sigd0Max
max. z0:
TrackSelector(const std::string &type, const std::string &name, const IInterface *parent)
bool m_useTrackQualityInfo
if true uses dead SCT sensors to compute nSct
ToolHandle< Reco::ITrackToVertex > m_trackToVertexTool
bool m_useAntiPileUpCuts
location of shared map in StoreGate
bool selectTrack(const Amg::Vector3D &pv, const xAOD::TrackParticle *track, double refPt=0) const
Returns true if the argument track fulfills the selection.
bool m_usepTDepTrackSel
min. pT: |pT|>pTMin
int m_nHitSi
at least n hits in SCT
int m_nHitTrtHighE
at least n hits in TRT
double m_antiPileUpSigD0Cut
activate antiPU cut d0z0
bool m_useDeadSctInfo
if true uses dead pixel sensors from conddb (except b-layer) to compute nPix
std::string m_outputTrackCollection
location of inputTracks in StoreGate
double m_fitProb
max. fit chi2
bool m_useBLayerHitPrediction
if false the following cuts are ignored
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
bool msgLvl(const MSG::Level lvl) const
double chi2(TH1 *h0, TH1 *h1)
Eigen::Matrix< double, 3, 1 > Vector3D
The namespace of all packages in PhysicsAnalysis/JetTagging.
static const InterfaceID IID_ITrackSelector("Analysis::TrackSelector", 1, 0)
TrackParticle_v1 TrackParticle
Reference the current persistent version:
@ expectInnermostPixelLayerHit
Do we expect a 0th-layer barrel hit for this track?
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
@ numberOfTRTHits
number of TRT hits [unit8_t].
@ numberOfSCTDeadSensors
number of dead SCT sensors crossed [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].
@ numberOfTRTHighThresholdHits
number of TRT hits which pass the high threshold (only xenon counted) [unit8_t].
@ numberOfPixelDeadSensors
number of dead pixel sensors crossed [unit8_t].