29 using namespace ctfseeding;
44 if ((index = name.find(
"BPix")) != string::npos) {
47 idLayer = atoi(name.substr(index+4,1).c_str());
52 else if ((index = name.find(
"FPix")) != string::npos) {
54 idLayer = atoi(name.substr(index+4,1).c_str());
55 if ( name.find(
"pos") != string::npos ) {
64 else if ((index = name.find(
"TIB")) != string::npos) {
67 idLayer = atoi(name.substr(index+3,1).c_str());
72 else if ((index = name.find(
"TID")) != string::npos) {
74 idLayer = atoi(name.substr(index+3,1).c_str());
75 if ( name.find(
"pos") != string::npos ) {
84 else if ((index = name.find(
"TOB")) != string::npos) {
87 idLayer = atoi(name.substr(index+3,1).c_str());
92 else if ((index = name.find(
"TEC")) != string::npos) {
94 idLayer = atoi(name.substr(index+3,1).c_str());
95 if ( name.find(
"pos") != string::npos ) {
101 return std::make_tuple(subdet, side, idLayer);
107 hitBuilder(cfgLayer.getParameter<
string>(
"TTRHBuilder"))
110 if (cfgLayer.
exists(
"HitProducer")) {
117 LogDebug(
"SeedingLayerSetsBuilder")<<layerName<<
" ready for skipping";
120 LogDebug(
"SeedingLayerSetsBuilder")<<layerName<<
" not skipping ";
123 auto subdetData = nameToEnumId(layerName);
124 subdet = std::get<0>(subdetData);
125 side = std::get<1>(subdetData);
126 idLayer = std::get<2>(subdetData);
133 if (cfgLayer.
exists(
"matchedRecHits")) {
136 if (cfgLayer.
exists(
"rphiRecHits")) {
139 if (cfgLayer.
exists(
"stereoRecHits")) {
142 if (cfgLayer.
exists(
"useRingSlector") && cfgLayer.
getParameter<
bool>(
"useRingSlector")) {
143 extr->useRingSelector(cfgLayer.
getParameter<
int>(
"minRing"),
147 extr->useSimpleRphiHitsCleaner(useSimpleRphiHitsCleaner);
149 double minAbsZ = cfgLayer.
exists(
"MinAbsZ") ? cfgLayer.
getParameter<
double>(
"MinAbsZ") : 0.;
151 extr->setMinAbsZ(minAbsZ);
154 bool useProjection = cfgLayer.
exists(
"useProjection") ? cfgLayer.
getParameter<
bool>(
"useProjection") :
false;
156 LogDebug(
"SeedingLayerSetsBuilder")<<layerName<<
" will project partially masked matched rechit";
159 extr->setNoProjection();
172 std::ostringstream str;
173 str <<
"Layer="<<names[nameIndex]<<
", hitBldr: "<<hitBuilder;
175 str <<
", useRingSelector: ";
177 if((ext = dynamic_cast<HitExtractorSTRP *>(extractor.get())) &&
180 str <<
"true,"<<
" Rings: ("<< std::get<0>(minMaxRing) <<
","<< std::get<1>(minMaxRing) <<
")";
192 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;
206 if(layerNamesInSets.size() == 0)
212 for (IT it = layerNamesInSets.begin(); it != layerNamesInSets.end(); it++) {
214 throw cms::Exception(
"Configuration") <<
"Assuming all SeedingLayerSets to have same number of layers. LayerSet " << (it-layerNamesInSets.begin()) <<
" has " << it->size() <<
" while 0th has " <<
theNumberOfLayersInSet;
217 unsigned short layerIndex = 0;
223 throw cms::Exception(
"Assert") <<
"Too many layers in " << __FILE__ <<
":" << __LINE__ <<
", we may have to enlarge the index type from unsigned short to unsigned int";
250 string name = nameLayer.substr(0,iEnd);
253 edm::LogError(
"SeedingLayerSetsBuilder") <<
"configuration for layer: "<<nameLayer<<
" not found, job will probably crash!";
259 std::vector<std::vector<std::string> >
result;
260 for (std::vector<std::string>::const_iterator is=namesPSet.begin(); is < namesPSet.end(); ++is) {
261 vector<std::string> layersInSet;
264 while (pos != string::npos ) {
266 string layer = line.substr(0,pos);
267 layersInSet.push_back(layer);
268 line=line.substr(pos+1,string::npos);
270 result.push_back(layersInSet);
280 const std::vector<BarrelDetLayer const*>& bpx = tracker.
barrelLayers();
281 const std::vector<BarrelDetLayer const*>& tib = tracker.
tibLayers();
282 const std::vector<BarrelDetLayer const*>& tob = tracker.
tobLayers();
284 const std::vector<ForwardDetLayer const*>& fpx_pos = tracker.
posForwardLayers();
285 const std::vector<ForwardDetLayer const*>& tid_pos = tracker.
posTidLayers();
286 const std::vector<ForwardDetLayer const*>& tec_pos = tracker.
posTecLayers();
288 const std::vector<ForwardDetLayer const*>& fpx_neg = tracker.
negForwardLayers();
289 const std::vector<ForwardDetLayer const*>& tid_neg = tracker.
negTidLayers();
290 const std::vector<ForwardDetLayer const*>& tec_neg = tracker.
negTecLayers();
294 const DetLayer * detLayer =
nullptr;
298 detLayer = bpx[
index];
301 if (layer.
side == SeedingLayer::PosEndcap) {
302 detLayer = fpx_pos[
index];
304 detLayer = fpx_neg[
index];
308 detLayer = tib[
index];
311 if (layer.
side == SeedingLayer::PosEndcap) {
312 detLayer = tid_pos[
index];
314 detLayer = tid_neg[
index];
318 detLayer = tob[
index];
321 if (layer.
side == SeedingLayer::PosEndcap) {
322 detLayer = tec_pos[
index];
324 detLayer = tec_neg[
index];
343 typedef std::vector<SeedingLayer> Set;
355 result.push_back(set);
374 indices.push_back(hits.size());
378 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
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)