ATLAS Offline Software
Loading...
Searching...
No Matches
DerivedILArCalculatorSvcForTest.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5// defining this class is just used for testing since class ILArCalculatorSvc 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_DERIVEDILARCALCULATORSVCFORTEST_H
11#define LARG4CODE_DERIVEDILARCALCULATORSVCFORTEST_H
12
14#include "GaudiKernel/StateMachine.h"
15
16class DerivedILArCalculatorSvcForTest : public implements<ILArCalculatorSvc> {
17
18public:
19
21
23
24// there are no concrete functions for the following member functions, just to override the pure virtual member function in the base classes
25 virtual StatusCode sysInitialize() override
26 {
27 StatusCode s1;
28 return s1;
29 }
30
31 virtual StatusCode sysStart() override
32 {
33 StatusCode s2;
34 return s2;
35 }
36
37 virtual StatusCode sysStop() override
38 {
39 StatusCode s3;
40 return s3;
41 }
42
43 virtual StatusCode sysFinalize() override
44 {
45 StatusCode s4;
46 return s4;
47 }
48
49 virtual StatusCode sysReinitialize() override
50 {
51 StatusCode s5;
52 return s5;
53 }
54
55 virtual StatusCode sysRestart() override
56 {
57 StatusCode s6;
58 return s6;
59 }
60
61 virtual void setServiceManager( ISvcManager* ) override { return; }
62
63 virtual StatusCode configure() override
64 {
65 StatusCode s7;
66 return s7;
67 }
68
69 virtual StatusCode initialize() override
70 {
71 StatusCode s7;
72 return s7;
73 }
74
75 virtual StatusCode start() override
76 {
77 StatusCode s7;
78 return s7;
79 }
80
81 virtual StatusCode stop() override
82 {
83 StatusCode s7;
84 return s7;
85 }
86
87 virtual StatusCode finalize() override
88 {
89 StatusCode s7;
90 return s7;
91 }
92
93 virtual StatusCode terminate() override
94 {
95 StatusCode s7;
96 return s7;
97 }
98
99 virtual StatusCode reinitialize() override
100 {
101 StatusCode s7;
102 return s7;
103 }
104
105 virtual StatusCode restart() override
106 {
107 StatusCode s7;
108 return s7;
109 }
110
111 void initializeForSDCreation() override {};
112
113 virtual Gaudi::StateMachine::State FSMState() const override
114 {
115 return Gaudi::StateMachine::State(0);
116 }
117
118 virtual Gaudi::StateMachine::State targetFSMState() const override
119 {
120 return Gaudi::StateMachine::State(0);
121 }
122
123 virtual const std::string& name() const override
124 {
125 static const std::string Tes = "test";
126 return Tes;
127 }
128
129 virtual G4float OOTcut() const override
130 {
131 return 1.0;
132 }
133
134 virtual G4bool isInTime(G4double hitTime) const override
135 {
136 (void)hitTime;
137 return true;
138 }
139
140 virtual G4bool Process (const G4Step* a_step, std::vector<LArHitData>& hits) const override
141 {
142//firstly set the G4Step object a_step to make it complete, you can set it here as much as you want. Since there is no need to set too much for it, I don't set sth for it
143 (void)a_step;
144
145//insert LArHitData object into hits
146 LArG4Identifier a_ident;//define a LArG4Identifier object called a_ident
147 a_ident.add(4);
148 a_ident.add(2);
149 a_ident.add(2);
150 a_ident.add(3);
151 a_ident.add(4);
152 a_ident.add(5);
153 a_ident.add(6);
154 hits.emplace_back(LArHitData{std::move(a_ident), 1, 1});
155
156 return true;
157 }
158
159};
160#endif
161
float hitTime(const AFP_SIDSimHit &hit)
virtual Gaudi::StateMachine::State FSMState() const override
virtual Gaudi::StateMachine::State targetFSMState() const override
virtual const std::string & name() const override
virtual void setServiceManager(ISvcManager *) override
virtual StatusCode sysReinitialize() override
virtual G4bool isInTime(G4double hitTime) const override
virtual G4bool Process(const G4Step *a_step, std::vector< LArHitData > &hits) const override
void add(element_type value)