Skip to content

Commit

Permalink
Merge pull request #27104 from cms-sw/code-format-dqm-l1-9c6cd3
Browse files Browse the repository at this point in the history
Running code-format for dqm-l1
  • Loading branch information
cmsbuild committed Jun 6, 2019
2 parents ae719ce + 26aecf3 commit 4ee3906
Show file tree
Hide file tree
Showing 26 changed files with 3,574 additions and 3,245 deletions.
55 changes: 27 additions & 28 deletions DQMOffline/L1Trigger/interface/HistDefinition.h
Expand Up @@ -46,38 +46,37 @@
#include <vector>

namespace dqmoffline {
namespace l1t {
namespace l1t {

class HistDefinition;
typedef std::vector<HistDefinition> HistDefinitions;
class HistDefinition;
typedef std::vector<HistDefinition> HistDefinitions;

class HistDefinition {
public:
HistDefinition();
HistDefinition(const edm::ParameterSet &ps);
~HistDefinition();
// static HistDefinitions readHistDefinitions(const edm::ParameterSet &ps,
// std::map<std::string, unsigned int>);
class HistDefinition {
public:
HistDefinition();
HistDefinition(const edm::ParameterSet &ps);
~HistDefinition();
// static HistDefinitions readHistDefinitions(const edm::ParameterSet &ps,
// std::map<std::string, unsigned int>);

std::string name;
std::string title;
unsigned int nbinsX;
unsigned int nbinsY;
double xmin;
double xmax;
double ymin;
double ymax;
std::vector<double> binsXtmp;
std::vector<double> binsYtmp;
std::vector<float> binsX;
std::vector<float> binsY;
};
std::string name;
std::string title;
unsigned int nbinsX;
unsigned int nbinsY;
double xmin;
double xmax;
double ymin;
double ymax;
std::vector<double> binsXtmp;
std::vector<double> binsYtmp;
std::vector<float> binsX;
std::vector<float> binsY;
};

HistDefinitions
readHistDefinitions(const edm::ParameterSet &ps,
const std::map<std::string, unsigned int> &mapping);
HistDefinitions readHistDefinitions(const edm::ParameterSet &ps,
const std::map<std::string, unsigned int> &mapping);

} // end l1t
} // end dqmoffline
} // namespace l1t
} // namespace dqmoffline

#endif
16 changes: 4 additions & 12 deletions DQMOffline/L1Trigger/interface/L1TBeamConfiguration.h
Expand Up @@ -53,29 +53,21 @@

// Forward declarations



// Helper

// Class declaration


class L1TBeamConfiguration{

public:

class L1TBeamConfiguration {
public:
L1TBeamConfiguration();

bool bxConfig(unsigned iBx);

bool isValid(){return m_valid;}
bool isValid() { return m_valid; }

bool m_valid; // Bit Name for which the fit refers to
bool m_valid; // Bit Name for which the fit refers to
std::vector<bool> beam1;
std::vector<bool> beam2;

};


#endif

42 changes: 19 additions & 23 deletions DQMOffline/L1Trigger/interface/L1TCommon.h
Expand Up @@ -6,33 +6,29 @@
#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"

namespace dqmoffline {
namespace l1t {
namespace l1t {

std::vector<unsigned int>
getTriggerIndices(const std::vector<std::string> &requestedTriggers,
const std::vector<std::string> &triggersInEvent);
std::vector<unsigned int> getTriggerIndices(const std::vector<std::string> &requestedTriggers,
const std::vector<std::string> &triggersInEvent);

std::vector<bool> getTriggerResults(const std::vector<unsigned int> &triggers,
const edm::TriggerResults &triggerResults);
std::vector<bool> getTriggerResults(const std::vector<unsigned int> &triggers,
const edm::TriggerResults &triggerResults);

std::vector<unsigned int>
getFiredTriggerIndices(const std::vector<unsigned int> &triggers,
const std::vector<bool> &triggerResults);
std::vector<unsigned int> getFiredTriggerIndices(const std::vector<unsigned int> &triggers,
const std::vector<bool> &triggerResults);

bool passesAnyTriggerFromList(const std::vector<unsigned int> &triggers,
const edm::TriggerResults &triggerResults);
bool passesAnyTriggerFromList(const std::vector<unsigned int> &triggers, const edm::TriggerResults &triggerResults);

trigger::TriggerObjectCollection
getTriggerObjects(const std::vector<edm::InputTag> &hltFilters,
const trigger::TriggerEvent &triggerEvent);
trigger::TriggerObjectCollection getTriggerObjects(const std::vector<edm::InputTag> &hltFilters,
const trigger::TriggerEvent &triggerEvent);

std::vector<edm::InputTag>
getHLTFilters(const std::vector<unsigned int> &triggers,
const HLTConfigProvider &hltConfig,
const std::string triggerProcess);
std::vector<edm::InputTag> getHLTFilters(const std::vector<unsigned int> &triggers,
const HLTConfigProvider &hltConfig,
const std::string triggerProcess);

trigger::TriggerObjectCollection
getMatchedTriggerObjects(double eta, double phi, double maxDeltaR,
const trigger::TriggerObjectCollection triggerObjects);
} // l1t
} // dqmoffline
trigger::TriggerObjectCollection getMatchedTriggerObjects(double eta,
double phi,
double maxDeltaR,
const trigger::TriggerObjectCollection triggerObjects);
} // namespace l1t
} // namespace dqmoffline
63 changes: 30 additions & 33 deletions DQMOffline/L1Trigger/interface/L1TDiffHarvesting.h
Expand Up @@ -13,48 +13,45 @@
#include <vector>

namespace dqmoffline {
namespace l1t {
namespace l1t {

class L1TDiffHarvesting: public DQMEDHarvester {
class L1TDiffHarvesting : public DQMEDHarvester {
public:
L1TDiffHarvesting(const edm::ParameterSet &ps);
~L1TDiffHarvesting() override;

public:
L1TDiffHarvesting(const edm::ParameterSet& ps);
~L1TDiffHarvesting() override;
protected:
void dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) override;

protected:
private:
class L1TDiffPlotHandler {
public:
L1TDiffPlotHandler(const edm::ParameterSet &ps, std::string plotName);
L1TDiffPlotHandler(const L1TDiffPlotHandler &handler); // needed for vector collection

void dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) override;
void computeDiff(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter);

private:
class L1TDiffPlotHandler {
public:
L1TDiffPlotHandler(const edm::ParameterSet & ps, std::string plotName);
L1TDiffPlotHandler(const L1TDiffPlotHandler &handler); // needed for vector collection
std::string dir1_;
std::string dir2_;
std::string outputDir_;
std::string plotName_;

void computeDiff(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter);
MonitorElement *h1_;
MonitorElement *h2_;
MonitorElement *h_diff_;
MonitorElement::Kind histType1_, histType2_;

std::string dir1_;
std::string dir2_;
std::string outputDir_;
std::string plotName_;
void loadHistograms(DQMStore::IGetter &igetter);
bool isValid() const;
void bookDiff(DQMStore::IBooker &ibooker);
};

MonitorElement* h1_;
MonitorElement* h2_;
MonitorElement* h_diff_;
MonitorElement::Kind histType1_, histType2_;
typedef std::vector<L1TDiffPlotHandler> L1TDiffPlotHandlers;

void loadHistograms(DQMStore::IGetter &igetter);
bool isValid() const;
void bookDiff(DQMStore::IBooker &ibooker);
L1TDiffPlotHandlers plotHandlers_;
};

};

typedef std::vector<L1TDiffPlotHandler> L1TDiffPlotHandlers;

L1TDiffPlotHandlers plotHandlers_;
};

} // l1t
} // dqmoffline
} // namespace l1t
} // namespace dqmoffline

#endif
26 changes: 9 additions & 17 deletions DQMOffline/L1Trigger/interface/L1TEGammaOffline.h
Expand Up @@ -36,38 +36,31 @@
// stage2 collections:
#include "DataFormats/L1Trigger/interface/EGamma.h"

class L1TEGammaOffline: public DQMEDAnalyzer {

class L1TEGammaOffline : public DQMEDAnalyzer {
public:

L1TEGammaOffline(const edm::ParameterSet& ps);
~L1TEGammaOffline() override;

enum PlotConfig {
nVertex,
ETvsET,
PHIvsPHI
};
enum PlotConfig { nVertex, ETvsET, PHIvsPHI };

static const std::map<std::string, unsigned int> PlotConfigNames;

protected:

void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override;
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
void dqmBeginRun(edm::Run const&, edm::EventSetup const&) override;
void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
void analyze(edm::Event const& e, edm::EventSetup const& eSetup) override;
void endRun(edm::Run const& run, edm::EventSetup const& eSetup) override;
void endJob() override;

private:
bool passesLooseEleId(reco::GsfElectron const& electron) const;
bool passesMediumEleId(reco::GsfElectron const& electron) const;
void bookElectronHistos(DQMStore::IBooker &);
void bookPhotonHistos(DQMStore::IBooker &);
void bookElectronHistos(DQMStore::IBooker&);
void bookPhotonHistos(DQMStore::IBooker&);

//other functions
double Distance(const reco::Candidate & c1, const reco::Candidate & c2);
double DistancePhi(const reco::Candidate & c1, const reco::Candidate & c2);
double Distance(const reco::Candidate& c1, const reco::Candidate& c2);
double DistancePhi(const reco::Candidate& c1, const reco::Candidate& c2);
double calcDeltaPhi(double phi1, double phi2);

void fillElectrons(edm::Event const& e, const unsigned int nVertex);
Expand Down Expand Up @@ -96,7 +89,7 @@ class L1TEGammaOffline: public DQMEDAnalyzer {
std::vector<double> electronEfficiencyThresholds_;
std::vector<double> electronEfficiencyBins_;
double probeToL1Offset_;
std::vector<double>deepInspectionElectronThresholds_;
std::vector<double> deepInspectionElectronThresholds_;

std::vector<double> photonEfficiencyThresholds_;
std::vector<double> photonEfficiencyBins_;
Expand Down Expand Up @@ -195,7 +188,6 @@ class L1TEGammaOffline: public DQMEDAnalyzer {
std::map<double, MonitorElement*> h_efficiencyPhotonET_EB_total_;
std::map<double, MonitorElement*> h_efficiencyPhotonET_EE_total_;
std::map<double, MonitorElement*> h_efficiencyPhotonET_EB_EE_total_;

};

#endif

0 comments on commit 4ee3906

Please sign in to comment.