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::SimHitSelectorFromDB ( )

Definition at line 3 of file SimHitSelectorFromDB.cc.

3 : theNewSimHitList(0) {}
std::vector< std::pair< const PSimHit *, int > > theNewSimHitList

◆ ~SimHitSelectorFromDB()

SimHitSelectorFromDB::~SimHitSelectorFromDB ( )
inline

Definition at line 14 of file SimHitSelectorFromDB.h.

14 {};

Member Function Documentation

◆ getSimHit()

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 8 of file SimHitSelectorFromDB.cc.

References theNewSimHitList.

9  {
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::vector< std::pair< const PSimHit *, int > > theNewSimHitList

Member Data Documentation

◆ theNewSimHitList

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

Definition at line 23 of file SimHitSelectorFromDB.h.

Referenced by getSimHit().