57 using namespace KM3NETDAQ;
69 JParser<> zap(
"Example program to determine time slewing of L1 hits.");
74 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
81 catch(
const exception& error) {
82 FATAL(error.what() << endl);
105 const double xmin = -25.0;
106 const double xmax = +25.0;
112 os <<
"M[" << setfill(
'0') << setw(2) << i <<
"]";
114 H1D.push_back(
new TH1D(os.str().c_str(), NULL, nx,
xmin,
xmax));
126 while (inputFile.hasNext()) {
128 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
133 const Evt*
event = ps;
139 if (muon != event->mc_trks.end()) {
148 buildL0(*tev, router,
true, back_inserter(dataL0));
149 buildL2(*tev, router,
true, back_inserter(dataL2));
153 sort(dataL2.begin(), dataL2.end(), timeSorter<JHitL2>);
155 dataL2.erase(unique(dataL2.begin(), dataL2.end(), equal_to<JDAQModuleIdentifier>()), dataL2.end());
157 for (JDataL0_t::const_iterator hit = dataL0.begin(); hit != dataL0.end(); ++hit) {
159 const double t0 = trk.
getT(*hit);
160 const double t1 = converter.getTime(hit->getT());
162 H1D[1]->Fill(t1 - t0);
166 for (JDataL2_t::const_iterator hit = dataL2.begin(); hit != dataL2.end(); ++hit) {
168 const double t0 = trk.
getT(*hit);
169 const double t1 = converter.getTime(hit->begin()->getT());
170 const size_t index = min(hit->size(), H1D.size() - 1);
172 H1D[index]->Fill(t1 - t0);
179 TF1
f1(
"f1",
"[0]*exp(-0.5*(x-[1])*(x-[1])/([2]*[2])) + [3]");
181 string option =
"LL";
194 Double_t
sigma = 2.0;
197 for (
int i = 1; i != (*h1)->GetNbinsX(); ++i) {
199 const Double_t
x = (*h1)->GetBinCenter (i);
200 const Double_t y = (*h1)->GetBinContent(i);
208 f1.SetParameter(0, ymax);
209 f1.SetParameter(1, x0);
210 f1.SetParameter(2, sigma);
211 f1.FixParameter(3, ymin);
216 (*h1)->Fit(&
f1, option.c_str(),
"same", x0 - 3 *
sigma, x0 + 3 *
sigma);
219 cout <<
"\tt0.push_back(" << showpos <<
FIXED(4,2) <<
f1.GetParameter(1) <<
");" << endl;
Utility class to parse command line options.
JTrack3E getTrack(const Trk &track)
Get track.
Template specialisation of L0 builder for JHitL0 data type.
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
Router for direct addressing of module data in detector data structure.
Auxiliary class to synchronously read DAQ events and Monte Carlo events (and optionally other events)...
Auxiliary class to convert DAQ hit time to/from Monte Carlo hit time.
Auxiliary data structure for floating point format specification.
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
const JPolynome f1(1.0, 2.0, 3.0)
Function.
Auxiliary class for defining the range of iterations of objects.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Template specialisation of L2 builder for JHitL2 data type.
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
Data structure for L2 parameters.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
2-dimensional frame with time calibrated data from one optical module.
const JLimit & getLimit() const
Get limit.
do set_variable DETECTOR_TXT $WORKDIR detector
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
General purpose class for multiple pointers.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
#define DEBUG(A)
Message macros.