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

Comparing UserCode/cbrown/AnalysisFramework/Plotting/Modules/SUSYScan.C (file contents):
Revision 1.34 by buchmann, Mon Sep 12 19:06:15 2011 UTC vs.
Revision 1.35 by buchmann, Tue Sep 13 09:18:42 2011 UTC

# Line 39 | Line 39 | struct limit_args {
39    string mcjzb;
40    vector<float> sigmas;
41    string plotfilename;
42 < };
42 > };
43  
44   void* compute_one_upper_limit_wrapper(void* data) {
45    isThreadActive=true;
# Line 79 | Line 79 | void do_limit_wrapper(float mceff,float
79   void prepare_scan_axis(TH2 *variablemap,bool ismSUGRA) {
80    variablemap->GetXaxis()->SetTitle("m_{glu}");
81    variablemap->GetYaxis()->SetTitle("m_{LSP}");
82 <  
82 >
83    if(ismSUGRA) {
84      variablemap->GetXaxis()->SetTitle("m_{0}");
85      variablemap->GetYaxis()->SetTitle("m_{1/2}");
86    }
87 <  
87 >
88    variablemap->GetXaxis()->CenterTitle();
89    variablemap->GetYaxis()->CenterTitle();
90   }
# Line 97 | Line 97 | void set_SUSY_style() {
97    Double_t stop[] = {0., .25, .50, .75, 1.0};
98    Int_t FI = TColor::CreateGradientColorTable(5, stop, r, g, b, 110);
99    for (int i=0;i<100;i++) MyPalette[i] = FI+i;
100  
101  gStyle->SetPalette(100, MyPalette);
100    
101 +  gStyle->SetPalette(100, MyPalette);
102 +
103    float rightmargin=gStyle->GetPadRightMargin();
104    gStyle->SetPadRightMargin(0.15);
105  
106   }
107  
108 + float get_xs(float mglu, float mlsp, string massgluname, string massLSPname, map <  pair<float, float>, map<string, float>  >  &xsec, string mcjzb, bool requireZ)  {
109 +  float weightedpointxs=0;
110 +  stringstream addcut;
111 +  addcut << "(TMath::Abs("<<massgluname<<"-"<<mglu<<")<5)&&(TMath::Abs("<<massLSPname<<"-"<<mlsp<<")<5)";
112 +  cout << "About to calculate the process efficiencies " << endl;
113 +  for(int iproc=1;iproc<=10;iproc++) {
114 +    float process_xs = GetXSecForPointAndChannel(mglu,mlsp,xsec,iproc);
115 +    stringstream addcutplus;
116 +    addcutplus<<addcut.str()<<"&&(pfJetGoodNum=="<<iproc<<")";
117 +    write_warning(__FUNCTION__,"replaced process with pfJetGoodNum for testing purposes only!");
118 +    (scansample.collection)[0].events->Draw("eventNum",addcutplus.str().c_str(),"goff");
119 +    float nprocessevents = (scansample.collection)[0].events->GetSelectedRows();
120 +    float nselectedprocessevents,nselectedprocesseventserr;
121 +    cout << "nprocessevents = " << nprocessevents << endl;
122 +    MCefficiency((scansample.collection)[0].events,nselectedprocessevents,nselectedprocesseventserr,mcjzb,requireZ,1,addcutplus.str(),-1);//1 is the number to normalize to :-)
123 +    float weight=0;
124 +    if(nprocessevents>0) weight=(process_xs)/(nprocessevents);//*luminosity;
125 +    weightedpointxs+=weight*nselectedprocessevents;
126 + //    */
127 +  }
128 +  return weightedpointxs;
129 + }
130 +
131   void establish_SUSY_limits(string mcjzb,string datajzb,vector<float> jzb_cut,bool requireZ, float peakerror, TFile *fsyst, int ibin,float njobs=-1, float jobnumber=-1) {
132    bool runninglocally=true;
133    if(njobs>-1&&jobnumber>-1) {
# Line 114 | Line 137 | void establish_SUSY_limits(string mcjzb,
137      dout << "Running locally " << endl;
138      dout << "This will take a really, really long time - if  you want to see the results THIS week try running the LimitWorkerScript on the grid (DistributedModelCalculation/Limits/)" << endl;
139    }
140 <  
140 >
141    string massgluname="MassGlu";
142    string massLSPname="MassLSP";
143 <  
143 >
144    string prefix="SMS_";
145    // up to here, everything is set up for SMS; now we need to switch stuff around if we're dealing with an mSUGRA scan!
146    bool ismSUGRA=false;
# Line 128 | Line 151 | void establish_SUSY_limits(string mcjzb,
151        TObject *obj = key->ReadObj();
152        if(Contains((string)(obj->GetName()),"mSUGRA")) ismSUGRA=true;
153      }
154 +  
155 +    map <  pair<float, float>, map<string, float>  >  xsec;
156  
157    if(ismSUGRA) {
158      massgluname="M0"; // this is the "x axis" in the limit plot (like the gluino in the SMS case)
159      massLSPname="M12"; // this is the "y axis" in the limit plot (like the LSP in the SMS case)
160      mglustart=m0start;
161 +    xsec=getXsec("/scratch/buchmann/C/scale_xsection_nlo1.0_m0_m12_10_0_1v1.txt");
162 +      write_warning(__FUNCTION__,"Don't have the correct XS file yet");
163      mgluend=m0end;
164      mglustep=m0step;
165      mLSPstart=m12start;
# Line 142 | Line 169 | void establish_SUSY_limits(string mcjzb,
169      cout << "mSUGRA scan has been set up." << endl;
170    } else {
171      cout << "SMS scan has been set up." << endl;
172 +      write_warning(__FUNCTION__,"Don't have the correct XS file yet");
173 +    xsec=getXsec("/scratch/buchmann/C/scale_xsection_nlo1.0_m0_m12_10_0_1v1.txt");
174    }
175 <  
175 >
176    set_SUSY_style();
177 <  
177 >
178    TCanvas *limcanvas = new TCanvas("limcanvas","Limit canvas");
179 <  
179 >
180    int Npoints=0;
181    for(int mglu=mglustart;mglu<=mgluend;mglu+=mglustep) {
182      for (int mlsp=mLSPstart;mlsp<=mLSPend&&mlsp<=mglu;mlsp+=mLSPstep) Npoints++;
183    }
155  
184   //  TH2F *mceff     = (TH2F*)fsyst->Get((prefix+"efficiencymap"+any2string(jzb_cut[ibin])).c_str());
185   write_warning(__FUNCTION__,"Currently the efficiencymap name was switched to Pablo's convention. This NEEDS to be switched BACK!");TH2F *mceff     = (TH2F*)fsyst->Get(("efficiency_jzbdiff"+any2string(jzb_cut[ibin])).c_str());
186    TH2F *fullerr   = (TH2F*)fsyst->Get((prefix+"systotmap"+any2string(jzb_cut[ibin])).c_str());
187    TH2F *NEvents   = (TH2F*)fsyst->Get((prefix+"Neventsmap"+any2string(jzb_cut[ibin])).c_str());
188 <  
188 >
189    TH2F *limitmap  = new TH2F((prefix+"limitmap"+any2string(jzb_cut[ibin])).c_str(), "",(mgluend-mglustart)/mglustep+1,mglustart-0.5*mglustep,mgluend+0.5*mglustep,(mLSPend-mLSPstart)/mLSPstep+1,mLSPstart-0.5*mLSPstep,mLSPend+0.5*mLSPstep);
190    TH2F *exclmap  = new TH2F((prefix+"exclusionmap"+any2string(jzb_cut[ibin])).c_str(), "",(mgluend-mglustart)/mglustep+1,mglustart-0.5*mglustep,mgluend+0.5*mglustep,(mLSPend-mLSPstart)/mLSPstep+1,mLSPstart-0.5*mLSPstep,mLSPend+0.5*mLSPstep);
191    TH2F *xsmap  = new TH2F((prefix+"crosssectionmap"+any2string(jzb_cut[ibin])).c_str(), "",(mgluend-mglustart)/mglustep+1,mglustart-0.5*mglustep,mgluend+0.5*mglustep,(mLSPend-mLSPstart)/mLSPstep+1,mLSPstart-0.5*mLSPstep,mLSPend+0.5*mLSPstep);
192 <    
192 >  
193    if(!fullerr || !mceff || !NEvents) {
194      write_error(__FUNCTION__,"The supplied systematics file did not contain the correct histograms - please check the file");
195      dout << "mc eff address: " << mceff << " , error address: " << fullerr << " , NEvents address: " << NEvents << endl;
196      delete limcanvas;
197      return;
198    }
199 <  
199 >
200    int ipoint=-1;
201    for(int mglu=mglustart;mglu<=mgluend;mglu+=mglustep) {
202      for (int mlsp=mLSPstart;mlsp<=mLSPend&&mlsp<=mglu;mlsp+=mLSPstep)
# Line 179 | Line 207 | write_warning(__FUNCTION__,"Currently th
207        float currtoterr=(fullerr->GetBinContent(fullerr->FindBin(mglu,mlsp)))*currmceff;
208        float nevents=NEvents->GetBinContent(NEvents->FindBin(mglu,mlsp));
209        dout << "Looking at point " << ipoint << " / " << Npoints << " with masses " << massgluname << " = " << mglu << " and " << massLSPname << " = " << mlsp << endl;
210 <      dout << "Found : systerr=" << currtoterr << " and eff=" << currmceff << " and nevents=" << nevents << endl;
210 >      dout << "Found : MCeff=" << currmceff << " and total error=" << currtoterr << " and Nevents=" << nevents << endl;
211        string plotfilename=(string)(TString(massgluname)+TString(any2string(mglu))+TString("__")+TString(massLSPname)+TString(any2string(mlsp))+TString(".png"));
212        if(currmceff<=0||currtoterr<=0||nevents==0) {
213          dout << "   Nothing to work with, skipping this point." << endl;
# Line 189 | Line 217 | write_warning(__FUNCTION__,"Currently th
217        //do_limit_wrapper(currmceff,currtoterr,ibin,mcjzb,sigmas,plotfilename); // no threading right now.
218        sigmas=compute_one_upper_limit(currmceff,currtoterr,ibin,mcjzb,plotfilename,true);
219        if(sigmas[0]>0) limitmap->Fill(mglu,mlsp,sigmas[0]); //anything else is an error code
220 <      dout << "An upper limit has been added for this point ( " << massgluname << " = " << mglu << " and " << massLSPname << " = " << mlsp << " )at " << sigmas[0] << endl;
221 <      if(ismSUGRA) {
222 <        dout << "Computing XS" << endl;
223 <        float rel_limit=0;
224 <        float xs=-1;
225 <        stringstream addcut;
226 <        addcut << "(TMath::Abs("<<massgluname<<"-"<<mglu<<")<5)&&(TMath::Abs("<<massLSPname<<"-"<<mlsp<<")<5)";
227 <
228 <        vector<float> xs_weights = processMCefficiency((scansample.collection)[0].events,mcjzb,requireZ,nevents, addcut.str());
229 <        
230 <        exclmap->Fill(mglu,mlsp,rel_limit);
203 <        xsmap->Fill(mglu,mlsp,xs);
220 >      dout << "An upper limit has been added for this point ( " << massgluname << " = " << mglu << " and " << massLSPname << " = " << mlsp << " ) at " << sigmas[0] << endl;
221 >      if(1) {
222 >          dout << "Computing exclusion status" << endl;
223 >          float rel_limit=0;
224 >          float xs=get_xs(mglu,mlsp,massgluname,massLSPname,xsec,mcjzb,requireZ);
225 >          if(xs>0) rel_limit=sigmas[0]/xs;
226 > //          stringstream addcut;
227 > //          addcut << "(TMath::Abs("<<massgluname<<"-"<<mglu<<")<5)&&(TMath::Abs("<<massLSPname<<"-"<<mlsp<<")<5)";
228 > //          vector<float> xs_weights = processMCefficiency((scansample.collection)[0].events,mcjzb,requireZ,nevents, addcut.str());
229 >          exclmap->Fill(mglu,mlsp,rel_limit);
230 >          xsmap->Fill(mglu,mlsp,xs);
231        }
205        
232      }
233    }
234 <  
234 >
235    prepare_scan_axis(limitmap,ismSUGRA);
236    TFile *outputfile=new TFile(("output/DistributedLimitsFromSystematics_job"+string(any2string(jobnumber))+"_of_"+string(any2string(njobs))+".root").c_str(),"UPDATE");//needs to be "UPDATE" as we can get to this point for different JZB cuts and don't want to erase the previous data :-)
237    outputfile->cd();
# Line 242 | Line 268 | void scan_SUSY_parameter_space(string mc
268      dout << "Running locally " << endl;
269      dout << "This will take a really, really long time - if  you want to see the results THIS week try running the LimitWorkerScript on the grid (DistributedModelCalculation/Limits/)" << endl;
270    }
271 <  
271 >
272   cout << "FILE USED: " << (scansample.collection)[0].filename << endl;
273   cout << "FILE USED (name): " << (scansample.collection)[0].samplename << endl;
274    jzbSel=jzb_cut[ibin];
275    geqleq="geq";
276    automatized=true;
277    mcjzbexpression=mcjzb;
278 <  
278 >
279    string massgluname="MassGlu";
280    string massLSPname="MassLSP";
281 <  
281 >
282    string prefix="SMS_";
283    // up to here, everything is set up for SMS; now we need to switch stuff around if we're dealing with an mSUGRA scan!
284    bool ismSUGRA=false;
# Line 271 | Line 297 | cout << "FILE USED (name): " << (scansam
297    } else {
298      cout << "SMS scan has been set up." << endl;
299   }
300 <  
300 >
301    Int_t MyPalette[100];
302    Double_t r[]    = {0., 0.0, 1.0, 1.0, 1.0};
303    Double_t g[]    = {0., 0.0, 0.0, 1.0, 1.0};
# Line 279 | Line 305 | cout << "FILE USED (name): " << (scansam
305    Double_t stop[] = {0., .25, .50, .75, 1.0};
306    Int_t FI = TColor::CreateGradientColorTable(5, stop, r, g, b, 110);
307    for (int i=0;i<100;i++) MyPalette[i] = FI+i;
282  
283  gStyle->SetPalette(100, MyPalette);
308    
309 +  gStyle->SetPalette(100, MyPalette);
310 +
311    TH2F *limitmap  = new TH2F((prefix+"limitmap"+any2string(jzbSel)).c_str(), "",(mgluend-mglustart)/mglustep+1,mglustart-0.5*mglustep,mgluend+0.5*mglustep,(mLSPend-mLSPstart)/mLSPstep+1,mLSPstart-0.5*mLSPstep,mLSPend+0.5*mLSPstep);
312    TH2F *exclmap  = new TH2F((prefix+"exclusionmap"+any2string(jzbSel)).c_str(), "",(mgluend-mglustart)/mglustep+1,mglustart-0.5*mglustep,mgluend+0.5*mglustep,(mLSPend-mLSPstart)/mLSPstep+1,mLSPstart-0.5*mLSPstep,mLSPend+0.5*mLSPstep);
313    TH2F *sysjesmap = new TH2F((prefix+"sysjes"+any2string(jzbSel)).c_str(),   "",(mgluend-mglustart)/mglustep+1,mglustart-0.5*mglustep,mgluend+0.5*mglustep,(mLSPend-mLSPstart)/mLSPstep+1,mLSPstart-0.5*mLSPstep,mLSPend+0.5*mLSPstep);
# Line 294 | Line 320 | cout << "FILE USED (name): " << (scansam
320    TH2F *systotmap = new TH2F((prefix+"systotmap"+any2string(jzbSel)).c_str(),"",(mgluend-mglustart)/mglustep+1,mglustart-0.5*mglustep,mgluend+0.5*mglustep,(mLSPend-mLSPstart)/mLSPstep+1,mLSPstart-0.5*mLSPstep,mLSPend+0.5*mLSPstep);
321    TH2F *sysstatmap = new TH2F((prefix+"sysstatmap"+any2string(jzbSel)).c_str(),"",(mgluend-mglustart)/mglustep+1,mglustart-0.5*mglustep,mgluend+0.5*mglustep,(mLSPend-mLSPstart)/mLSPstep+1,mLSPstart-0.5*mLSPstep,mLSPend+0.5*mLSPstep);
322  
323 <  
324 <  
323 >
324 >
325   write_warning(__FUNCTION__,"CURRENTLY SWITCHING AUTOMATIZED MODE OFF!");automatized=false;
326 <  
326 >
327    float rightmargin=gStyle->GetPadRightMargin();
328    gStyle->SetPadRightMargin(0.15);
329 <  
329 >
330    TCanvas *limcanvas = new TCanvas("limcanvas","Limit canvas");
331 <  
331 >
332    int Npoints=0;
333    for(int mglu=mglustart;mglu<=mgluend;mglu+=mglustep) {
334      for (int mlsp=mLSPstart;mlsp<=mLSPend&&mlsp<=mglu;mlsp+=mLSPstep) Npoints++;
335    }
336 <  
336 >
337    int ipoint=-1;
338    for(int mglu=mglustart;mglu<=mgluend;mglu+=mglustep) {
339      for (int mlsp=mLSPstart;mlsp<=mLSPend&&mlsp<=mglu;mlsp+=mLSPstep)
# Line 321 | Line 347 | write_warning(__FUNCTION__,"CURRENTLY SW
347        float nevents = (scansample.collection)[0].events->GetSelectedRows();
348        vector<vector<float> > systematics;
349        if(nevents<10) {
350 <        dout << "This point ("<<ipoint<<") with configuration ("<<massgluname<<"="<<mglu<<" , "<<massLSPname<<"="<<mlsp << ") does not contain enough events and will be skipped."<< endl;
351 <        continue;
350 >    dout << "This point ("<<ipoint<<") with configuration ("<<massgluname<<"="<<mglu<<" , "<<massLSPname<<"="<<mlsp << ") does not contain enough events and will be skipped."<< endl;
351 >    continue;
352        } else {
353 <        dout << "OK! This point ("<<ipoint<<") with configuration ("<<massgluname<<"="<<mglu<<" , "<<massLSPname<<"="<<mlsp << ") contains " << nevents << " and will therefore not be skipped."<< endl;
353 >    dout << "OK! This point ("<<ipoint<<") with configuration ("<<massgluname<<"="<<mglu<<" , "<<massLSPname<<"="<<mlsp << ") contains " << nevents << " and will therefore not be skipped."<< endl;
354        }
355        if(nevents!=0&&efficiencyonly) {
356 <        MCefficiency((scansample.collection)[0].events,result,resulterr,mcjzb,requireZ,nevents,addcut.str(),-1);
357 <        efficiencymap->Fill(mglu,mlsp,result);
356 >    MCefficiency((scansample.collection)[0].events,result,resulterr,mcjzb,requireZ,nevents,addcut.str(),-1);
357 >    efficiencymap->Fill(mglu,mlsp,result);
358        }
359        Neventsmap->Fill(mglu,mlsp,nevents);
360        ipointmap->Fill(mglu,mlsp,ipoint);
# Line 346 | Line 372 | write_warning(__FUNCTION__,"CURRENTLY SW
372        if(systematics[0].size()>9) sys_pdf = systematics[0][9]; // PDF
373        efficiencymap->Fill(mglu,mlsp,mceff);
374        efficiencymap->SetBinError(efficiencymap->FindBin(mglu,mlsp),mcefferr);//blublu
375 <      
375 >    
376        if(mceff!=mceff||toterr!=toterr||mceff<0) {
377 <        dout << "Limits can't be calculated for this configuration (mglu="<<mglu<<" , mlsp="<<mlsp << ") as either the efficiency or its error are not positive numbers! (mceff="<<mceff<<" and toterr="<<toterr<<")"<< endl;
378 <        continue;
377 >    dout << "Limits can't be calculated for this configuration (mglu="<<mglu<<" , mlsp="<<mlsp << ") as either the efficiency or its error are not positive numbers! (mceff="<<mceff<<" and toterr="<<toterr<<")"<< endl;
378 >    continue;
379        } else {
380 <        if(!systematicsonly&&!efficiencyonly) {
381 <          dout << "Calculating limit now for "<<massgluname<<"="<<mglu<<" , "<<massLSPname<<"="<<mlsp <<endl;
382 <          vector<float> sigmas;
383 <          string plotfilename=(string)(TString((scansample.collection)[0].samplename)+TString(massgluname)+TString(any2string(mglu))+TString("__")+TString(massLSPname)+TString(any2string(mlsp))+TString(".png"));
384 <          do_limit_wrapper(mceff,toterr,ibin,mcjzb,sigmas,plotfilename);
385 <          cout << "back in " << __FUNCTION__ << endl;
386 <          if(sigmas[0]>-0.5) { // negative sigmas are the error signature of do_limit_wrapper, so we want to exclude them.
387 <            limitmap->Fill(mglu,mlsp,sigmas[0]);
388 <            sysjesmap->Fill(mglu,mlsp,sys_jes);
389 <            sysjsumap->Fill(mglu,mlsp,sys_jsu);
390 <            sysresmap->Fill(mglu,mlsp,sys_res);
391 <            syspdfmap->Fill(mglu,mlsp,sys_pdf);
392 <            systotmap->Fill(mglu,mlsp,toterr/mceff);//total relative (!) error
393 <            sysstatmap->Fill(mglu,mlsp,mcefferr);//total relative (!) error
394 <            dout << "A limit has been added at " << sigmas[0] << " for m_{glu}="<<mglu << " and m_{lsp}="<<mlsp<<endl;
395 <          } //end of if sigma is positive
396 <        //end of not systematics only condition
397 <        }
398 <        if(systematicsonly) {
399 <            sysjesmap->Fill(mglu,mlsp,sys_jes);
400 <            sysjsumap->Fill(mglu,mlsp,sys_jsu);
401 <            sysresmap->Fill(mglu,mlsp,sys_res);
402 <            syspdfmap->Fill(mglu,mlsp,sys_pdf);
403 <            systotmap->Fill(mglu,mlsp,toterr/mceff);//total relative (!) error
404 <            sysstatmap->Fill(mglu,mlsp,mcefferr);//total relative (!) error
405 <        }
380 >    if(!systematicsonly&&!efficiencyonly) {
381 >      dout << "Calculating limit now for "<<massgluname<<"="<<mglu<<" , "<<massLSPname<<"="<<mlsp <<endl;
382 >      vector<float> sigmas;
383 >      string plotfilename=(string)(TString((scansample.collection)[0].samplename)+TString(massgluname)+TString(any2string(mglu))+TString("__")+TString(massLSPname)+TString(any2string(mlsp))+TString(".png"));
384 >      do_limit_wrapper(mceff,toterr,ibin,mcjzb,sigmas,plotfilename);
385 >      cout << "back in " << __FUNCTION__ << endl;
386 >      if(sigmas[0]>-0.5) { // negative sigmas are the error signature of do_limit_wrapper, so we want to exclude them.
387 >        limitmap->Fill(mglu,mlsp,sigmas[0]);
388 >        sysjesmap->Fill(mglu,mlsp,sys_jes);
389 >        sysjsumap->Fill(mglu,mlsp,sys_jsu);
390 >        sysresmap->Fill(mglu,mlsp,sys_res);
391 >        syspdfmap->Fill(mglu,mlsp,sys_pdf);
392 >        systotmap->Fill(mglu,mlsp,toterr/mceff);//total relative (!) error
393 >        sysstatmap->Fill(mglu,mlsp,mcefferr);//total relative (!) error
394 >        dout << "A limit has been added at " << sigmas[0] << " for m_{glu}="<<mglu << " and m_{lsp}="<<mlsp<<endl;
395 >      } //end of if sigma is positive
396 >    //end of not systematics only condition
397 >    }
398 >    if(systematicsonly) {
399 >        sysjesmap->Fill(mglu,mlsp,sys_jes);
400 >        sysjsumap->Fill(mglu,mlsp,sys_jsu);
401 >        sysresmap->Fill(mglu,mlsp,sys_res);
402 >        syspdfmap->Fill(mglu,mlsp,sys_pdf);
403 >        systotmap->Fill(mglu,mlsp,toterr/mceff);//total relative (!) error
404 >        sysstatmap->Fill(mglu,mlsp,mcefferr);//total relative (!) error
405 >    }
406        }//efficiency is valid
407      }
408    }
409 <  
409 >
410    prepare_scan_axis(limitmap,ismSUGRA);
411    prepare_scan_axis(sysjesmap,ismSUGRA);
412    prepare_scan_axis(sysjsumap,ismSUGRA);
# Line 388 | Line 414 | write_warning(__FUNCTION__,"CURRENTLY SW
414    prepare_scan_axis(syspdfmap,ismSUGRA);
415    prepare_scan_axis(systotmap,ismSUGRA);
416    prepare_scan_axis(sysstatmap,ismSUGRA);
417 <  
417 >
418    if(!systematicsonly&&!efficiencyonly) {
419      limcanvas->cd();
420      limitmap->Draw("COLZ");
# Line 401 | Line 427 | write_warning(__FUNCTION__,"CURRENTLY SW
427      } else {
428        TFile *outputfile;
429        if(systematicsonly) outputfile=new TFile(("output/DistributedSystematics_job"+string(any2string(jobnumber))+"_of_"+string(any2string(njobs))+".root").c_str(),"UPDATE");//needs to be "UPDATE" as we can get to this point for different JZB cuts and don't want to erase the previous data :-)
430 <        else outputfile=new TFile(("output/DistributedLimits_job"+string(any2string(jobnumber))+"_of_"+string(any2string(njobs))+".root").c_str(),"UPDATE");//needs to be "UPDATE" as we can get to this point for
430 >    else outputfile=new TFile(("output/DistributedLimits_job"+string(any2string(jobnumber))+"_of_"+string(any2string(njobs))+".root").c_str(),"UPDATE");//needs to be "UPDATE" as we can get to this point for
431        limitmap->Write();
432        sysjesmap->Write();
433        sysjsumap->Write();
# Line 414 | Line 440 | write_warning(__FUNCTION__,"CURRENTLY SW
440        ipointmap->Write();
441        outputfile->Close();
442      }
443 <  }
443 >  }
444    if(systematicsonly) { // systematics only :
445      limcanvas->cd();
446      sysjesmap->Draw("COLZ");
# Line 441 | Line 467 | write_warning(__FUNCTION__,"CURRENTLY SW
467      if(runninglocally) {
468        CompleteSave(limcanvas,"SUSYScan/Resolution_geq"+any2string(jzb_cut[ibin]));
469      }
470 <    
470 >  
471      if(!runninglocally) {
472        TFile *outputfile=new TFile(("output/DistributedSystematics_job"+string(any2string(jobnumber))+"_of_"+string(any2string(njobs))+".root").c_str(),"UPDATE");
473        sysjesmap->Write();
# Line 483 | Line 509 | write_warning(__FUNCTION__,"CURRENTLY SW
509        outputfile->Close();
510      }
511    }//end of efficiencies only
512 <  
512 >
513    delete limitmap;
514    delete exclmap;
515    delete sysjesmap;
# Line 504 | Line 530 | void scan_SUSY_parameter_space(string mc
530      scan_SUSY_parameter_space(mcjzb,datajzb,jzb_cut,requireZ, peakerror, ibin, njobs, jobnumber,systonly,effonly);
531    }
532   }
533 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines