ATLAS Offline Software
Loading...
Searching...
No Matches
IDTPM2::TrackAnalysisStore Class Reference

#include <TrackAnalysisStore.h>

Inheritance diagram for IDTPM2::TrackAnalysisStore:

Public Types

using beam_key_t = SG::ReadDecorHandleKeyArray<xAOD::EventInfo>
using keys_t = SG::ReadDecorHandleKeyArray<xAOD::EventInfo>

Public Member Functions

 TrackAnalysisStore (const std::string &anaTag, const EventContext &context)
 Constructor.
 TrackAnalysisStore (const std::string &anaTag, const ToolHandle< Trig::TrigDecisionTool > *tdt, const EventContext &context)
 ~TrackAnalysisStore ()=default
 Destructor.
TrackAnalysisStore & operator= (const TrackAnalysisStore &)=delete
 = operator
StatusCode initialize ()
 initialize this should not actually be needed - we should be creating a new instance whenever this is required, so all the "initialisation" could be moved to the constructor
const std::string & anaTag ()
 — Setter methods —
const std::vector< ParentView > & parents () const
const TIDA::Associator< const TrackView > * matcher () const
 test and reference tracks ...
void set_matcher (const TIDA::Associator< const TrackView > *m)
const std::vector< const TrackView * > & reference_tracks () const
const std::vector< const TrackView * > & test_tracks () const
std::vector< const TrackView * > & reference_tracks ()
std::vector< const TrackView * > & test_tracks ()
void reference_tracks (const std::vector< const TrackView * > &v)
 these are a bit dodgy - ie we pass in a vector<const TrackView*> so we want to construct a reference veiw_store_t ?
void test_tracks (const std::vector< const TrackView * > &v)
const std::vector< const VertexView * > & refvertices () const
 vertex accessors
const std::vector< const VertexView * > & testvertices () const
std::vector< const VertexView * > & refvertices ()
std::vector< const VertexView * > & testvertices ()
void set_vertex_matcher (const TIDA::Associator< const VertexView > *m)
const TIDA::Associator< const VertexView > * vertex_matcher () const
const xAOD::EventInfo * eventInfo () const
 get event info
const xAOD::TruthEventContainer * truthEventContainer () const
const xAOD::TruthPileupEventContainer * truthPileupEventContainer () const
int roiIndex () const
 odds n ends ...
void roiIndex (int i)
template<typename T>
StatusCode fillInfo (const T *&t, const std::string &key)
 filling methods to fetch collections ...
template<typename Collection>
std::pair< typename Collection::const_iterator, typename Collection::const_iterator > getPair (const ElementLink< TrigRoiDescriptorCollection > &roi_link, const std::string &key)
StatusCode fillEventInfo (const std::string &key)
void fillViewRef (const std::string &key)
 track fillers ...
void fillViewTest (const std::string &key)
void fillViewTest (const std::string &key, const ElementLink< TrigRoiDescriptorCollection > &roi_link)
 Roi filler ...
void fillVertexViewRef (const std::string &key)
 vertex fillers ...
void fillVertexViewTest (const std::string &key)
void fillVertexViewTest (const std::string &key, const ElementLink< TrigRoiDescriptorCollection > &roi_link)
void fillEventInfo (const xAOD::EventInfo *e)
bool hasTagNProbe () const
void addTagNProbe (const TagNProbe *t)
const TagNProbe * tagNProbe () const
void setBeamKeys (const beam_key_t *k)
void decoratePerigee ()
bool msgLvl (const MSG::Level lvl) const
 Test the output level.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.
void setLevel (MSG::Level lvl)
 Change the current logging level.

Protected Types

using view_store_t = std::vector<std::unique_ptr<TrackView>>
 polymoprphic master store types
using vtx_store_t = std::vector<std::unique_ptr<VertexView>>

Protected Member Functions

void fillView (const std::string &key, view_store_t &trackView)
 track fillers ...
void fillView (const std::string &key, const ElementLink< TrigRoiDescriptorCollection > &roi_link, view_store_t &trackView)
 must be a better way that to have a duplicated function, but only one I can think of is to pass in the TrackView, and both TrackParticle and TruthParticle contaiuners
void fillView (const std::string &key, vtx_store_t &vertexView)
 track vertices ...
void fillView (const std::string &key, const ElementLink< TrigRoiDescriptorCollection > &roi_link, vtx_store_t &vertexView)
 this and the roi based TrackView fillView should really be done with a single template
template<typename T, typename U, typename V = U>
bool fillView_internal (const std::string &key, std::vector< std::unique_ptr< U > > &outView)
 templates for athena type track and vertex retrieval ...
template<typename T>
bool fillView_internal (const std::string &key, std::vector< ParentView > &parentView)
 the specialisation for the ParentView, because we want to retrieve the parent, and then get the child tracks to add to the tracks for the analysis, and then add the lookup back to the parent on those tracks
template<typename T>
StatusCode fill (T const *&container, const std::string &key)
 have the eventInfo already ?? then just pass in the pointer
template<typename T>
StatusCode fillRoi (std::pair< typename T::const_iterator, typename T::const_iterator > &itrpair, const std::string &key, const ElementLink< TrigRoiDescriptorCollection > &roi_link)
 more rational generic Roi fill method
