test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions | Variables
filesave_online Namespace Reference

Functions

def convert
 
def copy2dropbox
 
def filecheck
 

Variables

string DIR = '/home/dqmprolocal/output'
 
tuple dqmfile = fname_T.replace('Playback','DQM')
 For SiStrip files. More...
 
string exedir = '/home/dqmprolocal/filecopy'
 
list fhead = fname[:i]
 
list fheads = []
 extract head of file name (ex. More...
 
tuple file = fname.replace(fname[:fname.find('/DQM_')],FILEDIR)
 
string FILEDIR = '/data/dqm/dropbox'
 
string fname = fhead+'_R0000'
 extract single good file for single subsys More...
 
list fname_T = fname_Ts[i]
 
tuple fname_Ts = os.popen('ls -rt '+fhead+'_R????'+run+'_T*.root')
 
tuple i = tagfile.find('/tagfile_runend_')
 
tuple NEW_ = os.popen('find '+ DIR +'/ -type f -name "tagfile_runend_?????_*" -newer '+ TimeTag)
 ENDLESS LOOP WITH SLEEP. More...
 
tuple numbers = range(len(fname_Ts))
 
list pairs = []
 sort tag files by run number More...
 
tuple playbacks = glob.glob(DIR + '/Playback*SiStrip_R????' + run + '_T*.root')
 
list run = tagfile[i+16:i+21]
 
list Runs = []
 extract uniq runs More...
 
string server = 'srv-c2d05-19'
 
list subfiles = []
 extract new files & copy to dropbox More...
 
string TempTag = TimeTag+'-tmp'
 
string TimeTag = '/home/dqmprolocal/output/timetag'
 
string TMPDIR = '/data/dqm/.dropbox_tmp'
 
tuple tmpfile = fname.replace(fname[:fname.find('/DQM_')],TMPDIR)
 
tuple UniqHeads = list(Set(fheads))
 
tuple UniqRuns = list(Set(Runs))
 
int WAITTIME = 120
 

Function Documentation

def filesave_online.convert (   infile,
  ofile 
)

Definition at line 57 of file filesave_online.py.

57 
58 def convert(infile, ofile):
59  cmd = exedir + '/convert.sh ' + infile + ' ' +ofile
60  os.system(cmd)
61 
def filesave_online.copy2dropbox (   org,
  tmp,
  final 
)

Definition at line 33 of file filesave_online.py.

33 
34 def copy2dropbox(org,tmp,final):
35  #server = 'srv-c2d05-19' #machine to which files are transfered (2008-07-29)
36  #file_stats = os.stat(org)
37  #t1 = time.localtime(file_stats[stat.ST_CTIME])[0:5]
38  #t2 = time.localtime()[0:5]
39  #while t1 == t2:
40  #print t1, t2
41  #print 'waiting for file creation is completed...'
42  #time.sleep(60)
43  #t2 = time.localtime()[0:5]
44  ### copy files to stealth area on cmsmon and move to final area
45  #os.popen('scp -Cpc blowfish '+org+' '+server+':'+tmp).read()
46  os.popen('scp '+org+' '+server+':'+tmp).read()
47  os.popen('ssh '+server+' -t mv '+tmp+' '+final).read()
48  a=os.popen('ssh '+server+' -t ls '+final).read().split()
49  # check if file tranfer is success
50  while len(a) != 1:
51  print 'File transfer failed. try again 2 min later ...'
52  time.sleep(120)
53  os.popen('scp '+org+' '+server+':'+tmp).read()
54  os.popen('ssh '+server+' -t mv '+tmp+' '+final).read()
55  a=os.popen('ssh '+server+' -t ls '+final).read().split()
56 
double split
Definition: MVATrainer.cc:139
def filesave_online.filecheck (   rootfile)

Definition at line 15 of file filesave_online.py.

References SiPixelLorentzAngle_cfi.read, and split.

15 
16 def filecheck(rootfile):
17  cmd = exedir + '/filechk.sh ' + rootfile
18  a = os.popen(cmd).read().split()
19  tag = a.pop()
20 
21  if tag == '(int)(-1)':
22  #print "File corrupted"
23  return 0
24  elif tag == '(int)0':
25  #print "File is incomplete"
26  return 0
27  elif tag == '(int)1':
28  #print "File is OK"
29  return 1
30  else:
31  return 0
32 
double split
Definition: MVATrainer.cc:139

Variable Documentation

string filesave_online.DIR = '/home/dqmprolocal/output'

Definition at line 8 of file filesave_online.py.

tuple filesave_online.dqmfile = fname_T.replace('Playback','DQM')

For SiStrip files.

Definition at line 133 of file filesave_online.py.

string filesave_online.exedir = '/home/dqmprolocal/filecopy'

Definition at line 7 of file filesave_online.py.

list filesave_online.fhead = fname[:i]

Definition at line 113 of file filesave_online.py.

list filesave_online.fheads = []

extract head of file name (ex.

'/home/dqmprolocal/output/DQM_SiStrip')

Definition at line 110 of file filesave_online.py.

tuple filesave_online.file = fname.replace(fname[:fname.find('/DQM_')],FILEDIR)

Definition at line 140 of file filesave_online.py.

string filesave_online.FILEDIR = '/data/dqm/dropbox'

Definition at line 10 of file filesave_online.py.

tuple filesave_online.fname = fhead+'_R0000'

extract single good file for single subsys

Definition at line 119 of file filesave_online.py.

filesave_online.fname_T = fname_Ts[i]

Definition at line 126 of file filesave_online.py.

tuple filesave_online.fname_Ts = os.popen('ls -rt '+fhead+'_R????'+run+'_T*.root')

Definition at line 120 of file filesave_online.py.

tuple filesave_online.i = tagfile.find('/tagfile_runend_')

Definition at line 90 of file filesave_online.py.

tuple filesave_online.NEW_ = os.popen('find '+ DIR +'/ -type f -name "tagfile_runend_?????_*" -newer '+ TimeTag)

ENDLESS LOOP WITH SLEEP.

search new tag files NEW_ = os.popen('find '+ DIR +'/ -type f -name "DQM_*_R?????????.root" -newer '+ TimeTag).read().split()

Definition at line 75 of file filesave_online.py.

tuple filesave_online.numbers = range(len(fname_Ts))

Definition at line 123 of file filesave_online.py.

Referenced by MuonGeometrySanityCheckCustomFrame.MuonGeometrySanityCheckCustomFrame().

list filesave_online.pairs = []

sort tag files by run number

Definition at line 88 of file filesave_online.py.

Referenced by AutoCorrMat.add(), TagProbeFitTreeProducer.analyze(), SiStripFedCablingBuilderFromDb.assignDcuAndDetIds(), IsoTrig.beginJob(), FastFedCablingHistosUsingDb.connections(), MultiHitGeneratorFromChi2.hitSets(), PixelTripletNoTipGenerator.hitTriplets(), PixelTripletLowPtGenerator.hitTriplets(), SMS.location(), DTRecSegment2DProducer.produce(), DTRecSegment2DExtendedProducer.produce(), DTClusterer.produce(), and tnp::TagProbePairMaker.run().

tuple filesave_online.playbacks = glob.glob(DIR + '/Playback*SiStrip_R????' + run + '_T*.root')

Definition at line 106 of file filesave_online.py.

list filesave_online.run = tagfile[i+16:i+21]

Definition at line 91 of file filesave_online.py.

list filesave_online.Runs = []

extract uniq runs

Definition at line 96 of file filesave_online.py.

string filesave_online.server = 'srv-c2d05-19'

Definition at line 12 of file filesave_online.py.

tuple filesave_online.subfiles = []

extract new files & copy to dropbox

Definition at line 104 of file filesave_online.py.

string filesave_online.TempTag = TimeTag+'-tmp'

Definition at line 65 of file filesave_online.py.

string filesave_online.TimeTag = '/home/dqmprolocal/output/timetag'

Definition at line 11 of file filesave_online.py.

string filesave_online.TMPDIR = '/data/dqm/.dropbox_tmp'

Definition at line 9 of file filesave_online.py.

tuple filesave_online.tmpfile = fname.replace(fname[:fname.find('/DQM_')],TMPDIR)

Definition at line 139 of file filesave_online.py.

Referenced by BeamMonitor.FitAndFill().

tuple filesave_online.UniqHeads = list(Set(fheads))

Definition at line 115 of file filesave_online.py.

tuple filesave_online.UniqRuns = list(Set(Runs))

Definition at line 99 of file filesave_online.py.

int filesave_online.WAITTIME = 120

Definition at line 62 of file filesave_online.py.