#include <SiPixelDigitizer.h>
Public Member Functions | |
virtual void | accumulate (edm::Event const &e, edm::EventSetup const &c) override |
virtual void | accumulate (PileUpEventPrincipal const &e, edm::EventSetup const &c) override |
virtual void | beginJob () |
virtual void | finalizeEvent (edm::Event &e, edm::EventSetup const &c) override |
virtual void | initializeEvent (edm::Event const &e, edm::EventSetup const &c) override |
SiPixelDigitizer (const edm::ParameterSet &conf, edm::EDProducer &mixMod) | |
virtual | ~SiPixelDigitizer () |
Private Types | |
typedef std::vector< std::string > | vstring |
Private Member Functions | |
void | accumulatePixelHits (edm::Handle< std::vector< PSimHit > >) |
Private Attributes | |
std::unique_ptr < SiPixelDigitizerAlgorithm > | _pixeldigialgo |
std::map< unsigned int, PixelGeomDetUnit * > | detectorUnits |
bool | first |
const std::string | geometryType |
const std::string | hitsProducer |
edm::ESHandle< TrackerGeometry > | pDD |
edm::ESHandle< MagneticField > | pSetup |
CLHEP::HepRandomEngine * | rndEngine |
const vstring | trackerContainers |
Definition at line 44 of file SiPixelDigitizer.h.
typedef std::vector<std::string> cms::SiPixelDigitizer::vstring [private] |
Definition at line 61 of file SiPixelDigitizer.h.
afs cern ch work a aaltunda public www CMSSW_6_2_7 src SimTracker SiPixelDigitizer plugins SiPixelDigitizer cc SiPixelDigitizer::SiPixelDigitizer | ( | const edm::ParameterSet & | conf, |
edm::EDProducer & | mixMod | ||
) | [explicit] |
Definition at line 90 of file SiPixelDigitizer.cc.
References Exception, edm::Service< T >::isAvailable(), and AlCaHLTBitMon_QueryRunRegistry::string.
{ edm::LogInfo ("PixelDigitizer ") <<"Enter the Pixel Digitizer"; const std::string alias ("simSiPixelDigis"); mixMod.produces<edm::DetSetVector<PixelDigi> >().setBranchAlias(alias); mixMod.produces<edm::DetSetVector<PixelDigiSimLink> >().setBranchAlias(alias + "siPixelDigiSimLink"); edm::Service<edm::RandomNumberGenerator> rng; if ( ! rng.isAvailable()) { throw cms::Exception("Configuration") << "SiPixelDigitizer requires the RandomNumberGeneratorService\n" "which is not present in the configuration file. You must add the service\n" "in the configuration file or remove the modules that require it."; } rndEngine = &(rng->getEngine()); _pixeldigialgo.reset(new SiPixelDigitizerAlgorithm(iConfig,(*rndEngine))); }
SiPixelDigitizer::~SiPixelDigitizer | ( | ) | [virtual] |
Definition at line 116 of file SiPixelDigitizer.cc.
void SiPixelDigitizer::accumulate | ( | edm::Event const & | e, |
edm::EventSetup const & | c | ||
) | [override, virtual] |
Implements DigiAccumulatorMixMod.
Definition at line 175 of file SiPixelDigitizer.cc.
References accumulatePixelHits(), edm::Event::getByLabel(), hitsProducer, i, trackerHits::simHits, and GlobalPosition_Frontier_DevDB_cff::tag.
{ edm::Handle<std::vector<PSimHit> > simHits; edm::InputTag tag(hitsProducer, *i); iEvent.getByLabel(tag, simHits); accumulatePixelHits(simHits); } }
void SiPixelDigitizer::accumulate | ( | PileUpEventPrincipal const & | e, |
edm::EventSetup const & | c | ||
) | [override, virtual] |
Implements DigiAccumulatorMixMod.
Definition at line 187 of file SiPixelDigitizer.cc.
References accumulatePixelHits(), PileUpEventPrincipal::getByLabel(), hitsProducer, i, trackerHits::simHits, and GlobalPosition_Frontier_DevDB_cff::tag.
{ edm::Handle<std::vector<PSimHit> > simHits; edm::InputTag tag(hitsProducer, *i); iEvent.getByLabel(tag, simHits); accumulatePixelHits(simHits); } }
void SiPixelDigitizer::accumulatePixelHits | ( | edm::Handle< std::vector< PSimHit > > | hSimHits | ) | [private] |
Definition at line 126 of file SiPixelDigitizer.cc.
References _pixeldigialgo, detectorUnits, LogDebug, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, GloballyPositioned< T >::position(), pSetup, trackerHits::simHits, DetId::subdetId(), and GeomDet::surface().
Referenced by accumulate().
{ std::set<unsigned int> detIds; std::vector<PSimHit> const& simHits = *hSimHits.product(); for(std::vector<PSimHit>::const_iterator it = simHits.begin(), itEnd = simHits.end(); it != itEnd; ++it) { unsigned int detId = (*it).detUnitId(); if(detIds.insert(detId).second) { // The insert succeeded, so this detector element has not yet been processed. unsigned int isub = DetId(detId).subdetId(); if((isub == PixelSubdetector::PixelBarrel) || (isub == PixelSubdetector::PixelEndcap)) { PixelGeomDetUnit* pixdet = detectorUnits[detId]; //access to magnetic field in global coordinates GlobalVector bfield = pSetup->inTesla(pixdet->surface().position()); LogDebug ("PixelDigitizer ") << "B-field(T) at " << pixdet->surface().position() << "(cm): " << pSetup->inTesla(pixdet->surface().position()); _pixeldigialgo->accumulateSimHits(it, itEnd, pixdet, bfield); } } } } }
virtual void cms::SiPixelDigitizer::beginJob | ( | void | ) | [inline, virtual] |
Definition at line 56 of file SiPixelDigitizer.h.
{}
void SiPixelDigitizer::finalizeEvent | ( | edm::Event & | e, |
edm::EventSetup const & | c | ||
) | [override, virtual] |
Implements DigiAccumulatorMixMod.
Definition at line 200 of file SiPixelDigitizer.cc.
{ DetId idet=DetId((*iu)->geographicalId().rawId()); unsigned int isub=idet.subdetId(); if((isub == PixelSubdetector::PixelBarrel) || (isub == PixelSubdetector::PixelEndcap)) { // edm::DetSet<PixelDigi> collector((*iu)->geographicalId().rawId()); edm::DetSet<PixelDigiSimLink> linkcollector((*iu)->geographicalId().rawId()); _pixeldigialgo->digitize(dynamic_cast<PixelGeomDetUnit*>((*iu)), collector.data, linkcollector.data, tTopo); if(collector.data.size() > 0) { theDigiVector.push_back(std::move(collector)); } if(linkcollector.data.size() > 0) { theDigiLinkVector.push_back(std::move(linkcollector)); } } } // Step C: create collection with the cache vector of DetSet std::auto_ptr<edm::DetSetVector<PixelDigi> > output(new edm::DetSetVector<PixelDigi>(theDigiVector) ); std::auto_ptr<edm::DetSetVector<PixelDigiSimLink> > outputlink(new edm::DetSetVector<PixelDigiSimLink>(theDigiLinkVector) ); // Step D: write output to file iEvent.put(output); iEvent.put(outputlink); }
void SiPixelDigitizer::initializeEvent | ( | edm::Event const & | e, |
edm::EventSetup const & | c | ||
) | [override, virtual] |
Implements DigiAccumulatorMixMod.
Definition at line 149 of file SiPixelDigitizer.cc.
References _pixeldigialgo, and first.
{ _pixeldigialgo->init(iSetup); first = false; } _pixeldigialgo->initializeEvent(); iSetup.get<TrackerDigiGeometryRecord>().get(geometryType, pDD); iSetup.get<IdealMagneticFieldRecord>().get(pSetup); // FIX THIS! We only need to clear and (re)fill this map when the geometry type IOV changes. Use ESWatcher to determine this. if(true) { // Replace with ESWatcher detectorUnits.clear(); for(TrackingGeometry::DetUnitContainer::const_iterator iu = pDD->detUnits().begin(); iu != pDD->detUnits().end(); ++iu) { unsigned int detId = (*iu)->geographicalId().rawId(); DetId idet=DetId(detId); unsigned int isub=idet.subdetId(); if((isub == PixelSubdetector::PixelBarrel) || (isub == PixelSubdetector::PixelEndcap)) { PixelGeomDetUnit* pixdet = dynamic_cast<PixelGeomDetUnit*>((*iu)); assert(pixdet != 0); detectorUnits.insert(std::make_pair(detId, pixdet)); } } } }
std::unique_ptr<SiPixelDigitizerAlgorithm> cms::SiPixelDigitizer::_pixeldigialgo [private] |
Definition at line 60 of file SiPixelDigitizer.h.
Referenced by accumulatePixelHits(), and initializeEvent().
std::map<unsigned int, PixelGeomDetUnit*> cms::SiPixelDigitizer::detectorUnits [private] |
Definition at line 67 of file SiPixelDigitizer.h.
Referenced by accumulatePixelHits().
bool cms::SiPixelDigitizer::first [private] |
Definition at line 59 of file SiPixelDigitizer.h.
Referenced by initializeEvent().
const std::string cms::SiPixelDigitizer::geometryType [private] |
Definition at line 64 of file SiPixelDigitizer.h.
const std::string cms::SiPixelDigitizer::hitsProducer [private] |
Definition at line 62 of file SiPixelDigitizer.h.
Referenced by accumulate().
Definition at line 65 of file SiPixelDigitizer.h.
Definition at line 66 of file SiPixelDigitizer.h.
Referenced by accumulatePixelHits().
CLHEP::HepRandomEngine* cms::SiPixelDigitizer::rndEngine [private] |
Definition at line 68 of file SiPixelDigitizer.h.
const vstring cms::SiPixelDigitizer::trackerContainers [private] |
Definition at line 63 of file SiPixelDigitizer.h.