本文整理汇总了C++中Prediction::GetLimitedRatio方法的典型用法代码示例。如果您正苦于以下问题:C++ Prediction::GetLimitedRatio方法的具体用法?C++ Prediction::GetLimitedRatio怎么用?C++ Prediction::GetLimitedRatio使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Prediction
的用法示例。
在下文中一共展示了Prediction::GetLimitedRatio方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run_DataGammaJetsZllToZnunu
void run_DataGammaJetsZllToZnunu(){
// defs ---------------------------------------------------------
gSystem->CompileMacro("../MT2Code/src/MT2Shapes.cc", "k");
// logStream
fLogStream = new std::ostringstream();
// create dir
if(!fOutDir.EndsWith("/")) fOutDir += "/";
char cmd[500];
sprintf(cmd,"mkdir -p %s", fOutDir.Data());
system(cmd);
DefineCutStreams(fHTmin, fHTmax, fMT2min, fMT2max);
TString filename=fOutDir+"/"+fRootFile;
fOutFile = new TFile(filename.Data(), "RECREATE");
fDir = (TDirectory*) fOutFile;
// fix output dir
// if(fHTmax <10000) fOutDir= TString::Format("%s_%d_HT_%d", fOutDir.Data(), abs(fHTmin), abs(fHTmax));
// else fOutDir= TString::Format("%s_%d_HT_%s", fOutDir.Data(), abs(fHTmin), "Inf");
// if(fMT2max<10000) fOutDir= TString::Format("%s_%d_MT2_%d", fOutDir.Data(), abs(fMT2min), abs(fMT2max));
// else fOutDir= TString::Format("%s_%d_MT2_%s", fOutDir.Data(), abs(fMT2min), "Inf");
// log MT2 and HT cuts
*fLogStream << "------------------------------------------------------------------------------------------------" << endl;
*fLogStream << "+++ new Znunu with Gamma+jets prediction +++" << endl;
*fLogStream << "+++ outputdir: " << fOutDir << "+++" << endl;
*fLogStream << "------------------------------------------------------------------------------------------------" << endl;
// new prediction ------------------------------------------------------
Prediction* prediction = new Prediction();
prediction->fVerbose=fVerbose;
prediction->fSave =fSaveResults;
// Photon Pt
if(fDoPhotonPtShape){
const int gNMT2bins = 11;
double gMT2bins[gNMT2bins+1] = {150, 160, 170, 180, 190, 200, 225, 250, 300, 400, 550, 800};
prediction->ChPhotonPt = new Channel("PhotonPt", "photon[0].lv.Pt()", cutStream_PhotonPt.str().c_str(), fTriggerStream.str().c_str(),fSamplesPhotonPt);
prediction->ChPhotonPt->fVerbose =prediction->fVerbose;
// prediction->ChPhotonPt->GetShapes("PhotonPt", "#gamma Pt", 2, 300, 800);
prediction->ChPhotonPt->GetShapes("PhotonPt", "#gamma Pt", 100, 150, 800);
// prediction->ChPhotonPt->GetShapes("PhotonPt", "#gamma Pt", gNMT2bins, gMT2bins);
}
// Zll Pt
if(fDoZllPtShape){
const int gNMT2bins = 11;
double gMT2bins[gNMT2bins+1] = {150, 160, 170, 180, 190, 200, 225, 250, 300, 400, 550, 800};
prediction->ChZllPt = new Channel("ZllPt", "RecoOSDiLeptPt(20,2.4,71,111)", cutStreamZll.str().c_str(), fTriggerStream.str().c_str(),fSamplesZllPt);
prediction->ChZllPt->fVerbose =prediction->fVerbose;
// prediction->ChZllPt->GetShapes("ZllPt", "Zll Pt", 2, 300, 800);
prediction->ChZllPt->GetShapes("ZllPt", "Zll Pt", 100, 150, 800);
// prediction->ChZllPt->GetShapes("ZllPt", "Zll Pt", gNMT2bins, gMT2bins);
}
// compute Zll/gamma pt ratio
if(fDoPhotonPtShape && fDoZllPtShape){
TH1D* hPhotonToZllPtRatio = prediction->GetRatio(fDoDataZllToPhotonRatio? prediction->ChZllPt->hData : prediction->ChZllPt->hZJetsToLL,
fDoDataZllToPhotonRatio? prediction->ChPhotonPt->hData : prediction->ChPhotonPt->hPhotons, 4);
DrawHisto(hPhotonToZllPtRatio,hPhotonToZllPtRatio->GetName(),"EX0");
TString rationame=hPhotonToZllPtRatio->GetName();
rationame +="_fittedRatio";
TF1 *f_lin = new TF1(rationame,"pol0(0)", fZllToGammaFitMin , fZllToGammaFitMax); f_lin->SetLineColor(8);
if(fDoFits){
hPhotonToZllPtRatio->Fit(rationame,"0L","", fZllToGammaFitMin, fZllToGammaFitMax); // set al weights to 1
fZllToPhotonRatio = f_lin->GetParameter(0);
} else{
fZllToPhotonRatio = prediction->GetLimitedRatio(fDoDataZllToPhotonRatio? prediction->ChZllPt->hData: prediction->ChZllPt->hZJetsToLL,
fDoDataZllToPhotonRatio? prediction->ChPhotonPt->hData : prediction->ChPhotonPt->hPhotons,
fZllToGammaFitMin, fZllToGammaFitMax, false, fZllToPhotonRatioRelErr);
f_lin->SetParameter(0,fZllToPhotonRatio);
}
const int nBins= 3;
const double Bins[nBins+1] = {150, fZllToGammaFitMin>150?fZllToGammaFitMin:150.0001, fZllToGammaFitMax<800? fZllToGammaFitMax:799.99, 800};
TH1D* hErrorbar = new TH1D(rationame.Data(), "", nBins, Bins);
hErrorbar->SetBinContent(2,fZllToPhotonRatio);
hErrorbar->SetBinError(2,fZllToPhotonRatioRelErr*fZllToPhotonRatio);
hErrorbar->SetBinContent(1,-10);
hErrorbar->SetBinError( 1,0);
hErrorbar->SetFillColor(5);
hErrorbar->SetFillStyle(3001);
hErrorbar->Draw("e2same");
f_lin->Draw("same");
hPhotonToZllPtRatio->Draw("EX0same");
}
// GenLevel Zll Pt, no acceptance cuts
if(fDoGenZllShape){
prediction->ChGenZllPt = new Channel("GenZllPt", "GenDiLeptPt(0,10,0,1000,true)", cutStreamGenZll.str().c_str(), fTriggerStream.str().c_str(),fSamplesZllPtMConly);
prediction->ChGenZllPt->fVerbose =prediction->fVerbose;
prediction->ChGenZllPt->GetShapes("GenZllPt", "GenZll Pt", 8, 0, 800);
}
// GenLevel Zll Pt, within acceptance
if(fDoGenAccZllShape){
prediction->ChGenZllPtAcc = new Channel("GenZllPtAcc", "GenDiLeptPt(20,2.4,71,111,true)", cutStreamGenZllAcc.str().c_str(), fTriggerStream.str().c_str(),fSamplesZllPtMConly);
//.........这里部分代码省略.........