58 #include "CLHEP/Random/RandomEngine.h"
61 gainLabel(conf.getParameter<std::
string>(
"Gain")),
62 hitsProducer(conf.getParameter<std::
string>(
"hitsProducer")),
63 trackerContainers(conf.getParameter<std::vector<std::
string> >(
"ROUList")),
64 ZSDigi(conf.getParameter<edm::
ParameterSet>(
"DigiModeList").getParameter<std::
string>(
"ZSDigi")),
65 SCDigi(conf.getParameter<edm::
ParameterSet>(
"DigiModeList").getParameter<std::
string>(
"SCDigi")),
66 VRDigi(conf.getParameter<edm::
ParameterSet>(
"DigiModeList").getParameter<std::
string>(
"VRDigi")),
67 PRDigi(conf.getParameter<edm::
ParameterSet>(
"DigiModeList").getParameter<std::
string>(
"PRDigi")),
68 geometryType(conf.getParameter<std::
string>(
"GeometryType")),
69 useConfFromDB(conf.getParameter<bool>(
"TrackerConfigurationFromDB")),
70 zeroSuppression(conf.getParameter<bool>(
"ZeroSuppression")),
71 makeDigiSimLinks_(conf.getUntrackedParameter<bool>(
"makeDigiSimLinks",
false))
83 <<
"SiStripDigitizer requires the RandomNumberGeneratorService\n"
84 "which is not present in the configuration file. You must add the service\n"
85 "in the configuration file or remove the modules that require it.";
103 if(hSimHits.isValid()) {
104 std::set<unsigned int> detIds;
105 std::vector<PSimHit>
const&
simHits = *hSimHits.product();
106 for(std::vector<PSimHit>::const_iterator it = simHits.begin(), itEnd = simHits.end(); it != itEnd; ++it, ++globalSimHitIndex ) {
107 unsigned int detId = (*it).detUnitId();
108 if(detIds.insert(detId).second) {
117 theDigiAlgo->accumulateSimHits(it, itEnd, globalSimHitIndex, stripdet, bfield, tTopo);
195 for(TrackingGeometry::DetUnitContainer::const_iterator iu =
pDD->detUnits().begin(); iu !=
pDD->detUnits().end(); ++iu) {
196 unsigned int detId = (*iu)->geographicalId().rawId();
204 assert(stripdet != 0);
223 std::vector<edm::DetSet<SiStripDigi> > theDigiVector;
224 std::vector<edm::DetSet<SiStripRawDigi> > theRawDigiVector;
228 theDigiVector.reserve(10000);
229 theDigiVector.clear();
231 for(TrackingGeometry::DetUnitContainer::const_iterator iu =
pDD->detUnits().begin(); iu !=
pDD->detUnits().end(); iu ++){
242 theDigiAlgo->digitize(collectorZS,collectorRaw,collectorLink,sgd,
243 gainHandle,thresholdHandle,noiseHandle,pedestalHandle);
245 if(collectorZS.data.size()>0){
246 theDigiVector.push_back(collectorZS);
247 if( !collectorLink.data.empty() ) pOutputDigiSimLink->insert(collectorLink);
250 if(collectorRaw.data.size()>0){
251 theRawDigiVector.push_back(collectorRaw);
252 if( !collectorLink.data.empty() ) pOutputDigiSimLink->insert(collectorLink);
const vstring trackerContainers
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.
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.
const PositionType & position() const
SiStripDigitizer(const edm::ParameterSet &conf, edm::EDProducer &mixMod)
const std::string gainLabel
CLHEP::HepRandomEngine * rndEngine