ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/cbrown/Development/Plotting/Modules/Plotting_Functions.C
(Generate patch)

Comparing UserCode/cbrown/Development/Plotting/Modules/Plotting_Functions.C (file contents):
Revision 1.4 by buchmann, Fri Mar 2 08:37:03 2012 UTC vs.
Revision 1.8 by buchmann, Mon Mar 19 18:12:47 2012 UTC

# Line 23 | Line 23 | using namespace PlottingSetup;
23   void todo() {
24    dout << "My to do list: " << endl;
25    dout << "  - ExperimentalModule::Poisson_ratio_plot : Get the second part to work!" << endl;
26 +  dout << "  - compare_onpeak_offpeak_signal_distributions: Implement this function ... " << endl;
27    dout << "Info : The trigger requirement is currently set to " << (const char*) passtrig << endl;
28    dout << "Info : The pt requirement is currently set to " << (const char*) passtrig << endl;
29    dout << "Info : The mll requirement is currently set to " << (const char*) cutmass << endl;
# Line 483 | Line 484 | void signal_bg_comparison()
484    float simulatedlumi=luminosity;//in pb please - adjust to your likings
485    
486    TH1F *JZBplotZJETs = allsamples.Draw("JZBplotZJETs",jzbvariablemc,sbg_nbins,sbg_min,sbg_max, "JZB [GeV]", "events",cutmass&&cutOSSF&&cutnJets,mc,simulatedlumi,allsamples.FindSample("/DY"));
487 <  TH1F *JZBplotLM4 = allsamples.Draw("JZBplotLM4",jzbvariablemc,sbg_nbins,sbg_min,sbg_max, "JZB [GeV]", "events",cutmass&&cutOSSF&&cutnJets,mc,simulatedlumi,allsamples.FindSample("LM4"));
487 >  TH1F *JZBplotLM4;
488 >  if(PlottingSetup::RestrictToMassPeak) JZBplotLM4 = allsamples.Draw("JZBplotLM4",jzbvariablemc,sbg_nbins,sbg_min,sbg_max, "JZB [GeV]", "events",cutmass&&cutOSSF&&cutnJets,mc,simulatedlumi,allsamples.FindSample("LM4"));
489 >  else JZBplotLM4 = allsamples.Draw("JZBplotLM4",jzbvariablemc,sbg_nbins,sbg_min,sbg_max, "JZB [GeV]", "events",cutmass&&cutOSSF&&cutnJets,mc,simulatedlumi,allsamples.FindSample("LM3"));
490    TH1F *JZBplotTtbar = allsamples.Draw("JZBplotTtbar",jzbvariablemc,sbg_nbins,sbg_min,sbg_max, "JZB [GeV]", "events",cutmass&&cutOSSF&&cutnJets,mc,simulatedlumi,allsamples.FindSample("TTJets"));
491    
492    JZBplotTtbar->SetLineColor(allsamples.GetColor("TTJet"));
# Line 507 | Line 510 | void signal_bg_comparison()
510    TLegend *signal_bg_comparison_leg2 =  make_legend("",0.55,0.75,false);
511    signal_bg_comparison_leg2->AddEntry(JZBplotZJETs,"Z+Jets","f");
512    signal_bg_comparison_leg2->AddEntry(JZBplotTtbar,"t#bar{t}","f");
513 <  signal_bg_comparison_leg2->AddEntry(JZBplotLM4,"LM4","f");
513 >  if(PlottingSetup::RestrictToMassPeak) signal_bg_comparison_leg2->AddEntry(JZBplotLM4,"LM4","f");
514 >  else signal_bg_comparison_leg2->AddEntry(JZBplotLM4,"LM3","f");
515    signal_bg_comparison_leg2->Draw();
516    DrawMCPrelim(simulatedlumi);
517    CompleteSave(can,"jzb_bg_vs_signal_distribution");
# Line 999 | Line 1003 | void do_prediction_plot(string jzb, TCan
1003    //3rd last argument: do special bpred ratio, 2nd last argument: extended range!, last: y-axis title
1004    string ytitle("ratio");
1005    if ( use_data==1 ) ytitle = "data/pred";
1006 <  save_with_ratio(JRcorrJZBeemm,JBpred,kinpad,Bpredsaveas,true,use_data!=1,ytitle);
1006 >  //save_with_ratio(JRcorrJZBeemm,JBpred,kinpad,Bpredsaveas,true,use_data!=1,ytitle);
1007 >  save_with_ratio(JRcorrJZBeemm,JBpred,kinpad,Bpredsaveas,true,false,ytitle);//not extending the y range anymore up to 4
1008  
1009    
1010    flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak
# Line 1953 | Line 1958 | void save_template(string mcjzb, string
1958    for(int i=0;i<flippedNprederr.size();i++) configfile<<"flippedNprederr.push_back("<<flippedNprederr[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n";
1959    configfile<<"\n\n";
1960    configfile<<"luminosity="<<luminosity<<";\n";
1961 +  configfile<<"RestrictToMassPeak="<<RestrictToMassPeak<<";//defines the type of analysis we're running\n";
1962    
1963    configfile<<"\n\ncout << \"Configuration successfully loaded!\" << endl; \n \n } \n \n";
1964    
# Line 2782 | Line 2788 | void check_ptsanity() {
2788    delete ptsancan;
2789   }
2790  
2791 + void do_mlls_plot(string mcjzb) {
2792 +  cout << "At this point we'd plot the mll distribution" << endl;
2793 +  TCanvas *sigcan = new TCanvas("sigcan","sigcan");
2794 +  for(int isig=0;isig<(signalsamples.collection).size();isig++) {
2795 +    if(!(signalsamples.collection)[isig].events) continue;
2796 +    string nowname=(signalsamples.collection)[isig].filename;
2797 +    TH1F *mll = signalsamples.Draw("mllhisto","mll",150,0,150, "m_{ll}", "events",cutOSSF&&cutnJets,mc,luminosity,signalsamples.FindSample(nowname));
2798 + //    TH1F *mll = signalsamples.Draw("mllhisto","mll",150,0,150, "m_{ll}", "events","",mc,luminosity,signalsamples.FindSample(nowname));
2799 +    mll->SetLineColor(TColor::GetColor("#04B404"));
2800 +    stringstream poscutS;
2801 +    poscutS << "((" << mcjzb <<")>50)";
2802 +    TCut poscut(poscutS.str().c_str());
2803 +    TH1F *mllP = signalsamples.Draw("mllhistoP","mll",150,0,150, "m_{ll}", "events",cutOSSF&&cutnJets&&poscut,mc,luminosity,signalsamples.FindSample(nowname));
2804 +    mllP->SetLineColor(TColor::GetColor("#0040FF"));
2805 +    mll->Draw("histo");
2806 +    mllP->Draw("histo,same");
2807 +    TLegend *leg = make_legend();
2808 +    leg->SetY1(0.8);
2809 +    leg->AddEntry(mll,(signalsamples.collection)[isig].samplename.c_str(),"L");
2810 +    leg->AddEntry(mllP,((signalsamples.collection)[isig].samplename+", JZB>50").c_str(),"L");
2811 +    leg->Draw();
2812 +    TLine *lin = new TLine(71.2,0,71.2,mll->GetMaximum());
2813 +    TLine *lin2 = new TLine(111.2,0,111.2,mll->GetMaximum());
2814 +    lin->Draw("same");
2815 +    lin2->Draw("same");
2816 +    
2817 +    CompleteSave(sigcan,"MllShape/"+(signalsamples.collection)[isig].samplename);
2818 +    delete mll;
2819 +    delete mllP;
2820 +  }
2821 + }
2822 +
2823   void test() {
2824    
2825    TCanvas *testcanv = new TCanvas("testcanv","testcanv");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines