Jpp test-rotations-old-533-g2bdbdb559
the software that should make you happy
Loading...
Searching...
No Matches
JMuonPDF_t Struct Reference

Auxiliary data structure for muon PDF. More...

#include <JPDF_t.hh>

Public Types

typedef JPP::JSplineFunction1D< JPP::JSplineElement2S< double, double >, JPP::JCollection, JPP::JResultPDF< double > > JFunction1D_t
 
typedef JPP::JMAPLIST< JPP::JPolint1FunctionalMap, JPP::JPolint0FunctionalGridMap, JPP::JPolint0FunctionalGridMap >::maplist JPDFMaplist_t
 
typedef JPP::JPDFTable< JFunction1D_t, JPDFMaplist_tJPDF_t
 
typedef JFunction1D_t::result_type result_type
 

Public Member Functions

 JMuonPDF_t (const std::string &fileDescriptor, const double TTS, const int numberOfPoints=25, const double epsilon=1.0e-10)
 Constructor.
 
result_type calculate (const double E, const double R, const double theta, const double phi, const double t1) const
 Get PDF.
 

Public Attributes

JPDF_t pdfA
 PDF for minimum ionising particle.
 
JPDF_t pdfB
 PDF for average energy losses.
 
JPDF_t pdfC
 PDF for delta-rays.
 

Detailed Description

Auxiliary data structure for muon PDF.

Definition at line 135 of file JPDF_t.hh.

Member Typedef Documentation

◆ JFunction1D_t

◆ JPDFMaplist_t

◆ JPDF_t

◆ result_type

Constructor & Destructor Documentation

◆ JMuonPDF_t()

JMuonPDF_t::JMuonPDF_t ( const std::string & fileDescriptor,
const double TTS,
const int numberOfPoints = 25,
const double epsilon = 1.0e-10 )
inline

Constructor.

The PDF file descriptor should contain the wild card character JPHYSICS::WILDCARD.
The TTS corresponds to the additional time smearing applied to the PDFs.

Parameters
fileDescriptorPDF file descriptor
TTSTTS [ns]
numberOfPointsnumber of points for Gauss-Hermite integration of TTS
epsilonprecision for Gauss-Hermite integration of TTS

Definition at line 159 of file JPDF_t.hh.

163 {
164 using namespace std;
165 using namespace JPP;
166
167 const JPDFType_t pdf_t[] = {
168 DIRECT_LIGHT_FROM_MUON,
169 SCATTERED_LIGHT_FROM_MUON,
170 DIRECT_LIGHT_FROM_EMSHOWERS,
171 SCATTERED_LIGHT_FROM_EMSHOWERS,
172 DIRECT_LIGHT_FROM_DELTARAYS,
173 SCATTERED_LIGHT_FROM_DELTARAYS
174 };
175
176 const int N = sizeof(pdf_t) / sizeof(pdf_t[0]);
177
178 JPDF_t pdf[N];
179
180 const JPDF_t::JSupervisor supervisor(new JPDF_t::JDefaultResult(zero));
181
182 for (int i = 0; i != N; ++i) {
183
184 const string file_name = getFilename(fileDescriptor, pdf_t[i]);
185
186 cout << "loading input from file " << file_name << "... " << flush;
187
188 pdf[i].load(file_name.c_str());
189
190 pdf[i].setExceptionHandler(supervisor);
191
192 cout << "OK" << endl;
193 }
194
195 // Add PDFs
196
197 cout << "adding PDFs... " << flush;
198
199 pdfA = pdf[1]; pdfA.add(pdf[0]);
200 pdfB = pdf[3]; pdfB.add(pdf[2]);
201 pdfC = pdf[5]; pdfC.add(pdf[4]);
202
203 cout << "OK" << endl;
204
205 if (TTS > 0.0) {
206
207 cout << "bluring PDFs... " << flush;
208
209 pdfA.blur(TTS, numberOfPoints, epsilon);
210 pdfB.blur(TTS, numberOfPoints, epsilon);
211 pdfC.blur(TTS, numberOfPoints, epsilon);
212
213 cout << "OK" << endl;
214
215 } else if (TTS < 0.0) {
216
217 THROW(JValueOutOfRange, "Illegal value of TTS [ns]: " << TTS);
218 }
219 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
int numberOfPoints
Definition JResultPDF.cc:22
Exception for accessing a value in a collection that is outside of its range.
void blur(const double TTS, const int numberOfPoints=25, const double epsilon=1.0e-10, const double quantile=0.99)
Blur PDF.
Definition JPDFTable.hh:111
void add(const JMultiFunction_t &input)
Add function.
JPDFType_t
PDF types.
Definition JPDFTypes.hh:24
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
JPP::JPDFTable< JFunction1D_t, JPDFMaplist_t > JPDF_t
Definition JPDF_t.hh:144
JPDF_t pdfB
PDF for average energy losses.
Definition JPDF_t.hh:262
JPDF_t pdfC
PDF for delta-rays.
Definition JPDF_t.hh:263
JPDF_t pdfA
PDF for minimum ionising particle.
Definition JPDF_t.hh:261

Member Function Documentation

◆ calculate()

result_type JMuonPDF_t::calculate ( const double E,
const double R,
const double theta,
const double phi,
const double t1 ) const
inline

Get PDF.

The orientation of the PMT should be defined according this documentation.
In this, the zenith and azimuth angles are limited to

\[\left[0, \pi\right]\]

.

Parameters
Emuon energy at minimum distance of approach [GeV]
Rminimum distance of approach [m]
thetaPMT zenith angle [rad]
phiPMT azimuth angle [rad]
t1arrival time relative to Cherenkov hypothesis [ns]
Returns
hypothesis value

Definition at line 235 of file JPDF_t.hh.

240 {
241 using namespace JPP;
242
243 result_type h1 = (pdfA(R, theta, phi, t1) +
244 pdfB(R, theta, phi, t1) * E +
245 pdfC(R, theta, phi, t1) * JDeltaRays::getEnergyLossFromMuon(E));
246
247 // safety measures
248
249 if (h1.f <= 0.0) {
250 h1.f = 0.0;
251 h1.fp = 0.0;
252 }
253
254 if (h1.v <= 0.0) {
255 h1.v = 0.0;
256 }
257
258 return h1;
259 }
JFunction1D_t::result_type result_type
Definition JPDF_t.hh:145

Member Data Documentation

◆ pdfA

JPDF_t JMuonPDF_t::pdfA

PDF for minimum ionising particle.

Definition at line 261 of file JPDF_t.hh.

◆ pdfB

JPDF_t JMuonPDF_t::pdfB

PDF for average energy losses.

Definition at line 262 of file JPDF_t.hh.

◆ pdfC

JPDF_t JMuonPDF_t::pdfC

PDF for delta-rays.

Definition at line 263 of file JPDF_t.hh.


The documentation for this struct was generated from the following file: