62 const std::vector<double>& vx,
110 const auto& offset_psets = iConfig.
getParameter<std::vector<edm::ParameterSet>>(
"offsetPlots");
111 for (
auto&
pset : offset_psets) {
115 std::vector<double> vx =
pset.getParameter<std::vector<double>>(
"vx");
116 int ny =
pset.getParameter<uint32_t>(
"ny");
117 double y0 =
pset.getParameter<
double>(
"y0");
118 double y1 =
pset.getParameter<
double>(
"y1");
124 const auto& th1d_psets = iConfig.
getParameter<std::vector<edm::ParameterSet>>(
"th1dPlots");
125 for (
auto&
pset : th1d_psets) {
129 int nx =
pset.getParameter<uint32_t>(
"nx");
130 double x0 =
pset.getParameter<
double>(
"x0");
131 double x1 =
pset.getParameter<
double>(
"x1");
138 std::vector<std::string>
pdgStrs = iConfig.
getParameter<std::vector<std::string>>(
"pdgStrs");
146 pair.second.book(booker);
149 pair.second.book(booker);
158 unsigned int nPVall = vertexHandle->size();
159 bool isGoodPV[nPVall];
160 for (
size_t i = 0;
i < nPVall; ++
i)
164 for (
unsigned int i = 0;
i < nPVall;
i++) {
165 const auto&
pv = vertexHandle->at(
i);
167 if (!
pv.isFake() &&
pv.ndof() >= 4 && fabs(
pv.z()) <= 24.0 && fabs(
pv.position().rho()) <= 2.0) {
173 int npv_in_range = npv;
174 if (npv_in_range < 0)
176 else if (npv_in_range >=
npvHigh)
183 const auto&
summary = *muHandle;
184 auto it = std::find_if(
summary.begin(),
summary.end(), [](
const auto&
s) {
return s.getBunchCrossing() == 0; });
186 if (it->getBunchCrossing() != 0) {
187 edm::LogError(
"OffsetAnalyzerDQM") <<
"Cannot find the in-time pileup info " << it->getBunchCrossing();
189 float mu = it->getTrueNumInteractions();
198 std::map<std::string, std::vector<double>> m_pftype_etaE;
200 for (
const auto& pftype :
pftypes)
201 m_pftype_etaE[pftype].assign(
nEta, 0.0);
207 for (
unsigned int i = 0,
n = pfHandle->size();
i <
n;
i++) {
208 const auto&
cand = pfHandle->at(
i);
212 if (etaIndex == -1 || pftype.empty())
215 if (pftype ==
"chm") {
216 bool attached =
false;
218 for (
unsigned int ipv = 0; ipv < nPVall && !attached; ipv++) {
219 if (isGoodPV[ipv] &&
cand.fromPV(ipv) == 3)
244 m_pftype_etaE[pftype][etaIndex] +=
cand.et();
247 for (
const auto& pair : m_pftype_etaE) {
249 std::vector<double> etaE = pair.second;
255 for (
int i = 0;
i <
nEta;
i++) {
265 for (
int i = 0;
i <
nEta;
i++) {
276 for (
int i = 0;
i <
nEta;
i++) {
void book(DQMStore::IBooker &booker) override
T getParameter(std::string const &) const
virtual void fill(float value)
edm::EDGetTokenT< edm::View< PileupSummaryInfo > > muToken
std::map< int, std::string > pdgMap
virtual void setCurrentFolder(std::string const &fullpath)
std::map< std::string, Plot1D > th1dPlots
OffsetAnalyzerDQM(const edm::ParameterSet &)
Log< level::Error, false > LogError
static std::string to_string(const XMLCh *ch)
std::vector< double > etabins
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::View< pat::PackedCandidate > > pfToken
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
int getEtaIndex(float eta)
void analyze(const edm::Event &, const edm::EventSetup &) override
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
std::string offsetPlotBaseName
std::map< std::string, PlotProfile > offsetPlots
Plot1D(const std::string &n, const std::string &t, const std::string &d, int nx, double x0, double x1)
PlotProfile(const std::string &n, const std::string &t, const std::string &d, int nx, double x0, double x1, const std::vector< double > &vx, int ny, double y0, double y1)
virtual DQM_DEPRECATED void setStatOverflows(bool value)
void fill2D(double value1, double value2)
edm::EDGetTokenT< edm::View< reco::Vertex > > pvToken
virtual void book(DQMStore::IBooker &booker)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::vector< double > xbins
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
std::vector< std::string > pftypes