CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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  // Initialize the visualization options to some meaningful defaults
13  double minCharge{-1.0e2};
14  double maxCharge{1.0e3};
15  double minTDC{0.0};
16  double maxTDC{25.0};
17  double minAsymm{-5.0};
18  double maxAsymm{5.0};
19  unsigned plotPoints{1000};
20  bool verbose{false};
21 
22  void load(cmdline::CmdLine& cmdline) {
23  cmdline.option(nullptr, "--minAsymm") >> minAsymm;
24  cmdline.option(nullptr, "--maxAsymm") >> maxAsymm;
25  cmdline.option(nullptr, "--minCharge") >> minCharge;
26  cmdline.option(nullptr, "--maxCharge") >> maxCharge;
27  cmdline.option(nullptr, "--minTDC") >> minTDC;
28  cmdline.option(nullptr, "--maxTDC") >> maxTDC;
29  cmdline.option(nullptr, "--plotPoints") >> plotPoints;
30  verbose = cmdline.has("-v");
31  }
32 
33  static const char* options() {
34  return "[-v] [--minAsymm a0] [--maxAsymm a1] [--minCharge Qmin] "
35  "[--maxCharge Qmax] [--minTDC t0] [--maxTDC t1] [--plotPoints n]";
36  }
37 
38  const char* description() const {
39  if (descr_.empty()) {
40  std::ostringstream os;
41 
42  os << " --minAsymm (default " << minAsymm << ") minimum value of charge asymmetry for plot axes\n\n";
43  os << " --maxAsymm (default " << maxAsymm << ") maximum value of charge asymmetry for plot axes\n\n";
44  os << " --minCharge (default " << minCharge << ") minimum value of charge for plot axes\n\n";
45  os << " --maxCharge (default " << maxCharge << ") maximum value of charge for plot axes\n\n";
46  os << " --maxTDC (default " << minTDC << ") minimum value of TDC time for plot axes\n\n";
47  os << " --maxTDC (default " << maxTDC << ") maximum value of TDC time for plot axes\n\n";
48  os << " -v (verbose) print various diagnostics "
49  << "to the standard output\n";
50 
51  descr_ = os.str();
52  }
53  return descr_.c_str();
54  }
55 
56 private:
58 };
59 
60 void visualizeHFPhase1PMTParams(const std::vector<HcalDetId>& idVec,
61  const HFPhase1PMTParams& cuts,
63  const HFPhase1PMTParams* reference = nullptr);
64 
65 #endif // CONDTOOLS_HCAL_VISUALIZEHFPHASE1PMTPARAMS_H_
OneShotIStream option(const char *shortOpt, const char *longOpt=nullptr)
Definition: CmdLine.h:291
void load(cmdline::CmdLine &cmdline)
const char * description() const
bool has(const char *shortOpt, const char *longOpt=nullptr)
Definition: CmdLine.h:278
TkSoA const *__restrict__ CAHitNtupletGeneratorKernelsGPU::QualityCuts cuts
static const char * options()
void visualizeHFPhase1PMTParams(const std::vector< HcalDetId > &idVec, const HFPhase1PMTParams &cuts, const VisualizationOptions &options, const HFPhase1PMTParams *reference=nullptr)