|
| 1 | +#define MuonTrigControl_cxx |
| 2 | +#include "MuonTrigControl.h" |
| 3 | +#include <TH2.h> |
| 4 | +#include <TStyle.h> |
| 5 | +#include <TCanvas.h> |
| 6 | +#include <vector> |
| 7 | +#include <TF1.h> |
| 8 | +#include <TMath.h> |
| 9 | + |
| 10 | + |
| 11 | +TFile* MuonTrigControl::Loop() |
| 12 | +{ |
| 13 | + TFile* myFile = new TFile(outputFileName,"recreate"); |
| 14 | + if (fChain == 0) return myFile; |
| 15 | + Long64_t nentries = fChain->GetEntriesFast(); |
| 16 | + |
| 17 | + TH1D *h_CutFlow =new TH1D("h_CutFlow","h_CutFlow", 25, -0.5, 24.5 ); |
| 18 | + h_CutFlow->Sumw2(); |
| 19 | + |
| 20 | + |
| 21 | + Long64_t nbytes = 0, nb = 0; |
| 22 | + for (Long64_t jentry=0; jentry<nentries;jentry++) { |
| 23 | + |
| 24 | + Long64_t ientry = LoadTree(jentry); |
| 25 | + if (ientry < 0) break; |
| 26 | + nb = fChain->GetEntry(jentry); nbytes += nb; |
| 27 | + |
| 28 | + float HT30 =0.; |
| 29 | + int Nj30=0; |
| 30 | + int Nb=0; |
| 31 | + |
| 32 | + for(int i=0;i<nJet;i++){//Loop Over Selected Jets, measure Nj, Nb, HT; |
| 33 | + if(Jet_pt[i]>30.&& fabs(Jet_eta[i])<4.5 ) { |
| 34 | + Nj30++; |
| 35 | + HT30=HT30+Jet_pt[i]; |
| 36 | + if(Jet_btagCSV[i]>0.679/*0.244*/)Nb++; //CSV[M] b-tagging |
| 37 | + } |
| 38 | + } |
| 39 | + if( Nb>0 )continue; h_CutFlow->Fill(11); |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + if( MLSP!=0 ){//-----(Cuts for scans to select point)---------- |
| 44 | + |
| 45 | + if( (GenSusyMStop<=(Mstop-12)) || (GenSusyMStop>=(Mstop+12)) ) continue; //<---[M_stop, M_LSP: set by by the last 2 arguments of the SampleInfo objects] |
| 46 | + if( (GenSusyMNeutralino<=(MLSP - 4)) || (GenSusyMNeutralino>=(MLSP +4)) ) continue; |
| 47 | + }//-------[ CUTS for Non-Scan samples ]------------------------- |
| 48 | + if( nJet==0 && nLepGood<2 )continue; h_CutFlow->Fill(1); |
| 49 | + if( fabs(LepGood_pdgId[0]*LepGood_pdgId[1])!=121 )continue; h_CutFlow->Fill(2); |
| 50 | + if( LepGood_pt[0]<5 || fabs(LepGood_eta[0])>1.5 )continue; h_CutFlow->Fill(3); |
| 51 | + if( LepGood_pt[1]<3 || fabs(LepGood_eta[1])>1.5 )continue; h_CutFlow->Fill(4); |
| 52 | + if( fabs(LepGood_pdgId[1])==11 && LepGood_pt[1]<5 )continue; h_CutFlow->Fill(5); //Threashold for electrons. |
| 53 | + if( fabs(LepGood_pdgId[0])==11 && LepGood_pt[0]<7 )continue; h_CutFlow->Fill(6); //Threashold for electrons. |
| 54 | + if( LepGood_relIso[1]>.5 || LepGood_relIso[1]*LepGood_pt[1]>5 )continue; h_CutFlow->Fill(7); //2nd lep: *Universal* iso requirements! |
| 55 | + if( fabs(LepGood_dz[0])>0.02 || fabs(LepGood_dxy[0])>0.02 ) continue; |
| 56 | + if( fabs(LepGood_dz[1])>0.02 || fabs(LepGood_dxy[1])>0.02 ) continue; h_CutFlow->Fill(8); |
| 57 | + if( Jet_pt[0]<150||fabs(Jet_eta[0])>2.4 )continue; h_CutFlow->Fill(9); //1st Jet requirements. |
| 58 | + if( nJet>2 && Jet_pt[2]>60 )continue; h_CutFlow->Fill(10);//2nd Jet requirements. |
| 59 | + for(int i=0;i<nJet;i++){//Loop Over Selected Jets, measure Nj, Nb, HT; |
| 60 | + if(Jet_pt[i]>30.&& fabs(Jet_eta[i])<4.5 ) { |
| 61 | + Nj30++; |
| 62 | + HT30=HT30+Jet_pt[i]; |
| 63 | + if(Jet_btagCSV[i]>0.679/*0.244*/)Nb++; //CSV[M] b-tagging |
| 64 | + } |
| 65 | + } |
| 66 | + if( Nb>0 )continue; h_CutFlow->Fill(11); |
| 67 | + |
| 68 | + } |
| 69 | + |
| 70 | + myFile->Write(); |
| 71 | + myFile->Close(); |
| 72 | + |
| 73 | + return (myFile); |
| 74 | + // if (Cut(ientry) < 0) continue; |
| 75 | +} |
0 commit comments