34 int main(
int argc,
char **argv)
38 using namespace KM3NETDAQ;
40 JMultipleFileScanner<JDAQSummaryslice> inputFile;
47 JParser<> zap(
"Monitoring of PMT time over threshold distributions.");
56 catch(
const exception &error) {
57 FATAL(error.what() << endl);
60 JTreeScanner<JDAQSummaryslice, JDAQEvaluator> in(inputFile);
64 using namespace KM3NETDAQ;
66 const double factor = 1.0/1000 ;
67 const int Nbins = 90 ;
72 const double maxRate_kHz = 20;
78 JManager<int, TH1D> DET(
new TH1D(
"det_S%", NULL, 1000, 0, nLines * 18 * maxRate_kHz * NUMBER_OF_PMTS));
84 const int nStages = 3;
89 while (in.hasNext()) {
93 int counter = in.getCounter();
95 STATUS(
"event: " << setw(10) << counter <<
'\r');
DEBUG(endl);
101 int nDetectorActivePMTs = 0;
103 int nDetectorTotalPMTs = 0;
107 for (KM3NETDAQ::JDAQSummaryslice::const_iterator summary_frame = summary->begin(); summary_frame != summary->end(); ++summary_frame) {
111 int DOMID = summary_frame->getModuleID() ;
113 TH2D* h_i = SinglesRatedistr[DOMID];
115 int nModuleActivePMTs = 0;
119 double pmtRate = summary_frame->getRate(ipmt, factor);
121 h_i->
Fill(ipmt, pmtRate, summary_frame->getWeight(ipmt, factor));
123 PMT[0]->
Fill(pmtRate);
125 domRate[0] += pmtRate;
127 nDetectorTotalPMTs++;
129 if ( !( summary_frame->testHighRateVeto(ipmt) || summary_frame->testFIFOStatus(ipmt) ) ) {
133 PMT[1]->
Fill(pmtRate);
135 domRate[1] += pmtRate;
161 nDetectorActivePMTs += nModuleActivePMTs;
164 for (
int i = 0; i < nStages; i++) {
165 if (domRate[i] > 0) {
166 detRate[i] += domRate[i];
170 DOM[i]->
Fill(domRate[i]);
172 if (i == 0) { modules.insert(DOMID); }
177 for (
int i = 0; i < nStages; i++) {
179 DET[i]->
Fill(detRate[i]);
181 detRate[i] /= ((double)nDetectorActivePMTs)/((double)nDetectorTotalPMTs);
183 History[i]->
Fill(counter, detRate[i]);
186 double deltaRate = detRate[i] - detRateBuf[i];
187 Delta[i]->
Fill(deltaRate);
190 detRateBuf[i] = detRate[i];
194 previous_summary = summary;
200 STATUS(modules.size() <<
" modules active in the run." << endl);
Utility class to parse command line options.
Auxiliary class to manage set of histograms.
Dynamic ROOT object management.
void Fill(const JFit &fA, const JFit &fB, const bool option)
Fill histograms.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
General purpose messaging.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Direct access to module in detector data structure.
Auxiliary class to define a range between two values.
Utility class to parse command line options.
void Write(TFile &out)
Write histograms to file.
JDAQPMTIdentifier PMT
Command line options.
ROOT TTree parameter settings.
KM3NeT DAQ constants, bit handling, etc.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
#define DEBUG(A)
Message macros.
int main(int argc, char *argv[])