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 { class Event; class EventSetup; class ConsumesCollector;}
19 namespace ctfseeding {class HitExtractor; }
23 class DetLayer;
24 
26 
27 public:
28  using SeedingLayerId = std::tuple<GeomDetEnumerators::SubDetector, TrackerDetSide, int>;
29 
30  SeedingLayerSetsBuilder() = default;
31  SeedingLayerSetsBuilder(const edm::ParameterSet & cfg, edm::ConsumesCollector& iC, const edm::InputTag& fastsimHitTag); //FastSim specific constructor
35 
37 
38  unsigned short numberOfLayers() const { return theLayers.size(); }
39  unsigned short numberOfLayerSets() const { return theNumberOfLayersInSet > 0 ? theLayerSetIndices.size()/theNumberOfLayersInSet : 0; }
40  std::vector<SeedingLayerId> layers() const; // please call at most once per job per client
41  SeedingLayerSetsLooper seedingLayerSetsLooper() const { return SeedingLayerSetsLooper(theNumberOfLayersInSet, &theLayerSetIndices); }
42 
43  const std::vector<SeedingLayerSetsHits::LayerSetIndex>& layerSetIndices() const { return theLayerSetIndices; }
44 
45  std::unique_ptr<SeedingLayerSetsHits> hits(const edm::Event& ev, const edm::EventSetup& es);
46  //new function for FastSim only
47  std::unique_ptr<SeedingLayerSetsHits> makeSeedingLayerSetsHitsforFastSim(const edm::Event& ev, const edm::EventSetup& es);
48 
49  static SeedingLayerId nameToEnumId(const std::string& name);
50  static std::vector<std::vector<std::string> > layerNamesInSets(const std::vector<std::string> & namesPSet) ;
51 
52 private:
53  edm::ParameterSet layerConfig(const std::string & nameLayer,const edm::ParameterSet& cfg) const;
54  void updateEventSetup(const edm::EventSetup& es);
55 
59  struct LayerSpec {
60  LayerSpec(unsigned short index, const std::string& layerName, const edm::ParameterSet& cfgLayer, edm::ConsumesCollector& iC);
61  ~LayerSpec() = default;
62  LayerSpec(const LayerSpec&) = delete;
63  LayerSpec& operator=(const LayerSpec&) = delete;
64  LayerSpec(LayerSpec &&) = default;
65  LayerSpec& operator=(LayerSpec &&) = default;
66  const unsigned short nameIndex;
70 
73  int idLayer;
74  std::unique_ptr<ctfseeding::HitExtractor> extractor;
75 
76  std::string print(const std::vector<std::string>& names) const;
77  };
78  unsigned short theNumberOfLayersInSet;
79  std::vector<SeedingLayerSetsHits::LayerSetIndex> theLayerSetIndices; // indices to theLayers to form the layer sets
80  std::vector<std::string> theLayerNames;
81  std::vector<const DetLayer *> theLayerDets;
82  std::vector<const TransientTrackingRecHitBuilder *> theTTRHBuilders;
83  std::vector<LayerSpec> theLayers;
84 };
85 
86 #endif
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
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:65
const std::string names[nVars_]
std::vector< const TransientTrackingRecHitBuilder * > theTTRHBuilders
GeomDetEnumerators::SubDetector subdet
std::tuple< GeomDetEnumerators::SubDetector, TrackerDetSide, int > SeedingLayerId
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< SeedingLayerSetsHits::LayerSetIndex > theLayerSetIndices
unsigned short numberOfLayerSets() const
edm::ESWatcher< TransientRecHitRecord > trhWatcher_
const std::vector< SeedingLayerSetsHits::LayerSetIndex > & layerSetIndices() const
unsigned short numberOfLayers() const
HLT enums.
SeedingLayerSetsLooper seedingLayerSetsLooper() const
std::vector< const DetLayer * > theLayerDets