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)
 
 LayerSpec (const LayerSpec &)=delete
 
 LayerSpec (LayerSpec &&)=default
 
LayerSpecoperator= (const LayerSpec &)=delete
 
LayerSpecoperator= (LayerSpec &&)=default
 
std::string print (const std::vector< std::string > &names) const
 
 ~LayerSpec ()=default
 

Public Attributes

std::unique_ptr< ctfseeding::HitExtractorextractor
 
const std::string hitBuilder
 
int idLayer
 
const unsigned short nameIndex
 
std::string pixelHitProducer
 
TrackerDetSide side
 
GeomDetEnumerators::SubDetector subdet
 
bool usePixelHitProducer
 

Detailed Description

Definition at line 55 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_unique<HitExtractorPIX>(side, idLayer, pixelHitProducer, iC);
126  }
127  else if(subdet != GeomDetEnumerators::invalidDet) { // strip
128  auto extr = std::make_unique<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
std::unique_ptr< ctfseeding::HitExtractor > extractor
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
static SeedingLayerId nameToEnumId(const std::string &name)
def move(src, dest)
Definition: eostools.py:510
SeedingLayerSetsBuilder::LayerSpec::~LayerSpec ( )
default
SeedingLayerSetsBuilder::LayerSpec::LayerSpec ( const LayerSpec )
delete
SeedingLayerSetsBuilder::LayerSpec::LayerSpec ( LayerSpec &&  )
default

Member Function Documentation

LayerSpec& SeedingLayerSetsBuilder::LayerSpec::operator= ( const LayerSpec )
delete
LayerSpec& SeedingLayerSetsBuilder::LayerSpec::operator= ( LayerSpec &&  )
default
std::string SeedingLayerSetsBuilder::LayerSpec::print ( const std::vector< std::string > &  names) const

Definition at line 165 of file SeedingLayerSetsBuilder.cc.

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

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

Member Data Documentation

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

Definition at line 70 of file SeedingLayerSetsBuilder.h.

Referenced by LayerSpec(), and print().

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

Definition at line 65 of file SeedingLayerSetsBuilder.h.

Referenced by print().

int SeedingLayerSetsBuilder::LayerSpec::idLayer

Definition at line 69 of file SeedingLayerSetsBuilder.h.

Referenced by LayerSpec().

const unsigned short SeedingLayerSetsBuilder::LayerSpec::nameIndex

Definition at line 62 of file SeedingLayerSetsBuilder.h.

Referenced by print().

std::string SeedingLayerSetsBuilder::LayerSpec::pixelHitProducer

Definition at line 63 of file SeedingLayerSetsBuilder.h.

Referenced by LayerSpec().

TrackerDetSide SeedingLayerSetsBuilder::LayerSpec::side

Definition at line 68 of file SeedingLayerSetsBuilder.h.

Referenced by LayerSpec().

GeomDetEnumerators::SubDetector SeedingLayerSetsBuilder::LayerSpec::subdet

Definition at line 67 of file SeedingLayerSetsBuilder.h.

Referenced by LayerSpec().

bool SeedingLayerSetsBuilder::LayerSpec::usePixelHitProducer

Definition at line 64 of file SeedingLayerSetsBuilder.h.

Referenced by LayerSpec().