CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
ME0DigiModel Class Referenceabstract

#include <ME0DigiModel.h>

Inheritance diagram for ME0DigiModel:
ME0SimpleModel

Public Types

typedef edm::DetSet< ME0DigiSimLinkME0DigiSimLinks
 
typedef edm::DetSet< StripDigiSimLinkStripDigiSimLinks
 

Public Member Functions

void fillDigis (int rollDetId, ME0DigiCollection &)
 
const ME0GeometrygetGeometry ()
 
const ME0DigiSimLinksme0DigiSimLinks () const
 
void setGeometry (const ME0Geometry *geom)
 
virtual void setup ()=0
 
virtual std::vector< std::pair< int, int > > simulateClustering (const ME0EtaPartition *, const PSimHit *, const int, CLHEP::HepRandomEngine *engine)=0
 
virtual void simulateNoise (const ME0EtaPartition *, CLHEP::HepRandomEngine *engine)=0
 
virtual void simulateSignal (const ME0EtaPartition *, const edm::PSimHitContainer &, CLHEP::HepRandomEngine *engine)=0
 
const StripDigiSimLinksstripDigiSimLinks () const
 
virtual ~ME0DigiModel ()
 

Protected Types

typedef std::multimap< std::pair< unsigned int, int >, const PSimHit *, std::less< std::pair< unsigned int, int > > > DetectorHitMap
 

Protected Member Functions

void addLinks (unsigned int strip, int bx)
 creates links from Digi to SimTrack More...
 
void addLinksWithPartId (unsigned int strip, int bx)
 
 ME0DigiModel (const edm::ParameterSet &)
 

Protected Attributes

DetectorHitMap detectorHitMap_
 
const ME0Geometrygeometry_
 
StripDigiSimLinks stripDigiSimLinks_
 
std::set< std::pair< int, int > > strips_
 
ME0DigiSimLinks theME0DigiSimLinks_
 

Detailed Description

Base Class for the ME0 strip response simulation

Author
Roumyana Hadjiiska

Definition at line 32 of file ME0DigiModel.h.

Member Typedef Documentation

◆ DetectorHitMap

typedef std::multimap<std::pair<unsigned int, int>, const PSimHit*, std::less<std::pair<unsigned int, int> > > ME0DigiModel::DetectorHitMap
protected

Definition at line 72 of file ME0DigiModel.h.

◆ ME0DigiSimLinks

Definition at line 35 of file ME0DigiModel.h.

◆ StripDigiSimLinks

Definition at line 34 of file ME0DigiModel.h.

Constructor & Destructor Documentation

◆ ~ME0DigiModel()

virtual ME0DigiModel::~ME0DigiModel ( )
inlinevirtual

Definition at line 37 of file ME0DigiModel.h.

37 {}

◆ ME0DigiModel()

ME0DigiModel::ME0DigiModel ( const edm::ParameterSet )
inlineprotected

Definition at line 60 of file ME0DigiModel.h.

60 {}

Member Function Documentation

◆ addLinks()

void ME0DigiModel::addLinks ( unsigned int  strip,
int  bx 
)
protected

creates links from Digi to SimTrack

Definition at line 18 of file ME0DigiModel.cc.

18  {
19  std::pair<unsigned int, int> digi(strip, bx);
20  auto channelHitItr = detectorHitMap_.equal_range(digi);
21 
22  // find the fraction contribution for each SimTrack
23  std::map<int, float> simTrackChargeMap;
24  std::map<int, EncodedEventId> eventIdMap;
25  float totalCharge(0.);
26  for (auto hitItr = channelHitItr.first; hitItr != channelHitItr.second; ++hitItr) {
27  const PSimHit *hit(hitItr->second);
28  // might be zero for unit tests and such
29  if (hit == nullptr)
30  continue;
31 
32  int simTrackId(hit->trackId());
33  //float charge = hit->getCharge();
34  const float charge(1.f);
35  auto chargeItr = simTrackChargeMap.find(simTrackId);
36  if (chargeItr == simTrackChargeMap.end()) {
37  simTrackChargeMap[simTrackId] = charge;
38  eventIdMap[simTrackId] = hit->eventId();
39  } else {
40  chargeItr->second += charge;
41  }
42  totalCharge += charge;
43  }
44 
45  for (const auto &charge : simTrackChargeMap) {
46  const int simTrackId(charge.first);
47  auto link(StripDigiSimLink(strip, simTrackId, eventIdMap[simTrackId], charge.second / totalCharge));
49  }
50 }

References l1GtPatternGenerator_cfi::bx, ALCARECOTkAlJpsiMuMu_cff::charge, detectorHitMap_, f, MainPageGenerator::link, edm::DetSet< T >::push_back(), digitizers_cfi::strip, and stripDigiSimLinks_.

Referenced by fillDigis().

◆ addLinksWithPartId()

void ME0DigiModel::addLinksWithPartId ( unsigned int  strip,
int  bx 
)
protected

Definition at line 52 of file ME0DigiModel.cc.

52  {
53  std::pair<unsigned int, int> digi(strip, bx);
54  auto channelHitItr = detectorHitMap_.equal_range(digi);
55  for (auto hitItr = channelHitItr.first; hitItr != channelHitItr.second; ++hitItr) {
56  const PSimHit *hit = (hitItr->second);
57  // might be zero for unit tests and such
58  if (hit == nullptr)
59  continue;
60 
62  hit->entryPoint(),
63  hit->momentumAtEntry(),
64  hit->timeOfFlight(),
65  hit->energyLoss(),
66  hit->particleType(),
67  hit->detUnitId(),
68  hit->trackId(),
69  hit->eventId(),
70  hit->processType()));
71  }
72 }

References l1GtPatternGenerator_cfi::bx, detectorHitMap_, edm::DetSet< T >::push_back(), digitizers_cfi::strip, and theME0DigiSimLinks_.

Referenced by fillDigis().

◆ fillDigis()

void ME0DigiModel::fillDigis ( int  rollDetId,
ME0DigiCollection digis 
)

Definition at line 4 of file ME0DigiModel.cc.

4  {
5  for (const auto &d : strips_) {
6  if (d.second == -999)
7  continue;
8 
9  // (strip, bx)
10  ME0Digi digi(d.first, d.second);
11  digis.insertDigi(ME0DetId(rollDetId), digi);
12  addLinks(d.first, d.second);
13  addLinksWithPartId(d.first, d.second);
14  }
15  strips_.clear();
16 }

References addLinks(), addLinksWithPartId(), ztail::d, and strips_.

◆ getGeometry()

const ME0Geometry* ME0DigiModel::getGeometry ( )
inline

Definition at line 41 of file ME0DigiModel.h.

41 { return geometry_; }

References geometry_.

◆ me0DigiSimLinks()

const ME0DigiSimLinks& ME0DigiModel::me0DigiSimLinks ( ) const
inline

Definition at line 57 of file ME0DigiModel.h.

57 { return theME0DigiSimLinks_; }

References theME0DigiSimLinks_.

◆ setGeometry()

void ME0DigiModel::setGeometry ( const ME0Geometry geom)
inline

Definition at line 39 of file ME0DigiModel.h.

39 { geometry_ = geom; }

References relativeConstraints::geom, and geometry_.

◆ setup()

virtual void ME0DigiModel::setup ( )
pure virtual

Implemented in ME0SimpleModel.

◆ simulateClustering()

virtual std::vector<std::pair<int, int> > ME0DigiModel::simulateClustering ( const ME0EtaPartition ,
const PSimHit ,
const int  ,
CLHEP::HepRandomEngine *  engine 
)
pure virtual

Implemented in ME0SimpleModel.

◆ simulateNoise()

virtual void ME0DigiModel::simulateNoise ( const ME0EtaPartition ,
CLHEP::HepRandomEngine *  engine 
)
pure virtual

Implemented in ME0SimpleModel.

◆ simulateSignal()

virtual void ME0DigiModel::simulateSignal ( const ME0EtaPartition ,
const edm::PSimHitContainer ,
CLHEP::HepRandomEngine *  engine 
)
pure virtual

Implemented in ME0SimpleModel.

◆ stripDigiSimLinks()

const StripDigiSimLinks& ME0DigiModel::stripDigiSimLinks ( ) const
inline

Definition at line 56 of file ME0DigiModel.h.

56 { return stripDigiSimLinks_; }

References stripDigiSimLinks_.

Member Data Documentation

◆ detectorHitMap_

DetectorHitMap ME0DigiModel::detectorHitMap_
protected

Definition at line 74 of file ME0DigiModel.h.

Referenced by addLinks(), addLinksWithPartId(), and ME0SimpleModel::simulateSignal().

◆ geometry_

const ME0Geometry* ME0DigiModel::geometry_
protected

Definition at line 62 of file ME0DigiModel.h.

Referenced by getGeometry(), ME0SimpleModel::getSimHitBx(), and setGeometry().

◆ stripDigiSimLinks_

StripDigiSimLinks ME0DigiModel::stripDigiSimLinks_
protected

Definition at line 75 of file ME0DigiModel.h.

Referenced by addLinks(), ME0SimpleModel::simulateSignal(), and stripDigiSimLinks().

◆ strips_

std::set<std::pair<int, int> > ME0DigiModel::strips_
protected

◆ theME0DigiSimLinks_

ME0DigiSimLinks ME0DigiModel::theME0DigiSimLinks_
protected
edm::DetSet::push_back
void push_back(const T &t)
Definition: DetSet.h:66
ME0Digi
Definition: ME0Digi.h:15
ME0DigiModel::geometry_
const ME0Geometry * geometry_
Definition: ME0DigiModel.h:62
MainPageGenerator.link
link
Definition: MainPageGenerator.py:271
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
ME0DigiModel::addLinksWithPartId
void addLinksWithPartId(unsigned int strip, int bx)
Definition: ME0DigiModel.cc:52
ME0DigiModel::theME0DigiSimLinks_
ME0DigiSimLinks theME0DigiSimLinks_
Definition: ME0DigiModel.h:76
ME0DigiModel::strips_
std::set< std::pair< int, int > > strips_
Definition: ME0DigiModel.h:64
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
ME0DigiModel::detectorHitMap_
DetectorHitMap detectorHitMap_
Definition: ME0DigiModel.h:74
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
ME0DetId
Definition: ME0DetId.h:16
ME0DigiModel::stripDigiSimLinks_
StripDigiSimLinks stripDigiSimLinks_
Definition: ME0DigiModel.h:75
ztail.d
d
Definition: ztail.py:151
PSimHit
Definition: PSimHit.h:15
hit
Definition: SiStripHitEffFromCalibTree.cc:88
ME0DigiModel::addLinks
void addLinks(unsigned int strip, int bx)
creates links from Digi to SimTrack
Definition: ME0DigiModel.cc:18