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);
105 : nameIndex(index), hitBuilder(cfgLayer.getParameter<
string>(
"TTRHBuilder")) {
107 if (cfgLayer.
exists(
"HitProducer")) {
114 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);
127 if (cfgLayer.
exists(
"matchedRecHits")) {
130 if (cfgLayer.
exists(
"rphiRecHits")) {
133 if (cfgLayer.
exists(
"stereoRecHits")) {
136 if (cfgLayer.
exists(
"useRingSlector") && cfgLayer.
getParameter<
bool>(
"useRingSlector")) {
140 cfgLayer.
exists(
"useSimpleRphiHitsCleaner") ? cfgLayer.
getParameter<
bool>(
"useSimpleRphiHitsCleaner") :
true;
141 extr->useSimpleRphiHitsCleaner(useSimpleRphiHitsCleaner);
143 double minAbsZ = cfgLayer.
exists(
"MinAbsZ") ? cfgLayer.
getParameter<
double>(
"MinAbsZ") : 0.;
145 extr->setMinAbsZ(minAbsZ);
148 bool useProjection = cfgLayer.
exists(
"useProjection") ? cfgLayer.
getParameter<
bool>(
"useProjection") :
false;
150 LogDebug(
"SeedingLayerSetsBuilder") << layerName <<
" will project partially masked matched rechit";
152 extr->setNoProjection();
163 std::ostringstream
str;
166 str <<
", useRingSelector: ";
171 <<
" Rings: (" << std::get<0>(minMaxRing) <<
"," << std::get<1>(minMaxRing) <<
")";
187 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())
205 for (IT it = layerNamesInSets.begin(); it != layerNamesInSets.end(); it++) {
208 <<
"Assuming all SeedingLayerSets to have same number of layers. LayerSet " << (it - layerNamesInSets.begin())
212 unsigned short layerIndex = 0;
218 <<
"Too many layers in " << __FILE__ <<
":" << __LINE__
219 <<
", we may have to enlarge the index type from unsigned short to unsigned int";
245 desc.
add<std::vector<std::string> >(
"layerList", {});
263 string name = nameLayer.substr(0, iEnd);
268 <<
"configuration for layer: " << nameLayer <<
" not found, job will probably crash!";
273 std::vector<std::vector<std::string> >
result;
274 for (std::vector<std::string>::const_iterator is = namesPSet.begin(); is < namesPSet.end(); ++is) {
275 vector<std::string> layersInSet;
278 while (pos != string::npos) {
279 pos = line.find(
"+");
280 string layer = line.substr(0, pos);
281 layersInSet.push_back(layer);
282 line = line.substr(pos + 1, string::npos);
284 result.push_back(layersInSet);
300 const std::vector<BarrelDetLayer const*>& bpx = tracker.
barrelLayers();
301 const std::vector<BarrelDetLayer const*>& tib = tracker.
tibLayers();
302 const std::vector<BarrelDetLayer const*>& tob = tracker.
tobLayers();
304 const std::vector<ForwardDetLayer const*>& fpx_pos = tracker.
posForwardLayers();
305 const std::vector<ForwardDetLayer const*>& tid_pos = tracker.
posTidLayers();
306 const std::vector<ForwardDetLayer const*>& tec_pos = tracker.
posTecLayers();
308 const std::vector<ForwardDetLayer const*>& fpx_neg = tracker.
negForwardLayers();
309 const std::vector<ForwardDetLayer const*>& tid_neg = tracker.
negTidLayers();
310 const std::vector<ForwardDetLayer const*>& tec_neg = tracker.
negTecLayers();
314 int index = layer.idLayer - 1;
317 detLayer = bpx[
index];
320 detLayer = fpx_pos[
index];
322 detLayer = fpx_neg[
index];
325 detLayer = tib[
index];
328 detLayer = tid_pos[
index];
330 detLayer = tid_neg[
index];
333 detLayer = tob[
index];
336 detLayer = tec_pos[
index];
338 detLayer = tec_neg[
index];
353 std::vector<SeedingLayerId>
ret;
356 ret.emplace_back(layer.subdet, layer.side, layer.idLayer);
364 auto ret = std::make_unique<SeedingLayerSetsHits>(
372 ret->shrink_to_fit();
387 auto ret = std::make_unique<SeedingLayerSetsHits>(
392 for (
auto& rh : *fastSimrechits_) {
399 idLayer = tTopo->
pxbLayer(rh.det()->geographicalId());
402 idLayer = tTopo->
pxfDisk(rh.det()->geographicalId());
403 if (tTopo->
pxfSide(rh.det()->geographicalId()) == 1)
409 if (layer.subdet == subdet && layer.side == side && layer.idLayer == idLayer) {
412 layerhits_.emplace_back(ptrHit);
418 ret->shrink_to_fit();
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
std::vector< const DetLayer * > theLayerDets
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)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void setAllowAnything()
allow any parameter label/value pairs
edm::EDGetTokenT< FastTrackerRecHitCollection > fastSimrecHitsToken_
std::vector< std::string > theLayerNames
ret
prodAgent to be discontinued
unsigned int pxfDisk(const DetId &id) const
std::unique_ptr< SeedingLayerSetsHits > makeSeedingLayerSetsHitsforFastSim(const edm::Event &ev, const edm::EventSetup &es)
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
const std::string names[nVars_]
GeomDetEnumerators::SubDetector subdet
std::tuple< GeomDetEnumerators::SubDetector, TrackerDetSide, int > SeedingLayerId
void updateEventSetup(const edm::EventSetup &es)
virtual TrackingRecHit * clone() const =0
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)
std::vector< const TransientTrackingRecHitBuilder * > theTTRHBuilders
edm::ESWatcher< TransientRecHitRecord > trhWatcher_
unsigned int pxbLayer(const DetId &id) const
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
unsigned int pxfSide(const DetId &id) const
static void fillDescriptions(edm::ParameterSetDescription &desc)
std::vector< HitPointer > OwnedHits
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< BarrelDetLayer const * > const & barrelLayers() const
static std::vector< std::vector< std::string > > layerNamesInSets(const std::vector< std::string > &namesPSet)