CMS 3D CMS Logo

Functions | Variables
TkMap_script_phase1 Namespace Reference

Functions

def downloadnlineDQMhisto (run, Run_type)
 
def downloadOfflineDQMhisto (run, Run_type, rereco)
 
def downloadOfflinePCLhisto (run, Run_type)
 
def getGT (DQMfile, RunNumber, globalTagVar)
 
def setRunDirectory (runNumber)
 

Variables

 check_command
 Check if run is complete##############. More...
 
 Check_output
 
 checkfolder
 Start making TkMaps################. More...
 
 CMSSW_BASE
 
 DataLocalDir
 
 deadRocMap
 
 dest
 Producing the list of bad modules. More...
 
 detIdInfoFileName
 
 File_Name
 
 File_Name_online
 
 File_Name_PCL
 
 filepath
 
 full_pixelfile_name
 
 full_stripfile_name
 
 globalTag
 Getting GT############## After switch production to 10_X_X release, the clean up section need to be reviewed and modified ##########. More...
 
 input_var
 
 nnnOut
 Downloading DQM file############################. More...
 
 output
 put color legend in the TrackerMap################### More...
 
 pixel_files
 Start making pixel maps#####################. More...
 
 pixelTreeFileName
 
 rereco
 Check if user enter the right run type######################. More...
 
 Run_Number
 
 Run_type
 
 runDirval
 
 sefile
 rename bad module list file###################### More...
 
 shell
 
 strip_files
 create merged list of BadComponent from (PCL, RunInfo and FED Errors) ignore for now More...
 
 workPath
 

Function Documentation

◆ downloadnlineDQMhisto()

def TkMap_script_phase1.downloadnlineDQMhisto (   run,
  Run_type 
)

Definition at line 93 of file TkMap_script_phase1.py.

References any(), getGT(), print(), setRunDirectory(), submitPVValidationJobs.split(), and str.

93 def downloadnlineDQMhisto(run, Run_type):
94  runDirval=setRunDirectory(run)
95  DataLocalDir=runDirval[0]
96  DataOfflineDir=runDirval[1]
97  nnn=run/100
98  nnnOnline = run/10000
99  File_Name_online=''
100  deadRocMap = False
101 
102  url1 = 'https://cmsweb.cern.ch/dqm/online/data/browse/Original/000'+str(nnnOnline)+'xxxx/000'+str(nnn)+'xx/'
103  os.popen("curl -k --cert /data/users/cctrkdata/current/auth/proxy/proxy.cert --key /data/users/cctrkdata/current/auth/proxy/proxy.cert -X GET "+url1+" > index_online.html")
104 
105  url2 = 'https://cmsweb.cern.ch/dqm/offline/data/browse/ROOT/OnlineData/original/000'+str(nnnOnline)+'xxxx/000'+str(nnn)+'xx/'
106  os.popen("curl -k --cert /data/users/cctrkdata/current/auth/proxy/proxy.cert --key /data/users/cctrkdata/current/auth/proxy/proxy.cert -X GET "+url2+" > index_online_backup.html")
107  f_online_backup=codecs.open("index_online_backup.html", 'r') index_online_backup = f_online_backup.readlines()
108 
109  f_online=codecs.open("index_online.html", 'r')
110  index_online = f_online.readlines()
111  if any(str(run) in x for x in index_online):
112  for x in index_online:
113  if (str(run) in x) and ("_PixelPhase1_" in x):
114  File_Name_online=str(str(x).split(".root'>")[1].split("</a></td><td>")[0])
115  deadRocMap = True
116  else:
117  print("Can't find any file in offline server, trying the online server")
118  if any(str(run) in y for y in index_online_backup):
119  for y in index_online:
120  if (str(run) in y) and ("_PixelPhase1_" in y):
121  File_Name_online=str(str(y).split(".root'>")[1].split("</a></td><td>")[0])
122  deadRocMap = True
123  else:
124  print('No Online DQM file available. Skip dead roc map')
125  deadRocMap = False
126 
127  print('Downloading DQM file:'+File_Name_online)
128 
129 
130  os.system('curl -k --cert /data/users/cctrkdata/current/auth/proxy/proxy.cert --key /data/users/cctrkdata/current/auth/proxy/proxy.cert -X GET https://cmsweb.cern.ch/dqm/online/data/browse/Original/000'+str(nnnOnline)+'xxxx/000'+str(nnn)+'xx/'+File_Name_online+' > /tmp/'+File_Name_online)
131 
132  os.remove('index_online.html')
133  os.remove('index_online_backup.html')
134  return deadRocMap, File_Name_online;
135 
136 
137 
bool any(const std::vector< T > &v, const T &what)
Definition: ECalSD.cc:36
def downloadnlineDQMhisto(run, Run_type)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def setRunDirectory(runNumber)
#define str(s)

◆ downloadOfflineDQMhisto()

def TkMap_script_phase1.downloadOfflineDQMhisto (   run,
  Run_type,
  rereco 
)

Definition at line 37 of file TkMap_script_phase1.py.

References any(), print(), setRunDirectory(), submitPVValidationJobs.split(), and str.

37 def downloadOfflineDQMhisto(run, Run_type,rereco):
38  runDirval=setRunDirectory(run)
39  DataLocalDir=runDirval[0]
40  DataOfflineDir=runDirval[1]
41  nnn=run/100
42  print('Processing '+ Run_type + ' in '+DataOfflineDir+"...")
43  File_Name = ''
44  print('Directory to fetch the DQM file from: https://cmsweb.cern.ch/dqm/offline/data/browse/ROOT/OfflineData/'+DataOfflineDir+'/'+Run_type+'/000'+str(nnn)+'xx/')
45  url = 'https://cmsweb.cern.ch/dqm/offline/data/browse/ROOT/OfflineData/'+DataOfflineDir+'/'+Run_type+'/000'+str(nnn)+'xx/'
46  os.popen("curl -k --cert /data/users/cctrkdata/current/auth/proxy/proxy.cert --key /data/users/cctrkdata/current/auth/proxy/proxy.cert -X GET "+url+" > index.html")
47  f=codecs.open("index.html", 'r')
48  index = f.readlines()
49  if any(str(Run_Number[i]) in s for s in index):
50  for s in index:
51  if rereco:
52  if (str(Run_Number[i]) in s) and ("__DQMIO.root" in s) and ("17Sep2018" in s):
53  File_Name = str(str(s).split("xx/")[1].split("'>DQM")[0])
54  else:
55  if (str(Run_Number[i]) in s) and ("__DQMIO.root" in s):
56  File_Name = str(str(s).split("xx/")[1].split("'>DQM")[0])
57 
58  else:
59  print('No DQM file available. Please check the Offline server')
60  sys.exit(0)
61 
62  print('Downloading DQM file:'+File_Name)
63  os.system('curl -k --cert /data/users/cctrkdata/current/auth/proxy/proxy.cert --key /data/users/cctrkdata/current/auth/proxy/proxy.cert -X GET https://cmsweb.cern.ch/dqm/offline/data/browse/ROOT/OfflineData/'+DataOfflineDir+'/'+Run_type+'/000'+str(nnn)+'xx/'+File_Name+' > /tmp/'+File_Name)
64 
65  return File_Name
66 
bool any(const std::vector< T > &v, const T &what)
Definition: ECalSD.cc:36
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def setRunDirectory(runNumber)
#define str(s)
def downloadOfflineDQMhisto(run, Run_type, rereco)

◆ downloadOfflinePCLhisto()

def TkMap_script_phase1.downloadOfflinePCLhisto (   run,
  Run_type 
)

Definition at line 67 of file TkMap_script_phase1.py.

References any(), print(), setRunDirectory(), submitPVValidationJobs.split(), and str.

67 def downloadOfflinePCLhisto(run, Run_type):
68  runDirval=setRunDirectory(run)
69  DataLocalDir=runDirval[0]
70  DataOfflineDir=runDirval[1]
71  nnn=run/100
72  print('Processing '+ Run_type + ' in '+DataOfflineDir+"...")
73  File_Name = 'Temp'
74  print('Directory to fetch the DQM file from: https://cmsweb.cern.ch/dqm/offline/data/browse/ROOT/OfflineData/'+DataOfflineDir+'/'+Run_type+'/000'+str(nnn)+'xx/')
75  url = 'https://cmsweb.cern.ch/dqm/offline/data/browse/ROOT/OfflineData/'+DataOfflineDir+'/'+Run_type+'/000'+str(nnn)+'xx/'
76  os.popen("curl -k --cert /data/users/cctrkdata/current/auth/proxy/proxy.cert --key /data/users/cctrkdata/current/auth/proxy/proxy.cert -X GET "+url+" > index.html")
77  f=codecs.open("index.html", 'r')
78  index = f.readlines()
79  if any(str(Run_Number[i]) in s for s in index):
80  for s in index:
81  if (str(Run_Number[i]) in s) and ("PromptCalibProdSiPixel-Express" in s) and ("__ALCAPROMPT.root" in s):
82  File_Name = str(str(s).split("xx/")[1].split("'>DQM")[0])
83  else:
84  print('No DQM file available. Please check the Offline server')
85  sys.exit(0)
86  if File_Name!='Temp':
87  print('Downloading DQM file:'+File_Name)
88  os.system('curl -k --cert /data/users/cctrkdata/current/auth/proxy/proxy.cert --key /data/users/cctrkdata/current/auth/proxy/proxy.cert -X GET https://cmsweb.cern.ch/dqm/offline/data/browse/ROOT/OfflineData/'+DataOfflineDir+'/'+Run_type+'/000'+str(nnn)+'xx/'+File_Name+' > /tmp/'+File_Name)
89 
90  return File_Name
91 
92 
bool any(const std::vector< T > &v, const T &what)
Definition: ECalSD.cc:36
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def downloadOfflinePCLhisto(run, Run_type)
def setRunDirectory(runNumber)
#define str(s)

◆ getGT()

def TkMap_script_phase1.getGT (   DQMfile,
  RunNumber,
  globalTagVar 
)

Definition at line 138 of file TkMap_script_phase1.py.

References print(), FastTimerService_cff.range, and str.

Referenced by downloadnlineDQMhisto().

138 def getGT(DQMfile, RunNumber, globalTagVar):
139  globalTag_v0 = getGTfromDQMFile(DQMfile, RunNumber, globalTagVar)
140  print("Global Tag: " + globalTag_v0)
141  globalTag = globalTag_v0
142 
143  for z in range(len(globalTag_v0)-2):#clean up the garbage string in the GT
144  if (globalTag_v0[z].isdigit()) and (globalTag_v0[z+1].isdigit()) and (globalTag_v0[z+2].isdigit()) and(globalTag_v0[z+3].isupper()):
145  globalTag = globalTag_v0[z:]
146  break
147  if globalTag == "":
148  print(" No GlobalTag found: trying from DAS.... ")
149  globalTag = str(os.popen('getGTscript.sh '+filepath+ File_Name+' ' +str(Run_Number[i])));
150  if globalTag == "":
151  print(" No GlobalTag found for run: "+str(Run_Number[i]))
152 
153  return globalTag
154 
155 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def getGT(DQMfile, RunNumber, globalTagVar)
#define str(s)

◆ setRunDirectory()

def TkMap_script_phase1.setRunDirectory (   runNumber)

Definition at line 16 of file TkMap_script_phase1.py.

Referenced by downloadnlineDQMhisto(), downloadOfflineDQMhisto(), and downloadOfflinePCLhisto().

16 def setRunDirectory(runNumber):
17  # Don't forget to add an entry when there is a new era
18  dirDict = { 325799:['Data2018', 'HIRun2018'],\
19  315252:['Data2018', 'Run2018'],\
20  308336:['Data2018', 'Commissioning2018'],\
21  294644:['Data2017', 'Run2017'],\
22  290123:['Data2017', 'Commissioning2017'],\
23  284500:['Data2016', 'PARun2016'],\
24  271024:['Data2016', 'Run2016'],\
25  264200:['Data2016', 'Commissioning2016'],\
26  246907:['Data2015', 'Run2015'],\
27  232881:['Data2015', 'Commissioning2015'],\
28  211658:['Data2013', 'Run2013'],\
29  209634:['Data2013', 'HIRun2013'],\
30  190450:['Data2012', 'Run2012']}
31  runKey=0
32  for key in sorted(dirDict):
33  if runNumber > key:
34  runKey=key
35  return dirDict[runKey]
36 
def setRunDirectory(runNumber)

Variable Documentation

◆ check_command

TkMap_script_phase1.check_command

Check if run is complete##############.

Definition at line 191 of file TkMap_script_phase1.py.

◆ Check_output

TkMap_script_phase1.Check_output

Definition at line 192 of file TkMap_script_phase1.py.

◆ checkfolder

TkMap_script_phase1.checkfolder

Start making TkMaps################.

Definition at line 217 of file TkMap_script_phase1.py.

◆ CMSSW_BASE

◆ DataLocalDir

TkMap_script_phase1.DataLocalDir

Definition at line 183 of file TkMap_script_phase1.py.

◆ deadRocMap

TkMap_script_phase1.deadRocMap

Definition at line 180 of file TkMap_script_phase1.py.

◆ dest

TkMap_script_phase1.dest

Producing the list of bad modules.

if Run_type != "StreamExpress": shutil.copyfile(sefile, checkdir+'/'+sefile) os.system('/usr/bin/python ${CMSSW_BASE}/src/DQM/SiStripMonitorClient/scripts/findBadModT9.py -p '+sefile+' -s /'+checkdir+'/'+sefile); Producing the run certification by lumisection Producing the PrimaryVertex/BeamSpot quality test by LS.. if (Run_type != "Cosmics") and ( Run_type != "StreamExpress") and (Run_type != "StreamExpressCosmics"): print(" Creating the BeamSpot Calibration certification summary:") os.system('lsbs_cert '+filepath+'/'+File_Name) .. and harvest the bad beamspot LS with automatic emailing (if in period and if bad LS found) Producing the Module difference for ExpressStream

Definition at line 297 of file TkMap_script_phase1.py.

◆ detIdInfoFileName

TkMap_script_phase1.detIdInfoFileName

Definition at line 233 of file TkMap_script_phase1.py.

◆ File_Name

TkMap_script_phase1.File_Name

Definition at line 177 of file TkMap_script_phase1.py.

◆ File_Name_online

TkMap_script_phase1.File_Name_online

Definition at line 180 of file TkMap_script_phase1.py.

◆ File_Name_PCL

TkMap_script_phase1.File_Name_PCL

Definition at line 179 of file TkMap_script_phase1.py.

◆ filepath

TkMap_script_phase1.filepath

Definition at line 176 of file TkMap_script_phase1.py.

◆ full_pixelfile_name

TkMap_script_phase1.full_pixelfile_name

Definition at line 383 of file TkMap_script_phase1.py.

◆ full_stripfile_name

TkMap_script_phase1.full_stripfile_name

Definition at line 359 of file TkMap_script_phase1.py.

◆ globalTag

TkMap_script_phase1.globalTag

Getting GT############## After switch production to 10_X_X release, the clean up section need to be reviewed and modified ##########.

Definition at line 226 of file TkMap_script_phase1.py.

◆ input_var

TkMap_script_phase1.input_var

Definition at line 199 of file TkMap_script_phase1.py.

◆ nnnOut

TkMap_script_phase1.nnnOut

Downloading DQM file############################.

Definition at line 174 of file TkMap_script_phase1.py.

◆ output

TkMap_script_phase1.output

put color legend in the TrackerMap###################

Copying the template html file to index.html########################

Definition at line 265 of file TkMap_script_phase1.py.

◆ pixel_files

TkMap_script_phase1.pixel_files

Start making pixel maps#####################.

copy ouput files##########

Definition at line 381 of file TkMap_script_phase1.py.

◆ pixelTreeFileName

TkMap_script_phase1.pixelTreeFileName

Definition at line 395 of file TkMap_script_phase1.py.

◆ rereco

TkMap_script_phase1.rereco

Check if user enter the right run type######################.

Definition at line 159 of file TkMap_script_phase1.py.

◆ Run_Number

TkMap_script_phase1.Run_Number

Definition at line 157 of file TkMap_script_phase1.py.

◆ Run_type

TkMap_script_phase1.Run_type

Definition at line 156 of file TkMap_script_phase1.py.

◆ runDirval

TkMap_script_phase1.runDirval

Definition at line 182 of file TkMap_script_phase1.py.

◆ sefile

TkMap_script_phase1.sefile

rename bad module list file######################

Definition at line 242 of file TkMap_script_phase1.py.

◆ shell

TkMap_script_phase1.shell

Definition at line 192 of file TkMap_script_phase1.py.

◆ strip_files

TkMap_script_phase1.strip_files

create merged list of BadComponent from (PCL, RunInfo and FED Errors) ignore for now

counting dead pixel####################### Counting Dead ROCs and Inefficient DC during the run######################### Merge Dead ROCs and Occupoancy Plot ################### Merge PCL and DQM Plot (only StreamExpress) ################### copy ouput files###################

Definition at line 357 of file TkMap_script_phase1.py.

◆ workPath

TkMap_script_phase1.workPath

Definition at line 234 of file TkMap_script_phase1.py.