Jpp  18.3.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::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, 1)
 

Public Attributes

const JModuleRouterrouter
 
size_t numberOfPrefits
 number of prefits More...
 
size_t numberOfOutfits
 number of fits to be saved in output More...
 
size_t minPrefitsSize
 number of prefits under which an event is treated as a very low energy one 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 roadWidth_m
 road width [m] More...
 
double ctMin
 minimal cosine space angle between PMT axes More...
 
JRange_t TWindow_ns
 time window for local coincidences [ns] for events with few prefits More...
 
JRange_t pos_grid_m
 edges in [m] of the position grid More...
 
double pos_step_m
 step in [m] of position grid More...
 
JRange_t time_grid_ns
 edges in [ns] of the time grid More...
 
double time_step_ns
 step in [ns] of time grid More...
 
double simplex_step_m
 step in [m] of JSimplex minimiser More...
 
double simplex_step_ns
 step in [ns] of JSimplex minimiser More...
 
double tukey_std_dev
 standard deviation of Tukey estimator More...
 
int NMax
 maximum number of iterations More...
 

Private Types

typedef JRegressor< JPoint4D,
JSimplex
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 67 of file JShowerPointSimplex.hh.

Member Typedef Documentation

Definition at line 74 of file JShowerPointSimplex.hh.

Definition at line 76 of file JShowerPointSimplex.hh.

Definition at line 77 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 88 of file JShowerPointSimplex.hh.

90  :
92  JRegressor_t(parameters.sigma_ns),
93  router(router)
94  {
95  using namespace JPP;
96 
99 
100  this->estimator.reset(new JMEstimatorTukey(tukey_std_dev));
101  }
static int debug
debug level (default is off).
Definition: JMessage.hh:45
JRegressor< JPoint4D, JSimplex > JRegressor_t
static int MAXIMUM_ITERATIONS
maximal number of iterations
Definition: JSimplex.hh:237
double tukey_std_dev
standard deviation of Tukey estimator
Tukey&#39;s biweight M-estimator.
Definition: JMEstimator.hh:105

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 109 of file JShowerPointSimplex.hh.

110  {
111  using namespace std;
112  using namespace JPP;
113 
114  const JBuildL0<hit_type> buildL0;
116 
117  buffer_type dataL0;
118  buffer_type dataL1;
119 
120  JEvt out;
121 
122  buildL0(JDAQTimeslice(event, true), router, back_inserter(dataL0));
123  buildL2(JDAQTimeslice(event, false), router, back_inserter(dataL1)); // false = triggered
124 
125  for (JEvt::const_iterator shower = in.begin(); shower != in.end(); ++shower) {
126 
127  JPoint4D vx(getPosition(*shower), shower->getT());
128 
130 
131  data.reserve(dataL0.size() + dataL1.size());
132 
134 
135  JRange<double> posGrid_m(0, 0);
136  JTimeRange timeGrid_ns(0, 0);
137 
138  /*
139  * part to help the reco of events with few hits:
140  * in this case a bigger time window in the hit selection and
141  * a grid in position and time are considered.
142  */
143  if(in.size() <= minPrefitsSize){
144 
146 
147  posGrid_m = pos_grid_m;
148  timeGrid_ns = time_grid_ns;
149  }
150 
151  for (buffer_type::const_iterator i = dataL1.begin(); i != dataL1.end(); ++i) {
152 
153  if (match(*i)) {
154  data.push_back(*i);
155  }
156  }
157 
158  buffer_type::iterator __end = data.end();
159 
160  for (buffer_type::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
161  if (find_if(data.begin(), __end, make_predicate(&hit_type::getModuleID, i->getModuleID())) == __end) {
162  if (match(*i)) {
163  data.push_back(*i);
164  }
165  }
166  }
167 
168  const int NDF = getCount(data.begin(), data.end()) - this->step.size();
169 
170  if (NDF > 0) {
171 
172  for(double x = posGrid_m.getLowerLimit(); x <= posGrid_m.getUpperLimit(); x += pos_step_m){
173  for(double y = posGrid_m.getLowerLimit(); y <= posGrid_m.getUpperLimit(); y += pos_step_m){
174  for(double z = posGrid_m.getLowerLimit(); z <= posGrid_m.getUpperLimit(); z += pos_step_m){
175  for(double t = timeGrid_ns.getLowerLimit(); t <= timeGrid_ns.getUpperLimit(); t += time_step_ns){
176 
177  JPoint4D vxs(JVector3D(vx.getX() + x, vx.getY() + y, vx.getZ() + z), vx.getT() + t);
178 
179  this->step.resize(4);
180  this->step[0] = JPoint4D(JVector3D(simplex_step_m, 0.0, 0.0), 0.0);
181  this->step[1] = JPoint4D(JVector3D(0.0, simplex_step_m, 0.0), 0.0);
182  this->step[2] = JPoint4D(JVector3D(0.0, 0.0, simplex_step_m), 0.0);
183  this->step[3] = JPoint4D(JVector3D(), simplex_step_ns);
184 
185  double chi2 = (*this)(vxs, data.begin(), data.end());
186 
187  JShower3E sh_fit(this->value.getPosition(), JDirection3D(),
188  this->value.getT(), shower->getE());
189 
190  out.push_back(getFit(JHistory(shower->getHistory()).add(JSHOWERPOINTSIMPLEX), sh_fit,
191  getQuality(chi2, NDF), NDF, sh_fit.getE()));
192 
193  }
194  }
195  }
196  }
197  }
198  }
199  return out;
200  }
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
Data structure for vertex fit.
Definition: JPoint4D.hh:22
JRange_t pos_grid_m
edges in [m] of the position grid
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.
3D track with energy.
Definition: JTrack3E.hh:30
double getQuality(const double chi2, const int N, const int NDF)
Get quality of fit.
JRange_t TWindow_ns
time window for local coincidences [ns] for events with few prefits
Template L2 builder.
Definition: JBuildL2.hh:45
Data structure for vector in three dimensions.
Definition: JVector3D.hh:34
Acoustic event fit.
double TMaxLocal_ns
time window for local coincidences [ns]
Data time slice.
double simplex_step_ns
step in [ns] of JSimplex minimiser
Data structure for L2 parameters.
JFIT::JHistory JHistory
Definition: JHistory.hh:354
double TMax_ns
maximum time for local coincidences [ns]
size_t minPrefitsSize
number of prefits under which an event is treated as a very low energy one
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.
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 34 of file JShowerPointSimplexParameters_t.hh.

35  {
36  numberOfPrefits = 0; // 0 means process all inputs
37  numberOfOutfits = 100;
38  minPrefitsSize = 8;
39  sigma_ns = 1;
40  TMaxLocal_ns = 10;
41  TMax_ns = 60.0;
42  TMin_ns = -60.0;
43  roadWidth_m = 50.0;
44  ctMin = 0.2;
45  TWindow_ns = JRange_t(-130, 120);
46  pos_grid_m = JRange_t( -20, 20);
47  pos_step_m = 20;
48  time_grid_ns = JRange_t( -90, 90);
49  time_step_ns = 20;
50  simplex_step_m = 5;
51  simplex_step_ns = 10;
52  tukey_std_dev = 20;
53  NMax = 1000;
54  }
JRange_t pos_grid_m
edges in [m] of the position grid
JRange_t TWindow_ns
time window for local coincidences [ns] for events with few prefits
size_t numberOfOutfits
number of fits to be saved in output
double TMaxLocal_ns
time window for local coincidences [ns]
double simplex_step_ns
step in [ns] of JSimplex minimiser
double TMax_ns
maximum time for local coincidences [ns]
size_t minPrefitsSize
number of prefits under which an event is treated as a very low energy one
double TMin_ns
minimum time for local coincidences [ns]
double tukey_std_dev
standard deviation of Tukey estimator
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 62 of file JShowerPointSimplexParameters_t.hh.

