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 53 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 101 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.

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

164 {}

Member Function Documentation

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

Definition at line 166 of file SeedingLayerSetsBuilder.cc.

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

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

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

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

Definition at line 59 of file SeedingLayerSetsBuilder.h.

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

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

Definition at line 56 of file SeedingLayerSetsBuilder.h.

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

std::string SeedingLayerSetsBuilder::LayerSpec::pixelHitProducer

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

Referenced by LayerSpec().