test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SimHitSelectorFromDB.cc
Go to the documentation of this file.
2 
4 
5 //std::vector<PSimHit> SimHitSelectorFromDB::getSimHit(std::auto_ptr<MixCollection<PSimHit> >& simhit,
6 std::vector<std::pair<const PSimHit*,int> > SimHitSelectorFromDB::getSimHit(std::auto_ptr<MixCollection<PSimHit> >& simhit,
7  std::map<uint32_t, std::vector<int> >& detId){
8  theNewSimHitList.clear();
9  int counter =0;
10  for(MixCollection<PSimHit>::iterator it = simhit->begin(); it!= simhit->end();it++){
11  counter++;
12  if(detId.size()!=0){
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 > > getSimHit(std::auto_ptr< MixCollection< PSimHit > > &, std::map< uint32_t, std::vector< int > > &)
std::vector< std::pair< const PSimHit *, int > > theNewSimHitList
static std::atomic< unsigned int > counter