59 #include "CLHEP/Random/RandomEngine.h"
62 gainLabel(conf.getParameter<std::
string>(
"Gain")),
63 hitsProducer(conf.getParameter<std::
string>(
"hitsProducer")),
64 trackerContainers(conf.getParameter<std::vector<std::
string> >(
"ROUList")),
65 ZSDigi(conf.getParameter<edm::
ParameterSet>(
"DigiModeList").getParameter<std::
string>(
"ZSDigi")),
66 SCDigi(conf.getParameter<edm::
ParameterSet>(
"DigiModeList").getParameter<std::
string>(
"SCDigi")),
67 VRDigi(conf.getParameter<edm::
ParameterSet>(
"DigiModeList").getParameter<std::
string>(
"VRDigi")),
68 PRDigi(conf.getParameter<edm::
ParameterSet>(
"DigiModeList").getParameter<std::
string>(
"PRDigi")),
69 geometryType(conf.getParameter<std::
string>(
"GeometryType")),
70 useConfFromDB(conf.getParameter<bool>(
"TrackerConfigurationFromDB")),
71 zeroSuppression(conf.getParameter<bool>(
"ZeroSuppression")),
72 makeDigiSimLinks_(conf.getUntrackedParameter<bool>(
"makeDigiSimLinks",
false))
88 <<
"SiStripDigitizer requires the RandomNumberGeneratorService\n"
89 "which is not present in the configuration file. You must add the service\n"
90 "in the configuration file or remove the modules that require it.";
108 if(hSimHits.isValid()) {
109 std::set<unsigned int> detIds;
110 std::vector<PSimHit>
const&
simHits = *hSimHits.product();
111 for(std::vector<PSimHit>::const_iterator it = simHits.begin(), itEnd = simHits.end(); it != itEnd; ++it, ++globalSimHitIndex ) {
112 unsigned int detId = (*it).detUnitId();
113 if(detIds.insert(detId).second) {
122 theDigiAlgo->accumulateSimHits(it, itEnd, globalSimHitIndex, stripdet, bfield, tTopo);
200 for(TrackingGeometry::DetUnitContainer::const_iterator iu =
pDD->detUnits().begin(); iu !=
pDD->detUnits().end(); ++iu) {
201 unsigned int detId = (*iu)->geographicalId().rawId();
209 assert(stripdet != 0);
228 std::vector<edm::DetSet<SiStripDigi> > theDigiVector;
229 std::vector<edm::DetSet<SiStripRawDigi> > theRawDigiVector;
233 theDigiVector.reserve(10000);
234 theDigiVector.clear();
236 for(TrackingGeometry::DetUnitContainer::const_iterator iu =
pDD->detUnits().begin(); iu !=
pDD->detUnits().end(); iu ++){
247 theDigiAlgo->digitize(collectorZS,collectorRaw,collectorLink,sgd,
248 gainHandle,thresholdHandle,noiseHandle,pedestalHandle);
250 if(collectorZS.data.size()>0){
251 theDigiVector.push_back(collectorZS);
252 if( !collectorLink.data.empty() ) pOutputDigiSimLink->insert(collectorLink);
255 if(collectorRaw.data.size()>0){
256 theRawDigiVector.push_back(collectorRaw);
257 if( !collectorLink.data.empty() ) pOutputDigiSimLink->insert(collectorLink);
const vstring trackerContainers
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::ESHandle< TrackerGeometry > pDD
const bool zeroSuppression
virtual void initializeEvent(edm::Event const &e, edm::EventSetup const &c) override
const std::string hitsProducer
virtual void finalizeEvent(edm::Event &e, edm::EventSetup const &c) override
virtual void accumulate(edm::Event const &e, edm::EventSetup const &c) override
const Plane & surface() const
The nominal surface of the GeomDet.
std::map< uint32_t, std::vector< int > > theDetIdList
virtual ~SiStripDigitizer()
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. ...
std::map< unsigned int, StripGeomDetUnit * > detectorUnits
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
SiStripDigitizer(const edm::ParameterSet &conf, edm::one::EDProducerBase &mixMod, edm::ConsumesCollector &iC)
virtual CLHEP::HepRandomEngine & getEngine() const =0
Use this to get the random number engine, this is the only function most users should call...
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::unique_ptr< SiStripDigitizerAlgorithm > theDigiAlgo
void accumulateStripHits(edm::Handle< std::vector< PSimHit > >, const TrackerTopology *tTopo, size_t globalSimHitIndex)
edm::ESHandle< MagneticField > pSetup
const std::string geometryType
T const * product() const
bool getByLabel(edm::InputTag const &tag, edm::Handle< T > &result) const
const bool makeDigiSimLinks_
Whether or not to create the association to sim truth collection. Set in configuration.
volatile std::atomic< bool > shutdown_flag false
const PositionType & position() const
const std::string gainLabel
CLHEP::HepRandomEngine * rndEngine