forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmssw-dqm-reference.file
57 lines (49 loc) · 1.57 KB
/
cmssw-dqm-reference.file
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
## NOCOMPILER
BuildRequires: cmssw
BuildRequires: local-cern-siteconf
Source: none
%if "%{?events:set}" != "set"
%define events 200
%endif
%if "%{?WFFilter:set}" != "set"
%define WFFilter grep '.*+HARVEST'
%endif
%if "%{?jobs:set}" != "set"
%define jobs 8
%endif
%define initenv %initenv_direct
%define RunTheMatrixArgs --useInput all --command '-n %{events}'
%prep
%build
cmssw_ver=`echo $CMSSW_VERSION | sed 's|-cms\d*$||'`
if [ "$cmssw_ver" != "%{realversion}" ] ; then
echo "ERROR: %n version %realversion does not match with cmssw version $cmssw_ver"
echo " Please update %n.spec file and use $cmssw_ver as its version"
exit 1
fi
source %{cmsroot}/cmsset_default.sh
CMS_PATH=$LOCAL_CERN_SITECONF_ROOT; export CMS_PATH
cd $CMSSW_ROOT
eval `scram run -sh`
cd %_builddir
rm -rf pyRelval
mkdir pyRelval
cd pyRelval
wfs=`runTheMatrix.py -n | grep '^[0-9][0-9]*\.[0-9][0-9]* *.*+HARVEST' | %{WFFilter} | awk '{print $1}' | tr '\n' ',' | sed 's|,$||'`
if [ "X$wfs" != "X" ]; then runTheMatrix.py %{RunTheMatrixArgs} -l $wfs -j %{jobs} ; fi
%install
mkdir %i/data
wfs=""
for dir in `find %{_builddir}/pyRelval -name "*+HARVEST*" -maxdepth 1 -mindepth 1 -type d` ; do
dname=`basename $dir`
for file in `find $dir -name "DQM_V*.root" -type f`; do
[ -d %i/data/$dname ] || mkdir %i/data/$dname
cp $file %i/data/$dname
wfs="$wfs `echo $dname | sed -e s'|_.*||'`"
done
done
if [ "X$wfs" != "X" ] ; then
mkdir %i/etc
wfs=`echo $wfs | tr ' ' '\n' | sort | uniq | tr '\n' ',' | sed 's|,$||'`
echo "%{RunTheMatrixArgs} -l $wfs" > %i/etc/runTheMatrix.args
fi