Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macros need to compile in ROOT6 (Analysis) (7_4_X) #8743

Merged
merged 1 commit into from May 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -40,7 +40,7 @@ public:
int getXbins(const TH1 * h, const double & xMin, const double & xMax)
{
// To get the correct integral for rescaling determine the borders
TAxis * xAxis = h->GetXaxis();
const TAxis * xAxis = h->GetXaxis();
double xAxisMin = xAxis->GetXmin();
// The bins have all the same width, therefore we can use this
double binWidth = xAxis->GetBinWidth(1);
Expand Down
Expand Up @@ -6,6 +6,7 @@
//------------------------------------------//

#include <iostream>
#include <vector>
#include "Gtypes.h"
#include "TROOT.h"
#include "TStyle.h"
Expand Down Expand Up @@ -69,10 +70,11 @@ void MultiHistoOverlap(TString namesandlabels, Int_t nOfFiles, const TString& ou
}


TString LegLabels[nOfFiles];
std::vector<TString> LegLabels;
LegLabels.reserve(nOfFiles);
for(Int_t j=0; j < nOfFiles; j++) {
TObjString* legend = (TObjString*)LabelList->At(j);
LegLabels[j] = legend->String();
LegLabels.push_back(legend->String());
std::cout<<"LegLabels["<<j<<"]"<<LegLabels[j]<<std::endl;
}

Expand Down
Expand Up @@ -10,6 +10,7 @@
#include "TH2.h"
#include "TPad.h"

extern void setTDRStyle();

using namespace ROOT::Math;

Expand Down Expand Up @@ -68,8 +69,7 @@
histo1->Draw();
leg->AddEntry(histo1,"this validation","L");
//--- fit ----------------------------------------------
TF1 * f1 = 0;
f1 = new TF1("cosinusoidal1", "[0]+[1]*cos(x+[2])", -3.14, 3.14);
TF1 * f1 = new TF1("cosinusoidal1", "[0]+[1]*cos(x+[2])", -3.14, 3.14);
f1->SetParameter(0, 90.5);
f1->SetParameter(1, 1.);
f1->SetParameter(2, 1.);
Expand All @@ -86,8 +86,7 @@
histo2->Draw("same");
leg->AddEntry(histo2,"reference","L");
//--- fit ----------------------------------------------
TF1 * f2 = 0;
f2 = new TF1("cosinusoidal2", "[0]+[1]*cos(x+[2])", -3.14, 3.14);
TF1 * f2 = new TF1("cosinusoidal2", "[0]+[1]*cos(x+[2])", -3.14, 3.14);
f2->SetParameter(0, 90.5);
f2->SetParameter(1, 1.);
f2->SetParameter(2, 1.);
Expand Down Expand Up @@ -119,7 +118,6 @@
histo1->GetXaxis()->SetRangeUser(-3.14,3.14);
histo1->Draw();
//--- fit ----------------------------------------------
TF1 * f1 = 0;
f1 = new TF1("cosinusoidal1", "[0]+[1]*cos(x+[2])", -3.14, 3.14);
f1->SetParameter(0, 90.5);
f1->SetParameter(1, 1.);
Expand All @@ -137,7 +135,6 @@
histo2->SetMarkerColor(2);
histo2->Draw("same");
//--- fit ----------------------------------------------
TF1 * f2 = 0;
f2 = new TF1("cosinusoidal2", "[0]+[1]*cos(x+[2])", -3.14, 3.14);
f2->SetParameter(0, 90.5);
f2->SetParameter(1, 1.);
Expand Down Expand Up @@ -169,7 +166,6 @@
histo1->GetXaxis()->SetRangeUser(-2.6,2.6);
histo1->Draw();
//--- fit ----------------------------------------------
TF1 * f1 = 0;
f1 = new TF1("linear1", "[0]+[1]*x", -2.6, 2.6);
f1->SetParameter(0, 90.5);
f1->SetParameter(1, 1.);
Expand All @@ -186,7 +182,6 @@
histo2->SetMarkerColor(2);
histo2->Draw("same");
//--- fit ----------------------------------------------
TF1 * f2 = 0;
f2 = new TF1("linear2", "[0]+[1]*x", -2.6, 2.6);
f2->SetParameter(0, 90.5);
f2->SetParameter(1, 1.);
Expand Down Expand Up @@ -217,7 +212,6 @@
histo1->GetXaxis()->SetRangeUser(-2.6,2.6);
histo1->Draw();
//--- fit ----------------------------------------------
TF1 * f1 = 0;
f1 = new TF1("linear1", "[0]+[1]*x", -2.6, 2.6);
f1->SetParameter(0, 0.);
f1->SetParameter(1, 0.);
Expand All @@ -234,7 +228,6 @@
histo2->SetMarkerColor(2);
histo2->Draw("same");
//--- fit ----------------------------------------------
TF1 * f2 = 0;
f2 = new TF1("linear2", "[0]+[1]*x", -2.6, 2.6);
f2->SetParameter(0, 0.);
f2->SetParameter(1, 0.);
Expand Down Expand Up @@ -265,7 +258,6 @@
histo1->GetXaxis()->SetRangeUser(-3.2,3.2);
histo1->Draw();
//--- fit ----------------------------------------------
TF1 * f1 = 0;
f1 = new TF1("linear1", "[0]+[1]*x", -3.2, 3.2);
f1->SetParameter(0, 0.);
f1->SetParameter(1, 0.);
Expand All @@ -282,7 +274,6 @@
histo2->SetMarkerColor(2);
histo2->Draw("same");
//--- fit ----------------------------------------------
TF1 * f2 = 0;
f2 = new TF1("linear1", "[0]+[1]*x", -3.2, 3.2);
f2->SetParameter(0, 0.);
f2->SetParameter(1, 0.);
Expand Down Expand Up @@ -314,7 +305,6 @@
histo1->GetXaxis()->SetRangeUser(-1.1,1.1);
histo1->Draw();
//--- fit ----------------------------------------------
TF1 * f1 = 0;
f1 = new TF1("cosinusoidal1", "[0]+[1]*cos(x+[2])", -1.1, 1.1);
f1->SetParameter(0, 90.5);
f1->SetParameter(1, 1.);
Expand All @@ -332,7 +322,6 @@
histo2->SetMarkerColor(2);
histo2->Draw("same");
//--- fit ----------------------------------------------
TF1 * f2 = 0;
f2 = new TF1("cosinusoidal2", "[0]+[1]*cos(x+[2])", -1.1, 1.1);
f2->SetParameter(0, 90.5);
f2->SetParameter(1, 1.);
Expand Down Expand Up @@ -364,7 +353,6 @@
histo1->GetXaxis()->SetRangeUser(-3.14,3.14);
histo1->Draw();
//--- fit ----------------------------------------------
TF1 * f1 = 0;
f1 = new TF1("cosinusoidal1", "[0]+[1]*cos(x+[2])", -3.14, 3.14);
f1->SetParameter(0, 90.5);
f1->SetParameter(1, 1.);
Expand All @@ -382,7 +370,6 @@
histo2->SetMarkerColor(2);
histo2->Draw("same");
//--- fit ----------------------------------------------
TF1 * f2 = 0;
f2 = new TF1("cosinusoidal2", "[0]+[1]*cos(x+[2])", -3.14, 3.14);
f2->SetParameter(0, 90.5);
f2->SetParameter(1, 1.);
Expand Down
Expand Up @@ -9,6 +9,7 @@
#include "TFile.h"
#include "TH2.h"
#include "TPad.h"
//#include "MuonAnalysis/MomentumScaleCalibration/test/Macros/RooFit/tdrstyle.C"

using namespace ROOT::Math;

Expand All @@ -33,7 +34,7 @@
bool switchONfit= false;
bool switchONfitEta= false;

gROOT->LoadMacro("tdrstyle.C");
gROOT->LoadMacro("MuonAnalysis/MomentumScaleCalibration/test/Macros/RooFit/tdrstyle.C");
setTDRStyle();

TCanvas* c0 = new TCanvas("c0", "c0",50, 20, 800,600);
Expand Down Expand Up @@ -67,8 +68,7 @@
histo1->Draw();
leg->AddEntry(histo1,"this validation","L");
//--- fit ----------------------------------------------
TF1 * f1 = 0;
f1 = new TF1("cosinusoidal1", "[0]+[1]*cos(x+[2])", -3.14, 3.14);
TF1 * f1 = new TF1("cosinusoidal1", "[0]+[1]*cos(x+[2])", -3.14, 3.14);
f1->SetParameter(0, 90.5);
f1->SetParameter(1, 1.);
f1->SetParameter(2, 1.);
Expand All @@ -85,8 +85,7 @@
histo2->Draw("same");
leg->AddEntry(histo2,"reference","L");
//--- fit ----------------------------------------------
TF1 * f2 = 0;
f2 = new TF1("cosinusoidal2", "[0]+[1]*cos(x+[2])", -3.14, 3.14);
TF1 * f2 = new TF1("cosinusoidal2", "[0]+[1]*cos(x+[2])", -3.14, 3.14);
f2->SetParameter(0, 90.5);
f2->SetParameter(1, 1.);
f2->SetParameter(2, 1.);
Expand Down Expand Up @@ -118,7 +117,6 @@
histo1->GetXaxis()->SetRangeUser(-3.14,3.14);
histo1->Draw();
//--- fit ----------------------------------------------
TF1 * f1 = 0;
f1 = new TF1("cosinusoidal1", "[0]+[1]*cos(x+[2])", -3.14, 3.14);
f1->SetParameter(0, 90.5);
f1->SetParameter(1, 1.);
Expand All @@ -136,7 +134,6 @@
histo2->SetMarkerColor(2);
histo2->Draw("same");
//--- fit ----------------------------------------------
TF1 * f2 = 0;
f2 = new TF1("cosinusoidal2", "[0]+[1]*cos(x+[2])", -3.14, 3.14);
f2->SetParameter(0, 90.5);
f2->SetParameter(1, 1.);
Expand Down Expand Up @@ -168,7 +165,6 @@
histo1->GetXaxis()->SetRangeUser(-2.6,2.6);
histo1->Draw();
//--- fit ----------------------------------------------
TF1 * f1 = 0;
f1 = new TF1("linear1", "[0]+[1]*x", -2.6, 2.6);
f1->SetParameter(0, 90.5);
f1->SetParameter(1, 1.);
Expand All @@ -185,7 +181,6 @@
histo2->SetMarkerColor(2);
histo2->Draw("same");
//--- fit ----------------------------------------------
TF1 * f2 = 0;
f2 = new TF1("linear2", "[0]+[1]*x", -2.6, 2.6);
f2->SetParameter(0, 90.5);
f2->SetParameter(1, 1.);
Expand Down Expand Up @@ -216,7 +211,6 @@
histo1->GetXaxis()->SetRangeUser(-2.6,2.6);
histo1->Draw();
//--- fit ----------------------------------------------
TF1 * f1 = 0;
f1 = new TF1("linear1", "[0]+[1]*x", -2.6, 2.6);
f1->SetParameter(0, 0.);
f1->SetParameter(1, 0.);
Expand All @@ -233,7 +227,6 @@
histo2->SetMarkerColor(2);
histo2->Draw("same");
//--- fit ----------------------------------------------
TF1 * f2 = 0;
f2 = new TF1("linear2", "[0]+[1]*x", -2.6, 2.6);
f2->SetParameter(0, 0.);
f2->SetParameter(1, 0.);
Expand Down Expand Up @@ -264,7 +257,6 @@
histo1->GetXaxis()->SetRangeUser(-3.2,3.2);
histo1->Draw();
//--- fit ----------------------------------------------
TF1 * f1 = 0;
f1 = new TF1("linear1", "[0]+[1]*x", -3.2, 3.2);
f1->SetParameter(0, 0.);
f1->SetParameter(1, 0.);
Expand All @@ -281,7 +273,6 @@
histo2->SetMarkerColor(2);
histo2->Draw("same");
//--- fit ----------------------------------------------
TF1 * f2 = 0;
f2 = new TF1("linear1", "[0]+[1]*x", -3.2, 3.2);
f2->SetParameter(0, 0.);
f2->SetParameter(1, 0.);
Expand Down Expand Up @@ -313,7 +304,6 @@
histo1->GetXaxis()->SetRangeUser(-1.1,1.1);
histo1->Draw();
//--- fit ----------------------------------------------
TF1 * f1 = 0;
f1 = new TF1("cosinusoidal1", "[0]+[1]*cos(x+[2])", -1.1, 1.1);
f1->SetParameter(0, 90.5);
f1->SetParameter(1, 1.);
Expand All @@ -331,7 +321,6 @@
histo2->SetMarkerColor(2);
histo2->Draw("same");
//--- fit ----------------------------------------------
TF1 * f2 = 0;
f2 = new TF1("cosinusoidal2", "[0]+[1]*cos(x+[2])", -1.1, 1.1);
f2->SetParameter(0, 90.5);
f2->SetParameter(1, 1.);
Expand Down Expand Up @@ -363,7 +352,6 @@
histo1->GetXaxis()->SetRangeUser(-3.14,3.14);
histo1->Draw();
//--- fit ----------------------------------------------
TF1 * f1 = 0;
f1 = new TF1("cosinusoidal1", "[0]+[1]*cos(x+[2])", -3.14, 3.14);
f1->SetParameter(0, 90.5);
f1->SetParameter(1, 1.);
Expand All @@ -381,7 +369,6 @@
histo2->SetMarkerColor(2);
histo2->Draw("same");
//--- fit ----------------------------------------------
TF1 * f2 = 0;
f2 = new TF1("cosinusoidal2", "[0]+[1]*cos(x+[2])", -3.14, 3.14);
f2->SetParameter(0, 90.5);
f2->SetParameter(1, 1.);
Expand Down
@@ -1,6 +1,7 @@
#include "TStyle.h"

// tdrGrid: Turns the grid lines on (true) or off (false)
extern TStyle* tdrStyle;

void tdrGrid(bool gridOn) {
tdrStyle->SetPadGridX(gridOn);
Expand Down
Expand Up @@ -6,6 +6,8 @@
#include <vector>
#include <string>

void makePlot(std::vector<double> vec, double& meanP, double& rmsP, double& sigmaP, std::string parNum);
void skimValues(std::vector<double>& vec, double mean, double rms);

void MakePlot() {
ifstream file("Values.txt");
Expand Down