Belle II Software  release-08-01-10
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  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 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...
 

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.
 

Detailed Description

Function Documentation

◆ TEST_F()

Belle2::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.