Belle II Software development

Modules

 ecl data objects
 
 ecl modules
 

Classes

struct  PackedAutoCovariance
 packed covariance matrix More...
 
class  ECLAutoCovariance
 Covariance matrices for offline ECL waveform fit. More...
 
class  ECLBeamBackgroundStudy
 Flag for beam background study. More...
 
class  ECLChannelMap
 DB object to store correspondence table of type (Crate id, ShaperDSP id, Channel id) <-> (ECL CellID) More...
 
class  ECLChargedPIDPhasespaceBinning
 Class to store the N dimensional phasespace binning of the MVA categorical training. More...
 
class  ECLChargedPIDPhasespaceCategory
 Stores all required information for the ECLChargedPIDMVA for a phasespace category. More...
 
class  ECLChargedPIDMVAWeights
 Class to contain payload of everything needed for MVA based charged particle identification. More...
 
class  ECLChargedPidPDFs
 Class representing the DB payload w/ information about ECL PDF parameters for a set of particle hypotheses 'signed pdgId' values, i.e. More...
 
class  ECLCrystalCalib
 General DB object to store one calibration number per ECL crystal. More...
 
class  ECLCrystalLocalRunCalib
 ECLCrystalLocalRunCalib is designed to store results of the ECL local run calibration to database. More...
 
class  ECLCrystalsShapeAndPosition
 Crystal shapes and positions. More...
 
class  ECLDatabaseImporter
 ECL database importer. More...
 
class  ECLDigitEnergyConstants
 Energy calibration constants per digit. More...
 
class  ECLDigitTimeConstants
 Time and time resolution calibration constants per digit. More...
 
class  ECLDigitWaveformParameters
 DB object to store photon, hadron and diode shape parameters. More...
 
class  ECLDigitWaveformParametersForMC
 DB object to store photon, hadron and diode shape parameters used in simulations. More...
 
class  ECLDspData
 This object contains ECL DSP coefs – electromagnetic calorimeter digital signal processing coefficients. More...
 
class  ECLHadronComponentEmissionFunction
 Hadron Component Emission Function for hadron pulse shape simulations. More...
 
class  ECLLeakageCorrections
 DB object to store leakage corrections, including nCrys dependence
More...
 
class  ECLLocalRunCalibRef
 ECLLocalRunCalibRef is designed to store reference marks to database for ECL local run calibration. More...
 
class  ECLnOptimal
 DB object to store the optimal number of crystals to be used in a cluster energy sum, and the corresponding corrections for bias and contained (raw) energy. More...
 
class  ECLReferenceCrystalPerCrateCalib
 General DB object to store one reference crystal per per ECL crate for calibration purposes. More...
 
class  ECLShowerCorrectorLeakageCorrection
 Class to hold the information for the ECL shower leakage corrections. More...
 
class  ECLShowerEnergyCorrectionTemporary
 Class to hold the information for the ECL shower energy corrections This is a temporary class as there is no information about phi dependence. More...
 
class  ECLShowerShapeSecondMomentCorrection
 Corrections to the second moment shower shape. More...
 
class  ECLTrackClusterMatchingParameterizations
 Class to hold the parameterizations of the RMS for the difference in polar and azimuthal angle between tracks and ECL clusters. More...
 
class  ECLTrackClusterMatchingThresholds
 Class to hold the matching thresholds for the track-ECLCluster matching. More...
 
class  ECLWaveformData
 ECLWaveformData - container for inverse covariant matrix and shape parameters for time and amplitude fit of ecl crystal waveform. More...
 
class  ECLWFAlgoParams
 Container for constant parameters used in waveform fits. More...
 
class  ECLNoiseData
 Container for constant matrix used to generate electronic noise. More...
 
class  ECLLookupTable
 Class for a lookup table. More...
 
class  ECLCalDigitTest
 Set up a few arrays and objects in the datastore. More...
 
class  ECLChargedPIDTest
 Test the ECL charged PID. More...
 
class  ECLDigitTest
 Set up a few arrays and objects in the datastore. More...
 
class  ECLHitTest
 Set up a few arrays and objects in the datastore. More...
 
class  ECLHitAssignmentTest
 Set up a few arrays and objects in the datastore. More...
 
class  ECLShowerTest
 Set up a few arrays and objects in the datastore. More...
 
class  ECLSimHitTest
 Set up a few arrays and objects in the datastore. More...
 
class  ECLDBTool
 The ECLDBTool class is designed to read / write object from / to database. More...
 

Functions

 TEST_F (ECLCalDigitTest, Constructors)
 Test Constructors.
 
 TEST_F (ECLCalDigitTest, SettersAndGetters)
 Test Setters and Getter.
 
 TEST_F (ECLChargedPIDTest, ECLPidLikelihoodSettersAndGetters)
 Test ECLPidLikelihood setters and getters.
 
 TEST_F (ECLChargedPIDTest, TestECLPdfs)
 Test ECL PDFs.
 
 TEST_F (ECLDigitTest, Constructors)
 Test Constructors.
 
 TEST_F (ECLDigitTest, SettersAndGetters)
 Test Setters and Getter.
 
 TEST_F (ECLHitTest, Constructors)
 Test Constructors.
 
 TEST_F (ECLHitTest, SettersAndGetters)
 Test Setters and Getters.
 
 TEST_F (ECLHitAssignmentTest, Constructors)
 Test Constructors.
 
 TEST_F (ECLHitAssignmentTest, SettersAndGetters)
 Test Setters and Getter.
 
 TEST_F (ECLShowerTest, Constructors)
 Test Constructors.
 
 TEST_F (ECLShowerTest, SettersAndGetters)
 Test Setters and Getter.
 
 TEST_F (ECLSimHitTest, Constructors)
 Test Constructors.
 
 TEST_F (ECLSimHitTest, SettersAndGetters)
 Test Setters and Getters.
 
 TEST (TestgetDetectorRegion, TestgetDetectorRegion)
 Test Constructors.
 

Detailed Description

Function Documentation

◆ TEST()

TEST ( TestgetDetectorRegion  ,
TestgetDetectorRegion   
)

Test Constructors.

Definition at line 25 of file utilityFunctions.cc.

26 {
27 ECLShower myECLShower;
28 ECLCluster myECLCluster;
29 for (int i = 0; i < 1e4; ++i) {
30 const double theta = gRandom->Uniform(0, TMath::Pi());
31
32 //Check shower
33 myECLShower.setTheta(theta);
34 EXPECT_EQ(myECLShower.getDetectorRegion(), static_cast<int>(getDetectorRegion(theta)));
35
36 //Check ECLCluster
37 myECLCluster.setTheta(theta);
38 EXPECT_EQ(myECLCluster.getDetectorRegion(), static_cast<int>(getDetectorRegion(theta)));
39 }
40
41 } // Testcases for Something

◆ TEST_F() [1/14]

TEST_F ( ECLCalDigitTest  ,
Constructors   
)

Test Constructors.

Definition at line 25 of file eclCalDigit.cc.

26 {
27 ECLCalDigit myECLCalDigit;
28 EXPECT_EQ(myECLCalDigit.getCellId(), 0);
29 EXPECT_EQ(myECLCalDigit.getEnergy(), 0);
30 EXPECT_EQ(myECLCalDigit.getTime(), 0);
31 EXPECT_EQ(myECLCalDigit.getTimeResolution(), 0);
32 } // Testcases for Constructors

◆ TEST_F() [2/14]

TEST_F ( ECLCalDigitTest  ,
SettersAndGetters   
)

Test Setters and Getter.

Definition at line 35 of file eclCalDigit.cc.

36 {
37 const int cellId = 1;
38 const double energy = 2.1;
39 const double time = 2.2;
40 const double timeres = 2.3;
41
42 ECLCalDigit myECLCalDigit;
43 myECLCalDigit.setCellId(cellId);
44 myECLCalDigit.setEnergy(energy);
45 myECLCalDigit.setTime(time);
46 myECLCalDigit.setTimeResolution(timeres);
47
48 EXPECT_EQ(myECLCalDigit.getCellId(), cellId);
49 EXPECT_EQ(myECLCalDigit.getEnergy(), energy);
50 EXPECT_EQ(myECLCalDigit.getTime(), time);
51 EXPECT_EQ(myECLCalDigit.getTimeResolution(), timeres);
52 } // Testcases for Setters and Getters

◆ TEST_F() [3/14]

TEST_F ( ECLChargedPIDTest  ,
ECLPidLikelihoodSettersAndGetters   
)

Test ECLPidLikelihood setters and getters.

Definition at line 56 of file eclChargedPID.cc.

