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))
87 <<
"SiStripDigitizer requires the RandomNumberGeneratorService\n"
88 "which is not present in the configuration file. You must add the service\n"
89 "in the configuration file or remove the modules that require it.";
99 const TrackerTopology *tTopo,
size_t globalSimHitIndex, CLHEP::HepRandomEngine* engine ) {
104 if(hSimHits.isValid()) {
105 std::set<unsigned int> detIds;
106 std::vector<PSimHit>
const&
simHits = *hSimHits.product();
107 for(std::vector<PSimHit>::const_iterator it = simHits.begin(), itEnd = simHits.end(); it != itEnd; ++it, ++globalSimHitIndex ) {
108 unsigned int detId = (*it).detUnitId();
109 if(detIds.insert(detId).second) {
116 LogDebug (
"Digitizer ") <<
"B-field(T) at " << stripdet->surface().position() <<
"(cm): "
117 <<
pSetup->inTesla(stripdet->surface().position());
118 theDigiAlgo->accumulateSimHits(it, itEnd, globalSimHitIndex, stripdet, bfield, tTopo, engine);
196 for(TrackingGeometry::DetUnitContainer::const_iterator iu =
pDD->detUnits().begin(); iu !=
pDD->detUnits().end(); ++iu) {
197 unsigned int detId = (*iu)->geographicalId().rawId();
205 assert(stripdet != 0);
224 std::vector<edm::DetSet<SiStripDigi> > theDigiVector;
225 std::vector<edm::DetSet<SiStripRawDigi> > theRawDigiVector;
229 theDigiVector.reserve(10000);
230 theDigiVector.clear();
232 for(TrackingGeometry::DetUnitContainer::const_iterator iu =
pDD->detUnits().begin(); iu !=
pDD->detUnits().end(); iu ++){
243 theDigiAlgo->digitize(collectorZS,collectorRaw,collectorLink,sgd,
246 if(collectorZS.data.size()>0){
247 theDigiVector.push_back(collectorZS);
248 if( !collectorLink.data.empty() ) pOutputDigiSimLink->insert(collectorLink);
251 if(collectorRaw.data.size()>0){
252 theRawDigiVector.push_back(collectorRaw);
253 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
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. ...
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
CLHEP::HepRandomEngine * randomEngine(edm::StreamID const &streamID)
SiStripDigitizer(const edm::ParameterSet &conf, edm::one::EDProducerBase &mixMod, edm::ConsumesCollector &iC)
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
void accumulateStripHits(edm::Handle< std::vector< PSimHit > >, const TrackerTopology *tTopo, size_t globalSimHitIndex, CLHEP::HepRandomEngine *)
unsigned int value() const
std::unique_ptr< SiStripDigitizerAlgorithm > theDigiAlgo
edm::ESHandle< MagneticField > pSetup
const std::string geometryType
T const * product() const
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &) const =0
Use this engine in event methods.
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_