CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
SeedingLayerSetsBuilder::LayerSpec Struct Reference

Public Member Functions

 LayerSpec (unsigned short index, const std::string &layerName, const edm::ParameterSet &cfgLayer, edm::ConsumesCollector &iC)
 
std::string print (const std::vector< std::string > &names) const
 
 ~LayerSpec ()
 

Public Attributes

std::shared_ptr
< ctfseeding::HitExtractor
extractor
 
const std::string hitBuilder
 
int idLayer
 
const unsigned short nameIndex
 
std::string pixelHitProducer
 
ctfseeding::SeedingLayer::Side side
 
GeomDetEnumerators::SubDetector subdet
 
bool usePixelHitProducer
 

Detailed Description

Definition at line 51 of file SeedingLayerSetsBuilder.h.

Constructor & Destructor Documentation

SeedingLayerSetsBuilder::LayerSpec::LayerSpec ( unsigned short  index,
const std::string &  layerName,
const edm::ParameterSet cfgLayer,
edm::ConsumesCollector iC 
)

Definition at line 103 of file SeedingLayerSetsBuilder.cc.

References edm::ParameterSet::exists(), extractor, edm::ParameterSet::getParameter(), idLayer, GeomDetEnumerators::invalidDet, LogDebug, GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, pixelHitProducer, side, subdet, usePixelHitProducer, and PixelLessLayerPairs4PixelLessTracking_cfi::useSimpleRphiHitsCleaner.

103  :
104  nameIndex(index),
105  hitBuilder(cfgLayer.getParameter<string>("TTRHBuilder"))
106 {
107  usePixelHitProducer = false;
108  if (cfgLayer.exists("HitProducer")) {
109  pixelHitProducer = cfgLayer.getParameter<string>("HitProducer");
110  usePixelHitProducer = true;
111  }
112 
113  bool skipClusters = cfgLayer.exists("skipClusters");
114  if (skipClusters) {
115  LogDebug("SeedingLayerSetsBuilder")<<layerName<<" ready for skipping";
116  }
117  else{
118  LogDebug("SeedingLayerSetsBuilder")<<layerName<<" not skipping ";
119  }
120 
121  auto subdetData = nameToEnumId(layerName);
122  subdet = std::get<0>(subdetData);
123  side = std::get<1>(subdetData);
124  idLayer = std::get<2>(subdetData);
127  extractor = std::make_shared<HitExtractorPIX>(side, idLayer, pixelHitProducer, iC);
128  }
129  else if(subdet != GeomDetEnumerators::invalidDet) { // strip
130  std::shared_ptr<HitExtractorSTRP> extr = std::make_shared<HitExtractorSTRP>(subdet, side, idLayer);
131  if (cfgLayer.exists("matchedRecHits")) {
132  extr->useMatchedHits(cfgLayer.getParameter<edm::InputTag>("matchedRecHits"), iC);
133  }
134  if (cfgLayer.exists("rphiRecHits")) {
135  extr->useRPhiHits(cfgLayer.getParameter<edm::InputTag>("rphiRecHits"), iC);
136  }
137  if (cfgLayer.exists("stereoRecHits")) {
138  extr->useStereoHits(cfgLayer.getParameter<edm::InputTag>("stereoRecHits"), iC);
139  }
140  if (cfgLayer.exists("useRingSlector") && cfgLayer.getParameter<bool>("useRingSlector")) {
141  extr->useRingSelector(cfgLayer.getParameter<int>("minRing"),
142  cfgLayer.getParameter<int>("maxRing"));
143  }
144  bool useSimpleRphiHitsCleaner = cfgLayer.exists("useSimpleRphiHitsCleaner") ? cfgLayer.getParameter<bool>("useSimpleRphiHitsCleaner") : true;
145  extr->useSimpleRphiHitsCleaner(useSimpleRphiHitsCleaner);
146 
147  double minAbsZ = cfgLayer.exists("MinAbsZ") ? cfgLayer.getParameter<double>("MinAbsZ") : 0.;
148  if(minAbsZ > 0.) {
149  extr->setMinAbsZ(minAbsZ);
150  }
151  if(skipClusters) {
152  bool useProjection = cfgLayer.exists("useProjection") ? cfgLayer.getParameter<bool>("useProjection") : false;
153  if(useProjection) {
154  LogDebug("SeedingLayerSetsBuilder")<<layerName<<" will project partially masked matched rechit";
155  }
156  else {
157  extr->setNoProjection();
158  }
159  }
160  extractor = std::move(extr);
161  }
162  if(extractor && skipClusters) {
163  extractor->useSkipClusters(cfgLayer.getParameter<edm::InputTag>("skipClusters"), iC);
164  }
165 }
#define LogDebug(id)
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
GeomDetEnumerators::SubDetector subdet
std::shared_ptr< ctfseeding::HitExtractor > extractor
ctfseeding::SeedingLayer::Side side
SeedingLayerSetsBuilder::LayerSpec::~LayerSpec ( )

Definition at line 166 of file SeedingLayerSetsBuilder.cc.

166 {}

Member Function Documentation

std::string SeedingLayerSetsBuilder::LayerSpec::print ( const std::vector< std::string > &  names) const

Definition at line 168 of file SeedingLayerSetsBuilder.cc.

References ctfseeding::HitExtractorSTRP::getMinMaxRing(), and ctfseeding::HitExtractorSTRP::useRingSelector().

169 {
170  std::ostringstream str;
171  str << "Layer="<<names[nameIndex]<<", hitBldr: "<<hitBuilder;
172 
173  str << ", useRingSelector: ";
174  HitExtractorSTRP *ext = nullptr;
175  if((ext = dynamic_cast<HitExtractorSTRP *>(extractor.get())) &&
176  ext->useRingSelector()) {
177  auto minMaxRing = ext->getMinMaxRing();
178  str <<"true,"<<" Rings: ("<< std::get<0>(minMaxRing) <<","<< std::get<1>(minMaxRing) <<")";
179  } else str<<"false";
180 
181  return str.str();
182 }
static const HistoName names[]
std::shared_ptr< ctfseeding::HitExtractor > extractor
void useRingSelector(int minRing, int maxRing)
std::tuple< int, int > getMinMaxRing() const

Member Data Documentation

std::shared_ptr<ctfseeding::HitExtractor> SeedingLayerSetsBuilder::LayerSpec::extractor

Definition at line 62 of file SeedingLayerSetsBuilder.h.

Referenced by SeedingLayerSetsBuilder::layers(), and LayerSpec().

const std::string SeedingLayerSetsBuilder::LayerSpec::hitBuilder

Definition at line 57 of file SeedingLayerSetsBuilder.h.

Referenced by SeedingLayerSetsBuilder::updateEventSetup().

int SeedingLayerSetsBuilder::LayerSpec::idLayer
const unsigned short SeedingLayerSetsBuilder::LayerSpec::nameIndex

Definition at line 54 of file SeedingLayerSetsBuilder.h.

Referenced by SeedingLayerSetsBuilder::updateEventSetup().

std::string SeedingLayerSetsBuilder::LayerSpec::pixelHitProducer

Definition at line 55 of file SeedingLayerSetsBuilder.h.

Referenced by LayerSpec().

ctfseeding::SeedingLayer::Side SeedingLayerSetsBuilder::LayerSpec::side
GeomDetEnumerators::SubDetector SeedingLayerSetsBuilder::LayerSpec::subdet
bool SeedingLayerSetsBuilder::LayerSpec::usePixelHitProducer

Definition at line 56 of file SeedingLayerSetsBuilder.h.

Referenced by LayerSpec().