53 bool operator()(
const T& first,
const T& second)
const
59 if (equal_to<JDAQPMTIdentifier>()(first, second))
60 return less<JHit>()(first, second);
62 return less<JDAQPMTIdentifier>()(first, second);
75 int main(
int argc,
char **argv)
82 typedef JParallelFileScanner_t::multi_pointer_type multi_pointer_type;
84 JParallelFileScanner_t inputFile;
95 JParser<> zap(
"Program to evaluate hit probabilities.");
99 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
106 catch(
const exception& error) {
107 FATAL(error.what() << endl);
139 while (inputFile.hasNext()) {
141 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
143 multi_pointer_type ps = inputFile.next();
148 DEBUG(
"event: " << *tev << endl);
156 buildL0(*tev, router,
true, back_inserter(dataL0));
158 for (JEvt::const_iterator shower = in->begin(); shower != in->end(); ++shower) {
160 DEBUG(
"shower: " << *shower << endl);
171 for (JDataL0_t::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
173 double rate_Hz = summary.
getRate(*i);
175 if (rate_Hz <= 0.0) {
190 sort(
data.begin(),
data.end(), compare);
192 JDataW0_t::iterator __end = unique(
data.begin(),
data.end(), equal_to<JDAQPMTIdentifier>());
199 <<
FIXED( 8,3) << shower->getQ() << endl);
203 for (JDataW0_t::const_iterator hit =
data.begin(); hit != __end; ++hit) {
208 const double x = hit->getX() - vx.
getX();
209 const double y = hit->getY() - vx.
getY();
210 const double z = hit->getZ() - vx.
getZ();
219 const double theta =
u.getTheta();
220 const double phi = fabs(
u.getPhi());
222 const double E = shower->getE();
223 const double dt = T_ns.
constrain(hit->getT() - t1);
226 double H0 = hit->getR() * 1e-9 * T_ns.
getLength();
228 double Vmax_npe = 20.0;
229 if (H1 >= Vmax_npe) {
235 const double chi2 =
getChi2(H1,
true);
238 << setw(10) << hit->getModuleID() <<
':' << setw( 2) << setfill(
'0') << hit->getPMTAddress() << setfill(
' ') <<
' '
239 <<
FIXED(12,1) << E <<
' '
240 <<
FIXED( 9,1) << R <<
' '
241 <<
FIXED( 6,4) << theta <<
' '
242 <<
FIXED( 6,4) << phi <<
' '
243 <<
FIXED( 8,3) << dt <<
' '
244 <<
FIXED(12,3) << chi2 << endl);
Data structure for detector geometry and calibration.
Basic data structure for L0 hit.
General purpose messaging.
#define DEBUG(A)
Message macros.
Direct access to module in detector data structure.
Auxiliary data structure for muon PDF.
Auxiliary data structure for muon PDF.
Parallel scanning of objects from a single file or multiple files according a format that follows fro...
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
I/O formatting auxiliaries.
int main(int argc, char **argv)
This include file containes various data structures that can be used as specific return types for the...
ROOT TTree parameter settings of various packages.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
Router for direct addressing of module data in detector data structure.
Data structure for vertex fit.
JAxis3D & rotate(const JRotation3D &R)
Rotate axis.
Data structure for direction in three dimensions.
Data structure for position in three dimensions.
JPosition3D & rotate(const JRotation3D &R)
Rotate.
double getY() const
Get y position.
double getLength() const
Get length.
double getZ() const
Get z position.
JVector3D & sub(const JVector3D &vector)
Subtract vector.
double getX() const
Get x position.
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
Utility class to parse command line options.
Auxiliary class for a hit with background rate value.
General purpose class for parallel reading of objects from a single file or multiple files.
File router for fast addressing of summary data.
void update(const JDAQHeader &header)
Update router.
double getRate() const
Get default rate.
Template specialisation of L0 builder for JHitL0 data type.
JDirection3D getDirection(const Vec &dir)
Get direction.
JPosition3D getPosition(const Vec &pos)
Get position.
double getQuality(const double chi2, const int NDF)
Get quality of fit.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
double getChi2(const double P)
Get chi2 corresponding to given probability.
double getIndexOfRefraction()
Get average index of refraction of water corresponding to group velocity.
const double getInverseSpeedOfLight()
Get inverse speed of light.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
bool qualitySorter(const JFit &first, const JFit &second)
Comparison of fit results.
KM3NeT DAQ data structures and auxiliaries.
Auxiliary data structure for floating point format specification.
Template specialisation of class JModel to match hit with bright point.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Data structure for fit parameters.
double DMax_m
maximal distance to optical module [m]
double TMax_ns
maximum time for local coincidences [ns]
double R_Hz
default rate [Hz]
double TMin_ns
minimum time for local coincidences [ns]
size_t numberOfPrefits
number of prefits
Auxiliary class for defining the range of iterations of objects.
const JLimit & getLimit() const
Get limit.
Auxiliary data structure for shower PDF.
double calculate(const double E, const double D, const double cd, const double theta, const double phi) const
Get PDF.