![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
#include <T2BSTrackFilterTool.h>
|
enum | TrackRejectReason {
fail_PT = 0,
fail_SiHits = 1,
fail_PIXHits = 2,
fail_SCTHits = 3,
fail_TRTHits = 4,
fail_NDF = 5,
fail_D0 = 6,
fail_Z0 = 7,
fail_D0err = 8,
fail_Z0err = 9,
fail_Eta = 10,
fail_MinQual = 11,
fail_MaxQual = 12,
fail_Chi2Prob = 13,
fail_D0Chi2 = 14,
numRejectReasons
} |
|
using | TrackVector = std::vector< const Trk::Track * > |
|
using | TrackRejectReasonSet = std::bitset< numRejectReasons > |
|
|
| T2BSTrackFilterTool (const std::string &type, const std::string &name, const IInterface *parent) |
|
| ~T2BSTrackFilterTool ()=default |
|
StatusCode | initialize () final |
|
TrackVector | filter (const TrackCollection &tracks) const |
| Select tracks that can be used for further processing. More...
|
|
bool | updateBS (const TrackVector &tracks, unsigned lbn, unsigned bcid, std::vector< TrackData > *bsTracks=nullptr) const |
| Update beam spot estimate with new tracks. More...
|
|
TrackVector | filterBS (const TrackVector &tracks) const |
| Select tracks based on their distance to estimated beamspot. 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 |
|
Definition at line 30 of file T2BSTrackFilterTool.h.
◆ AccumKey
◆ AccumMap
◆ StoreGateSvc_t
◆ TrackRejectReasonSet
◆ TrackVector
◆ TrackRejectReason
Enumerator |
---|
fail_PT | |
fail_SiHits | |
fail_PIXHits | |
fail_SCTHits | |
fail_TRTHits | |
fail_NDF | |
fail_D0 | |
fail_Z0 | |
fail_D0err | |
fail_Z0err | |
fail_Eta | |
fail_MinQual | |
fail_MaxQual | |
fail_Chi2Prob | |
fail_D0Chi2 | |
numRejectReasons | |
Definition at line 60 of file T2BSTrackFilterTool.h.
◆ T2BSTrackFilterTool()
PESA::T2BSTrackFilterTool::T2BSTrackFilterTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~T2BSTrackFilterTool()
PESA::T2BSTrackFilterTool::~T2BSTrackFilterTool |
( |
| ) |
|
|
default |
◆ bootstrapFromSeeds()
bool T2BSTrackFilterTool::bootstrapFromSeeds |
( |
std::vector< TrackData > * |
bsTracks = nullptr | ) |
const |
|
private |
Definition at line 408 of file T2BSTrackFilterTool.cxx.
414 TrackStatAccumulator acc0;
415 for (
auto const& seed: m_bsSeeds) {
418 auto solution = acc0.solution();
419 ATH_MSG_DEBUG(
"Unfiltered solution=" << solution[0] <<
", " << solution[1]
420 <<
", " << solution[2] <<
", " << solution[3]);
425 for (
int c = 0;
c < Niter; ++
c) {
426 TrackStatAccumulator
acc;
428 for (
auto const& seed: m_bsSeeds) {
434 solution =
acc.solution();
435 ATH_MSG_DEBUG(
"Filtered solution [iter " <<
c <<
"]=" << solution[0] <<
", " << solution[1]
436 <<
", " << solution[2] <<
", " << solution[3]);
441 m_accumulators.clear();
442 if (bsTracks !=
nullptr) {
444 bsTracks->reserve(m_bsSeeds.size());
447 for (
auto const& seed: m_bsSeeds) {
451 if (m_accumulators.count(
seed.lbn) == 0) {
455 if (bsTracks !=
nullptr) {
456 bsTracks->push_back(seed);
463 TrackStatAccumulator
acc;
464 for (
auto&& pair: m_accumulators) {
465 acc.update(pair.second);
467 solution =
acc.solution();
468 ATH_MSG_DEBUG(
"Final filtered solution=" << solution[0] <<
", " << solution[1]
469 <<
", " << solution[2] <<
", " << solution[3]);
◆ 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);
◆ 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.
◆ 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.
◆ 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()
◆ dumpTrackParams()
void T2BSTrackFilterTool::dumpTrackParams |
( |
Trk::Perigee const * |
trackPars, |
|
|
double |
chi2, |
|
|
std::string const & |
message |
|
) |
| const |
|
private |
Definition at line 493 of file T2BSTrackFilterTool.cxx.
494 auto&&
par = trackPars->parameters();
495 auto&&
cov = trackPars->covariance();
496 if (
cov !=
nullptr) {
503 psi_err = std::sqrt(psi_err);
505 psi_err = -std::sqrt(-psi_err);
508 << std::setprecision(15)
512 <<
" d0_err: " << d0_err
513 <<
" phi0_err: " << phi0_err
515 <<
" r_est: " << r_est
516 <<
" psi_err: " << psi_err
517 <<
" z0_err: " << z0_err
519 << std::setprecision(6));
◆ 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
◆ filter()
Select tracks that can be used for further processing.
This method only looks at parameters of individual tracks and does not check track distance to an estimated beam spot.
Definition at line 159 of file T2BSTrackFilterTool.cxx.
161 ATH_MSG_DEBUG(
"Selecting tracks for the beamSpot algorithm" );
170 std::vector<T2Track> myTracks;
171 myTracks.reserve(tracks.size());
172 std::vector<const Trk::Track*> selectedTracks;
173 selectedTracks.reserve(tracks.size());
176 for (
auto trackIter = tracks.begin(); trackIter != tracks.end(); ++trackIter) {
186 if (rejectSet.none()) {
188 selectedTracks.push_back(*trackIter);
191 myTracks.push_back(myTrack);
198 if (rejectSet.test(bit)) {
199 ++trackRejectReasonsCounts[bit];
205 "Track " << (rejectSet.none() ?
"passed" :
"failed") <<
" selection:" <<
206 " mask: " << rejectReasonsToString(rejectSet) <<
207 " d0: " << myTrack.D0() <<
208 " z0: " << myTrack.Z0() <<
209 " phi0: " << myTrack.Phi() <<
210 " eta: " << myTrack.Eta() <<
211 " pT: " << myTrack.Pt()*
GeV <<
212 " Z0err: " << myTrack.Z0err() <<
213 " D0err: " << myTrack.D0err() <<
214 " Qual: " << myTrack.Qual() <<
215 " Chi2Prob: " << myTrack.Chi2Prob() <<
216 " NpixSPs: " << myTrack.PIXHits() <<
217 " NsctSPs: " << myTrack.SCTHits() <<
218 " NstrawHits: " << myTrack.TRTHits());
222 ATH_MSG_DEBUG(
"Total Tracks: " << nTracksInput <<
" selectedTracks: " << nTracksFilter);
233 return selectedTracks;
◆ filterBS()
Select tracks based on their distance to estimated beamspot.
This method should only be called when updateBS()
returns true.
Definition at line 310 of file T2BSTrackFilterTool.cxx.
315 std::lock_guard<std::mutex> lock(
m_mutex);
317 std::vector<const Trk::Track*> selected;
318 if (m_accumulators.empty()) {
324 TrackStatAccumulator
acc;
325 for (
auto&& pair: m_accumulators) {
326 acc.update(pair.second);
328 auto solution =
acc.solution();
332 std::vector<T2Track> t2Tracks;
333 t2Tracks.reserve(tracks.size());
334 for (
auto&
track: tracks) {
335 auto trackPars =
track->perigeeParameters();
336 if (trackPars !=
nullptr) {
343 selected.push_back(
track);
344 t2Tracks.emplace_back(*
track);
◆ initialize()
StatusCode T2BSTrackFilterTool::initialize |
( |
| ) |
|
|
final |
◆ 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.
◆ isGoodTrack()
◆ monitor_tracks()
void T2BSTrackFilterTool::monitor_tracks |
( |
std::string const & |
prefix, |
|
|
std::string const & |
suffix, |
|
|
std::vector< T2Track > const & |
tracks |
|
) |
| const |
|
private |
Definition at line 388 of file T2BSTrackFilterTool.cxx.
405 trackNDF, trackQual, trackChi2Prob, trackSiHits, trackPiHits, trackSCTHits, trackTRTHits);
◆ 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()
◆ 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.
◆ trackChi2()
Calculate track chi2 w.r.t.
current solution for beam spot.
Definition at line 481 of file T2BSTrackFilterTool.cxx.
484 double const param[] = {-sin_phi0, cos_phi0, -
seed.z0*sin_phi0,
seed.z0*cos_phi0};
486 for (
int i = 0;
i < 4; ++
i) {
487 chi2 -= solution[
i]*param[
i];
◆ updateBS()
bool T2BSTrackFilterTool::updateBS |
( |
const TrackVector & |
tracks, |
|
|
unsigned |
lbn, |
|
|
unsigned |
bcid, |
|
|
std::vector< TrackData > * |
bsTracks = nullptr |
|
) |
| const |
Update beam spot estimate with new tracks.
Normally the tracks would be the same as returned from previous method as some filtering is needed for good estimation.
This method returns true when it has a reasonable estimate of the beamspot, if true is returned then further filtering can be done with filterBS()
method. If bsTracks
pointer is non-zero then the vector will be filled with tracks that were used for beam spot estimate, this only happens when new estimate is calculated. Returned track list can include tracks from multiple event in the same lumi block or even multiple lumi blocks, and it will include all tracks from a current call (after filtering).
Definition at line 236 of file T2BSTrackFilterTool.cxx.
240 std::lock_guard<std::mutex> lock(
m_mutex);
242 if (m_accumulators.empty()) {
244 m_bsSeeds.reserve(m_bsSeeds.size() + tracks.size());
245 for (
auto&
track: tracks) {
246 m_bsSeeds.emplace_back(*
track->perigeeParameters(),
lbn,
bcid);
260 if (m_accumulators.count(
lbn) == 0) {
264 m_accumulators.begin(), m_accumulators.end(), 0,
265 [](
unsigned counter,
auto const& pair) { return counter + pair.second.trk_count; }
267 ATH_MSG_DEBUG(
"Currently have " << m_accumulators.size() <<
" accumulators with "
268 << accumTrackCount <<
" tracks");
273 while (m_accumulators.size() > 2) {
274 ATH_MSG_DEBUG(
"Removing accumulator for LB=" << m_accumulators.begin()->first
275 <<
" with " << m_accumulators.begin()->second.trk_count <<
" tracks");
276 m_accumulators.erase(m_accumulators.begin());
281 TrackStatAccumulator
acc;
282 for (
auto&& pair: m_accumulators) {
283 acc.update(pair.second);
285 auto solution =
acc.solution();
288 for (
auto&
track: tracks) {
289 auto trackPars =
track->perigeeParameters();
290 if (trackPars !=
nullptr) {
◆ updateVHKA()
◆ ATLAS_THREAD_SAFE [1/2]
std::vector<TrackData> m_bsSeeds PESA::T2BSTrackFilterTool::ATLAS_THREAD_SAFE |
|
mutableprivate |
◆ ATLAS_THREAD_SAFE [2/2]
AccumMap m_accumulators PESA::T2BSTrackFilterTool::ATLAS_THREAD_SAFE |
|
mutableprivate |
◆ m_beamSizeLS
double PESA::T2BSTrackFilterTool::m_beamSizeLS |
|
private |
◆ m_chi2cutoff
double PESA::T2BSTrackFilterTool::m_chi2cutoff |
|
private |
◆ m_detStore
◆ m_evtStore
◆ m_goalSeedTracks
unsigned PESA::T2BSTrackFilterTool::m_goalSeedTracks |
|
private |
◆ m_lbnInterval
int PESA::T2BSTrackFilterTool::m_lbnInterval |
|
private |
◆ m_maxTrackD0
double PESA::T2BSTrackFilterTool::m_maxTrackD0 |
|
private |
◆ m_maxTrackD0err
double PESA::T2BSTrackFilterTool::m_maxTrackD0err |
|
private |
◆ m_maxTrackEta
double PESA::T2BSTrackFilterTool::m_maxTrackEta |
|
private |
◆ m_maxTrackQual
double PESA::T2BSTrackFilterTool::m_maxTrackQual |
|
private |
◆ m_maxTrackZ0
double PESA::T2BSTrackFilterTool::m_maxTrackZ0 |
|
private |
◆ m_maxTrackZ0err
double PESA::T2BSTrackFilterTool::m_maxTrackZ0err |
|
private |
◆ m_minPIXHits
int PESA::T2BSTrackFilterTool::m_minPIXHits |
|
private |
◆ m_minSCTHits
int PESA::T2BSTrackFilterTool::m_minSCTHits |
|
private |
◆ m_minSiHits
int PESA::T2BSTrackFilterTool::m_minSiHits |
|
private |
◆ m_minTrackChi2Prob
double PESA::T2BSTrackFilterTool::m_minTrackChi2Prob |
|
private |
◆ m_minTrackNDF
double PESA::T2BSTrackFilterTool::m_minTrackNDF |
|
private |
◆ m_minTrackPt
double PESA::T2BSTrackFilterTool::m_minTrackPt |
|
private |
◆ m_minTrackQual
double PESA::T2BSTrackFilterTool::m_minTrackQual |
|
private |
◆ m_minTRTHits
int PESA::T2BSTrackFilterTool::m_minTRTHits |
|
private |
◆ m_monTool
◆ m_mutex
std::mutex PESA::T2BSTrackFilterTool::m_mutex |
|
mutableprivate |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
Group
Properties of a chain group.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
virtual void setOwner(IDataHandleHolder *o)=0
double chi2(TH1 *h0, TH1 *h1)
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
bool trackPt(const xAOD::TauJet &, const xAOD::TauTrack &track, double &out)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
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 ...
setEventNumber setTimeStamp bcid
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
bool trackPhi(const xAOD::TauJet &, const xAOD::TauTrack &track, double &out)
Declare a monitored scalar variable.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
bool trackEta(const xAOD::TauJet &, const xAOD::TauTrack &track, double &out)