11#include <top/reconstruction_cpp/RaytracerBase.h>
12#include <top/reconstruction_cpp/InverseRaytracer.h>
13#include <top/reconstruction_cpp/PixelPositions.h>
14#include <top/reconstruction_cpp/PixelMasks.h>
15#include <top/reconstruction_cpp/PixelEfficiencies.h>
16#include <top/reconstruction_cpp/EnergyMask.h>
139 void set(
double X0,
double Step);
151 double getX(
int i)
const;
175 double getY(
int i)
const;
221 explicit YScanner(
int moduleID,
unsigned N = 64);
245 void prepare(
double momentum,
double beta,
double length)
const;
263 void expand(
unsigned col,
double yB,
double dydz,
const Derivatives& D,
int Ny,
bool doScan)
const;
418 void projectPixel(
double yc,
double size,
int k,
double dydz, PixelProjection proj[2])
const;
429 void scan(
unsigned col,
double yB,
double dydz,
const Derivatives& D,
int j1,
int j2)
const;
438 void merge(
unsigned col,
double dydz,
int j1,
int j2)
const;
471 mutable std::map<int, Table>
498 return (sol1.
yB - sol0.
yB) / sol1.
step;
543 if (k >= entries.size())
return 0;
549 if (sum == 0)
return;
551 sigsq = std::max(sigsq / sum - e0 * e0, 0.0);
A mask for energy masking.
Pixel relative efficiencies of a single module.
Pixel masks of a single module.
Pixel positions and dimensions in module local frame.
Base class with geometry data.
Singleton class providing pre-constructed reconstruction objects.
Utility for expanding the PDF in y direction.
double m_cosTotal
cosine of total reflection angle
void prepare(double momentum, double beta, double length) const
Prepare for the PDF expansion in y for a given track mass hypothesis.
Table m_energyDistribution
photon energy distribution
double getMeanEnergyBeta1() const
Returns mean photon energy for beta = 1.
PixelEfficiencies m_pixelEfficiencies
pixel relative efficiencies
double m_beta
particle beta
bool m_scanDone
true if scan performed, false if reflections just merged
Table m_efficiency
nominal photon detection efficiencies (PDE)
double getRMSEnergyBeta1() const
Returns r.m.s of photon energy for beta = 1.
double m_meanE
mean photon energy
double getSigmaScattering() const
Returns r.m.s of multiple scattering angle in quartz converted to photon energy.
PixelMasks & pixelMasks()
Returns non-const pixel masks.
double getTrackLengthInQuartz() const
Returns particle trajectory lenght inside quartz.
static int s_maxReflections
maximal number of reflections to perform scan
double m_rmsE
r.m.s of photon energy
bool m_aboveThreshold
true if beta is above the Cerenkov threshold
void projectPixel(double yc, double size, int k, double dydz, PixelProjection proj[2]) const
Calculates projections of a pixel to prism entrance window (going down-stream the photon).
void merge(unsigned col, double dydz, int j1, int j2) const
Performs expansion by merging all reflections.
double getNumPhotonsPerLen() const
Returns number of photons per Cerenkov azimuthal angle per track length.
const PixelPositions & getPixelPositions() const
Returns pixel positions and their sizes.
void scan(unsigned col, double yB, double dydz, const Derivatives &D, int j1, int j2) const
Performs expansion w/ the scan over reflections.
double m_meanE0
mean photon energy for beta = 1
double m_momentum
particle momentum magnitude
const PixelMasks & getPixelMasks() const
Returns pixel masks.
Table * m_quasyEnergyDistribution
a pointer to the element in m_quasyEnergyDistributions
double getCosTotal() const
Returns cosine of total reflection angle.
PixelMasks m_pixelMasks
pixel masks
void setQuasyEnergyDistribution(double sigma) const
Sets photon energy distribution convoluted with a normalized Gaussian.
void integrate(const EnergyMask *energyMask, double Ecp, Result &result) const
Integrates quasy energy distribution multiplied with energy mask.
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.
std::map< int, Table > m_quasyEnergyDistributions
photon energy distributions convoluted with Gaussian of different widths
PixelEfficiencies & pixelEfficiencies()
Returns non-const pixel relative efficiencies.
double getSigmaAlpha() const
Returns surface roughness parameter in units of photon energy.
const Table & getEnergyDistribution() const
Returns photon energy distribution.
double setEnergyDistribution(double beta) const
Sets photon energy distribution and mean photon energy according to nominal PDE and particle beta.
static void setScanLimits(int maxReflections)
Sets parameters for selection between expand methods.
const Table & getEfficiencies() const
Returns nominal photon detection efficiencies (PDE)
double m_length
length of particle trajectory inside quartz
double getNumPhotons() const
Returns number of photons per Cerenkov azimuthal angle.
double getMeanEnergy() const
Returns mean photon energy.
double m_rmsE0
r.m.s of photon energy for beta = 1
bool isAboveThreshold() const
Returns above Cerenkov threshold flag which is set in the prepare method.
const std::map< int, Table > getQuasyEnergyDistributions() const
Returns photon energy distributions convoluted with multiple scattering and surface roughness.
std::vector< Result > m_results
results of PDF expansion in y
const PixelEfficiencies & getPixelEfficiencies() const
Returns pixel relative efficiencies.
bool isScanDone() const
Checks which expansion method was used.
const std::vector< Result > & getResults() const
Returns the results of PDF expansion in y.
PixelPositions m_pixelPositions
positions and sizes of pixels
void clear() const
Clear mutable variables.
double m_numPhotons
number of photons per Cerenkov azimuthal angle per track length
double m_sigmaAlpha
surface roughness parameter in photon energy units
double getRMSEnergy() const
Returns r.m.s of photon energy.
double getBeta() const
Returns particle beta.
double getMomentum() const
Returns particle momentum.
Abstract base class for different kinds of events.
Solution of inverse ray-tracing.
double yB
unfolded coordinate y of photon at Bar exit plane
double step
step for numerical derivative calculation
double cosFic
cosine of azimuthal Cerenkov angle
double sinFic
sine of azimuthal Cerenkov angle
double len
propagation length to detector plane
static double dyB_d(const InverseRaytracer::Solution &sol0, const InverseRaytracer::Solution &sol1)
Calculates the derivative of unfolded y coordinate at prism entrance.
static double dLen_d(const InverseRaytracer::Solution &sol0, const InverseRaytracer::Solution &sol1)
Calculates the derivative of propagation length.
double dFic_de
Cerenkov azimuthal angle over photon energy.
double dLen_de
propagation length over photon energy
Derivatives()
Default constructor.
double dFic_dx
Cerenkov azimuthal angle over photon detection coordinate x.
double dFic_dL
Cerenkov azimuthal angle over running parameter of particle trajectory.
double dLen_dL
propagation length over running parameter of particle trajectory
double dyB_de
unfolded y coordinate at prism entrance over photon energy
double dLen_dx
propagation length over photon detection coordinate x
double dyB_dL
unfolded y coordinate at prism entrance over running parameter of particle trajectory
double dyB_dx
unfolded y coordinate at prism entrance over photon detection coordinate x
static double dFic_d(const InverseRaytracer::Solution &sol0, const InverseRaytracer::Solution &sol1)
Calculates the derivative of Cerenkov azimuthal angle.
Down-stream projection of a pixel to prism entrance window w/ a clip on bar exit thickness.
double yc
center in y of clipped pixel projection
bool operator<(const PixelProjection &other) const
operator "less than" needed for sorting
const EnergyMask * mask
the corresponding energy mask
double Dy
size in y of clipped pixel projection
double e0
mean photon energy of the peak
double sum
peak area proportional to number of photons
double sigsq
width of the peak squared, in photon energy units
void set()
Sets the mean and width-squared from the accumulated values.
Result(int ID)
Constructor with pixel ID.
int pixelID
pixel ID (1-based)
TableEntry(double Y, double X, double Xsq)
Constructor.
A table of equidistant entries.
Table()
Default constructor.
double getY(int i) const
Returns y for a given index.
int getIndex(double x) const
Returns index.
std::vector< TableEntry > entries
table entries
double getXmax() const
Returns x of the last entry.
double getX(int i) const
Returns x for a given index.
void clear()
Clear the content entirely.
double getXmin() const
Returns x of the first entry.
double x0
x of first entry
void set(double X0, double Step)
Sets the first x and the step, and clears the entries.