Belle II Software  release-06-01-15
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, 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...
 
const TablegetEnergyDistribution () const
 Returns photon energy distribution. More...
 
const TablegetQuasyEnergyDistribution () const
 Returns photon energy distribution convoluted with multiple scattering. 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...
 

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 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...
 
Table m_energyDistribution
 photon energy distribution
 
Table m_quasyEnergyDistribution
 photon energy distribution convoluted with multiple scattering
 
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 31 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 52 of file YScanner.cc.

52  : RaytracerBase(moduleID, c_Unified, c_SemiLinear),
53  m_pixelPositions(PixelPositions(moduleID)),
54  m_pixelMasks(PixelMasks(moduleID)),
55  m_pixelEfficiencies(PixelEfficiencies(moduleID))
56  {
57  if (N < 2) {
58  B2FATAL("TOP::YScanner: N must be > 1");
59  return;
60  }
61 
62  // set the table of nominal photon detection efficiencies (incl. wavelength filter)
63 
64  const auto* topgp = TOPGeometryPar::Instance();
65  const auto* geo = topgp->getGeometry();
66  auto qe = geo->getNominalQE(); // get a copy
67  qe.applyFilterTransmission(geo->getWavelengthFilter());
68 
69  double minE = TOPGeometryPar::c_hc / qe.getMaxLambda();
70  double maxE = TOPGeometryPar::c_hc / qe.getMinLambda();
71  if (minE >= maxE) {
72  B2FATAL("TOP::YScanner: quantum efficiency found zero for all wavelengths");
73  return;
74  }
75  m_efficiency.set(minE, (maxE - minE) / (N - 1));
76 
77  const auto& tdc = geo->getNominalTDC();
78  for (unsigned i = 0; i < N; i++) {
79  double e = m_efficiency.getX(i);
80  double lambda = TOPGeometryPar::c_hc / e;
81  double effi = qe.getEfficiency(lambda) * tdc.getEfficiency();
82  m_efficiency.entries.push_back(TableEntry(effi, e, e * e));
83  }
84 
85  // set cosine of total reflection angle using photon mean energy for beta = 1
86 
87  double s = 0;
88  double se = 0;
89  double see = 0;
90  for (const auto& entry : m_efficiency.entries) {
91  double e = entry.x;
92  double p = entry.y * (1 - 1 / pow(topgp->getPhaseIndex(e), 2));
93  s += p;
94  se += p * e;
95  see += p * e * e;
96  }
97  if (s == 0) return;
98  m_meanE0 = se / s;
99  m_rmsE0 = sqrt(see / s - m_meanE0 * m_meanE0);
100  m_cosTotal = sqrt(1 - 1 / pow(topgp->getPhaseIndex(m_meanE0), 2));
101  }
@ 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:463
PixelEfficiencies m_pixelEfficiencies
pixel relative efficiencies
Definition: YScanner.h:459
Table m_efficiency
nominal photon detection efficiencies (PDE)
Definition: YScanner.h:460
double m_meanE0
mean photon energy for beta = 1
Definition: YScanner.h:461
PixelMasks m_pixelMasks
pixel masks
Definition: YScanner.h:458
double m_rmsE0
r.m.s of photon energy for beta = 1
Definition: YScanner.h:462
PixelPositions m_pixelPositions
positions and sizes of pixels
Definition: YScanner.h:457
std::vector< TableEntry > entries
table entries
Definition: YScanner.h:130
double getX(int i) const
Returns x for a given index.
Definition: YScanner.h:539
void set(double X0, double Step)
Sets the first x and the step, and clears the entries.
Definition: YScanner.h:525

Member Function Documentation

◆ expand()

void expand ( unsigned  col,
double  yB,
double  dydz,
const Derivatives D,
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
doScanif true decide between scan and merge methods, if false always use merge method

Definition at line 217 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 160 of file RaytracerBase.h.

◆ getBeta()

double getBeta ( ) const
inline

Returns particle beta.

Returns
particle beta

Definition at line 313 of file YScanner.h.

313 {return m_beta;}
double m_beta
particle beta
Definition: YScanner.h:467

◆ 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 301 of file YScanner.h.

◆ getEfficiencies()

const Table& getEfficiencies ( ) const
inline

Returns nominal photon detection efficiencies (PDE)

Returns
nominal photon detection efficiencies

Definition at line 295 of file YScanner.h.

◆ getEnergyDistribution()

const Table& getEnergyDistribution ( ) const
inline

Returns photon energy distribution.

Returns
photon energy distribution

Definition at line 367 of file YScanner.h.

◆ getGeometry()

EGeometry getGeometry ( ) const
inlineinherited

Returns quartz geometry treatement.

Returns
quartz geometry treatement

Definition at line 148 of file RaytracerBase.h.

◆ getMeanEnergy()

double getMeanEnergy ( ) const
inline

Returns mean photon energy.

Returns
mean photon energy

Definition at line 337 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 349 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 166 of file RaytracerBase.h.

◆ getModuleID()

int getModuleID ( ) const
inlineinherited

Returns slot ID.

Returns
slot ID

Definition at line 142 of file RaytracerBase.h.

◆ getMomentum()

double getMomentum ( ) const
inline

Returns particle momentum.

Returns
particle momentum

Definition at line 307 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 331 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 325 of file YScanner.h.

◆ getOptics()

EOptics getOptics ( ) const
inlineinherited

Returns treatement of spherical mirror optics.

Returns
spherical mirror optics

Definition at line 154 of file RaytracerBase.h.

◆ getPixelEfficiencies()

const PixelEfficiencies& getPixelEfficiencies ( ) const
inline

Returns pixel relative efficiencies.

Returns
pixel relative efficiencies

Definition at line 289 of file YScanner.h.

◆ getPixelMasks()

const PixelMasks& getPixelMasks ( ) const
inline

Returns pixel masks.

Returns
pixel masks

Definition at line 283 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 277 of file YScanner.h.

◆ getPrism()

const Prism& getPrism ( ) const
inlineinherited

Returns geometry data of prism.

Returns
geometry data of prism

Definition at line 172 of file RaytracerBase.h.

◆ getQuasyEnergyDistribution()

const Table& getQuasyEnergyDistribution ( ) const
inline

Returns photon energy distribution convoluted with multiple scattering.

Returns
photon energy distribution convoluted with multiple scattering

Definition at line 373 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 379 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 343 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 355 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 361 of file YScanner.h.

◆ getTrackLengthInQuartz()

double getTrackLengthInQuartz ( ) const
inline

Returns particle trajectory lenght inside quartz.

Returns
particle trajectory lenght inside quartz

Definition at line 319 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 346 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 260 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 385 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 314 of file YScanner.cc.

◆ pixelEfficiencies()

PixelEfficiencies& pixelEfficiencies ( )
inlineprivate

Returns non-const pixel relative efficiencies.

Returns
pixel relative efficiencies

Definition at line 454 of file YScanner.h.

◆ pixelMasks()

PixelMasks& pixelMasks ( )
inlineprivate

Returns non-const pixel masks.

Returns
pixel masks

Definition at line 448 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 121 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 387 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 397 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 250 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 188 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 236 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 472 of file YScanner.h.


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