CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

GEMDigitizer Class Reference

#include <GEMDigitizer.h>

List of all members.

Public Types

typedef edm::DetSetVector
< StripDigiSimLink
StripDigiSimLinks

Public Member Functions

void digitize (MixCollection< PSimHit > &simHits, GEMDigiCollection &rpcDigis, StripDigiSimLinks &digiSimLinks)
const GEMEtaPartitionfindDet (int detId) const
 finds the GEM det unit in the geometry associated with this det ID
 GEMDigitizer (const edm::ParameterSet &config, CLHEP::HepRandomEngine &)
GEMSimSetUpgetGEMSimSetUp ()
void setGEMSimSetUp (GEMSimSetUp *simsetup)
void setGeometry (const GEMGeometry *geom)
 sets geometry
 ~GEMDigitizer ()

Private Attributes

GEMSimgemSim_
const GEMGeometrygeometry_
std::string modelName_
GEMSimSetUpsimSetUp_

Detailed Description

Digitizer for GEM

Author:
Vadim Khotilovich

Definition at line 28 of file GEMDigitizer.h.


Member Typedef Documentation

Definition at line 32 of file GEMDigitizer.h.


Constructor & Destructor Documentation

GEMDigitizer::GEMDigitizer ( const edm::ParameterSet config,
CLHEP::HepRandomEngine &  eng 
)

Definition at line 11 of file GEMDigitizer.cc.

References gemSim_, reco::get(), edm::ParameterSet::getParameter(), modelName_, and AlCaHLTBitMon_QueryRunRegistry::string.

{
  modelName_ = config.getParameter<std::string>("digiModel");
  gemSim_ = GEMSimFactory::get()->create(modelName_, config.getParameter<edm::ParameterSet>("digiModelConfig"));
  gemSim_->setRandomEngine(eng);
}
GEMDigitizer::~GEMDigitizer ( )

Definition at line 19 of file GEMDigitizer.cc.

References gemSim_.

{
  if(gemSim_) delete gemSim_;
}

Member Function Documentation

void GEMDigitizer::digitize ( MixCollection< PSimHit > &  simHits,
GEMDigiCollection rpcDigis,
StripDigiSimLinks digiSimLinks 
)

Definition at line 25 of file GEMDigitizer.cc.

References GEMGeometry::etaPartitions(), Exception, GEMSim::fillDigis(), gemSim_, geometry_, edm::DetSetVector< T >::insert(), AlCaHLTBitMon_ParallelJobs::p, GEMSim::setGEMSimSetUp(), simSetUp_, GEMSim::simulate(), GEMSim::simulateNoise(), and GEMSim::stripDigiSimLinks().

Referenced by GEMDigiProducer::produce().

{
  gemSim_->setGEMSimSetUp(simSetUp_);
  
  // arrange the hits by roll
  std::map<int, edm::PSimHitContainer> hitMap;
  for(auto &hit: simHits)
  {
    hitMap[hit.detUnitId()].push_back(hit);
  }

  if ( ! geometry_)
  {
    throw cms::Exception("Configuration")
      << "GEMDigitizer::digitize() - No GEMGeometry present in the configuration file."
      << "Add the service in the configuration file or remove the modules that require it.";
  }

  auto etaPartitions = geometry_->etaPartitions() ;
  for(auto &p: etaPartitions)
  {
    const auto & partSimHits = hitMap[p->id()];

    //LogDebug("GEMDigitizer") << "GEMDigitizer: found " << partSimHits.size() <<" hit(s) in the eta partition";
    
    gemSim_->simulate(p, partSimHits);
    gemSim_->simulateNoise(p);
    gemSim_->fillDigis(p->id(), digis);
    digiSimLinks.insert(gemSim_->stripDigiSimLinks());
  }
}
const GEMEtaPartition * GEMDigitizer::findDet ( int  detId) const

finds the GEM det unit in the geometry associated with this det ID

Definition at line 60 of file GEMDigitizer.cc.

References geometry_, and GEMGeometry::idToDetUnit().

{
  assert(geometry_ != 0);
  return dynamic_cast<const GEMEtaPartition *>(geometry_->idToDetUnit(GEMDetId(detId)));
}
GEMSimSetUp* GEMDigitizer::getGEMSimSetUp ( ) [inline]

Definition at line 47 of file GEMDigitizer.h.

References simSetUp_.

{ return simSetUp_; }
void GEMDigitizer::setGEMSimSetUp ( GEMSimSetUp simsetup) [inline]

Definition at line 45 of file GEMDigitizer.h.

References simSetUp_.

Referenced by GEMDigiProducer::beginRun().

{simSetUp_ = simsetup;}
void GEMDigitizer::setGeometry ( const GEMGeometry geom) [inline]

sets geometry

Definition at line 43 of file GEMDigitizer.h.

References relativeConstraints::geom, and geometry_.

Referenced by GEMDigiProducer::beginRun().


Member Data Documentation

Definition at line 55 of file GEMDigitizer.h.

Referenced by digitize(), GEMDigitizer(), and ~GEMDigitizer().

Definition at line 54 of file GEMDigitizer.h.

Referenced by digitize(), findDet(), and setGeometry().

std::string GEMDigitizer::modelName_ [private]

Definition at line 57 of file GEMDigitizer.h.

Referenced by GEMDigitizer().

Definition at line 56 of file GEMDigitizer.h.

Referenced by digitize(), getGEMSimSetUp(), and setGEMSimSetUp().