Jpp  15.0.2
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::JShowerPositionFit Class Reference

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

#include <JShowerPositionFit.hh>

Inheritance diagram for JRECONSTRUCTION::JShowerPositionFit:
JRECONSTRUCTION::JShowerPositionFitParameters_t JFIT::JRegressor< JModel_t, JMinimiser_t > TObject

Public Member Functions

 JShowerPositionFit (const JShowerPositionFitParameters_t &parameters, const JModuleRouter &router, const JSummaryRouter &summary, const std::string pdfFile, 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 JShowerPositionFitParameters_t &parameters) const
 Equality. More...
 
 ClassDef (JShowerPositionFitParameters_t, 1)
 

Public Attributes

const JModuleRouterrouter
 
const JSummaryRoutersummary
 
size_t numberOfPrefits
 number of prefits More...
 
size_t numberOfOutfits
 number of fits to be saved in output 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...
 
double E_GeV
 energy [GeV] More...
 
double R_Hz
 default rate [Hz] More...
 
double TTS_ns
 transition-time spread [ns] More...
 
double VMax_npe
 maximum number of of photo-electrons More...
 
int NMax
 maximum number of iterations More...
 

Private Types

typedef JRegressor< JPoint4D,
JGandalf
JRegressor_t
 

Detailed Description

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

Definition at line 72 of file JShowerPositionFit.hh.

Member Typedef Documentation

Definition at line 79 of file JShowerPositionFit.hh.

Constructor & Destructor Documentation

