CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
GEMDigitizer Class Reference

#include <GEMDigitizer.h>

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 More...
 
 GEMDigitizer (const edm::ParameterSet &config, CLHEP::HepRandomEngine &)
 
GEMSimSetUpgetGEMSimSetUp ()
 
void setGEMSimSetUp (GEMSimSetUp *simsetup)
 
void setGeometry (const GEMGeometry *geom)
 sets geometry More...
 
 ~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.

12 {
13  modelName_ = config.getParameter<std::string>("digiModel");
14  gemSim_ = GEMSimFactory::get()->create(modelName_, config.getParameter<edm::ParameterSet>("digiModelConfig"));
15  gemSim_->setRandomEngine(eng);
16 }
T getParameter(std::string const &) const
GEMSim * gemSim_
Definition: GEMDigitizer.h:55
std::string modelName_
Definition: GEMDigitizer.h:57
T get(const Candidate &c)
Definition: component.h:56
GEMDigitizer::~GEMDigitizer ( )

Definition at line 19 of file GEMDigitizer.cc.

References gemSim_.

20 {
21  if(gemSim_) delete gemSim_;
22 }
GEMSim * gemSim_
Definition: GEMDigitizer.h:55

Member Function Documentation

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

Definition at line 25 of file GEMDigitizer.cc.

References GEMGeometry::etaPartitions(), edm::hlt::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().

28 {
30 
31  // arrange the hits by roll
32  std::map<int, edm::PSimHitContainer> hitMap;
33  for(auto &hit: simHits)
34  {
35  hitMap[hit.detUnitId()].push_back(hit);
36  }
37 
38  if ( ! geometry_)
39  {
40  throw cms::Exception("Configuration")
41  << "GEMDigitizer::digitize() - No GEMGeometry present in the configuration file."
42  << "Add the service in the configuration file or remove the modules that require it.";
43  }
44 
45  auto etaPartitions = geometry_->etaPartitions() ;
46  for(auto &p: etaPartitions)
47  {
48  const auto & partSimHits = hitMap[p->id()];
49 
50  //LogDebug("GEMDigitizer") << "GEMDigitizer: found " << partSimHits.size() <<" hit(s) in the eta partition";
51 
52  gemSim_->simulate(p, partSimHits);
54  gemSim_->fillDigis(p->id(), digis);
55  digiSimLinks.insert(gemSim_->stripDigiSimLinks());
56  }
57 }
virtual void fillDigis(int rollDetId, GEMDigiCollection &digis)
Definition: GEMSim.cc:6
GEMSim * gemSim_
Definition: GEMDigitizer.h:55
const StripDigiSimLinks & stripDigiSimLinks() const
Definition: GEMSim.h:46
const GEMGeometry * geometry_
Definition: GEMDigitizer.h:54
void setGEMSimSetUp(GEMSimSetUp *setup)
Definition: GEMSim.h:42
virtual void simulate(const GEMEtaPartition *roll, const edm::PSimHitContainer &rpcHits)=0
GEMSimSetUp * simSetUp_
Definition: GEMDigitizer.h:56
virtual void simulateNoise(const GEMEtaPartition *roll)=0
const std::vector< GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM chambers.
Definition: GEMGeometry.cc:57
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().

61 {
62  assert(geometry_ != 0);
63  return dynamic_cast<const GEMEtaPartition *>(geometry_->idToDetUnit(GEMDetId(detId)));
64 }
const GEMGeometry * geometry_
Definition: GEMDigitizer.h:54
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: GEMGeometry.cc:40
GEMSimSetUp* GEMDigitizer::getGEMSimSetUp ( )
inline

Definition at line 47 of file GEMDigitizer.h.

References simSetUp_.

47 { return simSetUp_; }
GEMSimSetUp * simSetUp_
Definition: GEMDigitizer.h:56
void GEMDigitizer::setGEMSimSetUp ( GEMSimSetUp simsetup)
inline

Definition at line 45 of file GEMDigitizer.h.

References simSetUp_.

Referenced by GEMDigiProducer::beginRun().

45 {simSetUp_ = simsetup;}
GEMSimSetUp * simSetUp_
Definition: GEMDigitizer.h:56
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().

43 {geometry_ = geom;}
const GEMGeometry * geometry_
Definition: GEMDigitizer.h:54

Member Data Documentation

GEMSim* GEMDigitizer::gemSim_
private

Definition at line 55 of file GEMDigitizer.h.

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

const GEMGeometry* GEMDigitizer::geometry_
private

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().

GEMSimSetUp* GEMDigitizer::simSetUp_
private

Definition at line 56 of file GEMDigitizer.h.

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