From 921c8c1e48699966a3a263f1856082c4761b7c6f Mon Sep 17 00:00:00 2001 From: Heshy Roskes Date: Wed, 21 Oct 2015 19:05:29 +0200 Subject: [PATCH 1/4] Delete old log files --- .../OfflineValidation/scripts/validateAlignments.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Alignment/OfflineValidation/scripts/validateAlignments.py b/Alignment/OfflineValidation/scripts/validateAlignments.py index ea6bfe9806db3..8728a7b8adb45 100755 --- a/Alignment/OfflineValidation/scripts/validateAlignments.py +++ b/Alignment/OfflineValidation/scripts/validateAlignments.py @@ -186,6 +186,10 @@ def runJob( self ): "script": script, "bsub": "/afs/cern.ch/cms/caf/scripts/cmsbsub" } + for ext in ("stdout", "stderr", "stdout.gz", "stderr.gz"): + oldlog = "%(logDir)s/%(jobName)s."%repMap + ext + if os.path.exists(oldlog): + os.remove(oldlog) bsubOut=getCommandOutput2("%(bsub)s %(commands)s " "-J %(jobName)s " "-o %(logDir)s/%(jobName)s.stdout " @@ -539,6 +543,11 @@ def main(argv = None): "bsub": "/afs/cern.ch/cms/caf/scripts/cmsbsub", "conditions": '"' + " && ".join(["ended(" + jobId + ")" for jobId in ValidationJob.batchJobIds]) + '"' } + for ext in ("stdout", "stderr", "stdout.gz", "stderr.gz"): + oldlog = "%(logDir)s/%(jobName)s."%repMap + ext + if os.path.exists(oldlog): + os.remove(oldlog) + getCommandOutput2("%(bsub)s %(commands)s " "-o %(logDir)s/%(jobName)s.stdout " "-e %(logDir)s/%(jobName)s.stderr " From 53ce034f88e4726eeb89fa6a6682553cc8f88498 Mon Sep 17 00:00:00 2001 From: Heshy Roskes Date: Fri, 23 Oct 2015 16:22:46 +0200 Subject: [PATCH 2/4] Use GraphicsMagick instead since no ImageMagick on batch machines https://cern.service-now.com/service-portal/view-incident.do?n=INC0880640 --- Alignment/OfflineValidation/scripts/visualizationTracker.C | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Alignment/OfflineValidation/scripts/visualizationTracker.C b/Alignment/OfflineValidation/scripts/visualizationTracker.C index 33aa5c5a52b71..6875911a3b4ce 100644 --- a/Alignment/OfflineValidation/scripts/visualizationTracker.C +++ b/Alignment/OfflineValidation/scripts/visualizationTracker.C @@ -318,10 +318,10 @@ string getGifMergeCommand(int start, int breakspot1, int breakspot2, int end) { return str; } -//gets string that is a unix command that merges gifs using ImageMagick +//gets string that is a unix command that merges gifs using GraphicsMagick string getConvertCommand(int start, int breakspot1, int breakspot2, int end) { string str = ""; - str += "convert -loop 0 -delay 5 "; + str += "gm convert -loop 0 -delay 5 "; for (int i = start; i < breakspot1; i++) { str += "images/i"+to_string(i)+".gif "; } @@ -448,7 +448,7 @@ void runVisualizer(TString input, //gSystem->Exec(TString(getGifMergeCommand(0, start1, start2, _i))); gSystem->Exec(TString(getConvertCommand(0, start1, start2, _i))); cout << "images merged." << endl; - gSystem->Exec(TString("convert "+_outputFileName+".gif -rotate 90 "+_outputFileName+"_rotated.gif")); + gSystem->Exec(TString("gm convert "+_outputFileName+".gif -rotate 90 "+_outputFileName+"_rotated.gif")); cout << "images rotated." << endl; } From fcf7adecb08cbc95649a94619ec9376dac1d09c8 Mon Sep 17 00:00:00 2001 From: Heshy Roskes Date: Mon, 16 Nov 2015 00:30:04 +0100 Subject: [PATCH 3/4] copy the png and pdf plots too --- .../python/TkAlAllInOneTool/configTemplates.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Alignment/OfflineValidation/python/TkAlAllInOneTool/configTemplates.py b/Alignment/OfflineValidation/python/TkAlAllInOneTool/configTemplates.py index 6f473491d4471..0658ae11e2703 100644 --- a/Alignment/OfflineValidation/python/TkAlAllInOneTool/configTemplates.py +++ b/Alignment/OfflineValidation/python/TkAlAllInOneTool/configTemplates.py @@ -221,12 +221,12 @@ if [[ $HOSTNAME = lxplus[0-9]*\.cern\.ch ]] # check for interactive mode then - image_files=$(ls --color=never | find .oO[workdir]Oo./ExtendedOfflineValidation_Images/ -name \*ps -o -name \*root) + image_files=$(ls --color=never | find .oO[workdir]Oo./ExtendedOfflineValidation_Images/ -name \*ps -o -name \*root -o -name \*png -o -name \*pdf) echo -e "\n\nProduced plot files:" #echo ${image_files} ls .oO[workdir]Oo./ExtendedOfflineValidation_Images else - image_files=$(ls --color=never | find ExtendedOfflineValidation_Images/ -name \*ps -o -name \*root) + image_files=$(ls --color=never | find ExtendedOfflineValidation_Images/ -name \*ps -o -name \*root -o -name \*png -o -name \*pdf) echo -e "\n\nProduced plot files:" #echo ${image_files} ls ExtendedOfflineValidation_Images From 63f1a5f6312301879607048d447b94eaeb9a4a9e Mon Sep 17 00:00:00 2001 From: Heshy Roskes Date: Fri, 20 Nov 2015 20:19:51 +0100 Subject: [PATCH 4/4] Use the correct GlobalPosition so that the output can be consistently compared to the input --- .../plugins/TrackerSystematicMisalignments.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Alignment/TrackerAlignment/plugins/TrackerSystematicMisalignments.cc b/Alignment/TrackerAlignment/plugins/TrackerSystematicMisalignments.cc index fe8340157fb15..37580d2cabb37 100644 --- a/Alignment/TrackerAlignment/plugins/TrackerSystematicMisalignments.cc +++ b/Alignment/TrackerAlignment/plugins/TrackerSystematicMisalignments.cc @@ -12,12 +12,15 @@ #include "CondFormats/AlignmentRecord/interface/TrackerAlignmentRcd.h" #include "CondFormats/Alignment/interface/AlignmentErrorsExtended.h" #include "CondFormats/AlignmentRecord/interface/TrackerAlignmentErrorExtendedRcd.h" +#include "CondFormats/Alignment/interface/DetectorGlobalPosition.h" +#include "CondFormats/AlignmentRecord/interface/GlobalPositionRcd.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "DataFormats/DetId/interface/DetId.h" +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "Geometry/TrackingGeometryAligner/interface/GeometryAligner.h" #include "CLHEP/Random/RandGauss.h" @@ -117,7 +120,7 @@ void TrackerSystematicMisalignments::analyze(const edm::Event& event, const edm: setup.get().get(tTopoHandle); const TrackerTopology* const tTopo = tTopoHandle.product(); - edm::ESHandle geom; + edm::ESHandle geom; setup.get().get(geom); edm::ESHandle ptp; setup.get().get( ptp ); @@ -132,9 +135,13 @@ void TrackerSystematicMisalignments::analyze(const edm::Event& event, const edm: setup.get().get(alignments); setup.get().get(alignmentErrors); + edm::ESHandle globalPositionRcd; + setup.get().getRecord().get(globalPositionRcd); + //apply the latest alignments GeometryAligner aligner; - aligner.applyAlignments( &(*tracker), &(*alignments), &(*alignmentErrors), AlignTransform() ); + aligner.applyAlignments( &(*tracker), &(*alignments), &(*alignmentErrors), + align::DetectorGlobalPosition(*globalPositionRcd, DetId(DetId::Tracker))); }