CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/SimTracker/Common/src/SimHitSelectorFromDB.cc

Go to the documentation of this file.
00001 #include "SimTracker/Common/interface/SimHitSelectorFromDB.h"
00002 
00003 SimHitSelectorFromDB::SimHitSelectorFromDB():theNewSimHitList(0){}
00004 
00005 //std::vector<PSimHit> SimHitSelectorFromDB::getSimHit(std::auto_ptr<MixCollection<PSimHit> >& simhit, 
00006 std::vector<std::pair<const PSimHit*,int> > SimHitSelectorFromDB::getSimHit(std::auto_ptr<MixCollection<PSimHit> >& simhit, 
00007                                                      std::map<uint32_t, std::vector<int> >& detId){
00008   theNewSimHitList.clear();
00009   int counter =0;
00010   for(MixCollection<PSimHit>::iterator it = simhit->begin(); it!= simhit->end();it++){
00011     counter++;
00012     if(detId.size()!=0){
00013       uint32_t tkid = (*it).detUnitId();
00014       if (detId.find(tkid) != detId.end()){
00015         //      theNewSimHitList.push_back((*it));
00016         //      std::cout << "Hit in the MAP " << counter << std::endl;
00017         theNewSimHitList.push_back(std::make_pair(&(*it), counter));
00018       }
00019     }else{
00020       //      theNewSimHitList.push_back((*it));
00021       //      std::cout << "Hit NOT in the MAP " << counter << std::endl;
00022       theNewSimHitList.push_back(std::make_pair(&(*it),counter));
00023     }
00024   }
00025   return theNewSimHitList;
00026 }