CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PSimHitSelector.cc
Go to the documentation of this file.
1 
4 
6 
8 {
9  // Initilize psimhit collection discriminated by sub systems
10  edm::ParameterSet pSimHitCollections = config.getParameter<edm::ParameterSet>("simHitCollections");
11 
12  std::vector<std::string> subdetectors( pSimHitCollections.getParameterNames() );
13 
14  mixLabel_ = config.getParameter<std::string>("mixLabel");
15 
16  for (size_t i = 0; i < subdetectors.size(); ++i)
17  {
18  pSimHitCollectionMap_.insert(
19  std::pair<std::string, std::vector<std::string> >(
20  subdetectors[i],
21  pSimHitCollections.getParameter<std::vector<std::string> >(subdetectors[i])
22  )
23  );
24  }
25 }
26 
27 
29 {
30  // Look for all psimhit collections
31  PSimHitCollectionMap::const_iterator pSimHitCollections = pSimHitCollectionMap_.begin();
32 
33  std::vector<const CrossingFrame<PSimHit> *> cfPSimHitProductPointers;
34 
35  for (; pSimHitCollections != pSimHitCollectionMap_.end(); ++pSimHitCollections)
36  {
37  // Grab all the PSimHit from the different sencitive volumes
39 
40  // Collect the product pointers to the different psimhit collection
41  for (std::size_t i = 0; i < pSimHitCollections->second.size(); ++i)
42  {
43  event.getByLabel(mixLabel_, pSimHitCollections->second[i], cfPSimHits);
44  cfPSimHitProductPointers.push_back(cfPSimHits.product());
45  }
46  }
47 
48  if (cfPSimHitProductPointers.empty()) return;
49 
50  // Create a mix collection from the different psimhit collections
51  std::auto_ptr<MixCollection<PSimHit> > pSimHits(new MixCollection<PSimHit>(cfPSimHitProductPointers));
52 
53  // Select all psimhits
54  for (MixCollection<PSimHit>::MixItr pSimHit = pSimHits->begin(); pSimHit != pSimHits->end(); ++pSimHit)
55  selection.push_back(*pSimHit);
56 }
T getParameter(std::string const &) const
PSimHitSelector(edm::ParameterSet const &)
Constructor by pset.
int i
Definition: DBlmapReader.cc:9
selection
main part
Definition: corrVsCorr.py:98
std::string mixLabel_
std::vector< std::string > getParameterNames() const
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
std::vector< PSimHit > PSimHitCollection
T const * product() const
Definition: Handle.h:81
PSimHitCollectionMap pSimHitCollectionMap_
virtual void select(PSimHitCollection &, edm::Event const &, edm::EventSetup const &) const
Select the psimhit add them to a PSimHitCollection.