ATLAS Offline Software
Loading...
Searching...
No Matches
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
27class TTree;
28
29namespace MagField {
30
31class 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]{};
53 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
Property holding a SG store/key/clid from which a ReadHandle is made.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
virtual StatusCode initialize() override final
Gaudi::Property< double > m_minR
TTree * m_tree
the ROOT tree containing the output
Gaudi::Property< int > m_stepsZ
Gaudi::Property< double > m_minZ
SolenoidTest(const std::string &name, ISvcLocator *pSvcLocator)
std::atomic< long int > m_eventsSeen
event counter
double m_derivZR[9]
stores derivatives
double m_xyzt[4]
Variable to write out.
Gaudi::Property< int > m_event
Gaudi::Property< double > m_maxZ
Gaudi::Property< std::string > m_treeName
Gaudi::Property< double > m_maxR
double m_deriv[9]
stores derivatives
ServiceHandle< ITHistSvc > m_thistSvc
Histogram Service.
Gaudi::Property< std::string > m_histStream
Gaudi::Property< int > m_stepsR
Gaudi::Property< int > m_stepsPhi
double m_field[3]
stores the field components
double m_fieldZR[3]
stores the 2d field components
virtual StatusCode execute() override final
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheKey
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)