24 theLayersNeeded(p.getParameter<unsigned int>(
"layersNeeded")),
25 digitizeBadChambers_(p.getParameter<bool>(
"digitizeBadChambers"))
53 std::map<int, edm::PSimHitContainer> hitMap;
55 hitItr != simHits.
end(); ++hitItr)
57 hitMap[hitItr->detUnitId()].push_back(*hitItr);
61 std::map<int, std::set<int> > layersInChamberHit;
62 for(std::map<int, edm::PSimHitContainer>::const_iterator hitMapItr = hitMap.begin();
63 hitMapItr != hitMap.end(); ++hitMapItr)
67 layersInChamberHit[chamberId].insert(cscDetId.
layer());
77 for(std::map<int, edm::PSimHitContainer>::const_iterator hitMapItr = hitMap.begin();
78 hitMapItr != hitMap.end(); ++hitMapItr)
80 int chamberId =
CSCDetId(hitMapItr->first).chamberId();
81 unsigned int nLayersInChamberHit = layersInChamberHit[chamberId].size();
89 std::vector<CSCDetectorHit> newWireHits, newStripHits;
91 LogTrace(
"CSCDigitizer") <<
"CSCDigitizer: found " << layerSimHits.size() <<
" hit(s) in layer"
99 if(!newWireHits.empty()) {
118 for(std::list<int>::const_iterator missingLayerItr = missingLayers.begin();
119 missingLayerItr != missingLayers.end(); ++missingLayerItr)
131 std::map<int, std::list<int> > layersInChamberWithDigi;
133 j!=stripDigis.end();
j++)
137 if((*j).second.first != (*j).second.second)
140 layersInChamberWithDigi[chamberId].push_back(layerId.
layer());
144 std::list<int> oneThruSix;
145 for(
int i = 1;
i <=6; ++
i)
146 oneThruSix.push_back(
i);
148 for(
std::map<
int, std::list<int> >::iterator layersInChamberWithDigiItr = layersInChamberWithDigi.begin();
149 layersInChamberWithDigiItr != layersInChamberWithDigi.end(); ++ layersInChamberWithDigiItr)
151 std::list<int> & layersHit = layersInChamberWithDigiItr->second;
155 std::list<int> missingLayers(6);
156 std::list<int>::iterator lastLayerMissing =
157 set_difference(oneThruSix.begin(), oneThruSix.end(),
158 layersHit.begin(), layersHit.end(), missingLayers.begin());
159 int chamberId = layersInChamberWithDigiItr->first;
160 for(std::list<int>::iterator layerMissingItr = missingLayers.begin();
161 layerMissingItr != lastLayerMissing; ++layerMissingItr)
164 result.push_back(chamberId + *layerMissingItr);
205 <<
"\nPerhaps your signal or pileup dataset are not compatible with the current release?";
207 return dynamic_cast<const CSCLayer *
>(detUnit);
CSCDriftSim * theDriftSim
T getParameter(std::string const &) const
std::vector< CSCDetectorHit > & simulate(const CSCLayer *layer, const std::vector< CSCDetectorHit > &wireHits)
unsigned int theLayersNeeded
HepPDT::ParticleDataTable ParticleDataTable
void fillMissingLayer(const CSCLayer *layer, const CSCComparatorDigiCollection &comparators, CSCStripDigiCollection &digis)
const CSCLayer * findLayer(int detId) const
finds the layer in the geometry associated with this det ID
void setStripConditions(CSCStripConditions *cond)
std::list< int > layersMissing(const CSCStripDigiCollection &stripDigis) const
finds which layers, 1-6, aren't in the current list
void setRandomEngine(CLHEP::HepRandomEngine &engine)
void setRandomEngine(CLHEP::HepRandomEngine &engine)
void setMagneticField(const MagneticField *field)
bool digitizeBadChambers_
const DigiSimLinks & digiSimLinks() const
CSCStripElectronicsSim * theStripElectronicsSim
CSCDigitizer(const edm::ParameterSet &p)
configurable parameters
CSCNeutronReader * theNeutronReader
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
const CSCGeometry * theCSCGeometry
void doAction(MixCollection< PSimHit > &simHits, CSCWireDigiCollection &wireDigis, CSCStripDigiCollection &stripDigis, CSCComparatorDigiCollection &comparators, DigiSimLinks &wireDigiSimLinks, DigiSimLinks &stripDigiSimLinks)
CSCDetId chamberId() const
void setStripConditions(CSCStripConditions *cond)
CSCWireHitSim * theWireHitSim
void setRandomEngine(CLHEP::HepRandomEngine &engine)
void setParticleDataTable(const ParticleDataTable *pdt)
std::vector< CSCDetectorHit > & simulate(const CSCLayer *layer, const edm::PSimHitContainer &simHits)
void simulate(const CSCLayer *layer, const std::vector< CSCDetectorHit > &inputHits)
void fillDigis(CSCStripDigiCollection &digis, CSCComparatorDigiCollection &comparators)
void fillDigis(CSCWireDigiCollection &digis)
void insert(detset const &s)
Insert the given DetSet.
CSCWireElectronicsSim * theWireElectronicsSim
void setRandomEngine(CLHEP::HepRandomEngine &engine)
std::vector< PSimHit > PSimHitContainer
virtual bool isInBadChamber(const CSCDetId &id) const
is supplied layer/chamber flagged as bad? (default impl. is no)
void setMagneticField(const MagneticField *field)
sets the magnetic field
void addHits(std::map< int, edm::PSimHitContainer > &hitMap)
void setParticleDataTable(const ParticleDataTable *pdt)
CSCStripHitSim * theStripHitSim
CSCStripConditions * theConditions