Jpp 21.0.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JRECONSTRUCTION::JShowerFeatures Struct Reference

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

#include <JShowerFeatures.hh>

Inheritance diagram for JRECONSTRUCTION::JShowerFeatures:
JRECONSTRUCTION::JShowerFitParameters_t JFIT::JRegressor< JModel_t, JMinimiser_t > TObject

Classes

struct  input_type
 Input data type. More...
 

Public Types

typedef JRegressor< JShower3EZ, JAbstractMinimiserJRegressor_t
 
typedef JModuleL0 module_type
 
typedef std::vector< module_typedetector_type
 
typedef JRegressorStorage< JShower3EZ, JFIT::JAbstractMinimiserstorage_type
 

Public Member Functions

 JShowerFeatures (const JShowerFitParameters_t &parameters, const storage_type &storage, const JPMTParametersMap &pmtParameters, 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 JShowerFitParameters_t &parameters) const
 Equality.
 
 ClassDef (JShowerFitParameters_t, 2)
 

Public Attributes

const JPMTParametersMappmtParameters
 
size_t numberOfPrefits
 number of prefits

 
double TMax_ns
 maximum time for local coincidences [ns]

 
double TMin_ns
 minimum time for local coincidences [ns]

 
double DStep_m
 step increase for the distance to optical module [m]

 
double R_Hz
 default rate [Hz]

 
int mestimator
 M-estimator (see JFIT::JMEstimator_t)
 
double Vmax_npe
 maximum number of of photo-electrons
 
double DMax_m
 maximal distance to optical module [m]
 

Detailed Description

Wrapper class to add features after the final fit of shower.

Note that no values computed at previous steps are modified.

Definition at line 77 of file JShowerFeatures.hh.

Member Typedef Documentation

◆ JRegressor_t

◆ module_type

◆ detector_type

◆ storage_type

Constructor & Destructor Documentation

◆ JShowerFeatures()

JRECONSTRUCTION::JShowerFeatures::JShowerFeatures ( const JShowerFitParameters_t & parameters,
const storage_type & storage,
const JPMTParametersMap & pmtParameters,
const int debug = 0 )
inline

Constructor.

Parameters
parametersparameters
storagestorage
pmtParametersPMT parameters
debugdebug

Definition at line 127 of file JShowerFeatures.hh.

130 :
131 JShowerFitParameters_t(parameters),
132 JRegressor_t(storage),
134 {
135 using namespace JFIT;
136
139 }
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].
const JPMTParametersMap & pmtParameters
JRegressor< JShower3EZ, JAbstractMinimiser > JRegressor_t
double TMax_ns
maximum time for local coincidences [ns]
double TMin_ns
minimum time for local coincidences [ns]

Member Function Documentation

◆ getInput()

input_type JRECONSTRUCTION::JShowerFeatures::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 151 of file JShowerFeatures.hh.

156 {
157 using namespace std;
158 using namespace JTRIGGER;
159
160 input_type input(event.getDAQEventHeader(), in, coverage);
161
162 const JBuildL0 <JHitR0> buildL0;
164
165 const JDAQTimeslice timeslice(event, true);
166
167 JSuperFrame2D<JHit> buffer;
168
169 for (JDAQTimeslice::const_iterator i = timeslice.begin(); i != timeslice.end(); ++i) {
170
171 if (router.hasModule(i->getModuleID())) {
172
173 buffer(*i, router.getModule(i->getModuleID()));
174
175 buildL0(buffer, back_inserter(data[i->getModuleID()]));
176 }
177 }
178
179 for (const auto& module : router.getReference()) {
180 if (!module.empty()) {
181 input.data.push_back(module_type(module, summary.getSummaryFrame(module.getID(), R_Hz), data[module.getID()]));
182 }
183 }
184
185 return input;
186 }
bool hasModule(const JModuleIdentifier &id) const
Has module.
const JModule & getModule(const JModuleIdentifier &id) const
Get module parameters.
const JClass_t & getReference() const
Get reference to object.
Definition JReference.hh:38
const JDAQSummaryFrame & getSummaryFrame(const JDAQModuleIdentifier &module) const
Get summary frame.
2-dimensional frame with time calibrated data from one optical module.
const JDAQEventHeader & getDAQEventHeader() const
Get DAQ event header.
Auxiliary classes and methods for triggering.

◆ operator()()

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

Fit function.

Parameters
inputinput data
Returns
fit results

Definition at line 195 of file JShowerFeatures.hh.

196 {
197 using namespace std;
198 using namespace JFIT;
199 using namespace JGEOMETRY3D;
200
201 JEvent event(JSHOWERFEATURES);
202
203 JEvt out;
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 // Computation of max pmt getting a hit in a DOM for a given event, snapshot
214
215 struct {
216 size_t nhits = 0;
217 int id = -1;
218 } snapshot;
219
220 for (const auto& module : input.data) {
221 if (module.size() != 0) {
222
223 size_t snapshot_hits = 0;
224
225 for (size_t i = 0; i != module->size(); ++i) {
226
227 if (module.getStatus(i)) {
228
229 const size_t nhits = std::count_if(
230 module.begin(),
231 module.end(),
232 [i](const JHitR0& hit) {
233 return hit.getPMT() == i;
234 }
235 );
236
237 if (nhits > 0) snapshot_hits++;
238 }
239 }
240
241 if (snapshot_hits > snapshot.nhits){
242 snapshot.nhits = snapshot_hits;
243 snapshot.id = module->getID();
244 }
245 }
246 }
247
248 for (JEvt::const_iterator shower = in.begin(); shower != in.end(); ++shower) {
249
250 //Computation of the minimal distance from jshower vertex to a module
251 struct {
252 double Dmin = numeric_limits<double>::max();
253 int id = -1;
254 } vertex;
255
256 for (const auto& module : input.data) {
257 if (module->getFloor() != 0) {
258
259 const double D = getDistance(module->getPosition(), getPosition(*shower));
260
261 if (D < vertex.Dmin) {
262
263 vertex.Dmin = D;
264 vertex.id = module->getID();
265
266 }
267 }
268 }
269
270 out.push_back(JFit(*shower).add(JSHOWERFEATURES));
271 out.rbegin()->setW(JSHOWERFEATURES_DMIN, vertex.Dmin);
272 out.rbegin()->setW(JSHOWERFEATURES_DMIN_MODULEID, vertex.id);
273 out.rbegin()->setW(JSHOWERFEATURES_NSNAPSHOT, snapshot.nhits);
274 out.rbegin()->setW(JSHOWERFEATURES_NSNAPSHOT_MODULEID, snapshot.id);
275
276 }
277
278 // apply default sorter
279
280 sort(out.begin(), out.end(), qualitySorter);
281
282 copy(input.in.begin(), input.in.end(), back_inserter(out));
283
284 return out;
285 }
JFit & add(const int type)
Add event to history.
Reduced data structure for L0 hit.
Definition JHitR0.hh:29
static const int JSHOWERFEATURES_DMIN
mininal distance between shower vertex and any optical module [m] see JRECONSTRUCTION::JShowerFeature...
static const int JSHOWERFEATURES_NSNAPSHOT
maximum number of PMT with at least one snapshot hit in any DOM see JRECONSTRUCTION::JShowerFeatures
static const int JSHOWERFEATURES_DMIN_MODULEID
optical module identifier for which the distance to the shower vertex was mininal see JRECONSTRUCTION...
static const int JSHOWERFEATURES_NSNAPSHOT_MODULEID
optical module identifier for which the number of PMT with at least one snapshot hit was maximal see ...
Auxiliary classes and methods for 3D geometrical objects and operations.
Definition JAngle3D.hh:19
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects.
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.
Acoustic event fit.
Auxiliary class to test history.
Definition JHistory.hh:157

◆ reset()

void JRECONSTRUCTION::JShowerFitParameters_t::reset ( )
inlineinherited

Reset fit parameters.

Definition at line 35 of file JShowerFitParameters_t.hh.

36 {
38 TMax_ns = 30;
39 TMin_ns = -30;
40 DStep_m = 0;
41 DMax_m = 60;
42 R_Hz = 10.0e3;
44 Vmax_npe = 20;
45 }
double Vmax_npe
maximum number of of photo-electrons
int mestimator
M-estimator (see JFIT::JMEstimator_t)
double DMax_m
maximal distance to optical module [m]
double DStep_m
step increase for the distance to optical module [m]

◆ equals()

bool JRECONSTRUCTION::JShowerFitParameters_t::equals ( const JShowerFitParameters_t & parameters) const
inlineinherited

Equality.

Parameters
parametersfit parameters
Returns
true if equals; else false

Definition at line 53 of file JShowerFitParameters_t.hh.

54 {
55 return (this->TMax_ns == parameters.TMax_ns &&
56 this->TMin_ns == parameters.TMin_ns &&
57 this->numberOfPrefits == parameters.numberOfPrefits &&
58 this->DStep_m == parameters.DStep_m &&
59 this->DMax_m == parameters.DMax_m &&
60 this->R_Hz == parameters.R_Hz &&
61 this->mestimator == parameters.mestimator &&
62 this->Vmax_npe == parameters.Vmax_npe
63 );
64 }

◆ ClassDef()

JRECONSTRUCTION::JShowerFitParameters_t::ClassDef ( JShowerFitParameters_t ,
2  )
inherited

Member Data Documentation

◆ pmtParameters

const JPMTParametersMap& JRECONSTRUCTION::JShowerFeatures::pmtParameters

Definition at line 287 of file JShowerFeatures.hh.

◆ numberOfPrefits

size_t JRECONSTRUCTION::JShowerFitParameters_t::numberOfPrefits
inherited

number of prefits

Definition at line 69 of file JShowerFitParameters_t.hh.

◆ TMax_ns

double JRECONSTRUCTION::JShowerFitParameters_t::TMax_ns
inherited

maximum time for local coincidences [ns]

Definition at line 70 of file JShowerFitParameters_t.hh.

◆ TMin_ns

double JRECONSTRUCTION::JShowerFitParameters_t::TMin_ns
inherited

minimum time for local coincidences [ns]

Definition at line 71 of file JShowerFitParameters_t.hh.

◆ DStep_m

double JRECONSTRUCTION::JShowerFitParameters_t::DStep_m
inherited

step increase for the distance to optical module [m]

Definition at line 72 of file JShowerFitParameters_t.hh.

◆ R_Hz

double JRECONSTRUCTION::JShowerFitParameters_t::R_Hz
inherited

default rate [Hz]

Definition at line 73 of file JShowerFitParameters_t.hh.

◆ mestimator

int JRECONSTRUCTION::JShowerFitParameters_t::mestimator
inherited

M-estimator (see JFIT::JMEstimator_t)

Definition at line 74 of file JShowerFitParameters_t.hh.

◆ Vmax_npe

double JRECONSTRUCTION::JShowerFitParameters_t::Vmax_npe
inherited

maximum number of of photo-electrons

Definition at line 75 of file JShowerFitParameters_t.hh.

◆ DMax_m

double JRECONSTRUCTION::JShowerFitParameters_t::DMax_m
inherited

maximal distance to optical module [m]

Definition at line 76 of file JShowerFitParameters_t.hh.


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