Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:44:50

0001 #include <utility>
0002 
0003 #include "DQMOffline/Trigger/interface/HLTTauDQMPlotter.h"
0004 
0005 #include "Math/GenVector/VectorUtil.h"
0006 
0007 HLTTauDQMPlotter::HLTTauDQMPlotter(const edm::ParameterSet& pset, std::string dqmBaseFolder)
0008     : dqmFullFolder_(std::move(dqmBaseFolder)), configValid_(false) {
0009   dqmFolder_ = pset.getUntrackedParameter<std::string>("DQMFolder");
0010   dqmFullFolder_ += "/";
0011   dqmFullFolder_ += dqmFolder_;
0012   configValid_ = true;
0013 }
0014 
0015 HLTTauDQMPlotter::HLTTauDQMPlotter(const std::string& dqmFolder, const std::string& dqmBaseFolder)
0016     : dqmFullFolder_(dqmBaseFolder + "/" + dqmFolder), dqmFolder_(dqmFolder), configValid_(true) {}
0017 
0018 HLTTauDQMPlotter::~HLTTauDQMPlotter() = default;
0019 
0020 std::pair<bool, LV> HLTTauDQMPlotter::match(const LV& jet, const LVColl& McInfo, double dr) {
0021   bool matched = false;
0022   LV out;
0023   for (auto const& it : McInfo) {
0024     double delta = ROOT::Math::VectorUtil::DeltaR(jet, it);
0025     if (delta < dr) {
0026       matched = true;
0027       out = it;
0028       break;
0029     }
0030   }
0031   return std::pair<bool, LV>(matched, out);
0032 }