CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PixelPSimHitSelector Class Reference

PixelPSimHitSelector class. More...

#include <PixelPSimHitSelector.h>

Inheritance diagram for PixelPSimHitSelector:
PSimHitSelector

Public Member Functions

 PixelPSimHitSelector (edm::ParameterSet const &config, edm::ConsumesCollector &iC)
 Constructor by pset. More...
 
void select (PSimHitCollection &, edm::Event const &, edm::EventSetup const &) const override
 Pre-process event information. More...
 
- Public Member Functions inherited from PSimHitSelector
 PSimHitSelector (edm::ParameterSet const &, edm::ConsumesCollector &)
 Constructor by pset. More...
 
virtual ~PSimHitSelector ()=default
 Virtual destructor. More...
 

Private Attributes

edm::ESGetToken< SiPixelQuality, SiPixelQualityRcdbadModuleToken_
 

Additional Inherited Members

- Public Types inherited from PSimHitSelector
typedef std::vector< PSimHitPSimHitCollection
 
- Public Attributes inherited from PSimHitSelector
std::string mixLabel_
 
- Protected Types inherited from PSimHitSelector
typedef std::map< std::string, std::vector< std::string > > PSimHitCollectionMap
 
- Protected Attributes inherited from PSimHitSelector
PSimHitCollectionMap pSimHitCollectionMap_
 

Detailed Description

PixelPSimHitSelector class.

Definition at line 10 of file PixelPSimHitSelector.h.

Constructor & Destructor Documentation

◆ PixelPSimHitSelector()

PixelPSimHitSelector::PixelPSimHitSelector ( edm::ParameterSet const &  config,
edm::ConsumesCollector iC 
)
inline

Constructor by pset.

Definition at line 17 of file PixelPSimHitSelector.h.

Definition: config.py:1
PSimHitSelector(edm::ParameterSet const &, edm::ConsumesCollector &)
Constructor by pset.
edm::ESGetToken< SiPixelQuality, SiPixelQualityRcd > badModuleToken_

Member Function Documentation

◆ select()

void PixelPSimHitSelector::select ( PSimHitCollection selection,
edm::Event const &  event,
edm::EventSetup const &  setup 
) const
overridevirtual

Pre-process event information.

Reimplemented from PSimHitSelector.

Definition at line 9 of file PixelPSimHitSelector.cc.

References badModuleToken_, SiPixelQuality::getBadComponentList(), mps_fire::i, edm::Handle< T >::product(), PSimHitSelector::pSimHitCollectionMap_, corrVsCorr::selection, and singleTopDQM_cfi::setup.

11  {
12  // Look for psimhit collection associated o the tracker
13  PSimHitCollectionMap::const_iterator pSimHitCollections = pSimHitCollectionMap_.find("pixel");
14 
15  // Check that there are psimhit collections defined for the tracker
16  if (pSimHitCollections == pSimHitCollectionMap_.end())
17  return;
18 
19  // Grab all the PSimHit from the different sencitive volumes
21  std::vector<const CrossingFrame<PSimHit> *> cfPSimHitProductPointers;
22 
23  // Collect the product pointers to the different psimhit collection
24  for (std::size_t i = 0; i < pSimHitCollections->second.size(); ++i) {
25  event.getByLabel("mix", pSimHitCollections->second[i], cfPSimHits);
26  cfPSimHitProductPointers.push_back(cfPSimHits.product());
27  }
28 
29  // Create a mix collection from the different psimhit collections
30  std::unique_ptr<MixCollection<PSimHit>> pSimHits(new MixCollection<PSimHit>(cfPSimHitProductPointers));
31 
32  // Accessing dead pixel modules from DB:
33  edm::ESHandle<SiPixelQuality> siPixelBadModule = setup.getHandle(badModuleToken_);
34 
35  // Reading the DB information
36  std::vector<SiPixelQuality::disabledModuleType> badModules(siPixelBadModule->getBadComponentList());
37  SiPixelQuality pixelQuality(badModules);
38 
39  // Select only psimhits from alive modules
40  for (MixCollection<PSimHit>::MixItr pSimHit = pSimHits->begin(); pSimHit != pSimHits->end(); ++pSimHit) {
41  if (!pixelQuality.IsModuleBad(pSimHit->detUnitId()))
42  selection.push_back(*pSimHit);
43  }
44 }
T const * product() const
Definition: Handle.h:70
selection
main part
Definition: corrVsCorr.py:100
const std::vector< disabledModuleType > getBadComponentList() const
PSimHitCollectionMap pSimHitCollectionMap_
edm::ESGetToken< SiPixelQuality, SiPixelQualityRcd > badModuleToken_

Member Data Documentation

◆ badModuleToken_

edm::ESGetToken<SiPixelQuality, SiPixelQualityRcd> PixelPSimHitSelector::badModuleToken_
private

Definition at line 24 of file PixelPSimHitSelector.h.

Referenced by select().