예제 #1
0
파일: AspFrame.C 프로젝트: timburrow/ovj3
void AspFrame::draw() {

     if(annoTop) set_top_frame_on_top(1);
     else set_top_frame_on_top(0);
     drawSpec(); // currently do nothing

     callAspDisplayListeners(); 

     displayTop();
}
예제 #2
0
파일: plotHadTau.C 프로젝트: arapyan/MitHtt
void plotHadTau(std::string iVar="TMath::Min(abs(jphi_1-jphi_2),6.28-abs(jphi_1-jphi_2))",std::string iCut="vbf",std::string iName="can",std::string iDir="mtau/2012/mtau/",bool is2012=true,int iTauId = 2,bool iEmbed=true) { 
  //void plotHadTau(std::string iVar="pt_2*(1.015 + 0.001 * TMath::Min(TMath::Max(pt_2-45,0),10))",std::string iCut="(nprong_2 == 1 && ngamma_2 > 0  && pt_1 > 20 && iso_1 < 0.1 && iso_2 > 0.795  && pt_1 > 20   && nbtag == 0)",std::string iName="can",std::string iDir="mtau/2012/mtau/",bool is2012=true,int iTauId = 2,bool iEmbed=true) { 
//void plotHadTau(std::string iVar="mvamet*((acos(cos(mvametphi-phi_1)) > TMath::Pi()/2.)+(acos(cos(mvametphi-phi_1)) < TMath::Pi()/2.)*cos(mvametphi-phi_1))",std::string iCut="(pt_1 > 24 && pt_2 > 20 && iso_1 < 0.1 && iso_2 > 0.785 )",std::string iName="can",std::string iDir="2012/etau",int iTauId = 2,bool is2012=true,bool iEmbed=false) { 
  float iLumi = 4800.;
  if(is2012) iLumi = 19100.;
  //SetStyle();
  loadfMap();
  std::stringstream lNameId; //lNameId << "Flat_" << lTauId << "_";
  const int lN = 6;
  std::string lName = iDir+"ntuples/";
  //std::string lName1 = "2011/mutau/ntuples/";
  //std::string lName = "svfit/"+iDir;
  //std::string lName = iDir;

  fWId   = 2;
  fQCDId = 4;
  
  TTree **lTree = new TTree*[lN]; 
  TH1F**lH     = new TH1F*[lN]; 
  TH1F**lHSS   = new TH1F*[lN];
  TH1F**lHIso  = new TH1F*[lN];
  TH1F**lHMT   = new TH1F*[lN]; 
  TH1F**lHNMT  = new TH1F*[lN]; 
  TH1F**lHSSMT = new TH1F*[lN]; 
  TH1F**lHTIS  = new TH1F*[lN]; 
  TH1F**lHLIS  = new TH1F*[lN]; 
  TH1F**lHTemp = new TH1F*[lN]; 
  fString = new std::string[lN]; fWeights = new std::string[lN]; fColor = new int[lN]; fFreeWeights = new std::string[lN];
  lTree[0]     = load(lName+"ztt-mad_select.root");        fString[0] = "Z#rightarrow#tau#tau ";          fColor[0] = 796;//kOrange-3;
  lTree[1]     = load(lName+"ttbar-8TeV_select.root");     fString[1] = "t#bar{t}";                       fColor[1] = 592;//kRed+4;
  lTree[2]     = load(lName+"wjets_select.root");          fString[2] = "W+Jets";                         fColor[2] = 634;//kBlue-5;
  lTree[3]     = load(lName+"zmm_select.root");            fString[3] = "Z#rightarrow#tau#tau fakes";     fColor[3] = kBlue;
  lTree[4]     = load(lName+"data_select.root");           fString[4] = "QCD";                            fColor[4] = 606;//kBlue+3;
  //lTree[5]     = load(lName+"higgs_select.root");          fString[5] = "Higgs ";                         fColor[5] = kBlack;
  lTree[lN-1]  = load(lName+"data_select.root");        fString[lN-1] = "Data"; fColor[lN-1] = kBlack;
  TTree *lEmbTree  = load(lName+"ztt-emb_select.root"); 

  std::stringstream lLumi; lLumi << iLumi;
  if(iCut != "vbf") for(int i0 = 0; i0 < lN;   i0++) fWeights[i0]   = "(pt_1 > 20 && pt_2 > 20 && abs(eta_1) < 2.1 && abs(eta_2) < 2.3 )*"+iCut;
  if(iCut == "vbf") for(int i0 = 0; i0 < lN;   i0++) fWeights[i0]  += "(pt_1 > 20 && pt_2 > 20 && abs(eta_1) < 2.1 && abs(eta_2) < 2.3 )";

  for(int i0 = 0; i0 < lN-1; i0++) if(i0 != fQCDId ) fWeights[i0]  += "*weight*"+lLumi.str();//effweight*puOBweight*"+lLumi.str();
  //Z Scale Factors
  if(!is2012) { 
    fWeights[0]  += "*0.95";
    //fWeights[1]  += "*0.1";
    fWeights[3]  += "*0.95";
  }
  if(is2012) fWeights[1]  += "*1.01";//*0.1";//0.9*0.1";
  if(is2012) fWeights[0]  += "*1.01";
  if(is2012) fWeights[3]  += "*1.01";
  //if(iCut == "vbf") fWeights[2] += "*(weight < 0.1)";
  if(iCut == "vbf") for(int i0 = 0; i0 < lN;   i0++) fFreeWeights[i0]  += "(mjj > 300 && jdeta > 2.5 && iso_1 < 0.1 && iso_2 > 0.795 )";

  if(iEmbed) {
    TH1F *lMC = new TH1F("pXX","pXX",21,0,1000);
    TH1F *lDa = new TH1F("pAA","pAA",21,0,1000);
    std::string lCut = "weight*(pt_1 > 20 && pt_2 > 20 && abs(eta_1) < 2.1 && abs(eta_2) < 2.3 && iso_1 < 0.1 && iso_2 > 0.795 && genmass > 70)*"+lLumi.str();
    lTree[0]->Draw("pt_2>>pXX" ,lCut.c_str());
    lEmbTree->Draw("pt_2>>pAA" ,lCut.c_str());
    cout << "===> " << lMC->Integral() << " - " << lDa->Integral() << endl;
    double lIncWeight = lMC->Integral()/lDa->Integral();
    std::stringstream pSS; pSS << lIncWeight << "*";
    fWeights[0]   = pSS.str()+fWeights[0];
  delete lTree[0];
  lTree[0] = lEmbTree;
  }
  //bool applyVBFVeto

  std::string lVar = iVar;
  TCanvas *lC0 = new TCanvas("A","A",400,400);
  if(iCut != "vbf") drawSpec   (lTree,lH,lHSS,lHMT,lHNMT,lHSSMT,lHTIS              ,lN,lVar,"*( pt_2 > -10.105)",iName );    lC0->cd();
  if(iCut == "vbf") drawVBFSpec(lTree,lH,lHSS,lHMT,lHLIS,lHTIS ,lHNMT,lHSSMT,lHTemp,lN,lVar,"*( pt_2 > -10.105)",is2012);    lC0->cd();
}