Changeset 21 in huonglan
- Timestamp:
- Sep 1, 2011, 9:53:56 AM (13 years ago)
- Location:
- SPLOT/NEWREALEASE
- Files:
-
- 12 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
SPLOT/NEWREALEASE/MERGEFILES/MakeFakeData.C
r20 r21 39 39 40 40 TString s3 = "v3.root"; 41 TString ver = " NEW";41 TString ver = "ToTestEfficiency"; 42 42 43 43 //set the name of 78 files … … 141 141 142 142 //################################### 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 //################################### 143 200 //********** File Signal *********** 144 201 //################################### … … 175 232 b_HT = tSig->GetLeaf("HT")->GetValue(); 176 233 177 if (b_mtophad<250 || b_HT<620) continue;234 //if (b_mtophad<250 || b_HT<620) continue; 178 235 if (ifi%1000==0) cout << "Reading event " << ifi << " from Signal tree" << endl; 179 236 … … 235 292 b_HT = ht; 236 293 237 if (mt<250 || ht<620) continue;294 //if (mt<250 || ht<620) continue; 238 295 if (ifi%1000==0) cout << "Reading event " << ifi << " from AllBkg tree" << endl; 239 296 … … 301 358 b_HT = ht; 302 359 303 if (mt<250 || ht<620) continue;360 //if (mt<250 || ht<620) continue; 304 361 if (ifi%1000==0) cout << "Reading event " << ifi << " from Top tree" << endl; 305 362 … … 350 407 b_HT = ht; 351 408 352 if (mt<250 || ht<620) continue;409 //if (mt<250 || ht<620) continue; 353 410 if (ifi%1000==0) cout << "Reading event " << ifi << " from AllW tree" << endl; 354 411 … … 402 459 b_HT = ht; 403 460 404 if (mt<250 || ht<620) continue;461 //if (mt<250 || ht<620) continue; 405 462 if (ifi%1000==0) cout << "Reading event " << ifi << " from SingT tree" << endl; 406 463 … … 451 508 b_HT = ht; 452 509 453 if (mt<250 || ht<620) continue;510 //if (mt<250 || ht<620) continue; 454 511 if (ifi%1000==0) cout << "Reading event " << ifi << " from AllZ tree" << endl; 455 512 … … 503 560 b_HT = ht; 504 561 505 if (mt<250 || ht<620) continue;562 //if (mt<250 || ht<620) continue; 506 563 if (ifi%1000==0) cout << "Reading event " << ifi << " from QCD tree" << endl; 507 564
Note: See TracChangeset
for help on using the changeset viewer.