Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
DQMServices
Diagnostic
scripts
Database
Python
SelectRuns.py
Go to the documentation of this file.
1
import
os
2
3
class
SelectRuns
:
4
5
BaseDir =
"/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/HDQM/Cron/Scripts/RunSelection/Test"
6
Group =
"Collisions10"
7
# Group = "Cosmics10"
8
FirstRun =
"1"
9
FileName = BaseDir+
"/SelectedGoodRuns.txt"
10
HLTNameFilter =
""
11
QualityFlag =
"Strip:GOOD"
12
13
def
makeList
(self):
14
# Save the old run list file
15
os.system(
"mv "
+self.
FileName
+
" "
+self.
FileName
+
".old"
)
16
17
# Create the cfg for the run registry script
18
inputFile = open(self.
BaseDir
+
"/runreg_template.cfg"
,
"
r")
19
# print "OutputFileName = ", self.FileName
20
outputFileContent = inputFile.read().
replace
(
"GROUP"
, self.
Group
).
replace
(
"FIRSTRUN"
, self.
FirstRun
).
replace
(
"OUTPUTFILENAME"
, self.
FileName
).
replace
(
"HLTNAMEFILTER"
, self.
HLTNameFilter
).
replace
(
"QUALITYFLAG"
, self.
QualityFlag
)
21
outputFile = open(self.
BaseDir
+
"/runreg.cfg"
,
"w"
)
22
outputFile.write(outputFileContent)
23
outputFile.close()
24
25
# Produce the new run list file
26
os.system(
"source /afs/cern.ch/cms/ccs/wm/scripts/Crab/crab.sh; python "
+self.
BaseDir
+
"/runregparse.py"
)
27
28
# Check if the file changed
29
import
filecmp
30
if
os.path.isfile(self.
FileName
+
".old"
):
31
if
filecmp.cmp(self.
FileName
, self.
FileName
+
".old"
):
32
# They are equal
33
return
1
34
return
0
SelectRuns.SelectRuns.FileName
string FileName
Definition:
SelectRuns.py:9
SelectRuns.SelectRuns.HLTNameFilter
string HLTNameFilter
Definition:
SelectRuns.py:10
python.rootplot.root2matplotlib.replace
def replace
Definition:
root2matplotlib.py:443
SelectRuns.SelectRuns.FirstRun
string FirstRun
Definition:
SelectRuns.py:8
SelectRuns.SelectRuns.QualityFlag
string QualityFlag
Definition:
SelectRuns.py:11
SelectRuns.SelectRuns.BaseDir
string BaseDir
Definition:
SelectRuns.py:5
SelectRuns.SelectRuns.Group
string Group
Definition:
SelectRuns.py:6
SelectRuns.SelectRuns
Definition:
SelectRuns.py:3
SelectRuns.SelectRuns.makeList
def makeList
Definition:
SelectRuns.py:13
Generated for CMSSW Reference Manual by
1.8.5