26 std::vector<edm::ParameterSet> algoPSets = ps.
getParameter<std::vector<edm::ParameterSet> >(
"algo_psets");
32 LogDebug(
"CSCSegment|CSC") <<
"CSCSegmentBuilder algorithm name: " <<
algoName;
35 std::vector<edm::ParameterSet> segAlgoPSet =
36 algoPSets[chosenAlgo].getParameter<std::vector<edm::ParameterSet> >(
"algo_psets");
39 std::vector<std::string> chType = algoPSets[chosenAlgo].getParameter<std::vector<std::string> >(
"chamber_types");
40 LogDebug(
"CSCSegment|CSC") <<
"No. of chamber types to handle: " << chType.size();
43 std::vector<int> algoToType = algoPSets[chosenAlgo].getParameter<std::vector<int> >(
"parameters_per_chamber_type");
46 if (algoToType.size() != chType.size()) {
48 <<
"#dim algosToType=" << algoToType.size() <<
", #dim chType=" << chType.size() << std::endl;
53 for (
size_t j = 0;
j < chType.size(); ++
j) {
55 edm::LogVerbatim(
"CSCSegment|CSC") <<
"using algorithm #" << algoToType[
j] <<
" for chamber type " << chType[
j];
62 LogDebug(
"CSCSegment|CSC") <<
"Total number of rechits in this event: " <<
recHits->size();
65 std::vector<CSCDetId>::const_iterator chIt;
70 if (((*it2).cscDetId().chamber() == (*chIt).chamber()) && ((*it2).cscDetId().station() == (*chIt).station()) &&
71 ((*it2).cscDetId().ring() == (*chIt).ring()) && ((*it2).cscDetId().endcap() == (*chIt).endcap()))
75 chambers.push_back((*it2).cscDetId().chamberId());
79 std::vector<const CSCRecHit2D*> cscRecHits;
85 std::vector<int> hitPerLayer(6);
87 hitPerLayer[(*rechit).cscDetId().layer() - 1]++;
88 cscRecHits.push_back(&(*rechit));
91 LogDebug(
"CSCSegment|CSC") <<
"found " << cscRecHits.size() <<
" rechits in chamber " << *chIt;
94 std::vector<CSCSegment> segv =
algoMap[
chamber->specs()->chamberTypeName()]->run(
chamber, cscRecHits);
96 LogDebug(
"CSCSegment|CSC") <<
"found " << segv.size() <<
" segments in chamber " << *chIt;
99 oc.put((*chIt), segv.begin(), segv.end());
CSCSegmentBuilder(const edm::ParameterSet &)
Log< level::Info, true > LogVerbatim
void build(const CSCRecHit2DCollection *rechits, CSCSegmentCollection &oc)
T getParameter(std::string const &) const
std::pair< const_iterator, const_iterator > range
iterator range
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
def create(alignables, pedeDump, additionalData, outputFile, config)
const CSCGeometry * geom_
C::const_iterator const_iterator
constant access iterator type
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
~CSCSegmentBuilder()
Destructor.
std::map< std::string, std::unique_ptr< CSCSegmentAlgorithm > > algoMap
static char chambers[264][20]
void setGeometry(const CSCGeometry *geom)
static std::pair< CSCDetId, CSCDetIdSameChamberComparator > cscChamber(CSCDetId id)
Returns a valid DetId + a valid comparator for the RangeMap.