13#ifndef IDTPM2_TRACKANALYSISSTORE_H
14#define IDTPM2_TRACKANALYSISSTORE_H
68#include <unordered_map>
89 TrackAnalysisStore(
const std::string&
anaTag,
const ToolHandle<Trig::TrigDecisionTool>* tdt,
const EventContext& context );
164 StatusCode
fillInfo(
const T*& t,
const std::string& key );
166 template<
typename Collection>
167 std::pair<typename Collection::const_iterator, typename Collection::const_iterator>
169 const std::string& key );
246 template<
typename T,
typename U,
typename V=U>
247 bool fillView_internal(
const std::string& key, std::vector<std::unique_ptr<U>>& outView );
254 bool fillView_internal(
const std::string& key, std::vector<ParentView>& parentView );
262 StatusCode
fill( T
const*& container,
const std::string& key );
268 StatusCode
fillRoi( std::pair<typename T::const_iterator, typename T::const_iterator>& itrpair,
269 const std::string& key,
279 void trackptrs(
const std::vector<ParentView>& v, std::vector<const TrackView*>& vp ) {
281 for (
size_t i=0 ; i<v.size() ; i++ )
append_pointers( vp, v[i].begin(), v[i].end() );
289 bool isGoodOffline(
const T& ,
const std::string& ,
const std::string& =
"" ) =
delete;
339 const ToolHandle<Trig::TrigDecisionTool>*
m_tdt;
370template<
typename T,
typename U,
typename V >
372 const T* collection = 0;
373 if (
fill( collection, key ).isSuccess() ) {
375 fillv<U,V>( outView, collection->begin(), collection->end() );
394 for (
size_t i=parentView.size() ; i-- ; ) parentView[i].claimChildren();
408 if( !collection.
isValid() )
return StatusCode::FAILURE;
409 container = collection.
cptr();
410 return StatusCode::SUCCESS;
419 const std::string& key,
426 if( !collection.
isValid() )
return StatusCode::FAILURE;
429 itrpair = (*m_tdt)->associateToEventView( collection, roi_link );
430 return StatusCode::SUCCESS;
432 else return StatusCode::FAILURE;
439 if ( ! collection.
isValid() )
return StatusCode::FAILURE;
440 else t = collection.
ptr();
441 return StatusCode::SUCCESS;
448template<
typename Collection>
449std::pair<typename Collection::const_iterator, typename Collection::const_iterator>
451 const std::string& key ) {
454 std::pair<
typename Collection::const_iterator,
455 typename Collection::const_iterator > itrpair;
463 if (
m_tdt ) itrpair = (*m_tdt)->associateToEventView( handle, roi_link );
ATLAS-specific HepMC functions.
emacs: this is -*- c++ -*-
Handle class for reading a decoration on an object.
Property holding a SG store/key/clid from which a ReadHandle is made.
Handle class for reading from StoreGate.
emacs: this is -*- c++ -*-
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
const std::string & head() const
std::string value(const std::string &key) const
can't make this return a reference in case there is no such key - could throw an exception then it wo...
ElementLink implementation for ROOT usage.
std::vector< ParentView > m_parents
const TIDA::Associator< const TrackView > * m_matcher
store the track matches in an actual simple way
void addTagNProbe(const TagNProbe *t)
std::vector< std::unique_ptr< VertexView > > vtx_store_t
const TagNProbe * m_tnp
TrackAnalysis properties why do ALL these classes have independent m_anaTag variables ?
view_store_t m_reftracks
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 everyth...
const xAOD::EventInfo * eventInfo() const
get event info
void fillVertexViewTest(const std::string &key, const ElementLink< TrigRoiDescriptorCollection > &roi_link)
void fillEventInfo(const xAOD::EventInfo *e)
void fillVertexViewTest(const std::string &key)
std::vector< const VertexView * > m_refvertices
void setBeamKeys(const beam_key_t *k)
const xAOD::TruthPileupEventContainer * truthPileupEventContainer() const
TrackAnalysisStore & operator=(const TrackAnalysisStore &)=delete
= operator
std::vector< const TrackView * > m_testtrackptr
SG::ReadDecorHandleKeyArray< xAOD::EventInfo > keys_t
StatusCode fill(T const *&container, const std::string &key)
have the eventInfo already ?? then just pass in the pointer
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 trackptrs(const std::vector< ParentView > &v, std::vector< const TrackView * > &vp)
int roiIndex() const
odds n ends ...
std::vector< const TrackView * > & reference_tracks()
void set_vertex_matcher(const TIDA::Associator< const VertexView > *m)
vtx_store_t m_testvertices_raw
const xAOD::TruthPileupEventContainer * m_truthPUEventContainer
void fillVertexViewRef(const std::string &key)
vertex fillers ...
std::vector< const VertexView * > m_testvertices
const std::vector< const TrackView * > & reference_tracks() const
StatusCode fillInfo(const T *&t, const std::string &key)
filling methods to fetch collections ...
void fillViewRef(const std::string &key)
track fillers ...
void fillViewTest(const std::string &key, const ElementLink< TrigRoiDescriptorCollection > &roi_link)
Roi filler ...
SG::ReadDecorHandleKeyArray< xAOD::EventInfo > beam_key_t
bool isGoodOffline(const T &, const std::string &, const std::string &="")=delete
to be over ridden by selection for actual EDM classes
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...
const EventContext & eventContext() const
const std::vector< ParentView > & parents() const
void set_matcher(const TIDA::Associator< const TrackView > *m)
bool hasTagNProbe() const
const TIDA::Associator< const VertexView > * vertex_matcher() const
const std::vector< const VertexView * > & testvertices() const
bool fillView_internal(const std::string &key, std::vector< std::unique_ptr< U > > &outView)
templates for athena type track and vertex retrieval ...
const std::vector< const TrackView * > & test_tracks() const
StatusCode fillEventInfo(const std::string &key)
std::vector< const VertexView * > & testvertices()
const TIDA::Associator< const TrackView > * matcher() const
test and reference tracks ...
TrackAnalysisStore(const std::string &anaTag, const EventContext &context)
Constructor.
void test_tracks(const std::vector< const TrackView * > &v)
const xAOD::EventInfo * m_eventInfo
— Collections class variables — EventInfo, TruthEvent, and TruthPUEvent
const xAOD::TruthEventContainer * m_truthEventContainer
std::pair< typename Collection::const_iterator, typename Collection::const_iterator > getPair(const ElementLink< TrigRoiDescriptorCollection > &roi_link, const std::string &key)
~TrackAnalysisStore()=default
Destructor.
void trackptrs(const view_store_t &v, std::vector< const TrackView * > &vp)
do this with a single template for treacks and vertices
void fillView(const std::string &key, view_store_t &trackView)
track fillers ...
const std::vector< const VertexView * > & refvertices() const
vertex accessors
StatusCode initialize()
initialize this should not actually be needed - we should be creating a new instance whenever this is...
void vertexptrs(const vtx_store_t &v, std::vector< const VertexView * > &vp)
const beam_key_t * m_beamkeys
enable / diable local truth decoration handling
std::vector< const TrackView * > m_reftrackptr
const std::string & anaTag()
— Setter methods —
const EventContext & m_context
std::vector< const VertexView * > & refvertices()
vtx_store_t m_refvertices_raw
std::vector< const TrackView * > & test_tracks()
void fillViewTest(const std::string &key)
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 ...
const TagNProbe * tagNProbe() const
view_store_t m_testtracks
const xAOD::TruthEventContainer * truthEventContainer() const
std::vector< std::unique_ptr< TrackView > > view_store_t
polymoprphic master store types
Property holding a SG store/key/clid from which a ReadHandle is made.
const_pointer_type ptr()
Dereference the pointer.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
emacs: this is -*- c++ -*-
void fillv(std::vector< T > &t, Iterator first, Iterator last)
void fill_upointers(std::vector< const T * > &t, Iterator first, Iterator last)
void append_pointers(std::vector< const T * > &t, Iterator first, Iterator last)
DecorHandleKeyArray< ReadDecorHandle< T, S >, ReadDecorHandleKey< T >, Gaudi::DataHandle::Reader > ReadDecorHandleKeyArray
TruthEventContainer_v1 TruthEventContainer
Declare the latest version of the truth event container.
EventInfo_v1 EventInfo
Definition of the latest event info version.
TruthPileupEventContainer_v1 TruthPileupEventContainer
Declare the latest version of the truth event container.
void fill(H5::Group &out_file, size_t iterations)