-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdumpIt
More file actions
executable file
·75 lines (65 loc) · 1.8 KB
/
dumpIt
File metadata and controls
executable file
·75 lines (65 loc) · 1.8 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/sh -f
# this script takes an input rootfile and dumps to screen the tree branches
# parameters
ARGS=1
if [ $# -lt "$ARGS" ]
# Test number of arguments to script (always a good idea).
then
echo "Usage: `basename $0` <rootfile> <nevts> <nevts> is optional default=1"
exit $E_BADARGS
fi
root_file=$1
#if [ ! -f "$root_file" ]
#then
# echo "File \"$root_file\" does not exist."
# exit $E_NOFILE
#fi
NEVT=1
if [ $# -eq 2 ]
# Number of events to dump (default=1)
then
NEVT=$2
fi
echo
echo ">>> Beginning cmsRun execution on `date` <<<"
echo ">>> Rootfile: $root_file <<<"
echo ">>> Number of events: $NEVT <<<"
echo
#create config file
export WORKDIR=${PWD}
if [ -n "${CMS_PATH:-}" ]; then
echo "CMSSW computing environment already setup"
else
#setup the environment
echo "Setting up CMSSW computing environment"
export PATH=/bin:/usr/bin:/usr/local/bin:/usr/krb5/bin:/usr/afsws/bin:/usr/krb5/bin/aklog:{$PATH}
. /afs/fnal.gov/files/code/cms/setup/shrc uaf
export SCRAM_ARCH=`scramv1 arch`
fi
cd $WORKDIR
pwd
eval `scramv1 runtime -sh`
cd ${WORKDIR}
export CFG=dumpit_${RANDOM}.cfg
cat > $CFG <<EOF
process Dump = {
#keep the logging output to a nice level
include "FWCore/MessageLogger/data/MessageLogger.cfi"
source = PoolSource {
# untracked int32 maxEvents = ${NEVT}
untracked vstring fileNames = {
#"file:${root_file}"
"${root_file}"
#"dcap://cmsdca.fnal.gov:24136/pnfs/fnal.gov/usr/cms/WAX/11/store/mc/2006/12/28/mc-onsel-120_PU_Photon_Jets_pt_120_170-DIGI-RECO-2/0000/92C84A71-C596-DB11-9476-00304875A7AF.root"
}
}
untracked PSet maxEvents = {untracked int32 input = ${NEVT}}
module dump = EventContentAnalyzer {}
path p = { dump }
}
EOF
cmsRun -p ${WORKDIR}/${CFG}
rm $CFG
echo
echo ">>> Ending cmsRun execution on `date` <<<"
echo