88 : firstInitializeEvent_(
true),
89 firstFinalizeEvent_(
true),
92 trackerContainers(iConfig.getParameter<
std::vector<
std::
string> >(
"RoutList")),
94 pilotBlades(iConfig.exists(
"enablePilotBlades") ? iConfig.getParameter<
bool>(
"enablePilotBlades") :
false),
96 edm::LogInfo(
"PixelDigitizer ") <<
"Enter the Pixel Digitizer";
108 if (!rng.isAvailable()) {
110 <<
"SiPixelDigitizer requires the RandomNumberGeneratorService\n" 111 "which is not present in the configuration file. You must add the service\n" 112 "in the configuration file or remove the modules that require it.";
127 size_t globalSimHitIndex,
128 const unsigned int tofBin,
130 if (hSimHits.isValid()) {
131 std::set<unsigned int> detIds;
132 std::vector<PSimHit>
const&
simHits = *hSimHits.product();
136 for (std::vector<PSimHit>::const_iterator it = simHits.begin(), itEnd = simHits.end(); it != itEnd;
137 ++it, ++globalSimHitIndex) {
138 unsigned int detId = (*it).detUnitId();
139 if (detIds.insert(detId).second) {
146 std::map<unsigned int, PixelGeomDetUnit const*>::iterator itDet =
detectorUnits.find(detId);
149 auto pixdet = itDet->second;
150 assert(pixdet !=
nullptr);
153 LogDebug(
"PixelDigitizer ") <<
"B-field(T) at " << pixdet->surface().position()
154 <<
"(cm): " <<
pSetup->
inTesla(pixdet->surface().position());
156 it, itEnd, globalSimHitIndex, tofBin, pixdet, bfield, tTopo,
randomEngine_);
190 unsigned int detId = iu->geographicalId().rawId();
191 if (iu->type().isTrackerPixel()) {
193 assert(pixdet !=
nullptr);
194 if (iu->subDetector() ==
196 unsigned int disk = tTopo->
layer(detId);
215 if ((*i).find(
std::string(
"HighTof")) != std::string::npos)
238 if ((*i).find(
std::string(
"HighTof")) != std::string::npos)
257 std::vector<edm::DetSet<PixelDigi> > theDigiVector;
258 std::vector<edm::DetSet<PixelDigiSimLink> > theDigiLinkVector;
268 std::unique_ptr<PixelFEDChannelCollection> PixelFEDChannelCollection_ =
270 if (PixelFEDChannelCollection_ ==
nullptr) {
271 throw cms::Exception(
"NullPointerError") <<
"PixelFEDChannelCollection not set in chooseScenario function.\n";
277 if (iu->type().isTrackerPixel()) {
284 dynamic_cast<const PixelGeomDetUnit*>(iu), collector.data, linkcollector.data, tTopo,
randomEngine_);
285 if (!collector.data.empty()) {
286 theDigiVector.push_back(
std::move(collector));
288 if (!linkcollector.data.empty()) {
289 theDigiLinkVector.push_back(
std::move(linkcollector));
296 std::unique_ptr<edm::DetSetVector<PixelDigiSimLink> > outputlink(
~SiPixelDigitizer() override
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
void finalizeEvent(edm::Event &e, edm::EventSetup const &c) override
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
const int NumberOfEndcapDisks
edm::ESHandle< MagneticField > pSetup
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
std::unique_ptr< PileupMixingContent > PileupInfo_
const std::string hitsProducer
SiPixelDigitizer(const edm::ParameterSet &conf, edm::ProducesCollector, edm::ConsumesCollector &iC)
std::map< unsigned int, PixelGeomDetUnit const * > detectorUnits
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, edm::EventSetup const &c)
edm::ESHandle< TrackerGeometry > pDD
std::unique_ptr< SiPixelDigitizerAlgorithm > _pixeldigialgo
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
void accumulate(edm::Event const &e, edm::EventSetup const &c) override
Namespace of DDCMS conversion namespace.
CLHEP::HepRandomEngine * randomEngine_
const std::string geometryType
unsigned int layer(const DetId &id) const
const vstring trackerContainers
bool getByLabel(edm::InputTag const &tag, edm::Handle< T > &result) const
StreamID streamID() const
bool firstInitializeEvent_
T const * product() const
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
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. ...