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

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

Definition at line 76 of file ME0DigiModel.h.

Definition at line 37 of file ME0DigiModel.h.

Definition at line 36 of file ME0DigiModel.h.

Constructor & Destructor Documentation

virtual ME0DigiModel::~ME0DigiModel ( )
inlinevirtual

Definition at line 39 of file ME0DigiModel.h.

39 {}
ME0DigiModel::ME0DigiModel ( const edm::ParameterSet )
inlineprotected

Definition at line 61 of file ME0DigiModel.h.

61 {}

Member Function Documentation

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

creates links from Digi to SimTrack

Definition at line 21 of file ME0DigiModel.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, detectorHitMap_, PSimHit::eventId(), f, edm::DetSet< T >::push_back(), stripDigiSimLinks_, and PSimHit::trackId().

Referenced by fillDigis().

22 {
23  std::pair<unsigned int, int> digi(strip, bx);
24  auto channelHitItr = detectorHitMap_.equal_range(digi);
25 
26  // find the fraction contribution for each SimTrack
27  std::map<int, float> simTrackChargeMap;
28  std::map<int, EncodedEventId> eventIdMap;
29  float totalCharge(0.);
30  for(auto hitItr = channelHitItr.first; hitItr != channelHitItr.second; ++hitItr)
31  {
32  const PSimHit * hit(hitItr->second);
33  // might be zero for unit tests and such
34  if(hit == nullptr) continue;
35 
36  int simTrackId(hit->trackId());
37  //float charge = hit->getCharge();
38  const float charge(1.f);
39  auto chargeItr = simTrackChargeMap.find(simTrackId);
40  if( chargeItr == simTrackChargeMap.end() )
41  {
42  simTrackChargeMap[simTrackId] = charge;
43  eventIdMap[simTrackId] = hit->eventId();
44  }
45  else
46  {
47  chargeItr->second += charge;
48  }
49  totalCharge += charge;
50  }
51 
52  for(const auto &charge: simTrackChargeMap)
53  {
54  const int simTrackId(charge.first);
55  auto link(StripDigiSimLink(strip, simTrackId, eventIdMap[simTrackId], charge.second/totalCharge));
57  }
58 }
void push_back(const T &t)
Definition: DetSet.h:68
StripDigiSimLinks stripDigiSimLinks_
Definition: ME0DigiModel.h:79
double f[11][100]
DetectorHitMap detectorHitMap_
Definition: ME0DigiModel.h:78
void ME0DigiModel::addLinksWithPartId ( unsigned int  strip,
int  bx 
)
protected

Definition at line 60 of file ME0DigiModel.cc.

References detectorHitMap_, PSimHit::detUnitId(), PSimHit::energyLoss(), PSimHit::entryPoint(), PSimHit::eventId(), PSimHit::momentumAtEntry(), PSimHit::particleType(), PSimHit::processType(), edm::DetSet< T >::push_back(), theME0DigiSimLinks_, PSimHit::timeOfFlight(), and PSimHit::trackId().

Referenced by fillDigis().

61 {
62 
63  std::pair<unsigned int, int > digi(strip, bx);
64  auto channelHitItr = detectorHitMap_.equal_range(digi);
65  for(auto hitItr = channelHitItr.first; hitItr != channelHitItr.second; ++hitItr)
66  {
67  const PSimHit * hit = (hitItr->second);
68  // might be zero for unit tests and such
69  if (hit == nullptr) continue;
70 
72  hit->particleType(), hit->detUnitId(), hit->trackId(), hit->eventId(), hit->processType()));
73 
74  }
75 }
void push_back(const T &t)
Definition: DetSet.h:68
LocalVector momentumAtEntry() const
The momentum of the track that produced the hit, at entry point.
Definition: PSimHit.h:47
float timeOfFlight() const
Definition: PSimHit.h:69
EncodedEventId eventId() const
Definition: PSimHit.h:105
ME0DigiSimLinks theME0DigiSimLinks_
Definition: ME0DigiModel.h:80
unsigned short processType() const
Definition: PSimHit.h:118
float energyLoss() const
The energy deposit in the PSimHit, in ???.
Definition: PSimHit.h:75
int particleType() const
Definition: PSimHit.h:85
unsigned int trackId() const
Definition: PSimHit.h:102
DetectorHitMap detectorHitMap_
Definition: ME0DigiModel.h:78
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:35
unsigned int detUnitId() const
Definition: PSimHit.h:93
void ME0DigiModel::fillDigis ( int  rollDetId,
ME0DigiCollection digis 
)

Definition at line 5 of file ME0DigiModel.cc.

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

Referenced by ME0DigiProducer::produce().

6 {
7  for (const auto &d: strips_)
8  {
9  if (d.second == -999) continue;
10 
11  // (strip, bx)
12  ME0Digi digi(d.first, d.second);
13  digis.insertDigi(ME0DetId(rollDetId), digi);
14  addLinks(d.first, d.second);
15  addLinksWithPartId(d.first, d.second);
16  }
17  strips_.clear();
18 }
void addLinks(unsigned int strip, int bx)
creates links from Digi to SimTrack
Definition: ME0DigiModel.cc:21
std::set< std::pair< int, int > > strips_
Definition: ME0DigiModel.h:65
void addLinksWithPartId(unsigned int strip, int bx)
Definition: ME0DigiModel.cc:60
const ME0Geometry* ME0DigiModel::getGeometry ( )
inline

Definition at line 43 of file ME0DigiModel.h.

References GeneralSetup::setup().

Referenced by ME0DigiProducer::produce().

43 {return geometry_;}
const ME0Geometry * geometry_
Definition: ME0DigiModel.h:63
const ME0DigiSimLinks& ME0DigiModel::me0DigiSimLinks ( ) const
inline

Definition at line 57 of file ME0DigiModel.h.

Referenced by ME0DigiProducer::produce().

57 {return theME0DigiSimLinks_;}
ME0DigiSimLinks theME0DigiSimLinks_
Definition: ME0DigiModel.h:80
void ME0DigiModel::setGeometry ( const ME0Geometry geom)
inline

Definition at line 41 of file ME0DigiModel.h.

References relativeConstraints::geom.

Referenced by ME0DigiProducer::beginRun().

41 {geometry_ = geom;}
const ME0Geometry * geometry_
Definition: ME0DigiModel.h:63
virtual void ME0DigiModel::setup ( )
pure virtual

Implemented in ME0SimpleModel.

Referenced by ME0DigiProducer::beginRun().

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

Implemented in ME0SimpleModel.

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

Implemented in ME0SimpleModel.

Referenced by ME0DigiProducer::produce().

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

Implemented in ME0SimpleModel.

Referenced by ME0DigiProducer::produce().

const StripDigiSimLinks& ME0DigiModel::stripDigiSimLinks ( ) const
inline

Definition at line 56 of file ME0DigiModel.h.

Referenced by ME0DigiProducer::produce().

56 {return stripDigiSimLinks_;}
StripDigiSimLinks stripDigiSimLinks_
Definition: ME0DigiModel.h:79

Member Data Documentation

DetectorHitMap ME0DigiModel::detectorHitMap_
protected

Definition at line 78 of file ME0DigiModel.h.

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

const ME0Geometry* ME0DigiModel::geometry_
protected

Definition at line 63 of file ME0DigiModel.h.

Referenced by ME0SimpleModel::getSimHitBx().

StripDigiSimLinks ME0DigiModel::stripDigiSimLinks_
protected

Definition at line 79 of file ME0DigiModel.h.

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

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

Definition at line 80 of file ME0DigiModel.h.

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