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 92 of file TkMap_script_phase1.py.

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

92 def downloadnlineDQMhisto(run, Run_type):
93  runDirval=setRunDirectory(run)
94  DataLocalDir=runDirval[0]
95  DataOfflineDir=runDirval[1]
96  nnn=run/100
97  nnnOnline = run/10000
98  File_Name_online=''
99  deadRocMap = False
100 
101  url1 = 'https://cmsweb.cern.ch/dqm/online/data/browse/Original/000'+str(nnnOnline)+'xxxx/000'+str(nnn)+'xx/'
102  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")
103 
104  url2 = 'https://cmsweb.cern.ch/dqm/offline/data/browse/ROOT/OnlineData/original/000'+str(nnnOnline)+'xxxx/000'+str(nnn)+'xx/'
105  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")
106  f_online_backup=codecs.open("index_online_backup.html", 'r') index_online_backup = f_online_backup.readlines()
107 
108  f_online=codecs.open("index_online.html", 'r')
109  index_online = f_online.readlines()
110  if any(str(run) in x for x in index_online):
111  for x in index_online:
112  if (str(run) in x) and ("_PixelPhase1_" in x):
113  File_Name_online=str(str(x).split(".root'>")[1].split("</a></td><td>")[0])
114  deadRocMap = True
115  else:
116  print("Can't find any file in offline server, trying the online server")
117  if any(str(run) in y for y in index_online_backup):
118  for y in index_online:
119  if (str(run) in y) and ("_PixelPhase1_" in y):
120  File_Name_online=str(str(y).split(".root'>")[1].split("</a></td><td>")[0])
121  deadRocMap = True
122  else:
123  print('No Online DQM file available. Skip dead roc map')
124  deadRocMap = False
125 
126  print('Downloading DQM file:'+File_Name_online)
127 
128 
129  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)
130 
131  os.remove('index_online.html')
132  os.remove('index_online_backup.html')
133  return deadRocMap, File_Name_online;
134 
135 
136 
bool any(const std::vector< T > &v, const T &what)
Definition: ECalSD.cc:37
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 36 of file TkMap_script_phase1.py.

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

36 def downloadOfflineDQMhisto(run, Run_type,rereco):
37  runDirval=setRunDirectory(run)
38  DataLocalDir=runDirval[0]
39  DataOfflineDir=runDirval[1]
40  nnn=run/100
41  print('Processing '+ Run_type + ' in '+DataOfflineDir+"...")
42  File_Name = ''
43  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/')
44  url = 'https://cmsweb.cern.ch/dqm/offline/data/browse/ROOT/OfflineData/'+DataOfflineDir+'/'+Run_type+'/000'+str(nnn)+'xx/'
45  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")
46  f=codecs.open("index.html", 'r')
47  index = f.readlines()
48  if any(str(Run_Number[i]) in s for s in index):
49  for s in index:
50  if rereco:
51  if (str(Run_Number[i]) in s) and ("__DQMIO.root" in s) and ("17Sep2018" in s):
52  File_Name = str(str(s).split("xx/")[1].split("'>DQM")[0])
53  else:
54  if (str(Run_Number[i]) in s) and ("__DQMIO.root" in s):
55  File_Name = str(str(s).split("xx/")[1].split("'>DQM")[0])
56 
57  else:
58  print('No DQM file available. Please check the Offline server')
59  sys.exit(0)
60 
61  print('Downloading DQM file:'+File_Name)
62  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)
63 
64  return File_Name
65 
bool any(const std::vector< T > &v, const T &what)
Definition: ECalSD.cc:37
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 66 of file TkMap_script_phase1.py.

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

66 def downloadOfflinePCLhisto(run, Run_type):
67  runDirval=setRunDirectory(run)
68  DataLocalDir=runDirval[0]
69  DataOfflineDir=runDirval[1]
70  nnn=run/100
71  print('Processing '+ Run_type + ' in '+DataOfflineDir+"...")
72  File_Name = 'Temp'
73  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/')
74  url = 'https://cmsweb.cern.ch/dqm/offline/data/browse/ROOT/OfflineData/'+DataOfflineDir+'/'+Run_type+'/000'+str(nnn)+'xx/'
75  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")
76  f=codecs.open("index.html", 'r')
77  index = f.readlines()
78  if any(str(Run_Number[i]) in s for s in index):
79  for s in index:
80  if (str(Run_Number[i]) in s) and ("PromptCalibProdSiPixel-Express" in s) and ("__ALCAPROMPT.root" in s):
81  File_Name = str(str(s).split("xx/")[1].split("'>DQM")[0])
82  else:
83  print('No DQM file available. Please check the Offline server')
84  sys.exit(0)
85  if File_Name!='Temp':
86  print('Downloading DQM file:'+File_Name)
87  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)
88 
89  return File_Name
90 
91 
bool any(const std::vector< T > &v, const T &what)
Definition: ECalSD.cc:37
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 137 of file TkMap_script_phase1.py.

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

