72 calibdigiHBHEthreshold_ = iConfig.
getParameter<
double>(
"calibdigiHBHEthreshold");
74 calibdigiHFthreshold_ = iConfig.
getParameter<
double>(
"calibdigiHFthreshold");
79 std::vector<double> TS4TS5UpperThresholdTemp = iConfig.
getParameter<std::vector<double>>(
"TS4TS5UpperThreshold");
80 std::vector<double> TS4TS5UpperCutTemp = iConfig.
getParameter<std::vector<double>>(
"TS4TS5UpperCut");
81 std::vector<double> TS4TS5LowerThresholdTemp = iConfig.
getParameter<std::vector<double>>(
"TS4TS5LowerThreshold");
82 std::vector<double> TS4TS5LowerCutTemp = iConfig.
getParameter<std::vector<double>>(
"TS4TS5LowerCut");
84 for (
int i = 0;
i < (
int)TS4TS5UpperThresholdTemp.size() &&
i < (
int)TS4TS5UpperCutTemp.size();
i++)
85 TS4TS5UpperCut_.push_back(std::pair<double, double>(TS4TS5UpperThresholdTemp[
i], TS4TS5UpperCutTemp[i]));
88 for (
int i = 0; i < (
int)TS4TS5LowerThresholdTemp.size() && i < (
int)TS4TS5LowerCutTemp.size(); i++)
89 TS4TS5LowerCut_.push_back(std::pair<double, double>(TS4TS5LowerThresholdTemp[i], TS4TS5LowerCutTemp[i]));
95 edm::LogWarning(
"HCalNoiseInfoProducer") <<
" forcing fillRecHits to be true if fillDigis is true.\n";
107 edm::LogWarning(
"MisConfiguration") <<
"Must provide equally sized lists for laserMonCBoxList, laserMonIEtaList, " 108 "and laserMonIPhiList. Will not fill LaserMon\n";
109 fillLaserMonitor_ =
false;
117 adc2fC = std::vector<float>{
118 -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,
119 12.5, 13.5, 15., 17., 19., 21., 23., 25., 27., 29.5, 32.5, 35.5, 38.5,
120 42., 46., 50., 54.5, 59.5, 64.5, 59.5, 64.5, 69.5, 74.5, 79.5, 84.5, 89.5,
121 94.5, 99.5, 104.5, 109.5, 114.5, 119.5, 124.5, 129.5, 137., 147., 157., 167., 177.,
122 187., 197., 209.5, 224.5, 239.5, 254.5, 272., 292., 312., 334.5, 359.5, 384.5, 359.5,
123 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,
124 709.5, 747., 797., 847., 897., 947., 997., 1047., 1109.5, 1184.5, 1259.5, 1334.5, 1422.,
125 1522., 1622., 1734.5, 1859.5, 1984.5, 1859.5, 1984.5, 2109.5, 2234.5, 2359.5, 2484.5, 2609.5, 2734.5,
126 2859.5, 2984.5, 3109.5, 3234.5, 3359.5, 3484.5, 3609.5, 3797., 4047., 4297., 4547., 4797., 5047.,
127 5297., 5609.5, 5984.5, 6359.5, 6734.5, 7172., 7672., 8172., 8734.5, 9359.5, 9984.5};
420 produces<HcalNoiseRBXCollection>();
422 produces<HcalNoiseSummary>();
430 desc.
add<
double>(
"minRecHitE", 1.5);
431 desc.
add<
double>(
"minLowHitE", 10.0);
432 desc.
add<
double>(
"minHighHitE", 25.0);
433 desc.
add<
double>(
"minR45HitE", 5.0);
436 desc.
add<
double>(
"pMinERatio", 25.0);
437 desc.
add<
double>(
"pMinEZeros", 5.0);
438 desc.
add<
double>(
"pMinEEMF", 10.0);
441 desc.
add<
double>(
"minERatio", 50.0);
442 desc.
add<
double>(
"minEZeros", 10.0);
443 desc.
add<
double>(
"minEEMF", 50.0);
446 desc.
add<
double>(
"pMinE", 40.0);
447 desc.
add<
double>(
"pMinRatio", 0.75);
448 desc.
add<
double>(
"pMaxRatio", 0.85);
449 desc.
add<
int>(
"pMinHPDHits", 10);
450 desc.
add<
int>(
"pMinRBXHits", 20);
451 desc.
add<
int>(
"pMinHPDNoOtherHits", 7);
452 desc.
add<
int>(
"pMinZeros", 4);
453 desc.
add<
double>(
"pMinLowEHitTime", -6.0);
454 desc.
add<
double>(
"pMaxLowEHitTime", 6.0);
455 desc.
add<
double>(
"pMinHighEHitTime", -4.0);
456 desc.
add<
double>(
"pMaxHighEHitTime", 5.0);
457 desc.
add<
double>(
"pMaxHPDEMF", -0.02);
458 desc.
add<
double>(
"pMaxRBXEMF", 0.02);
459 desc.
add<
int>(
"pMinRBXRechitR45Count", 1);
460 desc.
add<
double>(
"pMinRBXRechitR45Fraction", 0.1);
461 desc.
add<
double>(
"pMinRBXRechitR45EnergyFraction", 0.1);
464 desc.
add<
double>(
"lMinRatio", -999.0);
465 desc.
add<
double>(
"lMaxRatio", 999.0);
466 desc.
add<
int>(
"lMinHPDHits", 17);
467 desc.
add<
int>(
"lMinRBXHits", 999);
468 desc.
add<
int>(
"lMinHPDNoOtherHits", 10);
469 desc.
add<
int>(
"lMinZeros", 10);
470 desc.
add<
double>(
"lMinLowEHitTime", -9999.0);
471 desc.
add<
double>(
"lMaxLowEHitTime", 9999.0);
472 desc.
add<
double>(
"lMinHighEHitTime", -9999.0);
473 desc.
add<
double>(
"lMaxHighEHitTime", 9999.0);
476 desc.
add<
double>(
"tMinRatio", -999.0);
477 desc.
add<
double>(
"tMaxRatio", 999.0);
478 desc.
add<
int>(
"tMinHPDHits", 16);
479 desc.
add<
int>(
"tMinRBXHits", 50);
480 desc.
add<
int>(
"tMinHPDNoOtherHits", 9);
481 desc.
add<
int>(
"tMinZeros", 8);
482 desc.
add<
double>(
"tMinLowEHitTime", -9999.0);
483 desc.
add<
double>(
"tMaxLowEHitTime", 9999.0);
484 desc.
add<
double>(
"tMinHighEHitTime", -7.0);
485 desc.
add<
double>(
"tMaxHighEHitTime", 6.0);
488 desc.
add<
double>(
"hlMaxHPDEMF", -9999.0);
489 desc.
add<
double>(
"hlMaxRBXEMF", 0.01);
492 desc.
add<
double>(
"calibdigiHBHEthreshold", 15)
494 "minimum threshold in fC of any HBHE \ 495 calib digi to be counted in summary");
496 desc.
add<std::vector<int>>(
"calibdigiHBHEtimeslices",
503 ->setComment(
"time slices to use when determining charge of HBHE calib digis");
504 desc.
add<
double>(
"calibdigiHFthreshold", -999)
505 ->setComment(
"minimum threshold in fC of any HF calib digi to be counted in summary");
506 desc.
add<std::vector<int>>(
"calibdigiHFtimeslices",
519 ->setComment(
"time slices to use when determining charge of HF calib digis");
522 desc.
add<
double>(
"TS4TS5EnergyThreshold", 50);
523 desc.
add<std::vector<double>>(
"TS4TS5UpperThreshold",
531 desc.
add<std::vector<double>>(
"TS4TS5UpperCut",
539 desc.
add<std::vector<double>>(
"TS4TS5LowerThreshold",
549 desc.
add<std::vector<double>>(
"TS4TS5LowerCut",
563 desc.
add<std::vector<double>>(
"lRBXRecHitR45Cuts",
575 "first 4 entries : equivalent to 'fraction > 0.5' \ 576 last 4 entries : equivalent to 'energy fraction > 0.5'");
577 desc.
add<std::vector<double>>(
"tRBXRecHitR45Cuts",
589 "first 4 entries : equivalent to 'fraction > 0.2' \ 590 last 4 entries : equivalent to 'energy fraction > 0.2'");
595 desc.
add<std::vector<int>>(
"laserMonCBoxList",
597 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
599 ->setComment(
"time ordered list of the cBox values of laser monitor channels");
600 desc.
add<std::vector<int>>(
"laserMonIPhiList",
601 {23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0})
602 ->setComment(
"time ordered list of the iPhi values of laser monitor channels");
603 desc.
add<std::vector<int>>(
"laserMonIEtaList",
605 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
607 ->setComment(
"time ordered list of the iEta values of laser monitor channels");
610 desc.
add<
int>(
"laserMonTSStart", 0)->setComment(
"lower bound of laser monitor charge integration window");
611 desc.
add<
int>(
"laserMonTSEnd", -1)
612 ->setComment(
"upper bound of laser monitor charge integration window (-1 = no bound)");
613 desc.
add<
unsigned>(
"laserMonSamples", 4)->setComment(
"Number of laser monitor samples to take per channel");
616 desc.
add<
bool>(
"fillDigis",
true);
617 desc.
add<
bool>(
"fillRecHits",
true);
618 desc.
add<
bool>(
"fillCaloTowers",
true);
619 desc.
add<
bool>(
"fillTracks",
true);
620 desc.
add<
bool>(
"fillLaserMonitor",
true);
625 desc.
add<
int>(
"maxProblemRBXs", 72)
627 "maximum number of RBXs to fill. if you want to record \ 628 all RBXs above some energy threshold,change maxProblemRBXs to \ 629 999 and pMinE (above) to the threshold you want");
633 desc.
add<
int>(
"maxCaloTowerIEta", 20);
634 desc.
add<
double>(
"maxTrackEta", 2.0);
635 desc.
add<
double>(
"minTrackPt", 1.0);
636 desc.
add<
double>(
"maxNHF", 0.9);
637 desc.
add<
int>(
"maxjetindex", 0);
648 desc.
add<
unsigned int>(
"HcalAcceptSeverityLevel", 9);
653 desc.
add<std::vector<int>>(
"HcalRecHitFlagsToBeExcluded",
663 "which hcal calo flags to mask (HBHEIsolatedNoise=11, \ 664 HBHEFlatNoise=12, HBHESpikeNoise=13, \ 665 HBHETriangleNoise=14, HBHETS4TS5Noise=15, HBHENegativeNoise=27)");
668 descriptions.
add(
"hcalnoise", desc);
678 auto result1 = std::make_unique<HcalNoiseRBXCollection>();
679 auto result2 = std::make_unique<HcalNoiseSummary>();
695 filldigis(iEvent, iSetup, rbxarray, summary);
705 HcalNoiseRBXArray::iterator maxit = rbxarray.begin();
706 double maxenergy = -999;
707 bool maxwritten =
false;
708 for (HcalNoiseRBXArray::iterator rit = rbxarray.begin(); rit != rbxarray.end(); ++rit) {
720 if (data.
energy() > maxenergy) {
721 maxenergy = data.
energy();
736 result1->push_back(rbx);
748 result1->push_back(rbx);
873 int NcalibTS45gt15 = 0;
876 double chargecalibTS45 = 0;
877 double chargecalibgt15TS45 = 0;
896 <<
" could not find HBHEDigiCollection named " <<
digiCollName_ <<
"\n.";
928 bool isBig =
false, isBig5 =
false, isRBX =
false;
933 const HcalDetId& detid = (*rit)->idFront();
934 if (
DetId(detid) == digi.
id()) {
936 isBig = isBig5 =
true;
947 for (
int ts = 0; ts < tool.
size(); ++ts) {
949 if (digi[ts].
adc() == 0) {
955 double corrfc = tool[ts] - calibrations.
pedestal(digi[ts].capid());
981 if (hCalib.
isValid() ==
true) {
983 if (digi->id().hcalSubdet() == 0)
986 for (
unsigned i = 0;
i < (unsigned)digi->size();
i++)
992 if (digi->zsMarkAndPass())
997 double sumChargeHF = 0;
1009 double sumChargeHBHE = 0;
1017 chargecalibTS45 += sumChargeHBHE;
1020 chargecalibgt15TS45 += sumChargeHBHE;
1028 float max_charge = 0;
1030 std::vector<float> comb_charge;
1034 for (
unsigned ich = 0; ich < nch; ++ich) {
1044 int ch_iphi = calibId.iphi();
1045 int ch_ieta = calibId.ieta();
1047 if (cboxch == ch_cboxch && iphi == ch_iphi && ieta == ch_ieta) {
1048 unsigned ts_size = df.samples();
1051 for (
unsigned its = 0; its < ts_size; ++its) {
1057 bool ok = df[its].ok();
1058 int adc = df[its].adc();
1067 if (ok && adc >= 0) {
1070 if (charge > max_charge) {
1075 comb_charge.push_back(charge);
1084 if (comb_charge.empty()) {
1089 int start_ts = max_ts - 3;
1090 int end_ts = max_ts + 3;
1096 if (end_ts >=
int(comb_charge.size()))
1097 end_ts = comb_charge.size() - 1;
1143 <<
" could not find HBHERecHitCollection named " <<
recHitCollName_ <<
"\n.";
1164 uint32_t recHitFlag = rechit.
flags();
1173 recHitFlag = (recHitFlag & bitset) ? recHitFlag - bitset : recHitFlag;
1182 bool isRecovered = hcalSevLvlComputer->
recoveredRecHit(
id, recHitFlag);
1191 HcalBadLaserSignal))
1201 if (rechit.
eraw() > 1.5) {
1212 if (rechit.
flags() & isolbitset) {
1216 double et = rechit.
eraw() * gp.perp() / gp.mag();
1220 if (rechit.
flags() & flatbitset) {
1224 double et = rechit.
eraw() * gp.perp() / gp.mag();
1228 if (rechit.
flags() & spikebitset) {
1232 double et = rechit.
eraw() * gp.perp() / gp.mag();
1236 if (rechit.
flags() & trianglebitset) {
1240 double et = rechit.
eraw() * gp.perp() / gp.mag();
1244 if (rechit.
flags() & ts4ts5bitset) {
1250 double et = rechit.
eraw() * gp.perp() / gp.mag();
1255 if (rechit.
flags() & negativebitset) {
1259 double et = rechit.
eraw() * gp.perp() / gp.mag();
1275 for (HcalNoiseRBXArray::iterator rbxit = array.begin(); rbxit != array.end(); ++rbxit) {
1276 for (std::vector<HcalNoiseHPD>::iterator hpdit = rbxit->hpds_.begin(); hpdit != rbxit->hpds_.end(); ++hpdit) {
1279 hpdit->refrechitset_.begin();
1280 it != hpdit->refrechitset_.end();
1282 hpdit->rechits_.push_back(*it);
1317 std::vector<std::vector<HcalNoiseHPD>::iterator> hpditervec;
1318 array.
findHPD(twr, hpditervec);
1321 for (std::vector<std::vector<HcalNoiseHPD>::iterator>::iterator it = hpditervec.begin(); it != hpditervec.end();
1323 (*it)->calotowers_.push_back(myRef);
1339 bool goodJetFoundInLowBVRegion =
false;
1348 for (reco::PFJetCollection::const_iterator
jet = pfjet_h->begin();
jet != pfjet_h->end(); ++
jet) {
1354 if (
jet->eta() > 0.0 &&
jet->eta() < 1.4 &&
jet->phi() > -1.8 &&
jet->phi() < -1.4) {
1358 goodJetFoundInLowBVRegion =
true;
1386 for (reco::TrackCollection::const_iterator iTrack = handle->begin(); iTrack != handle->end(); ++iTrack) {
double HPDEMF(void) const
double p() const
momentum vector magnitude
T getParameter(std::string const &) const
edm::RefVector< CaloTowerCollection > hlnoisetwrs_
edm::EDGetTokenT< QIE10DigiCollection > lasermondigi_token_
double lowEHitTimeSqrd(void) const
std::vector< int > calibdigiHFtimeslices_
std::vector< int > HcalRecHitFlagsToBeExcluded_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool isProblematic(const CommonHcalNoiseRBXData &) const
unsigned laserMonitorSamples_
bool passTightRatio(const CommonHcalNoiseRBXData &) const
bool zsMarkAndPass() const
was ZS MarkAndPass?
double minLowEHitTime(void) const
std::string caloTowerCollName_
bool passLooseRatio(const CommonHcalNoiseRBXData &) const
CalibDetType calibFlavor() const
get the flavor of this calibration detid
void fillrechits(edm::Event &, const edm::EventSetup &, HcalNoiseRBXArray &, HcalNoiseSummary &) const
bool passTightRBXRechitR45(const CommonHcalNoiseRBXData &) const
double maxHighEHitTime(void) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool passTightTiming(const CommonHcalNoiseRBXData &) const
double maxLowEHitTime(void) const
int numLowEHits(void) const
double energyInLaserRegion_
void produce(edm::Event &, const edm::EventSetup &) override
std::vector< std::pair< double, double > > TS4TS5LowerCut_
HcalDetId id() const
get the id
uint32_t auxPhase1() const
std::vector< float > adc2fC
std::set< edm::Ref< HBHERecHitCollection >, RefHBHERecHitEnergyComparison > refrechitset_
constexpr uint32_t rawId() const
get the raw id
std::vector< T >::const_iterator const_iterator
std::vector< float > bigCharge_
float maxE2Over10TS(void) const
edm::RefVector< CaloTowerCollection > loosenoisetwrs_
void fillcalotwrs(edm::Event &, const edm::EventSetup &, HcalNoiseRBXArray &, HcalNoiseSummary &) const
std::vector< float > big5Charge_
HcalDetId idFront() const
const Item * getValues(DetId fId, bool throwOnFail=true) const
int hitsInNonLaserRegion_
bool passLooseRBXRechitR45(const CommonHcalNoiseRBXData &) const
const_iterator end() const
Termination of iteration.
float min25GeVHitTime(void) const
std::string digiCollName_
bool passHighLevelNoiseFilter(const CommonHcalNoiseRBXData &) const
std::string trackCollName_
const_iterator begin() const
Initialize an iterator over the RefVector.
double RBXEMF(void) const
edm::RefVector< HBHERecHitCollection > rechits_
edm::EDGetTokenT< reco::PFJetCollection > jet_token_
int numRBXHits(void) const
float min10GeVHitTime(void) const
HcalNoiseRBXArray::iterator findRBX(int rbxindex)
static const unsigned OFF_TDC_TIME
double highEHitTimeSqrd(void) const
void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const override
#define DEFINE_FWK_MODULE(type)
float minE2Over10TS(void) const
double eta() const
pseudorapidity of momentum vector
bool passLooseZeros(const CommonHcalNoiseRBXData &) const
bool goodJetFoundInLowBVRegion_
~HcalNoiseInfoProducer() override
int maxRBXHits(void) const
bool passTightZeros(const CommonHcalNoiseRBXData &) const
std::vector< int > laserMonIPhiList_
double TS4TS5EnergyThreshold_
void filljetinfo(edm::Event &, const edm::EventSetup &, HcalNoiseSummary &) const
double pt() const
track transverse momentum
bool recoveredRecHit(const DetId &myid, const uint32_t &myflag) const
int numHighEHits(void) const
bool hasBadRBXRechitR45Loose_
edm::EDGetTokenT< HcalCalibDigiCollection > hcalcalibdigi_token_
std::vector< float > adc2fCHF
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
bool passRatioThreshold(const CommonHcalNoiseRBXData &) const
std::vector< HcalNoiseHPD >::iterator findHPD(int hpdindex)
bool hasBadRBXRechitR45Tight_
bool dropChannel(const uint32_t &mystatus) const
int numHPDNoOtherHits(void) const
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
edm::EDGetTokenT< HBHEDigiCollection > hbhedigi_token_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
double calibdigiHFthreshold_
bool passZerosThreshold(const CommonHcalNoiseRBXData &) const
std::vector< std::pair< double, double > > TS4TS5UpperCut_
float minHPDEMF(void) const
bool passLooseNoiseFilter(const CommonHcalNoiseRBXData &) const
edm::RefVector< CaloTowerCollection > rbxTowers(void) const
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_
bool passLooseHits(const CommonHcalNoiseRBXData &) const
constexpr double pedestal(int fCapId) const
get pedestal for capid=0..3
std::vector< int > laserMonIEtaList_
static std::string join(char **cmd)
edm::EDGetTokenT< HBHERecHitCollection > hbherechit_token_
int size() const
get the size
uint32_t HcalAcceptSeverityLevel_
void filldigis(edm::Event &, const edm::EventSetup &, HcalNoiseRBXArray &, HcalNoiseSummary &)
edm::RefVector< CaloTowerCollection > tightnoisetwrs_
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
double energy(void) const
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::GlobalCoordinateSystemTag > GlobalPoint
point in global coordinate system
bool isBitSet(unsigned int bitnumber) const
int cboxChannel() const
get the calibration box channel (if relevant)
std::vector< int > laserMonCBoxList_
bool passLooseTiming(const CommonHcalNoiseRBXData &) const
bool passTightNoiseFilter(const CommonHcalNoiseRBXData &) const
int maxHPDNoOtherHits(void) const
char data[epos_bytes_allocation]
double minHighEHitTime(void) const
static std::atomic< unsigned int > counter
double energyInNonLaserRegion_
float minRBXEMF(void) const
static const unsigned OFF_COMBINED
std::vector< int > calibdigiHBHEtimeslices_
const HcalTopology * theHcalTopology_
const HcalDetId & id() const
bool PassTS4TS5(void) const
uint32_t getValue() const
bool passEMFThreshold(const CommonHcalNoiseRBXData &) const
void filltracks(edm::Event &, const edm::EventSetup &, HcalNoiseSummary &) const
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
HcalNoiseInfoProducer(const edm::ParameterSet &)
void fillOtherSummaryVariables(HcalNoiseSummary &summary, const CommonHcalNoiseRBXData &data) const
int maxHPDHits(void) const
int numHPDHits(void) const
T const * product() const
constexpr uint32_t flags() const
std::string recHitCollName_
float max25GeVHitTime(void) const
float max10GeVHitTime(void) const
const_iterator begin() const
double calibChargegt15TS45_
bool validRatio(void) const
bool passTightHits(const CommonHcalNoiseRBXData &) const
edm::EDGetTokenT< CaloTowerCollection > calotower_token_