11 #include "CLHEP/Units/GlobalPhysicalConstants.h"
12 #include "CLHEP/Units/GlobalSystemOfUnits.h"
19 edm::LogInfo(
"HGCalGeom") <<
"FastTimeDDDConstants::FastTimeDDDConstants ( const DDCompactView& cpv ) constructor";
27 std::cout <<
"FastTimeDDDConstants:destructed!!!" << std::endl;
35 int column(0), rowmax(0);
37 double offsetX (0), offsetY(0);
38 while (offsetX <
rOut) {
43 while (offsetY <
rOut) {
49 double limit2 =
sqrt(offsetX*offsetX+offsetY*offsetY);
50 if (limit2 >
rIn && limit1 <
rOut) copy++;
54 if (row > rowmax) rowmax = row;
60 std::cout << rowmax <<
" rows and " << column <<
" columns with total of "
61 << copy <<
" cells in a quadrant " << std::endl;
72 for (
unsigned int k=0;
k<
firstY.size(); ++
k) {
79 int ix = (iq == 1 || iq == 4) ? (jx +
nCols) : (
nCols+1-jx);
80 int iy = (iq == 1 || iq == 2) ? (jy +
nRows) : (
nRows+1-jy);
81 return std::pair<int,int>(ix,iy);
83 return std::pair<int,int>(0,0);
99 int ix = (iq == 1 || iq == 4) ? (jx +
nCols) : (
nCols+1-jx);
100 int iy = (iq == 1 || iq == 2) ? (jy +
nRows) : (
nRows+1-jy);
102 return std::pair<int,int>(ix,iy);
104 return std::pair<int,int>(0,0);
111 int kx = (iq == 1 || iq == 4) ? (ix-
nCols) : (
nCols-1-ix);
112 int ky = (iq == 1 || iq == 2) ? (iy-
nRows) : (
nRows-1-iy);
129 else if (iy>0 && iy<=
nRows) iq = 4;
130 }
else if (ix>0 && ix<=
nCols) {
132 else if (iy>0 && iy<=
nRows) iq = 3;
140 }
else if (copy > 3*
nCells) {
142 }
else if (copy > 2*
nCells) {
144 }
else if (copy >
nCells) {
146 }
else if (copy > 0) {
156 DDValue val(attribute, value, 0.0);
167 edm::LogError(
"HGCalGeom") <<
"FastTimeDDDConstants: cannot get filtered"
168 <<
" view for " << attribute
169 <<
" not matching " <<
value;
170 throw cms::Exception(
"DDException") <<
"FastTimeDDDConstants: cannot match " << attribute <<
" to " <<
value;
181 if (firstY.size() !=
lastY.size()) {
182 edm::LogError(
"HGCalGeom") <<
"FastTimeDDDConstants: unequal numbers "
183 << firstY.size() <<
":" <<
lastY.size()
184 <<
" elements for first and last rows";
185 throw cms::Exception(
"DDException") <<
"FastTimeDDDConstants: wrong array sizes for first/last Row";
189 nCols = (int)(firstY.size());
199 std::cout <<
"FastTimeDDDConstants: nCells = " <<
nCells <<
", nRow = "
200 << 2*
nRows <<
", nColumns = " << 2*nCols << std::endl;
207 std::vector<double> gpar =
getDDDArray(
"geomPars",sv);
208 if (gpar.size() < 3) {
209 edm::LogError(
"HGCalGeom") <<
"FastTimeDDDConstants: too few "
210 << gpar.size() <<
" elements for gpar";
211 throw cms::Exception(
"DDException") <<
"FastTimeDDDConstants: wrong array sizes for gpar";
218 <<
rIn <<
":" <<
rOut << std::endl;
232 std::cout <<
"FastTimeDDDConstants:getDDDArray called for " << str << std::endl;
237 std::cout <<
"FastTimeDDDConstants: " << value << std::endl;
239 const std::vector<double> & fvec = value.
doubles();
240 int nval = fvec.size();
241 if (nval > 0)
return fvec;
243 edm::LogError(
"HGCalGeom") <<
"FastTimeDDDConstants: cannot get array "
245 throw cms::Exception(
"DDException") <<
"FastTimeDDDConstants: cannot get array " << str;
void initialize(const DDCompactView &cpv)
int quadrant(int ix, int iy) const
const std::vector< double > & doubles() const
a reference to the double-valued values stored in the given instance of DDValue
void addFilter(const DDFilter &, DDLogOp op=DDLogOp::AND)
bool isValidXY(int ix, int iy) const
type of data representation of DDCompactView
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
T x() const
Cartesian x coordinate.
FastTimeDDDConstants(const DDCompactView &cpv)
bool isValidCell(int copy) const
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::...
std::vector< int > firstCell
std::vector< int > firstY
#define TYPELOOKUP_DATA_REG(_dataclass_)
void loadSpecPars(const DDFilteredView &fv)
std::vector< int > lastCell
std::vector< double > getDDDArray(const std::string &, const DDsvalues_type &) const
DDsvalues_type mergedSpecifics() const
bool firstChild()
set the current node to the first child ...
int ism(int ieta, int iphi)
std::pair< int, int > getXY(int copy) const
void setCriteria(const DDValue &nameVal, DDCompOp, DDLogOp l=DDLogOp::AND, bool asString=true, bool merged=true)
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.