CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloSimParameters.cc
Go to the documentation of this file.
3 #include<iostream>
4 
5 CaloSimParameters::CaloSimParameters(double simHitToPhotoelectrons, double photoelectronsToAnalog,
6  double samplingFactor, double timePhase,
7  int readoutFrameSize, int binOfMaximum,
8  bool doPhotostatistics, bool syncPhase)
9 : simHitToPhotoelectrons_(simHitToPhotoelectrons),
10  photoelectronsToAnalog_(photoelectronsToAnalog),
11  timePhase_(timePhase),
12  readoutFrameSize_(readoutFrameSize),
13  binOfMaximum_(binOfMaximum),
14  doPhotostatistics_(doPhotostatistics),
15  syncPhase_(syncPhase)
16 {
17 }
18 
19 
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 {
30  // some subsystems may not want a single number for this
31  if(p.existsAs<double>("photoelectronsToAnalog")) {
32  photoelectronsToAnalog_ = p.getParameter<double>("photoelectronsToAnalog");
33  } else if(p.existsAs<std::vector<double> >("photoelectronsToAnalog")) {
34  // just take the first one
35  photoelectronsToAnalog_ = p.getParameter<std::vector<double> >("photoelectronsToAnalog").at(0);
36  } else {
37  throw cms::Exception("CaloSimParameters") << "Cannot find parameter photoelectronsToAnalog";
38  }
39 }
40 
41 
42 std::ostream & operator<<(std::ostream & os, const CaloSimParameters & p) {
43  DetId dummy(0);
44  os << "CALO SIM PARAMETERS" << std::endl;
45  os << p.simHitToPhotoelectrons(dummy) << " pe per SimHit energy " << std::endl;
46  os << p.photoelectronsToAnalog() << " Analog signal to be digitized per pe" << std::endl;
47  os << " Incident energy / SimHit Energy " << std::endl;
48  return os;
49 }
50 
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:187
CaloSimParameters(double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, int readoutFrameSize, int binOfMaximum, bool doPhotostatistics, bool syncPhase=true)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
Main class for Parameters in different subdetectors.
double simHitToPhotoelectrons() const
Definition: DetId.h:20
double photoelectronsToAnalog() const
the factor which goes from photoelectrons to whatever gets read by ADCs
list at
Definition: asciidump.py:428