35 |
|
dbs = None |
36 |
|
dataset = None |
37 |
|
option = 'lfn' |
38 |
+ |
private = False |
39 |
|
|
40 |
|
# Read new values from the command line |
41 |
|
for opt, arg in opts: |
56 |
|
cmd = "--dataset= required parameter not provided." |
57 |
|
raise RuntimeError, cmd |
58 |
|
|
59 |
+ |
# is it a private production |
60 |
+ |
f = dataset.split('/') |
61 |
+ |
if f[1] == "mc": |
62 |
+ |
private = True |
63 |
+ |
#print ' Attention -- private dataset identified.' |
64 |
+ |
|
65 |
|
#--------------------------------------------------------------------------------------------------- |
66 |
|
# main |
67 |
|
#--------------------------------------------------------------------------------------------------- |
68 |
+ |
if private: |
69 |
+ |
lfn = '/store/user/paus' + dataset |
70 |
+ |
dir = '/mnt/hadoop/cms/store/user/paus' + dataset |
71 |
+ |
cmd = 'list ' + dir |
72 |
+ |
for line in os.popen(cmd).readlines(): |
73 |
+ |
line = line[:-1] |
74 |
+ |
f = line.split(' ') |
75 |
+ |
size = int(f[0]) |
76 |
+ |
file = f[1] |
77 |
+ |
|
78 |
+ |
cmdCount = 'catalogFile.sh /mnt/hadoop/cms' + lfn + \ |
79 |
+ |
'/' + file + ' 2>/dev/null|tail -1|cut -d\' \' -f5' |
80 |
+ |
#print ' COUNT: ' + cmdCount |
81 |
+ |
nEvts = 0 |
82 |
+ |
for tmp in os.popen(cmdCount).readlines(): |
83 |
+ |
nEvts = tmp[:-1] |
84 |
+ |
|
85 |
+ |
print '%s#00000000-0000-0000-0000-000000000000 %s/%s %s'%(dataset,lfn,file,nEvts) |
86 |
+ |
sys.exit() |
87 |
+ |
|
88 |
|
if not db: |
89 |
|
# find relevant blocks |
90 |
|
if dbs == 'none': |