test
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 105 of file SeedingLayerSetsBuilder.cc.

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

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

Definition at line 168 of file SeedingLayerSetsBuilder.cc.

168 {}

Member Function Documentation

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

Definition at line 170 of file SeedingLayerSetsBuilder.cc.

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

171 {
172  std::ostringstream str;
173  str << "Layer="<<names[nameIndex]<<", hitBldr: "<<hitBuilder;
174 
175  str << ", useRingSelector: ";
176  HitExtractorSTRP *ext = nullptr;
177  if((ext = dynamic_cast<HitExtractorSTRP *>(extractor.get())) &&
178  ext->useRingSelector()) {
179  auto minMaxRing = ext->getMinMaxRing();
180  str <<"true,"<<" Rings: ("<< std::get<0>(minMaxRing) <<","<< std::get<1>(minMaxRing) <<")";
181  } else str<<"false";
182 
183  return str.str();
184 }
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().