9#include <tracking/modules/trackTimeEstimator/TrackTimeEstimatorModule.h>
10#include <framework/logging/Logger.h>
11#include <framework/core/ModuleParam.templateDetails.h>
16TrackTimeEstimatorModule::TrackTimeEstimatorModule() :
Module()
18 setPropertyFlags(c_ParallelProcessingCertified);
20 R
"DOC(Computes the track time, defined as the difference between the average of SVD clusters time and the SVDEvent T0)DOC");
34 const auto svdBestT0 =
m_evtT0->getBestSVDTemporaryEventT0();
38 const auto& recoTrack = track.getRelatedTo<
RecoTrack>();
41 float outgoingArmTime = recoTrack->getOutgoingArmTime();
42 float ingoingArmTime = recoTrack->getIngoingArmTime();
45 if (recoTrack->hasOutgoingArmTime() && recoTrack->hasIngoingArmTime()) {
46 if (outgoingArmTime <= ingoingArmTime) {
47 track.setTrackTime(outgoingArmTime - svdBestT0->eventT0);
49 track.setTrackTime(ingoingArmTime - svdBestT0->eventT0);
51 }
else if (recoTrack->hasOutgoingArmTime() && !recoTrack->hasIngoingArmTime()) {
52 track.setTrackTime(outgoingArmTime - svdBestT0->eventT0);
53 }
else if (!recoTrack->hasOutgoingArmTime() && recoTrack->hasIngoingArmTime()) {
54 track.setTrackTime(ingoingArmTime - svdBestT0->eventT0);
This is the Reconstruction Event-Data Model Track.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
void event()
Loop over all Tracks, get related recoTrack, get SVDHitlist, compute average time,...
void initialize()
Verify that required objects are registered.
StoreObjPtr< EventT0 > m_evtT0
Accessing eventT0, as we want SVDEventT0.
StoreArray< Track > m_tracks
Accessing the Tracks.
StoreArray< RecoTrack > m_recoTracks
Accessing the recoTracks, they have the SVD Hits attached.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.