Skip to content

Commit

Permalink
Merge CMSSW_9_4_X into CMSSW_9_4_AN_X.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmsbuild committed Sep 18, 2018
2 parents 9ad9f5e + bb47e36 commit ca07d96
Show file tree
Hide file tree
Showing 14 changed files with 52 additions and 41 deletions.
11 changes: 6 additions & 5 deletions FastSimulation/CaloGeometryTools/src/CaloGeometryHelper.cc
Expand Up @@ -99,10 +99,10 @@ DetId CaloGeometryHelper::getClosestCell(const XYZPoint& point, bool ecal, bool
}
else
{
result=((HcalGeometry*)(HcalGeometry_))->getClosestCell(GlobalPoint(point.X(),point.Y(),point.Z()));
result=static_cast<const HcalGeometry*>(HcalGeometry_)->getClosestCell(GlobalPoint(point.X(),point.Y(),point.Z()),true);
HcalDetId myDetId(result);

// special patch for HF
// special patch for HF (this is already a part of HcalGeometry)
if ( myDetId.subdetId() == HcalForward ) {
int mylayer;
if ( fabs(point.Z()) > 1132. ) {
Expand All @@ -112,12 +112,12 @@ DetId CaloGeometryHelper::getClosestCell(const XYZPoint& point, bool ecal, bool
}
HcalDetId myDetId2((HcalSubdetector)myDetId.subdetId(),myDetId.ieta(),myDetId.iphi(),mylayer);
result = myDetId2;
return result;
// return result;
}


// Special patch to correct the HCAL geometry (does not work)
/*
if(result.subdetId()!=HcalEndcap) return result;
// Special patch to correct the HCAL geometry
if(myDetId.depth()==3) return result;
int ieta=myDetId.ietaAbs();
Expand All @@ -141,6 +141,7 @@ DetId CaloGeometryHelper::getClosestCell(const XYZPoint& point, bool ecal, bool
HcalDetId second(HcalEndcap,myDetId.ieta(),myDetId.iphi(),2);
if(second!=HcalDetId()) result=second;
}
*/
#ifdef DEBUGGCC
if(result.null())
{
Expand Down
26 changes: 13 additions & 13 deletions FastSimulation/Calorimetry/src/CalorimetryManager.cc
Expand Up @@ -1226,28 +1226,28 @@ void CalorimetryManager::updateHCAL(const std::map<CaloHitID,float>& hitMap, int
if(HcalDigitizer_){
HcalDetId hdetid = HcalDetId(mapitr->first.unitID());
if (hdetid.subdetId()== HcalBarrel){
energy /= samplingHBHE_[hdetid.ietaAbs()-1]; //re-convert to GeV
time = timeShiftHB_[hdetid.ietaAbs()-ietaShiftHB_];
energy /= samplingHBHE_[hdetid.ietaAbs()-1]; //re-convert to GeV
time = timeShiftHB_[hdetid.ietaAbs()-ietaShiftHB_];
}
else if (hdetid.subdetId()== HcalEndcap){
energy /= samplingHBHE_[hdetid.ietaAbs()-1]; //re-convert to GeV
time = timeShiftHE_[hdetid.ietaAbs()-ietaShiftHE_];
energy /= samplingHBHE_[hdetid.ietaAbs()-1]; //re-convert to GeV
time = timeShiftHE_[hdetid.ietaAbs()-ietaShiftHE_];
}
else if (hdetid.subdetId()== HcalForward){
if(useShowerLibrary) {
if(useCorrectionSL) {
if(hdetid.depth()== 1) energy *= hfcorrEm[hdetid.ietaAbs()-ietaShiftHF_];
if(hdetid.depth()== 2) energy *= hfcorrHad[hdetid.ietaAbs()-ietaShiftHF_];
if(useCorrectionSL) {
if(hdetid.depth()== 1 or hdetid.depth()==3) energy *= hfcorrEm[hdetid.ietaAbs()-ietaShiftHF_];
if(hdetid.depth()== 2 or hdetid.depth()==4) energy *= hfcorrHad[hdetid.ietaAbs()-ietaShiftHF_];
}
} else {
if(hdetid.depth()== 1) energy *= samplingHF_[0];
if(hdetid.depth()== 2) energy *= samplingHF_[1];
} else {
if(hdetid.depth()== 1 or hdetid.depth()==3) energy *= samplingHF_[0];
if(hdetid.depth()== 2 or hdetid.depth()==4) energy *= samplingHF_[1];
time = timeShiftHF_[hdetid.ietaAbs()-ietaShiftHF_];
}
}
}
else if (hdetid.subdetId()== HcalOuter){
energy /= samplingHO_[hdetid.ietaAbs()-1];
time = timeShiftHO_[hdetid.ietaAbs()-ietaShiftHO_];
energy /= samplingHO_[hdetid.ietaAbs()-1];
time = timeShiftHO_[hdetid.ietaAbs()-ietaShiftHO_];
}
}

Expand Down
Expand Up @@ -50,7 +50,7 @@ class FastHFShowerLibrary {

void const initHFShowerLibrary(const edm::EventSetup& );
void recoHFShowerLibrary(const FSimTrack &myTrack);
void modifyDepth(uint32_t &id);
void modifyDepth(HcalNumberingFromDDD::HcalID& id);
const std::map<CaloHitID,float>& getHitsMap() { return hitMap; };

void SetRandom(const RandomEngineAndDistribution *);
Expand Down
17 changes: 7 additions & 10 deletions FastSimulation/ShowerDevelopment/src/FastHFShowerLibrary.cc
Expand Up @@ -123,6 +123,7 @@ void FastHFShowerLibrary::recoHFShowerLibrary(const FSimTrack& myTrack) {
int lay = 1;
uint32_t id = 0;
HcalNumberingFromDDD::HcalID tmp = numberingFromDDD->unitID(det, pos, depth, lay);
modifyDepth(tmp);
id = numberingScheme.getUnitID(tmp);

CaloHitID current_id(id,time,myTrack.id());
Expand All @@ -138,16 +139,12 @@ void FastHFShowerLibrary::recoHFShowerLibrary(const FSimTrack& myTrack) {

}

void FastHFShowerLibrary::modifyDepth(uint32_t &id) {

HcalDetId hid(id);
if (hid.subdet() == HcalForward) {
int eta = hid.ieta();
int phi = hid.iphi();
if (hcalConstants->maxHFDepth(eta,phi) > 2) {
if (hid.depth() <= 2) {
int dep = (G4UniformRand() > 0.5) ? (2+hid.depth()) : hid.depth();
id = HcalDetId(HcalForward,eta,phi,dep).rawId();
void FastHFShowerLibrary::modifyDepth(HcalNumberingFromDDD::HcalID& id) {
if (id.subdet == HcalForward) {
int ieta = (id.zside == 0) ? -id.etaR : id.etaR;
if (hcalConstants->maxHFDepth(ieta,id.phis) > 2) {
if (id.depth <= 2) {
if (G4UniformRand() > 0.5) id.depth += 2;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions Geometry/HcalTowerAlgo/interface/HcalGeometry.h
Expand Up @@ -54,6 +54,7 @@ class HcalGeometry : public CaloSubdetectorGeometry {
const CaloCellGeometry* getGeometry( const DetId& id ) const override ;

DetId getClosestCell(const GlobalPoint& r) const override ;
DetId getClosestCell(const GlobalPoint& r, bool ignoreCorrect) const;

CaloSubdetectorGeometry::DetIdSet getCells( const GlobalPoint& r,
double dR ) const override ;
Expand Down
13 changes: 11 additions & 2 deletions Geometry/HcalTowerAlgo/src/HcalGeometry.cc
Expand Up @@ -104,6 +104,11 @@ const CaloCellGeometry* HcalGeometry::getGeometry(const DetId& id) const {
}

DetId HcalGeometry::getClosestCell(const GlobalPoint& r) const {
return getClosestCell(r,false);
}

DetId HcalGeometry::getClosestCell(const GlobalPoint& r,
bool ignoreCorrect) const {

// Now find the closest eta_bin, eta value of a bin i is average
// of eta[i] and eta[i-1]
Expand Down Expand Up @@ -163,8 +168,12 @@ DetId HcalGeometry::getClosestCell(const GlobalPoint& r) const {
}
}
}

return correctId(bestId);
#ifdef EDM_ML_DEBUG
std::cout << bestId << " Corrected to " << HcalDetId(correctId(bestId))
<< std::endl;
#endif

return (ignoreCorrect ? bestId : correctId(bestId));
}
}

Expand Down
Expand Up @@ -48,7 +48,7 @@
fastSim.toModify( hcalSimBlock, hitsProducer=cms.string('fastSimProducer') )

from Configuration.Eras.Modifier_run2_HCAL_2017_cff import run2_HCAL_2017
run2_HCAL_2017.toModify( hcalSimBlock, TestNumbering = cms.bool(True) )
(run2_HCAL_2017 & ~fastSim).toModify( hcalSimBlock, TestNumbering = cms.bool(True) )

# remove HE processing for phase 2, completely put in HGCal land
from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal
Expand Down
3 changes: 2 additions & 1 deletion Validation/HcalDigis/python/HLTHcalDigisParam_cfi.py
Expand Up @@ -17,7 +17,8 @@
hltHCALdigisAnalyzer.hep17 = cms.bool(False)

from Configuration.Eras.Modifier_run2_HCAL_2017_cff import run2_HCAL_2017
run2_HCAL_2017.toModify(hltHCALdigisAnalyzer,
from Configuration.Eras.Modifier_fastSim_cff import fastSim
(run2_HCAL_2017 & ~fastSim).toModify(hltHCALdigisAnalyzer,
TestNumber = cms.bool(True)
)

Expand Down
2 changes: 1 addition & 1 deletion Validation/HcalDigis/python/HcalDigisParam_cfi.py
Expand Up @@ -20,7 +20,7 @@
fastSim.toModify(hcaldigisAnalyzer, simHits = "fastSimProducer:HcalHits")

from Configuration.Eras.Modifier_run2_HCAL_2017_cff import run2_HCAL_2017
run2_HCAL_2017.toModify(hcaldigisAnalyzer,
(run2_HCAL_2017 & ~fastSim).toModify(hcaldigisAnalyzer,
TestNumber = cms.bool(True)
)

Expand Down
2 changes: 1 addition & 1 deletion Validation/HcalHits/python/HcalSimHitStudy_cfi.py
Expand Up @@ -14,7 +14,7 @@
fastSim.toModify( hcalSimHitStudy, ModuleLabel = cms.untracked.string('fastSimProducer') )

from Configuration.Eras.Modifier_run2_HCAL_2017_cff import run2_HCAL_2017
run2_HCAL_2017.toModify( hcalSimHitStudy, TestNumber = cms.bool(True) )
(run2_HCAL_2017 & ~fastSim).toModify( hcalSimHitStudy, TestNumber = cms.bool(True) )

from Configuration.Eras.Modifier_run2_HEPlan1_2017_cff import run2_HEPlan1_2017
run2_HEPlan1_2017.toModify( hcalSimHitStudy, hep17 = cms.bool(True) )
2 changes: 1 addition & 1 deletion Validation/HcalHits/python/HcalSimHitsValidation_cfi.py
Expand Up @@ -9,4 +9,4 @@
fastSim.toModify( HcalSimHitsAnalyser, ModuleLabel = cms.untracked.string("fastSimProducer") )

from Configuration.Eras.Modifier_run2_HCAL_2017_cff import run2_HCAL_2017
run2_HCAL_2017.toModify( HcalSimHitsAnalyser, TestNumber = cms.untracked.bool(True), EEHitCollection = cms.untracked.string("") )
(run2_HCAL_2017 & ~fastSim).toModify( HcalSimHitsAnalyser, TestNumber = cms.untracked.bool(True) )
2 changes: 1 addition & 1 deletion Validation/HcalHits/python/SimHitsValidationHcal_cfi.py
Expand Up @@ -11,4 +11,4 @@
fastSim.toModify( simHitsValidationHcal, ModuleLabel = cms.string("fastSimProducer") )

from Configuration.Eras.Modifier_run2_HCAL_2017_cff import run2_HCAL_2017
run2_HCAL_2017.toModify( simHitsValidationHcal, TestNumber = cms.bool(True) )
(run2_HCAL_2017 & ~fastSim).toModify( simHitsValidationHcal, TestNumber = cms.bool(True) )
4 changes: 3 additions & 1 deletion Validation/HcalRecHits/python/HLTHcalRecHitParam_cfi.py
Expand Up @@ -24,9 +24,11 @@
hltHCALNoiseRates.minHitEnergy = cms.untracked.double(1.5)
hltHCALNoiseRates.noiselabel = cms.InputTag('hcalnoise')

from Configuration.Eras.Modifier_fastSim_cff import fastSim
fastSim.toModify( hltHCALRecoAnalyzer, SimHitCollectionLabel = cms.untracked.InputTag("fastSimProducer","HcalHits") )

from Configuration.Eras.Modifier_run2_HCAL_2017_cff import run2_HCAL_2017
run2_HCAL_2017.toModify( hltHCALRecoAnalyzer, TestNumber = cms.bool(True) )
(run2_HCAL_2017 & ~fastSim).toModify( hltHCALRecoAnalyzer, TestNumber = cms.bool(True) )

#from Configuration.Eras.Modifier_phase2_hcal_cff import phase2_hcal
#phase2_hcal.toModify(hcalRecoAnalyzer, mc = cms.untracked.string('no') )
6 changes: 3 additions & 3 deletions Validation/HcalRecHits/python/HcalRecHitParam_cfi.py
Expand Up @@ -27,8 +27,8 @@
noiselabel = cms.InputTag('hcalnoise')
)

from Configuration.Eras.Modifier_run2_HCAL_2017_cff import run2_HCAL_2017
run2_HCAL_2017.toModify( hcalRecoAnalyzer, TestNumber = cms.bool(True) )

from Configuration.Eras.Modifier_fastSim_cff import fastSim
fastSim.toModify( hcalRecoAnalyzer, SimHitCollectionLabel = cms.untracked.InputTag("fastSimProducer","HcalHits") )

from Configuration.Eras.Modifier_run2_HCAL_2017_cff import run2_HCAL_2017
(run2_HCAL_2017 & ~fastSim).toModify( hcalRecoAnalyzer, TestNumber = cms.bool(True) )

0 comments on commit ca07d96

Please sign in to comment.