Belle II Software  release-08-01-10
VXDTFFilters< point_t > Class Template Referencefinal

Class that contains all the static sectors to which the filters are attached. More...

#include <VXDTFFilters.h>

Collaboration diagram for VXDTFFilters< point_t >:

Public Types

typedef StaticSector< point_t, twoHitFilter_t, threeHitFilter_t, int > staticSector_t
 typedef to make a static sector type more readable.
 

Public Member Functions

 VXDTFFilters ()
 Construct the container of all the filters used by the VXD Track Finder.
 
 ~VXDTFFilters ()
 Destructor.
 
int addSectorsOnSensor (const std::vector< double > &normalizedUsup, const std::vector< double > &normalizedVsup, const std::vector< std::vector< FullSecID > > &sectorIds)
 To add an array of sectors on a sensor. More...
 
int addTwoHitFilter (FullSecID outer, FullSecID inner, const twoHitFilter_t &filter)
 adds a two hit filter
 
int addThreeHitFilter (FullSecID outer, FullSecID center, FullSecID inner, const threeHitFilter_t &filter)
 adds a three hit filter
 
CompactSecIDs::sectorID_t getCompactID (FullSecID outer) const
 returns compactSecID for given FullSecID, == 0 if not found.
 
const staticSector_tgetStaticSector (const FullSecID secID) const
 returns pointer to static sector for given fullSecID. More...
 
const twoHitFilter_t getTwoHitFilters (const FullSecID &outer, const FullSecID &inner) const
 retrieves a two hit filter: More...
 
bool areCoordinatesValid (VxdID aSensorID, double normalizedU, double normalizedV) const
 check if using getFullID() would be safe (true if it is safe):
 
FullSecID getFullID (VxdID aSensorID, double normalizedU, double normalizedV) const
 returns fullSecID for given sensorID and local coordinates.
 
FullSecID getFullID (CompactSecIDs::sectorID_t compactSecID) const
 returns the FullSecId of More...
 
const SectorMapConfiggetConfig (void) const
 returns the configuration settings for this VXDTFFilters.
 
void setConfig (const SectorMapConfig &config)
 set the configuration which is used to create this filter More...
 
const CompactSecIDsgetCompactIDsMap () const
 JKL: intended for some checks only - returns CompactIDsMap storing the static sectors.
 
const std::vector< staticSector_t * > & getStaticSectors () const
 JKL: intended for some checks only - returns CompactIDsMap storing the static sectors.
 
unsigned size () const
 returns number of compact secIDs stored for this filter-container.
 
bool persistOnRootFile (void) const
 Persists (i.e.: writes) on the current TDirectory the whole object.
 
bool retrieveFromRootFile (const TString *dirName)
 Retrieves from the current TDirectory all the VXDTFFilters.
 
bool setSubLayerIDs (FullSecID sector, int sublayer)
 during the trainings phase the sublayer ids have to be updated More...
 
void lockFilters ()
 This function should be called only AFTER all adjustments to the filters have been performed. More...
 
void modify2SPFilters (const std::vector< std::tuple< int, std::string > > &adjustFunctions)
 modifies the 2SP-filters according to the functions given More...
 
void modify3SPFilters (const std::vector< std::tuple< int, std::string > > &adjustFunctions)
 modifies the 3SP-filters according to the functions given More...
 

Public Attributes

decltype((0.<=DistanceInTimeUside< point_t >()<=0. &&0.<=DistanceInTimeVside< point_t >()<=0. &&0.<=Distance3DSquared< point_t >()<=0.&&0.<=Distance2DXYSquared< point_t >()<=0.&&0.<=Distance1DZ< point_t >()<=0.&&0.<=SlopeRZ< point_t >()<=0.&&0.<=Distance3DNormed< point_t >()<=0.)) typedef twoHitFilter_t
 minimal working 2-hits-example used for redesign of VXDTF. More...
 
decltype((0.<=DistanceInTime< point_t >()<=0. &&0.<=Angle3DSimple< point_t >()<=0.&&0.<=CosAngleXY< point_t >()<=0.&&0.<=AngleRZSimple< point_t >()<=0.&&CircleDist2IP< point_t >()<=0.&&0.<=DeltaSlopeRZ< point_t >()<=0.&&0.<=DeltaSlopeZoverS< point_t >()<=0.&&0.<=DeltaSoverZ< point_t >()<=0.&&0.<=HelixParameterFit< point_t >()<=0.&&0.<=Pt< point_t >()<=0.&&0.<=CircleRadius< point_t >()<=0.)) typedef threeHitFilter_t
 minimal working example for 3-hits: More...
 

