CMS 3D CMS Logo

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

Functions

def filecheck (rootfile)
 
def sendmail (EmailAddress, run)
 

Function Documentation

def mergeAndRegister.filecheck (   rootfile)

Definition at line 23 of file mergeAndRegister.py.

References mps_setup.append, FrontierConditions_GlobalTag_cff.file, join(), edm.print(), and sendmail().

23 def filecheck(rootfile):
24  f = TFile(rootfile)
25  if (f.IsZombie()):
26  #print "File corrupted"
27  f.Close()
28  return 0
29  else:
30  hist = f.FindObjectAny("reportSummaryContents")
31  #(skip filecheck for HcalTiming files!!)
32  if (hist == None and rootfile.rfind('HcalTiming') == -1):
33  #print "File is incomplete"
34  f.Close()
35  return 0
36  else:
37  #print "File is OK"
38  f.Close()
39  return 1
40 
41 
42 
def filecheck(rootfile)
def mergeAndRegister.sendmail (   EmailAddress,
  run 
)

Definition at line 12 of file mergeAndRegister.py.

Referenced by filecheck().

12 def sendmail(EmailAddress,run):
13  s=smtplib.SMTP("localhost")
14  tolist=[EmailAddress]
15  body="File merge failed by unknown reason for run"+run
16  msg = MIMEText(body)
17  msg['Subject'] = "File merge failed."
18  msg['From'] = ServerMail
19  msg['To'] = EmailAddress
20  s.sendmail(ServerMail,tolist,msg.as_string())
21  s.quit()
22 
def sendmail(EmailAddress, run)