|
ATLAS Offline Software
|
#include <BMuonTrackIsoTool.h>
|
enum | track_type {
ASSOCPV,
PVTYPE0,
PVTYPE1,
PVTYPE2,
PVTYPE3,
NONE,
NULLVP,
CAPVRFN3U0,
CAPVNRN3U0,
CAPVRF3DU0,
CAPVNR3DU0,
CAPVRFN3U1,
CAPVNRN3U1,
CAPVRF3DU1,
CAPVNR3DU1,
CAPVRFN3U2,
CAPVNRN3U2,
CAPVRF3DU2,
CAPVNR3DU2,
CAPVRFNNU3,
CAPVNRNNU3,
CAPVRFNNU4,
CAPVNRNNU4,
CAPVRFNNU5,
CAPVNRNNU5,
CAPVRFNNU6,
CAPVNRNNU6,
CAPVRFNNU7,
CAPVNRNNU7,
CAPVRFNNU8,
CAPVNRNNU8,
CAPVRFNNU9,
CAPVNRNNU9
} |
|
|
| BMuonTrackIsoTool (const std::string &t, const std::string &n, const IInterface *p) |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | finalize () override |
|
virtual StatusCode | addBranches () const override |
| Pass the thinning service
More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
virtual StatusCode | initializeHook () override |
|
virtual StatusCode | finalizeHook () override |
|
virtual StatusCode | addBranchesVCSetupHook (size_t ivc) const override |
|
virtual StatusCode | addBranchesSVLoopHook (const xAOD::Vertex *vtx) const override |
|
virtual StatusCode | calcValuesHook (const xAOD::Vertex *vtx, const unsigned int ipv, const unsigned int its, const unsigned int itt) const override |
|
virtual bool | fastFillHook (const xAOD::Vertex *vtx, const int ipv) const override |
|
virtual StatusCode | addBranchesHook () const |
|
StatusCode | calculateValues (const xAOD::Vertex *vtx) const |
|
virtual std::string | buildPvAssocCacheName (const xAOD::Vertex *vtx, const int ipv) const |
|
virtual void | initPvAssocTypeVec () |
|
TrackBag | findAllTracksInDecay (xAOD::BPhysHelper &vtx) const |
|
void | findAllTracksInDecay (xAOD::BPhysHelper &vtx, TrackBag &tracks) const |
|
MuonBag | findAllMuonsInDecay (xAOD::BPhysHelper &vtx) const |
|
void | findAllMuonsInDecay (xAOD::BPhysHelper &vtx, MuonBag &muons) const |
|
TrackBag | findAllMuonIdTracksInDecay (xAOD::BPhysHelper &vtx, MuonBag &muons) const |
|
std::vector< TVector3 > | findMuonRefTrackMomenta (xAOD::BPhysHelper &vtx, MuonBag &muons) const |
|
TrackBag | selectTracks (const xAOD::TrackParticleContainer *inpTracks, xAOD::BPhysHelper &cand, const unsigned int ipv, const unsigned int its, const unsigned int itt) const |
|
TrackBag | selectTracks (const xAOD::TrackParticleContainer *inpTracks, const TrackBag &exclTracks, xAOD::BPhysHelper &cand, const unsigned int ipv, const unsigned int its, const unsigned int itt) const |
|
uint64_t | detTrackTypes (const xAOD::TrackParticle *track, const xAOD::Vertex *candPV, const xAOD::Vertex *candRefPV) const |
|
double | getTrackCandPVLogChi2 (const xAOD::TrackParticle *track, const xAOD::Vertex *vtx, bool doDCAin3D=false, int chi2DefToUse=0) const |
|
std::vector< double > | getTrackLogChi2DCA (const xAOD::TrackParticle *track, const xAOD::Vertex *vtx, bool doDCAin3D=false, int chi2DefToUse=0) const |
|
std::string | buildBranchBaseName (unsigned int its, unsigned int ipv, unsigned int itt, const std::string &preSuffix="") const |
|
std::pair< const xAOD::Vertex *, double > | findMinChi2PV (const xAOD::TrackParticle *track, const xAOD::Vertex *candPV, const xAOD::Vertex *candRefPV, const std::vector< uint64_t > &pvtypes, const int minNTracksInPV, const bool useRefittedPvs, const bool doDCAin3D, const int chi2DefToUse) const |
|
const xAOD::Vertex * | findAssocPV (const xAOD::TrackParticle *track, const xAOD::Vertex *candPV, const xAOD::Vertex *candRefPV, const std::vector< uint64_t > &pvtypes, const int minNTracksInPV, const bool useRefittedPvs) const |
|
void | renounceArray (SG::VarHandleKeyArray &handlesArray) |
| remove all handles from I/O resolution More...
|
|
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > | renounce (T &h) |
|
void | extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps) |
| Add StoreName to extra input/output deps as needed. More...
|
|
Definition at line 32 of file BMuonTrackIsoTool.h.
◆ MuIsoItem4_t
◆ StoreGateSvc_t
◆ StringIntMap_t
◆ super
◆ track_type
Enumerator |
---|
ASSOCPV | |
PVTYPE0 | |
PVTYPE1 | |
PVTYPE2 | |
PVTYPE3 | |
NONE | |
NULLVP | |
CAPVRFN3U0 | |
CAPVNRN3U0 | |
CAPVRF3DU0 | |
CAPVNR3DU0 | |
CAPVRFN3U1 | |
CAPVNRN3U1 | |
CAPVRF3DU1 | |
CAPVNR3DU1 | |
CAPVRFN3U2 | |
CAPVNRN3U2 | |
CAPVRF3DU2 | |
CAPVNR3DU2 | |
CAPVRFNNU3 | |
CAPVNRNNU3 | |
CAPVRFNNU4 | |
CAPVNRNNU4 | |
CAPVRFNNU5 | |
CAPVNRNNU5 | |
CAPVRFNNU6 | |
CAPVNRNNU6 | |
CAPVRFNNU7 | |
CAPVNRNNU7 | |
CAPVRFNNU8 | |
CAPVNRNNU8 | |
CAPVRFNNU9 | |
CAPVNRNNU9 | |
Definition at line 114 of file BPhysVertexTrackBase.h.
◆ BMuonTrackIsoTool()
DerivationFramework::BMuonTrackIsoTool::BMuonTrackIsoTool |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
Definition at line 97 of file BMuonTrackIsoTool.cxx.
102 declareInterface<DerivationFramework::IAugmentationTool>(
this);
◆ addBranches()
StatusCode DerivationFramework::BPhysVertexTrackBase::addBranches |
( |
| ) |
const |
|
overridevirtualinherited |
◆ addBranchesHook()
StatusCode DerivationFramework::BPhysVertexTrackBase::addBranchesHook |
( |
| ) |
const |
|
protectedvirtualinherited |
◆ addBranchesSVLoopHook()
StatusCode DerivationFramework::BMuonTrackIsoTool::addBranchesSVLoopHook |
( |
const xAOD::Vertex * |
vtx | ) |
const |
|
overrideprotectedvirtual |
◆ addBranchesVCSetupHook()
StatusCode DerivationFramework::BMuonTrackIsoTool::addBranchesVCSetupHook |
( |
size_t |
ivc | ) |
const |
|
overrideprotectedvirtual |
◆ buildBranchBaseName()
std::string DerivationFramework::BPhysVertexTrackBase::buildBranchBaseName |
( |
unsigned int |
its, |
|
|
unsigned int |
ipv, |
|
|
unsigned int |
itt, |
|
|
const std::string & |
preSuffix = "" |
|
) |
| const |
|
protectedinherited |
Definition at line 1311 of file BPhysVertexTrackBase.cxx.
1317 ATH_MSG_DEBUG(
"BPhysVertexTrackBase::buildBranchBaseName -- begin");
1323 std::size_t ipos = tsName.find_last_of(
"_");
1324 if ( ipos != std::string::npos ) tsName = tsName.substr(ipos+1);
1329 (preSuffix.length() > 0 ?
"_" + preSuffix :
""),
1332 ATH_MSG_DEBUG(
"BPhysVertexBaseTrackBase::buildBranchBaseName: " <<
f);
◆ buildBranchName()
std::string DerivationFramework::BMuonTrackIsoTool::buildBranchName |
( |
unsigned int |
ic, |
|
|
unsigned int |
its, |
|
|
unsigned int |
ipv, |
|
|
unsigned int |
itt |
|
) |
| const |
|
private |
◆ buildPvAssocCacheName()
std::string DerivationFramework::BPhysVertexTrackBase::buildPvAssocCacheName |
( |
const xAOD::Vertex * |
vtx, |
|
|
const int |
ipv |
|
) |
| const |
|
protectedvirtualinherited |
◆ calculateValues()
StatusCode DerivationFramework::BPhysVertexTrackBase::calculateValues |
( |
const xAOD::Vertex * |
vtx | ) |
const |
|
protectedinherited |
Definition at line 638 of file BPhysVertexTrackBase.cxx.
640 ATH_MSG_DEBUG(
"BPhysVertexTrackBase::calculateValues -- begin");
649 for (
unsigned int ipv = 0; ipv < nPvAssocs; ++ipv) {
651 for (
unsigned int its = 0; its < nTrackSels; ++its) {
652 for (
unsigned int itt = 0; itt < nTrackTypes; ++itt) {
654 <<
", its: " << its <<
", itt: " << itt);
662 <<
" -- cached ipv: " << ipv);
666 return StatusCode::SUCCESS;
◆ calcValuesHook()
StatusCode DerivationFramework::BMuonTrackIsoTool::calcValuesHook |
( |
const xAOD::Vertex * |
vtx, |
|
|
const unsigned int |
ipv, |
|
|
const unsigned int |
its, |
|
|
const unsigned int |
itt |
|
) |
| const |
|
overrideprotectedvirtual |
Reimplemented from DerivationFramework::BPhysVertexTrackBase.
Definition at line 194 of file BMuonTrackIsoTool.cxx.
200 <<
", its: " << its <<
", itt: " << itt);
204 TVector3 candP = cand.totalP();
214 " muons and " << candMuTracks.size() <<
215 " tracks from B cand; " << tracks.size() <<
216 " tracks to check.");
220 for (
unsigned int ic = 0;
ic < nCones; ++
ic) {
229 for (
id=0;
id < candMuTracks.size(); ++
id) {
233 if ( candMuTracks[
id].Mag() > 0. ) {
239 double nTracksInCone = 0;
240 double ptSumInCone = 0.;
242 double isoValue(-5.);
245 if ( candRefPV != NULL ) {
247 for (TrackBag::const_iterator trkItr = tracks.begin();
248 trkItr != tracks.end(); ++trkItr) {
249 double deltaR = candMuTracks[
id].DeltaR((*trkItr)->p4().Vect());
251 double logChi2 = (doLogChi2 > 0) ?
254 if ( doLogChi2 == 2 ) logChi2 = abs(logChi2);
255 if ( doLogChi2 == 0 || logChi2 < logChi2Max ) {
257 ptSumInCone += (*trkItr)->pt();
262 if ( ptSumInCone + candMuTracks[
id].
Pt() > 0. ) {
263 isoValue = candMuTracks[
id].Pt()
264 / ( ptSumInCone + candMuTracks[
id].Pt() );
272 iso.fill(isoValue, nTracksInCone,
muon);
277 return StatusCode::SUCCESS;
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ detTrackTypes()
Definition at line 1001 of file BPhysVertexTrackBase.cxx.
1007 ATH_MSG_ERROR(
"BPhysVertexTrackBase::detTrackTypes must be adjusted due to changes in TrackParticle");
1010 if ( candPV != NULL ) {
1023 bool useRefittedPvs = (
i%2 == 1 );
1024 bool doDCAin3D = ( (
i-7)%4 > 1 );
1025 int chi2DefToUse = (
i-7)/4;
1029 chi2DefToUse = (
i-13)/2;
1032 if ( chi2DefToUse == 5 ) {
1040 doDCAin3D, chi2DefToUse).first;
1042 if ( candPV == minChi2PV
1043 || (candRefPV !=
nullptr && candRefPV == minChi2PV) ) {
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ fastFillHook()
◆ finalize()
StatusCode DerivationFramework::BPhysVertexTrackBase::finalize |
( |
| ) |
|
|
overridevirtualinherited |
◆ finalizeHook()
StatusCode DerivationFramework::BMuonTrackIsoTool::finalizeHook |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ findAllMuonIdTracksInDecay()
Definition at line 1131 of file BPhysVertexTrackBase.cxx.
1137 for (MuonBag::const_iterator muItr = muons.begin(); muItr != muons.end();
1140 (*muItr)->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
1141 tracks.push_back(
track);
◆ findAllMuonsInDecay() [1/2]
◆ findAllMuonsInDecay() [2/2]
◆ findAllTracksInDecay() [1/2]
◆ findAllTracksInDecay() [2/2]
◆ findAssocPV()
Definition at line 1411 of file BPhysVertexTrackBase.cxx.
1419 std::vector<const xAOD::Vertex*> vpvtx;
1421 if ( pvtx !=
nullptr ) {
1422 if (
std::find(pvtypes.begin(),pvtypes.end(),pvtx->vertexType())
1423 != pvtypes.end() ) {
1426 if ( useRefittedPvs && pvtx == candPV ) {
1427 if ( candRefPV !=
nullptr ) {
1431 <<
" candRefPV == NULL!");
1436 vpvtx.push_back(cvtx);
1451 assocPV = candRefPV;
1456 if ( assocPV ==
nullptr ) {
1462 if ( assocPV ==
nullptr ) {
1464 <<
" assocPV == NULL for track!"
1465 <<
" len(vpvtx) = " << vpvtx.size()
1466 <<
" useRefittedPvs = " << useRefittedPvs
1467 <<
" minNTracksInPV = " << minNTracksInPV);
◆ findMinChi2PV()
Definition at line 1359 of file BPhysVertexTrackBase.cxx.
1372 if ( pvtx !=
nullptr ) {
1373 if (
std::find(pvtypes.begin(),pvtypes.end(),pvtx->vertexType())
1374 != pvtypes.end() ) {
1377 if ( useRefittedPvs && pvtx == candPV ) {
1378 if ( candRefPV !=
nullptr ) {
1382 <<
" candRefPV == NULL!");
1389 if (
chi2 < minChi2 ) {
1398 return std::make_pair(minChi2PV, minChi2);
◆ findMuonRefTrackMomenta()
std::vector< TVector3 > DerivationFramework::BPhysVertexTrackBase::findMuonRefTrackMomenta |
( |
xAOD::BPhysHelper & |
vtx, |
|
|
MuonBag & |
muons |
|
) |
| const |
|
protectedinherited |
Definition at line 1152 of file BPhysVertexTrackBase.cxx.
1155 std::vector<TVector3> refMuTracks;
1159 muons = vtx.
muons();
1160 for (
auto refMuTrack : vtx.
refTrks() ) {
1161 refMuTracks.push_back(refMuTrack);
1169 if ( otp != NULL ) {
1170 if (
std::find(muonIdTracks.begin(), muonIdTracks.end(), otp)
1171 != muonIdTracks.end() ) {
1172 refMuTracks.push_back(vtx.
refTrk(
i));
1176 " refTrkOrigin == NULL for refTrk # "
1182 " size mismatch #refTrks = " << vtx.
nRefTrks()
1190 std::vector<TVector3> precRefMuTracks =
1193 for (
auto precRefMuTrack : precRefMuTracks ) {
1194 if (
std::find(refMuTracks.begin(), refMuTracks.end(),
1195 precRefMuTrack) == refMuTracks.end() ) {
1196 refMuTracks.push_back(precRefMuTrack);
1205 ATH_MSG_DEBUG(
"BPhysVertexTrackBase::findMuonRefTrackMomenta():"
1206 <<
" #muons: " << muons.size()
1207 <<
" #refMuTrks: " << refMuTracks.size());
1208 TString
str = Form(
">> refMuTracks(%d):\n", (
int)refMuTracks.size());
1209 for (
unsigned int i=0;
i < refMuTracks.size(); ++
i) {
1210 str += Form(
"(%10.4f,%10.4f,%10.4f) ",
1211 refMuTracks[
i].
x(), refMuTracks[
i].
y(),
1212 refMuTracks[
i].
z());
◆ getTrackCandPVLogChi2()
◆ getTrackLogChi2DCA()
Definition at line 722 of file BPhysVertexTrackBase.cxx.
727 std::vector<double>
res = {-999., -99., -999., -99., -100., -100., -1.,
731 const AmgSymMatrix(3) poscov = vtx->covariancePosition();
732 auto ctx =
Gaudi::Hive::currentContext();
734 if ( chi2DefToUse < 2 || (chi2DefToUse > 5 && chi2DefToUse < 8) ) {
736 std::unique_ptr<const Trk::Perigee>
738 if ( trkPerigee != NULL ) {
741 const AmgSymMatrix(5)* locError = trkPerigee->covariance();
742 if ( locError != NULL ) {
746 if ( chi2DefToUse == 1 ) {
748 Amg::Vector3D perppt(trkPerigee->momentum().y()/trkPerigee->pT(),
749 -trkPerigee->momentum().x()/trkPerigee->pT(),
751 double vtxD0Err2 = perppt.transpose()*poscov*perppt;
752 res[1] = sqrt(
pow(
res[1], 2.) + vtxD0Err2 );
753 res[3] = sqrt(
pow(
res[3], 2.) + poscov(2,2) );
755 if ( chi2DefToUse < 2 ) {
756 if ( fabs(
res[1]) > 0. && fabs(
res[3]) > 0. ) {
762 <<
" d0 = " <<
res[0] <<
", d0Err = "
763 <<
res[1] <<
", z0 = " <<
res[2]
764 <<
", z0Err = " <<
res[3]);
768 if ( chi2DefToUse > 5 && chi2DefToUse < 8 ) {
773 if ( chi2DefToUse == 6 ) {
780 AmgSymMatrix(3) mCovTrk3D = dmat.transpose()*(*locError)*dmat;
785 res[4] =
log( dvec.transpose() * (poscov+mCovTrk3D).
inverse()
787 res[7] = duvec.transpose()*poscov*duvec;
788 res[8] = duvec.transpose()*mCovTrk3D*duvec;
791 if ( chi2DefToUse == 7 ) {
799 AmgSymMatrix(2) mCovVtx2D = dmat.transpose()*poscov*dmat;
801 mCovTrk2D(0,0) = (*locError)(
Trk::
d0,
Trk::
d0);
802 mCovTrk2D(0,1) = (*locError)(
Trk::
d0,
Trk::
z0);
803 mCovTrk2D(1,0) = (*locError)(
Trk::
d0,
Trk::
z0);
804 mCovTrk2D(1,1) = (*locError)(
Trk::
z0,
Trk::
z0);
808 res[4] =
log( dvec.transpose()*(mCovVtx2D+mCovTrk2D).
inverse()
810 res[7] = duvec.transpose()*mCovVtx2D*duvec;
811 res[8] = duvec.transpose()*mCovTrk2D*duvec;
824 " locError pointer is NULL!");
828 " trkPerigee pointer is NULL!");
831 }
else if ( chi2DefToUse == 2
832 || (chi2DefToUse > 7 && chi2DefToUse < 10 )) {
837 TVector3 SV_def(vtx->
x(), vtx->
y(), vtx->
z());
841 double px = (
track->p4() ).Px();
842 double py = (
track->p4() ).Py();
845 double d0Err2 =
track->definingParametersCovMatrixVec()[0];
847 double z0Err2 =
track->definingParametersCovMatrixVec()[2];
849 double d0z0Cov =
track->definingParametersCovMatrixVec()[1];
853 TVector3 SV = SV_def - trk_origin;
858 double d0toSV =
d0 + (SV[0]*upx + SV[1]*upy);
859 double d0toSVErr2 = upx*SV_cov(0, 0)*upx + 2*upx*SV_cov(1, 0)*upy
860 + upy*SV_cov(1, 1)*upy + d0Err2;
865 double z0corr = (SV[0]*upx + SV[1]*upy)*cot_theta;
866 double z0toSV =
z0 + z0corr - SV[2];
867 double z0toSVErr2 = SV_cov(2, 2) + z0Err2;
869 double docaSV = sqrt(
pow(d0toSV, 2) +
pow(z0toSV, 2) );
871 double chi2testSV(999.);
872 if ( chi2DefToUse == 2 ) {
873 if (d0toSVErr2 !=0 && z0toSVErr2 != 0)
874 chi2testSV =
log(
pow( d0toSV, 2)/d0toSVErr2
875 +
pow( z0toSV, 2)/z0toSVErr2);
877 res = {d0toSV, sqrt(d0toSVErr2), z0toSV, sqrt(z0toSVErr2),
878 chi2testSV, (doDCAin3D ? docaSV : d0toSV), 4,
881 if ( chi2DefToUse > 7 && chi2DefToUse < 10 ) {
883 if ( chi2DefToUse == 8 ) {
888 dmat(2,0) = -d0toSV*
cos(
phi);
889 dmat(2,1) = -d0toSV*
sin(
phi);
891 track->definingParametersCovMatrix();
892 AmgSymMatrix(3) mCovTrk3D = dmat.transpose()*mCovTrk5D*dmat;
897 double chi2testSV =
log( dvec.transpose()
900 double vtx3DErr2 = duvec.transpose()*poscov*duvec;
901 double trk3DErr2 = duvec.transpose()*mCovTrk3D*duvec;
903 res = {d0toSV, sqrt(d0Err2), z0toSV, sqrt(z0Err2),
904 chi2testSV, (doDCAin3D ? docaSV : d0toSV), 5,
905 vtx3DErr2, trk3DErr2,
phi};
907 if ( chi2DefToUse == 9 ) {
915 AmgSymMatrix(2) mCovVtx2D = dmat.transpose()*SV_cov*dmat;
917 mCovTrk2D(0,0) = d0Err2;
918 mCovTrk2D(0,1) = d0z0Cov;
919 mCovTrk2D(1,0) = d0z0Cov;
920 mCovTrk2D(1,1) = z0Err2;
924 chi2testSV =
log( dvec.transpose()*(mCovVtx2D+mCovTrk2D).
inverse()
926 double vtx2DErr2 = duvec.transpose()*mCovVtx2D*duvec;
927 double trk2DErr2 = duvec.transpose()*mCovTrk2D*duvec;
929 if ( vtx2DErr2 < 0. || trk2DErr2 < 0. ) {
931 "getTrackLogChi2DCA(): "
932 <<
"vtx2DErr2 = " << vtx2DErr2
933 <<
" trk2DErr2 = " << trk2DErr2
934 <<
" chi2testSV = " << chi2testSV);
944 <<
" z0toSV = " << z0toSV
946 <<
" docaSV = " << docaSV);
950 res = {d0toSV, sqrt(d0Err2), z0toSV, sqrt(z0Err2),
951 chi2testSV, (doDCAin3D ? docaSV : d0toSV), 6,
952 vtx2DErr2, trk2DErr2,
phi};
956 <<
" docaSV == 0 !");
960 }
else if ( chi2DefToUse > 2 && chi2DefToUse < 5 ) {
966 if (chi2DefToUse == 4) {
979 double z0toPV =
track->z0() +
track->vz() - vtx->
z();
980 double z0Err2 =
track->definingParametersCovMatrixVec()[2];
981 if (chi2DefToUse == 4) z0Err2+= vtx->covariancePosition()(2,2);
982 double z0sign = z0toPV / sqrt( z0Err2 );
985 res = {-999., -99., z0toPV, sqrt(z0Err2),
chi2, -100., 4, -99., -99.,
991 " track pointer is NULL!");
◆ initialize()
StatusCode DerivationFramework::BPhysVertexTrackBase::initialize |
( |
| ) |
|
|
overridevirtualinherited |
Definition at line 402 of file BPhysVertexTrackBase.cxx.
404 ATH_MSG_DEBUG(
"BPhysVertexTrackBase::initialize() -- begin");
421 <<
") and RefPVContainerNames ("
428 <<
") and BranchPrefixes ("
444 const std::string tvaWp =
456 m_mttc = std::make_unique<TrackTypeCounter>(*
this,
name());
◆ initializeHook()
StatusCode DerivationFramework::BMuonTrackIsoTool::initializeHook |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ initPvAssocTypeVec()
void DerivationFramework::BPhysVertexTrackBase::initPvAssocTypeVec |
( |
| ) |
|
|
protectedvirtualinherited |
◆ initResults()
void DerivationFramework::BMuonTrackIsoTool::initResults |
( |
| ) |
|
|
private |
Definition at line 390 of file BMuonTrackIsoTool.cxx.
398 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::initResults : nCones = " << nCones);
399 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::initResults : nTrackSels = "
401 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::initResults : nPvAssocs = "
403 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::initResults : nTrackTypes = "
405 m_results.resize(boost::extents[nCones][nTrackSels][nPvAssocs][nTrackTypes]);
406 for (
unsigned int its = 0; its < nTrackSels; ++its) {
407 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::initResults -- its = " << its);
408 for (
unsigned int ipv = 0; ipv < nPvAssocs; ++ipv) {
409 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::initResults -- ipv = " << ipv);
410 for (
unsigned int ic = 0;
ic < nCones; ++
ic) {
412 for (
unsigned int itt = 0; itt < nTrackTypes; ++itt) {
413 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::initResults -- itt = " << itt);
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interfaceID()
static const InterfaceID& DerivationFramework::IAugmentationTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
AlgTool interface methods.
Definition at line 31 of file IAugmentationTool.h.
31 {
return IID_IAugmentationTool; }
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ rttor()
uint64_t DerivationFramework::BPhysVertexTrackBase::rttor |
( |
const std::vector< uint64_t > & |
vtypes | ) |
|
|
staticinherited |
◆ saveIsolation()
StatusCode DerivationFramework::BMuonTrackIsoTool::saveIsolation |
( |
const xAOD::Vertex * |
vtx | ) |
const |
|
private |
Definition at line 316 of file BMuonTrackIsoTool.cxx.
319 typedef std::vector<MuonLink_t> MuonLinkVector_t;
326 for (
unsigned int its = 0; its < nTrackSels; ++its) {
327 for (
unsigned int ipv = 0; ipv < nPvAssocs; ++ipv) {
328 for (
unsigned int ic = 0;
ic < nCones; ++
ic) {
329 for (
unsigned int itt = 0; itt < nTrackTypes; ++itt) {
332 dv_iso_values(
result.muIsoName());
334 dv_iso_ntracks(
result.nTracksName());
335 dv_iso_values(*vtx) =
result.vIsoValues;
336 dv_iso_ntracks(*vtx) =
result.vNTracks;
337 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::saveIsolation() -- isobn: "
338 <<
result.muIsoName() <<
", ntbn: "
340 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::saveIsolation() -- vertex: ("
343 << vtx->
z() <<
"), N(iso): "
344 <<
result.vIsoValues.size() <<
", N(nTracks): "
345 <<
result.vNTracks.size());
346 MuonLinkVector_t
links;
348 if (
muon != NULL ) {
350 links.push_back(link);
353 <<
" *muon == NULL -- EL not saved!");
358 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::saveIsolation() -- muLinks: "
359 <<
"N_saved = " <<
links.size() );
365 return StatusCode::SUCCESS;
◆ selectTracks() [1/2]
Definition at line 1241 of file BPhysVertexTrackBase.cxx.
1254 <<
" " << exclTracks
1255 <<
" for decay candidate " << cand.
vtx()
1256 <<
"; candPV: " << candPV <<
" candRefPV: " << candRefPV);
1263 inpTracks->
begin(); trkItr != inpTracks->
end(); ++trkItr) {
1269 m_mttc->addToCounter(trackTypesForTrack, itt, bname,
"all");
1275 m_mttc->addToCounter(trackTypesForTrack, itt, bname,
"ats");
1283 if ( trackTypesForTrack == 0x0 ) {
1292 m_mttc->addToCounter(trackTypesForTrack, itt, bname,
"att");
1296 != exclTracks.end() )
continue;
1299 m_mttc->addToCounter(trackTypesForTrack, itt, bname,
"fin");
1302 tracks.push_back(
track);
◆ selectTracks() [2/2]
◆ setResultsPrefix()
void DerivationFramework::BMuonTrackIsoTool::setResultsPrefix |
( |
std::string |
prefix | ) |
const |
|
private |
Definition at line 368 of file BMuonTrackIsoTool.cxx.
370 ATH_MSG_DEBUG(
"BMuonTrackIsoTool::setResultsPrefix -- begin");
377 for (
unsigned int its = 0; its < nTrackSels; ++its) {
378 for (
unsigned int ipv = 0; ipv < nPvAssocs; ++ipv) {
379 for (
unsigned int ic = 0;
ic < nCones; ++
ic) {
380 for (
unsigned int itt = 0; itt < nTrackTypes; ++itt) {
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ trackToString()
◆ ttall()
uint64_t DerivationFramework::BPhysVertexTrackBase::ttall |
( |
| ) |
|
|
staticinherited |
◆ ttallMin()
uint64_t DerivationFramework::BPhysVertexTrackBase::ttallMin |
( |
| ) |
|
|
staticinherited |
◆ ttb()
◆ tts()
◆ updateVHKA()
◆ wrapLines()
std::string DerivationFramework::BPhysVertexTrackBase::wrapLines |
( |
const std::string & |
lines, |
|
|
const std::string & |
prefix |
|
) |
| |
|
staticinherited |
◆ m_branchBaseName
std::string DerivationFramework::BPhysVertexTrackBase::m_branchBaseName |
|
protectedinherited |
◆ m_branchPrefixes
std::vector<std::string> DerivationFramework::BPhysVertexTrackBase::m_branchPrefixes |
|
protectedinherited |
◆ m_branchSuffix
std::string DerivationFramework::BPhysVertexTrackBase::m_branchSuffix |
|
protectedinherited |
◆ m_debugTracksInEvents
std::vector<uint64_t> DerivationFramework::BPhysVertexTrackBase::m_debugTracksInEvents |
|
protectedinherited |
◆ m_debugTracksInThisEvent
bool DerivationFramework::BPhysVertexTrackBase::m_debugTracksInThisEvent |
|
mutableprotectedinherited |
◆ m_debugTrackTypes
int DerivationFramework::BPhysVertexTrackBase::m_debugTrackTypes |
|
protectedinherited |
◆ m_detStore
◆ m_doVertexType
int DerivationFramework::BPhysVertexTrackBase::m_doVertexType |
|
protectedinherited |
◆ m_eventInfo
|
mutableprotectedinherited |
◆ m_evtNumber
uint64_t DerivationFramework::BPhysVertexTrackBase::m_evtNumber |
|
mutableprotectedinherited |
◆ m_evtStore
◆ m_incPrecVerticesInDecay
bool DerivationFramework::BPhysVertexTrackBase::m_incPrecVerticesInDecay |
|
protectedinherited |
◆ m_isoConeSizes
std::vector<double> DerivationFramework::BMuonTrackIsoTool::m_isoConeSizes |
|
private |
◆ m_isoDoTrkImpLogChi2Cut
std::vector<int> DerivationFramework::BMuonTrackIsoTool::m_isoDoTrkImpLogChi2Cut |
|
private |
◆ m_isoTrkImpLogChi2Max
std::vector<double> DerivationFramework::BMuonTrackIsoTool::m_isoTrkImpLogChi2Max |
|
private |
◆ m_minNTracksInPV
int DerivationFramework::BPhysVertexTrackBase::m_minNTracksInPV |
|
protectedinherited |
◆ m_mttc
std::unique_ptr<TrackTypeCounter> DerivationFramework::BPhysVertexTrackBase::m_mttc |
|
protectedinherited |
◆ m_muonContainerName
std::string DerivationFramework::BMuonTrackIsoTool::m_muonContainerName |
|
private |
◆ m_muons
◆ m_nEvtsSeen
unsigned int DerivationFramework::BPhysVertexTrackBase::m_nEvtsSeen |
|
mutableprotectedinherited |
◆ m_pvAssocResMap
StringIntMap_t DerivationFramework::BPhysVertexTrackBase::m_pvAssocResMap |
|
mutableprotectedinherited |
◆ m_pvAssocTypes
◆ m_pvContainerName
std::string DerivationFramework::BPhysVertexTrackBase::m_pvContainerName |
|
protectedinherited |
◆ m_pvtxContainer
|
mutableprotectedinherited |
◆ m_pvTypesToConsider
std::vector<uint64_t> DerivationFramework::BPhysVertexTrackBase::m_pvTypesToConsider |
|
protectedinherited |
◆ m_refPVAuxContainer
|
mutableprotectedinherited |
◆ m_refPVContainer
|
mutableprotectedinherited |
◆ m_refPVContainerNames
std::vector<std::string> DerivationFramework::BPhysVertexTrackBase::m_refPVContainerNames |
|
protectedinherited |
◆ m_results
MuIsoItem4_t DerivationFramework::BMuonTrackIsoTool::m_results |
|
mutableprivate |
◆ m_runNumber
unsigned int DerivationFramework::BPhysVertexTrackBase::m_runNumber |
|
mutableprotectedinherited |
◆ m_svtxAuxContainer
|
mutableprotectedinherited |
◆ m_svtxContainer
|
mutableprotectedinherited |
◆ m_trackParticleContainerName
std::string DerivationFramework::BPhysVertexTrackBase::m_trackParticleContainerName |
|
protectedinherited |
◆ m_tracks
|
mutableprotectedinherited |
◆ m_tracksAux
|
mutableprotectedinherited |
◆ m_trackSelectionTools
ToolHandleArray<TrkSelTool> DerivationFramework::BPhysVertexTrackBase::m_trackSelectionTools |
|
protectedinherited |
◆ m_trackToVertexTool
◆ m_trackTypesUsed
uint64_t DerivationFramework::BPhysVertexTrackBase::m_trackTypesUsed |
|
protectedinherited |
◆ m_tvaTool
◆ m_tvaToolHasWpLoose
bool DerivationFramework::BPhysVertexTrackBase::m_tvaToolHasWpLoose |
|
protectedinherited |
◆ m_useTrackTypes
std::vector<uint64_t> DerivationFramework::BPhysVertexTrackBase::m_useTrackTypes |
|
protectedinherited |
◆ m_varHandleArraysDeclared
◆ m_vertexContainerNames
std::vector<std::string> DerivationFramework::BPhysVertexTrackBase::m_vertexContainerNames |
|
protectedinherited |
◆ m_vhka
◆ n_track_types
const int DerivationFramework::BPhysVertexTrackBase::n_track_types = 33 |
|
staticinherited |
◆ s_track_type_all_cached
uint64_t DerivationFramework::BPhysVertexTrackBase::s_track_type_all_cached = 0x0 |
|
staticprivateinherited |
◆ track_type_bit
const uint64_t DerivationFramework::BPhysVertexTrackBase::track_type_bit |
|
staticinherited |
Initial value:=
{0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40,
0x80, 0x100, 0x200, 0x400,
0x800, 0x1000, 0x2000, 0x4000,
0x8000, 0x10000, 0x20000, 0x40000,
0x80000, 0x100000, 0x200000, 0x400000,
0x800000, 0x1000000, 0x2000000, 0x4000000,
0x8000000, 0x10000000, 0x20000000, 0x40000000,
0x80000000, 0x100000000}
Definition at line 125 of file BPhysVertexTrackBase.h.
◆ track_type_str
const std::string DerivationFramework::BPhysVertexTrackBase::track_type_str |
|
staticinherited |
Initial value:=
{"ASSOCPV", "PVTYPE0", "PVTYPE1", "PVTYPE2", "PVTYPE3", "NONE", "NULLVP",
"CAPVRFN3U0", "CAPVNRN3U0", "CAPVRF3DU0", "CAPVNR3DU0",
"CAPVRFN3U1", "CAPVNRN3U1", "CAPVRF3DU1", "CAPVNR3DU1",
"CAPVRFN3U2", "CAPVNRN3U2", "CAPVRF3DU2", "CAPVNR3DU2",
"CAPVRFNNU3", "CAPVNRNNU3", "CAPVRFNNU4", "CAPVNRNNU4",
"CAPVRFNNU5", "CAPVNRNNU5", "CAPVRFNNU6", "CAPVNRNNU6",
"CAPVRFNNU7", "CAPVNRNNU7", "CAPVRFNNU8", "CAPVNRNNU8",
"CAPVRFNNU9", "CAPVNRNNU9"}
Definition at line 124 of file BPhysVertexTrackBase.h.
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
float x() const
Returns the x position.
Const iterator class for DataVector/DataList.
ElementLink< xAOD::MuonContainer > MuonLink_t
int nMuons()
: Methods providing access to the linked muons
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
Temporary container used until we have I/O for AuxStoreInternal.
static const std::string pv_type_str[]
Scalar phi() const
phi method
int nRefTrks()
Returns number of stored refitted track momenta.
std::string find(const std::string &s)
return a remapped string
uint64_t eventNumber() const
The current event's event number.
Eigen::Matrix< double, 2, 1 > Vector2D
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
const TrackParticleLinks_t & trackParticleLinks() const
Get all the particles associated with the vertex.
StatusCode accept(const xAOD::Muon *mu)
Scalar theta() const
theta method
TrackParticleAuxContainer_v5 TrackParticleAuxContainer
Definition of the current TrackParticle auxiliary container.
double d0significance(const xAOD::TrackParticle *tp, double d0_uncert_beam_spot_2)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
const xAOD::Muon * muon(const size_t index)
Returns pointer to the i-th linked muon.
bool msgLvl(const MSG::Level lvl) const
float beamPosSigmaX() const
The width of the beam spot in the X direction.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
const Amg::Vector3D & position() const
Returns the 3-pos.
bool const RAWDATA *ch2 const
std::vector< const xAOD::Muon * > MuonBag
#define AmgMatrix(rows, cols)
uint32_t runNumber() const
The current event's run number.
AmgSymMatrix(3) BPhysAddMuonBasedInvMass
virtual void setOwner(IDataHandleHolder *o)=0
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
pv_type
: Enum type of the PV
Helper class to provide type-safe access to aux data.
const xAOD::Vertex * precedingVertex(const size_t index)
Returns pointer to a preceding vertex.
CalibratedSpacePoint::Covariance_t inverse(const CalibratedSpacePoint::Covariance_t &mat)
Inverts the parsed matrix.
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
std::pair< std::vector< unsigned int >, bool > res
T getProperty(const asg::IAsgTool *interface_tool, const std::string &prop_name)
double chi2(TH1 *h0, TH1 *h1)
#define CHECK(...)
Evaluate an expression and check for errors.
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
std::vector< const xAOD::TrackParticle * > TrackBag
float z() const
Returns the z position.
const xAOD::Vertex * origPv(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
original PV
const xAOD::IParticle * refTrkOrigin(const size_t index) const
: Returns the original track (charged or neutral) corresponding to the i-th refitted track
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
float beamPosSigmaY() const
The width of the beam spot in the Y direction.
ElementLink implementation for ROOT usage.
Ensure that the ATLAS eigen extensions are properly loaded.
Definition of ATLAS Math & Geometry primitives (Amg)
const xAOD::Vertex * vtx() const
Getter method for the cached xAOD::Vertex.
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
Eigen::Matrix< double, 3, 1 > Vector3D
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
float beamPosSigmaXY() const
The beam spot shape's X-Y correlation.
Class describing a Vertex.
TVector3 refTrk(const size_t index)
Returns i-th refitted track 3-momentum.
#define ATH_MSG_WARNING(x)
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
int nPrecedingVertices()
: Links to preceding vertices
float y() const
Returns the y position.
const xAOD::Vertex * pv(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
Get the refitted collision vertex of type pv_type.
const std::vector< TVector3 > & refTrks()
Returns refitted track momenta.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
=============================================================================
static const unsigned int n_pv_types
Class describing a TrackParticle.
const std::vector< const xAOD::Muon * > & muons()
Returns linked muons.
float coneSize(IsolationConeSize type)
convert Isolation Size into cone size
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.