CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SimHitSelectorFromDB Class Reference

#include <SimHitSelectorFromDB.h>

Public Member Functions

std::vector< std::pair< const PSimHit *, int > > getSimHit (std::unique_ptr< MixCollection< PSimHit > > &, std::map< uint32_t, std::vector< int > > &)
 
 SimHitSelectorFromDB ()
 
 ~SimHitSelectorFromDB ()
 

Private Attributes

std::vector< std::pair< const PSimHit *, int > > theNewSimHitList
 

Detailed Description

Definition at line 11 of file SimHitSelectorFromDB.h.

Constructor & Destructor Documentation

SimHitSelectorFromDB::SimHitSelectorFromDB ( )

Definition at line 3 of file SimHitSelectorFromDB.cc.

std::vector< std::pair< const PSimHit *, int > > theNewSimHitList
SimHitSelectorFromDB::~SimHitSelectorFromDB ( )
inline

Definition at line 15 of file SimHitSelectorFromDB.h.

References getSimHit(), and genParticles_cff::map.

15 {};

Member Function Documentation

std::vector< std::pair< const PSimHit *, int > > SimHitSelectorFromDB::getSimHit ( std::unique_ptr< MixCollection< PSimHit > > &  simhit,
std::map< uint32_t, std::vector< int > > &  detId 
)

Definition at line 6 of file SimHitSelectorFromDB.cc.

References theNewSimHitList.

Referenced by DigiSimLinkProducer::produce(), and ~SimHitSelectorFromDB().

7  {
8  theNewSimHitList.clear();
9  int counter =0;
10  for(MixCollection<PSimHit>::iterator it = simhit->begin(); it!= simhit->end();it++){
11  counter++;
12  if(!detId.empty()){
13  uint32_t tkid = (*it).detUnitId();
14  if (detId.find(tkid) != detId.end()){
15  // theNewSimHitList.push_back((*it));
16  // std::cout << "Hit in the MAP " << counter << std::endl;
17  theNewSimHitList.push_back(std::make_pair(&(*it), counter));
18  }
19  }else{
20  // theNewSimHitList.push_back((*it));
21  // std::cout << "Hit NOT in the MAP " << counter << std::endl;
22  theNewSimHitList.push_back(std::make_pair(&(*it),counter));
23  }
24  }
25  return theNewSimHitList;
26 }
std::vector< std::pair< const PSimHit *, int > > theNewSimHitList

Member Data Documentation

std::vector<std::pair<const PSimHit*, int > > SimHitSelectorFromDB::theNewSimHitList
private

Definition at line 21 of file SimHitSelectorFromDB.h.

Referenced by getSimHit().