ATLAS Offline Software
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
I4MomDumper Class Reference

#include <I4MomDumper.h>

Inheritance diagram for I4MomDumper:
Collaboration diagram for I4MomDumper:

Classes

struct  Display
 

Public Member Functions

 I4MomDumper (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor with parameters: More...
 
virtual ~I4MomDumper ()
 Destructor: More...
 
virtual StatusCode initialize ()
 
virtual StatusCode execute ()
 
virtual StatusCode finalize ()
 
StatusCode dump (const std::string &collName)
 Prints out (on the configured output stream) the content of an INavigable4MomentumCollection object, given its StoreGate key. More...
 
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
 

Protected Member Functions

 I4MomDumper ()
 Default constructor: More...
 
void setupDisplay (Gaudi::Details::PropertyBase &display)
 Callback method to configure the display property which will tell how to dump the informations from I4MomentumCollection. More...
 
void setupOutputStream (Gaudi::Details::PropertyBase &outputStreamName)
 Callback method to configure the output stream into which we'll dump the informations from I4MomentumCollection. More...
 
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
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. More...
 

Protected Attributes

StringArrayProperty m_i4momContainersName
 List of INavigable4Momentum containers one wants to dump. More...
 
StringProperty m_displayName
 switch for the type of printout (pxpypze/eetaphim/...) More...
 
Display::Type m_display
 its value translated into integer More...
 
StringProperty m_outputStreamName
 Name of the output stream where we'll dump informations from the I4Assocs object. More...
 
std::ostream * m_outputStream
 pointer to the file descriptor in case the output stream is not a "MsgStream" More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 26 of file I4MomDumper.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

◆ I4MomDumper() [1/2]

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

Constructor with parameters:

Definition at line 54 of file I4MomDumper.cxx.

55  :
56  AthAlgorithm( name, pSvcLocator ),
58  m_outputStream ( 0 )
59 {
60  //
61  // Property declaration
62  //
63  //declareProperty( "Property", m_nProperty );
64 
65  std::string descr;
66 
67  descr = "List of INavigable4Momentum containers one wants to dump";
68  declareProperty( "INav4Moms",
70  descr );
71  std::vector<std::string> i4momContainersName( 0 );
72  m_i4momContainersName.set( i4momContainersName );
73 
74  declareProperty( "Display",
75  m_displayName = "pxpypze",
76  "Tells how one wants the I4Momentum objects to be displayed"
77  " ie: eetaphim|iptcotthphim|ptetaphim|pxpypze" );
78  m_displayName.declareUpdateHandler( &I4MomDumper::setupDisplay, this );
79 
80  descr = "Name of the output stream where we'll dump informations from the";
81  descr += " INavigable4MomentumCollection object(s).";
82  descr += " Valid stream names are: \n";
83  descr += " - \"MsgStream\"\n";
84  descr += " - \"stderr\"\n";
85  descr += " - \"stdout\"\n";
86  descr += " - \"/path/to/some/file\".";
87 
88  declareProperty( "OutputStream",
89  m_outputStreamName = "MsgStream",
90  descr );
92  this );
93 }

◆ ~I4MomDumper()

I4MomDumper::~I4MomDumper ( )
virtual

Destructor:

Definition at line 97 of file I4MomDumper.cxx.

98 {
99  ATH_MSG_DEBUG( "Calling destructor" );
100  // delete output stream
101  if ( m_outputStream &&
102  ( m_outputStream != &std::cout &&
103  m_outputStream != &std::cerr ) ) {
104  delete m_outputStream;
105  m_outputStream = 0;
106  }
107 }

◆ I4MomDumper() [2/2]

I4MomDumper::I4MomDumper ( )
protected

Default constructor:

Member Function Documentation

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation 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.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation 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.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation 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.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation 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.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ 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.

95 { return m_detStore; }

◆ dump()

StatusCode I4MomDumper::dump ( const std::string &  collName)

Prints out (on the configured output stream) the content of an INavigable4MomentumCollection object, given its StoreGate key.

Definition at line 166 of file I4MomDumper.cxx.

