Belle II Software development
ECLSplitterN1Module.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/* Basf2 headers. */
12#include <framework/core/Module.h>
13#include <framework/datastore/StoreArray.h>
14#include <framework/datastore/StoreObjPtr.h>
15#include <framework/database/DBObjPtr.h>
16#include <framework/gearbox/Unit.h>
17
18/* Root headers */
19#include <TH2F.h>
20
21/* C++ headers. */
22#include <vector>
23
24namespace Belle2 {
29 class ECLCalDigit;
30 class ECLConnectedRegion;
31 class ECLShower;
32 class ECLLocalMaximum;
33 class EventLevelClusteringInfo;
34 class ECLnOptimal;
35
36 namespace ECL {
37 class ECLNeighbours;
38 class ECLGeometryPar;
39 }
40
42 class ECLSplitterN1Module : public Module {
43
44 public:
47
50
52 virtual void initialize() override;
53
55 virtual void beginRun() override;
56
58 virtual void event() override;
59
61 virtual void endRun() override;
62
64 virtual void terminate() override;
65
66 private:
67 // Module parameters:
68
69 // Splitter
70 double m_threshold;
76 const double c_molierRadius = 3.581 *
86 std::vector<int> m_groupNumber;
87 const int m_nLeakReg = 3;
88 int m_nEnergyBins = 0;
89 std::vector< std::vector<float> > m_eBoundaries;
91 // Position
92 std::string m_positionMethod;
96 std::vector<double> m_liloParameters;
98 // Background
102 std::vector< int > m_StoreArrPosition;
103
105 std::vector< int > m_StoreArrPositionLM;
106
108 std::vector< int > m_cellIdInCR;
109
116
119
122
125
128
130 virtual const char* eclCalDigitArrayName() const
131 { return "ECLCalDigits" ; }
132
134 virtual const char* eclConnectedRegionArrayName() const
135 { return "ECLConnectedRegions" ; }
136
138 virtual const char* eclLocalMaximumArrayName() const
139 { return "ECLLocalMaximums" ; }
140
142 virtual const char* eclShowerArrayName() const
143 { return "ECLShowers" ; }
144
146 virtual const char* eventLevelClusteringInfoName() const
147 { return "EventLevelClusteringInfo" ; }
148
151
154
156 int getNeighbourMap(const double energy, const double background);
157
159 std::vector<int> getOptimalNumberOfDigits(const int cellid, const double energy);
160
162 double getEnergySum(std::vector < std::pair<double, double> >& weighteddigits, const unsigned int n);
163
165 double estimateEnergy(const int centerid);
166
167 }; // end of ECLSplitterN1Module
168
169
172 public:
174 virtual const char* eclCalDigitArrayName() const override
175 { return "ECLCalDigitsPureCsI" ; }
176
178 virtual const char* eclConnectedRegionArrayName() const override
179 { return "ECLConnectedRegionsPureCsI" ; }
180
182 virtual const char* eclLocalMaximumArrayName() const override
183 { return "ECLLocalMaximumsPureCsI" ; }
184
186 virtual const char* eclShowerArrayName() const override
187 { return "ECLShowersPureCsI" ; }
188
190 virtual const char* eventLevelClusteringInfoName() const override
191 { return "EventLevelClusteringInfoPureCsI" ; }
192
193 }; // end of ECLSplitterN1PureCsIModule
194
196} // end of Belle2 namespace
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
Class to store connected regions (CRs)
Class to perform the shower correction.
virtual const char * eclShowerArrayName() const
Default name ECLShowers.
ECL::ECLNeighbours * m_NeighbourMap9
Neighbour maps.
virtual const char * eventLevelClusteringInfoName() const
Name to be used for default option: EventLevelClusteringInfo.
double m_liloParameterB
lin-log parameter B
int m_maxIterations
Maximum number of iterations.
StoreArray< ECLShower > m_eclShowers
Store array: ECLShower.
ECL::ECLNeighbours * m_NeighbourMap21
5x5 neighbours excluding corners = 21
StoreArray< ECLConnectedRegion > m_eclConnectedRegions
Store array: ECLConnectedRegion.
double m_minimumSharedEnergy
Minimum shared energy.
const int m_nLeakReg
3 ECL regions: 0 = forward, 1 = barrel, 2 = backward
std::string m_positionMethod
Position calculation: lilo or linear.
void splitConnectedRegion(ECLConnectedRegion &aCR)
Split connected region into showers.
virtual void initialize() override
Initialize.
double m_cutDigitTimeResidualForEnergy
Maximum time residual to be included in the shower energy calculation.
StoreArray< ECLLocalMaximum > m_eclLocalMaximums
Store array: ECLLocalMaximum.
virtual void event() override
Event.
virtual const char * eclLocalMaximumArrayName() const
Default name ECLLocalMaximums.
double m_threshold
Local maximum threshold after splitting.
double estimateEnergy(const int centerid)
Estimate energy using 3x3 around central crystal.
virtual void endRun() override
End run.
virtual void terminate() override
Terminate.
std::vector< int > getOptimalNumberOfDigits(const int cellid, const double energy)
Get optimal number of digits (out of 21) based on first energy estimation and background level per ev...
ECL::ECLGeometryPar * m_geom
Geometry.
std::vector< int > m_cellIdInCR
list with all cellid of this connected region
double m_shiftTolerance
Tolerance level for centroid shifts.
DBObjPtr< ECLnOptimal > m_eclNOptimal
nOptimal payload
virtual void beginRun() override
Begin run.
int m_fullBkgdCount
Number of expected background digits at full background, FIXME: move to database.
int m_nEnergyBins
number of energies bins in nOptimal payload
const double c_molierRadius
Constant RM (Molier Radius) from exp(-a*dist/RM), http://pdg.lbl.gov/2009/AtomicNuclearProperties/HTM...
virtual const char * eclConnectedRegionArrayName() const
Default name ECLConnectedRegions.
int m_maxSplits
Maximum number of splits.
int m_useOptimalNumberOfDigitsForEnergy
Optimize the number of neighbours for energy calculations.
int getNeighbourMap(const double energy, const double background)
Get number of neighbours based on first energy estimation and background level per event.
double m_cutDigitEnergyForEnergy
Minimum digit energy to be included in the shower energy calculation.
virtual const char * eclCalDigitArrayName() const
Default name ECLCalDigits.
std::vector< double > m_liloParameters
lin-log parameters A, B, and C
std::vector< int > m_StoreArrPosition
vector (ECLElementNumbers::c_NCrystals + 1 entries) with cell id to store array positions
std::vector< int > m_StoreArrPositionLM
vector (ECLElementNumbers::c_NCrystals + 1 entries) with cell id to store array positions for LM
double m_liloParameterA
lin-log parameter A
StoreObjPtr< EventLevelClusteringInfo > m_eventLevelClusteringInfo
Store object pointer: EventLevelClusteringInfo.
std::vector< std::vector< float > > m_eBoundaries
energy boundaries each region
TH2F m_nOptimal2D
2D hist of nOptimal for Ebin vs groupID
std::vector< int > m_groupNumber
group number for each crystal
double getEnergySum(std::vector< std::pair< double, double > > &weighteddigits, const unsigned int n)
Get energy sum for weighted entries.
StoreArray< ECLCalDigit > m_eclCalDigits
Store array: ECLCalDigit.
double m_expConstant
Constant a from exp(-a*dist/RM), 1.5 to 2.5.
double m_liloParameterC
lin-log parameter C
The very same module but for PureCsI.
virtual const char * eclCalDigitArrayName() const override
PureCsI name ECLCalDigitsPureCsI.
virtual const char * eventLevelClusteringInfoName() const override
Name to be used for PureCsI option: EventLevelClusteringInfoPureCsI.
virtual const char * eclShowerArrayName() const override
PureCsI name ECLShowersPureCsI.
virtual const char * eclLocalMaximumArrayName() const override
PureCsI name ECLLocalMaximumsPureCsI.
virtual const char * eclConnectedRegionArrayName() const override
PureCsI name ECLConnectedRegionsPureCsI.
The Class for ECL Geometry Parameters.
Class to get the neighbours for a given cell id.
Definition: ECLNeighbours.h:25
Base class for Modules.
Definition: Module.h:72
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
static const double cm
Standard units with the value = 1.
Definition: Unit.h:47
Abstract base class for different kinds of events.