1 #ifndef JORCASHOWERFIT_INCLUDE
2 #define JORCASHOWERFIT_INCLUDE
85 const std::string pdfFile):
90 JRegressor_t::T_ns.setRange(-parameters.
Tmax_ns,parameters.
Tmax_ns);
91 JRegressor_t::Vmax_npe = 20.0;
92 JRegressor_t::MAXIMUM_ITERATIONS = 1000;
157 if ( InPreFits.empty() )
return;
165 JEvt::iterator __end = InPreFits.end();
166 std::copy(InPreFits.begin(), __end, std::back_inserter(OutFits));
168 if (numberOfPrefits > 0) {
169 std::advance(__end = InPreFits.begin(), std::min(numberOfPrefits, InPreFits.size()));
172 std::partial_sort(InPreFits.begin(), __end, InPreFits.end(),
qualitySorter);
175 buildL0(timeSliceBuildL0, *
moduleRouter_, std::back_inserter(dataL0));
177 for (JEvt::const_iterator shower = InPreFits.begin(); shower != __end; ++shower) {
190 for (JDataL0_t::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
195 const double D = hit_pos.
getDistance(pt.getPosition());
196 const double t_res = hit.
getT() - pt.getT(hit_pos);
201 if(D < Dmax_m && (t_res >= -25 && t_res <= 25) && (cosT >= -1 && cosT <= 0.1)){
203 const JVector3D d(photonDir.getDX(), photonDir.getDY(), photonDir.getDZ());
206 if(D < Dmax_m && (t_res > -30 && t_res < 20)){
211 double start_E = exp((Nhits + 26)/26);
212 if(start_E > 100) start_E = 100;
219 double max_theta = 0, max_phi = 0, scan_step = 0;
222 if(start_E > 10 && radius < 100){
236 for(
double E = -15; E <= 5; E += 7.5){
237 for(
double th = -max_theta; th <= max_theta; th += scan_step){
238 for(
double ph = -max_phi; ph <= max_phi; ph += scan_step){
246 const double scan_E = start_E + E;
249 start_dir_angles.getPhi() + phi);
250 const JVector3D dir_shifted(dir_shifted_angles.getDX(),
251 dir_shifted_angles.getDY(),
252 dir_shifted_angles.getDZ());
259 for (JDETECTOR::JDetector::const_iterator module = detector.begin();
260 module != detector.end(); ++module) {
265 if (pt.getDistance(pos) < Dmax_m) {
266 for (
unsigned int i = 0; i != module->size(); ++i) {
270 buffer.push_back(
JPMTW0(pmt, R_Hz, top.count(
id)));
275 for(JPMTW0_t::iterator pmt = buffer.begin(); pmt != buffer.end(); ++pmt ){
279 shower_hypothesis.
LogLik = chi2;
280 shower_hypothesis.
Energy = scan_E;
281 shower_hypothesis.
Direction = dir_shifted;
283 shower_hypotheses.push_back(shower_hypothesis);
292 std::partial_sort(shower_hypotheses.begin(), __end2, shower_hypotheses.end(),
sortLogLik);
297 const double dir_step = 0.05;
302 const double scan_E = hp->Energy;
312 for(JDETECTOR::JDetector::const_iterator module = detector.begin();
313 module != detector.end(); ++module) {
317 if (pt.getDistance(pos) < Dmax_m) {
318 for (
unsigned int i = 0; i != module->size(); ++i) {
322 buffer.push_back(
JPMTW0(pmt, R_Hz, top.count(
id)));
327 const int NDF = buffer.size() -
fit_.step.size();
337 const double E_reco_corrected =
fit_.value.getE() - 4;
345 OutFits.push_back(outFit);
346 OutFits.rbegin()->setE(E_reco_corrected);
Data structure for angles in three dimensions.
double getT() const
Get calibrated time of hit.
Data structure for direction in three dimensions.
Definition for fit results, A good fit should hold: OKAY.
Algorithms for hit clustering and sorting.
JFIT::JRegressor< JFIT::JShower3EZ, JFIT::JSimplex > JRegressor_t
const JDAQPMTIdentifier & getPMTIdentifier() const
Get PMT identifier.
Auxiliary class for handling PMT geometry, rate and response.
Data structure for vertex fit.
const JDirection3D & getDirection() const
Get direction.
JLANG::JSharedPointer< const JDETECTOR::JModuleRouter > moduleRouter_
Container for historical events.
class to handle the third step of the shower reconstruction, mainly dedicated for ORCA ...
double getDistance(const JVector3D &pos) const
Get distance to point.
Data structure for detector geometry and calibration.
double getDot(const JAngle3D &angle) const
Get dot product.
JFit getFit(const JHistory &history, const JTrack3D &track, const double Q, const int NDF, const double energy=0.0, const int status=0)
Get fit.
Basic data structure for L0 hit.
Data structure for track fit results.
Basic data structure for time and time over threshold information of hit.
Data structure for fit of straight line in positive z-direction with energy.
JAxis3D & rotate(const JRotation3D &R)
Rotate axis.
Data structure for vector in three dimensions.
static bool sortLogLik(JShowerHypothesis A, JShowerHypothesis B)
Function to sort different shower hypotheses by their likelihood.
double getDY() const
Get y direction.
double getDX() const
Get x direction.
Data structure for PMT geometry and calibration.
Auxiliary class for a hit with background rate value.
JFIT::JShowerFitParameters_t parameters_
void getJEvt(const KM3NETDAQ::JDAQTimeslice &timeSliceBuildL0, JFIT::JEvt &InPreFits, JFIT::JEvt &OutFits) const
Declaration of the member function that actually performs the reconstruction.
JAxis3D & rotate_back(const JRotation3D &R)
Rotate back axis.
const JPosition3D & getPosition() const
Get position.
counter_type advance(counter_type &counter, const counter_type value, const counter_type limit=std::numeric_limits< counter_type >::max())
Advance counter.
Reduced data structure for L1 hit.
JPosition3D getPosition(const JFit &fit)
Get position.
const JClass_t & getReference() const
Get reference to object.
Data structure for set of track fit results.
std::size_t numberOfPrefits
void copy(const Head &from, JHead &to)
Copy header from from to to.
Data regression method for JFIT::JShower3Z.
Data structure for fit of energy.
Data structure for position in three dimensions.
bool qualitySorter(const JFit &first, const JFit &second)
Comparison of fit results.
JORCAShowerFit(const JLANG::JSharedPointer< const JDETECTOR::JModuleRouter > &moduleRouter, const JFIT::JShowerFitParameters_t ¶meters, const std::string pdfFile)
Parameterized constructor.
Data structure for normalised vector in three dimensions.
Data structure for normalised vector in positive z-direction.
double getDZ() const
Get z direction.
JVector3D & add(const JVector3D &vector)
Add vector.
Match operator for Cherenkov light from shower in any direction.
struct that holds the Parameters used for JORCAShowerFit
Basic data structure for L1 hit.
JORCAShowerFit()
Default constructor.
Container of shower hypothesis: During the fit the algorithm creates a grid in direction and energy s...