ATLAS Offline Software
Loading...
Searching...
No Matches
MuonPrdSelectorAlg Class Reference

#include <MuonPrdSelectorAlg.h>

Inheritance diagram for MuonPrdSelectorAlg:
Collaboration diagram for MuonPrdSelectorAlg:

Public Member Functions

 MuonPrdSelectorAlg (const std::string &name, ISvcLocator *pSvcLocator)
 Athena algorithm constructor.
virtual StatusCode initialize ()
 Algorithm initialization: retrieves StoreGate/DetectorStore/MuonIdHelpers/MuonPrepDataContainers.
virtual StatusCode execute ()
 Retrieves and records containers, performs selection.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
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.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

void print ()
 method for DEBUG purposes: prints the content of input and output MuonPrepDataContainer
StatusCode retrieveContainers ()
 retrieves input MuonPrepDataContainers from StoreGate
StatusCode recordContainers ()
 records output MuonPrepDataContainers to StoreGate
StatusCode performSelection ()
 checks if each hit in each collection passes a set of cuts these hits are written to new collections
StatusCode selectMDTs ()
 selects the hits from MDTcollections
StatusCode selectRPCs ()
 selects the hits from RPCcollections
StatusCode selectTGCs ()
 selects the hits from TGCcollections
StatusCode selectCSCs ()
 selects the hits from CSCcollections
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
ToolHandle< IMuonIdCutToolm_muonIdCutTool {this,"MuonIdCutTool","MuonIdCutTool/MuonIdCutTool","defines the cuts"}
std::string m_inputContainer_mdt
std::string m_inputContainer_rpc
std::string m_inputContainer_tgc
std::string m_inputContainer_csc
std::string m_outputContainer_mdt
std::string m_outputContainer_rpc
std::string m_outputContainer_tgc
std::string m_outputContainer_csc
const Muon::MdtPrepDataContainerm_mdtPRDs_in
const Muon::RpcPrepDataContainerm_rpcPRDs_in
const Muon::TgcPrepDataContainerm_tgcPRDs_in
const Muon::CscStripPrepDataContainerm_cscPRDs_in
Muon::MdtPrepDataContainerm_mdtPRDs_out
Muon::RpcPrepDataContainerm_rpcPRDs_out
Muon::TgcPrepDataContainerm_tgcPRDs_out
Muon::CscStripPrepDataContainerm_cscPRDs_out
DataObjIDColl m_extendedExtraObjects
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 34 of file MuonPrdSelectorAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ MuonPrdSelectorAlg()

MuonPrdSelectorAlg::MuonPrdSelectorAlg ( const std::string & name,
ISvcLocator * pSvcLocator )

Athena algorithm constructor.

Definition at line 10 of file MuonPrdSelectorAlg.cxx.

11 : AthAlgorithm(name,pSvcLocator),
12 m_mdtPRDs_in(nullptr), m_rpcPRDs_in(nullptr), m_tgcPRDs_in(nullptr), m_cscPRDs_in(nullptr),
13 m_mdtPRDs_out(nullptr), m_rpcPRDs_out(nullptr), m_tgcPRDs_out(nullptr), m_cscPRDs_out(nullptr)
14{
15 declareProperty("MDT_PRDinputContainer" , m_inputContainer_mdt = "MDT_DriftCircles_unfiltered" );
16 declareProperty("MDT_PRDoutputContainer" , m_outputContainer_mdt = "MDT_DriftCircles" );
17
18 declareProperty("RPC_PRDinputContainer" , m_inputContainer_rpc = "RPC_Measurements_unfiltered" );
19 declareProperty("RPC_PRDoutputContainer" , m_outputContainer_rpc = "RPC_Measurements" );
20
21 declareProperty("TGC_PRDinputContainer" , m_inputContainer_tgc = "TGC_Measurements_unfiltered" );
22 declareProperty("TGC_PRDoutputContainer" , m_outputContainer_tgc = "TGC_Measurements" );
23
24 declareProperty("CSC_PRDinputContainer" , m_inputContainer_csc = "CSC_Measurements_unfiltered" );
25 declareProperty("CSC_PRDoutputContainer" , m_outputContainer_csc = "CSC_Measurements" );
26}
AthAlgorithm()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
std::string m_outputContainer_rpc
std::string m_inputContainer_tgc
Muon::RpcPrepDataContainer * m_rpcPRDs_out
std::string m_inputContainer_mdt
Muon::MdtPrepDataContainer * m_mdtPRDs_out
const Muon::RpcPrepDataContainer * m_rpcPRDs_in
std::string m_outputContainer_csc
const Muon::MdtPrepDataContainer * m_mdtPRDs_in
std::string m_inputContainer_csc
const Muon::CscStripPrepDataContainer * m_cscPRDs_in
Muon::TgcPrepDataContainer * m_tgcPRDs_out
std::string m_inputContainer_rpc
Muon::CscStripPrepDataContainer * m_cscPRDs_out
std::string m_outputContainer_mdt
const Muon::TgcPrepDataContainer * m_tgcPRDs_in
std::string m_outputContainer_tgc

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode MuonPrdSelectorAlg::execute ( )
virtual

