Belle II Software development
Sector.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11// includes - rootStuff:
12// includes - stl:
13#include <vector>
14#include <string>
15
16// includes - tf-related stuff
17// includes - general fw stuff
18#include <framework/datastore/RelationsObject.h>
19
20
21namespace Belle2 {
29 class ActivatedSector;
30
31
33 class SectorFriendship;
34
35
43 class Sector : public RelationsObject {
44 public:
45
46
49 m_myActiveSector(nullptr),
50 m_sectorID(0),
53 {}
54
55
57 explicit Sector(unsigned int secID):
58 m_myActiveSector(nullptr),
59 m_sectorID(secID),
62 {}
63
64
69 Sector(unsigned int secID, float distance2origin, bool sortByDistance = true):
70 m_myActiveSector(nullptr),
71 m_sectorID(secID),
72 m_distance2Origin(distance2origin),
73 m_useDistance4sort(sortByDistance)
74 {}
75
79 Sector(const Sector&) = default;
80
81
83 Sector& operator=(const Sector& aSector)
84 {
86 m_sectorID = aSector.getSecID();
89 return *this;
90 }
91
92
94 bool operator<(const Sector& b) const
95 {
96 if (m_useDistance4sort == false) { return getSecID() < b.getSecID(); }
97 return getDistance() < b.getDistance();
98 }
99
100
102 bool operator==(const Sector& b) const
103 {
104 if (useDistance4sort() == false) { return getSecID() == b.getSecID(); }
105 return getDistance() == b.getDistance();
106 }
107
108
110 bool operator>(const Sector& b) const
111 {
112 if (useDistance4sort() == false) { return getSecID() > b.getSecID(); }
113 return getDistance() > b.getDistance();
114 }
115
116
118 void segmentMaker();
119
120
122 virtual void clear() { m_myActiveSector = nullptr; }
123
124
127
128
130 void setDistance(float distance) { m_distance2Origin = distance; }
131
132
134 float getDistance() const { return m_distance2Origin; }
135
136
138 unsigned getSecID() const { return m_sectorID; }
139
140
142 std::string printSector();
143
144
146 bool useDistance4sort() const { return m_useDistance4sort; }
147
148
150 void setDistance4sort(bool sortByDistance) { m_useDistance4sort = sortByDistance; }
151
152
153 protected:
154
155
158
159
161 std::vector<SectorFriendship*> m_myFriends;
162
163
172 unsigned int m_sectorID;
173
174
182
183
186
187
188 ClassDef(Sector, 1)
189 };
191} //Belle2 namespace
ActivatedSector is carrying the dynamic part of a Sector.
Defines interface for accessing relations of objects in StoreArray.
ClassDef(RelationsInterface, 0)
defines interface for accessing relations of objects in StoreArray.
Sector is a central part of storing information for VXD trackFinders.
Definition: Sector.h:43
std::string printSector()
printing member, delivers string of interesting features of current sector
Definition: Sector.cc:25
unsigned getSecID() const
getter - getSecID returns the ID of the sector (for definition of secID, see m_sectorID).
Definition: Sector.h:138
bool operator<(const Sector &b) const
overloaded '<'-operator for sorting algorithms - sorts by distance2origin or fullSecID depending on s...
Definition: Sector.h:94
bool useDistance4sort() const
if true, usingDistance for sector sorting is activated, if false, the sectorID is used
Definition: Sector.h:146
void segmentMaker()
called each event - takes all spacePoints from the activated Sector and its friend Sectors to produce...
Definition: Sector.cc:17
bool operator==(const Sector &b) const
overloaded '=='-operator for sorting algorithms - sorts by distance2origin or fullSecID depending on ...
Definition: Sector.h:102
ActivatedSector * getMyActiveSector() const
getter - returns a pointer to the currently connected activatedSector
Definition: Sector.h:126
bool operator>(const Sector &b) const
overloaded '>'-operator for sorting algorithms - sorts by distance2origin or fullSecID depending on s...
Definition: Sector.h:110
Sector(const Sector &)=default
Generate the default copy constructor.
float getDistance() const
getter - get distance of sector to origin defined by sectorMap
Definition: Sector.h:134
void setDistance(float distance)
setter - set distance of sector to origin defined by sectorMap
Definition: Sector.h:130
bool m_useDistance4sort
if activated, sectors are sorted by distance to origin, if false, they are sorted by layerID.
Definition: Sector.h:185
void setDistance4sort(bool sortByDistance)
if you pass a true here, the sorting will be set to using the distance to origind instead of the sect...
Definition: Sector.h:150
Sector & operator=(const Sector &aSector)
overloaded assignment operator
Definition: Sector.h:83
virtual void clear()
removes link to activated sector.
Definition: Sector.h:122
unsigned int m_sectorID
secID allows identification of sector.
Definition: Sector.h:172
Sector()
constructor
Definition: Sector.h:48
Sector(unsigned int secID, float distance2origin, bool sortByDistance=true)
useful constructor both cases of sector sorting: sectors treated by fullSecID (parameter 1) and dista...
Definition: Sector.h:69
ActivatedSector * m_myActiveSector
The activated sector is created each event where this sector inhabits a spacePoint.
Definition: Sector.h:157
float m_distance2Origin
carries info about the distance of the sector-center to the origin.
Definition: Sector.h:181
Sector(unsigned int secID)
useful constructor for cases where sectors are treated by fullSecID (parameter 1)
Definition: Sector.h:57
std::vector< SectorFriendship * > m_myFriends
This vector carries a pointer to each SectorFriendship for faster access during events.
Definition: Sector.h:161
Abstract base class for different kinds of events.