AdcRoiToTree.h
Go to the documentation of this file.
1 // AdcRoiToTree.h
2 //
3 // David Adams
4 // February 2021
5 //
6 // Tool to write ADC ROIs to a Root TTree.
7 //
8 // Configuration:
9 // LogLevel - Logging level: 0=none, 1=init, 2=call, ...
10 // OutFile - Output file name.
11 // MetatdataFields - :q
12 //
13 
14 #ifndef AdcRoiToTree_H
15 #define AdcRoiToTree_H
16 
19 #include "fhiclcpp/ParameterSet.h"
20 #include <string>
21 
23 
24 public:
25 
26  using Name = std::string;
27  using NameVector = std::vector<Name>;
28  using Index = unsigned int;
29  using IndexVector = std::vector<Index>;
30  using FloatVector = std::vector<float>;
31 
32  struct TreeData {
33  Index event =0;
34  Index run =0;
38  Index nroi =0;
44  };
45 
46  // Ctor.
48 
49  // Dtor.
50  ~AdcRoiToTree() override;
51 
52  // AdcChannelTool methods.
53  //DataMap view(const AdcChannelData& acd) const override;
54  DataMap viewMap(const AdcChannelDataMap& acds) const override;
55  bool updateWithView() const override { return true; }
56 
57  // Helpers.
58  Name treeName() const { return "adcrois"; }
59 
60 private:
61 
62  // Configuration data.
66 
67 };
68 
69 
70 #endif
unsigned int Index
std::string string
Definition: nybbler.cc:12
Name treeName() const
Definition: AdcRoiToTree.h:58
NameVector m_MetadataFields
Definition: AdcRoiToTree.h:65
std::vector< Index > IndexVector
Definition: AdcRoiToTree.h:29
std::vector< float > FloatVector
Definition: AdcRoiToTree.h:30
static constexpr double ps
Definition: Units.h:99
std::string Name
Definition: AdcRoiToTree.h:26
~AdcRoiToTree() override
std::map< AdcChannel, AdcChannelData > AdcChannelDataMap
DataMap viewMap(const AdcChannelDataMap &acds) const override
bool updateWithView() const override
Definition: AdcRoiToTree.h:55
std::vector< Name > NameVector
Definition: AdcRoiToTree.h:27
AdcRoiToTree(fhicl::ParameterSet const &ps)