UnivTimeKGTester.cc
Go to the documentation of this file.
1 
11 #include "UnivTimeKGTester.h"
12 
13 #include <utl/ErrorLogger.h>
14 
15 #include <tls/Atmosphere.h>
16 #include <tls/UnivParam.h>
17 #include <tls/UnivTimeKGLogNormal.h>
18 #include <tls/UnivTimeKGGamma.h>
19 
20 #include <iostream>
21 
22 using namespace fwk;
23 using namespace utl;
24 using namespace std;
25 
26 namespace UnivTimeKGTester {
27 
28 
31  {
32  return eSuccess;
33  }
34 
35 
37  UnivTimeKGTester::Run(evt::Event& /*event*/)
38  {
39  // initialize time models and fill parameters from xml files
40  vector<UnivTimeKG::TimeModel*> timeModels;
41 
42  for (int icomp = 0; icomp < 4; ++icomp) {
43  timeModels.push_back(new UnivTimeKG::GammaTimeModel(icomp));
44  //timeModels.push_back(new UnivTimeKG::LogNormalTimeModel(icomp));
45  }
46 
47  UnivParamNS::UnivParam fpar(0); // 0: Model for Water Cherenkov Detector
48  AtmosphereNS::Atmosphere fatm("monthly");
49  fatm.SetCurrentAtmosphere(1);
50 
51  const double gpercm2 = utl::gram / utl::cm2;
52 
53  double density = 1.04e-3 * gram / cm3;
54  double xmax_eg = 800 * gpercm2;
55  //double xmax_mu = 500 * gpercm2;
56  double Nmu = 1.0;
57  double logE = 19.0;
58  double theta = 36 * degree;
59 
60  double height = 1400 * meter;
61  int month = 4;
62  int sigComp = 1; // 1: pure electromagnetic signal
63 
64  double tracebinning = 25 * nanosecond;
65 
66  double rho = 1000 * meter;
67  double psi = 90 * degree;
68 
69  double DX = fatm.Get_DX_DL_i(rho / cm, psi, xmax_eg / gpercm2, theta, height / cm, false, true) * gpercm2;
70 
71  //double integratedSignal = 30.;
72  double integratedSignal = fpar.GetSignal(rho / cm, xmax_eg / gpercm2, logE,
73  theta, psi, density / (gram / cm3), height / cm,
74  Nmu, sigComp, month);
75 
76  // time referred to plane front arrival
77  double planeFrontTime = 400 * nanosecond;
78  // arrival time of first particle (difference between curved and plane front, depending on X0)
79  double fpTime = 50 * nanosecond;
80 
81  timeModels[sigComp]->setShapeParameters(DX / gpercm2, rho, psi, theta, logE);
82  // total signal of this component in the station
83  double S = timeModels[sigComp]->pdf(planeFrontTime - fpTime) * integratedSignal * tracebinning;
84 
85  cout << "S " << S << endl;
86 
87  double Scdf = timeModels[sigComp]->cdf(planeFrontTime - fpTime);
88 
89  cout << "cdf S (normed)" << Scdf << endl;
90 
91  double tinv = fpTime + timeModels[sigComp]->invcdf(Scdf);
92 
93  cout << "t " << tinv << endl;
94 
95  double pftimeit = fpTime;
96  double cdf = 0;
97 
98  while (cdf < 0.99) {
99  cdf = timeModels[sigComp]->cdf(pftimeit - fpTime);
100  cout << "rel. time [ns]: " << pftimeit << ", CDF (normed): " << cdf << endl;
101  pftimeit += 25;
102  }
103 
104  double startTimeProb = timeModels[0]->firstParticlePdfSmeared(planeFrontTime - fpTime, 20);
105 
106  cout << "start time probability: " << startTimeProb << endl;
107 
108  return eSuccess;
109  }
110 
111 
113  UnivTimeKGTester::Finish()
114  {
115  return eSuccess;
116  }
117 
118 }
const double degree
constexpr double cm3
Definition: AugerUnits.h:119
const double meter
Definition: GalacticUnits.h:29
void Init()
Initialise the registry.
const double tracebinning
Definition: FitterUtil.h:11
double GetSignal(double r, double XmaxEdep, double logE, double theta, double psi, double rhoGround, double hGround, double Nmu, int icomp0, int iatm)
Definition: UnivParam.cc:202
float Get_DX_DL_i(float r, float psi, float SlantDepth, float theta, float hground, bool UseDL, bool IsDiffusive)
constexpr double nanosecond
Definition: AugerUnits.h:143
#define S
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
constexpr double cm
Definition: AugerUnits.h:117
constexpr double gram
Definition: AugerUnits.h:195
const double gpercm2
Definition: FitterUtil.h:9
constexpr double cm2
Definition: AugerUnits.h:118

, generated on Tue Sep 26 2023.