84 : firstInitializeEvent_(
true),
85 firstFinalizeEvent_(
true),
87 hitsProducer(iConfig.getParameter<std::
string>(
"hitsProducer")),
88 trackerContainers(iConfig.getParameter<std::
vector<std::
string> >(
"RoutList")),
89 pilotBlades(iConfig.exists(
"enablePilotBlades") ? iConfig.getParameter<bool>(
"enablePilotBlades") :
false),
90 NumberOfEndcapDisks(iConfig.exists(
"NumPixelEndcap") ? iConfig.getParameter<int>(
"NumPixelEndcap") : 2),
94 edm::LogInfo(
"PixelDigitizer ") <<
"Enter the Pixel Digitizer";
108 <<
"SiPixelDigitizer requires the RandomNumberGeneratorService\n"
109 "which is not present in the configuration file. You must add the service\n"
110 "in the configuration file or remove the modules that require it.";
125 size_t globalSimHitIndex,
126 const unsigned int tofBin,
128 if (hSimHits.isValid()) {
129 std::set<unsigned int> detIds;
130 std::vector<PSimHit>
const&
simHits = *hSimHits.product();
132 for (std::vector<PSimHit>::const_iterator it = simHits.begin(), itEnd = simHits.end(); it != itEnd;
133 ++it, ++globalSimHitIndex) {
134 unsigned int detId = (*it).detUnitId();
135 if (detIds.insert(detId).second) {
142 std::map<unsigned int, PixelGeomDetUnit const*>::iterator itDet =
detectorUnits.find(detId);
145 auto pixdet = itDet->second;
146 assert(pixdet !=
nullptr);
149 LogDebug(
"PixelDigitizer ") <<
"B-field(T) at " << pixdet->surface().position()
150 <<
"(cm): " <<
pSetup->
inTesla(pixdet->surface().position());
152 it, itEnd, globalSimHitIndex, tofBin, pixdet, bfield, tTopo,
randomEngine_);
184 unsigned int detId = iu->geographicalId().rawId();
185 if (iu->type().isTrackerPixel()) {
187 assert(pixdet !=
nullptr);
188 if (iu->subDetector() ==
190 unsigned int disk = tTopo->
layer(detId);
209 if ((*i).find(
std::string(
"HighTof")) != std::string::npos)
232 if ((*i).find(
std::string(
"HighTof")) != std::string::npos)
249 std::vector<edm::DetSet<PixelDigi> > theDigiVector;
250 std::vector<edm::DetSet<PixelDigiSimLink> > theDigiLinkVector;
259 std::unique_ptr<PixelFEDChannelCollection> PixelFEDChannelCollection_ =
261 if (PixelFEDChannelCollection_ ==
nullptr) {
262 throw cms::Exception(
"NullPointerError") <<
"PixelFEDChannelCollection not set in chooseScenario function.\n";
268 if (iu->type().isTrackerPixel()) {
275 dynamic_cast<const PixelGeomDetUnit*>(iu), collector.data, linkcollector.data, tTopo,
randomEngine_);
276 if (!collector.data.empty()) {
277 theDigiVector.push_back(
std::move(collector));
279 if (!linkcollector.data.empty()) {
280 theDigiLinkVector.push_back(
std::move(linkcollector));
287 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 edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
const TrackerGeometry * pDD
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
const int NumberOfEndcapDisks
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
const MagneticField * pSetup
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
std::unique_ptr< PileupMixingContent > PileupInfo_
const std::string hitsProducer
bool getData(T &iHolder) const
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
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > pDDToken_
void accumulatePixelHits(edm::Handle< std::vector< PSimHit > >, size_t globalSimHitIndex, const unsigned int tofBin, edm::EventSetup const &c)
std::unique_ptr< SiPixelDigitizerAlgorithm > _pixeldigialgo
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void accumulate(edm::Event const &e, edm::EventSetup const &c) override
Log< level::Info, false > LogInfo
CLHEP::HepRandomEngine * randomEngine_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > pSetupToken_
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_
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. ...