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 379 of file MuonPrdSelectorAlg.cxx.

379 {
380 Muon::MdtPrepDataContainer::const_iterator mdtColl = m_mdtPRDs_in->begin();
381 Muon::MdtPrepDataContainer::const_iterator last_mdtColl = m_mdtPRDs_in->end();
382 unsigned int i_coll(0);
383 for( ; mdtColl!=last_mdtColl ; ++mdtColl, ++i_coll ){
384 Identifier ID = (*mdtColl)->identify() ;
385 ATH_MSG_DEBUG( "MDT IN Collection(" << std::setw(2) << i_coll << ") : " << ID );
386 }
387
388 mdtColl = m_mdtPRDs_out->begin();
389 last_mdtColl = m_mdtPRDs_out->end();
390 i_coll = 0 ;
391 for( ; mdtColl!=last_mdtColl ; ++mdtColl, ++i_coll ){
392 Identifier ID = (*mdtColl)->identify() ;
393 ATH_MSG_DEBUG( "MDT OUT Collection(" << std::setw(2) << i_coll << ") : " << ID );
394 }
395
396 Muon::RpcPrepDataContainer::const_iterator rpcColl = m_rpcPRDs_in->begin();
397 Muon::RpcPrepDataContainer::const_iterator last_rpcColl = m_rpcPRDs_in->end();
398 i_coll = 0 ;
399 for( ; rpcColl!=last_rpcColl ; ++rpcColl, ++i_coll ){
400 Identifier ID = (*rpcColl)->identify() ;
401 ATH_MSG_DEBUG( "RPC IN Collection(" << std::setw(2) << i_coll << ") : " << ID );
402 }
403
404 rpcColl = m_rpcPRDs_out->begin();
405 last_rpcColl = m_rpcPRDs_out->end();
406 i_coll = 0 ;
407 for( ; rpcColl!=last_rpcColl ; ++rpcColl, ++i_coll ){
408 Identifier ID = (*rpcColl)->identify() ;
409 ATH_MSG_DEBUG( "RPC OUT Collection(" << std::setw(2) << i_coll << ") : " << ID );
410 }
411
412
413 Muon::TgcPrepDataContainer::const_iterator tgcColl = m_tgcPRDs_in->begin();
414 Muon::TgcPrepDataContainer::const_iterator last_tgcColl = m_tgcPRDs_in->end();
415 i_coll = 0 ;
416 for( ; tgcColl!=last_tgcColl ; ++tgcColl, ++i_coll ){
417 Identifier ID = (*tgcColl)->identify() ;
418 ATH_MSG_DEBUG( "TGC IN Collection(" << std::setw(2) << i_coll << ") : " << ID );
419 }
420
421 tgcColl = m_tgcPRDs_out->begin();
422 last_tgcColl = m_tgcPRDs_out->end();
423 i_coll = 0 ;
424 for( ; tgcColl!=last_tgcColl ; ++tgcColl, ++i_coll ){
425 Identifier ID = (*tgcColl)->identify() ;
426 ATH_MSG_DEBUG( "TGC OUT Collection(" << std::setw(2) << i_coll << ") : " << ID );
427 }
428
429 Muon::CscStripPrepDataContainer::const_iterator cscColl = m_cscPRDs_in->begin();
430 Muon::CscStripPrepDataContainer::const_iterator last_cscColl = m_cscPRDs_in->end();
431 i_coll = 0 ;
432 for( ; cscColl!=last_cscColl ; ++cscColl, ++i_coll ){
433 Identifier ID = (*cscColl)->identify() ;
434 ATH_MSG_DEBUG( "CSC IN Collection(" << std::setw(2) << i_coll << ") : " << ID );
435 }
436
437 cscColl = m_cscPRDs_out->begin();
438 last_cscColl = m_cscPRDs_out->end();
439 i_coll = 0 ;
440 for( ; cscColl!=last_cscColl ; ++cscColl, ++i_coll ){
441 Identifier ID = (*cscColl)->identify() ;
442 ATH_MSG_DEBUG( "CSC OUT Collection(" << std::setw(2) << i_coll << ") : " << ID );
443 }
444
445 SG::ConstIterator<Muon::MdtPrepDataCollection> mdtCollection;
446 SG::ConstIterator<Muon::MdtPrepDataCollection> lastColl;
447 i_coll = 0;
448 if (evtStore()->retrieve(mdtCollection,lastColl) ==StatusCode::SUCCESS) {
449 for ( ; mdtCollection != lastColl ; ++mdtCollection ) {
450 ATH_MSG_DEBUG( "DIRECTLY FROM COLL (" <<std::setw(2) << i_coll << ") " << mdtCollection->identify() );
451 }
452 }
453
454}
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 325 of file MuonPrdSelectorAlg.cxx.

325 {
326 StatusCode sc = StatusCode::SUCCESS ;
327
328 // Clearing the outputContainers
329 m_cscPRDs_out->cleanup();
330
331
332 Muon::CscStripPrepDataContainer::const_iterator cscColl = m_cscPRDs_in->begin();
333 Muon::CscStripPrepDataContainer::const_iterator last_cscColl = m_cscPRDs_in->end();
334
335 unsigned int i_cscColl(0);
336
337
338 for( ; cscColl!=last_cscColl ; ++cscColl, ++i_cscColl ){ //for each collection
339
340 Identifier ID = (*cscColl)->identify() ;
341 IdentifierHash hashID = (*cscColl)->identifyHash();
343 (cscPrdColl)->setIdentifier(ID);
344
345 Muon::CscStripPrepDataCollection::const_iterator cscItr = (*cscColl)->begin();
346 Muon::CscStripPrepDataCollection::const_iterator cscEnd = (*cscColl)->end();
347 int i = 0;
348
349 for(; cscItr != cscEnd; ++cscItr,i++ ) { //for each hit in the collection
350 Identifier hitID =(*cscItr)->identify();
351
352 if (!m_muonIdCutTool->isCut(hitID)){ //write event to new collection
353
354 cscPrdColl->push_back(new Muon::CscStripPrepData(**cscItr));
355 ATH_MSG_DEBUG( "Writing Event." );
356 }
357 else
358 ATH_MSG_DEBUG( "Rejecting Event." );
359 }
360
361
362 Identifier newID = (cscPrdColl)->identify();
363 ATH_MSG_DEBUG( "Adding New Collection to CSC list:" << newID );
364 if (StatusCode::SUCCESS != m_cscPRDs_out->addCollection(cscPrdColl,hashID )) {
365 ATH_MSG_ERROR( "Couldn't record CSC Collection with hashID=" << hashID
366 << " in StoreGate!" );
367 continue;
368 }
369 else{
370 ATH_MSG_DEBUG( " Added collection with hashID " << hashID
371 << " in StoreGate!" );
372
373 }
374 }
375 return sc ;
376}
#define ATH_MSG_ERROR(x)
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
value_type push_back(value_type pElem)
MuonPrepDataCollection< CscStripPrepData > CscStripPrepDataCollection
const Identifier & identify(const UncalibratedMeasurement *meas)
Returns the associated identifier from the muon measurement.

◆ 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 Muon::MdtPrepDataContainer::const_iterator mdtColl = m_mdtPRDs_in->begin();
169 Muon::MdtPrepDataContainer::const_iterator last_mdtColl = m_mdtPRDs_in->end();
170
171 unsigned int i_mdtColl(0);
172
173
174 for( ; mdtColl!=last_mdtColl ; ++mdtColl, ++i_mdtColl ){ //for each collection
175
176 Identifier ID = (*mdtColl)->identify() ;
177 IdentifierHash hashID = (*mdtColl)->identifyHash();
178 Muon::MdtPrepDataCollection * driftCircleColl = new Muon::MdtPrepDataCollection(hashID);
179 (driftCircleColl)->setIdentifier(ID);
180
181 Muon::MdtPrepDataCollection::const_iterator mdtItr = (*mdtColl)->begin();
182 Muon::MdtPrepDataCollection::const_iterator mdtEnd = (*mdtColl)->end();
183 int i = 0;
184
185 for(; mdtItr != mdtEnd; ++mdtItr,i++ ) { //for each hit in the collection
186 Identifier hitID =(*mdtItr)->identify();
187
188 if (!m_muonIdCutTool->isCut(hitID)){ //write event to new collection
189
190 driftCircleColl->push_back(new Muon::MdtPrepData(**mdtItr));
191 ATH_MSG_DEBUG( "Writing Event." );
192 }
193 else
194 ATH_MSG_DEBUG( "Rejecting Event." );
195
196 }
197
198
199 Identifier newID = (driftCircleColl)->identify();
200 ATH_MSG_DEBUG( "Adding New Collection to MDT list:" << newID );
201 if (StatusCode::SUCCESS != m_mdtPRDs_out->addCollection(driftCircleColl,hashID )) {
202 ATH_MSG_ERROR( "Couldn't record MDT Drift Circle Collection with hash=" << hashID
203 << " in StoreGate!" );
204 continue;
205 }
206 else{
207 ATH_MSG_DEBUG( " Added collection with hashID " << hashID
208 << " in StoreGate!" );
209
210 }
211 }
212 return sc ;
213}
MuonPrepDataCollection< MdtPrepData > MdtPrepDataCollection

◆ selectRPCs()

StatusCode MuonPrdSelectorAlg::selectRPCs ( )
private

