Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LHCbDIRAC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Anton Lu
LHCbDIRAC
Commits
dc345417
Commit
dc345417
authored
7 years ago
by
Federico Stagni
Browse files
Options
Downloads
Patches
Plain Diff
minor fixes
parent
27feb422
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
LHCbDIRAC/Interfaces/API/DiracLHCb.py
+24
-23
24 additions, 23 deletions
LHCbDIRAC/Interfaces/API/DiracLHCb.py
with
24 additions
and
23 deletions
LHCbDIRAC/Interfaces/API/DiracLHCb.py
+
24
−
23
View file @
dc345417
...
...
@@ -39,6 +39,22 @@ def getSiteForSE( se ):
return
S_OK
(
result
[
'
Value
'
][
0
]
)
return
S_OK
(
''
)
def
__translateBKPath
(
bkPath
,
procPassID
=
3
):
bk
=
filter
(
None
,
bkPath
.
split
(
'
/
'
)
)
if
procPassID
<
0
:
return
bk
try
:
bkNodes
=
bk
[
0
:
procPassID
]
bkNodes
.
append
(
'
/
'
+
'
/
'
.
join
(
bk
[
procPassID
:
-
2
]
)
)
bkNodes
.
append
(
bk
[
-
2
]
)
bkNodes
.
append
(
bk
[
-
1
]
)
except
:
print
"
Incorrect BKQuery...
\n
"
bkNodes
=
None
return
bkNodes
class
DiracLHCb
(
Dirac
):
#############################################################################
...
...
@@ -92,7 +108,7 @@ class DiracLHCb( Dirac ):
fileGuid
=
makeGuid
(
fullPath
)[
fullPath
],
printOutput
=
printOutput
)
def
addFile
(
self
,
lfn
,
fullPath
,
diracSE
,
printOutput
=
False
):
def
addFile
(
self
,
lfn
,
fullPath
,
diracSE
,
printOutput
=
False
):
#pylint: disable=arguments-differ
"""
Copy of addRootFile
"""
return
super
(
DiracLHCb
,
self
).
addFile
(
lfn
,
fullPath
,
diracSE
,
...
...
@@ -177,22 +193,6 @@ class DiracLHCb( Dirac ):
return
S_OK
(
lfns
+
list
(
ancestors
)
)
#############################################################################
def
__translateBKPath
(
self
,
bkPath
,
procPassID
=
3
):
bk
=
filter
(
None
,
bkPath
.
split
(
'
/
'
)
)
if
procPassID
<
0
:
return
bk
try
:
bkNodes
=
bk
[
0
:
procPassID
]
bkNodes
.
append
(
'
/
'
+
'
/
'
.
join
(
bk
[
procPassID
:
-
2
]
)
)
bkNodes
.
append
(
bk
[
-
2
]
)
bkNodes
.
append
(
bk
[
-
1
]
)
except
:
print
"
Incorrect BKQuery...
\n
"
bkNodes
=
None
return
bkNodes
#############################################################################
def
bkQueryRunsByDate
(
self
,
bkPath
,
startDate
,
endDate
,
dqFlag
=
'
All
'
,
selection
=
'
Runs
'
):
"""
This function allows to create and perform a BK query given a supplied
...
...
@@ -217,7 +217,8 @@ class DiracLHCb( Dirac ):
>>>
dirac
.
bkQueryRunsByDate
(
'
/LHCb/Collision16//Real Data/90000000/RAW
'
,
'
2016-08-20
'
,
'
2016-08-22
'
,
dqFlag
=
'
OK
'
,
selection
=
'
Runs
'
)
{
'
OK
'
:
True
,
'
Value
'
:
[
<
LFN1
>
,
<
LFN2
>
]}
dirac.bkQueryRunsByDate(
'
/LHCb/Collision16/Beam6500GeV-VeloClosed-MagDown/Real Data/Reco16/Stripping26/90000000/EW.DST
'
,
'
2016-08-20
'
,
'
2016-08-22
'
,dqFlag=
'
OK
'
,selection=
'
Runs
'
)
dirac.bkQueryRunsByDate(
'
/LHCb/Collision16/Beam6500GeV-VeloClosed-MagDown/Real Data/Reco16/Stripping26/90000000/EW.DST
'
,
'
2016-08-20
'
,
'
2016-08-22
'
,dqFlag=
'
OK
'
,selection=
'
Runs
'
)
@param bkPath: BK path as described above
@type bkPath: string
...
...
@@ -232,7 +233,7 @@ class DiracLHCb( Dirac ):
@return: S_OK,S_ERROR
"""
runSelection
=
[
'
Runs
'
,
'
ProcessedRuns
'
,
'
NotProcessed
'
]
if
not
selection
in
runSelection
:
if
selection
not
in
runSelection
:
return
S_ERROR
(
'
Expected one of %s not
"
%s
"
for selection
'
%
(
'
,
'
.
join
(
runSelection
),
selection
)
)
if
not
isinstance
(
bkPath
,
str
):
...
...
@@ -332,7 +333,7 @@ class DiracLHCb( Dirac ):
# remove any double slashes, spaces must be preserved
# remove any empty components from leading and trailing slashes
bkPath
=
self
.
__translateBKPath
(
bkPath
,
procPassID
=
1
)
bkPath
=
__translateBKPath
(
bkPath
,
procPassID
=
1
)
if
not
len
(
bkPath
)
==
4
:
return
S_ERROR
(
'
Expected 4 components to the BK path: /<Run Number>/<Processing Pass>/<Event Type>/<File Type>
'
)
...
...
@@ -407,7 +408,7 @@ class DiracLHCb( Dirac ):
# remove any double slashes, spaces must be preserved
# remove any empty components from leading and trailing slashes
bkPath
=
self
.
__translateBKPath
(
bkPath
,
procPassID
=
1
)
bkPath
=
__translateBKPath
(
bkPath
,
procPassID
=
1
)
if
len
(
bkPath
)
<
2
:
return
S_ERROR
(
'
Invalid bkPath: should at least contain /ProductionID/FileType
'
)
query
=
self
.
bkQueryTemplate
.
copy
()
...
...
@@ -465,7 +466,7 @@ class DiracLHCb( Dirac ):
# remove any double slashes, spaces must be preserved
# remove any empty components from leading and trailing slashes
bkPath
=
self
.
__translateBKPath
(
bkPath
,
procPassID
=
3
)
bkPath
=
__translateBKPath
(
bkPath
,
procPassID
=
3
)
if
not
len
(
bkPath
)
==
6
:
return
S_ERROR
(
'
Expected 6 components to the BK path:
\
/<ConfigurationName>/<Configuration Version>/<Sim or Data Taking Condition>/<Processing Pass>/<Event Type>/<File Type>
'
)
...
...
@@ -1050,6 +1051,6 @@ class DiracLHCb( Dirac ):
ancestorsLFNs
=
[]
for
ancestorsLFN
in
res
[
'
Value
'
][
'
Successful
'
].
itervalues
():
ancestorsLFNs
+=
[
i
[
'
FileName
'
]
for
i
in
ancestorsLFN
]
inputData
+=
ancestorsLFN
inputData
+=
ancestorsLFN
s
return
inputData
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment