ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test Class Reference

#include <AtlasCLHEP_RandomGenerators_test.h>

Inheritance diagram for AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test:
Collaboration diagram for AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test:

Public Member Functions

 AtlasCLHEP_RandomGenerators_test (const std::string &name, ISvcLocator *pSvcLocator)
 Standard Athena-Algorithm Constructor. More...
 
 ~AtlasCLHEP_RandomGenerators_test ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
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

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

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

IChronoStatSvc * m_chrono
 central crono service More...
 
CLHEP::HepRandomEngine * m_ranlux64
 
CLHEP::HepRandomEngine * m_ranecu
 
CLHEP::HepRandomEngine * m_mtwist
 
ITHistSvc * m_histSvc
 
ServiceHandle< IAtRndmGenSvcm_rndmSvc1
 
CLHEP::HepRandomEngine * m_randomEngine1
 
std::string m_randomEngineName1
 
ServiceHandle< IAtRndmGenSvcm_rndmSvc2
 
CLHEP::HepRandomEngine * m_randomEngine2
 
std::string m_randomEngineName2
 
TH1m_hflat =nullptr
 
TH1m_hgauss1 =nullptr
 
TH1m_hgauss2 =nullptr
 
TH1m_hgauss3 =nullptr
 
TH1m_hexp1 =nullptr
 
TH1m_hexp2 =nullptr
 
TH1m_hbin1 =nullptr
 
TH1m_hbin2 =nullptr
 
int m_ntest =10000000
 
int m_ievent = 0
 
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 20 of file AtlasCLHEP_RandomGenerators_test.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

◆ AtlasCLHEP_RandomGenerators_test()

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

Standard Athena-Algorithm Constructor.

Definition at line 32 of file AtlasCLHEP_RandomGenerators_test.cxx.

32  :
33  AthAlgorithm(name,pSvcLocator),
34  m_chrono(0),
35  m_ranlux64(nullptr),
36  m_ranecu(nullptr),
37  m_mtwist(nullptr),
38  m_histSvc(nullptr),
39  m_rndmSvc1("AtRanluxGenSvc", name),
40  m_randomEngine1(0),
41  m_randomEngineName1("rnd_AtRanluxGenSvc"),
42  m_rndmSvc2("AtDSFMTGenSvc", name),
43  m_randomEngine2(0),
44  m_randomEngineName2("rnd_AtDSFMTGenSvc")
45  {
46  declareProperty("ntest", m_ntest);
47  }

◆ ~AtlasCLHEP_RandomGenerators_test()

AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::~AtlasCLHEP_RandomGenerators_test ( )

Definition at line 50 of file AtlasCLHEP_RandomGenerators_test.cxx.

50  {
51  }

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

◆ 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 AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::execute ( )

Definition at line 143 of file AtlasCLHEP_RandomGenerators_test.cxx.

144  {
145  int ntest=m_ntest;
146 
147  msg(MSG::DEBUG)<<"event="<<m_ievent<<" ntest="<<ntest<<endmsg;
148 
149  m_chrono -> chronoStart("flat");
150  double sum_flat=0;
151  for(int i=0;i<ntest;++i) {
152  double g=m_randomEngine2->flat();
153  m_hflat->Fill(g);
154  sum_flat+=g;
155  }
156  sum_flat/=ntest;
157  m_chrono -> chronoStop("flat");
158  msg(MSG::DEBUG)<<" avg "<<"flat"<<"="<<sum_flat<<endmsg;
159 
160  m_chrono -> chronoStart("RandGauss");
161  double sum_rnd1=0;
162  for(int i=0;i<ntest;++i) {
163  double g=CLHEP::RandGauss::shoot(m_randomEngine2);
164  m_hgauss1->Fill(g);
165  sum_rnd1+=g;
166  }
167  sum_rnd1/=ntest;
168  m_chrono -> chronoStop("RandGauss");
169  msg(MSG::DEBUG)<<" avg "<<"RandGauss"<<"="<<sum_rnd1<<endmsg;
170 
171  m_chrono -> chronoStart("RandGaussQ");
172  double sum_rnd2=0;
173  for(int i=0;i<ntest;++i) {
174  double g=CLHEP::RandGaussQ::shoot(m_randomEngine2);
175  m_hgauss2->Fill(g);
176  sum_rnd2+=g;
177  }
178  sum_rnd2/=ntest;
179  m_chrono -> chronoStop("RandGaussQ");
180  msg(MSG::DEBUG)<<" avg "<<"RandGaussQ"<<"="<<sum_rnd2<<endmsg;
181 
182  m_chrono -> chronoStart("RandGaussZiggurat");
183  double sum_zig=0;
184  for(int i=0;i<ntest;++i) {
185  double g=CLHEP::RandGaussZiggurat::shoot(m_randomEngine2);
186  m_hgauss3->Fill(g);
187  sum_zig+=g;
188  }
189  sum_zig/=ntest;
190  m_chrono -> chronoStop("RandGaussZiggurat");
191  msg(MSG::DEBUG)<<" avg "<<"RandGaussZiggurat"<<"="<<sum_zig<<endmsg;
192 
193  m_chrono -> chronoStart("RandExponential");
194  double sum_exp=0;
195  for(int i=0;i<ntest;++i) {
196  double g=CLHEP::RandExponential::shoot(m_randomEngine2);
197  m_hexp1->Fill(g);
198  sum_exp+=g;
199  }
200  sum_exp/=ntest;
201  m_chrono -> chronoStop("RandExponential");
202  msg(MSG::DEBUG)<<" avg "<<"RandExponential"<<"="<<sum_exp<<endmsg;
203 
204  m_chrono -> chronoStart("RandExpZiggurat");
205  double sum_expZ=0;
206  for(int i=0;i<ntest;++i) {
207  double g=CLHEP::RandExpZiggurat::shoot(m_randomEngine2);
208  m_hexp2->Fill(g);
209  sum_expZ+=g;
210  }
211  sum_expZ/=ntest;
212  m_chrono -> chronoStop("RandExpZiggurat");
213  msg(MSG::DEBUG)<<" avg "<<"RandExpZiggurat"<<"="<<sum_expZ<<endmsg;
214 
215  CLHEP::RandBinomialFixedP lu(*m_randomEngine2,1,0.4,12); // Needs to be called with the random engine as reference, as a pointer gets deleted by CLHEP::RandBinomial!
216 
217  for(int n=1;n<6;n+=1) {
218  double sum_bin=0;
219  m_chrono -> chronoStart("RandBinomial_"+std::to_string(n));
220  for(int i=0;i<ntest;++i) {
221  double g=CLHEP::RandBinomial::shoot(m_randomEngine2,n,0.4);
222  if(n==3) m_hbin1->Fill(g);
223  sum_bin+=g;
224  }
225  m_chrono -> chronoStop("RandBinomial_"+std::to_string(n));
226  sum_bin/=ntest;
227  msg(MSG::DEBUG) << " avg RandBinomial("<<n<<")="<<sum_bin<< endmsg;
228 
229  double sum_stdbin=0;
230  m_chrono -> chronoStart("RBinomialFP_"+std::to_string(n));
231  for(int i=0;i<ntest;++i) {
232  double g=lu.fire(m_randomEngine2, n );
233  if(n==3) m_hbin2->Fill(g);
234  sum_stdbin+=g;
235  }
236  m_chrono -> chronoStop("RBinomialFP_"+std::to_string(n));
237  sum_stdbin/=ntest;
238  msg(MSG::DEBUG) << " avg RandBinomialFixedP("<<n<<")="<<sum_stdbin<< endmsg;
239  }
240 
241 
242  /*
243 
244  m_chrono -> chronoStart(m_randomEngineName1);
245  double sum_rnd1=0;
246  for(int i=0;i<ntest;++i) {
247  sum_rnd1+=m_randomEngine1->flat();
248  }
249  sum_rnd1/=ntest;
250  m_chrono -> chronoStop(m_randomEngineName1);
251  msg(MSG::DEBUG)<<" avg "<<m_randomEngineName1<<"="<<sum_rnd1<<endmsg;
252 
253  m_chrono -> chronoStart(m_randomEngineName2);
254  double sum_rnd2=0;
255  for(int i=0;i<ntest;++i) {
256  sum_rnd2+=m_randomEngine2->flat();
257  }
258  sum_rnd2/=ntest;
259  m_chrono -> chronoStop(m_randomEngineName2);
260  msg(MSG::DEBUG)<<" avg "<<m_randomEngineName2<<"="<<sum_rnd2<<endmsg;
261 
262  m_chrono -> chronoStart("ranlux64");
263  m_ranlux64->setSeed(seed,1);
264  double sum_ranlux64=0;
265  for(int i=0;i<ntest;++i) {
266  sum_ranlux64+=m_ranlux64->flat();
267  }
268  sum_ranlux64/=ntest;
269  m_chrono -> chronoStop("ranlux64");
270  msg(MSG::DEBUG)<<" avg ranlux64="<<sum_ranlux64<<endmsg;
271 
272  m_chrono -> chronoStart("ranecu");
273  m_ranecu->setSeed(seed,1);
274  double sum_ranecu=0;
275  for(int i=0;i<ntest;++i) {
276  sum_ranecu+=m_ranecu->flat();
277  }
278  sum_ranecu/=ntest;
279  m_chrono -> chronoStop("ranecu");
280  msg(MSG::DEBUG)<<" avg ranecu="<<sum_ranecu<<endmsg;
281 
282  m_chrono -> chronoStart("mtwist");
283  m_mtwist->setSeed(seed,1);
284  double sum_mtwist=0;
285  for(int i=0;i<ntest;++i) {
286  sum_mtwist+=m_mtwist->flat();
287  }
288  sum_mtwist/=ntest;
289  m_chrono -> chronoStop("mtwist");
290  msg(MSG::DEBUG)<<" avg mtwist="<<sum_mtwist<<endmsg;
291 
292  */
293 
294  ++m_ievent;
295 
296  return StatusCode::SUCCESS;
297  }

