CMS 3D CMS Logo

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

Functions

def main
 
def runt0
 
def runttrig
 
def runvdrift
 

Function Documentation

def allPlotsResiduals.main ( )

Definition at line 8 of file allPlotsResiduals.py.

References print(), runt0(), runttrig(), and runvdrift().

8 
9 def main():
10  parser = optparse.OptionParser()
11  (options, args) = parser.parse_args()
12  ROOT.gROOT.SetBatch(True)
13  for filename in args:
14  if "vDrift_segment_" in filename:
15  #name="DQM"
16  m=re.search("vDrift_segment_(\d*)",filename)
17  run=m.group(1)
18 
19  #path="DQMData/Run "+run+"/DT/Run summary/DTCalibValidation"
20 
21  f = open('dtVDriftAnalyzer_cfg.py','w')
22  print("from CalibMuon.DTCalibration.Workflow.addPoolDBESSource import addPoolDBESSource", file=f)
23  print("from CalibMuon.DTCalibration.dtVDriftAnalyzer_cfg import process", file=f)
24  print("addPoolDBESSource(process = process, moduleName = 'vDriftDB',record = 'DTMtimeRcd',tag = 'vDrift', connect = 'sqlite_file:"+filename+"')", file=f)
25  print("process.dtVDriftAnalyzer.rootFileName = 'dtVDriftAnalyzer_dtVDriftCalibration"+run+".root'", file=f)
26  f.close()
27  os.system("cmsRun dtVDriftAnalyzer_cfg.py")
28  name="vdrift"
29  runvdrift(name, run, "dtVDriftAnalyzer_dtVDriftCalibration"+run+".root")
30 
31  if "vDrift_meantimer_" in filename:
32  #name="DQM"
33  m=re.search("vDrift_meantimer_(\d*)",filename)
34  run=m.group(1)
35 
36  #path="DQMData/Run "+run+"/DT/Run summary/DTCalibValidation"
37 
38  f = open('dtVDriftAnalyzer_cfg.py','w')
39  print("from CalibMuon.DTCalibration.Workflow.addPoolDBESSource import addPoolDBESSource", file=f)
40  print("from CalibMuon.DTCalibration.dtVDriftAnalyzer_cfg import process", file=f)
41  print("addPoolDBESSource(process = process, moduleName = 'vDriftDB',record = 'DTMtimeRcd',tag = 'vDrift', connect = 'sqlite_file:"+filename+"')", file=f)
42  print("process.dtVDriftAnalyzer.rootFileName = 'dtVDriftAnalyzer_dtVDriftCalibration"+run+".root'", file=f)
43  f.close()
44  os.system("cmsRun dtVDriftAnalyzer_cfg.py")
45  name="vdrift"
46  runvdrift(name, run, "dtVDriftAnalyzer_dtVDriftCalibration"+run+".root")
47 
48  elif "DQM" in filename:
49  name="DQM"
50  m=re.search("R000(\d*)__",filename)
51  run=m.group(1)
52  path="DQMData/Run "+run+"/DT/Run summary/DTCalibValidation"
53  runttrig(name, filename, path, run)
54  elif "TestPulses" in filename:
55  name="T0"
56  runt0(name,filename,123456)
57  else:
58  name="DTRV"
59  m=re.search("DTResidualValidation_(\d*)\.root",filename)
60  run=m.group(1)
61  path="DTResiduals"
62  runttrig(name, filename, path, run)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def allPlotsResiduals.runt0 (   name,
  filename,
  run 
)

Definition at line 81 of file allPlotsResiduals.py.

References bigModule.plot(), ecalTPGAnalyzer_cfg.Print, and str.

Referenced by main().

81 
82 def runt0(name,filename,run):
83  from CalibMuon.DTCalibration.PlottingTools.plotT0FromHistos import *
84  for SL in [1,2,3]:
85  mean = plot(filename, SL ,run)
86  mean[0].Print(name+run+"-SL"+str(SL)+"-mean.pdf")
87  mean[0].SaveAs(name+run+"-SL"+str(SL)+"-mean.root")
def plot
Definition: bigModule.py:18
#define str(s)
def allPlotsResiduals.runttrig (   name,
  filename,
  path,
  run 
)

Definition at line 63 of file allPlotsResiduals.py.

References bigModule.plot(), ecalTPGAnalyzer_cfg.Print, and str.

Referenced by main().

63 
64 def runttrig(name, filename, path, run):
65  from CalibMuon.DTCalibration.PlottingTools.plotResiduals import *
66  for SL in [1,2,3]:
67  mean,sigma = plot(filename, SL,dir=path)
68  mean[0].Print(name+run+"-SL"+str(SL)+"-mean.pdf")
69  mean[0].SaveAs(name+run+"-SL"+str(SL)+"-mean.root")
70  sigma[0].Print(name+run+"-SL"+str(SL)+"-sigma.pdf")
sigma[0].SaveAs(name+run+"-SL"+str(SL)+"-sigma.root")
def plot
Definition: bigModule.py:18
#define str(s)
def allPlotsResiduals.runvdrift (   name,
  run,
  filename 
)

Definition at line 71 of file allPlotsResiduals.py.

References bigModule.plot(), ecalTPGAnalyzer_cfg.Print, and str.

Referenced by main().

71 
72 def runvdrift(name, run, filename):
73  from CalibMuon.DTCalibration.PlottingTools.plotVDriftFromHistos import *
74  for SL in [1,2,3]:
75  mean = plot(filename, SL)
76  mean[0].Print(name+run+"-SL"+str(SL)+"-mean.pdf")
77  mean[0].SaveAs(name+run+"-SL"+str(SL)+"-mean.root")
78  #sigma[0].Print(name+run+"-SL"+str(SL)+"-sigma.pdf")
79 
80  #plot("DTResidualValidation_210614.root", 1,dir="DTResiduals")
#plot("DQM_V0001_R000210634__StreamExpress__HIRun2013-DtCalib-Express-v1-dtTtrigCalibrationFromResiduals-NEW-usedb-rev1__ALCARECO.root", 1,dir="DQMData/Run 210634/DT/Run summary/DTCalibValidation")
def plot
Definition: bigModule.py:18
#define str(s)