Retrieves and records containers, performs selection.

Definition at line 78 of file MuonPrdSelectorAlg.cxx.

79{
80 ATH_MSG_DEBUG( "execute() called" );
84 return StatusCode::SUCCESS;
85}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
StatusCode performSelection()
checks if each hit in each collection passes a set of cuts these hits are written to new collections
StatusCode retrieveContainers()
retrieves input MuonPrepDataContainers from StoreGate
StatusCode recordContainers()
records output MuonPrepDataContainers to StoreGate

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

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

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51{
52 // If we didn't find any symlinks to add, just return the collection
53 // from the base class. Otherwise, return the extended collection.
54 if (!m_extendedExtraObjects.empty()) {
56 }
57 return Algorithm::extraOutputDeps();
58}
DataObjIDColl m_extendedExtraObjects

◆ initialize()

StatusCode MuonPrdSelectorAlg::initialize ( )
virtual

Algorithm initialization: retrieves StoreGate/DetectorStore/MuonIdHelpers/MuonPrepDataContainers.

Definition at line 30 of file MuonPrdSelectorAlg.cxx.

31{
32 ATH_MSG_DEBUG( "initialize() called" );
33
34 ATH_CHECK( m_idHelperSvc.retrieve() );
35
36 // retrieve test tool
37 ATH_CHECK( m_muonIdCutTool.retrieve() );
38
39 try {
40 m_mdtPRDs_out = new Muon::MdtPrepDataContainer(m_idHelperSvc->mdtIdHelper().module_hash_max());
41 } catch(const std::bad_alloc&) {
42 ATH_MSG_FATAL( "Could not create a new MDT PrepRawData container!" );
43 return StatusCode::FAILURE;
44 }
45 m_mdtPRDs_out->addRef();
46
47
48
49 try {
50 m_rpcPRDs_out = new Muon::RpcPrepDataContainer(m_idHelperSvc->rpcIdHelper().module_hash_max());
51 } catch(const std::bad_alloc&) {
52 ATH_MSG_FATAL( "Could not create a new RPC PrepRawData container!" );
53 return StatusCode::FAILURE;
54 }
55 m_rpcPRDs_out->addRef();
56
57 try {
58 m_tgcPRDs_out = new Muon::TgcPrepDataContainer(m_idHelperSvc->tgcIdHelper().module_hash_max());
59 } catch(const std::bad_alloc&) {
60 ATH_MSG_FATAL( "Could not create a new TGC PrepRawData container!" );
61 return StatusCode::FAILURE;
62 }
63 m_tgcPRDs_out->addRef();
64
65
66 try {
67 m_cscPRDs_out = new Muon::CscStripPrepDataContainer(m_idHelperSvc->cscIdHelper().module_hash_max());
68 } catch(const std::bad_alloc&) {
69 ATH_MSG_FATAL( "Could not create a new CSC PrepRawData container!" );
70 return StatusCode::FAILURE;
71 }
72 m_cscPRDs_out->addRef();
73
74
75 return StatusCode::SUCCESS;
76}
#define ATH_MSG_FATAL(x)
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
ToolHandle< IMuonIdCutTool > m_muonIdCutTool
MuonPrepDataContainerT< RpcPrepData > RpcPrepDataContainer
MuonPrepDataContainerT< TgcPrepData > TgcPrepDataContainer
MuonPrepDataContainerT< MdtPrepData > MdtPrepDataContainer
MuonPrepDataContainerT< CscStripPrepData > CscStripPrepDataContainer

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

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.

◆ msg()

MsgStream & AthCommonMsg< Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

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.

◆ performSelection()

StatusCode MuonPrdSelectorAlg::performSelection ( )
private

checks if each hit in each collection passes a set of cuts these hits are written to new collections

Definition at line 151 of file MuonPrdSelectorAlg.cxx.

151 {
156
157 return StatusCode::SUCCESS;
158}
StatusCode selectMDTs()
selects the hits from MDTcollections
StatusCode selectCSCs()
selects the hits from CSCcollections
StatusCode selectTGCs()
selects the hits from TGCcollections
StatusCode selectRPCs()
selects the hits from RPCcollections

◆ print()

void MuonPrdSelectorAlg::print ( )
private

method for DEBUG purposes: prints the content of input and output MuonPrepDataContainer

Definition at line 339 of file MuonPrdSelectorAlg.cxx.

339 {
340 Muon::MdtPrepDataContainer::const_iterator mdtColl = m_mdtPRDs_in->begin();
341 Muon::MdtPrepDataContainer::const_iterator last_mdtColl = m_mdtPRDs_in->end();
342 unsigned int i_coll(0);
343 for( ; mdtColl!=last_mdtColl ; ++mdtColl, ++i_coll ){
344 Identifier ID = (*mdtColl)->identify() ;
345 ATH_MSG_DEBUG( "MDT IN Collection(" << std::setw(2) << i_coll << ") : " << ID );
346 }
347
348 mdtColl = m_mdtPRDs_out->begin();
349 last_mdtColl = m_mdtPRDs_out->end();
350 i_coll = 0 ;
351 for( ; mdtColl!=last_mdtColl ; ++mdtColl, ++i_coll ){
352 Identifier ID = (*mdtColl)->identify() ;
353 ATH_MSG_DEBUG( "MDT OUT Collection(" << std::setw(2) << i_coll << ") : " << ID );
354 }
355
356 Muon::RpcPrepDataContainer::const_iterator rpcColl = m_rpcPRDs_in->begin();
357 Muon::RpcPrepDataContainer::const_iterator last_rpcColl = m_rpcPRDs_in->end();
358 i_coll = 0 ;
359 for( ; rpcColl!=last_rpcColl ; ++rpcColl, ++i_coll ){
360 Identifier ID = (*rpcColl)->identify() ;
361 ATH_MSG_DEBUG( "RPC IN Collection(" << std::setw(2) << i_coll << ") : " << ID );
362 }
363
364 rpcColl = m_rpcPRDs_out->begin();
365 last_rpcColl = m_rpcPRDs_out->end();
366 i_coll = 0 ;
367 for( ; rpcColl!=last_rpcColl ; ++rpcColl, ++i_coll ){
368 Identifier ID = (*rpcColl)->identify() ;
369 ATH_MSG_DEBUG( "RPC OUT Collection(" << std::setw(2) << i_coll << ") : " << ID );
370 }
371
372
373 Muon::TgcPrepDataContainer::const_iterator tgcColl = m_tgcPRDs_in->begin();
374 Muon::TgcPrepDataContainer::const_iterator last_tgcColl = m_tgcPRDs_in->end();
375 i_coll = 0 ;
376 for( ; tgcColl!=last_tgcColl ; ++tgcColl, ++i_coll ){
377 Identifier ID = (*tgcColl)->identify() ;
378 ATH_MSG_DEBUG( "TGC IN Collection(" << std::setw(2) << i_coll << ") : " << ID );
379 }
380
381 tgcColl = m_tgcPRDs_out->begin();
382 last_tgcColl = m_tgcPRDs_out->end();
383 i_coll = 0 ;
384 for( ; tgcColl!=last_tgcColl ; ++tgcColl, ++i_coll ){
385 Identifier ID = (*tgcColl)->identify() ;
386 ATH_MSG_DEBUG( "TGC OUT Collection(" << std::setw(2) << i_coll << ") : " << ID );
387 }
388
389 Muon::CscStripPrepDataContainer::const_iterator cscColl = m_cscPRDs_in->begin();
390 Muon::CscStripPrepDataContainer::const_iterator last_cscColl = m_cscPRDs_in->end();
391 i_coll = 0 ;
392 for( ; cscColl!=last_cscColl ; ++cscColl, ++i_coll ){
393 Identifier ID = (*cscColl)->identify() ;
394 ATH_MSG_DEBUG( "CSC IN Collection(" << std::setw(2) << i_coll << ") : " << ID );
395 }
396
397 cscColl = m_cscPRDs_out->begin();
398 last_cscColl = m_cscPRDs_out->end();
399 i_coll = 0 ;
400 for( ; cscColl!=last_cscColl ; ++cscColl, ++i_coll ){
401 Identifier ID = (*cscColl)->identify() ;
402 ATH_MSG_DEBUG( "CSC OUT Collection(" << std::setw(2) << i_coll << ") : " << ID );
403 }
404
405 SG::ConstIterator<Muon::MdtPrepDataCollection> mdtCollection;
406 SG::ConstIterator<Muon::MdtPrepDataCollection> lastColl;
407 i_coll = 0;
408 if (evtStore()->retrieve(mdtCollection,lastColl) ==StatusCode::SUCCESS) {
409 for ( ; mdtCollection != lastColl ; ++mdtCollection ) {
410 ATH_MSG_DEBUG( "DIRECTLY FROM COLL (" <<std::setw(2) << i_coll << ") " << mdtCollection->identify() );
411 }
412 }
413
414}
std::vector< Identifier > ID
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ recordContainers()

StatusCode MuonPrdSelectorAlg::recordContainers ( )
private

records output MuonPrepDataContainers to StoreGate

Definition at line 136 of file MuonPrdSelectorAlg.cxx.

136 {
138 if( sc.isFailure() ) ATH_MSG_DEBUG( "Could not record MDT PRDs to output container " << m_outputContainer_mdt );
139
141 if( sc.isFailure() ) ATH_MSG_DEBUG( "Could not record RPC PRDs to output container " << m_outputContainer_rpc );
142
144 if( sc.isFailure() ) ATH_MSG_DEBUG( "Could not record TGC PRDs to output container " << m_outputContainer_tgc );
145
147 if( sc.isFailure() ) ATH_MSG_DEBUG( "Could not record CSC PRDs to output container " << m_outputContainer_csc );
148 return sc;
149}
static Double_t sc
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ renounce()

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 > AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
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)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ retrieveContainers()

StatusCode MuonPrdSelectorAlg::retrieveContainers ( )
private

retrieves input MuonPrepDataContainers from StoreGate

Definition at line 87 of file MuonPrdSelectorAlg.cxx.

87 {
88 ATH_MSG_DEBUG( "retrieveContainers() called" );
89
90 //resetting the inputcollections.
91 m_mdtPRDs_in = nullptr;
92 m_rpcPRDs_in = nullptr;
93 m_tgcPRDs_in = nullptr;
94 m_cscPRDs_in = nullptr;
95
97 if( sc.isFailure() ) {
98 ATH_MSG_WARNING( "Could not retrieve MDT PRDs input container "
100 } else {
101 ATH_MSG_DEBUG( "Retrieved MDT PRDs input container " << m_inputContainer_mdt << " ( "
102 << m_mdtPRDs_in->size() << " ) " );
103 }
104
106 if( sc.isFailure() ) {
107 ATH_MSG_WARNING( "Could not retrieve RPC PRDs input container "
109 } else {
110 ATH_MSG_DEBUG( "Retrieved RPC PRDs input container " << m_inputContainer_rpc << " ( "
111 << m_rpcPRDs_in->size() << " ) " );
112 }
113
115 if( sc.isFailure() ) {
116 ATH_MSG_WARNING( "Could not retrieve TGC PRDs input container "
118 } else {
119 ATH_MSG_DEBUG( "Retrieved TGC PRDs input container " << m_inputContainer_tgc << " ( "
120 << m_tgcPRDs_in->size() << " ) " );
121 }
122
124 if( sc.isFailure() ) {
125 ATH_MSG_WARNING( "Could not retrieve CSC PRDs input container "
127 } else {
128 ATH_MSG_DEBUG( "Retrieved CSC PRDs input container " << m_inputContainer_csc << " ( "
129 << m_cscPRDs_in->size() << " ) " );
130 }
131
132 return StatusCode::SUCCESS;
133}
#define ATH_MSG_WARNING(x)

◆ selectCSCs()

StatusCode MuonPrdSelectorAlg::selectCSCs ( )
private

selects the hits from CSCcollections

Definition at line 295 of file MuonPrdSelectorAlg.cxx.

295 {
296 StatusCode sc = StatusCode::SUCCESS ;
297
298 // Clearing the outputContainers
299 m_cscPRDs_out->cleanup();
300
301
302 for (const Muon::CscStripPrepDataCollection* cscColl : *m_cscPRDs_in) {
303
304 Identifier ID = cscColl->identify() ;
305 IdentifierHash hashID = cscColl->identifyHash();
306 auto cscPrdColl = std::make_unique<Muon::CscStripPrepDataCollection>(hashID);
307 cscPrdColl->setIdentifier(ID);
308
309 for (const Muon::CscStripPrepData* csc : *cscColl) {
310 Identifier hitID = csc->identify();
311
312 if (!m_muonIdCutTool->isCut(hitID)){ //write event to new collection
313
314 cscPrdColl->push_back(new Muon::CscStripPrepData(*csc));
315 ATH_MSG_DEBUG( "Writing Event." );
316 }
317 else
318 ATH_MSG_DEBUG( "Rejecting Event." );
319 }
320
321
322 Identifier newID = cscPrdColl->identify();
323 ATH_MSG_DEBUG( "Adding New Collection to CSC list:" << newID );
324 if (StatusCode::SUCCESS != m_cscPRDs_out->addCollection(cscPrdColl.release(),hashID )) {
325 ATH_MSG_ERROR( "Couldn't record CSC Collection with hashID=" << hashID
326 << " in StoreGate!" );
327 continue;
328 }
329 else{
330 ATH_MSG_DEBUG( " Added collection with hashID " << hashID
331 << " in StoreGate!" );
332
333 }
334 }
335 return sc ;
336}
#define ATH_MSG_ERROR(x)
MuonPrepDataCollection< CscStripPrepData > CscStripPrepDataCollection

◆ selectMDTs()

StatusCode MuonPrdSelectorAlg::selectMDTs ( )
private

selects the hits from MDTcollections

Definition at line 161 of file MuonPrdSelectorAlg.cxx.

161 {
162 StatusCode sc = StatusCode::SUCCESS ;
163
164 // Clearing the outputContainers
165 m_mdtPRDs_out->cleanup();
166
167
168 for (const Muon::MdtPrepDataCollection* mdtColl : *m_mdtPRDs_in) {
169
170 Identifier ID = mdtColl->identify() ;
171 IdentifierHash hashID = mdtColl->identifyHash();
172 auto driftCircleColl = std::make_unique<Muon::MdtPrepDataCollection>(hashID);
173 driftCircleColl->setIdentifier(ID);
174
175 for (const Muon::MdtPrepData* mdt : *mdtColl) {
176 Identifier hitID =mdt->identify();
177
178 if (!m_muonIdCutTool->isCut(hitID)){ //write event to new collection
179
180 driftCircleColl->push_back(new Muon::MdtPrepData(*mdt));
181 ATH_MSG_DEBUG( "Writing Event." );
182 }
183 else
184 ATH_MSG_DEBUG( "Rejecting Event." );
185
186 }
187
188
189 Identifier newID = driftCircleColl->identify();
190 ATH_MSG_DEBUG( "Adding New Collection to MDT list:" << newID );
191 if (StatusCode::SUCCESS != m_mdtPRDs_out->addCollection(driftCircleColl.release(),hashID )) {
192 ATH_MSG_ERROR( "Couldn't record MDT Drift Circle Collection with hash=" << hashID
193 << " in StoreGate!" );
194 continue;
195 }
196 else{
197 ATH_MSG_DEBUG( " Added collection with hashID " << hashID
198 << " in StoreGate!" );
199
200 }
201 }
202 return sc ;
203}
MuonPrepDataCollection< MdtPrepData > MdtPrepDataCollection

◆ selectRPCs()

StatusCode MuonPrdSelectorAlg::selectRPCs ( )
private

selects the hits from RPCcollections

Definition at line 206 of file MuonPrdSelectorAlg.cxx.

206 {
207 StatusCode sc = StatusCode::SUCCESS ;
208
209 // Clearing the outputContainers
210 m_rpcPRDs_out->cleanup();
211
212
213 for (const Muon::RpcPrepDataCollection* rpcColl : *m_rpcPRDs_in) {
214
215 Identifier ID = rpcColl->identify() ;
216 IdentifierHash hashID = rpcColl->identifyHash();
217 auto rpcPrdColl = std::make_unique<Muon::RpcPrepDataCollection>(hashID);
218 rpcPrdColl->setIdentifier(ID);
219
220 for (const Muon::RpcPrepData* rpc : *rpcColl) {
221 Identifier hitID = rpc->identify();
222
223 if (!m_muonIdCutTool->isCut(hitID)){ //write event to new collection
224
225 rpcPrdColl->push_back(new Muon::RpcPrepData(*rpc));
226 ATH_MSG_DEBUG( "Writing Event." );
227 }
228 else
229 ATH_MSG_DEBUG( "Rejecting Event." );
230
231 }
232
233
234 Identifier newID = rpcPrdColl->identify();
235 ATH_MSG_DEBUG( "Adding New Collection to RPC list:" << newID );
236 if (StatusCode::SUCCESS != m_rpcPRDs_out->addCollection(rpcPrdColl.release(),hashID )) {
237 ATH_MSG_ERROR( "Couldn't record RPC Drift Circle Collection with hashID=" << hashID
238 << " in StoreGate!" );
239 continue;
240 }
241 else{
242 ATH_MSG_DEBUG( " Added collection with hashID " << hashID
243 << " in StoreGate!" );
244
245 }
246 }
247 return sc ;
248}
MuonPrepDataCollection< RpcPrepData > RpcPrepDataCollection

◆ selectTGCs()

StatusCode MuonPrdSelectorAlg::selectTGCs ( )
private

selects the hits from TGCcollections

Definition at line 251 of file MuonPrdSelectorAlg.cxx.

251 {
252 StatusCode sc = StatusCode::SUCCESS ;
253
254 // Clearing the outputContainers
255 m_tgcPRDs_out->cleanup();
256
257
258 for (const Muon::TgcPrepDataCollection* tgcColl : *m_tgcPRDs_in) {
259
260 Identifier ID = tgcColl->identify() ;
261 IdentifierHash hashID = tgcColl->identifyHash();
262 auto tgcPrdColl = std::make_unique<Muon::TgcPrepDataCollection>(hashID);
263 tgcPrdColl->setIdentifier(ID);
264
265 for (const Muon::TgcPrepData* tgc : *tgcColl) {
266 Identifier hitID = tgc->identify();
267
268 if (!m_muonIdCutTool->isCut(hitID)){ //write event to new collection
269
270 tgcPrdColl->push_back(new Muon::TgcPrepData(*tgc));
271 ATH_MSG_DEBUG( "Writing Event." );
272 }
273 else
274 ATH_MSG_DEBUG( "Rejecting Event." );
275
276 }
277
278
279 Identifier newID = tgcPrdColl->identify();
280 ATH_MSG_DEBUG( "Adding New Collection to TGC list:" << newID );
281 if (StatusCode::SUCCESS != m_tgcPRDs_out->addCollection(tgcPrdColl.release(),hashID )) {
282 ATH_MSG_ERROR( "Couldn't record TGC Drift Circle Collection with hashID=" << hashID
283 << " in StoreGate!" );
284 continue;
285 }
286 else{
287 ATH_MSG_DEBUG( " Added collection with hashID " << hashID
288 << " in StoreGate!" );
289 }
290 }
291 return sc ;
292}
MuonPrepDataCollection< TgcPrepData > TgcPrepDataCollection

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, and PyAthena::Alg.

Definition at line 66 of file AthAlgorithm.cxx.

66 {
68
69 if (sc.isFailure()) {
70 return sc;
71 }
72 ServiceHandle<ICondSvc> cs("CondSvc",name());
73 for (auto h : outputHandles()) {
74 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75 // do this inside the loop so we don't create the CondSvc until needed
76 if ( cs.retrieve().isFailure() ) {
77 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78 return StatusCode::SUCCESS;
79 }
80 if (cs->regHandle(this,*h).isFailure()) {
81 sc = StatusCode::FAILURE;
82 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83 << " with CondSvc");
84 }
85 }
86 }
87 return sc;
88}
virtual StatusCode sysInitialize() override
Override sysInitialize.
AthCommonDataStore(const std::string &name, T... args)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_cscPRDs_in

const Muon::CscStripPrepDataContainer* MuonPrdSelectorAlg::m_cscPRDs_in
private

Definition at line 72 of file MuonPrdSelectorAlg.h.

◆ m_cscPRDs_out

Muon::CscStripPrepDataContainer* MuonPrdSelectorAlg::m_cscPRDs_out
private

Definition at line 77 of file MuonPrdSelectorAlg.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> MuonPrdSelectorAlg::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 55 of file MuonPrdSelectorAlg.h.

55{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};

◆ m_inputContainer_csc

std::string MuonPrdSelectorAlg::m_inputContainer_csc
private

Definition at line 62 of file MuonPrdSelectorAlg.h.

◆ m_inputContainer_mdt

std::string MuonPrdSelectorAlg::m_inputContainer_mdt
private

Definition at line 59 of file MuonPrdSelectorAlg.h.

◆ m_inputContainer_rpc

std::string MuonPrdSelectorAlg::m_inputContainer_rpc
private

Definition at line 60 of file MuonPrdSelectorAlg.h.

◆ m_inputContainer_tgc

std::string MuonPrdSelectorAlg::m_inputContainer_tgc
private

Definition at line 61 of file MuonPrdSelectorAlg.h.

◆ m_mdtPRDs_in

const Muon::MdtPrepDataContainer* MuonPrdSelectorAlg::m_mdtPRDs_in
private

Definition at line 69 of file MuonPrdSelectorAlg.h.

◆ m_mdtPRDs_out

Muon::MdtPrepDataContainer* MuonPrdSelectorAlg::m_mdtPRDs_out
private

Definition at line 74 of file MuonPrdSelectorAlg.h.

◆ m_muonIdCutTool

ToolHandle<IMuonIdCutTool> MuonPrdSelectorAlg::m_muonIdCutTool {this,"MuonIdCutTool","MuonIdCutTool/MuonIdCutTool","defines the cuts"}
private

Definition at line 57 of file MuonPrdSelectorAlg.h.

57{this,"MuonIdCutTool","MuonIdCutTool/MuonIdCutTool","defines the cuts"};

◆ m_outputContainer_csc

std::string MuonPrdSelectorAlg::m_outputContainer_csc
private

Definition at line 67 of file MuonPrdSelectorAlg.h.

◆ m_outputContainer_mdt

std::string MuonPrdSelectorAlg::m_outputContainer_mdt
private

Definition at line 64 of file MuonPrdSelectorAlg.h.

◆ m_outputContainer_rpc

std::string MuonPrdSelectorAlg::m_outputContainer_rpc
private

Definition at line 65 of file MuonPrdSelectorAlg.h.

◆ m_outputContainer_tgc

std::string MuonPrdSelectorAlg::m_outputContainer_tgc
private

Definition at line 66 of file MuonPrdSelectorAlg.h.

◆ m_rpcPRDs_in

const Muon::RpcPrepDataContainer* MuonPrdSelectorAlg::m_rpcPRDs_in
private

Definition at line 70 of file MuonPrdSelectorAlg.h.

◆ m_rpcPRDs_out

Muon::RpcPrepDataContainer* MuonPrdSelectorAlg::m_rpcPRDs_out
private

Definition at line 75 of file MuonPrdSelectorAlg.h.

◆ m_tgcPRDs_in

const Muon::TgcPrepDataContainer* MuonPrdSelectorAlg::m_tgcPRDs_in
private

Definition at line 71 of file MuonPrdSelectorAlg.h.

◆ m_tgcPRDs_out

Muon::TgcPrepDataContainer* MuonPrdSelectorAlg::m_tgcPRDs_out
private

Definition at line 76 of file MuonPrdSelectorAlg.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


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