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

#include <MagFieldTestbedAlg.h>

Inheritance diagram for MagField::MagFieldTestbedAlg:
Collaboration diagram for MagField::MagFieldTestbedAlg:

Public Member Functions

 MagFieldTestbedAlg (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~MagFieldTestbedAlg ()
 Destructor. More...
 
StatusCode initialize ()
 Athena algorithm's interface method initialize() More...
 
StatusCode execute ()
 Athena algorithm's interface method execute() More...
 
StatusCode finalize ()
 Athena algorithm's interface method finalize() 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

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

bool checkWithReference ()
 check current field with reference field More...
 
void getFieldValue ()
 get Field value either by G4 or by MagFieldSvc More...
 
StatusCode fetchEnvironment ()
 get environment either for g4 or for magFieldSvc More...
 
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

ServiceHandle< MagField::IMagFieldSvcm_magFieldSvc
 service to get vanilla field svc More...
 
const G4Field * p_g4field = nullptr
 field service from G4 More...
 
ServiceHandle< ITHistSvc > m_thistSvc
 the histogram service More...
 
std::string m_histStream
 THistSvc stream name. More...
 
ServiceHandle< IChronoStatSvc > m_chronoSvc
 the chrono service More...
 
TTree * m_tree
 the ROOT tree containing the output More...
 
std::string m_treeName
 name of the Tree object More...
 
bool m_generateBox
 generate box More...
 
double m_minX
 the minimum x for box generation More...
 
double m_halfX
 the half-lenght along x More...
 
double m_halfY
 the half-length along y More...
 
double m_halfZ
 the half-length along y More...
 
int m_stepsX
 the number of steps in X More...
 
int m_stepsY
 the number of steps in Y More...
 
int m_stepsZ
 the number of steps in Z More...
 
long m_numberOfReadings
 random readings instead of grid More...
 
int m_referenceCount = 0
 
std::string m_refFile
 reference field file name More...
 
std::string m_refTreeName
 TTree object in reference file. More...
 
double m_absTolerance
 absolute tolerance in field against reference More...
 
double m_relTolerance
 relative tolerance in field against reference More...
 
double m_xyzt [4]
 stores the current xyzt position More...
 
double m_field [3]
 stores the field components More...
 
double m_deriv [9] {}
 stores derivatives TODO: currently only useMagFieldSvc = true More...
 
double m_explicitX
 if value to check is given explicitly More...
 
double m_explicitY
 if value to check is given explicitly More...
 
double m_explicitZ
 if value to check is given explicitly More...
 
bool m_complete
 validation completed already? More...
 
bool m_useG4Field
 G4. More...
 
bool m_recordReadings
 record readings (for reproducability) or not (for speed tests) More...
 
bool m_useDerivatives
 only outer detector values will be tested More...
 
bool m_onlyCheckSolenoid
 only scan solenoid field More...
 
bool m_coordsAlongBeam
 coordinates on a beams in random directions More...
 
bool m_explicitCoords
 give values to check explicitly More...
 
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 33 of file MagFieldTestbedAlg.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

◆ MagFieldTestbedAlg()

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

Definition at line 57 of file MagFieldTestbedAlg.cxx.

58  :
59  ::AthAlgorithm(name, pSvcLocator), m_magFieldSvc("AtlasFieldSvc",
60  name), m_thistSvc("THistSvc", name), m_histStream(
61  "MagFieldTestbedAlg"), m_chronoSvc("ChronoStatSvc", name), m_tree(nullptr), m_treeName("field"), m_generateBox(false), m_minX(-11999.),
62  m_halfX(11999.), m_halfY(11999.), m_halfZ(22999.), m_stepsX(200), m_stepsY(
64  "field"), m_absTolerance(1e-7), m_relTolerance(0.01), m_xyzt(), m_field(), m_explicitX(
65  0), m_explicitY(0), m_explicitZ(0), m_complete(false), m_useG4Field(
67  false), m_coordsAlongBeam(false), m_explicitCoords(false) {
68  // histogram service
69  declareProperty("THistService", m_thistSvc, "The HistogramService");
70  declareProperty("HistogramStreamName", m_histStream = "MagFieldTestbedAlg",
71  "Name of the THistSvc output stream");
72 
73  // TTree object name
74  declareProperty("ROOTTreeName", m_treeName = "field",
75  "Name of the TTree object in the output file.");
76 
77  // boundaries for the magfield validation
78  declareProperty("GenerateBox", m_generateBox = false, "generate a box centered in (0,0,0) using halfXYZ");
79  declareProperty("MinX", m_minX = -11998., "minimum x for box generation");
80  declareProperty("HalfX", m_halfX = 11998., "half-length along x-direction");
81  declareProperty("HalfY", m_halfY = 11998., "half-length along y-direction");
82  declareProperty("HalfZ", m_halfZ = 22998., "half-length along z-direction");
83 
84  // number of steps in each dimension (granularity)
85  declareProperty("StepsX", m_stepsX = 200,
86  "Number of steps along x-direction (granularity)");
87  declareProperty("StepsY", m_stepsY = 200,
88  "Number of steps along x-direction (granularity)");
89  declareProperty("StepsZ", m_stepsZ = 200,
90  "Number of steps along x-direction (granularity)");
91 
92  // validate field against a reference file:
93  declareProperty("ReferenceFile", m_refFile = "",
94  "Filename of a reference file to compare the output with");
95  declareProperty("ReferenceTTreeName", m_refTreeName = "field",
96  "TTree object name in the reference file");
97  declareProperty("AbsTolerance", m_absTolerance = 1e-7,
98  "Numerical tolerance when comparing against reference.");
99  declareProperty("RelTolerance", m_relTolerance = 0.01,
100  "Numerical tolerance when comparing against reference.");
101  declareProperty("useG4Field", m_useG4Field);
102  declareProperty("recordReadings", m_recordReadings = true);
103  declareProperty("numberOfReadings", m_numberOfReadings = 0);
104  declareProperty("useDerivatives", m_useDerivatives = false);
105  declareProperty("onlyCheckSolenoid", m_onlyCheckSolenoid = false);
106  declareProperty("coordsAlongBeam", m_coordsAlongBeam = false);
107  declareProperty("explicitCoords", m_explicitCoords = false);
108  declareProperty("explicitX", m_explicitX = 0.);
109  declareProperty("explicitY", m_explicitY = 0.);
110  declareProperty("explicitZ", m_explicitZ = 0.);
111 
112 }

◆ ~MagFieldTestbedAlg()

MagField::MagFieldTestbedAlg::~MagFieldTestbedAlg ( )
virtual

Destructor.

Definition at line 116 of file MagFieldTestbedAlg.cxx.

116  {
117 }

Member Function Documentation

◆ checkWithReference()

bool MagField::MagFieldTestbedAlg::checkWithReference ( )
private

check current field with reference field

Definition at line 416 of file MagFieldTestbedAlg.cxx.

416  {
417 
418  // setup the reference TTree
419  TFile *refF = TFile::Open(m_refFile.c_str());
420  TTree *refT = (refF) ? (TTree*) refF->Get(m_refTreeName.c_str()) : nullptr;
421 
422  //comparison with Masahiro's reference file
423 // std::string temp = "scan";
424 // TTree *refT = (refF) ? (TTree*) refF->Get(temp.c_str()) : 0;
425 
426  if (!refT) {
428  "Unable to read the tree '" << m_refTreeName << "'"
429  << "from file: " << m_refFile);
430  return false;
431  }
432  // enable all input branches
433  refT->SetBranchStatus("*", 1);
434 
435  // setup the reference file branches
436  for (int i = 0; i < 4; i++)
437  m_xyzt[i] = 0.;
438  double refField[3] = { 0., 0., 0. };
439  double refDerivatives[9] = { 0., 0., 0., 0., 0., 0., 0., 0., 0. };
440 
441  refT->SetBranchAddress("pos", &m_xyzt);
442  refT->SetBranchAddress("field", &refField);
443  if (m_useDerivatives) {
444  refT->SetBranchAddress("derivatives", &refDerivatives);
445  }
446 
447  // number of reference TTree entries
448  Long64_t nentries = refT->GetEntries();
449 
450  // setup the diff TTree
451 // TTree *diffT = new TTree("fieldDiff",
452 // "Magnetic Field Differences in AtlasG4");
453  double fieldAbsDiff;
454  double fieldRelDiff;
455  //
456  m_tree->Branch("ReferenceField", &refField, "x/D:y/D:z/D");
457  m_tree->Branch("fieldAbsDiff", &fieldAbsDiff, "diff/D");
458  m_tree->Branch("fieldRelDiff", &fieldRelDiff, "diff/D");
459 
460  if (m_useDerivatives) {
461  m_tree->Branch("ReferenceDerivatives", &refDerivatives,
462  "d1/D:d2/D:d3/D:d4/D:d5/D:d6/D:d7/D:d8/D:d9/D");
463  }
464 
465  // register the diff ROOT TTree to the THistSvc
466 // std::string prefix = "/" + m_histStream + "/";
467 // if (m_thistSvc->regTree(prefix + "fieldDiff", diffT).isFailure()) {
468 // ATH_MSG_ERROR("Unable to register TTree to THistSvc");
469 // return false;
470 // }
471 
472  // to keep track of the errors:
473  double biggestAbsDiff = 0.;
474  double biggestRelDiff = 0.;
475 
476  // loop over all TTree entries
477  bool pass = true;
478  for (Long64_t i = 0; i < nentries; i++) {
479  // read the next entry in the reference ttree
480  // -> fill the m_xyzt and refField variables
481  refT->GetEntry(i);
482 
483  // compute the field at the position given
484  // from the reference file
485  getFieldValue();
486 
487  // compute the difference
488  double mFieldTotal = 0;
489  double refFieldTotal = 0;
490  for (int i = 0; i < 3; i++) {
491  mFieldTotal += m_field[i] * m_field[i];
492  refFieldTotal += refField[i] * refField[i];
493  }
494  mFieldTotal = sqrt(mFieldTotal);
495  refFieldTotal = sqrt(refFieldTotal);
496 
497  fieldAbsDiff = fabs(mFieldTotal - refFieldTotal);
498  if (refFieldTotal != 0) {
499  fieldRelDiff = fieldAbsDiff / refFieldTotal;
500  }
501  if (m_useDerivatives) {
502 
503  if (fabs((m_deriv[0] - refDerivatives[0]) / refDerivatives[0])
505  || fabs(
506  (m_deriv[1] - refDerivatives[1])
507  / refDerivatives[1]) > m_relTolerance
508  || fabs(
509  (m_deriv[2] - refDerivatives[2])
510  / refDerivatives[2]) > m_relTolerance
511  || fabs(
512  (m_deriv[3] - refDerivatives[3])
513  / refDerivatives[3]) > m_relTolerance
514  || fabs(
515  (m_deriv[4] - refDerivatives[4])
516  / refDerivatives[4]) > m_relTolerance
517  || fabs(
518  (m_deriv[5] - refDerivatives[5])
519  / refDerivatives[5]) > m_relTolerance
520  || fabs(
521  (m_deriv[6] - refDerivatives[6])
522  / refDerivatives[6]) > m_relTolerance
523  || fabs(
524  (m_deriv[7] - refDerivatives[7])
525  / refDerivatives[7]) > m_relTolerance
526  || fabs(
527  (m_deriv[8] - refDerivatives[8])
528  / refDerivatives[8]) > m_relTolerance) {
529  ATH_MSG_INFO(
530  "referenceDerivatives 1-9: " << refDerivatives[0]
531  << ", " << refDerivatives[1] << ", "
532  << refDerivatives[2] << ", "
533  << refDerivatives[3] << ", "
534  << refDerivatives[4] << ", "
535  << refDerivatives[5] << ", "
536  << refDerivatives[6] << ", "
537  << refDerivatives[7] << ", "
538  << refDerivatives[8]);
539  ATH_MSG_INFO(
540  "derivatives 1-9: " << m_deriv[0] << ", "
541  << m_deriv[1] << ", " << m_deriv[2] << ", "
542  << m_deriv[3] << ", " << m_deriv[4] << ", "
543  << m_deriv[5] << ", " << m_deriv[6] << ", "
544  << m_deriv[7] << ", " << m_deriv[8]);
545  ATH_MSG_INFO(
546  "relative differences: "
547  << ((m_deriv[0] - refDerivatives[0])
548  / refDerivatives[0]) << ", "
549  << ((m_deriv[1] - refDerivatives[1])
550  / refDerivatives[1]) << ", "
551  << ((m_deriv[2] - refDerivatives[2])
552  / refDerivatives[2]) << ", "
553  << ((m_deriv[3] - refDerivatives[3])
554  / refDerivatives[3]) << ", "
555  << ((m_deriv[4] - refDerivatives[4])
556  / refDerivatives[4]) << ", "
557  << ((m_deriv[5] - refDerivatives[5])
558  / refDerivatives[5]) << ", "
559  << ((m_deriv[6] - refDerivatives[6])
560  / refDerivatives[6]) << ", "
561  << ((m_deriv[7] - refDerivatives[7])
562  / refDerivatives[7]) << ", "
563  << ((m_deriv[8] - refDerivatives[8])
564  / refDerivatives[8]));
565  ATH_MSG_INFO(
566  "coordinates: " << m_xyzt[0] << ", " << m_xyzt[1]
567  << ", " << m_xyzt[2]);
569 
570  }
571  }
572 
573  // check if difference is smaller than one Gauss or if greater if < 1%
574  // only pass if below tolerances
575  if (fieldAbsDiff > m_absTolerance && fieldRelDiff > m_relTolerance) {
576 // if (pass) {
577  ATH_MSG_INFO(
578  "local reading" << m_field[0] << " " << m_field[1] << " "
579  << m_field[2]);
580  ATH_MSG_INFO(
581  "reference reading" << refField[0] << " " << refField[1]
582  << " " << refField[2]);
583  ATH_MSG_INFO(
584  "coordinates: " << m_xyzt[0] << ", " << m_xyzt[1] << ", "
585  << m_xyzt[2]);
586 // }
587  pass = false;
588  }
589  if (fieldAbsDiff > biggestAbsDiff) {
590  biggestAbsDiff = fieldAbsDiff;
591  }
592  if (fieldRelDiff > biggestRelDiff) {
593  biggestRelDiff = fieldRelDiff;
594  }
595 
596  // fill the magField ROOT Tree (using: m_xyzt, m_field)
597  m_tree->Fill();
598 
599  // fill the diffT ROOT Tree (using: m_xyzt, refField)
600 // diffT->Fill();
601  }
602 
603  // close the reference file
604  refF->Close();
605 
606  ATH_MSG_INFO("number of values unequal: " << m_referenceCount);
607  ATH_MSG_INFO("number of readings from reference file: " << nentries);
608 
609  ATH_MSG_INFO(
610  std::setprecision(20)
611  << "1) biggest absolute difference in the mag field comparison: "
612  << biggestAbsDiff << " (tolerance: " << m_absTolerance
613  << ")." << endmsg << "2) biggest relative difference: "
614  << biggestRelDiff << " (tolerance: " << m_relTolerance
615  << ")" << std::setprecision(-1));
616 
617  // tests passed
618  return pass;
619 }

◆ 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 MagField::MagFieldTestbedAlg::execute ( )

Athena algorithm's interface method execute()

Definition at line 179 of file MagFieldTestbedAlg.cxx.

179  {
180 
181  // OUTPUT ONLY EXPLICIT COORDINATE THEN EXIT
182  if (m_explicitCoords) {
183  if (fetchEnvironment().isFailure()) {
184  ATH_MSG_ERROR("Unable to fetch the magnetic field!");
185  return StatusCode::FAILURE;
186  }
187 
188  m_xyzt[0] = m_explicitX;
189  m_xyzt[1] = m_explicitY;
190  m_xyzt[2] = m_explicitZ;
191 
192  getFieldValue();
193 
194  ATH_MSG_INFO("Field Value at: " << m_explicitX << ", " << m_explicitY << ", " << m_explicitZ << "is: " << m_field[0] << ", " << m_field[1] << ", " << m_field[2] );
195 
196  m_complete = true;
197  }
198 
199  // if field validation was not done yet -> run it
200  if (!m_complete) {
201  if (fetchEnvironment().isFailure()) {
202  ATH_MSG_ERROR("Unable to fetch the magnetic field!");
203  return StatusCode::FAILURE;
204  }
205 // no reference file given?
206  if (m_refFile.empty()) {
207  //
208  // create normal validation output file
209  //
210 
211  // set fixed time (will not be written to the ROOT tree)
212 
213  std::vector < CLHEP::Hep3Vector > coordinatesToBeChecked;
214  double maxRadius = m_halfX;
215  double maxZ = m_halfZ;
216 
217  if (m_onlyCheckSolenoid) {
218  maxRadius = solenoidRadius;
219  maxZ = solenoidZhalf;
220  }
221  if (m_numberOfReadings != 0 && !m_coordsAlongBeam) {
222  TRandom3 ran;
223 
224  if (!m_generateBox) {
225  // generate inside a cylinder
226  Chrono chrono(&(*m_chronoSvc), "MFTBcylGen");
227  for (long i = 0; i < m_numberOfReadings; i++) {
228  CLHEP::Hep3Vector temp;
229 
230  double maxRadius = m_halfX;
231  double maxZ = m_halfZ;
232 
233  if (m_onlyCheckSolenoid) {
234  maxRadius = solenoidRadius;
235  maxZ = solenoidZhalf;
236  }
237  temp.setX(ran.Uniform(maxRadius * (-1), maxRadius));
238  temp.setY(ran.Uniform(maxRadius * (-1), maxRadius));
239  temp.setZ(ran.Uniform(maxZ * (-1), maxZ));
240  //only generate values within radius < 11.998; for onlyCheckSolenoid radius < 1075
241 
242  double radius = sqrt(
243  pow(temp.getX(), 2) + pow(temp.getY(), 2));
244  if (radius > m_halfX) {
245  i--;
246  continue;
247  }
248  coordinatesToBeChecked.push_back(temp);
249  }
250  } else {
251  // generate inside a box
252  Chrono chrono(&(*m_chronoSvc), "MFTBboxGen");
253  for (long i = 0; i < m_numberOfReadings; i++) {
254  CLHEP::Hep3Vector temp;
255 
256  double maxRadius = sqrt(pow(m_halfX, 2) + pow(m_halfY,2));
257  double maxZ = m_halfZ;
258 
259  if (m_onlyCheckSolenoid) {
260  maxRadius = solenoidRadius;
261  maxZ = solenoidZhalf;
262  }
263  temp.setX(ran.Uniform(m_minX, m_halfX)); // TODO: tidy this up...
264  temp.setY(ran.Uniform(m_halfY * (-1), m_halfY));
265  temp.setZ(ran.Uniform(maxZ * (-1), maxZ));
266  //only generate values within radius < 11.998; for onlyCheckSolenoid radius < 1075
267 
268  double radius = sqrt(
269  pow(temp.getX(), 2) + pow(temp.getY(), 2));
270  if (radius > maxRadius) {
271  i--;
272  continue;
273  }
274  coordinatesToBeChecked.push_back(temp);
275  }
276  }
277  }
278 
279  if (m_coordsAlongBeam) {
280 
281  TRandom3 rand;
282  CLHEP::Hep3Vector temp;
283  double r, phi, theta;
284 
285  for (long i = 0; i < m_numberOfReadings;) {
286  r = 0.;
287  phi = rand.Uniform(3.14 * (-1), 3.14);
288  theta = rand.Uniform(0, 3.14);
289  while (r < maxRadius) {
290  temp.setX(r * sin(theta) * cos(phi));
291  temp.setY(r * sin(phi) * sin(theta));
292  temp.setZ(r * cos(phi));
293  r += 10.;
294  i++;
295  coordinatesToBeChecked.push_back(temp);
296  }
297  }
298  }
299 
300  // initialize performance timer
301  time_t seconds;
302  seconds = time(nullptr);
303 
304  if (m_numberOfReadings != 0) {
305 
306  for (int i = 0; i < m_numberOfReadings; i++) {
307  m_xyzt[0] = coordinatesToBeChecked.at(i).getX();
308  m_xyzt[1] = coordinatesToBeChecked.at(i).getY();
309  m_xyzt[2] = coordinatesToBeChecked.at(i).getZ();
310  //TODO: delete random coordinates, this segfaults
311 // delete &randomCoordinates.at(i);
312  getFieldValue();
313  if (m_recordReadings) {
314  m_tree->Fill();
315  }
316  }
317  } else {
318  // loop over x
319  for (int stepx = 0; stepx < m_stepsX; stepx++) {
320  m_xyzt[0] = -maxRadius + (2 * maxRadius) / m_stepsX * stepx;
321 
322  // loop over y
323  for (int stepy = 0; stepy < maxRadius; stepy++) {
324  m_xyzt[1] = -maxRadius
325  + (2 * maxRadius) / maxRadius * stepy;
326 
327  // loop over z
328  for (int stepz = 0; stepz < maxZ; stepz++) {
329 
330  m_xyzt[2] = -maxZ + (2 * maxZ) / m_stepsZ * stepz;
331 
332  // compute the field
333  getFieldValue();
334 
335  // fill the ROOT Tree
336  if (m_recordReadings) {
337 
338  m_tree->Fill();
339  }
340  }
341  }
342  }
343  }
344  seconds = time(nullptr) - seconds;
345 
346  if (m_numberOfReadings != 0) {
347  ATH_MSG_INFO(
348  "the reading of " << m_numberOfReadings
349  << " random readings took " << seconds
350  << "seconds.");
351  } else {
352  ATH_MSG_INFO(
353  "the reading of " << m_stepsX * m_stepsY * m_stepsZ
354  << " values in a grid took " << seconds
355  << "seconds.");
356  }
357  }
358  // reference file given
359  else {
360  //
361  // validate against reference file and create output file with positions
362  // from this file
363  //
364 
365  ATH_MSG_INFO(
366  "will now run comparison against given reference file: "
367  << m_refFile);
368  if (checkWithReference())
369  ATH_MSG_INFO("comparison against reference file successful!");
370  else {
371  ATH_MSG_ERROR("comparison against reference file FAILED!!!!");
372  return StatusCode::FAILURE;
373  }
374  }
375 
376  // never run the validation again
377  m_complete = true;
378  }
379 
380  return StatusCode::SUCCESS;
381 }

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

◆ fetchEnvironment()

StatusCode MagField::MagFieldTestbedAlg::fetchEnvironment ( )
private

get environment either for g4 or for magFieldSvc

Definition at line 383 of file MagFieldTestbedAlg.cxx.

383  {
384  if (m_useG4Field) {
385  // use the transportation manager singleton to access the p_g4field
386  G4TransportationManager *transm =
387  G4TransportationManager::GetTransportationManager();
388  G4FieldManager *fieldm = (transm) ? transm->GetFieldManager() : nullptr;
389  p_g4field = (fieldm) ? fieldm->GetDetectorField() : nullptr;
390 
391  if (!p_g4field) {
392  return StatusCode::FAILURE;
393  }
394  }
395  return StatusCode::SUCCESS;
396 }

◆ finalize()

StatusCode MagField::MagFieldTestbedAlg::finalize ( )

Athena algorithm's interface method finalize()

Definition at line 171 of file MagFieldTestbedAlg.cxx.

171  {
172  ATH_MSG_INFO("entering finalize()...");
173 
174  ATH_MSG_INFO("end of finalize()");
175  return StatusCode::SUCCESS;
176 }

◆ getFieldValue()

void MagField::MagFieldTestbedAlg::getFieldValue ( )
private

get Field value either by G4 or by MagFieldSvc

Definition at line 398 of file MagFieldTestbedAlg.cxx.

398  {
399  if (m_useG4Field) {
400  p_g4field->GetFieldValue(m_xyzt, m_field);
401  } else {
402  // use new magnetic field service
403  m_magFieldSvc->getField(m_xyzt, m_field,
404  m_useDerivatives ? m_deriv : nullptr);
405  }
406  if (isnan(m_deriv[0]) || isnan(m_deriv[1]) || isnan(m_deriv[2])
407  || isnan(m_deriv[3]) || isnan(m_deriv[4]) || isnan(m_deriv[5])
408  || isnan(m_deriv[6]) || isnan(m_deriv[7]) || isnan(m_deriv[8])) {
409  ATH_MSG_INFO(
410  "at least one Derivative was NaN at: " << m_xyzt[0] << ", "
411  << m_xyzt[1] << ", " << m_xyzt[2]);
412  }
413 }

◆ initialize()

StatusCode MagField::MagFieldTestbedAlg::initialize ( )

Athena algorithm's interface method initialize()

Definition at line 120 of file MagFieldTestbedAlg.cxx.

120  {
121  ATH_MSG_INFO("entering initialize()...");
122 
123  if (m_chronoSvc.retrieve().isFailure()) {
124  ATH_MSG_ERROR("Could not find chrono svc");
125  return StatusCode::FAILURE;
126  }
127 
128  if (!m_useG4Field) {
129  //TODO: DUMMY reading to initialize newMagFieldSvc
130  m_xyzt[3] = 0.;
131  getFieldValue();
132  }
133 
134  if (m_recordReadings || !(m_refFile.empty())) {
135  // retrieve the histogram service
136  if (m_thistSvc.retrieve().isSuccess()) {
137 
138  // Create the prefix of histogram names for the THistSvc
139  std::string prefix = "/" + m_histStream + "/";
140 
141  // the ROOT tree
142  m_tree = new TTree(m_treeName.c_str(), "Magnetic Field in Atlas");
143  m_tree->Branch("pos", &m_xyzt, "x/D:y/D:z/D");
144  m_tree->Branch("field", &m_field, "fx/D:fy/D:fz/D");
145 
146  // G4Field doesn't allow to get derivatives
147  if (m_useDerivatives) {
148  m_tree->Branch("derivatives", &m_deriv,
149  "d1/D:d2/D:d3/D:d4/D:d5/D:d6/D:d7/D:d8/D:d9/D");
150  }
151  // register this ROOT TTree to the THistSvc
152  if (m_thistSvc->regTree(prefix + m_treeName, m_tree).isFailure()) {
153  ATH_MSG_ERROR("Unable to register TTree to THistSvc");
154  return StatusCode::FAILURE;
155  }
156  // failure in THistSvc retrieve
157  } else {
158  ATH_MSG_ERROR("Unable to retrieve HistogramSvc");
159  return StatusCode::FAILURE;
160  }
161  }
162 
163  m_referenceCount = 0;
164 
165  // success
166  ATH_MSG_INFO("end of initialize()");
167  return StatusCode::SUCCESS;
168 }

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

double MagField::MagFieldTestbedAlg::m_absTolerance
private

absolute tolerance in field against reference

Definition at line 85 of file MagFieldTestbedAlg.h.

◆ m_chronoSvc

ServiceHandle<IChronoStatSvc> MagField::MagFieldTestbedAlg::m_chronoSvc
private

the chrono service

Definition at line 62 of file MagFieldTestbedAlg.h.

◆ m_complete

bool MagField::MagFieldTestbedAlg::m_complete
private

validation completed already?

Definition at line 96 of file MagFieldTestbedAlg.h.

◆ m_coordsAlongBeam

bool MagField::MagFieldTestbedAlg::m_coordsAlongBeam
private

coordinates on a beams in random directions

Definition at line 101 of file MagFieldTestbedAlg.h.

◆ m_deriv

double MagField::MagFieldTestbedAlg::m_deriv[9] {}
private

stores derivatives TODO: currently only useMagFieldSvc = true

Definition at line 90 of file MagFieldTestbedAlg.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_explicitCoords

bool MagField::MagFieldTestbedAlg::m_explicitCoords
private

give values to check explicitly

Definition at line 102 of file MagFieldTestbedAlg.h.

◆ m_explicitX

double MagField::MagFieldTestbedAlg::m_explicitX
private

if value to check is given explicitly

Definition at line 91 of file MagFieldTestbedAlg.h.

◆ m_explicitY

double MagField::MagFieldTestbedAlg::m_explicitY
private

if value to check is given explicitly

Definition at line 92 of file MagFieldTestbedAlg.h.

◆ m_explicitZ

double MagField::MagFieldTestbedAlg::m_explicitZ
private

if value to check is given explicitly

Definition at line 93 of file MagFieldTestbedAlg.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_field

double MagField::MagFieldTestbedAlg::m_field[3]
private

stores the field components

Definition at line 89 of file MagFieldTestbedAlg.h.

◆ m_generateBox

bool MagField::MagFieldTestbedAlg::m_generateBox
private

generate box

Definition at line 67 of file MagFieldTestbedAlg.h.

◆ m_halfX

double MagField::MagFieldTestbedAlg::m_halfX
private

the half-lenght along x

Definition at line 69 of file MagFieldTestbedAlg.h.

◆ m_halfY

double MagField::MagFieldTestbedAlg::m_halfY
private

the half-length along y

Definition at line 70 of file MagFieldTestbedAlg.h.

◆ m_halfZ

double MagField::MagFieldTestbedAlg::m_halfZ
private

the half-length along y

Definition at line 71 of file MagFieldTestbedAlg.h.

◆ m_histStream

std::string MagField::MagFieldTestbedAlg::m_histStream
private

THistSvc stream name.

Definition at line 60 of file MagFieldTestbedAlg.h.

◆ m_magFieldSvc

ServiceHandle<MagField::IMagFieldSvc> MagField::MagFieldTestbedAlg::m_magFieldSvc
private

service to get vanilla field svc

Definition at line 55 of file MagFieldTestbedAlg.h.

◆ m_minX

double MagField::MagFieldTestbedAlg::m_minX
private

the minimum x for box generation

Definition at line 68 of file MagFieldTestbedAlg.h.

◆ m_numberOfReadings

long MagField::MagFieldTestbedAlg::m_numberOfReadings
private

random readings instead of grid

Definition at line 76 of file MagFieldTestbedAlg.h.

◆ m_onlyCheckSolenoid

bool MagField::MagFieldTestbedAlg::m_onlyCheckSolenoid
private

only scan solenoid field

Definition at line 100 of file MagFieldTestbedAlg.h.

◆ m_recordReadings

bool MagField::MagFieldTestbedAlg::m_recordReadings
private

record readings (for reproducability) or not (for speed tests)

Definition at line 98 of file MagFieldTestbedAlg.h.

◆ m_referenceCount

int MagField::MagFieldTestbedAlg::m_referenceCount = 0
private

Definition at line 81 of file MagFieldTestbedAlg.h.

◆ m_refFile

std::string MagField::MagFieldTestbedAlg::m_refFile
private

reference field file name

Definition at line 83 of file MagFieldTestbedAlg.h.

◆ m_refTreeName

std::string MagField::MagFieldTestbedAlg::m_refTreeName
private

TTree object in reference file.

Definition at line 84 of file MagFieldTestbedAlg.h.

◆ m_relTolerance

double MagField::MagFieldTestbedAlg::m_relTolerance
private

relative tolerance in field against reference

Definition at line 86 of file MagFieldTestbedAlg.h.

◆ m_stepsX

int MagField::MagFieldTestbedAlg::m_stepsX
private

the number of steps in X

Definition at line 73 of file MagFieldTestbedAlg.h.

◆ m_stepsY

int MagField::MagFieldTestbedAlg::m_stepsY
private

the number of steps in Y

Definition at line 74 of file MagFieldTestbedAlg.h.

◆ m_stepsZ

int MagField::MagFieldTestbedAlg::m_stepsZ
private

the number of steps in Z

Definition at line 75 of file MagFieldTestbedAlg.h.

◆ m_thistSvc

ServiceHandle<ITHistSvc> MagField::MagFieldTestbedAlg::m_thistSvc
private

the histogram service

Definition at line 59 of file MagFieldTestbedAlg.h.

◆ m_tree

TTree* MagField::MagFieldTestbedAlg::m_tree
private

the ROOT tree containing the output

Definition at line 64 of file MagFieldTestbedAlg.h.

◆ m_treeName

std::string MagField::MagFieldTestbedAlg::m_treeName
private

name of the Tree object

Definition at line 65 of file MagFieldTestbedAlg.h.

◆ m_useDerivatives

bool MagField::MagFieldTestbedAlg::m_useDerivatives
private

only outer detector values will be tested

Definition at line 99 of file MagFieldTestbedAlg.h.

◆ m_useG4Field

bool MagField::MagFieldTestbedAlg::m_useG4Field
private

G4.

Definition at line 97 of file MagFieldTestbedAlg.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.

◆ m_xyzt

double MagField::MagFieldTestbedAlg::m_xyzt[4]
private

stores the current xyzt position

Definition at line 88 of file MagFieldTestbedAlg.h.

◆ p_g4field

const G4Field* MagField::MagFieldTestbedAlg::p_g4field = nullptr
private

field service from G4

Definition at line 57 of file MagFieldTestbedAlg.h.


