CMS 3D CMS Logo

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::HitExtractorextractor
 
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 59 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 102 of file SeedingLayerSetsBuilder.cc.

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

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

Definition at line 165 of file SeedingLayerSetsBuilder.cc.

165 {}

Member Function Documentation

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

Definition at line 167 of file SeedingLayerSetsBuilder.cc.

References extractor, ctfseeding::HitExtractorSTRP::getMinMaxRing(), hitBuilder, nameIndex, harvestTrackValidationPlots::str, and ctfseeding::HitExtractorSTRP::useRingSelector().

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

Member Data Documentation

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

Definition at line 70 of file SeedingLayerSetsBuilder.h.

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

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

Definition at line 65 of file SeedingLayerSetsBuilder.h.

Referenced by print(), and SeedingLayerSetsBuilder::updateEventSetup().

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

Definition at line 62 of file SeedingLayerSetsBuilder.h.

Referenced by print(), and SeedingLayerSetsBuilder::updateEventSetup().

std::string SeedingLayerSetsBuilder::LayerSpec::pixelHitProducer

Definition at line 63 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 64 of file SeedingLayerSetsBuilder.h.

Referenced by LayerSpec().