57 {
58
59 StoreArray<ECLPidLikelihood> ecl_likelihoods;
60
61 auto* lk = ecl_likelihoods.appendNew();
62
63 lk->setLogLikelihood(Const::electron, 0.12);
64 lk->setLogLikelihood(Const::muon, 0.58);
65 lk->setLogLikelihood(Const::pion, 0.28);
66 lk->setLogLikelihood(Const::kaon, 0.38);
67 lk->setLogLikelihood(Const::proton, 0.48);
68
69 EXPECT_FLOAT_EQ(lk->getLogLikelihood(Const::electron), 0.12);
70 EXPECT_FLOAT_EQ(lk->getLogLikelihood(Const::muon), 0.58);
71 EXPECT_FLOAT_EQ(lk->getLogLikelihood(Const::pion), 0.28);
72 EXPECT_FLOAT_EQ(lk->getLogLikelihood(Const::kaon), 0.38);
73 EXPECT_FLOAT_EQ(lk->getLogLikelihood(Const::proton), 0.48);
74
75 } // Testcases for ECLPidLikelihood setters and getters.

◆ TEST_F() [4/14]

TEST_F ( ECLChargedPIDTest  ,
TestECLPdfs   
)

Test ECL PDFs.

Check separately +/- charge hypotheses.

Definition at line 78 of file eclChargedPID.cc.

