21 const std::string & tagName,
const unsigned int& mc) :
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 ( 0 ) ,
27 theDifferentialHistoB_u ( 0 ) ,
28 theDifferentialHistoB_s ( 0 ) ,
29 theDifferentialHistoB_c ( 0 ) ,
30 theDifferentialHistoB_b ( 0 ) ,
31 theDifferentialHistoB_g ( 0 ) ,
32 theDifferentialHistoB_ni ( 0 ) ,
33 theDifferentialHistoB_dus ( 0 ) ,
34 theDifferentialHistoB_dusg ( 0 ) ,
35 theDifferentialHistoB_pu ( 0 ) ,
59 bool btppColour =
true;
61 thePlotCanvas.SetFillColor ( 0 ) ;
62 thePlotCanvas.cd ( 1 ) ;
64 gPad->SetGridx ( 1 ) ;
65 gPad->SetGridy ( 1 ) ;
206 vector<float> variableRanges ;
208 for ( vector<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<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()
MonitorElement * theDifferentialHistoB_s
TH1F * getEffFlavVsBEff_dusg()
TH1F * getEffFlavVsBEff_c()
MonitorElement * theDifferentialHistoB_pu
MonitorElement * theDifferentialHistoB_dusg
std::string diffVariableName
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
std::vector< JetTagPlotter * > theBinPlotters
TH1F * getEffFlavVsBEff_dus()
TH1F * getEffFlavVsBEff_d()
MonitorElement * theDifferentialHistoB_u
TH1F * getTH1F(void) const
TH1F * getEffFlavVsBEff_ni()
MonitorElement * theDifferentialHistoB_d
TH1F * getEffFlavVsBEff_pu()
TH1F * getEffFlavVsBEff_b()
BTagDifferentialPlot(const double &bEff, const ConstVarType &constVariable, const std::string &tagName, const unsigned int &mc)
volatile std::atomic< bool > shutdown_flag false
void plot(TCanvas &theCanvas)
TH1F * getEffFlavVsBEff_s()
void epsPlot(const std::string &name)
MonitorElement * theDifferentialHistoB_c
MonitorElement * theDifferentialHistoB_ni