72 std::vector<double> TS4TS5UpperThresholdTemp = iConfig.
getParameter<std::vector<double>>(
"TS4TS5UpperThreshold");
73 std::vector<double> TS4TS5UpperCutTemp = iConfig.
getParameter<std::vector<double>>(
"TS4TS5UpperCut");
74 std::vector<double> TS4TS5LowerThresholdTemp = iConfig.
getParameter<std::vector<double>>(
"TS4TS5LowerThreshold");
75 std::vector<double> TS4TS5LowerCutTemp = iConfig.
getParameter<std::vector<double>>(
"TS4TS5LowerCut");
77 for (
int i = 0;
i < (
int)TS4TS5UpperThresholdTemp.size() &&
i < (
int)TS4TS5UpperCutTemp.size();
i++)
78 TS4TS5UpperCut_.push_back(std::pair<double, double>(TS4TS5UpperThresholdTemp[
i], TS4TS5UpperCutTemp[
i]));
81 for (
int i = 0;
i < (
int)TS4TS5LowerThresholdTemp.size() &&
i < (
int)TS4TS5LowerCutTemp.size();
i++)
82 TS4TS5LowerCut_.push_back(std::pair<double, double>(TS4TS5LowerThresholdTemp[
i], TS4TS5LowerCutTemp[
i]));
88 edm::LogWarning(
"HCalNoiseInfoProducer") <<
" forcing fillRecHits to be true if fillDigis is true.\n";
100 edm::LogWarning(
"MisConfiguration") <<
"Must provide equally sized lists for laserMonCBoxList, laserMonIEtaList, " 101 "and laserMonIPhiList. Will not fill LaserMon\n";
110 adc2fC = std::vector<float>{
111 -0.5, 0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5,
112 12.5, 13.5, 15., 17., 19., 21., 23., 25., 27., 29.5, 32.5, 35.5, 38.5,
113 42., 46., 50., 54.5, 59.5, 64.5, 59.5, 64.5, 69.5, 74.5, 79.5, 84.5, 89.5,
114 94.5, 99.5, 104.5, 109.5, 114.5, 119.5, 124.5, 129.5, 137., 147., 157., 167., 177.,
115 187., 197., 209.5, 224.5, 239.5, 254.5, 272., 292., 312., 334.5, 359.5, 384.5, 359.5,
116 384.5, 409.5, 434.5, 459.5, 484.5, 509.5, 534.5, 559.5, 584.5, 609.5, 634.5, 659.5, 684.5,
117 709.5, 747., 797., 847., 897., 947., 997., 1047., 1109.5, 1184.5, 1259.5, 1334.5, 1422.,
118 1522., 1622., 1734.5, 1859.5, 1984.5, 1859.5, 1984.5, 2109.5, 2234.5, 2359.5, 2484.5, 2609.5, 2734.5,
119 2859.5, 2984.5, 3109.5, 3234.5, 3359.5, 3484.5, 3609.5, 3797., 4047., 4297., 4547., 4797., 5047.,
120 5297., 5609.5, 5984.5, 6359.5, 6734.5, 7172., 7672., 8172., 8734.5, 9359.5, 9984.5};
418 produces<HcalNoiseRBXCollection>();
420 produces<HcalNoiseSummary>();
428 desc.add<
double>(
"minRecHitE", 1.5);
429 desc.add<
double>(
"minLowHitE", 10.0);
430 desc.add<
double>(
"minHighHitE", 25.0);
431 desc.add<
double>(
"minR45HitE", 5.0);
434 desc.add<
double>(
"pMinERatio", 25.0);
435 desc.add<
double>(
"pMinEZeros", 5.0);
436 desc.add<
double>(
"pMinEEMF", 10.0);
439 desc.add<
double>(
"minERatio", 50.0);
440 desc.add<
double>(
"minEZeros", 10.0);
441 desc.add<
double>(
"minEEMF", 50.0);
444 desc.add<
double>(
"pMinE", 40.0);
445 desc.add<
double>(
"pMinRatio", 0.75);
446 desc.add<
double>(
"pMaxRatio", 0.85);
447 desc.add<
int>(
"pMinHPDHits", 10);
448 desc.add<
int>(
"pMinRBXHits", 20);
449 desc.add<
int>(
"pMinHPDNoOtherHits", 7);
450 desc.add<
int>(
"pMinZeros", 4);
451 desc.add<
double>(
"pMinLowEHitTime", -6.0);
452 desc.add<
double>(
"pMaxLowEHitTime", 6.0);
453 desc.add<
double>(
"pMinHighEHitTime", -4.0);
454 desc.add<
double>(
"pMaxHighEHitTime", 5.0);
455 desc.add<
double>(
"pMaxHPDEMF", -0.02);
456 desc.add<
double>(
"pMaxRBXEMF", 0.02);
457 desc.add<
int>(
"pMinRBXRechitR45Count", 1);
458 desc.add<
double>(
"pMinRBXRechitR45Fraction", 0.1);
459 desc.add<
double>(
"pMinRBXRechitR45EnergyFraction", 0.1);
462 desc.add<
double>(
"lMinRatio", -999.0);
463 desc.add<
double>(
"lMaxRatio", 999.0);
464 desc.add<
int>(
"lMinHPDHits", 17);
465 desc.add<
int>(
"lMinRBXHits", 999);
466 desc.add<
int>(
"lMinHPDNoOtherHits", 10);
467 desc.add<
int>(
"lMinZeros", 10);
468 desc.add<
double>(
"lMinLowEHitTime", -9999.0);
469 desc.add<
double>(
"lMaxLowEHitTime", 9999.0);
470 desc.add<
double>(
"lMinHighEHitTime", -9999.0);
471 desc.add<
double>(
"lMaxHighEHitTime", 9999.0);
474 desc.add<
double>(
"tMinRatio", -999.0);
475 desc.add<
double>(
"tMaxRatio", 999.0);
476 desc.add<
int>(
"tMinHPDHits", 16);
477 desc.add<
int>(
"tMinRBXHits", 50);
478 desc.add<
int>(
"tMinHPDNoOtherHits", 9);
479 desc.add<
int>(
"tMinZeros", 8);
480 desc.add<
double>(
"tMinLowEHitTime", -9999.0);
481 desc.add<
double>(
"tMaxLowEHitTime", 9999.0);
482 desc.add<
double>(
"tMinHighEHitTime", -7.0);
483 desc.add<
double>(
"tMaxHighEHitTime", 6.0);
486 desc.add<
double>(
"hlMaxHPDEMF", -9999.0);
487 desc.add<
double>(
"hlMaxRBXEMF", 0.01);
490 desc.add<
double>(
"calibdigiHBHEthreshold", 15)
492 "minimum threshold in fC of any HBHE \ 493 calib digi to be counted in summary");
494 desc.add<std::vector<int>>(
"calibdigiHBHEtimeslices",
501 ->setComment(
"time slices to use when determining charge of HBHE calib digis");
502 desc.add<
double>(
"calibdigiHFthreshold", -999)
503 ->setComment(
"minimum threshold in fC of any HF calib digi to be counted in summary");
504 desc.add<std::vector<int>>(
"calibdigiHFtimeslices",
517 ->setComment(
"time slices to use when determining charge of HF calib digis");
520 desc.add<
double>(
"TS4TS5EnergyThreshold", 50);
521 desc.add<std::vector<double>>(
"TS4TS5UpperThreshold",
529 desc.add<std::vector<double>>(
"TS4TS5UpperCut",
537 desc.add<std::vector<double>>(
"TS4TS5LowerThreshold",
547 desc.add<std::vector<double>>(
"TS4TS5LowerCut",
561 desc.add<std::vector<double>>(
"lRBXRecHitR45Cuts",
573 "first 4 entries : equivalent to 'fraction > 0.5' \ 574 last 4 entries : equivalent to 'energy fraction > 0.5'");
575 desc.add<std::vector<double>>(
"tRBXRecHitR45Cuts",
587 "first 4 entries : equivalent to 'fraction > 0.2' \ 588 last 4 entries : equivalent to 'energy fraction > 0.2'");
593 desc.add<std::vector<int>>(
"laserMonCBoxList",
595 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
597 ->setComment(
"time ordered list of the cBox values of laser monitor channels");
598 desc.add<std::vector<int>>(
"laserMonIPhiList",
599 {23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0})
600 ->setComment(
"time ordered list of the iPhi values of laser monitor channels");
601 desc.add<std::vector<int>>(
"laserMonIEtaList",
603 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
605 ->setComment(
"time ordered list of the iEta values of laser monitor channels");
608 desc.add<
int>(
"laserMonTSStart", 0)->setComment(
"lower bound of laser monitor charge integration window");
609 desc.add<
int>(
"laserMonTSEnd", -1)
610 ->setComment(
"upper bound of laser monitor charge integration window (-1 = no bound)");
611 desc.add<
unsigned>(
"laserMonSamples", 4)->setComment(
"Number of laser monitor samples to take per channel");
614 desc.add<
bool>(
"fillDigis",
true);
615 desc.add<
bool>(
"fillRecHits",
true);
616 desc.add<
bool>(
"fillCaloTowers",
true);
617 desc.add<
bool>(
"fillTracks",
true);
618 desc.add<
bool>(
"fillLaserMonitor",
true);
623 desc.add<
int>(
"maxProblemRBXs", 72)
625 "maximum number of RBXs to fill. if you want to record \ 626 all RBXs above some energy threshold,change maxProblemRBXs to \ 627 999 and pMinE (above) to the threshold you want");
631 desc.add<
int>(
"maxCaloTowerIEta", 20);
632 desc.add<
double>(
"maxTrackEta", 2.0);
633 desc.add<
double>(
"minTrackPt", 1.0);
634 desc.add<
double>(
"maxNHF", 0.9);
635 desc.add<
int>(
"maxjetindex", 0);
646 desc.add<
unsigned int>(
"HcalAcceptSeverityLevel", 9);
651 desc.add<std::vector<int>>(
"HcalRecHitFlagsToBeExcluded",
661 "which hcal calo flags to mask (HBHEIsolatedNoise=11, \ 662 HBHEFlatNoise=12, HBHESpikeNoise=13, \ 663 HBHETriangleNoise=14, HBHETS4TS5Noise=15, HBHENegativeNoise=27)");
666 descriptions.
add(
"hcalnoise",
desc);
676 auto result1 = std::make_unique<HcalNoiseRBXCollection>();
677 auto result2 = std::make_unique<HcalNoiseSummary>();
702 HcalNoiseRBXArray::iterator maxit = rbxarray.begin();
703 double maxenergy = -999;
704 bool maxwritten =
false;
705 for (HcalNoiseRBXArray::iterator rit = rbxarray.begin(); rit != rbxarray.end(); ++rit) {
717 if (
data.energy() > maxenergy) {
718 maxenergy =
data.energy();
733 result1->push_back(rbx);
745 result1->push_back(rbx);
784 if (
data.numHPDNoOtherHits() >
summary.maxHPDNoOtherHits()) {
785 summary.maxhpdhitsnoother_ =
data.numHPDNoOtherHits();
789 if (
data.PassTS4TS5() ==
false)
790 summary.hasBadRBXTS4TS5_ =
true;
793 summary.hasBadRBXRechitR45Loose_ =
true;
795 summary.hasBadRBXRechitR45Tight_ =
true;
801 if (
data.maxLowEHitTime() >
summary.max10GeVHitTime()) {
806 if (
data.minHighEHitTime() <
summary.min25GeVHitTime()) {
809 if (
data.maxHighEHitTime() >
summary.max25GeVHitTime()) {
836 summary.filterstatus_ |= 0x100;
838 summary.filterstatus_ |= 0x200;
840 summary.filterstatus_ |= 0x400;
842 summary.filterstatus_ |= 0x800;
845 summary.filterstatus_ |= 0x10000;
870 int NcalibTS45gt15 = 0;
873 double chargecalibTS45 = 0;
874 double chargecalibgt15TS45 = 0;
890 <<
" could not find HBHEDigiCollection named " <<
digiCollName_ <<
"\n.";
922 bool isBig =
false, isBig5 =
false, isRBX =
false;
927 const HcalDetId& detid = (*rit)->idFront();
928 if (
DetId(detid) == digi.
id()) {
930 isBig = isBig5 =
true;
941 for (
int ts = 0; ts < tool.
size(); ++ts) {
943 if (digi[ts].
adc() == 0) {
949 double corrfc = tool[ts] -
calibrations.pedestal(digi[ts].capid());
975 if (hCalib.
isValid() ==
true) {
977 if (digi->id().hcalSubdet() == 0)
980 for (
unsigned i = 0;
i < (unsigned)digi->size();
i++)
986 if (digi->zsMarkAndPass())
991 double sumChargeHF = 0;
1003 double sumChargeHBHE = 0;
1011 chargecalibTS45 += sumChargeHBHE;
1014 chargecalibgt15TS45 += sumChargeHBHE;
1022 float max_charge = 0;
1024 std::vector<float> comb_charge;
1028 for (
unsigned ich = 0; ich < nch; ++ich) {
1038 int ch_iphi = calibId.iphi();
1039 int ch_ieta = calibId.ieta();
1041 if (cboxch == ch_cboxch &&
iphi == ch_iphi &&
ieta == ch_ieta) {
1042 unsigned ts_size =
df.samples();
1045 for (
unsigned its = 0; its < ts_size; ++its) {
1051 bool ok =
df[its].ok();
1052 int adc =
df[its].adc();
1061 if (
ok &&
adc >= 0) {
1064 if (
charge > max_charge) {
1069 comb_charge.push_back(
charge);
1078 if (comb_charge.empty()) {
1083 int start_ts = max_ts - 3;
1084 int end_ts = max_ts + 3;
1090 if (end_ts >=
int(comb_charge.size()))
1091 end_ts = comb_charge.size() - 1;
1101 summary.calibCountTS45_ = NcalibTS45;
1102 summary.calibCountgt15TS45_ = NcalibTS45gt15;
1103 summary.calibChargeTS45_ = chargecalibTS45;
1104 summary.calibChargegt15TS45_ = chargecalibgt15TS45;
1105 summary.calibCountHF_ = NcalibHFgtX;
1134 <<
" could not find HBHERecHitCollection named " <<
recHitCollName_ <<
"\n.";
1143 summary.hitsInLaserRegion_ = 0;
1144 summary.hitsInNonLaserRegion_ = 0;
1145 summary.energyInLaserRegion_ = 0;
1146 summary.energyInNonLaserRegion_ = 0;
1155 uint32_t recHitFlag = rechit.
flags();
1164 recHitFlag = (recHitFlag & bitset) ? recHitFlag - bitset : recHitFlag;
1173 bool isRecovered = hcalSevLvlComputer->
recoveredRecHit(
id, recHitFlag);
1182 HcalBadLaserSignal))
1184 ++
summary.hitsInNonLaserRegion_;
1192 if (rechit.
eraw() > 1.5) {
1203 if (rechit.
flags() & isolbitset) {
1207 double et = rechit.
eraw() * gp.perp() / gp.mag();
1211 if (rechit.
flags() & flatbitset) {
1215 double et = rechit.
eraw() * gp.perp() / gp.mag();
1219 if (rechit.
flags() & spikebitset) {
1223 double et = rechit.
eraw() * gp.perp() / gp.mag();
1227 if (rechit.
flags() & trianglebitset) {
1231 double et = rechit.
eraw() * gp.perp() / gp.mag();
1235 if (rechit.
flags() & ts4ts5bitset) {
1241 double et = rechit.
eraw() * gp.perp() / gp.mag();
1246 if (rechit.
flags() & negativebitset) {
1250 double et = rechit.
eraw() * gp.perp() / gp.mag();
1266 for (HcalNoiseRBXArray::iterator rbxit =
array.begin(); rbxit !=
array.end(); ++rbxit) {
1267 for (std::vector<HcalNoiseHPD>::iterator hpdit = rbxit->hpds_.begin(); hpdit != rbxit->hpds_.end(); ++hpdit) {
1270 hpdit->refrechitset_.begin();
1271 it != hpdit->refrechitset_.end();
1273 hpdit->rechits_.push_back(*it);
1308 std::vector<std::vector<HcalNoiseHPD>::iterator> hpditervec;
1309 array.findHPD(twr, hpditervec);
1312 for (
std::vector<std::vector<HcalNoiseHPD>::iterator>::iterator it = hpditervec.begin(); it != hpditervec.end();
1314 (*it)->calotowers_.push_back(myRef);
1330 bool goodJetFoundInLowBVRegion =
false;
1339 for (reco::PFJetCollection::const_iterator
jet = pfjet_h->begin();
jet != pfjet_h->end(); ++
jet) {
1345 if (
jet->eta() > 0.0 &&
jet->eta() < 1.4 &&
jet->phi() > -1.8 &&
jet->phi() < -1.4) {
1349 goodJetFoundInLowBVRegion =
true;
1358 summary.goodJetFoundInLowBVRegion_ = goodJetFoundInLowBVRegion;
1377 for (reco::TrackCollection::const_iterator iTrack =
handle->begin(); iTrack !=
handle->end(); ++iTrack) {
int cboxChannel() const
get the calibration box channel (if relevant)
edm::EDGetTokenT< QIE10DigiCollection > lasermondigi_token_
std::vector< int > calibdigiHFtimeslices_
T getParameter(std::string const &) const
std::vector< int > HcalRecHitFlagsToBeExcluded_
unsigned laserMonitorSamples_
bool passTightRatio(const CommonHcalNoiseRBXData &) const
int size() const
get the size
constexpr bool zsMarkAndPass() const
was ZS MarkAndPass?
std::string caloTowerCollName_
bool passLooseTiming(const CommonHcalNoiseRBXData &) const
bool passLooseZeros(const CommonHcalNoiseRBXData &) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool passLooseRatio(const CommonHcalNoiseRBXData &) const
double p() const
momentum vector magnitude
bool recoveredRecHit(const DetId &myid, const uint32_t &myflag) const
void produce(edm::Event &, const edm::EventSetup &) override
bool passRatioThreshold(const CommonHcalNoiseRBXData &) const
std::vector< std::pair< double, double > > TS4TS5LowerCut_
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd > severitycomputer_token_
std::vector< float > adc2fC
std::set< edm::Ref< HBHERecHitCollection >, RefHBHERecHitEnergyComparison > refrechitset_
std::vector< T >::const_iterator const_iterator
std::vector< float > bigCharge_
bool passTightNoiseFilter(const CommonHcalNoiseRBXData &) const
bool passTightZeros(const CommonHcalNoiseRBXData &) const
std::vector< float > big5Charge_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > hcaltopo_token_
std::string digiCollName_
std::string trackCollName_
const Item * getValues(DetId fId, bool throwOnFail=true) const
edm::RefVector< HBHERecHitCollection > rechits_
edm::EDGetTokenT< reco::PFJetCollection > jet_token_
void filljetinfo(edm::Event &, const edm::EventSetup &, HcalNoiseSummary &) const
bool passLooseHits(const CommonHcalNoiseRBXData &) const
bool passLooseRBXRechitR45(const CommonHcalNoiseRBXData &) const
double pt() const
track transverse momentum
void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const override
static const unsigned OFF_TDC_TIME
void fillrechits(edm::Event &, const edm::EventSetup &, HcalNoiseRBXArray &, HcalNoiseSummary &) const
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > quality_token_
T const * product() const
constexpr uint32_t flags() const
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
~HcalNoiseInfoProducer() override
std::vector< int > laserMonIPhiList_
constexpr float eraw() const
double TS4TS5EnergyThreshold_
HcalDetId idFront() const
bool passZerosThreshold(const CommonHcalNoiseRBXData &) const
constexpr uint32_t auxPhase1() const
edm::EDGetTokenT< HcalCalibDigiCollection > hcalcalibdigi_token_
std::vector< float > adc2fCHF
#define DEFINE_FWK_MODULE(type)
const_iterator begin() const
edm::EDGetTokenT< HBHEDigiCollection > hbhedigi_token_
double calibdigiHFthreshold_
void fillOtherSummaryVariables(HcalNoiseSummary &summary, const CommonHcalNoiseRBXData &data) const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
constexpr const HcalDetId & id() const
bool passTightRBXRechitR45(const CommonHcalNoiseRBXData &) const
bool passEMFThreshold(const CommonHcalNoiseRBXData &) const
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > calogeometry_token_
uint32_t getValue() const
std::vector< std::pair< double, double > > TS4TS5UpperCut_
constexpr bool getBit(const uint32_t u, const unsigned bitnum)
const_iterator end() const
std::vector< float > allCharge_
double calibdigiHBHEthreshold_
edm::EDGetTokenT< reco::TrackCollection > track_token_
double eta() const
pseudorapidity of momentum vector
std::vector< int > laserMonIEtaList_
static std::string join(char **cmd)
edm::EDGetTokenT< HBHERecHitCollection > hbherechit_token_
constexpr HcalDetId id() const
get the id
bool passLooseNoiseFilter(const CommonHcalNoiseRBXData &) const
uint32_t HcalAcceptSeverityLevel_
constexpr uint32_t rawId() const
get the raw id
void filldigis(edm::Event &, const edm::EventSetup &, HcalNoiseRBXArray &, HcalNoiseSummary &)
bool passHighLevelNoiseFilter(const CommonHcalNoiseRBXData &) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::ESGetToken< HcalDbService, HcalDbRecord > service_token_
CalibDetType calibFlavor() const
get the flavor of this calibration detid
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::GlobalCoordinateSystemTag > GlobalPoint
point in global coordinate system
std::vector< int > laserMonCBoxList_
char data[epos_bytes_allocation]
static std::atomic< unsigned int > counter
static const unsigned OFF_COMBINED
bool passTightTiming(const CommonHcalNoiseRBXData &) const
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
std::vector< int > calibdigiHBHEtimeslices_
const HcalTopology * theHcalTopology_
bool passTightHits(const CommonHcalNoiseRBXData &) const
Log< level::Warning, false > LogWarning
HcalNoiseInfoProducer(const edm::ParameterSet &)
void filltracks(edm::Event &, const edm::EventSetup &, HcalNoiseSummary &) const
std::string recHitCollName_
bool isBitSet(unsigned int bitnumber) const
bool isProblematic(const CommonHcalNoiseRBXData &) const
uint16_t *__restrict__ uint16_t const *__restrict__ adc
bool dropChannel(const uint32_t &mystatus) const
void fillcalotwrs(edm::Event &, const edm::EventSetup &, HcalNoiseRBXArray &, HcalNoiseSummary &) const
edm::EDGetTokenT< CaloTowerCollection > calotower_token_