Skip to content

Commit

Permalink
Merge pull request #9874 from alja/root6-tarball
Browse files Browse the repository at this point in the history
Fix bug in Track's magnetic field determination
  • Loading branch information
cmsbuild committed Jun 25, 2015
2 parents a026722 + 6b949d4 commit 59aa5e2
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 67 deletions.
5 changes: 3 additions & 2 deletions Fireworks/Core/scripts/cmsShow
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ setupEnv()
export CMSSW_SEARCH_PATH=".:$CMSSW_BASE"
export CMSSW_DATA_PATH="."
export ROOTSYS=$CMSSW_BASE/external/root
export LD_LIBRARY_PATH=${CMSSW_BASE}/external/gcc/lib64:${ROOTSYS}/lib:${CMSSW_BASE}/external/lib:${CMSSW_BASE}/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${CMSSW_BASE}/external/gcc/lib64:${ROOTSYS}/lib:${CMSSW_BASE}/external/lib:${CMSSW_BASE}/lib
export DYLD_FALLBACK_LIBRARY_PATH=/opt/X11/lib:${LD_LIBRARY_PATH}

if [ -n "$DYLD_LIBRARY_PATH" ]; then
Expand All @@ -104,6 +104,7 @@ setupEnv()
fi
export DYLD_LIBRARY_PATH=$CMSSW_BASE/external/gcc/lib64
export PATH=${ROOTSYS}/bin:$PATH
export ROOT_INCLUDE_PATH=${CMSSW_BASE}/external/gcc/include:${CMSSW_BASE}/external/gcc/include/x86_64-redhat-linux-gnu:${CMSSW_BASE}/external/gcc/include/backward:${CMSSW_BASE}/external/var-inc:$CMSSW_BASE/external/var-inc/sigc++:$CMSSW_BASE/external/var-inc/HepMC/include:${CMSSW_BASE}/src
# move cmsShow.exe to libexec
SHELLDIR=$SHELLDIR/libexec
else
Expand Down Expand Up @@ -192,7 +193,7 @@ if [ "X$debuginteractiveflag" = Xon ] ; then
if [[ `uname` == 'Linux' ]]; then
gdbCmd="gdb --args $SHELLDIR/cmsShow.exe $originalOptions"
else
gdbCmd="lldb $SHELLDIR/cmsShow.exe $originalOptions"
gdbCmd="lldb -- $SHELLDIR/cmsShow.exe $originalOptions"
fi
exec $gdbCmd
elif [ "X$valgrindflag" = Xon ] ; then
Expand Down
4 changes: 3 additions & 1 deletion Fireworks/Core/src/FWMagField.cc
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ void FWMagField::checkFieldInfo(const edm::EventBase* event)
{
const static float currentToField = 3.8/18160;
bool available = false;
m_source = kNone;
try
{
edm::InputTag conditionsTag("conditionsInEdm");
Expand All @@ -188,6 +189,7 @@ void FWMagField::checkFieldInfo(const edm::EventBase* event)
{
available = true;
m_eventField = currentToField * runCond->BAvgCurrent;
m_source = kEvent;
fwLog( fwlog::kDebug ) << "Magnetic field info found in ConditionsInEdm branch : "<< m_eventField << std::endl;
}
else
Expand All @@ -204,6 +206,7 @@ void FWMagField::checkFieldInfo(const edm::EventBase* event)

available = true;
m_eventField = currentToField * sum/dcsStatus->size();
m_source = kEvent;
fwLog( fwlog::kDebug) << "Magnetic field info found in DcsStatus branch: " << m_eventField << std::endl;
}

Expand All @@ -216,7 +219,6 @@ void FWMagField::checkFieldInfo(const edm::EventBase* event)

if (!available)
{
m_source = kNone;
fwLog( fwlog::kDebug ) << "No magnetic field info available in Event\n";
}
}
Expand Down
186 changes: 122 additions & 64 deletions Fireworks/Core/standalone_build/make_tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,38 @@

