CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
HcalLutAnalyzer Class Reference

#include <Test/HcalLutAnalyzer/plugins/HcalLutAnalyzer.cc>

Inheritance diagram for HcalLutAnalyzer:
edm::one::EDAnalyzer< edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 HcalLutAnalyzer (const edm::ParameterSet &)
 
 ~HcalLutAnalyzer () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources >
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 

Private Attributes

std::vector< std::string > gains_
 
std::string inputDir
 
std::vector< std::string > pedestals_
 
std::string plotsDir
 
double Pmax
 
double Pmin
 
std::vector< std::string > quality_
 
std::vector< std::string > respcorrs_
 
std::vector< std::string > tags_
 
double Ymax
 
double Ymin
 
double Zmax
 
double Zmin
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 50 of file HcalLutAnalyzer.cc.

Constructor & Destructor Documentation

◆ HcalLutAnalyzer()

HcalLutAnalyzer::HcalLutAnalyzer ( const edm::ParameterSet iConfig)
explicit

Definition at line 75 of file HcalLutAnalyzer.cc.

75  {
76  inputDir = iConfig.getParameter<std::string>("inputDir");
77  plotsDir = iConfig.getParameter<std::string>("plotsDir");
78  tags_ = iConfig.getParameter<std::vector<std::string> >("tags");
79  quality_ = iConfig.getParameter<std::vector<std::string> >("quality");
80  pedestals_ = iConfig.getParameter<std::vector<std::string> >("pedestals");
81  gains_ = iConfig.getParameter<std::vector<std::string> >("gains");
82  respcorrs_ = iConfig.getParameter<std::vector<std::string> >("respcorrs");
83 
84  Zmin = iConfig.getParameter<double>("Zmin");
85  Zmax = iConfig.getParameter<double>("Zmax");
86  Ymin = iConfig.getParameter<double>("Ymin");
87  Ymax = iConfig.getParameter<double>("Ymax");
88  Pmin = iConfig.getParameter<double>("Pmin");
89  Pmax = iConfig.getParameter<double>("Pmax");
90 }

References gains_, edm::ParameterSet::getParameter(), inputDir, pedestals_, plotsDir, Pmax, Pmin, quality_, respcorrs_, AlCaHLTBitMon_QueryRunRegistry::string, tags_, Ymax, Ymin, Zmax, and Zmin.

◆ ~HcalLutAnalyzer()

HcalLutAnalyzer::~HcalLutAnalyzer ( )
inlineoverride

Definition at line 53 of file HcalLutAnalyzer.cc.

53 {};

Member Function Documentation

◆ analyze()

void HcalLutAnalyzer::analyze ( const edm::Event ,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 92 of file HcalLutAnalyzer.cc.

92  {
93  using namespace std;
94 
97 
98  typedef std::vector<std::string> vstring;
99  typedef std::map<unsigned long int, float> LUTINPUT;
100 
101  static const int NVAR = 5; //variables
102  static const int NDET = 2; //detectors
103  static const int NDEP = 7; //depths
104  static const int NLEV = 3; //old,new,ratio
105 
106  const bool doRatio[NVAR] = {false, true, true, false, true};
107  const char* titleVar[NVAR] = {"Pedestals", "RespCorrs", "Gains", "Threshold", "LUTs"};
108  const char* titleHisR[NLEV] = {"Old", "New", "Ratio"};
109  const char* titleHisD[NLEV] = {"Old", "New", "Difference"};
110  const char* titleDet[4] = {"HBHE", "HF", "HEP17", "HO"};
111  const int DEP[NDET] = {7, 4};
112  const char* titleDep[NDEP] = {"depth1", "depth2", "depth3", "depth4", "depth5", "depth6", "depth7"};
113 
114  TH2D* r[NVAR][NDET];
115  TProfile* p[NVAR][NDET];
116 
117  TH2D* h[NVAR][NLEV][NDET][NDEP];
118  TH2D* hlut[4][NLEV];
119  TH2D* hslope[2];
120  TH2D* houtput[4][2];
121 
122  for (int d = 0; d < 4; ++d) {
123  for (int i = 0; i < 3; ++i) {
124  hlut[d][i] = new TH2D(Form("Lut_%s_%s", titleDet[d], titleHisR[i]),
125  Form("Input LUT, %s", (i == 2 ? "Ratio" : tags_[i].c_str())),
126  260,
127  0,
128  260,
129  240,
130  0,
131  i == NLEV - 1 ? 3 : 2400);
132  hlut[d][i]->SetMarkerColor(d == 0 ? kBlue : d == 1 ? kGreen + 2 : d == 2 ? kRed : kCyan);
133  hlut[d][i]->SetXTitle("raw adc");
134  hlut[d][i]->SetYTitle("lin adc");
135  }
136  }
137 
138  for (int d = 0; d < NDET; ++d) {
139  hslope[d] = new TH2D(
140  Form("GainLutScatter_%s", titleDet[d]), Form("Gain-Lutslope scatter, %s", titleDet[d]), 200, 0, 2, 200, 0, 2);
141  hslope[d]->SetXTitle("Gain x RespCorr ratio");
142  hslope[d]->SetYTitle("Lut ratio");
143 
144  for (int j = 0; j < NVAR; ++j) {
145  double rmin = doRatio[j] ? Ymin : -6;
146  double rmax = doRatio[j] ? Ymax : 6;
147  r[j][d] = new TH2D(Form("r%s_%s", titleVar[j], titleDet[d]),
148  Form("%s, %s", titleVar[j], titleDet[d]),
149  83,
150  -41.5,
151  41.5,
152  250,
153  rmin,
154  rmax);
155  r[j][d]->SetXTitle("iEta");
156  r[j][d]->SetYTitle(doRatio[j] ? "New / Old" : "New - Old");
157  p[j][d] = new TProfile(
158  Form("p%s_%s", titleVar[j], titleDet[d]), Form("%s, %s", titleVar[j], titleDet[d]), 83, -41.5, 41.5);
159  p[j][d]->SetXTitle("iEta");
160  p[j][d]->SetYTitle(doRatio[j] ? "New / Old" : "New - Old");
161  p[j][d]->SetMarkerStyle(20);
162  p[j][d]->SetMarkerSize(0.9);
163  p[j][d]->SetMarkerColor(kBlue);
164 
165  for (int p = 0; p < DEP[d]; ++p) {
166  for (int i = 0; i < NLEV; ++i) {
167  const char* titHist = doRatio[j] ? titleHisR[i] : titleHisD[i];
168  h[j][i][d][p] = new TH2D(Form("h%s_%s_%s_%s", titleVar[j], titHist, titleDet[d], titleDep[p]),
169  Form("%s, %s, %s, %s", titleVar[j], titHist, titleDet[d], titleDep[p]),
170  83,
171  -41.5,
172  41.5,
173  72,
174  0.5,
175  72.5);
176  h[j][i][d][p]->SetXTitle("iEta");
177  h[j][i][d][p]->SetYTitle("iPhi");
178  }
179  }
180  }
181  }
182 
183  for (int i = 0; i < 4; ++i) {
184  int color = i == 0 ? kBlue : i == 1 ? kViolet : i == 2 ? kGreen + 2 : kRed;
185  houtput[i][0] =
186  new TH2D(Form("houtlut0_%d", i), Form("Output LUT, %s", tags_[0].c_str()), 2100, 0, 2100, 260, 0, 260);
187  houtput[i][1] =
188  new TH2D(Form("houtlut1_%d", i), Form("Output LUT, %s", tags_[1].c_str()), 2100, 0, 2100, 260, 0, 260);
189  for (int j = 0; j < 2; ++j) {
190  houtput[i][j]->SetMarkerColor(color);
191  houtput[i][j]->SetLineColor(color);
192  }
193  }
194 
195  //FILL LUT INPUT DATA
196  LUTINPUT lutgain[2];
197  LUTINPUT lutresp[2];
198  LUTINPUT lutpede[2];
199 
200  assert(tags_.size() == 2);
201  assert(gains_.size() == 2);
202  assert(respcorrs_.size() == 2);
203  assert(pedestals_.size() == 2);
204 
205  unsigned long int iraw;
206  int ieta, iphi, idep;
207  string det, base;
208  float val1, val2, val3, val4;
209  float wid1, wid2, wid3, wid4;
210  char buffer[1024];
211 
212  std::vector<HcalDetId> BadChans[2];
213  std::vector<HcalDetId> ZeroLuts[2];
214 
215  //Read input condition files
216  for (int ii = 0; ii < 2; ++ii) {
217  //Gains
218  std::ifstream infile(
219  edm::FileInPath(Form("%s/Gains/Gains_Run%s.txt", inputDir.c_str(), gains_[ii].c_str())).fullPath().c_str());
220  assert(!infile.fail());
221  while (!infile.eof()) {
222  infile.getline(buffer, 1024);
223  if (buffer[0] == '#')
224  continue;
225  std::istringstream(buffer) >> ieta >> iphi >> idep >> det >> val1 >> val2 >> val3 >> val4 >> iraw;
226  if (det != "HB" && det != "HE" && det != "HF")
227  continue;
228 
229  float theval = (val1 + val2 + val3 + val4) / 4.0;
230 
231  HcalSubdetector subdet =
232  det == "HB" ? HcalBarrel : det == "HE" ? HcalEndcap : det == "HF" ? HcalForward : HcalOther;
233 
234  HcalDetId id(subdet, ieta, iphi, idep);
235  lutgain[ii].insert(LUTINPUT::value_type(id.rawId(), theval));
236  }
237 
238  //Pedestals
239  std::ifstream infped(
240  edm::FileInPath(Form("%s/Pedestals/Pedestals_Run%s.txt", inputDir.c_str(), pedestals_[ii].c_str()))
241  .fullPath()
242  .c_str());
243  assert(!infped.fail());
244  while (!infped.eof()) {
245  infped.getline(buffer, 1024);
246  if (buffer[0] == '#')
247  continue;
248  std::istringstream(buffer) >> ieta >> iphi >> idep >> det >> val1 >> val2 >> val3 >> val4 >> wid1 >> wid2 >>
249  wid3 >> wid4 >> iraw;
250  if (det != "HB" && det != "HE" && det != "HF")
251  continue;
252 
253  float theval = (val1 + val2 + val3 + val4) / 4.0;
254 
255  HcalSubdetector subdet =
256  det == "HB" ? HcalBarrel : det == "HE" ? HcalEndcap : det == "HF" ? HcalForward : HcalOther;
257 
258  HcalDetId id(subdet, ieta, iphi, idep);
259  lutpede[ii].insert(LUTINPUT::value_type(id.rawId(), theval));
260  }
261 
262  //Response corrections
263  std::ifstream inresp(
264  edm::FileInPath(Form("%s/RespCorrs/RespCorrs_Run%s.txt", inputDir.c_str(), respcorrs_[ii].c_str()))
265  .fullPath()
266  .c_str());
267  assert(!inresp.fail());
268  while (!inresp.eof()) {
269  inresp.getline(buffer, 1024);
270  if (buffer[0] == '#')
271  continue;
272  std::istringstream(buffer) >> ieta >> iphi >> idep >> det >> val1 >> iraw;
273  if (det != "HB" && det != "HE" && det != "HF")
274  continue;
275 
276  float theval = val1;
277 
278  HcalSubdetector subdet =
279  det == "HB" ? HcalBarrel : det == "HE" ? HcalEndcap : det == "HF" ? HcalForward : HcalOther;
280 
281  HcalDetId id(subdet, ieta, iphi, idep);
282  lutresp[ii].insert(LUTINPUT::value_type(id.rawId(), theval));
283  }
284 
285  //ChannelQuality
286  std::ifstream inchan(
287  edm::FileInPath(Form("%s/ChannelQuality/ChannelQuality_Run%s.txt", inputDir.c_str(), quality_[ii].c_str()))
288  .fullPath()
289  .c_str());
290  assert(!inchan.fail());
291  while (!inchan.eof()) {
292  inchan.getline(buffer, 1024);
293  if (buffer[0] == '#')
294  continue;
295  std::istringstream(buffer) >> ieta >> iphi >> idep >> det >> base >> val1 >> iraw;
296 
297  float theval = val1;
298 
299  HcalSubdetector subdet =
300  det == "HB" ? HcalBarrel
301  : det == "HE" ? HcalEndcap : det == "HF" ? HcalForward : det == "HO" ? HcalOuter : HcalOther;
302 
303  HcalDetId id(subdet, ieta, iphi, idep);
304  if (theval != 0)
305  BadChans[ii].push_back(id);
306  }
307  }
308 
309  LutXml xmls1(edm::FileInPath(Form("%s/%s/%s.xml", inputDir.c_str(), tags_[0].c_str(), tags_[0].c_str())).fullPath());
310  LutXml xmls2(edm::FileInPath(Form("%s/%s/%s.xml", inputDir.c_str(), tags_[1].c_str(), tags_[1].c_str())).fullPath());
311 
312  xmls1.create_lut_map();
313  xmls2.create_lut_map();
314 
315  for (const auto& xml2 : xmls2) {
316  HcalGenericDetId detid(xml2.first);
317 
318  if (detid.genericSubdet() == HcalGenericDetId::HcalGenTriggerTower) {
319  HcalTrigTowerDetId tid(detid.rawId());
320  if (!topology->validHT(tid))
321  continue;
322  const auto& lut2 = xml2.second;
323 
324  int D = abs(tid.ieta()) < 29 ? (lut2.size() == 1024 ? 0 : 3) : tid.version() == 0 ? 1 : 2;
325  for (size_t i = 0; i < lut2.size(); ++i) {
326  if (int(i) % 4 == D)
327  houtput[D][1]->Fill(i, lut2[i]);
328  }
329  } else if (topology->valid(detid)) {
330  HcalDetId id(detid);
331  HcalSubdetector subdet = id.subdet();
332  int idet = int(subdet);
333  const auto& lut2 = xml2.second;
334  int hbhe = idet == HcalForward ? 1 : idet == HcalOuter ? 3 : lut2.size() == 128 ? 0 : 2;
335  for (size_t i = 0; i < lut2.size(); ++i) {
336  hlut[hbhe][1]->Fill(i, lut2[i]);
337  if (hbhe == 2)
338  hlut[hbhe][1]->Fill(i, lut2[i] & 0x3FF);
339  }
340  }
341  }
342 
343  for (const auto& xml1 : xmls1) {
344  HcalGenericDetId detid(xml1.first);
345  const auto& lut1 = xml1.second;
346 
347  if (detid.genericSubdet() == HcalGenericDetId::HcalGenTriggerTower) {
348  HcalTrigTowerDetId tid(detid.rawId());
349  if (!topology->validHT(tid))
350  continue;
351  int D = abs(tid.ieta()) < 29 ? (lut1.size() == 1024 ? 0 : 3) : tid.version() == 0 ? 1 : 2;
352  for (size_t i = 0; i < lut1.size(); ++i) {
353  if (int(i) % 4 == D)
354  houtput[D][0]->Fill(i, lut1[i]);
355  }
356  } else if (topology->valid(detid)) {
357  HcalDetId id(detid);
358  HcalSubdetector subdet = id.subdet();
359  int idet = int(subdet);
360  const auto& lut1 = xml1.second;
361  int hbhe = idet == HcalForward ? 1 : idet == HcalOuter ? 3 : lut1.size() == 128 ? 0 : 2;
362  for (size_t i = 0; i < lut1.size(); ++i) {
363  hlut[hbhe][0]->Fill(i, lut1[i]);
364  if (hbhe == 2)
365  hlut[hbhe][0]->Fill(i, lut1[i] & 0x3FF);
366  }
367  }
368 
369  auto xml2 = xmls2.find(detid.rawId());
370  if (xml2 == xmls2.end())
371  continue;
372 
373  if (detid.genericSubdet() == HcalGenericDetId::HcalGenTriggerTower)
374  continue;
375 
376  HcalDetId id(detid);
377 
378  HcalSubdetector subdet = id.subdet();
379  int idet = int(subdet);
380  int ieta = id.ieta();
381  int iphi = id.iphi();
382  int idep = id.depth() - 1;
383  unsigned long int iraw = id.rawId();
384 
385  if (!topology->valid(detid))
386  continue;
387 
388  int hbhe = idet == HcalForward;
389 
390  const auto& lut2 = xml2->second;
391 
392  size_t size = lut1.size();
393  if (size != lut2.size())
394  continue;
395 
396  std::vector<unsigned int> llut1(size);
397  std::vector<unsigned int> llut2(size);
398  for (size_t i = 0; i < size; ++i) {
399  llut1[i] = hbhe == 0 ? lut1[i] & 0x3FF : lut1[i];
400  llut2[i] = hbhe == 0 ? lut2[i] & 0x3FF : lut2[i];
401  }
402 
403  int threshold[2] = {0, 0};
404  //Thresholds
405  for (size_t i = 0; i < size; ++i) {
406  if (llut1[i] > 0) {
407  threshold[0] = i;
408  break;
409  }
410  if (i == size - 1) {
411  ZeroLuts[0].push_back(id);
412  }
413  }
414  for (size_t i = 0; i < size; ++i) {
415  if (llut2[i] > 0) {
416  threshold[1] = i;
417  break;
418  }
419  if (i == size - 1) {
420  ZeroLuts[1].push_back(id);
421  }
422  }
423 
424  if (subdet != HcalBarrel && subdet != HcalEndcap && subdet != HcalForward)
425  continue;
426 
427  //fill conditions
428 
429  double xfill = 0;
430  h[0][0][hbhe][idep]->Fill(ieta, iphi, lutpede[0][iraw]);
431  h[0][1][hbhe][idep]->Fill(ieta, iphi, lutpede[1][iraw]);
432  xfill = lutpede[1][iraw] - lutpede[0][iraw];
433  h[0][2][hbhe][idep]->Fill(ieta, iphi, xfill);
434  r[0][hbhe]->Fill(ieta, xfill);
435  p[0][hbhe]->Fill(ieta, xfill);
436 
437  h[1][0][hbhe][idep]->Fill(ieta, iphi, lutresp[0][iraw]);
438  h[1][1][hbhe][idep]->Fill(ieta, iphi, lutresp[1][iraw]);
439  xfill = lutresp[1][iraw] / lutresp[0][iraw];
440  h[1][2][hbhe][idep]->Fill(ieta, iphi, xfill);
441  r[1][hbhe]->Fill(ieta, xfill);
442  p[1][hbhe]->Fill(ieta, xfill);
443 
444  h[2][0][hbhe][idep]->Fill(ieta, iphi, lutgain[0][iraw]);
445  h[2][1][hbhe][idep]->Fill(ieta, iphi, lutgain[1][iraw]);
446  xfill = lutgain[1][iraw] / lutgain[0][iraw];
447  h[2][2][hbhe][idep]->Fill(ieta, iphi, xfill);
448  r[2][hbhe]->Fill(ieta, xfill);
449  p[2][hbhe]->Fill(ieta, xfill);
450 
451  h[3][0][hbhe][idep]->Fill(ieta, iphi, threshold[0]);
452  h[3][1][hbhe][idep]->Fill(ieta, iphi, threshold[1]);
453  xfill = threshold[1] - threshold[0];
454  h[3][2][hbhe][idep]->Fill(ieta, iphi, xfill);
455  r[3][hbhe]->Fill(ieta, xfill);
456  p[3][hbhe]->Fill(ieta, xfill);
457 
458  size_t maxvalue = hbhe == 0 ? 1023 : 2047;
459 
460  //LutDifference
461  for (size_t i = 0; i < size; ++i) {
462  hlut[hbhe][2]->Fill(i, llut1[i] == 0 ? 0 : (double)llut2[i] / llut1[i]);
463 
464  if (i == size - 1 ||
465  (llut1[i] == maxvalue || llut2[i] == maxvalue)) { //Fill with only the last one before the maximum
466  if (llut1[i - 1] == 0 || llut2[i - 1] == 0) {
467  break;
468  }
469  double condratio = lutgain[1][iraw] / lutgain[0][iraw] * lutresp[1][iraw] / lutresp[0][iraw];
470  xfill = (double)llut2[i - 1] / llut1[i - 1];
471  hslope[hbhe]->Fill(condratio, xfill);
472 
473  h[4][0][hbhe][idep]->Fill(ieta, iphi, (double)llut1[i - 1] / (i - 1));
474  h[4][1][hbhe][idep]->Fill(ieta, iphi, (double)llut2[i - 1] / (i - 1));
475  h[4][2][hbhe][idep]->Fill(ieta, iphi, xfill);
476  r[4][hbhe]->Fill(ieta, xfill);
477  p[4][hbhe]->Fill(ieta, xfill);
478 
479  break;
480  }
481  }
482  }
483 
484  gROOT->SetStyle("Plain");
485  gStyle->SetPalette(1);
486  gStyle->SetStatW(0.2);
487  gStyle->SetStatH(0.1);
488  gStyle->SetStatY(1.0);
489  gStyle->SetStatX(0.9);
490  gStyle->SetOptStat(110010);
491  gStyle->SetOptFit(111111);
492 
493  //Draw and Print
494  TCanvas* cc = new TCanvas("cc", "cc", 0, 0, 1600, 1200);
495  cc->SetGridy();
496  for (int j = 0; j < NVAR; ++j) {
497  gSystem->mkdir(TString(plotsDir) + "/_" + titleVar[j]);
498  for (int d = 0; d < NDET; ++d) {
499  cc->Clear();
500  r[j][d]->Draw("colz");
501  cc->Print(TString(plotsDir) + "/_" + titleVar[j] + "/" + TString(r[j][d]->GetName()) + ".pdf");
502 
503  cc->Clear();
504  p[j][d]->Draw();
505  if (doRatio[j]) {
506  p[j][d]->SetMinimum(Pmin);
507  p[j][d]->SetMaximum(Pmax);
508  }
509  cc->Print(TString(plotsDir) + "/_" + titleVar[j] + "/" + TString(p[j][d]->GetName()) + ".pdf");
510 
511  for (int i = 0; i < NLEV; ++i) {
512  for (int p = 0; p < DEP[d]; ++p) {
513  cc->Clear();
514  h[j][i][d][p]->Draw("colz");
515 
516  if (i == NLEV - 1) {
517  if (doRatio[j]) {
518  h[j][2][d][p]->SetMinimum(Zmin);
519  h[j][2][d][p]->SetMaximum(Zmax);
520  } else {
521  h[j][2][d][p]->SetMinimum(-3);
522  h[j][2][d][p]->SetMaximum(3);
523  }
524  }
525  cc->Print(TString(plotsDir) + "/_" + titleVar[j] + "/" + TString(h[j][i][d][p]->GetName()) + ".pdf");
526  }
527  }
528  }
529  }
530 
531  for (int i = 0; i < NLEV; ++i) {
532  cc->Clear();
533  hlut[0][i]->Draw();
534  hlut[1][i]->Draw("sames");
535  hlut[2][i]->Draw("sames");
536  hlut[3][i]->Draw("sames");
537  cc->Print(TString(plotsDir) + Form("LUT_%d.gif", i));
538  }
539  cc->Clear();
540  hslope[0]->Draw("colz");
541  cc->SetGridx();
542  cc->SetGridy();
543  cc->Print(TString(plotsDir) + "GainLutScatterHBHE.pdf");
544  cc->Clear();
545  hslope[1]->Draw("colz");
546  cc->SetGridx();
547  cc->SetGridy();
548  cc->Print(TString(plotsDir) + "GainLutScatterLutHF.pdf");
549 
550  for (int i = 0; i < 2; ++i) {
551  cc->Clear();
552  houtput[0][i]->Draw("box");
553  houtput[1][i]->Draw("samebox");
554  houtput[2][i]->Draw("samebox");
555  houtput[3][i]->Draw("samebox");
556  cc->Print(TString(plotsDir) + Form("OUT_%d.gif", i));
557  }
558 }

References funct::abs(), cms::cuda::assert(), newFWLiteAna::base, edmScanValgrind::buffer, LutXml::create_lut_map(), ztail::d, histoStyle::doRatio, HcalObjRepresent::Fill(), edm::FileInPath::fullPath(), gains_, HcalGenericDetId::genericSubdet(), edm::EventSetup::get(), get, photonIsolationHIProducer_cfi::hbhe, HcalBarrel, HcalEndcap, HcalForward, HcalGenericDetId::HcalGenTriggerTower, HcalOther, HcalOuter, mps_fire::i, triggerObjects_cff::id, LEDCalibrationChannels::ieta, cuy::ii, timingPdfMaker::infile, inputDir, createfilelist::int, LEDCalibrationChannels::iphi, dqmiolumiharvest::j, AlCaHLTBitMon_ParallelJobs::p, pedestals_, plotsDir, Pmax, Pmin, quality_, alignCSCRings::r, DetId::rawId(), respcorrs_, findQualityFiles::size, tags_, remoteMonitoring_LED_IterMethod_cfg::threshold, ecaldqm::topology(), CaloTopology::valid(), Ymax, Ymin, Zmax, and Zmin.

◆ fillDescriptions()

void HcalLutAnalyzer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 560 of file HcalLutAnalyzer.cc.

560  {
562  desc.setUnknown();
563  descriptions.addDefault(desc);
564 }

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

Member Data Documentation

◆ gains_

std::vector<std::string> HcalLutAnalyzer::gains_
private

Definition at line 64 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ inputDir

std::string HcalLutAnalyzer::inputDir
private

Definition at line 59 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ pedestals_

std::vector<std::string> HcalLutAnalyzer::pedestals_
private

Definition at line 63 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ plotsDir

std::string HcalLutAnalyzer::plotsDir
private

Definition at line 60 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ Pmax

double HcalLutAnalyzer::Pmax
private

Definition at line 72 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ Pmin

double HcalLutAnalyzer::Pmin
private

Definition at line 71 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ quality_

std::vector<std::string> HcalLutAnalyzer::quality_
private

Definition at line 62 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ respcorrs_

std::vector<std::string> HcalLutAnalyzer::respcorrs_
private

Definition at line 65 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ tags_

std::vector<std::string> HcalLutAnalyzer::tags_
private

Definition at line 61 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ Ymax

double HcalLutAnalyzer::Ymax
private

Definition at line 70 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ Ymin

double HcalLutAnalyzer::Ymin
private

Definition at line 69 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ Zmax

double HcalLutAnalyzer::Zmax
private

Definition at line 68 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ Zmin

double HcalLutAnalyzer::Zmin
private

Definition at line 67 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

HcalOther
Definition: HcalAssistant.h:38
mps_fire.i
i
Definition: mps_fire.py:428
HcalGenericDetId
Definition: HcalGenericDetId.h:15
LutXml::create_lut_map
int create_lut_map(void)
Definition: LutXml.cc:336
HcalLutAnalyzer::Ymin
double Ymin
Definition: HcalLutAnalyzer.cc:69
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
cms::cuda::assert
assert(be >=bs)
HcalBarrel
Definition: HcalAssistant.h:33
HcalLutAnalyzer::Zmax
double Zmax
Definition: HcalLutAnalyzer.cc:68
edmScanValgrind.buffer
buffer
Definition: edmScanValgrind.py:171
cc
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
edm::FileInPath
Definition: FileInPath.h:64
histoStyle.doRatio
doRatio
Definition: histoStyle.py:55
h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
HcalLutAnalyzer::pedestals_
std::vector< std::string > pedestals_
Definition: HcalLutAnalyzer.cc:63
ecaldqm::topology
const CaloTopology * topology(nullptr)
HcalLutAnalyzer::Pmin
double Pmin
Definition: HcalLutAnalyzer.cc:71
edm::ESHandle< HcalTopology >
HcalOuter
Definition: HcalAssistant.h:35
HcalRecNumberingRecord
Definition: HcalRecNumberingRecord.h:23
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
HcalLutAnalyzer::Ymax
double Ymax
Definition: HcalLutAnalyzer.cc:70
HcalGenericDetId::HcalGenTriggerTower
Definition: HcalGenericDetId.h:23
HcalDetId
Definition: HcalDetId.h:12
createfilelist.int
int
Definition: createfilelist.py:10
HcalLutAnalyzer::inputDir
std::string inputDir
Definition: HcalLutAnalyzer.cc:59
HcalLutAnalyzer::tags_
std::vector< std::string > tags_
Definition: HcalLutAnalyzer.cc:61
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
get
#define get
HcalObjRepresent::Fill
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Definition: HcalObjRepresent.h:1053
HcalLutAnalyzer::Pmax
double Pmax
Definition: HcalLutAnalyzer.cc:72
HcalLutAnalyzer::respcorrs_
std::vector< std::string > respcorrs_
Definition: HcalLutAnalyzer.cc:65
alignCSCRings.r
r
Definition: alignCSCRings.py:93
photonIsolationHIProducer_cfi.hbhe
hbhe
Definition: photonIsolationHIProducer_cfi.py:8
HcalSubdetector
HcalSubdetector
Definition: HcalAssistant.h:31
HcalForward
Definition: HcalAssistant.h:36
funct::D
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
std
Definition: JetResolutionObject.h:76
CaloTopology::valid
bool valid(const DetId &id) const
Is this a valid cell id?
Definition: CaloTopology.cc:74
HcalEndcap
Definition: HcalAssistant.h:34
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
vstring
vector< string > vstring
Definition: ExoticaDQM.cc:8
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
timingPdfMaker.infile
infile
Definition: timingPdfMaker.py:350
ztail.d
d
Definition: ztail.py:151
HcalLutAnalyzer::plotsDir
std::string plotsDir
Definition: HcalLutAnalyzer.cc:60
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
LutXml
Definition: LutXml.h:27
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:426
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
newFWLiteAna.base
base
Definition: newFWLiteAna.py:92
HcalLutAnalyzer::quality_
std::vector< std::string > quality_
Definition: HcalLutAnalyzer.cc:62
cuy.ii
ii
Definition: cuy.py:590
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:163
HcalLutAnalyzer::gains_
std::vector< std::string > gains_
Definition: HcalLutAnalyzer.cc:64
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
HcalLutAnalyzer::Zmin
double Zmin
Definition: HcalLutAnalyzer.cc:67
HcalTrigTowerDetId
Definition: HcalTrigTowerDetId.h:14