 |
Belle II Software
release-05-02-19
|
12 #include <framework/core/Module.h>
13 #include <framework/datastore/StoreArray.h>
14 #include <tracking/spacePointCreation/SpacePoint.h>
16 #include <tracking/spacePointCreation/SpacePointTrackCand.h>
18 #include <genfit/TrackCand.h>
19 #include <genfit/TrackCandHit.h>
23 #include <boost/tuple/tuple.hpp>
66 class GFTC2SPTCConverterModule :
public Module {
75 void event()
override;
100 switch (intToConvert) {
236 template<
typename ClusterType>
239 short unsigned int layerNumber = cluster->getSensorID().getLayerNumber();
240 if (layerNumber > 6)
throw SpacePointTrackCand::UnsupportedDetType();
276 std::pair<double, const HitType*>;
280 boost::tuple<bool, T, T>;
292 std::pair<const Belle2::SpacePointTrackCand, conversionStatus>
299 std::pair<Belle2::SpacePoint*, conversionStatus>
310 template<
typename ClusterType,
typename TrueHitType>
311 std::pair<Belle2::SpacePoint*, conversionStatus>
313 std::string arrayName =
"");
322 template<
typename ClusterType>
323 std::pair<Belle2::SpacePoint*, conversionStatus>
341 const std::vector<std::pair<int, int> >& clusterPositions);
347 template<
typename ClusterType>
361 template <
typename TrueHitType>
368 "Not all hits of the genfit::TrackCand have been marked as used. This indicates that not all hits have been used to create a SpacePointTrackCand.");
bool m_PARAMcheckNoSingleSVDSP
Switch for checking the StoreArray of non-single cluster SVD SpacePoints in initialize.
std::string m_SingleClusterSVDSPName
Single Cluster SVD SpacePoints collection name.
std::pair< double, const HitType * > HitInfo
container used for storing information, that is then put into the SpacePointTrackCand
@ c_foundNoTrueHit
conversion failed because there was no related SpacePoint to a TrueHit
bool checkUsedAllHits(std::vector< flaggedPair< int > > &flaggedHitIDs)
check if all hits have been used (i.e.
Track candidate – seed values and indices.
std::string m_PXDClusterSPName
PXDCluster SpacePoints collection name.
unsigned int m_abortedTrueHitCtr
Counting discarded conversions due to check for TrueHits not good.
std::string m_SVDClusterName
SVDCluster collection name.
@ c_unsuitableGFTC
conversion failed because the GFTC is considered not suitable for conversion
unsigned int m_genfitTCCtr
Counter for genfit::TrackCands which were presented to the module.
unsigned int m_skippedSVDnoValidSPCtr
Counter for skipped SVD Clusters due to no found valid SpacePoint.
std::string m_NoSingleClusterSVDSPName
Non SingleCluster SVD SpacePoints collection name.
unsigned int m_skippedCluster
Counter for skipped Cluster.
unsigned int m_abortedNoValidSPCtr
Counter for aborted conversions due to no found valid SpacePoint to any Cluster of the GFTC.
void initialize() override
initialize module (e.g.
Hit object for use in TrackCand.
@ c_noValidSP
conversion failed because there was no valid SpacePoint (only possible for double Cluster SpacePoints...
std::pair< Belle2::SpacePoint *, conversionStatus > findAppropriateSpacePoint(const Belle2::RelationVector< Belle2::SpacePoint > &spacePoints, std::vector< flaggedPair< int > > &flaggedHitIDs)
given a RelationVector with SpacePoints in it, it tries to get the appropriate one (see main document...
void initializeCounters()
reset counters to 0 to avoid indeterministic behaviour
boost::tuple< bool, T, T > flaggedPair
typdef, for avoiding having a vector<bool> and a vector<pair<T,T>>
void increaseSkippedCounter(conversionStatus status, ClusterType *cluster)
increase the appropriate counter variable if a Cluster is skipped (i.e.
bool foundRelatedTrueHit(const Belle2::SpacePoint *spacePoint, unsigned int allowedRelations=1)
check if there is a related TrueHit for a given SpacePoint.
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
std::pair< int, int > checkExistAndValid(int clusterInd, int detID, std::vector< flaggedPair< int > > &flaggedHitIDs)
check if the Cluster (of a SpacePoint) is valid and/or exists in a genfit::TrackCand
unsigned int m_skippedSVDnoTHCtr
Counter for skipped SVD Clusters, due to no related TrueHit to a SpacePoint.
void event() override
event: convert genfit::TrackCands to SpacePointTrackCands
std::pair< const Belle2::SpacePointTrackCand, conversionStatus > createSpacePointTC(const genfit::TrackCand *genfitTC, const StoreArray< PXDCluster > &pxdClusters, const StoreArray< SVDCluster > &svdClusters)
create a SpacePointTrackCand from the genfit::TrackCand
void terminate() override
terminate: print some summary information on the processed events
unsigned int m_skippedPXDnoSPCtr
Counter for skipped PXD Clusters, due to no found SpacePoint.
unsigned int m_skippedSVDnoSPCtr
Counter for skipped SVD Clusters, due to no found SpacePoint.
Class for type safe access to objects that are referred to in relations.
unsigned int m_skippedPXDnoValidSPCtr
Counter for skipped PXD Clusters due to no found valid SpacePoint.
std::string m_SPTCName
Name of collection under which SpacePointTrackCands will be stored in the StoreArray.
void markHitAsUsed(std::vector< flaggedPair< int > > &flaggedHitIDs, int hitToMark)
mark a hit as used, i.e.
std::string m_genfitTCName
Name of collection of genfit::TrackCand StoreArray.
@ c_nonSingleSP
conversion failed because there were more than one single Cluster SpacePoints related to a Cluster
@ c_unusedHits
conversion failed because there were unused Hits
unsigned int m_singleClusterSPCtr
Counter for single cluster SVD SpacePoints.
Abstract base class for different kinds of events.
unsigned int m_nonSingleSPCtr
Counter for cases where there is more than one single Cluster SpacePoint related to a Cluster.
int getNDF(Belle2::SpacePoint *spacePoint)
get the NDF of a SpacePoint
unsigned int m_abortedLowNDFCtr
Counter for SpacePointTrackCands that were not stored due to a too small number of degrees of freedom...
@ c_singleClusterSP
had to use a singleCluster SpacePoint (also returned if PXD is passed!
@ c_foundNoSpacePoint
conversion failed because no related SpacePoint was found to a Cluster/Hit of the GFTC
std::string svdMainArrayName
Name of the Array of SVD SpacePoints that shall be searched first.
unsigned int m_noTwoClusterSPCtr
Counter for cases where no related two Cluster could be found for a Cluster.
@ c_lowNDF
conversion failed because the created SpacePointTrackCand had not enough degrees of freedom
GFTC2SPTCConverterModule()
Constructor.
conversionStatus
enum for differentiating different reasons why a conversion failed negative values mean fail!
conversionStatus getFailEnum(int intToConvert)
get the enum representation of an integer
unsigned int m_abortedNoSPCtr
Counter for aborted conversions because no SpacePoint has been found.
unsigned int m_skippedPXDnoTHCtr
Counter for skipped PXD Clusters, due to no related TrueHit to a SpacePoint.
unsigned int m_SpacePointTCCtr
Counter for SpacePointTrackCands which were converted (if a curling track is split up,...
unsigned int m_skippedPXDunsuitableCtr
Counter for skipped PXD Clusters due to unsuitable GFTC.
std::pair< Belle2::SpacePoint *, conversionStatus > processTrackCandHit(genfit::TrackCandHit *hit, const StoreArray< PXDCluster > &pxdClusters, const StoreArray< SVDCluster > &svdClusters, std::vector< flaggedPair< int > > &flaggedHitIDs, int iHit)
process a TrackCandHit (i.e.
void increaseFailCounter(conversionStatus status)
increase the counter that 'belongs' to the conversionStatus
unsigned int m_abortedUnsuitableTCCtr
Counter for aborted conversions due to unsuitable genfit::TrackCand.
@ c_noFail
conversion without any problems
unsigned int m_abortedMiscCtr
temporary counter used for counting all failed conversions for which the reason cannot be deduced at ...
bool m_PARAMskipCluster
Switch for controlling the behavior of the converter, when for one or more Clusters no appropriate Sp...
bool m_PARAMcheckTrueHits
Parameter Indicating if the TrueHits related from the Clusters forming a SpacePoint should be checked...
bool m_PARAMuseSingleClusterSP
Parameter Indicating if SingleCluster SVD SpacePoints should be used if no double Cluster SVD SpacePo...
unsigned int m_skippedSVDunsuitableCtr
Counter for skipped SVD Clusters due to unsuitable GFTC.
std::string m_PXDClusterName
PXDCluster collection name.
BELLE2_DEFINE_EXCEPTION(UnusedHits, "Not all hits of the genfit::TrackCand have been marked as used. This indicates that not all hits have been used to create a SpacePointTrackCand.")
Exception thrown, when not all hits of a genfit::TrackCand have been used for conversion.
int getAppropriateSpacePointIndex(const std::vector< std::pair< bool, bool > > &existAndValidSPs, const std::vector< std::pair< int, int > > &clusterPositions)
get the position of the appropriate SpacePoint inside the RelationVector NOTE: returns negative index...
int m_NDF
number of degrees of freedom.
int m_PARAMminNDF
parameter for specifying a minimal number of degrees of freedom a SpacePointTrackCand has to have in ...
std::vector< int > getClusterIndices(const Belle2::SpacePoint *spacePoint, std::string storeArrayName)
get the indices of the Clusters related to the SpacePoint.
std::pair< Belle2::SpacePoint *, conversionStatus > getSpacePoint(const ClusterType *cluster, std::vector< flaggedPair< int > > &flaggedHitIDs, int iHit, bool singleCluster, std::string arrayName="")
templated version to get a SpacePoint from a Cluster