83 : firstInitializeEvent_(
true),
84 firstFinalizeEvent_(
true),
86 hitsProducer(iConfig.getParameter<std::
string>(
"hitsProducer")),
87 trackerContainers(iConfig.getParameter<std::
vector<std::
string> >(
"RoutList")),
88 pilotBlades(iConfig.exists(
"enablePilotBlades") ? iConfig.getParameter<bool>(
"enablePilotBlades") :
false),
89 NumberOfEndcapDisks(iConfig.exists(
"NumPixelEndcap") ? iConfig.getParameter<int>(
"NumPixelEndcap") : 2),
93 edm::LogInfo(
"PixelDigitizer ") <<
"Enter the Pixel Digitizer";
107 <<
"SiPixelDigitizer requires the RandomNumberGeneratorService\n"
108 "which is not present in the configuration file. You must add the service\n"
109 "in the configuration file or remove the modules that require it.";
124 size_t globalSimHitIndex,
125 const unsigned int tofBin,
127 if (hSimHits.isValid()) {
128 std::set<unsigned int> detIds;
129 std::vector<PSimHit>
const&
simHits = *hSimHits.product();
131 for (std::vector<PSimHit>::const_iterator it = simHits.begin(), itEnd = simHits.end(); it != itEnd;
132 ++it, ++globalSimHitIndex) {
133 unsigned int detId = (*it).detUnitId();
134 if (detIds.insert(detId).second) {
141 std::map<unsigned int, PixelGeomDetUnit const*>::iterator itDet =
detectorUnits.find(detId);
144 auto pixdet = itDet->second;
145 assert(pixdet !=
nullptr);
148 LogDebug(
"PixelDigitizer ") <<
"B-field(T) at " << pixdet->surface().position()
149 <<
"(cm): " <<
pSetup->
inTesla(pixdet->surface().position());
151 it, itEnd, globalSimHitIndex, tofBin, pixdet, bfield, tTopo,
randomEngine_);
183 unsigned int detId = iu->geographicalId().rawId();
184 if (iu->type().isTrackerPixel()) {
186 assert(pixdet !=
nullptr);
187 if (iu->subDetector() ==
189 unsigned int disk = tTopo->
layer(detId);
208 if ((*i).find(
std::string(
"HighTof")) != std::string::npos)
231 if ((*i).find(
std::string(
"HighTof")) != std::string::npos)
248 std::vector<edm::DetSet<PixelDigi> > theDigiVector;
249 std::vector<edm::DetSet<PixelDigiSimLink> > theDigiLinkVector;
258 std::unique_ptr<PixelFEDChannelCollection> PixelFEDChannelCollection_ =
260 if (PixelFEDChannelCollection_ ==
nullptr) {
261 throw cms::Exception(
"NullPointerError") <<
"PixelFEDChannelCollection not set in chooseScenario function.\n";
267 if (iu->type().isTrackerPixel()) {
274 dynamic_cast<const PixelGeomDetUnit*>(iu), collector.data, linkcollector.data, tTopo,
randomEngine_);
275 if (!collector.data.empty()) {
276 theDigiVector.push_back(
std::move(collector));
278 if (!linkcollector.data.empty()) {
279 theDigiLinkVector.push_back(
std::move(linkcollector));
286 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. ...