Skip to content

Commit

Permalink
Merge pull request #2399 from vandreev11/hgcal-xml-files
Browse files Browse the repository at this point in the history
Hgcal xml files
  • Loading branch information
cmsbuild committed Feb 14, 2014
2 parents c144aee + 75fd644 commit 131bdfe
Show file tree
Hide file tree
Showing 23 changed files with 16,952 additions and 1,455 deletions.
23 changes: 17 additions & 6 deletions DataFormats/ForwardDetId/interface/HGCEEDetId.h
Expand Up @@ -14,23 +14,34 @@ class HGCEEDetId : public DetId {
/** Create cellid from raw id (0=invalid tower id) */
HGCEEDetId(uint32_t rawid);
/** Constructor from subdetector, zplus, layer, module, cell numbers */
HGCEEDetId(ForwardSubdetector subdet, int zp, int lay, int mod, int cell);
HGCEEDetId(ForwardSubdetector subdet, int zp, int lay, int mod, int subsec, int cell);
/** Constructor from a generic cell id */
HGCEEDetId(const DetId& id);
/** Assignment from a generic cell id */
HGCEEDetId& operator=(const DetId& id);

/// get the subdetector
ForwardSubdetector subdet() const { return HGCEE; }
/// get the z-side of the cell (1/-1)
int zside() const { return (id_&0x1000000)?(1):(-1); }

/// get the absolute value of the cell #'s in x and y
int cell() const { return id_&0x7FFF; }
int cell() const { return id_&0xFFFF; }

/// get the module #
int module() const { return (id_>>14)&0x1F; }
int module() const { return (id_>>16)&0x1F; }

/// get the degree subsector
int subsector() const { return ( (id_>>21)&0x1 ? 1 : -1); }

/// get the layer #
int layer() const { return (id_>>19)&0x1F; }
int layer() const { return (id_>>22)&0x1F; }

/// get the z-side of the cell (1/-1)
int zside() const { return ((id_>>27) & 0x1 ? 1 : -1); }

/// consistency check
bool isEE() const { return ((id_>>28) & 0x1); }
bool isForward() const { return (((id_>>29)& 0x7)==Forward); }

static const HGCEEDetId Undefined;

};
Expand Down
3 changes: 1 addition & 2 deletions DataFormats/ForwardDetId/interface/HGCHEDetId.h
Expand Up @@ -14,8 +14,7 @@ class HGCHEDetId : public DetId {
/** Create cellid from raw id (0=invalid tower id) */
HGCHEDetId(uint32_t rawid);
/** Constructor from subdetector, zplus, layer, module, cell numbers */
HGCHEDetId(ForwardSubdetector subdet, int zp, int lay, int mod,
int cellx, int celly);
HGCHEDetId(ForwardSubdetector subdet, int zp, int lay, int mod, int subsec, int cell);
/** Constructor from a generic cell id */
HGCHEDetId(const DetId& id);
/** Assignment from a generic cell id */
Expand Down
26 changes: 19 additions & 7 deletions DataFormats/ForwardDetId/src/HGCEEDetId.cc
@@ -1,20 +1,27 @@
#include "DataFormats/ForwardDetId/interface/HGCEEDetId.h"
#include "FWCore/Utilities/interface/Exception.h"
#include <ostream>
#include <iostream>

const HGCEEDetId HGCEEDetId::Undefined(ForwardEmpty,0,0,0,0);
const HGCEEDetId HGCEEDetId::Undefined(ForwardEmpty,0,0,0,0,0);

HGCEEDetId::HGCEEDetId() : DetId() {
}

HGCEEDetId::HGCEEDetId(uint32_t rawid) : DetId(rawid) {
}

HGCEEDetId::HGCEEDetId(ForwardSubdetector subdet, int zp, int lay, int mod,
int cell) : DetId(Forward,subdet) {
// (no checking at this point!)
id_ |= (((zp>0) ? 0x1000000 : 0) | ((lay&0x1F)<<19) | ((mod&0x1F)<14) |
(cell&0x7FFF));
HGCEEDetId::HGCEEDetId(ForwardSubdetector subdet, int zp, int lay, int mod, int subsec, int cell) : DetId(Forward,subdet)
{
uint32_t rawid=0;
rawid |= ((cell & 0xffff) << 0 );
rawid |= ((mod & 0x1f) << 16);
rawid |= ((subsec & 0x1) << 21);
rawid |= ((lay & 0x1f) << 22);
if(zp>0) rawid |= ((zp & 0x1) << 27);
rawid |= (1 << 28);
rawid |= ((Forward & 0x7) << 29);
id_=rawid;
}

HGCEEDetId::HGCEEDetId(const DetId& gen) {
Expand All @@ -40,7 +47,12 @@ HGCEEDetId& HGCEEDetId::operator=(const DetId& gen) {

std::ostream& operator<<(std::ostream& s,const HGCEEDetId& id) {
switch (id.subdet()) {
case(HGCEE) : return s << "(HGCEE " << id.zside() << ',' << id.layer() << ',' << id.module() << ',' << id.cell() << ')';
case(HGCEE) : return s << "isEE=" << id.isEE()
<< " zpos=" << id.zside()
<< " layer=" << id.layer()
<< " phi sub-sector" << id.subsector()
<< " module=" << id.module()
<< " cell=" << id.cell();
default : return s << id.rawId();
}
}
Expand Down
16 changes: 11 additions & 5 deletions DataFormats/ForwardDetId/src/HGCHEDetId.cc
Expand Up @@ -10,11 +10,17 @@ HGCHEDetId::HGCHEDetId() : DetId() {
HGCHEDetId::HGCHEDetId(uint32_t rawid) : DetId(rawid) {
}

HGCHEDetId::HGCHEDetId(ForwardSubdetector subdet, int zp, int lay, int mod,
int cellx, int celly) : DetId(Forward,subdet) {
// (no checking at this point!)
id_ |= (((zp>0) ? 0x1000000 : 0) | ((lay&0x3F)<<18) | ((mod&0x3F)<12) |
((cellx&0x3F)<<6) | (celly&0x3F));
HGCHEDetId::HGCHEDetId(ForwardSubdetector subdet, int zp, int lay, int mod, int subsec, int cell) : DetId(Forward,subdet)
{
uint32_t rawid=0;
rawid |= ((cell & 0xffff) << 0 );
rawid |= ((mod & 0x1f) << 16);
rawid |= ((subsec & 0x1) << 21);
rawid |= ((lay & 0x1f) << 22);
if(zp>0) rawid |= ((zp & 0x1) << 27);
//rawid |= (0 << 28);
rawid |= ((Forward & 0x7) << 29);
id_=rawid;
}

HGCHEDetId::HGCHEDetId(const DetId& gen) {
Expand Down
Expand Up @@ -67,7 +67,9 @@
'Geometry/HcalCommonData/data/PhaseII/NoHE/hcalRecNumbering.xml',
'Geometry/HGCalCommonData/data/hgcal.xml',
'Geometry/HGCalCommonData/data/hgcalEE.xml',
'Geometry/HGCalCommonData/data/hgcalHE.xml',
'Geometry/HGCalCommonData/data/hgcalHEsil.xml',
'Geometry/HGCalCommonData/data/hgcalHEsci.xml',
'Geometry/HGCalCommonData/data/hgcalHEgem.xml',
'Geometry/MuonCommonData/data/v1/mbCommon.xml',
'Geometry/MuonCommonData/data/v1/mb1.xml',
'Geometry/MuonCommonData/data/v1/mb2.xml',
Expand Down

0 comments on commit 131bdfe

Please sign in to comment.