CMS 3D CMS Logo

CaloSimParameters.cc
Go to the documentation of this file.
3 #include <iostream>
4 
7  double samplingFactor,
8  double timePhase,
10  int binOfMaximum,
11  bool doPhotostatistics,
12  bool syncPhase)
13  : simHitToPhotoelectrons_(simHitToPhotoelectrons),
14  photoelectronsToAnalog_(photoelectronsToAnalog),
15  timePhase_(timePhase),
16  readoutFrameSize_(readoutFrameSize),
17  binOfMaximum_(binOfMaximum),
18  doPhotostatistics_(doPhotostatistics),
19  syncPhase_(syncPhase) {}
20 
22  : simHitToPhotoelectrons_(p.getParameter<double>("simHitToPhotoelectrons")),
23  photoelectronsToAnalog_(0.),
24  timePhase_(p.getParameter<double>("timePhase")),
25  readoutFrameSize_(p.getParameter<int>("readoutFrameSize")),
26  binOfMaximum_(p.getParameter<int>("binOfMaximum")),
27  doPhotostatistics_(p.getParameter<bool>("doPhotoStatistics")),
28  syncPhase_(p.getParameter<bool>("syncPhase")) {
29  // some subsystems may not want a single number for this
30  if (p.existsAs<double>("photoelectronsToAnalog")) {
31  photoelectronsToAnalog_ = p.getParameter<double>("photoelectronsToAnalog");
32  } else if (p.existsAs<std::vector<double>>("photoelectronsToAnalog")) {
33  // just take the first one
34  photoelectronsToAnalog_ = p.getParameter<std::vector<double>>("photoelectronsToAnalog").at(0);
35  } else if (!skipPe2Fc) {
36  throw cms::Exception("CaloSimParameters") << "Cannot find parameter photoelectronsToAnalog";
37  }
38  // some subsystems may not want this at all
39 }
40 
41 std::ostream &operator<<(std::ostream &os, const CaloSimParameters &p) {
42  DetId dummy(0);
43  os << "CALO SIM PARAMETERS" << std::endl;
44  os << p.simHitToPhotoelectrons(dummy) << " pe per SimHit energy " << std::endl;
45  os << p.photoelectronsToAnalog() << " Analog signal to be digitized per pe" << std::endl;
46  os << " Incident energy / SimHit Energy " << std::endl;
47  return os;
48 }
CaloSimParameters(double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, int readoutFrameSize, int binOfMaximum, bool doPhotostatistics, bool syncPhase=true)
Main class for Parameters in different subdetectors.
Definition: DetId.h:17
std::ostream & operator<<(std::ostream &os, const CaloSimParameters &p)