CMS 3D CMS Logo

Functions
dqmPostProcessing_online Namespace Reference

Functions

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

Function Documentation

def dqmPostProcessing_online.filecheck (   rootfile)

Definition at line 33 of file dqmPostProcessing_online.py.

References mps_setup.append, createfilelist.int, join(), edm.print(), sendmail(), and split.

33 def filecheck(rootfile):
34  f = TFile(rootfile)
35  if (f.IsZombie()):
36  #print "File corrupted"
37  f.Close()
38  return 0
39  else:
40  hist = f.FindObjectAny("reportSummaryContents")
41  #(skip filecheck for HcalTiming files!!)
42  if (hist == None and rootfile.rfind('HcalTiming') == -1):
43  #print "File is incomplete"
44  f.Close()
45  return 0
46  else:
47  #print "File is OK"
48  f.Close()
49  return 1
50 
def dqmPostProcessing_online.sendmail (   EmailAddress,
  run 
)

Definition at line 22 of file dqmPostProcessing_online.py.

Referenced by filecheck().

22 def sendmail(EmailAddress,run):
23  s=smtplib.SMTP("localhost")
24  tolist=[EmailAddress, "lat@cern.ch"]
25  body="File merge failed by unknown reason for run"+run
26  msg = MIMEText(body)
27  msg['Subject'] = "File merge failed."
28  msg['From'] = ServerMail
29  msg['To'] = EmailAddress
30  s.sendmail(ServerMail,tolist,msg.as_string())
31  s.quit()
32 
def sendmail(EmailAddress, run)