Skip to content

Commit

Permalink
Merge pull request #17697 from kpedro88/Phase1-HE18
Browse files Browse the repository at this point in the history
remove photoelectronsToAnalog python parameter (now taken from DB)
  • Loading branch information
davidlange6 committed Mar 2, 2017
2 parents a6d8919 + e502326 commit ee4abab
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 39 deletions.
2 changes: 1 addition & 1 deletion SimCalorimetry/CaloSimAlgos/interface/CaloSimParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CaloSimParameters
int readoutFrameSize, int binOfMaximum,
bool doPhotostatistics, bool syncPhase=true);

CaloSimParameters(const edm::ParameterSet & p);
CaloSimParameters(const edm::ParameterSet & p, bool skipPe2Fc=false);

virtual ~CaloSimParameters() {};

Expand Down
5 changes: 3 additions & 2 deletions SimCalorimetry/CaloSimAlgos/src/CaloSimParameters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ CaloSimParameters::CaloSimParameters(double simHitToPhotoelectrons, double photo



CaloSimParameters::CaloSimParameters(const edm::ParameterSet & p)
CaloSimParameters::CaloSimParameters(const edm::ParameterSet & p, bool skipPe2Fc)
: simHitToPhotoelectrons_( p.getParameter<double>("simHitToPhotoelectrons") ),
photoelectronsToAnalog_( 0. ),
timePhase_( p.getParameter<double>("timePhase") ),
Expand All @@ -33,9 +33,10 @@ CaloSimParameters::CaloSimParameters(const edm::ParameterSet & p)
} else if(p.existsAs<std::vector<double> >("photoelectronsToAnalog")) {
// just take the first one
photoelectronsToAnalog_ = p.getParameter<std::vector<double> >("photoelectronsToAnalog").at(0);
} else {
} else if(!skipPe2Fc) {
throw cms::Exception("CaloSimParameters") << "Cannot find parameter photoelectronsToAnalog";
}
// some subsystems may not want this at all
}


Expand Down
2 changes: 0 additions & 2 deletions SimCalorimetry/HcalSimAlgos/interface/HcalSimParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class HcalSimParameters : public CaloSimParameters
{
public:
HcalSimParameters(double simHitToPhotoelectrons,
const std::vector<double> & photoelectronsToAnalog,
double samplingFactor, double timePhase,
int readoutFrameSize, int binOfMaximum,
bool doPhotostatistics, bool syncPhase,
Expand Down Expand Up @@ -54,7 +53,6 @@ class HcalSimParameters : public CaloSimParameters
const HcalSiPMCharacteristics* theSiPMcharacteristics;
int theFirstRing;
std::vector<double> theSamplingFactors;
std::vector<double> thePE2fCByRing;
bool theSiPMSmearing;
bool doTimeSmear_;
HcalTimeSmearSettings theSmearSettings;
Expand Down
10 changes: 5 additions & 5 deletions SimCalorimetry/HcalSimAlgos/src/HcalSimParameterMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
#include "FWCore/MessageLogger/interface/MessageLogger.h"

HcalSimParameterMap::HcalSimParameterMap() :
theHBParameters(2000., std::vector<double>(16, 0.3305),
theHBParameters(2000.,
117, 5,
10, 5, true, true,
1, std::vector<double>(16, 117.), 10.),
theHEParameters(2000., std::vector<double>(16, 0.3305),
theHEParameters(2000.,
178, 5,
10, 5, true, true,
16, std::vector<double>(16, 178.), 10.),
theHOParameters( 4000., std::vector<double>(16, 0.3065),
theHOParameters( 4000.,
217., 5,
10, 5, true, true,
1, std::vector<double>(16, 217.), 5.),
theHOZecotekSiPMParameters( 4000., std::vector<double>(16, 3.0), // 1 mip = 15 pe = 45 fC
theHOZecotekSiPMParameters( 4000.,
217., 5,
10, 5, true, true,
1, std::vector<double>(16, 217.), 5.),
theHOHamamatsuSiPMParameters( 4000., std::vector<double>(16, 3.0),
theHOHamamatsuSiPMParameters( 4000.,
217., 5,
10, 5, true, true,
1, std::vector<double>(16, 217.), 5.),
Expand Down
13 changes: 3 additions & 10 deletions SimCalorimetry/HcalSimAlgos/src/HcalSimParameters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,18 @@
using namespace std;

HcalSimParameters::HcalSimParameters(double simHitToPhotoelectrons,
const std::vector<double> & photoelectronsToAnalog,
double samplingFactor, double timePhase,
int readoutFrameSize, int binOfMaximum,
bool doPhotostatistics, bool syncPhase,
int firstRing, const std::vector<double> & samplingFactors,
double sipmTau
)
: CaloSimParameters(simHitToPhotoelectrons, photoelectronsToAnalog[0], samplingFactor, timePhase,
: CaloSimParameters(simHitToPhotoelectrons, 0.0, samplingFactor, timePhase,
readoutFrameSize, binOfMaximum, doPhotostatistics, syncPhase),
theDbService(0),
theSiPMcharacteristics(0),
theFirstRing(firstRing),
theSamplingFactors(samplingFactors),
thePE2fCByRing(photoelectronsToAnalog),
theSiPMSmearing(false),
doTimeSmear_(true),
theSiPMTau(sipmTau)
Expand All @@ -34,11 +32,10 @@ HcalSimParameters::HcalSimParameters(double simHitToPhotoelectrons,
}

HcalSimParameters::HcalSimParameters(const edm::ParameterSet & p)
: CaloSimParameters(p),
: CaloSimParameters(p,true),
theDbService(0),
theFirstRing( p.getParameter<int>("firstRing") ),
theSamplingFactors( p.getParameter<std::vector<double> >("samplingFactors") ),
thePE2fCByRing( p.getParameter<std::vector<double> >("photoelectronsToAnalog") ),
theSiPMSmearing( p.getParameter<bool>("doSiPMSmearing") ),
doTimeSmear_( p.getParameter<bool>("timeSmearing") ),
theSiPMTau( p.getParameter<double>("sipmTau") )
Expand Down Expand Up @@ -102,12 +99,8 @@ double HcalSimParameters::samplingFactor(const DetId & detId) const

double HcalSimParameters::photoelectronsToAnalog(const DetId & detId) const
{
//now always taken from database for HPDs or SiPMs (HB, HE, HO)
assert(theDbService);
int type = theDbService->getHcalSiPMParameter(detId)->getType();
if (type == HcalNoSiPM) {
HcalDetId hcalDetId(detId);
return thePE2fCByRing.at(hcalDetId.ietaAbs()-theFirstRing);
}
return theDbService->getHcalSiPMParameter(detId)->getFCByPE();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
firstRing = cms.int32(1),
binOfMaximum = cms.int32(5),
doPhotoStatistics = cms.bool(True),
photoelectronsToAnalog = cms.vdouble(0.24, 0.24, 0.24, 0.24,
0.17, 0.17, 0.17, 0.17, 0.17, 0.17,
0.17, 0.17, 0.17, 0.17, 0.17),
simHitToPhotoelectrons = cms.double(4000.0), # is not actually used
samplingFactors = cms.vdouble(231.0, 231.0, 231.0, 231.0,
360.0, 360.0, 360.0, 360.0, 360.0, 360.0,
Expand All @@ -59,7 +56,6 @@
firstRing = cms.int32(1),
binOfMaximum = cms.int32(5),
doPhotoStatistics = cms.bool(True),
photoelectronsToAnalog = cms.vdouble([0.3305]*16),
simHitToPhotoelectrons = cms.double(2000.0),
samplingFactors = cms.vdouble(
125.44, 125.54, 125.32, 125.13, 124.46,
Expand All @@ -77,7 +73,6 @@
firstRing = cms.int32(16),
binOfMaximum = cms.int32(5),
doPhotoStatistics = cms.bool(True),
photoelectronsToAnalog = cms.vdouble([0.3305]*14),
simHitToPhotoelectrons = cms.double(2000.0),
samplingFactors = cms.vdouble(
210.55, 197.93, 186.12, 189.64, 189.63,
Expand All @@ -104,16 +99,13 @@
)

hcalSimParameters.hoZecotek = hcalSimParameters.ho.clone()
hcalSimParameters.hoZecotek.photoelectronsToAnalog = [3.0]*16

hcalSimParameters.hoHamamatsu = hcalSimParameters.ho.clone()
hcalSimParameters.hoHamamatsu.photoelectronsToAnalog = [3.0]*16

# Customises the HCal digitiser for post LS1 running
from Configuration.Eras.Modifier_run2_common_cff import run2_common
run2_common.toModify( hcalSimParameters,
ho = dict(
photoelectronsToAnalog = cms.vdouble([4.0]*16),
siPMCode = cms.int32(1)
),
hf1 = dict( samplingFactor = cms.double(0.67) ),
Expand Down
5 changes: 0 additions & 5 deletions SimCalorimetry/HcalTestBeam/python/TBHcal06HcalDigi_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
syncPhaseTB = cms.untracked.bool(False),
tunePhaseShiftTB = cms.untracked.double(1.0),
photomultiplierGainTBHB = cms.untracked.double(2000.0),
photoelectronsToAnalogTBHB = cms.untracked.vdouble([0.3305]*16),
samplingFactorTBHB = cms.untracked.double(117.0),
timePhaseTBHB = cms.untracked.double(5.0),
binOfMaximumTBHB = cms.untracked.int32(5),
Expand All @@ -20,7 +19,6 @@
117.46, 116.79, 117.15, 117.29, 118.41,
134.86),
photomultiplierGainTBHE = cms.untracked.double(2000.0),
photoelectronsToAnalogTBHE = cms.vdouble([0.3305]*14),
samplingFactorTBHE = cms.untracked.double(178.0),
timePhaseTBHE = cms.untracked.double(5.0),
binOfMaximumTBHE = cms.untracked.int32(5),
Expand All @@ -30,9 +28,6 @@
171.92, 173.00, 173.22, 173.72, 174.21,
173.91, 175.88, 171.65, 171.65),
photomultiplierGainTBHO = cms.untracked.double(4000.0),
photoelectronsToAnalogTBHO = cms.vdouble(0.24, 0.24, 0.24, 0.24,
0.17, 0.17, 0.17, 0.17, 0.17, 0.17,
0.17, 0.17, 0.17, 0.17, 0.17),
samplingFactorTBHO = cms.untracked.double(217.0),
timePhaseTBHO = cms.untracked.double(5.0),
binOfMaximumTBHO = cms.untracked.int32(5),
Expand Down
9 changes: 3 additions & 6 deletions SimCalorimetry/HcalTestBeam/src/HcalTBSimParameterMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@


HcalTBSimParameterMap::HcalTBSimParameterMap() :
theHBParameters(2000., std::vector<double>(16, 0.3305), 117, 5, 10, 5,
theHBParameters(2000., 117, 5, 10, 5,
true, false, 1, std::vector<double>(16, 117.), 10.),
theHEParameters(2000., std::vector<double>(16, 0.3305), 178, 5, 10, 5,
theHEParameters(2000., 178, 5, 10, 5,
true, false, 16, std::vector<double>(16, 178.), 10.),
theHOParameters(4000., std::vector<double>(16, 0.3065), 217, 5, 10, 5,
theHOParameters(4000., 217, 5, 10, 5,
true, false, 1, std::vector<double>(16, 217.), 5.) {}

/*
Expand All @@ -21,7 +21,6 @@ HcalTBSimParameterMap::HcalTBSimParameterMap() :

HcalTBSimParameterMap::HcalTBSimParameterMap(const edm::ParameterSet & p) :
theHBParameters(p.getUntrackedParameter<double>("photomultiplierGainTBHB",2000.),
p.getUntrackedParameter<std::vector<double> >("photoelectronsToAnalogTBHB",std::vector<double>(16, 0.3305)),
p.getUntrackedParameter<double>("samplingFactorTBHB",117),
p.getUntrackedParameter<double>("timePhaseTBHB",5),
p.getUntrackedParameter<int>("readoutFrameSizeTB",10),
Expand All @@ -32,7 +31,6 @@ HcalTBSimParameterMap::HcalTBSimParameterMap(const edm::ParameterSet & p) :
p.getUntrackedParameter<std::vector<double> >("samplingFactorsTBHB", std::vector<double>(16, 117.)),
p.getUntrackedParameter<double>("sipmTauTBHB",10.) ),
theHEParameters(p.getUntrackedParameter<double>("photomultiplierGainTBHE",2000.),
p.getUntrackedParameter<std::vector<double> >("photoelectronsToAnalogTBHE",std::vector<double>(16, 0.3305)),
p.getUntrackedParameter<double>("samplingFactorTBHE",178),
p.getUntrackedParameter<double>("timePhaseTBHE",5),
p.getUntrackedParameter<int>("readoutFrameSizeTB",10),
Expand All @@ -43,7 +41,6 @@ HcalTBSimParameterMap::HcalTBSimParameterMap(const edm::ParameterSet & p) :
p.getUntrackedParameter<std::vector<double> >("samplingFactorsTBHE", std::vector<double>(16, 178.)),
p.getUntrackedParameter<double>("sipmTauTBHE",10.) ),
theHOParameters(p.getUntrackedParameter<double>("photomultiplierGainTBHE",4000.),
p.getUntrackedParameter<std::vector<double> >("photoelectronsToAnalogTBHO",std::vector<double>(16, 3065)),
p.getUntrackedParameter<double>("samplingFactorTBHO",217),
p.getUntrackedParameter<double>("timePhaseTBHO",5),
p.getUntrackedParameter<int>("readoutFrameSizeTB",10),
Expand Down

0 comments on commit ee4abab

Please sign in to comment.