8 double getMaxEta(
int binsEta,
double widthEta) {
10 edm::LogWarning(
"HLTTauDQMOffline") <<
"HLTTauDQML1Plotter::HLTTauDQML1Plotter: EtaHistoBinWidth = " << widthEta
11 <<
" <= 0, using default value 0.348 instead";
14 return binsEta / 2 * widthEta;
30 maxHighPt_(maxhighpt),
31 binsEt_(ps.getUntrackedParameter<int>(
"EtHistoBins", 25)),
32 binsEta_(ps.getUntrackedParameter<int>(
"EtaHistoBins", 14)),
34 maxEta_(getMaxEta(binsEta_, ps.getUntrackedParameter<double>(
"EtaHistoBinWidth", 0.348))) {
54 constexpr
float pi = 3.1416f;
55 constexpr
float phiShift = pi / 18;
56 constexpr
float minPhi = -pi + phiShift;
57 constexpr
float maxPhi = pi + phiShift;
59 constexpr
int BUFMAX = 256;
67 l1tauPhi_ = iWrapper.
book1D(iBooker,
"L1TauPhi",
"L1 #tau #phi;L1 #tau #phi;entries",
binsPhi_, minPhi, maxPhi);
70 iBooker,
"L1IsoTauEt",
"L1 isolated #tau E_{T};L1 #tau E_{T};entries",
binsEt_, 0,
maxPt_,
kVital);
74 iWrapper.
book1D(iBooker,
"L1IsoTauPhi",
"L1 isolated #tau #phi;L1 #tau #phi;entries",
binsPhi_, minPhi, maxPhi);
79 snprintf(buffer, BUFMAX,
"L1 leading #tau E_{T};L1 #tau E_{T};entries");
81 snprintf(buffer, BUFMAX,
"L1 leading #tau #eta;L1 #tau #eta;entries");
83 snprintf(buffer, BUFMAX,
"L1 leading #tau #phi;L1 #tau #phi;entries");
86 snprintf(buffer, BUFMAX,
"L1 second-leading #tau E_{T};L1 #tau E_{T};entries");
88 snprintf(buffer, BUFMAX,
"L1 second-leading #tau #eta;L1 #tau #eta;entries");
90 snprintf(buffer, BUFMAX,
"L1 second-leading #tau #phi;L1 #tau #phi;entries");
93 snprintf(buffer, BUFMAX,
"L1 leading isolated #tau E_{T};L1 #tau E_{T};entries");
95 snprintf(buffer, BUFMAX,
"L1 leading isolated #tau #eta;L1 #tau #eta;entries");
97 snprintf(buffer, BUFMAX,
"L1 leading isolated #tau #phi;L1 #tau #phi;entries");
100 snprintf(buffer, BUFMAX,
"L1 second-leading isolated #tau E_{T};L1 #tau E_{T};entries");
102 snprintf(buffer, BUFMAX,
"L1 second-leading isolated #tau #eta;L1 #tau #eta;entries");
104 snprintf(buffer, BUFMAX,
"L1 second-leading isolated #tau #phi;L1 #tau #phi;entries");
110 "L1 #tau E_{T} resolution;[L1 #tau E_{T}-Ref #tau E_{T}]/Ref #tau E_{T};entries",
118 "L1 isolated #tau E_{T} resolution;[L1 #tau E_{T}-Ref #tau E_{T}]/Ref #tau E_{T};entries",
127 iBooker,
"L1TauEtEffNum",
"L1 #tau E_{T} Efficiency;Ref #tau E_{T};entries",
binsEt_, 0,
maxPt_,
kVital);
130 "L1 #tau E_{T} Efficiency (high E_{T});Ref #tau E_{T};entries",
137 iBooker,
"L1TauEtEffDenom",
"L1 #tau E_{T} Denominator;Ref #tau E_{T};entries",
binsEt_, 0,
maxPt_,
kVital);
139 "L1TauHighEtEffDenom",
140 "L1 #tau E_{T} Denominator (high E_{T});Ref #tau E_{T};Efficiency",
149 iBooker,
"L1TauEtaEffDenom",
"L1 #tau #eta Denominator;Ref #tau #eta;entries",
binsEta_, -
maxEta_,
maxEta_);
152 iBooker,
"L1TauPhiEffNum",
"L1 #tau #phi Efficiency;Ref #tau #phi;entries",
binsPhi_, minPhi, maxPhi);
154 iBooker,
"L1TauPhiEffDenom",
"L1 #tau #phi Denominator;Ref #tau #phi;Efficiency",
binsPhi_, minPhi, maxPhi);
158 "L1 isolated #tau E_{T} Efficiency;Ref #tau E_{T};entries",
164 "L1IsoTauEtEffDenom",
165 "L1 isolated #tau E_{T} Denominator;Ref #tau E_{T};entries",
173 "L1 isolated #tau #eta Efficiency;Ref #tau #eta;entries",
178 "L1IsoTauEtaEffDenom",
179 "L1 isolated #tau #eta Denominator;Ref #tau #eta;entries",
186 "L1 isolated #tau #phi Efficiency;Ref #tau #phi;entries",
191 "L1IsoTauPhiEffDenom",
192 "L1 isolated #tau #phi Denominator;Ref #tau #phi;Efficiency",
215 for (
auto const&
tau : refC.
taus) {
234 if (!refC.
met.empty())
255 for (
auto const&
i : *taus) {
256 l1taus.push_back(
i.p4());
258 l1isotaus.push_back(
i.p4());
266 pathTaus.push_back(
i.p4());
275 pathIsoTaus.push_back(
i.p4());
279 edm::LogWarning(
"HLTTauDQMOffline") <<
"HLTTauDQML1Plotter::analyze: unable to read L1 tau collection "
285 for (
int ibx = sums->getFirstBX(); ibx <= sums->getLastBX(); ++ibx) {
286 for (
auto it = sums->begin(ibx); it != sums->end(ibx); it++) {
287 auto type =
static_cast<int>(it->getType());
295 edm::LogWarning(
"HLTTauDQMOffline") <<
"HLTTauDQML1Plotter::analyze: unable to read L1 met collection "
301 for (
auto const&
tau : refC.
taus) {
323 pathTaus.push_back(m.second);
344 pathIsoTaus.push_back(m.second);
349 for (
int ibx = sums->getFirstBX(); ibx <= sums->getLastBX(); ++ibx) {
350 for (
auto it = sums->begin(ibx); it != sums->end(ibx); it++) {
351 auto type =
static_cast<int>(it->getType());
369 if (pathTaus.size() > 1)
370 std::sort(pathTaus.begin(), pathTaus.end(), [](
const LV&
a,
const LV&
b) {
return a.pt() >
b.pt(); });
371 if (!pathTaus.empty()) {
379 if (pathTaus.size() > 1) {
387 if (pathIsoTaus.size() > 1)
388 std::sort(pathIsoTaus.begin(), pathIsoTaus.end(), [](
const LV&
a,
const LV&
b) {
return a.pt() >
b.pt(); });
389 if (!pathIsoTaus.empty()) {
397 if (pathIsoTaus.size() > 1) {
MonitorElement * secondIsoTauPhi_
T getUntrackedParameter(std::string const &, T const &) const
const double matchDeltaR_
MonitorElement * l1isotauEtEffDenom_
MonitorElement * secondTauEta_
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * l1isotauEta_
void bookHistograms(HistoWrapper &iWrapper, DQMStore::IBooker &iBooker)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * firstTauPhi_
math::XYZTLorentzVectorD LV
MonitorElement * l1etmEtEffNum_
MonitorElement * l1isotauPhiEffNum_
MonitorElement * l1isotauEt_
const std::string & triggerTag() const
MonitorElement * firstIsoTauPhi_
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup, const HLTTauDQMOfflineObjects &refC)
MonitorElement * secondIsoTauEt_
MonitorElement * firstTauEta_
MonitorElement * l1tauEt_
MonitorElement * l1isotauEtaEffDenom_
MonitorElement * l1isotauPhiEffDenom_
MonitorElement * secondTauEt_
MonitorElement * l1tauEtEffDenom_
MonitorElement * secondIsoTauEta_
const bool doRefAnalysis_
MonitorElement * l1tauEtaEffNum_
MonitorElement * firstTauEt_
MonitorElement * l1tauHighEtEffDenom_
edm::EDGetTokenT< l1t::TauBxCollection > l1stage2TausToken_
MonitorElement * l1etmEt_
edm::InputTag l1stage2Taus_
MonitorElement * l1tauEtEffNum_
MonitorElement * l1tauPhi_
MonitorElement * book1D(DQMStore::IBooker &iBooker, TString const &name, TString const &title, int const nchX, double const lowX, double const highX, int level=kEverything)
MonitorElement * l1tauEta_
MonitorElement * l1isotauPhi_
MonitorElement * l1isotauEtaEffNum_
MonitorElement * secondTauPhi_
T const * product() const
MonitorElement * l1tauPhiEffDenom_
HLTTauDQML1Plotter(const edm::ParameterSet &, edm::ConsumesCollector &&cc, int phibins, double maxpt, double maxhighpt, bool ref, double dr, const std::string &dqmBaseFolder)
MonitorElement * firstIsoTauEta_
MonitorElement * l1isotauEtEffNum_
MonitorElement * l1tauEtaEffDenom_
MonitorElement * l1tauEtRes_
Log< level::Warning, false > LogWarning
std::pair< bool, LV > match(const LV &, const LVColl &, double)
MonitorElement * l1isotauEtRes_
MonitorElement * l1etmEtEffDenom_
MonitorElement * l1etmPhi_
MonitorElement * firstIsoTauEt_
edm::InputTag l1stage2Sums_
MonitorElement * l1tauPhiEffNum_
MonitorElement * l1tauHighEtEffNum_
edm::EDGetTokenT< l1t::EtSumBxCollection > l1stage2SumsToken_