Jpp  15.0.1-rc.1-highqe
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...
 
JTOOLS::JRange< double > TWindow_ns
 time window for local coincidences [ns] for events with few prefits More...
 
JTOOLS::JRange< double > pos_grid_m
 edges in [m] of the position grid More...
 
double pos_step_m
 step in [m] of position grid More...
 
JTOOLS::JRange< double > 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 66 of file JShowerPointSimplex.hh.

Member Typedef Documentation

Definition at line 73 of file JShowerPointSimplex.hh.

Definition at line 75 of file JShowerPointSimplex.hh.

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

89  :
91  JRegressor_t(parameters.sigma_ns),
92  router(router)
93  {
94  using namespace JPP;
95 
98 
99  this->estimator.reset(new JMEstimatorTukey(tukey_std_dev));
100  }
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 108 of file JShowerPointSimplex.hh.

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

Reset fit parameters.

Definition at line 34 of file JShowerPointSimplexParameters_t.hh.

35  {
36  using namespace JPP;
37 
38  numberOfPrefits = 0; // 0 means process all inputs
39  numberOfOutfits = 100;
40  minPrefitsSize = 8;
41  sigma_ns = 1;
42  TMaxLocal_ns = 10;
43  TMax_ns = 60.0;
44  TMin_ns = -60.0;
45  roadWidth_m = 50.0;
46  ctMin = 0.2;
47  TWindow_ns = JRange<double>(-130, 120);
48  pos_grid_m = JRange<double>( -20, 20);
49  pos_step_m = 20;
50  time_grid_ns = JRange<double>( -90, 90);
51  time_step_ns = 20;
52  simplex_step_m = 5;
53  simplex_step_ns = 10;
54  tukey_std_dev = 20;
55  NMax = 1000;
56  }
JTOOLS::JRange< double > time_grid_ns
edges in [ns] of the time grid
size_t numberOfOutfits
number of fits to be saved in output
JTOOLS::JRange< double > pos_grid_m
edges in [m] of the position grid
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]
JTOOLS::JRange< double > TWindow_ns
time window for local coincidences [ns] for events with few prefits
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 64 of file JShowerPointSimplexParameters_t.hh.

65  {
66  return (this->numberOfPrefits == parameters.numberOfPrefits &&
67  this->numberOfOutfits == parameters.numberOfOutfits &&
68  this->minPrefitsSize == parameters.minPrefitsSize &&
69  this->sigma_ns == parameters.sigma_ns &&
70  this->TMaxLocal_ns == parameters.TMaxLocal_ns &&
71  this->TMax_ns == parameters.TMax_ns &&
72  this->TMin_ns == parameters.TMin_ns &&
73  this->roadWidth_m == parameters.roadWidth_m &&
74  this->ctMin == parameters.ctMin &&
75  this->TWindow_ns == parameters.TWindow_ns &&
76  this->pos_grid_m == parameters.pos_grid_m &&
77  this->pos_step_m == parameters.pos_step_m &&
78  this->time_grid_ns == parameters.time_grid_ns &&
79  this->time_step_ns == parameters.time_step_ns &&
80  this->simplex_step_m == parameters.simplex_step_m &&
81  this->simplex_step_ns == parameters.simplex_step_ns &&
82  this->tukey_std_dev == parameters.tukey_std_dev &&
83  this->NMax == parameters.NMax);
84  }
*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
JRECONSTRUCTION::JShowerPointSimplexParameters_t::ClassDef ( JShowerPointSimplexParameters_t  ,
 
)
inherited

Member Data Documentation

const JModuleRouter& JRECONSTRUCTION::JShowerPointSimplex::router

Definition at line 202 of file JShowerPointSimplex.hh.

size_t JRECONSTRUCTION::JShowerPointSimplexParameters_t::numberOfPrefits
inherited

number of prefits

Definition at line 88 of file JShowerPointSimplexParameters_t.hh.

size_t JRECONSTRUCTION::JShowerPointSimplexParameters_t::numberOfOutfits
inherited

number of fits to be saved in output

Definition at line 89 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 90 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::sigma_ns
inherited

time resolution [ns]

Definition at line 91 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::TMaxLocal_ns
inherited

time window for local coincidences [ns]

Definition at line 92 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::TMax_ns
inherited

maximum time for local coincidences [ns]

Definition at line 93 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::TMin_ns
inherited

minimum time for local coincidences [ns]

Definition at line 94 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::roadWidth_m
inherited

road width [m]

Definition at line 95 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::ctMin
inherited

minimal cosine space angle between PMT axes

Definition at line 96 of file JShowerPointSimplexParameters_t.hh.

JTOOLS::JRange<double> JRECONSTRUCTION::JShowerPointSimplexParameters_t::TWindow_ns
inherited

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

Definition at line 97 of file JShowerPointSimplexParameters_t.hh.

JTOOLS::JRange<double> JRECONSTRUCTION::JShowerPointSimplexParameters_t::pos_grid_m
inherited

edges in [m] of the position grid

Definition at line 98 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::pos_step_m
inherited

step in [m] of position grid

Definition at line 99 of file JShowerPointSimplexParameters_t.hh.

JTOOLS::JRange<double> JRECONSTRUCTION::JShowerPointSimplexParameters_t::time_grid_ns
inherited

edges in [ns] of the time grid

Definition at line 100 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::time_step_ns
inherited

step in [ns] of time grid

Definition at line 101 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::simplex_step_m
inherited

step in [m] of JSimplex minimiser

Definition at line 102 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::simplex_step_ns
inherited

step in [ns] of JSimplex minimiser

Definition at line 103 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::tukey_std_dev
inherited

standard deviation of Tukey estimator

Definition at line 104 of file JShowerPointSimplexParameters_t.hh.

int JRECONSTRUCTION::JShowerPointSimplexParameters_t::NMax
inherited

maximum number of iterations

Definition at line 105 of file JShowerPointSimplexParameters_t.hh.


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