Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Private Types | List of all members
JRECONSTRUCTION::JShowerDirectionPrefit Class Reference

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

#include <JShowerDirectionPrefit.hh>

Inheritance diagram for JRECONSTRUCTION::JShowerDirectionPrefit:
JRECONSTRUCTION::JShowerDirectionPrefitParameters_t JFIT::JRegressor< JModel_t, JMinimiser_t > TObject

Public Member Functions

 JShowerDirectionPrefit (const JShowerDirectionPrefitParameters_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 JShowerDirectionPrefitParameters_t &parameters) const
 Equality. More...
 
 ClassDef (JShowerDirectionPrefitParameters_t, 1)
 

Public Attributes

const JModuleRouterrouter
 
const JSummaryRoutersummary
 
size_t numberOfPrefits
 
double TMax_ns
 
double TMin_ns
 
double roadWidth_m
 
double DMin_m
 
double E_GeV
 
double R_Hz
 
int mestimator
 
double MaxAngle_deg_lowE
 
double scanAngle_deg_lowE
 
double MaxAngle_deg_highE
 
double scanAngle_deg_highE
 

Private Types

typedef JRegressor< JShower3EZ,
JGandalf
JRegressor_t
 

Detailed Description

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

Definition at line 71 of file JShowerDirectionPrefit.hh.

Member Typedef Documentation

Definition at line 76 of file JShowerDirectionPrefit.hh.

Constructor & Destructor Documentation

JRECONSTRUCTION::JShowerDirectionPrefit::JShowerDirectionPrefit ( const JShowerDirectionPrefitParameters_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, available in $JPP_DATA.
routermodule router, this is built via detector file.
summarysummary router
pdfFilePDF file
debugdebug

Definition at line 90 of file JShowerDirectionPrefit.hh.

94  :
96  JRegressor_t(pdfFile),
97  router(router),
98  summary(summary)
99  {
100  using namespace JPP;
101 
103  JRegressor_t::T_ns.setRange(parameters.TMin_ns, parameters.TMax_ns);
104  JRegressor_t::Vmax_npe = 20.0;
106 
107  this->parameters.resize(2);
108 
109  this->parameters[0] = JShower3EZ::pDX();
110  this->parameters[1] = JShower3EZ::pDY();
111 
112  this->estimator.reset(getMEstimator(parameters.mestimator));
113  }
static int debug
debug level (default is off).
Definition: JMessage.hh:45
static parameter_type pDX()
Definition: JShower3Z.hh:170
JRegressor< JShower3EZ, JGandalf > JRegressor_t
static parameter_type pDY()
Definition: JShower3Z.hh:171
static double Vmax_npe
Maximal integral of PDF [npe].
static JTimeRange T_ns
Time window with respect to Cherenkov hypothesis [ns].
static int MAXIMUM_ITERATIONS
maximal number of iterations
Definition: JGandalf.hh:247
JMEstimator * getMEstimator(const int type)
Get M-Estimator.
Definition: JMEstimator.hh:166

Member Function Documentation

JEvt JRECONSTRUCTION::JShowerDirectionPrefit::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 121 of file JShowerDirectionPrefit.hh.

122  {
123  using namespace std;
124  using namespace JPP;
125 
126  typedef vector<JHitL0> JDataL0_t;
127  JBuildL0<JHitL0> buildL0;
128 
129  JEvt out;
130 
132 
133  JDataL0_t dataL0;
134  buildL0(JDAQTimeslice(event, true), router, back_inserter(dataL0));
135 
136  for (JEvt::const_iterator shower = in.begin(); shower != in.end(); ++shower) {
137 
138  JShower3E sh(getPosition(*shower), getDirection(*shower), shower->getT(), shower->getE());
139 
141 
142  double distance = roadWidth_m;
143  double max_angle = MaxAngle_deg_lowE;
144  double scan_angle = scanAngle_deg_lowE;
145 
146  if(sh.getE() > E_GeV) {
147  distance = DMin_m; // to speed up the code
148  max_angle = MaxAngle_deg_highE;
149  scan_angle = scanAngle_deg_highE;
150  }
151 
152  const JModel<JPoint4D> match(JPoint4D(sh.getPosition(), sh.getT()), distance, JRegressor_t::T_ns);
153 
154  JVector3D start_dir(0,0,0);
155 
156  for (JDataL0_t::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
157 
158  if (match(*i)) {
159 
160  top.insert(i->getPMTIdentifier());
161 
162  start_dir.add(JDirection3D(i->getPosition() - sh.getPosition()));
163 
164  }
165  }
166 
167  sh.setDirection(JDirection3D(start_dir));
168 
169  JDetectorSubset_t subdetector(detector, sh.getPosition(), distance);
170 
171  JOmega3D scan_directions(sh.getDirection(), JAngleRange(0, max_angle * PI/180),
172  scan_angle * PI/180);
173 
174  for (JOmega3D_t::const_iterator dir = scan_directions.begin(); dir != scan_directions.end(); ++dir) {
175 
176  const JDirection3D conversion(*dir);
177  const JRotation3D R(conversion);
178 
179  vector<JPMTW0> buffer;
180 
181  for (JDetectorSubset_t::iterator module = subdetector.begin();
182  module != subdetector.end(); ++module) {
183 
184  JModule dom(*module);
185  dom.rotate(R);
186 
187  for (unsigned int i = 0; i != dom.size(); ++i) {
188 
189  const JDAQPMTIdentifier id(dom.getID(), i);
190 
191  const double rate_Hz = summary.getRate(id);
192 
193  buffer.push_back(JPMTW0(dom.getPMT(i), rate_Hz, top.count(id)));
194  }
195  }
196 
197  double chi2 = (*this)(JShower3EZ(JVertex3D(JVector3D(0,0,0), sh.getT()), JVersor3Z(),
198  JEnergy(log10(sh.getE()))), buffer.begin(), buffer.end());
199 
200  double NDF = getCount(buffer.begin(), buffer.end()) - this->parameters.size();
201 
202  JShower3E sh_fit(this->value.getPosition(), this->value.getDirection(),
203  this->value.getT(), this->value.getE());
204 
205  sh_fit.rotate_back(R);
206 
207  sh_fit.add(sh.getPosition());
208 
209  out.push_back(getFit(JHistory(shower->getHistory()).add(JSHOWERDIRECTIONPREFIT), sh_fit, getQuality(chi2),
210  NDF, sh_fit.getE()));
211 
212  }
213  }
214 
215  return out;
216 
217  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:32
Data structure for a composite optical module.
Definition: JModule.hh:50
JRange< double > JAngleRange
Type definition for angle range.
Definition: JAngleRange.hh:19
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
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
static const double PI
Constants.
Definition: JConstants.hh:20
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
Direction set covering (part of) solid angle.
Definition: JOmega3D.hh:64
3D track with energy.
Definition: JTrack3E.hh:29
double getQuality(const double chi2, const int N, const int NDF)
Get quality of fit.
Definition: JEvtToolkit.hh:206
Data structure for fit of straight line in positive z-direction with energy.
Definition: JShower3EZ.hh:25
Detector file.
Definition: JHead.hh:130
Data structure for vector in three dimensions.
Definition: JVector3D.hh:33
static const int JSHOWERDIRECTIONPREFIT
JDirection3D getDirection(const JFit &fit)
Get direction.
Definition: JEvtToolkit.hh:85
Data time slice.
JAxis3D & rotate_back(const JRotation3D &R)
Rotate back axis.
Definition: JAxis3D.hh:251
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:40
Detector subset without binary search functionality.
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.
Definition: JEvtToolkit.hh:126
JFIT::JHistory JHistory
Definition: JHistory.hh:283
const JClass_t & getReference() const
Get reference to object.
Definition: JReference.hh:38
Data structure for set of track fit results.
Definition: JEvt.hh:294
int getCount(const T &hit)
Get hit count.
Data structure for fit of energy.
Definition: JEnergy.hh:24
JPosition3D getPosition(const JFit &fit)
Get position.
Definition: JEvtToolkit.hh:73
static JTimeRange T_ns
Time window with respect to Cherenkov hypothesis [ns].
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:37
JVector3D & add(const JVector3D &vector)
Add vector.
Definition: JVector3D.hh:141
void JRECONSTRUCTION::JShowerDirectionPrefitParameters_t::reset ( )
inlineinherited

Reset fit parameters.

Definition at line 35 of file JShowerDirectionPrefitParameters_t.hh.

36  {
37  numberOfPrefits = 1;
38  TMax_ns = 30;
39  TMin_ns = -30;
40  roadWidth_m = 80;
41  DMin_m = 80;
42  E_GeV = 13;
43  MaxAngle_deg_lowE = 40;
44  scanAngle_deg_lowE = 10;
45  MaxAngle_deg_highE = 20;
47  R_Hz = 10.0e3;
49  }
bool JRECONSTRUCTION::JShowerDirectionPrefitParameters_t::equals ( const JShowerDirectionPrefitParameters_t parameters) const
inlineinherited

Equality.

Parameters
parametersfit parameters
Returns
true if equals; else false

Definition at line 57 of file JShowerDirectionPrefitParameters_t.hh.

58  {
59  return (this->TMax_ns == parameters.TMax_ns &&
60  this->TMin_ns == parameters.TMin_ns &&
61  this->numberOfPrefits == parameters.numberOfPrefits &&
62  this->roadWidth_m == parameters.roadWidth_m &&
63  this->DMin_m == parameters.DMin_m &&
64  this->E_GeV == parameters.E_GeV &&
65  this->R_Hz == parameters.R_Hz &&
66  this->mestimator == parameters.mestimator &&
67  this->MaxAngle_deg_lowE == parameters.MaxAngle_deg_lowE &&
68  this->scanAngle_deg_lowE == parameters.scanAngle_deg_lowE &&
69  this->MaxAngle_deg_highE == parameters.MaxAngle_deg_highE &&
70  this->scanAngle_deg_highE == parameters.scanAngle_deg_highE);
71  }
*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::JShowerDirectionPrefitParameters_t::ClassDef ( JShowerDirectionPrefitParameters_t  ,
 
)
inherited

Member Data Documentation

const JModuleRouter& JRECONSTRUCTION::JShowerDirectionPrefit::router

Definition at line 219 of file JShowerDirectionPrefit.hh.

const JSummaryRouter& JRECONSTRUCTION::JShowerDirectionPrefit::summary

Definition at line 220 of file JShowerDirectionPrefit.hh.

size_t JRECONSTRUCTION::JShowerDirectionPrefitParameters_t::numberOfPrefits
inherited

Definition at line 75 of file JShowerDirectionPrefitParameters_t.hh.

double JRECONSTRUCTION::JShowerDirectionPrefitParameters_t::TMax_ns
inherited

Definition at line 76 of file JShowerDirectionPrefitParameters_t.hh.

double JRECONSTRUCTION::JShowerDirectionPrefitParameters_t::TMin_ns
inherited

Definition at line 77 of file JShowerDirectionPrefitParameters_t.hh.

double JRECONSTRUCTION::JShowerDirectionPrefitParameters_t::roadWidth_m
inherited

Definition at line 78 of file JShowerDirectionPrefitParameters_t.hh.

double JRECONSTRUCTION::JShowerDirectionPrefitParameters_t::DMin_m
inherited

Definition at line 79 of file JShowerDirectionPrefitParameters_t.hh.

double JRECONSTRUCTION::JShowerDirectionPrefitParameters_t::E_GeV
inherited

Definition at line 80 of file JShowerDirectionPrefitParameters_t.hh.

double JRECONSTRUCTION::JShowerDirectionPrefitParameters_t::R_Hz
inherited

Definition at line 81 of file JShowerDirectionPrefitParameters_t.hh.

int JRECONSTRUCTION::JShowerDirectionPrefitParameters_t::mestimator
inherited

Definition at line 82 of file JShowerDirectionPrefitParameters_t.hh.

double JRECONSTRUCTION::JShowerDirectionPrefitParameters_t::MaxAngle_deg_lowE
inherited

Definition at line 83 of file JShowerDirectionPrefitParameters_t.hh.

double JRECONSTRUCTION::JShowerDirectionPrefitParameters_t::scanAngle_deg_lowE
inherited

Definition at line 84 of file JShowerDirectionPrefitParameters_t.hh.

double JRECONSTRUCTION::JShowerDirectionPrefitParameters_t::MaxAngle_deg_highE
inherited

Definition at line 85 of file JShowerDirectionPrefitParameters_t.hh.

double JRECONSTRUCTION::JShowerDirectionPrefitParameters_t::scanAngle_deg_highE
inherited

Definition at line 86 of file JShowerDirectionPrefitParameters_t.hh.


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