const EventContext & eventContext () const
void trackptrs (const view_store_t &v, std::vector< const TrackView * > &vp)
 do this with a single template for treacks and vertices
void trackptrs (const std::vector< ParentView > &v, std::vector< const TrackView * > &vp)
void vertexptrs (const vtx_store_t &v, std::vector< const VertexView * > &vp)
template<typename T>
bool isGoodOffline (const T &, const std::string &, const std::string &="")=delete
 to be over ridden by selection for actual EDM classes

Protected Attributes

view_store_t m_reftracks
 tracks
view_store_t m_testtracks
std::vector< ParentView > m_parents
std::vector< const TrackView * > m_reftrackptr
std::vector< const TrackView * > m_testtrackptr
const EventContext & m_context
const TIDA::Associator< const TrackView > * m_matcher = 0
 store the track matches in an actual simple way
vtx_store_t m_refvertices_raw
vtx_store_t m_testvertices_raw
std::vector< const VertexView * > m_refvertices
std::vector< const VertexView * > m_testvertices
const TIDA::Associator< const VertexView > * m_vertex_matcher = 0
 store the vertex matches in an actual simple way NB: a vertex match can be quite complex: two vertices can have similar z positions, but different tracks
const ToolHandle< Trig::TrigDecisionTool > * m_tdt
 Actually, actually, we don;t even need this AT ALL, it serves no purpose since we can control everything from the main execute() method as and when required, so this actually serves no real purpose any longer.
int m_roiIndex
const xAOD::EventInfo * m_eventInfo = nullptr
 — Collections class variables — EventInfo, TruthEvent, and TruthPUEvent
const xAOD::TruthEventContainer * m_truthEventContainer = nullptr
const xAOD::TruthPileupEventContainer * m_truthPUEventContainer = nullptr
const TagNProbe * m_tnp = 0
 TrackAnalysis properties why do ALL these classes have independent m_anaTag variables ?
std::string m_anaTag
const beam_key_t * m_beamkeys = 0
 enable / diable local truth decoration handling

Private Member Functions

void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

std::string m_nm
 Message source name.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels).
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging).

Detailed Description

Definition at line 78 of file TrackAnalysisStore.h.

Member Typedef Documentation

◆ beam_key_t

◆ keys_t

◆ view_store_t

using IDTPM2::TrackAnalysisStore::view_store_t = std::vector<std::unique_ptr<TrackView>>
protected

polymoprphic master store types

Definition at line 225 of file TrackAnalysisStore.h.

◆ vtx_store_t

using IDTPM2::TrackAnalysisStore::vtx_store_t = std::vector<std::unique_ptr<VertexView>>
protected

Definition at line 227 of file TrackAnalysisStore.h.

Constructor & Destructor Documentation

◆ TrackAnalysisStore() [1/2]

IDTPM2::TrackAnalysisStore::TrackAnalysisStore ( const std::string & anaTag,
const EventContext & context )

Constructor.


— Constructors —

Definition at line 39 of file TrackAnalysisStore.cxx.

39 :
40 AthMessaging( "TrackAnalysisStore"+anaTag ),
41 m_context(context),
42 m_tdt(0),
43 m_roiIndex(0),
45{ }
AthMessaging()
Default constructor:
const ToolHandle< Trig::TrigDecisionTool > * m_tdt
Actually, actually, we don;t even need this AT ALL, it serves no purpose since we can control everyth...
const std::string & anaTag()
— Setter methods —
const EventContext & m_context

◆ TrackAnalysisStore() [2/2]

IDTPM2::TrackAnalysisStore::TrackAnalysisStore ( const std::string & anaTag,
const ToolHandle< Trig::TrigDecisionTool > * tdt,
const EventContext & context )

Definition at line 47 of file TrackAnalysisStore.cxx.

48 :
49 AthMessaging( "TrackAnalysisStore"+anaTag ),
50 m_context(context),
51 m_tdt(tdt),
52 m_roiIndex(0),
54{ }

◆ ~TrackAnalysisStore()

IDTPM2::TrackAnalysisStore::~TrackAnalysisStore ( )
default

Destructor.

Member Function Documentation

◆ addTagNProbe()

void IDTPM2::TrackAnalysisStore::addTagNProbe ( const TagNProbe * t)
inline

Definition at line 211 of file TrackAnalysisStore.h.

211{ m_tnp=t; }
const TagNProbe * m_tnp
TrackAnalysis properties why do ALL these classes have independent m_anaTag variables ?

◆ anaTag()

const std::string & IDTPM2::TrackAnalysisStore::anaTag ( )
inline

— Setter methods —

get TrackAnalysis tag

Definition at line 106 of file TrackAnalysisStore.h.

106{ return m_anaTag; }

◆ decoratePerigee()

void IDTPM2::TrackAnalysisStore::decoratePerigee ( )

can extrapolate to the beamline perigee, if we don't know where the beamline is ...

only currently bother with this for actual, Truth/Particles ...

add perigee parameters ... NB: could make this add perigee parameters only when actually requested ...

should always have a production vertex ...

all of this would probably be much better, and certainiy more compact using some vector types ...

do we really want to bother for neutrals ???

siimple ultra-fast limear extrapolations ...

linear ...

do we need this ?

Definition at line 222 of file TrackAnalysisStore.cxx.

222 {
223
226 if ( !m_beamkeys ) return;
227
229 if ( m_reftracks.empty() || !m_reftracks.front()->is<xAOD::TruthParticle>() ) return;
230
231 SG::ReadDecorHandle<xAOD::EventInfo, float> beamPosX((*m_beamkeys)[0], m_context);
232 SG::ReadDecorHandle<xAOD::EventInfo, float> beamPosY((*m_beamkeys)[1], m_context);
233 SG::ReadDecorHandle<xAOD::EventInfo, float> beamPosZ((*m_beamkeys)[2], m_context);
234
237 for ( size_t i=0 ; i<m_reftracks.size() ; i++ ) {
238
239 TruthView* tv = dynamic_cast<TruthView*>(m_reftracks[i].get());
240
241 if ( !tv ) throw std::runtime_error("not a TruthView");
242
243 const xAOD::TruthParticle* tp = tv->as<xAOD::TruthParticle>();
244
245 if ( std::fabs(tv->pt())<50 ) continue;
246
247 if ( !MC::isStable(tp) ) continue;
248
249 float charge = tp->charge();
250
252 if ( !tp->hasProdVtx() ) {
253 tv->add_z0(-999);
254 tv->add_d0(-999);
255 tv->add_phi(tp->phi());
256 continue;
257 }
258
261
262 double vx = tp->prodVtx()->x();
263 double vy = tp->prodVtx()->y();
264 double vz = tp->prodVtx()->z();
265
266 double bx = beamPosX(0);
267 double by = beamPosY(0);
268 double bz = beamPosZ(0);
269
270 double dx = vx - bx;
271 double dy = vy - by;
272 double dz = vz - bz;
273
274 double eta = tp->eta();
275 double phi = tp->phi();
276
277 double theta = 2*std::atan( std::exp( -eta ) );
278
279 double sinphi = std::sin(phi);
280 double cosphi = std::cos(phi);
281 double tantheta = std::tan(theta);
282
283 if ( charge==0 ) {
284
286
288 double z0 = dz - (dy*cosphi + dy*sinphi)/tantheta + bz;
289 double d0 = dy*cosphi - dx*sinphi;
290
291 tv->add_z0(z0);
292 tv->add_d0(d0);
293 tv->add_phi(tp->phi());
294
295 }
296 else {
297
299 // double z0_ = dz - (dy*cosphi + dy*sinphi)/tantheta + bz;
300 // double d0_ = dy*cosphi - dx*sinphi;
301
302 // helix approximation ...
303
304 int sign = ( charge<0 ? -1 : 1 );
305
306 const double B = 2;
307 const double c = 2.99792458;
308
309 double QR = -charge*std::fabs(tv->pt())*10/(B*c);
310
311 double nx = sign*sinphi;
312 double ny = -sign*cosphi;
313
314 double Cx = vx + QR*nx;
315 double Cy = vy + QR*ny;
316
317 double wx = Cx - beamPosX(0);
318 double wy = Cy - beamPosY(0);
319
320 double w = std::sqrt( wx*wx + wy*wy );
321
322 double d0 = w - std::fabs(QR);
323
324 double rvx = -QR*nx;
325 double rvy = -QR*ny;
326
327 double rpx = -std::fabs(QR)*wx/w;
328 double rpy = -std::fabs(QR)*wy/w;
329
330 double dphi = sign*std::atan2( rvx*rpy - rvy*rpx, rvx*rpx + rvy*rpy );
331
333 // double side = dx*wy - dy*wx;
334
335 double s = dphi*QR;
336
337 double z0 = dz - s/tantheta + bz;
338
339 double phi = tp->phi()-dphi;
340
341 tv->add_z0(z0);
342 tv->add_d0(d0);
343 tv->add_phi(phi);
344
345 }
346 }
347
348}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
Scalar theta() const
theta method
double charge(const T &p)
Definition AtlasPID.h:1003
int sign(int a)
const beam_key_t * m_beamkeys
enable / diable local truth decoration handling
float pt() const
Definition TrackView.h:80
const T * as() const
Definition TrackView.h:140
void add_z0(float z0)
Definition TruthView.h:53
void add_phi(float phi)
Definition TruthView.h:55
void add_d0(float d0)
Definition TruthView.h:54
bool hasProdVtx() const
Check for a production vertex on this particle.
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
double charge() const
Physical charge.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
virtual double phi() const override final
The azimuthal angle ( ) of the particle.
float z() const
Vertex longitudinal distance along the beam line form the origin.
float y() const
Vertex y displacement.
float x() const
Vertex x displacement.
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
TruthParticle_v1 TruthParticle
Typedef to implementation.

◆ eventContext()

const EventContext & IDTPM2::TrackAnalysisStore::eventContext ( ) const
inlineprotected

Definition at line 274 of file TrackAnalysisStore.h.

274{ return m_context; }

◆ eventInfo()

const xAOD::EventInfo * IDTPM2::TrackAnalysisStore::eventInfo ( ) const
inline

get event info

Definition at line 148 of file TrackAnalysisStore.h.

148{ return m_eventInfo; }
const xAOD::EventInfo * m_eventInfo
— Collections class variables — EventInfo, TruthEvent, and TruthPUEvent

◆ fill()

template<typename T>
StatusCode IDTPM2::TrackAnalysisStore::fill ( T const *& container,
const std::string & key )
protected

have the eventInfo already ?? then just pass in the pointer

more rational generic fill method

more rational generic fill methods

Definition at line 405 of file TrackAnalysisStore.h.

405 {
406 MY_MSG_DEBUG << "fill: collection (ordinary fill)" << key << endmsg;
407 SG::ReadHandle<T> collection( key, eventContext() );
408 if( !collection.isValid() ) return StatusCode::FAILURE; // MY_MSG_WARNING << "Collection " << key << " could not be loaded" << endmsg;
409 container = collection.cptr();
410 return StatusCode::SUCCESS;
411}
#define endmsg
#define MY_MSG_DEBUG
Definition MsgMacros.h:25
const EventContext & eventContext() const
const SG::AuxVectorData * container() const
Return the container holding this element.

◆ fillEventInfo() [1/2]

StatusCode IDTPM2::TrackAnalysisStore::fillEventInfo ( const std::string & key)
inline

Definition at line 171 of file TrackAnalysisStore.h.

171{ return fillInfo<xAOD::EventInfo>( m_eventInfo, key ); }
StatusCode fillInfo(const T *&t, const std::string &key)
filling methods to fetch collections ...

◆ fillEventInfo() [2/2]

void IDTPM2::TrackAnalysisStore::fillEventInfo ( const xAOD::EventInfo * e)
inline

Definition at line 207 of file TrackAnalysisStore.h.

◆ fillInfo()

template<typename T>
StatusCode IDTPM2::TrackAnalysisStore::fillInfo ( const T *& t,
const std::string & key )

filling methods to fetch collections ...

Definition at line 437 of file TrackAnalysisStore.h.

437 {
438 SG::ReadHandle<T> collection( key, eventContext() );
439 if ( ! collection.isValid() ) return StatusCode::FAILURE; // MY_MSG_WARNING << "Collection " << key << " could not be loaded" << endmsg;
440 else t = collection.ptr();
441 return StatusCode::SUCCESS;
442}

◆ fillRoi()

template<typename T>
StatusCode IDTPM2::TrackAnalysisStore::fillRoi ( std::pair< typename T::const_iterator, typename T::const_iterator > & itrpair,
const std::string & key,
const ElementLink< TrigRoiDescriptorCollection > & roi_link )
protected

more rational generic Roi fill method

Definition at line 418 of file TrackAnalysisStore.h.

420 {
421
422 MY_MSG_DEBUG << "fill: collection (roi)" << key << endmsg;
423
424 SG::ReadHandle<T> collection( key, eventContext() );
425
426 if( !collection.isValid() ) return StatusCode::FAILURE; // MY_MSG_WARNING << "Collection " << key << " could not be loaded" << endmsg;
427
428 if ( m_tdt ) {
429 itrpair = (*m_tdt)->associateToEventView( collection, roi_link );
430 return StatusCode::SUCCESS;
431 }
432 else return StatusCode::FAILURE;
433}

◆ fillVertexViewRef()

void IDTPM2::TrackAnalysisStore::fillVertexViewRef ( const std::string & key)
inline

vertex fillers ...

Definition at line 199 of file TrackAnalysisStore.h.

std::vector< const VertexView * > m_refvertices
void fillView(const std::string &key, view_store_t &trackView)
track fillers ...
void vertexptrs(const vtx_store_t &v, std::vector< const VertexView * > &vp)

◆ fillVertexViewTest() [1/2]

void IDTPM2::TrackAnalysisStore::fillVertexViewTest ( const std::string & key)
inline

Definition at line 201 of file TrackAnalysisStore.h.

◆ fillVertexViewTest() [2/2]

void IDTPM2::TrackAnalysisStore::fillVertexViewTest ( const std::string & key,
const ElementLink< TrigRoiDescriptorCollection > & roi_link )
inline

Definition at line 203 of file TrackAnalysisStore.h.

203 {
205 }

◆ fillView() [1/4]

void IDTPM2::TrackAnalysisStore::fillView ( const std::string & key,
const ElementLink< TrigRoiDescriptorCollection > & roi_link,
view_store_t & trackView )
protected

must be a better way that to have a duplicated function, but only one I can think of is to pass in the TrackView, and both TrackParticle and TruthParticle contaiuners

don't need to bother with TruthParticles as they are not reconstructed in an Roi

Definition at line 91 of file TrackAnalysisStore.cxx.

91 {
92
94 std::pair<xAOD::TrackParticleContainer::const_iterator, xAOD::TrackParticleContainer::const_iterator> itrpair;
95
96 if ( fillRoi<xAOD::TrackParticleContainer>( itrpair, key, roi_link ).isSuccess() ) {
97 fillv( trackView, itrpair.first, itrpair.second );
98 }
99 else {
100 throw std::runtime_error( "iterator pair not retrieved FFS for key: "+key );
101 }
102
103}
StatusCode fillRoi(std::pair< typename T::const_iterator, typename T::const_iterator > &itrpair, const std::string &key, const ElementLink< TrigRoiDescriptorCollection > &roi_link)
more rational generic Roi fill method
void fillv(std::vector< T > &t, Iterator first, Iterator last)

