171 |
|
} |
172 |
|
|
173 |
|
if(signalonly) { |
174 |
< |
cout << "Processing a signal with mcjzb: " << mcjzb << " (identifier: '" << identifier << "')" << endl; |
174 |
> |
dout << "Processing a signal with mcjzb: " << mcjzb << " (identifier: '" << identifier << "')" << endl; |
175 |
|
TH1F *ZOSSFP = QuickDraw(signalevents,"ZOSSFP",mcjzb,binning, "JZB", "events",cutmass&&cutOSSF&&limitnJetcut&&basiccut,addcut,mc,luminosity,xsec); |
176 |
|
TH1F *ZOSOFP = QuickDraw(signalevents,"ZOSOFP",mcjzb,binning, "JZB", "events",cutmass&&cutOSOF&&limitnJetcut&&basiccut,addcut,mc,luminosity,xsec); |
177 |
|
TH1F *ZOSSFN = QuickDraw(signalevents,"ZOSSFN","-"+mcjzb,binning, "JZB", "events",cutmass&&cutOSSF&&limitnJetcut&&basiccut,addcut,mc,luminosity,xsec); |
203 |
|
Lobs->Add(ZOSSFP); |
204 |
|
Lpred->Add(ZOSSFN); |
205 |
|
|
206 |
< |
cout << "SITUATION FOR SIGNAL: " << endl; |
207 |
< |
cout << " OSSF JZB> 0 : " << ZOSSFP->Integral() << " JZB < 0 :" << ZOSSFN->Integral() << endl; |
208 |
< |
cout << " OSOF JZB> 0 : " << ZOSOFP->Integral() << " JZB < 0 :" << ZOSOFN->Integral() << endl; |
206 |
> |
dout << "SITUATION FOR SIGNAL: " << endl; |
207 |
> |
dout << " OSSF JZB> 0 : " << ZOSSFP->Integral() << " JZB < 0 :" << ZOSSFN->Integral() << endl; |
208 |
> |
dout << " OSOF JZB> 0 : " << ZOSOFP->Integral() << " JZB < 0 :" << ZOSOFN->Integral() << endl; |
209 |
|
if(PlottingSetup::RestrictToMassPeak) { |
210 |
< |
cout << " OSSF SB JZB> 0 : " << SBOSSFP->Integral() << " JZB < 0 :" << SBOSSFN->Integral() << endl; |
211 |
< |
cout << " OSOF SB JZB> 0 : " << SBOSOFP->Integral() << " JZB < 0 :" << SBOSOFN->Integral() << endl; |
210 |
> |
dout << " OSSF SB JZB> 0 : " << SBOSSFP->Integral() << " JZB < 0 :" << SBOSSFN->Integral() << endl; |
211 |
> |
dout << " OSOF SB JZB> 0 : " << SBOSOFP->Integral() << " JZB < 0 :" << SBOSOFN->Integral() << endl; |
212 |
|
} |
213 |
|
|
214 |
|
|
262 |
|
|
263 |
|
for(int i=1;i<=signalStatDn->GetNbinsX();i++) { |
264 |
|
float staterr = TMath::Sqrt(Lpred->GetBinContent(i) + Lobs->GetBinContent(i)); |
265 |
< |
cout << "Stat err in bin " << i << " : " << staterr << endl; |
266 |
< |
cout << " prediction: " << Lpred->GetBinContent(i) << " , observation: " << Lobs->GetBinContent(i) << " --> signal: " << signal->GetBinContent(i) << endl; |
267 |
< |
cout << " we obtain : " << signal->GetBinContent(i)-staterr << " , " << signal->GetBinContent(i)+staterr << endl; |
265 |
> |
dout << "Stat err in bin " << i << " : " << staterr << endl; |
266 |
> |
dout << " prediction: " << Lpred->GetBinContent(i) << " , observation: " << Lobs->GetBinContent(i) << " --> signal: " << signal->GetBinContent(i) << endl; |
267 |
> |
dout << " we obtain : " << signal->GetBinContent(i)-staterr << " , " << signal->GetBinContent(i)+staterr << endl; |
268 |
|
if(signal->GetBinContent(i)-staterr>0) signalStatDn->SetBinContent(i,signal->GetBinContent(i)-staterr); |
269 |
|
else signalStatDn->SetBinContent(i,0); |
270 |
|
signalStatUp->SetBinContent(i,signal->GetBinContent(i)+staterr); |
320 |
|
|
321 |
|
|
322 |
|
if(dataonly) { |
323 |
< |
cout << "Processing data with datajzb: " << datajzb << endl; |
323 |
> |
dout << "Processing data with datajzb: " << datajzb << endl; |
324 |
|
TH1F *ZOSSFP = allsamples.Draw("ZOSSFP",datajzb,binning, "JZB", "events",cutmass&&cutOSSF&&limitnJetcut&&basiccut,data,luminosity); |
325 |
|
TH1F *ZOSOFP = allsamples.Draw("ZOSOFP",datajzb,binning, "JZB", "events",cutmass&&cutOSOF&&limitnJetcut&&basiccut,data,luminosity); |
326 |
|
TH1F *ZOSSFN = allsamples.Draw("ZOSSFN","-"+datajzb,binning, "JZB", "events",cutmass&&cutOSSF&&limitnJetcut&&basiccut,data,luminosity); |
668 |
|
|
669 |
|
/*if(identifier=="") { |
670 |
|
for(int i=0;i<binning.size()-1;i++) { |
671 |
< |
cout << "[ " << binning[i] << " , " << binning[i+1] << "] : O " << obs->GetBinContent(i+1) << " P " << pred->GetBinContent(i+1) << " (Z: " << Zpred->GetBinContent(i+1) << " , T: " << Tpred->GetBinContent(i+1) << ")" << endl; |
671 |
> |
dout << "[ " << binning[i] << " , " << binning[i+1] << "] : O " << obs->GetBinContent(i+1) << " P " << pred->GetBinContent(i+1) << " (Z: " << Zpred->GetBinContent(i+1) << " , T: " << Tpred->GetBinContent(i+1) << ")" << endl; |
672 |
|
} |
673 |
|
}*/ |
674 |
|
delete ZOSSFP; |
700 |
|
|
701 |
|
ensure_directory_exists(RunDirectory); |
702 |
|
|
703 |
< |
TFile *datafile = new TFile("../StoredShapes.root","READ"); |
703 |
> |
TFile *datafile = new TFile((PlottingSetup::cbafbasedir+"/DistributedModelCalculations/StoredShapes.root").c_str(),"READ"); |
704 |
|
if(datafile->IsZombie()) { |
705 |
|
write_error(__FUNCTION__,"Fatal error: The stored shapes are not available!"); |
706 |
|
assert(!datafile->IsZombie()); |
707 |
|
} |
708 |
< |
cout << "Run Directory: " << RunDirectory << endl; |
708 |
> |
dout << "Run Directory: " << RunDirectory << endl; |
709 |
|
TFile *limfile = new TFile((RunDirectory+"/PRElimitfile.root").c_str(),"RECREATE"); |
710 |
|
|
711 |
|
TIter nextkey(datafile->GetListOfKeys()); |
800 |
|
else command << "bash CreateModel.sh " << RunDirectory << " susydatacard.txt" << " 2 0 " << int(0.5 * firstGuess) << " " << int(2*firstGuess); // ASYMPTOTIC LIMITS |
801 |
|
dout <<"Going to run : " << command.str() << endl; |
802 |
|
int CreatedModelFileExitCode = gSystem->Exec(command.str().c_str()); |
803 |
< |
cout << "exit code of limit algorithm (CreateModel.sh) : " << CreatedModelFileExitCode << endl; |
803 |
> |
dout << "exit code of limit algorithm (CreateModel.sh) : " << CreatedModelFileExitCode << endl; |
804 |
|
if(!(CreatedModelFileExitCode==0)) { |
805 |
|
write_warning(__FUNCTION__,"Something bad happened. It looks like a shape analysis is not the way to go. "); |
806 |
|
ShapeDroplet alpha; |
817 |
|
dout << alpha << endl; |
818 |
|
|
819 |
|
dout << "Everything is saved in " << RunDirectory << endl; |
820 |
< |
dout << "Will transfer model and datacard over for possible post-processing" << endl; |
821 |
< |
dout << " 1) Make sure models directory exists ... " << std::flush; |
820 |
> |
dout << "Cleaning up ... " << std::flush; |
821 |
> |
/* dout << " 1) Make sure models directory exists ... " << std::flush; |
822 |
|
gSystem->Exec("mkdir -p models/"); |
823 |
|
dout << " ok!" << endl; |
824 |
|
dout << " 2) Deleting any previous model files with the same name ... " << std::flush; |
840 |
|
copycommand3 << "cp " << RunDirectory << "/limitfile.root models/model_" << name << "_histo.root"; |
841 |
|
gSystem->Exec(copycommand3.str().c_str()); |
842 |
|
dout << " ok!" << endl; |
843 |
< |
dout << " 4) Removing original working directory (" << RunDirectory << ") ... " << std::flush; |
844 |
< |
write_warning(__FUNCTION__,"Watch out : need to uncomment the line below to remove the original working directory again"); |
845 |
< |
// gSystem->Exec(("rm -r "+RunDirectory).c_str()); |
843 |
> |
dout << " 4) Removing original working directory (" << RunDirectory << ") ... " << std::flush;*/ |
844 |
> |
gSystem->Exec(("rm -r "+RunDirectory).c_str()); |
845 |
|
dout << " ok!" << endl; |
846 |
|
delete limcan; |
847 |
|
return alpha; |