Skip to content

Commit

Permalink
Merge pull request #14471 from matz-e/fix-2016-fg
Browse files Browse the repository at this point in the history
Fix 2016 FG bit as MB trigger
  • Loading branch information
cmsbuild committed Jul 22, 2016
2 parents 52e6661 + 2bc8476 commit 268c357
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
Expand Up @@ -22,7 +22,7 @@ class HcalTriggerPrimitiveAlgo {
public:
HcalTriggerPrimitiveAlgo(bool pf, const std::vector<double>& w,
int latency,
uint32_t FG_threshold, uint32_t ZS_threshold,
bool FG_MinimumBias, uint32_t FG_threshold, uint32_t ZS_threshold,
int numberOfSamples, int numberOfPresamples,
int numberOfSamplesHF, int numberOfPresamplesHF,
uint32_t minSignalThreshold=0, uint32_t PMT_NoiseThreshold=0);
Expand Down Expand Up @@ -71,6 +71,7 @@ class HcalTriggerPrimitiveAlgo {
bool peakfind_;
std::vector<double> weights_;
int latency_;
bool FG_MinimumBias_;
uint32_t FG_threshold_;
uint32_t ZS_threshold_;
int ZS_threshold_I_;
Expand Down
21 changes: 12 additions & 9 deletions SimCalorimetry/HcalTrigPrimAlgos/src/HcalTriggerPrimitiveAlgo.cc
Expand Up @@ -14,20 +14,20 @@
using namespace std;

HcalTriggerPrimitiveAlgo::HcalTriggerPrimitiveAlgo( bool pf, const std::vector<double>& w, int latency,
uint32_t FG_threshold, uint32_t ZS_threshold,
bool FG_MinimumBias, uint32_t FG_threshold, uint32_t ZS_threshold,
int numberOfSamples, int numberOfPresamples,
int numberOfSamplesHF, int numberOfPresamplesHF,
uint32_t minSignalThreshold, uint32_t PMT_NoiseThreshold)
: incoder_(0), outcoder_(0),
theThreshold(0), peakfind_(pf), weights_(w), latency_(latency),
FG_threshold_(FG_threshold), ZS_threshold_(ZS_threshold),
FG_MinimumBias_(FG_MinimumBias), FG_threshold_(FG_threshold), ZS_threshold_(ZS_threshold),
numberOfSamples_(numberOfSamples),
numberOfPresamples_(numberOfPresamples),
numberOfSamplesHF_(numberOfSamplesHF),
numberOfPresamplesHF_(numberOfPresamplesHF),
minSignalThreshold_(minSignalThreshold),
PMT_NoiseThreshold_(PMT_NoiseThreshold),
NCTScaleShift(0), RCTScaleShift(0),
NCTScaleShift(0), RCTScaleShift(0),
peak_finder_algorithm_(2)
{
//No peak finding setting (for Fastsim)
Expand All @@ -51,7 +51,7 @@ void HcalTriggerPrimitiveAlgo::run(const HcalTPGCoder* incoder,
const HBHEDigiCollection& hbheDigis,
const HFDigiCollection& hfDigis,
HcalTrigPrimDigiCollection& result,
const HcalTrigTowerGeometry* trigTowerGeometry,
const HcalTrigTowerGeometry* trigTowerGeometry,
float rctlsb, const HcalFeatureBit* LongvrsShortCut) {
theTrigTowerGeometry = trigTowerGeometry;

Expand Down Expand Up @@ -406,11 +406,14 @@ void HcalTriggerPrimitiveAlgo::analyzeHFV1(
}
output[ibin] += (long_fiber_val + short_fiber_val);

int ADCLong = details.LongDigi[ibin].adc();
int ADCShort = details.ShortDigi[ibin].adc();
if(HCALFEM != 0)
{
finegrain[ibin] = (finegrain[ibin] || HCALFEM->fineGrainbit(ADCShort, details.ShortDigi.id(), details.ShortDigi[ibin].capid(), ADCLong, details.LongDigi.id(), details.LongDigi[ibin].capid()));
uint32_t ADCLong = details.LongDigi[ibin].adc();
uint32_t ADCShort = details.ShortDigi[ibin].adc();

if(FG_MinimumBias_) {
finegrain[ibin] = (finegrain[ibin] || ADCLong > FG_threshold_ || ADCShort > FG_threshold_);
}
else if(HCALFEM != 0) {
finegrain[ibin] = (finegrain[ibin] || HCALFEM->fineGrainbit(ADCShort, details.ShortDigi.id(), details.ShortDigi[ibin].capid(), ADCLong, details.LongDigi.id(), details.LongDigi[ibin].capid()));
}
}
}
Expand Down
Expand Up @@ -14,6 +14,7 @@
peakFilter = cms.bool(True),
weights = cms.vdouble(1.0, 1.0), ##hardware algo
latency = cms.int32(1),
FG_MinimumBias = cms.bool(True),
FG_threshold = cms.uint32(12), ## threshold for setting fine grain bit
ZS_threshold = cms.uint32(1), ## threshold for setting fine grain bit
numberOfSamples = cms.int32(4),
Expand Down
Expand Up @@ -30,8 +30,9 @@ HcalTrigPrimDigiProducer::HcalTrigPrimDigiProducer(const edm::ParameterSet& ps)
theAlgo_(ps.getParameter<bool>("peakFilter"),
ps.getParameter<std::vector<double> >("weights"),
ps.getParameter<int>("latency"),
ps.getParameter<bool>("FG_MinimumBias"),
ps.getParameter<uint32_t>("FG_threshold"),
ps.getParameter<uint32_t>("ZS_threshold"),
ps.getParameter<uint32_t>("ZS_threshold"),
ps.getParameter<int>("numberOfSamples"),
ps.getParameter<int>("numberOfPresamples"),
ps.getParameter<int>("numberOfSamplesHF"),
Expand Down

0 comments on commit 268c357

Please sign in to comment.