CMS 3D CMS Logo

PixelPSimHitSelector.cc
Go to the documentation of this file.
1 
4 
6 
9 
11 
13  edm::Event const &event,
14  edm::EventSetup const &setup) const {
15  // Look for psimhit collection associated o the tracker
16  PSimHitCollectionMap::const_iterator pSimHitCollections = pSimHitCollectionMap_.find("pixel");
17 
18  // Check that there are psimhit collections defined for the tracker
19  if (pSimHitCollections == pSimHitCollectionMap_.end())
20  return;
21 
22  // Grab all the PSimHit from the different sencitive volumes
24  std::vector<const CrossingFrame<PSimHit> *> cfPSimHitProductPointers;
25 
26  // Collect the product pointers to the different psimhit collection
27  for (std::size_t i = 0; i < pSimHitCollections->second.size(); ++i) {
28  event.getByLabel("mix", pSimHitCollections->second[i], cfPSimHits);
29  cfPSimHitProductPointers.push_back(cfPSimHits.product());
30  }
31 
32  // Create a mix collection from the different psimhit collections
33  std::unique_ptr<MixCollection<PSimHit>> pSimHits(new MixCollection<PSimHit>(cfPSimHitProductPointers));
34 
35  // Accessing dead pixel modules from DB:
36  edm::ESHandle<SiPixelQuality> siPixelBadModule;
37  setup.get<SiPixelQualityRcd>().get(siPixelBadModule);
38 
39  // Reading the DB information
40  std::vector<SiPixelQuality::disabledModuleType> badModules(siPixelBadModule->getBadComponentList());
41  SiPixelQuality pixelQuality(badModules);
42 
43  // Select only psimhits from alive modules
44  for (MixCollection<PSimHit>::MixItr pSimHit = pSimHits->begin(); pSimHit != pSimHits->end(); ++pSimHit) {
45  if (!pixelQuality.IsModuleBad(pSimHit->detUnitId()))
46  selection.push_back(*pSimHit);
47  }
48 }
mps_fire.i
i
Definition: mps_fire.py:428
PSimHitSelector::PSimHitCollection
std::vector< PSimHit > PSimHitCollection
Definition: PSimHitSelector.h:17
edm::Handle::product
T const * product() const
Definition: Handle.h:70
SiPixelQualityRcd
Definition: SiPixelQualityRcd.h:13
ESHandle.h
CrossingFrame.h
edm::Handle
Definition: AssociativeIterator.h:50
MixCollection::MixItr
Definition: MixCollection.h:62
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
PSimHitSelector::pSimHitCollectionMap_
PSimHitCollectionMap pSimHitCollectionMap_
Definition: PSimHitSelector.h:36
MixCollection.h
SiPixelQualityRcd.h
MixCollection
Definition: MixCollection.h:11
corrVsCorr.selection
selection
main part
Definition: corrVsCorr.py:100
edm::ESHandle< SiPixelQuality >
SiPixelQuality
Definition: SiPixelQuality.h:27
PixelPSimHitSelector.h
PixelPSimHitSelector::select
void select(PSimHitCollection &, edm::Event const &, edm::EventSetup const &) const override
Pre-process event information.
Definition: PixelPSimHitSelector.cc:12
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
SiPixelQuality::getBadComponentList
const std::vector< disabledModuleType > getBadComponentList() const
Definition: SiPixelQuality.h:100
SiPixelQuality.h
event
Definition: event.py:1
edm::Event
Definition: Event.h:73