|
ATLAS Offline Software
|
#include <WriteThinnedData.h>
|
| WriteThinnedData (const std::string &name, ISvcLocator *pSvcLocator) |
| Constructor with parameters: More...
|
|
virtual | ~WriteThinnedData () |
| Destructor: More...
|
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | execute () override |
|
virtual StatusCode | finalize () override |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
StringProperty | m_particlesName |
| Particles input location. More...
|
|
SG::ThinningHandleKey< AthExParticles > | m_particlesKey1 { this, "ParticlesKey1", "", "" } |
|
SG::ThinningHandleKey< AthExParticles > | m_particlesKey2 { this, "ParticlesKey2", "", "" } |
|
SG::ReadHandleKeyArray< AthExIParticles > | m_iparticlesKeys { this, "IParticlesKeys", {}, "" } |
|
SG::ThinningHandleKey< AthExIParticles > | m_iparticlesKey3 { this, "IParticlesKey3", "", "" } |
|
StringProperty | m_decayName { this, "Decay", "TwoBodyDecay", "Input location of Decay" } |
| Decay input location. More...
|
|
SG::ReadHandleKeyArray< AthExDecay > | m_decayKeys { this, "DecayKeys", {}, "" } |
|
StringProperty | m_elephantinoName { this, "Elephantino", "PinkElephantino", "Input location of Elephantino" } |
| Elephantino input location. More...
|
|
SG::ReadHandleKeyArray< AthExElephantino > | m_elephantinoKeys { this, "ElephantinoKeys", {}, "" } |
|
BooleanArrayProperty | m_filter |
| Filter to apply on the Particles. More...
|
|
Definition at line 58 of file WriteThinnedData.h.
◆ StoreGateSvc_t
◆ WriteThinnedData() [1/2]
WriteThinnedData::WriteThinnedData |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
Constructor with parameters:
Definition at line 41 of file WriteThinnedData.cxx.
52 "Input location of particles (to be thinned)" );
56 "Filter to apply on Particles (true == keep element)" );
57 std::vector<bool>
filter( 10,
false );
◆ ~WriteThinnedData()
WriteThinnedData::~WriteThinnedData |
( |
| ) |
|
|
virtual |
◆ WriteThinnedData() [2/2]
AthExThinning::WriteThinnedData::WriteThinnedData |
( |
| ) |
|
|
protected |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ doThinningTest1()
Apply the real thinning.
Definition at line 219 of file WriteThinnedData.cxx.
226 msg(MSG::INFO) <<
"Particles | filter :" <<
endmsg;
227 for (
unsigned int i = 0;
i !=
particles->size(); ++
i ) {
228 const std::string kr =
filter[
i] ?
"keep" :
"remove";
230 << std::setw(9) << (*particles)[
i]->px() * igev
234 msg(MSG::INFO) <<
"===================" <<
endmsg;
239 msg(MSG::INFO) <<
"Filter [" << std::boolalpha;
241 std::ostream_iterator<bool>(
msg(MSG::INFO).
stream(),
" ") );
244 msg(MSG::INFO) <<
"... Processing [pre-thinning] ..." <<
endmsg;
246 msg(MSG::INFO) <<
"======== Index table =========" <<
endmsg;
250 for ( std::size_t
i = 0;
i !=
particles->size(); ++
i ) {
251 std::size_t newIdx =
tmp.index(
i );
252 std::stringstream newIdxStr;
269 msg(MSG::INFO) <<
"Filter [" << std::boolalpha;
271 std::ostream_iterator<bool>(
msg(MSG::INFO).
stream(),
" ") );
274 msg(MSG::INFO) <<
"... Processing [thinning] ..." <<
endmsg;
277 msg(MSG::INFO) <<
"======== Index table =========" <<
endmsg;
281 for ( std::size_t
i = 0;
i !=
particles->size(); ++
i ) {
282 std::size_t newIdx =
tmp.index(
i );
283 std::stringstream newIdxStr;
294 return StatusCode::SUCCESS;
◆ doThinningTest2()
Apply the real thinning.
Definition at line 298 of file WriteThinnedData.cxx.
305 msg(MSG::INFO) <<
"Particles | filter :" <<
endmsg;
306 for (
unsigned int i = 0;
i !=
particles->size(); ++
i ) {
307 const std::string kr =
filter[
i] ?
"keep" :
"remove";
309 << std::setw(9) << (*particles)[
i]->px() * igev
313 msg(MSG::INFO) <<
"===================" <<
endmsg;
318 msg(MSG::INFO) <<
"Filter [" << std::boolalpha;
320 std::ostream_iterator<bool>(
msg(MSG::INFO).
stream(),
" ") );
323 msg(MSG::INFO) <<
"... Processing [pre-thinning] ..." <<
endmsg;
325 msg(MSG::INFO) <<
"======== Index table =========" <<
endmsg;
329 for ( std::size_t
i = 0;
i !=
particles->size(); ++
i ) {
330 std::size_t newIdx =
tmp.index(
i );
331 std::stringstream newIdxStr;
348 msg(MSG::INFO) <<
"Filter [" << std::boolalpha;
350 std::ostream_iterator<bool>(
msg(MSG::INFO).
stream(),
" ") );
353 msg(MSG::INFO) <<
"... Processing [thinning] ..." <<
endmsg;
356 msg(MSG::INFO) <<
"======== Index table =========" <<
endmsg;
360 for ( std::size_t
i = 0;
i !=
particles->size(); ++
i ) {
361 std::size_t newIdx =
tmp.index(
i );
362 std::stringstream newIdxStr;
373 return StatusCode::SUCCESS;
◆ doThinningTest3()
Apply the real thinning.
Definition at line 378 of file WriteThinnedData.cxx.
385 msg(MSG::INFO) <<
"IParticles | filter :" <<
endmsg;
386 for (
unsigned int i = 0;
i != iparticles->size(); ++
i ) {
387 const std::string kr =
filter[
i] ?
"keep" :
"remove";
389 << std::setw(9) << (*iparticles)[
i]->px() * igev
393 msg(MSG::INFO) <<
"===================" <<
endmsg;
398 msg(MSG::INFO) <<
"Filter [" << std::boolalpha;
400 std::ostream_iterator<bool>(
msg(MSG::INFO).
stream(),
" ") );
403 msg(MSG::INFO) <<
"... Processing [pre-thinning] ..." <<
endmsg;
405 msg(MSG::INFO) <<
"======== Index table =========" <<
endmsg;
409 for ( std::size_t
i = 0;
i != iparticles->size(); ++
i ) {
410 std::size_t newIdx =
tmp.index(
i );
411 std::stringstream newIdxStr;
428 msg(MSG::INFO) <<
"Filter [" << std::boolalpha;
430 std::ostream_iterator<bool>(
msg(MSG::INFO).
stream(),
" ") );
433 msg(MSG::INFO) <<
"... Processing [thinning] ..." <<
endmsg;
436 msg(MSG::INFO) <<
"======== Index table =========" <<
endmsg;
440 for ( std::size_t
i = 0;
i != iparticles->size(); ++
i ) {
441 std::size_t newIdx =
tmp.index(
i );
442 std::stringstream newIdxStr;
453 return StatusCode::SUCCESS;
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode WriteThinnedData::execute |
( |
| ) |
|
|
overridevirtual |
Definition at line 101 of file WriteThinnedData.cxx.
103 const EventContext& ctx = Gaudi::Hive::currentContext();
107 if ( !
test( ctx, 0,
"test1" ).isSuccess() ) {
112 if ( !
test( ctx, 1,
"test2" ).isSuccess() ) {
117 if ( !
test( ctx, 2,
"test3" ).isSuccess() ) {
122 return allGood ? StatusCode::SUCCESS : StatusCode::FAILURE;
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ 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.
57 return Algorithm::extraOutputDeps();
◆ finalize()
StatusCode WriteThinnedData::finalize |
( |
| ) |
|
|
overridevirtual |
◆ initialize()
StatusCode WriteThinnedData::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 69 of file WriteThinnedData.cxx.
73 for (
int i = 0;
i < 3;
i++) {
74 std::ostringstream
ss;
75 ss <<
"_test" << (
i+1);
92 return StatusCode::SUCCESS;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ test()
StatusCode WriteThinnedData::test |
( |
const EventContext & |
ctx, |
|
|
int |
testNum, |
|
|
const std::string & |
testName |
|
) |
| |
|
protected |
Exercise the following thinning tests: [testName = "test1"] retrieve a AthExParticles
container remove some of the AthExParticle
using an 'AND' filter [testName = "test2"] retrieve a AthExParticles
container remove some of the AthExParticle
using an 'OR' filter [testName = "test3"] retrieve a AthExIParticles
container remove some of the AthExIParticle
using an 'AND' filter.
thinning
Definition at line 125 of file WriteThinnedData.cxx.
128 const std::string&
test = testName;
137 (
"Could not fetch particles at [" << particlesName <<
"] !!");
138 return StatusCode::RECOVERABLE;
144 if ( iparticles->size() !=
particles->size() ||
145 iparticles->at(0)->px() !=
particles->at(0)->px() ) {
147 (
"symlinked containers are corrupted: " <<
endmsg
148 <<
" #iparticles: " << iparticles->size() <<
endmsg
150 <<
" ipx[0] = " << iparticles->at(0)->px() <<
endmsg
151 <<
" px[0] = " <<
particles->at(0)->px());
152 return StatusCode::RECOVERABLE;
164 <<
" p1: px= " << decay->p1()->px() * igev <<
endmsg
165 <<
" p2: px= " << decay->p2()->px() * igev <<
endmsg
166 <<
" l1: px= " << decay->l1()->px() * igev <<
endmsg
167 <<
" l2: px= " << decay->l2()->px() * igev);
170 <<
" leg1: px= " << elephantino->leg1()->px() * igev <<
endmsg
171 <<
" leg2: px= " << elephantino->leg2()->px() * igev <<
endmsg
172 <<
" leg3: px= " << elephantino->leg3()->px() * igev <<
endmsg
173 <<
" leg4: px= " << elephantino->leg4()->px() * igev <<
endmsg
174 <<
" ear1: px= " << elephantino->ear1()->px() * igev <<
endmsg
175 <<
" ear2: px= " << elephantino->ear2()->px() * igev);
179 if (
test ==
"test1" ) {
183 }
else if (
test ==
"test2" ) {
187 }
else if (
test ==
"test3" ) {
193 return StatusCode::FAILURE;
198 (
"Decay is now: " <<
endmsg
199 <<
" p1: px= " << decay->p1()->px() * igev <<
endmsg
200 <<
" p2: px= " << decay->p2()->px() * igev <<
endmsg
201 <<
" l1: px= " << decay->l1()->px() * igev <<
endmsg
202 <<
" l2: px= " << decay->l2()->px() * igev);
205 (
"Elephantino is now: " <<
endmsg
206 <<
" leg1: px= " << elephantino->leg1()->px() * igev <<
endmsg
207 <<
" leg2: px= " << elephantino->leg2()->px() * igev <<
endmsg
208 <<
" leg3: px= " << elephantino->leg3()->px() * igev <<
endmsg
209 <<
" leg4: px= " << elephantino->leg4()->px() * igev <<
endmsg
210 <<
" ear1: px= " << elephantino->ear1()->px() * igev <<
endmsg
211 <<
" ear2: px= " << elephantino->ear2()->px() * igev);
215 return StatusCode::SUCCESS;
◆ updateVHKA()
◆ m_decayKeys
◆ m_decayName
StringProperty AthExThinning::WriteThinnedData::m_decayName { this, "Decay", "TwoBodyDecay", "Input location of Decay" } |
|
protected |
◆ m_detStore
◆ m_elephantinoKeys
◆ m_elephantinoName
StringProperty AthExThinning::WriteThinnedData::m_elephantinoName { this, "Elephantino", "PinkElephantino", "Input location of Elephantino" } |
|
protected |
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_filter
BooleanArrayProperty AthExThinning::WriteThinnedData::m_filter |
|
protected |
Filter to apply on the Particles.
For each element of the filter being true
the corresponding particle will be kept.
Definition at line 140 of file WriteThinnedData.h.
◆ m_iparticlesKey3
◆ m_iparticlesKeys
◆ m_particlesKey1
◆ m_particlesKey2
◆ m_particlesName
StringProperty AthExThinning::WriteThinnedData::m_particlesName |
|
protected |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
SG::ThinningHandleKey< AthExParticles > m_particlesKey1
Hold thinning decisions for one container.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
StringProperty m_elephantinoName
Elephantino input location.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
StatusCode doThinningTest3(const EventContext &ctx, const SG::ThinningHandleKey< AthExIParticles > &iparticlesKey) const
Apply the real thinning.
SG::ThinningHandleKey< AthExIParticles > m_iparticlesKey3
Handle for requesting thinning for a data object.
StatusCode initialize(const std::string &stream, const std::string &qualifier, bool used=true)
Should be called during the initialize phase.
virtual void setOwner(IDataHandleHolder *o)=0
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize() override
Override sysInitialize.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
::StatusCode StatusCode
StatusCode definition for legacy code.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
static const std::size_t RemovedIdx
Flag used to show that an index has been thinned away.
StatusCode doThinningTest1(const EventContext &ctx, const SG::ThinningHandleKey< AthExParticles > &particlesKey) const
Apply the real thinning.
bool allGood
Loop over the SDOs & Digits.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
void fill(H5::Group &out_file, size_t iterations)
SG::ReadHandleKeyArray< AthExDecay > m_decayKeys
SG::ReadHandleKeyArray< AthExIParticles > m_iparticlesKeys
SG::ThinningHandleKey< AthExParticles > m_particlesKey2
StringProperty m_particlesName
Particles input location.
DataObjIDColl m_extendedExtraObjects
#define ATH_MSG_WARNING(x)
BooleanArrayProperty m_filter
Filter to apply on the Particles.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
AthAlgorithm()
Default constructor:
SG::ReadHandleKeyArray< AthExElephantino > m_elephantinoKeys
StatusCode doThinningTest2(const EventContext &ctx, const SG::ThinningHandleKey< AthExParticles > &particlesKey) const
Apply the real thinning.
StatusCode test(const EventContext &ctx, int testNum, const std::string &testName)
Exercise the following thinning tests: [testName = "test1"] retrieve a AthExParticles container remov...
StringProperty m_decayName
Decay input location.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>