diff --git a/Plotting/KCode/KBase.h b/Plotting/KCode/KBase.h index f54fe868..c6618087 100644 --- a/Plotting/KCode/KBase.h +++ b/Plotting/KCode/KBase.h @@ -17,6 +17,7 @@ #include //STL headers +#include #include #include @@ -30,30 +31,40 @@ class KBuilder; class KBase { public: //constructors - KBase() : name(""), filename(""),parent(0),option(0),file(0),tree(0),nEventProc(0),MyBuilder(0),stmp(""),htmp(0),etmp(0),isBuilt(false),doSubtract(false),intlumi(-1),normType("") { + KBase() : name(""), parent(0), localOpt(0), globalOpt(0), file(0), tree(0), MyBuilder(0), stmp(""), htmp(0), etmp(0), isBuilt(false) { //enable histo errors TH1::SetDefaultSumw2(kTRUE); - //must always have an option map - if(option==0) option = new OptionMap(); + //must always have local & global option maps + if(localOpt==0) localOpt = new OptionMap(); + if(globalOpt==0) globalOpt = new OptionMap(); } - KBase(string name_, string filename_, OptionMap* option_) : name(name_), filename(filename_), tree(0), parent(0), option(option_), MyBuilder(0), stmp(""), - htmp(0), etmp(0), isBuilt(false), doSubtract(false), intlumi(-1), normType("") { - //enable histo errors - TH1::SetDefaultSumw2(kTRUE); + KBase(string name_, OptionMap* localOpt_, OptionMap* globalOpt_) : name(name_), parent(0), localOpt(localOpt_), globalOpt(globalOpt_), file(0), tree(0), MyBuilder(0), stmp(""), + htmp(0), etmp(0), isBuilt(false) { + //must always have local & global option maps + if(localOpt==0) localOpt = new OptionMap(); + if(globalOpt==0) globalOpt = new OptionMap(); - if(filename.size()>0){ + string filename; + string treedir; + if(localOpt->Get("filename",filename)){ + if(globalOpt->Get("treedir",treedir)) { //get directory from global + filename = treedir + "/" + filename; + localOpt->Set("filename",filename); //store full filename for future use + } //open file file = TFile::Open(filename.c_str()); + if(!file) { + cout << "Input error: file " << filename << " cannot be found or opened. Object " << name << " will not be fully initialized." << endl; + return; + } //get tree tree = (TTree*)file->Get("tree"); //store this value (number of events processed) at the beginning so histo only has to be accessed once + int nEventProc = 1; TH1F* nEventHist = (TH1F*)file->Get("nEventProc"); if(nEventHist) nEventProc = nEventHist->GetBinContent(1); - else nEventProc = 1; //default value; + localOpt->Set("nEventProc",nEventProc); } - - //must always have an option map - if(option==0) option = new OptionMap(); } //destructor virtual ~KBase() {} @@ -84,7 +95,6 @@ class KBase { //accessors string GetName() { return name; } - string GetFileName() { return filename; } void SetName(string n) { name = n; } //add a blank histo for future building virtual TH1F* AddHisto(string s, TH1F* h){ @@ -116,22 +126,16 @@ class KBase { parent = p; //cout << name << " set parent " << parent->GetName() << endl; } - virtual bool GetSubtract() { return doSubtract; } - virtual void SetSubtract(bool s) { doSubtract = s; } - OptionMap* GetOption() { return option; } - void SetOption(OptionMap* opt) { option = opt; if(option==0) option = new OptionMap(); } //must always have an option map + OptionMap* GetLocalOpt() { return localOpt; } + void SetLocalOpt(OptionMap* opt) { localOpt = opt; if(localOpt==0) localOpt = new OptionMap(); } //must always have an option map + OptionMap* GetGlobalOpt() { return globalOpt; } + void SetGlobalOpt(OptionMap* opt) { globalOpt = opt; if(globalOpt==0) globalOpt = new OptionMap(); } //must always have an option map virtual void PrintYield() { double err = 0; double hint = htmp->IntegralAndError(0,htmp->GetNbinsX()+1,err); cout << name << ": " << hint << " +/- " << err << endl; } - virtual int GetNEventProc(){ return nEventProc; } - virtual void SetNEventProc(int n){ nEventProc = n; } virtual double GetYield() { return htmp->Integral(0,htmp->GetNbinsX()+1); } - //norm type is an additional property, not included in constructor - //it should be set separately if it needs to be changed - string GetNormType() { return normType; } - void SetNormType(string nt) { normType = nt; } virtual void CloseFile() { file->Close(); } //divide current histo by bin width, default implementation virtual void BinDivide(){ @@ -152,20 +156,16 @@ class KBase { virtual void AddToLegend(TLegend* leg) {} virtual void AddChild(KBase* ch) {} virtual void Normalize(double nn, bool toYield=true) {} - //these default values allow to distinguish between data and MC... - virtual double GetIntLumi() { return intlumi; } - virtual double GetCrossSection() { return -1; } - virtual Color_t GetColor() { } virtual void SetAddExt(bool ae) { } protected: //member variables - string name, filename; + string name; KBase* parent; - OptionMap* option; + OptionMap* localOpt; + OptionMap* globalOpt; TFile* file; TTree* tree; - int nEventProc; KBuilder* MyBuilder; HistoMap MyHistos; ErrorMap MyErrorBands; @@ -173,41 +173,37 @@ class KBase { TH1F* htmp; TGraphAsymmErrors* etmp; bool isBuilt; - bool doSubtract; - double intlumi; - string normType; }; //--------------------------------------------------------------- -//extension of base class for data - has intlumi +//extension of base class for data - has default intlumi class KBaseData : public KBase { public: //constructors - KBaseData() : KBase() {} - KBaseData(string name_, string filename_, OptionMap* option_, double intlumi_=0) : KBase(name_, filename_, option_) { intlumi = intlumi_; } + KBaseData() : KBase() { localOpt->Set("intlumi",0.0); } + KBaseData(string name_, OptionMap* localOpt_, OptionMap* globalOpt_) : KBase(name_, localOpt_, globalOpt_) { + if(!localOpt->Has("intlumi")) localOpt->Set("intlumi",0.0); + } //destructor virtual ~KBaseData() {} //functions for histo creation virtual void Build(); //implemented in KBuilder.h to avoid circular dependency - - //accessors - double GetIntLumi() { return intlumi; } - void SetIntLumi(double L) { intlumi = L; } - - protected: - //member variables - }; //-------------------------------------------------------------------------------- -//extension of base class for MC - has cross section, norm type, error band calc +//extension of base class for MC - has error band calc, default cross section & norm type class KBaseMC : public KBase { public: //constructors - KBaseMC() : KBase() { normType = "MC"; } - KBaseMC(string name_, string filename_, OptionMap* option_, double xsection_=0) : - KBase(name_, filename_, option_), xsection(xsection_), initWeight(false) { normType = "MC"; } + KBaseMC() : KBase() { + localOpt->Set("normtype","MC"); + localOpt->Set("xsection",0.0); + } + KBaseMC(string name_, OptionMap* localOpt_, OptionMap* globalOpt_) : KBase(name_, localOpt_, globalOpt_) { + if(!localOpt->Has("normtype")) localOpt->Set("normtype","MC"); + if(!localOpt->Has("xsection")) localOpt->Set("xsection",0.0); + } //destructor virtual ~KBaseMC() {} @@ -219,16 +215,6 @@ class KBaseMC : public KBase { if(toYield) htmp->Scale(nn/simyield); else htmp->Scale(nn); } - - //accessors - double GetCrossSection() { return xsection; } - void SetCrossSection(double c) { xsection = c; } - - protected: - //member variables - double xsection; - bool initWeight; - }; //------------------------------------------- @@ -237,7 +223,31 @@ class KBaseExt : public KBase { public: //constructors KBaseExt() : KBase(), add_ext(false) {} - KBaseExt(string name_, OptionMap* option_) : KBase(name_,"",option_), add_ext(false) {} + KBaseExt(string name_, OptionMap* localOpt_, OptionMap* globalOpt_) : KBase(name_, localOpt_, globalOpt_), add_ext(false) { + string filename; + if(localOpt->Get("filename",filename)){ + //open file + file = TFile::Open(filename.c_str()); + //check for specific histos to import + vector exthisto_in; + vector exthisto_out; + localOpt->Get("exthisto_in",exthisto_in); + localOpt->Get("exthisto_out",exthisto_out); + if(exthisto_in.size() != exthisto_out.size()){ + cout << "Input error: vectors of external histo input and output names must have the same length. These external histos will not be used." << endl; + return; + } + else{ + add_ext = true; + for(int i = 0; i < exthisto_in.size(); i++){ + TH1F* htmp = (TH1F*)file->Get(exthisto_in[i].c_str()); + AddHisto(exthisto_out[i],htmp); + } + add_ext = false; + } + } + + } //change histo add mode void SetAddExt(bool ae) { add_ext = ae; } diff --git a/Plotting/KCode/KBuilder.h b/Plotting/KCode/KBuilder.h index f4a66c63..69241c20 100644 --- a/Plotting/KCode/KBuilder.h +++ b/Plotting/KCode/KBuilder.h @@ -32,20 +32,15 @@ void TreeClass::Loop() {} class KBuilder : public TreeClass { public: //constructors - KBuilder() : TreeClass(), MyBase(0), option(0), stmp(""), htmp(0) { - //enable histo errors - TH1::SetDefaultSumw2(kTRUE); - - //must always have an option map - if(option==0) option = new OptionMap(); + KBuilder() : TreeClass(), MyBase(0), localOpt(0), globalOpt(0), stmp(""), htmp(0) { + //must always have local & global option maps + if(localOpt==0) localOpt = new OptionMap(); + if(globalOpt==0) globalOpt = new OptionMap(); } - KBuilder(KBase* MyBase_, TTree* tree_) : TreeClass(tree_), MyBase(MyBase_), option(MyBase_->GetOption()), stmp(""), htmp(0) { - //enable histo errors - TH1::SetDefaultSumw2(kTRUE); - //gStyle->SetErrorX(0.5); //now disabled by default - - //must always have an option map - if(option==0) option = new OptionMap(); + KBuilder(KBase* MyBase_, TTree* tree_) : TreeClass(tree_), MyBase(MyBase_), localOpt(MyBase->GetLocalOpt()), globalOpt(MyBase->GetGlobalOpt()), stmp(""), htmp(0) { + //must always have local & global option maps + if(localOpt==0) localOpt = new OptionMap(); + if(globalOpt==0) globalOpt = new OptionMap(); } //destructor virtual ~KBuilder() {} @@ -85,20 +80,22 @@ class KBuilder : public TreeClass { bool goodEvent = true; //check for double counting - if ((MyBase->GetNormType()!="chargino" && MyBase->GetNormType()!="rpv") && CheckDoubleCount()) return false; + string normtype = ""; + localOpt->Get("normtype",normtype); + if ((normtype!="chargino" && normtype!="rpv") && CheckDoubleCount()) return false; int filter = -1; - if(option->Get("filter",filter)){ + if(globalOpt->Get("filter",filter)){ //check appropriate filter conditions if(filter==0){ - if(option->Get("antiisosel",false)){ //anti-iso selection + if(globalOpt->Get("antiisosel",false)){ //anti-iso selection TLorentzVector v_mu; v_mu.SetPtEtaPhiM(MuonPt,MuonEta,MuonPhi,0.1056583715); bool anyGoodTau = false; for(int t = 0; t < HPSTauPt->size(); t++){ bool goodTau = true; - goodTau &= (PFJetMultiplicity>=2) || (option->Get("prepresel",false)); + goodTau &= (PFJetMultiplicity>=2) || (globalOpt->Get("prepresel",false)); TLorentzVector v_tau; v_tau.SetPtEtaPhiM(HPSTauPt->at(t),HPSTauEta->at(t),HPSTauPhi->at(t),1.77682); @@ -136,27 +133,27 @@ class KBuilder : public TreeClass { FakeTauMassTauJet.push_back(0); } - if(option->Get("finaltaupt",false)) goodTau &= HPSTauPt->at(t) > 50; + if(globalOpt->Get("finaltaupt",false)) goodTau &= HPSTauPt->at(t) > 50; - if(option->Get("mainsel",false)) { + if(globalOpt->Get("mainsel",false)) { goodTau &= (FakeTauIndexTauJet[t] != FakeTauIndexMuonJet[t]); //check that good jets were found and paired with leptons //options to do either part of final selection separately - //if(option->Get("finalmasscut",false)) goodTau &= MassTauJet > 250; + //if(globalOpt->Get("finalmasscut",false)) goodTau &= MassTauJet > 250; double mtb = 250; - option->Get("finalmasscutval",mtb); - if(option->Get("finalmasscut",false)) goodTau &= FakeTauMassTauJet[t] > mtb; - else if(option->Get("finalmasscutinv",false)) goodTau &= FakeTauMassTauJet[t] < mtb; + globalOpt->Get("finalmasscutval",mtb); + if(globalOpt->Get("finalmasscut",false)) goodTau &= FakeTauMassTauJet[t] > mtb; + else if(globalOpt->Get("finalmasscutinv",false)) goodTau &= FakeTauMassTauJet[t] < mtb; //final selection: M(tau,b) > 250 GeV and pT(tau) > 50 GeV //also final selection for lqd333 - if(option->Get("finalsel",false)) { + if(globalOpt->Get("finalsel",false)) { goodTau &= (FakeTauMassTauJet[t] > 250) && (HPSTauPt->at(t) > 50); } } //RPV selection for lqd321 - else if(option->Get("lqd321sel",false)){ //Nbjet>=1, Njet>=5 (+ tau pT cut) + else if(globalOpt->Get("lqd321sel",false)){ //Nbjet>=1, Njet>=5 (+ tau pT cut) //goodTau &= HPSTauPt->at(t) > 40; goodTau &= HPSTauPt->at(t) > 50; } @@ -166,13 +163,15 @@ class KBuilder : public TreeClass { anyGoodTau |= goodTau; //gen-level checks for MC - if(MyBase->GetNormType()=="faketau" && option->Get("dofaketau",false) && HPSTauFakeJet->at(t) != true) goodTau &= false; - else if(MyBase->GetNormType()=="nofaketau" && option->Get("dofaketau",false) && HPSTauFakeJet->at(t) != false) goodTau &= false; + string normtype = ""; + localOpt->Get("normtype",normtype); + if(normtype=="faketau" && globalOpt->Get("dofaketau",false) && HPSTauFakeJet->at(t) != true) goodTau &= false; + else if(normtype=="nofaketau" && globalOpt->Get("dofaketau",false) && HPSTauFakeJet->at(t) != false) goodTau &= false; FakeTauGenDecision.push_back(goodTau); } goodEvent &= anyGoodTau; //RPV selection for lqd321 - if(option->Get("lqd321sel",false)){ //Nbjet>=1, Njet>=5 (+ tau pT cut) + if(globalOpt->Get("lqd321sel",false)){ //Nbjet>=1, Njet>=5 (+ tau pT cut) for(int j = 0; j < PFJetPt->size(); j++){ if(BJetIndices.size()<1 && PFJetCSVBTag->at(j)>0.244) BJetIndices.push_back(j); else JetIndices.push_back(j); @@ -184,38 +183,38 @@ class KBuilder : public TreeClass { //main sample goodEvent &= (MuonPt > 29) //1 lepton with pT > 29 GeV && (HPSTauPt->at(0) > 29) //1 hadronic tau with pT > 29 GeV - && (option->Get("prepresel",false) || (PFJetMultiplicity >= 2 && PFJetPt->at(0) > 30 && PFJetPt->at(1) > 30)); //2 jets with pT > 30 GeV + && (globalOpt->Get("prepresel",false) || (PFJetMultiplicity >= 2 && PFJetPt->at(0) > 30 && PFJetPt->at(1) > 30)); //2 jets with pT > 30 GeV - if(option->Get("finaltaupt",false)) goodEvent &= HPSTauPt->at(0) > 50; + if(globalOpt->Get("finaltaupt",false)) goodEvent &= HPSTauPt->at(0) > 50; int dilepmass = -1; - if(option->Get("dilepmass",dilepmass)){ + if(globalOpt->Get("dilepmass",dilepmass)){ if(dilepmass==0) goodEvent &= (MassMuonTau < 60); else if(dilepmass==1) goodEvent &= ((MassMuonTau > 60) && (MassMuonTau < 120)); else if(dilepmass==2) goodEvent &= (MassMuonTau > 120); } //main selection: 2 good jets, 1 b-jet - if(option->Get("mainsel",false)) { + if(globalOpt->Get("mainsel",false)) { goodEvent &= (IndexTauJet != IndexMuonJet); //check that good jets were found and paired with leptons //options to do either part of final selection separately - //if(option->Get("finalmasscut",false)) goodEvent &= MassTauJet > 250; + //if(globalOpt->Get("finalmasscut",false)) goodEvent &= MassTauJet > 250; double mtb = 250; - option->Get("finalmasscutval",mtb); - if(option->Get("finalmasscut",false)) goodEvent &= MassTauJet > mtb; - else if(option->Get("finalmasscutinv",false)) goodEvent &= MassTauJet < mtb; + globalOpt->Get("finalmasscutval",mtb); + if(globalOpt->Get("finalmasscut",false)) goodEvent &= MassTauJet > mtb; + else if(globalOpt->Get("finalmasscutinv",false)) goodEvent &= MassTauJet < mtb; //final selection: M(tau,b) > 250 GeV and pT(tau) > 50 GeV //also final selection for lqd333 - if(option->Get("finalsel",false)) { + if(globalOpt->Get("finalsel",false)) { goodEvent &= (MassTauJet > 250) && (HPSTauPt->at(0) > 50); ST_rpv = MuonPt + HPSTauPt->at(0) + PFMainJetPt[0] + PFMainJetPt[1]; //for lqd333sel1 } } //RPV selection for lqd321 - else if(option->Get("lqd321sel",false)){ //Nbjet>=1, Njet>=5 (+ tau pT cut) + else if(globalOpt->Get("lqd321sel",false)){ //Nbjet>=1, Njet>=5 (+ tau pT cut) //goodEvent &= HPSTauPt->at(0) > 40; goodEvent &= HPSTauPt->at(0) > 50; for(int j = 0; j < PFJetPt->size(); j++){ @@ -226,7 +225,7 @@ class KBuilder : public TreeClass { } //RPV selections - testing various versions for Keti //define ST for the event in here - member variable for ST_rpv - else if(option->Get("lqd321sel1",false)){ //Nbjet>=1, Njet>=5 + else if(globalOpt->Get("lqd321sel1",false)){ //Nbjet>=1, Njet>=5 goodEvent &= HPSTauPt->at(0) > 50; for(int j = 0; j < PFJetPt->size(); j++){ if(BJetIndices.size()<1 && PFJetCSVBTag->at(j)>0.244) BJetIndices.push_back(j); @@ -236,7 +235,7 @@ class KBuilder : public TreeClass { //calculate ST if(goodEvent) ST_rpv = MuonPt + HPSTauPt->at(0) + PFJetPt->at(BJetIndices[0]) + PFJetPt->at(JetIndices[0]) + PFJetPt->at(JetIndices[1]) + PFJetPt->at(JetIndices[2]) + PFJetPt->at(JetIndices[3]); } - else if(option->Get("lqd321sel12",false)){ //Nbjet>=1, Njet>=5, pT>40 + else if(globalOpt->Get("lqd321sel12",false)){ //Nbjet>=1, Njet>=5, pT>40 goodEvent &= HPSTauPt->at(0) > 40; for(int j = 0; j < PFJetPt->size(); j++){ if(BJetIndices.size()<1 && PFJetCSVBTag->at(j)>0.244) BJetIndices.push_back(j); @@ -246,7 +245,7 @@ class KBuilder : public TreeClass { //calculate ST if(goodEvent) ST_rpv = MuonPt + HPSTauPt->at(0) + PFJetPt->at(BJetIndices[0]) + PFJetPt->at(JetIndices[0]) + PFJetPt->at(JetIndices[1]) + PFJetPt->at(JetIndices[2]) + PFJetPt->at(JetIndices[3]); } - else if(option->Get("lqd321sel13",false)){ //Nbjet>=1, Njet>=6, pT>40 + else if(globalOpt->Get("lqd321sel13",false)){ //Nbjet>=1, Njet>=6, pT>40 goodEvent &= HPSTauPt->at(0) > 40; for(int j = 0; j < PFJetPt->size(); j++){ if(BJetIndices.size()<1 && PFJetCSVBTag->at(j)>0.244) BJetIndices.push_back(j); @@ -256,7 +255,7 @@ class KBuilder : public TreeClass { //calculate ST if(goodEvent) ST_rpv = MuonPt + HPSTauPt->at(0) + PFJetPt->at(BJetIndices[0]) + PFJetPt->at(JetIndices[0]) + PFJetPt->at(JetIndices[1]) + PFJetPt->at(JetIndices[2]) + PFJetPt->at(JetIndices[3]) + PFJetPt->at(JetIndices[4]); } - else if(option->Get("lqd321sel14",false)){ //Nbjet>=1, Njet>=6, pT>30 + else if(globalOpt->Get("lqd321sel14",false)){ //Nbjet>=1, Njet>=6, pT>30 goodEvent &= HPSTauPt->at(0) > 30; for(int j = 0; j < PFJetPt->size(); j++){ if(BJetIndices.size()<1 && PFJetCSVBTag->at(j)>0.244) BJetIndices.push_back(j); @@ -266,7 +265,7 @@ class KBuilder : public TreeClass { //calculate ST if(goodEvent) ST_rpv = MuonPt + HPSTauPt->at(0) + PFJetPt->at(BJetIndices[0]) + PFJetPt->at(JetIndices[0]) + PFJetPt->at(JetIndices[1]) + PFJetPt->at(JetIndices[2]) + PFJetPt->at(JetIndices[3]) + PFJetPt->at(JetIndices[4]); } - else if(option->Get("lqd321sel15",false)){ //Nbjet>=2, Njet>=5, pT>40 + else if(globalOpt->Get("lqd321sel15",false)){ //Nbjet>=2, Njet>=5, pT>40 goodEvent &= HPSTauPt->at(0) > 40; for(int j = 0; j < PFJetPt->size(); j++){ if(BJetIndices.size()<2 && PFJetCSVBTag->at(j)>0.244) BJetIndices.push_back(j); @@ -276,7 +275,7 @@ class KBuilder : public TreeClass { //calculate ST if(goodEvent) ST_rpv = MuonPt + HPSTauPt->at(0) + PFJetPt->at(BJetIndices[0]) + PFJetPt->at(BJetIndices[1]) + PFJetPt->at(JetIndices[0]) + PFJetPt->at(JetIndices[1]) + PFJetPt->at(JetIndices[2]); } - else if(option->Get("lqd321sel16",false)){ //Nbjet>=2, Njet>=5, pT>30 + else if(globalOpt->Get("lqd321sel16",false)){ //Nbjet>=2, Njet>=5, pT>30 goodEvent &= HPSTauPt->at(0) > 30; for(int j = 0; j < PFJetPt->size(); j++){ if(BJetIndices.size()<2 && PFJetCSVBTag->at(j)>0.244) BJetIndices.push_back(j); @@ -286,7 +285,7 @@ class KBuilder : public TreeClass { //calculate ST if(goodEvent) ST_rpv = MuonPt + HPSTauPt->at(0) + PFJetPt->at(BJetIndices[0]) + PFJetPt->at(BJetIndices[1]) + PFJetPt->at(JetIndices[0]) + PFJetPt->at(JetIndices[1]) + PFJetPt->at(JetIndices[2]); } - else if(option->Get("lqd321sel2",false)){ //Nbjet>=1, Njet>=4 + else if(globalOpt->Get("lqd321sel2",false)){ //Nbjet>=1, Njet>=4 goodEvent &= HPSTauPt->at(0) > 50; for(int j = 0; j < PFJetPt->size(); j++){ if(BJetIndices.size()<1 && PFJetCSVBTag->at(j)>0.244) BJetIndices.push_back(j); @@ -296,7 +295,7 @@ class KBuilder : public TreeClass { //calculate ST if(goodEvent) ST_rpv = MuonPt + HPSTauPt->at(0) + PFJetPt->at(BJetIndices[0]) + PFJetPt->at(JetIndices[0]) + PFJetPt->at(JetIndices[1]) + PFJetPt->at(JetIndices[2]); } - else if(option->Get("lqd321sel3",false)){ //Nbjet>=1, Njet>=4, pT(jet 3) > 50, pT(jet 4) > 40 + else if(globalOpt->Get("lqd321sel3",false)){ //Nbjet>=1, Njet>=4, pT(jet 3) > 50, pT(jet 4) > 40 goodEvent &= HPSTauPt->at(0) > 50; for(int j = 0; j < PFJetPt->size(); j++){ if(BJetIndices.size()<1 && PFJetCSVBTag->at(j)>0.244) BJetIndices.push_back(j); @@ -308,7 +307,7 @@ class KBuilder : public TreeClass { if(goodEvent) ST_rpv = MuonPt + HPSTauPt->at(0) + PFJetPt->at(BJetIndices[0]) + PFJetPt->at(JetIndices[0]) + PFJetPt->at(JetIndices[1]) + PFJetPt->at(JetIndices[2]); } //note: lqd333sel1 -> finalsel - /*else if(option->Get("lqd333sel2",false)){ //Nbjet>=2, Njet>=3 + /*else if(globalOpt->Get("lqd333sel2",false)){ //Nbjet>=2, Njet>=3 goodEvent &= HPSTauPt->at(0) > 50; for(int j = 0; j < PFJetPt->size(); j++){ if(BJetIndices.size()<2 && PFJetCSVBTag->at(j)>0.244) BJetIndices.push_back(j); @@ -318,15 +317,15 @@ class KBuilder : public TreeClass { //calculate ST if(goodEvent) ST_rpv = MuonPt + HPSTauPt->at(0) + PFJetPt->at(BJetIndices[0]) + PFJetPt->at(BJetIndices[1]) + PFJetPt->at(JetIndices[0]); }*/ - else if(option->Get("lqd333sel2",false)){//3D optimization of sel2, w/ defaults: //Nbjet>=2, Njet>=3, pt>50 + else if(globalOpt->Get("lqd333sel2",false)){//3D optimization of sel2, w/ defaults: //Nbjet>=2, Njet>=3, pt>50 double pt_val = 50; - option->Get("pt_val",pt_val); + globalOpt->Get("pt_val",pt_val); goodEvent &= HPSTauPt->at(0) > pt_val; int nj_val = 3; - option->Get("nj_val",nj_val); + globalOpt->Get("nj_val",nj_val); int nb_val = 2; - option->Get("nb_val",nb_val); + globalOpt->Get("nb_val",nb_val); for(int j = 0; j < PFJetPt->size(); j++){ if(BJetIndices.size()at(j)>0.244) BJetIndices.push_back(j); else JetIndices.push_back(j); @@ -350,13 +349,13 @@ class KBuilder : public TreeClass { double MT=sqrt(2*MuonPt*PFMETPatType1*(1-cos(dPhi(MuonPhi,PFMETPhiPatType1)))); goodEvent &= (MuonPt > 29) //1 lepton with pT > 29 GeV && (HPSTauPt->at(0) > 40) //1 hadronic tau with pT > 40 GeV - && (!(option->Get("jetveto",true)) || (PFJetMultiplicity == 0 || PFJetPt->at(0) < 30)) //0 jets with pT > 30 GeV - jet veto for fakes - && (!(option->Get("btagveto",false)) || IndexTauJet == IndexMuonJet) //if those indices are equal, there was no good jet that passed b-tagging + && (!(globalOpt->Get("jetveto",true)) || (PFJetMultiplicity == 0 || PFJetPt->at(0) < 30)) //0 jets with pT > 30 GeV - jet veto for fakes + && (!(globalOpt->Get("btagveto",false)) || IndexTauJet == IndexMuonJet) //if those indices are equal, there was no good jet that passed b-tagging && MT > 50; //cut on transverse mass to reduce ttbar int nprong; - if(option->Get("tauprong",nprong)) goodEvent &= (HPSTauDecayMode->at(0)/5+1==nprong); + if(globalOpt->Get("tauprong",nprong)) goodEvent &= (HPSTauDecayMode->at(0)/5+1==nprong); string etaregion; - if(option->Get("etaregion",etaregion)){ + if(globalOpt->Get("etaregion",etaregion)){ if(etaregion=="barrel") goodEvent &= (abs(HPSTauEta->at(0))<1.4); else if(etaregion=="endcap") goodEvent &= (abs(HPSTauEta->at(0))>=1.4); } @@ -367,38 +366,38 @@ class KBuilder : public TreeClass { && (PFJetMultiplicity >=1 && PFJetPt->at(0) > 25); //1 jet with pT > 25 GeV } else if(filter==3){ //z->mumu control region - if(option->Get("finaltaupt",false)) goodEvent &= HPSTauPt->at(0) > 50; + if(globalOpt->Get("finaltaupt",false)) goodEvent &= HPSTauPt->at(0) > 50; goodEvent &= (MassMuonMuon > 50); //dimuon mass cut - if(option->Get("zpeak",false)) goodEvent &= (MassMuonMuon > 70) && (MassMuonMuon < 110); //look only at region near Z mass peak (for normalization) + if(globalOpt->Get("zpeak",false)) goodEvent &= (MassMuonMuon > 70) && (MassMuonMuon < 110); //look only at region near Z mass peak (for normalization) int njets = 0; - if(option->Get("njets",njets)) { - if(option->Get("njets_excl",false)) goodEvent &= (PFJetMultiplicity == njets); + if(globalOpt->Get("njets",njets)) { + if(globalOpt->Get("njets_excl",false)) goodEvent &= (PFJetMultiplicity == njets); else goodEvent &= (PFJetMultiplicity >= njets); } int nbjets = 0; - if(option->Get("nbjets",nbjets)){ + if(globalOpt->Get("nbjets",nbjets)){ int nb = 0; for(int j = 0; j < PFJetPt->size(); j++){ if(PFJetCSVBTag->at(j)>0.244) nb++; } - if(option->Get("nbjets_excl",false)) goodEvent &= (nbjets == nb); + if(globalOpt->Get("nbjets_excl",false)) goodEvent &= (nbjets == nb); else goodEvent &= (nbjets >= nb); } } else if(filter==4){ //ttbar control region - if(option->Get("finaltaupt",false)) goodEvent &= HPSTauPt->at(0) > 50; + if(globalOpt->Get("finaltaupt",false)) goodEvent &= HPSTauPt->at(0) > 50; int njets = 0; - if(option->Get("njets",njets)){ - if(option->Get("njets_excl",false)) goodEvent &= (PFJetMultiplicity == njets); + if(globalOpt->Get("njets",njets)){ + if(globalOpt->Get("njets_excl",false)) goodEvent &= (PFJetMultiplicity == njets); else goodEvent &= (PFJetMultiplicity >= njets); } int nbjets = 0; - if(option->Get("nbjets",nbjets)){ + if(globalOpt->Get("nbjets",nbjets)){ int nb = 0; for(int j = 0; j < PFJetPt->size(); j++){ if(PFJetCSVBTag->at(j)>0.244) nb++; } - if(option->Get("nbjets_excl",false)) goodEvent &= (nbjets == nb); + if(globalOpt->Get("nbjets_excl",false)) goodEvent &= (nbjets == nb); else goodEvent &= (nbjets >= nb); } } @@ -410,8 +409,8 @@ class KBuilder : public TreeClass { virtual double Weight() { return 1.; } virtual void FakeTauEstimation(double w){ TGraphAsymmErrors* tfr = 0; - if(option->Get("use_mc_tfr",false)) option->Get("tfr_mc",tfr); - else option->Get("tfr_data",tfr); + if(globalOpt->Get("use_mc_tfr",false)) globalOpt->Get("tfr_mc",tfr); + else globalOpt->Get("tfr_data",tfr); Double_t *x, *xel, *xeh, *y, *yel, *yeh; x = tfr->GetX(); @@ -442,8 +441,8 @@ class KBuilder : public TreeClass { for(int i = 0; i < nbins; i++){ if(x[i] - xel[i] < HPSTauPt->at(t) && HPSTauPt->at(t) < x[i] + xeh[i]) { fr_curr = y[i]; - if(option->Get("tfr_unc_up",false)) fr_curr += yeh[i]; - else if(option->Get("tfr_unc_down",false)) fr_curr -= yel[i]; + if(globalOpt->Get("tfr_unc_up",false)) fr_curr += yeh[i]; + else if(globalOpt->Get("tfr_unc_down",false)) fr_curr -= yel[i]; break; } } @@ -476,12 +475,12 @@ class KBuilder : public TreeClass { //add result to database double ft_norm = 0; - option->Get("ft_norm",ft_norm); - option->Set("ft_norm",ft_norm + norm); + globalOpt->Get("ft_norm",ft_norm); + globalOpt->Set("ft_norm",ft_norm + norm); double ft_err = 0; - option->Get("ft_err",ft_err); - option->Set("ft_err",ft_err + sumw2); + globalOpt->Get("ft_err",ft_err); + globalOpt->Set("ft_err",ft_err + sumw2); } virtual void Loop() { @@ -511,7 +510,7 @@ class KBuilder : public TreeClass { double w = Weight(); - if(option->Get("calcfaketau",false)) FakeTauEstimation(w); + if(globalOpt->Get("calcfaketau",false)) FakeTauEstimation(w); HMit sit; for(sit = MyBase->GetTable().begin(); sit != MyBase->GetTable().end(); sit++){ @@ -566,7 +565,7 @@ class KBuilder : public TreeClass { if(PFJetPt->size()>0) htmp->Fill(dPhi(PFMETPhiPatType1,PFJetPhi->at(0)),w); } else if(stmp=="ptmu"){//muon pT - if(option->Get("calcfaketau",false)){ //data-driven shape estimation for fake tau ST + if(globalOpt->Get("calcfaketau",false)){ //data-driven shape estimation for fake tau ST for(int t = 0; t < HPSTauPt->size(); t++){ if(!FakeTauGenDecision[t]) continue; htmp->Fill(MuonPt,w*FakeTauWeight[t]); @@ -577,7 +576,7 @@ class KBuilder : public TreeClass { } } else if(stmp=="pttau"){//tau pT - if(option->Get("calcfaketau",false)){ //data-driven shape estimation for fake tau + if(globalOpt->Get("calcfaketau",false)){ //data-driven shape estimation for fake tau for(int t = 0; t < HPSTauPt->size(); t++){ if(!FakeTauGenDecision[t]) continue; htmp->Fill(HPSTauPt->at(t),w*FakeTauWeight[t]); @@ -595,12 +594,12 @@ class KBuilder : public TreeClass { } else if(stmp=="pttauall"){//tau pT (all taus) for(int t = 0; t < HPSTauPt->size(); t++){ - if(!option->Get("checkfaketau",false) || HPSTauFakeJet->at(t)) htmp->Fill(HPSTauPt->at(t),w); + if(!globalOpt->Get("checkfaketau",false) || HPSTauFakeJet->at(t)) htmp->Fill(HPSTauPt->at(t),w); } } else if(stmp=="pttauisoall"){//tau pT (all taus) w/ isolation (fake rate) for(int t = 0; t < HPSTauPt->size(); t++){ - if( (!option->Get("checkfaketau",false) || HPSTauFakeJet->at(t)) && HPSTaubyLooseCombinedIsolationDeltaBetaCorr3Hits->at(t)) htmp->Fill(HPSTauPt->at(t),w); + if( (!globalOpt->Get("checkfaketau",false) || HPSTauFakeJet->at(t)) && HPSTaubyLooseCombinedIsolationDeltaBetaCorr3Hits->at(t)) htmp->Fill(HPSTauPt->at(t),w); } } else if(stmp=="pttauantiisoall"){//tau pT (all taus) w/ anti-isolation @@ -644,7 +643,7 @@ class KBuilder : public TreeClass { htmp->Fill(MuonEta,w); } else if(stmp=="etatau"){//tau eta - if(option->Get("calcfaketau",false)){ //data-driven shape estimation for fake tau ST + if(globalOpt->Get("calcfaketau",false)){ //data-driven shape estimation for fake tau ST for(int t = 0; t < HPSTauEta->size(); t++){ if(!FakeTauGenDecision[t]) continue; htmp->Fill(HPSTauEta->at(t),w*FakeTauWeight[t]); @@ -656,12 +655,12 @@ class KBuilder : public TreeClass { } else if(stmp=="etatauall"){//tau eta (all taus) for(int t = 0; t < HPSTauPt->size(); t++){ - if(!option->Get("checkfaketau",false) || HPSTauFakeJet->at(t)) htmp->Fill(HPSTauEta->at(t),w); + if(!globalOpt->Get("checkfaketau",false) || HPSTauFakeJet->at(t)) htmp->Fill(HPSTauEta->at(t),w); } } else if(stmp=="etatauisoall"){//tau eta (all taus) w/ isolation (fake rate) for(int t = 0; t < HPSTauPt->size(); t++){ - if( (!option->Get("checkfaketau",false) || HPSTauFakeJet->at(t)) && HPSTaubyLooseCombinedIsolationDeltaBetaCorr3Hits->at(t)) htmp->Fill(HPSTauEta->at(t),w); + if( (!globalOpt->Get("checkfaketau",false) || HPSTauFakeJet->at(t)) && HPSTaubyLooseCombinedIsolationDeltaBetaCorr3Hits->at(t)) htmp->Fill(HPSTauEta->at(t),w); } } else if(stmp=="nvertex"){//# good vertices @@ -770,7 +769,7 @@ class KBuilder : public TreeClass { else if(stmp=="dvtx"){//difference in vertex indices for muon and selected jets bool foundB = false; bool foundJ = false; - if(option->Get("lqd321sel",false)) { + if(globalOpt->Get("lqd321sel",false)) { htmp->Fill(abs(MuonVtxIndex - PFJetVtxIndex->at(BJetIndices[0])),w); for(int j = 0; j < 4; j++){ htmp->Fill(abs(MuonVtxIndex - PFJetVtxIndex->at(JetIndices[j])),w); @@ -806,11 +805,11 @@ class KBuilder : public TreeClass { } else if(stmp=="st"){//scalar sum of momenta (defined differently for lqd321) double st_base = 0; - if(option->Get("lqd321sel",false)) st_base = MuonPt + PFJetPt->at(BJetIndices[0]) + PFJetPt->at(JetIndices[0]) + PFJetPt->at(JetIndices[1]) + PFJetPt->at(JetIndices[2]) + PFJetPt->at(JetIndices[3]); - else if(!option->Get("mainsel",false)) st_base = MuonPt + PFJetPt->at(0) + PFJetPt->at(1); + if(globalOpt->Get("lqd321sel",false)) st_base = MuonPt + PFJetPt->at(BJetIndices[0]) + PFJetPt->at(JetIndices[0]) + PFJetPt->at(JetIndices[1]) + PFJetPt->at(JetIndices[2]) + PFJetPt->at(JetIndices[3]); + else if(!globalOpt->Get("mainsel",false)) st_base = MuonPt + PFJetPt->at(0) + PFJetPt->at(1); else st_base = MuonPt + PFMainJetPt[0] + PFMainJetPt[1]; - if(option->Get("calcfaketau",false)){ //data-driven shape estimation for fake tau ST + if(globalOpt->Get("calcfaketau",false)){ //data-driven shape estimation for fake tau ST for(int t = 0; t < HPSTauPt->size(); t++){ if(!FakeTauGenDecision[t]) continue; htmp->Fill(st_base + HPSTauPt->at(t),w*FakeTauWeight[t]); @@ -820,19 +819,21 @@ class KBuilder : public TreeClass { double st_tot = st_base + HPSTauPt->at(0); htmp->Fill(st_tot,w); //printeventnum uses histo minimum as the threshold - if(option->Get("printeventnum",false) && st_tot > htmp->GetXaxis()->GetXmin()){ + if(globalOpt->Get("printeventnum",false) && st_tot > htmp->GetXaxis()->GetXmin()){ //run:ls:event format for crab - cout << "ST = " << st_tot << " GeV in " << MyBase->GetFileName() << endl; + string filename = ""; + localOpt->Get("filename",filename); + cout << "ST = " << st_tot << " GeV in " << filename << endl; cout << run << ":" << ls << ":" << event << endl; cout << "muon: pt = " << MuonPt << ", eta = " << MuonEta << ", phi = " << MuonPhi << endl; cout << "tau: pt = " << HPSTauPt->at(0) << ", eta = " << HPSTauEta->at(0) << ", phi = " << HPSTauPhi->at(0) << endl; - if(option->Get("lqd321sel",false)){ + if(globalOpt->Get("lqd321sel",false)){ cout << "b-jet: pt = " << PFJetPt->at(BJetIndices[0]) << ", eta = " << PFJetEta->at(BJetIndices[0]) << ", phi = " << PFJetPhi->at(BJetIndices[0]) << endl; for(int j = 0; j < 4; j++){ cout << "jet " << j+1 << ": pt = " << PFJetPt->at(JetIndices[j]) << ", eta = " << PFJetEta->at(JetIndices[j]) << ", phi = " << PFJetPhi->at(JetIndices[j]) << endl; } } - else if(!option->Get("mainsel",false)){ + else if(!globalOpt->Get("mainsel",false)){ cout << "jet 1: pt = " << PFJetPt->at(0) << ", eta = " << PFJetEta->at(0) << ", phi = " << PFJetPhi->at(0) << endl; cout << "jet 2: pt = " << PFJetPt->at(1) << ", eta = " << PFJetEta->at(1) << ", phi = " << PFJetPhi->at(1) << endl; } @@ -846,7 +847,7 @@ class KBuilder : public TreeClass { else if(stmp=="stlep"){//scalar sum of momenta for leptons double st_base = MuonPt; - if(option->Get("calcfaketau",false)){ //data-driven shape estimation for fake tau ST + if(globalOpt->Get("calcfaketau",false)){ //data-driven shape estimation for fake tau ST for(int t = 0; t < HPSTauPt->size(); t++){ if(!FakeTauGenDecision[t]) continue; htmp->Fill(st_base + HPSTauPt->at(t),w*FakeTauWeight[t]); @@ -858,11 +859,11 @@ class KBuilder : public TreeClass { } else if(stmp=="stjet"){//scalar sum of momenta for jets double st_base = 0; - if(option->Get("lqd321sel",false)) st_base = PFJetPt->at(BJetIndices[0]) + PFJetPt->at(JetIndices[0]) + PFJetPt->at(JetIndices[1]) + PFJetPt->at(JetIndices[2]) + PFJetPt->at(JetIndices[3]); - else if(!option->Get("mainsel",false)) st_base = PFJetPt->at(0) + PFJetPt->at(1); + if(globalOpt->Get("lqd321sel",false)) st_base = PFJetPt->at(BJetIndices[0]) + PFJetPt->at(JetIndices[0]) + PFJetPt->at(JetIndices[1]) + PFJetPt->at(JetIndices[2]) + PFJetPt->at(JetIndices[3]); + else if(!globalOpt->Get("mainsel",false)) st_base = PFJetPt->at(0) + PFJetPt->at(1); else st_base = PFMainJetPt[0] + PFMainJetPt[1]; - if(option->Get("calcfaketau",false)){ //data-driven shape estimation for fake tau ST + if(globalOpt->Get("calcfaketau",false)){ //data-driven shape estimation for fake tau ST for(int t = 0; t < HPSTauPt->size(); t++){ if(!FakeTauGenDecision[t]) continue; htmp->Fill(st_base,w*FakeTauWeight[t]); @@ -886,7 +887,7 @@ class KBuilder : public TreeClass { } } - if(option->Get("plotoverflow",false)){ + if(globalOpt->Get("plotoverflow",false)){ HMit sit; for(sit = MyBase->GetTable().begin(); sit != MyBase->GetTable().end(); sit++){ //get histo name @@ -916,7 +917,8 @@ class KBuilder : public TreeClass { protected: //member variables KBase* MyBase; - OptionMap* option; + OptionMap* localOpt; + OptionMap* globalOpt; map,int> countmap; string stmp; TH1F* htmp; @@ -960,7 +962,7 @@ class KBuilderData : public KBuilder { bool goodEvent = KBuilder::Cut(); //special blinding option for data (disabled by default) - if(option->Get("blind",false)){ + if(globalOpt->Get("blind",false)){ goodEvent &= (MassTauJet < 180); //do not look at signal region //could make this setting into a double value for variable blinding... } @@ -992,13 +994,15 @@ class KBuilderMC : public KBuilder { bool goodEvent = KBuilder::Cut(); //add extra MC cuts here - if(!option->Get("antiisosel",false)){ //do not do these checks for the anti-iso region, they will be done at object level where appropriate + if(!globalOpt->Get("antiisosel",false)){ //do not do these checks for the anti-iso region, they will be done at object level where appropriate + string normtype = ""; + localOpt->Get("normtype",normtype); int nchargino = 0; - if(MyBase->GetNormType()=="faketau" && option->Get("dofaketau",false)) goodEvent &= HPSTauFakeJet->at(0); - else if(MyBase->GetNormType()=="nofaketau" && option->Get("dofaketau",false)) goodEvent &= !HPSTauFakeJet->at(0); - else if(MyBase->GetNormType()=="ttbar" && option->Get("dottbar",false)) goodEvent &= HPSTauReal->at(0); - else if(MyBase->GetNormType()=="faketaulep" && option->Get("dottbar",false)) goodEvent &= HPSTauFakeLep->at(0); - else if(MyBase->GetNormType()=="chargino" && option->Get("dochargino",false) && option->Get("nchargino",nchargino)) goodEvent &= (CharginoMultiplicity == nchargino); + if(normtype=="faketau" && globalOpt->Get("dofaketau",false)) goodEvent &= HPSTauFakeJet->at(0); + else if(normtype=="nofaketau" && globalOpt->Get("dofaketau",false)) goodEvent &= !HPSTauFakeJet->at(0); + else if(normtype=="ttbar" && globalOpt->Get("dottbar",false)) goodEvent &= HPSTauReal->at(0); + else if(normtype=="faketaulep" && globalOpt->Get("dottbar",false)) goodEvent &= HPSTauFakeLep->at(0); + else if(normtype=="chargino" && globalOpt->Get("dochargino",false) && globalOpt->Get("nchargino",nchargino)) goodEvent &= (CharginoMultiplicity == nchargino); } return goodEvent; @@ -1008,37 +1012,38 @@ class KBuilderMC : public KBuilder { //check option in case correction types are disabled globally //(enabled by default) - if(option->Get("pucorr",true)) { + if(globalOpt->Get("pucorr",true)) { TH1F* puWeights; - option->Get("puWeights",puWeights); + globalOpt->Get("puWeights",puWeights); w *= puWeights->GetBinContent(puWeights->GetXaxis()->FindBin(trueNInteraction)); } - if(option->Get("mucorr",true)) { + if(globalOpt->Get("mucorr",true)) { TH2F* muIDTight; - option->Get("muIDTight",muIDTight); + globalOpt->Get("muIDTight",muIDTight); w *= muIDTight->GetBinContent(muIDTight->FindBin(fabs(MuonEta),MuonPt)); } - if(option->Get("btagcorr",true)) { + if(globalOpt->Get("btagcorr",true)) { int bSF = 0; int mSF = 0; - option->Get("btagSFunc",bSF); - option->Get("mistagSFunc",mSF); + globalOpt->Get("btagSFunc",bSF); + globalOpt->Get("mistagSFunc",mSF); //btag corrs only applied to specific plots in preselection - if(stmp=="leadbjetpt" || stmp=="secondbjetpt" || option->Get("mainsel",false) || option->Get("lqd321sel",false) || option->Get("dobtagcorr",false)) + if(stmp=="leadbjetpt" || stmp=="secondbjetpt" || globalOpt->Get("mainsel",false) || globalOpt->Get("lqd321sel",false) || globalOpt->Get("dobtagcorr",false)) w *= GetBtagScale(PFJetPt,PFJetEta,PFJetPartonFlavour,bSF,mSF); } //now do scaling: norm*xsection/nevents //should this be a separate function using Scale()? - int nEventProc = MyBase->GetNEventProc(); - if(nEventProc > 0) w *= MyBase->GetCrossSection()/nEventProc; + int nEventProc = 0; + double xsection = 0; + if(localOpt->Get("nEventProc",nEventProc) && nEventProc>0 && localOpt->Get("xsection",xsection)) w *= xsection/nEventProc; //get norm from options double norm = 0; //use lumi norm (default) - if(option->Get("luminorm",norm)) w *= norm; + if(globalOpt->Get("luminorm",norm)) w *= norm; return w; } diff --git a/Plotting/KCode/KManager.h b/Plotting/KCode/KManager.h index 1a8b8e57..37e81ad8 100644 --- a/Plotting/KCode/KManager.h +++ b/Plotting/KCode/KManager.h @@ -61,12 +61,12 @@ class KManager { double intlumi = 0; if(!(globalOpt->Get("luminorm",intlumi))) { for(unsigned s = 0; s < MySets.size(); s++){ - double tmp = MySets[s]->GetIntLumi(); + double tmp = 0; + MySets[s]->GetLocalOpt()->Get("intlumi",tmp); if(tmp>0) { intlumi = tmp; } } if(intlumi==0) intlumi = 1; //default value - KOption* otmp = new KOption(intlumi); - globalOpt->Add("luminorm",otmp); + globalOpt->Set("luminorm",intlumi); } //get special status options diff --git a/Plotting/KCode/KMap.h b/Plotting/KCode/KMap.h index e2efe433..6a17f616 100644 --- a/Plotting/KCode/KMap.h +++ b/Plotting/KCode/KMap.h @@ -155,6 +155,12 @@ class OptionMap : public KMap { KOpt* otmp = new KOption(val); Add(name,otmp); } + + //check if entry exists + bool Has(string name) { + typename map::iterator it = table.find(name); + return it != table.end(); + } }; diff --git a/Plotting/KCode/KParser.h b/Plotting/KCode/KParser.h index acd6744d..cb3b0d64 100644 --- a/Plotting/KCode/KParser.h +++ b/Plotting/KCode/KParser.h @@ -158,6 +158,16 @@ class KParser { } cout << endl;*/ + //check for necessary options + if(fields.size()<3) { + cout << "Input error: not enough fields in this line:" << endl << line << endl << "Check that all fields are tab-separated. This input will be ignored." << endl; + return; + } + //universal variables + string type = fields[0]; + string subtype = fields[1]; + string name = fields[2]; + //check corner cases for indent if(indent==0 && fields[0]=="base"){ cout << "Input error: base must have a parent set! This input will be ignored." << endl; @@ -166,7 +176,7 @@ class KParser { else if(indent>0){ map::iterator it = MyManager->curr_sets.find(indent-1); if(it == MyManager->curr_sets.end()){ - cout << "Input error: no parent can be identified for this set! There may be too many indents, or the parent was not input properly. This input will be ignored." << endl; + cout << "Input error: no parent can be identified for the set " << name << "! There may be too many indents, or the parent was not input properly. This input will be ignored." << endl; return; } } @@ -175,88 +185,38 @@ class KParser { map::iterator it = MyManager->curr_sets.lower_bound(indent); MyManager->curr_sets.erase(it,MyManager->curr_sets.end()); - if(fields.size()>=4){ - //keeps track of last used field - unsigned ctr = 0; + OptionMap* omap = new OptionMap(); //for local options + //process local options before constructing objects + for(int i = 3; i < fields.size(); i++){ + processOption(fields[i],omap); + } - KBase* tmp = 0; - if(fields[0]=="base"){ - if(fields[1]=="ext") { //external is different - tmp = new KBaseExt(fields[2],MyManager->globalOpt); - string filename = fields[3]; - ctr = 4; - - //check for specific histos to import - if(fields.size()>ctr+1) { - tmp->SetAddExt(true); - TFile* f_ext = TFile::Open(filename.c_str(),"READ"); - for(unsigned i = ctr; i < fields.size(); i+=2){ - TH1F* htmp = (TH1F*)f_ext->Get(fields[i+1].c_str()); - tmp->AddHisto(fields[i],htmp); - } - tmp->SetAddExt(false); - } - } - else{ - //intlumi for data or xsection for mc - double property = 0; - if(fields.size()>4) { stringstream ps(fields[4]); ps >> property; ctr = 5; } - else ctr = 4; - - //create object - string full_filename = MyManager->treedir + "/" + fields[3]; - if(fields[1]=="data") tmp = new KBaseData(fields[2],full_filename,MyManager->globalOpt,property); - else if(fields[1]=="mc") tmp = new KBaseMC(fields[2],full_filename,MyManager->globalOpt,property); - } - } - else { - //parse color - Color_t color = processColor(fields[3]); - - //create object - if(fields[0]=="hist" && fields[1]=="data") tmp = new KSetData(fields[2],color,MyManager->globalOpt); - else if(fields[0]=="hist" && fields[1]=="mc") tmp = new KSetMC(fields[2],color,MyManager->globalOpt); - else if(fields[0]=="stack" && fields[1]=="mc") tmp = new KSetMCStack(fields[2],color,MyManager->globalOpt); - ctr = 4; - } - - //store and add to parent set - if(tmp){ - MyManager->curr_sets[indent] = tmp; - if(indent==0) MyManager->MySets.push_back(MyManager->curr_sets[indent]); //add top-level set to manager - else { - MyManager->curr_sets[indent-1]->AddChild(tmp); - //cout << curr_sets[indent-1]->GetName() << "->AddChild(" << tmp->GetName() << ")" << endl; - } - - //check for additional options - if(fields.size()>ctr) { - for(unsigned i = ctr; i < fields.size(); i++){ - if(fields[1]=="mc"){ - if(fields[i].size()>2 && fields[i].compare(0,2,"NT")==0) MyManager->curr_sets[indent]->SetNormType(fields[i].substr(2)); - else if(fields[i].size()>3 && fields[i].compare(0,3,"NEP")==0) { - stringstream val; - val << fields[i].substr(3); - int n; - val >> n; - MyManager->curr_sets[indent]->SetNEventProc(n); - } - } - - else if(fields[i]=="subtract") MyManager->curr_sets[indent]->SetSubtract(true); - } - } - } + KBase* tmp = 0; + if(type=="base"){ + if(subtype=="ext") tmp = new KBaseExt(name,omap,MyManager->globalOpt); + else if(subtype=="data") tmp = new KBaseData(name,omap,MyManager->globalOpt); + else if(subtype=="mc") tmp = new KBaseMC(name,omap,MyManager->globalOpt); + } + else { + //create object + if(type=="hist" && subtype=="data") tmp = new KSetData(name,omap,MyManager->globalOpt); + else if(type=="hist" && subtype=="mc") tmp = new KSetMC(name,omap,MyManager->globalOpt); + else if(type=="stack" && subtype=="mc") tmp = new KSetMCStack(name,omap,MyManager->globalOpt); + } + + //store and add to parent set + if(tmp){ + MyManager->curr_sets[indent] = tmp; + if(indent==0) MyManager->MySets.push_back(MyManager->curr_sets[indent]); //add top-level set to manager else { - cout << "Input error: set type \"" << fields[0] << " " << fields[1] << "\" is not recognized. This input will be ignored." << endl; - return; + MyManager->curr_sets[indent-1]->AddChild(tmp); + //cout << curr_sets[indent-1]->GetName() << "->AddChild(" << tmp->GetName() << ")" << endl; } } else { - cout << "Input error: not enough fields in this line. Check that all fields are tab-separated. This input will be ignored." << endl; + cout << "Input error: set type \"" << type << " " << subtype << "\" is not recognized. This input will be ignored." << endl; return; } - } Color_t processColor(string line){ //color input is space-separated @@ -347,11 +307,13 @@ template <> Color_t KParser::getOptionValue(string val){ KManager::KManager(string in, string dir) : input(in),treedir(dir),globalOpt(0),numer(0),denom(0),yieldref(0),doPrint(false),varbins(0),nbins(0),parsed(false) { //parser does most initializations based on text input globalOpt = new OptionMap(); + //store treedir in global options + globalOpt->Set("treedir",treedir); MyParser = new KParser(this); parsed = MyParser->Parse(); //final checks and initializations - MyRatio = new KSetRatio(globalOpt); + MyRatio = new KSetRatio(NULL,globalOpt); if(globalOpt->Get("calcfaketau",false)) FakeTauEstimationInit(); //store correction root files centrally //todo: make file location and histo name configurable diff --git a/Plotting/KCode/KPlot.h b/Plotting/KCode/KPlot.h index d8cb13bb..7937eb9b 100644 --- a/Plotting/KCode/KPlot.h +++ b/Plotting/KCode/KPlot.h @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -46,7 +47,9 @@ class KPlot{ if(localOpt==0) localOpt = new OptionMap(); if(globalOpt==0) globalOpt = new OptionMap(); - //construct histogram + //enable histo errors + TH1::SetDefaultSumw2(kTRUE); + //construct histogram vector xbins; int xnum; double xmin, xmax; diff --git a/Plotting/KCode/KSet.h b/Plotting/KCode/KSet.h index 0cace6cc..2e034e2a 100644 --- a/Plotting/KCode/KSet.h +++ b/Plotting/KCode/KSet.h @@ -24,11 +24,14 @@ using namespace std; //------------------------------------------------------------------------------------------ //set class: has children and a parent (KBase or KBase-derived) // inherits from KBase to allow for sets of sets +// default value for color class KSet : public KBase { public: //constructor - KSet() : KBase(), color(kBlack) {} - KSet(string name_, Color_t color_, OptionMap* option_) : KBase(name_,"",option_), color(color_) {} + KSet() : KBase() { localOpt->Set("color",kBlack); } + KSet(string name_, OptionMap* localOpt_, OptionMap* globalOpt_) : KBase(name_, localOpt_, globalOpt_) { + if(!localOpt->Has("color")) localOpt->Set("color",kBlack); + } //destructor virtual ~KSet() {} @@ -50,8 +53,8 @@ class KSet : public KBase { HMit sit; for(sit = MyHistos.GetTable().begin(); sit != MyHistos.GetTable().end(); sit++){ GetHisto(sit->first); //this will propagate to children - for(unsigned c = 0; c < children.size(); c++){ //include option to subtract histos - htmp->Add(children[c]->GetHisto(), children[c]->GetSubtract() ? -1 : 1); + for(unsigned c = 0; c < children.size(); c++){ //include option to subtract histos, off by default + htmp->Add(children[c]->GetHisto(), children[c]->GetLocalOpt()->Get("subtract",false) ? -1 : 1); } } } @@ -86,13 +89,8 @@ class KSet : public KBase { } } - //accessors - Color_t GetColor() { return color; } - void SetColor(Color_t c) { color = c; } - protected: //member variables - Color_t color; KBase* parent; //overloaded variable name vector children; }; @@ -103,14 +101,19 @@ class KSetData: public KSet { public: //constructor KSetData() : KSet() {} - KSetData(string name_, Color_t color_, OptionMap* option_) : KSet(name_,color_,option_) {} + KSetData(string name_, OptionMap* localOpt_, OptionMap* globalOpt_) : KSet(name_, localOpt_, globalOpt_) {} //destructor virtual ~KSetData() {} //sum up lumi when adding children void AddChild(KBase* ch){ KSet::AddChild(ch); - intlumi += ch->GetIntLumi(); + double intlumi, intlumi_ch; + intlumi = intlumi_ch = 0; + if(ch->GetLocalOpt()->Get("intlumi",intlumi_ch)) { + localOpt->Get("intlumi",intlumi); + localOpt->Set("intlumi",intlumi + intlumi_ch); + } } //add function - does formatting TH1F* AddHisto(string s, TH1F* h){ @@ -121,6 +124,8 @@ class KSetData: public KSet { children[c]->AddHisto(s,h); } + Color_t color; + localOpt->Get("color",color); //formatting htmp->SetLineColor(color); htmp->SetMarkerColor(color); @@ -132,7 +137,7 @@ class KSetData: public KSet { //adds histo to legend void AddToLegend(TLegend* leg) { //only draw horizontal line if horizontal error bar is enabled - if(option->Get("horizerrbars",false) || htmp->GetXaxis()->IsVariableBinSize()){ + if(globalOpt->Get("horizerrbars",false) || htmp->GetXaxis()->IsVariableBinSize()){ leg->AddEntry(htmp,name.c_str(),"pel"); } //note: this setting only works in ROOT 5.34.11+ @@ -152,7 +157,7 @@ class KSetMC: public KSet { public: //constructor KSetMC() : KSet() {} - KSetMC(string name_, Color_t color_, OptionMap* option_) : KSet(name_,color_,option_) {} + KSetMC(string name_, OptionMap* localOpt_, OptionMap* globalOpt_) : KSet(name_, localOpt_, globalOpt_) {} //destructor virtual ~KSetMC() {} @@ -167,7 +172,7 @@ class KSetMC: public KSet { for(sit = MyHistos.GetTable().begin(); sit != MyHistos.GetTable().end(); sit++){ GetHisto(sit->first); //this will propagate to children for(unsigned c = 0; c < children.size(); c++){ //include option to subtract histos - htmp->Add(children[c]->GetHisto(), children[c]->GetSubtract() ? -1 : 1); + htmp->Add(children[c]->GetHisto(), children[c]->GetLocalOpt()->Get("subtract",false) ? -1 : 1); } //use alternative data-driven normalizations (fake tau, real ttbar) if everything is enabled @@ -177,15 +182,16 @@ class KSetMC: public KSet { double normerr = 0; bool do_err_prop = false; TH1F* htmp2 = 0; - if(normType=="faketau" && option->Get("dofaketau",false) && option->Get("faketaunorm",norm)){ - if(option->Get("faketauerr",normerr)) { + string normtype = ""; + if(localOpt->Get("normtype",normtype) && normtype=="faketau" && globalOpt->Get("dofaketau",false) && globalOpt->Get("faketaunorm",norm)){ + if(globalOpt->Get("faketauerr",normerr)) { do_err_prop = true; htmp2 = (TH1F*)htmp->Clone(); } htmp->Scale(norm/simyield); } - else if(normType=="ttbar" && option->Get("dottbar",false) && option->Get("ttbarnorm",norm)){ - if(option->Get("ttbarerr",normerr)) { + else if(localOpt->Get("normtype",normtype) && normtype=="ttbar" && globalOpt->Get("dottbar",false) && globalOpt->Get("ttbarnorm",norm)){ + if(globalOpt->Get("ttbarerr",normerr)) { do_err_prop = true; htmp2 = (TH1F*)htmp->Clone(); } @@ -222,6 +228,8 @@ class KSetMC: public KSet { children[c]->AddHisto(s,h); } + Color_t color; + localOpt->Get("color",color); //formatting htmp->SetFillColor(0); htmp->SetLineColor(color); @@ -249,7 +257,7 @@ class KSetMCStack : public KSet { public: //constructor KSetMCStack() : KSet() {} - KSetMCStack(string name_, Color_t color_, OptionMap* option_) : KSet(name_,color_,option_), shtmp(0) {} + KSetMCStack(string name_, OptionMap* localOpt_, OptionMap* globalOpt_) : KSet(name_, localOpt_, globalOpt_), shtmp(0) {} //destructor virtual ~KSetMCStack() {} @@ -263,11 +271,14 @@ class KSetMCStack : public KSet { for(unsigned c = 0; c < children.size(); c++){ TH1F* ctmp = children[c]->AddHisto(s,h); //fix formatting of ctmp for stack - ctmp->SetFillColor(children[c]->GetColor()); - ctmp->SetLineColor(children[c]->GetColor()); - ctmp->SetMarkerColor(children[c]->GetColor()); + Color_t color; + children[c]->GetLocalOpt()->Get("color",color); + ctmp->SetFillColor(color); + ctmp->SetLineColor(color); + ctmp->SetMarkerColor(color); ctmp->SetLineWidth(1); - if(children[c]->GetName().compare(0,2,"LQ")==0 && option->Get("sigstack",false)){ + string sigstack = ""; + if(globalOpt->Get("sigstack",sigstack) && children[c]->GetName()==sigstack){ ctmp->SetFillColor(kWhite); ctmp->SetLineColor(kBlack); ctmp->SetMarkerColor(kBlack); @@ -292,22 +303,23 @@ class KSetMCStack : public KSet { //sort vector of children according to current histo - BEFORE adding to stack //unless disabled by user - if(!option->Get("nosort",false)) sort(children.begin(),children.end(),KComp()); + if(!globalOpt->Get("nosort",false)) sort(children.begin(),children.end(),KComp()); + string sigstack = ""; + bool do_sigstack = globalOpt->Get("sigstack",sigstack); + int c_sigstack = -1; for(unsigned c = 0; c < children.size(); c++){ - if(children[c]->GetName().compare(0,2,"LQ")==0 && option->Get("sigstack",false)) {} //do not add stacked signal yet + if(do_sigstack && children[c]->GetName()==sigstack) c_sigstack = c; //do not add stacked signal yet, just store index else shtmp->Add(children[c]->GetHisto()); } //fill in htmp now that shtmp is built htmp = (TH1F*)shtmp->GetStack()->Last(); //build error band, enabled by default - if(option->Get("errband",true)) BuildErrorBand(); + if(globalOpt->Get("errband",true)) BuildErrorBand(); - for(unsigned c = 0; c < children.size(); c++){ - //add stacked signal histo after calculating error band - if(children[c]->GetName().compare(0,2,"LQ")==0 && option->Get("sigstack",false)) shtmp->Add(children[c]->GetHisto()); - } + //add stacked signal histo after calculating error band + if(c_sigstack > -1) shtmp->Add(children[c_sigstack]->GetHisto()); } } //polymorphic GetHisto for stacks @@ -331,12 +343,12 @@ class KSetMCStack : public KSet { for(unsigned c = 0; c < children.size(); c++){ children[c]->GetLegendInfo(kleg); } - if(option->Get("errband",true)) kleg->CheckSize("uncertainty"); + if(globalOpt->Get("errband",true)) kleg->CheckSize("uncertainty"); } //adds child histos to legend void AddToLegend(TLegend* leg) { //sort vector of children according to current histo - BEFORE adding to legend - if(!option->Get("nosort",false)) sort(children.begin(),children.end(),KComp()); + if(!globalOpt->Get("nosort",false)) sort(children.begin(),children.end(),KComp()); //add to legend in reverse order so largest is first for(int c = children.size()-1; c >= 0; c--){ @@ -345,7 +357,7 @@ class KSetMCStack : public KSet { leg->AddEntry(ctmp,cname.c_str(),"f"); } //error band enabled by default - if(option->Get("errband",true)) leg->AddEntry(etmp,"uncertainty","f"); + if(globalOpt->Get("errband",true)) leg->AddEntry(etmp,"uncertainty","f"); //this assumes it has already been created previously... a little unsafe, but a pain in the ass otherwise } //draw function @@ -354,9 +366,9 @@ class KSetMCStack : public KSet { shtmp->Draw("hist same"); //error band enabled by default - if(option->Get("errband",true)) etmp->Draw("2 same"); + if(globalOpt->Get("errband",true)) etmp->Draw("2 same"); - if(option->Get("bgline",false)&&htmp){ + if(globalOpt->Get("bgline",false)&&htmp){ TH1F* hoverlay = (TH1F*)htmp->Clone(); hoverlay->SetFillColor(0); hoverlay->SetLineColor(kBlack); @@ -383,7 +395,7 @@ class KSetMCStack : public KSet { } //rebuild error band (enabled by default) - if(option->Get("errband",true)) BuildErrorBand(); + if(globalOpt->Get("errband",true)) BuildErrorBand(); } //divide current histo by bin width, stack implementation void BinDivide(){ @@ -403,7 +415,7 @@ class KSetMCStack : public KSet { } //rebuild error band (enabled by default) - if(option->Get("errband",true)) BuildErrorBand(); + if(globalOpt->Get("errband",true)) BuildErrorBand(); } //print yield from children void PrintYield() { @@ -435,7 +447,10 @@ class KSetRatio: public KSet { public: //constructor KSetRatio() : KSet() {} - KSetRatio(OptionMap* option_) : KSet("ratio",kBlack,option_) { children.resize(2); } + KSetRatio(OptionMap* localOpt_, OptionMap* globalOpt_) : KSet("ratio", localOpt_, globalOpt_) { + localOpt->Set("color",kBlack); + children.resize(2); + } //destructor virtual ~KSetRatio() {} @@ -458,6 +473,8 @@ class KSetRatio: public KSet { } hrat->Divide(hdata,hsim0); + Color_t color; + localOpt->Get("color",color); //formatting hrat->SetLineColor(color); hrat->SetMarkerColor(color); @@ -471,7 +488,7 @@ class KSetRatio: public KSet { MyHistos.Add(stmp,htmp); //error band enabled by default - if(option->Get("errband",true)) BuildErrorBand(); + if(globalOpt->Get("errband",true)) BuildErrorBand(); } //calculate ratio error band from denom TGraphAsymmErrors* BuildErrorBand(){ @@ -504,7 +521,7 @@ class KSetRatio: public KSet { void Draw(TPad* pad) { pad->cd(); //error band enabled by default - if(option->Get("errband",true)) etmp->Draw("2 same"); + if(globalOpt->Get("errband",true)) etmp->Draw("2 same"); htmp->Draw("PE same"); } diff --git a/Plotting/input_final_dd_fig.txt b/Plotting/input_final_dd_fig.txt index 603026b0..390eb688 100644 --- a/Plotting/input_final_dd_fig.txt +++ b/Plotting/input_final_dd_fig.txt @@ -1,8 +1,10 @@ #three sections: global options in OPTION, 1D histograms in HISTO, datasets in SET #option format is: type:name[val] or vtype:name[val1,val2,...] #available types are (full/abbrev): bool/b, int/i, double/d, string/s, color/c -#items on each line in the HISTO and SET sections must be tab-separated -#for datasets, each source must be listed after the appropriate group +#items on each line in the HISTO and SET sections must be tab-separated, with required items first, in order +#HISTO: only required item is name (but without binning options afterward, it won't build properly) +#SET: required items are type (stack, hist, base), subtype (data, mc, ext), name +#for datasets, child-parent relationships are indicated by tab-indentation OPTION vstring:printformat[eps] @@ -41,59 +43,59 @@ masstaub i:xnum[50] d:xmin[0] d:xmax[1000] s:xtitle[M_{#taub} [GeV]] s:ytitle[nu st vd:xbins[140,210,280,350,420,480,540,620,700,780,870,980,1100,1200] s:xtitle[S_{T} [GeV]] s:ytitle[number of events / GeV] b:liny[1] b:ratio[0] b:bindivide[1] SET -hist data data kBlack - base data SingleMu_A tree_SingleMu_A_190456_208686_muTau.root 0 - base data SingleMu_B_0 tree_SingleMu_B_190456_208686_muTau_0.root 0 - base data SingleMu_B_1 tree_SingleMu_B_190456_208686_muTau_1.root 0 - base data SingleMu_C_0 tree_SingleMu_C_190456_208686_muTau_0.root 0 - base data SingleMu_C_1 tree_SingleMu_C_190456_208686_muTau_1.root 0 - base data SingleMu_C_2 tree_SingleMu_C_190456_208686_muTau_2.root 0 - base data SingleMu_C_3 tree_SingleMu_C_190456_208686_muTau_3.root 0 - base data SingleMu_D_0 tree_SingleMu_D_190456_208686_muTau_0.root 0 - base data SingleMu_D_1 tree_SingleMu_D_190456_208686_muTau_1.root 0 - base data SingleMu_D_2 tree_SingleMu_D_190456_208686_muTau_2.root 0 - base data SingleMu_D_3 tree_SingleMu_D_190456_208686_muTau_3.root 0 -hist mc LQ500 kBlack - base mc LQ500_tb tree_LQ500_tb_muTau.root 0.082 -#hist mc LQ400 kBlack -# base mc LQ400_tb tree_LQ400_tb_muTau.root 0.342 -stack mc mc kWhite - hist mc VV kRed + 1 - base mc WZ tree_WZ_muTau.root 33.59 - base mc WW tree_WW_muTau.root 55.47 - base mc ZZ tree_ZZ_muTau.root 8.27 - hist mc single-t kOrange + 7 - base mc T_tWchan tree_T_tWchan_muTau.root 11.1 - base mc Tbar_tWchan tree_Tbar_tWchan_muTau.root 11.1 - base mc T_tchan tree_T_tchan_muTau.root 30.7 - base mc Tbar_tchan tree_Tbar_tchan_muTau.root 56.4 - base mc T_schan tree_T_schan_muTau.root 1.76 - base mc Tbar_schan tree_Tbar_schan_muTau.root 3.79 - hist mc t#bar{t} kOrange - 2 - base mc TTbarJets tree_TTbarJets_muTau.root 234 NTfaketaulep - hist mc t#bar{t} (real #tau) kViolet + 1 NTttbar - base mc TTbarJets tree_TTbarJets_2l_muTau.root 24.56 NTttbar - hist mc Z(ll/#tau#tau) + jets kBlue - 9 - base mc ZJets_2l tree_ZJets_2l_muTau.root 3503.71 NTnofaketau -# base mc Z1Jets_2l tree_Z1Jets_2l_muTau.root 666.3 NTnofaketau -# base mc Z2Jets_2l tree_Z2Jets_2l_muTau.root 214.97 NTnofaketau -# base mc Z3Jets_2l tree_Z3Jets_2l_muTau.root 60.69 NTnofaketau -# base mc Z4Jets_2l tree_Z4Jets_2l_muTau.root 27.36 NTnofaketau - hist mc Fake #tau kViolet + 1 NTfaketau -# base mc WJets_ln tree_WJets_ln_muTau.root 37509.0 NTfaketau -# base mc ZJets_2l tree_ZJets_2l_muTau.root 3503.71 NTfaketau -# base mc TTbarJets tree_TTbarJets_muTau.root 234 NTfaketau - base mc W1Jets_ln tree_W1Jets_ln_muTau.root 6440.58 NTfaketau - base mc W2Jets_ln tree_W2Jets_ln_muTau.root 2087.225 NTfaketau - base mc W3Jets_ln tree_W3Jets_ln_muTau.root 619.0113 NTfaketau - base mc W4Jets_ln tree_W4Jets_ln_muTau.root 255.2378 NTfaketau - base mc Z1Jets_2l tree_Z1Jets_2l_muTau.root 666.3 NTfaketau - base mc Z2Jets_2l tree_Z2Jets_2l_muTau.root 214.97 NTfaketau - base mc Z3Jets_2l tree_Z3Jets_2l_muTau.root 60.69 NTfaketau - base mc Z4Jets_2l tree_Z4Jets_2l_muTau.root 27.36 NTfaketau - base mc TTbarJets2l tree_TTbarJets_2l_muTau.root 24.56 NTfaketau - base mc TTbarJetsSl1 tree_TTbarJetsSemiLep_1_muTau.root 102.51 NTfaketau - base mc TTbarJetsSl2 tree_TTbarJetsSemiLep_2_muTau.root 102.51 NTfaketau - base mc TTbarJetsSl3 tree_TTbarJetsSemiLep_3_muTau.root 102.51 NTfaketau - base mc TTbarJetsSl4 tree_TTbarJetsSemiLep_4_muTau.root 102.51 NTfaketau - base mc TTbarJetsSl5 tree_TTbarJetsSemiLep_5_muTau.root 102.51 NTfaketau +hist data data c:color[kBlack] + base data SingleMu_A s:filename[tree_SingleMu_A_190456_208686_muTau.root] + base data SingleMu_B_0 s:filename[tree_SingleMu_B_190456_208686_muTau_0.root] + base data SingleMu_B_1 s:filename[tree_SingleMu_B_190456_208686_muTau_1.root] + base data SingleMu_C_0 s:filename[tree_SingleMu_C_190456_208686_muTau_0.root] + base data SingleMu_C_1 s:filename[tree_SingleMu_C_190456_208686_muTau_1.root] + base data SingleMu_C_2 s:filename[tree_SingleMu_C_190456_208686_muTau_2.root] + base data SingleMu_C_3 s:filename[tree_SingleMu_C_190456_208686_muTau_3.root] + base data SingleMu_D_0 s:filename[tree_SingleMu_D_190456_208686_muTau_0.root] + base data SingleMu_D_1 s:filename[tree_SingleMu_D_190456_208686_muTau_1.root] + base data SingleMu_D_2 s:filename[tree_SingleMu_D_190456_208686_muTau_2.root] + base data SingleMu_D_3 s:filename[tree_SingleMu_D_190456_208686_muTau_3.root] +hist mc LQ500 c:color[kBlack] + base mc LQ500_tb s:filename[tree_LQ500_tb_muTau.root] d:xsection[0.082] +#hist mc LQ400 c:color[kBlack] +# base mc LQ400_tb s:filename[tree_LQ400_tb_muTau.root] d:xsection[0.342] +stack mc mc c:color[kWhite] + hist mc VV c:color[kRed + 1] + base mc WZ s:filename[tree_WZ_muTau.root] d:xsection[33.59] + base mc WW s:filename[tree_WW_muTau.root] d:xsection[55.47] + base mc ZZ s:filename[tree_ZZ_muTau.root] d:xsection[8.27] + hist mc single-t c:color[kOrange + 7] + base mc T_tWchan s:filename[tree_T_tWchan_muTau.root] d:xsection[11.1] + base mc Tbar_tWchan s:filename[tree_Tbar_tWchan_muTau.root] d:xsection[11.1] + base mc T_tchan s:filename[tree_T_tchan_muTau.root] d:xsection[30.7] + base mc Tbar_tchan s:filename[tree_Tbar_tchan_muTau.root] d:xsection[56.4] + base mc T_schan s:filename[tree_T_schan_muTau.root] d:xsection[1.76] + base mc Tbar_schan s:filename[tree_Tbar_schan_muTau.root] d:xsection[3.79] + hist mc t#bar{t} c:color[kOrange - 2] + base mc TTbarJets s:filename[tree_TTbarJets_muTau.root] d:xsection[234] s:normtype[faketaulep] + hist mc t#bar{t} (real #tau) c:color[kViolet + 1] s:normtype[ttbar] + base mc TTbarJets s:filename[tree_TTbarJets_2l_muTau.root] d:xsection[24.56] s:normtype[ttbar] + hist mc Z(ll/#tau#tau) + jets c:color[kBlue - 9] + base mc ZJets_2l s:filename[tree_ZJets_2l_muTau.root] d:xsection[3503.71] s:normtype[nofaketau] +# base mc Z1Jets_2l s:filename[tree_Z1Jets_2l_muTau.root] d:xsection[666.3] s:normtype[nofaketau] +# base mc Z2Jets_2l s:filename[tree_Z2Jets_2l_muTau.root] d:xsection[214.97] s:normtype[nofaketau] +# base mc Z3Jets_2l s:filename[tree_Z3Jets_2l_muTau.root] d:xsection[60.69] s:normtype[nofaketau] +# base mc Z4Jets_2l s:filename[tree_Z4Jets_2l_muTau.root] d:xsection[27.36] s:normtype[nofaketau] + hist mc Fake #tau c:color[kViolet + 1] s:normtype[faketau] +# base mc WJets_ln s:filename[tree_WJets_ln_muTau.root] d:xsection[37509.0] s:normtype[faketau] +# base mc ZJets_2l s:filename[tree_ZJets_2l_muTau.root] d:xsection[3503.71] s:normtype[faketau] +# base mc TTbarJets s:filename[tree_TTbarJets_muTau.root] d:xsection[234] s:normtype[faketau] + base mc W1Jets_ln s:filename[tree_W1Jets_ln_muTau.root] d:xsection[6440.58] s:normtype[faketau] + base mc W2Jets_ln s:filename[tree_W2Jets_ln_muTau.root] d:xsection[2087.225] s:normtype[faketau] + base mc W3Jets_ln s:filename[tree_W3Jets_ln_muTau.root] d:xsection[619.0113] s:normtype[faketau] + base mc W4Jets_ln s:filename[tree_W4Jets_ln_muTau.root] d:xsection[255.2378] s:normtype[faketau] + base mc Z1Jets_2l s:filename[tree_Z1Jets_2l_muTau.root] d:xsection[666.3] s:normtype[faketau] + base mc Z2Jets_2l s:filename[tree_Z2Jets_2l_muTau.root] d:xsection[214.97] s:normtype[faketau] + base mc Z3Jets_2l s:filename[tree_Z3Jets_2l_muTau.root] d:xsection[60.69] s:normtype[faketau] + base mc Z4Jets_2l s:filename[tree_Z4Jets_2l_muTau.root] d:xsection[27.36] s:normtype[faketau] + base mc TTbarJets2l s:filename[tree_TTbarJets_2l_muTau.root] d:xsection[24.56] s:normtype[faketau] + base mc TTbarJetsSl1 s:filename[tree_TTbarJetsSemiLep_1_muTau.root] d:xsection[102.51] s:normtype[faketau] + base mc TTbarJetsSl2 s:filename[tree_TTbarJetsSemiLep_2_muTau.root] d:xsection[102.51] s:normtype[faketau] + base mc TTbarJetsSl3 s:filename[tree_TTbarJetsSemiLep_3_muTau.root] d:xsection[102.51] s:normtype[faketau] + base mc TTbarJetsSl4 s:filename[tree_TTbarJetsSemiLep_4_muTau.root] d:xsection[102.51] s:normtype[faketau] + base mc TTbarJetsSl5 s:filename[tree_TTbarJetsSemiLep_5_muTau.root] d:xsection[102.51] s:normtype[faketau] diff --git a/Plotting/input_final_dd_shapesyst_datacard.txt b/Plotting/input_final_dd_shapesyst_datacard.txt index 545ade3f..9add1d4e 100644 --- a/Plotting/input_final_dd_shapesyst_datacard.txt +++ b/Plotting/input_final_dd_shapesyst_datacard.txt @@ -25,84 +25,84 @@ HISTO st i:xnum[120] d:xmin[0] d:xmax[1200] s:xtitle[S_{T} [GeV]] s:ytitle[number of events / 10 GeV] b:ratio[0] b:liny[1] SET -hist data data kBlack - base data SingleMu_A tree_SingleMu_A_190456_208686_muTau.root 0 - base data SingleMu_B_0 tree_SingleMu_B_190456_208686_muTau_0.root 0 - base data SingleMu_B_1 tree_SingleMu_B_190456_208686_muTau_1.root 0 - base data SingleMu_C_0 tree_SingleMu_C_190456_208686_muTau_0.root 0 - base data SingleMu_C_1 tree_SingleMu_C_190456_208686_muTau_1.root 0 - base data SingleMu_C_2 tree_SingleMu_C_190456_208686_muTau_2.root 0 - base data SingleMu_C_3 tree_SingleMu_C_190456_208686_muTau_3.root 0 - base data SingleMu_D_0 tree_SingleMu_D_190456_208686_muTau_0.root 0 - base data SingleMu_D_1 tree_SingleMu_D_190456_208686_muTau_1.root 0 - base data SingleMu_D_2 tree_SingleMu_D_190456_208686_muTau_2.root 0 - base data SingleMu_D_3 tree_SingleMu_D_190456_208686_muTau_3.root 0 -hist mc single-t kMagenta + 1 - base mc T_tWchan tree_T_tWchan_muTau.root 11.1 - base mc Tbar_tWchan tree_Tbar_tWchan_muTau.root 11.1 - base mc T_tchan tree_T_tchan_muTau.root 30.7 - base mc Tbar_tchan tree_Tbar_tchan_muTau.root 56.4 - base mc T_schan tree_T_schan_muTau.root 1.76 - base mc Tbar_schan tree_Tbar_schan_muTau.root 3.79 -hist mc t#bar{t} kViolet + 1 - base mc TTbarJets tree_TTbarJets_muTau.root 234 NTfaketaulep - hist mc t#bar{t} (real #tau) kViolet + 1 NTttbar - base mc TTbarJets tree_TTbarJets_2l_muTau.root 24.56 NTttbar -hist mc diboson kRed + 1 - base mc WZ tree_WZ_muTau.root 33.59 - base mc WW tree_WW_muTau.root 55.47 - base mc ZZ tree_ZZ_muTau.root 8.27 -hist mc Z + jets kOrange - 3 - base mc ZJets_2l tree_ZJets_2l_muTau.root 3503.71 NTnofaketau -hist mc Fake #tau kAzure + 2 NTfaketau -# base mc WJets_ln tree_WJets_ln_muTau.root 37509.0 NTfaketau -# base mc ZJets_2l tree_ZJets_2l_muTau.root 3503.71 NTfaketau -# base mc TTbarJets tree_TTbarJets_muTau.root 234 NTfaketau - base mc W1Jets_ln tree_W1Jets_ln_muTau.root 6440.58 NTfaketau - base mc W2Jets_ln tree_W2Jets_ln_muTau.root 2087.225 NTfaketau - base mc W3Jets_ln tree_W3Jets_ln_muTau.root 619.0113 NTfaketau - base mc W4Jets_ln tree_W4Jets_ln_muTau.root 255.2378 NTfaketau - base mc Z1Jets_2l tree_Z1Jets_2l_muTau.root 666.3 NTfaketau - base mc Z2Jets_2l tree_Z2Jets_2l_muTau.root 214.97 NTfaketau - base mc Z3Jets_2l tree_Z3Jets_2l_muTau.root 60.69 NTfaketau - base mc Z4Jets_2l tree_Z4Jets_2l_muTau.root 27.36 NTfaketau - base mc TTbarJets2l tree_TTbarJets_2l_muTau.root 24.56 NTfaketau - base mc TTbarJetsSl1 tree_TTbarJetsSemiLep_1_muTau.root 102.51 NTfaketau - base mc TTbarJetsSl2 tree_TTbarJetsSemiLep_2_muTau.root 102.51 NTfaketau - base mc TTbarJetsSl3 tree_TTbarJetsSemiLep_3_muTau.root 102.51 NTfaketau - base mc TTbarJetsSl4 tree_TTbarJetsSemiLep_4_muTau.root 102.51 NTfaketau - base mc TTbarJetsSl5 tree_TTbarJetsSemiLep_5_muTau.root 102.51 NTfaketau -hist mc LQ200 kGray + 1 - base mc LQ200_tb tree_LQ200_tb_muTau.root 17.4 -hist mc LQ250 kGray + 1 - base mc LQ250_tb tree_LQ250_tb_muTau.root 5.26 -hist mc LQ300 kGray + 1 - base mc LQ300_tb tree_LQ300_tb_muTau.root 1.89 -hist mc LQ350 kGray + 1 - base mc LQ350_tb tree_LQ350_tb_muTau.root 0.77 -hist mc LQ400 kGray + 1 - base mc LQ400_tb tree_LQ400_tb_muTau.root 0.342 -hist mc LQ450 kGray + 1 - base mc LQ450_tb tree_LQ450_tb_muTau.root 0.163 -hist mc LQ500 kGray + 1 - base mc LQ500_tb tree_LQ500_tb_muTau.root 0.082 -hist mc LQ550 kGray + 1 - base mc LQ550_tb tree_LQ550_tb_muTau.root 0.0431 -hist mc LQ600 kGray + 1 - base mc LQ600_tb tree_LQ600_tb_muTau.root 0.0235 -hist mc LQ650 kGray + 1 - base mc LQ650_tb tree_LQ650_tb_muTau.root 0.0132 -hist mc LQ700 kGray + 1 - base mc LQ700_tb tree_LQ700_tb_muTau.root 0.00761 -hist mc LQ750 kGray + 1 - base mc LQ750_tb tree_LQ750_tb_muTau.root 0.00448 -hist mc LQ800 kGray + 1 - base mc LQ800_tb tree_LQ800_tb_muTau.root 0.00269 -hist mc LQ850 kGray + 1 - base mc LQ850_tb tree_LQ850_tb_muTau.root 0.00164 -hist mc LQ900 kGray + 1 - base mc LQ900_tb tree_LQ900_tb_muTau.root 0.00101 -hist mc LQ950 kGray + 1 - base mc LQ950_tb tree_LQ950_tb_muTau.root 0.000634 -hist mc LQ1000 kGray + 1 - base mc LQ1000_tb tree_LQ1000_tb_muTau.root 0.000401 \ No newline at end of file +hist data data c:color[kBlack] + base data SingleMu_A s:filename[tree_SingleMu_A_190456_208686_muTau.root] + base data SingleMu_B_0 s:filename[tree_SingleMu_B_190456_208686_muTau_0.root] + base data SingleMu_B_1 s:filename[tree_SingleMu_B_190456_208686_muTau_1.root] + base data SingleMu_C_0 s:filename[tree_SingleMu_C_190456_208686_muTau_0.root] + base data SingleMu_C_1 s:filename[tree_SingleMu_C_190456_208686_muTau_1.root] + base data SingleMu_C_2 s:filename[tree_SingleMu_C_190456_208686_muTau_2.root] + base data SingleMu_C_3 s:filename[tree_SingleMu_C_190456_208686_muTau_3.root] + base data SingleMu_D_0 s:filename[tree_SingleMu_D_190456_208686_muTau_0.root] + base data SingleMu_D_1 s:filename[tree_SingleMu_D_190456_208686_muTau_1.root] + base data SingleMu_D_2 s:filename[tree_SingleMu_D_190456_208686_muTau_2.root] + base data SingleMu_D_3 s:filename[tree_SingleMu_D_190456_208686_muTau_3.root] +hist mc VV c:color[kRed + 1] + base mc WZ s:filename[tree_WZ_muTau.root] d:xsection[33.59] + base mc WW s:filename[tree_WW_muTau.root] d:xsection[55.47] + base mc ZZ s:filename[tree_ZZ_muTau.root] d:xsection[8.27] +hist mc single-t c:color[kOrange + 7] + base mc T_tWchan s:filename[tree_T_tWchan_muTau.root] d:xsection[11.1] + base mc Tbar_tWchan s:filename[tree_Tbar_tWchan_muTau.root] d:xsection[11.1] + base mc T_tchan s:filename[tree_T_tchan_muTau.root] d:xsection[30.7] + base mc Tbar_tchan s:filename[tree_Tbar_tchan_muTau.root] d:xsection[56.4] + base mc T_schan s:filename[tree_T_schan_muTau.root] d:xsection[1.76] + base mc Tbar_schan s:filename[tree_Tbar_schan_muTau.root] d:xsection[3.79] +hist mc t#bar{t} c:color[kOrange - 2] + base mc TTbarJets s:filename[tree_TTbarJets_muTau.root] d:xsection[234] s:normtype[faketaulep] + hist mc t#bar{t} (real #tau) c:color[kViolet + 1] s:normtype[ttbar] + base mc TTbarJets s:filename[tree_TTbarJets_2l_muTau.root] d:xsection[24.56] s:normtype[ttbar] +hist mc Z(ll/#tau#tau) + jets c:color[kBlue - 9] + base mc ZJets_2l s:filename[tree_ZJets_2l_muTau.root] d:xsection[3503.71] s:normtype[nofaketau] +hist mc Fake #tau c:color[kViolet + 1] s:normtype[faketau] +# base mc WJets_ln s:filename[tree_WJets_ln_muTau.root] d:xsection[37509.0] s:normtype[faketau] +# base mc ZJets_2l s:filename[tree_ZJets_2l_muTau.root] d:xsection[3503.71] s:normtype[faketau] +# base mc TTbarJets s:filename[tree_TTbarJets_muTau.root] d:xsection[234] s:normtype[faketau] + base mc W1Jets_ln s:filename[tree_W1Jets_ln_muTau.root] d:xsection[6440.58] s:normtype[faketau] + base mc W2Jets_ln s:filename[tree_W2Jets_ln_muTau.root] d:xsection[2087.225] s:normtype[faketau] + base mc W3Jets_ln s:filename[tree_W3Jets_ln_muTau.root] d:xsection[619.0113] s:normtype[faketau] + base mc W4Jets_ln s:filename[tree_W4Jets_ln_muTau.root] d:xsection[255.2378] s:normtype[faketau] + base mc Z1Jets_2l s:filename[tree_Z1Jets_2l_muTau.root] d:xsection[666.3] s:normtype[faketau] + base mc Z2Jets_2l s:filename[tree_Z2Jets_2l_muTau.root] d:xsection[214.97] s:normtype[faketau] + base mc Z3Jets_2l s:filename[tree_Z3Jets_2l_muTau.root] d:xsection[60.69] s:normtype[faketau] + base mc Z4Jets_2l s:filename[tree_Z4Jets_2l_muTau.root] d:xsection[27.36] s:normtype[faketau] + base mc TTbarJets2l s:filename[tree_TTbarJets_2l_muTau.root] d:xsection[24.56] s:normtype[faketau] + base mc TTbarJetsSl1 s:filename[tree_TTbarJetsSemiLep_1_muTau.root] d:xsection[102.51] s:normtype[faketau] + base mc TTbarJetsSl2 s:filename[tree_TTbarJetsSemiLep_2_muTau.root] d:xsection[102.51] s:normtype[faketau] + base mc TTbarJetsSl3 s:filename[tree_TTbarJetsSemiLep_3_muTau.root] d:xsection[102.51] s:normtype[faketau] + base mc TTbarJetsSl4 s:filename[tree_TTbarJetsSemiLep_4_muTau.root] d:xsection[102.51] s:normtype[faketau] + base mc TTbarJetsSl5 s:filename[tree_TTbarJetsSemiLep_5_muTau.root] d:xsection[102.51] s:normtype[faketau] +hist mc LQ200 c:color[kGray + 1] + base mc LQ200_tb s:filename[tree_LQ200_tb_muTau.root] [17.4] +hist mc LQ250 c:color[kGray + 1] + base mc LQ250_tb s:filename[tree_LQ250_tb_muTau.root] [5.26] +hist mc LQ300 c:color[kGray + 1] + base mc LQ300_tb s:filename[tree_LQ300_tb_muTau.root] [1.89] +hist mc LQ350 c:color[kGray + 1] + base mc LQ350_tb s:filename[tree_LQ350_tb_muTau.root] [0.77] +hist mc LQ400 c:color[kGray + 1] + base mc LQ400_tb s:filename[tree_LQ400_tb_muTau.root] [0.342] +hist mc LQ450 c:color[kGray + 1] + base mc LQ450_tb s:filename[tree_LQ450_tb_muTau.root] [0.163] +hist mc LQ500 c:color[kGray + 1] + base mc LQ500_tb s:filename[tree_LQ500_tb_muTau.root] [0.082] +hist mc LQ550 c:color[kGray + 1] + base mc LQ550_tb s:filename[tree_LQ550_tb_muTau.root] [0.0431] +hist mc LQ600 c:color[kGray + 1] + base mc LQ600_tb s:filename[tree_LQ600_tb_muTau.root] [0.0235] +hist mc LQ650 c:color[kGray + 1] + base mc LQ650_tb s:filename[tree_LQ650_tb_muTau.root] [0.0132] +hist mc LQ700 c:color[kGray + 1] + base mc LQ700_tb s:filename[tree_LQ700_tb_muTau.root] [0.00761] +hist mc LQ750 c:color[kGray + 1] + base mc LQ750_tb s:filename[tree_LQ750_tb_muTau.root] [0.00448] +hist mc LQ800 c:color[kGray + 1] + base mc LQ800_tb s:filename[tree_LQ800_tb_muTau.root] [0.00269] +hist mc LQ850 c:color[kGray + 1] + base mc LQ850_tb s:filename[tree_LQ850_tb_muTau.root] [0.00164] +hist mc LQ900 c:color[kGray + 1] + base mc LQ900_tb s:filename[tree_LQ900_tb_muTau.root] [0.00101] +hist mc LQ950 c:color[kGray + 1] + base mc LQ950_tb s:filename[tree_LQ950_tb_muTau.root] [0.000634] +hist mc LQ1000 c:color[kGray + 1] + base mc LQ1000_tb s:filename[tree_LQ1000_tb_muTau.root] [0.000401] diff --git a/Plotting/input_final_lqd321_dd_fig.txt b/Plotting/input_final_lqd321_dd_fig.txt index fdaa655b..c8a4a06e 100644 --- a/Plotting/input_final_lqd321_dd_fig.txt +++ b/Plotting/input_final_lqd321_dd_fig.txt @@ -1,8 +1,10 @@ #three sections: global options in OPTION, 1D histograms in HISTO, datasets in SET #option format is: type:name[val] or vtype:name[val1,val2,...] #available types are (full/abbrev): bool/b, int/i, double/d, string/s, color/c -#items on each line in the HISTO and SET sections must be tab-separated -#for datasets, each source must be listed after the appropriate group +#items on each line in the HISTO and SET sections must be tab-separated, with required items first, in order +#HISTO: only required item is name (but without binning options afterward, it won't build properly) +#SET: required items are type (stack, hist, base), subtype (data, mc, ext), name +#for datasets, child-parent relationships are indicated by tab-indentation OPTION vstring:printformat[eps] @@ -40,59 +42,59 @@ masstaub i:xnum[50] d:xmin[0] d:xmax[1000] s:xtitle[M_{#taub} [GeV]] s:ytitle[nu st vd:xbins[200,280,350,420,480,540,610,680,770,860,960,1100,1200] s:xtitle[S_{T} [GeV]] s:ytitle[number of events / GeV] b:liny[1] b:ratio[0] b:bindivide[1] SET -hist data data kBlack - base data SingleMu_A tree_SingleMu_A_190456_208686_muTau.root 0 - base data SingleMu_B_0 tree_SingleMu_B_190456_208686_muTau_0.root 0 - base data SingleMu_B_1 tree_SingleMu_B_190456_208686_muTau_1.root 0 - base data SingleMu_C_0 tree_SingleMu_C_190456_208686_muTau_0.root 0 - base data SingleMu_C_1 tree_SingleMu_C_190456_208686_muTau_1.root 0 - base data SingleMu_C_2 tree_SingleMu_C_190456_208686_muTau_2.root 0 - base data SingleMu_C_3 tree_SingleMu_C_190456_208686_muTau_3.root 0 - base data SingleMu_D_0 tree_SingleMu_D_190456_208686_muTau_0.root 0 - base data SingleMu_D_1 tree_SingleMu_D_190456_208686_muTau_1.root 0 - base data SingleMu_D_2 tree_SingleMu_D_190456_208686_muTau_2.root 0 - base data SingleMu_D_3 tree_SingleMu_D_190456_208686_muTau_3.root 0 -hist mc #tilde{t}300 (LQD321) kBlack - base mc Stop300 tree_rpvstop_LQD321_Stop300_chargino.root 1.89 NTrpv -#hist mc #tilde{t}500 (LQD321) kBlack -# base mc Stop500 tree_rpvstop_LQD321_Stop500_chargino.root 0.082 NTrpv -stack mc mc kWhite - hist mc VV kRed + 1 - base mc WZ tree_WZ_muTau.root 33.59 - base mc WW tree_WW_muTau.root 55.47 - base mc ZZ tree_ZZ_muTau.root 8.27 - hist mc single-t kOrange + 7 - base mc T_tWchan tree_T_tWchan_muTau.root 11.1 - base mc Tbar_tWchan tree_Tbar_tWchan_muTau.root 11.1 - base mc T_tchan tree_T_tchan_muTau.root 30.7 - base mc Tbar_tchan tree_Tbar_tchan_muTau.root 56.4 - base mc T_schan tree_T_schan_muTau.root 1.76 - base mc Tbar_schan tree_Tbar_schan_muTau.root 3.79 - hist mc t#bar{t} kOrange - 2 - base mc TTbarJets tree_TTbarJets_muTau.root 234 NTfaketaulep - hist mc t#bar{t} (real #tau) kViolet + 1 NTttbar - base mc TTbarJets tree_TTbarJets_2l_muTau.root 24.56 NTttbar - hist mc Z(ll/#tau#tau) + jets kBlue - 9 - base mc ZJets_2l tree_ZJets_2l_muTau.root 3503.71 NTnofaketau -# base mc Z1Jets_2l tree_Z1Jets_2l_muTau.root 666.3 NTnofaketau -# base mc Z2Jets_2l tree_Z2Jets_2l_muTau.root 214.97 NTnofaketau -# base mc Z3Jets_2l tree_Z3Jets_2l_muTau.root 60.69 NTnofaketau -# base mc Z4Jets_2l tree_Z4Jets_2l_muTau.root 27.36 NTnofaketau - hist mc Fake #tau kViolet + 1 NTfaketau -# base mc WJets_ln tree_WJets_ln_muTau.root 37509.0 NTfaketau -# base mc ZJets_2l tree_ZJets_2l_muTau.root 3503.71 NTfaketau -# base mc TTbarJets tree_TTbarJets_muTau.root 234 NTfaketau - base mc W1Jets_ln tree_W1Jets_ln_muTau.root 6440.58 NTfaketau - base mc W2Jets_ln tree_W2Jets_ln_muTau.root 2087.225 NTfaketau - base mc W3Jets_ln tree_W3Jets_ln_muTau.root 619.0113 NTfaketau - base mc W4Jets_ln tree_W4Jets_ln_muTau.root 255.2378 NTfaketau - base mc Z1Jets_2l tree_Z1Jets_2l_muTau.root 666.3 NTfaketau - base mc Z2Jets_2l tree_Z2Jets_2l_muTau.root 214.97 NTfaketau - base mc Z3Jets_2l tree_Z3Jets_2l_muTau.root 60.69 NTfaketau - base mc Z4Jets_2l tree_Z4Jets_2l_muTau.root 27.36 NTfaketau - base mc TTbarJets2l tree_TTbarJets_2l_muTau.root 24.56 NTfaketau - base mc TTbarJetsSl1 tree_TTbarJetsSemiLep_1_muTau.root 102.51 NTfaketau - base mc TTbarJetsSl2 tree_TTbarJetsSemiLep_2_muTau.root 102.51 NTfaketau - base mc TTbarJetsSl3 tree_TTbarJetsSemiLep_3_muTau.root 102.51 NTfaketau - base mc TTbarJetsSl4 tree_TTbarJetsSemiLep_4_muTau.root 102.51 NTfaketau - base mc TTbarJetsSl5 tree_TTbarJetsSemiLep_5_muTau.root 102.51 NTfaketau +hist data data c:color[kBlack] + base data SingleMu_A s:filename[tree_SingleMu_A_190456_208686_muTau.root] + base data SingleMu_B_0 s:filename[tree_SingleMu_B_190456_208686_muTau_0.root] + base data SingleMu_B_1 s:filename[tree_SingleMu_B_190456_208686_muTau_1.root] + base data SingleMu_C_0 s:filename[tree_SingleMu_C_190456_208686_muTau_0.root] + base data SingleMu_C_1 s:filename[tree_SingleMu_C_190456_208686_muTau_1.root] + base data SingleMu_C_2 s:filename[tree_SingleMu_C_190456_208686_muTau_2.root] + base data SingleMu_C_3 s:filename[tree_SingleMu_C_190456_208686_muTau_3.root] + base data SingleMu_D_0 s:filename[tree_SingleMu_D_190456_208686_muTau_0.root] + base data SingleMu_D_1 s:filename[tree_SingleMu_D_190456_208686_muTau_1.root] + base data SingleMu_D_2 s:filename[tree_SingleMu_D_190456_208686_muTau_2.root] + base data SingleMu_D_3 s:filename[tree_SingleMu_D_190456_208686_muTau_3.root] +hist mc #tilde{t}300 (LQD321) c:color[kBlack] + base mc Stop300 s:filename[tree_rpvstop_LQD321_Stop300_chargino.root] d:xsection[1.89] s:normtype[rpv] +#hist mc #tilde{t}500 (LQD321) c:color[kBlack] +# base mc Stop500 s:filename[tree_rpvstop_LQD321_Stop500_chargino.root] d:xsection[0.082] s:normtype[rpv] +stack mc mc c:color[kWhite] + hist mc VV c:color[kRed + 1] + base mc WZ s:filename[tree_WZ_muTau.root] d:xsection[33.59] + base mc WW s:filename[tree_WW_muTau.root] d:xsection[55.47] + base mc ZZ s:filename[tree_ZZ_muTau.root] d:xsection[8.27] + hist mc single-t c:color[kOrange + 7] + base mc T_tWchan s:filename[tree_T_tWchan_muTau.root] d:xsection[11.1] + base mc Tbar_tWchan s:filename[tree_Tbar_tWchan_muTau.root] d:xsection[11.1] + base mc T_tchan s:filename[tree_T_tchan_muTau.root] d:xsection[30.7] + base mc Tbar_tchan s:filename[tree_Tbar_tchan_muTau.root] d:xsection[56.4] + base mc T_schan s:filename[tree_T_schan_muTau.root] d:xsection[1.76] + base mc Tbar_schan s:filename[tree_Tbar_schan_muTau.root] d:xsection[3.79] + hist mc t#bar{t} c:color[kOrange - 2] + base mc TTbarJets s:filename[tree_TTbarJets_muTau.root] d:xsection[234] s:normtype[faketaulep] + hist mc t#bar{t} (real #tau) c:color[kViolet + 1] s:normtype[ttbar] + base mc TTbarJets s:filename[tree_TTbarJets_2l_muTau.root] d:xsection[24.56] s:normtype[ttbar] + hist mc Z(ll/#tau#tau) + jets c:color[kBlue - 9] + base mc ZJets_2l s:filename[tree_ZJets_2l_muTau.root] d:xsection[3503.71] s:normtype[nofaketau] +# base mc Z1Jets_2l s:filename[tree_Z1Jets_2l_muTau.root] d:xsection[666.3] s:normtype[nofaketau] +# base mc Z2Jets_2l s:filename[tree_Z2Jets_2l_muTau.root] d:xsection[214.97] s:normtype[nofaketau] +# base mc Z3Jets_2l s:filename[tree_Z3Jets_2l_muTau.root] d:xsection[60.69] s:normtype[nofaketau] +# base mc Z4Jets_2l s:filename[tree_Z4Jets_2l_muTau.root] d:xsection[27.36] s:normtype[nofaketau] + hist mc Fake #tau c:color[kViolet + 1] s:normtype[faketau] +# base mc WJets_ln s:filename[tree_WJets_ln_muTau.root] d:xsection[37509.0] s:normtype[faketau] +# base mc ZJets_2l s:filename[tree_ZJets_2l_muTau.root] d:xsection[3503.71] s:normtype[faketau] +# base mc TTbarJets s:filename[tree_TTbarJets_muTau.root] d:xsection[234] s:normtype[faketau] + base mc W1Jets_ln s:filename[tree_W1Jets_ln_muTau.root] d:xsection[6440.58] s:normtype[faketau] + base mc W2Jets_ln s:filename[tree_W2Jets_ln_muTau.root] d:xsection[2087.225] s:normtype[faketau] + base mc W3Jets_ln s:filename[tree_W3Jets_ln_muTau.root] d:xsection[619.0113] s:normtype[faketau] + base mc W4Jets_ln s:filename[tree_W4Jets_ln_muTau.root] d:xsection[255.2378] s:normtype[faketau] + base mc Z1Jets_2l s:filename[tree_Z1Jets_2l_muTau.root] d:xsection[666.3] s:normtype[faketau] + base mc Z2Jets_2l s:filename[tree_Z2Jets_2l_muTau.root] d:xsection[214.97] s:normtype[faketau] + base mc Z3Jets_2l s:filename[tree_Z3Jets_2l_muTau.root] d:xsection[60.69] s:normtype[faketau] + base mc Z4Jets_2l s:filename[tree_Z4Jets_2l_muTau.root] d:xsection[27.36] s:normtype[faketau] + base mc TTbarJets2l s:filename[tree_TTbarJets_2l_muTau.root] d:xsection[24.56] s:normtype[faketau] + base mc TTbarJetsSl1 s:filename[tree_TTbarJetsSemiLep_1_muTau.root] d:xsection[102.51] s:normtype[faketau] + base mc TTbarJetsSl2 s:filename[tree_TTbarJetsSemiLep_2_muTau.root] d:xsection[102.51] s:normtype[faketau] + base mc TTbarJetsSl3 s:filename[tree_TTbarJetsSemiLep_3_muTau.root] d:xsection[102.51] s:normtype[faketau] + base mc TTbarJetsSl4 s:filename[tree_TTbarJetsSemiLep_4_muTau.root] d:xsection[102.51] s:normtype[faketau] + base mc TTbarJetsSl5 s:filename[tree_TTbarJetsSemiLep_5_muTau.root] d:xsection[102.51] s:normtype[faketau] diff --git a/Plotting/input_final_lqd321_dd_shapesyst_datacard.txt b/Plotting/input_final_lqd321_dd_shapesyst_datacard.txt index 0f2e3561..e4e4f005 100644 --- a/Plotting/input_final_lqd321_dd_shapesyst_datacard.txt +++ b/Plotting/input_final_lqd321_dd_shapesyst_datacard.txt @@ -24,66 +24,66 @@ HISTO st i:xnum[120] d:xmin[0] d:xmax[1200] s:xtitle[S_{T} [GeV]] s:ytitle[number of events / 10 GeV] b:ratio[0] b:liny[1] SET -hist data data kBlack - base data SingleMu_A tree_SingleMu_A_190456_208686_muTau.root 0 - base data SingleMu_B_0 tree_SingleMu_B_190456_208686_muTau_0.root 0 - base data SingleMu_B_1 tree_SingleMu_B_190456_208686_muTau_1.root 0 - base data SingleMu_C_0 tree_SingleMu_C_190456_208686_muTau_0.root 0 - base data SingleMu_C_1 tree_SingleMu_C_190456_208686_muTau_1.root 0 - base data SingleMu_C_2 tree_SingleMu_C_190456_208686_muTau_2.root 0 - base data SingleMu_C_3 tree_SingleMu_C_190456_208686_muTau_3.root 0 - base data SingleMu_D_0 tree_SingleMu_D_190456_208686_muTau_0.root 0 - base data SingleMu_D_1 tree_SingleMu_D_190456_208686_muTau_1.root 0 - base data SingleMu_D_2 tree_SingleMu_D_190456_208686_muTau_2.root 0 - base data SingleMu_D_3 tree_SingleMu_D_190456_208686_muTau_3.root 0 -hist mc single-t kMagenta + 1 - base mc T_tWchan tree_T_tWchan_muTau.root 11.1 - base mc Tbar_tWchan tree_Tbar_tWchan_muTau.root 11.1 - base mc T_tchan tree_T_tchan_muTau.root 30.7 - base mc Tbar_tchan tree_Tbar_tchan_muTau.root 56.4 - base mc T_schan tree_T_schan_muTau.root 1.76 - base mc Tbar_schan tree_Tbar_schan_muTau.root 3.79 -hist mc t#bar{t} kViolet + 1 - base mc TTbarJets tree_TTbarJets_muTau.root 234 NTfaketaulep - hist mc t#bar{t} (real #tau) kViolet + 1 NTttbar - base mc TTbarJets tree_TTbarJets_2l_muTau.root 24.56 NTttbar -hist mc diboson kRed + 1 - base mc WZ tree_WZ_muTau.root 33.59 - base mc WW tree_WW_muTau.root 55.47 - base mc ZZ tree_ZZ_muTau.root 8.27 -hist mc Z + jets kOrange - 3 - base mc ZJets_2l tree_ZJets_2l_muTau.root 3503.71 NTnofaketau -hist mc Fake #tau kAzure + 2 NTfaketau -# base mc WJets_ln tree_WJets_ln_muTau.root 37509.0 NTfaketau -# base mc ZJets_2l tree_ZJets_2l_muTau.root 3503.71 NTfaketau -# base mc TTbarJets tree_TTbarJets_muTau.root 234 NTfaketau - base mc W1Jets_ln tree_W1Jets_ln_muTau.root 6440.58 NTfaketau - base mc W2Jets_ln tree_W2Jets_ln_muTau.root 2087.225 NTfaketau - base mc W3Jets_ln tree_W3Jets_ln_muTau.root 619.0113 NTfaketau - base mc W4Jets_ln tree_W4Jets_ln_muTau.root 255.2378 NTfaketau - base mc Z1Jets_2l tree_Z1Jets_2l_muTau.root 666.3 NTfaketau - base mc Z2Jets_2l tree_Z2Jets_2l_muTau.root 214.97 NTfaketau - base mc Z3Jets_2l tree_Z3Jets_2l_muTau.root 60.69 NTfaketau - base mc Z4Jets_2l tree_Z4Jets_2l_muTau.root 27.36 NTfaketau - base mc TTbarJets2l tree_TTbarJets_2l_muTau.root 24.56 NTfaketau - base mc TTbarJetsSl1 tree_TTbarJetsSemiLep_1_muTau.root 102.51 NTfaketau - base mc TTbarJetsSl2 tree_TTbarJetsSemiLep_2_muTau.root 102.51 NTfaketau - base mc TTbarJetsSl3 tree_TTbarJetsSemiLep_3_muTau.root 102.51 NTfaketau - base mc TTbarJetsSl4 tree_TTbarJetsSemiLep_4_muTau.root 102.51 NTfaketau - base mc TTbarJetsSl5 tree_TTbarJetsSemiLep_5_muTau.root 102.51 NTfaketau -hist mc Stop200 kGray + 1 - base mc Stop200 tree_rpvstop_LQD321_Stop200_chargino.root 17.4 NTrpv -hist mc Stop300 kGray + 1 - base mc Stop300 tree_rpvstop_LQD321_Stop300_chargino.root 1.89 NTrpv -hist mc Stop400 kGray + 1 - base mc Stop400 tree_rpvstop_LQD321_Stop400_chargino.root 0.342 NTrpv -hist mc Stop500 kGray + 1 - base mc Stop500 tree_rpvstop_LQD321_Stop500_chargino.root 0.082 NTrpv -hist mc Stop600 kGray + 1 - base mc Stop600 tree_rpvstop_LQD321_Stop600_chargino.root 0.0235 NTrpv -hist mc Stop700 kGray + 1 - base mc Stop700 tree_rpvstop_LQD321_Stop700_chargino.root 0.00761 NTrpv -hist mc Stop800 kGray + 1 - base mc Stop800 tree_rpvstop_LQD321_Stop800_chargino.root 0.00269 NTrpv -hist mc Stop900 kGray + 1 - base mc Stop900 tree_rpvstop_LQD321_Stop900_chargino.root 0.00101 NTrpv +hist data data c:color[kBlack] + base data SingleMu_A s:filename[tree_SingleMu_A_190456_208686_muTau.root] + base data SingleMu_B_0 s:filename[tree_SingleMu_B_190456_208686_muTau_0.root] + base data SingleMu_B_1 s:filename[tree_SingleMu_B_190456_208686_muTau_1.root] + base data SingleMu_C_0 s:filename[tree_SingleMu_C_190456_208686_muTau_0.root] + base data SingleMu_C_1 s:filename[tree_SingleMu_C_190456_208686_muTau_1.root] + base data SingleMu_C_2 s:filename[tree_SingleMu_C_190456_208686_muTau_2.root] + base data SingleMu_C_3 s:filename[tree_SingleMu_C_190456_208686_muTau_3.root] + base data SingleMu_D_0 s:filename[tree_SingleMu_D_190456_208686_muTau_0.root] + base data SingleMu_D_1 s:filename[tree_SingleMu_D_190456_208686_muTau_1.root] + base data SingleMu_D_2 s:filename[tree_SingleMu_D_190456_208686_muTau_2.root] + base data SingleMu_D_3 s:filename[tree_SingleMu_D_190456_208686_muTau_3.root] +hist mc VV c:color[kRed + 1] + base mc WZ s:filename[tree_WZ_muTau.root] d:xsection[33.59] + base mc WW s:filename[tree_WW_muTau.root] d:xsection[55.47] + base mc ZZ s:filename[tree_ZZ_muTau.root] d:xsection[8.27] +hist mc single-t c:color[kOrange + 7] + base mc T_tWchan s:filename[tree_T_tWchan_muTau.root] d:xsection[11.1] + base mc Tbar_tWchan s:filename[tree_Tbar_tWchan_muTau.root] d:xsection[11.1] + base mc T_tchan s:filename[tree_T_tchan_muTau.root] d:xsection[30.7] + base mc Tbar_tchan s:filename[tree_Tbar_tchan_muTau.root] d:xsection[56.4] + base mc T_schan s:filename[tree_T_schan_muTau.root] d:xsection[1.76] + base mc Tbar_schan s:filename[tree_Tbar_schan_muTau.root] d:xsection[3.79] +hist mc t#bar{t} c:color[kOrange - 2] + base mc TTbarJets s:filename[tree_TTbarJets_muTau.root] d:xsection[234] s:normtype[faketaulep] + hist mc t#bar{t} (real #tau) c:color[kViolet + 1] s:normtype[ttbar] + base mc TTbarJets s:filename[tree_TTbarJets_2l_muTau.root] d:xsection[24.56] s:normtype[ttbar] +hist mc Z(ll/#tau#tau) + jets c:color[kBlue - 9] + base mc ZJets_2l s:filename[tree_ZJets_2l_muTau.root] d:xsection[3503.71] s:normtype[nofaketau] +hist mc Fake #tau c:color[kViolet + 1] s:normtype[faketau] +# base mc WJets_ln s:filename[tree_WJets_ln_muTau.root] d:xsection[37509.0] s:normtype[faketau] +# base mc ZJets_2l s:filename[tree_ZJets_2l_muTau.root] d:xsection[3503.71] s:normtype[faketau] +# base mc TTbarJets s:filename[tree_TTbarJets_muTau.root] d:xsection[234] s:normtype[faketau] + base mc W1Jets_ln s:filename[tree_W1Jets_ln_muTau.root] d:xsection[6440.58] s:normtype[faketau] + base mc W2Jets_ln s:filename[tree_W2Jets_ln_muTau.root] d:xsection[2087.225] s:normtype[faketau] + base mc W3Jets_ln s:filename[tree_W3Jets_ln_muTau.root] d:xsection[619.0113] s:normtype[faketau] + base mc W4Jets_ln s:filename[tree_W4Jets_ln_muTau.root] d:xsection[255.2378] s:normtype[faketau] + base mc Z1Jets_2l s:filename[tree_Z1Jets_2l_muTau.root] d:xsection[666.3] s:normtype[faketau] + base mc Z2Jets_2l s:filename[tree_Z2Jets_2l_muTau.root] d:xsection[214.97] s:normtype[faketau] + base mc Z3Jets_2l s:filename[tree_Z3Jets_2l_muTau.root] d:xsection[60.69] s:normtype[faketau] + base mc Z4Jets_2l s:filename[tree_Z4Jets_2l_muTau.root] d:xsection[27.36] s:normtype[faketau] + base mc TTbarJets2l s:filename[tree_TTbarJets_2l_muTau.root] d:xsection[24.56] s:normtype[faketau] + base mc TTbarJetsSl1 s:filename[tree_TTbarJetsSemiLep_1_muTau.root] d:xsection[102.51] s:normtype[faketau] + base mc TTbarJetsSl2 s:filename[tree_TTbarJetsSemiLep_2_muTau.root] d:xsection[102.51] s:normtype[faketau] + base mc TTbarJetsSl3 s:filename[tree_TTbarJetsSemiLep_3_muTau.root] d:xsection[102.51] s:normtype[faketau] + base mc TTbarJetsSl4 s:filename[tree_TTbarJetsSemiLep_4_muTau.root] d:xsection[102.51] s:normtype[faketau] + base mc TTbarJetsSl5 s:filename[tree_TTbarJetsSemiLep_5_muTau.root] d:xsection[102.51] s:normtype[faketau] +hist mc Stop200 c:color[kGray + 1] + base mc Stop200 s:filename[tree_rpvstop_LQD321_Stop200_chargino.root] [17.4] s:normtype[rpv] +hist mc Stop300 c:color[kGray + 1] + base mc Stop300 s:filename[tree_rpvstop_LQD321_Stop300_chargino.root] [1.89] s:normtype[rpv] +hist mc Stop400 c:color[kGray + 1] + base mc Stop400 s:filename[tree_rpvstop_LQD321_Stop400_chargino.root] [0.342] s:normtype[rpv] +hist mc Stop500 c:color[kGray + 1] + base mc Stop500 s:filename[tree_rpvstop_LQD321_Stop500_chargino.root] [0.082] s:normtype[rpv] +hist mc Stop600 c:color[kGray + 1] + base mc Stop600 s:filename[tree_rpvstop_LQD321_Stop600_chargino.root] [0.0235] s:normtype[rpv] +hist mc Stop700 c:color[kGray + 1] + base mc Stop700 s:filename[tree_rpvstop_LQD321_Stop700_chargino.root] [0.00761] s:normtype[rpv] +hist mc Stop800 c:color[kGray + 1] + base mc Stop800 s:filename[tree_rpvstop_LQD321_Stop800_chargino.root] [0.00269] s:normtype[rpv] +hist mc Stop900 c:color[kGray + 1] + base mc Stop900 s:filename[tree_rpvstop_LQD321_Stop900_chargino.root] [0.00101] s:normtype[rpv]