◆ fillView() [2/4]

void IDTPM2::TrackAnalysisStore::fillView ( const std::string & key,
const ElementLink< TrigRoiDescriptorCollection > & roi_link,
vtx_store_t & vertexView )
protected

this and the roi based TrackView fillView should really be done with a single template

this and the roi based TrackView fillView should really be done with a single template eventually, likelyt create Parent and Child VertexViews as from the TrackView, then we can have the vertices own their own tracks and we would be unstoppable I tell you !

!

don't need to bother with TruthVertices as they are not reconstructed in an Roi

Definition at line 119 of file TrackAnalysisStore.cxx.

119 {
120
122 std::pair<xAOD::VertexContainer::const_iterator, xAOD::VertexContainer::const_iterator> itrpair;
123
124 if ( fillRoi<xAOD::VertexContainer>( itrpair, key, roi_link ).isSuccess() ) {
125 fillv( vertexView, itrpair.first, itrpair.second );
126 }
127 else {
128 throw std::runtime_error( "iterator pair not retrieved FFS for key: "+key );
129 }
130
131}

◆ fillView() [3/4]

void IDTPM2::TrackAnalysisStore::fillView ( const std::string & key,
view_store_t & trackView )
protected

track fillers ...

track stuff ...

this is a bit naughty - using the m_parents directly rather than passing it in - prevents being able to use this mechanism for the test corrections as well, so perhaps it could be changed, should change this to always pass in both a TrackView and a ParentView vectors

Definition at line 77 of file TrackAnalysisStore.cxx.

77 {
84}
std::vector< ParentView > m_parents
bool fillView_internal(const std::string &key, std::vector< std::unique_ptr< U > > &outView)
templates for athena type track and vertex retrieval ...

◆ fillView() [4/4]

void IDTPM2::TrackAnalysisStore::fillView ( const std::string & key,
vtx_store_t & vertexView )
protected

track vertices ...

vertex stuff ... now we have the child-parent relationship sorted out, these vertices should really become ParentViews containing the pointers to all their tracks

Definition at line 109 of file TrackAnalysisStore.cxx.

109 {
110 if ( fillView_internal<xAOD::VertexContainer, VertexView>( key, vertexView ) ) return;
111 if ( fillView_internal<xAOD::TruthVertexContainer, VertexView>( key, vertexView ) ) return;
112}

◆ fillView_internal() [1/2]

template<typename T>
bool IDTPM2::TrackAnalysisStore::fillView_internal ( const std::string & key,
std::vector< ParentView > & parentView )
protected

the specialisation for the ParentView, because we want to retrieve the parent, and then get the child tracks to add to the tracks for the analysis, and then add the lookup back to the parent on those tracks

Definition at line 388 of file TrackAnalysisStore.h.

388 {
389 ChainString cs(key);
390 const T* parents = 0;
391 if ( fill( parents, cs.head() ).isSuccess() ) {
392 if ( parents ) {
393 for ( auto p : *parents ) if ( isGoodOffline( *p, cs.value(0), cs.value(1) ) ) parentView.push_back(p);
394 for ( size_t i=parentView.size() ; i-- ; ) parentView[i].claimChildren();
395 return true;
396 }
397 }
398 return false;
399}
StatusCode fill(T const *&container, const std::string &key)
have the eventInfo already ?? then just pass in the pointer
bool isGoodOffline(const T &, const std::string &, const std::string &="")=delete
to be over ridden by selection for actual EDM classes
const std::vector< ParentView > & parents() const
unsigned long long T

◆ fillView_internal() [2/2]

template<typename T, typename U, typename V>
bool IDTPM2::TrackAnalysisStore::fillView_internal ( const std::string & key,
std::vector< std::unique_ptr< U > > & outView )
protected

templates for athena type track and vertex retrieval ...

Definition at line 371 of file TrackAnalysisStore.h.

371 {
372 const T* collection = 0;
373 if ( fill( collection, key ).isSuccess() ) {
374 if ( collection ) {
375 fillv<U,V>( outView, collection->begin(), collection->end() );
376 return true;
377 }
378 }
379 return false;
380}

◆ fillViewRef()

void IDTPM2::TrackAnalysisStore::fillViewRef ( const std::string & key)
inline

track fillers ...

Definition at line 182 of file TrackAnalysisStore.h.

182 {
183 fillView( key, m_reftracks );
184 if ( m_parents.size()>0 ) trackptrs( m_parents, m_reftrackptr );
186 }
void trackptrs(const view_store_t &v, std::vector< const TrackView * > &vp)
do this with a single template for treacks and vertices
std::vector< const TrackView * > m_reftrackptr

◆ fillViewTest() [1/2]

void IDTPM2::TrackAnalysisStore::fillViewTest ( const std::string & key)
inline

Definition at line 188 of file TrackAnalysisStore.h.

◆ fillViewTest() [2/2]

void IDTPM2::TrackAnalysisStore::fillViewTest ( const std::string & key,
const ElementLink< TrigRoiDescriptorCollection > & roi_link )
inline

