Skip to content

Commit 1432363

Browse files
author
mstoye
committed
Merge pull request #9 from mstoye/origin/master
added conmtrol region
2 parents 06b7ed0 + 0a55447 commit 1432363

File tree

5 files changed

+656
-1
lines changed

5 files changed

+656
-1
lines changed

MuonTrigControl.C

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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+
}

MuonTrigControl.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#ifndef MuonTrigControl_h
2+
#define MuonTrigControl_h
3+
4+
#include "SUSYLooperHistsSoftBase.h"
5+
#include "SampleInfo.h"
6+
7+
class MuonTrigControl : public SUSYLooperHistsSoftBase
8+
{
9+
public:
10+
MuonTrigControl(SampleInfo mySample, float Mstop_ = 0, float MLSP_ = 0) {setTree(mySample, Mstop_, MLSP_);};
11+
TFile* Loop();
12+
};
13+
#endif

SUSYLooperHistsSoftBase.C

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#define SUSYLooperHistsSoftBase_cxx
2+
#include "SUSYLooperHistsSoftBase.h"
3+
#include <TH2.h>
4+
#include <TStyle.h>
5+
#include <TCanvas.h>
6+
#include <vector>
7+
8+
#include <TF1.h>
9+
#include <TMath.h>
10+
#include <TMatrixF.h>
11+
#include <TVectorF.h>
12+
13+
TFile* SUSYLooperHistsSoftBase::Loop()
14+
{
15+
TFile* myFile = new TFile(outputFileName,"recreate");
16+
if (fChain == 0) return myFile;
17+
Long64_t nentries = fChain->GetEntriesFast();
18+
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+
29+
}
30+
31+
32+
33+
return (myFile);
34+
// if (Cut(ientry) < 0) continue;
35+
}
36+
37+
38+
double SUSYLooperHistsSoftBase::DiTau_InvMass( TLorentzVector Met, TLorentzVector L1, TLorentzVector L2, float Al ){
39+
TLorentzVector T1,T2;
40+
double DiTauMass;
41+
TMatrixF A(2,2);
42+
TVectorF C(2),X(2);
43+
A(0,0)=L1.Px();
44+
A(0,1)=L2.Px();
45+
A(1,0)=L1.Py();
46+
A(1,1)=L2.Py();
47+
A=A.Invert();
48+
C(0)=(Met+L1+L2).Px();
49+
C(1)=(Met+L1+L2).Py();
50+
X=A*C;// double X0i=X(0), X1i=X(1);
51+
//---------------[ MET ReAlignement subsection ]------------------------------
52+
if(X(0)<0||X(1)<0){
53+
if ( fabs(L1.DeltaPhi(Met))>Al && fabs(L2.DeltaPhi(Met))>Al ) {/*DO NOTHING just normaly a non-Z event!*/}
54+
else if( fabs(L1.DeltaPhi(Met))<Al && fabs(L2.DeltaPhi(Met))>Al ) Met.SetPtEtaPhiM(Met.Pt(),0,L1.Phi(),0);
55+
else if( fabs(L2.DeltaPhi(Met))<Al && fabs(L1.DeltaPhi(Met))>Al ) Met.SetPtEtaPhiM(Met.Pt(),0,L2.Phi(),0);
56+
else if( fabs(L1.DeltaPhi(Met))<Al && fabs(L2.DeltaPhi(Met))<Al && fabs(L1.DeltaPhi(Met))<fabs(L2.DeltaPhi(Met)) ) Met.SetPtEtaPhiM(Met.Pt(),0,L1.Phi(),0);
57+
else if( fabs(L1.DeltaPhi(Met))<Al && fabs(L2.DeltaPhi(Met))<Al && fabs(L1.DeltaPhi(Met))>fabs(L2.DeltaPhi(Met)) ) Met.SetPtEtaPhiM(Met.Pt(),0,L2.Phi(),0);
58+
}//---------------------------------------------------------------------------
59+
C(0)=(Met+L1+L2).Px(); C(1)=(Met+L1+L2).Py(); X=A*C;
60+
T1.SetPxPyPzE( L1.Px()*X(0), L1.Py()*X(0), L1.Pz()*X(0), sqrt( 3.1571 +L1.P()*L1.P()*X(0)*X(0) ) );
61+
T2.SetPxPyPzE( L2.Px()*X(1), L2.Py()*X(1), L2.Pz()*X(1), sqrt( 3.1571 +L2.P()*L2.P()*X(1)*X(1) ) );
62+
if( X(0)>0 && X(1)>0 ) DiTauMass=(T1+T2).M(); else DiTauMass=-(T1+T2).M(); return DiTauMass;
63+
//if((X(0)!=X0i||X(1)!=X1i))std::cout<<X(0)<<" "<<X(1)<<" <--"<<X0i<<" "<<X1i<<" RMETal.phi="<<(T1+T2-L1-L2).Phi()<<" RMETal.eta"<<(T1+T2-L1-L2).Eta()<<" MZ="<<DiTauMass<<endl;
64+
}
65+
66+
67+

0 commit comments

Comments
 (0)