The documentation for this class was generated from the following files:
MagField::MagFieldTestbedAlg::m_useDerivatives
bool m_useDerivatives
only outer detector values will be tested
Definition: MagFieldTestbedAlg.h:99
MagField::MagFieldTestbedAlg::m_halfZ
double m_halfZ
the half-length along y
Definition: MagFieldTestbedAlg.h:71
MagField::MagFieldTestbedAlg::m_absTolerance
double m_absTolerance
absolute tolerance in field against reference
Definition: MagFieldTestbedAlg.h:85
beamspotman.r
def r
Definition: beamspotman.py:676
MagField::MagFieldTestbedAlg::m_useG4Field
bool m_useG4Field
G4.
Definition: MagFieldTestbedAlg.h:97
MagField::MagFieldTestbedAlg::checkWithReference
bool checkWithReference()
check current field with reference field
Definition: MagFieldTestbedAlg.cxx:416
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
MagField::MagFieldTestbedAlg::m_onlyCheckSolenoid
bool m_onlyCheckSolenoid
only scan solenoid field
Definition: MagFieldTestbedAlg.h:100
MagField::MagFieldTestbedAlg::m_recordReadings
bool m_recordReadings
record readings (for reproducability) or not (for speed tests)
Definition: MagFieldTestbedAlg.h:98
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
MagField::MagFieldTestbedAlg::m_stepsZ
int m_stepsZ
the number of steps in Z
Definition: MagFieldTestbedAlg.h:75
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
MagField::MagFieldTestbedAlg::m_stepsY
int m_stepsY
the number of steps in Y
Definition: MagFieldTestbedAlg.h:74
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
MagField::MagFieldTestbedAlg::m_tree
TTree * m_tree
the ROOT tree containing the output
Definition: MagFieldTestbedAlg.h:64
MagField::MagFieldTestbedAlg::p_g4field
const G4Field * p_g4field
field service from G4
Definition: MagFieldTestbedAlg.h:57
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:71
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
MagField::MagFieldTestbedAlg::m_thistSvc
ServiceHandle< ITHistSvc > m_thistSvc
the histogram service
Definition: MagFieldTestbedAlg.h:59
MagField::MagFieldTestbedAlg::m_relTolerance
double m_relTolerance
relative tolerance in field against reference
Definition: MagFieldTestbedAlg.h:86
MagField::MagFieldTestbedAlg::m_numberOfReadings
long m_numberOfReadings
random readings instead of grid
Definition: MagFieldTestbedAlg.h:76
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
MagField::MagFieldTestbedAlg::m_explicitCoords
bool m_explicitCoords
give values to check explicitly
Definition: MagFieldTestbedAlg.h:102
MagField::MagFieldTestbedAlg::m_halfX
double m_halfX
the half-lenght along x
Definition: MagFieldTestbedAlg.h:69
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
MagField::MagFieldTestbedAlg::m_generateBox
bool m_generateBox
generate box
Definition: MagFieldTestbedAlg.h:67
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
MagField::MagFieldTestbedAlg::m_field
double m_field[3]
stores the field components
Definition: MagFieldTestbedAlg.h:89
MagField::MagFieldTestbedAlg::m_explicitZ
double m_explicitZ
if value to check is given explicitly
Definition: MagFieldTestbedAlg.h:93
MagField::MagFieldTestbedAlg::m_chronoSvc
ServiceHandle< IChronoStatSvc > m_chronoSvc
the chrono service
Definition: MagFieldTestbedAlg.h:62
PlotCalibFromCool.nentries
nentries
Definition: PlotCalibFromCool.py:798
MagField::MagFieldTestbedAlg::m_deriv
double m_deriv[9]
stores derivatives TODO: currently only useMagFieldSvc = true
Definition: MagFieldTestbedAlg.h:90
MagField::MagFieldTestbedAlg::m_refFile
std::string m_refFile
reference field file name
Definition: MagFieldTestbedAlg.h:83
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
LArG4FSStartPointFilter.rand
rand
Definition: LArG4FSStartPointFilter.py:80
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
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
MagField::MagFieldTestbedAlg::fetchEnvironment
StatusCode fetchEnvironment()
get environment either for g4 or for magFieldSvc
Definition: MagFieldTestbedAlg.cxx:383
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
python.LArCalib_HVCorrConfig.seconds
seconds
Definition: LArCalib_HVCorrConfig.py:86
MagField::MagFieldTestbedAlg::m_treeName
std::string m_treeName
name of the Tree object
Definition: MagFieldTestbedAlg.h:65
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
MagField::MagFieldTestbedAlg::m_minX
double m_minX
the minimum x for box generation
Definition: MagFieldTestbedAlg.h:68
MagField::MagFieldTestbedAlg::m_halfY
double m_halfY
the half-length along y
Definition: MagFieldTestbedAlg.h:70
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
MagField::MagFieldTestbedAlg::m_magFieldSvc
ServiceHandle< MagField::IMagFieldSvc > m_magFieldSvc
service to get vanilla field svc
Definition: MagFieldTestbedAlg.h:55
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
MagField::MagFieldTestbedAlg::m_refTreeName
std::string m_refTreeName
TTree object in reference file.
Definition: MagFieldTestbedAlg.h:84
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
a
TList * a
Definition: liststreamerinfos.cxx:10
h
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
MagField::MagFieldTestbedAlg::getFieldValue
void getFieldValue()
get Field value either by G4 or by MagFieldSvc
Definition: MagFieldTestbedAlg.cxx:398
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
MagField::MagFieldTestbedAlg::m_explicitY
double m_explicitY
if value to check is given explicitly
Definition: MagFieldTestbedAlg.h:92
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
MagField::MagFieldTestbedAlg::m_stepsX
int m_stepsX
the number of steps in X
Definition: MagFieldTestbedAlg.h:73
MagField::MagFieldTestbedAlg::m_referenceCount
int m_referenceCount
Definition: MagFieldTestbedAlg.h:81
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
MagField::MagFieldTestbedAlg::m_histStream
std::string m_histStream
THistSvc stream name.
Definition: MagFieldTestbedAlg.h:60
MagField::MagFieldTestbedAlg::m_explicitX
double m_explicitX
if value to check is given explicitly
Definition: MagFieldTestbedAlg.h:91
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
MagField::MagFieldTestbedAlg::m_complete
bool m_complete
validation completed already?
Definition: MagFieldTestbedAlg.h:96
MagField::MagFieldTestbedAlg::m_coordsAlongBeam
bool m_coordsAlongBeam
coordinates on a beams in random directions
Definition: MagFieldTestbedAlg.h:101
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >
MagField::MagFieldTestbedAlg::m_xyzt
double m_xyzt[4]
stores the current xyzt position
Definition: MagFieldTestbedAlg.h:88