#include <PSimHitMap.h>
Public Member Functions | |
std::vector< int > | detsWithHits () const |
void | fill (const edm::Event &e) |
const edm::PSimHitContainer & | hits (int detId) const |
PSimHitMap (const edm::InputTag &) | |
Private Attributes | |
edm::InputTag | simHitsTag |
edm::PSimHitContainer | theEmptyContainer |
std::map< int, edm::PSimHitContainer > | theMap |
Definition at line 9 of file PSimHitMap.h.
PSimHitMap::PSimHitMap | ( | const edm::InputTag & | collectionTag | ) |
Definition at line 5 of file PSimHitMap.cc.
: theMap(), theEmptyContainer(), simHitsTag(collectionTag) { }
std::vector< int > PSimHitMap::detsWithHits | ( | ) | const |
Definition at line 47 of file PSimHitMap.cc.
References query::result, and theMap.
Referenced by CSCRecHit2DValidation::analyze(), and CSCSegmentValidation::fillLayerHitsPerChamber().
void PSimHitMap::fill | ( | const edm::Event & | e | ) |
Definition at line 13 of file PSimHitMap.cc.
References edm::Event::getByLabel(), LogTrace, edm::Handle< T >::product(), trackerHits::simHits, simHitsTag, and theMap.
Referenced by CSCRecHitValidation::analyze(), and CSCDigiValidation::analyze().
{ theMap.clear(); edm::Handle<CrossingFrame<PSimHit> > cf; LogTrace("PSimHitMap") <<"getting CrossingFrame<PSimHit> collection - "<<simHitsTag; e.getByLabel(simHitsTag, cf); MixCollection<PSimHit> simHits(cf.product()); LogTrace("PSimHitMap") <<"... size = "<<simHits.size(); // arrange the hits by detUnit for(MixCollection<PSimHit>::MixItr hitItr = simHits.begin(); hitItr != simHits.end(); ++hitItr) { theMap[hitItr->detUnitId()].push_back(*hitItr); } }
const edm::PSimHitContainer & PSimHitMap::hits | ( | int | detId | ) | const |
Definition at line 32 of file PSimHitMap.cc.
References theEmptyContainer, and theMap.
Referenced by CSCWireDigiValidation::analyze(), CSCRecHit2DValidation::analyze(), CSCSegmentValidation::fillLayerHitsPerChamber(), and CSCSegmentValidation::keyHit().
{ std::map<int, edm::PSimHitContainer>::const_iterator mapItr = theMap.find(detId); if(mapItr != theMap.end()) { return mapItr->second; } else { return theEmptyContainer; } }
edm::InputTag PSimHitMap::simHitsTag [private] |
Definition at line 23 of file PSimHitMap.h.
Referenced by fill().
Definition at line 22 of file PSimHitMap.h.
Referenced by hits().
std::map<int, edm::PSimHitContainer> PSimHitMap::theMap [private] |
Definition at line 21 of file PSimHitMap.h.
Referenced by detsWithHits(), fill(), and hits().