Jpp  debug
the software that should make you happy
Public Types | Public Member Functions | Public Attributes | List of all members
JRECONSTRUCTION::JMuonFeatures Struct Reference

Wrapper class to add features after the final fit of muon trajectory. More...

#include <JMuonFeatures.hh>

Inheritance diagram for JRECONSTRUCTION::JMuonFeatures:
JRECONSTRUCTION::JMuonGandalfParameters_t JFIT::JRegressor< JModel_t, JMinimiser_t > TObject

Public Types

typedef JRegressor< JLine3Z, JGandalfJRegressor_t
 
typedef JTRIGGER::JHitL0 hit_type
 
typedef std::vector< hit_typebuffer_type
 

Public Member Functions

 JMuonFeatures (const JMuonGandalfParameters_t &parameters, const JModuleRouter &router, const JSummaryRouter &summary, const std::string &pdf_file, const int debug=0)
 Constructor. More...
 
JEvt operator() (const KM3NETDAQ::JDAQEvent &event, const JEvt &in)
 Fit function. More...
 
JEvt operator() (const buffer_type &data, const JEvt &in)
 Fit function. More...
 
void reset ()
 Reset fit parameters. More...
 
bool equals (const JMuonGandalfParameters_t &parameters) const
 Equality. More...
 
 ClassDef (JMuonGandalfParameters_t, 2)
 

Public Attributes

const JModuleRouterrouter
 
const JSummaryRoutersummary
 
int debug
 
double roadWidth_m
 road width [m] More...
 
double R_Hz
 default rate [Hz] More...
 
size_t numberOfPrefits
 number of prefits More...
 
double TTS_ns
 transition-time spread [ns] More...
 
double E_GeV
 energy [GeV] More...
 
double TMin_ns
 minimal time w.r.t. Cherenkov hypothesis [ns] More...
 
double TMax_ns
 maximal time w.r.t. Cherenkov hypothesis [ns] More...
 
double ZMin_m
 minimal z-positon [m] More...
 
double ZMax_m
 maximal z-positon [m] More...
 
double VMax_npe
 maximum number of of photo-electrons More...
 
int NMax
 maximum number of iterations More...
 
bool reprocess
 reprocess More...
 

Detailed Description

Wrapper class to add features after the final fit of muon trajectory.

The JMuonGandalf fit uses one or more start values (usually taken from the output of JMuonSimplex).
All hits of which the PMT position lies within a set road width (JMuonGandalfParameters_t::roadWidth_m) and time is within a set window (JMuonGandalfParameters_t::TMin_ns, JMuonGandalfParameters_t::TMax_ns) around the Cherenkov hypothesis are taken.
In case there are multiple hits from the same PMT is the specified window, the first hit is taken and the other hits are discarded.
The PDF is accordingly evaluated, i.e. the normalised probability for a first hit at the given time of the hit is taken. The normalisation is consistently based on the specified time window.
Note that this hit selection is unbiased with respect to the PDF of a single PMT.

Definition at line 74 of file JMuonFeatures.hh.

Member Typedef Documentation

◆ JRegressor_t

Definition at line 78 of file JMuonFeatures.hh.

◆ hit_type

Definition at line 79 of file JMuonFeatures.hh.

◆ buffer_type

Definition at line 80 of file JMuonFeatures.hh.

Constructor & Destructor Documentation

◆ JMuonFeatures()

JRECONSTRUCTION::JMuonFeatures::JMuonFeatures ( const JMuonGandalfParameters_t parameters,
const JModuleRouter router,
const JSummaryRouter summary,
const std::string &  pdf_file,
const int  debug = 0 
)
inline

Constructor.

Parameters
parametersparameters
routermodule router
summarysummary file router
pdf_filePDF file
debugdebug

Definition at line 93 of file JMuonFeatures.hh.

97  :
98  JMuonGandalfParameters_t(parameters),
99  JRegressor_t(pdf_file, parameters.TTS_ns),
100  router (router),
102  {
103  using namespace JFIT;
104 
105  if (this->getRmax() < roadWidth_m) {
106  roadWidth_m = this->getRmax();
107  }
108 
110  JRegressor_t::T_ns.setRange(TMin_ns, TMax_ns);
111  JRegressor_t::Vmax_npe = VMax_npe;
112  JRegressor_t::MAXIMUM_ITERATIONS = NMax;
113 
114  this->parameters.resize(5);
115 
116  this->parameters[0] = JLine3Z::pX();
117  this->parameters[1] = JLine3Z::pY();
118  this->parameters[2] = JLine3Z::pT();
119  this->parameters[3] = JLine3Z::pDX();
120  this->parameters[4] = JLine3Z::pDY();
121  }
int debug
debug level
Definition: JSirene.cc:69
static parameter_type pY()
Definition: JLine1Z.hh:181
static parameter_type pX()
Definition: JLine1Z.hh:180
static parameter_type pT()
Definition: JLine1Z.hh:182
static parameter_type pDY()
Definition: JLine3Z.hh:320
static parameter_type pDX()
Definition: JLine3Z.hh:319
Auxiliary classes and methods for linear and iterative data regression.
Definition: JEnergy.hh:15
JRegressor< JLine3Z, JGandalf > JRegressor_t
const JSummaryRouter & summary
const JModuleRouter & router
double TMin_ns
minimal time w.r.t. Cherenkov hypothesis [ns]
double TMax_ns
maximal time w.r.t. Cherenkov hypothesis [ns]
double VMax_npe
maximum number of of photo-electrons

Member Function Documentation

◆ operator()() [1/2]

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

Fit function.

Parameters
eventevent
instart values
Returns
fit results

Definition at line 131 of file JMuonFeatures.hh.

132  {
133  using namespace std;
134  using namespace JFIT;
135  using namespace JTRIGGER;
136 
137  const JBuildL0<hit_type> buildL0;
138 
139  buffer_type dataL0;
140 
141  buildL0(event, router, true, back_inserter(dataL0));
142 
143  return (*this)(dataL0, in);
144  }
Template L0 hit builder.
Definition: JBuildL0.hh:38
Auxiliary classes and methods for triggering.
Definition: JSTDTypes.hh:14

◆ operator()() [2/2]

JEvt JRECONSTRUCTION::JMuonFeatures::operator() ( const buffer_type data,
const JEvt in 
)
inline

Fit function.

Parameters
datahit data
instart values
Returns
fit results

Definition at line 154 of file JMuonFeatures.hh.

