Jpp  18.2.0-rc.1
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 | List of all members
JRECONSTRUCTION::JShowerFit Class Reference

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

#include <JShowerFit.hh>

Inheritance diagram for JRECONSTRUCTION::JShowerFit:
JRECONSTRUCTION::JShowerFitParameters_t JFIT::JRegressor< JModel_t, JMinimiser_t > TObject

Public Member Functions

 JShowerFit (const JShowerFitParameters_t &parameters, const JModuleRouter &router, const JSummaryRouter &summary, const std::string pdfFile, const JShowerEnergyCorrection &correct, 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 JShowerFitParameters_t &parameters) const
 Equality. More...
 
 ClassDef (JShowerFitParameters_t, 1)
 

Public Attributes

const JModuleRouterrouter
 
const JSummaryRoutersummary
 
const JShowerEnergyCorrectioncorrect
 
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 roadWidth_m
 road width [m] More...
 
double R_Hz
 default rate [Hz] More...
 
int mestimator
 M-estimator. More...
 
double fit_step
 simplex initial step More...
 

Private Types

typedef JRegressor< JShower3EZ,
JSimplex
JRegressor_t
 

Detailed Description

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

Definition at line 73 of file JShowerFit.hh.

Member Typedef Documentation

Definition at line 78 of file JShowerFit.hh.

Constructor & Destructor Documentation

JRECONSTRUCTION::JShowerFit::JShowerFit ( const JShowerFitParameters_t parameters,
const JModuleRouter router,
const JSummaryRouter summary,
const std::string  pdfFile,
const JShowerEnergyCorrection correct,
const int  debug = 0 
)
inline

Parameterized constructor.

Parameters
parametersstruct that holds default-optimized parameters for the reconstruction, available in $JPP_DATA.
routermodule router, this is built via detector file.
summarysummary router
pdfFilePDF file
correctenergy correction
debugdebug

Definition at line 93 of file JShowerFit.hh.

98  :
99  JShowerFitParameters_t(parameters),
100  JRegressor_t(pdfFile),
101  router(router),
102  summary(summary),
103  correct(correct)
104  {
105  using namespace JPP;
106 
108  JRegressor_t::T_ns.setRange(parameters.TMin_ns, parameters.TMax_ns);
109  JRegressor_t::Vmax_npe = 20.0;
111 
112  this->estimator.reset(getMEstimator(parameters.mestimator));
113  }
static int debug
debug level (default is off).
Definition: JMessage.hh:45
double TMax_ns
maximum time for local coincidences [ns]
double TMin_ns
minimum time for local coincidences [ns]
const JModuleRouter & router
Definition: JShowerFit.hh:199
const JShowerEnergyCorrection & correct
Definition: JShowerFit.hh:201
const JSummaryRouter & summary
Definition: JShowerFit.hh:200
static double Vmax_npe
Maximal integral of PDF [npe].
JRegressor< JShower3EZ, JSimplex > JRegressor_t
Definition: JShowerFit.hh:78
static int MAXIMUM_ITERATIONS
maximal number of iterations
Definition: JSimplex.hh:237
JMEstimator * getMEstimator(const int type)
Get M-Estimator.
Definition: JMEstimator.hh:203
static JTimeRange T_ns
Time window with respect to Cherenkov hypothesis [ns].

Member Function Documentation

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

Declaration of the member function that actually performs the reconstruction.

Parameters
event= JDAQEvent
in= input fits

Definition at line 121 of file JShowerFit.hh.

122  {
123  using namespace std;
124  using namespace JPP;
125 
126  typedef vector<JHitL0> JDataL0_t;
127  JBuildL0<JHitL0> buildL0;
128 
129  JEvt out;
130 
132 
133  JDataL0_t dataL0;
134  buildL0(JDAQTimeslice(event, true), router, back_inserter(dataL0));
135 
136  for (JEvt::const_iterator shower = in.begin(); shower != in.end(); ++shower) {
137 
138  JShower3E sh(getPosition(*shower), getDirection(*shower), shower->getT(), shower->getE());
139 
141 
142  const JFIT::JModel<JPoint4D> match(JPoint4D(sh.getPosition(), sh.getT()), roadWidth_m, JRegressor_t::T_ns);
143 
144  for (JDataL0_t::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
145 
146  if (match(*i)) {
147  top.insert(i->getPMTIdentifier());
148  }
149  }
150 
151  JDetectorSubset_t subdetector(detector, sh.getPosition(), roadWidth_m);
152 
153  const JDirection3D conversion(sh.getDirection());
154  const JRotation3D R(conversion);
155 
156  vector<JPMTW0> buffer;
157 
158  for (JDetectorSubset_t::iterator module = subdetector.begin();
159  module != subdetector.end(); ++module) {
160 
161  JModule dom(*module);
162  dom.rotate(R);
163 
164  for (unsigned int i = 0; i != dom.size(); ++i) {
165 
166  const JDAQPMTIdentifier id(dom.getID(), i);
167 
168  const double rate_Hz = summary.getRate(id);
169 
170  buffer.push_back(JPMTW0(dom.getPMT(i), rate_Hz, top.count(id)));
171  }
172  }
173 
174  this->step.resize(2);
175  this->step[0] = JShower3EZ(JPoint4D(JVector3D(), 0.0), JVersor3Z(fit_step, 0.0), JEnergy(0.4));
176  this->step[1] = JShower3EZ(JPoint4D(JVector3D(), 0.0), JVersor3Z(0.0, fit_step), JEnergy(0.4));
177 
178  double chi2 = (*this)(JShower3EZ(JVertex3D(JVector3D(0,0,0), sh.getT()), JVersor3Z(),
179  JEnergy(log10(sh.getE()))), buffer.begin(), buffer.end());
180 
181  double NDF = getCount(buffer.begin(), buffer.end()) - this->step.size();
182 
183  JShower3E sh_fit(this->value.getPosition(), this->value.getDirection(),
184  this->value.getT(), correct(this->value.getE()));
185 
186  sh_fit.rotate_back(R);
187 
188  sh_fit.add(sh.getPosition());
189 
190  out.push_back(getFit(JHistory(shower->getHistory()).add(JSHOWERCOMPLETEFIT), sh_fit, getQuality(chi2),
191  NDF, sh_fit.getE()));
192 
193  out.rbegin()->setW(JSHOWERFIT_ENERGY, this->value.getE()); // Uncorrected Energy
194  }
195 
196  return out;
197  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:33
Data structure for a composite optical module.
Definition: JModule.hh:68
Template specialisation of L0 builder for JHitL0 data type.
Definition: JBuildL0.hh:102
Auxiliary class for handling PMT geometry, rate and response.
Definition: JPMTW0.hh:22
Data structure for vertex fit.
Definition: JPoint4D.hh:22
Detector data structure.
Definition: JDetector.hh:89
Rotation matrix.
Definition: JRotation3D.hh:111
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.
const JModuleRouter & router
Definition: JShowerFit.hh:199
3D track with energy.
Definition: JTrack3E.hh:30
double getQuality(const double chi2, const int N, const int NDF)
Get quality of fit.
const JShowerEnergyCorrection & correct
Definition: JShowerFit.hh:201
const JSummaryRouter & summary
Definition: JShowerFit.hh:200
static const int JSHOWERFIT_ENERGY
uncorrected energy [GeV] from JShowerFit.cc
Data structure for fit of straight line in positive z-direction with energy.
Definition: JShower3EZ.hh:28
Detector file.
Definition: JHead.hh:226
Data structure for vector in three dimensions.
Definition: JVector3D.hh:34
Acoustic event fit.
set_variable E_E log10(E_{fit}/E_{#mu})"
JDirection3D getDirection(const JFit &fit)
Get direction.
Data time slice.
Detector subset without binary search functionality.
static const int JSHOWERCOMPLETEFIT
then JCookie sh JDataQuality D $DETECTOR_ID R
Definition: JDataQuality.sh:41
JFIT::JHistory JHistory
Definition: JHistory.hh:354
const JClass_t & getReference() const
Get reference to object.
Definition: JReference.hh:38
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
int getCount(const T &hit)
Get hit count.
Data structure for fit of energy.
Definition: JEnergy.hh:28
JPosition3D getPosition(const JFit &fit)
Get position.
Template specialisation of class JModel to match hit with bright point.
Definition: JFit/JModel.hh:121
Data structure for normalised vector in positive z-direction.
Definition: JVersor3Z.hh:39
static JTimeRange T_ns
Time window with respect to Cherenkov hypothesis [ns].
void JRECONSTRUCTION::JShowerFitParameters_t::reset ( )
inlineinherited

Reset fit parameters.

Definition at line 35 of file JShowerFitParameters_t.hh.

36  {
37  numberOfPrefits = 4;
38  TMax_ns = 30;
39  TMin_ns = -30;
40  roadWidth_m = 80;
41  R_Hz = 10.0e3;
43  fit_step = 0.05;
44  }
double TMax_ns
maximum time for local coincidences [ns]
double TMin_ns
minimum time for local coincidences [ns]
bool JRECONSTRUCTION::JShowerFitParameters_t::equals ( const JShowerFitParameters_t parameters) const
inlineinherited

Equality.

Parameters
parametersfit parameters
Returns
true if equals; else false

Definition at line 52 of file JShowerFitParameters_t.hh.

53  {
54  return (this->TMax_ns == parameters.TMax_ns &&
55  this->TMin_ns == parameters.TMin_ns &&
56  this->numberOfPrefits == parameters.numberOfPrefits &&
57  this->roadWidth_m == parameters.roadWidth_m &&
58  this->R_Hz == parameters.R_Hz &&
59  this->mestimator == parameters.mestimator &&
60  this->fit_step == parameters.fit_step);
61  }
double TMax_ns
maximum time for local coincidences [ns]
*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::JShowerFitParameters_t::ClassDef ( JShowerFitParameters_t  ,
 
)
inherited

Member Data Documentation

const JModuleRouter& JRECONSTRUCTION::JShowerFit::router

Definition at line 199 of file JShowerFit.hh.

const JSummaryRouter& JRECONSTRUCTION::JShowerFit::summary

Definition at line 200 of file JShowerFit.hh.

const JShowerEnergyCorrection& JRECONSTRUCTION::JShowerFit::correct

Definition at line 201 of file JShowerFit.hh.

size_t JRECONSTRUCTION::JShowerFitParameters_t::numberOfPrefits
inherited

number of prefits

Definition at line 66 of file JShowerFitParameters_t.hh.

double JRECONSTRUCTION::JShowerFitParameters_t::TMax_ns
inherited

maximum time for local coincidences [ns]

Definition at line 67 of file JShowerFitParameters_t.hh.

double JRECONSTRUCTION::JShowerFitParameters_t::TMin_ns
inherited

minimum time for local coincidences [ns]

Definition at line 68 of file JShowerFitParameters_t.hh.

double JRECONSTRUCTION::JShowerFitParameters_t::roadWidth_m
inherited

road width [m]

Definition at line 69 of file JShowerFitParameters_t.hh.

double JRECONSTRUCTION::JShowerFitParameters_t::R_Hz
inherited

default rate [Hz]

Definition at line 70 of file JShowerFitParameters_t.hh.

int JRECONSTRUCTION::JShowerFitParameters_t::mestimator
inherited

M-estimator.

Definition at line 71 of file JShowerFitParameters_t.hh.

double JRECONSTRUCTION::JShowerFitParameters_t::fit_step
inherited

simplex initial step

Definition at line 72 of file JShowerFitParameters_t.hh.


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