CMS 3D CMS Logo

List of all members | Public Member Functions
PixelPSimHitSelector Class Reference

PixelPSimHitSelector class. More...

#include <PixelPSimHitSelector.h>

Inheritance diagram for PixelPSimHitSelector:
PSimHitSelector

Public Member Functions

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

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 7 of file PixelPSimHitSelector.h.

Constructor & Destructor Documentation

PixelPSimHitSelector::PixelPSimHitSelector ( edm::ParameterSet const &  config)
inline

Constructor by pset.

Definition at line 17 of file PixelPSimHitSelector.h.

References select().

PSimHitSelector(edm::ParameterSet const &)
Constructor by pset.
Definition: config.py:1

Member Function Documentation

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

Pre-process event information.

Reimplemented from PSimHitSelector.

Definition at line 13 of file PixelPSimHitSelector.cc.

References edm::EventSetup::get(), SiPixelQuality::getBadComponentList(), mps_fire::i, edm::Handle< T >::product(), and PSimHitSelector::pSimHitCollectionMap_.

Referenced by PixelPSimHitSelector().

14 {
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()) return;
20 
21  // Grab all the PSimHit from the different sencitive volumes
23  std::vector<const CrossingFrame<PSimHit> *> cfPSimHitProductPointers;
24 
25  // Collect the product pointers to the different psimhit collection
26  for (std::size_t i = 0; i < pSimHitCollections->second.size(); ++i)
27  {
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  {
46  if ( !pixelQuality.IsModuleBad(pSimHit->detUnitId()) )
47  selection.push_back(*pSimHit);
48  }
49 }
selection
main part
Definition: corrVsCorr.py:98
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
const std::vector< disabledModuleType > getBadComponentList() const
T const * product() const
Definition: Handle.h:81
PSimHitCollectionMap pSimHitCollectionMap_