SliceNavigator.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // \file SliceNavigator_service.cc
3 // \brief Look up products dependent on the current slice
4 // \author Christopher Backhouse - bckhouse@caltech.edu
5 ////////////////////////////////////////////////////////////////////////
6 
7 #ifndef EVD_SLICENAVIGATOR_H
8 #define EVD_SLICENAVIGATOR_H
9 
10 #include <vector>
11 #include <string>
12 
13 #include "fhiclcpp/ParameterSet.h"
17 
18 #include "RecoBase/Cluster.h"
19 
20 namespace evd
21 {
22  /// Look up products dependent on the current slice
24  {
25  public:
26  explicit SliceNavigator(const fhicl::ParameterSet& pset,
29 
30  void reconfigure(const fhicl::ParameterSet& pset) override;
31  void preBeginRun(art::Run const & r);
32  void postProcessEvent(const art::Event& evt);
33 
34  template<class T> size_t
35  GetProducts(const art::Event& evt,
36  const std::string& which,
37  const std::string& instance,
38  std::vector<const T*>& prods);
39 
40  template<class T> size_t
41  GetProducts(const art::Event& evt,
42  const std::string& whichTrack,
43  const std::string& whichMichel,
44  const std::string& instance,
45  std::vector<const T*>& prods);
46 
47  bool FullEventMode() const;
48  void SetFullEventMode(bool mode);
49 
50  void Previous();
51  void Next();
52  int CurrentSlice() const;
53  int CurrentSliceIndex() const;
54 
55  void SetCurrentSlice(int slice);
56  int MaxSlice() const;
57  std::vector<const rb::Cluster*> SlicesToNavigate( const art::Event& evt);
58 
59  void GetBounds(const art::Event& evt,
60  double& xmin, double& xmax,
61  double& ymin, double& ymax,
62  double& zmin, double& zmax,
63  double trimfrac = 0);
64 
65  void GetBox(const art::Event& evt,
66  double& xmin, double& xmax,
67  double& ymin, double& ymax,
68  double& zmin, double& zmax,
69  double trimfrac = 0);
70 
71  bool DimHits() const {return fDimHits;}
72  bool DimOthers() const {return fDimOthers;}
73 
74  int fAutoAdvanceInterval; ///< Wait time in milliseconds
75  std::string fAutoPrintPattern; ///< Pattern for constructing filename
76  int fAutoPrintMax; ///< How many events to print (zero = disable printing)
77 
79 
80  protected:
81  template<class T> size_t
82  GetProductsImpl(const art::Event& evt,
83  const std::string& which,
84  const std::string& instance,
85  std::vector<const T*>& prods);
86 
87  template<class T> size_t
89  const std::string& which,
90  const std::string& instance,
91  std::vector<const T*>& prods);
92 
93  template<class T> size_t
95  const std::string& which,
96  const std::string& instance,
97  std::vector<const T*>& prods);
98 
100  std::string & inst);
101 
103  const std::string &toReplace,
104  const std::string &replaceWith);
105 
106  int fRun;
107 
108  bool fFilterResults; ///< Only navigate slices that aren't filtered out
109  bool fDimHits;
116  int fCurrentSlice; ///< Index into \ref fSlicesToNavigate
118  std::vector<int> fSlicesToNavigate;
119 
120  std::vector<art::Ptr<rb::Cluster>> fSlices;
122 
123  int fInitialSlice; ///< -1 afterwards
124  };
125 }
126 
128 
129 #endif
130 ////////////////////////////////////////////////////////////////////////
int fAutoPrintMax
How many events to print (zero = disable printing)
void ParseModuleInstanceString(std::string &mod, std::string &inst)
std::map< std::string, double > xmax
void GetBounds(const art::Event &evt, double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax, double trimfrac=0)
std::vector< art::Ptr< rb::Cluster > > fSlices
Look up products dependent on the current slice.
std::string fSliceLabel
bool DimOthers() const
void postProcessEvent(const art::Event &evt)
void GetBox(const art::Event &evt, double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax, double trimfrac=0)
int fInitialSlice
-1 afterwards
#define DECLARE_ART_SERVICE(svc, scope)
Definition: ServiceMacros.h:91
size_t GetProducts(const art::Event &evt, const std::string &which, const std::string &instance, std::vector< const T * > &prods)
Definition: Run.h:31
std::string fCellHitLabel
Double_t ymax
Definition: plot.C:25
const XML_Char * s
Definition: expat.h:262
nova event display
size_t GetProductsImplFull(const art::Event &evt, const std::string &which, const std::string &instance, std::vector< const T * > &prods)
bool DimHits() const
std::vector< int > fSlicesToNavigate
int evt
std::string fAutoPrintPattern
Pattern for constructing filename.
int fCurrentSlice
Index into fSlicesToNavigate.
Interface class to services that are intended to be reconfigurable through the event display...
int fAutoAdvanceInterval
Wait time in milliseconds.
std::string stringReplace(std::string &s, const std::string &toReplace, const std::string &replaceWith)
void SetFullEventMode(bool mode)
art::PtrVector< rb::CellHit > fAllHits
size_t GetProductsImplPart(const art::Event &evt, const std::string &which, const std::string &instance, std::vector< const T * > &prods)
bool fFilterResults
Only navigate slices that aren&#39;t filtered out.
void preBeginRun(art::Run const &r)
TRandom3 r(0)
Double_t ymin
Definition: plot.C:24
size_t GetProductsImpl(const art::Event &evt, const std::string &which, const std::string &instance, std::vector< const T * > &prods)
std::string fSliceInstance
std::string fCellHitInstance
std::vector< const rb::Cluster * > SlicesToNavigate(const art::Event &evt)
void reconfigure(const fhicl::ParameterSet &pset) override
SliceNavigator(const fhicl::ParameterSet &pset, art::ActivityRegistry &reg)
enum BeamMode string