Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JTransitTime2D.cc File Reference

Example program to histogram PMT 2D transit-time distribution. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "TROOT.h"
#include "TFile.h"
#include "TH1D.h"
#include "JDetector/JPMTTransitTimeProbability.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

Example program to histogram PMT 2D transit-time distribution.

Author
mdejong

Definition in file JTransitTime2D.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 22 of file JTransitTime2D.cc.

23{
24 using namespace std;
25 using namespace JPP;
26
27 string outputFile;
28 int debug;
29
30 try {
31
32 JParser<> zap("Example program to histogram PMT 2D transit-time distribution.");
33
34 zap['o'] = make_field(outputFile) = "histogram.root";
35 zap['d'] = make_field(debug) = 0;
36
37 zap(argc, argv);
38 }
39 catch(const exception &error) {
40 FATAL(error.what() << endl);
41 }
42
43
44 TFile out(outputFile.c_str(), "recreate");
45
46 TH1D h2("tt2", NULL, 100, -20.0, +20.0);
47
48 for (int i = 1; i <= h2.GetNbinsX(); ++i) {
49
50 const double t1 = h2.GetBinCenter(i);
51
52 h2.SetBinContent(i, getTransitionTimeProbability2D(t1));
53 }
54
55 out.Write();
56 out.Close();
57}
string outputFile
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Utility class to parse command line options.
Definition JParser.hh:1698
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).