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());
64 for (int pmt = 0; pmt != NUMBER_OF_PMTS; ++pmt) {
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)
115 JLimit_t& numberOfEvents = inputFile.getLimit();
119 double gridAngle_deg;
125 JParser<> zap(
"Example program to analyse summary data.");
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) {
180 const double x = p2.
getX() -
p1.getX();
181 const double y = p2.
getY() -
p1.getY();
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);
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);
242 if (do_main<KM3NETDAQ::JDAQSummaryslice>(argc, argv)) {
return 0; }
243 if (do_main<ExtendedSummary_TimeSlice> (argc, argv)) {
return 0; }
Data structure for detector geometry and calibration.
General purpose messaging.
#define DEBUG(A)
Message macros.
Direct access to module in detector data structure.
int main(int argc, char **argv)
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
ROOT TTree parameter settings of various packages.
ExtendedSummary time slices.
Router for direct addressing of module data in detector data structure.
bool hasModule(const JObjectID &id) const
Has module.
const int getIndex(const JObjectID &id) const
Get index of module.
Direction set covering (part of) solid angle.
Data structure for position in three dimensions.
JPosition3D & rotate(const JRotation3D &R)
Rotate.
double getY() const
Get y position.
double getX() const
Get x position.
Utility class to parse command line options.
General purpose class for object reading from a list of file names.
virtual bool hasNext() override
Check availability of next element.
counter_type getCounter() const
Get counter.
virtual const pointer_type & next() override
Get next element.
void setClock()
Set clock.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
KM3NeT DAQ data structures and auxiliaries.
double getFrameTime()
Get frame time duration.
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.