Skip to content

Commit

Permalink
Merge pull request cms-sw#10123 from ianna/hcal-parameters-schema-upd…
Browse files Browse the repository at this point in the history
…ate-v2

Hcal Parameters Schema Update v2
  • Loading branch information
cmsbuild committed Jul 14, 2015
2 parents 6e97fa6 + e2b4086 commit 0a956f1
Show file tree
Hide file tree
Showing 28 changed files with 1,317 additions and 112 deletions.
6 changes: 4 additions & 2 deletions CondFormats/GeometryObjects/interface/HcalParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class HcalParameters {
std::vector<double> zHE;
std::vector<double> dzHE;
std::vector<double> zHO;
double dzVcal;

std::vector<double> rhoxHB;
std::vector<double> zxHB;
std::vector<double> dyHB;
Expand All @@ -44,7 +44,9 @@ class HcalParameters {
std::vector<double> HBGains;
std::vector<double> HEGains;
std::vector<double> HFGains;

std::vector<double> etaTableHF;
double dzVcal;

std::vector<int> maxDepth;
std::vector<int> modHB;
std::vector<int> modHE;
Expand Down
1 change: 1 addition & 0 deletions CondFormats/GeometryObjects/src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
<field name="phigroup" mapping="blob"/>
<field name="layerGroupEtaSim" mapping="blob"/>
<field name="layerGroupEtaRec" mapping="blob"/>
<field name="etaTableHF" mapping="blob"/>
</class>
<class name="HcalParameters::LayerItem"/>
<class name="std::vector<HcalParameters::LayerItem>"/>
Expand Down
16 changes: 8 additions & 8 deletions Geometry/HcalCommonData/data/Phase0/hcalRecNumbering.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<DDDefinition xmlns="http://www.cern.ch/cms/DDL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cern.ch/cms/DDL ../../../DetectorDescription/Schema/DDLSchema.xsd">

<ConstantsSection label="hcalSimNumbering.xml" eval="true">
<ConstantsSection label="hcalRecNumbering.xml" eval="true">
<Vector name="etagroup" type="numeric" nEntries="29">
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Expand All @@ -10,25 +10,25 @@
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
</Vector>
<Vector name="layergroupEta1" type="numeric" nEntries="19">
<Vector name="layerGroupRecEta1" type="numeric" nEntries="19">
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4
</Vector>
<Vector name="layergroupEta15" type="numeric" nEntries="19">
<Vector name="layerGroupRecEta15" type="numeric" nEntries="19">
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4
</Vector>
<Vector name="layergroupEta16" type="numeric" nEntries="19">
<Vector name="layerGroupRecEta16" type="numeric" nEntries="19">
1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
</Vector>
<Vector name="layergroupEta17" type="numeric" nEntries="19">
<Vector name="layerGroupRecEta17" type="numeric" nEntries="19">
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
</Vector>
<Vector name="layergroupEta18" type="numeric" nEntries="19">
<Vector name="layerGroupRecEta18" type="numeric" nEntries="19">
1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
</Vector>
<Vector name="layergroupEta19" type="numeric" nEntries="19">
<Vector name="layerGroupRecEta19" type="numeric" nEntries="19">
1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
</Vector>
<Vector name="layergroupEta27" type="numeric" nEntries="19">
<Vector name="layerGroupRecEta27" type="numeric" nEntries="19">
1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
</Vector>
</ConstantsSection>
Expand Down
20 changes: 10 additions & 10 deletions Geometry/HcalCommonData/data/Phase0/hcalSimNumbering.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,25 @@
10.0*deg, 10.0*deg, 10.0*deg, 10.0*deg, 10.0*deg, 20.0*deg,
20.0*deg
</Vector>
<Vector name="layerGroupEta1" type="numeric" nEntries="19">
<Vector name="layerGroupSimEta1" type="numeric" nEntries="19">
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4
</Vector>
<Vector name="layerGroupEta15" type="numeric" nEntries="19">
<Vector name="layerGroupSimEta15" type="numeric" nEntries="19">
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4
</Vector>
<Vector name="layerGroupEta16" type="numeric" nEntries="19">
<Vector name="layerGroupSimEta16" type="numeric" nEntries="19">
1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
</Vector>
<Vector name="layerGroupEta17" type="numeric" nEntries="19">
<Vector name="layerGroupSimEta17" type="numeric" nEntries="19">
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
</Vector>
<Vector name="layerGroupEta18" type="numeric" nEntries="19">
<Vector name="layerGroupSimEta18" type="numeric" nEntries="19">
1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
</Vector>
<Vector name="layerGroupEta19" type="numeric" nEntries="19">
<Vector name="layerGroupSimEta19" type="numeric" nEntries="19">
1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
</Vector>
<Vector name="layerGroupEta27" type="numeric" nEntries="19">
<Vector name="layerGroupSimEta27" type="numeric" nEntries="19">
1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
</Vector>
<Vector name="etaMin" type="numeric" nEntries="4">
Expand All @@ -55,6 +55,9 @@
<Vector name="etaMax" type="numeric" nEntries="4">
16, 29, 41, 15
</Vector>
<Vector name="MaxDepth" type="numeric" nEntries="4">
2, 3, 2, 4
</Vector>
<Vector name="etaRange" type="numeric" nEntries="4">
1.392, 3.000, 5.500, 1.305
</Vector>
Expand All @@ -68,9 +71,6 @@
<Vector name="Layer0Wt" type="numeric" nEntries="2">
0.5, 0.5
</Vector>
<Vector name="MaxDepth" type="numeric" nEntries="4">
2, 3, 2, 4
</Vector>
<Vector name="HBGains" type="numeric" nEntries="4">
117.0, 117.0, 117.0, 217.0
</Vector>
Expand Down
6 changes: 3 additions & 3 deletions Geometry/HcalCommonData/data/PhaseI/hcalRecNumbering.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
</Vector>
<Vector name="layergroupEta1" type="numeric" nEntries="19">
<Vector name="layerGroupRecEta1" type="numeric" nEntries="19">
1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4
</Vector>
<Vector name="layergroupEta16" type="numeric" nEntries="19">
<Vector name="layerGroupRecEta16" type="numeric" nEntries="19">
1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
</Vector>
<Vector name="layergroupEta17" type="numeric" nEntries="19">
<Vector name="layerGroupRecEta17" type="numeric" nEntries="19">
1, 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5
</Vector>
</ConstantsSection>
Expand Down
14 changes: 7 additions & 7 deletions Geometry/HcalCommonData/data/PhaseI/hcalSimNumbering.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
10.0*deg, 10.0*deg, 10.0*deg, 10.0*deg, 10.0*deg, 20.0*deg,
20.0*deg
</Vector>
<Vector name="layerGroupEta1" type="numeric" nEntries="19">
<Vector name="layerGroupSimEta1" type="numeric" nEntries="19">
1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4
</Vector>
<Vector name="layerGroupEta16" type="numeric" nEntries="19">
<Vector name="layerGroupSimEta16" type="numeric" nEntries="19">
1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
</Vector>
<Vector name="layerGroupEta17" type="numeric" nEntries="19">
<Vector name="layerGroupSimEta17" type="numeric" nEntries="19">
1, 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5
</Vector>
<Vector name="etaMin" type="numeric" nEntries="4">
Expand All @@ -43,6 +43,9 @@
<Vector name="etaMax" type="numeric" nEntries="4">
16, 29, 41, 15
</Vector>
<Vector name="MaxDepth" type="numeric" nEntries="4">
3, 5, 4, 4
</Vector>
<Vector name="etaRange" type="numeric" nEntries="4">
1.392, 3.000, 5.500, 1.305
</Vector>
Expand All @@ -56,9 +59,6 @@
<Vector name="Layer0Wt" type="numeric" nEntries="2">
1.2, 1.2
</Vector>
<Vector name="MaxDepth" type="numeric" nEntries="4">
3, 5, 4, 4
</Vector>
<Vector name="HBGains" type="numeric" nEntries="4">
117.0, 117.0, 117.0, 217.0
</Vector>
Expand All @@ -72,7 +72,7 @@
0, 0, 0, 0, 0
</Vector>
<Vector name="HFGains" type="numeric" nEntries="4">
2.840, 2.090, 0.000, 0.000
2.840, 2.090, 2.840, 2.090
</Vector>
<Vector name="HFShift" type="numeric" nEntries="4">
0, 0, 0, 0
Expand Down
12 changes: 8 additions & 4 deletions Geometry/HcalCommonData/interface/HcalCellType.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ class HcalCellType {
};

HcalCellType(HcalSubdetector detType, int etaBin, int phiBin,
int depthSegment,const HcalCell& cell, int readoutDirection,
double samplingFactor, int numberZ, int nmodule,
double halfSize, int units);
HcalCellType(const HcalCellType&);
int depthSegment, const HcalCell& cell, int readoutDirection=0,
double samplingFactor=0, int numberZ=0, int nmodule=0,
double halfSize=0, int units=0);
HcalCellType(const HcalCellType &right);
const HcalCellType& operator=(const HcalCellType &right);
~HcalCellType();

void setMissingPhi(std::vector<int>&, std::vector<int>&);
Expand All @@ -38,11 +39,13 @@ class HcalCellType {

/// which eta ring it belongs to, starting from one
int etaBin() const {return theEtaBin;}
void setEta(int bin, double etamin, double etamax);

/// which depth segment it is, starting from 1
/// absolute within the tower, so HE depth of the
/// overlap doesn't start at 1.
int depthSegment() const {return theDepthSegment;}
void setDepth(int bin, double dmin, double dmax);

/// the number of these cells in a ring
int nPhiBins() const {return theNumberOfPhiBins;}
Expand All @@ -54,6 +57,7 @@ class HcalCellType {
/// phi offset in degrees
double phiOffset() const {return thePhiOffset;}
int unitPhi() const {return theUnitPhi;}
void setPhi(int bins, int unit, double dphi, double phioff);

/// Number of halves (forward/backward)
int nHalves() const {return theNumberOfZ;}
Expand Down
108 changes: 108 additions & 0 deletions Geometry/HcalCommonData/interface/HcalDDDRecConstants.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#ifndef Geometry_HcalTowerAlgo_HcalDDDRecConstants_h
#define Geometry_HcalTowerAlgo_HcalDDDRecConstants_h

/** \class HcalDDDRecConstants
*
* this class reads the constant section of
* the hcal-sim-numbering xml-file
*
* $Date: 2013/12/25 00:06:50 $
* \author Sunanda Banerjee, SINP <[email protected]>
*
*/

#include<string>
#include<vector>
#include<iostream>

#include "CondFormats/GeometryObjects/interface/HcalParameters.h"
#include "Geometry/HcalCommonData/interface/HcalCellType.h"
#include "Geometry/HcalCommonData/interface/HcalDDDSimConstants.h"
#include "DataFormats/HcalDetId/interface/HcalSubdetector.h"

class HcalDDDRecConstants {

public:

HcalDDDRecConstants(const HcalParameters* hp, const HcalDDDSimConstants& hc);
~HcalDDDRecConstants();

struct HcalID {
int subdet, eta, phi, depth;
HcalID(int sub=0, int et=0, int fi=0, int d=0) : subdet(sub), eta(et),
phi(fi), depth(d) {}
};
struct HcalEtaBin {
int ieta, nPhi, depthStart;
double etaMin, etaMax, phi0, dphi;
std::vector<std::pair<int, int> > layer;
HcalEtaBin(int eta=0, double et1=0, double et2=0, int nf=0, double fi0=0,
double df=0) : ieta(eta), nPhi(nf),depthStart(0), etaMin(et1),
etaMax(et2), phi0(fi0), dphi(df) {}
};
struct HcalActiveLength {
int ieta, depth;
double eta, thick;
HcalActiveLength(int ie=0, int d=0, double et=0,
double t=0) : ieta(ie), depth(d), eta(et), thick(t) {}
};

std::vector<std::pair<double,double> > getConstHBHE(const int type) const {
if (type == 0) return gconsHB;
else if (type == 1) return gconsHE;
else {std::vector<std::pair<double,double> > gcons; return gcons;}
}
const std::vector<int> & getDepth(const int i) const {return layerGroup[i];}
std::vector<HcalEtaBin> getEtaBins(const int itype) const;
std::pair<double,double> getEtaPhi(int subdet, int ieta, int iphi) const;
std::pair<int,int> getEtaRange(const int i) const
{return std::pair<int,int>(iEtaMin[i],iEtaMax[i]);}
const std::vector<double> & getEtaTable() const {return etaTable;}
const std::vector<double> & getEtaTableHF() const {return hpar->etaTableHF;}
std::pair<double,double> getEtaLimit(const int i) const
{return std::pair<double,double>(etaTable[i],etaTable[i+1]);}
HcalID getHCID(int subdet, int ieta, int iphi, int lay,
int idepth) const;
int getMaxDepth(const int type) const {return maxDepth[type];}
int getNEta() const {return nEta;}
double getPhiBin(const int i) const {return phibin[i];}
double getPhiOff(const int i) const {return hpar->phioff[i];}
const std::vector<double> & getPhiOffs() const {return hpar->phioff;}
const std::vector<double> & getPhiTable() const {return phibin;}
const std::vector<double> & getPhiTableHF() const {return phibinHF;}
double getRZ(int subdet, int ieta, int depth) const;
std::vector<HcalActiveLength> getThickActive(const int type) const;
int getTopoMode() const {return modeTopo_;}
std::vector<HcalCellType> HcalCellTypes(HcalSubdetector) const;
unsigned int numberOfCells(HcalSubdetector) const;
unsigned int nCells(HcalSubdetector) const;
unsigned int nCells() const;

private:
void initialize(void);

bool tobeInitialized;
static const int nEtaMax=100;
const HcalParameters *hpar;
const HcalDDDSimConstants &hcons;
int modeTopo_; // Mode for topology
std::vector<int> etaGroup; // Eta Grouping
std::vector<std::pair<int,int> > etaSimValu; // eta ranges at Sim stage
std::vector<double> etaTable; // Eta table (HB+HE)
std::vector<int> ietaMap; // Map Sim level ieta to Rec level ieta
std::vector<int> iEtaMin, iEtaMax; // Minimum and maximum eta
std::vector<int> maxDepth; // Maximum depth in HB/HE/HF/HO
int nEta; // Number of bins in eta for HB and HE
std::vector<int> phiGroup; // Eta Grouping
std::vector<double> phibin; // Phi step for all eta bins (HB, HE, HO)
std::vector<double> phibinHF; // Phi step for all eta bins (HF)
std::vector<int> phiUnitS; // Phi unit at SIM stage
std::vector<int> layerGroup[nEtaMax];
std::vector<int> nOff; // Speical eta bin #'s in barrel and endcap
std::vector<std::pair<double,double> > gconsHB; // Geometry constatnts HB
std::vector<std::pair<double,double> > gconsHE; // Geometry constatnts HE
int nModule[2], nHalves[2]; // Modules, Halves for HB/HE
enum { kHOSizePreLS1 = 2160, kHFSizePreLS1 = 1728 } ;
};

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,13 @@ class HcalDDDSimConstants {
int lay);
double getEtaHO(double& etaR, double& x, double& y,
double& z) const;
std::pair<int,int> getiEtaRange(const int i) const {return std::pair<int,int>(etaMin[i],etaMax[i]);}
std::pair<int,int> getiEtaRange(const int i) const {return std::pair<int,int>(hpar->etaMin[i],hpar->etaMax[i]);}
std::vector<double> getEtaTableHF() const;
std::vector<double> getGparHF() const {return hpar->gparHF;}
std::vector<double> getLayer0Wt() const {return hpar->Layer0Wt;}
unsigned int findLayer(int layer, const std::vector<HcalParameters::LayerItem>& layerGroup) const;
const std::vector<double> & getGparHF() const {return hpar->gparHF;}
const std::vector<double> & getLayer0Wt() const {return hpar->Layer0Wt;}
std::pair<int,int> getModHalfHBHE(const int type) const;
std::vector<int> getNOff() const {return hpar->noff;}
double getPhiBin(const int i) const {return hpar->phibin[i];}
std::pair<double,double> getPhiCons(int det, int ieta);
double getPhiOff(const int i) const {return hpar->phioff[i];}
std::vector<double> getPhiOffs() const {return hpar->phioff;}
std::vector<double> getPhiTable() const {return hpar->phibin;}
std::vector<double> getPhiTableHF() const {return hpar->phitable;}
std::vector<double> getRTableHF() const {return hpar->rTable;}
std::vector<HcalCellType> HcalCellTypes() const;
std::vector<HcalCellType> HcalCellTypes(HcalSubdetector, int ieta=-1,
int depth=-1) const;
Expand All @@ -61,7 +55,6 @@ class HcalDDDSimConstants {

private:
void initialize();
unsigned int findLayer(int layer, const std::vector<HcalParameters::LayerItem>& layerGroup) const;
double deltaEta(int det, int eta, int depth) const;
double getEta(int det, int etaR, int zside, int depth=1) const;
double getEta(double r, double z) const;
Expand All @@ -77,7 +70,6 @@ class HcalDDDSimConstants {
int nEta; // Number of bins in eta for HB and HE
int nR; // Number of bins in r
int nPhiF; // Number of bins in phitable
std::vector<int> etaMin, etaMax; // Eta ranges in HB/HE/HF/HO
std::vector<int> layerGroup[nEtaMax]; // Depth index for a given layer
std::vector<int> depths[nDepthMax]; // Maximum layer number for a depth
int nDepth; // Number of bins in depth0
Expand Down
Loading

0 comments on commit 0a956f1

Please sign in to comment.