Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phase2 hgcx3 #3983

Merged
merged 3 commits into from May 23, 2014
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Geometry/CaloEventSetup/plugins/HGCalTopologyBuilder.cc
Expand Up @@ -90,7 +90,7 @@ HGCalTopologyBuilder::produce(const IdealGeometryRecord& iRecord ) {

edm::ESHandle<HGCalDDDConstants> pHGDC;
iRecord.get(name_, pHGDC) ;
const HGCalDDDConstants* hgdc = &(*pHGDC);
const HGCalDDDConstants hgdc = (*pHGDC);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bsunanda - I think, you meant const reference here:

const HGCalDDDConstants&

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Yana

You are right - I just pushed this change in the same branch. Could you
check if this is in or should I make a new push and pull request?

Sunanda

On Fri, 23 May 2014, ianna wrote:

In Geometry/CaloEventSetup/plugins/HGCalTopologyBuilder.cc:

@@ -90,7 +90,7 @@ HGCalTopologyBuilder::produce(const IdealGeometryRecord&
iRecord ) {

edm::ESHandle pHGDC;
iRecord.get(name_, pHGDC) ;

  • const HGCalDDDConstants* hgdc = &(*pHGDC);
  • const HGCalDDDConstants hgdc = (*pHGDC);

@bsunanda - I think, you meant const reference here:

const HGCalDDDConstants&


Reply to this email directly or view it onGitHub.[5033146__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcxNjQ2Nj
QxNywiZGF0YSI6eyJpZCI6MzI5NDgwNDR9fQ==--604acc6108f8ecf420414f99e02bf26c246
4dc9e.gif]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, I've already tested it before the change to a reference. The only difference should be that there is no longer a copy so I'll just merge.


ReturnType ct ( new HGCalTopology(hgdc, subdet_, halfType_) ) ;
std::cout << "Create HGCalTopology(hgdc,subdet,type)" << std::endl;
Expand Down
7 changes: 5 additions & 2 deletions Geometry/CaloTopology/interface/HGCalTopology.h
Expand Up @@ -13,7 +13,7 @@ class HGCalTopology : public CaloSubdetectorTopology {

public:
/// create a new Topology
HGCalTopology(const HGCalDDDConstants* hdcons, ForwardSubdetector subdet, bool halfChamber);
HGCalTopology(const HGCalDDDConstants& hdcons, ForwardSubdetector subdet, bool halfChamber);

/// virtual destructor
virtual ~HGCalTopology() { }
Expand Down Expand Up @@ -89,6 +89,9 @@ class HGCalTopology : public CaloSubdetectorTopology {
///Is this a valid cell id
virtual bool valid(const DetId& id) const;
bool validHashIndex(uint32_t ix) const {return (ix < kSizeForDenseIndexing);}

const HGCalDDDConstants& dddConstants () const {return hdcons_;}


/** returns a new DetId offset by nrStepsX and nrStepsY (can be negative),
* returns DetId(0) if invalid */
Expand All @@ -114,7 +117,7 @@ class HGCalTopology : public CaloSubdetectorTopology {
idCont decode(const DetId& id) const ;
DetId encode(const idCont& id_) const ;

const HGCalDDDConstants* hdcons_;
const HGCalDDDConstants& hdcons_;
ForwardSubdetector subdet_;
bool half_;
int sectors_, layers_, cells_, kEKhalf_;
Expand Down
18 changes: 9 additions & 9 deletions Geometry/CaloTopology/src/HGCalTopology.cc
Expand Up @@ -3,13 +3,13 @@

#define DebugLog

HGCalTopology::HGCalTopology(const HGCalDDDConstants* hdcons,
HGCalTopology::HGCalTopology(const HGCalDDDConstants& hdcons,
ForwardSubdetector subdet,
bool half) : hdcons_(hdcons), subdet_(subdet),
half_(half) {
sectors_ = hdcons->sectors();
layers_ = hdcons->layers(true);
cells_ = hdcons->maxCells(true);
sectors_ = hdcons_.sectors();
layers_ = hdcons_.layers(true);
cells_ = hdcons_.maxCells(true);
kEKhalf_ = sectors_*layers_*subSectors_*cells_;
kSizeForDenseIndexing = (unsigned int)(2*kEKhalf_);
#ifdef DebugLog
Expand Down Expand Up @@ -82,9 +82,9 @@ DetId HGCalTopology::changeXY(const DetId& id, int nrStepsX,
int nrStepsY ) const {

HGCalTopology::idCont id_ = decode(id);
std::pair<int,int> kcell= hdcons_->newCell(id_.iCell,id_.iLay,id_.iSec,
id_.iSubSec,nrStepsX,nrStepsY,
half_);
std::pair<int,int> kcell= hdcons_.newCell(id_.iCell,id_.iLay,id_.iSec,
id_.iSubSec,nrStepsX,nrStepsY,
half_);
id_.iSubSec= kcell.second;
id_.iSec = (kcell.second > 0) ? kcell.second : -kcell.second;
id_.iCell = kcell.first;
Expand All @@ -97,8 +97,8 @@ DetId HGCalTopology::changeXY(const DetId& id, int nrStepsX,
DetId HGCalTopology::changeZ(const DetId& id, int nrStepsZ) const {

HGCalTopology::idCont id_ = decode(id);
std::pair<int,int> kcell = hdcons_->newCell(id_.iCell,id_.iLay,
id_.iSubSec,nrStepsZ,half_);
std::pair<int,int> kcell = hdcons_.newCell(id_.iCell,id_.iLay,
id_.iSubSec,nrStepsZ,half_);
id_.iLay = kcell.second;
id_.iCell = kcell.first;
DetId nextPoint = encode(id_);
Expand Down
16 changes: 8 additions & 8 deletions Geometry/HGCalCommonData/plugins/DDShashlikNoTaperModule.cc
Expand Up @@ -94,17 +94,17 @@ void DDShashlikNoTaperModule::execute(DDCompactView& cpv) {
DDSplit(fibreMat).second));
DDRotation rot;
if (holeX.size() > 0) {
name = DDName(baseName1+DDSplit(fibreName).first,
DDSplit(activeName).second);
name = DDName(DDSplit(fibreName).first+"inActive",
DDSplit(fibreName).second);
solid = DDSolidFactory::tubs(name, 0.5*activeThick, 0, holeR,
0, CLHEP::twopi);
DDLogicalPart fibre1(solid.ddname(), matter, solid);
edm::LogInfo("HGCalGeom") << "DDShashlikNoTaperModule:: " << name
<< " tube made of " << matter.name() << " dim: "
<< 0.5*activeThick << ":0:" << holeR << ":0:"
<< CLHEP::twopi;
name = DDName(baseName2+DDSplit(fibreName).first,
DDSplit(absorbName).second);
name = DDName(DDSplit(fibreName).first+"inAbsorber",
DDSplit(fibreName).second);
solid = DDSolidFactory::tubs(name, 0.5*absorbThick, 0, holeR,
0, CLHEP::twopi);
DDLogicalPart fibre2(solid.ddname(), matter, solid);
Expand All @@ -126,17 +126,17 @@ void DDShashlikNoTaperModule::execute(DDCompactView& cpv) {
<< " with no rotation";
}
}
name = DDName(baseName1+DDSplit(calibFibreName).first,
DDSplit(activeName).second);
name = DDName(DDSplit(calibFibreName).first+"inActive",
DDSplit(calibFibreName).second);
solid = DDSolidFactory::tubs(name, 0.5*activeThick, 0,
calibFibrePars[0], 0, CLHEP::twopi);
DDLogicalPart fibre1(solid.ddname(), matter, solid);
edm::LogInfo("HGCalGeom") << "DDShashlikNoTaperModule:: " << name
<< " tube made of " << matter.name() << " dim: "
<< 0.5*activeThick << ":0:" << calibFibrePars[0]
<< ":0:" << CLHEP::twopi;
name = DDName(baseName2+DDSplit(calibFibreName).first,
DDSplit(absorbName).second);
name = DDName(DDSplit(calibFibreName).first+"inAbsorber",
DDSplit(calibFibreName).second);
solid = DDSolidFactory::tubs(name, 0.5*absorbThick, 0,
calibFibrePars[0], 0, CLHEP::twopi);
DDLogicalPart fibre2(solid.ddname(), matter, solid);
Expand Down
16 changes: 8 additions & 8 deletions Geometry/HGCalCommonData/plugins/DDShashlikTaperModule.cc
Expand Up @@ -75,26 +75,26 @@ void DDShashlikTaperModule::execute(DDCompactView& cpv) {
std::string baseName2 = DDSplit(absorbName).first;
DDMaterial matter = DDMaterial(DDName(DDSplit(fibreMat).first,
DDSplit(fibreMat).second));
DDName name = DDName(baseName1+DDSplit(fibreName).first,
DDSplit(activeName).second);
DDName name = DDName(DDSplit(fibreName).first+"inActive",
DDSplit(fibreName).second);
DDSolid solid = DDSolidFactory::tubs(name, 0.5*activeThick, 0,
holeR, 0, CLHEP::twopi);
DDLogicalPart fibre1(solid.ddname(), matter, solid);
edm::LogInfo("HGCalGeom") << "DDShashlikTaperModule:: " << name
<< " tube made of " << matter.name() << " dim: "
<< 0.5*activeThick << ":0:" << holeR << ":0:"
<< CLHEP::twopi;
name = DDName(baseName2+DDSplit(fibreName).first,
DDSplit(absorbName).second);
name = DDName(DDSplit(fibreName).first+"inAbsorber",
DDSplit(fibreName).second);
solid = DDSolidFactory::tubs(name, 0.5*absorbThick, 0,
holeR, 0, CLHEP::twopi);
DDLogicalPart fibre2(solid.ddname(), matter, solid);
edm::LogInfo("HGCalGeom") << "DDShashlikTaperModule:: " << name
<< " tube made of " << matter.name() << " dim: "
<< 0.5*absorbThick << ":0:" << holeR << ":0:"
<< CLHEP::twopi;
name = DDName(baseName1+DDSplit(calibFibreName).first,
DDSplit(activeName).second);
name = DDName(DDSplit(calibFibreName).first+"inActive",
DDSplit(calibFibreName).second);
solid = DDSolidFactory::tubs(name, 0.5*activeThick, 0,
calibFibrePars[0], 0,
CLHEP::twopi);
Expand All @@ -103,8 +103,8 @@ void DDShashlikTaperModule::execute(DDCompactView& cpv) {
<< " tube made of " << matter.name() << " dim: "
<< 0.5*activeThick << ":0:" << calibFibrePars[0]
<< ":0:" << CLHEP::twopi;
name = DDName(baseName2+DDSplit(calibFibreName).first,
DDSplit(absorbName).second);
name = DDName(DDSplit(calibFibreName).first+"inAbsorber",
DDSplit(calibFibreName).second);
solid = DDSolidFactory::tubs(name, 0.5*absorbThick, 0,
calibFibrePars[0], 0,
CLHEP::twopi);
Expand Down