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  : rctEmCandsLabel(iConfig.getParameter<edm::InputTag>("rctEmCandsLabel")),
28  rctRegionsLabel(iConfig.getParameter<edm::InputTag>("rctRegionsLabel")) {
29  // now do what ever initialization is needed
30 
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 #ifdef THIS_IS_AN_EVENT_EXAMPLE
57  iEvent.getByLabel("example", pIn);
58 #endif
59 
60 #ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE
61  ESHandle<SetupData> pSetup;
62  iSetup.get<SetupRecord>().get(pSetup);
63 #endif
64 
65  // as in L1GctTestAnalyzer.cc
66  Handle<L1CaloEmCollection> rctEmCands;
68 
69  L1CaloEmCollection::const_iterator em;
70  L1CaloRegionCollection::const_iterator rgn;
71 
72  iEvent.getByLabel(rctEmCandsLabel, rctEmCands);
73  iEvent.getByLabel(rctRegionsLabel, rctRegions);
74 
75  for (em = rctEmCands->begin(); em != rctEmCands->end(); em++) {
76  if ((*em).rank() > 0) {
77  h_emRank->Fill((*em).rank());
78  h_emIeta->Fill((*em).regionId().ieta());
79  h_emIphi->Fill((*em).regionId().iphi());
80  if ((*em).isolated()) {
81  h_emIsoOccIetaIphi->Fill((*em).regionId().ieta(), (*em).regionId().iphi());
82  } else {
83  h_emNonIsoOccIetaIphi->Fill((*em).regionId().ieta(), (*em).regionId().iphi());
84  }
85  }
86  }
87 
88  for (rgn = rctRegions->begin(); rgn != rctRegions->end(); rgn++) {
89  if ((*rgn).et() > 0) {
90  h_regionSum->Fill((*rgn).et());
91  h_regionSumIetaIphi->Fill((*rgn).gctEta(), (*rgn).gctPhi(), (*rgn).et());
92  h_regionOccIetaIphi->Fill((*rgn).gctEta(), (*rgn).gctPhi());
93  }
94  }
95 }
L1RCTRelValAnalyzer::h_regionSum
TH1F * h_regionSum
Definition: L1RCTRelValAnalyzer.h:63
L1RCTRelValAnalyzer::h_emIphi
TH1F * h_emIphi
Definition: L1RCTRelValAnalyzer.h:59
L1RCTRelValAnalyzer::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: L1RCTRelValAnalyzer.cc:53
L1RCTRelValAnalyzer::h_emRank
TH1F * h_emRank
Definition: L1RCTRelValAnalyzer.h:57
edm
HLT enums.
Definition: AlignableModifier.h:19
L1RCTRelValAnalyzer.h
gather_cfg.cout
cout
Definition: gather_cfg.py:144
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
L1RCTRelValAnalyzer::h_emIeta
TH1F * h_emIeta
Definition: L1RCTRelValAnalyzer.h:58
EDAnalyzer.h
edm::Handle
Definition: AssociativeIterator.h:50
MakerMacros.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
L1RCTRelValAnalyzer::h_regionOccIetaIphi
TH2F * h_regionOccIetaIphi
Definition: L1RCTRelValAnalyzer.h:65
Service.h
L1RCTRelValAnalyzer::~L1RCTRelValAnalyzer
~L1RCTRelValAnalyzer() override
Definition: L1RCTRelValAnalyzer.cc:43
edm::ESHandle
Definition: DTSurvey.h:22
l1RctValidation_cfi.rctEmCandsLabel
rctEmCandsLabel
Definition: l1RctValidation_cfi.py:5
L1RCTRelValAnalyzer::rctRegionsLabel
edm::InputTag rctRegionsLabel
Definition: L1RCTRelValAnalyzer.h:55
L1RCTRelValAnalyzer::L1RCTRelValAnalyzer
L1RCTRelValAnalyzer(const edm::ParameterSet &)
Definition: L1RCTRelValAnalyzer.cc:26
TFileService.h
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
edm::Service< TFileService >
L1CaloCollections.h
iEvent
int iEvent
Definition: GenABIO.cc:224
L1RCTRelValAnalyzer::h_emIsoOccIetaIphi
TH2F * h_emIsoOccIetaIphi
Definition: L1RCTRelValAnalyzer.h:60
L1RCTRelValAnalyzer::h_regionSumIetaIphi
TH2F * h_regionSumIetaIphi
Definition: L1RCTRelValAnalyzer.h:64
edm::EventSetup
Definition: EventSetup.h:58
get
#define get
TFileService::make
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Frameworkfwd.h
L1RCTRelValAnalyzer::rctEmCandsLabel
edm::InputTag rctEmCandsLabel
Definition: L1RCTRelValAnalyzer.h:54
ParameterSet.h
edm::Event
Definition: Event.h:73
L1RCTRelValAnalyzer::h_emNonIsoOccIetaIphi
TH2F * h_emNonIsoOccIetaIphi
Definition: L1RCTRelValAnalyzer.h:61
l1RctValidation_cfi.rctRegionsLabel
rctRegionsLabel
Definition: l1RctValidation_cfi.py:4