ATLAS Offline Software
SolenoidTest.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /*
6  * @author Masahiro Morii, Harvard University
7  * Christos Anastopoulos move to using conditions Alg (MT)
8  *
9  * @brief Test that dumps the solenoid for a selected event
10  * used as unit test see
11  */
12 
13 #ifndef SOLENOIDTEST_H
14 #define SOLENOIDTEST_H
15 
16 // FrameWork includes
20 #include "GaudiKernel/ITHistSvc.h"
21 //
22 #include <atomic>
23 #include <string>
24 
25 
26 // forward declarations
27 class TTree;
28 
29 namespace MagField {
30 
31 class SolenoidTest : public AthAlgorithm {
32 
33  public:
34  SolenoidTest(const std::string& name, ISvcLocator* pSvcLocator);
35  virtual StatusCode initialize() override final;
36  virtual StatusCode execute() override final;
37 
38  private:
39  // Read Magnetic Field
41  this, "AtlasFieldCacheCondObj", "fieldCondObj",
42  "Magnetic Field conditions object key"};
43 
47  double m_xyzt[4]{};
48  double m_field[3]{};
49  double m_fieldZR[3]{};
50  double m_deriv[9]{};
51  double m_derivZR[9]{};
52  TTree* m_tree{nullptr};
54 
55  Gaudi::Property<std::string> m_histStream{
56  this, "HistStreamName", "SolenoidTest",
57  "Name of the THistSvc output stream"};
58  Gaudi::Property<std::string> m_treeName{
59  this, "ROOTTreeName", "field",
60  "Name of the TTree object in the output file."};
61  Gaudi::Property<double> m_minR{this, "MinimumR", 0, "minimum R"};
62  Gaudi::Property<double> m_maxR{this, "MaximumR", 1075., "maximum R"};
63  Gaudi::Property<double> m_minZ{this, "MinimumZ", -2820, "minimum Z"};
64  Gaudi::Property<double> m_maxZ{this, "MaximumZ", 2820., "maximum Z"};
65  Gaudi::Property<int> m_stepsR{this, "StepsR", 200,
66  "Number of steps along radius (granularity)"};
67  Gaudi::Property<int> m_stepsZ{this, "StepsZ", 200,
68  "Number of steps along z (granularity)"};
69  Gaudi::Property<int> m_stepsPhi{this, "StepsPhi", 200,
70  "Number of steps along phi (granularity)"};
71  Gaudi::Property<int> m_event{this, "eventTodump", 0,
72  "Event to dump the magnetic field for"};
73  std::atomic<long int> m_eventsSeen{0};
74 
75 }; // end class SolenoidTest
76 
77 } // end namespace MagField
78 
79 #endif
80 
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
MagField::SolenoidTest::m_treeName
Gaudi::Property< std::string > m_treeName
Definition: SolenoidTest.h:58
MagField::SolenoidTest::m_stepsPhi
Gaudi::Property< int > m_stepsPhi
Definition: SolenoidTest.h:69
MagField::SolenoidTest::m_thistSvc
ServiceHandle< ITHistSvc > m_thistSvc
Histogram Service.
Definition: SolenoidTest.h:45
AtlasFieldCacheCondObj.h
MagField::SolenoidTest::m_minR
Gaudi::Property< double > m_minR
Definition: SolenoidTest.h:61
MagField::SolenoidTest::m_derivZR
double m_derivZR[9]
stores derivatives
Definition: SolenoidTest.h:51
MagField::SolenoidTest::m_stepsR
Gaudi::Property< int > m_stepsR
Definition: SolenoidTest.h:65
MagField::SolenoidTest::SolenoidTest
SolenoidTest(const std::string &name, ISvcLocator *pSvcLocator)
Definition: SolenoidTest.cxx:27
MagField::SolenoidTest::m_deriv
double m_deriv[9]
stores derivatives
Definition: SolenoidTest.h:50
MagField::SolenoidTest::m_tree
TTree * m_tree
the ROOT tree containing the output
Definition: SolenoidTest.h:53
AthAlgorithm.h
MagField::SolenoidTest::m_eventsSeen
std::atomic< long int > m_eventsSeen
event counter
Definition: SolenoidTest.h:73
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MagField::SolenoidTest::m_maxZ
Gaudi::Property< double > m_maxZ
Definition: SolenoidTest.h:64
MagField::SolenoidTest::m_stepsZ
Gaudi::Property< int > m_stepsZ
Definition: SolenoidTest.h:67
MagField::SolenoidTest::execute
virtual StatusCode execute() override final
Definition: SolenoidTest.cxx:63
MagField::SolenoidTest::m_fieldZR
double m_fieldZR[3]
stores the 2d field components
Definition: SolenoidTest.h:49
MagField::SolenoidTest::initialize
virtual StatusCode initialize() override final
Definition: SolenoidTest.cxx:32
AthAlgorithm
Definition: AthAlgorithm.h:47
MagField
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)
Definition: ForwardRegionFieldSvc.h:27
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SG::ReadCondHandleKey< AtlasFieldCacheCondObj >
MagField::SolenoidTest::m_minZ
Gaudi::Property< double > m_minZ
Definition: SolenoidTest.h:63
MagField::SolenoidTest::m_maxR
Gaudi::Property< double > m_maxR
Definition: SolenoidTest.h:62
MagField::SolenoidTest::m_fieldCacheKey
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheKey
Definition: SolenoidTest.h:40
MagField::SolenoidTest::m_field
double m_field[3]
stores the field components
Definition: SolenoidTest.h:48
MagField::SolenoidTest::m_event
Gaudi::Property< int > m_event
Definition: SolenoidTest.h:71
MagField::SolenoidTest
Definition: SolenoidTest.h:31
MagField::SolenoidTest::m_xyzt
double m_xyzt[4]
Variable to write out.
Definition: SolenoidTest.h:47
MagField::SolenoidTest::m_histStream
Gaudi::Property< std::string > m_histStream
Definition: SolenoidTest.h:55
ServiceHandle< ITHistSvc >