CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

GEMDigiProducer Class Reference

#include <GEMDigiProducer.h>

Inheritance diagram for GEMDigiProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Types

typedef
GEMDigitizer::StripDigiSimLinks 
StripDigiSimLinks

Public Member Functions

virtual void beginRun (edm::Run &, const edm::EventSetup &)
virtual void endRun (edm::Run &, const edm::EventSetup &)
 GEMDigiProducer (const edm::ParameterSet &ps)
virtual void produce (edm::Event &e, const edm::EventSetup &c)
void setGEMSetUp (std::vector< RPCStripNoises::NoiseItem >, std::vector< double >)
virtual ~GEMDigiProducer ()

Private Attributes

std::string collectionXF_
GEMDigitizerdigitizer_
GEMSimSetUpgemSimSetUp_

Detailed Description

Definition at line 16 of file GEMDigiProducer.h.


Member Typedef Documentation

Definition at line 20 of file GEMDigiProducer.h.


Constructor & Destructor Documentation

GEMDigiProducer::GEMDigiProducer ( const edm::ParameterSet ps) [explicit]

Definition at line 30 of file GEMDigiProducer.cc.

References collectionXF_, digitizer_, Exception, gemSimSetUp_, edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

{
  produces<GEMDigiCollection>();
  produces<StripDigiSimLinks>("GEM");

  //Name of Collection used for create the XF 
  collectionXF_ = ps.getParameter<std::string>("InputCollection");

  edm::Service<edm::RandomNumberGenerator> rng;
  if ( ! rng.isAvailable())
  {
   throw cms::Exception("Configuration")
     << "GEMDigiProducer::GEMDigiProducer() - RandomNumberGeneratorService is not present in configuration file.\n"
     << "Add the service in the configuration file or remove the modules that require it.";
  }
  CLHEP::HepRandomEngine& engine = rng->getEngine();

  gemSimSetUp_ =  new GEMSimSetUp(ps);
  digitizer_ = new GEMDigitizer(ps, engine);
}
GEMDigiProducer::~GEMDigiProducer ( ) [virtual]

Definition at line 52 of file GEMDigiProducer.cc.

References digitizer_, and gemSimSetUp_.

{
  delete digitizer_;
  delete gemSimSetUp_;
}

Member Function Documentation

void GEMDigiProducer::beginRun ( edm::Run r,
const edm::EventSetup eventSetup 
) [virtual]

Reimplemented from edm::EDProducer.

Definition at line 59 of file GEMDigiProducer.cc.

References digitizer_, gemSimSetUp_, edm::EventSetup::get(), GEMDigitizer::setGEMSimSetUp(), GEMSimSetUp::setGeometry(), GEMDigitizer::setGeometry(), and GEMSimSetUp::setup().

{
  edm::ESHandle<GEMGeometry> hGeom;
  eventSetup.get<MuonGeometryRecord>().get( hGeom );
  const GEMGeometry *pGeom = &*hGeom;

  /*
  edm::ESHandle<RPCStripNoises> noiseRcd;
  eventSetup.get<RPCStripNoisesRcd>().get(noiseRcd);

  edm::ESHandle<RPCClusterSize> clsRcd;
  eventSetup.get<RPCClusterSizeRcd>().get(clsRcd);

  auto vnoise = noiseRcd->getVNoise();
  auto vcls = clsRcd->getCls();
  */
  std::vector<RPCStripNoises::NoiseItem> vnoise;
  std::vector<float> vcls;

  gemSimSetUp_->setGeometry( pGeom );
  if (vnoise.size()==0 && vcls.size()==0)
    gemSimSetUp_->setup();
  else
    gemSimSetUp_->setup(vnoise, vcls);
  
  digitizer_->setGeometry( pGeom );
  digitizer_->setGEMSimSetUp( gemSimSetUp_ );
}
virtual void GEMDigiProducer::endRun ( edm::Run ,
const edm::EventSetup  
) [inline, virtual]

Reimplemented from edm::EDProducer.

Definition at line 26 of file GEMDigiProducer.h.

{}
void GEMDigiProducer::produce ( edm::Event e,
const edm::EventSetup c 
) [virtual]

Produces the EDM products,

Implements edm::EDProducer.

Definition at line 89 of file GEMDigiProducer.cc.

References collectionXF_, GEMDigitizer::digitize(), digitizer_, edm::Event::getByLabel(), edm::Handle< T >::product(), and edm::Event::put().

{
  edm::Handle<CrossingFrame<PSimHit> > cf;
  e.getByLabel("mix", collectionXF_, cf);

  std::auto_ptr<MixCollection<PSimHit> > hits( new MixCollection<PSimHit>(cf.product()) );

  // Create empty output
  std::auto_ptr<GEMDigiCollection> pDigis(new GEMDigiCollection());
  std::auto_ptr<StripDigiSimLinks> digiSimLinks(new StripDigiSimLinks() );

  // run the digitizer
  digitizer_->digitize(*hits, *pDigis, *digiSimLinks);

  // store them in the event
  e.put(pDigis);
  e.put(digiSimLinks,"GEM");
}
void GEMDigiProducer::setGEMSetUp ( std::vector< RPCStripNoises::NoiseItem ,
std::vector< double >   
)

Member Data Documentation

std::string GEMDigiProducer::collectionXF_ [private]

Definition at line 39 of file GEMDigiProducer.h.

Referenced by GEMDigiProducer(), and produce().

Definition at line 35 of file GEMDigiProducer.h.

Referenced by beginRun(), GEMDigiProducer(), produce(), and ~GEMDigiProducer().

Definition at line 36 of file GEMDigiProducer.h.

Referenced by beginRun(), GEMDigiProducer(), and ~GEMDigiProducer().