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

Comparing UserCode/cbrown/Development/Plotting/Modules/GeneratorLevelStudyModule.C (file contents):
Revision 1.3 by buchmann, Tue Mar 13 17:59:38 2012 UTC vs.
Revision 1.4 by buchmann, Tue Apr 10 13:45:00 2012 UTC

# Line 38 | Line 38 | namespace GenLevelStudy {
38          void MomentumFractionScenario(float massglu, float masslsp);
39          void WidthIllustration();
40          void ZDecayIllustration();
41 +        void ZDecayIllustration(float massglu, float masslsp);
42          void pStarIllustration(float x);
43          void DeltaLSPmomentum();
44          void DeltaLSPmomentumScenario(float massglu, float masslsp);
# Line 53 | Line 54 | namespace GenLevelStudy {
54   //      string LM4sample="/scratch/buchmann/ntuples/GeneratorInformationInJZB___JZBplusSamples_PrimeTime__SAMPLES__Gen_V11/LM4_SUSY_sftsht_7TeV-pythia6__Summer11-PU_S4_START42_V11-v2__withIndex.root";
55          string LM4sample="/scratch/buchmann/buchmann/SignalWithLeptonsStartingAt5GeV/LM4_SUSY_sftsht_7TeV-pythia.root";
56   //      string LM4sample="/scratch/buchmann/ntuples/GeneratorInformationInJZB___JZBplusSamples_PrimeTime__SAMPLES__Gen_V16_sumJet_with_LSPsum_LM8only_fixed/LM8_SUSY_sftsht_7TeV-pythia6__Summer11-PU_S4_START42_V11-v2_novtx_fixed3.root";
57 <        string SMSsample="/scratch/buchmann/buchmann/GeneratorInformationInJZB___JZBplusSamples_PrimeTime__SAMPLES__Gen_V12_with_zchi2angle_bf1/SMS-T5zz_x-05_Mgluino-150to1200_mLSP-50to1150_7TeV-Pythia6Z__Summer11-PU_START42_V11_FastSim-v2__AODSIM___inclindex_v2_complet.root";
57 >        string SMSsample="/shome/buchmann/JellyfishCBAF/various_assignments/SimPa/Tests/FullSMS.root";
58 >        //scratch/buchmann/buchmann/GeneratorInformationInJZB___JZBplusSamples_PrimeTime__SAMPLES__Gen_V12_with_zchi2angle_bf1/SMS-T5zz_x-05_Mgluino-150to1200_mLSP-50to1150_7TeV-Pythia6Z__Summer11-PU_START42_V11_FastSim-v2__AODSIM___inclindex_v2_complet.root";
59          string histoname(int i);
60          Color_t histocolor(int i);
61          Color_t diversehistocolor(int i);
62  
63          float pstarlow=0;
64 <        float pstarhigh=400;
64 >        float pstarhigh=320;
65  
66   } // end of GenLevelStudy namespace
67  
# Line 83 | Line 85 | Color_t GenLevelStudy::histocolor(int i)
85          return TColor::GetColor("#0B61A4");
86   }
87   Color_t GenLevelStudy::diversehistocolor(int i) {
88 +        i+=1;
89          if(i==0) return TColor::GetColor("#000000"); // Black
90 <        if(i==1) return TColor::GetColor("#800000"); //Dark Red
91 <        if(i==2) return TColor::GetColor("#008000");//Dark Green
92 <        if(i==3) return TColor::GetColor("#808000");//Dark Yellow
93 <        if(i==4) return TColor::GetColor("#000080");//Dark Blue
94 <        if(i==5) return TColor::GetColor("#800080");//Dark Magenta
95 <        if(i==6) return TColor::GetColor("#008080");//Dark Cyan
90 >        if(i==1) return kBlue;
91 >        if(i==2) return kRed;
92 >        if(i==3) return kGreen+2;
93 >        if(i==4) return TColor::GetColor("#FF8000");//Orange
94 >        if(i==5) return TColor::GetColor("#DF01D7");//Dark Magenta
95 >        if(i==6) return TColor::GetColor("#01A9DB");//Dark Cyan
96          if(i==7) return TColor::GetColor("#C0C0C0");//Light Gray
97 <        if(i==8) return TColor::GetColor("#C0DCC0");//Grass Green
98 <        if(i==9) return TColor::GetColor("#A6CAF0");//Light Blue
97 >        if(i==8) return TColor::GetColor("#F7FE2E");//Juicy Lemon
98 >        if(i==9) return TColor::GetColor("#F781BE");//Light
99          if(i==10) return TColor::GetColor("#FFFBF0");//Cream
100          if(i==11) return TColor::GetColor("#A0A0A4");//Medium Gray
101          if(i==12) return TColor::GetColor("#808080");//Dark Gray
# Line 223 | Line 226 | void GenLevelStudy::MomentumFractionScen
226   }  
227  
228   void GenLevelStudy::MomentumFraction() {
226 write_warning(__FUNCTION__,"Skipping this function (please uncomment the lines below)");
229    GenLevelStudy::MomentumFractionScenario(-1,-1);
230    GenLevelStudy::MomentumFractionScenario(1175,500);
231    GenLevelStudy::MomentumFractionScenario(625,425);
# Line 253 | Line 255 | void GenLevelStudy::AngleMETsumLSPScenar
255   }
256  
257   void GenLevelStudy::AngleMETsumLSP() {
258 < write_warning(__FUNCTION__,"Skipping this function (please uncomment the lines below)");
259 <  //AngleMETsumLSPScenario(-1,-1);
260 <  //AngleMETsumLSPScenario(1175,500.0);
259 <  //AngleMETsumLSPScenario(625,425);
258 >  AngleMETsumLSPScenario(-1,-1);
259 >  AngleMETsumLSPScenario(1175,500.0);
260 >  AngleMETsumLSPScenario(625,425);
261   }
262  
263   void GenLevelStudy::RatioMETsumLSPScenario(float massglu, float masslsp) {
# Line 282 | Line 283 | void GenLevelStudy::RatioMETsumLSPScenar
283   }
284  
285   void GenLevelStudy::RatioMETsumLSP() {
286 < write_warning(__FUNCTION__,"Skipping this function (please uncomment the lines below)");
287 <  //RatioMETsumLSPScenario(-1,-1);
288 <  //RatioMETsumLSPScenario(1175,500.0);
288 <  //RatioMETsumLSPScenario(625,425);
286 >  RatioMETsumLSPScenario(-1,-1);
287 >  RatioMETsumLSPScenario(1175,500.0);
288 >  RatioMETsumLSPScenario(625,425);
289   }
290  
291   void GenLevelStudy::AngleLSPLSPScenario(float massglu, float masslsp) {
# Line 325 | Line 325 | void GenLevelStudy::AngleLSPLSPScenario(
325   }
326  
327   void GenLevelStudy::AngleLSPLSP() {
328 < write_warning(__FUNCTION__,"Skipping this function (please uncomment the lines below)");
329 < //  AngleLSPLSPScenario(-1,-1);
330 < //  AngleLSPLSPScenario(1175,500);
331 < //  AngleLSPLSPScenario(625,425);
328 >  AngleLSPLSPScenario(-1,-1);
329 >  AngleLSPLSPScenario(1175,500);
330 >  AngleLSPLSPScenario(625,425);
331   }
332  
333   void GenLevelStudy::AngleLSPZScenario(float massglu, float masslsp) {
# Line 352 | Line 351 | void GenLevelStudy::AngleLSPZScenario(fl
351   }
352  
353   void GenLevelStudy::AngleLSPZ() {
354 < write_warning(__FUNCTION__,"Skipping this function (please uncomment the lines below)");
355 < //  AngleLSPZScenario(-1,-1);
356 < //  AngleLSPZScenario(1175,500.0);
358 < //  AngleLSPZScenario(625,425);
354 >  AngleLSPZScenario(-1,-1);
355 >  AngleLSPZScenario(1175,500.0);
356 >  AngleLSPZScenario(625,425);
357   }
358  
359   void GenLevelStudy::WidthIllustration() {
# Line 393 | Line 391 | void GenLevelStudy::WidthIllustration()
391    CompleteSave(can,"GeneratorStudies/JZB_over_MET__as_a_function_of_the_angle_between_Z_and_MET");
392   }
393  
394 < void GenLevelStudy::ZDecayIllustration() {
394 > void GenLevelStudy::ZDecayIllustration(float massglu, float masslsp) {
395    TFile *f = new TFile(GenLevelStudy::SMSsample.c_str());
396    TTree *events = (TTree*)f->Get("events");
397    TCanvas *jcan = new TCanvas("jcan","jcan");
398 <  string cutdileptonic="genNjets>2&&abs(pureGeneratorJZB)>0&&DecayCode==2";
399 <  string cutsemihadronic="genNjets>2&&abs(pureGeneratorJZB)>0&&DecayCode==11";
400 <  string cutsemineutrino="genNjets>2&&abs(pureGeneratorJZB)>0&&DecayCode==101";
398 >  
399 >  stringstream cut;
400 >  if(massglu>0&&masslsp>0) cut << "&&abs(MassGlu-" << massglu << ")<5&&abs(MassLSP-" << masslsp << ")";
401 >
402 >  string cutdileptonic="genNjets>2&&abs(pureGeneratorJZB)>0&&DecayCode==2"+cut.str();
403 >  string cutsemihadronic="genNjets>2&&abs(pureGeneratorJZB)>0&&DecayCode==11"+cut.str();
404 >  string cutsemineutrino="genNjets>2&&abs(pureGeneratorJZB)>0&&DecayCode==101"+cut.str();
405  
406    int nbins=100;
407    float xmin=-300;
# Line 431 | Line 433 | void GenLevelStudy::ZDecayIllustration()
433  
434    stringstream saveas;
435    saveas << "GeneratorStudies/ZDecayIllustration";
436 +  if(massglu>0&&masslsp>0) saveas << "__MassGlu" << massglu << "_MassLSP_" << masslsp;
437    CompleteSave(jcan,saveas.str());  
438    
439   }
440  
441 + void GenLevelStudy::ZDecayIllustration() {
442 +  ZDecayIllustration(-1,-1);
443 +  ZDecayIllustration(1175,500);
444 +  ZDecayIllustration(625,425);
445 + }
446 +
447  
448   void GenLevelStudy::pStarIllustration(float x) {
449    TH2F *pstarlspmap = new TH2F("pstarlspmap", "",(int)((mgluend-mglustart)/mglustep+1),mglustart-0.5*mglustep,mgluend+0.5*mglustep,(int)((mLSPend-mLSPstart)/mLSPstep+1),mLSPstart-0.5*mLSPstep,mLSPend+0.5*mLSPstep);
# Line 553 | Line 562 | void GenLevelStudy::DeltaLSPmomentumScen
562  
563  
564   void GenLevelStudy::DeltaLSPmomentum() {
556 write_warning(__FUNCTION__,"Skipping this function (please uncomment the lines below)");
565    GenLevelStudy::DeltaLSPmomentumScenario(-1,-1);
566    GenLevelStudy::DeltaLSPmomentumScenario(1175,500);
567    GenLevelStudy::DeltaLSPmomentumScenario(625,425);
# Line 561 | Line 569 | write_warning(__FUNCTION__,"Skipping thi
569   }
570  
571   void GenLevelStudy::fill_pstar_histos(string scandir, float x, TH1F* pstarhistos[], int npstarhistos, TLegend *leg, bool addlegentry=false) {
572 <  TChain chain("events");
572 >  cout << "Preparing SMS file" << endl;
573 >  TFile *f = new TFile(GenLevelStudy::SMSsample.c_str());
574 >  TTree *events = (TTree*)f->Get("events");
575 >  /*
576    for(int i=0;i<15;i++) {
577      for(int j=0;j<15;j++) {
578         stringstream filename;
# Line 569 | Line 580 | void GenLevelStudy::fill_pstar_histos(st
580         chain.Add(filename.str().c_str());
581      }
582     }
583 +   */
584    
585     //Draw two very different distributions ... for illustration purposes.
586     if(TMath::Abs((float)(x-0.5))<0.1) {
587          TCanvas *cannie = new TCanvas("cannie","cannie");
588          TH1F *h1 = new TH1F("h1","h1",100,-400,600);
589          TH1F *h2 = new TH1F("h2","h2",100,-400,600);
590 <        chain.Draw("jzb[1]>>h1","(MassLSP==150&&MassGlu==400&&abs(jzb[1])>0)");
591 <        chain.Draw("jzb[1]>>h2","(MassLSP==150&&MassGlu==1200&&abs(jzb[1])>0)","sames");
590 >        events->Draw("jzb[1]>>h1","(MassLSP==150&&MassGlu==400&&abs(jzb[1])>0)");
591 >        events->Draw("jzb[1]>>h2","(MassLSP==150&&MassGlu==1200&&abs(jzb[1])>0)","sames");
592          h1->SetLineColor(histocolor(4));
593          h2->SetLineColor(histocolor(6));
594          h1->GetXaxis()->SetTitle("JZB (GeV/c)");
# Line 593 | Line 605 | void GenLevelStudy::fill_pstar_histos(st
605     }
606    
607     float stepsize=(pstarhigh-pstarlow)/(float)npstarhistos;
608 < /*
608 >
609     stringstream accdrawcommand;
610     accdrawcommand << "1+((" << x << "*(MassGlu+MassLSP)-MassLSP)>91.2)";
611    
612     TCanvas *ca = new TCanvas("ca","ca");
613 <   chain.Draw(accdrawcommand.str().c_str(),"","COLZ");
613 >   events->Draw(accdrawcommand.str().c_str(),"","COLZ");
614     stringstream saveACCas;
615     saveACCas << "GeneratorStudies/AcceptedRegion__x_0p" << 100*x;
616     CompleteSave(ca,saveACCas.str());
# Line 610 | Line 622 | void GenLevelStudy::fill_pstar_histos(st
622          cut << "(abs(TMath::Sqrt((("<< x*x << ")*(MassGlu+MassLSP)*(MassGlu+MassLSP)-(MassLSP+91.2)*(MassLSP+91.2))*((" << x*x << ")*(MassGlu+MassLSP)*(MassGlu+MassLSP)-(MassLSP-91.2)*(MassLSP-91.2)))/(2*(" << x << ")*(MassGlu+MassLSP))-" << curr-stepsize/2.0 << ")<" << stepsize/2.0 << ")";
623          cut << "&&((" << x << "*(MassGlu+MassLSP)-MassLSP)>91.2)"; // cleaning all events out that dont' have the imposed x
624          stringstream drawcommand;
625 <        drawcommand << "jzb[1]>>GenLevelHisto_" << i;
626 <        chain.Draw(drawcommand.str().c_str(),cut.str().c_str());
625 >        drawcommand << "jzb[1]>>tempie";
626 >        TH1F *temp = (TH1F*)pstarhistos[i]->Clone("tempie");
627 >        events->Draw(drawcommand.str().c_str(),cut.str().c_str());
628 >        for(int ibi=1;ibi<=temp->GetNbinsX();ibi++) pstarhistos[i]->SetBinContent(ibi,temp->GetBinContent(ibi));
629 >        delete temp;
630          stringstream histotext;
631          histotext << curr-stepsize << " < p^{*} < " << curr;
632          if(addlegentry&&pstarhistos[i]->Integral()>0) leg->AddEntry(pstarhistos[i],histotext.str().c_str(),"l");
633          cout << "Finished working on " << scandir << " with a p* value in [" << curr - stepsize << "," << curr << "] (now contains: " << pstarhistos[i]->Integral() << " events)" << endl;
619
634     }
635     delete ca;
636 < */
636 >
637   }
638  
639   void GenLevelStudy::pStarDistributions(string name, float modelx) {
640 <  const int nhistos=20;
640 >  const int nhistos=8;
641    TH1F  *pstarhistos[nhistos];
642    TCanvas *can = new TCanvas("can","can");
643    for(int i=0;i<nhistos;i++) pstarhistos[i] = new TH1F(histoname(i).c_str(),histoname(i).c_str(),100,-400,600);
# Line 635 | Line 649 | void GenLevelStudy::pStarDistributions(s
649    stringstream rootfilename;
650    rootfilename << "pstarhistos__x0p" << 100*modelx << ".root";
651    TFile *f = new TFile(rootfilename.str().c_str(),"RECREATE");
652 <  pstarhistos[0]->GetXaxis()->SetTitle("JZB");
652 >  pstarhistos[0]->GetXaxis()->SetTitle("Generator JZB");
653    pstarhistos[0]->GetXaxis()->CenterTitle();
654 <  pstarhistos[0]->GetYaxis()->SetTitle("");
654 >  pstarhistos[0]->GetYaxis()->SetTitle("events (normalized to unity)");
655    pstarhistos[0]->GetYaxis()->CenterTitle();
656    for(int i=0;i<nhistos;i++) {
657        pstarhistos[i]->SetLineColor(diversehistocolor(i));
# Line 653 | Line 667 | void GenLevelStudy::pStarDistributions(s
667    leg->Draw();
668    stringstream saveas;
669    saveas << "GeneratorStudies/pStarStudy__x_0p" << 100*modelx;
670 +  TText *ta = write_title("JZB distribution for different p^{*}");
671 +  ta->Draw();
672    CompleteSave(can,saveas.str());
673  
674    TGraphErrors *gr = new TGraphErrors(nhistos,x,y,ex,ey);
675    gr->Draw("AP");
676    gr->GetXaxis()->SetTitle("p^{*}");
677    gr->GetXaxis()->CenterTitle();
678 <  gr->GetYaxis()->SetTitle("JZB");
678 >  gr->GetYaxis()->SetTitle("Generator JZB");
679    gr->GetYaxis()->CenterTitle();
680    gr->Draw("AP");
681    stringstream saveas2;
682    saveas2 << "GeneratorStudies/pStarVsJZB__x_0p" << 100*modelx;
683 +  TText *tb = write_title("JZB distribution width for different p^{*}");
684 +  tb->Draw();
685    CompleteSave(can,saveas2.str());
686    f->cd();
687    gr->Write();
# Line 672 | Line 690 | void GenLevelStudy::pStarDistributions(s
690  
691   }
692   void GenLevelStudy::pStarDistributions() {
693 <  pStarDistributions("SMS_T5zzh_newslots",0.25);
693 > //  pStarDistributions("SMS_T5zzh_newslots",0.25);
694    pStarDistributions("SMS_T5zz",0.5);
695 <  pStarDistributions("SMS_T5zzl",0.75);
695 > //  pStarDistributions("SMS_T5zzl",0.75);
696   }
697  
698   void GenLevelStudy::DrawJetBand(float massglu, float masslsp) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines