Skip to content
This repository was archived by the owner on May 6, 2024. It is now read-only.

Commit 5ab6fc5

Browse files
EinarElentomeichlersmith
authored andcommitted
Rename EndOfEvent
1 parent 75aea26 commit 5ab6fc5

9 files changed

Lines changed: 17 additions & 20 deletions

File tree

include/SimCore/SDs/EcalSD.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ class EcalSD : public SensitiveDetector {
7474
/**
7575
* Clear the map of hits we have accumulated
7676
*/
77-
virtual void EndOfEvent() final override {
78-
hits_.clear();
79-
}
77+
virtual void OnFinishedEvent() final override { hits_.clear(); }
8078

8179
private:
8280
/// map of hits to add to the event (will be squashed)

include/SimCore/SDs/HcalSD.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ class HcalSD : public SensitiveDetector {
8787
event.add(COLLECTION_NAME, hits_);
8888
}
8989

90-
virtual void EndOfEvent() final override { hits_.clear(); }
91-
90+
virtual void OnFinishedEvent() final override { hits_.clear(); }
91+
9292
private:
9393
// A list of identifiers used to find out whether or not a given logical
9494
// volume is one of the Hcal sensitive detector volumes. Any volume that is

include/SimCore/SDs/ScoringPlaneSD.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ class ScoringPlaneSD : public SensitiveDetector {
5151
*/
5252
virtual void saveHits(framework::Event& event) final override;
5353

54-
virtual void EndOfEvent() final override {
55-
hits_.clear();
56-
}
54+
virtual void OnFinishedEvent() final override { hits_.clear(); }
5755

5856
private:
5957
/// Substring to match to logical volumes

include/SimCore/SDs/TrackerSD.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ class TrackerSD : public SensitiveDetector {
5151
event.add(collection_name_, hits_);
5252
}
5353

54-
virtual void EndOfEvent() final override {
55-
hits_.clear();
56-
}
54+
virtual void OnFinishedEvent() final override { hits_.clear(); }
5755

5856
private:
5957
/// The name of the subsystem we are apart of

include/SimCore/SDs/TrigScintSD.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ class TrigScintSD : public SensitiveDetector {
5454
event.add(collection_name_, hits_);
5555
}
5656

57-
virtual void EndOfEvent() final override {
58-
hits_.clear();
59-
}
57+
virtual void OnFinishedEvent() final override { hits_.clear(); }
6058

6159
private:
6260
/// our collection of hits in this SD

include/SimCore/SensitiveDetector.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,23 @@ class SensitiveDetector : public G4VSensitiveDetector {
8787
* the input to this function is of no use to us. This is simply
8888
* here to make sure that we can reset the SD to a new-event state
8989
* whether or not a given event was serialized.
90+
*
91+
* @note: If you are looking for the callback that is used in LDMX-sw when a
92+
* Simulator event finishes, you want `OnFinishedEvent`
9093
*/
9194
virtual void EndOfEvent(G4HCofThisEvent*) override {}
9295

9396
/**
94-
* Cleanup SD and prepare a new-event state
97+
* Cleanup SD and prepare a new-event state.
9598
*/
96-
virtual void EndOfEvent() = 0;
99+
virtual void OnFinishedEvent() = 0;
97100

98101
/**
99102
* Record the configuration of this detector into the run header.
100103
*
101104
* @param[in,out] header RunHeader to write configuration to
102105
*/
103-
//virtual void RecordConfig(ldmx::RunHeader& header) const = 0;
106+
// virtual void RecordConfig(ldmx::RunHeader& header) const = 0;
104107

105108
protected:
106109
/**

src/SimCore/ReSimulator.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ void ReSimulator::produce(framework::Event& event) {
4747
}
4848
if (runManager_->GetCurrentEvent()->IsAborted()) {
4949
runManager_->TerminateOneEvent();
50-
SensitiveDetector::Factory::get().apply([](auto sd) { sd->EndOfEvent(); });
50+
SensitiveDetector::Factory::get().apply(
51+
[](auto sd) { sd->OnFinishedEvent(); });
5152
EXCEPTION_RAISE(
5253
"ReSimAbortedEvent",
5354
"Resimulation resulted in an aborted event, something is wrong with "

src/SimCore/Simulator.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ void Simulator::produce(framework::Event& event) {
142142
// the next event.
143143
if (runManager_->GetCurrentEvent()->IsAborted()) {
144144
runManager_->TerminateOneEvent(); // clean up event objects
145-
SensitiveDetector::Factory::get().apply([](auto sd) { sd->EndOfEvent(); });
145+
SensitiveDetector::Factory::get().apply(
146+
[](auto sd) { sd->OnFinishedEvent(); });
146147
this->abortEvent(); // get out of processors loop
147148
}
148149

src/SimCore/SimulatorBase.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ void SimulatorBase::saveSDHits(framework::Event& event) {
169169
// Copy hit objects from SD hit collections into the output event.
170170
SensitiveDetector::Factory::get().apply([&event](auto sd) {
171171
sd->saveHits(event);
172-
sd->EndOfEvent();
172+
sd->OnFinishedEvent();
173173
});
174174
}
175175

0 commit comments

Comments
 (0)