CMS 3D CMS Logo

L1TRCT.cc
Go to the documentation of this file.
1 /*
2  * \file L1TRCT.cc
3  *
4  * \author P. Wittich
5  *
6  */
7 
10 
11 //DQMStore
13 
14 using namespace edm;
15 
16 namespace {
17  constexpr unsigned int PHIBINS = 18;
18  constexpr float PHIMIN = -0.5;
19  constexpr float PHIMAX = 17.5;
20 
21  // Ranks 6, 10 and 12 bits
22  constexpr unsigned int R6BINS = 64;
23  constexpr float R6MIN = -0.5;
24  constexpr float R6MAX = 63.5;
25  constexpr unsigned int R10BINS = 1024;
26  constexpr float R10MIN = -0.5;
27  constexpr float R10MAX = 1023.5;
28 
29  constexpr unsigned int ETABINS = 22;
30  constexpr float ETAMIN = -0.5;
31  constexpr float ETAMAX = 21.5;
32 } // namespace
33 
35  : histFolder_(ps.getUntrackedParameter<std::string>("HistFolder", "L1T/L1TRCT")),
36  rctSource_L1CRCollection_(consumes<L1CaloRegionCollection>(ps.getParameter<InputTag>("rctSource"))),
37  rctSource_L1CEMCollection_(consumes<L1CaloEmCollection>(ps.getParameter<InputTag>("rctSource"))),
38  filterTriggerType_(ps.getParameter<int>("filterTriggerType")),
39  selectBX_(ps.getUntrackedParameter<int>("selectBX", 2)) {
40  // verbosity switch
41  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
42 
43  if (verbose_)
44  std::cout << "L1TRCT: constructor...." << std::endl;
45 }
46 
48 
51 
52  runId_ = ibooker.bookInt("iRun");
53  runId_->Fill(-1);
54  lumisecId_ = ibooker.bookInt("lumiSection");
55  lumisecId_->Fill(-1);
56 
57  triggerType_ = ibooker.book1D("TriggerType", "TriggerType", 17, -0.5, 16.5);
58 
59  // RCT UNPACKER
60 
61  // electrons
63  ibooker.book2D("RctEmIsoEmEtEtaPhi", "ISO EM E_{T}", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
65  ibooker.book2D("RctEmIsoEmOccEtaPhi", "ISO EM OCCUPANCY", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
67  ibooker.book2D("RctEmNonIsoEmEtEtaPhi", "NON-ISO EM E_{T}", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
68  rctNonIsoEmOccEtaPhi_ = ibooker.book2D(
69  "RctEmNonIsoEmOccEtaPhi", "NON-ISO EM OCCUPANCY", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
70 
71  // global regions
73  ibooker.book2D("RctRegionsEtEtaPhi", "REGION E_{T}", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
75  ibooker.book2D("RctRegionsOccEtaPhi", "REGION OCCUPANCY", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
76 
77  // bits
79  ibooker.book2D("RctBitOverFlowEtaPhi", "OVER FLOW OCCUPANCY", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
81  ibooker.book2D("RctBitTauVetoEtaPhi", "TAU VETO OCCUPANCY", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
82  rctMipEtaPhi_ = ibooker.book2D("RctBitMipEtaPhi", "MIP OCCUPANCY", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
84  ibooker.book2D("RctBitQuietEtaPhi", "QUIET OCCUPANCY", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
85  rctHfPlusTauEtaPhi_ = ibooker.book2D(
86  "RctBitHfPlusTauEtaPhi", "HF plus Tau OCCUPANCY", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
87 
88  // rank histos
89  rctRegionRank_ = ibooker.book1D("RctRegionRank", "REGION RANK", R10BINS, R10MIN, R10MAX);
90  rctIsoEmRank_ = ibooker.book1D("RctEmIsoEmRank", "ISO EM RANK", R6BINS, R6MIN, R6MAX);
91  rctNonIsoEmRank_ = ibooker.book1D("RctEmNonIsoEmRank", "NON-ISO EM RANK", R6BINS, R6MIN, R6MAX);
92 
93  // bx histos
94  rctRegionBx_ = ibooker.book1D("RctRegionBx", "Region BX", 10, -2.5, 7.5);
95  rctEmBx_ = ibooker.book1D("RctEmBx", "EM BX", 10, -2.5, 7.5);
96 
97  // NOT CENTRAL BXs
99  ibooker.book2D("rctNotCentralRegionsEtEtaPhi", "REGION E_{T}", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
101  "rctNotCentralRegionsOccEtaPhi", "REGION OCCUPANCY", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
103  ibooker.book2D("rctNotCentralEmIsoEmEtEtaPhi", "ISO EM E_{T}", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
105  "rctNotCentralEmIsoEmOccEtaPhi", "ISO EM OCCUPANCY", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
107  "rctNotCentralEmNonIsoEmEtEtaPhi", "NON-ISO EM E_{T}", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
109  "rctNotCentralEmNonIsoEmOccEtaPhi", "NON-ISO EM OCCUPANCY", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
110 }
111 
112 void L1TRCT::analyze(const Event &e, const EventSetup &c) {
113  if (verbose_) {
114  std::cout << "L1TRCT: analyze...." << std::endl;
115  }
116 
117  // filter according trigger type
118  // enum ExperimentType {
119  // Undefined = 0,
120  // PhysicsTrigger = 1,
121  // CalibrationTrigger = 2,
122  // RandomTrigger = 3,
123  // Reserved = 4,
124  // TracedEvent = 5,
125  // TestTrigger = 6,
126  // ErrorTrigger = 15
127 
128  // fill a histogram with the trigger type, for normalization fill also last bin
129  // ErrorTrigger + 1
130  double triggerType = static_cast<double>(e.experimentType()) + 0.001;
131  double triggerTypeLast = static_cast<double>(edm::EventAuxiliary::ExperimentType::ErrorTrigger) + 0.001;
133  triggerType_->Fill(triggerTypeLast + 1);
134 
135  // filter only if trigger type is greater than 0, negative values disable filtering
136  if (filterTriggerType_ >= 0) {
137  // now filter, for real data only
138  if (e.isRealData()) {
139  if (!(e.experimentType() == filterTriggerType_)) {
140  edm::LogInfo("L1TRCT") << "\n Event of TriggerType " << e.experimentType() << " rejected" << std::endl;
141  return;
142  }
143  }
144  }
145 
146  // Get the RCT digis
149 
150  bool doEm = true;
151  bool doHd = true;
152 
153  e.getByToken(rctSource_L1CRCollection_, rgn);
154  e.getByToken(rctSource_L1CEMCollection_, em);
155 
156  if (!rgn.isValid()) {
157  edm::LogInfo("DataNotFound") << "can't find L1CaloRegionCollection - RCT";
158  doHd = false;
159  }
160 
161  if (!em.isValid()) {
162  edm::LogInfo("DataNotFound") << "can't find L1CaloEmCollection - Layer2 ";
163  doEm = false;
164  }
165 
166  if (doHd) {
167  // Fill the RCT histograms
168 
169  for (L1CaloRegionCollection::const_iterator ireg = rgn->begin(); ireg != rgn->end(); ireg++) {
170  if (ireg->et() > 0) {
171  rctRegionBx_->Fill(ireg->bx());
172  }
173 
174  if (selectBX_ == -1 || selectBX_ == ireg->bx()) {
175  if (ireg->et() > 0) {
176  rctRegionRank_->Fill(ireg->et());
177  if (ireg->et() > 5) {
178  rctRegionsOccEtaPhi_->Fill(ireg->gctEta(), ireg->gctPhi());
179  }
180  rctRegionsEtEtaPhi_->Fill(ireg->gctEta(), ireg->gctPhi(), ireg->et());
181  }
182 
183  if (ireg->overFlow())
184  rctOverFlowEtaPhi_->Fill(ireg->gctEta(), ireg->gctPhi());
185  if (ireg->tauVeto())
186  rctTauVetoEtaPhi_->Fill(ireg->gctEta(), ireg->gctPhi());
187  if (ireg->mip())
188  rctMipEtaPhi_->Fill(ireg->gctEta(), ireg->gctPhi());
189  if (ireg->quiet())
190  rctQuietEtaPhi_->Fill(ireg->gctEta(), ireg->gctPhi());
191  if (ireg->fineGrain())
192  rctHfPlusTauEtaPhi_->Fill(ireg->gctEta(), ireg->gctPhi());
193 
194  } else if (selectBX_ != -1 && selectBX_ != ireg->bx()) {
195  if (ireg->et() > 5)
196  rctNotCentralRegionsOccEtaPhi_->Fill(ireg->gctEta(), ireg->gctPhi());
197  rctNotCentralRegionsEtEtaPhi_->Fill(ireg->gctEta(), ireg->gctPhi(), ireg->et());
198  }
199  }
200  }
201 
202  if (doEm) {
203  // Isolated and non-isolated EM
204  for (L1CaloEmCollection::const_iterator iem = em->begin(); iem != em->end(); iem++) {
205  if (iem->rank() == 0)
206  continue;
207  rctEmBx_->Fill(iem->bx());
208  if (selectBX_ == -1 || selectBX_ == iem->bx()) {
209  if (iem->isolated()) {
210  rctIsoEmRank_->Fill(iem->rank());
211  rctIsoEmEtEtaPhi_->Fill(iem->regionId().ieta(), iem->regionId().iphi(), iem->rank());
212  if (iem->rank() > 10) {
213  rctIsoEmOccEtaPhi_->Fill(iem->regionId().ieta(), iem->regionId().iphi());
214  }
215  } else {
216  rctNonIsoEmRank_->Fill(iem->rank());
217  rctNonIsoEmEtEtaPhi_->Fill(iem->regionId().ieta(), iem->regionId().iphi(), iem->rank());
218  if (iem->rank() > 10) {
219  rctNonIsoEmOccEtaPhi_->Fill(iem->regionId().ieta(), iem->regionId().iphi());
220  }
221  }
222  } else if (selectBX_ != -1 && selectBX_ != iem->bx()) {
223  if (iem->isolated()) {
224  rctNotCentralIsoEmEtEtaPhi_->Fill(iem->regionId().ieta(), iem->regionId().iphi(), iem->rank());
225  if (iem->rank() > 10) {
226  rctNotCentralIsoEmOccEtaPhi_->Fill(iem->regionId().ieta(), iem->regionId().iphi());
227  }
228  } else {
229  rctNotCentralNonIsoEmEtEtaPhi_->Fill(iem->regionId().ieta(), iem->regionId().iphi(), iem->rank());
230  if (iem->rank() > 10) {
231  rctNotCentralNonIsoEmOccEtaPhi_->Fill(iem->regionId().ieta(), iem->regionId().iphi());
232  }
233  }
234  }
235  }
236  }
237 }
L1TRCT::histFolder_
std::string histFolder_
Definition: L1TRCT.h:113
ETAMIN
const float ETAMIN
Definition: L1TCompare.cc:78
L1TRCT::lumisecId_
MonitorElement * lumisecId_
Definition: L1TRCT.h:111
L1TRCT::rctNotCentralIsoEmEtEtaPhi_
MonitorElement * rctNotCentralIsoEmEtEtaPhi_
Definition: L1TRCT.h:81
L1TRCT::verbose_
bool verbose_
Definition: L1TRCT.h:114
L1TRCT::rctIsoEmOccEtaPhi_
MonitorElement * rctIsoEmOccEtaPhi_
Definition: L1TRCT.h:73
L1TRCT::rctIsoEmEtEtaPhi_
MonitorElement * rctIsoEmEtEtaPhi_
Definition: L1TRCT.h:72
R6MIN
const float R6MIN
Definition: L1TCompare.cc:72
L1TRCT::rctRegionBx_
MonitorElement * rctRegionBx_
Definition: L1TRCT.h:68
edm::Run
Definition: Run.h:45
L1TRCT::rctNonIsoEmOccEtaPhi_
MonitorElement * rctNonIsoEmOccEtaPhi_
Definition: L1TRCT.h:75
edm
HLT enums.
Definition: AlignableModifier.h:19
R6BINS
const unsigned int R6BINS
Definition: L1TCompare.cc:71
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::LogInfo
Definition: MessageLogger.h:254
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
L1TRCT::rctNotCentralNonIsoEmEtEtaPhi_
MonitorElement * rctNotCentralNonIsoEmEtEtaPhi_
Definition: L1TRCT.h:83
L1TRCT::filterTriggerType_
int filterTriggerType_
filter TriggerType
Definition: L1TRCT.h:122
DQMStore.h
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
L1TRCT::rctQuietEtaPhi_
MonitorElement * rctQuietEtaPhi_
Definition: L1TRCT.h:64
L1TRCT::rctNotCentralRegionsEtEtaPhi_
MonitorElement * rctNotCentralRegionsEtEtaPhi_
Definition: L1TRCT.h:79
L1TRCT::rctRegionRank_
MonitorElement * rctRegionRank_
Definition: L1TRCT.h:60
edm::Handle
Definition: AssociativeIterator.h:50
L1TRCT::~L1TRCT
~L1TRCT() override
Definition: L1TRCT.cc:47
L1TRCT::rctMipEtaPhi_
MonitorElement * rctMipEtaPhi_
Definition: L1TRCT.h:63
L1TRCT::rctRegionsOccEtaPhi_
MonitorElement * rctRegionsOccEtaPhi_
Definition: L1TRCT.h:59
L1CaloEmCollection
std::vector< L1CaloEmCand > L1CaloEmCollection
Definition: L1CaloCollections.h:10
L1TRCT::rctNotCentralIsoEmOccEtaPhi_
MonitorElement * rctNotCentralIsoEmOccEtaPhi_
Definition: L1TRCT.h:82
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
L1TRCT::rctNotCentralRegionsOccEtaPhi_
MonitorElement * rctNotCentralRegionsOccEtaPhi_
Definition: L1TRCT.h:80
L1TRCT::rctOverFlowEtaPhi_
MonitorElement * rctOverFlowEtaPhi_
Definition: L1TRCT.h:61
L1TRCT::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: L1TRCT.cc:112
L1TRCT::rctNonIsoEmRank_
MonitorElement * rctNonIsoEmRank_
Definition: L1TRCT.h:77
L1TRCT::rctTauVetoEtaPhi_
MonitorElement * rctTauVetoEtaPhi_
Definition: L1TRCT.h:62
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
L1TRCT::rctNotCentralNonIsoEmOccEtaPhi_
MonitorElement * rctNotCentralNonIsoEmOccEtaPhi_
Definition: L1TRCT.h:84
edm::ParameterSet
Definition: ParameterSet.h:36
unpackData-CaloStage1.doEm
doEm
Definition: unpackData-CaloStage1.py:177
L1TRCT.h
L1TRCT::bookHistograms
void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) override
Definition: L1TRCT.cc:49
dqm::implementation::IBooker::bookInt
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:73
createfilelist.int
int
Definition: createfilelist.py:10
L1TRCT::rctSource_L1CRCollection_
edm::EDGetTokenT< L1CaloRegionCollection > rctSource_L1CRCollection_
Definition: L1TRCT.h:116
L1TRCT::L1TRCT
L1TRCT(const edm::ParameterSet &ps)
Definition: L1TRCT.cc:34
L1TRCT::rctRegionsEtEtaPhi_
MonitorElement * rctRegionsEtEtaPhi_
Definition: L1TRCT.h:58
PHIBINS
const unsigned int PHIBINS
Definition: L1TCompare.cc:66
edm::EventSetup
Definition: EventSetup.h:57
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
L1TRCT::rctNonIsoEmEtEtaPhi_
MonitorElement * rctNonIsoEmEtEtaPhi_
Definition: L1TRCT.h:74
L1TRCT::triggerType_
MonitorElement * triggerType_
Definition: L1TRCT.h:54
R6MAX
const float R6MAX
Definition: L1TCompare.cc:73
L1TRCT::rctHfPlusTauEtaPhi_
MonitorElement * rctHfPlusTauEtaPhi_
Definition: L1TRCT.h:65
std
Definition: JetResolutionObject.h:76
L1CaloRegionCollection
std::vector< L1CaloRegion > L1CaloRegionCollection
Definition: L1CaloCollections.h:11
ETABINS
const unsigned int ETABINS
Definition: L1TCompare.cc:77
L1TRCT::rctIsoEmRank_
MonitorElement * rctIsoEmRank_
Definition: L1TRCT.h:76
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
EventAuxiliary.h
PHIMAX
const float PHIMAX
Definition: L1TCompare.cc:68
L1TRCT::runId_
MonitorElement * runId_
Definition: L1TRCT.h:110
L1TRCT::selectBX_
int selectBX_
Definition: L1TRCT.h:123
ETAMAX
const float ETAMAX
Definition: L1TCompare.cc:79
HLT_2018_cff.triggerType
triggerType
Definition: HLT_2018_cff.py:7443
dqm::implementation::IBooker
Definition: DQMStore.h:43
L1TRCT::rctSource_L1CEMCollection_
edm::EDGetTokenT< L1CaloEmCollection > rctSource_L1CEMCollection_
Definition: L1TRCT.h:117
L1TRCT::rctEmBx_
MonitorElement * rctEmBx_
Definition: L1TRCT.h:69
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
PHIMIN
const float PHIMIN
Definition: L1TCompare.cc:67
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37