Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JSummaryFileRouter.hh
Go to the documentation of this file.
1#ifndef __JSUPPORT__JSUMMARYFILEROUTER__
2#define __JSUPPORT__JSUMMARYFILEROUTER__
3
4#include <string>
5
8
10#include "JDAQ/JSupport.hh"
11
14
15
16/**
17 * \author mdejong
18 */
19
20namespace JSUPPORT {}
21namespace JPP { using namespace JSUPPORT; }
22
23namespace JSUPPORT {
24
28
29
30 /**
31 * File router for fast addressing of summary data.
32 *
33 * The member method update() should be used to update the internal router for a given event.
34 * The member method getRate(const JDAQPMTIdentifier&) const can subsequently be used to obtain
35 * the measured singles rate for a given PMT at the closest time of the event.
36 */
38 public JSummaryRouter,
39 public JTreeScanner<JDAQSummaryslice, JDAQEvaluator>
40 {
41 public:
42 /**
43 * Constructor.
44 *
45 * \param file_name file name
46 */
47 JSummaryFileRouter(const std::string& file_name) :
50 {}
51
52
53 /**
54 * Constructor.
55 *
56 * \param file_name file name
57 * \param rate_Hz default singles rate [Hz]
58 */
59 JSummaryFileRouter(const std::string& file_name,
60 const double rate_Hz) :
63 {}
64
65
66 /**
67 * Update router.
68 *
69 * \param header header
70 */
71 void update(const JDAQHeader& header)
72 {
73 static Long64_t previous = -1;
74
75 const Long64_t index = this->find(header);
76
77 if (index != -1) {
78
79 if (index != previous) {
80
81 previous = index;
82
83 JSummaryRouter::update(this->getEntry(index));
84 }
85 }
86 }
87 };
88}
89
90#endif
ROOT TTree parameter settings.
File router for fast addressing of summary data.
JSummaryFileRouter(const std::string &file_name, const double rate_Hz)
Constructor.
void update(const JDAQHeader &header)
Update router.
JSummaryFileRouter(const std::string &file_name)
Constructor.
Router for fast addressing of summary data in KM3NETDAQ::JDAQSummaryslice data structure as a functio...
void update(const JDAQSummaryslice *ps)
Update router.
Template definition for direct access of elements in ROOT TChain.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Support classes and methods for experiment specific I/O.
Auxiliary class to determine time of DAQ objects.