9#include <tracking/ckf/cdc/findlets/CDCCKFResultStorer.h>
11#include <tracking/ckf/general/utilities/SearchDirection.h>
12#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
13#include <tracking/dataobjects/RecoTrack.h>
15#include <framework/core/ModuleParamList.h>
24 "Export the result tracks into a StoreArray.",
27 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"outputRecoTrackStoreArrayName"),
29 "StoreArray name of the output Track Store Array.");
30 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"outputRelationRecoTrackStoreArrayName"),
32 "StoreArray name of the tracks, the output reco tracks should be related to.");
34 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"writeOutDirection"),
36 "Write out the relations with the direction of the CDC part as weight");
38 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"trackFindingDirection"),
40 "Direction in which the track is reconstructed (SVD/ECL seed)",
43 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"exportAllTracks"),
45 "Export all tracks, even if they did not reach the center of the CDC",
48 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"seedComponent"),
50 "Where does the seed track come from (typically SVD, ECL)",
53 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"setTakenFlag"),
55 "Set flag that hit is taken",
83 B2FATAL(
"CDCCKFResultStorer: No valid seed component specified. Please use SVD/ECL.");
90 if (result.size() < 2) {
94 genfit::MeasuredStateOnPlane
const* trackState =
nullptr;
96 trackState = &result.at(1).getTrackState();
98 trackState = &result.back().getTrackState();
100 B2FATAL(
"CDCCKFResultStorer: No valid direction specified. Please use forward/backward.");
106 && result.back().getWireHit()->getWire().getICLayer() > 2) {
110 const ROOT::Math::XYZVector& trackPosition = ROOT::Math::XYZVector(trackState->getPos());
111 const ROOT::Math::XYZVector& trackMomentum = ROOT::Math::XYZVector(trackState->getMom());
112 const double trackCharge = trackState->getCharge();
116 unsigned int sortingParameter = 0;
118 if (state.isSeed()) {
124 auto rl = state.getRLinfo() == TrackFindingCDC::ERightLeft::c_Right ?
125 RecoHitInformation::RightLeftInformation::c_right :
126 RecoHitInformation::RightLeftInformation::c_left;
136 const RecoTrack* seed = result.front().getSeed();
StoreArray< RecoTrack > m_outputRecoTracks
Output Reco Tracks Store Array.
void initialize() override
Register the store arrays.
std::string m_seedComponentString
Where does the seed track for the CKF come from (typically SVD, ECL)
bool m_param_exportTracks
Export the tracks or not.
std::string m_param_outputRelationRecoTrackStoreArrayName
StoreArray name of the tracks, the output reco tracks should be related to.
RecoHitInformation::OriginTrackFinder m_trackFinderType
What was used to seed the CKF (typically c_SVDtoCDCCKF, c_ECLtoCDCCKF)
bool m_param_exportAllTracks
Export all tracks, even if they did not reach the center of the CDC.
bool m_param_setTakenFlag
Set flag that hit is taken.
TrackFindingCDC::EForwardBackward m_param_writeOutDirection
Direction parameter converted from the string parameters.
TrackFindingCDC::EForwardBackward m_param_trackFindingDirection
Direction parameter converted from the string parameters.
std::string m_param_trackFindingDirectionAsString
Parameter for the direction of the CKF.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
std::string m_param_writeOutDirectionAsString
Parameter for the distance given to the framework (can not handle EForwardBackward directly)
std::string m_param_outputRecoTrackStoreArrayName
StoreArray name of the output Track Store Array.
void apply(const std::vector< CDCCKFResult > &results) override
Do the track/hit finding/merging.
Define states for CKF algorithm, which can be seed track or CDC wire hit.
The Module parameter list class.
This is the Reconstruction Event-Data Model Track.
bool addCDCHit(const UsedCDCHit *cdcHit, const unsigned int sortingParameter, RightLeftInformation rightLeftInformation=RightLeftInformation::c_undefinedRightLeftInformation, OriginTrackFinder foundByTrackFinder=OriginTrackFinder::c_undefinedTrackFinder)
Adds a cdc hit with the given information to the reco track.
static void registerRequiredRelations(StoreArray< RecoTrack > &recoTracks, std::string const &pxdHitsStoreArrayName="", std::string const &svdHitsStoreArrayName="", std::string const &cdcHitsStoreArrayName="", std::string const &bklmHitsStoreArrayName="", std::string const &eklmHitsStoreArrayName="", std::string const &recoHitInformationStoreArrayName="")
Convenience method which registers all relations required to fully use a RecoTrack.
void addRelationTo(const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const
Add a relation from this object to another object (with caching).
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
Accessor to arrays stored in the data store.
T * appendNew()
Construct a new T object at the end of the array.
bool registerRelationTo(const StoreArray< TO > &toArray, DataStore::EDurability durability=DataStore::c_Event, DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut, const std::string &namedRelation="") const
Register a relation to the given StoreArray.
void setTakenFlag(bool setTo=true)
Sets the taken flag to the given value. Default value true.
Class representing a hit wire in the central drift chamber.
void initialize() override
Receive and dispatch signal before the start of the event processing.
virtual void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix)
Forward prefixed parameters of this findlet to the module parameter list.
void addParameter(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
CDCCKFPath CDCCKFResult
Alias for the collection of CDC CKF-algorithm states.
TrackFindingCDC::EForwardBackward fromString(const std::string &directionString)
Helper function to turn a direction string into a valid forward backward information.
Abstract base class for different kinds of events.