CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DebugZMCTruth.cc
Go to the documentation of this file.
9 #include <iostream>
10 using namespace edm;
11 using namespace std;
12 using namespace reco;
13 
15 public:
17 private:
18  virtual void analyze(const Event& event, const EventSetup& setup) override;
23 };
24 
26  src_(cfg.getParameter<InputTag>("src")),
27  srcToken_(consumes<CandidateView>(src_)),
28  genParticlesToken_(consumes<GenParticleCollection>(cfg.getParameter<InputTag>("genParticles"))),
29  matchToken_(consumes<GenParticleMatch>(cfg.getParameter<InputTag>("mcMatch"))) {
30 }
31 
32 
35  event.getByToken(genParticlesToken_, genParticles);
37  event.getByToken(srcToken_, src);
38  cout << ">>> event has " << src->size() << " reconstructed particles in {" << src_ << "}" <<endl;
40  event.getByToken(matchToken_, match);
41  cout << ">>> Z matches: ";
42  for(unsigned int i = 0; i < src->size(); ++i) {
43  CandidateBaseRef ref = src->refAt(i);
44  GenParticleRef mc = (*match)[ref];
45  cout << (mc.isNull() ? "(no)" : "(yes)");
46  }
47  cout << endl;
48 }
49 
51 
53 
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int i
Definition: DBlmapReader.cc:9
tuple cfg
Definition: looper.py:293
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
virtual void analyze(const Event &event, const EventSetup &setup) override
DebugZMCTruth(const edm::ParameterSet &pset)
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
bool isNull() const
Checks for null.
Definition: Ref.h:249
EDGetTokenT< GenParticleCollection > genParticlesToken_
EDGetTokenT< CandidateView > srcToken_
tuple cout
Definition: gather_cfg.py:145
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
EDGetTokenT< GenParticleMatch > matchToken_