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);
103 hitBuilder(cfgLayer.getParameter<
string>(
"TTRHBuilder"))
106 if (cfgLayer.
exists(
"HitProducer")) {
113 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);
129 if (cfgLayer.
exists(
"matchedRecHits")) {
132 if (cfgLayer.
exists(
"rphiRecHits")) {
135 if (cfgLayer.
exists(
"stereoRecHits")) {
138 if (cfgLayer.
exists(
"useRingSlector") && cfgLayer.
getParameter<
bool>(
"useRingSlector")) {
139 extr->useRingSelector(cfgLayer.
getParameter<
int>(
"minRing"),
143 extr->useSimpleRphiHitsCleaner(useSimpleRphiHitsCleaner);
145 double minAbsZ = cfgLayer.
exists(
"MinAbsZ") ? cfgLayer.
getParameter<
double>(
"MinAbsZ") : 0.;
147 extr->setMinAbsZ(minAbsZ);
150 bool useProjection = cfgLayer.
exists(
"useProjection") ? cfgLayer.
getParameter<
bool>(
"useProjection") :
false;
152 LogDebug(
"SeedingLayerSetsBuilder")<<layerName<<
" will project partially masked matched rechit";
155 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) <<
")";
188 std::vector<std::string> namesPset = cfg.
getParameter<std::vector<std::string> >(
"layerList");
192 typedef std::vector<std::string>::const_iterator IS;
193 typedef std::vector<std::vector<std::string> >::const_iterator
IT;
194 std::ostringstream
str;
202 if(layerNamesInSets.empty())
208 for (IT it = layerNamesInSets.begin(); it != layerNamesInSets.end(); it++) {
210 throw cms::Exception(
"Configuration") <<
"Assuming all SeedingLayerSets to have same number of layers. LayerSet " << (it-layerNamesInSets.begin()) <<
" has " << it->size() <<
" while 0th has " <<
theNumberOfLayersInSet;
213 unsigned short layerIndex = 0;
219 throw cms::Exception(
"Assert") <<
"Too many layers in " << __FILE__ <<
":" << __LINE__ <<
", we may have to enlarge the index type from unsigned short to unsigned int";
246 string name = nameLayer.substr(0,iEnd);
249 edm::LogError(
"SeedingLayerSetsBuilder") <<
"configuration for layer: "<<nameLayer<<
" not found, job will probably crash!";
255 std::vector<std::vector<std::string> >
result;
256 for (std::vector<std::string>::const_iterator is=namesPSet.begin(); is < namesPSet.end(); ++is) {
257 vector<std::string> layersInSet;
260 while (pos != string::npos ) {
262 string layer = line.substr(0,pos);
263 layersInSet.push_back(layer);
264 line=line.substr(pos+1,string::npos);
266 result.push_back(layersInSet);
276 const std::vector<BarrelDetLayer const*>& bpx = tracker.
barrelLayers();
277 const std::vector<BarrelDetLayer const*>& tib = tracker.
tibLayers();
278 const std::vector<BarrelDetLayer const*>& tob = tracker.
tobLayers();
280 const std::vector<ForwardDetLayer const*>& fpx_pos = tracker.
posForwardLayers();
281 const std::vector<ForwardDetLayer const*>& tid_pos = tracker.
posTidLayers();
282 const std::vector<ForwardDetLayer const*>& tec_pos = tracker.
posTecLayers();
284 const std::vector<ForwardDetLayer const*>& fpx_neg = tracker.
negForwardLayers();
285 const std::vector<ForwardDetLayer const*>& tid_neg = tracker.
negTidLayers();
286 const std::vector<ForwardDetLayer const*>& tec_neg = tracker.
negTecLayers();
290 const DetLayer * detLayer =
nullptr;
294 detLayer = bpx[
index];
297 if (layer.
side == SeedingLayer::PosEndcap) {
298 detLayer = fpx_pos[
index];
300 detLayer = fpx_neg[
index];
304 detLayer = tib[
index];
307 if (layer.
side == SeedingLayer::PosEndcap) {
308 detLayer = tid_pos[
index];
310 detLayer = tid_neg[
index];
314 detLayer = tob[
index];
317 if (layer.
side == SeedingLayer::PosEndcap) {
318 detLayer = tec_pos[
index];
320 detLayer = tec_neg[
index];
339 typedef std::vector<SeedingLayer> Set;
351 result.push_back(
set);
370 indices.push_back(hits.size());
374 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
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)
std::vector< ForwardDetLayer const * > const & negForwardLayers() const
std::shared_ptr< ctfseeding::HitExtractor > extractor
std::vector< LinkConnSpec >::const_iterator IT
edm::ESWatcher< TransientRecHitRecord > trhWatcher_
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
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)