Skip to content

Commit

Permalink
Merge pull request #10486 from alja/hidePF-75
Browse files Browse the repository at this point in the history
75x Fireworks: hide PF user code by the default
  • Loading branch information
davidlange6 committed Jul 31, 2015
2 parents 833842a + 8c91654 commit ddb4450
Show file tree
Hide file tree
Showing 12 changed files with 163 additions and 70 deletions.
5 changes: 5 additions & 0 deletions Fireworks/Core/interface/Context.h
Expand Up @@ -88,6 +88,9 @@ class Context {
void voteMaxEtAndEnergy(float Et, float energy) const;
void resetMaxEtAndEnergy() const;

bool getHidePFBuilders() const { return m_hidePFBuilders; }
void setHidePFBuilders( bool x ) { m_hidePFBuilders = x; }

// ---------- member functions ---------------------------

void initEveElements();
Expand Down Expand Up @@ -129,6 +132,8 @@ class Context {
mutable float m_maxEt;
mutable float m_maxEnergy;

mutable bool m_hidePFBuilders;

TEveCaloDataHist *m_caloData;
TEveCaloDataVec *m_caloDataHF;

Expand Down
4 changes: 3 additions & 1 deletion Fireworks/Core/scripts/cmsShow
Expand Up @@ -103,7 +103,9 @@ setupEnv()
unset DYLD_LIBRARY_PATH
fi
export DYLD_LIBRARY_PATH=$CMSSW_BASE/external/gcc/lib64
export PATH=${ROOTSYS}/bin:$PATH
export PATH=$CMSSW_BASE/external/gcc/bin:${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
12 changes: 11 additions & 1 deletion Fireworks/Core/src/CmsShowMain.cc
Expand Up @@ -94,6 +94,7 @@ static const char* const kAdvancedRenderCommandOpt = "shine,s";
static const char* const kHelpOpt = "help";
static const char* const kHelpCommandOpt = "help,h";
static const char* const kSoftCommandOpt = "soft";
static const char* const kExpertCommandOpt = "expert";
static const char* const kPortCommandOpt = "port";
static const char* const kPlainRootCommandOpt = "prompt";
static const char* const kRootInteractiveCommandOpt = "root-interactive,r";
Expand Down Expand Up @@ -161,7 +162,8 @@ CmsShowMain::CmsShowMain(int argc, char *argv[])
(kSimGeomFileCommandOpt,po::value<std::string>(), "Geometry file for browsing in table view. Default is CmsSimGeom-14.root. Can be simulation or reco geometry in TGeo format")
(kFieldCommandOpt, po::value<double>(), "Set magnetic field value explicitly. Default is auto-field estimation")
(kRootInteractiveCommandOpt, "Enable root interactive prompt")
(kSoftCommandOpt, "Try to force software rendering to avoid problems with bad hardware drivers")
(kSoftCommandOpt, "Try to force software rendering to avoid problems with bad hardware drivers")
(kExpertCommandOpt, "Enable PF user plugins.")
(kHelpCommandOpt, "Display help message");

po::options_description livedesc("Live Event Display");
Expand Down Expand Up @@ -334,6 +336,14 @@ CmsShowMain::CmsShowMain(int argc, char *argv[])
m_context->getField()->setUserField(vm[kFieldCommandOpt].as<double>());
}

if(vm.count(kExpertCommandOpt))
{
m_context->setHidePFBuilders(false);
}
else {
m_context->setHidePFBuilders(true);
}

if ( m_inputFiles.empty()) {
f=boost::bind(&CmsShowMainBase::setupConfiguration,this);
startupTasks()->addTask(f);
Expand Down
1 change: 1 addition & 0 deletions Fireworks/Core/src/Context.cc
Expand Up @@ -78,6 +78,7 @@ Context::Context(FWModelChangeManager* iCM,
m_commonPrefs(0),
m_maxEt(1.f),
m_maxEnergy(1.f),
m_hidePFBuilders(false),
m_caloData(0),
m_caloDataHF(0)
{
Expand Down
6 changes: 6 additions & 0 deletions Fireworks/Core/src/FWDetailViewManager.cc
Expand Up @@ -143,6 +143,12 @@ FWDetailViewManager::findViewersFor(const std::string& iType) const
for(std::set<std::string>::iterator it = detailViews.begin(), itEnd=detailViews.end();
it!=itEnd;
++it) {

if (m_context->getHidePFBuilders()) {
std::size_t found = it->find("PF ");
if (found != std::string::npos)
break;
}
std::string::size_type first = it->find_first_of('@');
std::string type = it->substr(0,first);

Expand Down
8 changes: 7 additions & 1 deletion Fireworks/Core/src/FWEveViewManager.cc
Expand Up @@ -797,6 +797,12 @@ FWEveViewManager::supportedTypesAndRepresentations() const
for (size_t bii = 0, bie = blist.size(); bii != bie; ++bii)
{
BuilderInfo &info = blist[bii];

if (context().getHidePFBuilders()) {
const static std::string pfExt = "PF ";
if (std::string::npos != info.m_name.find(pfExt))
continue;
}

unsigned int bitPackedViews = info.m_viewBit;
bool representsSubPart = (info.m_name.substr(info.m_name.find_first_of('@')-1, 1)=="!");
Expand All @@ -806,7 +812,7 @@ FWEveViewManager::supportedTypesAndRepresentations() const
std::string name;
bool isSimple;
info.classType(name, isSimple);
if(isSimple)
if(isSimple)
{
returnValue.add(boost::shared_ptr<FWRepresentationCheckerBase>(new FWSimpleRepresentationChecker(name, it->first,bitPackedViews,representsSubPart, FFOnly)) );
}
Expand Down
3 changes: 3 additions & 0 deletions Fireworks/Core/src/FWGUIManager.cc
Expand Up @@ -160,6 +160,9 @@ FWGUIManager::FWGUIManager(fireworks::Context* ctx,

for (int i = 0 ; i < FWViewType::kTypeSize; ++i)
{
if (m_context->getHidePFBuilders() && (i == FWViewType::kLegoPFECAL || i == FWViewType::kRhoPhiPF))
continue;

bool separator = (i == FWViewType::kGlimpse || i == FWViewType::kTableHLT || i == FWViewType::kLegoPFECAL);
CSGAction* action = m_cmsShowMainFrame->createNewViewerAction(FWViewType::idToName(i), separator);
action->activated.connect(boost::bind(&FWGUIManager::newViewSlot, this, FWViewType::idToName(i)));
Expand Down
186 changes: 123 additions & 63 deletions Fireworks/Core/standalone_build/make_tarball.sh
Expand Up @@ -2,41 +2,37 @@

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
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`

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

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
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 +50,18 @@ 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 +85,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

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

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 +163,55 @@ 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
echo "get $i ..............."
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 +279,12 @@ case $i in
doForce=1;
shift;
;;
--fwlite=*)
fwlite_list="${i#*=}"
shift;
;;
*)
echo "usage [$i] ----"
usage
;;
esac
Expand Down Expand Up @@ -271,9 +317,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"
getCmsLibs

getExternals
getSources
getCmsSources
getFireworksSources

mkdir -p ${tard}/lib
getCmsLibs

cp /usr/include/wchar.h $tard/external/var/inc
getDataFiles
echo $tard
if [ -n "$doTar" ] ; then
Expand Down
2 changes: 1 addition & 1 deletion Fireworks/ParticleFlow/plugins/FWPFCandidateDetailView.cc
Expand Up @@ -528,4 +528,4 @@ void FWPFCandidateDetailView::buildGLEventScene()

}

REGISTER_FWDETAILVIEW(FWPFCandidateDetailView, reco::PFCandidate, particleFlowRecHitECAL&particleFlowRecHitHF&particleFlowClusterECAL);
REGISTER_FWDETAILVIEW(FWPFCandidateDetailView, PF Candidate, particleFlowRecHitECAL&particleFlowRecHitHF&particleFlowClusterECAL);
Expand Up @@ -344,4 +344,4 @@ void FWPFCandidateWithHitsProxyBuilder::addHitsForCandidate(const reco::PFCandid
}
}

REGISTER_FWPROXYBUILDER(FWPFCandidateWithHitsProxyBuilder, reco::PFCandidateCollection,"PF CandidatesWithHits", FWViewType::kAll3DBits | FWViewType::kAllRPZBits );
REGISTER_FWPROXYBUILDER(FWPFCandidateWithHitsProxyBuilder, reco::PFCandidateCollection,"PFCandidatesWithHits", FWViewType::kAll3DBits | FWViewType::kAllRPZBits );
Expand Up @@ -137,4 +137,4 @@ FWPFEcalRecHitLegoProxyBuilder::cleanLocal()
}

//______________________________________________________________________________
REGISTER_FWPROXYBUILDER( FWPFEcalRecHitLegoProxyBuilder, EcalRecHit, "Ecal RecHit", FWViewType::kLegoPFECALBit );
REGISTER_FWPROXYBUILDER( FWPFEcalRecHitLegoProxyBuilder, EcalRecHit, "PF Ecal RecHit", FWViewType::kLegoPFECALBit );
Expand Up @@ -102,4 +102,4 @@ FWPFEcalRecHitRPProxyBuilder::build( const FWEventItem *iItem, TEveElementList *
}

//______________________________________________________________________________
REGISTER_FWPROXYBUILDER( FWPFEcalRecHitRPProxyBuilder, EcalRecHit, "Ecal RecHit", FWViewType::kRhoPhiPFBit );
REGISTER_FWPROXYBUILDER( FWPFEcalRecHitRPProxyBuilder, EcalRecHit, "PF Ecal RecHit", FWViewType::kRhoPhiPFBit );

0 comments on commit ddb4450

Please sign in to comment.