Belle II Software  release-08-01-10
YScanner Class Reference

Utility for expanding the PDF in y direction. More...

#include <YScanner.h>

Inheritance diagram for YScanner:
Collaboration diagram for YScanner:

Classes

struct  Derivatives
 Derivatives. More...
 
struct  PixelProjection
 Down-stream projection of a pixel to prism entrance window w/ a clip on bar exit thickness. More...
 
struct  Result
 Single PDF peak data. More...
 
struct  Table
 A table of equidistant entries. More...
 
struct  TableEntry
 Table entry. More...
 

Public Types

enum  EGeometry {
  c_Unified = 0 ,
  c_Segmented = 1
}
 Treatement of quartz geometry. More...
 
enum  EOptics {
  c_SemiLinear = 0 ,
  c_Exact = 1
}
 Treatement of spherical mirror optics. More...
 

Public Member Functions

 YScanner (int moduleID, unsigned N=64)
 Class constructor. More...
 
void clear () const
 Clear mutable variables.
 
void prepare (double momentum, double beta, double length) const
 Prepare for the PDF expansion in y for a given track mass hypothesis. More...
 
bool isAboveThreshold () const
 Returns above Cerenkov threshold flag which is set in the prepare method. More...
 
void expand (unsigned col, double yB, double dydz, const Derivatives &D, int Ny, bool doScan) const
 Performs the PDF expansion in y for a given pixel column using scan or merge methods. More...
 
const PixelPositionsgetPixelPositions () const
 Returns pixel positions and their sizes. More...
 
const PixelMasksgetPixelMasks () const
 Returns pixel masks. More...
 
const PixelEfficienciesgetPixelEfficiencies () const
 Returns pixel relative efficiencies. More...
 
const TablegetEfficiencies () const
 Returns nominal photon detection efficiencies (PDE) More...
 
double getCosTotal () const
 Returns cosine of total reflection angle. More...
 
double getMomentum () const
 Returns particle momentum. More...
 
double getBeta () const
 Returns particle beta. More...
 
double getTrackLengthInQuartz () const
 Returns particle trajectory lenght inside quartz. More...
 
double getNumPhotonsPerLen () const
 Returns number of photons per Cerenkov azimuthal angle per track length. More...
 
double getNumPhotons () const
 Returns number of photons per Cerenkov azimuthal angle. More...
 
double getMeanEnergy () const
 Returns mean photon energy. More...
 
double getRMSEnergy () const
 Returns r.m.s of photon energy. More...
 
double getMeanEnergyBeta1 () const
 Returns mean photon energy for beta = 1. More...
 
double getRMSEnergyBeta1 () const
 Returns r.m.s of photon energy for beta = 1. More...
 
double getSigmaScattering () const
 Returns r.m.s of multiple scattering angle in quartz converted to photon energy. More...
 
double getSigmaAlpha () const
 Returns surface roughness parameter in units of photon energy. More...
 
const TablegetEnergyDistribution () const
 Returns photon energy distribution. More...
 
const std::map< int, TablegetQuasyEnergyDistributions () const
 Returns photon energy distributions convoluted with multiple scattering and surface roughness. More...
 
const std::vector< Result > & getResults () const
 Returns the results of PDF expansion in y. More...
 
bool isScanDone () const
 Checks which expansion method was used. More...
 
int getModuleID () const
 Returns slot ID. More...
 
EGeometry getGeometry () const
 Returns quartz geometry treatement. More...
 
EOptics getOptics () const
 Returns treatement of spherical mirror optics. More...
 
const std::vector< BarSegment > & getBars () const
 Returns geometry data of bar segments. More...
 
const MirrorgetMirror () const
 Returns geometry data of spherical mirror. More...
 
const PrismgetPrism () const
 Returns geometry data of prism. More...
 
void setMirrorCenter (double xc, double yc)
 Sets the mirror center-of-curvature. More...
 

Static Public Member Functions

static void setScanLimits (int maxReflections)
 Sets parameters for selection between expand methods. More...
 

Protected Attributes

int m_moduleID = 0
 slot ID
 
EGeometry m_geometry = c_Unified
 quartz geometry
 
EOptics m_optics = c_SemiLinear
 spherical mirror optics
 
std::vector< BarSegmentm_bars
 geometry data of bar segments
 
Mirror m_mirror
 spherical mirror geometry data
 
Prism m_prism
 prism geometry data
 

Private Member Functions

double setEnergyDistribution (double beta) const
 Sets photon energy distribution and mean photon energy according to nominal PDE and particle beta. More...
 
