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 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_unique<HitExtractorPIX>(side, idLayer, pixelHitProducer, iC);
127  }
128  else if(subdet != GeomDetEnumerators::invalidDet) { // strip
129  auto extr = std::make_unique<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
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:511
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 166 of file SeedingLayerSetsBuilder.cc.

References extractor, ctfseeding::HitExtractorSTRP::getMinMaxRing(), hitBuilder, nameIndex, 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 }
std::unique_ptr< ctfseeding::HitExtractor > extractor
const std::string names[nVars_]
void useRingSelector(int minRing, int maxRing)
Definition: memstream.h:15
#define str(s)
std::tuple< int, int > getMinMaxRing() const

Member Data Documentation

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

Definition at line 74 of file SeedingLayerSetsBuilder.h.

Referenced by LayerSpec(), and print().

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

Definition at line 69 of file SeedingLayerSetsBuilder.h.

Referenced by print().

int SeedingLayerSetsBuilder::LayerSpec::idLayer

Definition at line 73 of file SeedingLayerSetsBuilder.h.

Referenced by LayerSpec().

const unsigned short SeedingLayerSetsBuilder::LayerSpec::nameIndex

Definition at line 66 of file SeedingLayerSetsBuilder.h.

Referenced by print().

std::string SeedingLayerSetsBuilder::LayerSpec::pixelHitProducer

Definition at line 67 of file SeedingLayerSetsBuilder.h.

Referenced by LayerSpec().

TrackerDetSide SeedingLayerSetsBuilder::LayerSpec::side

Definition at line 72 of file SeedingLayerSetsBuilder.h.

Referenced by LayerSpec().

GeomDetEnumerators::SubDetector SeedingLayerSetsBuilder::LayerSpec::subdet

Definition at line 71 of file SeedingLayerSetsBuilder.h.

Referenced by LayerSpec().

bool SeedingLayerSetsBuilder::LayerSpec::usePixelHitProducer

Definition at line 68 of file SeedingLayerSetsBuilder.h.

Referenced by LayerSpec().