Skip to content

Commit

Permalink
Merge pull request #12525 from hroskes/alignment-bugfixes-75X
Browse files Browse the repository at this point in the history
Backport of #12523: Small bugfixes in alignment workflows
  • Loading branch information
cmsbuild committed Nov 27, 2015
2 parents a88710f + 63f1a5f commit 0dc8f13
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions Alignment/OfflineValidation/scripts/validateAlignments.py
Expand Up @@ -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 "
Expand Down Expand Up @@ -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 "
Expand Down
6 changes: 3 additions & 3 deletions Alignment/OfflineValidation/scripts/visualizationTracker.C
Expand Up @@ -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 ";
}
Expand Down Expand Up @@ -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;
}

Expand Down
Expand Up @@ -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"
Expand Down Expand Up @@ -117,7 +120,7 @@ void TrackerSystematicMisalignments::analyze(const edm::Event& event, const edm:
setup.get<TrackerTopologyRcd>().get(tTopoHandle);
const TrackerTopology* const tTopo = tTopoHandle.product();

edm::ESHandle<GeometricDet> geom;
edm::ESHandle<GeometricDet> geom;
setup.get<IdealGeometryRecord>().get(geom);
edm::ESHandle<PTrackerParameters> ptp;
setup.get<PTrackerParametersRcd>().get( ptp );
Expand All @@ -132,9 +135,13 @@ void TrackerSystematicMisalignments::analyze(const edm::Event& event, const edm:
setup.get<TrackerAlignmentRcd>().get(alignments);
setup.get<TrackerAlignmentErrorExtendedRcd>().get(alignmentErrors);

edm::ESHandle<Alignments> globalPositionRcd;
setup.get<TrackerDigiGeometryRecord>().getRecord<GlobalPositionRcd>().get(globalPositionRcd);

//apply the latest alignments
GeometryAligner aligner;
aligner.applyAlignments<TrackerGeometry>( &(*tracker), &(*alignments), &(*alignmentErrors), AlignTransform() );
aligner.applyAlignments<TrackerGeometry>( &(*tracker), &(*alignments), &(*alignmentErrors),
align::DetectorGlobalPosition(*globalPositionRcd, DetId(DetId::Tracker)));

}

Expand Down

0 comments on commit 0dc8f13

Please sign in to comment.