void setQuasyEnergyDistribution (double sigma) const
 Sets photon energy distribution convoluted with a normalized Gaussian. More...
 
void integrate (const EnergyMask *energyMask, double Ecp, Result &result) const
 Integrates quasy energy distribution multiplied with energy mask. More...
 
double prismEntranceY (double y, int k, double dydz) const
 Calculates y at prism entrance from detection position, reflection number and photon slope. More...
 
void projectPixel (double yc, double size, int k, double dydz, PixelProjection &proj) const
 Calculates a projection of a pixel to prism entrance window (going down-stream the photon). More...
 
void scan (unsigned col, double yB, double dydz, const Derivatives &D, int j1, int j2) const
 Performs expansion w/ the scan over reflections. More...
 
void merge (unsigned col, double dydz, int j1, int j2) const
 Performs expansion by merging all reflections. More...
 
PixelMaskspixelMasks ()
 Returns non-const pixel masks. More...
 
PixelEfficienciespixelEfficiencies ()
 Returns non-const pixel relative efficiencies. More...
 

Private Attributes

PixelPositions m_pixelPositions
 positions and sizes of pixels
 
PixelMasks m_pixelMasks
 pixel masks
 
PixelEfficiencies m_pixelEfficiencies
 pixel relative efficiencies
 
Table m_efficiency
 nominal photon detection efficiencies (PDE)
 
double m_meanE0 = 0
 mean photon energy for beta = 1
 
double m_rmsE0 = 0
 r.m.s of photon energy for beta = 1
 
double m_cosTotal = 0
 cosine of total reflection angle
 
double m_momentum = 0
 particle momentum magnitude
 
double m_beta = 0
 particle beta
 
double m_length = 0
 length of particle trajectory inside quartz
 
double m_numPhotons = 0
 number of photons per Cerenkov azimuthal angle per track length
 
double m_meanE = 0
 mean photon energy
 
double m_rmsE = 0
 r.m.s of photon energy
 
double m_sigmaScat = 0
 r.m.s. More...
 
double m_sigmaAlpha = 0
 surface roughness parameter in photon energy units
 
Table m_energyDistribution
 photon energy distribution
 
std::map< int, Tablem_quasyEnergyDistributions
 photon energy distributions convoluted with Gaussian of different widths
 
Tablem_quasyEnergyDistribution = nullptr
 a pointer to the element in m_quasyEnergyDistributions
 
bool m_aboveThreshold = false
 true if beta is above the Cerenkov threshold
 
std::vector< Resultm_results
 results of PDF expansion in y
 
bool m_scanDone = false
 true if scan performed, false if reflections just merged
 

Static Private Attributes

static int s_maxReflections = 16
 maximal number of reflections to perform scan
 

Friends

class TOPRecoManager
 

Detailed Description

Utility for expanding the PDF in y direction.

Definition at line 33 of file YScanner.h.

Member Enumeration Documentation

◆ EGeometry

enum EGeometry
inherited

Treatement of quartz geometry.

Enumerator
c_Unified 

single bar with average width and thickness

c_Segmented 

segmented bars

Definition at line 33 of file RaytracerBase.h.

◆ EOptics

enum EOptics
inherited

Treatement of spherical mirror optics.

Enumerator
c_SemiLinear 

semi-linear approximation

c_Exact 

exact optics

Definition at line 41 of file RaytracerBase.h.

Constructor & Destructor Documentation

◆ YScanner()

YScanner ( int  moduleID,
unsigned  N = 64 
)
explicit

Class constructor.

Sets pixel positions of a given module and nominal photon detection efficiency.

Parameters
moduleIDslot ID
Nsize of nominal photon detection efficiency table

Definition at line 47 of file YScanner.cc.

