CMS 3D CMS Logo

ProcConfigurationBase.cc
Go to the documentation of this file.
1 /*
2  * ProcConfigurationBase.cc
3  *
4  * Created on: Jan 30, 2019
5  * Author: Karol Bunkowski kbunkow@cern.ch
6  */
7 
10 
12 
13 ProcConfigurationBase::ProcConfigurationBase() : cscLctCentralBx_(CSCConstants::LCT_CENTRAL_BX) {}
14 
16 
18  int phiBins = nPhiBins();
19  if (phi > phiBins / 2)
20  return (phi - phiBins);
21  else if (phi < -phiBins / 2)
22  return (phi + phiBins);
23 
24  return phi;
25 }
26 
28  if (edmParameterSet.exists("rpcMaxClusterSize")) {
29  setRpcMaxClusterSize(edmParameterSet.getParameter<int>("rpcMaxClusterSize"));
30  edm::LogVerbatim("OMTFReconstruction")
31  << "rpcMaxClusterSize: " << edmParameterSet.getParameter<int>("rpcMaxClusterSize") << std::endl;
32  }
33 
34  if (edmParameterSet.exists("rpcMaxClusterCnt")) {
35  setRpcMaxClusterCnt(edmParameterSet.getParameter<int>("rpcMaxClusterCnt"));
36  edm::LogVerbatim("OMTFReconstruction")
37  << "rpcMaxClusterCnt: " << edmParameterSet.getParameter<int>("rpcMaxClusterCnt") << std::endl;
38  }
39 
40  if (edmParameterSet.exists("rpcDropAllClustersIfMoreThanMax")) {
41  setRpcDropAllClustersIfMoreThanMax(edmParameterSet.getParameter<bool>("rpcDropAllClustersIfMoreThanMax"));
42  edm::LogVerbatim("OMTFReconstruction")
43  << "rpcDropAllClustersIfMoreThanMax: " << edmParameterSet.getParameter<bool>("rpcDropAllClustersIfMoreThanMax")
44  << std::endl;
45  }
46 
47  if (edmParameterSet.exists("lctCentralBx")) {
48  cscLctCentralBx_ = edmParameterSet.getParameter<int>("lctCentralBx");
49  edm::LogVerbatim("OMTFReconstruction")
50  << "lctCentralBx: " << edmParameterSet.getParameter<int>("lctCentralBx") << std::endl;
51  }
52 
53  if (edmParameterSet.exists("minDtPhiQuality")) {
54  minDtPhiQuality = edmParameterSet.getParameter<int>("minDtPhiQuality");
55  edm::LogVerbatim("OMTFReconstruction")
56  << "minDtPhiQuality: " << edmParameterSet.getParameter<int>("minDtPhiQuality") << std::endl;
57  }
58 
59  if (edmParameterSet.exists("minDtPhiBQuality")) {
60  minDtPhiBQuality = edmParameterSet.getParameter<int>("minDtPhiBQuality");
61  edm::LogVerbatim("OMTFReconstruction")
62  << "minDtPhiBQuality: " << edmParameterSet.getParameter<int>("minDtPhiBQuality") << std::endl;
63  }
64 
65  if (edmParameterSet.exists("stubEtaEncoding")) {
66  auto stubEtaEncodingStr = edmParameterSet.getParameter<std::string>("stubEtaEncoding");
67  if (stubEtaEncodingStr == "bits")
69  else if (stubEtaEncodingStr == "valueP1Scale")
71  else
72  throw cms::Exception(std::string("ProcConfigurationBase::configureFromEdmParameterSet: stubEtaEncoding ") +
73  stubEtaEncodingStr + "is not correct");
74 
75  edm::LogVerbatim("OMTFReconstruction")
76  << "stubEtaEncoding: " << static_cast<int>(stubEtaEncoding) << " = " << stubEtaEncodingStr << std::endl;
77  }
78 
79  if (edmParameterSet.exists("dtPhiBUnitsRad")) {
80  dtPhiBUnitsRad_ = edmParameterSet.getParameter<int>("dtPhiBUnitsRad");
81  edm::LogVerbatim("OMTFReconstruction") << "dtPhiBUnitsRad: " << dtPhiBUnitsRad_ << std::endl;
82  }
83 }
Log< level::Info, true > LogVerbatim
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
virtual void setRpcMaxClusterSize(unsigned int rpcMaxClusterSize=4)
virtual void configureFromEdmParameterSet(const edm::ParameterSet &edmParameterSet)
bool exists(std::string const &parameterName) const
checks if a parameter exists
virtual unsigned int nPhiBins() const =0
virtual int foldPhi(int phi) const
virtual void setRpcMaxClusterCnt(unsigned int rpcMaxClusterCnt=2)
virtual void setRpcDropAllClustersIfMoreThanMax(bool rpcDropAllClustersIfMoreThanMax=true)