Jpp  16.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | List of all members
JRECONSTRUCTION::JMuonSimplex Struct Reference

Wrapper class to make intermediate fit of muon trajectory. More...

#include <JMuonSimplex.hh>

Inheritance diagram for JRECONSTRUCTION::JMuonSimplex:
JRECONSTRUCTION::JMuonSimplexParameters_t JFIT::JRegressor< JModel_t, JMinimiser_t > TObject

Public Types

typedef JRegressor< JLine3Z,
JSimplex
JRegressor_t
 
typedef JTRIGGER::JHitR1 hit_type
 
typedef std::vector< hit_typebuffer_type
 

Public Member Functions

 JMuonSimplex (const JMuonSimplexParameters_t &parameters, const JModuleRouter &router, const int debug=0)
 Constructor. More...
 
JEvt operator() (const KM3NETDAQ::JDAQEvent &event, const JEvt &in)
 Fit function. More...
 
JEvt operator() (const buffer_type &dataL0, const buffer_type &dataL1, const JEvt &in)
 Fit function. More...
 
void reset ()
 Reset fit parameters. More...
 
bool equals (const JMuonSimplexParameters_t &parameters) const
 Equality. More...
 
 ClassDef (JMuonSimplexParameters_t, 2)
 

Public Attributes

const JModuleRouterrouter
 
double sigma_ns
 time resolution [ns] More...
 
bool useL0
 option for L0 hit use More...
 
size_t numberOfPrefits
 number of prefits More...
 
double TMaxLocal_ns
 time window for local coincidences [ns] More...
 
double ctMin
 minimal cosine space angle between PMT axes More...
 
double roadWidth_m
 road width [m] More...
 
double TMin_ns
 minimal time w.r.t. Cherenkov hypothesis [ns] More...
 
double TMax_ns
 maximal time w.r.t. Cherenkov hypothesis [ns] More...
 
int NMax
 maximum number of iterations More...
 
bool reprocess
 reprocess More...
 

Detailed Description

Wrapper class to make intermediate fit of muon trajectory.

The JMuonSimplex fit uses one or more start values (usually taken from the output of JMuonPrefit) and produces new start values for subsequent fits (usually JMuonGandalf).
All hits of which the PMT position lies within a set road width (JMuonSimplexParameters_t::roadWidth_m) and time is within a set window (JMuonSimplexParameters_t::TMin_ns, JMuonSimplexParameters_t::TMax_ns) around the Cherenkov hypothesis are taken.
In case there are multiple hits from the same PMT is the specified window, the first hit is taken and the other hits are discarded.
The chi-squared is based on an M-estimator of the time residuals.

Definition at line 63 of file JMuonSimplex.hh.

Member Typedef Documentation

Definition at line 67 of file JMuonSimplex.hh.

Definition at line 68 of file JMuonSimplex.hh.

Definition at line 69 of file JMuonSimplex.hh.

Constructor & Destructor Documentation

JRECONSTRUCTION::JMuonSimplex::JMuonSimplex ( const JMuonSimplexParameters_t parameters,
const JModuleRouter router,
const int  debug = 0 
)
inline

Constructor.

Parameters
parametersparameters
routermodule router
debugdebug

Definition at line 80 of file JMuonSimplex.hh.

82  :
83  JMuonSimplexParameters_t(parameters),
84  JRegressor_t(parameters.sigma_ns),
85  router(router)
86  {
87  using namespace JFIT;
88 
89  this->estimator.reset(new JMEstimatorLorentzian());
90 
93  }
static int debug
debug level (default is off).
Definition: JMessage.hh:45
const JModuleRouter & router
JRegressor< JLine3Z, JSimplex > JRegressor_t
Definition: JMuonSimplex.hh:67
int debug
debug level
Definition: JSirene.cc:63
static int MAXIMUM_ITERATIONS
maximal number of iterations
Definition: JSimplex.hh:237
Lorentzian M-estimator.
Definition: JMEstimator.hh:79

Member Function Documentation

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

Fit function.

Parameters
eventevent
instart values
Returns
fit results

Definition at line 103 of file JMuonSimplex.hh.