79 {
80
81 ECLChargedPidPDFs eclPdfs;
82
83 float pmin_vals[] = {0.2, 0.6, 1.0, 100.0};
84 float thetamin_vals[] = {0.21, 0.56, 2.24, 2.70};
85
86 TH2F histgrid("binsgrid",
87 "bins grid",
88 sizeof(thetamin_vals) / sizeof(float) - 1,
89 thetamin_vals,
90 sizeof(pmin_vals) / sizeof(float) - 1,
91 pmin_vals);
92
93 eclPdfs.setEnergyUnit(Unit::GeV);
94 eclPdfs.setAngularUnit(Unit::rad);
95
96 eclPdfs.setPdfCategories(&histgrid);
97
98 // Create a set of fictitious (normalised) PDFs of E/p, for various signed particle hypotheses.
99 // The first element in the pair is the true charge.
100
101 typedef std::pair<int, TF1> pdfSet;
102
103 pdfSet pdf_el = std::make_pair(-1, TF1("pdf_el", "TMath::Gaus(x, 1.0, 0.2, true)", 0.0, 1.3));
104 pdfSet pdf_elanti = std::make_pair(1, TF1("pdf_elanti", "TMath::Gaus(x, 0.9, 0.2, true)", 0.0, 1.2));
105
106 pdfSet pdf_mu = std::make_pair(-1, TF1("pdf_mu", "TMath::Gaus(x, 0.3, 0.2, true)", 0.0, 1.0));
107 pdfSet pdf_muanti = std::make_pair(1, TF1("pdf_muanti", "TMath::Gaus(x, 0.35, 0.22, true)", 0.0, 1.0));
108
109 pdfSet pdf_pi = std::make_pair(1, TF1("pdf_pi", "TMath::Gaus(x, 0.4, 0.1, true)", 0.0, 1.0));
110 pdfSet pdf_pianti = std::make_pair(-1, TF1("pdf_pianti", "TMath::Gaus(x, 0.38, 0.15, true)", 0.0, 1.0));
111
112 pdfSet pdf_k = std::make_pair(1, TF1("pdf_k", "TMath::Gaus(x, 0.38, 0.2, true)", 0.0, 1.0));
113 pdfSet pdf_kanti = std::make_pair(-1, TF1("pdf_kanti", "TMath::Gaus(x, 0.5, 0.22, true)", 0.0, 1.0));
114
115 pdfSet pdf_p = std::make_pair(1, TF1("pdf_p", "TMath::Gaus(x, 1.0, 0.4, true)", 0.0, 1.6));
116 pdfSet pdf_panti = std::make_pair(-1, TF1("pdf_panti", "TMath::Gaus(x, 1.3, 0.5, true)", 0.0, 2.0));
117
118 pdfSet pdf_d = std::make_pair(1, TF1("pdf_d", "TMath::Gaus(x, 1.1, 0.45, true)", 0.0, 1.6));
119 pdfSet pdf_danti = std::make_pair(-1, TF1("pdf_danti", "TMath::Gaus(x, 1.2, 0.6, true)", 0.0, 2.0));
120
121 std::map<unsigned int, std::vector<pdfSet>> pdfs = {
122 {Const::electron.getPDGCode(), std::vector<pdfSet>{pdf_el, pdf_elanti}},
123 {Const::muon.getPDGCode(), std::vector<pdfSet>{pdf_mu, pdf_muanti}},
124 {Const::pion.getPDGCode(), std::vector<pdfSet>{pdf_pi, pdf_pianti}},
125 {Const::kaon.getPDGCode(), std::vector<pdfSet>{pdf_k, pdf_kanti}},
126 {Const::proton.getPDGCode(), std::vector<pdfSet>{pdf_p, pdf_panti}},
127 {Const::deuteron.getPDGCode(), std::vector<pdfSet>{pdf_d, pdf_danti}},
128 };
129
130 // E/p is the only variable considered in the test.
131 std::vector<ECLChargedPidPDFs::InputVar> varids = {ECLChargedPidPDFs::InputVar::c_EoP};
132
133 // Fill the DB PDF map.
134 // (Use the same PDF for all (clusterTheta, p) bins for simplicity).
135 for (auto& [pdg, pdf_setlist] : pdfs) {
136 for (auto& pdf_set : pdf_setlist) {
137 for (int ip(1); ip <= histgrid.GetNbinsY(); ++ip) {
138 for (int jth(1); jth <= histgrid.GetNbinsX(); ++jth) {
139 for (const auto& varid : varids) {
140 eclPdfs.add(pdg, pdf_set.first, ip, jth, varid, &pdf_set.second);
141 }
142 }
143 }
144 }
145 }
146
147 // Store the value of the PDFs in here, and pass it to the ECLPidLikelihood object later on.
148 float likelihoods_plus[Const::ChargedStable::c_SetSize];
149 float likelihoods_minus[Const::ChargedStable::c_SetSize];
150
151 // Choose an arbitrary set of (clusterTheta, p), and of E/p.
152 double clusterTheta = 1.047; // (X) --> clusterTheta [rad] = 60 [deg]
153 double p = 0.85; // (Y) --> P [GeV] = 850 [MeV]
154 double eop = 0.87;
155
156 // Now read the PDFs.
157 for (const auto& [pdg, pdf_setlist] : pdfs) {
158 for (const auto& pdf_set : pdf_setlist) {
159 float pdfval = eclPdfs.getPdf(pdg, pdf_set.first, p, clusterTheta, varids.at(0))->Eval(eop);
160 EXPECT_NEAR(pdf_set.second.Eval(eop), pdfval, 0.001);
161 if (pdf_set.first < 0) {
162 likelihoods_minus[Const::chargedStableSet.find(pdg).getIndex()] = log(pdfval);
163 } else {
164 likelihoods_plus[Const::chargedStableSet.find(pdg).getIndex()] = log(pdfval);
165 }
166 }
167 }
168
169 // Set the ECL likelihood dataobjects
170 StoreArray<ECLPidLikelihood> ecl_likelihoods_minus;
171 const auto* lk_minus = ecl_likelihoods_minus.appendNew(likelihoods_minus);
172 StoreArray<ECLPidLikelihood> ecl_likelihoods_plus;
173 const auto* lk_plus = ecl_likelihoods_plus.appendNew(likelihoods_plus);
174
175 for (const auto& [pdg, pdf_setlist] : pdfs) {
176 for (const auto& pdf_set : pdf_setlist) {
177 float logl;
178 float logl_expect = log(pdf_set.second.Eval(eop));
179 if (pdf_set.first < 0) {
180 logl = lk_minus->getLogLikelihood(Const::chargedStableSet.find(pdg));
181 } else {
182 logl = lk_plus->getLogLikelihood(Const::chargedStableSet.find(pdg));
183 }
184 EXPECT_NEAR(logl_expect, logl, 0.01);
185 }
186 }
187
188 } // Testcases for ECL PDFs.

◆ TEST_F() [5/14]

TEST_F ( ECLDigitTest  ,
Constructors   
)

Test Constructors.

Definition at line 25 of file eclDigit.cc.

26 {
27 ECLDigit myECLDigit;
28 EXPECT_EQ(myECLDigit.getCellId(), 0);
29 EXPECT_EQ(myECLDigit.getAmp(), 0);
30 EXPECT_EQ(myECLDigit.getTimeFit(), 0);
31 EXPECT_EQ(myECLDigit.getQuality(), 0);
32 } // Testcases for Constructors

