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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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_
 
edm::ESGetToken< HcalTopology, HcalRecNumberingRecordtok_htopo_
 
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 49 of file HcalLutAnalyzer.cc.

Constructor & Destructor Documentation

◆ HcalLutAnalyzer()

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

Definition at line 76 of file HcalLutAnalyzer.cc.

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

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

◆ ~HcalLutAnalyzer()

HcalLutAnalyzer::~HcalLutAnalyzer ( )
inlineoverride

Definition at line 52 of file HcalLutAnalyzer.cc.

52 {};

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 95 of file HcalLutAnalyzer.cc.

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

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::getData(), 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, tok_htopo_, HcalTopology::valid(), HcalTopology::validHT(), Ymax, Ymin, Zmax, and Zmin.

◆ fillDescriptions()

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

Definition at line 562 of file HcalLutAnalyzer.cc.

562  {
564  desc.setUnknown();
565  descriptions.addDefault(desc);
566 }

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

Member Data Documentation

◆ gains_

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

Definition at line 63 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ inputDir

std::string HcalLutAnalyzer::inputDir
private

Definition at line 58 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ pedestals_

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

Definition at line 62 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ plotsDir

std::string HcalLutAnalyzer::plotsDir
private

Definition at line 59 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ Pmax

double HcalLutAnalyzer::Pmax
private

Definition at line 71 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ Pmin

double HcalLutAnalyzer::Pmin
private

Definition at line 70 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ quality_

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

Definition at line 61 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ respcorrs_

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

Definition at line 64 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ tags_

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

Definition at line 60 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ tok_htopo_

edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> HcalLutAnalyzer::tok_htopo_
private

Definition at line 73 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ Ymax

double HcalLutAnalyzer::Ymax
private

Definition at line 69 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ Ymin

double HcalLutAnalyzer::Ymin
private

Definition at line 68 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ Zmax

double HcalLutAnalyzer::Zmax
private

Definition at line 67 of file HcalLutAnalyzer.cc.

Referenced by analyze(), and HcalLutAnalyzer().

◆ Zmin

double HcalLutAnalyzer::Zmin
private

Definition at line 66 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:338
HcalLutAnalyzer::Ymin
double Ymin
Definition: HcalLutAnalyzer.cc:68
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
HcalTopology
Definition: HcalTopology.h:26
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
cms::cuda::assert
assert(be >=bs)
HcalBarrel
Definition: HcalAssistant.h:33
HcalLutAnalyzer::Zmax
double Zmax
Definition: HcalLutAnalyzer.cc:67
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
HcalLutAnalyzer::pedestals_
std::vector< std::string > pedestals_
Definition: HcalLutAnalyzer.cc:62
HcalLutAnalyzer::Pmin
double Pmin
Definition: HcalLutAnalyzer.cc:70
HcalOuter
Definition: HcalAssistant.h:35
HcalLutAnalyzer::tok_htopo_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > tok_htopo_
Definition: HcalLutAnalyzer.cc:73
HcalTopology::validHT
bool validHT(const HcalTrigTowerDetId &id) const
Definition: HcalTopology.cc:239
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
HcalLutAnalyzer::Ymax
double Ymax
Definition: HcalLutAnalyzer.cc:69
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:58
HcalLutAnalyzer::tags_
std::vector< std::string > tags_
Definition: HcalLutAnalyzer.cc:60
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
HcalObjRepresent::Fill
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Definition: HcalObjRepresent.h:1053
HcalLutAnalyzer::Pmax
double Pmax
Definition: HcalLutAnalyzer.cc:71
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
HcalLutAnalyzer::respcorrs_
std::vector< std::string > respcorrs_
Definition: HcalLutAnalyzer.cc:64
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
HcalTopology::valid
bool valid(const DetId &id) const override
Definition: HcalTopology.cc:225
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
HcalEndcap
Definition: HcalAssistant.h:34
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
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:59
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:430
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:61
cuy.ii
ii
Definition: cuy.py:590
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:161
HcalLutAnalyzer::gains_
std::vector< std::string > gains_
Definition: HcalLutAnalyzer.cc:63
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
HcalLutAnalyzer::Zmin
double Zmin
Definition: HcalLutAnalyzer.cc:66
HcalTrigTowerDetId
Definition: HcalTrigTowerDetId.h:14