Skip to content

Commit

Permalink
Merge pull request #25044 from makortel/saConstCastFS
Browse files Browse the repository at this point in the history
Remove some const-away casts from FastSim
  • Loading branch information
cmsbuild committed Nov 2, 2018
2 parents 159c739 + 773b884 commit c46cb61
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions FastSimulation/CaloHitMakers/src/CaloHitMaker.cc
Expand Up @@ -2,6 +2,8 @@
#include "FastSimulation/CaloGeometryTools/interface/CaloGeometryHelper.h"
#include "FastSimulation/CalorimeterProperties/interface/CalorimeterProperties.h"
#include "FastSimulation/CalorimeterProperties/interface/PreshowerProperties.h"
#include "FastSimulation/CalorimeterProperties/interface/PreshowerLayer1Properties.h"
#include "FastSimulation/CalorimeterProperties/interface/ECALProperties.h"
#include "FastSimulation/CalorimeterProperties/interface/HCALProperties.h"
#include "DataFormats/EcalDetId/interface/EcalSubdetector.h"

Expand All @@ -15,10 +17,10 @@ CaloHitMaker::CaloHitMaker(const CaloGeometryHelper * theCalo,DetId::Detector ba
HADSHOWER=(sht==1);
MIP=(sht==2);
if(base_==DetId::Ecal&&(subdetn_==EcalBarrel||subdetn==EcalEndcap)&&onCal_)
theCaloProperties = (CalorimeterProperties*)myCalorimeter->ecalProperties(onCal_);
theCaloProperties = myCalorimeter->ecalProperties(onCal_);
// is it really necessary to cast here ?
if(base_==DetId::Ecal&&subdetn_==EcalPreshower&&onCal_)
theCaloProperties = (PreshowerProperties*)myCalorimeter->layer1Properties(onCal_);
theCaloProperties = myCalorimeter->layer1Properties(onCal_);
if(base_==DetId::Hcal&&cal) theCaloProperties = myCalorimeter->hcalProperties(onCal_);

if(theCaloProperties)
Expand Down
Expand Up @@ -60,7 +60,7 @@ class FastHFShowerLibrary {
const edm::ParameterSet fast;
std::unique_ptr<HFShowerLibrary> hfshower;
std::unique_ptr<HcalNumberingFromDDD> numberingFromDDD;
HcalDDDSimConstants* hcalConstants;
const HcalDDDSimConstants* hcalConstants;
HcalNumberingScheme numberingScheme;

std::map<CaloHitID,float> hitMap;
Expand Down
Expand Up @@ -55,7 +55,7 @@ void const FastHFShowerLibrary::initHFShowerLibrary(const edm::EventSetup& iSetu

edm::ESHandle<HcalDDDSimConstants> hdc;
iSetup.get<HcalSimNumberingRecord>().get(hdc);
hcalConstants = (HcalDDDSimConstants*)(&(*hdc));
hcalConstants = hdc.product();

std::string name = "HcalHits";
numberingFromDDD.reset(new HcalNumberingFromDDD(hcalConstants));
Expand Down

0 comments on commit c46cb61

Please sign in to comment.