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

Bugfixes and updates to the geometry comparison tool #9200

Closed
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -7,9 +7,10 @@ class Alignment:
def __init__(self, name, config, runGeomComp = "1"):
self.condShorts = {
"TrackerAlignmentErrorExtendedRcd":
{"zeroAPE":{"connectString": ("frontier://FrontierProd"
"/CMS_COND_31X_FROM21X"),
"tagName": "TrackerIdealGeometryErrors210_mc",
{"zeroAPE":{"connectString": ("frontier://PromptProd"
Copy link
Contributor

Choose a reason for hiding this comment

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

why PromptProd? It cannot be used for tests as it is the Tier-0 servlet. Please use FrontierProd

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changing this line was one of the main fixes to get the extended alignment parameter errors working. I had a look at the recent global tags and there TrackerAlignmentErrorExtendedRcd has frontier://PromptProd/CMS_COND_ALIGN_000 as PFN
Since I am new to alignment I am not sure what else to use.

Copy link
Contributor

Choose a reason for hiding this comment

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

@cschomak please move to condDBv2 interface using frontier://FrontierProd/CMS_CONDITIONS PFN

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did the changes you suggested

"/CMS_COND_ALIGN_000"),
"tagName": "TrackerAlignmentExtendedErr_2009_v2_express_IOVs",

"labelName": ""}}}
section = "alignment:%s"%name
if not config.has_section( section ):
Expand Down
Expand Up @@ -44,7 +44,7 @@
cd .oO[CMSSW_BASE]Oo./src
export SCRAM_ARCH=.oO[SCRAM_ARCH]Oo.
eval `scramv1 ru -sh`
rfmkdir -p .oO[datadir]Oo. &>! /dev/null
#rfmkdir -p .oO[datadir]Oo. &>! /dev/null

#remove possible result file from previous runs
previous_results=$(cmsLs -l /store/caf/user/$USER/.oO[eosdir]Oo. | awk '{print $5}')
Expand Down
Expand Up @@ -98,6 +98,7 @@ def getRepMap(self, alignment = None):
"CMSSW_RELEASE_BASE": self.cmsswreleasebase,
"alignmentName": alignment.name,
"condLoad": alignment.getConditions(),
"condLoad": alignment.getConditions(),
})
return result

Expand Down

Large diffs are not rendered by default.

Expand Up @@ -9,9 +9,14 @@
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
process.GlobalTag.globaltag = ".oO[GlobalTag]Oo."

process.load("Configuration.Geometry.GeometryDB_cff")
#process.load('Configuration.Geometry.GeometryExtended2015_cff')
#process.TrackerTopologyEP = cms.ESProducer("TrackerTopologyEP")

#process.load("Configuration.StandardSequences.Geometry_cff")
process.load("Configuration.Geometry.GeometryRecoDB_cff")
#process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi")
#process.load("Geometry.TrackerGeometryBuilder.trackerGeometry_cfi")
process.load("Geometry.TrackerGeometryBuilder.trackerGeometryDB_cfi")

#process.load("Alignment.CommonAlignmentProducer.GlobalPosition_Frontier_cff")
process.load("CondCore.DBCommon.CondDBSetup_cfi")
Expand Down Expand Up @@ -50,11 +55,15 @@
# global tag
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
process.GlobalTag.globaltag = ".oO[GlobalTag]Oo."
process.load("Configuration.Geometry.GeometryDB_cff")

#process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi")
#process.load('Configuration.Geometry.GeometryExtended2015_cff')
#process.TrackerTopologyEP = cms.ESProducer("TrackerTopologyEP")

#process.load("Configuration.StandardSequences.Geometry_cff")
process.load("Configuration.Geometry.GeometryRecoDB_cff")
#process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi")
#process.load("Geometry.TrackerGeometryBuilder.trackerGeometry_cfi")
process.load("Geometry.TrackerGeometryBuilder.trackerGeometryDB_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 there are many commented loads. Would it be possible to clean it up?

#process.load("Alignment.CommonAlignmentProducer.GlobalPosition_Frontier_cff")
# the input .GlobalPosition_Frontier_cff is providing the frontier://FrontierProd/CMS_COND_31X_ALIGNMENT in the release which does not provide the ideal geometry
Expand Down Expand Up @@ -113,7 +122,7 @@
dbOutputTemplate= """
//_________________________ db Output ____________________________
# setup for writing out to DB
include "CondCore/DBCommon/data/CondDBSetup.cfi"
include "CondCore/DBCommon/CondDBSetup.cfi"
# include "CondCore/DBCommon/data/CondDBCommon.cfi"

service = PoolDBOutputService {
Expand Down
69 changes: 56 additions & 13 deletions Alignment/OfflineValidation/scripts/comparisonScript.C
Expand Up @@ -33,25 +33,68 @@ void comparisonScript (TString inFile,//="mp1510_vs_mp1509.Comparison_commonTrac
// from r and dphi

// now the object to produce the comparison plots is created
GeometryComparisonPlotter * cp = new GeometryComparisonPlotter (inFile, outDir);

// Plot Translations
GeometryComparisonPlotter * trans = new GeometryComparisonPlotter (inFile, outDir);
// x and y contain the couples to plot
// -> every combination possible will be performed
// /!\ always give units (otherwise, unexpected bug from root...)
vector<TString> x,y;
x.push_back("r"); cp->SetBranchUnits("r", "cm");
x.push_back("phi"); cp->SetBranchUnits("phi", "rad");
x.push_back("z"); cp->SetBranchUnits("z", "cm"); //cp->SetBranchMax("z", 100); cp->SetBranchMin("z", -100);
y.push_back("dr"); cp->SetBranchSF("dr", 10000); cp->SetBranchUnits("dr", "#mum");
y.push_back("dz"); cp->SetBranchSF("dz", 10000); cp->SetBranchUnits("dz", "#mum");
y.push_back("rdphi"); cp->SetBranchSF("rdphi",10000); cp->SetBranchUnits("rdphi", "#mum rad");
y.push_back("dx"); cp->SetBranchSF("dx", 10000); cp->SetBranchUnits("dx", "#mum"); //cp->SetBranchMax("dx", 10); cp->SetBranchMin("dx", -10);
y.push_back("dy"); cp->SetBranchSF("dy", 10000); cp->SetBranchUnits("dy", "#mum"); //cp->SetBranchMax("dy", 10); cp->SetBranchMin("dy", -10);
cp->MakePlots(x, y); // default output is pdf, but png gives a nicer result, so we use it as well
x.push_back("r"); trans->SetBranchUnits("r", "cm");
x.push_back("phi"); trans->SetBranchUnits("phi", "rad");
x.push_back("z"); trans->SetBranchUnits("z", "cm"); //trans->SetBranchMax("z", 100); trans->SetBranchMin("z", -100);
y.push_back("dr"); trans->SetBranchSF("dr", 10000); trans->SetBranchUnits("dr", "#mum");
y.push_back("dz"); trans->SetBranchSF("dz", 10000); trans->SetBranchUnits("dz", "#mum");
y.push_back("rdphi"); trans->SetBranchSF("rdphi",10000); trans->SetBranchUnits("rdphi", "#mum rad");
y.push_back("dx"); trans->SetBranchSF("dx", 10000); trans->SetBranchUnits("dx", "#mum"); //trans->SetBranchMax("dx", 10); trans->SetBranchMin("dx", -10);
y.push_back("dy"); trans->SetBranchSF("dy", 10000); trans->SetBranchUnits("dy", "#mum"); //trans->SetBranchMax("dy", 10); trans->SetBranchMin("dy", -10);
trans->MakePlots(x, y); // default output is pdf, but png gives a nicer result, so we use it as well
// remark: what takes the more time is the creation of the output files,
// not the looping on the tree (because the code is perfect, of course :p)
cp->SetGrid(1,1);
cp->SetPrintOption("png");
cp->MakePlots(x, y);
trans->SetGrid(1,1);
trans->SetPrintOption("png");
trans->MakePlots(x, y);


// Plot Rotations
GeometryComparisonPlotter * rot = new GeometryComparisonPlotter (inFile, outDir);
// x and y contain the couples to plot
// -> every combination possible will be performed
// /!\ always give units (otherwise, unexpected bug from root...)
vector<TString> a,b;
a.push_back("alpha"); rot->SetBranchUnits("alpha", "rad");
a.push_back("beta"); rot->SetBranchUnits("beta", "rad");
a.push_back("gamma"); rot->SetBranchUnits("gamma", "rad");
b.push_back("dalpha"); rot->SetBranchUnits("dalpha", "rad");
b.push_back("dbeta"); rot->SetBranchUnits("dbeta", "rad");
b.push_back("dgamma"); rot->SetBranchUnits("dgamma", "rad");
rot->MakePlots(a, b); // default output is pdf, but png gives a nicer result, so we use it as well
// remark: what takes the more time is the creation of the output files,
// not the looping on the tree (because the code is perfect, of course :p)
rot->SetGrid(1,1);
rot->SetPrintOption("png");
rot->MakePlots(a, b);

// Plot cross talk
GeometryComparisonPlotter * cross = new GeometryComparisonPlotter (inFile, outDir);
// x and y contain the couples to plot
// -> every combination possible will be performed
// /!\ always give units (otherwise, unexpected bug from root...)
vector<TString> dx,dy;
dx.push_back("dr"); cross->SetBranchSF("dr", 10000); cross->SetBranchUnits("dr", "#mum");
dx.push_back("dz"); cross->SetBranchSF("dz", 10000); cross->SetBranchUnits("dz", "#mum");
dx.push_back("rdphi"); cross->SetBranchSF("rdphi",10000); cross->SetBranchUnits("rdphi", "#mum rad");
dx.push_back("dx"); cross->SetBranchSF("dx", 10000); cross->SetBranchUnits("dx", "#mum");
dx.push_back("dy"); cross->SetBranchSF("dy", 10000); cross->SetBranchUnits("dy", "#mum");
dy.push_back("dalpha"); cross->SetBranchUnits("dalpha", "rad");
dy.push_back("dbeta"); cross->SetBranchUnits("dbeta", "rad");
dy.push_back("dgamma"); cross->SetBranchUnits("dgamma", "rad");
cross->MakePlots(dx,dy); // default output is pdf, but png gives a nicer result, so we use it as well
// remark: what takes the more time is the creation of the output files,
// not the looping on the tree (because the code is perfect, of course :p)
cross->SetGrid(1,1);
cross->SetPrintOption("png");
cross->MakePlots(dx, dy);

// now the same object can be reused with other specifications/cuts
//void SetPrint (const bool); // activates the printing of the individual and global pdf
Expand Down
17 changes: 6 additions & 11 deletions Alignment/OfflineValidation/scripts/makeArrowPlots.C
Expand Up @@ -12,7 +12,7 @@ float y_,x_,z_,phi_,r_,dphi_,dr_,dx_,dz_,dy_;
int level_,sublevel_;
char outputDir_[192];

void Plot10Mu(char* text,float X, float Y, float size)
void Plot10Mu(const char* text,float X, float Y, float size)
{
TPaveText* atext = new TPaveText(X,Y,X+size,Y+size);
atext->AddText(text);
Expand Down Expand Up @@ -48,13 +48,8 @@ void DrawRPhiLegend(double xLim, double yLim, double barrelRPhiRescale)
normArrow(xTest+dYTest,yTest-4*dYTest-disty,500./10000*barrelRPhiRescale);
}

void Write()
{
output->Write();
}


int makeRPhiArrowPlot( TTree* data, char* name, double xLim, double yLim, double level, double sublevel, double zMin, double zMax, double rMin, double rMax, double barrelRPhiRescale){
int makeRPhiArrowPlot( TTree* data, const char* name, double xLim, double yLim, double level, double sublevel, double zMin, double zMax, double rMin, double rMax, double barrelRPhiRescale){


TCanvas* OBPCanvas = new TCanvas(name,name,1050,875);
Expand All @@ -80,7 +75,7 @@ int makeRPhiArrowPlot( TTree* data, char* name, double xLim, double yLim, double
DrawRPhiLegend( xLim, yLim, barrelRPhiRescale );

char sliceLeg[192];
sprintf( sliceLeg, "%s: %d < z <= %d", name, zMin, zMax );
sprintf( sliceLeg, "%s: %f < z <= %f", name, zMin, zMax );
//Plot10Mu( name, xLim/2, yLim, 0.2*xLim );
TPaveText* atext = new TPaveText(0.2*xLim,0.85*yLim,0.66*xLim,0.99*yLim);
atext->AddText(sliceLeg);
Expand All @@ -99,7 +94,7 @@ int makeRPhiArrowPlot( TTree* data, char* name, double xLim, double yLim, double
return passcut;
}

int makeZPhiArrowPlot( TTree* data, char* name, double zLim, double phiLim, double level, double sublevel, double zMin, double zMax, double rMin, double rMax, double barrelRPhiRescale){
int makeZPhiArrowPlot( TTree* data, const char* name, double zLim, double phiLim, double level, double sublevel, double zMin, double zMax, double rMin, double rMax, double barrelRPhiRescale){


TCanvas* OBPCanvas = new TCanvas(name,name,1050,875);
Expand All @@ -125,7 +120,7 @@ int makeZPhiArrowPlot( TTree* data, char* name, double zLim, double phiLim, doub
DrawRPhiLegend( zLim, phiLim, barrelRPhiRescale );

char sliceLeg[192];
sprintf( sliceLeg, "%s: %d < r <= %d", name, rMin, rMax );
sprintf( sliceLeg, "%s: %f < r <= %f", name, rMin, rMax );
//Plot10Mu( name, xLim/2, yLim, 0.2*xLim );
TPaveText* atext = new TPaveText(0.2*zLim,0.85*phiLim,0.66*zLim,0.99*phiLim);
atext->AddText(sliceLeg);
Expand Down Expand Up @@ -198,7 +193,7 @@ int makeRZArrowPlot( TTree* data, char* name, double zLim, double zLimMax, doubl
}
*/

void makeArrowPlots(char* filename, char* outputDir)
void makeArrowPlots(const char* filename, const char* outputDir)
{

fin = new TFile(filename);
Expand Down