21 theNeutronReader(nullptr),
22 theCSCGeometry(nullptr),
23 theLayersNeeded(
p.getParameter<unsigned
int>(
"layersNeeded")),
24 digitizeBadChambers_(
p.getParameter<
bool>(
"digitizeBadChambers")) {
25 if (
p.getParameter<
bool>(
"doNeutrons")) {
45 CLHEP::HepRandomEngine *engine) {
47 std::map<int, edm::PSimHitContainer> hitMap;
49 hitMap[hitItr->detUnitId()].push_back(*hitItr);
53 std::map<int, std::set<int>> layersInChamberHit;
54 for (std::map<int, edm::PSimHitContainer>::const_iterator hitMapItr = hitMap.begin(); hitMapItr != hitMap.end();
58 layersInChamberHit[chamberId].insert(cscDetId.
layer());
67 for (std::map<int, edm::PSimHitContainer>::const_iterator hitMapItr = hitMap.begin(); hitMapItr != hitMap.end();
76 unsigned int nLayersInChamberHitForWireDigis = 0;
78 std::set<int> layersInME1a = layersInChamberHit[
CSCDetId(endc,
stat, 4,
cham, 0)];
79 std::set<int> layersInME11 = layersInChamberHit[chamberId];
80 layersInME11.insert(layersInME1a.begin(), layersInME1a.end());
81 nLayersInChamberHitForWireDigis = layersInME11.size();
83 std::set<int> layersInME1b = layersInChamberHit[
CSCDetId(endc,
stat, 1,
cham, 0)];
84 std::set<int> layersInME11 = layersInChamberHit[chamberId];
85 layersInME11.insert(layersInME1b.begin(), layersInME1b.end());
86 nLayersInChamberHitForWireDigis = layersInME11.size();
88 nLayersInChamberHitForWireDigis = layersInChamberHit[chamberId].size();
90 unsigned int nLayersInChamberHitForStripDigis = layersInChamberHit[chamberId].size();
101 std::vector<CSCDetectorHit> newWireHits, newStripHits;
105 edm::LogVerbatim(
"CSCDigitizer") <<
"[CSCDigitizer] found " << layerSimHits.size() <<
" hit(s) in layer"
113 if (!newWireHits.empty()) {
132 for (std::list<int>::const_iterator missingLayerItr = missingLayers.begin(); missingLayerItr != missingLayers.end();
142 std::map<int, std::list<int>> layersInChamberWithDigi;
146 if ((*j).second.first != (*j).second.second) {
148 layersInChamberWithDigi[chamberId].push_back(layerId.
layer());
152 std::list<int> oneThruSix;
153 for (
int i = 1;
i <= 6; ++
i)
154 oneThruSix.push_back(
i);
156 for (
std::map<
int, std::list<int>>::iterator layersInChamberWithDigiItr = layersInChamberWithDigi.begin();
157 layersInChamberWithDigiItr != layersInChamberWithDigi.end();
158 ++layersInChamberWithDigiItr) {
159 std::list<int> &layersHit = layersInChamberWithDigiItr->second;
162 std::list<int> missingLayers(6);
163 std::list<int>::iterator lastLayerMissing = set_difference(
164 oneThruSix.begin(), oneThruSix.end(), layersHit.begin(), layersHit.end(), missingLayers.begin());
165 int chamberId = layersInChamberWithDigiItr->first;
166 for (std::list<int>::iterator layerMissingItr = missingLayers.begin(); layerMissingItr != lastLayerMissing;
169 result.push_back(chamberId + *layerMissingItr);
188 if (detUnit ==
nullptr) {
190 <<
"\nPerhaps your signal or pileup dataset are not compatible with "
191 "the current release?";
193 return dynamic_cast<const CSCLayer *>(detUnit);