◆ 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 AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::finalize ( )

Definition at line 136 of file AtlasCLHEP_RandomGenerators_test.cxx.

137  {
138 
139  return StatusCode::SUCCESS;
140  }

◆ initialize()

StatusCode AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::initialize ( )

Definition at line 54 of file AtlasCLHEP_RandomGenerators_test.cxx.

55  {
56  if(!serviceLocator()->service("ChronoStatSvc" , m_chrono ).isSuccess()){
57  ATH_MSG_FATAL( "Cannot retrieve ChronoStatSvc ");
58  return StatusCode::FAILURE;
59  }
60 
61  m_ranlux64=new CLHEP::Ranlux64Engine();
62  m_ranecu=new CLHEP::RanecuEngine();
63  m_mtwist=new CLHEP::MTwistEngine();
64 
65  // Random number service
66  if ( m_rndmSvc1.retrieve().isFailure() ) {
67  msg(MSG::ERROR)<< "Could not retrieve " << m_rndmSvc1 << endmsg;
68  return StatusCode::FAILURE;
69  }
70  if ( m_rndmSvc2.retrieve().isFailure() ) {
71  msg(MSG::ERROR)<< "Could not retrieve " << m_rndmSvc2 << endmsg;
72  return StatusCode::FAILURE;
73  }
74 
75  //Get own engine with own seeds:
77  if (!m_randomEngine1) {
78  msg(MSG::ERROR)<< "Could not get random engine '" << m_randomEngineName1 << "'" << endmsg;
79  return StatusCode::FAILURE;
80  }
82  if (!m_randomEngine2) {
83  msg(MSG::ERROR)<< "Could not get random engine '" << m_randomEngineName2 << "'" << endmsg;
84  return StatusCode::FAILURE;
85  }
86 
87  if((service("THistSvc", m_histSvc)).isFailure()) {
88  msg(MSG::ERROR) << "Cannot allocate THistSvc service" << endmsg;
89  return StatusCode::FAILURE;
90  }
91 
92  m_hflat=new TH1D("RandFlat","RandFlat",1000,0,1);
93  if(!m_histSvc->regHist(std::string("/PLOTS/") + m_hflat->GetName(), m_hflat).isSuccess()) {
94  msg(MSG::WARNING) << "Could not register histogram "<< m_hflat->GetName() << endmsg;
95  }
96 
97  m_hgauss1=new TH1D("RandGauss","RandGauss",700,-7,7);
98  if(!m_histSvc->regHist(std::string("/PLOTS/") + m_hgauss1->GetName(), m_hgauss1).isSuccess()) {
99  msg(MSG::WARNING) << "Could not register histogram "<< m_hgauss1->GetName() << endmsg;
100  }
101 
102  m_hgauss2=new TH1D("RandGaussQ","RandGaussQ",700,-7,7);
103  if(!m_histSvc->regHist(std::string("/PLOTS/") + m_hgauss2->GetName(), m_hgauss2).isSuccess()) {
104  msg(MSG::WARNING) << "Could not register histogram "<< m_hgauss2->GetName() << endmsg;
105  }
106 
107  m_hgauss3=new TH1D("RandGaussZigurat","RandGaussZigurat",700,-7,7);
108  if(!m_histSvc->regHist(std::string("/PLOTS/") + m_hgauss3->GetName(), m_hgauss3).isSuccess()) {
109  msg(MSG::WARNING) << "Could not register histogram "<< m_hgauss3->GetName() << endmsg;
110  }
111 
112  m_hexp1=new TH1D("RandExponential","RandExponential",900,0,30);
113  if(!m_histSvc->regHist(std::string("/PLOTS/") + m_hexp1->GetName(), m_hexp1).isSuccess()) {
114  msg(MSG::WARNING) << "Could not register histogram "<< m_hexp1->GetName() << endmsg;
115  }
116 
117  m_hexp2=new TH1D("RandExpZiggurat","RandExpZiggurat",900,0,30);
118  if(!m_histSvc->regHist(std::string("/PLOTS/") + m_hexp2->GetName(), m_hexp2).isSuccess()) {
119  msg(MSG::WARNING) << "Could not register histogram "<< m_hexp2->GetName() << endmsg;
120  }
121 
122  m_hbin1=new TH1D("RandBinomial","RandBinomial",4,-0.5,3.5);
123  if(!m_histSvc->regHist(std::string("/PLOTS/") + m_hbin1->GetName(), m_hbin1).isSuccess()) {
124  msg(MSG::WARNING) << "Could not register histogram "<< m_hbin1->GetName() << endmsg;
125  }
126 
127  m_hbin2=new TH1D("RandBinomialFixedP","RandBinomialFixedP",4,-0.5,3.5);
128  if(!m_histSvc->regHist(std::string("/PLOTS/") + m_hbin2->GetName(), m_hbin2).isSuccess()) {
129  msg(MSG::WARNING) << "Could not register histogram "<< m_hbin2->GetName() << endmsg;
130  }
131 
132 
133  return StatusCode::SUCCESS;
134  }

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

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

IChronoStatSvc* AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_chrono
private

central crono service

Definition at line 33 of file AtlasCLHEP_RandomGenerators_test.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_hbin1

TH1* AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_hbin1 =nullptr
private

Definition at line 56 of file AtlasCLHEP_RandomGenerators_test.h.

◆ m_hbin2

TH1* AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_hbin2 =nullptr
private

Definition at line 57 of file AtlasCLHEP_RandomGenerators_test.h.

◆ m_hexp1

TH1* AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_hexp1 =nullptr
private

Definition at line 53 of file AtlasCLHEP_RandomGenerators_test.h.

◆ m_hexp2

TH1* AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_hexp2 =nullptr
private

Definition at line 54 of file AtlasCLHEP_RandomGenerators_test.h.

◆ m_hflat

TH1* AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_hflat =nullptr
private

Definition at line 47 of file AtlasCLHEP_RandomGenerators_test.h.

◆ m_hgauss1

TH1* AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_hgauss1 =nullptr
private

Definition at line 49 of file AtlasCLHEP_RandomGenerators_test.h.

◆ m_hgauss2

TH1* AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_hgauss2 =nullptr
private

Definition at line 50 of file AtlasCLHEP_RandomGenerators_test.h.

◆ m_hgauss3

TH1* AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_hgauss3 =nullptr
private

Definition at line 51 of file AtlasCLHEP_RandomGenerators_test.h.

◆ m_histSvc

ITHistSvc* AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_histSvc
private

Definition at line 38 of file AtlasCLHEP_RandomGenerators_test.h.

◆ m_ievent

int AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_ievent = 0
private

Definition at line 61 of file AtlasCLHEP_RandomGenerators_test.h.

◆ m_mtwist

CLHEP::HepRandomEngine* AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_mtwist
private

Definition at line 37 of file AtlasCLHEP_RandomGenerators_test.h.

◆ m_ntest

int AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_ntest =10000000
private

Definition at line 59 of file AtlasCLHEP_RandomGenerators_test.h.

◆ m_randomEngine1

CLHEP::HepRandomEngine* AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_randomEngine1
private

Definition at line 41 of file AtlasCLHEP_RandomGenerators_test.h.

◆ m_randomEngine2

CLHEP::HepRandomEngine* AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_randomEngine2
private

