Skip to content

Commit

Permalink
Merge pull request #126 from cms-nanoAOD/master1010pre3
Browse files Browse the repository at this point in the history
move master-cmsswmaster to 10_1_0_pre3
  • Loading branch information
arizzi authored Mar 20, 2018
2 parents 785f7e3 + 4d5e4d2 commit ac05899
Show file tree
Hide file tree
Showing 4,577 changed files with 213,818 additions and 653,489 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
30 changes: 14 additions & 16 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
---
Checks:
-*
,boost-use-to-string
,misc-string-compare
,misc-uniqueptr-reset-release
,modernize-deprecated-headers
,modernize-make-shared
,modernize-use-bool-literals
,modernize-use-equals-delete
,modernize-use-nullptr
,modernize-use-override
,performance-unnecessary-copy-initialization
,readability-container-size-empty
,readability-redundant-string-cstr
,readability-static-definition-in-anonymous-namespace
Checks: -*,
,boost-use-to-string,
,misc-string-compare,
,misc-uniqueptr-reset-release,
,modernize-deprecated-headers,
,modernize-make-shared,
,modernize-use-bool-literals,
,modernize-use-equals-delete,
,modernize-use-nullptr,
,modernize-use-override,
,performance-unnecessary-copy-initialization,
,readability-container-size-empty,
,readability-redundant-string-cstr,
,readability-static-definition-in-anonymous-namespace,
,readability-uniqueptr-delete-release
WarningsAsErrors: ''
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
User: muzaffar
CheckOptions:
- key: google-readability-braces-around-statements.ShortStatementLines
value: '1'
Expand Down
17 changes: 7 additions & 10 deletions Alignment/APEEstimation/macros/DrawIteration.C
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@


