From d661e4c36958f8b65801d84c8fe766eec9f80cdd Mon Sep 17 00:00:00 2001 From: Georgios Voutsinas Date: Tue, 8 Jul 2014 07:42:12 +0000 Subject: [PATCH] Importing a first set of criteria for a mini-vector based CA - extending IHit class to cope with mini-vectors --- include/Criteria/Criteria.h | 4 ++++ include/KiTrack/Automaton.h | 8 ++++---- include/KiTrack/IHit.h | 17 +++++++++++++++-- src/Criteria/Criteria.cc | 17 ++++++++++++++--- src/KiTrack/Automaton.cc | 4 ++-- 5 files changed, 39 insertions(+), 11 deletions(-) diff --git a/include/Criteria/Criteria.h b/include/Criteria/Criteria.h index 3183346..4a68cd7 100644 --- a/include/Criteria/Criteria.h +++ b/include/Criteria/Criteria.h @@ -28,6 +28,10 @@ #include "Criteria/Crit4_NoZigZag.h" #include "Criteria/Crit4_RChange.h" +// Criteria for Mini - Vector based Cellular Automaton for VXD +#include "Criteria/Crit2_DeltaPhi_MV.h" +#include "Criteria/Crit2_DeltaTheta_MV.h" +#include "Criteria/Crit3_NoZigZag_MV.h" #include diff --git a/include/KiTrack/Automaton.h b/include/KiTrack/Automaton.h index 0e726ec..efd2a7b 100644 --- a/include/KiTrack/Automaton.h +++ b/include/KiTrack/Automaton.h @@ -161,14 +161,14 @@ namespace KiTrack{ * that have less won't be considered as tracks and won't be returned. * */ - std::vector < std::vector< IHit* > > getTracks( unsigned minHits = 3 ); - + //std::vector < std::vector< IHit* > > getTracks( unsigned minHits = 3 ); + std::vector < std::vector< IHit* > > getTracks( unsigned minHits = 2 ); // YV, 2 mini-vector hits can form a track /**Returns all the tracks starting from this segment. * It is a recursive method and gets invoked by getTracks. */ - std::vector < std::vector< IHit* > > getTracksOfSegment ( Segment* segment, std::vector< IHit* > hits , unsigned minHits = 3 ); - + //std::vector < std::vector< IHit* > > getTracksOfSegment ( Segment* segment, std::vector< IHit* > hits , unsigned minHits = 3 ); + std::vector < std::vector< IHit* > > getTracksOfSegment ( Segment* segment, std::vector< IHit* > hits , unsigned minHits = 2 ); // YV, 2 mini-vector hits can form a track /** * @return All the segments currently saved in the automaton diff --git a/include/KiTrack/IHit.h b/include/KiTrack/IHit.h index 655e148..dccf9b8 100644 --- a/include/KiTrack/IHit.h +++ b/include/KiTrack/IHit.h @@ -18,8 +18,8 @@ namespace KiTrack{ public: - - /** @return the x position */ + + /** @return the x position */ float getX() const { return _x; } /** @return the y position */ @@ -46,6 +46,15 @@ namespace KiTrack{ /** @return a string containing the position of the hit */ std::string getPositionInfo(); + + /** to be used with mini-vectors: @return 3D angle */ //YV + double get3DAngle( IHit* otherHit) const { return _3DAngle ; } + + /** to be used with mini-vectors: @return azimuth angle */ //YV + double getPhi() const { return _phiMV ; } + + /** to be used with mini-vectors: @return polar angle */ //YV + double getTheta() const { return _thetaMV ; } virtual ~IHit(){} @@ -55,6 +64,10 @@ namespace KiTrack{ float _x; float _y; float _z; + + double _3DAngle; //YV + double _phiMV; //YV + double _thetaMV; //YV int _sector; diff --git a/src/Criteria/Criteria.cc b/src/Criteria/Criteria.cc index 435ac46..644ae75 100644 --- a/src/Criteria/Criteria.cc +++ b/src/Criteria/Criteria.cc @@ -31,7 +31,12 @@ std::set< std::string > Criteria::getAllCriteriaNames(){ critNames.insert( "Crit4_DistOfCircleCenters" ); critNames.insert( "Crit4_NoZigZag" ); critNames.insert( "Crit4_RChange" ); - + + // MiniVector based Cellular Automaton for VXD + + critNames.insert( "Crit2_DeltaPhi_MV" ); + critNames.insert( "Crit2_DeltaTheta_MV" ); + critNames.insert( "Crit3_NoZigZag_MV" ); return critNames; @@ -137,8 +142,14 @@ ICriterion* Criteria::createCriterion( std::string critName, float min , float m else if ( critName == "Crit4_NoZigZag" ) return ( new Crit4_NoZigZag( min , max ) ); else if ( critName == "Crit4_RChange" ) return ( new Crit4_RChange( min , max ) ); - - + + // Mini-Vector based + + else if ( critName == "Crit2_DeltaPhi_MV" ) return ( new Crit2_DeltaPhi_MV( min , max ) ); + + else if ( critName == "Crit2_DeltaTheta_MV" ) return ( new Crit2_DeltaTheta_MV( min , max ) ); + + else if ( critName == "Crit3_NoZigZag_MV" ) return ( new Crit3_NoZigZag_MV( min , max ) ); else { diff --git a/src/KiTrack/Automaton.cc b/src/KiTrack/Automaton.cc index 4070952..bb45dd5 100644 --- a/src/KiTrack/Automaton.cc +++ b/src/KiTrack/Automaton.cc @@ -671,7 +671,7 @@ std::vector < std::vector< IHit* > > Automaton::getTracks( unsigned minHits ){ Segment* segment = *iSeg; - if ( segment->getParents().empty() ){ // if it has no parents it is the end of a possible track + //if ( segment->getParents().empty() ){ // if it has no parents it is the end of a possible track // get the tracks from the segment @@ -681,7 +681,7 @@ std::vector < std::vector< IHit* > > Automaton::getTracks( unsigned minHits ){ tracks.insert( tracks.end() , newTracks.begin() , newTracks.end() ); - } + //} }