41 if ((index = name.find(
"BPix")) != string::npos) {
44 idLayer = atoi(name.substr(index+4,1).c_str());
49 else if ((index = name.find(
"FPix")) != string::npos) {
51 idLayer = atoi(name.substr(index+4).c_str());
52 if ( name.find(
"pos") != string::npos ) {
61 else if ((index = name.find(
"TIB")) != string::npos) {
64 idLayer = atoi(name.substr(index+3,1).c_str());
69 else if ((index = name.find(
"TID")) != string::npos) {
71 idLayer = atoi(name.substr(index+3,1).c_str());
72 if ( name.find(
"pos") != string::npos ) {
81 else if ((index = name.find(
"TOB")) != string::npos) {
84 idLayer = atoi(name.substr(index+3,1).c_str());
89 else if ((index = name.find(
"TEC")) != string::npos) {
91 idLayer = atoi(name.substr(index+3,1).c_str());
92 if ( name.find(
"pos") != string::npos ) {
98 return std::make_tuple(subdet, side, idLayer);
103 hitBuilder(cfgLayer.getParameter<
string>(
"TTRHBuilder"))
106 if (cfgLayer.
exists(
"HitProducer")) {
113 LogDebug(
"SeedingLayerSetsBuilder")<<layerName<<
" ready for skipping";
116 LogDebug(
"SeedingLayerSetsBuilder")<<layerName<<
" not skipping ";
120 subdet = std::get<0>(subdetData);
121 side = std::get<1>(subdetData);
122 idLayer = std::get<2>(subdetData);
129 if (cfgLayer.
exists(
"matchedRecHits")) {
132 if (cfgLayer.
exists(
"rphiRecHits")) {
135 if (cfgLayer.
exists(
"stereoRecHits")) {
138 if (cfgLayer.
exists(
"useRingSlector") && cfgLayer.
getParameter<
bool>(
"useRingSlector")) {
139 extr->useRingSelector(cfgLayer.
getParameter<
int>(
"minRing"),
143 extr->useSimpleRphiHitsCleaner(useSimpleRphiHitsCleaner);
145 double minAbsZ = cfgLayer.
exists(
"MinAbsZ") ? cfgLayer.
getParameter<
double>(
"MinAbsZ") : 0.;
147 extr->setMinAbsZ(minAbsZ);
150 bool useProjection = cfgLayer.
exists(
"useProjection") ? cfgLayer.
getParameter<
bool>(
"useProjection") :
false;
152 LogDebug(
"SeedingLayerSetsBuilder")<<layerName<<
" will project partially masked matched rechit";
155 extr->setNoProjection();
167 std::ostringstream
str;
170 str <<
", useRingSelector: ";
172 if((ext = dynamic_cast<HitExtractorSTRP *>(
extractor.get())) &&
175 str <<
"true,"<<
" Rings: ("<< std::get<0>(minMaxRing) <<
","<< std::get<1>(minMaxRing) <<
")";
186 std::vector<std::string> namesPset = cfg.
getParameter<std::vector<std::string> >(
"layerList");
190 typedef std::vector<std::string>::const_iterator IS;
191 typedef std::vector<std::vector<std::string> >::const_iterator
IT;
192 std::ostringstream
str;
200 if(layerNamesInSets.empty())
206 for (IT it = layerNamesInSets.begin(); it != layerNamesInSets.end(); it++) {
208 throw cms::Exception(
"Configuration") <<
"Assuming all SeedingLayerSets to have same number of layers. LayerSet " << (it-layerNamesInSets.begin()) <<
" has " << it->size() <<
" while 0th has " <<
theNumberOfLayersInSet;
211 unsigned short layerIndex = 0;
217 throw cms::Exception(
"Assert") <<
"Too many layers in " << __FILE__ <<
":" << __LINE__ <<
", we may have to enlarge the index type from unsigned short to unsigned int";
243 desc.
add<std::vector<std::string> >(
"layerList", {});
261 string name = nameLayer.substr(0,iEnd);
264 edm::LogError(
"SeedingLayerSetsBuilder") <<
"configuration for layer: "<<nameLayer<<
" not found, job will probably crash!";
270 std::vector<std::vector<std::string> >
result;
271 for (std::vector<std::string>::const_iterator is=namesPSet.begin(); is < namesPSet.end(); ++is) {
272 vector<std::string> layersInSet;
275 while (pos != string::npos ) {
277 string layer = line.substr(0,pos);
278 layersInSet.push_back(layer);
279 line=line.substr(pos+1,string::npos);
281 result.push_back(layersInSet);
297 const std::vector<BarrelDetLayer const*>& bpx = tracker.
barrelLayers();
298 const std::vector<BarrelDetLayer const*>& tib = tracker.
tibLayers();
299 const std::vector<BarrelDetLayer const*>& tob = tracker.
tobLayers();
301 const std::vector<ForwardDetLayer const*>& fpx_pos = tracker.
posForwardLayers();
302 const std::vector<ForwardDetLayer const*>& tid_pos = tracker.
posTidLayers();
303 const std::vector<ForwardDetLayer const*>& tec_pos = tracker.
posTecLayers();
305 const std::vector<ForwardDetLayer const*>& fpx_neg = tracker.
negForwardLayers();
306 const std::vector<ForwardDetLayer const*>& tid_neg = tracker.
negTidLayers();
307 const std::vector<ForwardDetLayer const*>& tec_neg = tracker.
negTecLayers();
310 const DetLayer * detLayer =
nullptr;
311 int index = layer.idLayer-1;
314 detLayer = bpx[
index];
318 detLayer = fpx_pos[
index];
320 detLayer = fpx_neg[
index];
324 detLayer = tib[
index];
328 detLayer = tid_pos[
index];
330 detLayer = tid_neg[
index];
334 detLayer = tob[
index];
338 detLayer = tec_pos[
index];
340 detLayer = tec_neg[
index];
356 std::vector<SeedingLayerId> ret;
359 ret.emplace_back(layer.subdet, layer.side, layer.idLayer);
375 ret->shrink_to_fit();
T getParameter(std::string const &) const
static const HistoName names[]
std::vector< ForwardDetLayer const * > const & posForwardLayers() const
std::vector< LayerSpec > theLayers
SeedingLayerSetsBuilder()=default
edm::ESWatcher< TrackerRecoGeometryRecord > geometryWatcher_
~SeedingLayerSetsBuilder()
LayerSpec(unsigned short index, const std::string &layerName, const edm::ParameterSet &cfgLayer, edm::ConsumesCollector &iC)
void setAllowAnything()
allow any parameter label/value pairs
std::vector< std::string > theLayerNames
std::unique_ptr< ctfseeding::HitExtractor > extractor
bool exists(std::string const ¶meterName) const
checks if a parameter exists
float clusterChargeCut(const edm::ParameterSet &conf, const char *name="clusterChargeCut")
std::vector< BarrelDetLayer const * > const & tobLayers() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< SeedingLayerId > layers() const
std::vector< const TransientTrackingRecHitBuilder * > theTTRHBuilders
GeomDetEnumerators::SubDetector subdet
std::tuple< GeomDetEnumerators::SubDetector, TrackerDetSide, int > SeedingLayerId
void updateEventSetup(const edm::EventSetup &es)
std::vector< ForwardDetLayer const * > const & negForwardLayers() const
std::unique_ptr< SeedingLayerSetsHits > hits(const edm::Event &ev, const edm::EventSetup &es)
std::vector< SeedingLayerSetsHits::LayerSetIndex > theLayerSetIndices
std::vector< LinkConnSpec >::const_iterator IT
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::ESWatcher< TransientRecHitRecord > trhWatcher_
static SeedingLayerId nameToEnumId(const std::string &name)
std::vector< BarrelDetLayer const * > const & tibLayers() const
std::vector< ForwardDetLayer const * > const & posTecLayers() const
std::string pixelHitProducer
unsigned short numberOfLayers() const
std::vector< ForwardDetLayer const * > const & negTidLayers() const
const std::string hitBuilder
bool check(const edm::EventSetup &iSetup)
unsigned short theNumberOfLayersInSet
std::vector< ForwardDetLayer const * > const & posTidLayers() const
std::string print(const std::vector< std::string > &names) const
const unsigned short nameIndex
static void fillDescriptions(edm::ParameterSetDescription &desc)
std::vector< ForwardDetLayer const * > const & negTecLayers() const
T const * product() const
edm::ParameterSet layerConfig(const std::string &nameLayer, const edm::ParameterSet &cfg) const
std::vector< const DetLayer * > theLayerDets
std::vector< BarrelDetLayer const * > const & barrelLayers() const
static std::vector< std::vector< std::string > > layerNamesInSets(const std::vector< std::string > &namesPSet)