DrawIteration::DrawIteration(unsigned int iterationNumber, const bool overlayMode):
outpath_(0), file_(0), overlayMode_(overlayMode), yAxisFixed_(false), systematics_(false), cmsText_("")
outpath_(nullptr), file_(nullptr), overlayMode_(overlayMode), yAxisFixed_(false), systematics_(false), cmsText_("")
{
if(!overlayMode_){
std::stringstream ss_inpath;
Expand Down Expand Up @@ -149,24 +149,21 @@ DrawIteration::SectorValues DrawIteration::getSectorValues(TFile* file){
}

for(std::map<unsigned int, TBranch*>::const_iterator i_branch = m_branchName.begin(); i_branch != m_branchName.end(); ++i_branch){
std::string* value(nullptr);
i_branch->second->SetAddress(&value);
sectorValues.m_sectorName[i_branch->first] = nullptr;
i_branch->second->SetAddress( &( sectorValues.m_sectorName[i_branch->first]) );
i_branch->second->GetEntry(0);
sectorValues.m_sectorName[i_branch->first] = value;
}
const unsigned int nIter(treeX->GetEntries());
for(unsigned int iIter = 0; iIter < nIter; ++iIter){
for(std::map<unsigned int, TBranch*>::const_iterator i_branch = m_branchX.begin(); i_branch != m_branchX.end(); ++i_branch){
double value(-999.);
(i_branch->second)->SetAddress(&value);
sectorValues.m_sectorValueX[i_branch->first].push_back(-999);
(i_branch->second)->SetAddress(&(sectorValues.m_sectorValueX[i_branch->first].back()));
(i_branch->second)->GetEntry(iIter);
sectorValues.m_sectorValueX[i_branch->first].push_back(value);
}
for(std::map<unsigned int, TBranch*>::const_iterator i_branch = m_branchY.begin(); i_branch != m_branchY.end(); ++i_branch){
double value(-999.);
(i_branch->second)->SetAddress(&value);
sectorValues.m_sectorValueY[i_branch->first].push_back(-999);
(i_branch->second)->SetAddress(&(sectorValues.m_sectorValueY[i_branch->first].back()));
(i_branch->second)->GetEntry(iIter);
sectorValues.m_sectorValueY[i_branch->first].push_back(value);
}
}
return sectorValues;
Expand Down
31 changes: 17 additions & 14 deletions Alignment/APEEstimation/macros/DrawPlot.C
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


DrawPlot::DrawPlot(const unsigned int iterationNumber, const bool summaryFile):
outpath_(0), file_(0), fileZeroApe_(0), designFile_(0), baselineTreeX_(0), baselineTreeY_(0), delta0_(0),
outpath_(nullptr), file_(nullptr), fileZeroApe_(nullptr), designFile_(nullptr), baselineTreeX_(nullptr), baselineTreeY_(nullptr), delta0_(nullptr),
legendEntry_("data (final APE)"), legendEntryZeroApe_("data (APE=0)"), designLegendEntry_("MCideal"),
legendXmin_(0.41), legendYmin_(0.27), legendXmax_(0.71), legendYmax_(0.42),
thesisMode_(false)
Expand Down Expand Up @@ -64,6 +64,9 @@ thesisMode_(false)
if(!baselineTreeX_)std::cout<<"Baseline tree for x coordinate not found, cannot draw baselines!\n";
if(!baselineTreeY_)std::cout<<"Baseline tree for y coordinate not found, cannot draw baselines!\n";

baseLineTreeX_->SetDirectory(nullptr);
baselineTreeY_->SetDirectory(nullptr);

delete inpath;
delete fileName;
delete fileNameZeroApe;
Expand Down Expand Up @@ -291,27 +294,27 @@ DrawPlot::drawPlot(const TString& pluginName, const TString& histName, const boo
std::stringstream ss_sectorName, ss_sector;
ss_sectorName<<"Sector_"<<iSector;
ss_sector<<*plugin<<ss_sectorName.str()<<"/";
TDirectory* dir(0);
TDirectory* dir(nullptr);
//std::cout<<"Sector: "<<ss_sector.str()<<"\n";
dir = (TDirectory*)designFile_->TDirectory::GetDirectory(ss_sector.str().c_str());
if(!dir)break;

TH1* SectorName(0);
TH1* SectorName(nullptr);
designFile_->GetObject((ss_sector.str()+"z_name;1").c_str(), SectorName);
const TString sectorName(SectorName ? SectorName->GetTitle() : ss_sectorName.str().c_str());


TTree* baselineTree(0);
TTree* baselineTree(nullptr);
if(histName=="h_residualWidthX1"){baselineTree = baselineTreeX_;}
else if(histName=="h_residualWidthY1"){baselineTree = baselineTreeY_;}
if(baselineTree){
std::stringstream ss_branch;
ss_branch<<"Ape_Sector_"<<iSector;
TBranch* branch(0);
TBranch* branch(nullptr);
branch = baselineTree->GetBranch(ss_branch.str().c_str());
if(branch){
double delta0(999.);
branch->SetAddress(&delta0);
double delta0(999.);
branch->SetAddress(&delta0);
branch->GetEntry(0);
delta0_ = new double(std::sqrt(delta0));
}
Expand Down Expand Up @@ -361,9 +364,9 @@ void
DrawPlot::printHist(const TString& fullName, const TString& sectorName, const bool normalise, const bool plotZeroApe){
if(thesisMode_)gStyle->SetOptStat(0);

TH1* hist(0);
TH1* histZeroApe(0);
TH1* designHist(0);
TH1* hist(nullptr);
TH1* histZeroApe(nullptr);
TH1* designHist(nullptr);
if(file_)file_->GetObject(fullName + ";1", hist);
if(fileZeroApe_)fileZeroApe_->GetObject(fullName + ";1", histZeroApe);
designFile_->GetObject(fullName + ";1", designHist);
Expand Down Expand Up @@ -420,7 +423,7 @@ DrawPlot::printHist(const TString& fullName, const TString& sectorName, const bo
if(delta0_){
const double xLow(designHist->GetXaxis()->GetXmin());
const double xUp(designHist->GetXaxis()->GetXmax());
TLine* baseline(0);
TLine* baseline(nullptr);
baseline = new TLine(xLow,*delta0_,xUp,*delta0_);
baseline->SetLineStyle(2);
baseline->SetLineWidth(2);
Expand All @@ -432,15 +435,15 @@ DrawPlot::printHist(const TString& fullName, const TString& sectorName, const bo
canvas->Update();

//TPaveStats* stats =(TPaveStats*) hist->GetListOfFunctions()->At(1);
TPaveStats* statsZeroApe(0);
TPaveStats* statsZeroApe(nullptr);
if(histZeroApe)statsZeroApe = (TPaveStats*)histZeroApe->GetListOfFunctions()->FindObject("stats");
if(statsZeroApe){
statsZeroApe->SetY1NDC(0.58);
statsZeroApe->SetY2NDC(0.78);
statsZeroApe->SetLineColor(2);
statsZeroApe->SetTextColor(2);
}
TPaveStats* stats(0);
TPaveStats* stats(nullptr);
if(hist)stats = (TPaveStats*)hist->GetListOfFunctions()->FindObject("stats");
if(stats){
stats->SetY1NDC(0.37);
Expand All @@ -451,7 +454,7 @@ DrawPlot::printHist(const TString& fullName, const TString& sectorName, const bo
canvas->Modified();
canvas->Update();

TLegend* legend(0);
TLegend* legend(nullptr);
const LegendEntries& legendEntries = this->adjustLegendEntry(sectorName, hist, histZeroApe, designHist);
legend = new TLegend(legendXmin_, legendYmin_, legendXmax_, legendYmax_);
this->adjustLegend(legend);
Expand Down
Loading

0 comments on commit ac05899

Please sign in to comment.