167 {
168  typedef INavigable4MomentumCollection I4Moms_t;
169  if ( !evtStore()->contains<I4Moms_t>( collName ) ) {
170  ATH_MSG_WARNING( "No [" << collName
171  << "] I4MomentumContainer in StoreGate !" );
172  return StatusCode::RECOVERABLE;
173  }
174 
175  const I4Moms_t * coll = 0;
176  if ( !evtStore()->retrieve( coll, collName ).isSuccess() ||
177  0 == coll )
178  {
179  ATH_MSG_WARNING( "Could not retrieve any I4MomentumContainer at ["
180  << collName << "] !!" );
181  return StatusCode::RECOVERABLE;
182  }
183 
184  std::ostringstream out;
185 
186  const std::size_t iMax = coll->size();
187  out << "Retrieved [" << collName << "] ==> size = " << iMax << "\n";
188  if ( coll->empty() ) {
189  return StatusCode::SUCCESS;
190  }
191 
192  // sorting the collection by Pt
193  typedef std::set<const I4Momentum*, P4Sorters::Descending::Pt> Coll_t;
194  Coll_t i4moms( coll->begin(), coll->end() );
195 
196  if ( m_display == Display::EEtaPhiM ) {
197  out << "[e,eta,phi,m] ="
198  << std::right << std::scientific << std::setprecision(8);
199  for ( Coll_t::const_iterator itr = i4moms.begin(),
200  iEnd = i4moms.end();
201  itr != iEnd;
202  ++itr ) {
203  out << std::setw(16) << (*itr)->e()
204  << std::setw(16) << (*itr)->eta()
205  << std::setw(16) << (*itr)->phi()
206  << std::setw(16) << (*itr)->m()
207  << "\n";
208  }
209 
210  } else if ( m_display == Display::IPtCotThPhiM ) {
211  out << "[ipt,cotTh,phi,m] ="
212  << std::right << std::scientific << std::setprecision(8);
213  for ( Coll_t::const_iterator itr = i4moms.begin(),
214  iEnd = i4moms.end();
215  itr != iEnd;
216  ++itr ) {
217  out << std::setw(16) << (*itr)->iPt()
218  << std::setw(16) << (*itr)->cotTh()
219  << std::setw(16) << (*itr)->phi()
220  << std::setw(16) << (*itr)->m()
221  << "\n";
222  }
223 
224  } else if ( m_display == Display::PtEtaPhiM ) {
225  out << "[pt,eta,phi,m] ="
226  << std::right << std::scientific << std::setprecision(8);
227  for ( Coll_t::const_iterator itr = i4moms.begin(),
228  iEnd = i4moms.end();
229  itr != iEnd;
230  ++itr ) {
231  out << std::setw(16) << (*itr)->pt()
232  << std::setw(16) << (*itr)->eta()
233  << std::setw(16) << (*itr)->phi()
234  << std::setw(16) << (*itr)->m()
235  << "\n";
236  }
237  } else {
238  out << "[px,py,pz,e] ="
239  << std::right << std::scientific << std::setprecision(8);
240  for ( Coll_t::const_iterator itr = i4moms.begin(),
241  iEnd = i4moms.end();
242  itr != iEnd;
243  ++itr ) {
244  out << std::setw(16) << (*itr)->px()
245  << std::setw(16) << (*itr)->py()
246  << std::setw(16) << (*itr)->pz()
247  << std::setw(16) << (*itr)->e()
248  << "\n";
249  }
250  }
251  out << "\n";
252 
253  if ( 0 != m_outputStream ) { (*m_outputStream) << out.str() << std::flush;
254  } else { ATH_MSG_DEBUG( out.str() );
255  }
256 
257  return StatusCode::SUCCESS;
258 }

◆ evtStore() [1/2]

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.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode I4MomDumper::execute ( )
virtual

Definition at line 137 of file I4MomDumper.cxx.

