|
|
Go to the documentation of this file.
61 const std::vector<double>& vx,
109 const auto& offset_psets = iConfig.
getParameter<std::vector<edm::ParameterSet>>(
"offsetPlots");
110 for (
auto&
pset : offset_psets) {
114 std::vector<double> vx =
pset.getParameter<std::vector<double>>(
"vx");
115 int ny =
pset.getParameter<uint32_t>(
"ny");
116 double y0 =
pset.getParameter<
double>(
"y0");
117 double y1 =
pset.getParameter<
double>(
"y1");
123 const auto& th1d_psets = iConfig.
getParameter<std::vector<edm::ParameterSet>>(
"th1dPlots");
124 for (
auto&
pset : th1d_psets) {
128 int nx =
pset.getParameter<uint32_t>(
"nx");
129 double x0 =
pset.getParameter<
double>(
"x0");
130 double x1 =
pset.getParameter<
double>(
"x1");
137 std::vector<std::string>
pdgStrs = iConfig.
getParameter<std::vector<std::string>>(
"pdgStrs");
145 pair.second.book(booker);
148 pair.second.book(booker);
157 unsigned int nPVall = vertexHandle->size();
158 bool isGoodPV[nPVall];
159 for (
size_t i = 0;
i < nPVall; ++
i)
163 for (
unsigned int i = 0;
i < nPVall;
i++) {
164 const auto&
pv = vertexHandle->at(
i);
166 if (!
pv.isFake() &&
pv.ndof() >= 4 && fabs(
pv.z()) <= 24.0 && fabs(
pv.position().rho()) <= 2.0) {
172 int npv_in_range = npv;
173 if (npv_in_range < 0)
175 else if (npv_in_range >=
npvHigh)
182 const auto&
summary = *muHandle;
183 auto it = std::find_if(
summary.begin(),
summary.end(), [](
const auto&
s) {
return s.getBunchCrossing() == 0; });
185 if (it->getBunchCrossing() != 0) {
186 edm::LogError(
"OffsetAnalyzerDQM") <<
"Cannot find the in-time pileup info " << it->getBunchCrossing();
188 float mu = it->getTrueNumInteractions();
197 std::map<std::string, std::vector<double>> m_pftype_etaE;
199 for (
const auto& pftype :
pftypes)
200 m_pftype_etaE[pftype].assign(
nEta, 0.0);
206 for (
unsigned int i = 0,
n = pfHandle->size();
i <
n;
i++) {
207 const auto&
cand = pfHandle->at(
i);
211 if (etaIndex == -1 || pftype.empty())
214 if (pftype ==
"chm") {
215 bool attached =
false;
217 for (
unsigned int ipv = 0; ipv < nPVall && !attached; ipv++) {
218 if (isGoodPV[ipv] &&
cand.fromPV(ipv) == 3)
243 m_pftype_etaE[pftype][etaIndex] +=
cand.et();
246 for (
const auto& pair : m_pftype_etaE) {
248 std::vector<double> etaE = pair.second;
254 for (
int i = 0;
i <
nEta;
i++) {
264 for (
int i = 0;
i <
nEta;
i++) {
275 for (
int i = 0;
i <
nEta;
i++) {
virtual void fill(float value)
std::vector< std::string > pftypes
virtual void setCurrentFolder(std::string const &fullpath)
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::View< pat::PackedCandidate > > pfToken
void analyze(const edm::Event &, const edm::EventSetup &) override
Plot1D(const std::string &n, const std::string &t, const std::string &d, int nx, double x0, double x1)
void fill2D(double value1, double value2)
std::map< int, std::string > pdgMap
#define DEFINE_FWK_MODULE(type)
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())
std::vector< double > xbins
std::vector< double > etabins
OffsetAnalyzerDQM(const edm::ParameterSet &)
Log< level::Error, false > LogError
int getEtaIndex(float eta)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
T getParameter(std::string const &) const
std::string offsetPlotBaseName
edm::EDGetTokenT< edm::View< PileupSummaryInfo > > muToken
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)
Abs< T >::type abs(const T &t)
std::map< std::string, PlotProfile > offsetPlots
void book(DQMStore::IBooker &booker) override
edm::EDGetTokenT< edm::View< reco::Vertex > > pvToken
virtual void book(DQMStore::IBooker &booker)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
std::map< std::string, Plot1D > th1dPlots