Roi filler ...

Definition at line 192 of file TrackAnalysisStore.h.

192 {
194 }

◆ getPair()

template<typename Collection>
std::pair< typename Collection::const_iterator, typename Collection::const_iterator > IDTPM2::TrackAnalysisStore::getPair ( const ElementLink< TrigRoiDescriptorCollection > & roi_link,
const std::string & key )

access by a pair of begin and end iterators

Definition at line 450 of file TrackAnalysisStore.h.

451 {
452
454 std::pair< typename Collection::const_iterator,
455 typename Collection::const_iterator > itrpair;
456
457 SG::ReadHandle<Collection> handle( key, eventContext() );
458
459 // CLID checkCLID;
460 // const std::string* keyStr = m_provider->evtStore()->keyToString(roi_link.key(), checkCLID);
461 // MY_MSG_DEBUG << "Requesting range over (" << key << ") associated to ROI from " << (keyStr == nullptr ? "UNKNOWN" : *keyStr) << endmsg;
462
463 if ( m_tdt ) itrpair = (*m_tdt)->associateToEventView( handle, roi_link );
464
465 return itrpair;
466}
virtual void handle(const Incident &inc)
Handle end of run incidents to save the metadata at that point.

◆ hasTagNProbe()

bool IDTPM2::TrackAnalysisStore::hasTagNProbe ( ) const
inline

Definition at line 209 of file TrackAnalysisStore.h.

209{ return m_tnp!=0; }

◆ initialize()

StatusCode IDTPM2::TrackAnalysisStore::initialize ( )

initialize this should not actually be needed - we should be creating a new instance whenever this is required, so all the "initialisation" could be moved to the constructor


— initialize —

this was a tool, instantiated, AS NEW for EVERY event, therefor having an initialize() method of this nature is completely pointless - so now everything is done in the constructor and the initialise is actually redundent. Also the DefinitioSvc is not needed, as the required information can simply be passed in from the top level tool.

Definition at line 66 of file TrackAnalysisStore.cxx.

66{ return StatusCode::SUCCESS; }

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40{
42 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)
int outputLevel(const IMessageSvc *ims, const std::string &source)

◆ isGoodOffline()

template<typename T>
bool IDTPM2::TrackAnalysisStore::isGoodOffline ( const T & ,
const std::string & ,
const std::string & = "" )
protecteddelete

to be over ridden by selection for actual EDM classes

◆ matcher()

const TIDA::Associator< const TrackView > * IDTPM2::TrackAnalysisStore::matcher ( ) const
inline

test and reference tracks ...

these are all the accessors you actually should ever need ... local matcher ...

Definition at line 116 of file TrackAnalysisStore.h.

116{ return m_matcher; }
const TIDA::Associator< const TrackView > * m_matcher
store the track matches in an actual simple way

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 167 of file AthMessaging.h.

168{
169 MsgStream* ms = m_msg_tls.get();
170 if (!ms) {
171 if (!m_initialized.test_and_set()) initMessaging();
172 ms = new MsgStream(m_imsg,m_nm);
173 m_msg_tls.reset( ms );
174 }
175
176 ms->setLevel (m_lvl);
177 return *ms;
178}
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels).
void initMessaging() const
Initialize our message level and MessageSvc.

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 182 of file AthMessaging.h.

183{ return msg() << lvl; }
MsgStream & msg() const
The standard message stream.

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152{
153 // If user did not set explicit message level we have to initialize
154 // the messaging and retrieve the default via the MessageSvc.
155 if (m_lvl==MSG::NIL && !m_initialized.test_and_set()) initMessaging();
156
157 if (m_lvl <= lvl) {
158 msg() << lvl;
159 return true;
160 } else {
161 return false;
162 }
163}

◆ operator=()

TrackAnalysisStore & IDTPM2::TrackAnalysisStore::operator= ( const TrackAnalysisStore & )
delete

= operator

◆ parents()

const std::vector< ParentView > & IDTPM2::TrackAnalysisStore::parents ( ) const
inline

Definition at line 108 of file TrackAnalysisStore.h.

108{ return m_parents; };

◆ reference_tracks() [1/3]

std::vector< const TrackView * > & IDTPM2::TrackAnalysisStore::reference_tracks ( )
inline

Definition at line 123 of file TrackAnalysisStore.h.

123{ return m_reftrackptr; }

◆ reference_tracks() [2/3]

const std::vector< const TrackView * > & IDTPM2::TrackAnalysisStore::reference_tracks ( ) const
inline

Definition at line 120 of file TrackAnalysisStore.h.

120{ return m_reftrackptr; }

◆ reference_tracks() [3/3]

void IDTPM2::TrackAnalysisStore::reference_tracks ( const std::vector< const TrackView * > & v)
inline

these are a bit dodgy - ie we pass in a vector<const TrackView*> so we want to construct a reference veiw_store_t ?

? this would mean making copies of the original TrackView objects, so now we would have two, seperate sets of pointers to copies of the same objects so we don't want this, and so we clear the raw view

Definition at line 131 of file TrackAnalysisStore.h.

◆ refvertices() [1/2]

std::vector< const VertexView * > & IDTPM2::TrackAnalysisStore::refvertices ( )
inline

