27 std::vector<edm::ParameterSet> algoPSets = ps.
getParameter<std::vector<edm::ParameterSet> >(
"algo_psets");
33 LogDebug(
"CSCSegment|CSC")<<
"CSCSegmentBuilder algorithm name: " << algoName;
36 std::vector<edm::ParameterSet> segAlgoPSet = 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 create(algoName, segAlgoPSet[algoToType[
j]-1]);
56 LogDebug(
"CSCSegment|CSC")<<
"using algorithm #" << algoToType[
j] <<
" for chamber type " << chType[
j];
64 for (std::map<std::string, CSCSegmentAlgorithm*>::iterator it =
algoMap.begin();it !=
algoMap.end(); it++){
65 delete ((*it).second);
71 LogDebug(
"CSCSegment|CSC")<<
"Total number of rechits in this event: " << recHits->size();
74 std::vector<CSCDetId>::const_iterator chIt;
79 for(chIt=chambers.begin(); chIt != chambers.end(); ++chIt)
80 if (((*it2).cscDetId().chamber() == (*chIt).chamber()) &&
81 ((*it2).cscDetId().station() == (*chIt).station()) &&
82 ((*it2).cscDetId().ring() == (*chIt).ring()) &&
83 ((*it2).cscDetId().endcap() == (*chIt).endcap()))
87 chambers.push_back((*it2).cscDetId().chamberId());
90 for(chIt=chambers.begin(); chIt != chambers.end(); ++chIt) {
92 std::vector<const CSCRecHit2D*> cscRecHits;
98 std::vector<int> hitPerLayer(6);
101 hitPerLayer[(*rechit).cscDetId().layer()-1]++;
102 cscRecHits.push_back(&(*rechit));
105 LogDebug(
"CSCSegment|CSC") <<
"found " << cscRecHits.size() <<
" rechits in chamber " << *chIt;
110 LogDebug(
"CSCSegment|CSC") <<
"found " << segv.size() <<
" segments in chamber " << *chIt;
113 oc.put((*chIt), segv.begin(), segv.end());
CSCSegmentBuilder(const edm::ParameterSet &)
T getParameter(std::string const &) const
void build(const CSCRecHit2DCollection *rechits, CSCSegmentCollection &oc)
std::pair< const_iterator, const_iterator > range
iterator range
std::map< std::string, CSCSegmentAlgorithm * > algoMap
std::string chamberTypeName() const
const CSCGeometry * geom_
const CSCChamberSpecs * specs() const
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
~CSCSegmentBuilder()
Destructor.
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
static char chambers[264][20]
void setGeometry(const CSCGeometry *geom)
T get(const Candidate &c)
static std::pair< CSCDetId, CSCDetIdSameChamberComparator > cscChamber(CSCDetId id)
Returns a valid DetId + a valid comparator for the RangeMap.