47  : RaytracerBase(moduleID, c_Unified, c_SemiLinear),
48  m_pixelPositions(PixelPositions(moduleID)),
49  m_pixelMasks(PixelMasks(moduleID)),
50  m_pixelEfficiencies(PixelEfficiencies(moduleID))
51  {
52  if (N < 2) {
53  B2FATAL("TOP::YScanner: N must be > 1");
54  return;
55  }
56 
57  // set the table of nominal photon detection efficiencies (incl. wavelength filter)
58 
59  const auto* topgp = TOPGeometryPar::Instance();
60  const auto* geo = topgp->getGeometry();
61  auto qe = geo->getNominalQE(); // get a copy
62  qe.applyFilterTransmission(geo->getWavelengthFilter());
63 
64  double minE = TOPGeometryPar::c_hc / qe.getMaxLambda();
65  double maxE = TOPGeometryPar::c_hc / qe.getMinLambda();
66  if (minE >= maxE) {
67  B2FATAL("TOP::YScanner: quantum efficiency found zero for all wavelengths");
68  return;
69  }
70  m_efficiency.set(minE, (maxE - minE) / (N - 1));
71 
72  const auto& tdc = geo->getNominalTDC();
73  for (unsigned i = 0; i < N; i++) {
74  double e = m_efficiency.getX(i);
75  double lambda = TOPGeometryPar::c_hc / e;
76  double effi = qe.getEfficiency(lambda) * tdc.getEfficiency();
77  m_efficiency.entries.push_back(TableEntry(effi, e, e * e));
78  }
79 
80  // set cosine of total reflection angle using photon mean energy for beta = 1
81 
82  double s = 0;
83  double se = 0;
84  double see = 0;
85  for (const auto& entry : m_efficiency.entries) {
86  double e = entry.x;
87  double p = entry.y * (1 - 1 / pow(topgp->getPhaseIndex(e), 2));
88  s += p;
89  se += p * e;
90  see += p * e * e;
91  }
92  if (s == 0) return;
93  m_meanE0 = se / s;
94  m_rmsE0 = sqrt(see / s - m_meanE0 * m_meanE0);
95  m_cosTotal = sqrt(1 - 1 / pow(topgp->getPhaseIndex(m_meanE0), 2));
96  }
@ c_Unified
single bar with average width and thickness
Definition: RaytracerBase.h:34
@ c_SemiLinear
semi-linear approximation
Definition: RaytracerBase.h:42
RaytracerBase(int moduleID, EGeometry geometry=c_Unified, EOptics optics=c_SemiLinear)
Constructor.
static TOPGeometryPar * Instance()
Static method to obtain the pointer to its instance.
static const double c_hc
Planck constant times speed of light in [eV*nm].
double m_cosTotal
cosine of total reflection angle
Definition: YScanner.h:468
PixelEfficiencies m_pixelEfficiencies
pixel relative efficiencies
Definition: YScanner.h:464
Table m_efficiency
nominal photon detection efficiencies (PDE)
Definition: YScanner.h:465
double m_meanE0
mean photon energy for beta = 1
Definition: YScanner.h:466
PixelMasks m_pixelMasks
pixel masks
Definition: YScanner.h:463
double m_rmsE0
r.m.s of photon energy for beta = 1
Definition: YScanner.h:467
PixelPositions m_pixelPositions
positions and sizes of pixels
Definition: YScanner.h:462
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28
std::vector< TableEntry > entries
table entries
Definition: YScanner.h:121
double getX(int i) const
Returns x for a given index.
Definition: YScanner.h:541
void set(double X0, double Step)
Sets the first x and the step, and clears the entries.
Definition: YScanner.h:527

Member Function Documentation

◆ expand()

void expand ( unsigned  col,
double  yB,
double  dydz,
const Derivatives D,
int  Ny,
bool  doScan 
) const

Performs the PDF expansion in y for a given pixel column using scan or merge methods.

Results accessable with getResults() method.

Parameters
colpixel column number (0-based)
yBunfolded coordinate y of photon at prism entrance (= Bar exit) plane
dydzphoton slope in y-z projection at prism entrance (dy/dz)
Dthe derivatives
Nyeffective number of reflections
doScanif true decide between scan and merge methods, if false always use merge method

Definition at line 238 of file YScanner.cc.

◆ getBars()

const std::vector<BarSegment>& getBars ( ) const
inlineinherited

Returns geometry data of bar segments.

Returns
geometry data of bar segments

Definition at line 161 of file RaytracerBase.h.

◆ getBeta()

double getBeta ( ) const
inline

Returns particle beta.

Returns
particle beta

Definition at line 305 of file YScanner.h.

305 {return m_beta;}
double m_beta
particle beta
Definition: YScanner.h:472

◆ getCosTotal()

double getCosTotal ( ) const
inline

Returns cosine of total reflection angle.

Returns
cosine of total reflection angle at mean photon energy for beta = 1

Definition at line 293 of file YScanner.h.

◆ getEfficiencies()

const Table& getEfficiencies ( ) const
inline

Returns nominal photon detection efficiencies (PDE)

Returns
nominal photon detection efficiencies

Definition at line 287 of file YScanner.h.

◆ getEnergyDistribution()

const Table& getEnergyDistribution ( ) const
inline

Returns photon energy distribution.

Returns
photon energy distribution

Definition at line 365 of file YScanner.h.

