List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Attributes | Private Types | Private Member Functions | Private Attributes
FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency Class Reference

Light collection efficiency correction for profile reconstruction. More...

#include <FdLightCollectionEfficiency.h>

Inheritance diagram for FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency:
Inheritance graph
[legend]

Public Types

enum  ResultFlag { eSuccess, eFailure, eBreakLoop, eContinueLoop }
 Flag returned by module methods to the RunController. More...
 
enum  VersionInfoType {
  eFilename = 1, eRevisionNumber = 2, eDate = 3, eTime = 4,
  eLastEditor = 5
}
 Different types of version info that can be retrieved from GetVersionInfo. More...
 

Public Member Functions

fwk::VModule::ResultFlag Finish ()
 Finish: invoked at end of the run (NOT end of the event) More...
 
utl::StopwatchGetStopwatch ()
 
const utl::StopwatchGetStopwatch () const
 
std::string GetVersionInfo (const VersionInfoType v) const
 Retrieve different sorts of module version info. More...
 
fwk::VModule::ResultFlag Init ()
 Initialize: invoked at beginning of run (NOT beginning of event) More...
 
void InitTiming ()
 
fwk::VModule::ResultFlag Run (evt::Event &event)
 Run: invoked once per event. More...
 
ResultFlag RunWithTiming (evt::Event &event)
 

Static Public Member Functions

static std::string GetResultFlagByName (const ResultFlag flag)
 

Protected Types

enum  InfoLevel { eInfoNone = 0, eInfoFinal = 1, eInfoIntermediate = 2, eInfoDebug = 3 }
 

Protected Attributes

int fInfoLevel = 0
 

Private Types

enum  EStopCondition { eFixed = 0, eTargetUncertainty, eSmallEnough, eBootstrap }
 

Private Member Functions

template<typename T >
double CalcTraceBinContent (const utl::Trace< T > &trace, const double start, const double end)
 
utl::TabulatedFunctionErrors CalcTraceDivision (const utl::TabulatedFunctionErrors &pixelTrace, const utl::TraceD &apertureTrace, const utl::TraceI &nRayTracedTrace, const double nRayTracingIterations)
 
double CalculateAdditionalIterationsToMeetTarget (const fevt::FEvent &theRealFEvent, const fevt::FEvent &theSimFEvent, const fevt::FdConstants::LightSource &lightSource, const double targetRelUncertainty, const double minRelevantEfficiency)
 
bool CalculateEfficiency (const evt::Event &simEvent, evt::Event &realEvent, const int eyeId, const unsigned int nRayTracingIterations, const fevt::FdConstants::LightSource lightSource)
 Calculates the light collection efficiency of a sim shower. More...
 
utl::TabulatedFunctionErrors CalculatePixelTraceSum (const fevt::Telescope &tel, const fevt::FdConstants::LightSource component, const double simTimeOffset, const std::vector< std::vector< unsigned int > > &pixelsInZeta, const utl::TabulatedFunctionErrors &realApLight)
 Calculate the sum of pixel traces (simTimeOffset in ns) More...
 
double CalculateTargetRelUncertainty (const fevt::FEvent &theRealFEvent, const fevt::FEvent &theSimFEvent, const fevt::FdConstants::LightSource &lightSource, const double minRelevantEfficiency, const double maxUncertaintyChangeFraction)
 
bool CalculateTelescopeEfficiency (const fevt::Telescope &simTel, fevt::Telescope &realTel, const fevt::Eye &realEye, const unsigned int nRayTracingIterations, const fevt::FdConstants::LightSource lightSource)
 Calculates the light collection efficiency of a telescope. More...
 
utl::TraceD CalculateTelescopeTraceSum (const fevt::Telescope &tel, const fevt::FdConstants::LightSource component, const atm::Atmosphere::EmissionMode lightType)
 Calculate the wavelength-efficiency weighted sum of light-at-aperture traces. More...
 
fwk::VModule::ResultFlag DoInitialReconstruction (evt::Event &event, std::map< int, evt::ShowerFRecData * > &dataSets)
 Runs the FdProfileReconstructor before the efficiency calculation. More...
 
void FillSimEvent (evt::Event &event, const evt::ShowerFRecData &recData)
 Fill the simulated shower with data from the initial reconstruction. More...
 
fwk::VModule::ResultFlag ProcessEvent (evt::Event &realEvent)
 Main entry point. Run() is just a proxy. More...
 
 REGISTER_MODULE ("FdLightCollectionEfficiencyKG", FdLightCollectionEfficiency)
 for easy iteration over the relevant light components More...
 
std::pair
< fwk::VModule::ResultFlag,
unsigned int > 
RunPhotonGenerationRayTracingLoop (evt::Event &event, evt::Event &realEvent, unsigned int nRayTracingIterations, const fevt::FdConstants::LightSource lightSource)
 Runs the ShowerPhotonGenerator and TelescopeSimulator nRayTracingIterations times. More...
 
void WriteDebugInfo (const int eyeId, const int simTelId, const double simTimeOffset, const fevt::FdConstants::LightSource component, const utl::TabulatedFunctionErrors &totalPixelTrace, const utl::TraceD &totalWlTrace, const utl::TabulatedFunctionErrors &realApLightFlux, const utl::TabulatedFunctionErrors &telEff)
 

Private Attributes

double fExtraRayTraceFactor
 
double fLightAtDiaBinning
 Relative time binning factor for the light at diaphragm simulation (default: 10 => slowish) More...
 
std::vector
< fevt::FdConstants::LightSource
fLightComponents
 
PixelToApertureLightConverterfLightConverter
 
double fLowerUncertaintyLimit
 Lower limit of the required uncertainty in eSmallEnough mode. More...
 
unsigned int fMaxIterations
 Hard limit for the number of iterations. Intended for a fallback, HIGH upper limit. More...
 
int fMaxNRayTracePerBin
 
int fMinNRayTracePerBin
 ShowerPhotonGeneratorOG overrides. More...
 
double fMinRelevantEfficiency
 Minimum relevant efficiency value. More...
 
int fNRayTracingIterations
 Number of photon-gen/ray-trace loop iterations. More...
 
double fProfileXBinning
 Depth-binning of the GH => dEdX/Ne calculation. More...
 
EStopCondition fStopCondition
 Condition for stopping the ray tracing loop: eFixed/eTargetUncertainty/eBootstrap. More...
 
std::map< std::string, SubModulefSubModulesList
 
double fTargetUncertainty
 Maximum tolerable uncertainty. More...
 
double fTargetWorstCaseLAtApUncertaintyChange
 Target worst-case change of light at aperture uncertainty. More...
 
std::map< unsigned int,
utl::TraceD > * 
fTimeCorrectedApertureTraces
 
bool fUseZeta
 Collect light within zeta only or in the whole camera? More...
 
int fVerbosity
 global verbosity flag More...
 

Detailed Description

Light collection efficiency correction for profile reconstruction.

Author
Steffen Mueller
Date
Wed May 27 11:01:00 CET 2009

Definition at line 52 of file FdLightCollectionEfficiency.h.

Member Enumeration Documentation

Enumerator
eFixed 
eTargetUncertainty 
eSmallEnough 
eBootstrap 

Definition at line 60 of file FdLightCollectionEfficiency.h.

enum fwk::VModule::InfoLevel
protectedinherited
Enumerator
eInfoNone 
eInfoFinal 
eInfoIntermediate 
eInfoDebug 

Definition at line 125 of file VModule.h.

enum fwk::VModule::ResultFlag
inherited

Flag returned by module methods to the RunController.

Enumerator
eSuccess 

Report success to RunController.

eFailure 

Report failure to RunController, causing RunController to terminate execution.

eBreakLoop 

Break current loop. It works for nested loops too!

eContinueLoop 

Skip remaining modules in the current loop and continue with next iteration of the loop.

Definition at line 60 of file VModule.h.

Different types of version info that can be retrieved from GetVersionInfo.

