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 }
counter
Definition: counter.py:1
MixCollection::MixItr
Definition: MixCollection.h:61
MixCollection
Definition: MixCollection.h:10
SimHitSelectorFromDB::getSimHit
std::vector< std::pair< const PSimHit *, int > > getSimHit(std::unique_ptr< MixCollection< PSimHit >> &, std::map< uint32_t, std::vector< int >> &)
Definition: SimHitSelectorFromDB.cc:8
SimHitSelectorFromDB::theNewSimHitList
std::vector< std::pair< const PSimHit *, int > > theNewSimHitList
Definition: SimHitSelectorFromDB.h:23
SimHitSelectorFromDB::SimHitSelectorFromDB
SimHitSelectorFromDB()
Definition: SimHitSelectorFromDB.cc:3
cms::cuda::device::unique_ptr
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
Definition: device_unique_ptr.h:33
genParticles_cff.map
map
Definition: genParticles_cff.py:11
SimHitSelectorFromDB.h