JRECONSTRUCTION::JShowerPositionFit::JShowerPositionFit ( const JShowerPositionFitParameters_t parameters,
const JModuleRouter router,
const JSummaryRouter summary,
const std::string  pdfFile,
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.
summarysummary router
pdfFilefile name with PDF
debugdebug

Definition at line 93 of file JShowerPositionFit.hh.

97  :
99  JRegressor_t(pdfFile, parameters.TTS_ns),
100  router(router),
101  summary(summary)
102  {
103  using namespace JPP;
104 
106  JRegressor_t::T_ns.setRange(parameters.TMin_ns, parameters.TMax_ns);
109 
110  this->parameters.resize(4);
111 
112  this->parameters[0] = JPoint4D::pX();
113  this->parameters[1] = JPoint4D::pY();
114  this->parameters[2] = JPoint4D::pZ();
115  this->parameters[3] = JPoint4D::pT();
116  }
static int debug
debug level (default is off).
Definition: JMessage.hh:45
static parameter_type pT()
Definition: JPoint4D.hh:61
JRegressor< JPoint4D, JGandalf > JRegressor_t
static parameter_type pZ()
Definition: JPoint4D.hh:60
double TMin_ns
minimum time for local coincidences [ns]
double VMax_npe
maximum number of of photo-electrons
double TMax_ns
maximum time for local coincidences [ns]
static parameter_type pX()
Definition: JPoint4D.hh:58
static parameter_type pY()
Definition: JPoint4D.hh:59
static double Vmax_npe
Maximal integral of PDF [npe].
static int MAXIMUM_ITERATIONS
maximal number of iterations
Definition: JGandalf.hh:280
static JTimeRange T_ns
Time window with respect to Cherenkov hypothesis [ns].

Member Function Documentation

JEvt JRECONSTRUCTION::JShowerPositionFit::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 124 of file JShowerPositionFit.hh.

125  {
126  using namespace std;
127  using namespace JPP;
128 
129  typedef vector<JHitL0> JDataL0_t;
130  const JBuildL0<JHitL0> buildL0;
131 
132  JEvt out;
133 
134  JDataL0_t dataL0;
135  buildL0(JDAQTimeslice(event, true), router, back_inserter(dataL0));
136 
137  for (JEvt::const_iterator shower = in.begin(); shower != in.end(); ++shower) {
138 
139  JPoint4D vx(getPosition(*shower), shower->getT());
140 
141  vector<JHitW0> data;
142 
144 
145  for (JDataL0_t::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
146 
147  const double rate_Hz = summary.getRate(*i);
148 
149  if (match(*i)) {
150  data.push_back(JHitW0(*i, rate_Hz));
151  }
152  }
153 
154  // select first hit
155 
156  sort(data.begin(), data.end(), JHitL0::compare);
157 
158  vector<JHitW0>::iterator __end = unique(data.begin(), data.end(), equal_to<JDAQPMTIdentifier>());
159 
160  const int NDF = distance(data.begin(), __end) - this->parameters.size();
161 
162  if (NDF > 0) {
163 
164  // set fit parameters
165 
166  if (shower->getE() > 0.1)
167  JRegressor_t::E_GeV = shower->getE();
168  else
170 
171  double chi2 = (*this)(vx, data.begin(), __end);
172 
173  JShower3E sh_fit(this->value.getPosition(), JDirection3D(),
174  this->value.getT(), shower->getE());
175 
176  out.push_back(getFit(JHistory(shower->getHistory()).add(JSHOWERPOSITIONFIT), sh_fit,
177  getQuality(chi2), NDF, sh_fit.getE()));
178 
179  }
180  }
181 
182  return out;
183  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:33
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
Template specialisation of L0 builder for JHitL0 data type.
Definition: JBuildL0.hh:102
Data structure for vertex fit.
Definition: JPoint4D.hh:22
double getRate() const
Get default rate.
*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.
static const int JSHOWERPOSITIONFIT
Acoustic event fit.
Data time slice.
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.
Auxiliary class for a hit with background rate value.
Definition: JHitW0.hh:21
JFIT::JHistory JHistory
Definition: JHistory.hh:283
JPosition3D getPosition(const JFit &fit)
Get position.
Template specialisation of class JModel to match hit with bright point.
Definition: JFit/JModel.hh:121
static struct JTRIGGER::JHitL0::@77 compare
Auxiliary data structure for sorting of hits.
static JTimeRange T_ns
Time window with respect to Cherenkov hypothesis [ns].
void JRECONSTRUCTION::JShowerPositionFitParameters_t::reset ( )
inlineinherited

Reset fit parameters.

Definition at line 32 of file JShowerPositionFitParameters_t.hh.

33  {
34  numberOfPrefits = 0; // process all inputs from PointSimplex, which should give a max of 100
35  numberOfOutfits = 5;
36  TMax_ns = 100.0;
37  TMin_ns = -100.0;
38  roadWidth_m = 80.0;
39  E_GeV = 10;
40  R_Hz = 10000;
41  TTS_ns = 2;
42  VMax_npe = 20.0;
43  NMax = 1000;
44  }
double TMin_ns
minimum time for local coincidences [ns]
double VMax_npe
maximum number of of photo-electrons
double TMax_ns
maximum time for local coincidences [ns]
size_t numberOfOutfits
number of fits to be saved in output
bool JRECONSTRUCTION::JShowerPositionFitParameters_t::equals ( const JShowerPositionFitParameters_t parameters) const
inlineinherited

Equality.

Parameters
parametersfit parameters
Returns
true if equals; else false

Definition at line 52 of file JShowerPositionFitParameters_t.hh.

53  {
54  return (this->numberOfPrefits == parameters.numberOfPrefits &&
55  this->numberOfOutfits == parameters.numberOfOutfits &&
56  this->TMax_ns == parameters.TMax_ns &&
57  this->TMin_ns == parameters.TMin_ns &&
58  this->ctMin == parameters.ctMin &&
59  this->roadWidth_m == parameters.roadWidth_m &&
60  this->E_GeV == parameters.E_GeV &&
61  this->R_Hz == parameters.R_Hz &&
62  this->TTS_ns == parameters.TTS_ns &&
63  this->VMax_npe == parameters.VMax_npe &&
64  this->NMax == parameters.NMax);
65  }
*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::JShowerPositionFitParameters_t::ClassDef ( JShowerPositionFitParameters_t  ,
 
)
inherited

Member Data Documentation

const JModuleRouter& JRECONSTRUCTION::JShowerPositionFit::router

Definition at line 186 of file JShowerPositionFit.hh.

const JSummaryRouter& JRECONSTRUCTION::JShowerPositionFit::summary

Definition at line 187 of file JShowerPositionFit.hh.

size_t JRECONSTRUCTION::JShowerPositionFitParameters_t::numberOfPrefits
inherited

number of prefits

Definition at line 69 of file JShowerPositionFitParameters_t.hh.

size_t JRECONSTRUCTION::JShowerPositionFitParameters_t::numberOfOutfits
inherited

number of fits to be saved in output

Definition at line 70 of file JShowerPositionFitParameters_t.hh.

double JRECONSTRUCTION::JShowerPositionFitParameters_t::TMax_ns
inherited

maximum time for local coincidences [ns]

Definition at line 71 of file JShowerPositionFitParameters_t.hh.

double JRECONSTRUCTION::JShowerPositionFitParameters_t::TMin_ns
inherited

minimum time for local coincidences [ns]

Definition at line 72 of file JShowerPositionFitParameters_t.hh.

double JRECONSTRUCTION::JShowerPositionFitParameters_t::roadWidth_m
inherited

road width [m]

Definition at line 73 of file JShowerPositionFitParameters_t.hh.

double JRECONSTRUCTION::JShowerPositionFitParameters_t::ctMin
inherited

minimal cosine space angle between PMT axes

Definition at line 74 of file JShowerPositionFitParameters_t.hh.

double JRECONSTRUCTION::JShowerPositionFitParameters_t::E_GeV
inherited

energy [GeV]

Definition at line 75 of file JShowerPositionFitParameters_t.hh.

double JRECONSTRUCTION::JShowerPositionFitParameters_t::R_Hz
inherited

default rate [Hz]

Definition at line 76 of file JShowerPositionFitParameters_t.hh.

double JRECONSTRUCTION::JShowerPositionFitParameters_t::TTS_ns
inherited

transition-time spread [ns]

Definition at line 77 of file JShowerPositionFitParameters_t.hh.

double JRECONSTRUCTION::JShowerPositionFitParameters_t::VMax_npe
inherited

maximum number of of photo-electrons

Definition at line 78 of file JShowerPositionFitParameters_t.hh.

int JRECONSTRUCTION::JShowerPositionFitParameters_t::NMax
inherited

maximum number of iterations

Definition at line 79 of file JShowerPositionFitParameters_t.hh.


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