Referenced by downloadnlineDQMhisto().

137 def getGT(DQMfile, RunNumber, globalTagVar):
138  globalTag_v0 = getGTfromDQMFile(DQMfile, RunNumber, globalTagVar)
139  print("Global Tag: " + globalTag_v0)
140  globalTag = globalTag_v0
141 
142  for z in range(len(globalTag_v0)-2):#clean up the garbage string in the GT
143  if (globalTag_v0[z].isdigit()) and (globalTag_v0[z+1].isdigit()) and (globalTag_v0[z+2].isdigit()) and(globalTag_v0[z+3].isupper()):
144  globalTag = globalTag_v0[z:]
145  break
146  if globalTag == "":
147  print(" No GlobalTag found: trying from DAS.... ")
148  globalTag = str(os.popen('getGTscript.sh '+filepath+ File_Name+' ' +str(Run_Number[i])));
149  if globalTag == "":
150  print(" No GlobalTag found for run: "+str(Run_Number[i]))
151 
152  return globalTag
153 
154 
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 15 of file TkMap_script_phase1.py.

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

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

Variable Documentation

◆ check_command

TkMap_script_phase1.check_command

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

Definition at line 190 of file TkMap_script_phase1.py.

◆ Check_output

TkMap_script_phase1.Check_output

Definition at line 191 of file TkMap_script_phase1.py.

◆ checkfolder

TkMap_script_phase1.checkfolder

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

Definition at line 216 of file TkMap_script_phase1.py.

◆ CMSSW_BASE

◆ DataLocalDir

TkMap_script_phase1.DataLocalDir

Definition at line 182 of file TkMap_script_phase1.py.

◆ deadRocMap

TkMap_script_phase1.deadRocMap

Definition at line 179 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 296 of file TkMap_script_phase1.py.

◆ detIdInfoFileName

TkMap_script_phase1.detIdInfoFileName

Definition at line 232 of file TkMap_script_phase1.py.

◆ File_Name

TkMap_script_phase1.File_Name

Definition at line 176 of file TkMap_script_phase1.py.

◆ File_Name_online

TkMap_script_phase1.File_Name_online

Definition at line 179 of file TkMap_script_phase1.py.

◆ File_Name_PCL

TkMap_script_phase1.File_Name_PCL

Definition at line 178 of file TkMap_script_phase1.py.

◆ filepath

TkMap_script_phase1.filepath

Definition at line 175 of file TkMap_script_phase1.py.

◆ full_pixelfile_name

TkMap_script_phase1.full_pixelfile_name

Definition at line 382 of file TkMap_script_phase1.py.

◆ full_stripfile_name

TkMap_script_phase1.full_stripfile_name

Definition at line 358 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 225 of file TkMap_script_phase1.py.

◆ input_var

TkMap_script_phase1.input_var

Definition at line 198 of file TkMap_script_phase1.py.

◆ nnnOut

TkMap_script_phase1.nnnOut

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

Definition at line 173 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 264 of file TkMap_script_phase1.py.

◆ pixel_files

TkMap_script_phase1.pixel_files

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

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

Definition at line 380 of file TkMap_script_phase1.py.

◆ pixelTreeFileName

TkMap_script_phase1.pixelTreeFileName

Definition at line 394 of file TkMap_script_phase1.py.

◆ rereco

TkMap_script_phase1.rereco

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

Definition at line 158 of file TkMap_script_phase1.py.

◆ Run_Number

TkMap_script_phase1.Run_Number

Definition at line 156 of file TkMap_script_phase1.py.

◆ Run_type

TkMap_script_phase1.Run_type

Definition at line 155 of file TkMap_script_phase1.py.

◆ runDirval

TkMap_script_phase1.runDirval

Definition at line 181 of file TkMap_script_phase1.py.

◆ sefile

TkMap_script_phase1.sefile

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

Definition at line 241 of file TkMap_script_phase1.py.

◆ shell

TkMap_script_phase1.shell

Definition at line 191 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 356 of file TkMap_script_phase1.py.

◆ workPath

TkMap_script_phase1.workPath

Definition at line 233 of file TkMap_script_phase1.py.