Jpp  19.1.0
the software that should make you happy
Public Member Functions | Public Attributes | Private Types | List of all members
JRECONSTRUCTION::JShowerBjorkenY Class Reference

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

#include <JShowerBjorkenY.hh>

Inheritance diagram for JRECONSTRUCTION::JShowerBjorkenY:
JRECONSTRUCTION::JShowerBjorkenYParameters_t JFIT::JRegressor< JModel_t, JMinimiser_t > TObject

Public Member Functions

 JShowerBjorkenY (const JShowerBjorkenYParameters_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...
 
double getFinalBjY (double E_em, double E_h)
 
void reset ()
 Reset fit parameters. More...
 
bool equals (const JShowerBjorkenYParameters_t &parameters) const
 Equality. More...
 
 ClassDef (JShowerBjorkenYParameters_t, 1)
 

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 roadWidth_m
 road width [m]
More...
 
double R_Hz
 default rate [Hz]
More...
 
int mestimator
 M-estimator
More...
 
double fit_step
 simplex initial step
More...
 
double VMax_npe
 maximum number of of photo-electrons
More...
 
int NMax
 maximum number of iterations
More...
 

Private Types

typedef JRegressor< JShowerEH, JSimplexJRegressor_t
 

Detailed Description

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

Definition at line 74 of file JShowerBjorkenY.hh.

Member Typedef Documentation

◆ JRegressor_t

Definition at line 79 of file JShowerBjorkenY.hh.

Constructor & Destructor Documentation

◆ JShowerBjorkenY()

JRECONSTRUCTION::JShowerBjorkenY::JShowerBjorkenY ( const JShowerBjorkenYParameters_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 94 of file JShowerBjorkenY.hh.

99  :
100  JShowerBjorkenYParameters_t(parameters),
101  JRegressor_t(pdfFile),
102  router(router),
103  summary(summary),
105  {
106  using namespace JPP;
107 
109  JRegressor_t::T_ns.setRange(parameters.TMin_ns, parameters.TMax_ns);
110  JRegressor_t::Vmax_npe = VMax_npe;
111  JRegressor_t::MAXIMUM_ITERATIONS = NMax;
112 
113  this->estimator.reset(getMEstimator(parameters.mestimator));
114  }
int debug
debug level
Definition: JSirene.cc:69
JRegressor< JShowerEH, JSimplex > JRegressor_t
const JSummaryRouter & summary
const JShowerEnergyCorrection & correct
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 TMax_ns
maximum time for local coincidences [ns]
double VMax_npe
maximum number of of photo-electrons
double TMin_ns
minimum time for local coincidences [ns]

Member Function Documentation

◆ operator()()

JEvt JRECONSTRUCTION::JShowerBjorkenY::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 122 of file JShowerBjorkenY.hh.

123  {
124  using namespace std;
125  using namespace JPP;
126 
127  typedef vector<JHitL0> JDataL0_t;
128  JBuildL0<JHitL0> buildL0;
129 
130  JEvt out;
131 
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  JShower3EY sh(getPosition(*shower), getDirection(*shower), shower->getT(),
140  shower->getE(), 0.0);
141 
143 
144  const JModel<JPoint4D> match(JPoint4D(sh.getPosition(), sh.getT()), roadWidth_m, JRegressor_t::T_ns);
145 
146  for (JDataL0_t::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
147 
148  if (match(*i)) {
149  top.insert(i->getPMTIdentifier());
150  }
151  }
152 
153  JDetectorSubset_t subdetector(detector, sh.getPosition(), roadWidth_m);
154 
155  const JDirection3D conversion(sh.getDirection());
156  const JRotation3D R(conversion);
157 
158  vector<JPMTW0> buffer;
159 
160  for (JDetectorSubset_t::iterator module = subdetector.begin();
161  module != subdetector.end(); ++module) {
162 
163  const JDAQSummaryFrame& frame = summary.getSummaryFrame(module->getID());
164 
165  JModule dom(*module);
166 
167  dom.rotate(R);
168 
169  for (unsigned int i = 0; i != dom.size(); ++i) {
170 
171  if (getDAQStatus(frame, *module, i) &&
172  getPMTStatus(frame, *module, i) &&
173  frame[i].is_valid() &&
174  !module->getPMT(i).has(PMT_DISABLE)) {
175 
176  const JDAQPMTIdentifier id(module->getID(), i);
177 
178  const double rate_Hz = summary.getRate(id);
179  const size_t count = top.count(id);
180 
181  buffer.push_back(JPMTW0(dom.getPMT(i), rate_Hz, count));
182  }
183  }
184  }
185 
186  this->step.resize(2);
187  this->step[0] = JShowerEH(JPoint4D(JVector3D(), 0.0), JVersor3Z(), fit_step, 0.0, 0.0);
188  this->step[1] = JShowerEH(JPoint4D(JVector3D(), 0.0), JVersor3Z(), 0.0, fit_step, 0.0);
189 
190  double f_h = 1 - 0.681 * (std::pow(shower->getE()/0.863, -0.207));
191 
192  double chi2 = (*this)(JShowerEH(JVertex3D(JVector3D(0,0,0), sh.getT()), JVersor3Z(),
193  log10(sh.getE()), log10(f_h*sh.getE()), sh.getBjY()),
194  buffer.begin(), buffer.end());
195 
196  double NDF = getCount(buffer.begin(), buffer.end()) - this->step.size();
197 
198  JShower3EY sh_fit(this->value.getPosition(), this->value.getDirection(),
199  this->value.getT(), correct(this->value.getEem() + this->value.getEh()), this->value.getBy());
200 
201  double y = getFinalBjY(this->value.getEem(), this->value.getEh());
202 
203  sh_fit.rotate_back(R);
204 
205  sh_fit.add(sh.getPosition());
206 
207  out.push_back(getFit(JHistory(shower->getHistory()).add(JSHOWER_BJORKEN_Y), sh_fit, getQuality(chi2),
208  NDF, sh_fit.getE()));
209 
210  out.rbegin()->setW(5, y);
211  out.rbegin()->setW(6, this->value.getEem());
212  out.rbegin()->setW(7, this->value.getEh());
213 
214  }
215 
216  return out;
217  }
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 vertex fit.
Definition: JPoint4D.hh:24
Data structure for fit of straight line in positive z-direction with energy.
Definition: JShowerEH.hh:32
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:35
Rotation matrix.
Definition: JRotation3D.hh:114
3D track with energy and Bjorken Y.
Definition: JTrack3EY.hh:31
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
double getFinalBjY(double E_em, double E_h)
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 JSHOWER_BJORKEN_Y
size_t getCount(const array_type< T > &buffer, const JCompare_t &compare)
Count number of unique values.
Definition: JVectorize.hh:261
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:97
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

◆ getFinalBjY()

double JRECONSTRUCTION::JShowerBjorkenY::getFinalBjY ( double  E_em,
double  E_h 
)
inline

Definition at line 229 of file JShowerBjorkenY.hh.

229  {
230  return E_h / (E_em + E_h);
231  }

◆ reset()

void JRECONSTRUCTION::JShowerBjorkenYParameters_t::reset ( )
inlineinherited

Reset fit parameters.

Definition at line 35 of file JShowerBjorkenYParameters_t.hh.

36  {
37  numberOfPrefits = 1;
38  TMax_ns = 30;
39  TMin_ns = -30;
40  roadWidth_m = 80;
41  R_Hz = 10.0e3;
43  fit_step = 0.5;
44  VMax_npe = 20.0;
45  NMax = 1000;
46  }
@ EM_NULL
Definition: JMEstimator.hh:189

◆ equals()

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

Equality.

Parameters
parametersfit parameters
Returns
true if equals; else false

Definition at line 54 of file JShowerBjorkenYParameters_t.hh.

55  {
56  return (this->TMax_ns == parameters.TMax_ns &&
57  this->TMin_ns == parameters.TMin_ns &&
58  this->numberOfPrefits == parameters.numberOfPrefits &&
59  this->roadWidth_m == parameters.roadWidth_m &&
60  this->R_Hz == parameters.R_Hz &&
61  this->mestimator == parameters.mestimator &&
62  this->fit_step == parameters.fit_step &&
63  this->VMax_npe == parameters.VMax_npe &&
64  this->NMax == parameters.NMax);
65  }

◆ ClassDef()

JRECONSTRUCTION::JShowerBjorkenYParameters_t::ClassDef ( JShowerBjorkenYParameters_t  ,
 
)
inherited

Member Data Documentation

◆ router

const JModuleRouter& JRECONSTRUCTION::JShowerBjorkenY::router

Definition at line 219 of file JShowerBjorkenY.hh.

◆ summary

const JSummaryRouter& JRECONSTRUCTION::JShowerBjorkenY::summary

Definition at line 220 of file JShowerBjorkenY.hh.

◆ correct

const JShowerEnergyCorrection& JRECONSTRUCTION::JShowerBjorkenY::correct

Definition at line 221 of file JShowerBjorkenY.hh.

◆ numberOfPrefits

size_t JRECONSTRUCTION::JShowerBjorkenYParameters_t::numberOfPrefits
inherited

number of prefits

Definition at line 69 of file JShowerBjorkenYParameters_t.hh.

◆ TMax_ns

double JRECONSTRUCTION::JShowerBjorkenYParameters_t::TMax_ns
inherited

maximum time for local coincidences [ns]

Definition at line 70 of file JShowerBjorkenYParameters_t.hh.

◆ TMin_ns

double JRECONSTRUCTION::JShowerBjorkenYParameters_t::TMin_ns
inherited

minimum time for local coincidences [ns]

Definition at line 71 of file JShowerBjorkenYParameters_t.hh.

◆ roadWidth_m

double JRECONSTRUCTION::JShowerBjorkenYParameters_t::roadWidth_m
inherited

road width [m]

Definition at line 72 of file JShowerBjorkenYParameters_t.hh.

◆ R_Hz

double JRECONSTRUCTION::JShowerBjorkenYParameters_t::R_Hz
inherited

default rate [Hz]

Definition at line 73 of file JShowerBjorkenYParameters_t.hh.

◆ mestimator

int JRECONSTRUCTION::JShowerBjorkenYParameters_t::mestimator
inherited

M-estimator

Definition at line 74 of file JShowerBjorkenYParameters_t.hh.

◆ fit_step

double JRECONSTRUCTION::JShowerBjorkenYParameters_t::fit_step
inherited

simplex initial step

Definition at line 75 of file JShowerBjorkenYParameters_t.hh.

◆ VMax_npe

double JRECONSTRUCTION::JShowerBjorkenYParameters_t::VMax_npe
inherited

maximum number of of photo-electrons

Definition at line 76 of file JShowerBjorkenYParameters_t.hh.

◆ NMax

int JRECONSTRUCTION::JShowerBjorkenYParameters_t::NMax
inherited

maximum number of iterations

Definition at line 77 of file JShowerBjorkenYParameters_t.hh.


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