CMS 3D CMS Logo

FastTimeParametersFromDD.cc
Go to the documentation of this file.
6 
8 
9 //#define EDM_ML_DEBUG
10 
12  FastTimeParameters& php,
13  const std::string& name,
14  const int type) {
15 #ifdef EDM_ML_DEBUG
16  edm::LogVerbatim("HGCalGeom") << "FastTimeParametersFromDD::build called with names " << name << " and type " << type;
17 #endif
18 
19  // Special parameters at simulation level
20  std::string attribute = "Volume";
21  const std::string& value = name;
22  DDValue val(attribute, value, 0.0);
24  DDFilteredView fv(*cpv, filter);
25  bool ok = fv.firstChild();
26 
27  if (ok) {
29  std::vector<double> temp;
30  if (type == 1) {
31  php.geomParBarrel_ = getDDDArray("geomParsB", sv);
32  temp = getDDDArray("numberZB", sv);
33  php.nZBarrel_ = (int)(temp[0]);
34  temp = getDDDArray("numberPhiB", sv);
35  php.nPhiBarrel_ = (int)(temp[0]);
36 #ifdef EDM_ML_DEBUG
37  edm::LogVerbatim("HGCalGeom") << "Barrel Parameters: " << php.nZBarrel_ << ":" << php.nPhiBarrel_ << ":"
38  << php.geomParBarrel_[0] << ":" << php.geomParBarrel_[1];
39 #endif
40  } else if (type == 2) {
41  php.geomParEndcap_ = getDDDArray("geomParsE", sv);
42  temp = getDDDArray("numberEtaE", sv);
43  php.nEtaEndcap_ = (int)(temp[0]);
44  temp = getDDDArray("numberPhiE", sv);
45  php.nPhiEndcap_ = (int)(temp[0]);
46 #ifdef EDM_ML_DEBUG
47  edm::LogVerbatim("HGCalGeom") << "Endcap Parameters: " << php.nEtaEndcap_ << ":" << php.nPhiEndcap_ << ":"
48  << php.geomParEndcap_[0] << ":" << php.geomParEndcap_[1] << ":"
49  << php.geomParEndcap_[2];
50 #endif
51  } else {
52  edm::LogWarning("HGCalGeom") << "Unknown Geometry type " << type << " for FastTiming " << name;
53  }
54  } else {
55  edm::LogError("HGCalGeom") << " Attribute " << val << " not found but needed.";
56  throw cms::Exception("DDException") << "Attribute " << val << " not found but needed.";
57  }
58 #ifdef EDM_ML_DEBUG
59  edm::LogVerbatim("HGCalGeom") << "FastTimeParametersFromDD::Returns with flag " << ok << " for " << name
60  << " and type " << type;
61 #endif
62  return ok;
63 }
64 
66  DDValue value(str);
67  if (DDfetch(&sv, value)) {
68  const std::vector<double>& fvec = value.doubles();
69  int nval = fvec.size();
70  if (nval < 1) {
71  edm::LogError("HGCalGeom") << "HGCalGeomParameters : # of " << str << " bins " << nval << " < 1 ==> illegal";
72  throw cms::Exception("DDException") << "HGCalGeomParameters: cannot get array " << str;
73  }
74  return fvec;
75  } else {
76  edm::LogError("HGCalGeom") << "HGCalGeomParameters: cannot get array " << str;
77  throw cms::Exception("DDException") << "HGCalGeomParameters: cannot get array " << str;
78  }
79 }
MessageLogger.h
FastTimeParameters::geomParBarrel_
std::vector< double > geomParBarrel_
Definition: FastTimeParameters.h:18
DDFilteredView::mergedSpecifics
DDsvalues_type mergedSpecifics() const
Definition: DDFilteredView.cc:42
FastTimeParametersFromDD.h
FastTimeParametersFromDD::build
bool build(const DDCompactView *, FastTimeParameters &, const std::string &, const int)
Definition: FastTimeParametersFromDD.cc:11
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
DDCompactView.h
DDFilteredView::firstChild
bool firstChild()
set the current node to the first child ...
Definition: DDFilteredView.cc:86
DDFilteredView.h
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
pfDeepBoostedJetPreprocessParams_cfi.sv
sv
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:226
str
#define str(s)
Definition: TestProcessor.cc:48
DDfetch
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:79
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition: MessageLogger.h:141
FastTimeParameters::nPhiBarrel_
int nPhiBarrel_
Definition: FastTimeParameters.h:15
edm::LogError
Definition: MessageLogger.h:183
FastTimeParameters::nEtaEndcap_
int nEtaEndcap_
Definition: FastTimeParameters.h:16
FastTimeParameters::nZBarrel_
int nZBarrel_
Definition: FastTimeParameters.h:14
createfilelist.int
int
Definition: createfilelist.py:10
DDutils.h
value
Definition: value.py:1
edm::LogVerbatim
Definition: MessageLogger.h:297
FastTimeParametersFromDD::getDDDArray
std::vector< double > getDDDArray(const std::string &, const DDsvalues_type &)
Definition: FastTimeParametersFromDD.cc:65
FastTimeParameters
Definition: FastTimeParameters.h:9
type
type
Definition: HCALResponse.h:21
heppy_batch.val
val
Definition: heppy_batch.py:351
DDValue
Definition: DDValue.h:21
relativeConstraints.value
value
Definition: relativeConstraints.py:53
Exception
Definition: hltDiff.cc:246
FastTimeParameters::geomParEndcap_
std::vector< double > geomParEndcap_
Definition: FastTimeParameters.h:19
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
DDSpecificsMatchesValueFilter
Definition: DDFilter.h:70
DDFilteredView
Definition: DDFilteredView.h:20
DDsvalues_type
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12
FastTimeParameters::nPhiEndcap_
int nPhiEndcap_
Definition: FastTimeParameters.h:17
FastTimeParameters.h