56 const double factor = 1.0e-3;
58 for (JDAQSummaryslice::const_iterator frame = summary.begin(); frame != summary.end(); ++frame) {
60 if (router.
hasModule(frame->getModuleID())) {
62 const int index = router.
getIndex(frame->getModuleID());
65 (*this)[index].put(frame->getRate(pmt, factor));
85 for (ExtendedSummary_TimeSlice::const_iterator frame = summary.begin(); frame != summary.end(); ++frame) {
89 const int index = router.
getIndex(frame->lcm_id());
91 const int count = frame->numberOfItemsOrg() << 4;
93 (*this)[index].put(count * factor);
108 bool do_main(
int argc,
char **argv)
112 using namespace KM3NETDAQ;
119 double gridAngle_deg;
125 JParser<> zap(
"Example program to analyse summary data.");
130 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
138 catch(
const exception& error) {
139 FATAL(error.what() << endl);
143 if (roadWidth_m <= 0.0) {
FATAL(
"Invalid road width [m] " << roadWidth_m << endl); }
144 if (gridAngle_deg <= 0.0) {
FATAL(
"Invalid grid angle [deg] " << gridAngle_deg << endl); }
145 if (gridAngle_deg >= 90.0) {
FATAL(
"Invalid grid angle [deg] " << gridAngle_deg << endl); }
157 DEBUG(
"Number of modules in detector " <<
detector.size() << endl);
160 const JOmega3D omega(gridAngle_deg *
PI/180.0);
165 buffer2D M2(omega.size(), buffer1D(
detector.size()));
167 for (
size_t i = 0;
i != omega.size(); ++
i) {
171 for (
size_t m1 = 0; m1 !=
detector.size(); ++m1) {
172 for (
size_t m2 = 0; m2 != m1; ++m2) {
183 if (sqrt(x*x + y*y) <= roadWidth_m) {
184 M2[
i][m1].insert(m2);
193 TH1D h1(
"h1", NULL, 1000, 0.0, 1.0e3);
196 while (inputFile.hasNext()) {
198 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
200 const T* summary = inputFile.next();
202 const JRates buffer(router, *summary);
204 for (
size_t i = 0;
i != omega.size(); ++
i) {
208 for (
size_t m1 = 0; m1 != buffer.size(); ++m1) {
229 return (inputFile.getCounter() != 0 ?
true :
false);
240 int main(
int argc,
char **argv)
242 if (do_main<KM3NETDAQ::JDAQSummaryslice>(argc, argv)) {
return 0; }
243 if (do_main<ExtendedSummary_TimeSlice> (argc, argv)) {
return 0; }
void setClock()
Set clock.
Utility class to parse command line options.
Q(UTCMax_s-UTCMin_s)-livetime_s
int main(int argc, char *argv[])
ROOT TTree parameter settings of various packages.
const int getIndex(const JObjectID &id) const
Get index of module.
Router for direct addressing of module data in detector data structure.
Direction set covering (part of) solid angle.
Data structure for detector geometry and calibration.
ExtendedSummary time slices.
Auxiliary class for defining the range of iterations of objects.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
double getFrameTime()
Get frame time duration.
do set_variable OUTPUT_DIRECTORY $WORKDIR T
static const double PI
Mathematical constants.
double getY() const
Get y position.
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.
then JCookie sh JDataQuality D $DETECTOR_ID R
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
General purpose class for object reading from a list of file names.
Utility class to parse command line options.
bool hasModule(const JObjectID &id) const
Has module.
double getX() const
Get x position.
Data structure for position in three dimensions.
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.
JPosition3D & rotate(const JRotation3D &R)
Rotate.
#define DEBUG(A)
Message macros.