Jpp 20.0.0-rc.8
the software that should make you happy
Loading...
Searching...
No Matches
JRECONSTRUCTION Namespace Reference

Support. More...

Classes

struct  event_type
 Auxiliary data structure to store data and fit in memory. More...
 
struct  JARCAMuonReconstruction
 ARCA muon reconstruction. More...
 
class  JAtmosphericMuon
 Auxiliary class to evaluate atmospheric muon hypothesis. More...
 
struct  JEditor
 Auxiliary class for editing time offset. More...
 
class  JEnergyCorrection
 Auxiliary class for correction of energy determined by JEnergy.cc. More...
 
struct  JEventSelector
 Event selector. More...
 
class  JHitW0
 Auxiliary class for a hit with background rate value. More...
 
struct  JModuleL0
 Auxiliary class for handling module response. More...
 
class  JMultiThreadedReconstruction
 Thread pool for event-by-event reconstruction. More...
 
class  JMuonEnergy
 Auxiliary class to to determine muon energy. More...
 
struct  JMuonEnergyParameters_t
 Data structure for fit parameters. More...
 
struct  JMuonFeatures
 Wrapper class to add features after the final fit of muon trajectory. More...
 
struct  JMuonGandalf
 Wrapper class to make final fit of muon trajectory. More...
 
struct  JMuonGandalfParameters_t
 Data structure for fit parameters. More...
 
struct  JMuonParameters
 Muon reconstruction parameters. More...
 
struct  JMuonPrefit
 Wrapper class to make pre-fit of muon trajectory. More...
 
struct  JMuonPrefitParameters_t
 Data structure for fit parameters. More...
 
struct  JMuonSimplex
 Wrapper class to make intermediate fit of muon trajectory. More...
 
struct  JMuonSimplexParameters_t
 Data structure for fit parameters. More...
 
class  JMuonStart
 Auxiliary class to determine start and end position of muon trajectory. More...
 
struct  JMuonStartParameters_t
 Data structure for fit parameters. More...
 
struct  JORCAMuonReconstruction
 ORCA muon reconstruction. More...
 
struct  JORCAReconstruction
 ORCA reconstruction. More...
 
struct  JORCAShowerReconstruction
 ORCA shower reconstruction. More...
 
struct  JPerth
 Thread pool for fits to data. More...
 
struct  JPerth_t
 Auxiliary data structure for chi2 function object. More...
 
class  JPointing
 Auxiliary class to compare fit results with respect to a reference direction (e.g. true muon). More...
 
class  JPosition
 Auxiliary class to compare fit results with respect to a reference position. More...
 
struct  JQualitySorter
 General purpose sorter of fit results. More...
 
struct  JRange_t
 Type definition of range. More...
 
class  JReconstructionDictionary
 Simple wrapper class around JROOT::JRootDictionary so that other classes are included by construction,. More...
 
class  JShowerBjorkenY
 class to handle the direction fit of the shower reconstruction, mainly dedicated for ORCA More...
 
struct  JShowerBjorkenYParameters_t
 Data structure for fit parameters. More...
 
class  JShowerDirectionPrefit
 class to handle the direction fit of the shower reconstruction, mainly dedicated for ORCA More...
 
struct  JShowerDirectionPrefitParameters_t
 Data structure for fit parameters. More...
 
class  JShowerEnergy
 Auxiliary class to compare fit results with respect to a reference energy. More...
 
class  JShowerFit
 class to handle the direction fit of the shower reconstruction, mainly dedicated for ORCA More...
 
struct  JShowerFitParameters_t
 Data structure for fit parameters. More...
 
struct  JShowerParameters
 Shower reconstruction parameters. More...
 
class  JShowerPointSimplex
 class to handle the second position fit of the shower reconstruction, mainly dedicated for ORCA More...
 
struct  JShowerPointSimplexParameters_t
 
class  JShowerPositionFit
 class to handle the second position fit of the shower reconstruction, mainly dedicated for ORCA More...
 
struct  JShowerPositionFitParameters_t
 
class  JShowerPrefit
 class to handle first step of the shower reconstruction in ORCA: it reconstructs the shower vertex, intended as the shower brightest point, as the barycenter of the hits More...
 
struct  JShowerPrefitParameters_t
 Data structure for fit parameters. More...
 
struct  JSparkSummary
 Struct for storing spark removal summary data. More...
 
struct  JStart
 Auxiliary class for start or end point evaluation. More...
 
struct  JWeight
 Auxiliary data structure to get weight of given fit. More...
 

Typedefs

typedef JFIT::JFit JFit
 
typedef JFIT::JEvt JEvt
 
typedef JFIT::JEvent JEvent
 
typedef JFIT::JHistory JHistory
 
typedef std::vector< JHitW0buffer_type
 hits
 
typedef std::map< int, buffer_typemap_type
 identifier -> hits
 
typedef std::vector< event_typedata_type
 
typedef JLANG::JSTDObjectReader< const event_typeinput_type
 
typedef JFIT::JRegressorStorage< JFIT::JLine3Z, JFIT::JGandalfJRegressorStorage_t
 
typedef JFIT::JRegressor< JFIT::JLine3Z, JFIT::JGandalfJRegressor_t
 

Enumerations

enum  JFitStatus_t {
  ERROR = -100 , INSUFFICIENT_NUMBER_OF_HITS , INSUFFICIENT_NUMBER_OF_DOMS , UNDEFINED = -1 ,
  SINGLE_STAGE = 0 , INCOMPLETE_CHAIN = +1 , COMPLETE_CHAIN = +100
}
 

Functions

void copy (const JFIT::JEvt::const_iterator __begin, const JFIT::JEvt::const_iterator __end, Evt &out)
 Copy tracks.
 
JPosition3D getPosition (const JFit &fit)
 Get position.
 
JDirection3D getDirection (const JFit &fit)
 Get direction.
 
JVertex3D getVertex (const JFit &fit)
 Get vertex.
 
JAxis3D getAxis (const JFit &fit)
 Get axis.
 
JTrack3E getTrack (const JFit &fit)
 Get track.
 
JShower3E getShower (const JFit &fit)
 Get shower.
 
JFit getFit (const JHistory &history, const JTrack3D &track, const double Q, const int NDF, const double energy=0.0, const int status=SINGLE_STAGE)
 Get fit.
 
JFit getFit (const JHistory &history, const JLine1Z &track, const JAngle3D &angle, const double Q, const int NDF, const double energy=0.0, const int status=SINGLE_STAGE)
 Get fit.
 
JFit getFit (const JHistory &history, const JShower3D &shower, const double Q, const int NDF, const double energy=0.0, const int status=SINGLE_STAGE)
 Get fit.
 
double getDot (const JFit &first, const JFit &second)
 Get dot product.
 
double getDot (const JFit &fit, const JDirection3D &dir)
 Get dot product.
 
double getAngle (const JFit &first, const JFit &second)
 Get space angle.
 
double getAngle (const JFit &fit, const JDirection3D &dir)
 Get space angle.
 
double getQuality (const double chi2, const int N, const int NDF)
 Get quality of fit.
 
double getQuality (const double chi2, const int NDF)
 Get quality of fit.
 
double getQuality (const double chi2)
 Get quality of fit.
 
bool qualitySorter (const JFit &first, const JFit &second)
 Comparison of fit results.
 
bool has_history (const JFit &fit, const int type)
 Test whether given fit has specified history.
 
bool has_history (const JFit &fit, const JRange< int > &range)
 Test whether given fit has specified history.
 
bool has_muon_prefit (const JFit &fit)
 Test whether given fit has muon prefit in history.
 
bool has_muon_simplex (const JFit &fit)
 Test whether given fit has muon simplex in history.
 
bool has_muon_gandalf (const JFit &fit)
 Test whether given fit has muon gandalf in history.
 
bool has_muon_energy (const JFit &fit)
 Test whether given fit has muon energy in history.
 
bool has_muon_start (const JFit &fit)
 Test whether given fit has muon start in history.
 
bool has_muon_fit (const JFit &fit)
 Test whether given fit has muon fit in history.
 
bool has_shower_prefit (const JFit &fit)
 Test whether given fit has shower prefit in history.
 
bool has_shower_positionfit (const JFit &fit)
 Test whether given fit has shower position fit in history.
 
bool has_shower_completefit (const JFit &fit)
 Test whether given fit has shower complete fit in history.
 
bool has_shower_fit (const JFit &fit)
 Test whether given fit has shower fit in history.
 
template<class JTrackSelector_t >
bool has_reconstructed_track (const JEvt &evt, JTrackSelector_t selector)
 Test whether given event has a track according selection.
 
bool has_reconstructed_muon (const JEvt &evt)
 Test whether given event has a track with muon reconstruction.
 
bool has_reconstructed_shower (const JEvt &evt)
 Test whether given event has a track with shower reconstruction.
 
template<class JTrackSelector_t , class JQualitySorter_t >
const JFitget_best_reconstructed_track (const JEvt &evt, JTrackSelector_t selector, JQualitySorter_t comparator)
 Get best reconstructed track.
 
const JFitget_best_reconstructed_muon (const JEvt &evt)
 Get best reconstructed muon.
 
const JFitget_best_reconstructed_shower (const JEvt &evt)
 Get best reconstructed shower.
 
JEvt::iterator gridify (JEvt::iterator __begin, JEvt::iterator __end, const int N)
 Gridify set of fits.
 
JTreeParameters getTreeParameters (const JType< JSparkSummary > &type)
 
bool filter (const JDAQEvent &tev, const JEvt &evt, const Evt *const pE)
 Event selection.
 

Variables

static const int JVETO_NPE = 11
 number of photo-electrons
 
static const int JVETO_NUMBER_OF_HITS = 12
 number of hits
 
JRECONSTRUCTION::JWeight getWeight
 
const char *const h2_t = "h2"
 Name of histogram with results from JMuonCompass.cc.
 
static std::string TTREE_SPARKSUMMARY = "JSparkSummary"
 
static std::string TBRANCH_SPARKSUMMARY = "JSpark"
 
static int COMPRESSION_LEVEL_SPARKSUMMARY = 1
 
static int BASKET_SIZE_SPARKSUMMARY = 5000000
 
static int SPLIT_LEVEL_SPARKSUMMARY = 1
 
static int AUTOFLUSH_LEVEL_SPARKSUMMARY = 1000
 

Detailed Description

Support.

Model fits to data.

Author
mdejong
mdejong, azegarelli, scelli
eleguirriec, mdejong
mdejong, gmaggi
gmaggi
mdejong, gmaggi, azegarelli
adomi
adomi, vcarretero
adomi, gmaggi, vcarretero
adomi, gmaggi

Typedef Documentation

◆ JFit

Definition at line 481 of file JReconstruction/JEvt.hh.

◆ JEvt

Definition at line 482 of file JReconstruction/JEvt.hh.

◆ JEvent

Definition at line 454 of file JHistory.hh.

◆ JHistory

Definition at line 455 of file JHistory.hh.

◆ buffer_type

hits

Definition at line 70 of file JPerth.cc.

◆ map_type

identifier -> hits

Definition at line 71 of file JPerth.cc.

◆ data_type

Definition at line 82 of file JPerth.cc.

◆ input_type

Definition at line 83 of file JPerth.cc.

◆ JRegressorStorage_t

◆ JRegressor_t

Enumeration Type Documentation

◆ JFitStatus_t

Enumerator
ERROR 
INSUFFICIENT_NUMBER_OF_HITS 
INSUFFICIENT_NUMBER_OF_DOMS 
UNDEFINED 
SINGLE_STAGE 
INCOMPLETE_CHAIN 
COMPLETE_CHAIN 

Definition at line 16 of file JFitStatus.hh.

16 {
17
18 ERROR = -100,
21 UNDEFINED = -1,
22 SINGLE_STAGE = 0,
24 COMPLETE_CHAIN = +100
25 };
#define ERROR(A)
Definition JMessage.hh:66
@ INSUFFICIENT_NUMBER_OF_HITS
Definition JFitStatus.hh:19
@ INSUFFICIENT_NUMBER_OF_DOMS
Definition JFitStatus.hh:20

Function Documentation

◆ copy()

void JRECONSTRUCTION::copy ( const JFIT::JEvt::const_iterator __begin,
const JFIT::JEvt::const_iterator __end,
Evt & out )
inline

Copy tracks.

Parameters
__beginbegin of input tracks
__endend of input tracks
outoutput tracks

Definition at line 35 of file JEvtSupportkit.hh.

38 {
39 using namespace std;
40 using namespace JPP;
41
42 struct : public set<JUUID> {
43
44 inline int get_index(const JUUID& element) const
45 {
46 const_iterator i = this->find(element);
47
48 if (i != this->end())
49 return std::distance(this->begin(), i);
50 else
51 return -1;
52 }
53 } uuid;
54
55 for (JFIT::JEvt::const_iterator fit = __begin; fit != __end; ++fit) {
56 uuid.insert(fit->getUUID());
57 }
58
59 for (JFIT::JEvt::const_iterator fit = __begin; fit != __end; ++fit) { // import reconstruction data
60
61 Trk trk;
62
63 trk.id = uuid.get_index(fit->getUUID());
64 trk.pos = Vec(fit->getX(), fit->getY(), fit->getZ());
65 trk.dir = Vec(fit->getDX(), fit->getDY(), fit->getDZ());
66 trk.t = fit->getT();
67 trk.E = fit->getE();
68 trk.lik = fit->getQ();
70 trk.status = (fit->getStatus() == COMPLETE_CHAIN ? TRK_ST_FINALSTATE : TRK_ST_UNDEFINED);
71
72 if (fit->hasParentUUID()) {
73 trk.mother_id = uuid.get_index(fit->getParentUUID());
74 }
75
76 for (JHistory::const_iterator i = fit->getHistory().begin(); i != fit->getHistory().end(); ++i) {
77 trk.rec_stages.push_back(i->type);
78 }
79
80 for (int i = 0; i != fit->getN(); ++i) {
81 trk.fitinf.push_back(fit->getW(i));
82 }
83
84 trk.error_matrix = fit->getV();
85
86 out.trks.push_back(trk);
87 }
88 }
static const int JPP_RECONSTRUCTION_TYPE
ile KM3NeT Data Definitions v3.6.1-27-ge2759ac https://git.km3net.de/common/km3net-dataformat
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
std::vector< Trk > trks
list of reconstructed tracks (can be several because of prefits,showers, etc).
Definition Evt.hh:39
Simple wrapper for UUID.
Definition JUUID.hh:24
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
Definition Trk.hh:15
int status
MC or reconstruction status code, see km3net-dataformat/definitions/trkmembers.csv for values.
Definition Trk.hh:28
int id
track identifier
Definition Trk.hh:16
std::vector< double > error_matrix
(NxN) error covariance matrix for fit parameters (stored as linear vector)
Definition Trk.hh:34
std::vector< double > fitinf
place to store additional fit info, see km3net-dataformat/definitions/fitparameters....
Definition Trk.hh:32
Vec dir
track direction
Definition Trk.hh:18
std::vector< int > rec_stages
list of identifiers of successful fitting stages resulting in this track
Definition Trk.hh:26
double E
Energy [GeV] (either MC truth or reconstructed)
Definition Trk.hh:20
double t
track time [ns] (when the particle is at pos )
Definition Trk.hh:19
int rec_type
identifier of the fitting algorithm/chain/strategy, see km3net-dataformat/definitions/reconstruction....
Definition Trk.hh:25
int mother_id
id of the parent MC particle or of the reconstructed track at the previous stage
Definition Trk.hh:29
double lik
likelihood or lambda value (for aafit, lambda)
Definition Trk.hh:23
Vec pos
postion [m] of the track at time t
Definition Trk.hh:17
The Vec class is a straightforward 3-d vector, which also works in pyroot.
Definition Vec.hh:13
static const int TRK_ST_FINALSTATE
for MC: the particle must be processed by detector simulation ('track_in' tag in evt files)....
Definition trkmembers.hh:16
static const int TRK_ST_UNDEFINED
MC or reco status was not defined for this track.
Definition trkmembers.hh:15

◆ getPosition()

JPosition3D JRECONSTRUCTION::getPosition ( const JFit & fit)
inline

Get position.

Parameters
fitfit
Returns
position

Definition at line 158 of file JReconstruction/JEvtToolkit.hh.

159 {
160 return JPosition3D(fit.getX(), fit.getY(), fit.getZ());
161 }
double getZ() const
Get Z-position.
double getY() const
Get Y-position.
double getX() const
Get X-position.
Data structure for position in three dimensions.

◆ getDirection()

JDirection3D JRECONSTRUCTION::getDirection ( const JFit & fit)
inline

Get direction.

Parameters
fitfit
Returns
direction

Definition at line 170 of file JReconstruction/JEvtToolkit.hh.

171 {
172 return JDirection3D(fit.getDX(), fit.getDY(), fit.getDZ());
173 }
double getDZ() const
Get Z-slope.
double getDY() const
Get Y-slope.
double getDX() const
Get X-slope.
Data structure for direction in three dimensions.

◆ getVertex()

JVertex3D JRECONSTRUCTION::getVertex ( const JFit & fit)
inline

Get vertex.

Parameters
fitfit
Returns
vertex

Definition at line 182 of file JReconstruction/JEvtToolkit.hh.

183 {
184 return JVertex3D(getPosition(fit), fit.getT());
185 }
double getT() const
Get time.

◆ getAxis()

JAxis3D JRECONSTRUCTION::getAxis ( const JFit & fit)
inline

Get axis.

Parameters
fitfit
Returns
axis

Definition at line 194 of file JReconstruction/JEvtToolkit.hh.

195 {
196 return JAxis3D(getPosition(fit), getDirection(fit));
197 }
Axis object.
Definition JAxis3D.hh:41

◆ getTrack()

JTrack3E JRECONSTRUCTION::getTrack ( const JFit & fit)
inline

Get track.

Parameters
fitfit
Returns
track

Definition at line 206 of file JReconstruction/JEvtToolkit.hh.

207 {
208 return JTrack3E(JTrack3D(getAxis(fit), fit.getT()), fit.getE());
209 }
double getE() const
Get energy.
3D track with energy.
Definition JTrack3E.hh:34

◆ getShower()

JShower3E JRECONSTRUCTION::getShower ( const JFit & fit)
inline

Get shower.

Parameters
fitfit
Returns
shower

Definition at line 218 of file JReconstruction/JEvtToolkit.hh.

219 {
220 return JShower3E(JShower3D(getVertex(fit), getDirection(fit)), fit.getE());
221 }
3D shower with energy.
Definition JShower3E.hh:31

◆ getFit() [1/3]

JFit JRECONSTRUCTION::getFit ( const JHistory & history,
const JTrack3D & track,
const double Q,
const int NDF,
const double energy = 0.0,
const int status = SINGLE_STAGE )
inline

Get fit.

Parameters
historyhistory
tracktrack
Qquality
NDFnumber of degrees of freedom
energyEnergy, which would be set as 0, if the fit does not reconstruct energy
statusstatus of the fit as defined in enum JFitStatus.hh
Returns
fit

Definition at line 235 of file JReconstruction/JEvtToolkit.hh.

241 {
242 return JFit(history,
243 track.getX(), track.getY(), track.getZ(),
244 track.getDX(), track.getDY(), track.getDZ(),
245 track.getT(),
246 Q, NDF,
247 energy, status);
248 }
Data structure for track fit results with history and optional associated values.
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
Definition JTrack3D.hh:87
double getY() const
Get y position.
Definition JVector3D.hh:104
double getZ() const
Get z position.
Definition JVector3D.hh:115
double getX() const
Get x position.
Definition JVector3D.hh:94
double getDY() const
Get y direction.
Definition JVersor3D.hh:106
double getDX() const
Get x direction.
Definition JVersor3D.hh:95
double getDZ() const
Get z direction.
Definition JVersor3D.hh:117

◆ getFit() [2/3]

JFit JRECONSTRUCTION::getFit ( const JHistory & history,
const JLine1Z & track,
const JAngle3D & angle,
const double Q,
const int NDF,
const double energy = 0.0,
const int status = SINGLE_STAGE )
inline

Get fit.

Parameters
historyhistory
tracktrack
angleangle
Qquality
NDFnumber of degrees of freedom
energyEnergy, which would be set as 0, if the fit does not reconstruct energy
statusstatus of the fit as defined in JFitStatus.hh
Returns
fit

Definition at line 263 of file JReconstruction/JEvtToolkit.hh.

270 {
271 return JFit(history,
272 track.getX(), track.getY(), track.getZ(),
273 angle.getDX(), angle.getDY(), angle.getDZ(),
274 track.getT(),
275 Q, NDF,
276 energy, status);
277 }
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
Definition JLine1Z.hh:114
double getZ(const JPosition3D &pos) const
Get point of emission of Cherenkov light along muon path.
Definition JLine1Z.hh:134
double getDY() const
Get y direction.
Definition JAngle3D.hh:119
double getDZ() const
Get z direction.
Definition JAngle3D.hh:130
double getDX() const
Get x direction.
Definition JAngle3D.hh:108

◆ getFit() [3/3]

JFit JRECONSTRUCTION::getFit ( const JHistory & history,
const JShower3D & shower,
const double Q,
const int NDF,
const double energy = 0.0,
const int status = SINGLE_STAGE )
inline

Get fit.

Parameters
historyhistory
showershower
Qquality
NDFnumber of degrees of freedom
energyEnergy, which would be set as 0, if the fit does not reconstruct energy
statusstatus of the fit as defined in enum JFitStatus.hh
Returns
fit

Definition at line 291 of file JReconstruction/JEvtToolkit.hh.

297 {
298 return JFit(history,
299 shower.getX(), shower.getY(), shower.getZ(),
300 shower.getDX(), shower.getDY(), shower.getDZ(),
301 shower.getT(),
302 Q, NDF,
303 energy, status);
304 }
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
Definition JShower3D.hh:97

◆ getDot() [1/2]

double JRECONSTRUCTION::getDot ( const JFit & first,
const JFit & second )
inline

Get dot product.

Parameters
firstfirst fit
secondsecond fit
Returns
dot product

Definition at line 314 of file JReconstruction/JEvtToolkit.hh.

315 {
316 return JMATH::getDot(getDirection(first), getDirection(second));
317 }
double getDot(const JFirst_t &first, const JSecond_t &second)
Get dot product of objects.

◆ getDot() [2/2]

double JRECONSTRUCTION::getDot ( const JFit & fit,
const JDirection3D & dir )
inline

Get dot product.

Parameters
fitfit
dirdirection
Returns
dot product

Definition at line 327 of file JReconstruction/JEvtToolkit.hh.

328 {
329 return JMATH::getDot(getDirection(fit), dir);
330 }

◆ getAngle() [1/2]

double JRECONSTRUCTION::getAngle ( const JFit & first,
const JFit & second )
inline

Get space angle.

Parameters
firstfirst fit
secondsecond fit
Returns
angle [deg]

Definition at line 340 of file JReconstruction/JEvtToolkit.hh.

341 {
342 return JMATH::getAngle(getDirection(first), getDirection(second));
343 }
double getAngle(const JFirst_t &first, const JSecond_t &second)
Get space angle between objects.

◆ getAngle() [2/2]

double JRECONSTRUCTION::getAngle ( const JFit & fit,
const JDirection3D & dir )
inline

Get space angle.

Parameters
fitfit
dirdirection
Returns
angle [deg]

Definition at line 353 of file JReconstruction/JEvtToolkit.hh.

354 {
355 return JMATH::getAngle(getDirection(fit), dir);
356 }

◆ getQuality() [1/3]

double JRECONSTRUCTION::getQuality ( const double chi2,
const int N,
const int NDF )
inline

Get quality of fit.


The larger the quality, the better the fit.

Parameters
chi2chi2
Nnumber of hits
NDFnumber of degrees of freedom
Returns
quality

Definition at line 368 of file JReconstruction/JEvtToolkit.hh.

369 {
370 return N - 0.25 * chi2 / NDF;
371 }

◆ getQuality() [2/3]

double JRECONSTRUCTION::getQuality ( const double chi2,
const int NDF )
inline

Get quality of fit.


The larger the quality, the better the fit.

Parameters
chi2chi2
NDFnumber of degrees of freedom
Returns
quality

Definition at line 382 of file JReconstruction/JEvtToolkit.hh.

383 {
384 return NDF - 0.25 * chi2 / NDF;
385 }

◆ getQuality() [3/3]

double JRECONSTRUCTION::getQuality ( const double chi2)
inline

Get quality of fit.


The larger the quality, the better the fit.

Parameters
chi2chi2
Returns
quality

Definition at line 395 of file JReconstruction/JEvtToolkit.hh.

396 {
397 return -chi2;
398 }

◆ qualitySorter()

bool JRECONSTRUCTION::qualitySorter ( const JFit & first,
const JFit & second )
inline

Comparison of fit results.

Parameters
firstfirst fit
secondsecond fit
Returns
true if first fit has better quality than second; else false

Definition at line 408 of file JReconstruction/JEvtToolkit.hh.

409 {
410 if (first.getHistory().size() == second.getHistory().size())
411 return first.getQ() > second.getQ();
412 else
413 return first.getHistory().size() > second.getHistory().size();
414 }
double getQ() const
Get quality.
const JHistory & getHistory() const
Get history.
Definition JHistory.hh:301

◆ has_history() [1/2]

bool JRECONSTRUCTION::has_history ( const JFit & fit,
const int type )
inline

Test whether given fit has specified history.

Parameters
fitfit
typeapplication type
Returns
true if type in history; else false

Definition at line 447 of file JReconstruction/JEvtToolkit.hh.

448 {
449 return std::find_if(fit.getHistory().begin(),
450 fit.getHistory().end(),
451 JLANG::make_predicate(&JEvent::type, type)) != fit.getHistory().end();
452 }
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.

◆ has_history() [2/2]

bool JRECONSTRUCTION::has_history ( const JFit & fit,
const JRange< int > & range )
inline

Test whether given fit has specified history.

Parameters
fitfit
rangeapplication type range
Returns
true if type in history; else false

Definition at line 462 of file JReconstruction/JEvtToolkit.hh.

463 {
464 return std::find_if(fit.getHistory().begin(),
465 fit.getHistory().end(),
466 JLANG::make_find_if(&JEvent::type, range)) != fit.getHistory().end();
467 }
JFind_if< JResult_t T::*, JPredicate_t > make_find_if(JResult_t T::*member, const JPredicate_t &predicate)
Helper method to create find_if for data member.
Definition JFind_if.hh:119

◆ has_muon_prefit()

bool JRECONSTRUCTION::has_muon_prefit ( const JFit & fit)
inline

Test whether given fit has muon prefit in history.

Parameters
fitfit
Returns
true if muon prefit in history; else false

Definition at line 476 of file JReconstruction/JEvtToolkit.hh.

477 {
478 return has_history(fit, JMUONPREFIT);
479 }
Auxiliary class to test whether given track has specified history.

◆ has_muon_simplex()

bool JRECONSTRUCTION::has_muon_simplex ( const JFit & fit)
inline

Test whether given fit has muon simplex in history.

Parameters
fitfit
Returns
true if muon simplex in history; else false

Definition at line 488 of file JReconstruction/JEvtToolkit.hh.

489 {
490 return has_history(fit, JMUONSIMPLEX);
491 }

◆ has_muon_gandalf()

bool JRECONSTRUCTION::has_muon_gandalf ( const JFit & fit)
inline

Test whether given fit has muon gandalf in history.

Parameters
fitfit
Returns
true if muon gandalf in history; else false

Definition at line 500 of file JReconstruction/JEvtToolkit.hh.

501 {
502 return has_history(fit, JMUONGANDALF);
503 }

◆ has_muon_energy()

bool JRECONSTRUCTION::has_muon_energy ( const JFit & fit)
inline

Test whether given fit has muon energy in history.

Parameters
fitfit
Returns
true if muon energy in history; else false

Definition at line 512 of file JReconstruction/JEvtToolkit.hh.

513 {
514 return has_history(fit, JMUONENERGY);
515 }

◆ has_muon_start()

bool JRECONSTRUCTION::has_muon_start ( const JFit & fit)
inline

Test whether given fit has muon start in history.

Parameters
fitfit
Returns
true if muon start in history; else false

Definition at line 524 of file JReconstruction/JEvtToolkit.hh.

525 {
526 return has_history(fit, JMUONSTART);
527 }

◆ has_muon_fit()

bool JRECONSTRUCTION::has_muon_fit ( const JFit & fit)
inline

Test whether given fit has muon fit in history.

Parameters
fitfit
Returns
true if muon fit in history; else false

Definition at line 536 of file JReconstruction/JEvtToolkit.hh.

537 {
539 }
static const int JMUONBEGIN
begin range of reconstruction stages
static const int JMUONEND
end range of reconstruction stages
Range of values.
Definition JRange.hh:42

◆ has_shower_prefit()

bool JRECONSTRUCTION::has_shower_prefit ( const JFit & fit)
inline

Test whether given fit has shower prefit in history.

Parameters
fitfit
Returns
true if shower prefit in history; else false

Definition at line 548 of file JReconstruction/JEvtToolkit.hh.

549 {
550 return has_history(fit, JSHOWERPREFIT);
551 }

◆ has_shower_positionfit()

bool JRECONSTRUCTION::has_shower_positionfit ( const JFit & fit)
inline

Test whether given fit has shower position fit in history.

Parameters
fitfit
Returns
true if shower position fit in history; else false

Definition at line 560 of file JReconstruction/JEvtToolkit.hh.

561 {
562 return has_history(fit, JSHOWERPOSITIONFIT);
563 }

◆ has_shower_completefit()

bool JRECONSTRUCTION::has_shower_completefit ( const JFit & fit)
inline

Test whether given fit has shower complete fit in history.

Parameters
fitfit
Returns
true if shower complete fit in history; else false

Definition at line 572 of file JReconstruction/JEvtToolkit.hh.

573 {
574 return has_history(fit, JSHOWERCOMPLETEFIT);
575 }

◆ has_shower_fit()

bool JRECONSTRUCTION::has_shower_fit ( const JFit & fit)
inline

Test whether given fit has shower fit in history.

Parameters
fitfit
Returns
true if shower fit in history; else false

Definition at line 584 of file JReconstruction/JEvtToolkit.hh.

585 {
587 }
static const int JSHOWEREND
end range of reconstruction stages
static const int JSHOWERBEGIN
begin range of reconstruction stages

◆ has_reconstructed_track()

template<class JTrackSelector_t >
bool JRECONSTRUCTION::has_reconstructed_track ( const JEvt & evt,
JTrackSelector_t selector )
inline

Test whether given event has a track according selection.


The track selector corresponds to the function operator bool selector(const JFit&);.

Parameters
evtevent
selectortrack selector
Returns
true if at least one corresponding track; else false

Definition at line 599 of file JReconstruction/JEvtToolkit.hh.

600 {
601 return std::find_if(evt.begin(), evt.end(), selector) != evt.end();
602 }

◆ has_reconstructed_muon()

bool JRECONSTRUCTION::has_reconstructed_muon ( const JEvt & evt)
inline

Test whether given event has a track with muon reconstruction.

Parameters
evtevent
Returns
true if at least one reconstructed muon; else false

Definition at line 611 of file JReconstruction/JEvtToolkit.hh.

612 {
613 return has_reconstructed_track(evt, has_muon_fit);
614 }
bool has_reconstructed_track(const Evt &evt, JTrackSelector_t selector)
Test whether given event has a track according selection.

◆ has_reconstructed_shower()

bool JRECONSTRUCTION::has_reconstructed_shower ( const JEvt & evt)
inline

Test whether given event has a track with shower reconstruction.

Parameters
evtevent
Returns
true if at least one reconstructed shower; else false

Definition at line 623 of file JReconstruction/JEvtToolkit.hh.

624 {
626 }
bool has_shower_fit(const Trk &track)
Test whether given track has default shower fit in history.

◆ get_best_reconstructed_track()

template<class JTrackSelector_t , class JQualitySorter_t >
const JFit & JRECONSTRUCTION::get_best_reconstructed_track ( const JEvt & evt,
JTrackSelector_t selector,
JQualitySorter_t comparator )
inline

Get best reconstructed track.


The track selector corresponds to the function operator bool selector(const Trk&); and the track comparator to bool comparator(const Trk&, const Trk&);.

Parameters
evtevent
selectortrack selector
comparatortrack comparator
Returns
track

Definition at line 640 of file JReconstruction/JEvtToolkit.hh.

643 {
644 JEvt::const_iterator p = std::find_if(evt.begin(), evt.end(), selector);
645
646 for (JEvt::const_iterator i = p; i != evt.end(); ++i) {
647 if (selector(*i) && comparator(*i, *p)) {
648 p = i;
649 }
650 }
651
652 if (p != evt.end())
653 return *p;
654 else
655 THROW(JIndexOutOfRange, "This event has no fit with given selector.");
656 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.

◆ get_best_reconstructed_muon()

const JFit & JRECONSTRUCTION::get_best_reconstructed_muon ( const JEvt & evt)
inline

Get best reconstructed muon.

Parameters
evtevent
Returns
track

Definition at line 665 of file JReconstruction/JEvtToolkit.hh.

666 {
667 return get_best_reconstructed_track(evt, has_muon_fit, qualitySorter);
668 }
const Trk & get_best_reconstructed_track(const Evt &evt, JTrackSelector_t selector, JQualitySorter_t comparator)
Get best reconstructed track.

◆ get_best_reconstructed_shower()

const JFit & JRECONSTRUCTION::get_best_reconstructed_shower ( const JEvt & evt)
inline

Get best reconstructed shower.

Parameters
evtevent
Returns
track

Definition at line 677 of file JReconstruction/JEvtToolkit.hh.

678 {
679 return get_best_reconstructed_track(evt, has_shower_fit, qualitySorter);
680 }

◆ gridify()

JEvt::iterator JRECONSTRUCTION::gridify ( JEvt::iterator __begin,
JEvt::iterator __end,
const int N )
inline

Gridify set of fits.

Parameters
__beginbegin of fits
__endend of fits
Nnumber of directions in grid
Returns
end of fits sorted by quality

Definition at line 882 of file JReconstruction/JEvtToolkit.hh.

883 {
884 using namespace std;
885 using namespace JPP;
886
887 static const double MINIMAL_ANGLE_DEG = 60.0;
888
889 // estimate grid angle
890
891 double angle_deg = 10.0 * sqrt((double) 240 / (double) N);
892
893 if (angle_deg > MINIMAL_ANGLE_DEG) {
894 angle_deg = MINIMAL_ANGLE_DEG;
895 }
896
897 const JOmega3D ps(angle_deg * PI/180.0);
898
899 JEvt::iterator out = __begin;
900
901 for (JOmega3D_t::const_iterator dir = ps.begin(); dir != ps.end() && out != __end; ++dir) {
902
903 const JPointing pointing(*dir);
904
905 sort(out, __end, pointing);
906
907 JEvt::iterator p = out;
908
909 for (JEvt::iterator i = out; i != __end && pointing.getAngle(*i) <= angle_deg; ++i) {
910 if (qualitySorter(*i, *p)) {
911 p = i;
912 }
913 }
914
915 swap(*(out++), *p);
916 }
917
918 sort(__begin, out, qualitySorter);
919
920 return out;
921 }
Direction set covering (part of) solid angle.
Definition JOmega3D.hh:68
Auxiliary class to compare fit results with respect to a reference direction (e.g....

◆ getTreeParameters()

JTreeParameters JRECONSTRUCTION::getTreeParameters ( const JType< JSparkSummary > & type)
inline

Definition at line 44 of file JSparkSummary.hh.

45 {
46 return JTreeParameters(TTREE_SPARKSUMMARY, "", TBRANCH_SPARKSUMMARY, COMPRESSION_LEVEL_SPARKSUMMARY, BASKET_SIZE_SPARKSUMMARY, SPLIT_LEVEL_SPARKSUMMARY, AUTOFLUSH_LEVEL_SPARKSUMMARY);
47 }
Data structure for TTree parameters.

◆ filter()

bool JRECONSTRUCTION::filter ( const JDAQEvent & tev,
const JEvt & evt,
const Evt *const pE )

Event selection.

Parameters
tevDAQ event
evtinput event
pEpointer to Monte Carlo event
Returns
true if selected; else false

Definition at line 21 of file JReconstruction/event_selector.cc.

22 {
23 using namespace std;
24 using namespace JPP;
25 /*
26 if (!evt.empty() && evt[0].getQ() >= 100) {
27
28 if (pE != NULL) {
29
30 Trk muon;
31
32 for (const auto& t1 : pE->mc_trks) {
33 if (is_muon(t1)) {
34 if (t1.E > muon.E) {
35 muon = t1;
36 }
37 }
38 }
39
40 return (is_muon(muon) && getAngle(getDirection(event[0]), getDirection(muon)) > 5.0);
41 }
42 }
43 */
44 return true;
45 }

Variable Documentation

◆ JVETO_NPE

const int JRECONSTRUCTION::JVETO_NPE = 11
static

number of photo-electrons

Definition at line 70 of file JReconstruction/JEvtToolkit.hh.

◆ JVETO_NUMBER_OF_HITS

const int JRECONSTRUCTION::JVETO_NUMBER_OF_HITS = 12
static

number of hits

Definition at line 71 of file JReconstruction/JEvtToolkit.hh.

◆ getWeight

JRECONSTRUCTION::JWeight JRECONSTRUCTION::getWeight
static

◆ h2_t

const char* const JRECONSTRUCTION::h2_t = "h2"

Name of histogram with results from JMuonCompass.cc.

Definition at line 12 of file JMuonCompass.hh.

◆ TTREE_SPARKSUMMARY

std::string JRECONSTRUCTION::TTREE_SPARKSUMMARY = "JSparkSummary"
static

Definition at line 34 of file JSparkSummary.hh.

◆ TBRANCH_SPARKSUMMARY

std::string JRECONSTRUCTION::TBRANCH_SPARKSUMMARY = "JSpark"
static

Definition at line 35 of file JSparkSummary.hh.

◆ COMPRESSION_LEVEL_SPARKSUMMARY

int JRECONSTRUCTION::COMPRESSION_LEVEL_SPARKSUMMARY = 1
static

Definition at line 36 of file JSparkSummary.hh.

◆ BASKET_SIZE_SPARKSUMMARY

int JRECONSTRUCTION::BASKET_SIZE_SPARKSUMMARY = 5000000
static

Definition at line 37 of file JSparkSummary.hh.

◆ SPLIT_LEVEL_SPARKSUMMARY

int JRECONSTRUCTION::SPLIT_LEVEL_SPARKSUMMARY = 1
static

Definition at line 38 of file JSparkSummary.hh.

◆ AUTOFLUSH_LEVEL_SPARKSUMMARY

int JRECONSTRUCTION::AUTOFLUSH_LEVEL_SPARKSUMMARY = 1000
static

Definition at line 39 of file JSparkSummary.hh.