Jpp - 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::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
 
double TMax_ns
 
double TMin_ns
 
double roadWidth_m
 
double R_Hz
 
int mestimator
 
double fit_step
 

Private Types

typedef JRegressor< JShowerEH,
JSimplex
JRegressor_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

Definition at line 79 of file JShowerBjorkenY.hh.

Constructor & Destructor Documentation

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),
104  correct(correct)
105  {
106  using namespace JPP;
107 
109  JRegressor_t::T_ns.setRange(parameters.TMin_ns, parameters.TMax_ns);
110  JRegressor_t::Vmax_npe = 20.0;
112 
113  this->estimator.reset(getMEstimator(parameters.mestimator));
114  }
static int debug
debug level (default is off).
Definition: JMessage.hh:45
const JSummaryRouter & summary
static JTimeRange T_ns
Time window with respect to Cherenkov hypothesis [ns].
static double Vmax_npe
Maximal integral of PDF [npe].
int debug
debug level
Definition: JSirene.cc:63
static int MAXIMUM_ITERATIONS
maximal number of iterations
Definition: JSimplex.hh:237
JMEstimator * getMEstimator(const int type)
Get M-Estimator.
Definition: JMEstimator.hh:166
const JShowerEnergyCorrection & correct
JRegressor< JShowerEH, JSimplex > JRegressor_t

Member Function Documentation

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  JModule dom(*module);
164  dom.rotate(R);
165 
166  for (unsigned int i = 0; i != dom.size(); ++i) {
167 
168  const JDAQPMTIdentifier id(dom.getID(), i);
169 
170  const double rate_Hz = summary.getRate(id);
171 
172  buffer.push_back(JPMTW0(dom.getPMT(i), rate_Hz, top.count(id)));
173  }
174  }
175 
176  this->step.resize(2);
177  this->step[0] = JShowerEH(JPoint4D(JVector3D(), 0.0), JVersor3Z(), fit_step, 0.0, 0.0);
178  this->step[1] = JShowerEH(JPoint4D(JVector3D(), 0.0), JVersor3Z(), 0.0, fit_step, 0.0);
179 
180  double f_h = 1 - 0.681 * (std::pow(shower->getE()/0.863, -0.207));
181 
182  double chi2 = (*this)(JShowerEH(JVertex3D(JVector3D(0,0,0), sh.getT()), JVersor3Z(),
183  log10(sh.getE()), log10(f_h*sh.getE()), sh.getBjY()),
184  buffer.begin(), buffer.end());
185 
186  double NDF = getCount(buffer.begin(), buffer.end()) - this->step.size();
187 
188  JShower3EY sh_fit(this->value.getPosition(), this->value.getDirection(),
189  this->value.getT(), correct(this->value.getEem() + this->value.getEh()), this->value.getBy());
190 
191  double y = getFinalBjY(this->value.getEem(), this->value.getEh());
192 
193  sh_fit.rotate_back(R);
194 
195  sh_fit.add(sh.getPosition());
196 
197  out.push_back(getFit(JHistory(shower->getHistory()).add(JSHOWER_BJORKEN_Y), sh_fit, getQuality(chi2),
198  NDF, sh_fit.getE()));
199 
200  out.rbegin()->setW(5, y);
201  out.rbegin()->setW(6, this->value.getEem());
202  out.rbegin()->setW(7, this->value.getEh());
203 
204  }
205 
206  return out;
207  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:33
Data structure for a composite optical module.
Definition: JModule.hh:57
Template specialisation of L0 builder for JHitL0 data type.
Definition: JBuildL0.hh:102
Auxiliary class for handling PMT geometry, rate and response.
Definition: JPMTW0.hh:22
Data structure for vertex fit.
Definition: JPoint4D.hh:22
Detector data structure.
Definition: JDetector.hh:80
Rotation matrix.
Definition: JRotation3D.hh:111
double getRate() const
Get default rate.
3D track with energy and Bjorken Y.
Definition: JTrack3EY.hh:29
double getQuality(const double chi2, const int N, const int NDF)
Get quality of fit.
const JSummaryRouter & summary
Detector file.
Definition: JHead.hh:196
Data structure for vector in three dimensions.
Definition: JVector3D.hh:34
Acoustic event fit.
static JTimeRange T_ns
Time window with respect to Cherenkov hypothesis [ns].
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:98
JDirection3D getDirection(const JFit &fit)
Get direction.
Data time slice.
static const int JSHOWER_BJORKEN_Y
Detector subset without binary search functionality.
Data structure for fit of straight line in positive z-direction with energy.
Definition: JShowerEH.hh:28
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.
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR set_variable NORTH set_variable EAST set_variable SOUTH set_variable WEST set_variable WORKDIR tmp set_variable R set_variable CT set_variable YMAX set_variable YMIN if do_usage *then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:35
JFIT::JHistory JHistory
Definition: JHistory.hh:283
const JClass_t & getReference() const
Get reference to object.
Definition: JReference.hh:38
double getFinalBjY(double E_em, double E_h)
int getCount(const T &hit)
Get hit count.
JPosition3D getPosition(const JFit &fit)
Get position.
Template specialisation of class JModel to match hit with bright point.
Definition: JFit/JModel.hh:121
Data structure for normalised vector in positive z-direction.
Definition: JVersor3Z.hh:39
const JShowerEnergyCorrection & correct
double JRECONSTRUCTION::JShowerBjorkenY::getFinalBjY ( double  E_em,
double  E_h 
)
inline

Definition at line 219 of file JShowerBjorkenY.hh.

219  {
220  return E_h / (E_em + E_h);
221  }
void JRECONSTRUCTION::JShowerBjorkenYParameters_t::reset ( )
inlineinherited
bool JRECONSTRUCTION::JShowerBjorkenYParameters_t::equals ( const JShowerBjorkenYParameters_t parameters) const
inlineinherited

Equality.

Parameters
parametersfit parameters
Returns
true if equals; else false

Definition at line 52 of file JShowerBjorkenYParameters_t.hh.

53  {
54  return (this->TMax_ns == parameters.TMax_ns &&
55  this->TMin_ns == parameters.TMin_ns &&
56  this->numberOfPrefits == parameters.numberOfPrefits &&
57  this->roadWidth_m == parameters.roadWidth_m &&
58  this->R_Hz == parameters.R_Hz &&
59  this->mestimator == parameters.mestimator &&
60  this->fit_step == parameters.fit_step);
61  }
*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::JShowerBjorkenYParameters_t::ClassDef ( JShowerBjorkenYParameters_t  ,
 
)
inherited

Member Data Documentation

const JModuleRouter& JRECONSTRUCTION::JShowerBjorkenY::router

Definition at line 209 of file JShowerBjorkenY.hh.

const JSummaryRouter& JRECONSTRUCTION::JShowerBjorkenY::summary

Definition at line 210 of file JShowerBjorkenY.hh.

const JShowerEnergyCorrection& JRECONSTRUCTION::JShowerBjorkenY::correct

Definition at line 211 of file JShowerBjorkenY.hh.

size_t JRECONSTRUCTION::JShowerBjorkenYParameters_t::numberOfPrefits
inherited

Definition at line 65 of file JShowerBjorkenYParameters_t.hh.

double JRECONSTRUCTION::JShowerBjorkenYParameters_t::TMax_ns
inherited

Definition at line 66 of file JShowerBjorkenYParameters_t.hh.

double JRECONSTRUCTION::JShowerBjorkenYParameters_t::TMin_ns
inherited

Definition at line 67 of file JShowerBjorkenYParameters_t.hh.

double JRECONSTRUCTION::JShowerBjorkenYParameters_t::roadWidth_m
inherited

Definition at line 68 of file JShowerBjorkenYParameters_t.hh.

double JRECONSTRUCTION::JShowerBjorkenYParameters_t::R_Hz
inherited

Definition at line 69 of file JShowerBjorkenYParameters_t.hh.

int JRECONSTRUCTION::JShowerBjorkenYParameters_t::mestimator
inherited

Definition at line 70 of file JShowerBjorkenYParameters_t.hh.

double JRECONSTRUCTION::JShowerBjorkenYParameters_t::fit_step
inherited

Definition at line 71 of file JShowerBjorkenYParameters_t.hh.


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