104  {
105  using namespace std;
106  using namespace JFIT;
107  using namespace JTRIGGER;
108 
109  const JBuildL0<hit_type> buildL0;
111 
112  buffer_type dataL0;
113  buffer_type dataL1;
114 
115  const KM3NETDAQ::JDAQTimeslice timeslice(event, true);
116  JSuperFrame2D<JHit> buffer;
117 
118  for (JDAQTimeslice::const_iterator i = timeslice.begin(); i != timeslice.end(); ++i) {
119 
120  if (router.hasModule(i->getModuleID())) {
121 
122  buffer(*i, router.getModule(i->getModuleID()));
123 
124  if (useL0) {
125  buildL0(buffer, back_inserter(dataL0));
126  }
127  {
128  buildL2(buffer, back_inserter(dataL1));
129  }
130  }
131  }
132 
133  return (*this)(dataL0, dataL1, in);
134  }
const JModule & getModule(const JObjectID &id) const
Get module parameters.
const JModuleRouter & router
double TMaxLocal_ns
time window for local coincidences [ns]
Template L2 builder.
Definition: JBuildL2.hh:45
Data time slice.
std::vector< hit_type > buffer_type
Definition: JMuonSimplex.hh:69
Data structure for L2 parameters.
bool hasModule(const JObjectID &id) const
Has module.
2-dimensional frame with time calibrated data from one optical module.
double ctMin
minimal cosine space angle between PMT axes
Template L0 hit builder.
Definition: JBuildL0.hh:35
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:42
JEvt JRECONSTRUCTION::JMuonSimplex::operator() ( const buffer_type dataL0,
const buffer_type dataL1,
const JEvt in 
)
inline

Fit function.

Parameters
dataL0L0 hit data
dataL1L1 hit data
instart values
Returns
fit results

Definition at line 145 of file JMuonSimplex.hh.

148  {
149  using namespace std;
150  using namespace JFIT;
151  using namespace JGEOMETRY3D;
152 
153  JEvt out;
154 
155  buffer_type data;
156 
157  data.reserve(dataL0.size() +
158  dataL1.size());
159 
160 
161  for (JEvt::const_iterator track = in.begin(); track != in.end(); ++track) {
162 
163  const JRotation3D R (getDirection(*track));
164  const JLine1Z tz(getPosition (*track).rotate(R), track->getT());
166 
167  data.clear();
168 
169  for (buffer_type::const_iterator i = dataL1.begin(); i != dataL1.end(); ++i) {
170 
171  hit_type hit(*i);
172 
173  hit.rotate(R);
174 
175  if (match(hit)) {
176  data.push_back(hit);
177  }
178  }
179 
180  if (useL0) {
181 
182  buffer_type::iterator __end = data.end();
183 
184  for (buffer_type::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
185 
186  if (find_if(data.begin(), __end, bind2nd(equal_to<JDAQModuleIdentifier>(), i->getModuleID())) == __end) {
187 
188  hit_type hit(*i);
189 
190  hit.rotate(R);
191 
192  if (match(hit)) {
193  data.push_back(hit);
194  }
195  }
196  }
197  }
198 
199 
200  this->step.resize(5);
201 
202  this->step[0] = JLine3Z(JLine1Z(JVector3D(0.5, 0.0, 0.0), 0.0));
203  this->step[1] = JLine3Z(JLine1Z(JVector3D(0.0, 0.5, 0.0), 0.0));
204  this->step[2] = JLine3Z(JLine1Z(JVector3D(0.0, 0.0, 0.0), 1.0));
205  this->step[3] = JLine3Z(JLine1Z(JVector3D(), 0.0), JVersor3Z(0.005, 0.0));
206  this->step[4] = JLine3Z(JLine1Z(JVector3D(), 0.0), JVersor3Z(0.0, 0.005));
207 
208  const int NDF = getCount(data.begin(), data.end()) - this->step.size();
209 
210  if (NDF > 0) {
211 
212  const double chi2 = (*this)(JLine3Z(tz), data.begin(), data.end());
213 
214  JTrack3D tb(this->value);
215 
216  tb.rotate_back(R);
217 
218  out.push_back(getFit(JHistory(track->getHistory()).add(JMUONSIMPLEX), tb, getQuality(chi2, NDF), NDF));
219 
220  out.rbegin()->setW(track->getW());
221  }
222  }
223 
224  return out;
225  }
double TMax_ns
maximal time w.r.t. Cherenkov hypothesis [ns]
JTOOLS::JRange< double > JTimeRange
Type definition for time range (unit [ns]).
Rotation matrix.
Definition: JRotation3D.hh:111
Template specialisation of class JModel to match hit with muon trajectory along z-axis.
Definition: JFit/JModel.hh:34
Data structure for fit of straight line in positive z-direction.
Definition: JLine3Z.hh:36
double getQuality(const double chi2, const int N, const int NDF)
Get quality of fit.
Data structure for vector in three dimensions.
Definition: JVector3D.hh:34
Acoustic event fit.
JDirection3D getDirection(const JFit &fit)
Get direction.
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:43
std::vector< hit_type > buffer_type
Definition: JMuonSimplex.hh:69
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.
double TMin_ns
minimal time w.r.t. Cherenkov hypothesis [ns]
JFIT::JHistory JHistory
Definition: JHistory.hh:301
static const int JMUONSIMPLEX
Data structure for fit of straight line paralel to z-axis.
Definition: JLine1Z.hh:27
int getCount(const T &hit)
Get hit count.
JPosition3D getPosition(const JFit &fit)
Get position.
Data structure for normalised vector in positive z-direction.
Definition: JVersor3Z.hh:39
JPosition3D & rotate(const JRotation3D &R)
Rotate.
Definition: JPosition3D.hh:186
void JRECONSTRUCTION::JMuonSimplexParameters_t::reset ( )
inlineinherited

