Belle II Software  release-05-01-25
Collaboration diagram for ecl:

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  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  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 Corrections produced by Claudia Cecchi (claud.nosp@m.ia.c.nosp@m.ecchi.nosp@m.@pg..nosp@m.infn..nosp@m.it) Elisa Manoni (elisa.nosp@m..man.nosp@m.oni@p.nosp@m.g.in.nosp@m.fn.it) This is a temperary 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...
 
class  EnableECLCalDigitVariablesModule
 

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. More...
 
 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.
 
 REG_MODULE (EnableECLCalDigitVariables)
 register the empty module
 

Detailed Description

Function Documentation

◆ TEST_F()

Belle2::TEST_F ( ECLChargedPIDTest  ,
TestECLPdfs   
)

Test ECL PDFs.

Check separately +/- charge hypotheses.

Definition at line 71 of file eclChargedPID.cc.

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