Jpp  15.0.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JSummaryFileRouter.hh
Go to the documentation of this file.
1 #ifndef __JSUPPORT__JSUMMARYFILEROUTER__
2 #define __JSUPPORT__JSUMMARYFILEROUTER__
3 
4 #include <string>
5 
8 
9 #include "JDAQ/JDAQEvaluator.hh"
10 
12 #include "JSupport/JTreeScanner.hh"
13 
14 
15 /**
16  * \author mdejong
17  */
18 
19 namespace JSUPPORT {}
20 namespace JPP { using namespace JSUPPORT; }
21 
22 namespace JSUPPORT {
23 
27 
28 
29  /**
30  * File router for fast addressing of summary data.
31  *
32  * The member method JSummaryFileRouter::update should be used to update the internal router for a given event.\n
33  */
35  public JSummaryRouter,
36  public JTreeScanner<JDAQSummaryslice, JDAQEvaluator>
37  {
38  public:
39  /**
40  * Constructor.
41  *
42  * \param file_name file name
43  * \param rate_Hz default singles rate [Hz]
44  */
45  JSummaryFileRouter(const std::string& file_name,
46  const double rate_Hz = 0.0) :
49  {}
50 
51 
52  /**
53  * Update router.
54  *
55  * \param header header
56  */
57  void update(const JDAQHeader& header)
58  {
59  static Long64_t previous = -1;
60 
61  const Long64_t index = this->find(header);
62 
63  if (index != -1) {
64 
65  if (index != previous) {
66 
67  previous = index;
68 
69  JSummaryRouter::update(this->getEntry(index));
70  }
71  }
72  }
73  };
74 }
75 
76 #endif
void update(const JDAQSummaryslice *ps)
Update router.
void update(const JDAQHeader &header)
Update router.
Template definition for direct access of elements in ROOT TChain.
Definition: JTreeScanner.hh:91
File router for fast addressing of summary data.
Router for fast addressing of summary data in JDAQSummaryslice data structure as a function of the op...
Auxiliary class to determine value of DAQ objects.
JSummaryFileRouter(const std::string &file_name, const double rate_Hz=0.0)
Constructor.