◆ getGeometry()

EGeometry getGeometry ( ) const
inlineinherited

Returns quartz geometry treatement.

Returns
quartz geometry treatement

Definition at line 149 of file RaytracerBase.h.

◆ getMeanEnergy()

double getMeanEnergy ( ) const
inline

Returns mean photon energy.

Returns
mean photon energy

Definition at line 329 of file YScanner.h.

◆ getMeanEnergyBeta1()

double getMeanEnergyBeta1 ( ) const
inline

Returns mean photon energy for beta = 1.

Returns
mean photon energy for beta = 1

Definition at line 341 of file YScanner.h.

◆ getMirror()

const Mirror& getMirror ( ) const
inlineinherited

Returns geometry data of spherical mirror.

Returns
geometry data of spherical mirror

Definition at line 167 of file RaytracerBase.h.

◆ getModuleID()

int getModuleID ( ) const
inlineinherited

Returns slot ID.

Returns
slot ID

Definition at line 143 of file RaytracerBase.h.

◆ getMomentum()

double getMomentum ( ) const
inline

Returns particle momentum.

Returns
particle momentum

Definition at line 299 of file YScanner.h.

◆ getNumPhotons()

double getNumPhotons ( ) const
inline

Returns number of photons per Cerenkov azimuthal angle.

Returns
number of photons per radian

Definition at line 323 of file YScanner.h.

◆ getNumPhotonsPerLen()

double getNumPhotonsPerLen ( ) const
inline

Returns number of photons per Cerenkov azimuthal angle per track length.

Returns
number of photons per radian per centimeter

Definition at line 317 of file YScanner.h.

◆ getOptics()

EOptics getOptics ( ) const
inlineinherited

Returns treatement of spherical mirror optics.

Returns
spherical mirror optics

Definition at line 155 of file RaytracerBase.h.

◆ getPixelEfficiencies()

const PixelEfficiencies& getPixelEfficiencies ( ) const
inline

Returns pixel relative efficiencies.

Returns
pixel relative efficiencies

Definition at line 281 of file YScanner.h.

◆ getPixelMasks()

const PixelMasks& getPixelMasks ( ) const
inline

Returns pixel masks.

Returns
pixel masks

Definition at line 275 of file YScanner.h.

◆ getPixelPositions()

const PixelPositions& getPixelPositions ( ) const
inline

Returns pixel positions and their sizes.

Returns
pixel positions and their sizes in module local frame

Definition at line 269 of file YScanner.h.

◆ getPrism()

const Prism& getPrism ( ) const
inlineinherited

Returns geometry data of prism.

Returns
geometry data of prism

Definition at line 173 of file RaytracerBase.h.

◆ getQuasyEnergyDistributions()

const std::map<int, Table> getQuasyEnergyDistributions ( ) const
inline

Returns photon energy distributions convoluted with multiple scattering and surface roughness.

Map entries correspond to different Gaussian widths due to different number of reflections.

Returns
photon energy distributions convoluted with multiple scattering and surface roughness

Definition at line 372 of file YScanner.h.

◆ getResults()

const std::vector<Result>& getResults ( ) const
inline

Returns the results of PDF expansion in y.

Returns
results

Definition at line 378 of file YScanner.h.

◆ getRMSEnergy()

double getRMSEnergy ( ) const
inline

Returns r.m.s of photon energy.

Returns
r.m.s of photon energy

Definition at line 335 of file YScanner.h.

◆ getRMSEnergyBeta1()

double getRMSEnergyBeta1 ( ) const
inline

Returns r.m.s of photon energy for beta = 1.

Returns
r.m.s of photon energy for beta = 1

Definition at line 347 of file YScanner.h.

◆ getSigmaAlpha()

double getSigmaAlpha ( ) const
inline

Returns surface roughness parameter in units of photon energy.

Returns
surface roughness parameter [eV]

Definition at line 359 of file YScanner.h.

◆ getSigmaScattering()

double getSigmaScattering ( ) const
inline

Returns r.m.s of multiple scattering angle in quartz converted to photon energy.

Returns
r.m.s of multiple scattering angle in quartz [eV]

Definition at line 353 of file YScanner.h.

◆ getTrackLengthInQuartz()

double getTrackLengthInQuartz ( ) const
inline

Returns particle trajectory lenght inside quartz.

Returns
particle trajectory lenght inside quartz

Definition at line 311 of file YScanner.h.

◆ integrate()

void integrate ( const EnergyMask energyMask,
double  Ecp,
Result result 
) const
private

Integrates quasy energy distribution multiplied with energy mask.

Parameters
energyMaskenergy mask (pointer must be valid)
Ecpposition of the mask
resultupdated result [in/out]

Definition at line 370 of file YScanner.cc.

◆ isAboveThreshold()

bool isAboveThreshold ( ) const
inline

Returns above Cerenkov threshold flag which is set in the prepare method.

Returns
true, if beta is above the Cherenkov threshold for at least one PDE data point

Definition at line 251 of file YScanner.h.

◆ isScanDone()

bool isScanDone ( ) const
inline

Checks which expansion method was used.

Returns
true if scan, false if merge

Definition at line 384 of file YScanner.h.

◆ merge()

void merge ( unsigned  col,
double  dydz,
int  j1,
int  j2 
) const
private

Performs expansion by merging all reflections.

Parameters
colpixel column number (0-based)
dydzphoton slope in y-z projection at prism entrance (dy/dz)
j1first reflection number in y
j2last (exclusive) reflection number in y

Definition at line 338 of file YScanner.cc.

◆ pixelEfficiencies()

PixelEfficiencies& pixelEfficiencies ( )
inlineprivate

Returns non-const pixel relative efficiencies.

Returns
pixel relative efficiencies

Definition at line 459 of file YScanner.h.

◆ pixelMasks()

PixelMasks& pixelMasks ( )
inlineprivate

Returns non-const pixel masks.

Returns
pixel masks

Definition at line 453 of file YScanner.h.

◆ prepare()

void prepare ( double  momentum,
double  beta,
double  length 
) const

Prepare for the PDF expansion in y for a given track mass hypothesis.

Sets photon energy and quasy-energy distributions, mean and r.m.s of photon energy, number of photons and aboveThreshold flag.

Parameters
momentumparticle momentum
betaparticle beta
lengthlength of particle trajectory within the quartz

Definition at line 118 of file YScanner.cc.

◆ prismEntranceY()

double prismEntranceY ( double  y,
int  k,
double  dydz 
) const
private

Calculates y at prism entrance from detection position, reflection number and photon slope.

Parameters
ydetection position in y
kvalid index of vector of unfolded prism exit windows
dydzphoton slope at prism entrance
Returns
y position at prism entrance

Definition at line 411 of file YScanner.cc.

◆ projectPixel()

void projectPixel ( double  yc,
double  size,
int  k,
double  dydz,
PixelProjection proj 
) const
private

Calculates a projection of a pixel to prism entrance window (going down-stream the photon).

Parameters
ycpixel center in y
sizepixel size in y
kvalid index of vector of unfolded prism exit windows
dydzphoton slope at prism entrance
projprojection of a pixel to prism entrance [out]

Definition at line 421 of file YScanner.cc.

◆ scan()

void scan ( unsigned  col,
double  yB,
double  dydz,
const Derivatives D,
int  j1,
int  j2 
) const
private

Performs expansion w/ the scan over reflections.

Parameters
colpixel column number (0-based)
yBunfolded coordinate y of photon at prism entrance (= Bar exit) plane
dydzphoton slope in y-z projection at prism entrance (dy/dz)
Dthe derivatives
j1first reflection number in y
j2last (exclusive) reflection number in y

Definition at line 274 of file YScanner.cc.

◆ setEnergyDistribution()

double setEnergyDistribution ( double  beta) const
private

Sets photon energy distribution and mean photon energy according to nominal PDE and particle beta.

Parameters
betaparticle beta
Returns
integral of distribution before normalization

Definition at line 163 of file YScanner.cc.

◆ setMirrorCenter()

void setMirrorCenter ( double  xc,
double  yc 
)
inherited

Sets the mirror center-of-curvature.

Parameters
xccenter of curvature in x
yccenter of curvature in y

Definition at line 100 of file RaytracerBase.cc.

◆ setQuasyEnergyDistribution()

void setQuasyEnergyDistribution ( double  sigma) const
private

Sets photon energy distribution convoluted with a normalized Gaussian.

Parameters
sigmawidth of the Gaussian [eV]

Definition at line 192 of file YScanner.cc.

◆ setScanLimits()

static void setScanLimits ( int  maxReflections)
inlinestatic

Sets parameters for selection between expand methods.

Parameters
maxReflectionsmaximal number of reflections in y to perform scan

Definition at line 227 of file YScanner.h.

Member Data Documentation

◆ m_sigmaScat

double m_sigmaScat = 0
mutableprivate

r.m.s.

of multiple scattering angle in photon energy units

Definition at line 477 of file YScanner.h.


The documentation for this class was generated from the following files: