59 gainLabel(conf.getParameter<std::
string>(
"Gain")),
60 hitsProducer(conf.getParameter<std::
string>(
"hitsProducer")),
61 trackerContainers(conf.getParameter<std::vector<std::
string> >(
"ROUList")),
62 ZSDigi(conf.getParameter<edm::
ParameterSet>(
"DigiModeList").getParameter<std::
string>(
"ZSDigi")),
63 SCDigi(conf.getParameter<edm::
ParameterSet>(
"DigiModeList").getParameter<std::
string>(
"SCDigi")),
64 VRDigi(conf.getParameter<edm::
ParameterSet>(
"DigiModeList").getParameter<std::
string>(
"VRDigi")),
65 PRDigi(conf.getParameter<edm::
ParameterSet>(
"DigiModeList").getParameter<std::
string>(
"PRDigi")),
66 geometryType(conf.getParameter<std::
string>(
"GeometryType")),
67 useConfFromDB(conf.getParameter<bool>(
"TrackerConfigurationFromDB")),
68 zeroSuppression(conf.getParameter<bool>(
"ZeroSuppression")),
69 makeDigiSimLinks_(conf.getUntrackedParameter<bool>(
"makeDigiSimLinks",
false))
85 <<
"SiStripDigitizer requires the RandomNumberGeneratorService\n"
86 "which is not present in the configuration file. You must add the service\n"
87 "in the configuration file or remove the modules that require it.";
97 const TrackerTopology *tTopo,
size_t globalSimHitIndex,
const unsigned int tofBin, CLHEP::HepRandomEngine* engine ) {
102 if(hSimHits.isValid()) {
103 std::set<unsigned int> detIds;
104 std::vector<PSimHit>
const&
simHits = *hSimHits.product();
105 for(std::vector<PSimHit>::const_iterator it = simHits.begin(), itEnd = simHits.end(); it != itEnd; ++it, ++globalSimHitIndex ) {
106 unsigned int detId = (*it).detUnitId();
107 if(detIds.insert(detId).second) {
114 LogDebug (
"Digitizer ") <<
"B-field(T) at " << stripdet->surface().position() <<
"(cm): "
115 <<
pSetup->inTesla(stripdet->surface().position());
116 theDigiAlgo->accumulateSimHits(it, itEnd, globalSimHitIndex, tofBin, stripdet, bfield, tTopo, engine);
198 for(TrackingGeometry::DetUnitContainer::const_iterator iu =
pDD->detUnits().begin(); iu !=
pDD->detUnits().end(); ++iu) {
199 unsigned int detId = (*iu)->geographicalId().rawId();
200 if((*iu)->type().isTrackerStrip()) {
221 std::vector<edm::DetSet<SiStripDigi> > theDigiVector;
222 std::vector<edm::DetSet<SiStripRawDigi> > theRawDigiVector;
226 theDigiVector.reserve(10000);
227 theDigiVector.clear();
229 for(TrackingGeometry::DetUnitContainer::const_iterator iu =
pDD->detUnits().begin(); iu !=
pDD->detUnits().end(); iu ++){
240 theDigiAlgo->digitize(collectorZS,collectorRaw,collectorLink,sgd,
243 if(collectorZS.data.size()>0){
244 theDigiVector.push_back(collectorZS);
245 if( !collectorLink.data.empty() ) pOutputDigiSimLink->insert(collectorLink);
248 if(collectorRaw.data.size()>0){
249 theRawDigiVector.push_back(collectorRaw);
250 if( !collectorLink.data.empty() ) pOutputDigiSimLink->insert(collectorLink);
const vstring trackerContainers
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
void accumulateStripHits(edm::Handle< std::vector< PSimHit > >, const TrackerTopology *tTopo, size_t globalSimHitIndex, const unsigned int tofBin, CLHEP::HepRandomEngine *)
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
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
std::map< uint32_t, std::vector< int > > theDetIdList
virtual ~SiStripDigitizer()
bool isTrackerStrip(const 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. ...
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
CLHEP::HepRandomEngine * randomEngine(edm::StreamID const &streamID)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
unsigned int value() const
std::unique_ptr< SiStripDigitizerAlgorithm > theDigiAlgo
edm::ESHandle< MagneticField > pSetup
const std::string geometryType
T const * product() const
SiStripDigitizer(const edm::ParameterSet &conf, edm::stream::EDProducerBase &mixMod, edm::ConsumesCollector &iC)
bool getByLabel(edm::InputTag const &tag, edm::Handle< T > &result) const
StreamID streamID() 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 std::string gainLabel
std::map< unsigned int, StripGeomDetUnit const * > detectorUnits
std::vector< CLHEP::HepRandomEngine * > randomEngines_