All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ProviderManager.hh
Go to the documentation of this file.
1 #ifndef __sbnanalysis_core_ProviderManager__
2 #define __sbnanalysis_core_ProviderManager__
3 
4 #include <string>
5 #include <memory>
6 #include <vector>
7 #include "core/Experiment.hh"
8 
9 #include "gallery/Event.h"
10 
12 
13 namespace geo {
14  class GeometryCore;
15  class AuxDetGeometryCore;
16 }
17 
18 namespace detinfo {
19  class LArPropertiesStandard;
20  class DetectorClocksStandard;
21  class DetectorPropertiesStandard;
22 }
23 
24 namespace fhicl {
25  class ParameterSet;
26 }
27 
28 namespace cheat {
29  class BackTracker;
30  class ParticleInventory;
31  class PhotonBackTracker;
32 }
33 
34 namespace core {
35 
36 /**
37  * \class ProviderManager
38  * \brief Interface to LArSoft services
39  *
40  * The ProviderManager handles loading and provides access to LArSoft services:
41  *
42  * * Geometry
43  * * LArProperties
44  * * DetectorClocks
45  * * DetectorProperties
46  *
47  * \param det The detector ID (as defined in the Detector enum)
48  * \param fcl An optional FHiCL file for service settings
49  */
51 public:
52  ProviderManager(Experiment det, std::string fcl="", bool setup_event_services=true);
53 
54  void SetupServices(gallery::Event &ev);
55 
57  return fGeometryProvider.get();
58  }
59 
61  return fAuxDetGeometryProvider.get();
62  }
63 
65  return fLArPropertiesProvider.get();
66  }
67 
69  return fDetectorClocksProvider.get();
70  }
71 
73  return fDetectorPropertiesProvider.get();
74  }
75 
77  return fBackTrackerProvider.get();
78  }
79 
81  return fParticleInventoryProvider.get();
82  }
83 
85  return fPhotonBackTrackerProvider.get();
86  }
87 
88  static std::vector<Experiment> GetValidExperiments();
89 
90 private:
91  fhicl::ParameterSet* config;
92  std::unique_ptr<geo::GeometryCore> fGeometryProvider;
93  std::unique_ptr<geo::AuxDetGeometryCore> fAuxDetGeometryProvider;
94  std::unique_ptr<detinfo::LArPropertiesStandard> fLArPropertiesProvider;
95  std::unique_ptr<detinfo::DetectorClocksStandard> fDetectorClocksProvider;
96  std::unique_ptr<detinfo::DetectorPropertiesStandard> fDetectorPropertiesProvider;
97  std::unique_ptr<cheat::BackTracker> fBackTrackerProvider;
98  std::unique_ptr<cheat::ParticleInventory> fParticleInventoryProvider;
99  std::unique_ptr<cheat::PhotonBackTracker> fPhotonBackTrackerProvider;
100 };
101 
102 } // namespace core
103 
104 #endif // __sbnanalysis_core_ProviderManager__
105 
process_name standard_reco_uboone fcl
std::unique_ptr< cheat::PhotonBackTracker > fPhotonBackTrackerProvider
Experiment
Definition: Experiment.hh:13
const detinfo::DetectorPropertiesStandard * GetDetectorPropertiesProvider() const
std::unique_ptr< detinfo::DetectorClocksStandard > fDetectorClocksProvider
const geo::AuxDetGeometryCore * GetAuxDetGeometryProvider() const
fhicl::ParameterSet * config
std::unique_ptr< geo::GeometryCore > fGeometryProvider
std::unique_ptr< cheat::ParticleInventory > fParticleInventoryProvider
cheat::BackTracker * GetBackTrackerProvider() const
Description of geometry of one set of auxiliary detectors.
const geo::GeometryCore * GetGeometryProvider() const
cheat::ParticleInventory * GetParticleInventoryProvider() const
std::unique_ptr< geo::AuxDetGeometryCore > fAuxDetGeometryProvider
Interface to LArSoft services.
ProviderManager(Experiment det, std::string fcl="", bool setup_event_services=true)
const detinfo::LArPropertiesStandard * GetLArPropertiesProvider() const
Description of geometry of one entire detector.
const detinfo::DetectorClocksStandard * GetDetectorClocksProvider() const
std::unique_ptr< cheat::BackTracker > fBackTrackerProvider
std::unique_ptr< detinfo::LArPropertiesStandard > fLArPropertiesProvider
Properties related to liquid argon environment in the detector.
static std::vector< Experiment > GetValidExperiments()
Implementation of detinfo::DetectorClocks interface with fixed settings from configuration.
cheat::PhotonBackTracker * GetPhotonBackTrackerProvider() const
void SetupServices(gallery::Event &ev)
std::unique_ptr< detinfo::DetectorPropertiesStandard > fDetectorPropertiesProvider