Changeset 21 in huonglan


Ignore:
Timestamp:
Sep 1, 2011, 9:53:56 AM (13 years ago)
Author:
huonglan
Message:

Add efficiency test folder

Location:
SPLOT/NEWREALEASE
Files:
12 added
1 edited

Legend:

Unmodified
Added
Removed
  • SPLOT/NEWREALEASE/MERGEFILES/MakeFakeData.C

    r20 r21  
    3939
    4040  TString s3 = "v3.root";
    41   TString ver = "NEW";
     41  TString ver = "ToTestEfficiency";
    4242
    4343  //set the name of 78 files
     
    141141
    142142  //###################################
     143  //************ File Data  ***********
     144  //###################################
     145
     146  TFile *fData    = new TFile("res_Data"+ver+".root","RECREATE");
     147  TTree *tWeiD   = new TTree("T","T");
     148  float b_weiD  = -100;
     149  float b_mtophad= -100;   
     150  float b_HT= -100;         
     151  float b_cos1= -100;       
     152  float b_cos2= -100;       
     153  float b_MinLep1= -100;   
     154  short b_hfor= -100;       
     155  short b_hasBadJet= -100; 
     156  short b_isEleEvent= -100;
     157  int b_RunNumber= -100; 
     158  tWeiD->Branch("wei",        &b_weiD,               "wei/F");
     159  tWeiD->Branch("mtophad",    &b_mtophad,        "mtophad/F");
     160  tWeiD->Branch("HT",         &b_HT,                  "HT/F");
     161  tWeiD->Branch("cos1",       &b_cos1,              "cos1/F");
     162  tWeiD->Branch("cos2",       &b_cos2,              "cos2/F");
     163  tWeiD->Branch("MinLep1",    &b_MinLep1,        "MinLep1/F");
     164  tWeiD->Branch("hfor",       &b_hfor,              "hfor/S");
     165  tWeiD->Branch("hasBadJet",  &b_hasBadJet,    "hasBadJet/S");
     166  tWeiD->Branch("isEleEvent", &b_isEleEvent,  "isEleEvent/S");
     167  tWeiD->Branch("RunNumber",  &b_RunNumber,    "RunNumber/I");
     168  gROOT->cd();
     169 
     170  int countD = 0;
     171  for (int ifi = 0; ifi < tData->GetEntries(); ifi++){
     172    countD++;
     173    tData->GetEntry(ifi);
     174    b_mtophad = tSig->GetLeaf("mtophad")->GetValue();
     175    b_HT = tSig->GetLeaf("HT")->GetValue();
     176
     177    //if (b_mtophad<250 || b_HT<620) continue;
     178    if (ifi%1000==0) cout << "Reading event " << ifi << " from Signal tree" << endl;
     179
     180    //TString currentFile = tSig->GetTree()->GetCurrentFile()->GetName();
     181
     182    b_weiS = Wei[0]*tSig->GetLeaf("WeiEvent")->GetValue();
     183    b_cos1 = tSig->GetLeaf("cos_tlepCMtpair")->GetValue();
     184    b_cos2 = tSig->GetLeaf("cosWqq")->GetValue();
     185    b_MinLep1 = tSig->GetLeaf("MinLep1")->GetValue();           
     186    b_hfor = (short)tSig->GetLeaf("hfor")->GetValue();
     187    b_isEleEvent = (short)tSig->GetLeaf("isEleEvent")->GetValue();
     188    b_hasBadJet = (short)tSig->GetLeaf("hasBadJet")->GetValue();
     189    b_RunNumber = (int)tSig->GetLeaf("RunNumber_ana")->GetValue();
     190
     191    tWeiS->Fill();
     192  }
     193
     194  fSig->cd();
     195  tWeiS->Write();
     196  fSig->Close();
     197
     198
     199  //###################################
    143200  //********** File Signal  ***********
    144201  //###################################
     
    175232    b_HT = tSig->GetLeaf("HT")->GetValue();
    176233
    177     if (b_mtophad<250 || b_HT<620) continue;
     234    //if (b_mtophad<250 || b_HT<620) continue;
    178235    if (ifi%1000==0) cout << "Reading event " << ifi << " from Signal tree" << endl;
    179236
     
    235292    b_HT = ht;
    236293
    237     if (mt<250 || ht<620) continue;
     294    //if (mt<250 || ht<620) continue;
    238295    if (ifi%1000==0) cout << "Reading event " << ifi << " from AllBkg tree" << endl;
    239296
     
    301358    b_HT = ht;
    302359
    303     if (mt<250 || ht<620) continue;
     360    //if (mt<250 || ht<620) continue;
    304361    if (ifi%1000==0) cout << "Reading event " << ifi << " from Top tree" << endl;
    305362
     
    350407    b_HT = ht;
    351408
    352     if (mt<250 || ht<620) continue;
     409    //if (mt<250 || ht<620) continue;
    353410    if (ifi%1000==0) cout << "Reading event " << ifi << " from AllW tree" << endl;
    354411
     
    402459    b_HT = ht;
    403460
    404     if (mt<250 || ht<620) continue;
     461    //if (mt<250 || ht<620) continue;
    405462    if (ifi%1000==0) cout << "Reading event " << ifi << " from SingT tree" << endl;
    406463
     
    451508    b_HT = ht;
    452509
    453     if (mt<250 || ht<620) continue;
     510    //if (mt<250 || ht<620) continue;
    454511    if (ifi%1000==0) cout << "Reading event " << ifi << " from AllZ tree" << endl;
    455512
     
    503560    b_HT = ht;
    504561
    505     if (mt<250 || ht<620) continue;
     562    //if (mt<250 || ht<620) continue;
    506563    if (ifi%1000==0) cout << "Reading event " << ifi << " from QCD tree" << endl;
    507564
Note: See TracChangeset for help on using the changeset viewer.