◆ TEST_F() [6/14]

TEST_F ( ECLDigitTest  ,
SettersAndGetters   
)

Test Setters and Getter.

Definition at line 35 of file eclDigit.cc.

36 {
37 const int cellId = 1;
38 const int amp = 1;
39 const int timeFit = 1;
40 const int quality = 1;
41
42 ECLDigit myECLDigit;
43 myECLDigit.setCellId(cellId);
44 myECLDigit.setAmp(amp);
45 myECLDigit.setTimeFit(timeFit);
46 myECLDigit.setQuality(quality);
47 EXPECT_EQ(myECLDigit.getCellId(), cellId);
48 EXPECT_EQ(myECLDigit.getAmp(), amp);
49 EXPECT_EQ(myECLDigit.getTimeFit(), timeFit);
50 EXPECT_EQ(myECLDigit.getQuality(), quality);
51 } // Testcases for Setters and Getters

◆ TEST_F() [7/14]

TEST_F ( ECLHitAssignmentTest  ,
Constructors   
)

Test Constructors.

Definition at line 25 of file eclHitAssignment.cc.

26 {
27 ECLHitAssignment myECLHitAssignment;
28 EXPECT_EQ(myECLHitAssignment.getShowerId(), 0);
29 EXPECT_EQ(myECLHitAssignment.getCellId(), 0);
30 const int showerId = 1;
31 const int cellId = 2;
32 ECLHitAssignment myECLHitAssignment2(showerId, cellId);
33 EXPECT_EQ(myECLHitAssignment2.getShowerId(), showerId);
34 EXPECT_EQ(myECLHitAssignment2.getCellId(), cellId);
35 } // Testcases for Something

◆ TEST_F() [8/14]

TEST_F ( ECLHitAssignmentTest  ,
SettersAndGetters   
)

Test Setters and Getter.

Definition at line 38 of file eclHitAssignment.cc.

39 {
40 const int showerId = 1;
41 const int cellId = 2;
42 ECLHitAssignment myECLHitAssignment;
43 myECLHitAssignment.setShowerId(showerId);
44 myECLHitAssignment.setCellId(cellId);
45 EXPECT_EQ(myECLHitAssignment.getShowerId(), showerId);
46 EXPECT_EQ(myECLHitAssignment.getCellId(), cellId);
47 } // Testcases for Setters and Getters

◆ TEST_F() [9/14]

TEST_F ( ECLHitTest  ,
Constructors   
)

Test Constructors.

Definition at line 25 of file eclHit.cc.

26 {
27 ECLHit myHit;
28 EXPECT_EQ(myHit.getCellId(), 0);
29 EXPECT_EQ(myHit.getEnergyDep(), 0);
30 EXPECT_EQ(myHit.getTimeAve(), 0);
31
32 const int cellId = 1;
33 const float edep = 1.234;
34 const float timeAve = 4.321;
35 ECLHit myHit2(cellId, edep, timeAve);
36 EXPECT_EQ(myHit2.getCellId(), cellId);
37 EXPECT_EQ(myHit2.getEnergyDep(), edep);
38 EXPECT_EQ(myHit2.getTimeAve(), timeAve);
39 } // Testcases for Something

◆ TEST_F() [10/14]

TEST_F ( ECLHitTest  ,
SettersAndGetters   
)

Test Setters and Getters.

Definition at line 42 of file eclHit.cc.

43 {
44 const int cellId = 1;
45 const float edep = 1.234;
46 const float timeAve = 4.321;
47 const float deltaTimeShift = 2.5;
48 ECLHit myHit;
49 myHit.setCellId(cellId);
50 myHit.setEnergyDep(edep);
51 myHit.setTimeAve(timeAve);
52 EXPECT_EQ(myHit.getCellId(), cellId);
53 EXPECT_EQ(myHit.getEnergyDep(), edep);
54 EXPECT_EQ(myHit.getTimeAve(), timeAve);
55 myHit.shiftInTime(deltaTimeShift);
56 EXPECT_EQ(myHit.getTimeAve(), timeAve + deltaTimeShift);
57
58 } // Testcases for Setters and Getters

◆ TEST_F() [11/14]

TEST_F ( ECLShowerTest  ,
Constructors   
)

Test Constructors.

Definition at line 28 of file eclShower.cc.