155  {
156  using namespace std;
157  using namespace JFIT;
158  using namespace JGEOMETRY3D;
159 
160  JEvt out;
161 
162  for (JEvt::const_iterator track = in.begin(); track != in.end(); ++track) {
163 
164  const JRotation3D R (getDirection(*track));
165  const JLine1Z tz(getPosition (*track).rotate(R), track->getT());
166  JRange<double> Z_m;
167 
168  if (track->hasW(JSTART_LENGTH_METRES) &&
169  track->getW(JSTART_LENGTH_METRES) > 0.0) {
170  Z_m = JZRange(ZMin_m, ZMax_m + track->getW(JSTART_LENGTH_METRES));
171  }
172 
173  const JModel<JLine1Z> match(tz, roadWidth_m, JRegressor_t::T_ns, Z_m);
174 
175  // hit selection based on start value
176 
177  vector<JHitW0> buffer;
178 
179  for (buffer_type::const_iterator i = data.begin(); i != data.end(); ++i) {
180 
181  JHitW0 hit(*i, summary.getRate(i->getPMTIdentifier()));
182 
183  hit.rotate(R);
184 
185  if (match(hit)) {
186  buffer.push_back(hit);
187  }
188  }
189 
190  // select first hit
191 
192  std::set<int> string_ids;
193  for (vector<JHitW0>::const_iterator i = buffer.begin(); i != buffer.end(); ++i) {
194  string_ids.insert(router.getModule(((*i).getModuleID())).getString());
195  }
196 
197  const int number_of_hits = JLANG::getCount(JLANG::make_array(buffer.begin(), buffer.end(), &JHitW0::getPMTIdentifier));
198  const int number_of_doms = JLANG::getCount(JLANG::make_array(buffer.begin(), buffer.end(), &JHitW0::getModuleIdentifier));
199  const int number_of_lines = string_ids.size();
200 
201  const int NDF = number_of_hits - this->parameters.size();
202 
203  if (NDF > 0) {
204 
205  out.push_back(JFit(*track).add(JMUONFEATURES));
206 
207  // set additional values
208 
209  out.rbegin()->setW(JMUONFEATURES_NUMBER_OF_HITS , number_of_hits);
210  out.rbegin()->setW(JMUONFEATURES_NUMBER_OF_DOMS , number_of_doms);
211  out.rbegin()->setW(JMUONFEATURES_NUMBER_OF_LINES , number_of_lines);
212 
213  }
214  }
215 
216  return out;
217  }
int getString() const
Get string number.
Definition: JLocation.hh:134
const JModule & getModule(const JObjectID &id) const
Get module parameters.
JFit & add(const int type)
Add event to history.
Data structure for fit of straight line paralel to z-axis.
Definition: JLine1Z.hh:29
JPosition3D & rotate(const JRotation3D &R)
Rotate.
Definition: JPosition3D.hh:186
Rotation matrix.
Definition: JRotation3D.hh:114
Auxiliary class for a hit with background rate value.
Definition: JHitW0.hh:23
double getRate() const
Get default rate.
const JDAQModuleIdentifier & getModuleIdentifier() const
Get Module identifier.
const JDAQPMTIdentifier & getPMTIdentifier() const
Get PMT identifier.
static const int JMUONFEATURES
static const int JMUONFEATURES_NUMBER_OF_LINES
number of lines from JMuonFeatures.cc
static const int JSTART_LENGTH_METRES
distance between first and last hits in metres from JStart.cc
static const int JMUONFEATURES_NUMBER_OF_HITS
number of hits from JMuonFeatures.cc
static const int JMUONFEATURES_NUMBER_OF_DOMS
number of doms from JMuonFeatures.cc
JTOOLS::JRange< double > JZRange
Definition: JFit/JModel.hh:21
Auxiliary classes and methods for 3D geometrical objects and operations.
Definition: JAngle3D.hh:19
const array_type< JValue_t > & make_array(const JValue_t(&array)[N])
Method to create array of values.
Definition: JVectorize.hh:54
size_t getCount(const array_type< T > &buffer, const JCompare_t &compare)
Count number of unique values.
Definition: JVectorize.hh:261
JPosition3D getPosition(const JFit &fit)
Get position.
JDirection3D getDirection(const JFit &fit)
Get direction.
Acoustic event fit.
Template specialisation of class JModel to match hit with muon trajectory along z-axis.
Definition: JFit/JModel.hh:36

◆ reset()

void JRECONSTRUCTION::JMuonGandalfParameters_t::reset ( )
inlineinherited

Reset fit parameters.

Definition at line 41 of file JMuonGandalfParameters_t.hh.

42  {
43  roadWidth_m = std::numeric_limits<double>::max();
44  R_Hz = 6.0e3;
45  numberOfPrefits = 0;
46  TTS_ns = 2;
47  E_GeV = 1.0e3;
48  TMin_ns = -50.0;
49  TMax_ns = +450.0;
50  ZMin_m = 0.0;
51  ZMax_m = 0.0;
52  VMax_npe = 10.0;
53  NMax = 1000;
54  reprocess = false;
55  }

◆ equals()

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

Equality.

Parameters
parametersfit parameters
Returns
true if equals; else false

Definition at line 63 of file JMuonGandalfParameters_t.hh.

64  {
65  return (this->roadWidth_m == parameters.roadWidth_m &&
66  this->R_Hz == parameters.R_Hz &&
67  this->numberOfPrefits == parameters.numberOfPrefits &&
68  this->TTS_ns == parameters.TTS_ns &&
69  this->E_GeV == parameters.E_GeV &&
70  this->TMin_ns == parameters.TMin_ns &&
71  this->TMax_ns == parameters.TMax_ns &&
72  this->ZMin_m == parameters.ZMin_m &&
73  this->ZMax_m == parameters.ZMax_m &&
74  this->VMax_npe == parameters.VMax_npe &&
75  this->NMax == parameters.NMax &&
76  this->reprocess == parameters.reprocess);
77  }

◆ ClassDef()

JRECONSTRUCTION::JMuonGandalfParameters_t::ClassDef ( JMuonGandalfParameters_t  ,
 
)
inherited

Member Data Documentation

◆ router

const JModuleRouter& JRECONSTRUCTION::JMuonFeatures::router

Definition at line 220 of file JMuonFeatures.hh.

◆ summary

const JSummaryRouter& JRECONSTRUCTION::JMuonFeatures::summary

Definition at line 221 of file JMuonFeatures.hh.

◆ debug

int JRECONSTRUCTION::JMuonFeatures::debug

Definition at line 222 of file JMuonFeatures.hh.

◆ roadWidth_m

double JRECONSTRUCTION::JMuonGandalfParameters_t::roadWidth_m
inherited

road width [m]

Definition at line 81 of file JMuonGandalfParameters_t.hh.

◆ R_Hz

double JRECONSTRUCTION::JMuonGandalfParameters_t::R_Hz
inherited

default rate [Hz]

Definition at line 82 of file JMuonGandalfParameters_t.hh.

◆ numberOfPrefits

size_t JRECONSTRUCTION::JMuonGandalfParameters_t::numberOfPrefits
inherited

number of prefits

Definition at line 83 of file JMuonGandalfParameters_t.hh.

◆ TTS_ns

double JRECONSTRUCTION::JMuonGandalfParameters_t::TTS_ns
inherited

transition-time spread [ns]

Definition at line 84 of file JMuonGandalfParameters_t.hh.

◆ E_GeV

double JRECONSTRUCTION::JMuonGandalfParameters_t::E_GeV
inherited

energy [GeV]

Definition at line 85 of file JMuonGandalfParameters_t.hh.

◆ TMin_ns

double JRECONSTRUCTION::JMuonGandalfParameters_t::TMin_ns
inherited

minimal time w.r.t. Cherenkov hypothesis [ns]

Definition at line 86 of file JMuonGandalfParameters_t.hh.

◆ TMax_ns

double JRECONSTRUCTION::JMuonGandalfParameters_t::TMax_ns
inherited

maximal time w.r.t. Cherenkov hypothesis [ns]

Definition at line 87 of file JMuonGandalfParameters_t.hh.

◆ ZMin_m

double JRECONSTRUCTION::JMuonGandalfParameters_t::ZMin_m
inherited

minimal z-positon [m]

Definition at line 88 of file JMuonGandalfParameters_t.hh.

◆ ZMax_m

double JRECONSTRUCTION::JMuonGandalfParameters_t::ZMax_m
inherited

maximal z-positon [m]

Definition at line 89 of file JMuonGandalfParameters_t.hh.

◆ VMax_npe

double JRECONSTRUCTION::JMuonGandalfParameters_t::VMax_npe
inherited

maximum number of of photo-electrons

Definition at line 90 of file JMuonGandalfParameters_t.hh.

◆ NMax

int JRECONSTRUCTION::JMuonGandalfParameters_t::NMax
inherited

maximum number of iterations

Definition at line 91 of file JMuonGandalfParameters_t.hh.

◆ reprocess

bool JRECONSTRUCTION::JMuonGandalfParameters_t::reprocess
inherited

reprocess

Definition at line 92 of file JMuonGandalfParameters_t.hh.


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