 |
Belle II Software
release-05-02-19
|
23 #include <framework/core/Module.h>
24 #include <framework/database/DBArray.h>
25 #include <framework/database/DBObjPtr.h>
26 #include <framework/datastore/StoreArray.h>
27 #include <framework/gearbox/Unit.h>
35 class DatabaseRepresentationOfWeightfile;
36 class ECLConnectedRegion;
38 class ECLShowerShapeSecondMomentCorrection;
53 class ECLShowerShapeModule :
public Module {
77 virtual void event()
override;
80 virtual void endRun()
override;
117 std::unique_ptr<DBObjPtr<DatabaseRepresentationOfWeightfile>>
119 std::unique_ptr<DBObjPtr<DatabaseRepresentationOfWeightfile>>
121 std::unique_ptr<DBObjPtr<DatabaseRepresentationOfWeightfile>>
126 std::unique_ptr<MVA::SingleDataset>
155 double computeLateralEnergy(
const std::vector<ProjectedECLDigit>& projectedDigits,
const double avgCrystalDimension)
const;
171 double computeAbsZernikeMoment(
const std::vector<ProjectedECLDigit>& projectedDigits,
const double totalEnergy,
const int n,
173 const double rho)
const;
178 double computeSecondMoment(
const std::vector<ProjectedECLDigit>& shower,
const double totalEnergy)
const;
186 double Rnm(
const int n,
const int m,
const double rho)
const;
192 std::complex<double>
zernikeValue(
const double rho,
const double alpha,
const int n,
const int m)
const;
225 {
return "ECLShowers" ; }
229 {
return "ECLCalDigits" ; }
233 {
return "ECLConnectedRegions" ; }
244 {
return "ECLShowersPureCsI" ; }
248 {
return "ECLCalDigitsPureCsI" ; }
252 {
return "ECLConnectedRegionsPureCsI" ; }
@ c_thetaType
type of theta identifier
virtual const char * eclConnectedRegionArrayName() const override
PureCsI name ECLConnectedRegionsPureCsI.
std::complex< double > zernikeValue(const double rho, const double alpha, const int n, const int m) const
Return the complex value of the Zernike polynomial of rank n,m.
std::unique_ptr< ECL::ECLNeighbours > m_neighbourMap21
Neighbour map 21 neighbours, for E9oE21.
double rho
radial distance
std::unique_ptr< MVA::Expert > m_expert_BRL
Pointer to the current MVA Expert for BRL.
Struct used to hold information of the digits projected to a plane perpendicular to the shower direct...
double computeSecondMoment(const std::vector< ProjectedECLDigit > &shower, const double totalEnergy) const
Compute the second moment in the plane perpendicular to the direction of the shower.
virtual void endRun() override
End run.
virtual void initialize() override
Initialize.
virtual void event() override
Event.
virtual const char * eclCalDigitArrayName() const override
PureCsI name ECLCalDigitsPureCsI.
void setShowerShapeVariables(ECLShower *eclShower, const bool calculateZernikeMVA) const
Set showr shape variables.
Class for accessing arrays of objects in the database.
double computeE1oE9(const ECLShower &) const
Shower shape variable: E1oE9 The energy ratio is calculated taking the weighted central (=1) and the ...
std::unique_ptr< MVA::SingleDataset > m_dataset
Pointer to the current dataset.
std::string m_zernike_MVAidentifier_BWD
Zernike moment MVA - BWD endcap weight-file.
const double m_BRLthetaMin
Minimum theta of barrel used for choosing which Zernike MVA to apply.
void initializeMVA(const std::string &identifier, std::unique_ptr< DBObjPtr< DatabaseRepresentationOfWeightfile >> &weightFileRepresentation, std::unique_ptr< MVA::Expert > &expert)
Load MVA weight file and set pointer of expert.
DBArray< ECLShowerShapeSecondMomentCorrection > m_secondMomentCorrectionArray
Shower shape corrections from DB.
virtual void beginRun() override
Begin run.
std::unique_ptr< DBObjPtr< DatabaseRepresentationOfWeightfile > > m_weightfile_representation_BRL
Database pointer to the Database representation of the Zernike moment MVA weightfile for BRL.
virtual const char * eclConnectedRegionArrayName() const
Default name ECLConnectedRegions.
void prepareSecondMomentCorrectionsCallback()
Prepare corrections for second moment Will be called whenever the m_secondMomentCorrectionArray get u...
std::string m_zernike_MVAidentifier_BRL
Zernike moment MVA - Barrel weight-file.
virtual const char * eclShowerArrayName() const
We need names for the data objects to differentiate between PureCsI and default.
Class for accessing objects in the database.
double energy
weighted energy
void initializeMVAweightFiles(const std::string &identifier, std::unique_ptr< DBObjPtr< DatabaseRepresentationOfWeightfile >> &weightFileRepresentation)
initialize MVA weight files from DB
Class to perform the shower correction.
double m_avgCrystalDimension
Average crystal dimension [cm].
virtual const char * eclShowerArrayName() const override
PureCsI name ECLShowersPureCsI.
bool m_zernike_useFarCrystals
Determines if to include or ignore crystals with rho > rho0 in perpendicular plane,...
~ECLShowerShapeModule()
Destructor.
ECLShowerShapeModule()
Constructor.
double computeE9oE21(const ECLShower &) const
Shower shape variable: E9oE21 The energy ratio is calculated taking the weighted 3x3 (=9) and the wei...
std::unique_ptr< MVA::Expert > m_expert_BWD
Pointer to the current MVA Expert for BWD.
std::unique_ptr< ECL::ECLNeighbours > m_neighbourMap9
Neighbour map 9 neighbours, for E9oE21 and E1oE9.
Abstract base class for different kinds of events.
double computeLateralEnergy(const std::vector< ProjectedECLDigit > &projectedDigits, const double avgCrystalDimension) const
Shower shape variable: Lateral energy.
double m_zernike_n1_rho0
Scaling factor for radial distances in perpendicular plane, used in Zernike moment calculation for N1...
virtual const char * eclCalDigitArrayName() const
Default name ECLCalDigits.
static const double deg
degree to radians
double computeAbsZernikeMoment(const std::vector< ProjectedECLDigit > &projectedDigits, const double totalEnergy, const int n, const int m, const double rho) const
Compute the absolute value of the complex Zernike moment Znm.
double m_zernike_n2_rho0
Scaling factor for radial distances in perpendicular plane, used in Zernike moment calculation for N2...
const unsigned int m_numZernikeMVAvariables
number of variables expected in the Zernike MVA weightfile
std::unique_ptr< DBObjPtr< DatabaseRepresentationOfWeightfile > > m_weightfile_representation_FWD
Database pointer to the Database representation of the Zernike moment MVA weightfile for FWD.
std::unique_ptr< DBObjPtr< DatabaseRepresentationOfWeightfile > > m_weightfile_representation_BWD
Database pointer to the Database representation of the Zernike moment MVA weightfile for BWD.
std::vector< ProjectedECLDigit > projectECLDigits(const ECLShower &shower) const
Compute projections of the ECLCalDigits to the perpendicular plane.
const double m_BRLthetaMax
Maximum theta of barrel used for choosing which Zernike MVA to apply.
TGraph m_secondMomentCorrections[2][10]
TGraphs that hold the corrections.
double getSecondMomentCorrection(const double theta, const double phi, const int hypothesis) const
Get corrections for second moment.
std::unique_ptr< MVA::Expert > m_expert_FWD
Pointer to the current MVA Expert for FWD.
std::string m_zernike_MVAidentifier_FWD
Zernike moment MVA - FWD endcap weight-file.
virtual void terminate() override
Terminate.
Accessor to arrays stored in the data store.
@ c_phiType
type of phi identifier
double Rnm(const int n, const int m, const double rho) const
The radial part of the Zernike polynomial n,m - Zernike polynomial rank rho - radial distance
The very same module but for PureCsI.
StoreArray< ECLConnectedRegion > m_eclConnectedRegions
StoreArray ECLConnectedRegion.
Class to store ECL Showers.