Skip to content

Commit

Permalink
Comments #29762
Browse files Browse the repository at this point in the history
  • Loading branch information
jbsauvan committed May 12, 2020
1 parent 8074ea1 commit f63610f
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 33 deletions.
5 changes: 3 additions & 2 deletions L1Trigger/L1THGCal/python/hgcalBackEndLayer1Producer_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,6 @@
ProcessorParameters = be_proc.clone()
)

hgcalBackEndLayer1ProducerHFNose = hgcalBackEndLayer1Producer.clone()
hgcalBackEndLayer1ProducerHFNose.InputTriggerCells = cms.InputTag('hgcalConcentratorProducerHFNose:HGCalConcentratorProcessorSelection')
hgcalBackEndLayer1ProducerHFNose = hgcalBackEndLayer1Producer.clone(
InputTriggerCells = cms.InputTag('hgcalConcentratorProducerHFNose:HGCalConcentratorProcessorSelection')
)
24 changes: 13 additions & 11 deletions L1Trigger/L1THGCal/python/hgcalBackEndLayer2Producer_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,17 @@
)


hgcalBackEndLayer2ProducerHFNose = hgcalBackEndLayer2Producer.clone()
hgcalBackEndLayer2ProducerHFNose.InputCluster = cms.InputTag('hgcalBackEndLayer1ProducerHFNose:HGCalBackendLayer1Processor2DClustering')

binSumsNose = cms.vuint32(13,11,9,9)

hgcalBackEndLayer2ProducerHFNose.ProcessorParameters.C3d_parameters.histoMax_C3d_seeding_parameters = dict(
## note in #Phi same bin size for HGCAL and HFNose
nBins_X1_histo_multicluster = 4, # R bin size: 5 FullModules * 8 TP
binSumsHisto = binSumsNose,
kROverZMin = 0.025,
kROverZMax = 0.1
hgcalBackEndLayer2ProducerHFNose = hgcalBackEndLayer2Producer.clone(
InputCluster = cms.InputTag('hgcalBackEndLayer1ProducerHFNose:HGCalBackendLayer1Processor2DClustering'),
ProcessorParameters = dict(
C3d_parameters = dict(
histoMax_C3d_seeding_parameters = dict(
## note in #Phi same bin size for HGCAL and HFNose
nBins_X1_histo_multicluster = 4, # R bin size: 5 FullModules * 8 TP
binSumsHisto = cms.vuint32(13,11,9,9),
kROverZMin = 0.025,
kROverZMax = 0.1
)
)
)
)
7 changes: 4 additions & 3 deletions L1Trigger/L1THGCal/python/hgcalConcentratorProducer_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@
)


hgcalConcentratorProducerHFNose = hgcalConcentratorProducer.clone()
hgcalConcentratorProducerHFNose.InputTriggerCells = cms.InputTag('hfnoseVFEProducer:HGCalVFEProcessorSums')
hgcalConcentratorProducerHFNose.InputTriggerSums = cms.InputTag('hfnoseVFEProducer:HGCalVFEProcessorSums')
hgcalConcentratorProducerHFNose = hgcalConcentratorProducer.clone(
InputTriggerCells = cms.InputTag('hfnoseVFEProducer:HGCalVFEProcessorSums'),
InputTriggerSums = cms.InputTag('hfnoseVFEProducer:HGCalVFEProcessorSums')
)

5 changes: 3 additions & 2 deletions L1Trigger/L1THGCal/python/hgcalTowerMapProducer_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
ProcessorParameters = tower_map.clone()
)

hgcalTowerMapProducerHFNose = hgcalTowerMapProducer.clone()
hgcalTowerMapProducerHFNose.InputTriggerCells = cms.InputTag('hfnoseVFEProducer:HFNoseVFEProcessorSums')
hgcalTowerMapProducerHFNose = hgcalTowerMapProducer.clone(
InputTriggerCells = cms.InputTag('hfnoseVFEProducer:HFNoseVFEProcessorSums')
)
5 changes: 3 additions & 2 deletions L1Trigger/L1THGCal/python/hgcalTowerProducer_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
)


hgcalTowerProducerHFNose = hgcalTowerProducer.clone()
hgcalTowerProducerHFNose.InputTowerMaps = cms.InputTag('hgcalTowerMapProducerHFNose:HGCalTowerMapProcessor')
hgcalTowerProducerHFNose = hgcalTowerProducer.clone(
InputTowerMaps = cms.InputTag('hgcalTowerMapProducerHFNose:HGCalTowerMapProcessor')
)

2 changes: 1 addition & 1 deletion L1Trigger/L1THGCal/python/hgcalVFEProducer_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
adcnBits_sc = adcNbits_sc,
tdcsaturation_sc = tdcSaturation_sc,
linnBits = cms.uint32(16),
oot_coefficients = cms.vdouble(0., 0.), # (bx-2, bx-1)
oot_coefficients = cms.vdouble(0., 0.), # OOT PU subtraction coeffs for samples (bx-2, bx-1). (0,0) = no OOT PU subtraction
siliconCellLSB_fC = cms.double( triggerCellLsbBeforeCompression*(2**triggerCellTruncationBits) ),
scintillatorCellLSB_MIP = cms.double(float(adcSaturation_sc.value())/(2**float(adcNbits_sc.value()))),
noiseSilicon = cms.PSet(),
Expand Down
14 changes: 8 additions & 6 deletions L1Trigger/L1THGCal/src/veryfrontend/HGCalVFELinearizationImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ HGCalVFELinearizationImpl::HGCalVFELinearizationImpl(const edm::ParameterSet& co
tdcsaturation_sc_(conf.getParameter<double>("tdcsaturation_sc")),
linnBits_(conf.getParameter<uint32_t>("linnBits")),
oot_coefficients_(conf.getParameter<std::vector<double>>("oot_coefficients")) {
const int kOot_order = 2;
constexpr int kOot_order = 2;
if (oot_coefficients_.size() != kOot_order) {
throw cms::Exception("BadConfiguration") << "OOT subtraction needs " << kOot_order << " coefficients";
}
Expand All @@ -28,7 +28,9 @@ HGCalVFELinearizationImpl::HGCalVFELinearizationImpl(const edm::ParameterSet& co

void HGCalVFELinearizationImpl::linearize(const std::vector<HGCDataFrame<DetId, HGCSample>>& dataframes,
std::vector<std::pair<DetId, uint32_t>>& linearized_dataframes) {
const int kIntimeSample = 2;
constexpr int kIntimeSample = 2;
constexpr int kOuttime1Sample = 1; // in time - 1;
constexpr int kOuttime2Sample = 0; // in time - 2;

for (const auto& frame : dataframes) { //loop on DIGI
double amplitude = 0.;
Expand All @@ -48,10 +50,10 @@ void HGCalVFELinearizationImpl::linearize(const std::vector<HGCDataFrame<DetId,
} else { //ADC mode
double data = frame[kIntimeSample].data();
// applies OOT PU subtraction only in the ADC mode
if (!frame[kIntimeSample - 1].mode()) {
data += oot_coefficients_[kIntimeSample - 1] * frame[kIntimeSample - 1].data();
if (!frame[kIntimeSample - 2].mode()) {
data += oot_coefficients_[kIntimeSample - 2] * frame[kIntimeSample - 2].data();
if (!frame[kOuttime1Sample].mode()) {
data += oot_coefficients_[kOuttime1Sample] * frame[kOuttime1Sample].data();
if (!frame[kOuttime2Sample].mode()) {
data += oot_coefficients_[kOuttime2Sample] * frame[kOuttime2Sample].data();
}
}
amplitude = std::max(0., data) * adcLSB;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ void HGCalTriggerNtupleHGCDigis::fill(const edm::Event& e, const edm::EventSetup
vector<int> hgcdigi_isadc(digi.size());
for (int i = 0; i < digi.size(); i++) {
hgcdigi_data[i] = digi[i].data();
hgcdigi_isadc[i] = (digi[i].mode() ? 0 : 1);
hgcdigi_isadc[i] = !digi[i].mode();
}
hgcdigi_data_.emplace_back(hgcdigi_data);
hgcdigi_isadc_.emplace_back(hgcdigi_isadc);
Expand Down Expand Up @@ -239,7 +239,7 @@ void HGCalTriggerNtupleHGCDigis::fill(const edm::Event& e, const edm::EventSetup
vector<int> hgcdigi_isadc(digi.size());
for (int i = 0; i < digi.size(); i++) {
hgcdigi_data[i] = digi[i].data();
hgcdigi_isadc[i] = (digi[i].mode() ? 0 : 1);
hgcdigi_isadc[i] = !digi[i].mode();
}
hgcdigi_data_.emplace_back(hgcdigi_data);
hgcdigi_isadc_.emplace_back(hgcdigi_isadc);
Expand Down Expand Up @@ -280,7 +280,7 @@ void HGCalTriggerNtupleHGCDigis::fill(const edm::Event& e, const edm::EventSetup
vector<int> bhdigi_isadc(digi.size());
for (int i = 0; i < digi.size(); i++) {
bhdigi_data[i] = digi[i].data();
bhdigi_isadc[i] = (digi[i].mode() ? 0 : 1);
bhdigi_isadc[i] = !digi[i].mode();
}
bhdigi_data_.emplace_back(bhdigi_data);
bhdigi_isadc_.emplace_back(bhdigi_isadc);
Expand Down
7 changes: 4 additions & 3 deletions L1Trigger/L1THGCalUtilities/python/vfe.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ def create_compression(process,
rounding=vfe_proc.rounding,
oot_coefficients=vfe_proc.oot_coefficients
):
producer = process.hgcalVFEProducer.clone()
producer.ProcessorParameters = vfe_proc.clone(
producer = process.hgcalVFEProducer.clone(
ProcessorParameters = vfe_proc.clone(
exponentBits = exponent,
mantissaBits = mantissa,
rounding = rounding,
oot_coefficients = oot_coefficients
)
)
)
return producer

0 comments on commit f63610f

Please sign in to comment.