Belle II Software  release-08-01-10
PXDClusterizerModule.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 #include <framework/core/Module.h>
12 #include <framework/database/DBObjPtr.h>
13 #include <vxd/dataobjects/VxdID.h>
14 #include <pxd/dbobjects/PXDClusterPositionErrorPar.h>
15 #include <pxd/reconstruction/ClusterCache.h>
16 #include <pxd/reconstruction/ClusterProjection.h>
17 #include <pxd/reconstruction/NoiseMap.h>
18 #include <string>
19 #include <memory>
20 
21 namespace Belle2 {
26  class RelationArray;
27  class RelationElement;
28 
29 
30  namespace PXD {
31 
45  class PXDClusterizerModule : public Module {
46 
47  public:
49  typedef std::vector<const RelationElement*> RelationLookup;
50 
53 
55  virtual void initialize() override;
57  virtual void beginRun() override;
59  virtual void event() override;
60 
61  private:
72  void createRelationLookup(const RelationArray& relation, RelationLookup& lookup, size_t digits);
73 
79  void fillRelationMap(const RelationLookup& lookup, std::map<unsigned int, float>& relation, unsigned int index);
80 
84  void writeClusters(VxdID sensorID);
85 
94  void calculatePositionError(const ClusterCandidate& cls, ClusterProjection& primary, const ClusterProjection& secondary,
95  double minPitch, double centerPitch, double maxPitch);
96 
109  VxdID sensorID, unsigned int uCell, unsigned int vCell, double centerPitch,
110  bool isAtUEdge = false, bool isAtVEdge = false, bool isAdjacentDead = false);
111 
113  double m_elNoise;
115  double m_cutSeed;
119  double m_cutCluster;
123  std::string m_storeDigitsName;
125  std::string m_storeClustersName;
127  std::string m_storeTrueHitsName;
140 
143 
147  std::unique_ptr<ClusterCache> m_cache;
150 
155 
159  std::string m_positionErrorUName;
161  std::string m_positionErrorVName;
163  std::unique_ptr<DBObjPtr<PXDClusterPositionErrorPar>> m_clusterPositionErrorUPar;
165  std::unique_ptr<DBObjPtr<PXDClusterPositionErrorPar>> m_clusterPositionErrorVPar;
166 
167 
168  };//end class declaration
169 
170 
171  } //end PXD namespace;
173 } // end namespace Belle2
174 
Base class for Modules.
Definition: Module.h:72
The payload class for PXD cluster position error.
Class representing a possible cluster during clustering of the PXD It supports merging of different c...
Helper struct to collect information about the 1D projection of a Pixel cluster.
Base Class to represent pixel dependent Noise Map.
Definition: NoiseMap.h:25
NoiseMap m_noiseMap
Noise map for the currently active sensor.
int m_clusterCacheSize
Size of cluster Cache (0 = default)
std::unique_ptr< DBObjPtr< PXDClusterPositionErrorPar > > m_clusterPositionErrorVPar
DB object for cluster posotion errors in V.
double m_cutAdjacentSignal
Signal in ADU for Adjacent cut, basically m_elNoise*m_cutAdjacent.
virtual void initialize() override
Initialize the module.
std::string m_positionErrorVName
Name of the DB payload containing cluster posotion errors in V.
std::string m_relDigitMCParticleName
Name of the relation between PXDDigits and MCParticles.
virtual void event() override
do the clustering
void calculatePositionError(const ClusterCandidate &cls, ClusterProjection &primary, const ClusterProjection &secondary, double minPitch, double centerPitch, double maxPitch)
Calculate position and error for a given cluster.
std::vector< const RelationElement * > RelationLookup
Container for a RelationArray Lookup table.
std::string m_relClusterDigitName
Name of the relation between PXDClusters and PXDDigits.
double m_cutCluster
Cluster cut in sigma.
std::string m_storeTrueHitsName
Name of the collection to use for the PXDTrueHits.
PXDClusterizerModule()
Constructor defining the parameters.
void fillRelationMap(const RelationLookup &lookup, std::map< unsigned int, float > &relation, unsigned int index)
Add the relation from a given PXDDigit index to a map.
std::string m_storeMCParticlesName
Name of the collection to use for the MCParticles.
RelationLookup m_trueRelation
Lookup table for PXDDigit->PXDTrueHit relation.
std::string m_positionErrorUName
Name of the DB payload containing cluster posotion errors in U.
virtual void beginRun() override
do at every run change
std::unique_ptr< DBObjPtr< PXDClusterPositionErrorPar > > m_clusterPositionErrorUPar
DB object for cluster posotion errors in U.
void assignPositionErrorFromDB(ClusterProjection &primary, PXDClusterPositionErrorPar errorPar, VxdID sensorID, unsigned int uCell, unsigned int vCell, double centerPitch, bool isAtUEdge=false, bool isAtVEdge=false, bool isAdjacentDead=false)
Assign position error for a given cluster from DB.
int m_sizeHeadTail
Size of the cluster at which we switch from Center of Gravity to Analog Head Tail.
std::string m_storeDigitsName
Name of the collection to use for the PXDDigits.
void createRelationLookup(const RelationArray &relation, RelationLookup &lookup, size_t digits)
Create lookup maps for Relations We do not use the RelationIndex as we know much more about the relat...
std::string m_storeClustersName
Name of the collection to use for the PXDClusters.
void writeClusters(VxdID sensorID)
Write clusters to collection.
std::string m_relDigitTrueHitName
Name of the relation between PXDDigits and PXDTrueHits.
std::string m_relClusterMCParticleName
Name of the relation between PXDClusters and MCParticles.
RelationLookup m_mcRelation
Lookup table for PXDDigit->MCParticle relation.
std::unique_ptr< ClusterCache > m_cache
cache of the last seen clusters to speed up clustering
bool m_errorFromDB
Flag to set cluster position error from DB (default = true)
double m_cutAdjacent
Noise cut in sigma.
std::string m_relClusterTrueHitName
Name of the relation between PXDClusters and PXDTrueHits.
Low-level class to create/modify relations between StoreArrays.
Definition: RelationArray.h:62
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
Abstract base class for different kinds of events.