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 | List of all members
JRECONSTRUCTION::JShowerPointSimplex Class Reference

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

#include <JShowerPointSimplex.hh>

Inheritance diagram for JRECONSTRUCTION::JShowerPointSimplex:
JRECONSTRUCTION::JShowerPointSimplexParameters_t JFIT::JRegressor< JModel_t, JMinimiser_t > TObject

Public Member Functions

 JShowerPointSimplex (const JShowerPointSimplexParameters_t &parameters, const JModuleRouter &router, 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 JShowerPointSimplexParameters_t &parameters) const
 Equality. More...
 
 ClassDef (JShowerPointSimplexParameters_t, 2)
 

Public Attributes

const JModuleRouterrouter
 
size_t numberOfPrefits
 number of prefits More...
 
double sigma_ns
 time resolution [ns] More...
 
double TMaxLocal_ns
 time window for local coincidences [ns] 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 ctMin
 minimal cosine space angle between PMT axes More...
 
int mestimator
 m-estimator More...
 
int NMax
 maximum number of iterations More...
 

Private Types

typedef JRegressor< JPoint4D,
JGandalf
JRegressor_t
 
typedef JTRIGGER::JHitR1 hit_type
 
typedef std::vector< hit_typebuffer_type
 

Detailed Description

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

Definition at line 68 of file JShowerPointSimplex.hh.

Member Typedef Documentation

Definition at line 75 of file JShowerPointSimplex.hh.

Definition at line 77 of file JShowerPointSimplex.hh.

Definition at line 78 of file JShowerPointSimplex.hh.

Constructor & Destructor Documentation

JRECONSTRUCTION::JShowerPointSimplex::JShowerPointSimplex ( const JShowerPointSimplexParameters_t parameters,
const JModuleRouter router,
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.
debugdebug

Definition at line 89 of file JShowerPointSimplex.hh.

91  :
93  JRegressor_t(parameters.sigma_ns),
94  router(router)
95  {
96  using namespace JPP;
97 
100  JRegressor_t::EPSILON = 1e-4;
101  //this->estimator.reset(new JMEstimatorTukey(tukey_std_dev));
102  this->estimator.reset(getMEstimator(parameters.mestimator));
103  this->parameters.resize(4);
104  this->parameters[0] = JPoint4D::pX();
105  this->parameters[1] = JPoint4D::pY();
106  this->parameters[2] = JPoint4D::pZ();
107  this->parameters[3] = JPoint4D::pT();
108  }
static int debug
debug level (default is off).
Definition: JMessage.hh:45
static double EPSILON
maximal distance to minimum
Definition: JGandalf.hh:336
static parameter_type pT()
Definition: JPoint4D.hh:61
static parameter_type pZ()
Definition: JPoint4D.hh:60
static parameter_type pX()
Definition: JPoint4D.hh:58
static parameter_type pY()
Definition: JPoint4D.hh:59
static int MAXIMUM_ITERATIONS
maximal number of iterations
Definition: JGandalf.hh:335
JMEstimator * getMEstimator(const int type)
Get M-Estimator.
Definition: JMEstimator.hh:203
JRegressor< JPoint4D, JGandalf > JRegressor_t
int debug
debug level

Member Function Documentation

JEvt JRECONSTRUCTION::JShowerPointSimplex::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 116 of file JShowerPointSimplex.hh.

117  {
118  using namespace std;
119  using namespace JPP;
120 
121  const JBuildL0<hit_type> buildL0;
123 
124  buffer_type dataL0;
125  buffer_type dataL1;
126 
127  JEvt out;
128 
129  buildL0(JDAQTimeslice(event, true), router, back_inserter(dataL0));
130  buildL2(JDAQTimeslice(event, false), router, back_inserter(dataL1)); // false = triggered
131 
132  for (JEvt::const_iterator shower = in.begin(); shower != in.end(); ++shower) {
133 
134  JPoint4D vx(getPosition(*shower), shower->getT());
135 
136 
139 
140  data.reserve(dataL0.size() + dataL1.size());
141  for (buffer_type::const_iterator i = dataL1.begin(); i != dataL1.end(); ++i) {
142 
143  if (match(*i)) {
144  data.push_back(*i);
145  }
146  }
147 
148  buffer_type::iterator __end = data.end();
149 
150  for (buffer_type::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
151  if (find_if(data.begin(), __end, make_predicate(&hit_type::getModuleID, i->getModuleID())) == __end) {
152  if (match(*i)) {
153  data.push_back(*i);
154  }
155  }
156  }
157 
158  const int NDF = getCount(data.begin(), data.end()) - this->parameters.size();
159 
160  if (NDF > 0) {
161 
162  double chi2 = (*this)(vx, data.begin(), data.end());
163 
164  JShower3E sh_fit(this->value.getPosition(),
165  JDirection3D(),
166  this->value.getT(),
167  shower->getE());
168  out.push_back(getFit(JHistory(shower->getHistory()).add(JSHOWERPOINTSIMPLEX), sh_fit, getQuality(chi2, NDF), NDF, sh_fit.getE()));
169  }
170  }
171 
172 
173  return out;
174  }
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
Definition: JPredicate.hh:128
int getModuleID() const
Get module identifier.
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:33
double DMax_m
maximal distance to optical module [m]
size_t getCount(const array_type< T > &buffer, const JCompare_t &compare)
Count number of unique values.
Definition: JVectorize.hh:261
Data structure for vertex fit.
Definition: JPoint4D.hh:22
static const int JSHOWERPOINTSIMPLEX
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.
Template L2 builder.
Definition: JBuildL2.hh:45
Acoustic event fit.
double TMaxLocal_ns
time window for local coincidences [ns]
Data time slice.
Data structure for L2 parameters.
JFIT::JHistory JHistory
Definition: JHistory.hh:354
double TMax_ns
maximum time for local coincidences [ns]
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.
double TMin_ns
minimum time for local coincidences [ns]
Template L0 hit builder.
Definition: JBuildL0.hh:35
double ctMin
minimal cosine space angle between PMT axes
Template specialisation of class JModel to match hit with bright point.
Definition: JFit/JModel.hh:121
JTOOLS::JRange< double > JTimeRange
Type definition for time range (unit [s]).
void JRECONSTRUCTION::JShowerPointSimplexParameters_t::reset ( )
inlineinherited

Reset fit parameters.

Definition at line 35 of file JShowerPointSimplexParameters_t.hh.

36  {
37  numberOfPrefits = 0; // 0 means process all inputs
38  sigma_ns = 1;
39  TMaxLocal_ns = 10;
40  TMax_ns = 60.0;
41  TMin_ns = -60.0;
42  DMax_m = 50.0;
43  ctMin = 0.2;
45  NMax = 1000;
46  }
double DMax_m
maximal distance to optical module [m]
double TMaxLocal_ns
time window for local coincidences [ns]
double TMax_ns
maximum time for local coincidences [ns]
double TMin_ns
minimum time for local coincidences [ns]
double ctMin
minimal cosine space angle between PMT axes
bool JRECONSTRUCTION::JShowerPointSimplexParameters_t::equals ( const JShowerPointSimplexParameters_t parameters) const
inlineinherited

Equality.

Parameters
parametersfit parameters
Returns
true if equals; else false

Definition at line 54 of file JShowerPointSimplexParameters_t.hh.

55  {
56  return (this->numberOfPrefits == parameters.numberOfPrefits &&
57  this->sigma_ns == parameters.sigma_ns &&
58  this->TMaxLocal_ns == parameters.TMaxLocal_ns &&
59  this->TMax_ns == parameters.TMax_ns &&
60  this->TMin_ns == parameters.TMin_ns &&
61  this->DMax_m == parameters.DMax_m &&
62  this->ctMin == parameters.ctMin &&
63  this->mestimator == parameters.mestimator &&
64  this->NMax == parameters.NMax
65  );
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::JShowerPointSimplexParameters_t::ClassDef ( JShowerPointSimplexParameters_t  ,
 
)
inherited

Member Data Documentation

const JModuleRouter& JRECONSTRUCTION::JShowerPointSimplex::router

Definition at line 175 of file JShowerPointSimplex.hh.

size_t JRECONSTRUCTION::JShowerPointSimplexParameters_t::numberOfPrefits
inherited

number of prefits

Definition at line 70 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::sigma_ns
inherited

time resolution [ns]

Definition at line 71 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::TMaxLocal_ns
inherited

time window for local coincidences [ns]

Definition at line 72 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::TMax_ns
inherited

maximum time for local coincidences [ns]

Definition at line 73 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::TMin_ns
inherited

minimum time for local coincidences [ns]

Definition at line 74 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::DMax_m
inherited

maximal distance to optical module [m]

Definition at line 75 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::ctMin
inherited

minimal cosine space angle between PMT axes

Definition at line 76 of file JShowerPointSimplexParameters_t.hh.

int JRECONSTRUCTION::JShowerPointSimplexParameters_t::mestimator
inherited

m-estimator

Definition at line 77 of file JShowerPointSimplexParameters_t.hh.

int JRECONSTRUCTION::JShowerPointSimplexParameters_t::NMax
inherited

maximum number of iterations

Definition at line 78 of file JShowerPointSimplexParameters_t.hh.


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