Jpp  19.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Private Types | Private Attributes | List of all members
JRECONSTRUCTION::JShowerPositionFit Class Reference

class to handle the second position fit of the shower reconstruction, mainly dedicated for ORCA More...

#include <JShowerPositionFit.hh>

Inheritance diagram for JRECONSTRUCTION::JShowerPositionFit:
JRECONSTRUCTION::JShowerPositionFitParameters_t JFIT::JRegressor< JModel_t, JMinimiser_t > TObject

Public Member Functions

 JShowerPositionFit (const JShowerPositionFitParameters_t &parameters, const JModuleRouter &router, const JSummaryRouter &summary, const std::string pdfFile, const int debug=0)
 Parameterized constructor. More...
 
JEvt operator() (const KM3NETDAQ::JDAQEvent &event, const JFIT::JEvt &in)
 Declaration of the member function that actually performs the reconstruction. More...
 
void reset ()
 Reset fit parameters. More...
 
bool equals (const JShowerPositionFitParameters_t &parameters) const
 Equality. More...
 
 ClassDef (JShowerPositionFitParameters_t, 2)
 

Public Attributes

const JModuleRouterrouter
 
const JSummaryRoutersummary
 
size_t numberOfPrefits
 number of prefits More...
 
double TMax_ns
 maximum time for local coincidences [ns] More...
 
double TMin_ns
 minimum time for local coincidences [ns] More...
 
double DMax_m
 maximal distance to optical module [m] More...
 
double Emin_GeV
 minimum energy to scan More...
 
double Emax_GeV
 maximum energy to scan More...
 
int En
 number of points to scan in energy range More...
 
double R_Hz
 default rate [Hz] More...
 
double TTS_ns
 transition-time spread [ns] More...
 
double VMax_npe
 maximum number of of photo-electrons More...
 
int NMax
 maximum number of iterations More...
 

Private Types

typedef JRegressor< JPoint4E,
JGandalf
JRegressor_t
 

Private Attributes

std::vector< double > Ev
 

Detailed Description

class to handle the second position fit of the shower reconstruction, mainly dedicated for ORCA

Definition at line 73 of file JShowerPositionFit.hh.

Member Typedef Documentation

Definition at line 80 of file JShowerPositionFit.hh.

Constructor & Destructor Documentation

JRECONSTRUCTION::JShowerPositionFit::JShowerPositionFit ( const JShowerPositionFitParameters_t parameters,
const JModuleRouter router,
const JSummaryRouter summary,
const std::string  pdfFile,
const int  debug = 0 
)
inline

Parameterized constructor.

Parameters
parametersstruct that holds default-optimized parameters for the reconstruction
routermodule router, this is built via detector file.
summarysummary router
pdfFilefile name with PDF
debugdebug

Definition at line 94 of file JShowerPositionFit.hh.

98  :
100  JRegressor_t(pdfFile, parameters.TTS_ns),
101  router(router),
102  summary(summary)
103  {
104  using namespace JPP;
105 
107  JRegressor_t::T_ns.setRange(parameters.TMin_ns, parameters.TMax_ns);
110  JRegressor_t::EPSILON = 1e-3;
111 
112  if (Emin_GeV > Emax_GeV || En <= 1) {
113  THROW(JException, "Invalid energy input " << Emin_GeV << ' ' << Emax_GeV << ' ' << En);
114  }
115 
116  const double base = std::pow((Emax_GeV / Emin_GeV), 1.0 / (En - 1));
117 
118  for (int i = 0; i != En; ++i) {
119  Ev.push_back(Emin_GeV * std::pow(base, i));
120  }
121 
122  this->parameters.resize(4);
123 
124  this->parameters[0] = JPoint4E::pX();
125  this->parameters[1] = JPoint4E::pY();
126  this->parameters[2] = JPoint4E::pZ();
127  this->parameters[3] = JPoint4E::pT();
128  }
static int debug
debug level (default is off).
Definition: JMessage.hh:45
General exception.
Definition: JException.hh:24
static double EPSILON
maximal distance to minimum
Definition: JGandalf.hh:336
JRegressor< JPoint4E, JGandalf > JRegressor_t
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
static double Vmax_npe
Maximal integral of PDF [npe].
double TMin_ns
minimum time for local coincidences [ns]
double VMax_npe
maximum number of of photo-electrons
static JTimeRange T_ns
Time window with respect to Cherenkov hypothesis [ns].
double TMax_ns
maximum time for local coincidences [ns]
int En
number of points to scan in energy range
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:97
static parameter_type pT()
Definition: JPoint4E.hh:72
static parameter_type pX()
Definition: JPoint4E.hh:69
static parameter_type pY()
Definition: JPoint4E.hh:70
static int MAXIMUM_ITERATIONS
maximal number of iterations
Definition: JGandalf.hh:335
int debug
debug level
static parameter_type pZ()
Definition: JPoint4E.hh:71

Member Function Documentation

