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

Zmumu validation ported to 74X #10854

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -14,16 +14,16 @@
.oO[datasetDefinition]Oo.
# process.load("Alignment.OfflineValidation..oO[dataset]Oo._cff")

process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi")
process.load("Geometry.CommonDetUnit.globalTrackingGeometry_cfi")
#process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi")
process.load("Geometry.CommonDetUnit.globalTrackingGeometryDB_cfi")
process.load("RecoMuon.DetLayers.muonDetLayerGeometry_cfi")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cschomak is this inclusion really needed?

process.load("Geometry.MuonNumbering.muonNumberingInitialization_cfi")
process.load("RecoMuon.TrackingTools.MuonServiceProxy_cff")

########### standard includes ##############################
process.load("Configuration.StandardSequences.MagneticField_.oO[magneticField]Oo._cff")
process.load("Configuration.StandardSequences.Reconstruction_cff")
process.load("Configuration.Geometry.GeometryDB_cff")
process.load("Configuration.Geometry.GeometryRecoDB_cff")


########### DATABASE conditions ############################
Expand Down Expand Up @@ -244,8 +244,8 @@

ls -lh .

source /afs/cern.ch/sw/lcg/external/gcc/4.8.1/x86_64-slc6/setup.sh
source /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.10/x86_64-slc6-gcc48-opt/root/bin/thisroot.sh
#source /afs/cern.ch/sw/lcg/external/gcc/4.8.1/x86_64-slc6/setup.sh
#source /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.10/x86_64-slc6-gcc48-opt/root/bin/thisroot.sh

# cd .oO[CMSSW_BASE]Oo./src/MuonAnalysis/MomentumScaleCalibration/test/Macros/RooFit
# ln -fs .oO[workdir]Oo./0_zmumuHisto.root .
Expand Down
Expand Up @@ -77,50 +77,50 @@ class FitSlices
double sigma2, sigma2Min, sigma2Max;
bool useChi2;

TH3* rebin3D(const TH3* histo3D)
{
unsigned int zbins=histo3D->GetNbinsZ();
// std::cout<< "number of bins in z (and tempHisto) --> "<<zbins<<std::endl;
std::map<unsigned int, TH2*> twoDprojection;
for(unsigned int z=1;z<zbins;++z) {
histo3D->GetZaxis()->SetRange(z,z);
TH2*tempHisto= (TH2*)histo3D->Project3D("xy");
std::stringstream ss;
ss << z;
tempHisto->SetName(TString(tempHisto->GetName())+ss.str());
tempHisto->RebinX(rebinX);
tempHisto->RebinY(rebinY);
twoDprojection.insert(std::make_pair(z,tempHisto));
}
unsigned int xbins, ybins;
TH3* rebinned3D= new TH3(TString(histo3D->GetName())+"_rebinned",histo3D->GetTitle(),
xbins,histo3D->GetXaxis()->GetXmin(),histo3D->GetXaxis()->GetXmax(),
ybins,histo3D->GetYaxis()->GetXmin(),histo3D->GetYaxis()->GetXmax(),
zbins,histo3D->GetZaxis()->GetXmin(),histo3D->GetZaxis()->GetXmax() );
if(twoDprojection.size()!=0)
{
xbins=twoDprojection[1]->GetNbinsX();
ybins=twoDprojection[1]->GetNbinsY();
//std::cout<< "number of bins in x --> "<<xbins<<std::endl;
//std::cout<< "number of bins in y --> "<<ybins<<std::endl;
for(unsigned int z=1;z<zbins;++z)
{
for(unsigned int y=1;y<ybins;++y)
{
for(unsigned int x=1;x<xbins;++x)
{
std::cout<< "x/y/z= "<<x<<"/"<<y<<"/"<<z <<std::endl;
std::cout<< "number of bins in x --> "<<xbins<<std::endl;
std::cout<< "number of bins in y --> "<<ybins<<std::endl;
rebinned3D->Fill(x,y,twoDprojection[z]->GetBinContent(x,y));
}

}

}
}
return rebinned3D;
}
//~ TH3* rebin3D(TH3* histo3D)
//~ {
//~ unsigned int zbins=histo3D->GetNbinsZ();
//~ // std::cout<< "number of bins in z (and tempHisto) --> "<<zbins<<std::endl;
//~ std::map<unsigned int, TH2*> twoDprojection;
//~ for(unsigned int z=1;z<zbins;++z) {
//~ histo3D->GetZaxis()->SetRange(z,z);
//~ TH2*tempHisto= (TH2*)histo3D->Project3D("xy");
//~ std::stringstream ss;
//~ ss << z;
//~ tempHisto->SetName(TString(tempHisto->GetName())+ss.str());
//~ tempHisto->RebinX(rebinX);
//~ tempHisto->RebinY(rebinY);
//~ twoDprojection.insert(std::make_pair(z,tempHisto));
//~ }
//~ unsigned int xbins, ybins;
//~ TH3* rebinned3D= new TH3(TString(histo3D->GetName())+"_rebinned",histo3D->GetTitle(),
//~ xbins,histo3D->GetXaxis()->GetXmin(),histo3D->GetXaxis()->GetXmax(),
//~ ybins,histo3D->GetYaxis()->GetXmin(),histo3D->GetYaxis()->GetXmax(),
//~ zbins,histo3D->GetZaxis()->GetXmin(),histo3D->GetZaxis()->GetXmax() );
//~ if(twoDprojection.size()!=0)
//~ {
//~ xbins=twoDprojection[1]->GetNbinsX();
//~ ybins=twoDprojection[1]->GetNbinsY();
//~ //std::cout<< "number of bins in x --> "<<xbins<<std::endl;
//~ //std::cout<< "number of bins in y --> "<<ybins<<std::endl;
//~ for(unsigned int z=1;z<zbins;++z)
//~ {
//~ for(unsigned int y=1;y<ybins;++y)
//~ {
//~ for(unsigned int x=1;x<xbins;++x)
//~ {
//~ std::cout<< "x/y/z= "<<x<<"/"<<y<<"/"<<z <<std::endl;
//~ std::cout<< "number of bins in x --> "<<xbins<<std::endl;
//~ std::cout<< "number of bins in y --> "<<ybins<<std::endl;
//~ rebinned3D->Fill(x,y,twoDprojection[z]->GetBinContent(x,y));
//~ }
//~
//~ }
//~
//~ }
//~ }
//~ return rebinned3D;
//~ }

};

Expand Down
Expand Up @@ -23,9 +23,9 @@
cmsprel->SetBorderSize(0);
cmsprel->SetMargin(0.01);
cmsprel->SetTextAlign(12); // align left
TString text = "CMS Preliminary 2012";
TString text = "CMS Preliminary 2015";
cmsprel->AddText(0.01,0.5,text);
TString text2 = "#sqrt{s} = 8 TeV Run2012A TkAlZMuMu |#eta_{#mu}|<2.4";
TString text2 = "#sqrt{s} = 13 TeV Run2015B TkAlZMuMu |#eta_{#mu}|<2.4";
cmsprel->AddText(0.4, 0.6, text2);

TFile *file1 = new TFile("./BiasCheck.root");
Expand All @@ -34,7 +34,7 @@
bool switchONfit= false;
bool switchONfitEta= false;

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

TCanvas* c0 = new TCanvas("c0", "c0",50, 20, 800,600);
Expand Down