Reset fit parameters.

Definition at line 39 of file JMuonSimplexParameters_t.hh.

40  {
41  sigma_ns = 3;
42  useL0 = true;
43  numberOfPrefits = 0;
44  TMaxLocal_ns = 15.0;
45  ctMin = 0.0;
46  roadWidth_m = 200.0;
47  TMin_ns = -50.0;
48  TMax_ns = +50.0;
49  NMax = 1000;
50  reprocess = false;
51  }
double TMax_ns
maximal time w.r.t. Cherenkov hypothesis [ns]
double TMaxLocal_ns
time window for local coincidences [ns]
double TMin_ns
minimal time w.r.t. Cherenkov hypothesis [ns]
double ctMin
minimal cosine space angle between PMT axes
bool JRECONSTRUCTION::JMuonSimplexParameters_t::equals ( const JMuonSimplexParameters_t parameters) const
inlineinherited

Equality.

Parameters
parametersfit parameters
Returns
true if equals; else false

Definition at line 59 of file JMuonSimplexParameters_t.hh.

60  {
61  return (this->sigma_ns == parameters.sigma_ns &&
62  this->useL0 == parameters.useL0 &&
63  this->numberOfPrefits == parameters.numberOfPrefits &&
64  this->TMaxLocal_ns == parameters.TMaxLocal_ns &&
65  this->ctMin == parameters.ctMin &&
66  this->roadWidth_m == parameters.roadWidth_m &&
67  this->TMin_ns == parameters.TMin_ns &&
68  this->TMax_ns == parameters.TMax_ns &&
69  this->NMax == parameters.NMax &&
70  this->reprocess == parameters.reprocess);
71  }
double TMax_ns
maximal time w.r.t. Cherenkov hypothesis [ns]
double TMaxLocal_ns
time window for local coincidences [ns]
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
double TMin_ns
minimal time w.r.t. Cherenkov hypothesis [ns]
double ctMin
minimal cosine space angle between PMT axes
JRECONSTRUCTION::JMuonSimplexParameters_t::ClassDef ( JMuonSimplexParameters_t  ,
 
)
inherited

Member Data Documentation

const JModuleRouter& JRECONSTRUCTION::JMuonSimplex::router

Definition at line 228 of file JMuonSimplex.hh.

double JRECONSTRUCTION::JMuonSimplexParameters_t::sigma_ns
inherited

time resolution [ns]

Definition at line 75 of file JMuonSimplexParameters_t.hh.

bool JRECONSTRUCTION::JMuonSimplexParameters_t::useL0
inherited

option for L0 hit use

Definition at line 76 of file JMuonSimplexParameters_t.hh.

size_t JRECONSTRUCTION::JMuonSimplexParameters_t::numberOfPrefits
inherited

number of prefits

Definition at line 77 of file JMuonSimplexParameters_t.hh.

double JRECONSTRUCTION::JMuonSimplexParameters_t::TMaxLocal_ns
inherited

time window for local coincidences [ns]

Definition at line 78 of file JMuonSimplexParameters_t.hh.

double JRECONSTRUCTION::JMuonSimplexParameters_t::ctMin
inherited

minimal cosine space angle between PMT axes

Definition at line 79 of file JMuonSimplexParameters_t.hh.

double JRECONSTRUCTION::JMuonSimplexParameters_t::roadWidth_m
inherited

road width [m]

Definition at line 80 of file JMuonSimplexParameters_t.hh.

double JRECONSTRUCTION::JMuonSimplexParameters_t::TMin_ns
inherited

minimal time w.r.t. Cherenkov hypothesis [ns]

Definition at line 81 of file JMuonSimplexParameters_t.hh.

double JRECONSTRUCTION::JMuonSimplexParameters_t::TMax_ns
inherited

maximal time w.r.t. Cherenkov hypothesis [ns]

Definition at line 82 of file JMuonSimplexParameters_t.hh.

int JRECONSTRUCTION::JMuonSimplexParameters_t::NMax
inherited

maximum number of iterations

Definition at line 83 of file JMuonSimplexParameters_t.hh.

bool JRECONSTRUCTION::JMuonSimplexParameters_t::reprocess
inherited

reprocess

Definition at line 84 of file JMuonSimplexParameters_t.hh.


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