ChannelMapService.h
Go to the documentation of this file.
1 #ifndef CHANNELMAPSERVICE__H
2 #define CHANNELMAPSERVICE__H
3 ////////////////////////////////////////////////////////////////////////
4 /// \file ChannelMap_service.cc
5 ///
6 ///
7 /// \author Andrey Sheshukov
8 ////////////////////////////////////////////////////////////////////////
9 
15 #include "fhiclcpp/ParameterSet.h"
20 
22 
23 namespace novaddt{
24  class ChannelMapService;
25  class MapSource;
26 }
27 
29  public:
30  MapSource(fhicl::ParameterSet const& pset);
31  public:
34  int count;
35 };
36 
37 
38 //A service for access to shared noise hit map object
39 
41  public:
43  //get the scoped lock for reading/writing buffer.
45  //get map for reading
46  const novaddt::calib::FDHitMap& GetRMap() const;
47  //get map for writing
48  novaddt::calib::FDHitMap& GetWMap();
49  //append counter - until it reaches counterMax. Then buffers will rotate
50  void addCounter(int n=1){fSharedMapContainer.getData().addCounter(n);}
51  size_t getCounter(){return fSharedMapContainer.getData().getCounter();}
52  size_t getCounterMax(){return fSharedMapContainer.getData().getCounterMax();}
53 
54  void readMapFromFile(const std::string& fname);
55  void saveMapToFile(const std::string& fname);
56  private:
57  void preBeginRun(const art::Run& run);
58  void postEndRun(const art::Run& run);
59  void postProcessEvent(const art::Event& event);
60  void fillMapFromEvent(const art::Event& event, const art::InputTag& product);
61 
62  novaddt::MapSource fMapSource; //< configuration for map source
63  std::string fMapSave; //< filename to save map for each run
67 };
68 
70 #endif
MapSource(fhicl::ParameterSet const &pset)
#define DECLARE_ART_SERVICE(svc, scope)
Definition: ServiceMacros.h:91
novaddt::MapSource fMapSource
Definition: Run.h:31
boost::interprocess::sharable_lock< mutexType > sharableLock
Definition: BufferManager.h:12
novaddt::calib::SharedFDHitMap fSharedMapContainer
Definition: run.py:1
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
T product(std::vector< T > dims)