selects the hits from RPCcollections

Definition at line 216 of file MuonPrdSelectorAlg.cxx.

216 {
217 StatusCode sc = StatusCode::SUCCESS ;
218
219 // Clearing the outputContainers
220 m_rpcPRDs_out->cleanup();
221
222
223 Muon::RpcPrepDataContainer::const_iterator rpcColl = m_rpcPRDs_in->begin();
224 Muon::RpcPrepDataContainer::const_iterator last_rpcColl = m_rpcPRDs_in->end();
225
226 unsigned int i_rpcColl(0);
227
228
229 for( ; rpcColl!=last_rpcColl ; ++rpcColl, ++i_rpcColl ){ //for each collection
230
231 Identifier ID = (*rpcColl)->identify() ;
232 IdentifierHash hashID = (*rpcColl)->identifyHash();
234 (rpcPrdColl)->setIdentifier(ID);
235
236 Muon::RpcPrepDataCollection::const_iterator rpcItr = (*rpcColl)->begin();
237 Muon::RpcPrepDataCollection::const_iterator rpcEnd = (*rpcColl)->end();
238 int i = 0;
239
240 for(; rpcItr != rpcEnd; ++rpcItr,i++ ) { //for each hit in the collection
241 Identifier hitID =(*rpcItr)->identify();
242
243 if (!m_muonIdCutTool->isCut(hitID)){ //write event to new collection
244
245 rpcPrdColl->push_back(new Muon::RpcPrepData(**rpcItr));
246 ATH_MSG_DEBUG( "Writing Event." );
247 }
248 else
249 ATH_MSG_DEBUG( "Rejecting Event." );
250
251 }
252
253
254 Identifier newID = (rpcPrdColl)->identify();
255 ATH_MSG_DEBUG( "Adding New Collection to RPC list:" << newID );
256 if (StatusCode::SUCCESS != m_rpcPRDs_out->addCollection(rpcPrdColl,hashID )) {
257 ATH_MSG_ERROR( "Couldn't record RPC Drift Circle Collection with hashID=" << hashID
258 << " in StoreGate!" );
259 continue;
260 }
261 else{
262 ATH_MSG_DEBUG( " Added collection with hashID " << hashID
263 << " in StoreGate!" );
264
265 }
266 }
267 return sc ;
268}
MuonPrepDataCollection< RpcPrepData > RpcPrepDataCollection

◆ selectTGCs()

StatusCode MuonPrdSelectorAlg::selectTGCs ( )
private

selects the hits from TGCcollections

Definition at line 271 of file MuonPrdSelectorAlg.cxx.

271 {
272 StatusCode sc = StatusCode::SUCCESS ;
273
274 // Clearing the outputContainers
275 m_tgcPRDs_out->cleanup();
276
277
278 Muon::TgcPrepDataContainer::const_iterator tgcColl = m_tgcPRDs_in->begin();
279 Muon::TgcPrepDataContainer::const_iterator last_tgcColl = m_tgcPRDs_in->end();
280
281 unsigned int i_tgcColl(0);
282
283
284 for( ; tgcColl!=last_tgcColl ; ++tgcColl, ++i_tgcColl ){ //for each collection
285
286 Identifier ID = (*tgcColl)->identify() ;
287 IdentifierHash hashID = (*tgcColl)->identifyHash();
289 (tgcPrdColl)->setIdentifier(ID);
290
291 Muon::TgcPrepDataCollection::const_iterator tgcItr = (*tgcColl)->begin();
292 Muon::TgcPrepDataCollection::const_iterator tgcEnd = (*tgcColl)->end();
293 int i = 0;
294
295 for(; tgcItr != tgcEnd; ++tgcItr,i++ ) { //for each hit in the collection
296 Identifier hitID =(*tgcItr)->identify();
297
298 if (!m_muonIdCutTool->isCut(hitID)){ //write event to new collection
299
300 tgcPrdColl->push_back(new Muon::TgcPrepData(**tgcItr));
301 ATH_MSG_DEBUG( "Writing Event." );
302 }
303 else
304 ATH_MSG_DEBUG( "Rejecting Event." );
305
306 }
307
308
309 Identifier newID = (tgcPrdColl)->identify();
310 ATH_MSG_DEBUG( "Adding New Collection to TGC list:" << newID );
311 if (StatusCode::SUCCESS != m_tgcPRDs_out->addCollection(tgcPrdColl,hashID )) {
312 ATH_MSG_ERROR( "Couldn't record TGC Drift Circle Collection with hashID=" << hashID
313 << " in StoreGate!" );
314 continue;
315 }
316 else{
317 ATH_MSG_DEBUG( " Added collection with hashID " << hashID
318 << " in StoreGate!" );
319 }
320 }
321 return sc ;
322}
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: