Jpp 20.0.0-rc.2
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  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.
 
bool filter (const JDAQEvent &tev, const JEvt &evt, const Evt *const pE)
 Event selection.
 

Variables

JRECONSTRUCTION::JWeight getWeight
 
const char *const h2_t = "h2"
 Name of histogram with results from JMuonCompass.cc.
 

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 81 of file JPerth.cc.

◆ input_type

Definition at line 82 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
KM3NeT Data Definitions v3.6.1-2-g905a24d 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 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 identifyers of succesfull 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
MC id of the parent particle.
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:15
static const int TRK_ST_UNDEFINED
status was not defined for this MC track (all reco tracks have this value)
Definition trkmembers.hh:14

◆ getPosition()

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

Get position.

Parameters
fitfit
Returns
position

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

155 {
156 return JPosition3D(fit.getX(), fit.getY(), fit.getZ());
157 }
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 166 of file JReconstruction/JEvtToolkit.hh.

167 {
168 return JDirection3D(fit.getDX(), fit.getDY(), fit.getDZ());
169 }
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 178 of file JReconstruction/JEvtToolkit.hh.

179 {
180 return JVertex3D(getPosition(fit), fit.getT());
181 }
double getT() const
Get time.

◆ getAxis()

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

Get axis.

Parameters
fitfit
Returns
axis

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

191 {
192 return JAxis3D(getPosition(fit), getDirection(fit));
193 }
Axis object.
Definition JAxis3D.hh:41

◆ getTrack()

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

Get track.

Parameters
fitfit
Returns
track

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

203 {
204 return JTrack3E(JTrack3D(getAxis(fit), fit.getT()), fit.getE());
205 }
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 214 of file JReconstruction/JEvtToolkit.hh.

215 {
216 return JShower3E(JShower3D(getVertex(fit), getDirection(fit)), fit.getE());
217 }
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 231 of file JReconstruction/JEvtToolkit.hh.

237 {
238 return JFit(history,
239 track.getX(), track.getY(), track.getZ(),
240 track.getDX(), track.getDY(), track.getDZ(),
241 track.getT(),
242 Q, NDF,
243 energy, status);
244 }
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 259 of file JReconstruction/JEvtToolkit.hh.

266 {
267 return JFit(history,
268 track.getX(), track.getY(), track.getZ(),
269 angle.getDX(), angle.getDY(), angle.getDZ(),
270 track.getT(),
271 Q, NDF,
272 energy, status);
273 }
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 287 of file JReconstruction/JEvtToolkit.hh.

293 {
294 return JFit(history,
295 shower.getX(), shower.getY(), shower.getZ(),
296 shower.getDX(), shower.getDY(), shower.getDZ(),
297 shower.getT(),
298 Q, NDF,
299 energy, status);
300 }
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 310 of file JReconstruction/JEvtToolkit.hh.

311 {
312 return JMATH::getDot(getDirection(first), getDirection(second));
313 }
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 323 of file JReconstruction/JEvtToolkit.hh.

324 {
325 return JMATH::getDot(getDirection(fit), dir);
326 }

◆ 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 336 of file JReconstruction/JEvtToolkit.hh.

337 {
338 return JMATH::getAngle(getDirection(first), getDirection(second));
339 }
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 349 of file JReconstruction/JEvtToolkit.hh.

350 {
351 return JMATH::getAngle(getDirection(fit), dir);
352 }

◆ 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 364 of file JReconstruction/JEvtToolkit.hh.

365 {
366 return N - 0.25 * chi2 / NDF;
367 }

◆ 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 378 of file JReconstruction/JEvtToolkit.hh.

379 {
380 return NDF - 0.25 * chi2 / NDF;
381 }

◆ 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 391 of file JReconstruction/JEvtToolkit.hh.

392 {
393 return -chi2;
394 }

◆ 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 404 of file JReconstruction/JEvtToolkit.hh.

405 {
406 if (first.getHistory().size() == second.getHistory().size())
407 return first.getQ() > second.getQ();
408 else
409 return first.getHistory().size() > second.getHistory().size();
410 }
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 443 of file JReconstruction/JEvtToolkit.hh.

444 {
445 return std::find_if(fit.getHistory().begin(),
446 fit.getHistory().end(),
447 JLANG::make_predicate(&JEvent::type, type)) != fit.getHistory().end();
448 }
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 458 of file JReconstruction/JEvtToolkit.hh.

459 {
460 return std::find_if(fit.getHistory().begin(),
461 fit.getHistory().end(),
462 JLANG::make_find_if(&JEvent::type, range)) != fit.getHistory().end();
463 }
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 472 of file JReconstruction/JEvtToolkit.hh.

473 {
474 return has_history(fit, JMUONPREFIT);
475 }
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 484 of file JReconstruction/JEvtToolkit.hh.

485 {
486 return has_history(fit, JMUONSIMPLEX);
487 }

◆ 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 496 of file JReconstruction/JEvtToolkit.hh.

497 {
498 return has_history(fit, JMUONGANDALF);
499 }

◆ 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 508 of file JReconstruction/JEvtToolkit.hh.

509 {
510 return has_history(fit, JMUONENERGY);
511 }

◆ 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 520 of file JReconstruction/JEvtToolkit.hh.

521 {
522 return has_history(fit, JMUONSTART);
523 }

◆ 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 532 of file JReconstruction/JEvtToolkit.hh.

533 {
535 }
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 544 of file JReconstruction/JEvtToolkit.hh.

545 {
546 return has_history(fit, JSHOWERPREFIT);
547 }

◆ 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 556 of file JReconstruction/JEvtToolkit.hh.

557 {
558 return has_history(fit, JSHOWERPOSITIONFIT);
559 }

◆ 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 568 of file JReconstruction/JEvtToolkit.hh.

569 {
570 return has_history(fit, JSHOWERCOMPLETEFIT);
571 }

◆ 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 580 of file JReconstruction/JEvtToolkit.hh.

581 {
583 }
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 595 of file JReconstruction/JEvtToolkit.hh.

596 {
597 return std::find_if(evt.begin(), evt.end(), selector) != evt.end();
598 }

◆ 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 607 of file JReconstruction/JEvtToolkit.hh.

608 {
609 return has_reconstructed_track(evt, has_muon_fit);
610 }
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 619 of file JReconstruction/JEvtToolkit.hh.

620 {
622 }
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 636 of file JReconstruction/JEvtToolkit.hh.

639 {
640 JEvt::const_iterator p = std::find_if(evt.begin(), evt.end(), selector);
641
642 for (JEvt::const_iterator i = p; i != evt.end(); ++i) {
643 if (selector(*i) && comparator(*i, *p)) {
644 p = i;
645 }
646 }
647
648 if (p != evt.end())
649 return *p;
650 else
651 THROW(JIndexOutOfRange, "This event has no fit with given selector.");
652 }
#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 661 of file JReconstruction/JEvtToolkit.hh.

662 {
663 return get_best_reconstructed_track(evt, has_muon_fit, qualitySorter);
664 }
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 673 of file JReconstruction/JEvtToolkit.hh.

674 {
675 return get_best_reconstructed_track(evt, has_shower_fit, qualitySorter);
676 }

◆ 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 878 of file JReconstruction/JEvtToolkit.hh.

879 {
880 using namespace std;
881 using namespace JPP;
882
883 static const double MINIMAL_ANGLE_DEG = 60.0;
884
885 // estimate grid angle
886
887 double angle_deg = 10.0 * sqrt((double) 240 / (double) N);
888
889 if (angle_deg > MINIMAL_ANGLE_DEG) {
890 angle_deg = MINIMAL_ANGLE_DEG;
891 }
892
893 const JOmega3D ps(angle_deg * PI/180.0);
894
895 JEvt::iterator out = __begin;
896
897 for (JOmega3D_t::const_iterator dir = ps.begin(); dir != ps.end() && out != __end; ++dir) {
898
899 const JPointing pointing(*dir);
900
901 sort(out, __end, pointing);
902
903 JEvt::iterator p = out;
904
905 for (JEvt::iterator i = out; i != __end && pointing.getAngle(*i) <= angle_deg; ++i) {
906 if (qualitySorter(*i, *p)) {
907 p = i;
908 }
909 }
910
911 swap(*(out++), *p);
912 }
913
914 sort(__begin, out, qualitySorter);
915
916 return out;
917 }
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....

◆ 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

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