10#include <framework/core/Module.h>
11#include <framework/datastore/StoreArray.h>
13#include <tracking/spacePointCreation/SpacePointTrackCand.h>
44 void event()
override;
52 typedef std::tuple<std::vector<int>, std::vector<int>>
CheckInfo;
172 const std::vector<bool>
getDirectionsOfFlight(
const std::vector<const Belle2::SpacePoint*>& spacePoints,
bool useMCInfo);
181 std::vector<Belle2::SpacePointTrackCand>
183 const CheckInfo& prevChecksInfo,
bool removedHits);
192 template <
typename TrueHitType>
237 return std::find_if(V.begin(), V.end(), [&P](
const T & aValue) { return (aValue < P.second && aValue >= P.first);}) != V.end();
Module that does some sanity checks on SpacePointTrackCands that have been created by conversion from...
unsigned int m_kickedSpacePointsCtr
counter of kicked SpacePoints
bool m_PARAMkeepOnlyFirstPart
parameter for keeping only the first part of a curling SpacePointTrackCand
std::vector< bool > getDirsOfFlightSpacePoints(const std::vector< const Belle2::SpacePoint * > &spacePoints, B2Vector3F origin)
get the directions of flight for a vector of SpacePoints using only information from SpacePoints (i....
std::string m_curlingArrayName
name of the StoreArray in which the trackStubs from a curling SPTC are stored
const std::vector< int > checkCurling(Belle2::SpacePointTrackCand *trackCand, bool useMCInfo)
Check if the SpacePointTrackCand shows curling behavior.
StoreArray< SpacePointTrackCand > m_inputSpacePointTrackCands
Input SpacePointTrackCands StoreArray.
SPTCRefereeModule()
Constructor.
unsigned int m_regTrackStubsCtr
counter for the number of track stubs that were registered by this module
StoreArray< SpacePointTrackCand > m_curlingSpacePointTrackCands
Curling SpacePointTrackCands StoreArray.
unsigned int m_SameSensorCtr
counter for TrackCands with SpacePoints on the same sensor
void copyToNewStoreArray(const Belle2::SpacePointTrackCand *trackCand, Belle2::StoreArray< Belle2::SpacePointTrackCand > newStoreArray)
copy the SpacePointTrackCand to a new StoreArray and register a relation to the original trackCand
double m_PARAMminDistance
minimal distance two subsequent SpacePoints have to be separated
void initialize() override
initialize: check StoreArrays, initialize counters, ...
unsigned int m_minDistanceCtr
counter for TrackCands with SpacePoints not far enough apart
const std::vector< int > checkMinDistance(Belle2::SpacePointTrackCand *trackCand, double minDistance)
Check if two subsequent SpacePoints are separated by at least the provided minDistance.
unsigned short int getCheckStatus(const Belle2::SpacePointTrackCand *trackCand)
get the checked referee status of a SPTC (i.e.
std::vector< double > m_PARAMsetOrigin
assumed interaction point from which the SpacePointTrackCands emerge.
void event() override
event: check SpacePointTrackCands
bool getDirOfFlightTrueHit(const Belle2::SpacePoint *spacePoint, B2Vector3F origin)
get the direction of flight for a SpacePoint by using information from the underlying TrueHit NOTE: t...
void terminate() override
terminate: print some summary information
std::tuple< std::vector< int >, std::vector< int > > CheckInfo
typedef for storing the outcome of previously done checks to have them available later.
unsigned int m_totalTrackCandCtr
counter for the total number of TrackCands
std::string m_PARAMsptcName
Name of input container of SpacePointTrackCands.
B2Vector3F m_origin
origin used internally.
std::vector< Belle2::SpacePointTrackCand > splitTrackCand(const Belle2::SpacePointTrackCand *trackCand, const std::vector< int > &splitIndices, bool onlyFirstPart, const CheckInfo &prevChecksInfo, bool removedHits)
split a curling SpacePointTrackCand into TrackStubs.
StoreArray< SpacePointTrackCand > m_optionalOutputSpacePointTrackCands
Optional output SpacePointTrackCands StoreArray.
int m_PARAMminNumSpacePoints
only keep track candidates which have at least m_PARAMminNumSpacePoints space points
bool getDirOfFlightPosMom(B2Vector3F position, B2Vector3F momentum, B2Vector3F origin)
get the direction of flight provided the global position and momentum of a SpacePoint/TrueHit for the...
unsigned int m_allInwardsCtr
counter for the number of SPTCs which have direction of flight inward for all SpacePoints in them
bool m_PARAMkickSpacePoint
parameter for indicating if only the 'problematic' SpacePoint shall be removed from the SPTC or if th...
bool m_PARAMstoreNewArray
parameter for indicating if all checked SpacePointTrackCands should be stored in a new StoreArray NOT...
unsigned int m_curlingTracksCtr
counter for tracks that curl
void addToStoreArray(const Belle2::SpacePointTrackCand &trackCand, Belle2::StoreArray< Belle2::SpacePointTrackCand > storeArray, const Belle2::SpacePointTrackCand *origTrackCand)
register the SpacePointTrackCand (i.e.
bool vectorHasValueBetween(std::vector< T > V, std::pair< T, T > P)
function to determine if any of the values in vector V are between the values of P (i....
const std::vector< int > removeSpacePoints(Belle2::SpacePointTrackCand *trackCand, const std::vector< int > &indsToRemove)
remove the SpacePoint passed to this function from the SpacePointTrackCand
bool m_PARAMcheckSameSensor
parameter for indicating if the check for subsequent SpacePoints being on the same sensor should be d...
bool m_PARAMcheckMinDistance
parameter for indicating if the check for the minimal distance between two subsequent SpacePoints sho...
std::string m_PARAMcurlingSuffix
Suffix that will be used to get a name for the StoreArray that holds the trackStubs that were obtaine...
std::string m_PARAMnewArrayName
Name of the output container of SpacePointTrackCands if 'storeNewArray' is set to true.
const std::vector< int > checkSameSensor(Belle2::SpacePointTrackCand *trackCand)
Check if two subsequent SpacePoints are on the same sensor.
void initializeCounters()
initialize all counters to 0
bool m_PARAMuseMCInfo
parameter for indicating if MC information should be used or not
const std::vector< bool > getDirectionsOfFlight(const std::vector< const Belle2::SpacePoint * > &spacePoints, bool useMCInfo)
get the directions of Flight for every SpacePoint in the passed vector.
bool m_PARAMcheckIfFitted
if true it is looked for any related RecoTrack and if that RecoTrack has a valid fit.
bool m_PARAMsplitCurlers
parameter for switching on/off the splitting of curling SpacePointTrackCands
bool m_PARAMcheckCurling
parameter for indicating if the SpacePointTrackCand should be checked for curling
Storage for (VXD) SpacePoint-based track candidates.
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
Accessor to arrays stored in the data store.
Abstract base class for different kinds of events.