CMS 3D CMS Logo

SeedingLayerSetsBuilder.h
Go to the documentation of this file.
1 #ifndef TkSeedingLayers_SeedingLayerSetsBuilder_H
2 #define TkSeedingLayers_SeedingLayerSetsBuilder_H
3 
6 
16 #include <string>
17 #include <vector>
18 namespace edm {
19  class Event;
20  class EventSetup;
21  class ConsumesCollector;
22 } // namespace edm
23 namespace ctfseeding {
24  class HitExtractor;
25 }
29 class DetLayer;
30 
32 public:
33  using SeedingLayerId = std::tuple<GeomDetEnumerators::SubDetector, TrackerDetSide, int>;
34 
35  SeedingLayerSetsBuilder() = default;
38  const edm::InputTag& fastsimHitTag); //FastSim specific constructor
42 
44 
45  unsigned short numberOfLayers() const { return theLayers.size(); }
46  unsigned short numberOfLayerSets() const {
47  return theNumberOfLayersInSet > 0 ? theLayerSetIndices.size() / theNumberOfLayersInSet : 0;
48  }
49  std::vector<SeedingLayerId> layers() const; // please call at most once per job per client
51  return SeedingLayerSetsLooper(theNumberOfLayersInSet, &theLayerSetIndices);
52  }
53 
54  const std::vector<SeedingLayerSetsHits::LayerSetIndex>& layerSetIndices() const { return theLayerSetIndices; }
55 
56  std::unique_ptr<SeedingLayerSetsHits> hits(const edm::Event& ev, const edm::EventSetup& es);
57  //new function for FastSim only
58  std::unique_ptr<SeedingLayerSetsHits> makeSeedingLayerSetsHitsforFastSim(const edm::Event& ev,
59  const edm::EventSetup& es);
60 
61  static SeedingLayerId nameToEnumId(const std::string& name);
62  static std::vector<std::vector<std::string> > layerNamesInSets(const std::vector<std::string>& namesPSet);
63 
64 private:
65  edm::ParameterSet layerConfig(const std::string& nameLayer, const edm::ParameterSet& cfg) const;
66  void updateEventSetup(const edm::EventSetup& es);
67 
71  struct LayerSpec {
72  LayerSpec(unsigned short index,
73  const std::string& layerName,
74  const edm::ParameterSet& cfgLayer,
76  ~LayerSpec() = default;
77  LayerSpec(const LayerSpec&) = delete;
78  LayerSpec& operator=(const LayerSpec&) = delete;
79  LayerSpec(LayerSpec&&) = default;
80  LayerSpec& operator=(LayerSpec&&) = delete;
81  const unsigned short nameIndex;
85 
88  int idLayer;
89  std::unique_ptr<ctfseeding::HitExtractor> extractor;
90 
91  std::string print(const std::vector<std::string>& names) const;
92  };
93  unsigned short theNumberOfLayersInSet;
94  std::vector<SeedingLayerSetsHits::LayerSetIndex> theLayerSetIndices; // indices to theLayers to form the layer sets
95  std::vector<std::string> theLayerNames;
96  std::vector<const DetLayer*> theLayerDets;
97  std::vector<const TransientTrackingRecHitBuilder*> theTTRHBuilders;
98  std::vector<LayerSpec> theLayers;
99 };
100 
101 #endif
std::vector< const DetLayer * > theLayerDets
std::vector< LayerSpec > theLayers
edm::ESWatcher< TrackerRecoGeometryRecord > geometryWatcher_
edm::EDGetTokenT< FastTrackerRecHitCollection > fastSimrecHitsToken_
std::vector< std::string > theLayerNames
TrackerDetSide
Definition: TrackerDetSide.h:4
std::unique_ptr< ctfseeding::HitExtractor > extractor
bool ev
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
const std::string names[nVars_]
GeomDetEnumerators::SubDetector subdet
std::tuple< GeomDetEnumerators::SubDetector, TrackerDetSide, int > SeedingLayerId
std::vector< SeedingLayerSetsHits::LayerSetIndex > theLayerSetIndices
unsigned short numberOfLayerSets() const
std::vector< const TransientTrackingRecHitBuilder * > theTTRHBuilders
edm::ESWatcher< TransientRecHitRecord > trhWatcher_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const std::vector< SeedingLayerSetsHits::LayerSetIndex > & layerSetIndices() const
unsigned short numberOfLayers() const
HLT enums.
SeedingLayerSetsLooper seedingLayerSetsLooper() const