74 class HepRandomEngine;
97 hitsProducer(iConfig.getParameter<std::
string>(
"hitsProducer")),
98 trackerContainers(iConfig.getParameter<std::vector<std::
string> >(
"RoutList")),
99 geometryType(iConfig.getParameter<std::
string>(
"PixGeometryType")),
100 pilotBlades(iConfig.exists(
"enablePilotBlades")?iConfig.getParameter<bool>(
"enablePilotBlades"):
false),
101 NumberOfEndcapDisks(iConfig.exists(
"NumPixelEndcap")?iConfig.getParameter<int>(
"NumPixelEndcap"):2)
103 edm::LogInfo (
"PixelDigitizer ") <<
"Enter the Pixel Digitizer";
116 <<
"SiPixelDigitizer requires the RandomNumberGeneratorService\n"
117 "which is not present in the configuration file. You must add the service\n"
118 "in the configuration file or remove the modules that require it.";
125 edm::LogInfo (
"PixelDigitizer ") <<
"Destruct the Pixel Digitizer";
135 size_t globalSimHitIndex,
136 const unsigned int tofBin,
137 CLHEP::HepRandomEngine* engine,
139 if(hSimHits.isValid()) {
140 std::set<unsigned int> detIds;
141 std::vector<PSimHit>
const&
simHits = *hSimHits.product();
145 for(std::vector<PSimHit>::const_iterator it = simHits.begin(), itEnd = simHits.end(); it != itEnd; ++it, ++globalSimHitIndex) {
146 unsigned int detId = (*it).detUnitId();
147 if(detIds.insert(detId).second) {
151 std::map<unsigned int, PixelGeomDetUnit const *>::iterator itDet =
detectorUnits.find(detId);
153 auto pixdet = itDet->second;
157 LogDebug (
"PixelDigitizer ") <<
"B-field(T) at " << pixdet->surface().position() <<
"(cm): "
158 <<
pSetup->inTesla(pixdet->surface().position());
159 _pixeldigialgo->accumulateSimHits(it, itEnd, globalSimHitIndex, tofBin, pixdet, bfield, tTopo, engine);
188 for(TrackingGeometry::DetUnitContainer::const_iterator iu =
pDD->detUnits().begin(); iu !=
pDD->detUnits().end(); ++iu) {
189 unsigned int detId = (*iu)->geographicalId().rawId();
190 if((*iu)->type().isTrackerPixel()) {
194 unsigned int disk = tTopo->
layer(detId);
255 std::vector<edm::DetSet<PixelDigi> > theDigiVector;
256 std::vector<edm::DetSet<PixelDigiSimLink> > theDigiLinkVector;
261 for(TrackingGeometry::DetUnitContainer::const_iterator iu =
pDD->detUnits().begin(); iu !=
pDD->detUnits().end(); iu ++){
263 if((*iu)->type().isTrackerPixel()) {
271 _pixeldigialgo->digitize(dynamic_cast<const PixelGeomDetUnit*>((*iu)),
276 if(collector.data.size() > 0) {
277 theDigiVector.push_back(
std::move(collector));
279 if(linkcollector.data.size() > 0) {
280 theDigiLinkVector.push_back(
std::move(linkcollector));
286 std::auto_ptr<edm::DetSetVector<PixelDigi> >
288 std::auto_ptr<edm::DetSetVector<PixelDigiSimLink> >
293 iEvent.
put(outputlink);
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
virtual void finalizeEvent(edm::Event &e, edm::EventSetup const &c) override
CLHEP::HepRandomEngine * randomEngine(edm::StreamID const &streamID)
const int NumberOfEndcapDisks
std::vector< CLHEP::HepRandomEngine * > randomEngines_
std::map< unsigned int, PixelGeomDetUnit const * > detectorUnits
edm::ESHandle< MagneticField > pSetup
SiPixelDigitizer(const edm::ParameterSet &conf, edm::one::EDProducerBase &mixMod, edm::ConsumesCollector &iC)
const std::string hitsProducer
std::map< std::string, size_t > crossingSimHitIndexOffset_
Offset to add to the index of each sim hit to account for which crossing it's in. ...
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual void initializeEvent(edm::Event const &e, edm::EventSetup const &c) override
void accumulatePixelHits(edm::Handle< std::vector< PSimHit > >, size_t globalSimHitIndex, const unsigned int tofBin, CLHEP::HepRandomEngine *, edm::EventSetup const &c)
edm::ESHandle< TrackerGeometry > pDD
std::unique_ptr< SiPixelDigitizerAlgorithm > _pixeldigialgo
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual void accumulate(edm::Event const &e, edm::EventSetup const &c) override
unsigned int value() const
T const * product() const
const std::string geometryType
bool isTrackerPixel(const GeomDetEnumerators::SubDetector m)
PileupMixingContent * PileupInfo_
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &) const =0
Use this engine in event methods.
unsigned int layer(const DetId &id) const
virtual PileupMixingContent * getEventPileupInfo()
const vstring trackerContainers
bool getByLabel(edm::InputTag const &tag, edm::Handle< T > &result) const
StreamID streamID() const
volatile std::atomic< bool > shutdown_flag false
virtual ~SiPixelDigitizer()