CMS 3D CMS Logo

L1RCTRelValAnalyzer.cc
Go to the documentation of this file.
1 // system include files
2 #include <memory>
3 
4 // user include files
8 
11 
14 
16 
18 
19 using std::cout;
20 using std::endl;
21 using std::string;
22 
23 //
24 // constructors and destructor
25 //
27  : m_rctEmCands(consumes(iConfig.getParameter<edm::InputTag>("rctEmCandsLabel"))),
28  m_rctRegions(consumes(iConfig.getParameter<edm::InputTag>("rctRegionsLabel"))) {
29  // now do what ever initialization is needed
30 
31  usesResource(TFileService::kSharedResource);
33  h_emRank = fs->make<TH1F>("emRank", "emRank", 64, 0., 64.);
34  h_emIeta = fs->make<TH1F>("emOccupancyIeta", "emOccupancyIeta", 22, 0., 22.);
35  h_emIphi = fs->make<TH1F>("emOccupancyIphi", "emOccupancyIphi", 18, 0., 18.);
36  h_emIsoOccIetaIphi = fs->make<TH2F>("emIsoOccupancy2D", "emIsoOccupancy2D", 22, 0., 22., 18, 0., 18.);
37  h_emNonIsoOccIetaIphi = fs->make<TH2F>("emNonIsoOccupancy2D", "emNonIsoOccupancy2D", 22, 0., 22., 18, 0., 18.);
38 
39  h_regionSum = fs->make<TH1F>("regionSum", "regionSum", 100, 0., 100.);
40  h_regionSumIetaIphi = fs->make<TH2F>("regionSumEtWeighted2D", "regionSumEtWeighted2D", 22, 0., 22., 18, 0., 18.);
41  h_regionOccIetaIphi = fs->make<TH2F>("regionOccupancy2D", "regionOccupancy2D", 22, 0., 22., 18, 0., 18.);
42 }
43 
45  // do anything here that needs to be done at destruction time
46  // (e.g. close files, deallocate resources etc.)
47 }
48 
49 //
50 // member functions
51 //
52 
53 // ------------ method called to produce the data ------------
55  using namespace edm;
56 
57  // as in L1GctTestAnalyzer.cc
58  Handle<L1CaloEmCollection> rctEmCands = iEvent.getHandle(m_rctEmCands);
59  Handle<L1CaloRegionCollection> rctRegions = iEvent.getHandle(m_rctRegions);
60 
61  for (auto em = rctEmCands->begin(); em != rctEmCands->end(); em++) {
62  if ((*em).rank() > 0) {
63  h_emRank->Fill((*em).rank());
64  h_emIeta->Fill((*em).regionId().ieta());
65  h_emIphi->Fill((*em).regionId().iphi());
66  if ((*em).isolated()) {
67  h_emIsoOccIetaIphi->Fill((*em).regionId().ieta(), (*em).regionId().iphi());
68  } else {
69  h_emNonIsoOccIetaIphi->Fill((*em).regionId().ieta(), (*em).regionId().iphi());
70  }
71  }
72  }
73 
74  for (auto rgn = rctRegions->begin(); rgn != rctRegions->end(); rgn++) {
75  if ((*rgn).et() > 0) {
76  h_regionSum->Fill((*rgn).et());
77  h_regionSumIetaIphi->Fill((*rgn).gctEta(), (*rgn).gctPhi(), (*rgn).et());
78  h_regionOccIetaIphi->Fill((*rgn).gctEta(), (*rgn).gctPhi());
79  }
80  }
81 }
static const std::string kSharedResource
Definition: TFileService.h:76
void analyze(const edm::Event &, const edm::EventSetup &) override
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< L1CaloRegionCollection > m_rctRegions
L1RCTRelValAnalyzer(const edm::ParameterSet &)
edm::EDGetTokenT< L1CaloEmCollection > m_rctEmCands
HLT enums.