Jpp  test_elongated_shower_pde
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JCalibrateK40.cc File Reference

Auxiliary program to determine PMT parameters from K40 data. More...

#include <string>
#include <iostream>
#include <iomanip>
#include <limits>
#include "TROOT.h"
#include "TFile.h"
#include "TH1D.h"
#include "TH2D.h"
#include "TMath.h"
#include "km3net-dataformat/online/JDAQ.hh"
#include "km3net-dataformat/online/JDAQHeader.hh"
#include "JDAQ/JDAQTimesliceIO.hh"
#include "JDAQ/JDAQSummarysliceIO.hh"
#include "JDAQ/JDAQEvaluator.hh"
#include "JTrigger/JSuperFrame1D.hh"
#include "JTrigger/JSuperFrame2D.hh"
#include "JTrigger/JHitR0.hh"
#include "JTrigger/JMatchL0.hh"
#include "JTrigger/JHitToolkit.hh"
#include "JTrigger/JTriggerParameters.hh"
#include "JTrigger/JTriggerToolkit.hh"
#include "JTrigger/JPreprocessor.hh"
#include "JDetector/JDetector.hh"
#include "JDetector/JDetectorToolkit.hh"
#include "JDetector/JModuleRouter.hh"
#include "JDetector/JPMTAnalogueSignalProcessor.hh"
#include "JSupport/JSingleFileScanner.hh"
#include "JSupport/JMultipleFileScanner.hh"
#include "JSupport/JSummaryFileRouter.hh"
#include "JSupport/JSupport.hh"
#include "JSupport/JMeta.hh"
#include "JSupport/JTriggerParametersSupportkit.hh"
#include "JTools/JRange.hh"
#include "JROOT/JROOTClassSelector.hh"
#include "JROOT/JRootToolkit.hh"
#include "JROOT/JRootFileWriter.hh"
#include "JLang/JObjectMultiplexer.hh"
#include "JCalibrate/JCalibrateK40.hh"
#include "Jeep/JPrint.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Auxiliary program to determine PMT parameters from K40 data.

By default, the combinatorial background is estimated from the singles rate.
In case L0 data are taken (and no summary data are available), the singles rate can be determined from the amount of L0 data.
One can also estimate the background from the tails in the time residual distribution.
In that case, option -B can be used to specify the minimal and maximal time offset in ns.
For example -B "10 20".
Note that the minimal and maximal time should be larger that the width of the time residual distribution and less than the time window of the L1 coincidence, respectively.
The time window is applied symmetrically around a time offset of zero.
Finally, if L0 data are available, one can estimate the background using the same procedure but with a random (read wrong) time calibration.

The option -M can be used to specify a range of multiplicities.
For example -M "2 2" will strictly select two-fold coincidences. Note that such a selection can bias the sample.

Also consult documentation.

Author
mdejong

Definition in file JCalibrateK40.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 140 of file JCalibrateK40.cc.

141 {
142  using namespace std;
143  using namespace JPP;
144  using namespace KM3NETDAQ;
145 
146  JMultipleFileScanner_t inputFile;
147  counter_type numberOfEvents;
148  string outputFile;
149  string detectorFile;
150  Double_t TMax_ns;
151  JRange<double> rateRange_Hz;
152  JRange<double> totRange_ns;
153  JRange<double> Tail_ns;
154  JRange<int> multiplicity;
155  double deadTime_us;
156  JROOTClassSelector selector;
157  string background;
158  JPreprocessor option;
159  int debug;
160 
161  try {
162 
163  JParser<> zap("Auxiliary program to determine PMT parameters from K40 data.");
164 
165  zap['f'] = make_field(inputFile, "input file.");
166  zap['o'] = make_field(outputFile, "output file.") = "calibrate_k40.root";
167  zap['n'] = make_field(numberOfEvents) = JLimit::max();
168  zap['a'] = make_field(detectorFile, "detector file.");
169  zap['T'] = make_field(TMax_ns, "time window [ns].") = 20.0;
170  zap['V'] = make_field(rateRange_Hz, "PMT rate range [Hz].") = JRange<double>(0.0, 20.0e3);
171  zap['t'] = make_field(totRange_ns, "PMT time-over-threshold range [ns].") = JRange<double>(4.0, ToTmax_ns);
172  zap['b'] = make_field(background, "background estimation method.") = rates_t, count_t, tails_t, rndms_t;
173  zap['B'] = make_field(Tail_ns, "time window used for background estimation.") = JRange<double>(15.0, 20.0);
174  zap['M'] = make_field(multiplicity, "multiplicity range of hits on DOM.") = JRange<int>(2, 31);
175  zap['D'] = make_field(deadTime_us, "L1 dead time (us)") = 0.0;
176  zap['C'] = make_field(selector, "timeslice selector, e.g. JDAQTimesliceL1.") = getROOTClassSelection<JDAQTimesliceTypes_t>();
177  zap['O'] = make_field(option, "hit pre-processing option.") = JPreprocessor::getOptions();
178  zap['d'] = make_field(debug, "debug flag.") = 1;
179 
180  zap(argc, argv);
181  }
182  catch(const exception &error) {
183  FATAL(error.what() << endl);
184  }
185 
186  //-----------------------------------------------------------
187  // check the input parameters
188  //-----------------------------------------------------------
189 
190  cout.tie(&cerr);
191 
192  if (selector == JDAQTimesliceL2::Class_Name() ||
193  selector == JDAQTimesliceSN::Class_Name()) {
194  FATAL("Option -C <selector> " << selector << " not compatible with calibration method." << endl);
195  }
196 
197  if (selector == JDAQTimeslice ::Class_Name() ||
198  selector == JDAQTimesliceL1::Class_Name()) {
199 
201 
202  try {
203  parameters = getTriggerParameters(inputFile);
204  }
205  catch(const JException& error) {
206  FATAL("No trigger parameters from input:" << error.what() << endl);
207  }
208 
209  if ((selector == JDAQTimeslice ::Class_Name() && parameters.writeL1.prescale > 0) ||
210  (selector == JDAQTimesliceL1::Class_Name())) {
211 
212  if (parameters.TMaxLocal_ns < TMax_ns) {
213  FATAL("Option -T <TMax_ns> = " << TMax_ns << " is larger than in the trigger " << parameters.TMaxLocal_ns << endl);
214  }
215 
216  if (background == rndms_t ||
217  background == count_t) {
218  FATAL("Option -C <selector> " << selector << " incompatible with option -b <background> " << background << endl);
219  }
220  }
221  }
222 
223  if (!multiplicity.is_valid() || multiplicity.getLowerLimit() < 2) {
224  FATAL("Invalid option -M <multiplicity> " << multiplicity << endl);
225  }
226 
227  if (!totRange_ns.is_valid()) {
228  FATAL("Invalid option -t <totRange_ns> " << totRange_ns << endl);
229  }
230 
231  if (background == tails_t) {
232 
233  if (!Tail_ns.is_valid()) {
234  FATAL("Invalid option -B <Tail_ns> " << Tail_ns << endl);
235  }
236 
237  if (Tail_ns.getUpperLimit() > TMax_ns) {
238  FATAL("Invalid option -B <Tail_ns> " << Tail_ns << "; upper limit larger than option -T <TMax_ns> " << TMax_ns << endl);
239  }
240  }
241 
242  //-----------------------------------------------------------
243  // load detector file
244  //-----------------------------------------------------------
245 
247 
248  try {
249  load(detectorFile, detector);
250  }
251  catch(const JException& error) {
252  FATAL(error);
253  }
254 
255  if (detector.empty()) {
256  FATAL("Empty detector." << endl);
257  }
258 
259  const JModuleRouter router(detector);
260 
261  //-----------------------------------------------------------
262  // determine time offsets for background method rndms_t
263  //-----------------------------------------------------------
264 
265  vector<double> t0; // time offsets for random background evaluation [ns]
266 
267  for (int i = 0; i != NUMBER_OF_PMTS; ++i) {
268  t0.push_back(i * 2 * TMax_ns);
269  }
270 
271  //-----------------------------------------------------------
272  // correction factor for rate due to specified time-over-threshold range
273  //-----------------------------------------------------------
274 
275  const JPMTAnalogueSignalProcessor cpu;
276 
277  const int NPE = 1;
278  const double RTU = (cpu.getIntegralOfChargeProbability(cpu.getNPE(totRange_ns.getLowerLimit()), cpu.getNPE(totRange_ns.getUpperLimit()), NPE)
279  /
280  cpu.getIntegralOfChargeProbability(cpu.getNPE(0.0), cpu.getNPE(ToTmax_ns), NPE));
281 
282 
283 
284  //-----------------------------------------------------------
285  // initialise histograms
286  //-----------------------------------------------------------
287 
288  JCombinatorics combinatorics(NUMBER_OF_PMTS);
289 
290  vector<JHistogram> zmap(detector.size());
291 
292  const int nx = combinatorics.getNumberOfPairs();
293  const double xmin = -0.5;
294  const double xmax = nx - 0.5;
295 
296  const double ymin = -floor(TMax_ns) + 0.5;
297  const double ymax = +floor(TMax_ns) - 0.5;
298  const int ny = (int) ((ymax - ymin) / 1.0);
299 
300 
301  for (JDetector::iterator module = detector.begin(); module != detector.end(); ++module) {
302 
303  const JModuleAddress& address = router.getAddress(module->getID());
304 
305  if (!module->empty()) {
306 
307  NOTICE("Booking histograms for module " << module->getID() << endl);
308 
309  zmap[address.first] = JHistogram(new TH2D(MAKE_CSTRING(module->getID() << _2S), NULL, nx, xmin, xmax, ny, ymin, ymax),
310  new TH1D(MAKE_CSTRING(module->getID() << _1B), NULL, nx, xmin, xmax),
311  new TH1D(MAKE_CSTRING(module->getID() << _1L), NULL, nx, xmin, xmax));
312  }
313  }
314 
315 
316  typedef JHitR0 hit_type;
317  typedef JSuperFrame2D<hit_type> JSuperFrame2D_t;
318  typedef JSuperFrame1D<hit_type> JSuperFrame1D_t;
319 
320  const JMatchL0<hit_type> match(TMax_ns); // time window self-coincidences [ns]
321 
322  const double deadTime_ns = deadTime_us * 1e3;
323 
324 
325  TFile out(outputFile.c_str(), "recreate");
326 
327  putObject(out, JMeta(argc, argv));
328 
329  counter_type counter = 0;
330 
331  for (JMultipleFileScanner_t::const_iterator i = inputFile.begin(); i != inputFile.end(); ++i) {
332 
333  STATUS("Processing: " << *i << endl);
334 
335  JSummaryFileRouter summary(*i);
336 
339 
340  for (JDAQHeader header; in.hasNext() && counter != numberOfEvents; ++counter) {
341 
342  STATUS("event: " << setw(10) << counter << '\r'); DEBUG(endl);
343 
344  const JDAQTimeslice* timeslice = in.next();
345 
346  if (header.getDetectorID() != timeslice->getDetectorID() ||
347  header.getRunNumber () != timeslice->getRunNumber ()) {
348 
349  header = timeslice->getDAQHeader();
350 
351  putObject(out, header);
352  }
353 
354  if (background == rates_t) {
355 
356  summary.update(timeslice->getDAQHeader());
357 
358  if (timeslice->getFrameIndex() != summary.getSummaryslice()->getFrameIndex()) {
359 
360  ERROR("Frame indices do not match at "
361  << "[counter = " << counter << "]"
362  << "[timeslice = " << timeslice->getFrameIndex() << "]"
363  << "[summaryslice = " << summary.getSummaryslice()->getFrameIndex() << "]" << endl);
364 
365  if (!in.hasNext())
366  break;
367  else
368  FATAL("ROOT TTrees not aligned; Run number " << timeslice->getRunNumber() << endl);
369  }
370  }
371 
372 
373  for (JDAQTimeslice::const_iterator frame = timeslice->begin(); frame != timeslice->end(); ++frame) {
374 
375  if (router.hasModule(frame->getModuleID())) {
376 
377  const JModule& module = router.getModule(frame->getModuleID());
378 
379  //-----------------------------------------------------------
380  // determine background rates and veto per PMT
381  //-----------------------------------------------------------
382 
383  vector<double> rate_Hz(NUMBER_OF_PMTS, 0.0);
384  vector<bool> veto (NUMBER_OF_PMTS, false);
385 
386  if (background == count_t) {
387 
388  for (JDAQSuperFrame::const_iterator i = frame->begin(); i != frame->end(); ++i) {
389  rate_Hz[i->getPMT()] += RTU * 1e9 / getFrameTime();
390  }
391 
392  } else if (background == tails_t) {
393 
394  // see below
395 
396  } else if (background == rndms_t) {
397 
398  // see below
399 
400  } else if (background == rates_t) {
401 
402  if (summary.hasSummaryFrame(frame->getModuleID())) {
403 
404  const JDAQSummaryFrame& sum = summary.getSummaryFrame(frame->getModuleID());
405 
406  for (int i = 0; i != NUMBER_OF_PMTS; ++i){
407  rate_Hz[i] = RTU * sum.getRate(i);
408  }
409 
410  } else {
411 
412  FATAL("Summary frame of module " << frame->getModuleID() << " not found at frame index " << timeslice->getFrameIndex() << endl);
413  }
414  }
415 
416  const JDAQFrameStatus status = frame->getDAQFrameStatus();
417 
418  // Set veto according DAQ or PMT status
419  // Hits of PMTs with veto will not be counted in livetime nor coincidences nor background
420 
421  for (int i = 0; i != NUMBER_OF_PMTS; ++i) {
422  if (!getDAQStatus(status, module, i) ||
423  !getPMTStatus(status, module, i)) {
424  veto[i] = true;
425  }
426  }
427 
428  //-----------------------------------------------------------
429  // sort the PMT pairs by opening angle in the order largest angle-->smallest angle
430  //-----------------------------------------------------------
431 
432  const JModuleAddress& address = router.getAddress(frame->getModuleID());
433 
434  combinatorics.configure(module.size());
435 
436  combinatorics.sort(JPairwiseComparator(module));
437 
438  TH2D* h2s = zmap[address.first].h2s;
439  TH1D* h1b = zmap[address.first].h1b;
440  TH1D* h1L = zmap[address.first].h1L;
441 
442  //-----------------------------------------------------------
443  // process data
444  //-----------------------------------------------------------
445 
446  JSuperFrame2D_t& buffer = JSuperFrame2D_t::demultiplex(*frame, module);
447 
448  buffer.preprocess(option, match);
449 
450  for (JSuperFrame2D_t::iterator i = buffer.begin(); i != buffer.end(); ++i) {
451 
452  const int pmt = i->getPMTAddress();
453 
454  if (veto[pmt] || !rateRange_Hz(rate_Hz[pmt])) {
455  i->reset();
456  }
457  }
458 
459  JSuperFrame1D_t& data = JSuperFrame1D_t::multiplex(buffer);
460 
461  DEBUG("Number of hits " << timeslice->getFrameIndex() << ":" << frame->getModuleID() << ' ' << frame->size() << ' ' << data.size() << endl);
462 
463  if (data.empty()) {
464  continue;
465  }
466 
467  // Signal;
468  // Hits from PMTs that do not comply with rate cuts have been exluded above
469 
470  size_t numberOfSignalEvents = 0;
471 
472  double t1 = numeric_limits<double>::lowest();
473 
474  for (vector<hit_type>::const_iterator p = data.begin(); p != data.end(); ) {
475 
477 
478  while (++q != data.end() && q->getT() - p->getT() <= TMax_ns) {}
479 
480  const int N = distance(p,q);
481 
482  if (multiplicity(N)) {
483 
484  numberOfSignalEvents += 1;
485 
486  if (p->getT() > t1 + deadTime_ns) {
487 
488  for (vector<hit_type>::const_iterator __p = p; __p != q; ++__p) {
489  for (vector<hit_type>::const_iterator __q = __p; ++__q != q; ) {
490 
491  if (totRange_ns( __p->getToT()) && totRange_ns(__q->getToT())) {
492  h2s->Fill((double) combinatorics.getIndex(__p->getPMT(),__q->getPMT()),
493  JCombinatorics::getSign(__p->getPMT(),__q->getPMT()) * (__q->getT() - __p->getT()));
494  }
495  }
496  }
497 
498  t1 = p->getT();
499  }
500  }
501 
502  p = q;
503  }
504 
505  // Background;
506  // Note that rate cuts and veto have already been accounted for when data buffer was filled
507 
508  if (background == rndms_t) {
509 
510  for (vector<hit_type>::iterator i = data.begin(); i != data.end(); ++i) {
511  *i = hit_type(i->getPMT(), JHit(i->getT() + t0[i->getPMT()], i->getToT()));
512  }
513 
514  sort(data.begin(), data.end());
515 
516  double t1 = numeric_limits<double>::lowest();
517 
518  for (vector<hit_type>::const_iterator p = data.begin(); p != data.end(); ) {
519 
521 
522  while (++q != data.end() && q->getT() - p->getT() <= TMax_ns) {}
523 
524  const int N = distance(p,q);
525 
526  if (multiplicity(N)) {
527 
528  if (p->getT() > t1 + deadTime_ns) {
529 
530  for (vector<hit_type>::const_iterator __p = p; __p != q; ++__p) {
531  for (vector<hit_type>::const_iterator __q = __p; ++__q != q; ) {
532 
533  if (totRange_ns(__p->getToT()) && totRange_ns(__q->getToT())) {
534  h1b->Fill((double) combinatorics.getIndex(p->getPMT(),q->getPMT()), 1.0);
535  }
536  }
537  }
538 
539  t1 = p->getT();
540  }
541  }
542 
543  p = q;
544  }
545 
546  } else if (background == rates_t ||
547  background == count_t) {
548 
549  Double_t Rs = 0.0; // total rate [Hz]
550 
551  for (int i = 0; i != NUMBER_OF_PMTS; ++i) {
552 
553  const Double_t R1 = rate_Hz[i]; // [Hz]
554 
555  if (!veto[i] && rateRange_Hz(R1)) {
556  Rs += R1;
557  }
558  }
559 
560  for (int i = 0; i != NUMBER_OF_PMTS; ++i) {
561  for (int j = i; ++j != NUMBER_OF_PMTS; ) {
562 
563  const Double_t R1 = rate_Hz[i]; // [Hz]
564  const Double_t R2 = rate_Hz[j]; // [Hz]
565 
566  if (!veto[i] && rateRange_Hz(R1) &&
567  !veto[j] && rateRange_Hz(R2)) {
568 
569  // expectation values (counts) within TMax_ns * 2 for the optical module and the two PMTs
570  const double ED = (Rs - rate_Hz[i] - rate_Hz[j]) * 2 * TMax_ns * 1e-9;
571  const double E1 = rate_Hz[i] * 2 * TMax_ns * 1e-9;
572  const double E2 = rate_Hz[j] * 2 * TMax_ns * 1e-9;
573 
574  // expected rate of coincidences = P * # of trials
575  Double_t N = coincidenceP(E1, E2, ED,
576  multiplicity.getLowerLimit(),
577  multiplicity.getUpperLimit()) * getFrameTime() / (2*TMax_ns);
578 
579  h1b->Fill((double) combinatorics.getIndex(i,j), N);
580  }
581  }
582  }
583  }
584 
585  //-----------------------------------------------------------
586  // fill the livetime by PMT pairs
587  //-----------------------------------------------------------
588 
589  const double livetime_s = getFrameTime()*1e-9 * exp(-deadTime_ns * numberOfSignalEvents/getFrameTime());
590 
591  for (size_t i = 0; i < combinatorics.getNumberOfPairs(); ++i) {
592 
593  const int pmt1 = combinatorics.getPair(i).first;
594  const int pmt2 = combinatorics.getPair(i).second;
595 
596  if (!veto[pmt1] && rateRange_Hz(rate_Hz[pmt1]) &&
597  !veto[pmt2] && rateRange_Hz(rate_Hz[pmt2]) ) {
598 
599  h1L->Fill(i, livetime_s);
600  }
601  }
602  }
603  }
604  }
605  }
606  STATUS(endl);
607 
608  if (background == tails_t ) {
609 
610  for (vector<JHistogram>::iterator hist = zmap.begin() ; hist != zmap.end() ; ++hist) {
611 
612  if (hist->is_valid()) {
613 
614  TH2D* h2s = hist->h2s;
615  TH1D* h1b = hist->h1b;
616 
617  for (int i = 0; i != NUMBER_OF_PMTS; ++i) {
618  for (int j = i; ++j != NUMBER_OF_PMTS; ) {
619 
620  double Y = 0.0; // sum of counts in tail regions
621  double W = 0.0; // square of error of Y
622  int N = 0; // number of bins in tail regions
623  int k = combinatorics.getIndex(i,j); // PMT pair index (x-axis of h2s)
624 
625  for (int l = 1; l <= h2s->GetYaxis()->GetNbins(); ++l) {
626 
627  const Double_t dt = h2s->GetYaxis()->GetBinCenter(l) ;
628 
629  if (Tail_ns(fabs(dt))) {
630  Y += h2s->GetBinContent(k+1,l);
631  W += h2s->GetBinError(k+1,l) * h2s->GetBinError(k+1,l);
632  N++;
633  }
634  }
635 
636  h1b->SetBinContent(k+1, Y / N * (2.0*TMax_ns) / ((ymax - ymin)/ny) );
637  h1b->SetBinError (k+1, sqrt(W/N) * (2.0*TMax_ns) / ((ymax - ymin)/ny) );
638  }
639  }
640  }
641  }
642  }
643 
644  //---------------------------------------------
645  // save normalisation constants and store histograms
646  //---------------------------------------------
647 
648  TH1D weights_hist(weights_hist_t, NULL, 3, 0.0, 3.0);
649 
650  weights_hist.GetXaxis()->SetBinLabel(1, W1_overall_t); // [s]
651  weights_hist.GetXaxis()->SetBinLabel(2, WS_t); // [ns]
652  weights_hist.GetXaxis()->SetBinLabel(3, WB_t); // [ns]
653 
654  weights_hist.Fill(W1_overall_t, counter*getFrameTime()*1e-9); // [s]
655  weights_hist.Fill(WS_t, (ymax - ymin)/ny); // [ns]
656  weights_hist.Fill(WB_t, 2.0*TMax_ns); // [ns]
657 
658  out << weights_hist;
659 
660  for (vector<JHistogram>::iterator i = zmap.begin(); i != zmap.end(); ++i) {
661  if (i->is_valid()) {
662  out << *(i->h2s);
663  out << *(i->h1b);
664  out << *(i->h1L);
665  }
666  }
667 
668  out.Write();
669  out.Close();
670 }
JDetector detector
Definition: JRunAnalyzer.hh:23
Auxiliary class for ROOT I/O of application specific meta data.
Definition: JMeta.hh:70
Utility class to parse command line options.
Definition: JParser.hh:1500
General exception.
Definition: JException.hh:23
then fatal No hydrophone data file $HYDROPHONE_TXT fi sort gr k
Auxiliary class to convert pair of indices to unique index and back.
double getRate(const int tdc, const double factor=1.0) const
Get count rate.
Data structure for a composite optical module.
Definition: JModule.hh:68
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
int getDetectorID() const
Get detector identifier.
static const char *const WB_t
Named bin for value of TMax_ns in JCalibrateK40.
L0 match criterion.
Definition: JMatchL0.hh:27
#define STATUS(A)
Definition: JMessage.hh:63
Detector data structure.
Definition: JDetector.hh:89
Auxiliary class to select ROOT class based on class name.
Router for direct addressing of module data in detector data structure.
then JShowerPostfit f $INPUT_FILE o $OUTPUT_FILE N
#define R1(x)
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
#define MAKE_CSTRING(A)
Make C-string.
Definition: JPrint.hh:151
Long64_t counter_type
Type definition for counter.
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTORXY_TXT $WORKDIR $DETECTORXY_TXT tail read X Y CHI2 RMS printf optimum n $X $Y $CHI2 $RMS awk v Y
Auxiliary class for multiplexing object iterators.
string outputFile
int getRunNumber() const
Get run number.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable STRING $argv[2] set_array QUANTILES set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"` source JAcoustics.sh -- typeset -A TRIPODS get_tripods $WORKDIR/tripod.txt TRIPODS XMEAN
Acoustics hit.
int getFrameIndex() const
Get frame index.
1-dimensional frame with time calibrated data from one optical module.
then JCookie sh JDataQuality D $DETECTOR_ID R $RUNS[*] o $QUALITY_TXT d $DEBUG!fi fi JDataQuality f $QUALITY_TXT Q livetime_s
Definition: JDataQuality.sh:49
int first
index of module in detector data structure
static const char *const WS_t
Named bin for time residual bin width.
Auxiliary class to sort pairs of PMT addresses within optical module.
Detector file.
Definition: JHead.hh:224
Reduced data structure for L0 hit.
Definition: JHitR0.hh:25
Hit data structure.
Definition: JDAQHit.hh:34
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1961
static const char *const _1B
Name extension for 1D background.
double getFrameTime()
Get frame time duration.
Definition: JDAQClock.hh:162
Data storage class for rate measurements of all PMTs in one module.
#define NOTICE(A)
Definition: JMessage.hh:64
#define ERROR(A)
Definition: JMessage.hh:66
Data time slice.
File router for fast addressing of summary data.
Address of module in detector data structure.
int debug
debug level
Definition: JSirene.cc:68
bool putObject(TDirectory &dir, const TObject &object)
Write object to ROOT directory.
#define FATAL(A)
Definition: JMessage.hh:67
static const char *const weights_hist_t
Histogram naming.
static const char *const _1L
Name extension for 1D live time.
Auxiliary base class for list of file names.
virtual const char * what() const override
Get error message.
Definition: JException.hh:48
bool getPMTStatus(const JStatus &status)
Test status of PMT.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
const JDAQHeader & getDAQHeader() const
Get DAQ header.
Definition: JDAQHeader.hh:49
static const char *const W1_overall_t
Named bin for duration of the run.
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
2-dimensional frame with time calibrated data from one optical module.
Object reading from a list of files.
int j
Definition: JPolint.hh:682
double coincidenceP(double E1, double E2, double ED, int M_min, int M_max)
Coincidence probability of two PMTs within one module.
bool getDAQStatus(const JDAQFrameStatus &frame, const JStatus &status)
Test status of DAQ.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
Definition: JDAQ.hh:26
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:42
Auxiliary class for specifying the way of pre-processing of hits.
const JDAQFrameStatus & getDAQFrameStatus() const
Get DAQ frame status.
JTriggerParameters getTriggerParameters(const JMultipleFileScanner_t &file_list)
Get trigger parameters.
static const char *const _2S
Name extension for 2D counts.
Template definition of histogram object interface.
Definition: JHistogram.hh:27