Jpp 20.0.0-195-g190c9e876
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  hit_type
 
struct  input_type
 Input data type. More...
 

Public Types

typedef JRegressor< JLine3Z, JGandalfJRegressor_t
 
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 77 of file JMuonFeatures.hh.

Member Typedef Documentation

◆ JRegressor_t

◆ 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 128 of file JMuonFeatures.hh.

130 :
131 JMuonGandalfParameters_t(parameters),
132 JRegressor_t(storage)
133 {
134 using namespace JFIT;
135
136 if (this->getRmax() < roadWidth_m) {
137 roadWidth_m = this->getRmax();
138 }
139
142 JRegressor_t::Vmax_npe = VMax_npe;
143 }
int debug
debug level
Definition JSirene.cc:74
void setRange(const range_type &range)
Set range.
Definition JRange.hh:146
Auxiliary classes and methods for linear and iterative data regression.
static int debug
debug level (default is off).
Definition JMessage.hh:45
JTimeRange T_ns
Time window with respect to Cherenkov hypothesis [ns].
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 155 of file JMuonFeatures.hh.

160 {
161 using namespace std;
162 using namespace JTRIGGER;
163
164 const JBuildL0<JHitL0> buildL0;
165
166 input_type input(event.getDAQEventHeader(), in, coverage);
167
169
170 buildL0(event, router, true, back_inserter(data));
171
172 for (const auto& hit : data) {
173
174 const int type = 0;
175 const double QE = 1.0;
176 const double R_Hz = summary.getRate(hit.getPMTIdentifier(), this->R_Hz);
177
178 input.data.push_back( { JHitW0(hit, type, QE, R_Hz), router.getModule(hit.getModuleID()).getLocation() } );
179 }
180
181 return input;
182 }
const JLocation & getLocation() const
Get location.
Definition JLocation.hh:70
const JModule & getModule(const JObjectID &id) const
Get module parameters.
Auxiliary class for a hit with background rate value.
Definition JHitW0.hh:25
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 191 of file JMuonFeatures.hh.

192 {
193 using namespace std;
194 using namespace JFIT;
195 using namespace JGEOMETRY3D;
196
197 JEvent event(JMUONFEATURES);
198
199 JEvt out;
200
201 const buffer_type& data = input.data;
202
203 // select start values
204
205 JEvt in = input.in;
206
207 in.select(numberOfPrefits, qualitySorter);
208
209 if (!in.empty()) {
210 in.select(JHistory::is_event(in.begin()->getHistory()));
211 }
212
213 for (JEvt::const_iterator track = in.begin(); track != in.end(); ++track) {
214
215 const JRotation3D R (getDirection(*track));
216 const JLine1Z tz(getPosition (*track).rotate(R), track->getT());
217 JRange<double> Z_m;
218
219 if (track->hasW(JSTART_LENGTH_METRES) &&
220 track->getW(JSTART_LENGTH_METRES) > 0.0) {
221 Z_m = JZRange(ZMin_m, ZMax_m + track->getW(JSTART_LENGTH_METRES));
222 }
223
224 const JModel<JLine1Z> match(tz, roadWidth_m, JRegressor_t::T_ns, Z_m);
225
226 // hit selection based on start value
227
228 buffer_type buffer;
229
230 for (buffer_type::const_iterator i = data.begin(); i != data.end(); ++i) {
231
232 hit_type hit(*i);
233
234 hit.rotate(R);
235
236 if (match(hit)) {
237 buffer.push_back(hit);
238 }
239 }
240
241 const int number_of_hits = JLANG::getCount(JLANG::make_array(buffer.begin(), buffer.end(), &hit_type::getPMTIdentifier));
242 const int number_of_doms = JLANG::getCount(JLANG::make_array(buffer.begin(), buffer.end(), &hit_type::getModuleIdentifier));
243 const int number_of_lines = JLANG::getCount(JLANG::make_array(buffer.begin(), buffer.end(), &hit_type::getString));
244
245 out.push_back(JFit(*track).add(JMUONFEATURES));
246
247 // set additional values
248
249 out.rbegin()->setW(JMUONFEATURES_NUMBER_OF_HITS , number_of_hits);
250 out.rbegin()->setW(JMUONFEATURES_NUMBER_OF_DOMS , number_of_doms);
251 out.rbegin()->setW(JMUONFEATURES_NUMBER_OF_LINES , number_of_lines);
252 }
253
254 // apply default sorter
255
256 sort(out.begin(), out.end(), qualitySorter);
257
258 copy(input.in.begin(), input.in.end(), back_inserter(out));
259
260 return out;
261 }
int getString() const
Get string number.
Definition JLocation.hh:135
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: