42 if ((index = name.find(
"BPix")) != string::npos) {
45 idLayer = atoi(name.substr(index+4,1).c_str());
50 else if ((index = name.find(
"FPix")) != string::npos) {
52 idLayer = atoi(name.substr(index+4).c_str());
53 if ( name.find(
"pos") != string::npos ) {
62 else if ((index = name.find(
"TIB")) != string::npos) {
65 idLayer = atoi(name.substr(index+3,1).c_str());
70 else if ((index = name.find(
"TID")) != string::npos) {
72 idLayer = atoi(name.substr(index+3,1).c_str());
73 if ( name.find(
"pos") != string::npos ) {
82 else if ((index = name.find(
"TOB")) != string::npos) {
85 idLayer = atoi(name.substr(index+3,1).c_str());
90 else if ((index = name.find(
"TEC")) != string::npos) {
92 idLayer = atoi(name.substr(index+3,1).c_str());
93 if ( name.find(
"pos") != string::npos ) {
99 return std::make_tuple(subdet, side, idLayer);
104 hitBuilder(cfgLayer.getParameter<
string>(
"TTRHBuilder"))
107 if (cfgLayer.
exists(
"HitProducer")) {
114 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);
130 if (cfgLayer.
exists(
"matchedRecHits")) {
133 if (cfgLayer.
exists(
"rphiRecHits")) {
136 if (cfgLayer.
exists(
"stereoRecHits")) {
139 if (cfgLayer.
exists(
"useRingSlector") && cfgLayer.
getParameter<
bool>(
"useRingSlector")) {
140 extr->useRingSelector(cfgLayer.
getParameter<
int>(
"minRing"),
144 extr->useSimpleRphiHitsCleaner(useSimpleRphiHitsCleaner);
146 double minAbsZ = cfgLayer.
exists(
"MinAbsZ") ? cfgLayer.
getParameter<
double>(
"MinAbsZ") : 0.;
148 extr->setMinAbsZ(minAbsZ);
151 bool useProjection = cfgLayer.
exists(
"useProjection") ? cfgLayer.
getParameter<
bool>(
"useProjection") :
false;
153 LogDebug(
"SeedingLayerSetsBuilder")<<layerName<<
" will project partially masked matched rechit";
156 extr->setNoProjection();
168 std::ostringstream
str;
171 str <<
", useRingSelector: ";
173 if((ext = dynamic_cast<HitExtractorSTRP *>(
extractor.get())) &&
176 str <<
"true,"<<
" Rings: ("<< std::get<0>(minMaxRing) <<
","<< std::get<1>(minMaxRing) <<
")";
192 std::vector<std::string> namesPset = cfg.
getParameter<std::vector<std::string> >(
"layerList");
195 typedef std::vector<std::string>::const_iterator IS;
196 typedef std::vector<std::vector<std::string> >::const_iterator
IT;
197 std::ostringstream
str;
205 if(layerNamesInSets.empty())
211 for (IT it = layerNamesInSets.begin(); it != layerNamesInSets.end(); it++) {
213 throw cms::Exception(
"Configuration") <<
"Assuming all SeedingLayerSets to have same number of layers. LayerSet " << (it-layerNamesInSets.begin()) <<
" has " << it->size() <<
" while 0th has " <<
theNumberOfLayersInSet;
216 unsigned short layerIndex = 0;
222 throw cms::Exception(
"Assert") <<
"Too many layers in " << __FILE__ <<
":" << __LINE__ <<
", we may have to enlarge the index type from unsigned short to unsigned int";
248 desc.
add<std::vector<std::string> >(
"layerList", {});
266 string name = nameLayer.substr(0,iEnd);
269 edm::LogError(
"SeedingLayerSetsBuilder") <<
"configuration for layer: "<<nameLayer<<
" not found, job will probably crash!";
275 std::vector<std::vector<std::string> >
result;
276 for (std::vector<std::string>::const_iterator is=namesPSet.begin(); is < namesPSet.end(); ++is) {
277 vector<std::string> layersInSet;
280 while (pos != string::npos ) {
282 string layer = line.substr(0,pos);
283 layersInSet.push_back(layer);
284 line=line.substr(pos+1,string::npos);
286 result.push_back(layersInSet);
302 const std::vector<BarrelDetLayer const*>& bpx = tracker.
barrelLayers();
303 const std::vector<BarrelDetLayer const*>& tib = tracker.
tibLayers();
304 const std::vector<BarrelDetLayer const*>& tob = tracker.
tobLayers();
306 const std::vector<ForwardDetLayer const*>& fpx_pos = tracker.
posForwardLayers();
307 const std::vector<ForwardDetLayer const*>& tid_pos = tracker.
posTidLayers();
308 const std::vector<ForwardDetLayer const*>& tec_pos = tracker.
posTecLayers();
310 const std::vector<ForwardDetLayer const*>& fpx_neg = tracker.
negForwardLayers();
311 const std::vector<ForwardDetLayer const*>& tid_neg = tracker.
negTidLayers();
312 const std::vector<ForwardDetLayer const*>& tec_neg = tracker.
negTecLayers();
315 const DetLayer * detLayer =
nullptr;
316 int index = layer.idLayer-1;
319 detLayer = bpx[
index];
323 detLayer = fpx_pos[
index];
325 detLayer = fpx_neg[
index];
329 detLayer = tib[
index];
333 detLayer = tid_pos[
index];
335 detLayer = tid_neg[
index];
339 detLayer = tob[
index];
343 detLayer = tec_pos[
index];
345 detLayer = tec_neg[
index];
361 std::vector<SeedingLayerId> ret;
364 ret.emplace_back(layer.subdet, layer.side, layer.idLayer);
380 ret->shrink_to_fit();
401 for(
auto &rh : *fastSimrechits_){
408 idLayer = tTopo->
pxbLayer(rh.det()->geographicalId());
412 idLayer = tTopo->
pxfDisk(rh.det()->geographicalId());
413 if(tTopo->
pxfSide(rh.det()->geographicalId())==1)
419 if(layer.subdet == subdet && layer.side == side && layer.idLayer == idLayer){
422 layerhits_.emplace_back(ptrHit);
426 ret->addHits(layer.nameIndex,
std::move(layerhits_));
428 ret->shrink_to_fit();
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
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)
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
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
std::vector< const TransientTrackingRecHitBuilder * > theTTRHBuilders
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)
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< const DetLayer * > theLayerDets
std::vector< BarrelDetLayer const * > const & barrelLayers() const
static std::vector< std::vector< std::string > > layerNamesInSets(const std::vector< std::string > &namesPSet)