Jpp 20.0.0-rc.8
the software that should make you happy
Loading...
Searching...
No Matches
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

Classes

struct  input_type
 Input data type. More...
 

Public Types

typedef JRegressor< JLine3Z, JGandalfJRegressor_t
 
typedef JHitW0 hit_type
 
typedef std::vector< hit_typebuffer_type
 

Public Member Functions

 JMuonFeatures (const JMuonGandalfParameters_t &parameters, const storage_type &storage, const int debug=0)
 Constructor.
 
input_type getInput (const JModuleRouter &router, const JSummaryRouter &summary, const JDAQEvent &event, const JEvt &in, const coverage_type &coverage) const
 Get input data.
 
JEvt operator() (const input_type &input)
 Fit function.
 
void reset ()
 Reset fit parameters.
 
bool equals (const JMuonGandalfParameters_t &parameters) const
 Equality.
 
 ClassDef (JMuonGandalfParameters_t, 3)
 

Public Attributes

double roadWidth_m
 road width [m]
 
double R_Hz
 default rate [Hz]
 
size_t numberOfPrefits
 number of prefits
 
double TTS_ns
 transition-time spread [ns]
 
double E_GeV
 energy [GeV]
 
double TMin_ns
 minimal time w.r.t. Cherenkov hypothesis [ns]
 
double TMax_ns
 maximal time w.r.t. Cherenkov hypothesis [ns]
 
double ZMin_m
 minimal z-positon [m]
 
double ZMax_m
 maximal z-positon [m]
 
double VMax_npe
 maximum number of of photo-electrons
 
double cosLR
 maximal cosine space angle likelihood ratio test
 
int NMax
 maximum number of iterations
 

Detailed Description

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

JMuonFeatures computes value of number of hists, number of doms and number of lines from the hits of an event. Note that no values computed at previous steps are modified.

Definition at line 75 of file JMuonFeatures.hh.

Member Typedef Documentation

◆ JRegressor_t

◆ hit_type

◆ buffer_type

Constructor & Destructor Documentation

◆ JMuonFeatures()

JRECONSTRUCTION::JMuonFeatures::JMuonFeatures ( const JMuonGandalfParameters_t & parameters,
const storage_type & storage,
const int debug = 0 )
inline

Constructor.

Parameters
parametersparameters
storagestorage
debugdebug

Definition at line 126 of file JMuonFeatures.hh.

128 :
129 JMuonGandalfParameters_t(parameters),
130 JRegressor_t(storage)
131 {
132 using namespace JFIT;
133
134 if (this->getRmax() < roadWidth_m) {
135 roadWidth_m = this->getRmax();
136 }
137
138 JRegressor_t::debug = debug;
139 JRegressor_t::T_ns.setRange(TMin_ns, TMax_ns);
140 JRegressor_t::Vmax_npe = VMax_npe;
141 JRegressor_t::MAXIMUM_ITERATIONS = NMax;
142
143 this->parameters.resize(5);
144
145 this->parameters[0] = JLine3Z::pX();
146 this->parameters[1] = JLine3Z::pY();
147 this->parameters[2] = JLine3Z::pT();
148 this->parameters[3] = JLine3Z::pDX();
149 this->parameters[4] = JLine3Z::pDY();
150
151 }
int debug
debug level
Definition JSirene.cc:72
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.
JRegressor< JLine3Z, JGandalf > JRegressor_t
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

◆ getInput()

input_type JRECONSTRUCTION::JMuonFeatures::getInput ( const JModuleRouter & router,
const JSummaryRouter & summary,
const JDAQEvent & event,
const JEvt & in,
const coverage_type & coverage ) const
inline

Get input data.

Parameters
routermodule router
summarysummary data
eventevent
instart values
coveragecoverage
Returns
input data

Definition at line 163 of file JMuonFeatures.hh.

168 {
169 using namespace std;
170 using namespace JTRIGGER;
171
172 const JBuildL0<JHitL0> buildL0;
173
174 input_type input(event.getDAQEventHeader(), in, coverage);
175
177
178 buildL0(event, router, true, back_inserter(data));
179
180 for (const auto& hit : data) {
181 input.data.push_back(hit_type(hit, summary.getRate(hit.getPMTIdentifier(), this->R_Hz)));
182 input.mapString[hit.getModuleID()] = router.getModule(hit.getModuleID()).getString();
183 }
184
185 return input;
186 }
int getString() const
Get string number.
Definition JLocation.hh:135
const JModule & getModule(const JObjectID &id) const
Get module parameters.
double getRate(const JDAQPMTIdentifier &id) const
Get rate.
Template L0 hit builder.
Definition JBuildL0.hh:38
const JDAQEventHeader & getDAQEventHeader() const
Get DAQ event header.
Auxiliary classes and methods for triggering.

◆ operator()()

JEvt JRECONSTRUCTION::JMuonFeatures::operator() ( const input_type & input)
inline

Fit function.

Parameters
inputinput data
Returns
fit results

Definition at line 195 of file JMuonFeatures.hh.

196 {
197 using namespace std;
198 using namespace JFIT;
199 using namespace JGEOMETRY3D;
200
201 JEvent event(JMUONFEATURES);
202
203 JEvt out;
204
205 const buffer_type& data = input.data;
206
207 // select start values
208
209 JEvt in = input.in;
210
211 in.select(numberOfPrefits, qualitySorter);
212
213 if (!in.empty()) {
214 in.select(JHistory::is_event(in.begin()->getHistory()));
215 }
216
217 for (JEvt::const_iterator track = in.begin(); track != in.end(); ++track) {
218
219 const JRotation3D R (getDirection(*track));
220 const JLine1Z tz(getPosition (*track).rotate(R), track->getT());
221 JRange<double> Z_m;
222
223 if (track->hasW(JSTART_LENGTH_METRES) &&
224 track->getW(JSTART_LENGTH_METRES) > 0.0) {
225 Z_m = JZRange(ZMin_m, ZMax_m + track->getW(JSTART_LENGTH_METRES));
226 }
227
228 const JModel<JLine1Z> match(tz, roadWidth_m, JRegressor_t::T_ns, Z_m);
229
230 // hit selection based on start value
231
232 buffer_type buffer;
233
234 for (buffer_type::const_iterator i = data.begin(); i != data.end(); ++i) {
235
236 hit_type hit(*i);
237
238 hit.rotate(R);
239
240 if (match(hit)) {
241 buffer.push_back(hit);
242 }
243 }
244
245 // select first hit
246
247 std::map<int, int> mapString = input.mapString;
248
249 std::set<int> stringSet;
250 for (buffer_type::const_iterator i = buffer.begin(); i != buffer.end(); ++i) {
251 auto it = mapString.find((*i).getModuleID());
252 stringSet.insert(it->second);
253 }
254
255 const int number_of_hits = JLANG::getCount(JLANG::make_array(buffer.begin(), buffer.end(), &JHitW0::getPMTIdentifier));
256 const int number_of_doms = JLANG::getCount(JLANG::make_array(buffer.begin(), buffer.end(), &JHitW0::getModuleIdentifier));
257 const int number_of_lines = stringSet.size();
258
259 const int NDF = number_of_hits - this->parameters.size();
260
261 if (NDF > 0) {
262
263 out.push_back(JFit(*track).add(JMUONFEATURES));
264
265 // set additional values
266
267 out.rbegin()->setW(JMUONFEATURES_NUMBER_OF_HITS , number_of_hits);
268 out.rbegin()->setW(JMUONFEATURES_NUMBER_OF_DOMS , number_of_doms);
269 out.rbegin()->setW(JMUONFEATURES_NUMBER_OF_LINES , number_of_lines);
270
271 }
272 }
273
274 // apply default sorter
275
276 sort(out.begin(), out.end(), qualitySorter);
277
278 copy(input.in.begin(), input.in.end(), back_inserter(out));
279
280 return out;
281 }
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.
Range of values.
Definition JRange.hh:42
const JDAQModuleIdentifier & getModuleIdentifier() const
Get Module identifier.
const JDAQPMTIdentifier & getPMTIdentifier() const
Get PMT identifier.
static const int JMUONFEATURES_NUMBER_OF_LINES
number of lines see JRECONSTRUCTION::JMuonFeatures
static const int JSTART_LENGTH_METRES
distance between projected positions on the track of optical modules for which the response does not ...
static const int JMUONFEATURES_NUMBER_OF_HITS
number of hits see JRECONSTRUCTION::JMuonFeatures
static const int JMUONFEATURES_NUMBER_OF_DOMS
number of doms see JRECONSTRUCTION::JMuonFeatures
JTOOLS::JRange< double > JZRange
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.
JPosition3D getPosition(const JFit &fit)
Get position.
void copy(const JFIT::JEvt::const_iterator __begin, const JFIT::JEvt::const_iterator __end, Evt &out)
Copy tracks.
bool qualitySorter(const JFit &first, const JFit &second)
Comparison of fit results.
JDirection3D getDirection(const JFit &fit)
Get direction.
Acoustic event fit.
Model for fit to acoustics data.
Transmission with position.
Definition JBillabong.cc:70
Auxiliary class to test history.
Definition JHistory.hh:157

◆ 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;
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 cosLR = 0.7;
54 NMax = 1000;
55 }
double cosLR
maximal cosine space angle likelihood ratio test

◆ 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->cosLR == parameters.cosLR &&
76 this->NMax == parameters.NMax);
77 }

◆ ClassDef()

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

Member Data Documentation

◆ 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.

◆ cosLR

double JRECONSTRUCTION::JMuonGandalfParameters_t::cosLR
inherited

maximal cosine space angle likelihood ratio test

Definition at line 91 of file JMuonGandalfParameters_t.hh.

◆ NMax

int JRECONSTRUCTION::JMuonGandalfParameters_t::NMax
inherited

maximum number of iterations

Definition at line 92 of file JMuonGandalfParameters_t.hh.


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