getExternals()
{
mkdir ${tard}/external
mkdir ${tard}/external

# external libraries
extdl=${tard}/external/lib
mkdir $extdl
extt=/tmp/cmsswExt
ext=`dirname ${CMSSW_DATA_PATH}`/external
ls -l $CMSSW_RELEASE_BASE/external/$SCRAM_ARCH/lib/* > $extt
ext=$CMS_PATH/$SCRAM_ARCH/external # this used to be CMSSW_DATA_PATH
echo "=========================================================="
echo "=========================================================="

gccd=${tard}/external

export gcmd=`which gcc`
gv=`perl -e ' if ($ENV{gcmd} =~ /\/gcc\/(.*)\/bin\/gcc/) { print $1;}'`
printf "gcc version $gv"
if [ -z "$gv" ]; then
echo "can't get gcc version"
exit;
fi
echo "Copy gcc from $ext/gcc/${gv}/ to ${gccd}"
for i in bin etc lib lib64 libexec
do
cp -a $ext/gcc/${gv}/$i ${gccd}/gcc
done
if [ `uname` = "Darwin" ]; then
echo "Renaming gcc lib directory to lib64."
mv ${gccd}/gcc/lib ${gccd}/gcc/lib64
fi

cd $CMSSW_BASE
echo "Copy gcc subdirs"
scram tool tag gcc-ccompiler GCC_CCOMPILER_BASE
gccd_src=`scram tool tag gcc-ccompiler GCC_CCOMPILER_BASE`
set -x
gccd_target=${tard}/external/gcc
mkdir $gccd_target
cp -a $gccd_src/include $gccd_target
cp -a $gccd_src/bin $gccd_target

if [ `uname` = "Darwin" ]; then
cp -a $gccd_src/lib $gccd_target/lib64
else
cp -a $gccd_src/lib64 $gccd_target/lib64
fi
exit
echo "=========================================================="
echo "=========================================================="


echo "Copying external libraries from $ext to $extdl."

# external libraries
extdl=${tard}/external/lib
mkdir $extdl
extt=/tmp/cmsswExt
ls -l $CMSSW_RELEASE_BASE/external/$SCRAM_ARCH/lib/* > $extt
# cp -a $ext/*/*/lib/* ${tard}/external/lib
for i in boost bz2lib castor clhep dcap db4 dcap \
expat fftw3 gdbm gsl hepmc\
Expand All @@ -54,6 +51,19 @@ getExternals()
cp -a $ext/$i/$ever/lib/* ${extdl}
done


echo "=========================================================="
echo "=========================================================="
echo "Copying external headers."

mkdir ${tard}/external/var-inc
for i in CLHEP HepMC boost sigcpp; do
# scram tool info $i | grep INCL | head -1
edir=`scram tool info $i | grep INCL | head -1| perl -ne 'if ($_ =~/\=(.*)$/) {print "$1\n"}'`
if [ -n $edir ]; then
cp -r $edir/* ${tard}/external/var-inc
fi
done

echo "=========================================================="
echo "=========================================================="
Expand All @@ -77,52 +87,36 @@ getExternals()
cp -a $origr ${tard}/external/root

}
#----------------------------------------------------------------

getCmssw()
#----------------------------------------------------------------
getCmsSources()
{
echo "=========================================================="
echo "=========================================================="
echo "get CMS libs"

mkdir -p ${tard}/lib
fwl="/tmp/fwlite_build_set.file"
$dwnCmd $fwl https://raw.githubusercontent.com/cms-sw/cmsdist/IB/CMSSW_7_3_X/stable/fwlite_build_set.file

# remove package without libs
perl -i -ne 'print unless /Fireworks\/Macros/' $fwl
perl -i -ne 'print unless /FWCore\/PythonUtilities/' $fwl
perl -i -ne 'print unless /DataFormats\/MuonData/' $fwl
perl -i -ne 'print unless /Utilities\/ReleaseScripts/' $fwl

cn=${tard}/lib/.edmplugincache;
fwpl=`cat $fwl | perl -ne 'if( ~/(.+)\/(.+)$/){print "$1$2 ";}'`
echo "get list from $fwpl"
for i in $fwpl
for i in `cat $fwl` $extra_list
do
cp -f $CMSSW_RELEASE_BASE/lib/$SCRAM_ARCH/*${i}* $tard/lib
grep $i $CMSSW_RELEASE_BASE/lib/$SCRAM_ARCH/.edmplugincache >> $cn
grep $i $CMSSW_BASE/lib/$SCRAM_ARCH/.edmplugincache >> $cn
# run-away headers
if [ -f $CMSSW_RELEASE_BASE/src/${i} ]; then
mkdir -p $tard/src/`dirname $i`
cp $CMSSW_RELEASE_BASE/src/$i $tard/src/$i
fi

done;

# workaround for missing fwlite package list
for i in CondFormatsSerialization GeometryCommonDetUnit DataFormatsMuonSeed
do
cp -f $CMSSW_RELEASE_BASE/lib/$SCRAM_ARCH/*${i}* $tard/lib
grep $i $CMSSW_RELEASE_BASE/lib/$SCRAM_ARCH/.edmplugincache >> $cn
grep $i $CMSSW_BASE/lib/$SCRAM_ARCH/.edmplugincache >> $cn
done
mkdir -p $tard/src/$i
mkdir -p $tard/src/$i/src

echo "getting libs from $CMSSW_BASE/lib/$SCRAM_ARCH"
cp -f $CMSSW_BASE/lib/$SCRAM_ARCH/* ${tard}/lib/

sort -u $cn -o $cn
if [ -e $CMSSW_BASE/src/$i ]; then
cp -rf $CMSSW_BASE/src/${i}/interface $tard/src/$i
cp -rf $CMSSW_BASE/src/${i}/src/*.h $tard/src/$i/src
else
cp -rf $CMSSW_RELEASE_BASE/src/${i}/interface $tard/src/$i
cp -rf $CMSSW_RELEASE_BASE/src/${i}/src/*.h $tard/src/$i/src
fi
done;
}

#----------------------------------------------------------------

getSources()
getFireworksSources()
{
echo "=========================================================="
echo "=========================================================="
Expand Down Expand Up @@ -171,6 +165,51 @@ getSources()

#----------------------------------------------------------------

getCmsLibs()
{
echo "=========================================================="
echo "=========================================================="
echo "get CMS libs"

libext=".so";
if [ `uname` = "Darwin" ]; then
libext=".dylib";
fi

cat $fwl | grep -v '\.h$' > ${fwl}tmp
# remove package without libs
perl -i -ne 'print unless /Fireworks\/Macros/' ${fwl}tmp
perl -i -ne 'print unless /FWCore\/PythonUtilities/' ${fwl}tmp
perl -i -ne 'print unless /DataFormats\/MuonData/' ${fwl}tmp
perl -i -ne 'print unless /Utilities\/ReleaseScripts/' ${fwl}tmp


libl=`cat ${fwl}tmp | perl -ne 'if( ~/(.+)\/(.+)$/){print "$1$2 ";}'`
libl_extra=`echo $extra_list | perl -pe '{ s/\///og;}'`

echo "get FWLite libraries"

cn=${tard}/lib/.edmplugincache;
for i in $libl $libl_extra; do
if [ -e $CMSSW_BASE/lib/$SCRAM_ARCH/lib${i}.$libext ]; then
cp -f $CMSSW_BASE/lib/$SCRAM_ARCH/*${i}* $tard/lib
else
cp -f $CMSSW_RELEASE_BASE/lib/$SCRAM_ARCH/*${i}* $tard/lib
fi
grep $i $CMSSW_RELEASE_BASE/lib/$SCRAM_ARCH/.edmplugincache >> $cn
grep $i $CMSSW_BASE/lib/$SCRAM_ARCH/.edmplugincache >> $cn
done

echo "getting libs from $CMSSW_BASE/lib/$SCRAM_ARCH"
cp -f $CMSSW_BASE/lib/$SCRAM_ARCH/* ${tard}/lib/

sort -u $cn -o $cn

rm ${fwl}tmp
}

#----------------------------------------------------------------

getDataFiles()
{
echo "=========================================================="
Expand Down Expand Up @@ -238,7 +277,12 @@ case $i in
doForce=1;
shift;
;;
--fwlite=*)
fwlite_list="${i#*=}"
shift;
;;
*)
echo "usage [$i] ----"
usage
;;
esac
Expand Down Expand Up @@ -271,9 +315,23 @@ fi

origd=$PWD

getCmssw
if [ -z fwlite_list ]; then
fwl="/tmp/fwlite_build_set.file"
$dwnCmd $fwl https://raw.githubusercontent.com/cms-sw/cmsdist/IB/CMSSW_7_3_X/stable/fwlite_build_set.file
else
fwl=$fwlite_list
fi
extra_list="/CondFormats/Serialization /Geometry/CommonDetUnit /DataFormats/MuonSeed"


getExternals
getSources
getCmsSources
getFireworksSources

mkdir -p ${tard}/lib
getCmsLibs


getDataFiles
echo $tard
if [ -n "$doTar" ] ; then
Expand Down

0 comments on commit 59aa5e2

Please sign in to comment.