CMS 3D CMS Logo

visualizeHFPhase1PMTParams.h
Go to the documentation of this file.
1 #ifndef CONDTOOLS_HCAL_VISUALIZEHFPHASE1PMTPARAMS_H_
2 #define CONDTOOLS_HCAL_VISUALIZEHFPHASE1PMTPARAMS_H_
3 
4 #include <vector>
5 #include <sstream>
6 
10 
12 {
13  // Initialize the visualization options to some meaningful defaults
14  double minCharge{-1.0e2};
15  double maxCharge{1.0e3};
16  double minTDC{0.0};
17  double maxTDC{25.0};
18  double minAsymm{-5.0};
19  double maxAsymm{5.0};
20  unsigned plotPoints{1000};
21  bool verbose{false};
22 
24  {
25  cmdline.option(0, "--minAsymm") >> minAsymm;
26  cmdline.option(0, "--maxAsymm") >> maxAsymm;
27  cmdline.option(0, "--minCharge") >> minCharge;
28  cmdline.option(0, "--maxCharge") >> maxCharge;
29  cmdline.option(0, "--minTDC") >> minTDC;
30  cmdline.option(0, "--maxTDC") >> maxTDC;
31  cmdline.option(0, "--plotPoints") >> plotPoints;
32  verbose = cmdline.has("-v");
33  }
34 
35  static const char* options()
36  {
37  return "[-v] [--minAsymm a0] [--maxAsymm a1] [--minCharge Qmin] "
38  "[--maxCharge Qmax] [--minTDC t0] [--maxTDC t1] [--plotPoints n]";
39  }
40 
41  const char* description() const
42  {
43  if (descr_.empty())
44  {
45  std::ostringstream os;
46 
47  os << " --minAsymm (default " << minAsymm
48  << ") minimum value of charge asymmetry for plot axes\n\n";
49  os << " --maxAsymm (default " << maxAsymm
50  << ") maximum value of charge asymmetry for plot axes\n\n";
51  os << " --minCharge (default " << minCharge
52  << ") minimum value of charge for plot axes\n\n";
53  os << " --maxCharge (default " << maxCharge
54  << ") maximum value of charge for plot axes\n\n";
55  os << " --maxTDC (default " << minTDC
56  << ") minimum value of TDC time for plot axes\n\n";
57  os << " --maxTDC (default " << maxTDC
58  << ") maximum value of TDC time for plot axes\n\n";
59  os << " -v (verbose) print various diagnostics "
60  << "to the standard output\n";
61 
62  descr_ = os.str();
63  }
64  return descr_.c_str();
65  }
66 
67 private:
69 };
70 
71 void visualizeHFPhase1PMTParams(const std::vector<HcalDetId>& idVec,
72  const HFPhase1PMTParams& cuts,
74  const HFPhase1PMTParams* reference = nullptr);
75 
76 #endif // CONDTOOLS_HCAL_VISUALIZEHFPHASE1PMTPARAMS_H_
bool has(const char *shortOpt, const char *longOpt=0)
Definition: CmdLine.h:306
void load(cmdline::CmdLine &cmdline)
const char * description() const
static const char * options()
void visualizeHFPhase1PMTParams(const std::vector< HcalDetId > &idVec, const HFPhase1PMTParams &cuts, const VisualizationOptions &options, const HFPhase1PMTParams *reference=0)
OneShotIStream option(const char *shortOpt, const char *longOpt=0)
Definition: CmdLine.h:322