138 {
139  ATH_MSG_DEBUG( "Executing " << name() << "..." );
140 
141  typedef std::vector<std::string>::const_iterator ContNameIterator;
142 
143  for ( ContNameIterator
144  itr = m_i4momContainersName.value().begin(),
145  iEnd = m_i4momContainersName.value().end();
146  itr != iEnd;
147  ++itr )
148  {
149  ATH_MSG_DEBUG( "dumping: [" << *itr << "]..." );
150 
151  if ( !dump( *itr ).isSuccess() ) {
152  ATH_MSG_WARNING( "Problem while dumping [" << *itr << "] !!" );
153  continue;
154  }
155  ATH_MSG_DEBUG( "dumping: [" << *itr << "]... [OK]" );
156  }
157 
158  return StatusCode::SUCCESS;
159 }

◆ 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 }

◆ finalize()

StatusCode I4MomDumper::finalize ( )
virtual

Definition at line 131 of file I4MomDumper.cxx.

132 {
133  ATH_MSG_INFO( "Finalizing " << name() << "..." );
134  return StatusCode::SUCCESS;
135 }

◆ initialize()

StatusCode I4MomDumper::initialize ( )
virtual

Definition at line 111 of file I4MomDumper.cxx.

112 {
113  ATH_MSG_INFO( "Initializing " << name() << "..." );
114 
115  ATH_MSG_INFO( "Configured to dump [" << m_i4momContainersName.value().size()
116  << "] containers:" );
117  for ( std::vector<std::string>::const_iterator
118  itr = m_i4momContainersName.value().begin(),
119  iEnd= m_i4momContainersName.value().end();
120  itr != iEnd;
121  ++itr )
122  {
123  ATH_MSG_INFO( " - " << *itr );
124  }
125  ATH_MSG_INFO( "Display : [" << s_display[m_display] << "]\n"
126  << "OutputStream : " << m_outputStreamName.value() );
127 
128  return StatusCode::SUCCESS;
129 }

◆ 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() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ 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.

◆ 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();
383  PBASE::renounce (h);
384  }

◆ 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  {
365  handlesArray.renounce();
366  }

◆ setupDisplay()

void I4MomDumper::setupDisplay ( Gaudi::Details::PropertyBase &  display)
protected

Callback method to configure the display property which will tell how to dump the informations from I4MomentumCollection.

Definition at line 271 of file I4MomDumper.cxx.

272 {
273  std::string& display = const_cast<std::string&>(m_displayName.value());
274 
275  // get the stream in lower case
276  std::transform( display.begin(), display.end(),
277  display.begin(),
278  ToLower() );
279 
280  if ( display == "eetaphim" ) { m_display = Display::EEtaPhiM;
281  } else if ( display == "iptcotthphim" ) { m_display = Display::IPtCotThPhiM;
282  } else if ( display == "ptetaphim" ) { m_display = Display::PtEtaPhiM;
283  } else if ( display == "pxpypze" ) { m_display = Display::PxPyPzE;
284  } else {
285  ATH_MSG_WARNING( "Unknown value for display [" << m_displayName.value() << "] !!\n"
286  << " => will use [pxpypxe] instead..." );
287  display = "pxpypze";
289  }
290 
291  return;
292 }

◆ setupOutputStream()

void I4MomDumper::setupOutputStream ( Gaudi::Details::PropertyBase &  outputStreamName)
protected

Callback method to configure the output stream into which we'll dump the informations from I4MomentumCollection.

Definition at line 294 of file I4MomDumper.cxx.

295 {
296  // reset internal state
297  if ( m_outputStream &&
298  ( m_outputStream != &std::cout && m_outputStream != &std::cerr ) ) {
299  delete m_outputStream;
300  m_outputStream = 0;
301  }
302 
303  std::string streamName = m_outputStreamName.value();
304 
305  // get the stream in lower case
306  std::transform( streamName.begin(), streamName.end(),
307  streamName.begin(),
308  ToLower() );
309 
310  const std::string stdout = "stdout";
311  const std::string stderr = "stderr";
312  const std::string msgstream = "msgstream";
313 
314  if ( streamName == msgstream ) {
315  m_outputStream = 0;
316  } else if ( streamName == stdout ) {
317  m_outputStream = &std::cout;
318  } else if ( streamName == stderr ) {
319  m_outputStream = &std::cerr;
320  } else {
321  m_outputStream = new std::ofstream( m_outputStreamName.value().c_str(),
322  std::ios::out | std::ios::trunc );
323  }
324 
325  return;
326 }

