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
7 
10 
13 
15 
17 
18 using std::cout;
19 using std::endl;
20 using std::string;
21 
22 //
23 // constructors and destructor
24 //
26  : m_rctEmCands(consumes(iConfig.getParameter<edm::InputTag>("rctEmCandsLabel"))),
27  m_rctRegions(consumes(iConfig.getParameter<edm::InputTag>("rctRegionsLabel"))) {
28  // now do what ever initialization is needed
29 
30  usesResource(TFileService::kSharedResource);
32  h_emRank = fs->make<TH1F>("emRank", "emRank", 64, 0., 64.);
33  h_emIeta = fs->make<TH1F>("emOccupancyIeta", "emOccupancyIeta", 22, 0., 22.);
34  h_emIphi = fs->make<TH1F>("emOccupancyIphi", "emOccupancyIphi", 18, 0., 18.);
35  h_emIsoOccIetaIphi = fs->make<TH2F>("emIsoOccupancy2D", "emIsoOccupancy2D", 22, 0., 22., 18, 0., 18.);
36  h_emNonIsoOccIetaIphi = fs->make<TH2F>("emNonIsoOccupancy2D", "emNonIsoOccupancy2D", 22, 0., 22., 18, 0., 18.);
37 
38  h_regionSum = fs->make<TH1F>("regionSum", "regionSum", 100, 0., 100.);
39  h_regionSumIetaIphi = fs->make<TH2F>("regionSumEtWeighted2D", "regionSumEtWeighted2D", 22, 0., 22., 18, 0., 18.);
40  h_regionOccIetaIphi = fs->make<TH2F>("regionOccupancy2D", "regionOccupancy2D", 22, 0., 22., 18, 0., 18.);
41 }
42 
44  // do anything here that needs to be done at destruction time
45  // (e.g. close files, deallocate resources etc.)
46 }
47 
48 //
49 // member functions
50 //
51 
52 // ------------ method called to produce the data ------------
54  using namespace edm;
55 
56  // as in L1GctTestAnalyzer.cc
57  Handle<L1CaloEmCollection> rctEmCands = iEvent.getHandle(m_rctEmCands);
58  Handle<L1CaloRegionCollection> rctRegions = iEvent.getHandle(m_rctRegions);
59 
60  for (auto em = rctEmCands->begin(); em != rctEmCands->end(); em++) {
61  if ((*em).rank() > 0) {
62  h_emRank->Fill((*em).rank());
63  h_emIeta->Fill((*em).regionId().ieta());
64  h_emIphi->Fill((*em).regionId().iphi());
65  if ((*em).isolated()) {
66  h_emIsoOccIetaIphi->Fill((*em).regionId().ieta(), (*em).regionId().iphi());
67  } else {
68  h_emNonIsoOccIetaIphi->Fill((*em).regionId().ieta(), (*em).regionId().iphi());
69  }
70  }
71  }
72 
73  for (auto rgn = rctRegions->begin(); rgn != rctRegions->end(); rgn++) {
74  if ((*rgn).et() > 0) {
75  h_regionSum->Fill((*rgn).et());
76  h_regionSumIetaIphi->Fill((*rgn).gctEta(), (*rgn).gctPhi(), (*rgn).et());
77  h_regionOccIetaIphi->Fill((*rgn).gctEta(), (*rgn).gctPhi());
78  }
79  }
80 }
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.