CMS 3D CMS Logo

SimHitSelectorFromDB.cc
Go to the documentation of this file.
2 
4 
5 // std::vector<PSimHit>
6 // SimHitSelectorFromDB::getSimHit(std::unique_ptr<MixCollection<PSimHit> >&
7 // simhit,
8 std::vector<std::pair<const PSimHit *, int>> SimHitSelectorFromDB::getSimHit(
9  std::unique_ptr<MixCollection<PSimHit>> &simhit, std::map<uint32_t, std::vector<int>> &detId) {
10  theNewSimHitList.clear();
11  int counter = 0;
12  for (MixCollection<PSimHit>::iterator it = simhit->begin(); it != simhit->end(); it++) {
13  counter++;
14  if (!detId.empty()) {
15  uint32_t tkid = (*it).detUnitId();
16  if (detId.find(tkid) != detId.end()) {
17  // theNewSimHitList.push_back((*it));
18  // std::cout << "Hit in the MAP " << counter << std::endl;
19  theNewSimHitList.push_back(std::make_pair(&(*it), counter));
20  }
21  } else {
22  // theNewSimHitList.push_back((*it));
23  // std::cout << "Hit NOT in the MAP " << counter << std::endl;
24  theNewSimHitList.push_back(std::make_pair(&(*it), counter));
25  }
26  }
27  return theNewSimHitList;
28 }
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
std::vector< std::pair< const PSimHit *, int > > getSimHit(std::unique_ptr< MixCollection< PSimHit >> &, std::map< uint32_t, std::vector< int >> &)
std::vector< std::pair< const PSimHit *, int > > theNewSimHitList