1 |
algomez |
1.1 |
#! /bin/env python
|
2 |
|
|
import os
|
3 |
|
|
import sys
|
4 |
|
|
import string
|
5 |
|
|
|
6 |
|
|
####################################
|
7 |
|
|
## Parameters to Modify ##
|
8 |
|
|
#####################################
|
9 |
|
|
#right now we copy from OSU to Rutgers
|
10 |
|
|
#FromSRM = 'srm://cmssrm.fnal.gov:8443/srm/managerv2?SFN=/11/store/user/clseitz/TLBM52xData/'
|
11 |
|
|
#FromSRM = 'srm://cmssrm.fnal.gov:8443/srm/managerv2?SFN=/11/store/user/lpctlbsm/crsilk/'
|
12 |
|
|
FromSRM = 'srm://cmssrm.fnal.gov:8443/srm/managerv2?SFN=/11/store/user/algomez/'
|
13 |
|
|
|
14 |
|
|
#ToSRM = 'srm://ruhex-osgce.rutgers.edu:8443/srm/v2/server?SFN=/cms/data24/algomez/'
|
15 |
|
|
ToSRM = 'file:///uscms_data/d3/algomez/files/RPV_M300_112_ISRFSRdown_1/'
|
16 |
|
|
|
17 |
|
|
#define which dataset to copu
|
18 |
|
|
#dataset = 'MultiJet/'
|
19 |
|
|
#dataset = 'SMS-T2tt_Mstop-225to1200_mLSP-50to1025_7TeV-Pythia6Z/ttbsm_v9_Summer11-PU_S4_START42_V11-v1/'
|
20 |
|
|
dataset = 'RPV_M300_112_ISRFSRdown_1/'
|
21 |
|
|
|
22 |
|
|
|
23 |
|
|
#run = 'Run2012A-PromptReco-v1_Json0601'
|
24 |
|
|
#run = 'Run2012B-PromptReco-v1_Json0601'
|
25 |
|
|
#run = '2f45e7f986681f9c0bbcc7cc31425dac'
|
26 |
|
|
#####################################
|
27 |
|
|
## Main Code ##
|
28 |
|
|
#####################################
|
29 |
|
|
#make list of all the files in a directory
|
30 |
|
|
#print 'srmls "'+FromSRM+dataset+run+'"'
|
31 |
|
|
print 'srmls "'+FromSRM+dataset+'"'
|
32 |
|
|
#outlist = os.popen('srmls "'+FromSRM+dataset+run+'"').readlines()
|
33 |
|
|
outlist = os.popen('srmls "'+FromSRM+dataset+'"').readlines()
|
34 |
|
|
#loop through all these files
|
35 |
|
|
count=0
|
36 |
|
|
for myfile in outlist:
|
37 |
|
|
#find the position in the string for a certain dataset
|
38 |
|
|
startD = int(string.find(myfile,dataset))
|
39 |
|
|
endD = startD+int(len(dataset))
|
40 |
|
|
#runD = endD+int(len(run))
|
41 |
|
|
print startD, endD, myfile[startD:endD]#, myfile[endD:runD]
|
42 |
|
|
if startD > 0:
|
43 |
|
|
if count < 550:
|
44 |
|
|
print count
|
45 |
|
|
FileName = myfile[startD:-1]
|
46 |
|
|
#OutName = myfile[runD+1:-1]
|
47 |
|
|
OutName = myfile[endD+1:-1]
|
48 |
|
|
print FileName
|
49 |
|
|
#command to acutally copy stuff
|
50 |
|
|
cmd = 'lcg-cp -b -D srmv2 "' + FromSRM + FileName + '" "' + ToSRM + OutName + '"'
|
51 |
|
|
print 'Performing: '+cmd
|
52 |
|
|
#execute the command, uncomment line below
|
53 |
|
|
os.popen(cmd)
|
54 |
|
|
count=count+1
|
55 |
|
|
#print count
|
56 |
|
|
#Performing: lcg-cp -b -D srmv2 "srm://cmssrm.fnal.gov:8443/srm/managerv2?SFN=/11/store/user/algomez/RPV_M300_112_ISRFSRdown_1//RPVgluino_M_300_8TeV_pythia6D6THC_112_cff_less_ISRFSR_py_GEN_SIM_DIGI_L1_DIGI2RAW_HLT_RAW2DIGI_L1Reco_RECO_PU_149_1_xFz.root" "srm://ruhex-osgce.rutgers.edu:8443/srm/v2/server?SFN=/cms/data24/algomez/RPVgluino_M_300_8TeV_pythia6D6THC_112_cff_less_ISRFSR_py_GEN_SIM_DIGI_L1_DIGI2RAW_HLT_RAW2DIGI_L1Reco_RECO_PU_149_1_xFz.root"
|
57 |
|
|
#38 64 RPV_M300_112_ISRFSRdown_1/
|
58 |
|
|
#371
|
59 |
|
|
#RPV_M300_112_ISRFSRdown_1//RPVgluino_M_300_8TeV_pythia6D6THC_112_cff_less_ISRFSR_py_GEN_SIM_DIGI_L1_DIGI2RAW_HLT_RAW2DIGI_L1Reco_RECO_PU_300_1_ZA8.root
|
60 |
|
|
|
61 |
|
|
|