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

overriding inefficient CalosubdetectorGeometry::present function :100X backport #22206

Merged
merged 1 commit into from Feb 18, 2018
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions Geometry/EcalAlgo/interface/EcalBarrelGeometry.h
Expand Up @@ -103,6 +103,9 @@ class EcalBarrelGeometry final : public CaloSubdetectorGeometry
const GlobalPoint& f3 ,
const CCGFloat* parm ,
const DetId& detId ) override ;

bool present( const DetId& id ) const override;

protected:

// Modify the RawPtr class
Expand Down
2 changes: 2 additions & 0 deletions Geometry/EcalAlgo/interface/EcalEndcapGeometry.h
Expand Up @@ -99,6 +99,8 @@ class EcalEndcapGeometry final: public CaloSubdetectorGeometry
const CCGFloat* parm ,
const DetId& detId ) override ;

bool present( const DetId& id ) const override;

protected:

// Modify the RawPtr class
Expand Down
11 changes: 11 additions & 0 deletions Geometry/EcalAlgo/src/EcalBarrelGeometry.cc
Expand Up @@ -499,3 +499,14 @@ const CaloCellGeometry* EcalBarrelGeometry::getGeometryRawPtr (uint32_t index) c
return (m_cellVec.size() < index ||
nullptr == cell->param() ? nullptr : cell);
}

bool EcalBarrelGeometry::present( const DetId& id ) const
{
if(id.det()==DetId::Ecal && id.subdetId()==EcalBarrel){
EBDetId ebId(id);
if(EBDetId::validDetId(ebId.ieta(),ebId.iphi())) return true;
}
return false;

}

9 changes: 9 additions & 0 deletions Geometry/EcalAlgo/src/EcalEndcapGeometry.cc
Expand Up @@ -522,3 +522,12 @@ const CaloCellGeometry* EcalEndcapGeometry::getGeometryRawPtr(uint32_t index) co
return (m_cellVec.size() < index ||
nullptr == cell->param() ? nullptr : cell);
}

bool EcalEndcapGeometry::present( const DetId& id ) const
{
if(id.det()==DetId::Ecal && id.subdetId()==EcalEndcap){
EEDetId eeId(id);
if(EEDetId::validDetId(eeId.ix(),eeId.iy(),eeId.zside())) return true;
}
return false;
}