◆ 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, PyAthena::Alg, and AthHistogramAlgorithm.

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 }

◆ 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) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ 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_display

Display::Type I4MomDumper::m_display
protected

its value translated into integer

Definition at line 103 of file I4MomDumper.h.

◆ m_displayName

StringProperty I4MomDumper::m_displayName
protected

switch for the type of printout (pxpypze/eetaphim/...)

Definition at line 100 of file I4MomDumper.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_i4momContainersName

StringArrayProperty I4MomDumper::m_i4momContainersName
protected

List of INavigable4Momentum containers one wants to dump.

Definition at line 97 of file I4MomDumper.h.

◆ m_outputStream

std::ostream* I4MomDumper::m_outputStream
protected

pointer to the file descriptor in case the output stream is not a "MsgStream"

Definition at line 113 of file I4MomDumper.h.

◆ m_outputStreamName

StringProperty I4MomDumper::m_outputStreamName
protected

Name of the output stream where we'll dump informations from the I4Assocs object.

Default: "MsgStream" Available streams: ["MsgStream", "stdout", "stderr", "anyfile"]

Definition at line 109 of file I4MomDumper.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:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
FullCPAlgorithmsTest_eljob.flush
flush
Definition: FullCPAlgorithmsTest_eljob.py:168
I4MomDumper::m_display
Display::Type m_display
its value translated into integer
Definition: I4MomDumper.h:103
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
get_generator_info.stdout
stdout
Definition: get_generator_info.py:40
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
get_generator_info.stderr
stderr
Definition: get_generator_info.py:40
I4MomDumper::setupOutputStream
void setupOutputStream(Gaudi::Details::PropertyBase &outputStreamName)
Callback method to configure the output stream into which we'll dump the informations from I4Momentum...
Definition: I4MomDumper.cxx:294
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
I4MomDumper::Display::PxPyPzE
@ PxPyPzE
Definition: I4MomDumper.h:34
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
python.TransformConfig.descr
descr
print "%s.properties()" % self.__name__
Definition: TransformConfig.py:360
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
pyroot.display
display
Definition: pyroot.py:44
I4MomDumper::m_outputStreamName
StringProperty m_outputStreamName
Name of the output stream where we'll dump informations from the I4Assocs object.
Definition: I4MomDumper.h:109
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
I4MomDumper::Display::EEtaPhiM
@ EEtaPhiM
Definition: I4MomDumper.h:31
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
AthenaPoolExample_Copy.streamName
string streamName
Definition: AthenaPoolExample_Copy.py:39
a
TList * a
Definition: liststreamerinfos.cxx:10
h
I4MomDumper::dump
StatusCode dump(const std::string &collName)
Prints out (on the configured output stream) the content of an INavigable4MomentumCollection object,...
Definition: I4MomDumper.cxx:166
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
I4MomDumper::setupDisplay
void setupDisplay(Gaudi::Details::PropertyBase &display)
Callback method to configure the display property which will tell how to dump the informations from I...
Definition: I4MomDumper.cxx:271
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
I4MomDumper::m_displayName
StringProperty m_displayName
switch for the type of printout (pxpypze/eetaphim/...)
Definition: I4MomDumper.h:100
I4MomDumper::m_i4momContainersName
StringArrayProperty m_i4momContainersName
List of INavigable4Momentum containers one wants to dump.
Definition: I4MomDumper.h:97
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
I4MomDumper::Display::IPtCotThPhiM
@ IPtCotThPhiM
Definition: I4MomDumper.h:32
I4MomDumper::m_outputStream
std::ostream * m_outputStream
pointer to the file descriptor in case the output stream is not a "MsgStream"
Definition: I4MomDumper.h:113
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
I4MomDumper::Display::PtEtaPhiM
@ PtEtaPhiM
Definition: I4MomDumper.h:33
ServiceHandle< ICondSvc >