29 {
30 ECLShower myECLShower;
31 EXPECT_EQ(myECLShower.getIsTrack(), 0);
32
33 EXPECT_EQ(myECLShower.getStatus(), 0);
34 EXPECT_EQ(myECLShower.getShowerId(), 0);
35 EXPECT_EQ(myECLShower.getConnectedRegionId(), 0);
36 EXPECT_EQ(myECLShower.getHypothesisId(), 0);
37 EXPECT_EQ(myECLShower.getEnergy(), 0);
38 EXPECT_EQ(myECLShower.getTheta(), 0);
39 EXPECT_EQ(myECLShower.getPhi(), 0);
40 EXPECT_EQ(myECLShower.getR(), 0);
41 EXPECT_EQ(myECLShower.getUncertaintyEnergy(), 0);
42 EXPECT_EQ(myECLShower.getUncertaintyTheta(), 0);
43 EXPECT_EQ(myECLShower.getUncertaintyPhi(), 0);
44 EXPECT_EQ(myECLShower.getTime(), 0);
45 EXPECT_EQ(myECLShower.getDeltaTime99(), 0);
46 EXPECT_EQ(myECLShower.getEnergyHighestCrystal(), 0);
47 EXPECT_EQ(myECLShower.getLateralEnergy(), 0);
48 EXPECT_EQ(myECLShower.getMinTrkDistance(), 0);
49 EXPECT_EQ(myECLShower.getTrkDepth(), 0);
50 EXPECT_EQ(myECLShower.getShowerDepth(), 0);
51 EXPECT_EQ(myECLShower.getNumberOfCrystals(), 0);
52 EXPECT_EQ(myECLShower.getAbsZernikeMoment(4, 0), 0);
53 EXPECT_EQ(myECLShower.getAbsZernikeMoment(5, 1), 0);
54 EXPECT_EQ(myECLShower.getZernikeMVA(), 0);
55 EXPECT_EQ(myECLShower.getSecondMoment(), 0);
56 EXPECT_EQ(myECLShower.getE1oE9(), 0);
57 EXPECT_EQ(myECLShower.getE9oE21(), 0);
58
59 double errorArray[6];
60 myECLShower.getCovarianceMatrixAsArray(errorArray);
61 EXPECT_EQ(errorArray[0], 0);
62 EXPECT_EQ(errorArray[1], 0);
63 EXPECT_EQ(errorArray[2], 0);
64 EXPECT_EQ(errorArray[3], 0);
65 EXPECT_EQ(errorArray[4], 0);
66 EXPECT_EQ(errorArray[5], 0);
67
68 ROOT::Math::XYZVector momentum(myECLShower.getMomentum());
69 EXPECT_EQ(momentum.X(), 0);
70 EXPECT_EQ(momentum.Y(), 0);
71 EXPECT_EQ(momentum.Z(), 0);
72 } // Testcases for Something

◆ TEST_F() [12/14]

TEST_F ( ECLShowerTest  ,
SettersAndGetters   
)

Test Setters and Getter.

Definition at line 75 of file eclShower.cc.

76 {
77 const bool isTrk = true;
78
79 const int status = 5;
80 const int showerId = 6;
81 const int connectedRegionId = 7;
82 const int hypothesisId = 8;
83
84 const double energy = 1.1;
85 const double theta = 1.2;
86 const double phi = 1.3;
87 const double r = 1.4;
88 double error[6] = {2.1, 2.2, 2.3, 2.4, 2.5, 2.6};
89 const double time = 1.5;
90 const double timeResolution = 1.6;
91 const double highestEnergy = 1.7;
92 const double lateralEnergy = 1.8;
93 const double minTrkDistance = 1.9;
94 const double trkDepth = 4.1;
95 const double showerDepth = 3.1;
96 const double NofCrystals = 3.2;
97 const double absZernike40 = 1.1;
98 const double absZernike51 = 0.1;
99 const double zernikeMVA = 0.5;
100 const double secondMoment = 5.1;
101 const double E1oE9 = 3.8;
102 const double E9oE21 = 3.9;
103
104 ECLShower myECLShower;
105 myECLShower.setIsTrack(isTrk);
106 myECLShower.setStatus(status);
107 myECLShower.setShowerId(showerId);
108 myECLShower.setConnectedRegionId(connectedRegionId);
109 myECLShower.setHypothesisId(hypothesisId);
110 myECLShower.setEnergy(energy);
111 myECLShower.setTheta(theta);
112 myECLShower.setPhi(phi);
113 myECLShower.setR(r);
114 myECLShower.setCovarianceMatrix(error);
115 myECLShower.setTime(time);
116 myECLShower.setDeltaTime99(timeResolution);
117 myECLShower.setEnergyHighestCrystal(highestEnergy);
118 myECLShower.setLateralEnergy(lateralEnergy);
119 myECLShower.setMinTrkDistance(minTrkDistance);
120 myECLShower.setTrkDepth(trkDepth);
121 myECLShower.setShowerDepth(showerDepth);
122 myECLShower.setNumberOfCrystals(NofCrystals);
123 myECLShower.setAbsZernikeMoment(4, 0, absZernike40);
124 myECLShower.setAbsZernikeMoment(5, 1, absZernike51);
125 myECLShower.setZernikeMVA(zernikeMVA);
126 myECLShower.setSecondMoment(secondMoment);
127 myECLShower.setE1oE9(E1oE9);
128 myECLShower.setE9oE21(E9oE21);
129
130 EXPECT_EQ(myECLShower.getIsTrack(), isTrk);
131 EXPECT_EQ(myECLShower.getStatus(), status);
132 EXPECT_EQ(myECLShower.getShowerId(), showerId);
133 EXPECT_EQ(myECLShower.getConnectedRegionId(), connectedRegionId);
134 EXPECT_EQ(myECLShower.getHypothesisId(), hypothesisId);
135 EXPECT_EQ(myECLShower.getEnergy(), energy);
136 EXPECT_EQ(myECLShower.getTheta(), theta);
137 EXPECT_EQ(myECLShower.getPhi(), phi);
138 EXPECT_EQ(myECLShower.getUncertaintyEnergy(), sqrt(error[0]));
139 EXPECT_EQ(myECLShower.getUncertaintyTheta(), sqrt(error[5]));
140 EXPECT_EQ(myECLShower.getUncertaintyPhi(), sqrt(error[2]));
141 EXPECT_EQ(myECLShower.getTime(), time);
142 EXPECT_EQ(myECLShower.getDeltaTime99(), timeResolution);
143 EXPECT_EQ(myECLShower.getEnergyHighestCrystal(), highestEnergy);
144 EXPECT_EQ(myECLShower.getLateralEnergy(), lateralEnergy);
145 EXPECT_EQ(myECLShower.getMinTrkDistance(), minTrkDistance);
146 EXPECT_EQ(myECLShower.getTrkDepth(), trkDepth);
147 EXPECT_EQ(myECLShower.getShowerDepth(), showerDepth);
148 EXPECT_EQ(myECLShower.getMinTrkDistance(), minTrkDistance);
149 EXPECT_EQ(myECLShower.getTrkDepth(), trkDepth);
150 EXPECT_EQ(myECLShower.getNumberOfCrystals(), NofCrystals);
151 EXPECT_EQ(myECLShower.getAbsZernikeMoment(4, 0), absZernike40);
152 EXPECT_EQ(myECLShower.getAbsZernikeMoment(5, 1), absZernike51);
153 EXPECT_EQ(myECLShower.getZernikeMVA(), zernikeMVA);
154 EXPECT_EQ(myECLShower.getSecondMoment(), secondMoment);
155 EXPECT_EQ(myECLShower.getE1oE9(), E1oE9);
156 EXPECT_EQ(myECLShower.getE9oE21(), E9oE21);
157
158
159 double errorArray[6];
160 myECLShower.getCovarianceMatrixAsArray(errorArray);
161 EXPECT_EQ(errorArray[0], error[0]);
162 EXPECT_EQ(errorArray[1], error[1]);
163 EXPECT_EQ(errorArray[2], error[2]);
164 EXPECT_EQ(errorArray[3], error[3]);
165 EXPECT_EQ(errorArray[4], error[4]);
166 EXPECT_EQ(errorArray[5], error[5]);
167
168 ROOT::Math::XYZVector momentum(myECLShower.getMomentum());
169 EXPECT_FLOAT_EQ(momentum.X(), energy * sin(theta) * cos(phi));
170 EXPECT_FLOAT_EQ(momentum.Y(), energy * sin(theta) * sin(phi));
171 EXPECT_FLOAT_EQ(momentum.Z(), energy * cos(theta));
172 } // Testcases for Setters and Getters
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28

◆ TEST_F() [13/14]

TEST_F ( ECLSimHitTest  ,
Constructors   
)

Test Constructors.

Definition at line 25 of file eclSimHit.cc.

26 {
27 ECLSimHit myECLSimHit;
28 EXPECT_EQ(myECLSimHit.getCellId(), 0);
29 EXPECT_EQ(myECLSimHit.getTrackId(), 0);
30 EXPECT_EQ(myECLSimHit.getPDGCode(), 0);
31 EXPECT_EQ(myECLSimHit.getFlightTime(), 0);
32 EXPECT_EQ(myECLSimHit.getEnergyDep(), 0);
33 const auto momentum = myECLSimHit.getMomentum();
34 EXPECT_EQ(momentum.x(), 0);
35 EXPECT_EQ(momentum.y(), 0);
36 EXPECT_EQ(momentum.z(), 0);
37 const auto position = myECLSimHit.getPosition();
38 EXPECT_EQ(position.x(), 0);
39 EXPECT_EQ(position.y(), 0);
40 EXPECT_EQ(position.z(), 0);
41
42 const int cellId = 1;
43 const int trackId = 2;
44 const int pdg = 3;
45 const float flightTime = 4.1;
46 const float edep = 4.2;
47 const G4ThreeVector init_momentum(1, 2, 3);
48 const G4ThreeVector init_position(4, 5, 6);
49 ECLSimHit myECLSimHit2(cellId, trackId, pdg, flightTime, edep, init_momentum, init_position, 0);
50 EXPECT_EQ(myECLSimHit2.getCellId(), cellId);
51 EXPECT_EQ(myECLSimHit2.getTrackId(), trackId);
52 EXPECT_EQ(myECLSimHit2.getPDGCode(), pdg);
53 EXPECT_EQ(myECLSimHit2.getFlightTime(), flightTime);
54 EXPECT_EQ(myECLSimHit2.getEnergyDep(), edep);
55 const auto momentum2 = myECLSimHit2.getMomentum();
56 EXPECT_EQ(momentum2.x(), init_momentum.x());
57 EXPECT_EQ(momentum2.y(), init_momentum.y());
58 EXPECT_EQ(momentum2.z(), init_momentum.z());
59 const auto position2 = myECLSimHit2.getPosition();
60 EXPECT_EQ(position2.x(), init_position.x());
61 EXPECT_EQ(position2.y(), init_position.y());
62 EXPECT_EQ(position2.z(), init_position.z());
63
64 } // Testcases for Something

◆ TEST_F() [14/14]

TEST_F ( ECLSimHitTest  ,
SettersAndGetters   
)

Test Setters and Getters.

Definition at line 68 of file eclSimHit.cc.

69 {
70 const int cellId = 1;
71 const int trackId = 2;
72 const int pdg = 3;
73 const float flightTime = 4.1;
74 const float edep = 4.2;
75 const G4ThreeVector init_momentum(1, 2, 3);
76 const G4ThreeVector init_position(4, 5, 6);
77 ECLSimHit myECLSimHit;
78 myECLSimHit.setCellId(cellId);
79 myECLSimHit.setTrackId(trackId);
80 myECLSimHit.setPDGCode(pdg);
81 myECLSimHit.setFlightTime(flightTime);
82 myECLSimHit.setEnergyDep(edep);
83 myECLSimHit.setPosition(init_position);
84 myECLSimHit.setMomentum(init_momentum);
85
86 EXPECT_EQ(myECLSimHit.getCellId(), cellId);
87 EXPECT_EQ(myECLSimHit.getTrackId(), trackId);
88 EXPECT_EQ(myECLSimHit.getPDGCode(), pdg);
89 EXPECT_EQ(myECLSimHit.getFlightTime(), flightTime);
90 EXPECT_EQ(myECLSimHit.getEnergyDep(), edep);
91 const auto momentum = myECLSimHit.getMomentum();
92 EXPECT_EQ(momentum.x(), init_momentum.x());
93 EXPECT_EQ(momentum.y(), init_momentum.y());
94 EXPECT_EQ(momentum.z(), init_momentum.z());
95 const auto position = myECLSimHit.getPosition();
96 EXPECT_EQ(position.x(), init_position.x());
97 EXPECT_EQ(position.y(), init_position.y());
98 EXPECT_EQ(position.z(), init_position.z());
99
100 } // Testcases for Setters and Getters