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();
169 std::ostringstream
str;
172 str <<
", useRingSelector: ";
174 if((ext = dynamic_cast<HitExtractorSTRP *>(
extractor.get())) &&
177 str <<
"true,"<<
" Rings: ("<< std::get<0>(minMaxRing) <<
","<< std::get<1>(minMaxRing) <<
")";
195 std::vector<std::string> namesPset = cfg.
getParameter<std::vector<std::string> >(
"layerList");
198 typedef std::vector<std::string>::const_iterator IS;
199 typedef std::vector<std::vector<std::string> >::const_iterator
IT;
200 std::ostringstream
str;
208 if(layerNamesInSets.empty())
214 for (IT it = layerNamesInSets.begin(); it != layerNamesInSets.end(); it++) {
216 throw cms::Exception(
"Configuration") <<
"Assuming all SeedingLayerSets to have same number of layers. LayerSet " << (it-layerNamesInSets.begin()) <<
" has " << it->size() <<
" while 0th has " <<
theNumberOfLayersInSet;
219 unsigned short layerIndex = 0;
225 throw cms::Exception(
"Assert") <<
"Too many layers in " << __FILE__ <<
":" << __LINE__ <<
", we may have to enlarge the index type from unsigned short to unsigned int";
252 string name = nameLayer.substr(0,iEnd);
255 edm::LogError(
"SeedingLayerSetsBuilder") <<
"configuration for layer: "<<nameLayer<<
" not found, job will probably crash!";
261 std::vector<std::vector<std::string> >
result;
262 for (std::vector<std::string>::const_iterator is=namesPSet.begin(); is < namesPSet.end(); ++is) {
263 vector<std::string> layersInSet;
266 while (pos != string::npos ) {
268 string layer = line.substr(0,pos);
269 layersInSet.push_back(layer);
270 line=line.substr(pos+1,string::npos);
272 result.push_back(layersInSet);
282 const std::vector<BarrelDetLayer const*>& bpx = tracker.
barrelLayers();
283 const std::vector<BarrelDetLayer const*>& tib = tracker.
tibLayers();
284 const std::vector<BarrelDetLayer const*>& tob = tracker.
tobLayers();
286 const std::vector<ForwardDetLayer const*>& fpx_pos = tracker.
posForwardLayers();
287 const std::vector<ForwardDetLayer const*>& tid_pos = tracker.
posTidLayers();
288 const std::vector<ForwardDetLayer const*>& tec_pos = tracker.
posTecLayers();
290 const std::vector<ForwardDetLayer const*>& fpx_neg = tracker.
negForwardLayers();
291 const std::vector<ForwardDetLayer const*>& tid_neg = tracker.
negTidLayers();
292 const std::vector<ForwardDetLayer const*>& tec_neg = tracker.
negTecLayers();
296 const DetLayer * detLayer =
nullptr;
300 detLayer = bpx[
index];
303 if (layer.
side == SeedingLayer::PosEndcap) {
304 detLayer = fpx_pos[
index];
306 detLayer = fpx_neg[
index];
310 detLayer = tib[
index];
313 if (layer.
side == SeedingLayer::PosEndcap) {
314 detLayer = tid_pos[
index];
316 detLayer = tid_neg[
index];
320 detLayer = tob[
index];
323 if (layer.
side == SeedingLayer::PosEndcap) {
324 detLayer = tec_pos[
index];
326 detLayer = tec_neg[
index];
345 typedef std::vector<SeedingLayer> Set;
357 result.push_back(
set);
376 indices.push_back(hits.size());
380 std::move(tmp.begin(), tmp.end(), std::back_inserter(hits));
400 std::vector<unsigned int> indices;
404 indices.push_back(layerhits_.size());
405 for(
auto &rh : *fastSimrechits_){
412 idLayer = tTopo->
pxbLayer(rh.det()->geographicalId());
416 idLayer = tTopo->
pxfDisk(rh.det()->geographicalId());
417 if(tTopo->
pxfSide(rh.det()->geographicalId())==1)
418 side = SeedingLayer::NegEndcap;
420 side = SeedingLayer::PosEndcap;
423 if(layer.subdet == subdet && layer.side == side && layer.idLayer == idLayer){
426 layerhits_.emplace_back(ptrHit);
431 layerhits_.shrink_to_fit();
432 ret->swapHits(indices, layerhits_);
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
ctfseeding::SeedingLayerSets layers(const edm::EventSetup &es)
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
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)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
float clusterChargeCut(const edm::ParameterSet &conf, const char *name="clusterChargeCut")
std::vector< HitPointer > Hits
std::vector< BarrelDetLayer const * > const & tobLayers() const
bool check(const edm::EventSetup &es)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< const TransientTrackingRecHitBuilder * > theTTRHBuilders
GeomDetEnumerators::SubDetector subdet
void updateEventSetup(const edm::EventSetup &es)
virtual TrackingRecHit * clone() const =0
std::vector< ForwardDetLayer const * > const & negForwardLayers() const
std::shared_ptr< ctfseeding::HitExtractor > extractor
std::vector< LinkConnSpec >::const_iterator IT
edm::ESWatcher< TransientRecHitRecord > trhWatcher_
unsigned int pxbLayer(const DetId &id) const
std::vector< LayerSetIndex > theLayerSetIndices
static SeedingLayerId nameToEnumId(const std::string &name)
std::vector< BarrelDetLayer const * > const & tibLayers() const
std::vector< ForwardDetLayer const * > const & posTecLayers() const
std::string pixelHitProducer
std::vector< ForwardDetLayer const * > const & negTidLayers() const
const std::string hitBuilder
bool check(const edm::EventSetup &iSetup)
unsigned short theNumberOfLayersInSet
std::vector< std::vector< double > > tmp
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
void hits(const edm::Event &ev, const edm::EventSetup &es, std::vector< unsigned int > &indices, ctfseeding::SeedingLayer::Hits &hits) const
std::tuple< GeomDetEnumerators::SubDetector, ctfseeding::SeedingLayer::Side, int > SeedingLayerId
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
ctfseeding::SeedingLayer::Side side
std::vector< std::vector< SeedingLayer > > SeedingLayerSets
static std::vector< std::vector< std::string > > layerNamesInSets(const std::vector< std::string > &namesPSet)