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
Introduction of New-All-In-One tool for Offline Validation of TrkAlignment #38304
Introduction of New-All-In-One tool for Offline Validation of TrkAlignment #38304
Conversation
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38304/30467 ERROR: Unable to merge PR. See log https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38304/30467/cms-checkout-topic.log |
@antoniovagnerini seems we have a merge conflict
Please resolve conflict and commit again. Also having more commits than the number of files changed... that's somewhat discouraged. Please group them together into a few bigger commits with the squash option of git. |
Oh also, just looking at the first file, |
Also what does "aligned" in the title mean? |
type trk |
@cms-sw/orp-l2 can you remind me what's our review policy for files under |
@antoniovagnerini et al, I see a few files added under |
#define logInfo std::cout << "INFO: " | ||
#define logWarning std::cout << "WARNING: " | ||
#define logError std::cout << "ERROR!!! " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldnt it have been easier to just used the MsgLogger variants of this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the original implementation this was part of a ROOT macro which was supposed to work also without a cms environment. Given this is now in interface
(even though it not very clear to me why it should be the case....) and so by construction implied to be distributed with cmssw
, it probably makes sense to change it to MsgLogger.
public: | ||
|
||
SmartSelectionMonitor(){} | ||
~SmartSelectionMonitor() { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~SmartSelectionMonitor() { } | |
~SmartSelectionMonitor() = default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in next commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some cleanup/cosmetic changes / memory leak suggestion for new
h->Reset("ICE"); | ||
h->SetDirectory(gROOT); | ||
(*map)[tag] = h; | ||
// printf("new histo created with name = %30s and tag = %15s: Name=%s\n",allName.c_str(), tag.c_str(), h->GetName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented out code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in next commit.
if(h->second->GetEntries()>0)neverFilled = false; | ||
|
||
if(h->first=="all"){h->second->SetName(Form("%s_%s",h->first.c_str(),h->second->GetName()));} | ||
//printf("histo = %30s tag = %15s Name = %s\n",it->first.c_str(), h->first.c_str(), h->second->GetName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in next commit.
#include <TROOT.h> | ||
#include <TCanvas.h> | ||
#include <TLegend.h> | ||
//#include <TH1.h> // TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this still a TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in next commit.
//float dZTest =2; | ||
//float xLegObj = 20; | ||
//float yLegObj = 18; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleaned in next commit.
//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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you added a commented line... either explain why this might be needed or remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleaned.
//char outfile[192]; | ||
//sprintf( outfile, "%s/%s.png", outputDir_, name ); | ||
//OBPCanvas->Print( outfile ); | ||
std::ostringstream outfile_s; | ||
outfile_s << outputDir_ << "/" << name << ".png"; | ||
TString outfile(outfile_s.str()); | ||
OBPCanvas->Print( outfile ); | ||
sprintf(outfile, "%s/%s.pdf", outputDir_, name); | ||
OBPCanvas->SaveAs(outfile); | ||
std::ostringstream outfile2_s; | ||
outfile2_s << outputDir_ << "/" << name << ".pdf"; | ||
TString outfile2(outfile2_s.str()); | ||
//sprintf(outfile, "%s/%s.pdf", outputDir_, name); | ||
//OBPCanvas->SaveAs(outfile); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. Generally I left only quite an extensive snippet of code with makeRZArrowPlot function commented out. I believe that is unnecessary to remove.
//Specify that only 'tracks' is allowed | ||
//To use, remove the default given above and uncomment below | ||
//ParameterSetDescription desc; | ||
//desc.addUntracked<edm::InputTag>("tracks","ctfWithMaterialTracks"); | ||
//descriptions.addDefault(desc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this default text could be cleaned up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That explains why text bellow is commented out and when it should be un-commented. Therefore I would leave it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually a real fillDescriptions
method should be provided and the boiler plate code removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fillDescriptions was added
vFPIX_plus_ = SimplePoint(FPIX_plus_); | ||
vFPIX_minus_ = SimplePoint(FPIX_minus_); | ||
|
||
for (unsigned int i = 0; i < 4; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Magic numbers like the 4 here and the 3 below should be made a named constant (especially since this is going to change for Phase-2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed within next commit.
} | ||
} | ||
fout->Close(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the things that are new
-ed technically should be delete
-ed as well in the end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pointers properly dealt with.
<!-- <bin file="testAlignmentOfflineValidation.cpp" name="PVsingle"> --> | ||
<!-- <flags TEST_RUNNER_ARGS=" /bin/bash Alignment/OfflineValidation/test test_all.sh"/> --> | ||
<!-- <use name="FWCore/Utilities"/> --> | ||
<!-- </bin> --> | ||
<!-- <bin file="testPVPlotting.cpp"> --> | ||
<!-- <flags PRE_TEST="PVsingle"/> --> | ||
<!-- <use name="rootmath"/> --> | ||
<!-- <use name="roothistmatrix"/> --> | ||
<!-- <use name="rootgraphics"/> --> | ||
<!-- <use name="Alignment/OfflineValidation"/> --> | ||
<!-- </bin> --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these not needed in the end?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these should definitely be maintained.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was fully changed.
assign trk-dpg |
I am having a look at suggested changes and will try to perform rebase. It will take me some time, so please be patient. It is also likely I will add some small changes with fully new commits. In any case you can contact me here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here's some preliminary set of comments.
I might post more, once the preliminary set is addressed.
|
||
namespace AllInOneConfig { | ||
|
||
//boost::property_tree::ptree get_unique_child (const boost::property_tree::ptree& tree) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is all of this commented text needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this namespace is barely used as far as I can tell only in Alignment/OfflineValidation/bin/DMRsingle.cc
and I see no previous reference to get_unique_child
that could hint its usage. ---> Removing this commented part with the next commit.
.gitignore
Outdated
*.ini | ||
*.old | ||
*.bckp | ||
*.info |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure these changes are appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok we do no keep .gitignore anymore.
@@ -25,6 +25,8 @@ | |||
<use name="CLHEP"/> | |||
<use name="rootmath"/> | |||
<use name="roothistmatrix"/> | |||
<use name="rootgraphics"/> | |||
<lib name="MultiProc" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is also in the Alignment/OfflineValidation/bin/BuildFile.xml
.
Is it needed in both places?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems not to be needed in /bin. Removing.
validateAlignments.py $CMSSW_BASE/src/Alignment/OfflineValidation/test/test.yaml | ||
|
||
----------------------------------------------------------------------- | ||
File for submitting this DAG to HTCondor : /afs/cern.ch/user/d/dbrunner/ToolDev/CMSSW_10_6_0/src/MyTest/DAG/dagFile.condor.sub |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please don't use personal user accounts in README files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
- from DMR toy to real application | ||
- GCP (get "n-tuples" + grid, 3D, TkMaps) | ||
- DMRs (single + merge + trend) | ||
- PV (single + merge + trend) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aren't some of these already implemented??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, updated.
|
||
##Read in AllInOne config in JSON format | ||
with open(options.config, "r") as configFile: | ||
config = _byteify(json.load(configFile, object_hook=_byteify),ignore_dicts=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the _byteify
was not needed anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was removed to make runtests work.
TkMap_drange_full = TkAlMap('test', title, in_file, use_default_range=True, two_sigma_cap=False, GEO_file=geometry_file, tracker='full', palette=palette, check_tracker=auto_tk) | ||
TkMap_drange_pixel = TkAlMap('test', title, in_file, use_default_range=True, two_sigma_cap=False, GEO_file=geometry_file, tracker='pixel', palette=palette, check_tracker=auto_tk) | ||
TkMap_drange_strips = TkAlMap('test', title, in_file, use_default_range=True, two_sigma_cap=False, GEO_file=geometry_file, tracker='strips', palette=palette, check_tracker=auto_tk) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove empty lines at the end of this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -541,12 +499,16 @@ void PlotAlignmentValidation::plotSS(const std::string& options, const std::stri | |||
bool plotLayers = false; // overrides plotLayerN | |||
// bool plotRings = false; // Todo: implement this? | |||
bool plotSplits = false; | |||
if (plotSplits) | |||
; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the point of this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea. Removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I remembered. This actually is needed for a reason I have never understood. Compiler seems to throw "[-Werror=unused-but-set-variable" error eventhough 'plotSplits' is assigned in if-statement right after.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is plotSplits
used anywhere else below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes multiple times in assignments within or out of if-statements and few times in the condition itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah it is late ... indeed in that member function it is unused. Will remove it entirely in the second commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
@@ -0,0 +1,19 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this file belong here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, this can be moved away. Please approve this PR: cms-data/Alignment-OfflineValidation#3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this PR can be tested with the cms-data one, but I would suggest to push also the txt files in Alignment/OfflineValidation/data
in the same PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is tested, GCP unit test still works plus I moved file to local data dir.
<!-- <flags TEST_RUNNER_ARGS=" /bin/bash Alignment/OfflineValidation/test test_all.sh"/> --> | ||
<!-- <use name="FWCore/Utilities"/> --> | ||
<!-- </bin> --> | ||
<!-- <bin file="testPVPlotting.cpp"> --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please don't remove this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one had 'test_all.sh' as a pre-requisite, however that required the old version of validateAlignments.py to be run. Plotting libraries in testPVPlotting.cpp
are anyway implicitly used in unit test "PVall" so I could see no point in preserving this test.
Hi @antoniovagnerini given that there is a lot to do with this PR, would you mind changing it's status to a "draft PR"? Thanks! |
e0e86be
to
24a89c0
Compare
oh wow #39967 is though PR... affecting MC in all times with widespread changes... |
+alca
|
+1 |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @rappoccio (and backports should be raised in the release meeting by the corresponding L2) |
A note to @cms-sw/orp-l2: when merging, this PR requires cms-data/Alignment-OfflineValidation#3 to be merged at the same time. |
+1 Extensive review but seems to have converged. |
…ompilationEL8 fix `gcc11` compilation issues in `CompareAlignments`, post #38304 merge
PR description:
The aim of this PR is to introduce a new "All-In-One-Tool" common interface for the offline validation of the alignment. In particular, the validations affected are the functionality of DMR, PV (and relative trends), Geometry Comparisons as well as the JetHT validation.
The main improvements consist in the following:
PR validation:
Unit test have been devised for each validation type to ensure correctness of the outcome.
@connorpa @consuegs @mmusich