Enumerator
eFilename 
eRevisionNumber 
eDate 
eTime 
eLastEditor 

Definition at line 110 of file VModule.h.

Member Function Documentation

template<typename T >
double FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency::CalcTraceBinContent ( const utl::Trace< T > &  trace,
const double  start,
const double  end 
)
inlineprivate

Helper method for CalcTraceDivision. Given a trace and the start and end of a range (in the same units as the trace's x-coordinate), calculate the contents of the trace in that range. (Hopefully) takes partial bins correctly into account.

Definition at line 157 of file FdLightCollectionEfficiency.h.

References utl::Trace< T >::At(), utl::Trace< T >::GetBinning(), and utl::Trace< T >::GetSize().

utl::TabulatedFunctionErrors FdLightCollectionEfficiency::CalcTraceDivision ( const utl::TabulatedFunctionErrors pixelTrace,
const utl::TraceD apertureTrace,
const utl::TraceI nRayTracedTrace,
const double  nRayTracingIterations 
)
private

Given the bin size and bin number in an output trace, calculate the division of two input traces which may have arbitrarily different binning. The nRayTracedTrace is the number of photons that were ray-traced. The binning must be the same as that of the numeratorTrace. Note: This currently assumes all traces have the same starting point.

Definition at line 1412 of file FdLightCollectionEfficiency.cc.

References utl::TabulatedFunction::GetNPoints(), utl::TabulatedFunction::GetX(), utl::TabulatedFunctionErrors::GetXErr(), utl::TabulatedFunction::GetY(), utl::TabulatedFunctionErrors::GetYErr(), and utl::TabulatedFunctionErrors::PushBack().

double FdLightCollectionEfficiency::CalculateAdditionalIterationsToMeetTarget ( const fevt::FEvent theRealFEvent,
const fevt::FEvent theSimFEvent,
const fevt::FdConstants::LightSource lightSource,
const double  targetRelUncertainty,
const double  minRelevantEfficiency 
)
private
bool FdLightCollectionEfficiency::CalculateEfficiency ( const evt::Event simEvent,
evt::Event realEvent,
const int  eyeId,
const unsigned int  nRayTracingIterations,
const fevt::FdConstants::LightSource  lightSource 
)
private
utl::TabulatedFunctionErrors FdLightCollectionEfficiency::CalculatePixelTraceSum ( const fevt::Telescope tel,
const fevt::FdConstants::LightSource  component,
const double  simTimeOffset,
const std::vector< std::vector< unsigned int > > &  pixelsInZeta,
const utl::TabulatedFunctionErrors realApLight 
)
private
double FdLightCollectionEfficiency::CalculateTargetRelUncertainty ( const fevt::FEvent theRealFEvent,
const fevt::FEvent theSimFEvent,
const fevt::FdConstants::LightSource lightSource,
const double  minRelevantEfficiency,
const double  maxUncertaintyChangeFraction 
)
private

Calculate the target relative uncertainty of the efficiency by looking at the aperture light uncertainties. We require that if we propagate the uncertainty of the light collection efficiency to the real light at aperture (y_real = y_measured/epsilon), the uncertainty on the light at aperture should not be increased by more than a fraction of k (maxUncertaintyChangeFraction). Thus, we check all aperture light (and efficiency) bins to determine the one with the largest change in uncertainty and adjust the target relative uncertainty on the efficiency accordingly.

Effectively, we minimize the following quantity with the iteration over the aperture light bins and telescopes and eyes: (e == epsilon) sigma_e/e = sqrt((k+1)^2-1) * sigma_y,measured / abs(y_measured)

Definition at line 1316 of file FdLightCollectionEfficiency.cc.

References fevt::ComponentSelector::eDeSelected, fevt::ComponentSelector::eHasData, fevt::ComponentSelector::eInDAQ, fevt::FdConstants::eTotal, fevt::FEvent::EyesBegin(), fevt::FEvent::EyesEnd(), fevt::FEvent::GetEye(), fevt::Eye::GetId(), fevt::TelescopeRecData::GetLightCollectionEfficiency(), fevt::TelescopeRecData::GetLightFlux(), utl::TabulatedFunction::GetNPoints(), fevt::Telescope::GetRecData(), utl::MultiTabulatedFunctionErrors::GetTabulatedFunctionErrors(), fevt::Eye::GetTelescope(), utl::TabulatedFunction::GetX(), utl::TabulatedFunction::GetY(), utl::TabulatedFunctionErrors::GetYErr(), fevt::FEvent::HasEye(), utl::MultiObject< T, LabeledObjectType >::HasLabel(), fevt::TelescopeRecData::HasLightCollectionEfficiency(), fevt::TelescopeRecData::HasLightFlux(), fevt::Telescope::HasRecData(), fevt::Eye::HasTelescope(), INFO, std::pow(), sqrt(), fevt::Eye::TelescopesBegin(), and fevt::Eye::TelescopesEnd().

bool FdLightCollectionEfficiency::CalculateTelescopeEfficiency ( const fevt::Telescope simTel,
fevt::Telescope realTel,
const fevt::Eye realEye,
const unsigned int  nRayTracingIterations,
const fevt::FdConstants::LightSource  lightSource 
)
private
utl::TraceD FdLightCollectionEfficiency::CalculateTelescopeTraceSum ( const fevt::Telescope tel,
const fevt::FdConstants::LightSource  component,
const atm::Atmosphere::EmissionMode  lightType 
)
private
fwk::VModule::ResultFlag FdLightCollectionEfficiency::DoInitialReconstruction ( evt::Event event,
std::map< int, evt::ShowerFRecData * > &  dataSets 
)
private
void FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency::FillSimEvent ( evt::Event event,
const evt::ShowerFRecData recData 
)
private

Fill the simulated shower with data from the initial reconstruction.

fwk::VModule::ResultFlag FdLightCollectionEfficiency::Finish ( )
virtual

Finish: invoked at end of the run (NOT end of the event)

This method is for things that should be done at the end of the run (for example, closing files or writing out histograms) {You must override this method in your concrete module}

Implements fwk::VModule.

Definition at line 422 of file FdLightCollectionEfficiency.cc.

References io::eSuccess, FdLightCollectionEfficiencyKG::SubModule::Finish(), FdLightCollectionEfficiencyKG::SubModule::FinishTimingPrintout(), FdLightCollectionEfficiencyKG::SubModule::GetName(), FdLightCollectionEfficiencyKG::SubModule::PrintTiming(), and FdLightCollectionEfficiencyKG::SubModule::TimingHeader().

std::string fwk::VModule::GetResultFlagByName ( const ResultFlag  flag)
staticinherited
utl::Stopwatch& fwk::VModule::GetStopwatch ( )
inlineinherited

Definition at line 106 of file VModule.h.

References fwk::VModule::fStopwatch.

const utl::Stopwatch& fwk::VModule::GetStopwatch ( ) const
inlineinherited

Definition at line 107 of file VModule.h.

References fwk::VModule::fStopwatch.

std::string fwk::VModule::GetVersionInfo ( const VersionInfoType  v) const
inherited
fwk::VModule::ResultFlag FdLightCollectionEfficiency::Init ( )
virtual

Initialize: invoked at beginning of run (NOT beginning of event)

This method is for things that should be done once at the beginning of a run (for example, booking histograms, performing calculations that need to be done only once, initializing parameters) {You must override this method in your concrete module}

Implements fwk::VModule.

Definition at line 118 of file FdLightCollectionEfficiency.cc.

References utl::cm, fevt::FdConstants::eCherRayleighScattered, LDFFinderKG::eFixed, fevt::FdConstants::eFluorDirect, io::eSuccess, utl::g, utl::Branch::GetChild(), utl::Branch::GetData(), FdLightCollectionEfficiencyKG::SubModule::GetName(), fwk::CentralConfig::GetTopBranch(), FdLightCollectionEfficiencyKG::SubModule::Init(), and WARNING.

void fwk::VModule::InitTiming ( )
inlineinherited

Definition at line 95 of file VModule.h.

References fwk::VModule::fStopwatch, and utl::Stopwatch::Reset().

fwk::VModule::ResultFlag FdLightCollectionEfficiency::ProcessEvent ( evt::Event realEvent)
private
FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency::REGISTER_MODULE ( "FdLightCollectionEfficiencyKG"  ,
FdLightCollectionEfficiency   
)
private

for easy iteration over the relevant light components

fwk::VModule::ResultFlag FdLightCollectionEfficiency::Run ( evt::Event event)
virtual

Run: invoked once per event.

This method is for things that should be done once per event {You must override this method in your concrete module}

Implements fwk::VModule.

Definition at line 222 of file FdLightCollectionEfficiency.cc.

References io::eSuccess, and evt::Event::HasFEvent().

std::pair< fwk::VModule::ResultFlag, unsigned int > FdLightCollectionEfficiency::RunPhotonGenerationRayTracingLoop ( evt::Event event,
evt::Event realEvent,
unsigned int  nRayTracingIterations,
const fevt::FdConstants::LightSource  lightSource 
)
private

Runs the ShowerPhotonGenerator and TelescopeSimulator nRayTracingIterations times.

Definition at line 958 of file FdLightCollectionEfficiency.cc.

References fevt::TelescopeSimData::ClearPhotons(), fevt::TelescopeSimData::ClearRayTracedPhotonTrace(), fevt::ComponentSelector::eDeSelected, LDFFinderKG::eFixed, fevt::ComponentSelector::eInDAQ, ERROR, io::eSuccess, fevt::FEvent::EyesBegin(), fevt::FEvent::EyesEnd(), ShowerPhotonGeneratorOG::ShowerPhotonGenerator::GetExtraRayTraceFactor(), fevt::FEvent::GetEye(), evt::Event::GetFEvent(), fevt::Eye::GetId(), fevt::TelescopeRecData::GetLightCollectionEfficiency(), ShowerPhotonGeneratorOG::ShowerPhotonGenerator::GetLightSourceSelection(), ShowerPhotonGeneratorOG::ShowerPhotonGenerator::GetMaxNRayTrace(), FdLightCollectionEfficiencyKG::Bootstrapper::GetMean(), ShowerPhotonGeneratorOG::ShowerPhotonGenerator::GetMinNRayTrace(), FdLightCollectionEfficiencyKG::SubModule::GetModule(), fevt::Telescope::GetRecData(), utl::MultiTabulatedFunctionErrors::GetTabulatedFunctionErrors(), fevt::Eye::GetTelescope(), ShowerPhotonGeneratorOG::ShowerPhotonGenerator::GetUseOnlyReferenceWavelength(), TelescopeSimulatorKG::TelescopeSimulator::GetVerbosity(), fevt::FEvent::HasEye(), fevt::TelescopeSimData::HasRayTracedPhotonTrace(), fevt::Telescope::HasRecData(), fevt::Eye::HasTelescope(), INFO, FdLightCollectionEfficiencyKG::Bootstrapper::MaxRelUncertaintyBelowThreshold(), ShowerPhotonGeneratorOG::ShowerPhotonGenerator::ResetLightSourceSelection(), FdLightCollectionEfficiencyKG::CorrectedApLightCalculator::Run(), FdLightCollectionEfficiencyKG::SubModule::Run(), ShowerPhotonGeneratorOG::ShowerPhotonGenerator::SetExtraRayTraceFactor(), ShowerPhotonGeneratorOG::ShowerPhotonGenerator::SetLightSourceSelection(), ShowerPhotonGeneratorOG::ShowerPhotonGenerator::SetMaxNRayTrace(), ShowerPhotonGeneratorOG::ShowerPhotonGenerator::SetMinNRayTrace(), TelescopeSimulatorKG::TelescopeSimulator::SetStoreLightComponentsAtPixels(), ShowerPhotonGeneratorOG::ShowerPhotonGenerator::SetUseOnlyReferenceWavelength(), TelescopeSimulatorKG::TelescopeSimulator::SetVerbosity(), TelescopeSimulatorKG::TelescopeSimulator::StoreLightComponentsAtPixels(), fevt::Eye::TelescopesBegin(), and fevt::Eye::TelescopesEnd().

ResultFlag fwk::VModule::RunWithTiming ( evt::Event event)
inlineinherited
void FdLightCollectionEfficiency::WriteDebugInfo ( const int  eyeId,
const int  simTelId,
const double  simTimeOffset,
const fevt::FdConstants::LightSource  component,
const utl::TabulatedFunctionErrors totalPixelTrace,
const utl::TraceD totalWlTrace,
const utl::TabulatedFunctionErrors realApLightFlux,
const utl::TabulatedFunctionErrors telEff 
)
private

Member Data Documentation

double FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency::fExtraRayTraceFactor
private

Definition at line 242 of file FdLightCollectionEfficiency.h.

int fwk::VModule::fInfoLevel = 0
protectedinherited
double FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency::fLightAtDiaBinning
private

Relative time binning factor for the light at diaphragm simulation (default: 10 => slowish)

Definition at line 245 of file FdLightCollectionEfficiency.h.

std::vector<fevt::FdConstants::LightSource> FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency::fLightComponents
private

Definition at line 253 of file FdLightCollectionEfficiency.h.

PixelToApertureLightConverter* FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency::fLightConverter
private

Definition at line 250 of file FdLightCollectionEfficiency.h.

double FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency::fLowerUncertaintyLimit
private

Lower limit of the required uncertainty in eSmallEnough mode.

Definition at line 230 of file FdLightCollectionEfficiency.h.

unsigned int FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency::fMaxIterations
private

Hard limit for the number of iterations. Intended for a fallback, HIGH upper limit.

Definition at line 223 of file FdLightCollectionEfficiency.h.

int FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency::fMaxNRayTracePerBin
private

Definition at line 241 of file FdLightCollectionEfficiency.h.

int FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency::fMinNRayTracePerBin
private

ShowerPhotonGeneratorOG overrides.

Definition at line 240 of file FdLightCollectionEfficiency.h.

double FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency::fMinRelevantEfficiency
private

Minimum relevant efficiency value.

Definition at line 221 of file FdLightCollectionEfficiency.h.

int FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency::fNRayTracingIterations
private

Number of photon-gen/ray-trace loop iterations.

Definition at line 238 of file FdLightCollectionEfficiency.h.

double FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency::fProfileXBinning
private

Depth-binning of the GH => dEdX/Ne calculation.

Definition at line 233 of file FdLightCollectionEfficiency.h.

EStopCondition FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency::fStopCondition
private

Condition for stopping the ray tracing loop: eFixed/eTargetUncertainty/eBootstrap.

Definition at line 218 of file FdLightCollectionEfficiency.h.

std::map<std::string, SubModule> FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency::fSubModulesList
private

Definition at line 247 of file FdLightCollectionEfficiency.h.

double FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency::fTargetUncertainty
private

Maximum tolerable uncertainty.

Definition at line 225 of file FdLightCollectionEfficiency.h.

double FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency::fTargetWorstCaseLAtApUncertaintyChange
private

Target worst-case change of light at aperture uncertainty.

Definition at line 228 of file FdLightCollectionEfficiency.h.

std::map<unsigned int, utl::TraceD>* FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency::fTimeCorrectedApertureTraces
private

Definition at line 251 of file FdLightCollectionEfficiency.h.

bool FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency::fUseZeta
private

Collect light within zeta only or in the whole camera?

Definition at line 235 of file FdLightCollectionEfficiency.h.

int FdLightCollectionEfficiencyKG::FdLightCollectionEfficiency::fVerbosity
private

global verbosity flag

Definition at line 215 of file FdLightCollectionEfficiency.h.


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

, generated on Tue Sep 26 2023.