52 bool operator()(
const T& first,
const T& second)
const
54 if (first.getPMTIdentifier() == second.getPMTIdentifier())
55 return first.getT() < second.getT();
57 return first.getPMTIdentifier() < second.getPMTIdentifier();
70int main(
int argc,
char **argv)
77 typedef JParallelFileScanner_t::multi_pointer_type multi_pointer_type;
79 JParallelFileScanner_t inputFile;
91 JParser<> zap(
"Program to evaluate hit probabilities.");
103 catch(
const exception& error) {
104 FATAL(error.what() << endl);
137 while (inputFile.hasNext()) {
139 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
141 multi_pointer_type ps = inputFile.next();
146 DEBUG(
"event: " << *tev << endl);
154 buildL0(*tev, router,
true, back_inserter(dataL0));
156 for (JEvt::const_iterator track = in->begin(); track != in->end(); ++track) {
158 DEBUG(
"track: " << *track << endl);
174 for (JDataL0_t::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
180 const int type = wip.
getType();
181 const double QE = wip.
QE;
182 const double R_Hz = summary.
getRate(i->getPMTIdentifier(), parameters.
R_Hz);
184 JHitW0 hit(*i, type, QE, R_Hz);
195 sort(data.begin(), data.end(), compare);
197 JDataW0_t::iterator __end = unique(data.begin(), data.end(), equal_to<JDAQPMTIdentifier>());
200 double E_GeV = parameters.
E_GeV;
212 <<
FIXED(12,1) << E_GeV <<
' '
213 <<
FIXED( 8,3) << track->getQ() << endl);
232 for (JDataW0_t::const_iterator hit = data.begin(); hit != __end; ++hit) {
234 const double x = hit->getX() - tz.
getX();
235 const double y = hit->getY() - tz.
getY();
236 const double z = hit->getZ() - tz.
getZ();
237 const double R = sqrt(x*x + y*y);
241 JDirection3D u(hit->getDX(), hit->getDY(), hit->getDZ());
246 const double phi = fabs(u.
getPhi());
249 const double E = E_GeV;
250 const double dt = T_ns.
constrain(hit->getT() - t1);
257 const double chi2 = H1.getChi2() - H0.getChi2();
260 << setw(10) << hit->getModuleID() <<
':' << setw( 2) << setfill(
'0') << hit->getPMTAddress() << setfill(
' ') <<
' '
261 <<
FIXED(12,1) << E <<
' '
262 <<
FIXED( 9,1) << R <<
' '
263 <<
FIXED( 6,4) << theta <<
' '
264 <<
FIXED( 6,4) << phi <<
' '
265 <<
FIXED( 8,3) << dt <<
' '
266 <<
FIXED(12,3) << chi2 << endl);
271 DEBUG(
"quality: " <<
FIXED(8,3) << Q <<
' ' <<
distance(data.begin(), __end) << endl);
276 for (JDetector::const_iterator i =
detector.begin(); i !=
detector.end(); ++i) {
286 module.transform(R, tz.getPosition());
288 for (JModule::iterator pmt = module.begin(); pmt != module.end(); ++pmt) {
290 const double R = sqrt(pmt->getX()*pmt->getX() + pmt->getY()*pmt->getY());
291 const double theta = pmt->getTheta();
292 const double phi = fabs(pmt->getPhi());
293 const double y = npe.
calculate(1.0, R, theta, phi);
296 << setw(10) << module.
getID() <<
':' << setw( 2) << setfill(
'0') <<
distance(module.begin(),pmt) << setfill(
' ') <<
' '
297 <<
FIXED(9,1) << R <<
' '
298 <<
FIXED(6,4) << theta <<
' '
299 <<
FIXED(6,4) << phi <<
' '
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.
int main(int argc, char **argv)
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.
ROOT TTree parameter settings of various packages.
Router for direct addressing of module data in detector data structure.
Data structure for a composite optical module.
Auxiliary class for map of PMT parameters.
const JPMTParameters & getPMTParameters(const JPMTIdentifier &id) const
Get PMT parameters.
Data structure for PMT parameters.
double QE
relative quantum efficiency
int getType() const
Get type for for time-slewing correction.
Data structure for fit of straight line paralel to z-axis.
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
double getZ(const JPosition3D &pos) const
Get point of emission of Cherenkov light along muon path.
JAxis3D & rotate(const JRotation3D &R)
Rotate axis.
Data structure for direction in three dimensions.
JDirection3D & rotate(const JRotation3D &R)
Rotate.
Data structure for position in three dimensions.
void transform(const JRotation3D &R, const JVector3D &pos)
Transform position.
JPosition3D & rotate(const JRotation3D &R)
Rotate.
const JPosition3D & getPosition() const
Get position.
double getY() const
Get y position.
double getX() const
Get x position.
double getTheta() const
Get theta angle.
double getPhi() const
Get phi angle.
int getID() const
Get identifier.
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 JDAQPMTIdentifier &id) const
Get rate.
static const int JSTART_LENGTH_METRES
distance between projected positions on the track of optical modules for which the response does not ...
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.
const double getInverseSpeedOfLight()
Get inverse speed of light.
double getTanThetaC()
Get average tangent of Cherenkov angle of water corresponding to group velocity.
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.
Model for fit to acoustics data.
double calculate(const double E, const double R, const double theta, const double phi) const
Get PDF.
Auxiliary data structure for muon PDF.
JFunction1D_t::result_type result_type
result_type calculate(const double E, const double R, const double theta, const double phi, const double t1) const
Get PDF.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Data structure for fit parameters.
double TTS_ns
transition-time spread [ns]
double TMin_ns
minimal time w.r.t. Cherenkov hypothesis [ns]
double roadWidth_m
road width [m]
double TMax_ns
maximal time w.r.t. Cherenkov hypothesis [ns]
double ZMax_m
maximal z-positon [m]
double ZMin_m
minimal z-positon [m]
double R_Hz
default rate [Hz]
size_t numberOfPrefits
number of prefits
Auxiliary class for defining the range of iterations of objects.
const JLimit & getLimit() const
Get limit.
static counter_type max()
Get maximum counter value.
Auxiliary data structure for floating point format specification.