test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonPSimHitSelector.cc
Go to the documentation of this file.
1 
4 
6 
9 
11 
12 // #include "SimTracker/Common/interface/SimHitSelectorFromDB.h"
13 
14 
16 {
17  // Look for psimhit collection associated to the muon system
18  PSimHitCollectionMap::const_iterator pSimHitCollections = pSimHitCollectionMap_.find("muon");
19 
20  // Check that there are psimhit collections defined for the tracker
21  if (pSimHitCollections == pSimHitCollectionMap_.end()) return;
22 
23  // Grab all the PSimHit from the different sencitive volumes
25  std::vector<const CrossingFrame<PSimHit> *> cfPSimHitProductPointers;
26 
27  // Collect the product pointers to the different psimhit collection
28  for (std::size_t i = 0; i < pSimHitCollections->second.size(); ++i)
29  {
30  event.getByLabel("mix", pSimHitCollections->second[i], cfPSimHits);
31  cfPSimHitProductPointers.push_back(cfPSimHits.product());
32  }
33 
34  // Create a mix collection from the different psimhit collections
35  std::unique_ptr<MixCollection<PSimHit> > pSimHits(new MixCollection<PSimHit>(cfPSimHitProductPointers));
36 
37  // Get CSC Bad Chambers (ME4/2)
39  setup.get<CSCBadChambersRcd>().get(cscBadChambers);
40 
41  // Select only psimhits from alive modules
42  for (MixCollection<PSimHit>::MixItr pSimHit = pSimHits->begin(); pSimHit != pSimHits->end(); ++pSimHit)
43  {
44  DetId dId = DetId( pSimHit->detUnitId() );
45 
46  if (dId.det() == DetId::Muon && dId.subdetId() == MuonSubdetId::CSC)
47  {
48  if ( !cscBadChambers->isInBadChamber(CSCDetId(dId)) )
49  selection.push_back(*pSimHit);
50  }
51  else
52  selection.push_back(*pSimHit);
53  }
54 }
int i
Definition: DBlmapReader.cc:9
selection
main part
Definition: corrVsCorr.py:98
static const int CSC
Definition: MuonSubdetId.h:13
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
std::vector< PSimHit > PSimHitCollection
Definition: DetId.h:18
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:56
PSimHitCollectionMap pSimHitCollectionMap_
virtual void select(PSimHitCollection &, edm::Event const &, edm::EventSetup const &) const
Pre-process event information.
Detector det() const
get the detector field from this detid
Definition: DetId.h:35