CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
HcalParametersFromDD Class Reference

#include <HcalParametersFromDD.h>

Public Member Functions

bool build (const DDCompactView *, PHcalParameters &)
 
 HcalParametersFromDD ()
 
virtual ~HcalParametersFromDD ()
 

Detailed Description

Definition at line 7 of file HcalParametersFromDD.h.

Constructor & Destructor Documentation

HcalParametersFromDD::HcalParametersFromDD ( )
inline

Definition at line 9 of file HcalParametersFromDD.h.

9 {}
virtual HcalParametersFromDD::~HcalParametersFromDD ( )
inlinevirtual

Definition at line 10 of file HcalParametersFromDD.h.

10 {}

Member Function Documentation

bool HcalParametersFromDD::build ( const DDCompactView cpv,
PHcalParameters php 
)

Definition at line 33 of file HcalParametersFromDD.cc.

References DDFilteredView::addFilter(), AND, DDVectorGetter::check(), dbl_to_int(), PHcalParameters::etagroup, PHcalParameters::etaMax, PHcalParameters::etaMin, PHcalParameters::etaRange, PHcalParameters::etaTable, Exception, alcazmumu_cfi::filter, DDFilteredView::firstChild(), DDVectorGetter::get(), PHcalParameters::gparHF, PHcalParameters::HBGains, PHcalParameters::HBShift, PHcalParameters::HEGains, PHcalParameters::HEShift, PHcalParameters::HFGains, PHcalParameters::HFShift, i, PHcalParameters::LayerItem::layer, PHcalParameters::Layer0Wt, PHcalParameters::LayerItem::layerGroup, PHcalParameters::layerGroupEta, DDFilteredView::mergedSpecifics(), PHcalParameters::noff, not_equals, convertSQLiteXML::ok, PHcalParameters::phibin, PHcalParameters::phigroup, PHcalParameters::phioff, PHcalParameters::phitable, PHcalParameters::rTable, DDSpecificsFilter::setCriteria(), AlCaHLTBitMon_QueryRunRegistry::string, PHcalParameters::topologyMode, and relativeConstraints::value.

Referenced by PHcalParametersDBBuilder::beginRun(), and HcalParametersESModule::produce().

35 {
36  php.phioff = DDVectorGetter::get( "phioff" );
37  php.etaTable = DDVectorGetter::get( "etaTable" );
38  php.rTable = DDVectorGetter::get( "rTable" );
39  php.phibin = DDVectorGetter::get( "phibin" );
40  php.phitable = DDVectorGetter::get( "phitable" );
41  php.etaRange = DDVectorGetter::get( "etaRange" );
42  php.gparHF = DDVectorGetter::get( "gparHF" );
43  php.noff = dbl_to_int( DDVectorGetter::get( "noff" ));
44  php.Layer0Wt = DDVectorGetter::get( "Layer0Wt" );
45  php.HBGains = DDVectorGetter::get( "HBGains" );
46  php.HEGains = DDVectorGetter::get( "HEGains" );
47  php.HFGains = DDVectorGetter::get( "HFGains" );
48  php.etaMin = dbl_to_int( DDVectorGetter::get( "etaMin" ));
49  php.etaMax = dbl_to_int( DDVectorGetter::get( "etaMax" ));
50  php.HBShift = dbl_to_int( DDVectorGetter::get( "HBShift" ));
51  php.HEShift = dbl_to_int( DDVectorGetter::get( "HEShift" ));
52  php.HFShift = dbl_to_int( DDVectorGetter::get( "HFShift" ));
53 
54  php.etagroup = dbl_to_int( DDVectorGetter::get( "etagroup" ));
55  php.phigroup = dbl_to_int( DDVectorGetter::get( "phigroup" ));
56 
57  PHcalParameters::LayerItem layerGroupEta;
58  for( unsigned int i = 0; i < 27; ++i )
59  {
60  std::stringstream sstm;
61  sstm << "layerGroupEta" << i;
62  std::string tempName = sstm.str();
63 
64  if( DDVectorGetter::check( tempName ))
65  {
66  PHcalParameters::LayerItem layerGroupEta;
67  layerGroupEta.layer = i;
68  layerGroupEta.layerGroup = dbl_to_int( DDVectorGetter::get( tempName ));
69  php.layerGroupEta.push_back( layerGroupEta );
70  }
71  }
72 
73  // FIXME: HcalTopology mode can be defined as double.
74  // This is for consistency with SLHC releases.
75  //
76  std::string attribute = "OnlyForHcalRecNumbering";
77  std::string value = "any";
78  DDValue val( attribute, value, 0.0 );
79 
81  filter.setCriteria( val,
83  DDLogOp::AND, true, // compare strings
84  true // use merged-specifics or simple-specifics
85  );
86  DDFilteredView fv( *cpv );
87  fv.addFilter( filter );
88  bool ok = fv.firstChild();
89 
90  if( !ok ) throw cms::Exception( "HcalParametersFromDD" ) << "Not found "<< attribute.c_str() << " but needed.";
91 
92  DDsvalues_type sv( fv.mergedSpecifics());
93 
94  php.topologyMode = getTopologyMode( "TopologyMode", sv );
95 
96  return true;
97 }
std::vector< double > HEGains
std::vector< double > Layer0Wt
int i
Definition: DBlmapReader.cc:9
std::vector< int > HBShift
std::vector< double > phioff
std::vector< int > etaMax
std::vector< int > layerGroup
std::vector< double > HBGains
std::vector< int > phigroup
std::vector< double > HFGains
std::vector< double > rTable
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
Definition: DDutils.cc:4
std::vector< int > HFShift
bool check(const std::string &)
std::vector< int > etaMin
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::maps an index to a DDValue. The index corresponds to the index assigned to the name of the std::...
Definition: DDsvalues.h:19
std::vector< double > phibin
std::vector< double > get(const std::string &)
std::vector< int > etagroup
std::vector< double > phitable
std::vector< double > etaRange
std::vector< double > etaTable
std::vector< int > noff
std::vector< int > HEShift
std::vector< LayerItem > layerGroupEta
void setCriteria(const DDValue &nameVal, DDCompOp, DDLogOp l=DDLogOp::AND, bool asString=true, bool merged=true)
Definition: DDFilter.cc:245
std::vector< double > gparHF
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.
Definition: DDFilter.h:32