Commit 1af62586 authored by Giulio Dujany's avatar Giulio Dujany
Browse files

added plots also for Tracker and Muon

parent b80c598b
......@@ -80,7 +80,6 @@ def plotsCompare(Pages, files_histo, outputFile_name, normalize = True):
def publishHistosCompare(Pages, files_histo, run, monSvc, folder_name='MoniOnlineAligVelo'):
histo_paths = sum([i[1] for i in Pages],[])
allHistos = []
for histo_path in histo_paths:
path, histo_args = histo_path[:2]
inFiles = {key: r.TFile(path) for key, path in files_histo.items()}
......@@ -137,8 +136,6 @@ if __name__ == '__main__':
alignlog = args.alignlog if args.alignlog else findAlignlog(activity, run)
files_histo = {'old': args.histoFiles[0], 'new': args.histoFiles[1]} if args.histoFiles else findHistos(activity, run)
folder_name = 'MoniOnlineAligVelo'
if args.online:
#################################################################
......@@ -153,6 +150,7 @@ if __name__ == '__main__':
mj.Saver = False
# Start our main job
gaudi, monSvc = start()
folder_name = 'MoniOnlineAligVelo'
#################################################################
......
......@@ -9,6 +9,7 @@ if __name__ == '__main__':
parser.add_argument('--alignlog', help='location of alignlog.txt, default is guessed by run number')
parser.add_argument('--histoFiles', help='location of histograms files, expect two paths, old ad new align histos, default is guessed by run number', nargs=2)
parser.add_argument('-o','--outFile',help='output file name')
parser.add_argument('--online',help='Setup monitoring job to send the histograms to the presenter', action='store_true')
args = parser.parse_args()
##########################
......@@ -19,7 +20,7 @@ from GaudiPython import gbl
from AlignmentOutputParser.AlignOutput import *
from AlignmentMonitoring.MultiPlot import MultiPlot
from AlignmentMonitoring.OnlineUtils import findLastRun, findAlignlog, findHistos
from AlignmentMonitoring.RootUtils import getExpression, getDofDeltas, getDofDeltaConvergence, makeGraph, makeHisto, getDrawnCanvas
from AlignmentMonitoring.RootUtils import getExpression, getDofDeltas, getDofDeltaConvergence, makeGraph, makeHisto, getDrawnCanvas, makeGraphHisto
import AlignmentMonitoring.RootUtils
from moniPlots import plotsCompare
......@@ -47,9 +48,23 @@ if __name__ == '__main__':
alignlog = args.alignlog if args.alignlog else findAlignlog(activity, run)
# files_histo = {'old': args.histoFiles[0], 'new': args.histoFiles[1]} if args.histoFiles else findHistos(activity, run)
# print files_histo
print alignlog
if args.online:
#################################################################
# Initialize monitoring Job to send plots to the presenter
#################################################################
from Configurables import MonitoringJob
from Monitoring.MonitoringJob import start
mj = MonitoringJob()
# JobName should be the same as the saver
mj.JobName = "MoniOnlineAlig"
mj.Sender = True
mj.Saver = False
# Start our main job
gaudi, monSvc = start()
folder_name = 'MoniOnlineAligMuon'
#################################################################
# read alignlog
aout = AlignOutput(alignlog)
aout.Parse()
......@@ -68,6 +83,10 @@ if __name__ == '__main__':
mps.append(MultiPlot(expression, title = '{0};Iteration;{0}'.format(title), histos = {expression:gr},
kind='g', drawLegend = False))
mps[-1].DrawOption = 'alp'
if args.online:
monSvc.publishHistogram(folder_name,
makeGraphHisto(expression, title, getExpression(aout, expression)),
runNumber=int(run), add=False)
# 2 halves
c.cd()
......@@ -79,6 +98,16 @@ if __name__ == '__main__':
mps[-1].Add(makeGraph(*getDofDeltaConvergence(aout, dof='Tx', alignable='Muon/M{0}/M{0}CSide'.format(i))), 'Tx_C',-1)
mps[-1].Add(makeGraph(*getDofDeltaConvergence(aout, dof='Ty', alignable='Muon/M{0}/M{0}ASide'.format(i))), 'Ty_A',2)
mps[-1].Add(makeGraph(*getDofDeltaConvergence(aout, dof='Ty', alignable='Muon/M{0}/M{0}CSide'.format(i))), 'Ty_C',-2)
if args.online:
monSvc.publishHistogram(folder_name, makeGraphHisto('M{0}A_Tx'.format(i), 'M{0}A;Iteration;Variation Tx [mm]'.format(i),
*getDofDeltaConvergence(aout, dof='Tx', alignable='Muon/M{0}/M{0}ASide'.format(i))), runNumber=int(run), add=False)
monSvc.publishHistogram(folder_name, makeGraphHisto('M{0}C_Tx'.format(i), 'M{0}C;Iteration;Variation Tx [mm]'.format(i),
*getDofDeltaConvergence(aout, dof='Tx', alignable='Muon/M{0}/M{0}CSide'.format(i))), runNumber=int(run), add=False)
monSvc.publishHistogram(folder_name, makeGraphHisto('M{0}A_Ty'.format(i), 'M{0}A;Iteration;Variation Ty [mm]'.format(i),
*getDofDeltaConvergence(aout, dof='Ty', alignable='Muon/M{0}/M{0}ASide'.format(i))), runNumber=int(run), add=False)
monSvc.publishHistogram(folder_name, makeGraphHisto('M{0}C_Ty'.format(i), 'M{0}C;Iteration;Variation Ty [mm]'.format(i),
*getDofDeltaConvergence(aout, dof='Ty', alignable='Muon/M{0}/M{0}CSide'.format(i))), runNumber=int(run), add=False)
c1 = getDrawnCanvas(mps)
......@@ -87,7 +116,9 @@ if __name__ == '__main__':
c.Print(outputFile_name+']')
if args.online:
gaudi.stop()
gaudi.finalize()
......@@ -9,6 +9,7 @@ if __name__ == '__main__':
parser.add_argument('--alignlog', help='location of alignlog.txt, default is guessed by run number')
parser.add_argument('--histoFiles', help='location of histograms files, expect two paths, old ad new align histos, default is guessed by run number', nargs=2)
parser.add_argument('-o','--outFile',help='output file name')
parser.add_argument('--online',help='Setup monitoring job to send the histograms to the presenter', action='store_true')
args = parser.parse_args()
##########################
......@@ -123,6 +124,34 @@ Configs = {
}
def publishHistosCompare(Configs, files_histo, run, monSvc, folder_name='MoniOnlineAligTracker'):
histo_paths = sum([i.items() for i in Configs.values()],[])
for histo_path in histo_paths:
path, histo_args = histo_path[:2]
inFiles = {key: r.TFile(path) for key, path in files_histo.items()}
histos = {key: inFiles[key].Get(path) for key in inFiles}
if not histo_args.has_key('title'):
histo_args['title'] = histos['old'].GetTitle()
if not histo_args.has_key('name'):
histo_args['name'] = '_'.join(path.split('/')[-2:])
histos['new'].SetTitle(histo_args['title'])
histos['old'].SetTitle(histo_args['title'])
histos['new'].SetName(histo_args['name'])
histos['old'].SetName(histo_args['name']+'_reference')
if isinstance(histos['old'],r.TProfile) or isinstance(histos['old'],r.TGraph):
histos['old'] = histos['old'].ProjectionX(histos['old'].GetName())
histos['new'] = histos['new'].ProjectionX(histos['new'].GetName())
# if isinstance(histos['old'],r.TGraph):
# continue
monSvc.publishHistogram(folder_name, histos['new'], runNumber=int(run), add=False)
monSvc.publishHistogram(folder_name, histos['old'], runNumber=int(run), add=False)
from AlignmentOutputParser.AlignOutput import *
from matplotlib.backends.backend_pdf import PdfPages
......@@ -139,6 +168,22 @@ if __name__ == '__main__':
files_histo = {'old': args.histoFiles[0], 'new': args.histoFiles[1]} if args.histoFiles else OnlineUtils.findHistos(activity,run)
print files_histo
if args.online:
#################################################################
# Initialize monitoring Job to send plots to the presenter
#################################################################
from Configurables import MonitoringJob
from Monitoring.MonitoringJob import start
mj = MonitoringJob()
# JobName should be the same as the saver
mj.JobName = "MoniOnlineAlig"
mj.Sender = True
mj.Saver = False
# Start our main job
gaudi, monSvc = start()
folder_name = 'MoniOnlineAligTracker'
#################################################################
outputFile_name = args.outFile if args.outFile else 'MoniPlots.pdf'
c = r.TCanvas('c', 'c')
......@@ -148,6 +193,9 @@ if __name__ == '__main__':
for label, f in files_histo.iteritems(): monApp.addFile(label+':'+f)
monApp.draw(c, False)
if args.online:
publishHistosCompare(Configs=Configs, files_histo=files_histo, run=run, monSvc=monSvc, folder_name=folder_name)
#-->read alignlog.txt file
c = r.gPad.GetCanvas()
r.gPad.SetGrid(0,0)
......@@ -162,6 +210,11 @@ if __name__ == '__main__':
mps.append(MultiPlot(expression, title = '{0};Iteration;{0}'.format(title), histos = {expression:gr},
kind='g', drawLegend = False))
mps[-1].DrawOption = 'alp'
if args.online:
monSvc.publishHistogram(folder_name,
RootUtils.makeGraphHisto(expression, title, RootUtils.getExpression(aout, expression)),
runNumber=int(run), add=False)
# 2 halves
c.cd()
......@@ -173,6 +226,17 @@ if __name__ == '__main__':
mp1.Add(RootUtils.makeGraph(*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='TT/TTb/TTbVLayer')), 'TTbVLayer.Tz')
mp1.Add(RootUtils.makeGraph(*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='TT/TTb/TTbXLayer')), 'TTbXLayer.Tz')
if args.online:
monSvc.publishHistogram(folder_name, RootUtils.makeGraphHisto('TTaXLayer_Tz', 'Convergence TTaX Tz;Iteration;Variation [#mum]',
*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='TT/TTa/TTaXLayer')), runNumber=int(run), add=False)
monSvc.publishHistogram(folder_name, RootUtils.makeGraphHisto('TTaULayer_Tz', 'Convergence TTaU Tz;Iteration;Variation [#mum]',
*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='TT/TTa/TTaULayer')), runNumber=int(run), add=False)
monSvc.publishHistogram(folder_name, RootUtils.makeGraphHisto('TTbVLayer_Tz', 'Convergence TTbV Tz;Iteration;Variation [#mum]',
*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='TT/TTb/TTbVLayer')), runNumber=int(run), add=False)
monSvc.publishHistogram(folder_name, RootUtils.makeGraphHisto('TTbXLayer_Tz', 'Convergence TTbX Tz;Iteration;Variation [#mum]',
*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='TT/TTb/TTbXLayer')), runNumber=int(run), add=False)
mp2 = MultiPlot('2', title = '(25) Convergence IT1 Tz;Iteration;Variation [#mum]',kind='g', hlines=[0,-150,150], rangeY = [-250, 250])
mp2.DrawOption = 'alp'
mp2.Add(RootUtils.makeGraph(*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='IT/Station1/ASideBox')), 'IT1.ASideBox.Tz')
......@@ -180,6 +244,17 @@ if __name__ == '__main__':
mp2.Add(RootUtils.makeGraph(*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='IT/Station1/TopBox')), 'IT1.TopBox.Tz')
mp2.Add(RootUtils.makeGraph(*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='IT/Station1/BottomBox')), 'IT1.BottomBox.Tz')
if args.online:
monSvc.publishHistogram(folder_name, RootUtils.makeGraphHisto('IT1_ASideBox_Tz', 'Convergence IT1 ASideBox Tz;Iteration;Variation [#mum]',
*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='IT/Station1/ASideBox')), runNumber=int(run), add=False)
monSvc.publishHistogram(folder_name, RootUtils.makeGraphHisto('IT1_CSideBox_Tz', 'Convergence IT1 CSideBox Tz;Iteration;Variation [#mum]',
*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='IT/Station1/CSideBox')), runNumber=int(run), add=False)
monSvc.publishHistogram(folder_name, RootUtils.makeGraphHisto('IT1_TopBox_Tz', 'Convergence IT1 TopBox Tz;Iteration;Variation [#mum]',
*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='IT/Station1/TopBox')), runNumber=int(run), add=False)
monSvc.publishHistogram(folder_name, RootUtils.makeGraphHisto('IT1_BottomBox_Tz', 'Convergence IT1 BottomBox Tz;Iteration;Variation [#mum]',
*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='IT/Station1/BottomBox')), runNumber=int(run), add=False)
mp3 = MultiPlot('2', title = '(26) Convergence IT2 Tz;Iteration;Variation [#mum]',kind='g', hlines=[0,-150,150], rangeY = [-250, 250])
mp3.DrawOption = 'alp'
mp3.Add(RootUtils.makeGraph(*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='IT/Station2/ASideBox')), 'IT2.ASideBox.Tz')
......@@ -187,6 +262,17 @@ if __name__ == '__main__':
mp3.Add(RootUtils.makeGraph(*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='IT/Station2/TopBox')), 'IT2.TopBox.Tz')
mp3.Add(RootUtils.makeGraph(*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='IT/Station2/BottomBox')), 'IT2.BottomBox.Tz')
if args.online:
monSvc.publishHistogram(folder_name, RootUtils.makeGraphHisto('IT2_ASideBox_Tz', 'Convergence IT2 ASideBox Tz;Iteration;Variation [#mum]',
*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='IT/Station2/ASideBox')), runNumber=int(run), add=False)
monSvc.publishHistogram(folder_name, RootUtils.makeGraphHisto('IT2_CSideBox_Tz', 'Convergence IT2 CSideBox Tz;Iteration;Variation [#mum]',
*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='IT/Station2/CSideBox')), runNumber=int(run), add=False)
monSvc.publishHistogram(folder_name, RootUtils.makeGraphHisto('IT2_TopBox_Tz', 'Convergence IT2 TopBox Tz;Iteration;Variation [#mum]',
*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='IT/Station2/TopBox')), runNumber=int(run), add=False)
monSvc.publishHistogram(folder_name, RootUtils.makeGraphHisto('IT2_BottomBox_Tz', 'Convergence IT2 BottomBox Tz;Iteration;Variation [#mum]',
*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='IT/Station2/BottomBox')), runNumber=int(run), add=False)
mp4 = MultiPlot('2', title = '(27) Convergence IT3 Tz;Iteration;Variation [#mum]',kind='g', hlines=[0,-150,150], rangeY = [-250, 250])
mp4.DrawOption = 'alp'
mp4.Add(RootUtils.makeGraph(*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='IT/Station3/ASideBox')), 'IT3.ASideBox.Tz')
......@@ -194,6 +280,17 @@ if __name__ == '__main__':
mp4.Add(RootUtils.makeGraph(*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='IT/Station3/TopBox')), 'IT3.TopBox.Tz')
mp4.Add(RootUtils.makeGraph(*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='IT/Station3/BottomBox')), 'IT3.BottomBox.Tz')
if args.online:
monSvc.publishHistogram(folder_name, RootUtils.makeGraphHisto('IT3_ASideBox_Tz', 'Convergence IT3 ASideBox Tz;Iteration;Variation [#mum]',
*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='IT/Station3/ASideBox')), runNumber=int(run), add=False)
monSvc.publishHistogram(folder_name, RootUtils.makeGraphHisto('IT3_CSideBox_Tz', 'Convergence IT3 CSideBox Tz;Iteration;Variation [#mum]',
*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='IT/Station3/CSideBox')), runNumber=int(run), add=False)
monSvc.publishHistogram(folder_name, RootUtils.makeGraphHisto('IT3_TopBox_Tz', 'Convergence IT3 TopBox Tz;Iteration;Variation [#mum]',
*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='IT/Station3/TopBox')), runNumber=int(run), add=False)
monSvc.publishHistogram(folder_name, RootUtils.makeGraphHisto('IT3_BottomBox_Tz', 'Convergence IT3 BottomBox Tz;Iteration;Variation [#mum]',
*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='IT/Station3/BottomBox')), runNumber=int(run), add=False)
mp5 = MultiPlot('3', title = '(28) Convergence OT Tz;Iteration;Variation [#mum]', kind='g', hlines=[0,-200,200], rangeY = [-250, 250] )
mp5.DrawOption = 'alp'
......@@ -204,6 +301,21 @@ if __name__ == '__main__':
mp5.Add(RootUtils.makeGraph(*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='OT/T3X1U')), 'OT3.X1U.Tz')
mp5.Add(RootUtils.makeGraph(*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='OT/T3VX2')), 'OT3.VX2.Tz')
if args.online:
monSvc.publishHistogram(folder_name, RootUtils.makeGraphHisto('OT1_X1U_Tz', 'Convergence OT1 X1U Tz;Iteration;Variation [#mum]',
*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='OT/T1X1U')), runNumber=int(run), add=False)
monSvc.publishHistogram(folder_name, RootUtils.makeGraphHisto('OT1_VX2_Tz', 'Convergence OT1 VX2 Tz;Iteration;Variation [#mum]',
*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='OT/T1VX2')), runNumber=int(run), add=False)
monSvc.publishHistogram(folder_name, RootUtils.makeGraphHisto('OT2_X1U_Tz', 'Convergence OT2 X1U Tz;Iteration;Variation [#mum]',
*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='OT/T2X1U')), runNumber=int(run), add=False)
monSvc.publishHistogram(folder_name, RootUtils.makeGraphHisto('OT2_VX2_Tz', 'Convergence OT2 VX2 Tz;Iteration;Variation [#mum]',
*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='OT/T2VX2')), runNumber=int(run), add=False)
monSvc.publishHistogram(folder_name, RootUtils.makeGraphHisto('OT3_X1U_Tz', 'Convergence OT3 X1U Tz;Iteration;Variation [#mum]',
*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='OT/T3X1U')), runNumber=int(run), add=False)
monSvc.publishHistogram(folder_name, RootUtils.makeGraphHisto('OT3_VX2_Tz', 'Convergence OT3 VX2 Tz;Iteration;Variation [#mum]',
*RootUtils.getDofDeltaConvergence(aout, dof='Tz', alignable='OT/T3VX2')), runNumber=int(run), add=False)
# c1 = getDrawnCanvas([mp1, mp2, mp3])
mps += [mp1, mp2, mp3, mp4, mp5]
......@@ -217,3 +329,8 @@ if __name__ == '__main__':
c.Print(outputFile_name+']')
##########################
if args.online:
gaudi.stop()
gaudi.finalize()
......@@ -44,7 +44,7 @@ def getRunFromXml(xml_file):
except IndexError:
return None
def getRunsUpdated(activity = 'Velo', minRun = 0):
if activity == 'Tracker': activity = 'IT'
xmlDir = os.path.join(alignment_dir, '{0}/{0}Global'.format(activity))
......@@ -101,7 +101,7 @@ def writeInLogbook(Fill, activity, updated = False, file2upload=None, version =
status = 'Good'
subject = 'No alignment update'
text = "No {activity} alignment update needed for fill {Fill}.".format(**locals())
command = 'elog -h "{host}" -p {port} -l "{logbook}" -u {username} -a "Author={author}" -a "Fill={Fill}" -a "System={activity}" -a "Type={Type}" -a "Status={status}" -a "Subject={subject}" "{text}"'.format(**locals())
if file2upload:
......@@ -124,14 +124,14 @@ def sendEmail(text, receivers = ['gdujany@cern.ch']):
try:
smtpObj = smtplib.SMTP('localhost')
smtpObj.sendmail(sender, receivers, message)
smtpObj.sendmail(sender, receivers, message)
print "Successfully sent email"
except smtplib.SMTPException:
print "Error: unable to send email"
if __name__ == '__main__':
moniScript = {'Velo' : 'moniPlots.py --online', 'Tracker' : 'moniPlots_Tracker.py', 'Muon' : 'moniPlots_Muon.py'}
moniScript = {'Velo' : 'moniPlots.py', 'Tracker' : 'moniPlots_Tracker.py', 'Muon' : 'moniPlots_Muon.py'}
#################################################################
# Initialize monitoring Job to send plots to the presenter
......@@ -157,12 +157,17 @@ if __name__ == '__main__':
#################################################################
# Logging
logFile_name = '/group/online/AligWork/MoniPlots/log.log'
if os.path.getsize(logFile_name) > 1e9:
os.remove(logFile_name)
import logging
logger = logging.getLogger('myapp')
hdlr = logging.FileHandler('log.log')
hdlr = logging.FileHandler(logFile_name)
formatter = logging.Formatter('%(asctime)s | %(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
logger.addHandler(hdlr)
logger.setLevel(logging.INFO)
while True:
......@@ -172,7 +177,9 @@ if __name__ == '__main__':
os.mkdir(os.path.join(Moni_dir, activity))
os.chmod(os.path.join(Moni_dir, activity), 01775)
toAnalise = getRuns2Analise(activity, minRun)
if activity == 'Velo': toAnalise = [187431]
#if activity == 'Velo': toAnalise = [187431]
#if activity == 'Tracker': toAnalise = [187406]
#if activity == 'Muon': toAnalise = [187178]
runsUpdated = getRunsUpdated(activity, minRun)
print printTime(), 'Alignments, runs to analise for ', activity, ': ', toAnalise
sys.stdout.flush()
......@@ -184,14 +191,14 @@ if __name__ == '__main__':
else:
version = None
outFile_name = os.path.join(Moni_dir, '{0}/{1}.pdf'.format(activity, run))
outFile_name='test.pdf'
#outFile_name='test{0}.pdf'.format(activity)
print printTime(), 'Analising run {0}'.format(run) + (', alignment version v{0}'.format(version) if version else '')
sys.stdout.flush()
logger.info('Analising run {0}'.format(run) + (', alignment version v{0}'.format(version) if version else ''))
# Making pdf with plots
command = '{0} -r {1} -o {2}'.format(
os.path.join(this_file_dir, moniScript[activity]),
run,
command = '{0} --online -r {1} -o {2}'.format(
os.path.join(this_file_dir, moniScript[activity]),
run,
outFile_name)
cmd = shlex.split(command)
FNULL = open('moniLog.log', 'w') #open(os.devnull, 'w')
......@@ -201,7 +208,7 @@ if __name__ == '__main__':
if not version:
# check if it did not update because too big a movement
command = '{0} {1}/Iter1/ {1}/xml/ -l 3'.format(
os.path.join(this_file_dir, 'diffXML.py'),
os.path.join(this_file_dir, 'diffXML.py'),
os.path.join(AligWork_dir, activity, 'run{0}'.format(run)))
cmd = shlex.split(command)
pgr = subprocess.Popen(cmd, stdout=subprocess.PIPE)
......@@ -209,7 +216,7 @@ if __name__ == '__main__':
rc = pgr.returncode
if rc != 27 and rc != 0:
sendEmail('Unable to make check if costats movement was too large for {0} run {1}, please have a look'.format(activity, run))
if success == 0:
if version:
if activity != 'Muon':
......@@ -220,15 +227,15 @@ if __name__ == '__main__':
else:
if activity != 'Muon':
writeInLogbook(Fill=getFillNumber(run), activity=activity, updated = False)
os.chmod(outFile_name, 0444)
else:
sendEmail('Unable to make pdf for {0} run {1}, please have a look'.format(activity, run))
# Making root file with convergence plots
command = '{0} -r {1} -a {2}'.format(
os.path.join(this_file_dir, 'alignlog2root.py'),
run,
os.path.join(this_file_dir, 'alignlog2root.py'),
run,
activity)
cmd = shlex.split(command)
success = subprocess.call(cmd, stdout=FNULL)#, stderr=subprocess.STDOUT) # if succes should be 0
......@@ -237,18 +244,17 @@ if __name__ == '__main__':
# Making file with reference to last histos
command = '{0} -r {1} -a {2} -o {3}'.format(
os.path.join(this_file_dir, 'lastHistos.py'),
run,
os.path.join(this_file_dir, 'lastHistos.py'),
run,
activity,
'/group/online/AligWork/{0}/lastHistos.txt'.format(activity))
cmd = shlex.split(command)
success = subprocess.call(cmd, stdout=FNULL)#, stderr=subprocess.STDOUT) # if succes should be 0
if success != 0:
sendEmail('Unable to make file with references to histos for run {0}, please have a look'.format(run))
print printTime(), 'Done for now'
sys.stdout.flush()
logger.info('Done for now')
time.sleep(5)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment