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", 22, 0., 22., 18, 0., 18.);
35  h_emNonIsoOccIetaIphi = fs->make<TH2F>("emNonIsoOccupancy2D", "emNonIsoOccupancy2D", 22, 0., 22., 18, 0., 18.);
36 
37  h_regionSum = fs->make<TH1F>("regionSum", "regionSum", 100, 0., 100.);
38  h_regionSumIetaIphi = fs->make<TH2F>("regionSumEtWeighted2D", "regionSumEtWeighted2D", 22, 0., 22., 18, 0., 18.);
39  h_regionOccIetaIphi = fs->make<TH2F>("regionOccupancy2D", "regionOccupancy2D", 22, 0., 22., 18, 0., 18.);
40 }
41 
43  // do anything here that needs to be done at destruction time
44  // (e.g. close files, deallocate resources etc.)
45 }
46 
47 //
48 // member functions
49 //
50 
51 // ------------ method called to produce the data ------------
53  using namespace edm;
54 #ifdef THIS_IS_AN_EVENT_EXAMPLE
56  iEvent.getByLabel("example", pIn);
57 #endif
58 
59 #ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE
60  ESHandle<SetupData> pSetup;
61  iSetup.get<SetupRecord>().get(pSetup);
62 #endif
63 
64  // as in L1GctTestAnalyzer.cc
65  Handle<L1CaloEmCollection> rctEmCands;
67 
68  L1CaloEmCollection::const_iterator em;
69  L1CaloRegionCollection::const_iterator rgn;
70 
71  iEvent.getByLabel(rctEmCandsLabel, rctEmCands);
72  iEvent.getByLabel(rctRegionsLabel, rctRegions);
73 
74  for (em = rctEmCands->begin(); em != rctEmCands->end(); em++) {
75  if ((*em).rank() > 0) {
76  h_emRank->Fill((*em).rank());
77  h_emIeta->Fill((*em).regionId().ieta());
78  h_emIphi->Fill((*em).regionId().iphi());
79  if ((*em).isolated()) {
80  h_emIsoOccIetaIphi->Fill((*em).regionId().ieta(), (*em).regionId().iphi());
81  } else {
82  h_emNonIsoOccIetaIphi->Fill((*em).regionId().ieta(), (*em).regionId().iphi());
83  }
84  }
85  }
86 
87  for (rgn = rctRegions->begin(); rgn != rctRegions->end(); rgn++) {
88  if ((*rgn).et() > 0) {
89  h_regionSum->Fill((*rgn).et());
90  h_regionSumIetaIphi->Fill((*rgn).gctEta(), (*rgn).gctPhi(), (*rgn).et());
91  h_regionOccIetaIphi->Fill((*rgn).gctEta(), (*rgn).gctPhi());
92  }
93  }
94 }
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:488
edm::InputTag rctEmCandsLabel
edm::InputTag rctRegionsLabel
HLT enums.
T get() const
Definition: EventSetup.h:73