![]() |
![]() |
#include <GEMSim.h>
Public Types | |
typedef edm::DetSet < StripDigiSimLink > | StripDigiSimLinks |
Public Member Functions | |
virtual void | fillDigis (int rollDetId, GEMDigiCollection &digis) |
GEMSimSetUp * | getGEMSimSetUp () |
void | setGEMSimSetUp (GEMSimSetUp *setup) |
virtual void | setRandomEngine (CLHEP::HepRandomEngine &eng)=0 |
virtual void | simulate (const GEMEtaPartition *roll, const edm::PSimHitContainer &rpcHits)=0 |
virtual void | simulateNoise (const GEMEtaPartition *roll)=0 |
const StripDigiSimLinks & | stripDigiSimLinks () const |
virtual | ~GEMSim () |
Protected Types | |
typedef std::multimap < std::pair< unsigned int, int > , const PSimHit *, std::less < std::pair< unsigned int, int > > > | DetectorHitMap |
Protected Member Functions | |
virtual void | addLinks (unsigned int strip, int bx) |
GEMSim (const edm::ParameterSet &config) | |
virtual void | init ()=0 |
Protected Attributes | |
DetectorHitMap | detectorHitMap_ |
GEMSimSetUp * | simSetUp_ |
StripDigiSimLinks | stripDigiSimLinks_ |
std::set< std::pair< int, int > > | strips_ |
typedef std::multimap< std::pair<unsigned int, int>, const PSimHit*, std::less<std::pair<unsigned int, int> > > GEMSim::DetectorHitMap [protected] |
GEMSim::GEMSim | ( | const edm::ParameterSet & | config | ) | [inline, protected] |
void GEMSim::addLinks | ( | unsigned int | strip, |
int | bx | ||
) | [protected, virtual] |
creates links from Digi to SimTrack disabled for now
Definition at line 21 of file GEMSim.cc.
References DeDxDiscriminatorTools::charge(), detectorHitMap_, PSimHit::eventId(), edm::DetSet< T >::push_back(), stripDigiSimLinks_, and PSimHit::trackId().
Referenced by fillDigis().
{ std::pair<unsigned int, int> digi(strip, bx); auto channelHitItr = detectorHitMap_.equal_range(digi); // find the fraction contribution for each SimTrack std::map<int, float> simTrackChargeMap; std::map<int, EncodedEventId> eventIdMap; float totalCharge = 0; for(auto hitItr = channelHitItr.first; hitItr != channelHitItr.second; ++hitItr) { const PSimHit * hit = hitItr->second; // might be zero for unit tests and such if(hit == nullptr) continue; int simTrackId = hit->trackId(); //float charge = hit->getCharge(); const float charge = 1.f; auto chargeItr = simTrackChargeMap.find(simTrackId); if( chargeItr == simTrackChargeMap.end() ) { simTrackChargeMap[simTrackId] = charge; eventIdMap[simTrackId] = hit->eventId(); } else { chargeItr->second += charge; } totalCharge += charge; } for(auto &charge: simTrackChargeMap) { int simTrackId = charge.first; stripDigiSimLinks_.push_back( StripDigiSimLink(strip, simTrackId, eventIdMap[simTrackId], charge.second/totalCharge )); } }
void GEMSim::fillDigis | ( | int | rollDetId, |
GEMDigiCollection & | digis | ||
) | [virtual] |
Definition at line 6 of file GEMSim.cc.
References addLinks(), and strips_.
Referenced by GEMDigitizer::digitize().
GEMSimSetUp* GEMSim::getGEMSimSetUp | ( | ) | [inline] |
Definition at line 44 of file GEMSim.h.
References simSetUp_.
Referenced by GEMSimAverage::simulate().
{ return simSetUp_; }
virtual void GEMSim::init | ( | ) | [protected, pure virtual] |
Implemented in GEMSimAverage, and GEMSimTriv.
void GEMSim::setGEMSimSetUp | ( | GEMSimSetUp * | setup | ) | [inline] |
Definition at line 42 of file GEMSim.h.
References HcalObjRepresent::setup(), and simSetUp_.
Referenced by GEMDigitizer::digitize().
virtual void GEMSim::setRandomEngine | ( | CLHEP::HepRandomEngine & | eng | ) | [pure virtual] |
Implemented in GEMSimAverage, and GEMSimTriv.
virtual void GEMSim::simulate | ( | const GEMEtaPartition * | roll, |
const edm::PSimHitContainer & | rpcHits | ||
) | [pure virtual] |
Implemented in GEMSimAverage, and GEMSimTriv.
Referenced by GEMDigitizer::digitize().
virtual void GEMSim::simulateNoise | ( | const GEMEtaPartition * | roll | ) | [pure virtual] |
Implemented in GEMSimAverage, and GEMSimTriv.
Referenced by GEMDigitizer::digitize().
const StripDigiSimLinks& GEMSim::stripDigiSimLinks | ( | ) | const [inline] |
Definition at line 46 of file GEMSim.h.
References stripDigiSimLinks_.
Referenced by GEMDigitizer::digitize().
{ return stripDigiSimLinks_; }
DetectorHitMap GEMSim::detectorHitMap_ [protected] |
Definition at line 67 of file GEMSim.h.
Referenced by addLinks(), GEMSimAverage::simulate(), and GEMSimTriv::simulate().
GEMSimSetUp* GEMSim::simSetUp_ [protected] |
Definition at line 70 of file GEMSim.h.
Referenced by getGEMSimSetUp(), and setGEMSimSetUp().
StripDigiSimLinks GEMSim::stripDigiSimLinks_ [protected] |
Definition at line 68 of file GEMSim.h.
Referenced by addLinks(), GEMSimAverage::simulate(), GEMSimTriv::simulate(), and stripDigiSimLinks().
std::set< std::pair<int, int> > GEMSim::strips_ [protected] |
Definition at line 54 of file GEMSim.h.
Referenced by fillDigis(), GEMSimAverage::simulate(), GEMSimTriv::simulate(), and GEMSimAverage::simulateNoise().