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

Comparing UserCode/cbrown/Development/Plotting/Modules/ShapeLimit.C (file contents):
Revision 1.7 by buchmann, Fri Apr 27 14:07:39 2012 UTC vs.
Revision 1.10 by buchmann, Mon May 7 16:44:27 2012 UTC

# Line 55 | Line 55 | void prepare_limit_datacard(string RunDi
55   assert(Tbackground);
56   assert(Zbackground);
57  
58 ofstream datacard;
59 write_warning(__FUNCTION__,"Need to rethink systematics we want to use !");
60 datacard.open ((RunDirectory+"/susydatacard.txt").c_str());
61 datacard << "Writing this to a file.\n";
62 datacard << "imax 1\n"; // number of channels
63 datacard << "jmax 2\n"; // number of backgrounds (Z+Jets prediction and TTbar prediction)
64 datacard << "kmax *\n"; // number of nuisance parameters (sources of systematic uncertainties)
65 datacard << "---------------\n";
66 datacard << "shapes * * limitfile.root $PROCESS $PROCESS_$SYSTEMATIC\n";
67 datacard << "---------------\n";
68 datacard << "bin 1\n";
69 datacard << "observation "<<dataob->Integral()<<"\n";
70 datacard << "------------------------------\n";
71 datacard << "bin             1          1          1\n";
72 datacard << "process         signal     TTbarBackground     ZJetsBackground\n";
73 datacard << "process         0          1          2\n";
74 datacard << "rate            "<<signal->Integral()<<"         "<<Tbackground->Integral()<<"         "<<Zbackground->Integral()<<"\n";
75 datacard << "--------------------------------\n";
76 datacard << "lumi     lnN    " << 1+ PlottingSetup::lumiuncert << "       -       -    luminosity uncertainty\n"; // only affects MC -> signal!
77 datacard << "Stat   shape    -          1          -    statistical uncertainty (ttbar)\n";
78 datacard << "Stat   shape    -          -          1    statistical uncertainty (zjets)\n";
79 datacard << "Sys    shape    -          1          -    systematic uncertainty on ttbar\n";
80 datacard << "Sys    shape    -          -          1    systematic uncertainty on zjets\n";
81 datacard << "Stat   shape    1          -          -    statistical uncertainty (signal)\n";
82 datacard << "JES    shape    1          -          -    uncertainty on Jet Energy Scale\n";
83 datacard << "JSU      lnN    " << 1+uJSU << "          -          -    JZB Scale Uncertainty\n";
84 if(uPDF>0) datacard << "PDF      lnN    " << 1+uPDF << "          -          -    uncertainty from PDFs\n";
58  
59 < // datacard << "peak   shape    1          1    uncertainty on signal resolution.
60 < datacard.close();
59 > if(FullMCAnalysis) {
60 >   //dealing with MC analysis - need to use shapes.
61 >   write_warning(__FUNCTION__,"Not correctly implemented yet for MC");
62 >   ofstream datacard;
63 >   write_warning(__FUNCTION__,"Need to rethink systematics we want to use !");
64 >   datacard.open ((RunDirectory+"/susydatacard.txt").c_str());
65 >   datacard << "Writing this to a file.\n";
66 >   datacard << "imax 1\n"; // number of channels
67 >   datacard << "jmax 2\n"; // number of backgrounds (Z+Jets prediction and TTbar prediction)
68 >   datacard << "kmax *\n"; // number of nuisance parameters (sources of systematic uncertainties)
69 >   datacard << "---------------\n";
70 >   datacard << "shapes * * limitfile.root $PROCESS $PROCESS_$SYSTEMATIC\n";
71 >   datacard << "---------------\n";
72 >   datacard << "bin 1\n";
73 >   datacard << "observation "<<dataob->Integral()<<"\n";
74 >   datacard << "------------------------------\n";
75 >   datacard << "bin             1          1          1\n";
76 >   datacard << "process         signal     TTbarBackground     ZJetsBackground\n";
77 >   datacard << "process         0          1          2\n";
78 >   datacard << "rate            "<<signal->Integral()<<"         "<<Tbackground->Integral()<<"         "<<Zbackground->Integral()<<"\n";
79 >   datacard << "--------------------------------\n";
80 >   datacard << "lumi     lnN    " << 1+ PlottingSetup::lumiuncert << "       -       -    luminosity uncertainty\n"; // only affects MC -> signal!
81 >   datacard << "Stat   shape    -          1          -    statistical uncertainty (ttbar)\n";
82 >   datacard << "Stat   shape    -          -          1    statistical uncertainty (zjets)\n";
83 >   datacard << "Sys    shape    -          1          -    systematic uncertainty on ttbar\n";
84 >   datacard << "Sys    shape    -          -          1    systematic uncertainty on zjets\n";
85 >   datacard << "Stat   shape    1          -          -    statistical uncertainty (signal)\n";
86 >   datacard << "JES    shape    1          -          -    uncertainty on Jet Energy Scale\n";
87 >   datacard << "JSU      lnN    " << 1+uJSU << "          -          -    JZB Scale Uncertainty\n";
88 >   if(uPDF>0) datacard << "PDF      lnN    " << 1+uPDF << "          -          -    uncertainty from PDFs\n";
89 >   datacard.close();
90 > } else {
91 >   //doing mutibin analysis
92 >   ofstream datacard;
93 >   write_warning(__FUNCTION__,"Need to rethink systematics we want to use !");
94 >   datacard.open ((RunDirectory+"/susydatacard.txt").c_str());
95 >   datacard << "Writing this to a file.\n";
96 >   datacard << "imax " << dataob->GetNbinsX() << "\n"; // number of channels
97 >   datacard << "jmax 2\n"; // number of backgrounds (Z+Jets prediction and TTbar prediction)
98 >   datacard << "kmax *\n"; // number of nuisance parameters (sources of systematic uncertainties)
99 >   datacard << "---------------\n";
100 >   datacard << "bin\t";
101 >   for(int i=1;i<=dataob->GetNbinsX();i++) datacard << " " << dataob->GetBinLowEdge(i) << "to" << dataob->GetBinLowEdge(i)+dataob->GetBinWidth(i) << " \t";
102 >   datacard << "\n";
103 >   datacard << "observation\t";
104 >   for(int i=1;i<=dataob->GetNbinsX();i++) datacard << " " << dataob->GetBinContent(i) << " \t";
105 >   datacard<<"\n";
106 >   datacard << "------------------------------\n";
107 >   datacard << "bin\t";
108 >   for(int i=1;i<=dataob->GetNbinsX();i++) {
109 >     datacard << " " << dataob->GetBinLowEdge(i) << "to" << dataob->GetBinLowEdge(i)+dataob->GetBinWidth(i) << "\t" <<
110 >                 " " << dataob->GetBinLowEdge(i) << "to" << dataob->GetBinLowEdge(i)+dataob->GetBinWidth(i) << "\t" <<
111 >                 " " << dataob->GetBinLowEdge(i) << "to" << dataob->GetBinLowEdge(i)+dataob->GetBinWidth(i) << "\t";
112 >   }
113 >   datacard << "\n";
114 >   datacard << "process\t";
115 >   for(int i=1;i<=dataob->GetNbinsX();i++) datacard << "\t signal \t TTbarBackground \t ZJetsBackground";
116 >   datacard << "\n";
117 >   datacard << "process\t";
118 >   for(int i=1;i<=dataob->GetNbinsX();i++) datacard << "\t 0 \t 1 \t 2";
119 >   datacard << "\n";
120 >  
121 >  
122 >   datacard << "rate\t";
123 >   for(int i=1;i<=dataob->GetNbinsX();i++) datacard << "\t " << signal->GetBinContent(i) << " \t " << Tbackground->GetBinContent(i) << " \t " << Zbackground->GetBinContent(i) << "\t";
124 >   datacard<<"\n";
125 >  
126 >   datacard << "--------------------------------\n";
127 >  
128 >  
129 >   datacard << "lumi     lnN    \t";
130 >   for(int i=1;i<=dataob->GetNbinsX();i++) datacard << " " << 1+ PlottingSetup::lumiuncert << "\t - \t -";
131 >   datacard << "       luminosity uncertainty\n"; // only affects MC -> signal!
132 >  
133 >   // Statistical uncertainty
134 >   datacard << "Stat     lnN    \t";
135 >   for(int i=1;i<=dataob->GetNbinsX();i++) {
136 >     //Signal
137 >     float central = signal->GetBinContent(i);
138 >     float up      = ((TH1F*)f->Get("signal_StatDown"))->GetBinContent(i);
139 >     float down    = ((TH1F*)f->Get("signal_StatUp"))->GetBinContent(i);
140 >     float suncert=0;
141 >     if(central>0) {
142 >       if(abs(up-central)>abs(down-central)) suncert=abs(up-central)/central;
143 >       else suncert=abs(central-down)/central;
144 >     }
145 >
146 >     //TTbar
147 >     central = Tbackground->GetBinContent(i);
148 >     up      = ((TH1F*)f->Get("TTbarBackground_StatUp"))->GetBinContent(i);
149 >     down    = ((TH1F*)f->Get("TTbarBackground_StatDown"))->GetBinContent(i);
150 >     float tuncert=0;
151 >     if(central>0) {
152 >       if(abs(up-central)>abs(down-central)) tuncert=abs(up-central)/central;
153 >       else tuncert=abs(central-down)/central;
154 >     }
155 >     //ZJets
156 >     central = Zbackground->GetBinContent(i);
157 >     up      = ((TH1F*)f->Get("ZJetsBackground_StatUp"))->GetBinContent(i);
158 >     down    = ((TH1F*)f->Get("ZJetsBackground_StatDown"))->GetBinContent(i);
159 >     float zuncert=0;
160 >     if(central>0) {
161 >       if(abs(up-central)>abs(down-central)) zuncert=abs(up-central)/central;
162 >       else zuncert=abs(central-down)/central;
163 >     }
164 >     datacard << " " << 1+suncert << " \t " << 1+tuncert << "\t " << 1+zuncert << " \t ";
165 >   }
166 >  
167 >   datacard << "       statistical uncertainty\n";
168 >  
169 >   // Statistical uncertainty
170 >   datacard << "Sys     lnN    \t";
171 >   for(int i=1;i<=dataob->GetNbinsX();i++) {
172 >     float central = Tbackground->GetBinContent(i);
173 >     float up      = ((TH1F*)f->Get("TTbarBackground_SysUp"))->GetBinContent(i);
174 >     float down    = ((TH1F*)f->Get("TTbarBackground_SysDown"))->GetBinContent(i);
175 >     float tuncert=0;
176 >     if(central>0) {
177 >       if(abs(up-central)>abs(down-central)) tuncert=abs(up-central)/central;
178 >       else tuncert=abs(central-down)/central;
179 >     }
180 >     central = Zbackground->GetBinContent(i);
181 >     up      = ((TH1F*)f->Get("ZJetsBackground_SysUp"))->GetBinContent(i);
182 >     down    = ((TH1F*)f->Get("ZJetsBackground_SysDown"))->GetBinContent(i);
183 >     float zuncert=0;
184 >     if(central>0) {
185 >       if(abs(up-central)>abs(down-central)) zuncert=abs(up-central)/central;
186 >       else zuncert=abs(central-down)/central;
187 >     }
188 >     datacard << " - \t " << 1+tuncert << "\t " << 1+zuncert << " \t ";
189 >   }
190 >  
191 >   datacard << "       systematic uncertainty\n";
192 >  
193 >  
194 >   float JESup = ((TH1F*)f->Get("signal_JESUp"))->Integral();
195 >   float JESdn = ((TH1F*)f->Get("signal_JESDown"))->Integral();
196 >   float central = signal->Integral();
197 >   float uJES=0;
198 >   if(abs(JESup-central)>abs(JESdn-central)) uJES=abs(JESup-central)/central;
199 >   else uJES=abs(central-JESdn)/central;
200 >   datacard << "JES    lnN";
201 >   for(int i=1;i<=dataob->GetNbinsX();i++) datacard << " " << 1+uJES << "\t - \t  - \t";
202 >   datacard << "uncertainty on Jet Energy Scale\n";
203 >  
204 >   datacard << "JSU      lnN    ";
205 >   for(int i=1;i<=dataob->GetNbinsX();i++) datacard << " " << 1+uJSU << "\t - \t  - \t";
206 >   datacard << "JZB Scale Uncertainty\n";
207 >  
208 >   if(uPDF>0) {
209 >     datacard << "PDF      lnN    ";
210 >     for(int i=1;i<=dataob->GetNbinsX();i++) datacard << " " << 1+uPDF << "\t - \t - \t";
211 >     datacard << "uncertainty from PDFs\n";
212 >   }
213 >  
214 >   datacard.close();
215 > }
216 >  
217   }
218  
219   float QuickDrawNevents=0;
# Line 117 | Line 246 | TH1F* QuickDraw(TTree *events, string hn
246    return histo;
247   }
248  
120 /*void do_stat_up(TH1F *h, float sign=1.0) {
121  for(int i=1;i<=h->GetNbinsX();i++) {
122    h->SetBinContent(i,h->GetBinContent(i)+sign*h->GetBinError(i));
123  }
124  h->Write();
125 }
126
127 void do_stat_dn(TH1F *h) {
128  do_stat_up(h,-1.0);
129 }*/
249  
250   void SQRT(TH1F *h) {
251    for (int i=1;i<=h->GetNbinsX();i++) {
# Line 173 | Line 292 | void generate_shapes_for_systematic(bool
292    if(signalonly) {
293      dout << "Processing a signal with mcjzb: " << mcjzb << " (identifier: '" << identifier << "')" << endl;
294      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);
295      TH1F *ZOSSFN = QuickDraw(signalevents,"ZOSSFN","-"+mcjzb,binning, "JZB", "events",cutmass&&cutOSSF&&limitnJetcut&&basiccut,addcut,mc,luminosity,xsec);
296 <    TH1F *ZOSOFN = QuickDraw(signalevents,"ZOSOFN","-"+mcjzb,binning, "JZB", "events",cutmass&&cutOSOF&&limitnJetcut&&basiccut,addcut,mc,luminosity,xsec);
296 >    TH1F *ZOSOFP;
297 >    TH1F *ZOSOFN;
298 >
299 >    if(!PlottingSetup::FullMCAnalysis) {
300 >      ZOSOFP = QuickDraw(signalevents,"ZOSOFP",mcjzb,binning,     "JZB", "events",cutmass&&cutOSOF&&limitnJetcut&&basiccut,addcut,mc,luminosity,xsec);
301 >      ZOSOFN = QuickDraw(signalevents,"ZOSOFN","-"+mcjzb,binning, "JZB", "events",cutmass&&cutOSOF&&limitnJetcut&&basiccut,addcut,mc,luminosity,xsec);
302 >    }
303      
304      TH1F *SBOSSFP;
305      TH1F *SBOSOFP;
306      TH1F *SBOSSFN;
307      TH1F *SBOSOFN;
308      
309 <    if(PlottingSetup::RestrictToMassPeak) {
309 >    if(PlottingSetup::RestrictToMassPeak&&!PlottingSetup::FullMCAnalysis) {
310        SBOSSFP = QuickDraw(signalevents,"SBOSSFP",mcjzb,binning, "JZB", "events",cutOSSF&&limitnJetcut&&basiccut&&sidebandcut,addcut,mc,luminosity,xsec);
311        SBOSOFP = QuickDraw(signalevents,"SBOSOFP",mcjzb,binning, "JZB", "events",cutOSOF&&limitnJetcut&&basiccut&&sidebandcut,addcut,mc,luminosity,xsec);
312        SBOSSFN = QuickDraw(signalevents,"SBOSSFN","-"+mcjzb,binning, "JZB", "events",cutOSSF&&limitnJetcut&&basiccut&&sidebandcut,addcut,mc,luminosity,xsec);
# Line 201 | Line 325 | void generate_shapes_for_systematic(bool
325      TH1F *flippedLpred = new TH1F("flippedLpred","flippedLpred",binning.size()-1,&binning[0]);
326      
327      Lobs->Add(ZOSSFP);
328 <    Lpred->Add(ZOSSFN);
328 >    if(!PlottingSetup::FullMCAnalysis) Lpred->Add(ZOSSFN);
329      
330      dout << "SITUATION FOR SIGNAL: " << endl;
331 <    dout << " OSSF     JZB> 0 : " << ZOSSFP->Integral() << "     JZB < 0 :" << ZOSSFN->Integral() << endl;
332 <    dout << " OSOF     JZB> 0 : " << ZOSOFP->Integral() << "     JZB < 0 :" << ZOSOFN->Integral() << endl;
333 <    if(PlottingSetup::RestrictToMassPeak) {
334 <      dout << " OSSF SB  JZB> 0 : " << SBOSSFP->Integral() << "     JZB < 0 :" << SBOSSFN->Integral() << endl;
335 <      dout << " OSOF SB  JZB> 0 : " << SBOSOFP->Integral() << "     JZB < 0 :" << SBOSOFN->Integral() << endl;
331 >    
332 >    
333 >    if(PlottingSetup::FullMCAnalysis) {
334 >      dout << " OSSF     JZB> 0 : " << ZOSSFP->Integral() << endl;
335 >    } else {
336 >      dout << " OSSF     JZB> 0 : " << ZOSSFP->Integral() << "     JZB < 0 :" << ZOSSFN->Integral() << endl;
337 >      dout << " OSOF     JZB> 0 : " << ZOSOFP->Integral() << "     JZB < 0 :" << ZOSOFN->Integral() << endl;
338 >      if(PlottingSetup::RestrictToMassPeak&&!PlottingSetup::FullMCAnalysis) {
339 >        dout << " OSSF SB  JZB> 0 : " << SBOSSFP->Integral() << "     JZB < 0 :" << SBOSSFN->Integral() << endl;
340 >        dout << " OSOF SB  JZB> 0 : " << SBOSOFP->Integral() << "     JZB < 0 :" << SBOSOFN->Integral() << endl;
341 >      }
342      }
343  
344      
345      flippedLobs->Add(ZOSSFN);
346 <    flippedLpred->Add(ZOSSFP);
346 >    if(!PlottingSetup::FullMCAnalysis) flippedLpred->Add(ZOSSFP);
347      
348 <    if(PlottingSetup::RestrictToMassPeak) {
349 <      Lpred->Add(ZOSOFP,1.0/3);
350 <      Lpred->Add(ZOSOFN,-1.0/3);
351 <      Lpred->Add(SBOSSFP,1.0/3);
352 <      Lpred->Add(SBOSSFN,-1.0/3);
353 <      Lpred->Add(SBOSOFP,1.0/3);
354 <      Lpred->Add(SBOSOFN,-1.0/3);
355 <      
356 <      //flipped prediction
357 <      flippedLpred->Add(ZOSOFP,-1.0/3);
358 <      flippedLpred->Add(ZOSOFN,1.0/3);
359 <      flippedLpred->Add(SBOSSFP,-1.0/3);
360 <      flippedLpred->Add(SBOSSFN,1.0/3);
361 <      flippedLpred->Add(SBOSOFP,-1.0/3);
362 <      flippedLpred->Add(SBOSOFN,1.0/3);
363 <      
364 <    } else {
365 <      Lpred->Add(ZOSOFP,1.0);
366 <      Lpred->Add(ZOSOFN,-1.0);
367 <      
368 <      //flipped prediction
369 <      flippedLpred->Add(ZOSOFP,-1.0);
370 <      flippedLpred->Add(ZOSOFN,1.0);
348 >    if(!PlottingSetup::FullMCAnalysis) {
349 >      if(PlottingSetup::RestrictToMassPeak) {
350 >        Lpred->Add(ZOSOFP,1.0/3);
351 >        Lpred->Add(ZOSOFN,-1.0/3);
352 >        Lpred->Add(SBOSSFP,1.0/3);
353 >        Lpred->Add(SBOSSFN,-1.0/3);
354 >        Lpred->Add(SBOSOFP,1.0/3);
355 >        Lpred->Add(SBOSOFN,-1.0/3);
356 >        
357 >        //flipped prediction
358 >        flippedLpred->Add(ZOSOFP,-1.0/3);
359 >        flippedLpred->Add(ZOSOFN,1.0/3);
360 >        flippedLpred->Add(SBOSSFP,-1.0/3);
361 >        flippedLpred->Add(SBOSSFN,1.0/3);
362 >        flippedLpred->Add(SBOSOFP,-1.0/3);
363 >        flippedLpred->Add(SBOSOFN,1.0/3);
364 >      } else {
365 >        Lpred->Add(ZOSOFP,1.0);
366 >        Lpred->Add(ZOSOFN,-1.0);
367 >        
368 >        //flipped prediction
369 >        flippedLpred->Add(ZOSOFP,-1.0);
370 >        flippedLpred->Add(ZOSOFN,1.0);
371 >      }
372      }
373      
374      TH1F *signal = (TH1F*)Lobs->Clone("signal");
375 <    signal->Add(Lpred,-1);
375 >    if(!PlottingSetup::FullMCAnalysis) signal->Add(Lpred,-1);
376      signal->SetName(signalname.c_str());
377      signal->SetTitle(signalname.c_str());
378      signal->Write();
379      
380      TH1F *flippedsignal = (TH1F*)flippedLobs->Clone();
381 <    flippedsignal->Add(flippedLpred,-1);
381 >    if(!PlottingSetup::FullMCAnalysis) flippedsignal->Add(flippedLpred,-1);
382      flippedsignal->SetName(("flipped_"+signalname).c_str());
383      flippedsignal->Write();
384      
# Line 261 | Line 392 | void generate_shapes_for_systematic(bool
392        signalStatDn->SetTitle(((string)signal->GetTitle()+"_StatDown").c_str());
393        
394        for(int i=1;i<=signalStatDn->GetNbinsX();i++) {
395 <        float staterr = TMath::Sqrt(Lpred->GetBinContent(i) + Lobs->GetBinContent(i));
396 <        dout << "Stat err in bin " << i << " : " << staterr << endl;
397 <        dout << "    prediction: " << Lpred->GetBinContent(i) << " , observation: " << Lobs->GetBinContent(i) << " --> signal: " << signal->GetBinContent(i) << endl;
398 <        dout << "    we obtain : " << signal->GetBinContent(i)-staterr << " , " << signal->GetBinContent(i)+staterr << endl;
395 >        float staterr;
396 >        if(!PlottingSetup::FullMCAnalysis) staterr = TMath::Sqrt(Lpred->GetBinContent(i) + Lobs->GetBinContent(i));
397 >        else staterr = TMath::Sqrt(Lobs->GetBinContent(i));
398 >        
399 >        if(!PlottingSetup::FullMCAnalysis) {
400 >          dout << "Stat err in bin " << i << " : " << staterr << endl;
401 >          dout << "    prediction: " << Lpred->GetBinContent(i) << " , observation: " << Lobs->GetBinContent(i) << " --> signal: " << signal->GetBinContent(i) << endl;
402 >          dout << "    we obtain : " << signal->GetBinContent(i)-staterr << " , " << signal->GetBinContent(i)+staterr << endl;
403 >        }
404          if(signal->GetBinContent(i)-staterr>0) signalStatDn->SetBinContent(i,signal->GetBinContent(i)-staterr);
405          else signalStatDn->SetBinContent(i,0);
406          signalStatUp->SetBinContent(i,signal->GetBinContent(i)+staterr);
# Line 286 | Line 422 | void generate_shapes_for_systematic(bool
422        flippedsignalStatDn->SetTitle(((string)flippedsignal->GetTitle()+"_StatDown").c_str());
423        
424        for(int i=1;i<=flippedsignalStatDn->GetNbinsX();i++) {
425 <        float staterr = TMath::Sqrt(flippedLpred->GetBinContent(i) + flippedLobs->GetBinContent(i));
425 >        float staterr;
426 >        if(!PlottingSetup::FullMCAnalysis) staterr = TMath::Sqrt(flippedLpred->GetBinContent(i) + flippedLobs->GetBinContent(i));
427 >        else staterr = TMath::Sqrt(flippedLobs->GetBinContent(i));
428          if(flippedsignal->GetBinContent(i)-staterr>0) flippedsignalStatDn->SetBinContent(i,flippedsignal->GetBinContent(i)-staterr);
429          else flippedsignalStatDn->SetBinContent(i,0);
430          flippedsignalStatUp->SetBinContent(i,flippedsignal->GetBinContent(i)+staterr);
# Line 723 | Line 861 | ShapeDroplet LimitsFromShapes(bool asymp
861    bool dataonly=false;
862    
863    generate_shapes_for_systematic(signalonly,dataonly,limfile,events,"",mcjzb,datajzb,noJES,jzbbins,limcan,addcut,xsec);
726 //  generate_shapes_for_systematic(signalonly,dataonly,limfile,events,"peakUp",newjzbexpression(mcjzb,jzbpeakerrormc),newjzbexpression(datajzb,jzbpeakerrordata),noJES,jzbbins,limcan,addcut,xsec);
727 //  generate_shapes_for_systematic(signalonly,dataonly,limfile,events,"peakDown",newjzbexpression(mcjzb,-jzbpeakerrormc),newjzbexpression(datajzb,-jzbpeakerrordata),noJES,jzbbins,limcan,addcut,xsec);
864    generate_shapes_for_systematic(signalonly,dataonly,limfile,events,"JESUp",mcjzb,datajzb,JESup,jzbbins,limcan,addcut,xsec);
865    generate_shapes_for_systematic(signalonly,dataonly,limfile,events,"JESDown",mcjzb,datajzb,JESdown,jzbbins,limcan,addcut,xsec);
866    
# Line 794 | Line 930 | ShapeDroplet LimitsFromShapes(bool asymp
930    dout << "Info: Shape root file and datacard have been generated in " << RunDirectory << endl;
931    stringstream command;
932    if(asymptotic) {
933 <    if(firstGuess>0) command << "bash CreateModel.sh " << RunDirectory << " susydatacard.txt" << " 1 0 0 " << firstGuess; // ASYMPTOTIC LIMITS WITH FIRST GUESS
934 <    else command << "bash CreateModel.sh " << RunDirectory << " susydatacard.txt" << " 0 0 0 0"; // ASYMPTOTIC LIMITS
933 >    if(firstGuess>0) command << "bash " << PlottingSetup::cbafbasedir<< "/DistributedModelCalculations/ShapeLimits/CreateModel.sh " << RunDirectory << " susydatacard.txt" << " 1 0 0 " << firstGuess; // ASYMPTOTIC LIMITS WITH FIRST GUESS
934 >    else command << "bash " << PlottingSetup::cbafbasedir<< "/DistributedModelCalculations/ShapeLimits/CreateModel.sh " << RunDirectory << " susydatacard.txt" << " 0 0 0 0"; // ASYMPTOTIC LIMITS
935    }
936 <  else command << "bash CreateModel.sh " << RunDirectory << " susydatacard.txt" << " 2 0 " << int(0.5 * firstGuess) << " " << int(2*firstGuess); // ASYMPTOTIC LIMITS
936 >  else command << "bash " << PlottingSetup::cbafbasedir<< "/DistributedModelCalculations/ShapeLimits/CreateModel.sh " << RunDirectory << " susydatacard.txt" << " 2 0 " << int(0.333 * firstGuess) << " " << int(firstGuess); // ASYMPTOTIC LIMITS
937    dout <<"Going to run : " << command.str() << endl;
938    int CreatedModelFileExitCode = gSystem->Exec(command.str().c_str());
939    dout << "exit code of limit algorithm (CreateModel.sh) : " << CreatedModelFileExitCode << endl;
# Line 856 | Line 992 | void PrepareDataShapes(string datajzb, v
992    bool dataonly=true;
993    bool signalonly=false;
994    string mcjzb="JZBforMCinPrepareDataShapes";//this string is not used.
995 <  float jzbpeakerrormc=0;
995 > //  float jzbpeakerrormc=0;
996    generate_shapes_for_systematic(signalonly,dataonly,datafile,faketree,"",mcjzb,datajzb,noJES,jzbbins,limcan,"",xsec);
997    // don't need these effects for obs & pred, only for signal!
998   //  generate_shapes_for_systematic(signalonly,dataonly,datafile,faketree,"peakUp",newjzbexpression(mcjzb,jzbpeakerrormc),newjzbexpression(datajzb,jzbpeakerrordata),noJES,jzbbins,limcan,"",xsec);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines