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 32 of file dqmPostProcessing_online.py.

References mps_alisetup.append, createfilelist.int, join(), sendmail(), and split.

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

Definition at line 21 of file dqmPostProcessing_online.py.

Referenced by filecheck().

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