Definition at line 139 of file TrackAnalysisStore.h.

139{ return m_refvertices; }

◆ refvertices() [2/2]

const std::vector< const VertexView * > & IDTPM2::TrackAnalysisStore::refvertices ( ) const
inline

vertex accessors

Definition at line 136 of file TrackAnalysisStore.h.

136{ return m_refvertices; }

◆ roiIndex() [1/2]

int IDTPM2::TrackAnalysisStore::roiIndex ( ) const
inline

odds n ends ...

Definition at line 155 of file TrackAnalysisStore.h.

155{ return m_roiIndex; }

◆ roiIndex() [2/2]

void IDTPM2::TrackAnalysisStore::roiIndex ( int i)
inline

Definition at line 157 of file TrackAnalysisStore.h.

157{ m_roiIndex = i; }

◆ set_matcher()

void IDTPM2::TrackAnalysisStore::set_matcher ( const TIDA::Associator< const TrackView > * m)
inline

Definition at line 118 of file TrackAnalysisStore.h.

◆ set_vertex_matcher()

void IDTPM2::TrackAnalysisStore::set_vertex_matcher ( const TIDA::Associator< const VertexView > * m)
inline

Definition at line 142 of file TrackAnalysisStore.h.

142{ m_vertex_matcher = m; };
const TIDA::Associator< const VertexView > * m_vertex_matcher
store the vertex matches in an actual simple way NB: a vertex match can be quite complex: two vertice...

◆ setBeamKeys()

void IDTPM2::TrackAnalysisStore::setBeamKeys ( const beam_key_t * k)
inline

Definition at line 217 of file TrackAnalysisStore.h.

217{ m_beamkeys = k; }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29{
30 m_lvl = lvl;
31}

◆ tagNProbe()

const TagNProbe * IDTPM2::TrackAnalysisStore::tagNProbe ( ) const
inline

Definition at line 213 of file TrackAnalysisStore.h.

213{ return m_tnp; }

◆ test_tracks() [1/3]

std::vector< const TrackView * > & IDTPM2::TrackAnalysisStore::test_tracks ( )
inline

Definition at line 124 of file TrackAnalysisStore.h.

124{ return m_testtrackptr; }

◆ test_tracks() [2/3]

const std::vector< const TrackView * > & IDTPM2::TrackAnalysisStore::test_tracks ( ) const
inline

Definition at line 121 of file TrackAnalysisStore.h.

121{ return m_testtrackptr; }

◆ test_tracks() [3/3]

void IDTPM2::TrackAnalysisStore::test_tracks ( const std::vector< const TrackView * > & v)
inline

Definition at line 132 of file TrackAnalysisStore.h.

132{ m_testtrackptr = v; m_testtracks.clear(); }

◆ testvertices() [1/2]

std::vector< const VertexView * > & IDTPM2::TrackAnalysisStore::testvertices ( )
inline

Definition at line 140 of file TrackAnalysisStore.h.

140{ return m_testvertices; }

◆ testvertices() [2/2]

const std::vector< const VertexView * > & IDTPM2::TrackAnalysisStore::testvertices ( ) const
inline

Definition at line 137 of file TrackAnalysisStore.h.

137{ return m_testvertices; }

◆ trackptrs() [1/2]

void IDTPM2::TrackAnalysisStore::trackptrs ( const std::vector< ParentView > & v,
std::vector< const TrackView * > & vp )
inlineprotected

Definition at line 279 of file TrackAnalysisStore.h.

279 {
280 vp.clear();
281 for ( size_t i=0 ; i<v.size() ; i++ ) append_pointers( vp, v[i].begin(), v[i].end() );
282 }
void append_pointers(std::vector< const T * > &t, Iterator first, Iterator last)

◆ trackptrs() [2/2]

void IDTPM2::TrackAnalysisStore::trackptrs ( const view_store_t & v,
std::vector< const TrackView * > & vp )
inlineprotected

do this with a single template for treacks and vertices

Definition at line 277 of file TrackAnalysisStore.h.

277{ fill_upointers( vp, v.begin(), v.end() ); }
void fill_upointers(std::vector< const T * > &t, Iterator first, Iterator last)

◆ truthEventContainer()

const xAOD::TruthEventContainer * IDTPM2::TrackAnalysisStore::truthEventContainer ( ) const
inline

Definition at line 149 of file TrackAnalysisStore.h.

149{ return m_truthEventContainer; }
const xAOD::TruthEventContainer * m_truthEventContainer

◆ truthPileupEventContainer()

const xAOD::TruthPileupEventContainer * IDTPM2::TrackAnalysisStore::truthPileupEventContainer ( ) const
inline

Definition at line 150 of file TrackAnalysisStore.h.

150{ return m_truthPUEventContainer; }
const xAOD::TruthPileupEventContainer * m_truthPUEventContainer

◆ vertex_matcher()

const TIDA::Associator< const VertexView > * IDTPM2::TrackAnalysisStore::vertex_matcher ( ) const
inline

Definition at line 144 of file TrackAnalysisStore.h.

144{ return m_vertex_matcher; }

◆ vertexptrs()

