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();
67 for (std::map<int, edm::PSimHitContainer>::const_iterator hitMapItr = hitMap.begin(); hitMapItr != hitMap.end();
71 int endc =
detId.endcap();
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) {
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);
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;
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);
CSCDriftSim * theDriftSim
Log< level::Info, true > LogVerbatim
std::vector< CSCDetectorHit > & simulate(const CSCLayer *layer, const std::vector< CSCDetectorHit > &wireHits)
const CSCLayer * findLayer(int detId) const
finds the layer in the geometry associated with this det ID
unsigned int theLayersNeeded
const DigiSimLinks & digiSimLinks() const
HepPDT::ParticleDataTable ParticleDataTable
std::vector< CSCDetectorHit > & simulate(const CSCLayer *layer, const edm::PSimHitContainer &simHits, CLHEP::HepRandomEngine *)
void setStripConditions(CSCStripConditions *cond)
CSCDigitizer(const CSCDigitizer &)=delete
void setMagneticField(const MagneticField *field)
bool digitizeBadChambers_
CSCStripElectronicsSim * theStripElectronicsSim
CSCNeutronReader * theNeutronReader
const CSCGeometry * theCSCGeometry
void fillDigis(CSCWireDigiCollection &digis, CLHEP::HepRandomEngine *)
virtual bool isInBadChamber(const CSCDetId &id) const
is supplied layer/chamber flagged as bad? (default impl. is no)
void fillMissingLayer(const CSCLayer *layer, const CSCComparatorDigiCollection &comparators, CSCStripDigiCollection &digis, CLHEP::HepRandomEngine *)
void setStripConditions(CSCStripConditions *cond)
CSCWireHitSim * theWireHitSim
std::list< int > layersMissing(const CSCStripDigiCollection &stripDigis) const
finds which layers, 1-6, aren't in the current list
CSCDetId chamberId() const
void setParticleDataTable(const ParticleDataTable *pdt)
void doAction(MixCollection< PSimHit > &simHits, CSCWireDigiCollection &wireDigis, CSCStripDigiCollection &stripDigis, CSCComparatorDigiCollection &comparators, DigiSimLinks &wireDigiSimLinks, DigiSimLinks &stripDigiSimLinks, CLHEP::HepRandomEngine *)
void insert(detset const &s)
Insert the given DetSet.
CSCWireElectronicsSim * theWireElectronicsSim
void fillDigis(CSCStripDigiCollection &digis, CSCComparatorDigiCollection &comparators, CLHEP::HepRandomEngine *)
void addHits(std::map< int, edm::PSimHitContainer > &hitMap, CLHEP::HepRandomEngine *)
std::vector< PSimHit > PSimHitContainer
void simulate(const CSCLayer *layer, const std::vector< CSCDetectorHit > &inputHits, CLHEP::HepRandomEngine *)
void setMagneticField(const MagneticField *field)
sets the magnetic field
void setParticleDataTable(const ParticleDataTable *pdt)
CSCStripHitSim * theStripHitSim
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
CSCStripConditions * theConditions