27 using namespace ctfseeding;
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,1).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);
105 hitBuilder(cfgLayer.getParameter<
string>(
"TTRHBuilder"))
108 if (cfgLayer.
exists(
"HitProducer")) {
113 bool skipClusters = cfgLayer.
exists(
"skipClusters");
115 LogDebug(
"SeedingLayerSetsBuilder")<<layerName<<
" ready for skipping";
118 LogDebug(
"SeedingLayerSetsBuilder")<<layerName<<
" not skipping ";
121 auto subdetData = nameToEnumId(layerName);
122 subdet = std::get<0>(subdetData);
123 side = std::get<1>(subdetData);
124 idLayer = std::get<2>(subdetData);
130 std::shared_ptr<HitExtractorSTRP> extr = std::make_shared<HitExtractorSTRP>(
subdet,
side,
idLayer);
131 if (cfgLayer.
exists(
"matchedRecHits")) {
134 if (cfgLayer.
exists(
"rphiRecHits")) {
137 if (cfgLayer.
exists(
"stereoRecHits")) {
140 if (cfgLayer.
exists(
"useRingSlector") && cfgLayer.
getParameter<
bool>(
"useRingSlector")) {
141 extr->useRingSelector(cfgLayer.
getParameter<
int>(
"minRing"),
145 extr->useSimpleRphiHitsCleaner(useSimpleRphiHitsCleaner);
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";
157 extr->setNoProjection();
170 std::ostringstream str;
171 str <<
"Layer="<<names[nameIndex]<<
", hitBldr: "<<hitBuilder;
173 str <<
", useRingSelector: ";
175 if((ext = dynamic_cast<HitExtractorSTRP *>(extractor.get())) &&
178 str <<
"true,"<<
" Rings: ("<< std::get<0>(minMaxRing) <<
","<< std::get<1>(minMaxRing) <<
")";
190 std::vector<std::string> namesPset = cfg.
getParameter<std::vector<std::string> >(
"layerList");
194 typedef std::vector<std::string>::const_iterator IS;
195 typedef std::vector<std::vector<std::string> >::const_iterator
IT;
196 std::ostringstream str;
204 if(layerNamesInSets.size() == 0)
210 for (IT it = layerNamesInSets.begin(); it != layerNamesInSets.end(); it++) {
212 throw cms::Exception(
"Configuration") <<
"Assuming all SeedingLayerSets to have same number of layers. LayerSet " << (it-layerNamesInSets.begin()) <<
" has " << it->size() <<
" while 0th has " <<
theNumberOfLayersInSet;
215 unsigned short layerIndex = 0;
221 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 string name = nameLayer.substr(0,iEnd);
251 edm::LogError(
"SeedingLayerSetsBuilder") <<
"configuration for layer: "<<nameLayer<<
" not found, job will probably crash!";
257 std::vector<std::vector<std::string> >
result;
258 for (std::vector<std::string>::const_iterator is=namesPSet.begin(); is < namesPSet.end(); ++is) {
259 vector<std::string> layersInSet;
262 while (pos != string::npos ) {
264 string layer = line.substr(0,pos);
265 layersInSet.push_back(layer);
266 line=line.substr(pos+1,string::npos);
268 result.push_back(layersInSet);
278 const std::vector<BarrelDetLayer const*>& bpx = tracker.
barrelLayers();
279 const std::vector<BarrelDetLayer const*>& tib = tracker.
tibLayers();
280 const std::vector<BarrelDetLayer const*>& tob = tracker.
tobLayers();
282 const std::vector<ForwardDetLayer const*>& fpx_pos = tracker.
posForwardLayers();
283 const std::vector<ForwardDetLayer const*>& tid_pos = tracker.
posTidLayers();
284 const std::vector<ForwardDetLayer const*>& tec_pos = tracker.
posTecLayers();
286 const std::vector<ForwardDetLayer const*>& fpx_neg = tracker.
negForwardLayers();
287 const std::vector<ForwardDetLayer const*>& tid_neg = tracker.
negTidLayers();
288 const std::vector<ForwardDetLayer const*>& tec_neg = tracker.
negTecLayers();
292 const DetLayer * detLayer =
nullptr;
296 detLayer = bpx[
index];
299 if (layer.
side == SeedingLayer::PosEndcap) {
300 detLayer = fpx_pos[
index];
302 detLayer = fpx_neg[
index];
306 detLayer = tib[
index];
309 if (layer.
side == SeedingLayer::PosEndcap) {
310 detLayer = tid_pos[
index];
312 detLayer = tid_neg[
index];
316 detLayer = tob[
index];
319 if (layer.
side == SeedingLayer::PosEndcap) {
320 detLayer = tec_pos[
index];
322 detLayer = tec_neg[
index];
341 typedef std::vector<SeedingLayer> Set;
353 result.push_back(set);
372 indices.push_back(hits.size());
376 std::move(tmp.begin(), tmp.end(), std::back_inserter(hits));
T getParameter(std::string const &) const
ctfseeding::SeedingLayerSets layers(const edm::EventSetup &es)
SeedingLayerSetsBuilder()
static const HistoName names[]
std::vector< ForwardDetLayer const * > const & posForwardLayers() const
std::vector< LayerSpec > theLayers
edm::ESWatcher< TrackerRecoGeometryRecord > geometryWatcher_
~SeedingLayerSetsBuilder()
LayerSpec(unsigned short index, const std::string &layerName, const edm::ParameterSet &cfgLayer, edm::ConsumesCollector &iC)
std::vector< std::string > theLayerNames
bool exists(std::string const ¶meterName) const
checks if a parameter exists
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)
std::vector< ForwardDetLayer const * > const & negForwardLayers() const
std::shared_ptr< ctfseeding::HitExtractor > extractor
tuple useSimpleRphiHitsCleaner
std::vector< LinkConnSpec >::const_iterator IT
edm::ESWatcher< TransientRecHitRecord > trhWatcher_
std::vector< LayerSetIndex > theLayerSetIndices
std::vector< BarrelDetLayer const * > const & tibLayers() const
std::vector< ForwardDetLayer const * > const & posTecLayers() const
T const * product() 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
void hits(const edm::Event &ev, const edm::EventSetup &es, std::vector< unsigned int > &indices, ctfseeding::SeedingLayer::Hits &hits) const
std::vector< ForwardDetLayer const * > const & negTecLayers() 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
std::vector< std::vector< std::string > > layerNamesInSets(const std::vector< std::string > &namesPSet)