22 fixedBEfficiency (bEff),
23 noProcessing (
false), processed(
false), constVar(constVariable),
24 constVariableName (
"") , diffVariableName (
"") ,
25 constVariableValue (999.9, 999.9), commonName(
"MisidForBEff_" + tagName+
"_"),
26 theDifferentialHistoB_d (
nullptr),
27 theDifferentialHistoB_u (
nullptr),
28 theDifferentialHistoB_s (
nullptr),
29 theDifferentialHistoB_c (
nullptr),
30 theDifferentialHistoB_b (
nullptr),
31 theDifferentialHistoB_g (
nullptr),
32 theDifferentialHistoB_ni (
nullptr),
33 theDifferentialHistoB_dus(
nullptr),
34 theDifferentialHistoB_dusg(
nullptr),
35 theDifferentialHistoB_pu (
nullptr),
59 bool btppColour =
true;
61 thePlotCanvas.SetFillColor(0);
206 vector<float> variableRanges;
208 for (vector<std::shared_ptr<JetTagPlotter>>::const_iterator iP =
theBinPlotters.begin();
210 const EtaPtBin & currentBin =(*iP)->etaPtBin();
214 variableRanges.push_back(currentBin.
getEtaMin());
222 variableRanges.push_back(currentBin.
getPtMin());
230 int nBins = variableRanges.size() - 1;
231 float * binArray = &variableRanges[0];
234 std::stringstream stream(
"");
262 for (vector<std::shared_ptr<JetTagPlotter>>::const_iterator iP =
theBinPlotters.begin();
264 const EtaPtBin & currentBin =(*iP)->etaPtBin();
267 bool isActive =
true;
268 double valueXAxis = -999.99;
278 <<
"====>>>> BTagDifferentialPlot::fillHisto() : illegal diffVariableName = " <<
diffVariableName << endl;
284 if (!isActive)
continue;
287 vector< pair<TH1F*,TH1F*> > effPurDifferentialPairs;
306 for (vector< pair<TH1F*,TH1F*> >::const_iterator itP = effPurDifferentialPairs.begin();
307 itP != effPurDifferentialPairs.end(); ++itP) {
308 TH1F * effPurHist = itP->first;
309 TH1F * diffHist = itP->second;
311 int iBinSet = diffHist->FindBin(valueXAxis);
312 diffHist->SetBinContent(iBinSet, mistag.first);
313 diffHist->SetBinError(iBinSet, mistag.second);
322 int iBinGet = effPurHist->FindBin(fixedBEfficiency);
323 double effForBEff = effPurHist->GetBinContent(iBinGet);
324 double effForBEffErr = effPurHist->GetBinError (iBinGet);
326 if (effForBEff==0. && effForBEffErr==0.) {
333 TF1 myfunc(
"myfunc",
"pol4");
335 fitStatus = effPurHist->Fit(&myfunc,
"q");
337 return pair<double, double>(effForBEff, effForBEffErr);
339 if (fitStatus != 0) {
340 edm::LogWarning(
"BTagDifferentialPlot")<<
"Fit failed to hisogram " << effPurHist->GetTitle() <<
", perhaps because too few entries = " << effPurHist->GetEntries() <<
". This bin will be missing in plots at fixed b efficiency.";
343 return pair<double, double>(effForBEff, effForBEffErr);
345 effForBEff = myfunc.Eval(fixedBEfficiency);
346 effPurHist->RecursiveRemove(&myfunc);
348 for (
int i = iBinGet+1;
i< effPurHist->GetNbinsX(); ++
i) {
349 if (effPurHist->GetBinContent(
i)!=0) {
350 effForBEffErr = effPurHist->GetBinError(
i);
356 return pair<double, double>(effForBEff, effForBEffErr);
MonitorElement * theDifferentialHistoB_b
MonitorElement * theDifferentialHistoB_g
TH1F * getEffFlavVsBEff_g()
BTagDifferentialPlot(double bEff, const ConstVarType &constVariable, const std::string &tagName, unsigned int mc)
MonitorElement * theDifferentialHistoB_s
TH1F * getEffFlavVsBEff_dusg()
TH1F * getEffFlavVsBEff_c()
MonitorElement * theDifferentialHistoB_pu
MonitorElement * theDifferentialHistoB_dusg
std::string diffVariableName
def replace(string, replacements)
std::vector< std::shared_ptr< JetTagPlotter > > theBinPlotters
void process(DQMStore::IBooker &ibook)
void psPlot(const std::string &name)
bool getEtaActive() const
Get rapidity/pt ranges and check whether rapidity/pt cuts are active.
MonitorElement * theDifferentialHistoB_dus
virtual MonitorElement * book1D(const std::string &name, const std::string &title, const int &nchX, const double &lowX, const double &highX)
TH1F * getEffFlavVsBEff_u()
void bookHisto(DQMStore::IBooker &ibook)
std::pair< double, double > getMistag(const double &fixedBEfficiency, TH1F *effPurHist)
std::string constVariableName
std::pair< double, double > constVariableValue
TH1F * getEffFlavVsBEff_dus()
TH1F * getEffFlavVsBEff_d()
MonitorElement * theDifferentialHistoB_u
def remove(d, key, TELL=False)
TH1F * getEffFlavVsBEff_ni()
MonitorElement * theDifferentialHistoB_d
TH1F * getEffFlavVsBEff_pu()
TH1F * getEffFlavVsBEff_b()
void plot(TCanvas &theCanvas)
TH1F * getEffFlavVsBEff_s()
void epsPlot(const std::string &name)
MonitorElement * theDifferentialHistoB_c
MonitorElement * theDifferentialHistoB_ni