Private Member Functions

bool persistSectors (void) const
 Persists all the sectors on the current TDirectory.
 
bool retrieveSectors (const TString *dirName)
 Read the whole CompactSecIDs from the current TDirectory.
 
bool persistFilters (void) const
 Persists on the current TDirectory the StaticSectors.
 
bool retrieveFilters (const TString *dirName)
 Retrieves from the current TDirectory the StaticSectors.
 
int addSectorsOnSensor (const std::vector< double > &normalizedUsup, const std::vector< double > &normalizedVsup, const std::vector< std::vector< unsigned int >> &fullSecIDsBaseType)
 Adds the static sector: TODO: need documentation for the parameters.
 

Private Attributes

CompactSecIDs m_compactSecIDsMap
 This member takes care of converting the [layer][ladder] [sensor][sector] multi index into a linear index on the m_staticSectors vector.
 
std::vector< staticSector_t * > m_staticSectors
 This vector contains all the static sectors on a sector map. More...
 
SectorMapConfig m_testConfig
 Configuration: i.e. More...
 
const char * c_CompactSecIDstreeName = "CompactSecIDs"
 name of the tree the SecIDs are stored in when persisted
 
bool m_preventModification = false
 The filters are not supposed to be altered after initialization (typically in the Module::initialize() function). More...
 

Detailed Description

template<class point_t>
class Belle2::VXDTFFilters< point_t >

Class that contains all the static sectors to which the filters are attached.

It contains functions that are used to attach and retrieve filters. Also the type of the filters is defined in this class

Definition at line 63 of file VXDTFFilters.h.

Member Function Documentation

◆ addSectorsOnSensor()

int addSectorsOnSensor ( const std::vector< double > &  normalizedUsup,
const std::vector< double > &  normalizedVsup,
const std::vector< std::vector< FullSecID > > &  sectorIds 
)
inline

To add an array of sectors on a sensor.

Parameters
normalizedUsupand
normalizedVsupare two vectors of double coding the geometry of the sectors.
sectorIdsis a rectangular matrix of FullSecID. It returns the number of sectors added to the compactSecIDsMap

Definition at line 142 of file VXDTFFilters.h.

145  {
146 
147  auto addedSectors = m_compactSecIDsMap.addSectors(normalizedUsup,
148  normalizedVsup,
149  sectorIds);
150 
151  if ((int) addedSectors != ((int) normalizedVsup.size() + 1) *
152  ((int) normalizedUsup.size() + 1))
153  return addedSectors ;
154 
155  addedSectors = 0;
156  try {
157  for (auto secIDrow : sectorIds)
158  for (auto secID : secIDrow) {
159  auto compactID = m_compactSecIDsMap.getCompactID(secID);
160 
161  if ((int) m_staticSectors.size() <= compactID)
162  m_staticSectors.resize(compactID + 1);
163 
164  m_staticSectors[ compactID ] = new staticSector_t(secID) ;
165  m_staticSectors[ compactID ]->assignCompactSecIDsMap(m_compactSecIDsMap);
166 
167  addedSectors ++;
168  }
169  } catch (...) { return addedSectors ; }
170 
171  return addedSectors;
172  }
int addSectors(const std::vector< double > &normalizedUsup, const std::vector< double > &normalizedVsup, const std::vector< std::vector< FullSecID >> &fullSecIDs)
This method defines all the sectors on a given sensor.
Definition: CompactSecIDs.h:69
sectorID_t getCompactID(const FullSecID &fullID) const
Returns the compact id of the FullSecID It does not throw exceptions (at least it should not).
CompactSecIDs m_compactSecIDsMap
This member takes care of converting the [layer][ladder] [sensor][sector] multi index into a linear i...
Definition: VXDTFFilters.h:622
std::vector< staticSector_t * > m_staticSectors
This vector contains all the static sectors on a sector map.
Definition: VXDTFFilters.h:627
StaticSector< point_t, twoHitFilter_t, threeHitFilter_t, int > staticSector_t
typedef to make a static sector type more readable.
Definition: VXDTFFilters.h:117

◆ getFullID()

FullSecID getFullID ( CompactSecIDs::sectorID_t  compactSecID) const
inline

returns the FullSecId of

Parameters
compactSecID

Definition at line 268 of file VXDTFFilters.h.

◆ getStaticSector()

const staticSector_t* getStaticSector ( const FullSecID  secID) const
inline

returns pointer to static sector for given fullSecID.

if fullSecID is not found, a nullptr is returned.

Parameters
secIDFullSecID of the filter to be retrieved

Definition at line 220 of file VXDTFFilters.h.

◆ getTwoHitFilters()

const twoHitFilter_t getTwoHitFilters ( const FullSecID outer,
const FullSecID inner 
) const
inline

retrieves a two hit filter:

Parameters
outerFullSecID of the outer static sector this filter is attached to
innerFullSecID of the inner static sector this filter is attached to

Definition at line 231 of file VXDTFFilters.h.

◆ lockFilters()

void lockFilters ( )
inline

This function should be called only AFTER all adjustments to the filters have been performed.

It sets m_preventModification to true and the VXDTFFilter is locked meaning that all function trying to modify it will be doing nothing. After a filter is locked it can NOT be unlocked.

Definition at line 351 of file VXDTFFilters.h.

◆ modify2SPFilters()

void modify2SPFilters ( const std::vector< std::tuple< int, std::string > > &  adjustFunctions)
inline

modifies the 2SP-filters according to the functions given

Parameters
adjustFunctionsa vector of vectors that contain exactly two strings, the first string will be interpreted integer, the second one will be interpreted TF1 regexp.

Definition at line 356 of file VXDTFFilters.h.

◆ modify3SPFilters()

void modify3SPFilters ( const std::vector< std::tuple< int, std::string > > &  adjustFunctions)
inline

modifies the 3SP-filters according to the functions given

Parameters
adjustFunctionsa vector of vectors that contain exactly two strings, the first string will be interpreted integer, the second one will be interpreted as regexp to generate a TF1.

Definition at line 373 of file VXDTFFilters.h.

◆ setConfig()

void setConfig ( const SectorMapConfig config)
inline

set the configuration which is used to create this filter

Parameters
configthe new configuration

Definition at line 278 of file VXDTFFilters.h.

◆ setSubLayerIDs()

bool setSubLayerIDs ( FullSecID  sector,
int  sublayer 
)
inline

during the trainings phase the sublayer ids have to be updated

Parameters
sector: FullSecID of the sector to be updated (SubLayerID of sector will be ignored while searching for it!)
sublayer: new value for the sublayer, the new SubLayerID will be 0 if sublayer==0, and 1 else

Definition at line 329 of file VXDTFFilters.h.

Member Data Documentation

◆ m_preventModification

bool m_preventModification = false
private

The filters are not supposed to be altered after initialization (typically in the Module::initialize() function).

To prevent accidental alteration of the contained filters one can set this parameter to true which will not allow further modification of the stored filters. A check of this variable should be included in every public function that modifies filters!

Definition at line 640 of file VXDTFFilters.h.

◆ m_staticSectors

std::vector< staticSector_t* > m_staticSectors
private

This vector contains all the static sectors on a sector map.

The index is the compact ID provided by the CompactSecIDs

Definition at line 627 of file VXDTFFilters.h.

◆ m_testConfig

SectorMapConfig m_testConfig
private

Configuration: i.e.

name of the sector map, tuning parameters, etc.

Definition at line 631 of file VXDTFFilters.h.

◆ threeHitFilter_t

decltype( ( 0. <= DistanceInTime<point_t>() <= 0. && 0. <= Angle3DSimple<point_t>() <= 0.&& 0. <= CosAngleXY<point_t>() <= 0.&& 0. <= AngleRZSimple<point_t>() <= 0.&& CircleDist2IP<point_t>() <= 0.&& 0. <= DeltaSlopeRZ<point_t>() <= 0.&& 0. <= DeltaSlopeZoverS<point_t>() <= 0.&& 0. <= DeltaSoverZ<point_t>() <= 0.&& 0. <= HelixParameterFit<point_t>() <= 0.&& 0. <= Pt<point_t>() <= 0.&& 0. <= CircleRadius<point_t>() <= 0. ) ) typedef threeHitFilter_t

minimal working example for 3-hits:

big working example for 3-hits:

Definition at line 112 of file VXDTFFilters.h.

◆ twoHitFilter_t

decltype( ( 0. <= DistanceInTimeUside<point_t>() <= 0. && 0. <= DistanceInTimeVside<point_t>() <= 0. && 0. <= Distance3DSquared<point_t>() <= 0.&& 0. <= Distance2DXYSquared<point_t>() <= 0.&& 0. <= Distance1DZ<point_t>() <= 0.&& 0. <= SlopeRZ<point_t>() <= 0.&& 0. <= Distance3DNormed<point_t>() <= 0. ) ) typedef twoHitFilter_t

minimal working 2-hits-example used for redesign of VXDTF.

big working 2-hits-example used for redesign of VXDTF.

Definition at line 82 of file VXDTFFilters.h.


The documentation for this class was generated from the following file: