CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RCTMonitor.cc
Go to the documentation of this file.
4 #include <iostream>
5 
7  m_nevts(0),
8  m_dbe(edm::Service<DQMStore>().operator->()),
9  m_enableMonitorDaemon(iConfig.getUntrackedParameter<bool>("EnableMonitorDaemon")),
10  m_rctSource(iConfig.getUntrackedParameter<edm::InputTag>("rctSource")),
11  m_writeOutputFile(iConfig.getUntrackedParameter<bool>("WriteOutputFile")),
12  m_outputFileName(iConfig.getUntrackedParameter<std::string>("OutputFileName"))
13 {
14 
15  //set Token(-s)
16  m_rctSourceToken_ = consumes<L1CaloEmCollection>(iConfig.getUntrackedParameter<edm::InputTag>("rctSource"));
17 }
18 
19 
21 {
22 }
23 
24 
26 {
27  BookRCT() ;
28 
29 }
30 
31 
33 {
34  // Print out directory structure
36 
37  // If requested write output to a root file
38  if (m_writeOutputFile){
40  }
41 }
42 
43 
45 {
46 
47  // Fill histograms
48 
49 
50  FillRCT(iEvent,iSetup) ;
51 
52 
53  // Increment number of events
54  m_nevts++;
55 
56 }
57 
58 
59 float DynamicScale(int EtaStamp)
60 {
61  //This function weights bin elements according to spatial extent of calorimeter tower.
62  if(EtaStamp >= 6 && EtaStamp <= 15) {return ScaleINNER;}
63  else if(EtaStamp==5 || EtaStamp==16) {return ScaleIN;}
64  else if(EtaStamp == 4 || EtaStamp == 17) {return ScaleOUT;}
65  else {return 0.000000;}
66 }
67 
68 
70 {
71 
72  // Get the RCT digis
74  // edm::Handle<L1CaloRegionCollection> rgn;
75 
76  iEvent.getByToken(m_rctSourceToken_, em);
77 
78 
79 
80  // Regions
81 // for (L1CaloRegionCollection::const_iterator ireg=rgn->begin(); ireg!=rgn->end(); ireg++) {
82 
83 // if(ireg->et()>7){
84 // m_rctRegionsOccEtaPhi->Fill(ireg->gctPhi(),ireg->gctEta(),DynamicScale(ireg->gctEta()));
85 // m_rctRegionsEtEtaPhi->Fill(ireg->gctPhi(),ireg->gctEta(),ireg->et());
86 // m_rctRegionEt->Fill(ireg->et());
87 // m_rctTauVetoEtaPhi->Fill(ireg->gctPhi(),ireg->gctEta(),ireg->tauVeto());
88 // }
89 // }
90 
91 
92  //Isolated and non-isolated EM with cut at >1 GeV
93  for (L1CaloEmCollection::const_iterator iem=em->begin(); iem!=em->end(); iem++) {
94  if(iem->rank()>1.){ //applies the 1 GeV cut
95  if (iem->isolated()){ //looks for isolated EM candidates only
96  m_rctIsoEmRank1->Fill(iem->rank());
97 //std::cout << "Just to show what is there " << iem->rank() << std::endl ;
98  m_rctIsoEmRankEtaPhi1->Fill(iem->regionId().iphi(),iem->regionId().ieta(),iem->rank());
99  m_rctIsoEmOccEtaPhi1->Fill(iem->regionId().iphi(),iem->regionId().ieta(),DynamicScale(iem->regionId().ieta()));
100  m_rctRelaxedEmRankEtaPhi1->Fill(iem->regionId().iphi(),iem->regionId().ieta(),iem->rank());
101  m_rctRelaxedEmOccEtaPhi1->Fill(iem->regionId().iphi(),iem->regionId().ieta(),DynamicScale(iem->regionId().ieta()));
102  m_rctRelaxedEmRank1->Fill(iem->rank());
103  } else { //instructions for Non-isolated EM candidates
104  m_rctNonIsoEmRank1->Fill(iem->rank());
105  m_rctNonIsoEmRankEtaPhi1->Fill(iem->regionId().iphi(),iem->regionId().ieta(),iem->rank());
106  m_rctNonIsoEmOccEtaPhi1->Fill(iem->regionId().iphi(),iem->regionId().ieta(),DynamicScale(iem->regionId().ieta()));
107  m_rctRelaxedEmRankEtaPhi1->Fill(iem->regionId().iphi(),iem->regionId().ieta(),iem->rank());
108  m_rctRelaxedEmOccEtaPhi1->Fill(iem->regionId().iphi(),iem->regionId().ieta(),DynamicScale(iem->regionId().ieta()));
109  m_rctRelaxedEmRank1->Fill(iem->rank());
110  }
111  }
112  if(iem->rank()>10.){ //applies the 10 GeV cut
113  if (iem->isolated()){ //looks for isolated EM candidates only
114  m_rctIsoEmOccEtaPhi10->Fill(iem->regionId().iphi(),iem->regionId().ieta(),DynamicScale(iem->regionId().ieta()));
115  m_rctRelaxedEmOccEtaPhi10->Fill(iem->regionId().iphi(),iem->regionId().ieta(),DynamicScale(iem->regionId().ieta()));
116  } else { //instructions for Non-isolated EM candidates
117  m_rctNonIsoEmOccEtaPhi10->Fill(iem->regionId().iphi(),iem->regionId().ieta(),DynamicScale(iem->regionId().ieta()));
118  m_rctRelaxedEmOccEtaPhi10->Fill(iem->regionId().iphi(),iem->regionId().ieta(),DynamicScale(iem->regionId().ieta()));;
119  }
120  }
121  }
122 }
123 
124 
125 
127 {
128 //std::cout << "I am in the RCT booking" << std::endl ;
129 
130  // Book RCT histograms
131  m_dbe->setCurrentFolder("RCT");
132 
133  m_rctIsoEmRankEtaPhi1 = m_dbe->book2D("RctIsoEmRankEtaPhi", "ISO EM RANK" , PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
134  m_rctIsoEmOccEtaPhi1 = m_dbe->book2D("RctIsoEmOccEtaPhi", "ISO EM OCCUPANCY" , PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
135  m_rctIsoEmRank1 = m_dbe->book1D("RctIsoEmRank", "ISO EM RANK" , R6BINS, R6MIN, R6MAX);
136  m_rctIsoEmRankEtaPhi10 = m_dbe->book2D("RctIsoEmRankEtaPhi10", "ISO EM RANK" , PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
137  m_rctIsoEmOccEtaPhi10 = m_dbe->book2D("RctIsoEmOccEtaPhi10", "ISO EM OCCUPANCY" , PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
138  m_rctIsoEmRank10 = m_dbe->book1D("RctIsoEmRank10", "ISO EM RANK" , R6BINS, R6MIN, R6MAX);
139 
140  m_rctNonIsoEmRankEtaPhi1 = m_dbe->book2D("RctNonIsoEmRankEtaPhi", "NON-ISO EM RANK" , PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
141  m_rctNonIsoEmOccEtaPhi1 = m_dbe->book2D("RctNonIsoEmOccEtaPhi", "NON-ISO EM OCCUPANCY", PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
142  m_rctNonIsoEmRank1 = m_dbe->book1D("RctNonIsoEmRank", "NON-ISO EM RANK" , R6BINS, R6MIN, R6MAX);
143  m_rctNonIsoEmRankEtaPhi10 = m_dbe->book2D("RctNonIsoEmRankEtaPhi10", "NON-ISO EM RANK" , PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
144  m_rctNonIsoEmOccEtaPhi10 = m_dbe->book2D("RctNonIsoEmOccEtaPhi10", "NON-ISO EM OCCUPANCY", PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
145  m_rctNonIsoEmRank10 = m_dbe->book1D("RctNonIsoEmRank10", "NON-ISO EM RANK" , R6BINS, R6MIN, R6MAX);
146 
147  m_rctRelaxedEmRankEtaPhi1 = m_dbe->book2D("RctRelaxedEmRankEtaPhi", "RELAXED EM RANK" , PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
148  m_rctRelaxedEmOccEtaPhi1 = m_dbe->book2D("RctRelaxedEmOccEtaPhi", "RELAXED EM OCCUPANCY", PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
149  m_rctRelaxedEmRank1 = m_dbe->book1D("RctRelaxedEmRank", "RELAXED EM RANK" , R6BINS, R6MIN, R6MAX);
150  m_rctRelaxedEmRankEtaPhi10= m_dbe->book2D("RctRelaxedEmRankEtaPhi", "RELAXED EM RANK" , PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
151  m_rctRelaxedEmOccEtaPhi10 = m_dbe->book2D("RctRelaxedEmOccEtaPhi10", "RELAXED EM OCCUPANCY", PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
152  m_rctRelaxedEmRank10 = m_dbe->book1D("RctRelaxedEmRank", "RELAXED EM RANK" , R6BINS, R6MIN, R6MAX);
153 
154  m_rctRegionsEtEtaPhi = m_dbe->book2D("RctRegionsEtEtaPhi", "REGION E_{T}" , PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
155  m_rctRegionsOccEtaPhi = m_dbe->book2D("RctRegionsOccEtaPhi", "REGION OCCUPANCY" , PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
156  m_rctTauVetoEtaPhi = m_dbe->book2D("RctTauVetoEtaPhi", "TAU VETO OCCUPANCY" , PHIBINS, PHIMIN, PHIMAX, ETABINS, ETAMIN, ETAMAX);
157  m_rctRegionEt = m_dbe->book1D("RctRegionEt", "REGION E_{T}" , R10BINS, R10MIN, R10MAX);
158 
159 
160 
161 }
162 
163 
164 // define this as a plug-in
166 
167 
168 
T getUntrackedParameter(std::string const &, T const &) const
static const float ETAMIN
Definition: RCTMonitor.h:122
virtual void beginJob()
Definition: RCTMonitor.cc:25
edm::EDGetTokenT< L1CaloEmCollection > m_rctSourceToken_
Definition: RCTMonitor.h:158
MonitorElement * m_rctIsoEmRankEtaPhi10
Definition: RCTMonitor.h:101
std::string m_outputFileName
Definition: RCTMonitor.h:154
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:942
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
MonitorElement * m_rctNonIsoEmOccEtaPhi1
Definition: RCTMonitor.h:108
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
static const float R6MIN
Definition: RCTMonitor.h:125
MonitorElement * m_rctNonIsoEmOccEtaPhi10
Definition: RCTMonitor.h:109
static const float R6MAX
Definition: RCTMonitor.h:125
static const float R10MAX
Definition: RCTMonitor.h:126
void Fill(long long x)
MonitorElement * m_rctRelaxedEmRank1
Definition: RCTMonitor.h:114
MonitorElement * m_rctRelaxedEmRankEtaPhi1
Definition: RCTMonitor.h:106
MonitorElement * m_rctNonIsoEmRank10
Definition: RCTMonitor.h:117
MonitorElement * m_rctNonIsoEmRankEtaPhi10
Definition: RCTMonitor.h:105
int iEvent
Definition: GenABIO.cc:230
MonitorElement * m_rctIsoEmRankEtaPhi1
Definition: RCTMonitor.h:100
virtual void endJob(void)
Definition: RCTMonitor.cc:32
MonitorElement * m_rctNonIsoEmRank1
Definition: RCTMonitor.h:116
MonitorElement * m_rctRelaxedEmOccEtaPhi10
Definition: RCTMonitor.h:111
const float ScaleINNER
static const unsigned int R10BINS
Definition: RCTMonitor.h:126
bool m_writeOutputFile
Definition: RCTMonitor.h:153
static const float PHIMAX
Definition: RCTMonitor.h:123
MonitorElement * m_rctRelaxedEmRankEtaPhi10
Definition: RCTMonitor.h:107
static const unsigned int R6BINS
Definition: RCTMonitor.h:125
MonitorElement * m_rctTauVetoEtaPhi
Definition: RCTMonitor.h:97
static const float R10MIN
Definition: RCTMonitor.h:126
MonitorElement * m_rctRegionsEtEtaPhi
Definition: RCTMonitor.h:95
MonitorElement * m_rctNonIsoEmRankEtaPhi1
Definition: RCTMonitor.h:104
static const float ETAMAX
Definition: RCTMonitor.h:122
static const unsigned int PHIBINS
Definition: RCTMonitor.h:123
const float ScaleOUT
static const unsigned int ETABINS
Definition: RCTMonitor.h:122
MonitorElement * m_rctRegionsOccEtaPhi
Definition: RCTMonitor.h:96
MonitorElement * m_rctIsoEmRank1
Definition: RCTMonitor.h:112
MonitorElement * m_rctRegionEt
Definition: RCTMonitor.h:98
static const float PHIMIN
Definition: RCTMonitor.h:123
MonitorElement * m_rctRelaxedEmRank10
Definition: RCTMonitor.h:115
MonitorElement * m_rctIsoEmOccEtaPhi1
Definition: RCTMonitor.h:102
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2490
MonitorElement * m_rctIsoEmRank10
Definition: RCTMonitor.h:113
MonitorElement * m_rctIsoEmOccEtaPhi10
Definition: RCTMonitor.h:103
void FillRCT(const edm::Event &, const edm::EventSetup &)
Definition: RCTMonitor.cc:69
DQMStore * m_dbe
Definition: RCTMonitor.h:143
MonitorElement * m_rctRelaxedEmOccEtaPhi1
Definition: RCTMonitor.h:110
void BookRCT()
Definition: RCTMonitor.cc:126
void showDirStructure(void) const
Definition: DQMStore.cc:3282
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1070
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition: RCTMonitor.cc:44
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
float DynamicScale(int EtaStamp)
Definition: RCTMonitor.cc:59
const float ScaleIN