40 if ((
index =
name.find(
"BPix")) != string::npos) {
43 idLayer = atoi(
name.substr(
index + 4, 1).c_str());
48 else if ((
index =
name.find(
"FPix")) != string::npos) {
50 idLayer = atoi(
name.substr(
index + 4).c_str());
51 if (
name.find(
"pos") != string::npos) {
60 else if ((
index =
name.find(
"TIB")) != string::npos) {
63 idLayer = atoi(
name.substr(
index + 3, 1).c_str());
68 else if ((
index =
name.find(
"TID")) != string::npos) {
70 idLayer = atoi(
name.substr(
index + 3, 1).c_str());
71 if (
name.find(
"pos") != string::npos) {
80 else if ((
index =
name.find(
"TOB")) != string::npos) {
83 idLayer = atoi(
name.substr(
index + 3, 1).c_str());
88 else if ((
index =
name.find(
"TEC")) != string::npos) {
90 idLayer = atoi(
name.substr(
index + 3, 1).c_str());
91 if (
name.find(
"pos") != string::npos) {
97 return std::make_tuple(subdet,
side, idLayer);
105 hitBuilder(cfgLayer.getParameter<
string>(
"TTRHBuilder")),
108 if (cfgLayer.
exists(
"HitProducer")) {
115 LogDebug(
"SeedingLayerSetsBuilder") << layerName <<
" ready for skipping";
117 LogDebug(
"SeedingLayerSetsBuilder") << layerName <<
" not skipping ";
121 subdet = std::get<0>(subdetData);
122 side = std::get<1>(subdetData);
123 idLayer = std::get<2>(subdetData);
128 if (cfgLayer.
exists(
"matchedRecHits")) {
131 if (cfgLayer.
exists(
"rphiRecHits")) {
134 if (cfgLayer.
exists(
"stereoRecHits")) {
137 if (cfgLayer.
exists(
"vectorRecHits")) {
140 if (cfgLayer.
exists(
"useRingSlector") && cfgLayer.
getParameter<
bool>(
"useRingSlector")) {
144 cfgLayer.
exists(
"useSimpleRphiHitsCleaner") ? cfgLayer.
getParameter<
bool>(
"useSimpleRphiHitsCleaner") :
true;
147 double minAbsZ = cfgLayer.
exists(
"MinAbsZ") ? cfgLayer.
getParameter<
double>(
"MinAbsZ") : 0.;
149 extr->setMinAbsZ(minAbsZ);
152 bool useProjection = cfgLayer.
exists(
"useProjection") ? cfgLayer.
getParameter<
bool>(
"useProjection") :
false;
154 LogDebug(
"SeedingLayerSetsBuilder") << layerName <<
" will project partially masked matched rechit";
156 extr->setNoProjection();
167 std::ostringstream
str;
168 str <<
"Layer=" <<
names[nameIndex] <<
", hitBldr: " << hitBuilder;
170 str <<
", useRingSelector: ";
172 if ((
ext = dynamic_cast<HitExtractorSTRP*>(extractor.get())) &&
ext->useRingSelector()) {
173 auto minMaxRing =
ext->getMinMaxRing();
175 <<
" Rings: (" << std::get<0>(minMaxRing) <<
"," << std::get<1>(minMaxRing) <<
")";
193 std::vector<std::string> namesPset =
cfg.getParameter<std::vector<std::string> >(
"layerList");
196 typedef std::vector<std::string>::const_iterator IS;
197 typedef std::vector<std::vector<std::string> >::const_iterator
IT;
198 std::ostringstream
str;
214 <<
"Assuming all SeedingLayerSets to have same number of layers. LayerSet " << (
it -
layerNamesInSets.begin())
218 unsigned short layerIndex = 0;
224 <<
"Too many layers in " << __FILE__ <<
":" << __LINE__
225 <<
", we may have to enlarge the index type from unsigned short to unsigned int";
249 empty.setAllowAnything();
251 desc.add<std::vector<std::string> >(
"layerList", {});
269 string name = nameLayer.substr(0, iEnd);
274 <<
"configuration for layer: " << nameLayer <<
" not found, job will probably crash!";
279 std::vector<std::vector<std::string> >
result;
280 for (std::vector<std::string>::const_iterator is = namesPSet.begin(); is < namesPSet.end(); ++is) {
281 vector<std::string> layersInSet;
284 while (
pos != string::npos) {
287 layersInSet.push_back(
layer);
290 result.push_back(layersInSet);
304 const std::vector<BarrelDetLayer const*>& bpx =
tracker.barrelLayers();
305 const std::vector<BarrelDetLayer const*>& tib =
tracker.tibLayers();
306 const std::vector<BarrelDetLayer const*>& tob =
tracker.tobLayers();
308 const std::vector<ForwardDetLayer const*>& fpx_pos =
tracker.posForwardLayers();
309 const std::vector<ForwardDetLayer const*>& tid_pos =
tracker.posTidLayers();
310 const std::vector<ForwardDetLayer const*>& tec_pos =
tracker.posTecLayers();
312 const std::vector<ForwardDetLayer const*>& fpx_neg =
tracker.negForwardLayers();
313 const std::vector<ForwardDetLayer const*>& tid_neg =
tracker.negTidLayers();
314 const std::vector<ForwardDetLayer const*>& tec_neg =
tracker.negTecLayers();
321 detLayer = bpx[
index];
324 detLayer = fpx_pos[
index];
326 detLayer = fpx_neg[
index];
329 detLayer = tib[
index];
332 detLayer = tid_pos[
index];
334 detLayer = tid_neg[
index];
337 detLayer = tob[
index];
340 detLayer = tec_pos[
index];
342 detLayer = tec_neg[
index];
354 std::vector<SeedingLayerId>
ret;
365 auto ret = std::make_unique<SeedingLayerSetsHits>(
373 ret->shrink_to_fit();
386 auto ret = std::make_unique<SeedingLayerSetsHits>(
391 for (
auto& rh : *fastSimrechits_) {
398 idLayer = tTopo->
pxbLayer(rh.det()->geographicalId());
401 idLayer = tTopo->
pxfDisk(rh.det()->geographicalId());
402 if (tTopo->
pxfSide(rh.det()->geographicalId()) == 1)
411 layerhits_.emplace_back(ptrHit);
417 ret->shrink_to_fit();
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< const DetLayer * > theLayerDets
std::string print(const std::vector< std::string > &names) const
T getParameter(std::string const &) const
unsigned int pxbLayer(const DetId &id) const
SeedingLayerSetsBuilder(const edm::ParameterSet &cfg, edm::ConsumesCollector &iC, const edm::InputTag &fastsimHitTag)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
std::vector< LayerSpec > theLayers
edm::ESWatcher< TrackerRecoGeometryRecord > geometryWatcher_
~SeedingLayerSetsBuilder()
LayerSpec(unsigned short index, const std::string &layerName, const edm::ParameterSet &cfgLayer, edm::ConsumesCollector &iC)
edm::EDGetTokenT< FastTrackerRecHitCollection > fastSimrecHitsToken_
std::vector< std::string > theLayerNames
ret
prodAgent to be discontinued
std::unique_ptr< SeedingLayerSetsHits > makeSeedingLayerSetsHitsforFastSim(const edm::Event &ev, const edm::EventSetup &es)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::unique_ptr< ctfseeding::HitExtractor > extractor
ALPAKA_FN_ACC int side(int ieta, int iphi)
Log< level::Error, false > LogError
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const std::string names[nVars_]
GeomDetEnumerators::SubDetector subdet
std::tuple< GeomDetEnumerators::SubDetector, TrackerDetSide, int > SeedingLayerId
void updateEventSetup(const edm::EventSetup &es)
unsigned int pxfDisk(const DetId &id) 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
std::vector< const TransientTrackingRecHitBuilder * > theTTRHBuilders
edm::ESWatcher< TransientRecHitRecord > trhWatcher_
static SeedingLayerId nameToEnumId(const std::string &name)
unsigned int pxfSide(const DetId &id) const
const edm::ESGetToken< GeometricSearchTracker, TrackerRecoGeometryRecord > trackerToken_
std::string pixelHitProducer
float clusterChargeCut(const edm::ParameterSet &conf, const char *name="clusterChargeCut")
bool check(const edm::EventSetup &iSetup)
unsigned short theNumberOfLayersInSet
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyToken_
edm::ParameterSet layerConfig(const std::string &nameLayer, const edm::ParameterSet &cfg) const
unsigned short numberOfLayers() const
static void fillDescriptions(edm::ParameterSetDescription &desc)
std::vector< HitPointer > OwnedHits
std::vector< SeedingLayerId > layers() const
static std::vector< std::vector< std::string > > layerNamesInSets(const std::vector< std::string > &namesPSet)