CMS 3D CMS Logo

Functions
mergeAndRegister Namespace Reference

Functions

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

Function Documentation

def mergeAndRegister.filecheck (   rootfile)

Definition at line 22 of file mergeAndRegister.py.

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

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

Definition at line 11 of file mergeAndRegister.py.

Referenced by filecheck().

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