Definition at line 44 of file AtlasCLHEP_RandomGenerators_test.h.

◆ m_randomEngineName1

std::string AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_randomEngineName1
private

Definition at line 42 of file AtlasCLHEP_RandomGenerators_test.h.

◆ m_randomEngineName2

std::string AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_randomEngineName2
private

Definition at line 45 of file AtlasCLHEP_RandomGenerators_test.h.

◆ m_ranecu

CLHEP::HepRandomEngine* AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_ranecu
private

Definition at line 36 of file AtlasCLHEP_RandomGenerators_test.h.

◆ m_ranlux64

CLHEP::HepRandomEngine* AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_ranlux64
private

Definition at line 35 of file AtlasCLHEP_RandomGenerators_test.h.

◆ m_rndmSvc1

ServiceHandle<IAtRndmGenSvc> AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_rndmSvc1
private

Definition at line 40 of file AtlasCLHEP_RandomGenerators_test.h.

◆ m_rndmSvc2

ServiceHandle<IAtRndmGenSvc> AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_rndmSvc2
private

Definition at line 43 of file AtlasCLHEP_RandomGenerators_test.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:
AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_hbin2
TH1 * m_hbin2
Definition: AtlasCLHEP_RandomGenerators_test.h:57
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_hexp1
TH1 * m_hexp1
Definition: AtlasCLHEP_RandomGenerators_test.h:53
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_histSvc
ITHistSvc * m_histSvc
Definition: AtlasCLHEP_RandomGenerators_test.h:38
AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_rndmSvc1
ServiceHandle< IAtRndmGenSvc > m_rndmSvc1
Definition: AtlasCLHEP_RandomGenerators_test.h:40
AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_hgauss3
TH1 * m_hgauss3
Definition: AtlasCLHEP_RandomGenerators_test.h:51
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_rndmSvc2
ServiceHandle< IAtRndmGenSvc > m_rndmSvc2
Definition: AtlasCLHEP_RandomGenerators_test.h:43
AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_hgauss1
TH1 * m_hgauss1
Definition: AtlasCLHEP_RandomGenerators_test.h:49
TH1D
Definition: rootspy.cxx:342
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
AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_hbin1
TH1 * m_hbin1
Definition: AtlasCLHEP_RandomGenerators_test.h:56
AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_chrono
IChronoStatSvc * m_chrono
central crono service
Definition: AtlasCLHEP_RandomGenerators_test.h:33
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
AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_randomEngine1
CLHEP::HepRandomEngine * m_randomEngine1
Definition: AtlasCLHEP_RandomGenerators_test.h:41
AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_ranecu
CLHEP::HepRandomEngine * m_ranecu
Definition: AtlasCLHEP_RandomGenerators_test.h:36
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_ievent
int m_ievent
Definition: AtlasCLHEP_RandomGenerators_test.h:61
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.
lumiFormat.i
int i
Definition: lumiFormat.py:92
beamspotman.n
n
Definition: beamspotman.py:731
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_ntest
int m_ntest
Definition: AtlasCLHEP_RandomGenerators_test.h:59
AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_mtwist
CLHEP::HepRandomEngine * m_mtwist
Definition: AtlasCLHEP_RandomGenerators_test.h:37
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
TH1::Fill
int Fill(double)
Definition: rootspy.cxx:285
CLHEP::RandBinomialFixedP
Definition: RandBinomialFixedP.h:18
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
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_randomEngineName1
std::string m_randomEngineName1
Definition: AtlasCLHEP_RandomGenerators_test.h:42
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_hexp2
TH1 * m_hexp2
Definition: AtlasCLHEP_RandomGenerators_test.h:54
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_randomEngineName2
std::string m_randomEngineName2
Definition: AtlasCLHEP_RandomGenerators_test.h:45
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_randomEngine2
CLHEP::HepRandomEngine * m_randomEngine2
Definition: AtlasCLHEP_RandomGenerators_test.h:44
AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_hflat
TH1 * m_hflat
Definition: AtlasCLHEP_RandomGenerators_test.h:47
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >
AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_ranlux64
CLHEP::HepRandomEngine * m_ranlux64
Definition: AtlasCLHEP_RandomGenerators_test.h:35
AtlasCLHEP_RandomGenerators::AtlasCLHEP_RandomGenerators_test::m_hgauss2
TH1 * m_hgauss2
Definition: AtlasCLHEP_RandomGenerators_test.h:50