From 8550daa2faa9c18a86410b11228e675e54f6ee07 Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Wed, 19 Jul 2017 14:11:06 +0200 Subject: [PATCH 01/29] code was crashing due to typo, fixed --- .../python/PyMirrAlignOnline/SetupHelper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py index 6f87fe65f..3cd69a248 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py @@ -391,7 +391,7 @@ class SetupHelper: if not self.testing: CKresTrendFile = "/group/rich/AlignmentFiles/Logging/Rich" + str(self.whichRich) + "_CKresTrend.txt" - with open(CKTrendFile, "a") as myfile: + with open(CKresTrendFile, "a") as myfile: myfile.write(str(self.getFillNumber(runs[0])) + " " + (self.directoryTime).replace("_", "T") + " " + str(self.finalCKres) + " " + (self.finalCKresErr)) def sendEmail(self, subject, text, receiversList): -- GitLab From 2ab319ca0c52029812204b4770af4e0c77cecf5f Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Wed, 19 Jul 2017 15:18:36 +0200 Subject: [PATCH 02/29] create a copy of the previous hlt02.log, in case the alignment failed then immediately tried to run again. --- .../python/PyMirrAlignOnline/Iterator.py | 40 ++++++++++++------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py index fd7616bc0..a9046bc73 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py @@ -28,27 +28,40 @@ def run(whichRich): ### Start logging of hlt02 (the node that the iteraror is running on) loggingDir = '/group/rich/AlignmentFiles/Logging/' - cmdProcess = 'exec /opt/FMC/bin/logViewer -l 2 -S -b &> ' + loggingDir + 'Rich' + str(whichRich) + '_' + 'hlt02.log' + currentHLT02log = loggingDir + 'Rich' + str(whichRich) + '_' + 'hlt02.log' + previousHLT02log = loggingDir + 'Rich' + str(whichRich) + '_' + 'hlt02_previous.log' + previousHLT02logReduced = loggingDir + 'Rich' + str(whichRich) + '_' + 'hlt02reduced_previous.log' + cmdProcess = 'exec /opt/FMC/bin/logViewer -l 2 -S -b &> ' + currentHLT02log logProcess = Popen(cmdProcess, shell=True, executable="/bin/bash", stderr=PIPE, stdout=PIPE) logProcess.stdout.close() logProcess.stderr.close() sys.stdout.flush() sleep(8) # wait long enough for logger to initialize + + # string used to help remove lines from the hlt02 log, using grep -vE (E = Enhanced Mode, required to parse the string) + removeExtraneous = '(LHCb2_HLT02_Hlt2Adder_0|Hlt2SaverSvc|MARK|BusyPub|BusyMon)' ### Printout (slightly late, so it gets logged) print "INFO: run(whichRich = " + str(whichRich) + ") command received at " + launchTime + " UTC" print "INFO: LHCbA config start time set." - print "INFO: logging hlt02 in temporary file: " + loggingDir + 'Rich' + str(whichRich) + '_' + 'hlt02.log' + print "INFO: logging hlt02 in temporary file: " + currentHLT02log + print "INFO: backing up last hlt02 log in temporary file: " + previousHLT02log + print 'INFO: storing reduced backup of last hlt02 log in temporary file: ' + previousHLT02logReduced + + shutil.copy2( currentHLT02log , previousHLT02log ) + os.system('grep -vE "' + removeExtraneous + '" ' + previousHLT02log +' > ' + previousHLT02logReduced) sys.stdout.flush() ### make a backup of OnlineEnvBase.py (do it now, in case we need to study the configuration on a single node) - shutil.copy2('/group/online/dataflow/options/LHCbA/HLT/OnlineEnvBase.py' , loggingDir + 'Rich' + str(whichRich) + '_' + 'OnlineEnvBase.py' ) - print "INFO: storing OnlineEnvBase.py in temporary file: " + loggingDir + 'Rich' + str(whichRich) + '_' + 'OnlineEnvBase.py' + saveOnlineEnvBase = loggingDir + 'Rich' + str(whichRich) + '_' + 'OnlineEnvBase.py' + shutil.copy2('/group/online/dataflow/options/LHCbA/HLT/OnlineEnvBase.py' , saveOnlineEnvBase ) + print "INFO: storing OnlineEnvBase.py in temporary file: " + saveOnlineEnvBase sys.stdout.flush() ### make a backup of Configuration.py (make sure AlignmentRelease on /group/rich/sw/cmtuser/ points to our newest AlignmentOnline release!) - shutil.copy2('/group/rich/sw/cmtuser/AlignmentRelease/Rich/RichMirrorAlignmentOnline/python/RichMirrorAlignmentOnline/Configuration.py' , loggingDir + 'Rich' + str(whichRich) + '_' + 'Configuration.py' ) - print "INFO: storing Configuration.py in temporary file: " + loggingDir + 'Rich' + str(whichRich) + '_' + 'Configuration.py' + saveConfiguration = loggingDir + 'Rich' + str(whichRich) + '_' + 'Configuration.py' + shutil.copy2('/group/rich/sw/cmtuser/AlignmentRelease/Rich/RichMirrorAlignmentOnline/python/RichMirrorAlignmentOnline/Configuration.py' , saveConfiguration ) + print "INFO: storing Configuration.py in temporary file: " + saveConfiguration sys.stdout.flush() from HistoHelper import SaveSetRetriever @@ -495,16 +508,16 @@ def run(whichRich): if not cancel: try: - shutil.copy2(loggingDir + 'Rich' + str(whichRich) + '_' + 'Configuration.py', setupHelper.savedir + 'Configuration.py') + shutil.copy2(saveConfiguration, setupHelper.savedir + 'Configuration.py') print "INFO: Configuration.py stored in file: " + setupHelper.savedir + 'Configuration.py' except: - shutil.copy2(loggingDir + 'Rich' + str(whichRich) + '_' + 'Configuration.py', loggingDir + 'Rich' + str(whichRich) + '_Configuration_' + setupHelper.directoryTime + '.py') + shutil.copy2(saveConfiguration, loggingDir + 'Rich' + str(whichRich) + '_Configuration_' + setupHelper.directoryTime + '.py') print "INFO: Configuration.py stored in file: " + loggingDir + 'Rich' + str(whichRich) + '_Configuration_' + setupHelper.directoryTime + '.py' try: - shutil.copy2(loggingDir + 'Rich' + str(whichRich) + '_' + 'OnlineEnvBase.py', setupHelper.savedir + 'OnlineEnvBase.py') + shutil.copy2(saveOnlineEnvBase, setupHelper.savedir + 'OnlineEnvBase.py') print "INFO: OnlineEnvBase.py stored in file: " + setupHelper.savedir + 'OnlineEnvBase.py' except: - shutil.copy2(loggingDir + 'Rich' + str(whichRich) + '_' + 'OnlineEnvBase.py', loggingDir + 'Rich' + str(whichRich) + '_OnlineEnvBase_' + setupHelper.directoryTime + '.py') + shutil.copy2(saveOnlineEnvBase, loggingDir + 'Rich' + str(whichRich) + '_OnlineEnvBase_' + setupHelper.directoryTime + '.py') print "INFO: OnlineEnvBase.py stored in file: " + loggingDir + 'Rich' + str(whichRich) + '_OnlineEnvBase_' + setupHelper.directoryTime + '.py' sys.stdout.flush() @@ -525,14 +538,11 @@ def run(whichRich): print "INFO: End of run(whichRich = " + str(whichRich) + "). Killing logProcess and writing hlt02 log file." sys.stdout.flush() - # string used to help remove lines from the hlt02 log, using grep -vE (E = Enhanced Mode, required to parse the string) - removeExtraneous = '(tmSrv|LHCb2_HLT02_Hlt2Adder_0|Hlt2SaverSvc|MARK|BusyPub|BusyMon)' - if os.path.exists(setupHelper.savedir): print 'INFO: storing hlt02 log in file: ' + setupHelper.savedir + 'hlt02.log' print 'INFO: storing reduced file: ' + setupHelper.savedir + 'hlt02reduced.log' sys.stdout.flush() - shutil.copy2(loggingDir + 'Rich' + str(whichRich) + '_' + 'hlt02.log', setupHelper.savedir + 'hlt02.log') + shutil.copy2(currentHLT02log, setupHelper.savedir + 'hlt02.log') # remove what we currently believe are extraneous items # print 'INFO: Executing: ' + 'grep -vE "' + removeExtraneous + '" ' + setupHelper.savedir + 'hlt02.log > ' + setupHelper.savedir + 'hlt02reduced.log' sys.stdout.flush() @@ -541,7 +551,7 @@ def run(whichRich): print 'INFO: storing hlt02 log in file: ' + loggingDir + 'Rich' + str(whichRich) + '_' + setupHelper.directoryTime + '_hlt02.log' print 'INFO: storing reduced file: ' + loggingDir + 'Rich' + str(whichRich) + '_' + setupHelper.directoryTime + '_hlt02reduced.log' sys.stdout.flush() - shutil.copy2(loggingDir + 'Rich' + str(whichRich) + '_' + 'hlt02.log', loggingDir + 'Rich' + str(whichRich) + '_' + setupHelper.directoryTime + '_hlt02.log') + shutil.copy2(currentHLT02log, loggingDir + 'Rich' + str(whichRich) + '_' + setupHelper.directoryTime + '_hlt02.log') # remove what we currently believe are extraneous items # print 'INFO: Executing: ' + 'grep -vE "' + removeExtraneous + '" ' + loggingDir + 'Rich' + str(whichRich) + '_' + setupHelper.directoryTime + '_hlt02.log > ' + loggingDir + 'Rich' + str(whichRich) + '_' + setupHelper.directoryTime + '_hlt02reduced.log' os.system('grep -vE "' + removeExtraneous + '" ' + loggingDir + 'Rich' + str(whichRich) + '_' + setupHelper.directoryTime + '_hlt02.log > ' + loggingDir + 'Rich' + str(whichRich) + '_' + setupHelper.directoryTime + '_hlt02reduced.log') -- GitLab From 6e1d6134e611c55b4473c975f36cb0cea2b9cb8f Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Wed, 19 Jul 2017 15:26:07 +0200 Subject: [PATCH 03/29] add fill number of the first run processed to the email sent from SetupHelper during writeInLogbook --- .../python/PyMirrAlignOnline/SetupHelper.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py index 3cd69a248..8b014f07c 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py @@ -294,6 +294,8 @@ class SetupHelper: text2 += "\n More information is available at the following link: \n\n " text2 += 'https://lblogbook.cern.ch/RICH/?System=%5EAlignment%24&Subject={0}&mode=full'.format(self.directoryTime) + text2 += "\n Fill number of first run processed: " + str(FillAlignment) + self.sendEmail(subj2, text2, self.emails) return messageID -- GitLab From 7b825557e8bc7b2121d624545b08f3f662c8d44c Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Wed, 19 Jul 2017 19:50:52 +0200 Subject: [PATCH 04/29] Change it so that if the last alignment was not successful, then hlt02.log gets appended to, instead of overwritten. --- .../python/PyMirrAlignOnline/Iterator.py | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py index a9046bc73..5606c128d 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py @@ -26,18 +26,35 @@ def run(whichRich): launchTime = strftime("%Y-%m-%d %H:%M:%S", gmtime()) start_time_config = time() # when LHCbA config start time is really set - ### Start logging of hlt02 (the node that the iteraror is running on) + ### Set up strings needed for logging of hlt02 (the node that the iterator is running on) loggingDir = '/group/rich/AlignmentFiles/Logging/' + lastAlignSuccessFile = loggingDir + 'Rich' + str(whichRich) + '_' + 'success.txt' currentHLT02log = loggingDir + 'Rich' + str(whichRich) + '_' + 'hlt02.log' previousHLT02log = loggingDir + 'Rich' + str(whichRich) + '_' + 'hlt02_previous.log' previousHLT02logReduced = loggingDir + 'Rich' + str(whichRich) + '_' + 'hlt02reduced_previous.log' - cmdProcess = 'exec /opt/FMC/bin/logViewer -l 2 -S -b &> ' + currentHLT02log - logProcess = Popen(cmdProcess, shell=True, executable="/bin/bash", stderr=PIPE, stdout=PIPE) + cmdStart = 'exec /opt/FMC/bin/logViewer -l 2 -S -b &>' + cmdProcess = cmdStart + ' ' + currentHLT02log + cmdProcessAppend = cmdStart + '> ' + currentHLT02log + + ### Check to see if the last mirror alignment was successful + with open(lastAlignSuccess) as lastAlignSuccessFile: + lastAlignSuccessLine = lastAlignSuccessFile.readline() + + ### Start logging of hlt02 (the node that the iterator is running on) + if lastAlignSuccessLine == 'YES\n': + logProcess = Popen(cmdProcess, shell=True, executable="/bin/bash", stderr=PIPE, stdout=PIPE) + else: + logProcess = Popen(cmdProcessAppend, shell=True, executable="/bin/bash", stderr=PIPE, stdout=PIPE) logProcess.stdout.close() logProcess.stderr.close() sys.stdout.flush() sleep(8) # wait long enough for logger to initialize + ### Reset lastAlignSuccessFile to default + lastAlignSuccessFile = open(lastAlignSuccess, 'w') + lastAlignSuccessFile.write('NO\n') # python will convert \n to os.linesep + lastAlignSuccessFile.close() + # string used to help remove lines from the hlt02 log, using grep -vE (E = Enhanced Mode, required to parse the string) removeExtraneous = '(LHCb2_HLT02_Hlt2Adder_0|Hlt2SaverSvc|MARK|BusyPub|BusyMon)' @@ -547,6 +564,10 @@ def run(whichRich): # print 'INFO: Executing: ' + 'grep -vE "' + removeExtraneous + '" ' + setupHelper.savedir + 'hlt02.log > ' + setupHelper.savedir + 'hlt02reduced.log' sys.stdout.flush() os.system('grep -vE "' + removeExtraneous + '" ' + setupHelper.savedir + 'hlt02.log > ' + setupHelper.savedir + 'hlt02reduced.log') + ### Reset lastAlignSuccessFile to default + lastAlignSuccessFile = open(lastAlignSuccess, 'w') + lastAlignSuccessFile.write('YES\n') # python will convert \n to os.linesep + lastAlignSuccessFile.close() else: print 'INFO: storing hlt02 log in file: ' + loggingDir + 'Rich' + str(whichRich) + '_' + setupHelper.directoryTime + '_hlt02.log' print 'INFO: storing reduced file: ' + loggingDir + 'Rich' + str(whichRich) + '_' + setupHelper.directoryTime + '_hlt02reduced.log' @@ -555,6 +576,10 @@ def run(whichRich): # remove what we currently believe are extraneous items # print 'INFO: Executing: ' + 'grep -vE "' + removeExtraneous + '" ' + loggingDir + 'Rich' + str(whichRich) + '_' + setupHelper.directoryTime + '_hlt02.log > ' + loggingDir + 'Rich' + str(whichRich) + '_' + setupHelper.directoryTime + '_hlt02reduced.log' os.system('grep -vE "' + removeExtraneous + '" ' + loggingDir + 'Rich' + str(whichRich) + '_' + setupHelper.directoryTime + '_hlt02.log > ' + loggingDir + 'Rich' + str(whichRich) + '_' + setupHelper.directoryTime + '_hlt02reduced.log') + ### Reset lastAlignSuccessFile to default + lastAlignSuccessFile = open(lastAlignSuccess, 'w') + lastAlignSuccessFile.write('YES\n') # python will convert \n to os.linesep + lastAlignSuccessFile.close() # Set our status one last time com.set_status(state) -- GitLab From 1e005b78c6aab02bd95aaf6e12175169260c463d Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Wed, 19 Jul 2017 19:54:53 +0200 Subject: [PATCH 05/29] Change it so that if the last alignment was not successful, then hlt02.log gets appended to, instead of overwritten. (2) --- .../python/PyMirrAlignOnline/SetupHelper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py index 8b014f07c..a8fe80347 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py @@ -394,7 +394,7 @@ class SetupHelper: if not self.testing: CKresTrendFile = "/group/rich/AlignmentFiles/Logging/Rich" + str(self.whichRich) + "_CKresTrend.txt" with open(CKresTrendFile, "a") as myfile: - myfile.write(str(self.getFillNumber(runs[0])) + " " + (self.directoryTime).replace("_", "T") + " " + str(self.finalCKres) + " " + (self.finalCKresErr)) + myfile.write(str(self.getFillNumber(runs[0])) + " " + (self.directoryTime).replace("_", "T") + " " + str(self.finalCKres) + " " + (self.finalCKresErr) + '\n') def sendEmail(self, subject, text, receiversList): import smtplib -- GitLab From 33dfd2b3a9af3d90fee9d2e9d4c185133d3004a2 Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Wed, 19 Jul 2017 19:56:11 +0200 Subject: [PATCH 06/29] Change it so that if the last alignment was not successful, then hlt02.log gets appended to, instead of overwritten. (3) --- .../python/PyMirrAlignOnline/Iterator.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py index 5606c128d..fe2416eb6 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py @@ -564,7 +564,6 @@ def run(whichRich): # print 'INFO: Executing: ' + 'grep -vE "' + removeExtraneous + '" ' + setupHelper.savedir + 'hlt02.log > ' + setupHelper.savedir + 'hlt02reduced.log' sys.stdout.flush() os.system('grep -vE "' + removeExtraneous + '" ' + setupHelper.savedir + 'hlt02.log > ' + setupHelper.savedir + 'hlt02reduced.log') - ### Reset lastAlignSuccessFile to default lastAlignSuccessFile = open(lastAlignSuccess, 'w') lastAlignSuccessFile.write('YES\n') # python will convert \n to os.linesep lastAlignSuccessFile.close() @@ -576,7 +575,6 @@ def run(whichRich): # remove what we currently believe are extraneous items # print 'INFO: Executing: ' + 'grep -vE "' + removeExtraneous + '" ' + loggingDir + 'Rich' + str(whichRich) + '_' + setupHelper.directoryTime + '_hlt02.log > ' + loggingDir + 'Rich' + str(whichRich) + '_' + setupHelper.directoryTime + '_hlt02reduced.log' os.system('grep -vE "' + removeExtraneous + '" ' + loggingDir + 'Rich' + str(whichRich) + '_' + setupHelper.directoryTime + '_hlt02.log > ' + loggingDir + 'Rich' + str(whichRich) + '_' + setupHelper.directoryTime + '_hlt02reduced.log') - ### Reset lastAlignSuccessFile to default lastAlignSuccessFile = open(lastAlignSuccess, 'w') lastAlignSuccessFile.write('YES\n') # python will convert \n to os.linesep lastAlignSuccessFile.close() -- GitLab From f70221fce9e36b47d73c05f3cfb9c972290a9f7f Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Wed, 19 Jul 2017 20:06:58 +0200 Subject: [PATCH 07/29] Change it so that if the last alignment was not successful, then hlt02.log gets appended to, instead of overwritten. (4) --- .../python/PyMirrAlignOnline/Iterator.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py index fe2416eb6..cdf131640 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py @@ -35,6 +35,14 @@ def run(whichRich): cmdStart = 'exec /opt/FMC/bin/logViewer -l 2 -S -b &>' cmdProcess = cmdStart + ' ' + currentHLT02log cmdProcessAppend = cmdStart + '> ' + currentHLT02log + + # string used to help remove lines from the hlt02 log in the hlt02reduced versions, + # using grep -vE (E = Enhanced Mode, required to parse the string) + removeExtraneous = '(LHCb2_HLT02_Hlt2Adder_0|Hlt2SaverSvc|MARK|BusyPub|BusyMon)' + + ## Backup the last HLT02 log + shutil.copy2( currentHLT02log , previousHLT02log ) + os.system('grep -vE "' + removeExtraneous + '" ' + previousHLT02log +' > ' + previousHLT02logReduced) ### Check to see if the last mirror alignment was successful with open(lastAlignSuccess) as lastAlignSuccessFile: @@ -43,8 +51,10 @@ def run(whichRich): ### Start logging of hlt02 (the node that the iterator is running on) if lastAlignSuccessLine == 'YES\n': logProcess = Popen(cmdProcess, shell=True, executable="/bin/bash", stderr=PIPE, stdout=PIPE) + print "INFO: The previous Rich" + str(whichRich) + " alignment did not crash, overwriting hlt02.log with this alignment's printouts." else: logProcess = Popen(cmdProcessAppend, shell=True, executable="/bin/bash", stderr=PIPE, stdout=PIPE) + print "INFO: The previous Rich" + str(whichRich) + " alignment crashed, appending this alignment's printouts to hlt02.log." logProcess.stdout.close() logProcess.stderr.close() sys.stdout.flush() @@ -54,9 +64,6 @@ def run(whichRich): lastAlignSuccessFile = open(lastAlignSuccess, 'w') lastAlignSuccessFile.write('NO\n') # python will convert \n to os.linesep lastAlignSuccessFile.close() - - # string used to help remove lines from the hlt02 log, using grep -vE (E = Enhanced Mode, required to parse the string) - removeExtraneous = '(LHCb2_HLT02_Hlt2Adder_0|Hlt2SaverSvc|MARK|BusyPub|BusyMon)' ### Printout (slightly late, so it gets logged) print "INFO: run(whichRich = " + str(whichRich) + ") command received at " + launchTime + " UTC" @@ -64,10 +71,6 @@ def run(whichRich): print "INFO: logging hlt02 in temporary file: " + currentHLT02log print "INFO: backing up last hlt02 log in temporary file: " + previousHLT02log print 'INFO: storing reduced backup of last hlt02 log in temporary file: ' + previousHLT02logReduced - - shutil.copy2( currentHLT02log , previousHLT02log ) - os.system('grep -vE "' + removeExtraneous + '" ' + previousHLT02log +' > ' + previousHLT02logReduced) - sys.stdout.flush() ### make a backup of OnlineEnvBase.py (do it now, in case we need to study the configuration on a single node) saveOnlineEnvBase = loggingDir + 'Rich' + str(whichRich) + '_' + 'OnlineEnvBase.py' -- GitLab From 58b29ddad12c91368c3bc042d9cf68ed02af37eb Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Wed, 19 Jul 2017 20:08:12 +0200 Subject: [PATCH 08/29] Change it so that if the last alignment was not successful, then hlt02.log gets appended to, instead of overwritten. (5) --- .../python/PyMirrAlignOnline/Iterator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py index cdf131640..0c4db2f81 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py @@ -28,7 +28,7 @@ def run(whichRich): ### Set up strings needed for logging of hlt02 (the node that the iterator is running on) loggingDir = '/group/rich/AlignmentFiles/Logging/' - lastAlignSuccessFile = loggingDir + 'Rich' + str(whichRich) + '_' + 'success.txt' + lastAlignSuccess = loggingDir + 'Rich' + str(whichRich) + '_' + 'success.txt' currentHLT02log = loggingDir + 'Rich' + str(whichRich) + '_' + 'hlt02.log' previousHLT02log = loggingDir + 'Rich' + str(whichRich) + '_' + 'hlt02_previous.log' previousHLT02logReduced = loggingDir + 'Rich' + str(whichRich) + '_' + 'hlt02reduced_previous.log' -- GitLab From 4633fa05c94d963fe15190f6cf7d28fe87cc2e17 Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Wed, 19 Jul 2017 20:11:56 +0200 Subject: [PATCH 09/29] Change it so that if the last alignment was not successful, then hlt02.log gets appended to, instead of overwritten. (6) --- .../python/PyMirrAlignOnline/Iterator.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py index 0c4db2f81..70c87c57c 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py @@ -44,10 +44,12 @@ def run(whichRich): shutil.copy2( currentHLT02log , previousHLT02log ) os.system('grep -vE "' + removeExtraneous + '" ' + previousHLT02log +' > ' + previousHLT02logReduced) - ### Check to see if the last mirror alignment was successful - with open(lastAlignSuccess) as lastAlignSuccessFile: - lastAlignSuccessLine = lastAlignSuccessFile.readline() - + ### Check to see if the last mirror alignment was successful + if os.path.exists(lastAlignSuccess): + with open(lastAlignSuccess) as lastAlignSuccessFile: + lastAlignSuccessLine = lastAlignSuccessFile.readline() + else: + lastAlignSuccessLine == 'UNKNOWN\n' ### Start logging of hlt02 (the node that the iterator is running on) if lastAlignSuccessLine == 'YES\n': logProcess = Popen(cmdProcess, shell=True, executable="/bin/bash", stderr=PIPE, stdout=PIPE) -- GitLab From c6cff5466de12f7275accd6e92299708a6da6762 Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Wed, 19 Jul 2017 20:12:57 +0200 Subject: [PATCH 10/29] Change it so that if the last alignment was not successful, then hlt02.log gets appended to, instead of overwritten. (7) --- .../python/PyMirrAlignOnline/Iterator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py index 70c87c57c..58b808d57 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py @@ -42,7 +42,8 @@ def run(whichRich): ## Backup the last HLT02 log shutil.copy2( currentHLT02log , previousHLT02log ) - os.system('grep -vE "' + removeExtraneous + '" ' + previousHLT02log +' > ' + previousHLT02logReduced) + if os.path.exists(previousHLT02log): + os.system('grep -vE "' + removeExtraneous + '" ' + previousHLT02log +' > ' + previousHLT02logReduced) ### Check to see if the last mirror alignment was successful if os.path.exists(lastAlignSuccess): -- GitLab From d5ad4120f764fa39e7dd1a7001cbfaf2e3ffcfde Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Wed, 19 Jul 2017 20:14:54 +0200 Subject: [PATCH 11/29] Change it so that if the last alignment was not successful, then hlt02.log gets appended to, instead of overwritten. (8) --- .../python/PyMirrAlignOnline/Iterator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py index 58b808d57..94a20923f 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py @@ -41,7 +41,8 @@ def run(whichRich): removeExtraneous = '(LHCb2_HLT02_Hlt2Adder_0|Hlt2SaverSvc|MARK|BusyPub|BusyMon)' ## Backup the last HLT02 log - shutil.copy2( currentHLT02log , previousHLT02log ) + if os.path.exists(currentHLT02log): + shutil.copy2( currentHLT02log , previousHLT02log ) if os.path.exists(previousHLT02log): os.system('grep -vE "' + removeExtraneous + '" ' + previousHLT02log +' > ' + previousHLT02logReduced) -- GitLab From eb56ce27ad94fad921b8fed69baeb6dfa79d253f Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Wed, 19 Jul 2017 20:15:43 +0200 Subject: [PATCH 12/29] Change it so that if the last alignment was not successful, then hlt02.log gets appended to, instead of overwritten. (9) --- .../python/PyMirrAlignOnline/Iterator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py index 94a20923f..a66169446 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py @@ -51,7 +51,7 @@ def run(whichRich): with open(lastAlignSuccess) as lastAlignSuccessFile: lastAlignSuccessLine = lastAlignSuccessFile.readline() else: - lastAlignSuccessLine == 'UNKNOWN\n' + lastAlignSuccessLine = 'UNKNOWN\n' ### Start logging of hlt02 (the node that the iterator is running on) if lastAlignSuccessLine == 'YES\n': logProcess = Popen(cmdProcess, shell=True, executable="/bin/bash", stderr=PIPE, stdout=PIPE) -- GitLab From 262c3e4328489caa34c0716c8e23c23b9ffe34ef Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Wed, 19 Jul 2017 20:37:44 +0200 Subject: [PATCH 13/29] Change it so that if the last alignment was not successful, then hlt02.log gets appended to, instead of overwritten. (10) --- .../python/PyMirrAlignOnline/Iterator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py index a66169446..ce0d715e2 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py @@ -30,6 +30,7 @@ def run(whichRich): loggingDir = '/group/rich/AlignmentFiles/Logging/' lastAlignSuccess = loggingDir + 'Rich' + str(whichRich) + '_' + 'success.txt' currentHLT02log = loggingDir + 'Rich' + str(whichRich) + '_' + 'hlt02.log' + currentHLT02logReduced = loggingDir + 'Rich' + str(whichRich) + '_' + 'hlt02reduced.log' previousHLT02log = loggingDir + 'Rich' + str(whichRich) + '_' + 'hlt02_previous.log' previousHLT02logReduced = loggingDir + 'Rich' + str(whichRich) + '_' + 'hlt02reduced_previous.log' cmdStart = 'exec /opt/FMC/bin/logViewer -l 2 -S -b &>' @@ -593,6 +594,9 @@ def run(whichRich): print 'INFO: Claire says miezmiezmiez' sys.stdout.flush() + # For good measure, make a reduced log in the logging directory + os.system('grep -vE "' + removeExtraneous + '" ' + currentHLT02log +' > ' + currentHLT02logReduced) + logProcess.kill() print "INFO: hlt02 logProcess killed." sys.stdout.flush() -- GitLab From 282d4cd6eea8bccf70648a3d1b25390d2ac8806c Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Wed, 19 Jul 2017 20:53:23 +0200 Subject: [PATCH 14/29] Change it so that if the last alignment was not successful, then hlt02.log gets appended to, instead of overwritten. (11) --- .../python/PyMirrAlignOnline/SetupHelper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py index a8fe80347..606c04894 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py @@ -394,7 +394,7 @@ class SetupHelper: if not self.testing: CKresTrendFile = "/group/rich/AlignmentFiles/Logging/Rich" + str(self.whichRich) + "_CKresTrend.txt" with open(CKresTrendFile, "a") as myfile: - myfile.write(str(self.getFillNumber(runs[0])) + " " + (self.directoryTime).replace("_", "T") + " " + str(self.finalCKres) + " " + (self.finalCKresErr) + '\n') + myfile.write(str(self.getFillNumber(runs[0])) + " " + (self.directoryTime).replace("_", "T") + " " + str(self.finalCKres) + " " + str(self.finalCKresErr) + '\n') def sendEmail(self, subject, text, receiversList): import smtplib -- GitLab From 1fa9aaaf0c5b4d3010b48f3e8324aef7e8720487 Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Wed, 19 Jul 2017 20:56:52 +0200 Subject: [PATCH 15/29] Change it so that if the last alignment was not successful, then hlt02.log gets appended to, instead of overwritten. (12) --- .../python/PyMirrAlignOnline/Iterator.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py index ce0d715e2..2e6d87539 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py @@ -56,10 +56,8 @@ def run(whichRich): ### Start logging of hlt02 (the node that the iterator is running on) if lastAlignSuccessLine == 'YES\n': logProcess = Popen(cmdProcess, shell=True, executable="/bin/bash", stderr=PIPE, stdout=PIPE) - print "INFO: The previous Rich" + str(whichRich) + " alignment did not crash, overwriting hlt02.log with this alignment's printouts." else: logProcess = Popen(cmdProcessAppend, shell=True, executable="/bin/bash", stderr=PIPE, stdout=PIPE) - print "INFO: The previous Rich" + str(whichRich) + " alignment crashed, appending this alignment's printouts to hlt02.log." logProcess.stdout.close() logProcess.stderr.close() sys.stdout.flush() @@ -73,6 +71,10 @@ def run(whichRich): ### Printout (slightly late, so it gets logged) print "INFO: run(whichRich = " + str(whichRich) + ") command received at " + launchTime + " UTC" print "INFO: LHCbA config start time set." + if lastAlignSuccessLine == 'YES\n': + print "INFO: The previous Rich" + str(whichRich) + " alignment did not crash, overwriting hlt02.log with this alignment's printouts." + else: + print "INFO: The previous Rich" + str(whichRich) + " alignment crashed, appending this alignment's printouts to hlt02.log." print "INFO: logging hlt02 in temporary file: " + currentHLT02log print "INFO: backing up last hlt02 log in temporary file: " + previousHLT02log print 'INFO: storing reduced backup of last hlt02 log in temporary file: ' + previousHLT02logReduced -- GitLab From 1f7cef0edb4781b5c77aa73a59eff1afa018524e Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Wed, 19 Jul 2017 21:33:37 +0200 Subject: [PATCH 16/29] Change it so that if the last alignment was not successful, then hlt02.log gets appended to, instead of overwritten. (13) --- .../python/PyMirrAlignOnline/SetupHelper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py index 606c04894..1a55bf5a2 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py @@ -394,7 +394,7 @@ class SetupHelper: if not self.testing: CKresTrendFile = "/group/rich/AlignmentFiles/Logging/Rich" + str(self.whichRich) + "_CKresTrend.txt" with open(CKresTrendFile, "a") as myfile: - myfile.write(str(self.getFillNumber(runs[0])) + " " + (self.directoryTime).replace("_", "T") + " " + str(self.finalCKres) + " " + str(self.finalCKresErr) + '\n') + myfile.write(str(self.getFillNumber(runs[0])) + " " + (self.directoryTime).replace("_", "T") + " " + str(self.finalCKres)/1000 + " " + str(self.finalCKresErr)/1000 + '\n') def sendEmail(self, subject, text, receiversList): import smtplib -- GitLab From a0627a12aea5c085e755d9563eee2fbf931c3c14 Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Wed, 19 Jul 2017 22:13:54 +0200 Subject: [PATCH 17/29] typo fix --- .../python/PyMirrAlignOnline/SetupHelper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py index 1a55bf5a2..a50417f98 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py @@ -394,7 +394,7 @@ class SetupHelper: if not self.testing: CKresTrendFile = "/group/rich/AlignmentFiles/Logging/Rich" + str(self.whichRich) + "_CKresTrend.txt" with open(CKresTrendFile, "a") as myfile: - myfile.write(str(self.getFillNumber(runs[0])) + " " + (self.directoryTime).replace("_", "T") + " " + str(self.finalCKres)/1000 + " " + str(self.finalCKresErr)/1000 + '\n') + myfile.write(str(self.getFillNumber(runs[0])) + " " + (self.directoryTime).replace("_", "T") + " " + str(self.finalCKres/1000) + " " + str(self.finalCKresErr/1000) + '\n') def sendEmail(self, subject, text, receiversList): import smtplib -- GitLab From a8fcce3d7ad10881c8e54a60a10a6a01ad319240 Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Wed, 19 Jul 2017 22:45:57 +0200 Subject: [PATCH 18/29] Added more info to final email. --- .../python/PyMirrAlignOnline/SetupHelper.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py index a50417f98..fc459445b 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py @@ -291,9 +291,11 @@ class SetupHelper: else: text2 += "\n The alignment in the DB is still " + vN_DB_str + "." - text2 += "\n More information is available at the following link: \n\n " + text2 += "\n More information is available at the following links: \n\n " text2 += 'https://lblogbook.cern.ch/RICH/?System=%5EAlignment%24&Subject={0}&mode=full'.format(self.directoryTime) - + text2 += '\n https://lbrich.cern.ch/alignmentview.php' + text2 += '\n https://lbrich.cern.ch/plot/index.html?rich=' + str(self.whichRich) +'&source=mirror' + text2 += "\n Fill number of first run processed: " + str(FillAlignment) self.sendEmail(subj2, text2, self.emails) -- GitLab From 71ef54d99ef3c48f85abe4c9f770cd8c5dfa80be Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Wed, 19 Jul 2017 22:47:36 +0200 Subject: [PATCH 19/29] Added more info to final email. (2) --- .../python/PyMirrAlignOnline/SetupHelper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py index fc459445b..8fd8f3288 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py @@ -296,7 +296,7 @@ class SetupHelper: text2 += '\n https://lbrich.cern.ch/alignmentview.php' text2 += '\n https://lbrich.cern.ch/plot/index.html?rich=' + str(self.whichRich) +'&source=mirror' - text2 += "\n Fill number of first run processed: " + str(FillAlignment) + text2 += "\n\n Fill number of first run processed: " + str(FillAlignment) self.sendEmail(subj2, text2, self.emails) -- GitLab From 849848482dbc56a7ee7119c6f9648e696a99170a Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Wed, 19 Jul 2017 22:51:30 +0200 Subject: [PATCH 20/29] typo fix --- .../python/PyMirrAlignOnline/Iterator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py index 2e6d87539..b262a9f29 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py @@ -72,9 +72,9 @@ def run(whichRich): print "INFO: run(whichRich = " + str(whichRich) + ") command received at " + launchTime + " UTC" print "INFO: LHCbA config start time set." if lastAlignSuccessLine == 'YES\n': - print "INFO: The previous Rich" + str(whichRich) + " alignment did not crash, overwriting hlt02.log with this alignment's printouts." + print "INFO: The previous Rich" + str(whichRich) + " alignment was able to copy hlt02.log, overwriting hlt02.log with this alignment's printouts." else: - print "INFO: The previous Rich" + str(whichRich) + " alignment crashed, appending this alignment's printouts to hlt02.log." + print "INFO: The previous Rich" + str(whichRich) + " alignment was not able to copy hlt02.log, appending this alignment's printouts to hlt02.log." print "INFO: logging hlt02 in temporary file: " + currentHLT02log print "INFO: backing up last hlt02 log in temporary file: " + previousHLT02log print 'INFO: storing reduced backup of last hlt02 log in temporary file: ' + previousHLT02logReduced -- GitLab From 9544ede35d8f9d195e3ea024b9373a17f702effa Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Wed, 19 Jul 2017 23:05:20 +0200 Subject: [PATCH 21/29] Rich/RichMirrorAlignmentOnline "Tagged" as v3r5. Update Release Notes. --- Rich/RichMirrorAlignmentOnline/CMakeLists.txt | 2 +- Rich/RichMirrorAlignmentOnline/cmt/requirements | 2 +- Rich/RichMirrorAlignmentOnline/doc/release.notes | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Rich/RichMirrorAlignmentOnline/CMakeLists.txt b/Rich/RichMirrorAlignmentOnline/CMakeLists.txt index d18168c18..d57398e42 100644 --- a/Rich/RichMirrorAlignmentOnline/CMakeLists.txt +++ b/Rich/RichMirrorAlignmentOnline/CMakeLists.txt @@ -1,7 +1,7 @@ ################################################################################ # Package: RichMirrorAlignmentOnline ################################################################################ -gaudi_subdir(RichMirrorAlignmentOnline v3r4p1) +gaudi_subdir(RichMirrorAlignmentOnline v3r5) gaudi_depends_on_subdirs(Online/Gaucho Event/DAQEvent diff --git a/Rich/RichMirrorAlignmentOnline/cmt/requirements b/Rich/RichMirrorAlignmentOnline/cmt/requirements index deee73579..e1da0bca8 100644 --- a/Rich/RichMirrorAlignmentOnline/cmt/requirements +++ b/Rich/RichMirrorAlignmentOnline/cmt/requirements @@ -3,7 +3,7 @@ # Maintainer : Paras Naik, Claire Prouve #============================================================================ package RichMirrorAlignmentOnline -version v3r4p1 +version v3r5 #============================================================================ # Structure, i.e. directories to process. diff --git a/Rich/RichMirrorAlignmentOnline/doc/release.notes b/Rich/RichMirrorAlignmentOnline/doc/release.notes index c9a047ccb..138e84730 100644 --- a/Rich/RichMirrorAlignmentOnline/doc/release.notes +++ b/Rich/RichMirrorAlignmentOnline/doc/release.notes @@ -14,6 +14,22 @@ Get into the habit of committing on every change (that compiles of course) ! Notes pertaining to already "tagged" releases: +! 2017-07-19 - Paras Naik + - "Tagged" as v3r5 (internally, since only Panoptes gets a tag now). + - Added more links to the final email that is sent on a successful alignment. + - Add the first fill number to the email that is sent on a successful alignment. + - If the last alignment was unable to save the hlt02 log, + then we now append to the hlt02 log instead of overwrite it + - Create a copy of the existing hlt02 log before it gets overwritten or appended to. + - Created CK resolution trend file in /group/rich/AlignmentFiles/Logging/Rich{1,2}_CKresTrend.txt. + We automatically add to this every time we perform an alignment. + We back-propagated information from all alignments since 2016 into this text file. + A trend plot is currently accessible via https://lbrich.cern.ch + Check under "Resolution timelines: Mirror" + - If this is a test alignment, in the Alignment monitoring ELOG it gets status 'Test'. + However, because there is no 'Test' status in the Alignment monitoring ELOG, the message gets ignored. + This is OK for now. + ! 2017-07-16 - Paras Naik - "Tagged" as v3r4p1 (internally, since only Panoptes gets a tag now). - Added the final CK angle resolution and error to summary.txt. -- GitLab From adfe38d7f522c233b6c07f4ab08e445598d3b320 Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Thu, 20 Jul 2017 23:00:09 +0200 Subject: [PATCH 22/29] Rich/RichMirrorAlignmentOnline "Tagged" as v3r5. Updated Release Notes. autoUpdate set to False in Configuration until at least 14 August 2017 --- Rich/RichMirrorAlignmentOnline/doc/release.notes | 2 ++ .../python/RichMirrorAlignmentOnline/Configuration.py | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Rich/RichMirrorAlignmentOnline/doc/release.notes b/Rich/RichMirrorAlignmentOnline/doc/release.notes index 138e84730..cda10d04e 100644 --- a/Rich/RichMirrorAlignmentOnline/doc/release.notes +++ b/Rich/RichMirrorAlignmentOnline/doc/release.notes @@ -16,6 +16,8 @@ Get into the habit of committing on every change (that compiles of course) ! 2017-07-19 - Paras Naik - "Tagged" as v3r5 (internally, since only Panoptes gets a tag now). + - Default autoUpdate in the configuration has been changed to False + We expect to run in this mode until at least 14 August 2017 - Added more links to the final email that is sent on a successful alignment. - Add the first fill number to the email that is sent on a successful alignment. - If the last alignment was unable to save the hlt02 log, diff --git a/Rich/RichMirrorAlignmentOnline/python/RichMirrorAlignmentOnline/Configuration.py b/Rich/RichMirrorAlignmentOnline/python/RichMirrorAlignmentOnline/Configuration.py index d4cfcb6e0..4334f74b1 100644 --- a/Rich/RichMirrorAlignmentOnline/python/RichMirrorAlignmentOnline/Configuration.py +++ b/Rich/RichMirrorAlignmentOnline/python/RichMirrorAlignmentOnline/Configuration.py @@ -58,7 +58,7 @@ class Rich1MirrAlignOnConf(LHCbConfigurableUser): ,"stopSigmaFraction" : 0 ,"maxIterations" : 8 ,"requiredEvents" : 1165000 # ~70% of 1666222 - ,"autoUpdate" : True + ,"autoUpdate" : False ,"testing" : False # 2017 tolerances: [0.027, 0.030, 0.455, 0.370], adjusted to [0.03, 0.03, 0.46, 0.37] ,"stopTolerancePriY" : 0.03 @@ -100,7 +100,7 @@ class Rich1MirrAlignOnConf(LHCbConfigurableUser): ,"stopSigmaFraction" : """ tolerance for total tilt of mirror pair in terms of the fraction of the nominal Cherenkov angle resolution """ ,"maxIterations" : """ The number of iterations the mirror alignment will run, before giving up """ ,"requiredEvents" : """ If this many events are not procesed by the farm, on average, we do run the alignment but we will never update it. """ - ,"autoUpdate" : """ If True, then the fully automated updating system is activated. """ + ,"autoUpdate" : """ If True, then the fully automated updating system is activated. If False, our DB update service is still active but returns the starting alignment version. """ ,"testing" : """ If True, then we are running a test alignment; we also disable our DB update service completely. """ ,"stopTolerancePriY" : """ RICH-dependent tolerance for primary mirrors rotation around Y correction in mrad to stop the alignment """ ,"stopTolerancePriZ" : """ RICH-dependent tolerance for primary mirrors rotation around Z correction in mrad to stop the alignment """ @@ -194,7 +194,7 @@ class Rich2MirrAlignOnConf(LHCbConfigurableUser): ,"stopSigmaFraction" : 0 ,"maxIterations" : 8 ,"requiredEvents" : 925000 # ~70% of 1322220 - ,"autoUpdate" : True + ,"autoUpdate" : False ,"testing" : False # 2017 tolerances: [0.032, 0.030, 0.043, 0.057], adjusted to [0.03, 0.03, 0.05, 0.06] ,"stopTolerancePriY" : 0.03 @@ -236,7 +236,7 @@ class Rich2MirrAlignOnConf(LHCbConfigurableUser): ,"stopSigmaFraction" : """ tolerance for total tilt of mirror pair in terms of the fraction of the nominal Cherenkov angle resolution """ ,"maxIterations" : """ The number of iterations the mirror alignment will run, before giving up """ ,"requiredEvents" : """ If this many events are not procesed by the farm, on average, we do run the alignment but we will never update it. """ - ,"autoUpdate" : """ If True, then the fully automated updating system is activated. """ + ,"autoUpdate" : """ If True, then the fully automated updating system is activated. If False, our DB update service is still active but returns the starting alignment version. """ ,"testing" : """ If True, then we are running a test alignment; we also disable our DB update service completely. """ ,"stopTolerancePriY" : """ RICH-dependent tolerance for primary mirrors rotation around Y correction in mrad to stop the alignment """ ,"stopTolerancePriZ" : """ RICH-dependent tolerance for primary mirrors rotation around Z correction in mrad to stop the alignment """ -- GitLab From 8e11cbbea0e936ae692da4d48b4cdf3df8b47539 Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Fri, 21 Jul 2017 00:15:37 +0200 Subject: [PATCH 23/29] Print messages and send email if sanity check fails, even if autoUpdate is already False. Still RichMirrorAlignmentOnline v3r5 --- .../python/PyMirrAlignOnline/Iterator.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py index b262a9f29..7b69645f8 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py @@ -420,13 +420,19 @@ def run(whichRich): if nEventsListList[1] < int(alignConf.getProp('requiredEvents')): if autoUpdate: autoUpdate = False - print "INFO: We processed an average number of events per iteration of " + str(nEventsListList[1]) + ", which is too low to allow mirror alignment " + setupHelper.directoryTime + " to automatically update, should an update be deemed necessary." - setupHelper.sendEmail( 'autoUpdate disabled for RICH' + str(whichRich) + ' alignment ' + setupHelper.directoryTime + '.' , 'RICH' + str(whichRich) + ' mirror alignment ' + setupHelper.directoryTime + ' will not automatically be updated, should an update be deemed necessary. \n Average number of events processed per iteration: ' + str(nEventsListList[1]) , setupHelper.emails) + print "INFO: We processed an average number of events per iteration of " + str(nEventsListList[1]) + ", which is too low to allow mirror alignment " + setupHelper.directoryTime + " to automatically update, should an update be deemed necessary. autoUpdate is now set to False." + setupHelper.sendEmail( 'Lack of events, autoUpdate disabled for RICH' + str(whichRich) + ' alignment ' + setupHelper.directoryTime + '.' , 'RICH' + str(whichRich) + ' mirror alignment ' + setupHelper.directoryTime + ' will not automatically be updated, should an update be deemed necessary. \n Average number of events processed per iteration: ' + str(nEventsListList[1]) , setupHelper.emails) + else: + print "INFO: We processed an average number of events per iteration of " + str(nEventsListList[1]) + ", which is too low to allow mirror alignment " + setupHelper.directoryTime + " to automatically update, should an update be deemed necessary. autoUpdate was already False though." + setupHelper.sendEmail( 'Lack of events for RICH' + str(whichRich) + ' alignment ' + setupHelper.directoryTime + ', autoUpdate was already False.' , 'RICH' + str(whichRich) + ' mirror alignment ' + setupHelper.directoryTime + ' will not automatically be updated, should an update be deemed necessary. \n Average number of events processed per iteration: ' + str(nEventsListList[1]) , setupHelper.emails) if insane: if autoUpdate: autoUpdate = False - print "INFO: Sanity checks have failed, we will not allow mirror alignment " + setupHelper.directoryTime + " to automatically update, should an update be deemed necessary." - setupHelper.sendEmail( 'autoUpdate disabled for RICH' + str(whichRich) + ' alignment ' + setupHelper.directoryTime + '.' , 'RICH' + str(whichRich) + ' mirror alignment ' + setupHelper.directoryTime + ' will not automatically be updated, should an update be deemed necessary. \n Sanity checks have failed for this alignment.' , setupHelper.emails) + print "INFO: Sanity checks have failed, we will not allow mirror alignment " + setupHelper.directoryTime + " to automatically update, should an update be deemed necessary. autoUpdate is now set to False." + setupHelper.sendEmail( 'Sanity checks failed, autoUpdate disabled for RICH' + str(whichRich) + ' alignment ' + setupHelper.directoryTime + '.' , 'RICH' + str(whichRich) + ' mirror alignment ' + setupHelper.directoryTime + ' will not automatically be updated, should an update be deemed necessary. \n Sanity checks have failed for this alignment.' , setupHelper.emails) + else: + print "INFO: Sanity checks have failed, we will not allow mirror alignment " + setupHelper.directoryTime + " to automatically update, should an update be deemed necessary. autoUpdate was already False though." + setupHelper.sendEmail( 'Sanity checks failed for RICH' + str(whichRich) + ' alignment ' + setupHelper.directoryTime + ', autoUpdate was already False.' , 'RICH' + str(whichRich) + ' mirror alignment ' + setupHelper.directoryTime + ' will not automatically be updated, should an update be deemed necessary. \n Sanity checks have failed for this alignment.' , setupHelper.emails) sys.stdout.flush() # if forcedUpdate_ChMagPol and conv: -- GitLab From 6a8405dd9abda7f7af0bd71dff202e2ca17acf66 Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Fri, 21 Jul 2017 00:38:14 +0200 Subject: [PATCH 24/29] Final email and RICH ELOG now state if autoUpdate is False. Still RichMirrorAlignmentOnline v3r5 --- .../python/PyMirrAlignOnline/SetupHelper.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py index 8fd8f3288..c73911b5a 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py @@ -168,7 +168,9 @@ class SetupHelper: elif DBUpdated: text += " Due to a significant change from the alignment in the DB, or a change in magnet polarity, the DB was automatically updated to " + vN_DB_str + "." # We should probably provide more info here else: - text += " The alignment in the DB is still " + vN_DB_str + "." + text += " The alignment in the DB is still " + vN_DB_str + "." + if not autoUpdate: + text += " autoUpdate is False." command = 'elog -h "' command += str(host) command += '" -p ' @@ -290,7 +292,9 @@ class SetupHelper: text2 += "\n Due to a significant change from the alignment in the DB, or a change in magnet polarity, the DB was automatically updated to " + vN_DB_str + ". \n" # We should probably provide more info here else: text2 += "\n The alignment in the DB is still " + vN_DB_str + "." - + if not autoUpdate: + text2 += " autoUpdate is False." + text2 += "\n More information is available at the following links: \n\n " text2 += 'https://lblogbook.cern.ch/RICH/?System=%5EAlignment%24&Subject={0}&mode=full'.format(self.directoryTime) text2 += '\n https://lbrich.cern.ch/alignmentview.php' -- GitLab From 1046246ccb4ee8ccec36af38b64c0dcc2ecf9342 Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Fri, 21 Jul 2017 00:42:04 +0200 Subject: [PATCH 25/29] Final emails and ELOG state if autoUpdate is False. Still RichMirrorAlignmentOnline v3r5 (2) --- .../python/PyMirrAlignOnline/SetupHelper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py index c73911b5a..9cb7cf49e 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py @@ -169,7 +169,7 @@ class SetupHelper: text += " Due to a significant change from the alignment in the DB, or a change in magnet polarity, the DB was automatically updated to " + vN_DB_str + "." # We should probably provide more info here else: text += " The alignment in the DB is still " + vN_DB_str + "." - if not autoUpdate: + if not self.autoUpdate: text += " autoUpdate is False." command = 'elog -h "' command += str(host) @@ -292,7 +292,7 @@ class SetupHelper: text2 += "\n Due to a significant change from the alignment in the DB, or a change in magnet polarity, the DB was automatically updated to " + vN_DB_str + ". \n" # We should probably provide more info here else: text2 += "\n The alignment in the DB is still " + vN_DB_str + "." - if not autoUpdate: + if not self.autoUpdate: text2 += " autoUpdate is False." text2 += "\n More information is available at the following links: \n\n " -- GitLab From 5341728caec29516ef0d7cdba889a9497c7ba3ae Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Fri, 21 Jul 2017 00:51:13 +0200 Subject: [PATCH 26/29] Final emails and ELOG state if autoUpdate is False. Still RichMirrorAlignmentOnline v3r5 (3) --- .../python/PyMirrAlignOnline/SetupHelper.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py index 9cb7cf49e..04b0094be 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py @@ -164,13 +164,13 @@ class SetupHelper: text += self.directoryTime text += "." if DBUpdated is None: - text += " There was a significant change from the alignment in the DB, or a change in magnet polarity. However the automatic update feature is off, or was disabled during the alignment, or the alignment is in testing mode, so the DB was not updated. If the automatic update feature was disabled, there may not have been enough events processed, or a sanity check was not satisfied. Please notify a MirrAlign expert to investigate whether this alignment (" + vN_DB_str + ") should be installed." # We should maybe provide more info here + text += " There was a significant change from the alignment in the DB, or a change in magnet polarity. However the automatic update feature is off or was disabled during the alignment (The final state of autoUpdate was set to False), or the alignment is in testing mode, so the DB was not updated. If the automatic update feature was disabled, there may not have been enough events processed, or a sanity check was not satisfied. Please notify a MirrAlign expert to investigate whether this alignment (" + vN_DB_str + ") should be installed." # We should maybe provide more info here elif DBUpdated: text += " Due to a significant change from the alignment in the DB, or a change in magnet polarity, the DB was automatically updated to " + vN_DB_str + "." # We should probably provide more info here else: text += " The alignment in the DB is still " + vN_DB_str + "." if not self.autoUpdate: - text += " autoUpdate is False." + text += " The initial state of autoUpdate was set to False in the configuration." command = 'elog -h "' command += str(host) command += '" -p ' @@ -287,13 +287,13 @@ class SetupHelper: text2 += str(n_it + 1) text2 += " iteration(s) occured. \n" if DBUpdated is None: - text2 += "\n There was a significant change from the alignment in the DB, or a change in magnet polarity. However the automatic update feature is off, or was disabled during the alignment, so the DB was not updated. If the automatic update feature was disabled, there may not have been enough events processed, or a sanity check was not satisfied. A MirrAlign expert should investigate whether this draft alignment (" + vN_DB_str + ") should be installed. \n" # We should probably provide more info here + text2 += "\n There was a significant change from the alignment in the DB, or a change in magnet polarity. However the automatic update feature is off or was disabled during the alignment (The final state of autoUpdate was set to False), so the DB was not updated. If the automatic update feature was disabled, there may not have been enough events processed, or a sanity check was not satisfied. A MirrAlign expert should investigate whether this draft alignment (" + vN_DB_str + ") should be installed. \n" # We should probably provide more info here elif DBUpdated: text2 += "\n Due to a significant change from the alignment in the DB, or a change in magnet polarity, the DB was automatically updated to " + vN_DB_str + ". \n" # We should probably provide more info here else: text2 += "\n The alignment in the DB is still " + vN_DB_str + "." if not self.autoUpdate: - text2 += " autoUpdate is False." + text2 += " The initial state of autoUpdate was set to False in the configuration." text2 += "\n More information is available at the following links: \n\n " text2 += 'https://lblogbook.cern.ch/RICH/?System=%5EAlignment%24&Subject={0}&mode=full'.format(self.directoryTime) @@ -345,7 +345,7 @@ class SetupHelper: args += 'richDetector = ' + str(self.whichRich) + '\n' args += 'DB updated = ' + str(DBUpdated) + '\n' if DBUpdated is None: - args += ' (Alignment changed, but autoUpdate is False or was disabled) \n' + args += ' (Alignment changed, but autoUpdate started as False or was disabled) \n' args += 'resulting DB = ' + str(vN_DB_str) + '\n' args += 'converged = ' + str(conv) + '\n' args += 'Number of iterations = ' + str(n_it + 1) + '\n' @@ -370,7 +370,7 @@ class SetupHelper: args += ' error = ' + str(finalCKresErr) + '\n' args += '\n' - args += 'autoUpdate = ' + str(self.autoUpdate) + '\n' + args += 'autoUpdate (initial) = ' + str(self.autoUpdate) + '\n' args += 'testing = ' + str(self.testing) + '\n' args += 'requiredEvents = ' + str(self.alignConf.getProp('requiredEvents')) + '\n' args += 'minAverageBinPop = ' + str(self.minAverageBinPop) + '\n' -- GitLab From 9478a531e9e0739de7868cd49c412cdfb86fc160 Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Fri, 21 Jul 2017 00:59:44 +0200 Subject: [PATCH 27/29] Final emails and ELOG state if autoUpdate is False. Still RichMirrorAlignmentOnline v3r5 (4) --- .../python/PyMirrAlignOnline/SetupHelper.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py index 04b0094be..2957b2f23 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py @@ -169,8 +169,8 @@ class SetupHelper: text += " Due to a significant change from the alignment in the DB, or a change in magnet polarity, the DB was automatically updated to " + vN_DB_str + "." # We should probably provide more info here else: text += " The alignment in the DB is still " + vN_DB_str + "." - if not self.autoUpdate: - text += " The initial state of autoUpdate was set to False in the configuration." + if not self.autoUpdate: + text += " The initial state of autoUpdate was set to False in the configuration." command = 'elog -h "' command += str(host) command += '" -p ' @@ -292,8 +292,6 @@ class SetupHelper: text2 += "\n Due to a significant change from the alignment in the DB, or a change in magnet polarity, the DB was automatically updated to " + vN_DB_str + ". \n" # We should probably provide more info here else: text2 += "\n The alignment in the DB is still " + vN_DB_str + "." - if not self.autoUpdate: - text2 += " The initial state of autoUpdate was set to False in the configuration." text2 += "\n More information is available at the following links: \n\n " text2 += 'https://lblogbook.cern.ch/RICH/?System=%5EAlignment%24&Subject={0}&mode=full'.format(self.directoryTime) @@ -302,6 +300,9 @@ class SetupHelper: text2 += "\n\n Fill number of first run processed: " + str(FillAlignment) + if not self.autoUpdate: + text2 += " The initial state of autoUpdate was set to False in the configuration." + self.sendEmail(subj2, text2, self.emails) return messageID -- GitLab From 9f59a858f0b8a4868159d09c008998e50ca1b75f Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Fri, 21 Jul 2017 02:07:00 +0200 Subject: [PATCH 28/29] We now send an extra warning email on magnet polarity change. Still RichMirrorAlignmentOnline v3r5 (4) --- .../python/PyMirrAlignOnline/Iterator.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py index 7b69645f8..38ddc8cf0 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/Iterator.py @@ -191,12 +191,14 @@ def run(whichRich): with open(oldPolarityFilename, 'r') as previousAlignPolarityFile: first_line = previousAlignPolarityFile.readline() if (first_line != polarities[0] + '\n'): + setupHelper.sendEmail( 'WARNING: MAGNET POLARITY CHANGE! RICH' + str(whichRich) + ' mirror alignment ' + setupHelper.directoryTime + '.', 'WARNING: MAGNET POLARITY CHANGE from \n ' + first_line + ' to ' + polarities[0] + ' \n RICH' + str(whichRich) + ' mirror alignment ' + setupHelper.directoryTime + '. \n Runs: ' + str(runs) + ' \n Fills: ' + str(fills) + ' \n Polarities: ' + str(polsStr) + ' \n dataVariant: ' + alignConf.getProp('dataVariant'), setupHelper.emails) forcedUpdate_ChMagPol = True ChMagPolSubject += 'Magnet Polarity Changed; possibly forcing update.' - ChMagPolText += 'If this alignment converges, the alignment will be updated due to a change in magnet polarity (unless autoUpdate is/becomes False, or testing is True). If there are any problems with this alignment, please contact the Mirror Alignment expert! They should re-flip the magnet polarity in ' + polarityDir + ' in order to have the proper behavior on the next attempt!' + ChMagPolText += 'If this alignment converges, the alignment will be updated due to a change in magnet polarity (unless autoUpdate is/becomes False, or testing is True). If there are any problems with this alignment, please contact the Mirror Alignment expert! They should check previousPolarity_RICH in ' + polarityDir + ' to ensure the proper behavior on the next attempt!' postSubject += ' ' + ChMagPolSubject postText += ' \n ' + ChMagPolText print 'INFO: Magnet Polarity Changed; if this alignment converges under normal conditions, then the alignment will be updated.' + # Next two lines only get used at the end if things fail ChMagPolSubject = ' WARNING: The magnet polarity changed!' ChMagPolText = ' \n WARNING: The magnet polarity changed! Make sure that everything (e.g. previousPolarity_RICH) is in order for the next alignment!!!' # OUTDATED: The expert should re-flip the magnet polarity for this Rich detector in ' + polarityDir + ' in order to have the proper behavior on the next attempt!!! -- GitLab From 6ef976eb29d136c10404bcd502030c6f4cd81e10 Mon Sep 17 00:00:00 2001 From: Paras Naik <paras.naik@cern.ch> Date: Fri, 21 Jul 2017 03:49:36 +0200 Subject: [PATCH 29/29] typo fix --- .../python/PyMirrAlignOnline/SetupHelper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py index 2957b2f23..0736371e2 100644 --- a/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py +++ b/Rich/RichMirrorAlignmentOnline/python/PyMirrAlignOnline/SetupHelper.py @@ -301,7 +301,7 @@ class SetupHelper: text2 += "\n\n Fill number of first run processed: " + str(FillAlignment) if not self.autoUpdate: - text2 += " The initial state of autoUpdate was set to False in the configuration." + text2 += " \n\n The initial state of autoUpdate was set to False in the configuration." self.sendEmail(subj2, text2, self.emails) -- GitLab