Belle II Software  release-05-02-19
SpacePoint2TrueHitConnectorModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2014 Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Thomas Madlener *
7  * *
8  **************************************************************************/
9 
10 #pragma once
11 
12 #include <framework/core/FrameworkExceptions.h>
13 #include <framework/core/Module.h>
14 
15 #include <framework/datastore/StoreArray.h>
16 #include <framework/datastore/RelationArray.h>
17 
18 #include <tracking/spacePointCreation/SpacePoint.h>
19 #include <pxd/dataobjects/PXDTrueHit.h>
20 #include <svd/dataobjects/SVDTrueHit.h>
21 
22 #include <string>
23 #include <vector>
24 #include <array>
25 #include <tuple>
26 
27 #include <unordered_map> // needed for typedef of defaultMap
28 
29 // root output
30 #include <TFile.h>
31 #include <TTree.h>
32 
33 namespace Belle2 {
42  struct TrueHitInfo {
43 
44  int m_Id;
45  double m_wU;
46  double m_wV;
47  bool m_U;
48  bool m_V;
51  TrueHitInfo() : m_Id(-1), m_wU(0.), m_wV(0.), m_U(false), m_V(false) { }
52 
54  explicit TrueHitInfo(int Id) : m_Id(Id), m_wU(0.), m_wV(0.), m_U(false), m_V(false) { }
55 
56  // /** ctor with full information */
57  // TrueHitInfo(int Id, double wU, double wV, bool U, bool V) :
58  // m_Id(Id), m_wU(wU), m_wV(wV), m_U(U), m_V(V) { }
59 
60  // /** ctor for single Cluster SpacePoints (SVD) or PXD SpacePoints. The information which Cluster is set can be
61  // * retrieved from the SpacePoint directlly for SVD in this case!
62  // */
63  // TrueHitInfo(int Id, double weight) : m_Id(Id), m_wU(weight), m_wV(0.), m_U(true), m_V(false) { }
64 
70  bool operator<(const TrueHitInfo& b) const
71  {
72  return (std::tuple<int, double>(b.m_U + b.m_V, b.m_wU + b.m_wV) < std::tuple<int, double>(m_U + m_V, m_wU + m_wV));
73  }
74 
76  short getNClusters() const { return m_U + m_V; }
77 
79  void setUWeight(double weight) { m_wU = weight; m_U = true; }
80 
82  void setVWeight(double weight) { m_wV = weight; m_V = true; }
83 
85  double getWeightSum() const { return m_wU + m_wV; }
86  }; // end of struct TrueHitInfo
87 
89  std::ostream& operator<<(std::ostream& os, const TrueHitInfo& thInfo)
90  {
91  os << "Id " << thInfo.m_Id << ": wU = " << thInfo.m_wU << ", setU = " << thInfo.m_U << ". wV = " <<
92  thInfo.m_wV << ", setV = " << thInfo.m_V;
93  return os;
94  }
95 
119 
120  public:
121 
124  void initialize() override;
126  void event() override;
128  void terminate() override;
130  BELLE2_DEFINE_EXCEPTION(NoClusterToSpacePoint,
131  "Found no related Cluster for a SpacePoint!");
134  struct RootVariables {
135  std::vector<double> SpacePointULocal;
136  std::vector<double> SpacePointVLocal;
137  std::vector<double> SpacePointXGlobal;
138  std::vector<double> SpacePointYGlobal;
139  std::vector<double> SpacePointZGlobal;
141  std::vector<double> TrueHitULocal;
142  std::vector<double> TrueHitVLocal;
143  std::vector<double> TrueHitXGlobal;
144  std::vector<double> TrueHitYGlobal;
145  std::vector<double> TrueHitZGlobal;
147  std::vector<double> WeightU;
148  std::vector<double> WeightV;
150  std::vector<unsigned short int> HitVxdID;
151  std::vector<unsigned short int> RelationStatus;
152  std::vector<unsigned int> NRelations;
154  // TODO TODO TODO TODO TODO TODO TODO: remove if not needed, only for tessting at the moment (i.e. do not commit)
155  std::vector<unsigned int> ClusterSizeU;
156  std::vector<unsigned int> ClusterSizeV;
158  std::vector<double> SpacePointErrorU;
159  std::vector<double> SpacePointErrorV;
161  std::vector<double> SpacePointErrorX;
162  std::vector<double> SpacePointErrorY;
163  std::vector<double> SpacePointErrorZ;
164  // TODO TODO TODO TODO TODO TODO TODO: remove if not needed, only for tessting at the moment (i.e. do not commit)
165  }; // end RootVariables
166 
167  protected:
168 
169  typedef std::unordered_map<int, TrueHitInfo> baseMapT;
174  enum e_detTypes {
177  };
178 
180  enum e_relationStatus {
181  c_clearHit = 1, //< bit 0: Only one TrueHit to SpacePoint
182  c_ghostHit = 2, //< bit 1: ghost hit as described in this module
183  c_SpacePointU = 4, //< bit 2: SpacePoint U-coordinate is set
184  c_SpacePointV = 8, //< bit 3: SpacePoint V-coordinate is set
185  c_primaryParticle = 16, //< bit 4: Particle related to TrueHit is primary
186  c_bgParticle = 32, //< bit 5: particle related to TrueHit is background
187  c_nonUniqueRelation = 64, //< bit 6: more than one TrueHit related to SpacePoint
188  c_registeredRelation = 128, //< bit 7: this relation got registered
189  c_noiseCluster = 256, //< bit 8: one of the Clusters has no relation to a TrueHit (i.e. is noise) -> only for twoCluster SPs!
190  }; // end e_relationStatus
191 
192  // ================================================== PARAMETERS ==============================================================
193  std::string m_PARAMoutputSuffix;
195  std::vector<std::string> m_PARAMtrueHitNames;
197  std::vector<std::string> m_PARAMspacePointNames;
200  std::vector<std::string> m_PARAMdetectorTypes;
201 
202  std::vector<std::string> m_PARAMclusterNames;
204  std::vector<std::string> m_PARAMrootFileName;
208 
210  bool m_PARAMregisterAll;
211 
218  double m_PARAMmaxGlobalDiff;
220 // double m_PARAMmaxLocalDiff; /**< maximum difference of local position coordinates for each direction between TrueHit and SpacePoint */
221 
222  double m_PARAMmaxPosSigma;
224  double m_PARAMminWeight;
226  // ================================================= INTERMALLY USED MEMBERS ==================================================
228  unsigned int m_nContainers;
229 
230  std::vector<e_detTypes> m_detectorTypes;
241  std::vector<std::pair<Belle2::StoreArray<Belle2::SpacePoint>, e_detTypes> > m_inputSpacePoints;
242 
243  std::vector<Belle2::StoreArray<Belle2::SpacePoint> > m_outputSpacePoints;
248  unsigned int m_iCont;
249 
252  TFile* m_rootFilePtr;
254  TTree* m_treePtr;
256  // ================================================= COUNTERS =================================================================
257  std::vector<unsigned int> m_SpacePointsCtr;
260  std::vector<std::array<unsigned int, 5> > m_nRelTrueHitsCtr;
261 
263  std::vector<unsigned int> m_noClusterCtr;
264 
265  std::vector<unsigned int> m_regRelationsCtr;
267  std::vector<unsigned int> m_ghostHitCtr;
270  std::vector<unsigned int> m_noTrueHitCtr;
271 
273  std::vector<unsigned int> m_rejectedRelsCtr;
274 
275  unsigned int m_weightTooSmallCtr;
277  unsigned int m_rejectedNoPrimaryCtr;
279  // TODO: make these counters for every container not only for all together!
280 // unsigned int m_negWeightCtr; /**< number of negative weights */
281 
282 // unsigned int m_totWeightsCtr; /**< total number of weights */
283 
284 // unsigned int m_single2WTHCtr; /**< counter for SpacePoints with more than two possible TrueHits, but only one of them has two weights */
285 //
286 // unsigned int m_nonSingle2WTHCtr; /**< counter for SpacePoints with more than two possible TrueHits, with more than one of them having two weights */
287 //
288 // unsigned int m_all2WTHCtr; /**< Counter for SpacePoints where alle possible TrueHits have two weights */
289 //
290 // unsigned int m_accSingle2WTHCtr; /**< counter for SpacePoints with more than two possible TrueHits, but only one of them has two weights, where a relation was registered to a TrueHit */
291 //
292 // unsigned int m_accNonSingle2WTHCtr; /**< counter for SpacePoints with more than two possible TrueHits, with more than one of them having two weights where a relation was registered to a TrueHit */
293 //
294 // unsigned int m_accAll2WTHCtr; /**< Counter for SpacePoints where alle possible TrueHits have two weights, where a relation was registered to a TrueHit */
295 //
296 // unsigned int m_oneCluster2THCtr; /**< Counter for SpacePoints with only one Cluster but two possible TrueHits (in these cases, the one with the bigger weight gets automatically accepted) */
297 //
298 // unsigned int m_moreThan2Weights; /**< Count the cases whith more than two weights */
299 //
300 
304  void initializeCounters();
305 
315  template <typename MapType, typename TrueHitType>
316  std::pair<TrueHitType*, double> getTHwithWeight(const MapType& aMap, Belle2::StoreArray<TrueHitType> trueHits,
317  Belle2::SpacePoint* spacePoint, e_detTypes detType);
318 
323  template <typename TrueHitType>
324  bool compatibleCombination(Belle2::SpacePoint* spacePoint, TrueHitType* trueHit);
325 
333  template<typename MapType, typename ClusterType, typename TrueHitType>
334  MapType getRelatedTrueHits(Belle2::SpacePoint* spacePoint, std::string clusterName = "ALL", std::string trueHitName = "ALL");
335 
341  template<typename MapType>
342  MapType processSpacePoint(Belle2::SpacePoint* spacePoint, e_detTypes detType);
343 
347  template<typename MapType>
348  void registerAllRelations(Belle2::SpacePoint* spacePoint, MapType trueHitMap, e_detTypes detType);
349 
353  template<typename TrueHitType>
354  void registerOneRelation(Belle2::SpacePoint* spacePoint, std::pair<TrueHitType*, double> trueHitwWeight, e_detTypes);
355 
359  template<typename ClusterType>
360  void
361  reRegisterClusterRelations(Belle2::SpacePoint* origSpacePoint, Belle2::SpacePoint* newSpacePoint, std::string clusterName = "ALL");
362 
366  template<typename ClusterType>
367  std::vector<std::pair<ClusterType*, double> >
368  getRelatedClusters(Belle2::SpacePoint* spacePoint, std::string clusterName = "ALL");
369 
375  template<typename TrueHitType>
376  void registerTrueHitRelation(Belle2::SpacePoint* spacePoint, int index, double weight, Belle2::StoreArray<TrueHitType> trueHits);
377 
387  template<typename MapType>
388  void positionAnalysis(Belle2::SpacePoint* spacePoint, const MapType& trueHitMap, const int& index, e_detTypes detType);
389 
391  std::pair<double, double> getLocalPos(Belle2::SpacePoint* spacePoint);
392 
394  template<typename TrueHitType>
395  std::pair<TVector3, TVector3> getTrueHitPositions(TrueHitType* trueHit);
396 
398  void initializeRootFile();
399 
401  void closeRootFile();
402 
403  // TODO TODO TODO TODO TODO TODO TODO: remove if not needed, only for tessting at the moment (i.e. do not commit)
407  std::pair<unsigned short int, unsigned short int> getClusterSizes(Belle2::SpacePoint* spacePoint, e_detTypes detType);
408 
412  std::pair<double, double> getLocalError(Belle2::SpacePoint* spacePoint);
413 
420  double calculateRelationWeight(const TrueHitInfo& trueHitInfo, Belle2::SpacePoint* spacePoint);
421 
422  }; // end module
423 
427  template<typename T>
428  class simpleBitfield {
429 
430  public:
431  simpleBitfield() : __bits() { }
433  simpleBitfield(const simpleBitfield<T>& __otherBitfield) = delete;
434  simpleBitfield<T>& operator = (simpleBitfield<T>&) = delete;
437  const T hasStatus(T __statusBits) const { return (__bits & __statusBits) == __statusBits; }
439  const T getStatus() const { return __bits; }
441  void setStatus(T __statusBits) { __bits = __statusBits; }
443  void addStatus(T __statusBits) { __bits |= __statusBits; }
445  void removeStatus(T __statusBits) { __bits &= __statusBits; }
447  void clear() { __bits = T(); }
448 
449  private:
450  T __bits;
451  }; // end class bitfield
453 } // end namespace Belle2
Belle2::SpacePoint2TrueHitConnectorModule::RootVariables::TrueHitZGlobal
std::vector< double > TrueHitZGlobal
TrueHit global Z-position.
Definition: SpacePoint2TrueHitConnectorModule.h:152
Belle2::SpacePoint2TrueHitConnectorModule::SpacePoint2TrueHitConnectorModule
SpacePoint2TrueHitConnectorModule()
Constructor.
Belle2::SpacePoint2TrueHitConnectorModule::m_rejectedNoPrimaryCtr
unsigned int m_rejectedNoPrimaryCtr
Count how many times a relation was rejected because TrueHit was not related to primary.
Definition: SpacePoint2TrueHitConnectorModule.h:284
Belle2::SpacePoint2TrueHitConnectorModule::RootVariables::ClusterSizeU
std::vector< unsigned int > ClusterSizeU
size of the u-cluster (resp.
Definition: SpacePoint2TrueHitConnectorModule.h:162
Belle2::SpacePoint2TrueHitConnectorModule::RootVariables
helper struct to access root variables inside the module
Definition: SpacePoint2TrueHitConnectorModule.h:141
Belle2::simpleBitfield::removeStatus
void removeStatus(T __statusBits)
remove a status from the bitfield
Definition: SpacePoint2TrueHitConnectorModule.h:452
Belle2::SpacePoint2TrueHitConnectorModule::e_relationStatus
e_relationStatus
enum for better code readability
Definition: SpacePoint2TrueHitConnectorModule.h:187
Belle2::SpacePoint2TrueHitConnectorModule::getTHwithWeight
std::pair< TrueHitType *, double > getTHwithWeight(const MapType &aMap, Belle2::StoreArray< TrueHitType > trueHits, Belle2::SpacePoint *spacePoint, e_detTypes detType)
get the TrueHit from information that is stored in the map (conditions are checked in the following o...
Definition: SpacePoint2TrueHitConnectorModule.cc:629
Belle2::TrueHitInfo::m_wU
double m_wU
weight of relation between U-Cluster and TrueHit
Definition: SpacePoint2TrueHitConnectorModule.h:52
Belle2::SpacePoint2TrueHitConnectorModule::c_SVD
@ c_SVD
SVD.
Definition: SpacePoint2TrueHitConnectorModule.h:183
Belle2::SpacePoint2TrueHitConnectorModule::m_detectorTypes
std::vector< e_detTypes > m_detectorTypes
storing the detector types for each container in vector, needed in initialize
Definition: SpacePoint2TrueHitConnectorModule.h:237
Belle2::SpacePoint2TrueHitConnectorModule::RootVariables::RelationStatus
std::vector< unsigned short int > RelationStatus
different flags of the relation stored in here (see c_relationStatus)
Definition: SpacePoint2TrueHitConnectorModule.h:158
Belle2::operator<<
std::ostream & operator<<(std::ostream &output, const IntervalOfValidity &iov)
Definition: IntervalOfValidity.cc:196
Belle2::SpacePoint2TrueHitConnectorModule::RootVariables::SpacePointErrorU
std::vector< double > SpacePointErrorU
position error of SpacePoint in U direction
Definition: SpacePoint2TrueHitConnectorModule.h:165
Belle2::SpacePoint2TrueHitConnectorModule::registerOneRelation
void registerOneRelation(Belle2::SpacePoint *spacePoint, std::pair< TrueHitType *, double > trueHitwWeight, e_detTypes)
register Relation between SpacePoint and TrueHit (and if neccessary also between SpacePoint and Clust...
Definition: SpacePoint2TrueHitConnectorModule.cc:456
Belle2::SpacePoint2TrueHitConnectorModule::m_SVDClusters
Belle2::StoreArray< Belle2::SVDCluster > m_SVDClusters
PXDClusters StoreArray used throughout the module.
Definition: SpacePoint2TrueHitConnectorModule.h:245
Belle2::simpleBitfield::hasStatus
const T hasStatus(T __statusBits) const
check if a certain status has been set to the bitfield
Definition: SpacePoint2TrueHitConnectorModule.h:444
Belle2::SpacePoint2TrueHitConnectorModule::m_PARAMmaxPosSigma
double m_PARAMmaxPosSigma
defining th maximum difference of local coordinates in units of PitchSize / sqrt(12)
Definition: SpacePoint2TrueHitConnectorModule.h:229
Belle2::SpacePoint2TrueHitConnectorModule::m_nContainers
unsigned int m_nContainers
number of passed containers -> storing the size of an input vector for not having to obtain it every ...
Definition: SpacePoint2TrueHitConnectorModule.h:235
Belle2::SpacePoint2TrueHitConnectorModule::m_PXDClusters
Belle2::StoreArray< Belle2::PXDCluster > m_PXDClusters
PXDTClusters StoreArray used throughout the module.
Definition: SpacePoint2TrueHitConnectorModule.h:243
Belle2::SpacePoint2TrueHitConnectorModule::initializeRootFile
void initializeRootFile()
initialize the root file that is used for output
Definition: SpacePoint2TrueHitConnectorModule.cc:810
Belle2::SpacePoint2TrueHitConnectorModule::RootVariables::ClusterSizeV
std::vector< unsigned int > ClusterSizeV
size of the v-cluster (resp.
Definition: SpacePoint2TrueHitConnectorModule.h:163
Belle2::SpacePoint2TrueHitConnectorModule::m_PARAMregisterAll
bool m_PARAMregisterAll
switch for registereing all relations for all TrueHits for all SpacePoints (there can be more than 1 ...
Definition: SpacePoint2TrueHitConnectorModule.h:217
Belle2::SpacePoint2TrueHitConnectorModule::m_PARAMmaxGlobalDiff
double m_PARAMmaxGlobalDiff
maximum difference of global position coordinates for each direction between TrueHit and SpacePoint
Definition: SpacePoint2TrueHitConnectorModule.h:225
Belle2::SpacePoint2TrueHitConnectorModule::m_PARAMrequirePrimary
bool m_PARAMrequirePrimary
require the TrueHit to be related to a primary particle in order for the relation to get registered!
Definition: SpacePoint2TrueHitConnectorModule.h:221
Belle2::SpacePoint2TrueHitConnectorModule::getLocalPos
std::pair< double, double > getLocalPos(Belle2::SpacePoint *spacePoint)
get the local position of a SpacePoint
Definition: SpacePoint2TrueHitConnectorModule.cc:786
Belle2::SpacePoint2TrueHitConnectorModule::event
void event() override
event: try to find the appropriate TrueHit to all SpacePoints
Definition: SpacePoint2TrueHitConnectorModule.cc:198
Belle2::SpacePoint2TrueHitConnectorModule::RootVariables::TrueHitXGlobal
std::vector< double > TrueHitXGlobal
TrueHit global X-position.
Definition: SpacePoint2TrueHitConnectorModule.h:150
Belle2::SpacePoint2TrueHitConnectorModule::reRegisterClusterRelations
void reRegisterClusterRelations(Belle2::SpacePoint *origSpacePoint, Belle2::SpacePoint *newSpacePoint, std::string clusterName="ALL")
register all the relations to Clusters that origSpacePoint had for newSpacePoint
Definition: SpacePoint2TrueHitConnectorModule.cc:478
Belle2::SpacePoint2TrueHitConnectorModule::m_PARAMspacePointNames
std::vector< std::string > m_PARAMspacePointNames
names of containers of SpacePoints
Definition: SpacePoint2TrueHitConnectorModule.h:204
Belle2::SpacePoint2TrueHitConnectorModule::c_PXD
@ c_PXD
PXD.
Definition: SpacePoint2TrueHitConnectorModule.h:182
Belle2::TrueHitInfo
helper struct that holds information that is needed for the registration of the relation between Spac...
Definition: SpacePoint2TrueHitConnectorModule.h:49
Belle2::SpacePoint2TrueHitConnectorModule::getTrueHitPositions
std::pair< TVector3, TVector3 > getTrueHitPositions(TrueHitType *trueHit)
get the local (.first) and global (.second) position of a TrueHit (passed by index)
Definition: SpacePoint2TrueHitConnectorModule.cc:797
Belle2::SpacePoint2TrueHitConnectorModule::m_noTrueHitCtr
std::vector< unsigned int > m_noTrueHitCtr
Number of SpacePoints that contained a Cluster to which no TrueHit could be found (i....
Definition: SpacePoint2TrueHitConnectorModule.h:277
Belle2::SpacePoint2TrueHitConnectorModule::m_iCont
unsigned int m_iCont
'helper variable' needed to not have to pass one integer down to processSpacePoint only to have a han...
Definition: SpacePoint2TrueHitConnectorModule.h:255
Belle2::SpacePoint2TrueHitConnectorModule::m_treePtr
TTree * m_treePtr
pointer to tree in root file
Definition: SpacePoint2TrueHitConnectorModule.h:261
Belle2::SpacePoint2TrueHitConnectorModule::m_PARAMrootFileName
std::vector< std::string > m_PARAMrootFileName
name and update status of root file
Definition: SpacePoint2TrueHitConnectorModule.h:211
Belle2::simpleBitfield
helper class for setting up a bitfield that can be used to store several flags in one variable TODO: ...
Definition: SpacePoint2TrueHitConnectorModule.h:435
Belle2::SpacePoint2TrueHitConnectorModule::baseMapT
std::unordered_map< int, TrueHitInfo > baseMapT
typedef for shorter notation throughout the module
Definition: SpacePoint2TrueHitConnectorModule.h:176
Belle2::SpacePoint
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
Definition: SpacePoint.h:52
Belle2::SpacePoint2TrueHitConnectorModule::m_weightTooSmallCtr
unsigned int m_weightTooSmallCtr
Count the omitted relations because of a too small weight.
Definition: SpacePoint2TrueHitConnectorModule.h:282
Belle2::simpleBitfield::operator=
simpleBitfield< T > & operator=(simpleBitfield< T > &)=delete
not needed
Belle2::SpacePoint2TrueHitConnectorModule::m_PXDTrueHits
Belle2::StoreArray< Belle2::PXDTrueHit > m_PXDTrueHits
PXDTrueHits StoreArray used throughout the module.
Definition: SpacePoint2TrueHitConnectorModule.h:241
Belle2::SpacePoint2TrueHitConnectorModule::m_nRelTrueHitsCtr
std::vector< std::array< unsigned int, 5 > > m_nRelTrueHitsCtr
counting different numbers of related TrueHits (to a SpacePoint) with one variable
Definition: SpacePoint2TrueHitConnectorModule.h:267
Belle2::SpacePoint2TrueHitConnectorModule::initializeCounters
void initializeCounters()
initialize all counters to 0 WARNING: only call in constructor of module!
Definition: SpacePoint2TrueHitConnectorModule.cc:388
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2::TrueHitInfo::m_wV
double m_wV
weight of relation between V-Cluster and TrueHit
Definition: SpacePoint2TrueHitConnectorModule.h:53
Belle2::SpacePoint2TrueHitConnectorModule::compatibleCombination
bool compatibleCombination(Belle2::SpacePoint *spacePoint, TrueHitType *trueHit)
compares the TrueHit and the SpacePoint positions (global) to decide whether they are compatible NOTE...
Definition: SpacePoint2TrueHitConnectorModule.cc:703
Belle2::SpacePoint2TrueHitConnectorModule::m_rootFilePtr
TFile * m_rootFilePtr
pointer to root file
Definition: SpacePoint2TrueHitConnectorModule.h:259
Belle2::simpleBitfield::addStatus
void addStatus(T __statusBits)
add a status to the bitfield (if it has not already been added)
Definition: SpacePoint2TrueHitConnectorModule.h:450
Belle2::SpacePoint2TrueHitConnectorModule::e_detTypes
e_detTypes
enum to distinguish the detectortypes
Definition: SpacePoint2TrueHitConnectorModule.h:181
Belle2::SpacePoint2TrueHitConnectorModule::getClusterSizes
std::pair< unsigned short int, unsigned short int > getClusterSizes(Belle2::SpacePoint *spacePoint, e_detTypes detType)
get the sizes of the related Clusters of a SpacePoint
Definition: SpacePoint2TrueHitConnectorModule.cc:864
Belle2::SpacePoint2TrueHitConnectorModule::RootVariables::SpacePointULocal
std::vector< double > SpacePointULocal
SpacePoint local U-position.
Definition: SpacePoint2TrueHitConnectorModule.h:142
Belle2::TrueHitInfo::getWeightSum
double getWeightSum() const
get sum of relation weights
Definition: SpacePoint2TrueHitConnectorModule.h:92
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::SpacePoint2TrueHitConnectorModule::RootVariables::HitVxdID
std::vector< unsigned short int > HitVxdID
VxdID of the SpacePoint/TrueHit.
Definition: SpacePoint2TrueHitConnectorModule.h:157
Belle2::SpacePoint2TrueHitConnectorModule::initialize
void initialize() override
initialize: initialize counters, check StoreArrays, register StoreArrays, ...
Definition: SpacePoint2TrueHitConnectorModule.cc:106
Belle2::SpacePoint2TrueHitConnectorModule::m_PARAMrequireProximity
bool m_PARAMrequireProximity
require the TrueHit to be close to the SpacePoint.
Definition: SpacePoint2TrueHitConnectorModule.h:223
Belle2::SpacePoint2TrueHitConnectorModule::m_regRelationsCtr
std::vector< unsigned int > m_regRelationsCtr
Number of registered relations.
Definition: SpacePoint2TrueHitConnectorModule.h:272
Belle2::SpacePoint2TrueHitConnectorModule::RootVariables::NRelations
std::vector< unsigned int > NRelations
Number of related TrueHits to a SpacePoint.
Definition: SpacePoint2TrueHitConnectorModule.h:159
Belle2::SpacePoint2TrueHitConnectorModule::m_outputSpacePoints
std::vector< Belle2::StoreArray< Belle2::SpacePoint > > m_outputSpacePoints
StoreArray of all output SpacePoints.
Definition: SpacePoint2TrueHitConnectorModule.h:250
Belle2::SpacePoint2TrueHitConnectorModule
Module that tries to register a relation between SpacePoints and TrueHits, hence making some MC Infor...
Definition: SpacePoint2TrueHitConnectorModule.h:125
Belle2::SpacePoint2TrueHitConnectorModule::m_SVDTrueHits
Belle2::StoreArray< Belle2::SVDTrueHit > m_SVDTrueHits
SVDTrueHits StoreArray used throughout the module.
Definition: SpacePoint2TrueHitConnectorModule.h:239
Belle2::TrueHitInfo::getNClusters
short getNClusters() const
get the number of Clusters that point to this TrueHit
Definition: SpacePoint2TrueHitConnectorModule.h:83
Belle2::simpleBitfield::__bits
T __bits
member holding the bits that are maniuplated
Definition: SpacePoint2TrueHitConnectorModule.h:457
Belle2::SpacePoint2TrueHitConnectorModule::getRelatedTrueHits
MapType getRelatedTrueHits(Belle2::SpacePoint *spacePoint, std::string clusterName="ALL", std::string trueHitName="ALL")
get all the related TrueHits to the SpacePoint, including their weights in a map (multimap!...
Definition: SpacePoint2TrueHitConnectorModule.cc:332
Belle2::SpacePoint2TrueHitConnectorModule::RootVariables::WeightU
std::vector< double > WeightU
weight of the relation between the U-Cluster of the SpacePoint and the TrueHit
Definition: SpacePoint2TrueHitConnectorModule.h:154
Belle2::SpacePoint2TrueHitConnectorModule::calculateRelationWeight
double calculateRelationWeight(const TrueHitInfo &trueHitInfo, Belle2::SpacePoint *spacePoint)
calculate the Relation weight to be used (for SVD only, although method works with PXD as well!...
Definition: SpacePoint2TrueHitConnectorModule.cc:904
Belle2::SpacePoint2TrueHitConnectorModule::m_noClusterCtr
std::vector< unsigned int > m_noClusterCtr
Number of SpacePoints without relation to a Cluster (i.e.
Definition: SpacePoint2TrueHitConnectorModule.h:270
Belle2::SpacePoint2TrueHitConnectorModule::m_PARAMdetectorTypes
std::vector< std::string > m_PARAMdetectorTypes
detector type names as strings to determine which name belongs to which detector type
Definition: SpacePoint2TrueHitConnectorModule.h:207
Belle2::SpacePoint2TrueHitConnectorModule::m_PARAMstoreSeparate
bool m_PARAMstoreSeparate
switch for storing the SpacePoints that can be related to a TrueHit into separate StoreArrays,...
Definition: SpacePoint2TrueHitConnectorModule.h:214
Belle2::simpleBitfield::simpleBitfield
simpleBitfield(const simpleBitfield< T > &__otherBitfield)=delete
not needed
Belle2::SpacePoint2TrueHitConnectorModule::m_ghostHitCtr
std::vector< unsigned int > m_ghostHitCtr
Number of SpacePoints that are considered ghost hits.
Definition: SpacePoint2TrueHitConnectorModule.h:274
Belle2::SpacePoint2TrueHitConnectorModule::positionAnalysis
void positionAnalysis(Belle2::SpacePoint *spacePoint, const MapType &trueHitMap, const int &index, e_detTypes detType)
Analyze the position of SpacePoints and corresponding TrueHits.
Definition: SpacePoint2TrueHitConnectorModule.cc:525
Belle2::SpacePoint2TrueHitConnectorModule::RootVariables::SpacePointXGlobal
std::vector< double > SpacePointXGlobal
SpacePoint global X-position.
Definition: SpacePoint2TrueHitConnectorModule.h:144
Belle2::VXD::SensorInfoBase::SVD
@ SVD
SVD Sensor.
Definition: SensorInfoBase.h:45
Belle2::SpacePoint2TrueHitConnectorModule::BELLE2_DEFINE_EXCEPTION
BELLE2_DEFINE_EXCEPTION(NoClusterToSpacePoint, "Found no related Cluster for a SpacePoint!")
Exception for when no related Cluster can be found for a SpacePoint.
Belle2::SpacePoint2TrueHitConnectorModule::m_rejectedRelsCtr
std::vector< unsigned int > m_rejectedRelsCtr
Number of SpacePoints that were not related to a TrueHit (i.e.
Definition: SpacePoint2TrueHitConnectorModule.h:280
Belle2::TrueHitInfo::TrueHitInfo
TrueHitInfo()
default ctor, initializing Id to -1, weights to 0, and bools to false
Definition: SpacePoint2TrueHitConnectorModule.h:58
Belle2::SpacePoint2TrueHitConnectorModule::RootVariables::SpacePointErrorY
std::vector< double > SpacePointErrorY
positiion error of SpacePoint in Y direction (global)
Definition: SpacePoint2TrueHitConnectorModule.h:169
Belle2::SpacePoint2TrueHitConnectorModule::m_PARAMpositionAnalysis
bool m_PARAMpositionAnalysis
switch for doing the analysis of positions of SpacePoints and TrueHits
Definition: SpacePoint2TrueHitConnectorModule.h:219
Belle2::SpacePoint2TrueHitConnectorModule::m_PARAMclusterNames
std::vector< std::string > m_PARAMclusterNames
names of containers of Clusters
Definition: SpacePoint2TrueHitConnectorModule.h:209
Belle2::TrueHitInfo::m_U
bool m_U
if true, U-Cluster is used by SpacePoint
Definition: SpacePoint2TrueHitConnectorModule.h:54
Belle2::TrueHitInfo::m_Id
int m_Id
TrueHit ID (StoreArray Index)
Definition: SpacePoint2TrueHitConnectorModule.h:51
Belle2::TrueHitInfo::setUWeight
void setUWeight(double weight)
set the weight for the U-Cluster
Definition: SpacePoint2TrueHitConnectorModule.h:86
Belle2::VXD::SensorInfoBase::PXD
@ PXD
PXD Sensor.
Definition: SensorInfoBase.h:44
Belle2::SpacePoint2TrueHitConnectorModule::RootVariables::SpacePointVLocal
std::vector< double > SpacePointVLocal
SpacePoint local V-position.
Definition: SpacePoint2TrueHitConnectorModule.h:143
Belle2::SpacePoint2TrueHitConnectorModule::m_PARAMtrueHitNames
std::vector< std::string > m_PARAMtrueHitNames
names of containers of TrueHits
Definition: SpacePoint2TrueHitConnectorModule.h:202
Belle2::SpacePoint2TrueHitConnectorModule::RootVariables::TrueHitVLocal
std::vector< double > TrueHitVLocal
TrueHit local V-position.
Definition: SpacePoint2TrueHitConnectorModule.h:149
Belle2::SpacePoint2TrueHitConnectorModule::processSpacePoint
MapType processSpacePoint(Belle2::SpacePoint *spacePoint, e_detTypes detType)
process a SpacePoint.
Definition: SpacePoint2TrueHitConnectorModule.cc:308
Belle2::SpacePoint2TrueHitConnectorModule::RootVariables::SpacePointYGlobal
std::vector< double > SpacePointYGlobal
SpacePoint global Y-position.
Definition: SpacePoint2TrueHitConnectorModule.h:145
Belle2::SpacePoint2TrueHitConnectorModule::m_rootVariables
RootVariables m_rootVariables
Root variables used for collecting data eventwise.
Definition: SpacePoint2TrueHitConnectorModule.h:257
Belle2::SpacePoint2TrueHitConnectorModule::RootVariables::WeightV
std::vector< double > WeightV
weight of the relation between the V-Cluster of the SpacePoint and the TrueHit
Definition: SpacePoint2TrueHitConnectorModule.h:155
Belle2::SpacePoint2TrueHitConnectorModule::registerAllRelations
void registerAllRelations(Belle2::SpacePoint *spacePoint, MapType trueHitMap, e_detTypes detType)
register a Relation to all the TrueHits in the trueHitMap for the passed SpacePoint
Definition: SpacePoint2TrueHitConnectorModule.cc:428
Belle2::SpacePoint2TrueHitConnectorModule::getRelatedClusters
std::vector< std::pair< ClusterType *, double > > getRelatedClusters(Belle2::SpacePoint *spacePoint, std::string clusterName="ALL")
get the pointers to the related Clusters and the weight of the original Relations between the spacePo...
Definition: SpacePoint2TrueHitConnectorModule.cc:494
Belle2::StoreArray< Belle2::SVDTrueHit >
Belle2::SpacePoint2TrueHitConnectorModule::RootVariables::SpacePointZGlobal
std::vector< double > SpacePointZGlobal
SpacePoint global Z-position.
Definition: SpacePoint2TrueHitConnectorModule.h:146
Belle2::SpacePoint2TrueHitConnectorModule::m_PARAMminWeight
double m_PARAMminWeight
define a minimal weight a relation between Cluster and TrueHit.
Definition: SpacePoint2TrueHitConnectorModule.h:231
Belle2::simpleBitfield::clear
void clear()
reset bitfield
Definition: SpacePoint2TrueHitConnectorModule.h:454
Belle2::SpacePoint2TrueHitConnectorModule::m_inputSpacePoints
std::vector< std::pair< Belle2::StoreArray< Belle2::SpacePoint >, e_detTypes > > m_inputSpacePoints
StoreArray of all input SpacePoints.
Definition: SpacePoint2TrueHitConnectorModule.h:248
Belle2::SpacePoint2TrueHitConnectorModule::m_PARAMoutputSuffix
std::string m_PARAMoutputSuffix
suffix that will be appended to the StoreArray names of the output StoreArrays
Definition: SpacePoint2TrueHitConnectorModule.h:200
Belle2::SpacePoint2TrueHitConnectorModule::registerTrueHitRelation
void registerTrueHitRelation(Belle2::SpacePoint *spacePoint, int index, double weight, Belle2::StoreArray< TrueHitType > trueHits)
register the relation between a SpacePoint and the TrueHit (passed by index in the correspoinding Tru...
Definition: SpacePoint2TrueHitConnectorModule.cc:512
Belle2::SpacePoint2TrueHitConnectorModule::m_SpacePointsCtr
std::vector< unsigned int > m_SpacePointsCtr
Number of SpacePoints presented to the module.
Definition: SpacePoint2TrueHitConnectorModule.h:264
Belle2::SpacePoint2TrueHitConnectorModule::closeRootFile
void closeRootFile()
close root file
Definition: SpacePoint2TrueHitConnectorModule.cc:853
Belle2::SpacePoint2TrueHitConnectorModule::RootVariables::TrueHitYGlobal
std::vector< double > TrueHitYGlobal
TrueHit global Y-position.
Definition: SpacePoint2TrueHitConnectorModule.h:151
Belle2::SpacePoint2TrueHitConnectorModule::m_maxGlobalDiff
double m_maxGlobalDiff
storing the squared value of m_PARAMmaxGlobalDiff here to not alter the parameter input
Definition: SpacePoint2TrueHitConnectorModule.h:252
Belle2::SpacePoint2TrueHitConnectorModule::RootVariables::TrueHitULocal
std::vector< double > TrueHitULocal
TrueHit local U-position.
Definition: SpacePoint2TrueHitConnectorModule.h:148
Belle2::SpacePoint2TrueHitConnectorModule::RootVariables::SpacePointErrorV
std::vector< double > SpacePointErrorV
position error of SpacePoint in V direction
Definition: SpacePoint2TrueHitConnectorModule.h:166
Belle2::simpleBitfield::getStatus
const T getStatus() const
get the status of the bitfield
Definition: SpacePoint2TrueHitConnectorModule.h:446
Belle2::TrueHitInfo::m_V
bool m_V
if true, V-Cluster is used by SpacePoint
Definition: SpacePoint2TrueHitConnectorModule.h:55
Belle2::SpacePoint2TrueHitConnectorModule::getLocalError
std::pair< double, double > getLocalError(Belle2::SpacePoint *spacePoint)
get the position error of SpacePoints in local coordinates @retuns .first is U position error,...
Definition: SpacePoint2TrueHitConnectorModule.cc:881
Belle2::SpacePoint2TrueHitConnectorModule::RootVariables::SpacePointErrorZ
std::vector< double > SpacePointErrorZ
positiion error of SpacePoint in Z direction (global)
Definition: SpacePoint2TrueHitConnectorModule.h:170
Belle2::simpleBitfield::setStatus
void setStatus(T __statusBits)
set the status of the bitfield (CAUTION: overwrites any previously defined status!...
Definition: SpacePoint2TrueHitConnectorModule.h:448
Belle2::SpacePoint2TrueHitConnectorModule::terminate
void terminate() override
terminate: print some summary information
Definition: SpacePoint2TrueHitConnectorModule.cc:262
Belle2::TrueHitInfo::operator<
bool operator<(const TrueHitInfo &b) const
comparison operator ensuring strict weak ordering sorts by the number of Clusters first,...
Definition: SpacePoint2TrueHitConnectorModule.h:77
Belle2::SpacePoint2TrueHitConnectorModule::RootVariables::SpacePointErrorX
std::vector< double > SpacePointErrorX
positiion error of SpacePoint in X direction (global)
Definition: SpacePoint2TrueHitConnectorModule.h:168
Belle2::TrueHitInfo::setVWeight
void setVWeight(double weight)
set the weight for the V-Cluster
Definition: SpacePoint2TrueHitConnectorModule.h:89