63  {
64  return (this->numberOfPrefits == parameters.numberOfPrefits &&
65  this->numberOfOutfits == parameters.numberOfOutfits &&
66  this->minPrefitsSize == parameters.minPrefitsSize &&
67  this->sigma_ns == parameters.sigma_ns &&
68  this->TMaxLocal_ns == parameters.TMaxLocal_ns &&
69  this->TMax_ns == parameters.TMax_ns &&
70  this->TMin_ns == parameters.TMin_ns &&
71  this->roadWidth_m == parameters.roadWidth_m &&
72  this->ctMin == parameters.ctMin &&
73  this->TWindow_ns == parameters.TWindow_ns &&
74  this->pos_grid_m == parameters.pos_grid_m &&
75  this->pos_step_m == parameters.pos_step_m &&
76  this->time_grid_ns == parameters.time_grid_ns &&
77  this->time_step_ns == parameters.time_step_ns &&
78  this->simplex_step_m == parameters.simplex_step_m &&
79  this->simplex_step_ns == parameters.simplex_step_ns &&
80  this->tukey_std_dev == parameters.tukey_std_dev &&
81  this->NMax == parameters.NMax);
82  }
*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 201 of file JShowerPointSimplex.hh.

size_t JRECONSTRUCTION::JShowerPointSimplexParameters_t::numberOfPrefits
inherited

number of prefits

Definition at line 86 of file JShowerPointSimplexParameters_t.hh.

size_t JRECONSTRUCTION::JShowerPointSimplexParameters_t::numberOfOutfits
inherited

number of fits to be saved in output

Definition at line 87 of file JShowerPointSimplexParameters_t.hh.

size_t JRECONSTRUCTION::JShowerPointSimplexParameters_t::minPrefitsSize
inherited

number of prefits under which an event is treated as a very low energy one

Definition at line 88 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::sigma_ns
inherited

time resolution [ns]

Definition at line 89 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::TMaxLocal_ns
inherited

time window for local coincidences [ns]

Definition at line 90 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::TMax_ns
inherited

maximum time for local coincidences [ns]

Definition at line 91 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::TMin_ns
inherited

minimum time for local coincidences [ns]

Definition at line 92 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::roadWidth_m
inherited

road width [m]

Definition at line 93 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::ctMin
inherited

minimal cosine space angle between PMT axes

Definition at line 94 of file JShowerPointSimplexParameters_t.hh.

JRange_t JRECONSTRUCTION::JShowerPointSimplexParameters_t::TWindow_ns
inherited

time window for local coincidences [ns] for events with few prefits

Definition at line 95 of file JShowerPointSimplexParameters_t.hh.

JRange_t JRECONSTRUCTION::JShowerPointSimplexParameters_t::pos_grid_m
inherited

edges in [m] of the position grid

Definition at line 96 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::pos_step_m
inherited

step in [m] of position grid

Definition at line 97 of file JShowerPointSimplexParameters_t.hh.

JRange_t JRECONSTRUCTION::JShowerPointSimplexParameters_t::time_grid_ns
inherited

edges in [ns] of the time grid

Definition at line 98 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::time_step_ns
inherited

step in [ns] of time grid

Definition at line 99 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::simplex_step_m
inherited

step in [m] of JSimplex minimiser

Definition at line 100 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::simplex_step_ns
inherited

step in [ns] of JSimplex minimiser

Definition at line 101 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::tukey_std_dev
inherited

standard deviation of Tukey estimator

Definition at line 102 of file JShowerPointSimplexParameters_t.hh.

int JRECONSTRUCTION::JShowerPointSimplexParameters_t::NMax
inherited

maximum number of iterations

Definition at line 103 of file JShowerPointSimplexParameters_t.hh.


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