JEvt JRECONSTRUCTION::JShowerPositionFit::operator() ( const KM3NETDAQ::JDAQEvent event,
const JFIT::JEvt in 
)
inline

Declaration of the member function that actually performs the reconstruction.

Parameters
eventwhich is a JDAQEvent
ininput fits

Definition at line 136 of file JShowerPositionFit.hh.

137  {
138  using namespace std;
139  using namespace JPP;
140 
141  typedef vector<JHitL0> JDataL0_t;
142  const JBuildL0<JHitL0> buildL0;
143 
144  JEvt out;
145 
146  JDataL0_t dataL0;
147  buildL0(JDAQTimeslice(event, true), router, back_inserter(dataL0));
148 
149  for (JEvt::const_iterator shower = in.begin(); shower != in.end(); ++shower) {
150 
151  JPoint4D vx(getPosition(*shower), shower->getT());
152 
154 
156 
157  for (JDataL0_t::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
158 
159  const double rate_Hz = summary.getRate(*i);
160 
161  if (match(*i)) {
162  data.push_back(JHitW0(*i, rate_Hz));
163  }
164  }
165 
166  // select first hit
167 
168  sort(data.begin(), data.end(), JHitL0::compare);
169 
170  vector<JHitW0>::iterator __end = unique(data.begin(), data.end(), equal_to<JDAQPMTIdentifier>());
171 
172  const int NDF = distance(data.begin(), __end) - this->parameters.size();
173 
174  if (NDF > 0) {
175 
176  // set fit parameters
177  for (vector<double>::iterator i = Ev.begin(); i != Ev.end(); ++i) {
178  JPoint4E sh(vx, *i);
179  double chi2 = (*this)(sh, data.begin(), __end);
180 
181  JShower3E sh_fit(this->value.getPosition(), JDirection3D(),
182  this->value.getT(), this->value.getE());
183 
184  out.push_back(getFit(JHistory(shower->getHistory()).add(JSHOWERPOSITIONFIT), sh_fit,
185  getQuality(chi2), NDF, sh_fit.getE()));
186 
187  }
188  }
189  }
190 
191  return out;
192  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:33
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
Template specialisation of L0 builder for JHitL0 data type.
Definition: JBuildL0.hh:102
Data structure for vertex fit.
Definition: JPoint4D.hh:22
double getRate() const
Get default rate.
JFit getFit(const JHistory &history, const JTrack3D &track, const double Q, const int NDF, const double energy=0.0, const int status=SINGLE_STAGE)
Get fit.
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
3D track with energy.
Definition: JTrack3E.hh:30
double getQuality(const double chi2, const int N, const int NDF)
Get quality of fit.
static struct JTRIGGER::JHitL0::compare compare
static const int JSHOWERPOSITIONFIT
static JTimeRange T_ns
Time window with respect to Cherenkov hypothesis [ns].
Acoustic event fit.
Data structure for vertex fit.
Definition: JPoint4E.hh:22
double DMax_m
maximal distance to optical module [m]
Data time slice.
Auxiliary class for a hit with background rate value.
Definition: JHitW0.hh:21
JFIT::JHistory JHistory
Definition: JHistory.hh:354
then if[[!-f $DETECTOR]] then JDetector sh $DETECTOR fi cat $WORKDIR trigger_parameters txt<< EOFtrigger3DMuon.enabled=1;trigger3DMuon.numberOfHits=5;trigger3DMuon.gridAngle_deg=1;ctMin=0.0;TMaxLocal_ns=15.0;EOF set_variable TRIGGEREFFICIENCY_TRIGGERED_EVENTS_ONLY INPUT_FILES=() for((i=1;$i<=$NUMBER_OF_RUNS;++i));do JSirene.sh $DETECTOR $JPP_DATA/genhen.km3net_wpd_V2_0.evt.gz $WORKDIR/sirene_ ${i}.root JTriggerEfficiency.sh $DETECTOR $DETECTOR $WORKDIR/sirene_ ${i}.root $WORKDIR/trigger_efficiency_ ${i}.root $WORKDIR/trigger_parameters.txt $JPP_DATA/PMT_parameters.txt INPUT_FILES+=($WORKDIR/trigger_efficiency_ ${i}.root) done for ANGLE_DEG in $ANGLES_DEG[*];do set_variable SIGMA_NS 3.0 set_variable OUTLIERS 3 set_variable OUTPUT_FILE $WORKDIR/matrix\[${ANGLE_DEG}\deg\].root $JPP_DIR/examples/JReconstruction-f"$INPUT_FILES[*]"-o $OUTPUT_FILE-S ${SIGMA_NS}-A ${ANGLE_DEG}-O ${OUTLIERS}-d ${DEBUG}--!fiif[[$OPTION=="plot"]];then if((0));then for H1 in h0 h1;do JPlot1D-f"$WORKDIR/matrix["${^ANGLES_DEG}" deg].root:${H1}"-y"1 2e3"-Y-L TR-T""-\^"number of events [a.u.]"-> o chi2
Definition: JMatrixNZ.sh:106
JPosition3D getPosition(const JFit &fit)
Get position.
Template specialisation of class JModel to match hit with bright point.
Definition: JFit/JModel.hh:121
void JRECONSTRUCTION::JShowerPositionFitParameters_t::reset ( )
inlineinherited

Reset fit parameters.

Definition at line 32 of file JShowerPositionFitParameters_t.hh.

33  {
34  numberOfPrefits = 0; // process all inputs from PointSimplex, which should give a max of 100
35  TMax_ns = 100.0;
36  TMin_ns = -100.0;
37  DMax_m = 80.0;
38  R_Hz = 10000;
39  Emin_GeV = 1;
40  Emax_GeV = 200;
41  En = 10;
42  TTS_ns = 2;
43  VMax_npe = 20.0;
44  NMax = 1000;
45  }
double TMin_ns
minimum time for local coincidences [ns]
double VMax_npe
maximum number of of photo-electrons
double TMax_ns
maximum time for local coincidences [ns]
int En
number of points to scan in energy range
double DMax_m
maximal distance to optical module [m]
bool JRECONSTRUCTION::JShowerPositionFitParameters_t::equals ( const JShowerPositionFitParameters_t parameters) const
inlineinherited

Equality.

Parameters
parametersfit parameters
Returns
true if equals; else false

Definition at line 53 of file JShowerPositionFitParameters_t.hh.

54  {
55  return (this->numberOfPrefits == parameters.numberOfPrefits &&
56  this->TMax_ns == parameters.TMax_ns &&
57  this->TMin_ns == parameters.TMin_ns &&
58  this->DMax_m == parameters.DMax_m &&
59  this->R_Hz == parameters.R_Hz &&
60  this->TTS_ns == parameters.TTS_ns &&
61  this->Emin_GeV == parameters.Emin_GeV &&
62  this->Emax_GeV == parameters.Emax_GeV &&
63  this->En == parameters.En &&
64  this->VMax_npe == parameters.VMax_npe &&
65  this->NMax == parameters.NMax);
66  }
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
then usage $script< detector file >< detectorfile > nIf the range of floors is the first detector file is aligned to the second before the comparison nIn this
JRECONSTRUCTION::JShowerPositionFitParameters_t::ClassDef ( JShowerPositionFitParameters_t  ,
 
)
inherited

Member Data Documentation

std::vector<double> JRECONSTRUCTION::JShowerPositionFit::Ev
private

Definition at line 82 of file JShowerPositionFit.hh.

const JModuleRouter& JRECONSTRUCTION::JShowerPositionFit::router

Definition at line 195 of file JShowerPositionFit.hh.

const JSummaryRouter& JRECONSTRUCTION::JShowerPositionFit::summary

Definition at line 196 of file JShowerPositionFit.hh.

size_t JRECONSTRUCTION::JShowerPositionFitParameters_t::numberOfPrefits
inherited

number of prefits

Definition at line 70 of file JShowerPositionFitParameters_t.hh.

double JRECONSTRUCTION::JShowerPositionFitParameters_t::TMax_ns
inherited

maximum time for local coincidences [ns]

Definition at line 71 of file JShowerPositionFitParameters_t.hh.

double JRECONSTRUCTION::JShowerPositionFitParameters_t::TMin_ns
inherited

minimum time for local coincidences [ns]

Definition at line 72 of file JShowerPositionFitParameters_t.hh.

double JRECONSTRUCTION::JShowerPositionFitParameters_t::DMax_m
inherited

maximal distance to optical module [m]

Definition at line 73 of file JShowerPositionFitParameters_t.hh.

double JRECONSTRUCTION::JShowerPositionFitParameters_t::Emin_GeV
inherited

minimum energy to scan

Definition at line 74 of file JShowerPositionFitParameters_t.hh.

double JRECONSTRUCTION::JShowerPositionFitParameters_t::Emax_GeV
inherited

maximum energy to scan

Definition at line 75 of file JShowerPositionFitParameters_t.hh.

int JRECONSTRUCTION::JShowerPositionFitParameters_t::En
inherited

number of points to scan in energy range

Definition at line 76 of file JShowerPositionFitParameters_t.hh.

double JRECONSTRUCTION::JShowerPositionFitParameters_t::R_Hz
inherited

default rate [Hz]

Definition at line 77 of file JShowerPositionFitParameters_t.hh.

double JRECONSTRUCTION::JShowerPositionFitParameters_t::TTS_ns
inherited

transition-time spread [ns]

Definition at line 78 of file JShowerPositionFitParameters_t.hh.

double JRECONSTRUCTION::JShowerPositionFitParameters_t::VMax_npe
inherited

maximum number of of photo-electrons

Definition at line 79 of file JShowerPositionFitParameters_t.hh.

int JRECONSTRUCTION::JShowerPositionFitParameters_t::NMax
inherited

maximum number of iterations

Definition at line 80 of file JShowerPositionFitParameters_t.hh.


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