Jpp
 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
 
int numberOfPrefits
 
size_t minPrefitsSize
 
double sigma_ns
 
double TMaxLocal_ns
 
double TMax_ns
 
double TMin_ns
 
double roadWidth_m
 
double ctMin
 
JTOOLS::JTimeRange TWindow_ns
 
JTOOLS::JRange< double > pos_grid_m
 
double pos_step_m
 
JTOOLS::JTimeRange time_grid_ns
 
double time_step_ns
 
double simplex_step_m
 
double simplex_step_ns
 
double tukey_std_dev
 

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
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:32
Data structure for vertex fit.
Definition: JPoint4D.hh:22
static const int JSHOWERPOINTSIMPLEX
3D track with energy.
Definition: JTrack3E.hh:29
double getQuality(const double chi2, const int N, const int NDF)
Get quality of fit.
Definition: JEvtToolkit.hh:206
JRange< double > JTimeRange
Type definition for time range.
Template L2 builder.
Definition: JBuildL2.hh:45
Data structure for vector in three dimensions.
Definition: JVector3D.hh:33
Data time slice.
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.
Definition: JEvtToolkit.hh:126
JFIT::JHistory JHistory
Definition: JHistory.hh:283
Data structure for set of track fit results.
Definition: JEvt.hh:294
int getCount(const T &hit)
Get hit count.
JPosition3D getPosition(const JFit &fit)
Get position.
Definition: JEvtToolkit.hh:73
Template L0 hit builder.
Definition: JBuildL0.hh:35
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 35 of file JShowerPointSimplexParameters_t.hh.

36  {
37  numberOfPrefits = 50;
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 = JTOOLS::JTimeRange(-130, 120);
47  pos_step_m = 20;
49  time_step_ns = 20;
50  simplex_step_m = 5;
51  simplex_step_ns = 10;
52  tukey_std_dev = 20;
53  }
JRange< double > JTimeRange
Type definition for time range.
bool JRECONSTRUCTION::JShowerPointSimplexParameters_t::equals ( const JShowerPointSimplexParameters_t parameters) const
inlineinherited

Equality.

Parameters
parametersfit parameters
Returns
true if equals; else false

Definition at line 61 of file JShowerPointSimplexParameters_t.hh.

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

int JRECONSTRUCTION::JShowerPointSimplexParameters_t::numberOfPrefits
inherited

Definition at line 83 of file JShowerPointSimplexParameters_t.hh.

size_t JRECONSTRUCTION::JShowerPointSimplexParameters_t::minPrefitsSize
inherited

Definition at line 84 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::sigma_ns
inherited

Definition at line 85 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::TMaxLocal_ns
inherited

Definition at line 86 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::TMax_ns
inherited

Definition at line 87 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::TMin_ns
inherited

Definition at line 88 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::roadWidth_m
inherited

Definition at line 89 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::ctMin
inherited

Definition at line 90 of file JShowerPointSimplexParameters_t.hh.

JTOOLS::JTimeRange JRECONSTRUCTION::JShowerPointSimplexParameters_t::TWindow_ns
inherited

Definition at line 91 of file JShowerPointSimplexParameters_t.hh.

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

Definition at line 92 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::pos_step_m
inherited

Definition at line 93 of file JShowerPointSimplexParameters_t.hh.

JTOOLS::JTimeRange JRECONSTRUCTION::JShowerPointSimplexParameters_t::time_grid_ns
inherited

Definition at line 94 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::time_step_ns
inherited

Definition at line 95 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::simplex_step_m
inherited

Definition at line 96 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::simplex_step_ns
inherited

Definition at line 97 of file JShowerPointSimplexParameters_t.hh.

double JRECONSTRUCTION::JShowerPointSimplexParameters_t::tukey_std_dev
inherited

Definition at line 98 of file JShowerPointSimplexParameters_t.hh.


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