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  for (size_t i = 0; i < subdetectors.size(); ++i)
15  {
16  pSimHitCollectionMap_.insert(
17  std::pair<std::string, std::vector<std::string> >(
18  subdetectors[i],
19  pSimHitCollections.getParameter<std::vector<std::string> >(subdetectors[i])
20  )
21  );
22  }
23 }
24 
25 
27 {
28  // Look for all psimhit collections
29  PSimHitCollectionMap::const_iterator pSimHitCollections = pSimHitCollectionMap_.begin();
30 
31  std::vector<const CrossingFrame<PSimHit> *> cfPSimHitProductPointers;
32 
33  for (; pSimHitCollections != pSimHitCollectionMap_.end(); ++pSimHitCollections)
34  {
35  // Grab all the PSimHit from the different sencitive volumes
37 
38  // Collect the product pointers to the different psimhit collection
39  for (std::size_t i = 0; i < pSimHitCollections->second.size(); ++i)
40  {
41  event.getByLabel("mix", pSimHitCollections->second[i], cfPSimHits);
42  cfPSimHitProductPointers.push_back(cfPSimHits.product());
43  }
44  }
45 
46  if (cfPSimHitProductPointers.empty()) return;
47 
48  // Create a mix collection from the different psimhit collections
49  std::auto_ptr<MixCollection<PSimHit> > pSimHits(new MixCollection<PSimHit>(cfPSimHitProductPointers));
50 
51  // Select all psimhits
52  for (MixCollection<PSimHit>::MixItr pSimHit = pSimHits->begin(); pSimHit != pSimHits->end(); ++pSimHit)
53  selection.push_back(*pSimHit);
54 }
T getParameter(std::string const &) const
PSimHitSelector(edm::ParameterSet const &)
Constructor by pset.
int i
Definition: DBlmapReader.cc:9
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
iterator begin()
T const * product() const
Definition: Handle.h:74
PSimHitCollectionMap pSimHitCollectionMap_
tuple config
Definition: cmsDriver.py:17
virtual void select(PSimHitCollection &, edm::Event const &, edm::EventSetup const &) const
Select the psimhit add them to a PSimHitCollection.