Jpp  master_rocky-43-ge265d140c
the software that should make you happy
Public Member Functions | Public Attributes | Private Types | List of all members
JRECONSTRUCTION::JShowerFit Class Reference

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

#include <JShowerFit.hh>

Inheritance diagram for JRECONSTRUCTION::JShowerFit:
JRECONSTRUCTION::JShowerFitParameters_t JFIT::JRegressor< JModel_t, JMinimiser_t > TObject

Public Member Functions

 JShowerFit (const JShowerFitParameters_t &parameters, const JModuleRouter &router, const JSummaryRouter &summary, const std::string pdfFile, const JShowerEnergyCorrection &correct, 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 JShowerFitParameters_t &parameters) const
 Equality. More...
 
 ClassDef (JShowerFitParameters_t, 2)
 

Public Attributes

const JModuleRouterrouter
 
const JSummaryRoutersummary
 
const JShowerEnergyCorrectioncorrect
 
size_t numberOfPrefits
 number of prefits
More...
 
double TMax_ns
 maximum time for local coincidences [ns]
More...
 
double TMin_ns
 minimum time for local coincidences [ns]
More...
 
double DStep_m
 step increase for the distance to optical module [m]
More...
 
double R_Hz
 default rate [Hz]
More...
 
int mestimator
 M-estimator
More...
 
double Vmax_npe
 maximum number of of photo-electrons More...
 
double DMax_m
 maximal distance to optical module [m] More...
 

Private Types

typedef JRegressor< JShower3EZ, JGandalfJRegressor_t
 

Detailed Description

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

Definition at line 72 of file JShowerFit.hh.

Member Typedef Documentation

◆ JRegressor_t

Definition at line 77 of file JShowerFit.hh.

Constructor & Destructor Documentation

◆ JShowerFit()

JRECONSTRUCTION::JShowerFit::JShowerFit ( const JShowerFitParameters_t parameters,
const JModuleRouter router,
const JSummaryRouter summary,
const std::string  pdfFile,
const JShowerEnergyCorrection correct,
const int  debug = 0 
)
inline

Parameterized constructor.

Parameters
parametersstruct that holds default-optimized parameters for the reconstruction, available in $JPP_DATA.
routermodule router, this is built via detector file.
summarysummary router
pdfFilePDF file
correctenergy correction
debugdebug

Definition at line 92 of file JShowerFit.hh.

97  :
98  JShowerFitParameters_t(parameters),
99  JRegressor_t(pdfFile),
100  router(router),
101  summary(summary),
103  {
104  using namespace JPP;
105 
107  JRegressor_t::T_ns.setRange(parameters.TMin_ns, parameters.TMax_ns);
108  JRegressor_t::Vmax_npe = parameters.Vmax_npe;
109  JRegressor_t::MAXIMUM_ITERATIONS = 1000;
110  JRegressor_t::EPSILON = 1e-3;
111  JRegressor_t::EPSILON_ABSOLUTE = true;
112 
113  this->parameters.resize(3);
114 
115  this->parameters[0] = JShower3EZ::pDX();
116  this->parameters[1] = JShower3EZ::pDY();
117  this->parameters[2] = JShower3EZ::pE();
118 
119  this->estimator.reset(getMEstimator(parameters.mestimator));
120  }
int debug
debug level
Definition: JSirene.cc:69
static parameter_type pE()
Definition: JShower3EZ.hh:205
static parameter_type pDY()
Definition: JShower3Z.hh:172
static parameter_type pDX()
Definition: JShower3Z.hh:171
JRegressor< JShower3EZ, JGandalf > JRegressor_t
Definition: JShowerFit.hh:77
const JSummaryRouter & summary
Definition: JShowerFit.hh:213
const JShowerEnergyCorrection & correct
Definition: JShowerFit.hh:214
const JModuleRouter & router
Definition: JShowerFit.hh:212
JMEstimator * getMEstimator(const int type)
Get M-Estimator.
Definition: JMEstimator.hh:203
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
double Vmax_npe
maximum number of of photo-electrons
double TMax_ns
maximum time for local coincidences [ns]
double TMin_ns
minimum time for local coincidences [ns]

Member Function Documentation

◆ operator()()

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

Declaration of the member function that actually performs the reconstruction.

Parameters
event= JDAQEvent
in= input fits

Definition at line 128 of file JShowerFit.hh.

129  {
130  using namespace std;
131  using namespace JPP;
132 
133  typedef vector<JHitL0> JDataL0_t;
134  JBuildL0<JHitL0> buildL0;
135 
136  JEvt out;
137 
139 
140  JDataL0_t dataL0;
141 
142  buildL0(JDAQTimeslice(event, true), router, back_inserter(dataL0));
143 
144  for (JEvt::const_iterator shower = in.begin(); shower != in.end(); ++shower) {
145 
146  const JVertex3D Vertex(getPosition(*shower), shower->getT());
147 
149 
150  const double distance = DMax_m + DStep_m * log10(shower->getE());
151 
152  const JFIT::JModel<JPoint4D> match(Vertex, distance, JRegressor_t::T_ns);
153 
154  for (JDataL0_t::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
155  if (match(*i)) {
156  top.insert(i->getPMTIdentifier());
157  }
158  }
159 
160  const JDetectorSubset_t subdetector(detector, Vertex.getPosition(), distance);
161 
162  const JRotation3D R(getDirection(*shower));
163 
164  vector<JPMTW0> buffer;
165 
166  for (JDetectorSubset_t::const_iterator module = subdetector.begin();
167  module != subdetector.end(); ++module) {
168 
169  const JDAQSummaryFrame& frame = summary.getSummaryFrame(module->getID());
170 
171  JModule dom(*module);
172 
173  dom.rotate(R);
174 
175  for (size_t i = 0; i != dom.size(); ++i) {
176 
177  if (getDAQStatus(frame, *module, i) &&
178  getPMTStatus(frame, *module, i) &&
179  frame[i].is_valid() &&
180  !module->getPMT(i).has(PMT_DISABLE)) {
181  const JDAQPMTIdentifier id(module->getID(), i);
182 
183  const double rate_Hz = summary.getRate(id);
184  const size_t count = top.count(id);
185 
186  buffer.push_back(JPMTW0(dom.getPMT(i), rate_Hz, count));
187  }
188  }
189  }
190 
191  double chi2 = (*this)(JShower3EZ(JVertex3D(JVector3D(0,0,0), shower->getT()), JVersor3Z(),
192  shower->getE()), buffer.begin(), buffer.end());
193 
194  double NDF = getCount(buffer.begin(), buffer.end()) - this->parameters.size();
195 
196  JShower3E sh_fit(this->value.getPosition(), this->value.getDirection(),
197  this->value.getT(), correct(this->value.getE()));
198 
199  sh_fit.rotate_back(R);
200 
201  sh_fit.add(Vertex.getPosition());
202 
203  out.push_back(getFit(JHistory(shower->getHistory()).add(JSHOWERCOMPLETEFIT), sh_fit, getQuality(chi2),
204  NDF, sh_fit.getE()));
205  out.rbegin()->setV(this->V.size(), this->V);
206  out.rbegin()->setW(JSHOWERFIT_ENERGY, this->value.getE()); // Uncorrected Energy
207  }
208 
209  return out;
210  }
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
Detector subset without binary search functionality.
Detector data structure.
Definition: JDetector.hh:96
Data structure for a composite optical module.
Definition: JModule.hh:75
Data structure for fit of straight line in positive z-direction with energy.
Definition: JShower3EZ.hh:30
Rotation matrix.
Definition: JRotation3D.hh:114
3D track with energy.
Definition: JTrack3E.hh:32
Data structure for vector in three dimensions.
Definition: JVector3D.hh:36
Data structure for normalised vector in positive z-direction.
Definition: JVersor3Z.hh:41
const JClass_t & getReference() const
Get reference to object.
Definition: JReference.hh:38
const JDAQSummaryFrame & getSummaryFrame() const
Get default summary frame.
double getRate() const
Get default rate.
Template specialisation of L0 builder for JHitL0 data type.
Definition: JBuildL0.hh:105
Data storage class for rate measurements of all PMTs in one module.
static const int JSHOWERCOMPLETEFIT
static const int JSHOWERFIT_ENERGY
uncorrected energy [GeV] from JShowerFit.cc
size_t getCount(const array_type< T > &buffer, const JCompare_t &compare)
Count number of unique values.
Definition: JVectorize.hh:261
double getQuality(const double chi2, const int N, const int NDF)
Get quality of fit.
JPosition3D getPosition(const JFit &fit)
Get position.
JFIT::JHistory JHistory
Definition: JHistory.hh:354
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.
JDirection3D getDirection(const JFit &fit)
Get direction.
bool is_valid(const json &js)
Check validity of JSon data.
bool getDAQStatus(const JDAQFrameStatus &frame, const JStatus &status)
Test status of DAQ.
bool getPMTStatus(const JStatus &status)
Test status of PMT.
Definition: JSTDTypes.hh:14
static const int PMT_DISABLE
KM3NeT Data Definitions v3.4.0-8-ge14cb17 https://git.km3net.de/common/km3net-dataformat.
Definition: pmt_status.hh:12
Detector file.
Definition: JHead.hh:227
Acoustic event fit.
JHistory & add(const int type)
Add event to history.
Definition: JHistory.hh:295
Template specialisation of class JModel to match hit with bright point.
Definition: JFit/JModel.hh:123
Auxiliary class for handling PMT geometry, rate and response.
Definition: JPMTW0.hh:24
double DMax_m
maximal distance to optical module [m]
double DStep_m
step increase for the distance to optical module [m]

◆ reset()

void JRECONSTRUCTION::JShowerFitParameters_t::reset ( )
inlineinherited

Reset fit parameters.

Definition at line 35 of file JShowerFitParameters_t.hh.

36  {
37  numberOfPrefits = 4;
38  TMax_ns = 30;
39  TMin_ns = -30;
40  DStep_m = 0;
41  DMax_m = 60;
42  R_Hz = 10.0e3;
44  Vmax_npe = 20;
45  }
@ EM_NULL
Definition: JMEstimator.hh:189

◆ equals()

bool JRECONSTRUCTION::JShowerFitParameters_t::equals ( const JShowerFitParameters_t parameters) const
inlineinherited

Equality.

Parameters
parametersfit parameters
Returns
true if equals; else false

Definition at line 53 of file JShowerFitParameters_t.hh.

54  {
55  return (this->TMax_ns == parameters.TMax_ns &&
56  this->TMin_ns == parameters.TMin_ns &&
57  this->numberOfPrefits == parameters.numberOfPrefits &&
58  this->DStep_m == parameters.DStep_m &&
59  this->DMax_m == parameters.DMax_m &&
60  this->R_Hz == parameters.R_Hz &&
61  this->mestimator == parameters.mestimator &&
62  this->Vmax_npe == parameters.Vmax_npe
63  );
64  }

◆ ClassDef()

JRECONSTRUCTION::JShowerFitParameters_t::ClassDef ( JShowerFitParameters_t  ,
 
)
inherited

Member Data Documentation

◆ router

const JModuleRouter& JRECONSTRUCTION::JShowerFit::router

Definition at line 212 of file JShowerFit.hh.

◆ summary

const JSummaryRouter& JRECONSTRUCTION::JShowerFit::summary

Definition at line 213 of file JShowerFit.hh.

◆ correct

const JShowerEnergyCorrection& JRECONSTRUCTION::JShowerFit::correct

Definition at line 214 of file JShowerFit.hh.

◆ numberOfPrefits

size_t JRECONSTRUCTION::JShowerFitParameters_t::numberOfPrefits
inherited

number of prefits

Definition at line 69 of file JShowerFitParameters_t.hh.

◆ TMax_ns

double JRECONSTRUCTION::JShowerFitParameters_t::TMax_ns
inherited

maximum time for local coincidences [ns]

Definition at line 70 of file JShowerFitParameters_t.hh.

◆ TMin_ns

double JRECONSTRUCTION::JShowerFitParameters_t::TMin_ns
inherited

minimum time for local coincidences [ns]

Definition at line 71 of file JShowerFitParameters_t.hh.

◆ DStep_m

double JRECONSTRUCTION::JShowerFitParameters_t::DStep_m
inherited

step increase for the distance to optical module [m]

Definition at line 72 of file JShowerFitParameters_t.hh.

◆ R_Hz

double JRECONSTRUCTION::JShowerFitParameters_t::R_Hz
inherited

default rate [Hz]

Definition at line 73 of file JShowerFitParameters_t.hh.

◆ mestimator

int JRECONSTRUCTION::JShowerFitParameters_t::mestimator
inherited

M-estimator

Definition at line 74 of file JShowerFitParameters_t.hh.

◆ Vmax_npe

double JRECONSTRUCTION::JShowerFitParameters_t::Vmax_npe
inherited

maximum number of of photo-electrons

Definition at line 75 of file JShowerFitParameters_t.hh.

◆ DMax_m

double JRECONSTRUCTION::JShowerFitParameters_t::DMax_m
inherited

maximal distance to optical module [m]

Definition at line 76 of file JShowerFitParameters_t.hh.


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