CMS 3D CMS Logo

CaloSimParameters.cc
Go to the documentation of this file.
3 #include<iostream>
4 
6  double samplingFactor, double timePhase,
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") ),
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 if(!skipPe2Fc) {
37  throw cms::Exception("CaloSimParameters") << "Cannot find parameter photoelectronsToAnalog";
38  }
39  // some subsystems may not want this at all
40 }
41 
42 
43 std::ostream & operator<<(std::ostream & os, const CaloSimParameters & p) {
44  DetId dummy(0);
45  os << "CALO SIM PARAMETERS" << std::endl;
46  os << p.simHitToPhotoelectrons(dummy) << " pe per SimHit energy " << std::endl;
47  os << p.photoelectronsToAnalog() << " Analog signal to be digitized per pe" << std::endl;
48  os << " Incident energy / SimHit Energy " << std::endl;
49  return os;
50 }
51 
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:185
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.
double simHitToPhotoelectrons() const
Definition: DetId.h:18
std::ostream & operator<<(std::ostream &os, const CaloSimParameters &p)
double photoelectronsToAnalog() const
the factor which goes from photoelectrons to whatever gets read by ADCs