void IDTPM2::TrackAnalysisStore::vertexptrs ( const vtx_store_t & v,
std::vector< const VertexView * > & vp )
inlineprotected

Definition at line 284 of file TrackAnalysisStore.h.

284{ fill_upointers( vp, v.begin(), v.end() ); }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging).

Definition at line 141 of file AthMessaging.h.

◆ m_anaTag

std::string IDTPM2::TrackAnalysisStore::m_anaTag
protected

Definition at line 358 of file TrackAnalysisStore.h.

◆ m_beamkeys

const beam_key_t* IDTPM2::TrackAnalysisStore::m_beamkeys = 0
protected

enable / diable local truth decoration handling

Definition at line 363 of file TrackAnalysisStore.h.

◆ m_context

const EventContext& IDTPM2::TrackAnalysisStore::m_context
protected

Definition at line 303 of file TrackAnalysisStore.h.

◆ m_eventInfo

const xAOD::EventInfo* IDTPM2::TrackAnalysisStore::m_eventInfo = nullptr
protected

— Collections class variables — EventInfo, TruthEvent, and TruthPUEvent

Definition at line 345 of file TrackAnalysisStore.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ m_matcher

const TIDA::Associator<const TrackView>* IDTPM2::TrackAnalysisStore::m_matcher = 0
protected

store the track matches in an actual simple way

Definition at line 307 of file TrackAnalysisStore.h.

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels).

Definition at line 132 of file AthMessaging.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_parents

std::vector<ParentView> IDTPM2::TrackAnalysisStore::m_parents
protected

Definition at line 298 of file TrackAnalysisStore.h.

◆ m_reftrackptr

std::vector<const TrackView*> IDTPM2::TrackAnalysisStore::m_reftrackptr
protected

Definition at line 300 of file TrackAnalysisStore.h.

◆ m_reftracks

view_store_t IDTPM2::TrackAnalysisStore::m_reftracks
protected

tracks

Definition at line 295 of file TrackAnalysisStore.h.

◆ m_refvertices

std::vector<const VertexView*> IDTPM2::TrackAnalysisStore::m_refvertices
protected

Definition at line 314 of file TrackAnalysisStore.h.

◆ m_refvertices_raw

vtx_store_t IDTPM2::TrackAnalysisStore::m_refvertices_raw
protected

Definition at line 311 of file TrackAnalysisStore.h.

◆ m_roiIndex

int IDTPM2::TrackAnalysisStore::m_roiIndex
protected

Definition at line 341 of file TrackAnalysisStore.h.

◆ m_tdt

const ToolHandle<Trig::TrigDecisionTool>* IDTPM2::TrackAnalysisStore::m_tdt
protected

Actually, actually, we don;t even need this AT ALL, it serves no purpose since we can control everything from the main execute() method as and when required, so this actually serves no real purpose any longer.

actually, we don't want to use a service handle for this, we extract it at the tool level, and pass it in when this tool is constructed for each event We stick with the Svc name however for the time being to avoid having to change the code that much SmartIF< ITrackAnalysisDefinitionSvc > m_trkAnaDefSvc; const ITrackAnalysisDefinition* m_trkAnaDefSvc; TrigDecisionTool - we don;t want to retrieve this tool ourselves, we can have it passed in by the parent tool

Definition at line 339 of file TrackAnalysisStore.h.

◆ m_testtrackptr

std::vector<const TrackView*> IDTPM2::TrackAnalysisStore::m_testtrackptr
protected

Definition at line 301 of file TrackAnalysisStore.h.

◆ m_testtracks

view_store_t IDTPM2::TrackAnalysisStore::m_testtracks
protected

Definition at line 296 of file TrackAnalysisStore.h.

◆ m_testvertices

std::vector<const VertexView*> IDTPM2::TrackAnalysisStore::m_testvertices
protected

Definition at line 315 of file TrackAnalysisStore.h.

◆ m_testvertices_raw

vtx_store_t IDTPM2::TrackAnalysisStore::m_testvertices_raw
protected

Definition at line 312 of file TrackAnalysisStore.h.

◆ m_tnp

const TagNProbe* IDTPM2::TrackAnalysisStore::m_tnp = 0
protected

TrackAnalysis properties why do ALL these classes have independent m_anaTag variables ?

this is very dangerous, as none of them applear to ever be checked - there should be one analTag for an analysis, and all the tools in the analysis use the same thing

Definition at line 356 of file TrackAnalysisStore.h.

◆ m_truthEventContainer

const xAOD::TruthEventContainer* IDTPM2::TrackAnalysisStore::m_truthEventContainer = nullptr
protected

Definition at line 346 of file TrackAnalysisStore.h.

◆ m_truthPUEventContainer

const xAOD::TruthPileupEventContainer* IDTPM2::TrackAnalysisStore::m_truthPUEventContainer = nullptr
protected

Definition at line 347 of file TrackAnalysisStore.h.

◆ m_vertex_matcher

const TIDA::Associator<const VertexView>* IDTPM2::TrackAnalysisStore::m_vertex_matcher = 0
protected

store the vertex matches in an actual simple way NB: a vertex match can be quite complex: two vertices can have similar z positions, but different tracks

Definition at line 321 of file TrackAnalysisStore.h.


The documentation for this class was generated from the following files: