LaserFlag

LaserTask

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
#ifndef LaserTask_h
#define LaserTask_h

/*
 *	file:			LaserTask.h
 *	Author:			Viktor Khristenko
 *	Date:			16.10.2015
 */

#include "DQM/HcalCommon/interface/DQTask.h"
#include "DQM/HcalCommon/interface/Utilities.h"
#include "DQM/HcalCommon/interface/ElectronicsMap.h"
#include "DQM/HcalCommon/interface/ContainerXXX.h"
#include "DQM/HcalCommon/interface/Container1D.h"
#include "DQM/HcalCommon/interface/Container2D.h"
#include "DQM/HcalCommon/interface/ContainerSingle1D.h"
#include "DQM/HcalCommon/interface/ContainerSingleProf1D.h"
#include "DQM/HcalCommon/interface/ContainerSingle2D.h"
#include "DQM/HcalCommon/interface/ContainerSingleProf2D.h"
#include "DQM/HcalCommon/interface/ContainerProf1D.h"
#include "DQM/HcalCommon/interface/ContainerProf2D.h"
#include "FWCore/Framework/interface/Run.h"

class LaserTask : public hcaldqm::DQTask {
public:
  LaserTask(edm::ParameterSet const &);
  ~LaserTask() override {}

  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
  void dqmEndRun(edm::Run const &r, edm::EventSetup const &) override {
    if (_ptype == hcaldqm::fLocal) {
      if (r.runAuxiliary().run() == 1)
        return;
      else
        this->_dump();
    }
  }
  void globalEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override;

protected:
  //	funcs
  void _process(edm::Event const &, edm::EventSetup const &) override;
  void _resetMonitors(hcaldqm::UpdateFreq) override;
  bool _isApplicable(edm::Event const &) override;
  virtual void _dump();
  void processLaserMon(edm::Handle<QIE10DigiCollection> &col, std::vector<int> &iLaserMonADC);

  //	tags and tokens
  edm::InputTag _tagQIE11;
  edm::InputTag _tagHO;
  edm::InputTag _tagQIE10;
  edm::InputTag _taguMN;
  edm::EDGetTokenT<QIE11DigiCollection> _tokQIE11;
  edm::EDGetTokenT<HODigiCollection> _tokHO;
  edm::EDGetTokenT<QIE10DigiCollection> _tokQIE10;
  edm::EDGetTokenT<HcalUMNioDigi> _tokuMN;
  edm::ESGetToken<HcalDbService, HcalDbRecord> hcalDbServiceToken_;

  enum LaserFlag { fBadTiming = 0, fMissingLaserMon = 1, nLaserFlag = 2 };
  std::vector<hcaldqm::flag::Flag> _vflags;

  //	emap
  hcaldqm::electronicsmap::ElectronicsMap _ehashmap;
  hcaldqm::filter::HashFilter _filter_uTCA;
  hcaldqm::filter::HashFilter _filter_VME;
  std::vector<uint32_t> _vhashFEDs;

  //	Cuts and variables
  int _nevents;
  double _lowHBHE;
  double _lowHE;
  double _lowHO;
  double _lowHF;
  uint32_t _laserType;

  //	Compact
  hcaldqm::ContainerXXX<double> _xSignalSum;
  hcaldqm::ContainerXXX<double> _xSignalSum2;
  hcaldqm::ContainerXXX<int> _xEntries;
  hcaldqm::ContainerXXX<double> _xTimingSum;
  hcaldqm::ContainerXXX<double> _xTimingSum2;
  hcaldqm::ContainerXXX<double> _xTimingRefLMSum;  // For computation of channel-by-channel mean timing w.r.t. lasermon
  hcaldqm::ContainerXXX<double> _xTimingRefLMSum2;
  hcaldqm::ContainerXXX<int> _xNBadTimingRefLM;  // Count channels with bad timing
  hcaldqm::ContainerXXX<int> _xNChs;             // number of channels per FED as in emap

  //	1D
  hcaldqm::Container1D _cSignalMean_Subdet;
  hcaldqm::Container1D _cSignalRMS_Subdet;
  hcaldqm::Container1D _cSignalMeanQIE1011_Subdet;
  hcaldqm::Container1D _cSignalRMSQIE1011_Subdet;
  hcaldqm::Container1D _cTimingMean_Subdet;
  hcaldqm::Container1D _cTimingRMS_Subdet;

  hcaldqm::Container1D _cADC_SubdetPM;

  //	Prof1D
  hcaldqm::ContainerProf1D _cShapeCut_FEDSlot;
  hcaldqm::ContainerProf1D _cTimingvsEvent_SubdetPM;
  hcaldqm::ContainerProf1D _cSignalvsEvent_SubdetPM;
  hcaldqm::ContainerProf1D _cTimingvsLS_SubdetPM;
  hcaldqm::ContainerProf1D _cSignalvsLS_SubdetPM;
  hcaldqm::ContainerProf1D _cSignalvsLSQIE1011_SubdetPM;
  hcaldqm::ContainerProf1D _cTimingvsBX_SubdetPM;
  hcaldqm::ContainerProf1D _cSignalvsBX_SubdetPM;
  hcaldqm::ContainerProf1D _cSignalvsBXQIE1011_SubdetPM;

  //	2D timing/signals
  hcaldqm::ContainerProf2D _cSignalMean_depth;
  hcaldqm::ContainerProf2D _cSignalRMS_depth;
  hcaldqm::ContainerProf2D _cSignalMeanQIE1011_depth;
  hcaldqm::ContainerProf2D _cSignalRMSQIE1011_depth;
  hcaldqm::ContainerProf2D _cTimingMean_depth;
  hcaldqm::ContainerProf2D _cTimingRMS_depth;

  hcaldqm::ContainerProf2D _cSignalMean_FEDuTCA;
  hcaldqm::ContainerProf2D _cTimingMean_FEDuTCA;
  hcaldqm::ContainerProf2D _cSignalRMS_FEDuTCA;
  hcaldqm::ContainerProf2D _cTimingRMS_FEDuTCA;

  //	Bad Quality and Missing Channels
  hcaldqm::Container2D _cMissing_depth;
  hcaldqm::Container2D _cMissing_FEDuTCA;

  // Things for LASERMON
  edm::InputTag _tagLaserMon;
  edm::EDGetTokenT<QIE10DigiCollection> _tokLaserMon;

  std::vector<int> _vLaserMonIPhi;  // Laser mon digis are assigned to CBox=5, IEta=0, IPhi=[23-index] by the emap
  int _laserMonIEta;
  int _laserMonCBox;
  int _laserMonDigiOverlap;
  int _laserMonTS0;
  double _laserMonThreshold;
  std::map<HcalSubdetector, std::pair<double, double>> _thresh_timingreflm;  // Min and max timing (ref. lasermon)
  double _thresh_frac_timingreflm;  // Flag threshold (BAD) on fraction of channels with bad timing
  double _thresh_min_lmsumq;        // Threshold on minimum SumQ from lasermon, if laser is expected
  int _xMissingLaserMon;            // Counter for missing lasermon events

  hcaldqm::ContainerSingle1D _cLaserMonSumQ;
  hcaldqm::ContainerSingle1D _cLaserMonTiming;
  hcaldqm::ContainerSingleProf1D _cLaserMonSumQ_LS;       // Online
  hcaldqm::ContainerSingleProf1D _cLaserMonTiming_LS;     // Online
  hcaldqm::ContainerSingleProf1D _cLaserMonSumQ_Event;    // Local
  hcaldqm::ContainerSingleProf1D _cLaserMonTiming_Event;  // Local
  hcaldqm::Container2D _cTiming_DigivsLaserMon_SubdetPM;
  hcaldqm::ContainerProf2D _cTimingDiffLS_SubdetPM;
  hcaldqm::ContainerProf2D _cTimingDiffEvent_SubdetPM;

  //	Summaries
  hcaldqm::Container2D _cSummaryvsLS_FED;
  hcaldqm::ContainerSingle2D _cSummaryvsLS;
};

#endif