59 float ptBins[11] = {0, 1, 2, 5, 10, 20, 50, 100, 200, 400, 1000};
60 int size =
sizeof(ptBins)/
sizeof(*ptBins);
64 dptOvptPS.
n, dptOvptPS.
m, dptOvptPS.
M );
68 dptOvptPS.
n, dptOvptPS.
m, dptOvptPS.
M );
71 dptOvptPS.
n, dptOvptPS.
m, dptOvptPS.
M );
75 dptPS.
n, dptPS.
m, dptPS.
M );
79 detaPS.
n, detaPS.
m, detaPS.
M );
83 dphiPS.
n, dphiPS.
m, dphiPS.
M );
119 for (
size_t i = 0;
i <
pTRes_.size();
i++) {
129 std::vector<double> ptBinsPS = parameterSet.
getParameter< std::vector<double> >(
"VariablePtBins" );
132 for (
size_t i = 0;
i <
pTRes_.size();
i++) {
143 std::vector<float> ptBins;
144 if (ptBinsPS.size() > 1) {
145 ptBins.reserve(ptBinsPS.size());
146 for (
size_t i = 0;
i < ptBinsPS.size();
i++)
147 ptBins.push_back(ptBinsPS[
i]);
150 ptBins.reserve(nFixedBins+1);
151 for (Int_t
i = 0;
i <= nFixedBins;
i++)
153 ptBinsPS.resize(nFixedBins);
156 if (dptOvptPS.getParameter<
bool>(
"switchOn")) {
158 ptBinsPS.size()-1, &(ptBins.front()),
159 dptOvptPS.getParameter<int32_t>(
"nBin"),
160 dptOvptPS.getParameter<
double>(
"xMin"),
161 dptOvptPS.getParameter<
double>(
"xMax"));
163 if (dptOvptPS.getParameter<
bool>(
"slicingOn")) {
164 for (
size_t i = 0;
i <
pTRes_.size();
i++) {
165 pTRes_[
i] =
book1D( b, TString::Format(
"Pt%d_%d", (
int)ptBins[
i], (
int)ptBins[i+1]),
";#Deltap_{T}/p_{T};Entries",
166 dptOvptPS.getParameter<int32_t>(
"nBin"),
167 dptOvptPS.getParameter<
double>(
"xMin"),
168 dptOvptPS.getParameter<
double>(
"xMax"));
169 BRpTRes_[
i] =
book1D( b, TString::Format(
"BRPt%d_%d", (
int)ptBins[i], (
int)ptBins[i+1]),
";#Deltap_{T}/p_{T};Entries",
170 dptOvptPS.getParameter<int32_t>(
"nBin"),
171 dptOvptPS.getParameter<
double>(
"xMin"),
172 dptOvptPS.getParameter<
double>(
"xMax"));
173 ERpTRes_[
i] =
book1D( b, TString::Format(
"ERPt%d_%d", (
int)ptBins[i], (
int)ptBins[i+1]),
";#Deltap_{T}/p_{T};Entries",
174 dptOvptPS.getParameter<int32_t>(
"nBin"),
175 dptOvptPS.getParameter<
double>(
"xMin"),
176 dptOvptPS.getParameter<
double>(
"xMax"));
179 if (dptOvptPS.getParameter<
bool>(
"BROn")) {
181 ptBinsPS.size()-1, &(ptBins.front()),
182 dptOvptPS.getParameter<int32_t>(
"nBin"),
183 dptOvptPS.getParameter<
double>(
"xMin"),
184 dptOvptPS.getParameter<
double>(
"xMax"));
186 if (dptOvptPS.getParameter<
bool>(
"EROn")) {
188 ptBinsPS.size()-1, &(ptBins.front()),
189 dptOvptPS.getParameter<int32_t>(
"nBin"),
190 dptOvptPS.getParameter<
double>(
"xMin"),
191 dptOvptPS.getParameter<
double>(
"xMax"));
194 if (dptPS.getParameter<
bool>(
"switchOn")) {
196 ptBinsPS.size()-1, &(ptBins.front()),
197 dptPS.getParameter<int32_t>(
"nBin"),
198 dptPS.getParameter<
double>(
"xMin"),
199 dptPS.getParameter<
double>(
"xMax"));
202 if (detaPS.getParameter<
bool>(
"switchOn")) {
204 ptBinsPS.size()-1, &(ptBins.front()),
205 detaPS.getParameter<int32_t>(
"nBin"),
206 detaPS.getParameter<
double>(
"xMin"),
207 detaPS.getParameter<
double>(
"xMax"));
210 if (dphiPS.getParameter<
bool>(
"switchOn")) {
212 ptBinsPS.size()-1, &(ptBins.front()),
213 dphiPS.getParameter<int32_t>(
"nBin"),
214 dphiPS.getParameter<
double>(
"xMin"),
215 dphiPS.getParameter<
double>(
"xMax"));
275 if ( fabs(cand.
eta()) <= 1.4 )
277 if ( fabs(cand.
eta()) >= 1.6 && fabs(cand.
eta()) <= 2.4 )
307 std::vector<double> ptBinsPS = parameterSet.
getParameter< std::vector<double> >(
"VariablePtBins" );
309 std::vector<float> ptBins;
310 if (ptBinsPS.size() > 1) {
311 ptBins.reserve(ptBinsPS.size());
312 for (
size_t i = 0;
i < ptBinsPS.size();
i++) {
313 ptBins.push_back(ptBinsPS[
i]);
317 ptBins.reserve(nFixedBins + 1);
318 for (Int_t
i = 0;
i <= nFixedBins;
i++) {
319 ptBins.push_back( ptPS.getParameter<
double>(
"xMin") +
i*((ptPS.getParameter<
double>(
"xMax") - ptPS.getParameter<
double>(
"xMin")) / nFixedBins) );
321 ptBinsPS.resize(nFixedBins);
325 if (matchedCand.
pt() > ptBins.at(0)) {
351 for (
size_t i = 0;
i <
pTRes_.size();
i++) {
352 if (matchedCand.
pt() >= ptBins.at(
i) && matchedCand.
pt() < ptBins.at(
i+1)) {
T getParameter(std::string const &) const
TH1F * book1D(DQMStore::IBooker &b, const char *histname, const char *title, int nbins, float xmin, float xmax)
book a 1D histogram, either with DQM or plain root depending if DQM_ has been initialized in a child ...
void fillOne(const reco::Candidate &candidate, const reco::Candidate &matchedCandidate)
fill histograms with a given particle
TH2F * delta_et_Over_et_VS_et_
void setup(DQMStore::IBooker &b)
book histograms
TH2F * BRdelta_et_Over_et_VS_et_
std::vector< TH1F * > pTRes_
std::vector< TH1F * > BRpTRes_
MatchCandidateBenchmark(Mode mode)
TH2F * ERdelta_et_Over_et_VS_et_
TH2F * book2D(DQMStore::IBooker &b, const char *histname, const char *title, int nbinsx, float xmin, float xmax, int nbinsy, float ymin, float ymax)
book a 2D histogram, either with DQM or plain root depending if DQM_ has been initialized in a child ...
virtual double eta() const =0
momentum pseudorapidity
virtual double pt() const =0
transverse momentum
std::vector< TH1F * > ERpTRes_
bool isInRange(float pt, float eta, float phi) const
~MatchCandidateBenchmark() override
virtual double phi() const =0
momentum azimuthal angle
ParameterSet const & parameterSet(Provenance const &provenance)