52 {
53
55 JLimit_t& nSlices = inputFile.getLimit();
58 string detectorFile;
59
60 try {
61
63
64 zap[
'f'] =
make_field(inputFile ,
"Path to input file ");
68
69 zap(argc,argv);
70 }
71 catch(const exception &error) {
72 ERROR(error.what() << endl);
73 }
74
76
77 TH1D* h1 = new TH1D("rate_%", NULL, 100, -2, 2);
78 TH1D* h2 = new TH1D("time_%", NULL, 1, -0.5, 0.5);
79
82 s->configure(inputFile);
83
84 if (s->hasNext()){
85 JFrameIndexRange range (s->begin()->getFrameIndex() , s->rbegin()->getFrameIndex());
86 h2->SetBins(range.second - range.first + 1, range.first - 0.5, range.second + 0.5);
87 }
88
90
93
95
97
98 for ( ; scanner.hasNext() && counter != inputFile.getLimit(); ++counter) {
99
101
102 for(JDAQTimeslice::const_iterator frame = slice->begin() ; frame != slice->end() ; ++frame) {
103
104 vector <int> pmt_hit_count (NUMBER_OF_PMTS , 0) ;
105
107 pmt_hit_count[hit->getPMT()]++;
108 }
109
113 }
114 }
115 }
116
117 for (typename JManager < JDAQPMTIdentifier , TH1D >::const_iterator i = r.begin() ; i != r.end() ; ++i){
118
119 for(
int j=1 ;
j < i -> second -> GetNbinsX() ; ++
j){
120
121 double width = i->second->GetXaxis()->GetBinWidth(
j);
122 i -> second->SetBinContent(
j ,i->second->GetBinContent(
j)/width);
123 i -> second->SetBinError (
j ,i->second->GetBinError (
j)/width);
124 }
125 }
126
128
130
131 r.Write(out);
132 t.Write(out);
133}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Auxiliary class for multiplexing object iterators.
Utility class to parse command line options.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys.
General purpose class for object reading from a list of file names.
Auxiliary interface for direct access of elements in ROOT TChain.
int getFrameIndex() const
Get frame index.
bool putObject(TDirectory &dir, const TObject &object)
Write object to ROOT directory.
std::set< JROOTClassSelector > getROOTClassSelection(const bool option=false)
Get ROOT class selection.
Long64_t counter_type
Type definition for counter.
double getFrameTime()
Get frame time duration.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
Auxiliary class for a type holder.
Auxiliary class to select ROOT class based on class name.
Auxiliary class to select JTreeScanner based on ROOT class name.
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.