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  : rctEmCandsLabel(iConfig.getParameter<edm::InputTag>("rctEmCandsLabel")),
27  rctRegionsLabel(iConfig.getParameter<edm::InputTag>("rctRegionsLabel")) {
28  // now do what ever initialization is needed
29 
31  h_emRank = fs->make<TH1F>("emRank", "emRank", 64, 0., 64.);
32  h_emIeta = fs->make<TH1F>("emOccupancyIeta", "emOccupancyIeta", 22, 0., 22.);
33  h_emIphi = fs->make<TH1F>("emOccupancyIphi", "emOccupancyIphi", 18, 0., 18.);
34  h_emIsoOccIetaIphi = fs->make<TH2F>("emIsoOccupancy2D", "emIsoOccupancy2D",
35  22, 0., 22., 18, 0., 18.);
36  h_emNonIsoOccIetaIphi = fs->make<TH2F>(
37  "emNonIsoOccupancy2D", "emNonIsoOccupancy2D", 22, 0., 22., 18, 0., 18.);
38 
39  h_regionSum = fs->make<TH1F>("regionSum", "regionSum", 100, 0., 100.);
41  fs->make<TH2F>("regionSumEtWeighted2D", "regionSumEtWeighted2D", 22, 0.,
42  22., 18, 0., 18.);
43  h_regionOccIetaIphi = fs->make<TH2F>("regionOccupancy2D", "regionOccupancy2D",
44  22, 0., 22., 18, 0., 18.);
45 }
46 
48 
49  // do anything here that needs to be done at destruction time
50  // (e.g. close files, deallocate resources etc.)
51 }
52 
53 //
54 // member functions
55 //
56 
57 // ------------ method called to produce the data ------------
59  const edm::EventSetup &iSetup) {
60  using namespace edm;
61 #ifdef THIS_IS_AN_EVENT_EXAMPLE
63  iEvent.getByLabel("example", pIn);
64 #endif
65 
66 #ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE
67  ESHandle<SetupData> pSetup;
68  iSetup.get<SetupRecord>().get(pSetup);
69 #endif
70 
71  // as in L1GctTestAnalyzer.cc
72  Handle<L1CaloEmCollection> rctEmCands;
74 
75  L1CaloEmCollection::const_iterator em;
76  L1CaloRegionCollection::const_iterator rgn;
77 
78  iEvent.getByLabel(rctEmCandsLabel, rctEmCands);
79  iEvent.getByLabel(rctRegionsLabel, rctRegions);
80 
81  for (em = rctEmCands->begin(); em != rctEmCands->end(); em++) {
82  if ((*em).rank() > 0) {
83  h_emRank->Fill((*em).rank());
84  h_emIeta->Fill((*em).regionId().ieta());
85  h_emIphi->Fill((*em).regionId().iphi());
86  if ((*em).isolated()) {
87  h_emIsoOccIetaIphi->Fill((*em).regionId().ieta(),
88  (*em).regionId().iphi());
89  } else {
90  h_emNonIsoOccIetaIphi->Fill((*em).regionId().ieta(),
91  (*em).regionId().iphi());
92  }
93  }
94  }
95 
96  for (rgn = rctRegions->begin(); rgn != rctRegions->end(); rgn++) {
97  if ((*rgn).et() > 0) {
98  h_regionSum->Fill((*rgn).et());
99  h_regionSumIetaIphi->Fill((*rgn).gctEta(), (*rgn).gctPhi(), (*rgn).et());
100  h_regionOccIetaIphi->Fill((*rgn).gctEta(), (*rgn).gctPhi());
101  }
102  }
103 }
void analyze(const edm::Event &, const edm::EventSetup &) override
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
int iEvent
Definition: GenABIO.cc:224
L1RCTRelValAnalyzer(const edm::ParameterSet &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:480
edm::InputTag rctEmCandsLabel
edm::InputTag rctRegionsLabel
HLT enums.
T get() const
Definition: EventSetup.h:71