ATLAS Offline Software
Loading...
Searching...
No Matches
DerivedILArCalibCalculatorSvcForTest.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// defining this class is just used for testing since class LArCalibCalculatorSvc is a abstract class which needs to be instatiated in my test code
6// actually the class(i.e. IService) that LArCalibCalculatorSvc inherits is also abstract, which means I also need to override the pure virtual functions in class IService
7// To make matters more complicated, the classes(i.e. INamedInterface and IStateful) that IService inherits are also abstract, so I need to override the pure virtual functions in classes INamedInterface and IStateful
8// In addition, since INamedInterface and IStateful all inherit the class IInterface, which is abstract. Therefore, I also override the pure virtual functions in the class IInterface.
9
10#ifndef LARG4CODE_DERIVEDILARCALIBCALCULATORSVCFORTEST_H
11#define LARG4CODE_DERIVEDILARCALIBCALCULATORSVCFORTEST_H
12
14#include "GaudiKernel/StateMachine.h"
15
16class DerivedILArCalibCalculatorSvcForTest : public implements<ILArCalibCalculatorSvc> {
17
18public:
19
21
23
24// there are no concrete functions for the following member functions,
25 StatusCode sysInitialize()
26 {
27 StatusCode s1;
28 return s1;
29 }
30
31 StatusCode sysStart()
32 {
33 StatusCode s2;
34 return s2;
35 }
36
37 StatusCode sysStop()
38 {
39 StatusCode s3;
40 return s3;
41 }
42
43 StatusCode sysFinalize()
44 {
45 StatusCode s4;
46 return s4;
47 }
48
49 StatusCode sysReinitialize()
50 {
51 StatusCode s5;
52 return s5;
53 }
54
55 StatusCode sysRestart()
56 {
57 StatusCode s6;
58 return s6;
59 }
60
61 void setServiceManager( ISvcManager* ) { return; }
62
63 StatusCode configure()
64 {
65 StatusCode s7;
66 return s7;
67 }
68
69 StatusCode initialize()
70 {
71 StatusCode s7;
72 return s7;
73 }
74
75 StatusCode start()
76 {
77 StatusCode s7;
78 return s7;
79 }
80
81 StatusCode stop()
82 {
83 StatusCode s7;
84 return s7;
85 }
86
87 StatusCode finalize()
88 {
89 StatusCode s7;
90 return s7;
91 }
92
93 StatusCode terminate()
94 {
95 StatusCode s7;
96 return s7;
97 }
98
99 StatusCode reinitialize()
100 {
101 StatusCode s7;
102 return s7;
103 }
104
105 StatusCode restart()
106 {
107 StatusCode s7;
108 return s7;
109 }
110
111 Gaudi::StateMachine::State FSMState() const
112 {
113 return Gaudi::StateMachine::State(0);
114 }
115
116 Gaudi::StateMachine::State targetFSMState() const
117 {
118 return Gaudi::StateMachine::State(0);
119 }
120
121 const std::string& name() const
122 {
123 static const std::string Tes = "test";
124 return Tes;
125 }
126
127 G4bool Process (const G4Step* step, LArG4Identifier & identifier,
128 std::vector<G4double> & energies,
130 {
131 (void)step; //just to silence the unused-parameter warning, the same below
132// (void)energies;
133 (void)process;
134
135 identifier.add(4); //add a set of numbers into the LArG4Identifier class, which can provide proper setting for test
136 identifier.add(1);
137 identifier.add(2);
138 identifier.add(3);
139 identifier.add(4);
140 identifier.add(5);
141 identifier.add(6);
142
143 energies = {1., 2., 3., 4.};
144
145 return true; //returning true aims to make "m_calculator->Process( a_step, identifier, vtmp, LArG4::kOnlyID)" return true in the tested code LArG4CalibSD.cc
146 }
147
148};
149#endif
G4bool Process(const G4Step *step, LArG4Identifier &identifier, std::vector< G4double > &energies, const LArG4::eCalculatorProcessing process=LArG4::kEnergyAndID) const
const std::string process
eCalculatorProcessing
@ kEnergyAndID