50 template<
class JHit_t>
62 buffer.insert(JType_t(*i));
69 const char*
const muon_t =
"muon";
79 int main(
int argc,
char **argv)
86 typedef JTriggeredFileScanner_t::multi_pointer_type multi_pointer_type;
88 JTriggeredFileScanner_t inputFile;
91 size_t numberOfPrefits;
103 JParser<> zap(
"Example program to histogram fit results.");
107 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
114 zap[
'O'] =
make_field(option) =
"E",
"N",
"LINE",
"LOGE";
120 catch(
const exception& error) {
121 FATAL(error.what() << endl);
129 catch(
const exception& error) {
130 FATAL(error.what() << endl);
133 JVolume volume(head, option !=
"LINE");
138 cylinder.
add(offset);
140 NOTICE(
"Offset: " << offset << endl);
141 NOTICE(
"Cylinder: " << cylinder << endl);
145 TH1D job(
"job", NULL, 100, 0.5, 100.5);
147 TH1D hn(
"hn", NULL, 250, -0.5, 249.5);
148 TH1D hq(
"hq", NULL, 300, 0.0, 600.0);
149 TH1D hi(
"hi", NULL, 101, -0.5, 100.5);
150 TH1D hv(
"hv", NULL, 200, -6.0, 0.0);
151 TH1D h1(
"h1", NULL, 200, -2.0, +2.0);
152 TH1D hc(
"hc", NULL, 200, -1.0, +1.0);
153 TH1D hu(
"hu", NULL, 400, -1.0e3, 1.0e3);
155 TH1D hx(
"hx", NULL, 70, -3.0, +2.3);
156 TH1D hd(
"hd", NULL, 100, 0.0, 10.0);
157 TH1D ht(
"ht", NULL, 100, -100.0, 100.0);
159 TH1D hz0(
"hz0[start]", NULL, 400, -200.0, 200.0);
160 TH1D hz1(
"hz1[end]", NULL, 400, -200.0, 200.0);
165 TH1D E_E(
"E_E", NULL, 100, -5.0, +5.0);
166 TH2D ExE(
"ExE", NULL,
170 const Int_t ny = 28800;
171 const Double_t ymin = 0.0;
172 const Double_t ymax = 180.0;
176 if (option.find(
'E') != string::npos) {
184 const double xmin = log((
double) 1);
185 const double xmax = log((
double) 300);
188 X.push_back((
int) exp(
x));
192 TH2D h2(
"h2", NULL, X.size() - 1, X.data(), ny, ymin, ymax);
205 while (inputFile.hasNext()) {
207 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
209 multi_pointer_type ps = inputFile.next();
236 if (track->E > Emax) {
243 if (muon == event->mc_trks.end()) {
254 if (option.find(
'E') != string::npos)
255 x = volume.
getX(event->mc_trks[0].E);
261 JEvt::iterator __end = partition(evt->begin(), evt->end(),
JHistory::is_event(application));
263 if (evt->begin() == __end) {
269 if (numberOfPrefits > 0) {
271 JEvt::iterator __q = __end;
273 advance(__end = evt->begin(), min(numberOfPrefits, (
size_t)
distance(evt->begin(), __q)));
293 JEvt::iterator best = pointing(evt->begin(), __end);
294 const Double_t beta = pointing.
getAngle(*best);
295 const double Efit = best->getE();
296 const double Eraw = best->getW(
JENERGY_ENERGY, numeric_limits<double>::min());
297 const double mip = best->getW(
JSTART_NPE_MIP, numeric_limits<double>::max());
301 bool ok = (Efit >= Emin_GeV && mip >= NPE);
307 hn.Fill((Double_t) best->getNDF());
308 hq.Fill(best->getQ());
309 hi.Fill((Double_t)
distance(evt->begin(), best));
310 hc.Fill(best->getDZ());
316 hu.Fill(atmosphere(evt->begin(), __end));
319 hx.Fill(max(log10(beta), hx.GetXaxis()->GetXmin()));
360 E_0.Fill(volume.
getX(E,
true));
361 E_1.Fill(volume.
getX(Eraw,
true));
362 E_2.Fill(volume.
getX(Efit,
true));
363 E_E.Fill(volume.
getX(Efit) - volume.
getX(E));
364 ExE.Fill(volume.
getX(E), volume.
getX(Efit));
374 const double npe = best->getW(
JVETO_NPE);
376 const double pv = TMath::PoissonI(count, npe);
378 hv.Fill(max(log10(pv), hv.GetXaxis()->GetXmin()));
385 NOTICE(
"Number of events input " << setw(8) << right << job.GetBinContent(1) << endl);
386 NOTICE(
"Number of events with muon " << setw(8) << right << job.GetBinContent(3) << endl);
387 NOTICE(
"Number of events with fit " << setw(8) << right << job.GetBinContent(4) << endl);
388 NOTICE(
"Number of events selected " << setw(8) << right << job.GetBinContent(5) << endl);
389 NOTICE(
"Number of events with neutrino " << setw(8) << right << job.GetBinContent(6) << endl);
390 NOTICE(
"Number of events contained " << setw(8) << right << job.GetBinContent(7) << endl);
General purpose messaging.
#define DEBUG(A)
Message macros.
int main(int argc, char **argv)
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
ROOT TTree parameter settings of various packages.
Synchronously read DAQ events and Monte Carlo events (and optionally other events).
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
double getRadius() const
Get radius.
Data structure for vector in two dimensions.
double getLengthSquared() const
Get length squared.
double getIntersection(const JVector3D &pos) const
Get longitudinal position along axis of position of closest approach with given position.
double getZmin() const
Get minimal z position.
bool is_inside(const JVector3D &pos) const
Check whether given point is inside cylinder.
JCylinder3D & add(const JVector3D &pos)
Add position.
double getZmax() const
Get maximal z position.
Data structure for position in three dimensions.
const JPosition3D & getPosition() const
Get position.
JTime & add(const JTime &value)
Addition operator.
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
JTime & sub(const JTime &value)
Subtraction operator.
JVector3D & add(const JVector3D &vector)
Add vector.
Utility class to parse command line options.
Auxiliary class to evaluate atmospheric muon hypothesis.
Auxiliary class to compare fit results with respect to a reference direction (e.g....
double getAngle(const JFit &fit) const
Get angle between reference direction and fit result.
const_iterator< T > end() const
Get end of data.
const_iterator< T > begin() const
Get begin of data.
Auxiliary class to convert DAQ hit time to/from Monte Carlo hit time.
double putTime() const
Get Monte Carlo time minus DAQ/trigger time.
static const int JMUONGANDALF
static const int JMUONPREFIT
static const int JMUONENERGY
static const int JMUONSIMPLEX
static const int JMUONPATH
static const int JMUONSTART
static const int JENERGY_ENERGY
uncorrected energy [GeV] from JEnergy.cc
static const int JVETO_NPE
number of photo-electrons from JVeto.cc
static const int JSTART_LENGTH_METRES
distance between first and last hits in metres from JStart.cc
static const int JVETO_NUMBER_OF_HITS
number of hits from JVeto.cc
static const int JSTART_NPE_MIP
number of photo-electrons up to the barycentre from JStart.cc
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
Vec getOrigin(const JHead &header)
Get origin.
JDirection3D getDirection(const Vec &dir)
Get direction.
JTrack3E getTrack(const Trk &track)
Get track.
JCylinder3D getCylinder(const JHead &header)
Get cylinder corresponding to the positions of generated tracks (i.e.
bool has_neutrino(const Evt &evt)
Test whether given event has an incoming neutrino.
JPosition3D getPosition(const Vec &pos)
Get position.
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
Vec getOffset(const JHead &header)
Get offset.
size_t getCount(const array_type< T > &buffer, const JCompare_t &compare)
Count number of unique values.
static const JGeaneWater gWater
Function object for energy loss of muon in sea water.
const double getSpeedOfLight()
Get speed of light.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
counter_type advance(counter_type &counter, const counter_type value, const counter_type limit=std::numeric_limits< counter_type >::max())
Advance counter.
Head getCommonHeader(const JMultipleFileScanner_t &file_list)
Get common Monte Carlo header.
KM3NeT DAQ data structures and auxiliaries.
const char *const neutrino_t
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Auxiliary data structure for floating point format specification.
Auxiliary class for histogramming of effective volume.
Double_t getX(const Double_t E, double constrain=false) const
Get abscissa value.
Double_t getXmax() const
Get maximal abscissa value.
Double_t getXmin() const
Get minimal abscissa value.
Auxiliary class to test history.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
General purpose sorter of fit results.
Auxiliary class for defining the range of iterations of objects.
const JLimit & getLimit() const
Get limit.
Auxiliary class to synchronously read DAQ events and Monte Carlo events (and optionally other events)...
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
double E
Energy [GeV] (either MC truth or reconstructed)
Reconstruction type dependent comparison of track quality.
Auxiliary include file for time conversion between DAQ/trigger hit and Monte Carlo hit.