CMS 3D CMS Logo

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

Functions

def get_all
 
def get_single
 
def main
 
def qstring
 
def query
 

Variables

list rf = sys.argv[1]
 
list rt = sys.argv[2]
 
string SQL
 
string TIME = "select to_char(p.time,'YYYY-MM-DD HH24:MI:SS') time from hcal.run_parameters p where p.name like '%TRIGGERS'"
 
string URL = "http://vocms00169:2113"
 

Function Documentation

def hcal_runs.get_all (   q,
  qs 
)

Definition at line 39 of file hcal_runs.py.

References DeadROC_duringRun.dir, and qstring().

Referenced by main().

39 
40 def get_all(q, qs):
41  qid = query(q)
42  ps = qstring(qs)
43  u = "%s/query/%s/count?%s" % (URL, qid, ps)
44  resp = urllib2.urlopen(u)
45  if "getcode" in dir(resp) and resp.getcode() == 200:
46  data = []
47  c = int(resp.read())
48  p = 1
49  while c > 0:
50  u = "%s/query/%s/page/1000/%d/data?%s" % (URL, qid, p, ps)
51  resp = urllib2.urlopen(u)
52  if "getcode" in dir(resp) and resp.getcode() == 200:
53  j = json.loads(resp.read())
54  data.extend(j["data"])
55  p += 1
56  c -= 1000
57  return data
58  return None
def get_all
Definition: hcal_runs.py:39
Definition: query.py:1
def qstring
Definition: hcal_runs.py:26
def hcal_runs.get_single (   q,
  qs 
)

Definition at line 33 of file hcal_runs.py.

References DeadROC_duringRun.dir, and qstring().

Referenced by main().

33 
34 def get_single(q, qs):
35  resp = urllib2.urlopen("%s/query/%s/data?%s" % (URL, query(q), qstring(qs)))
36  if "getcode" in dir(resp) and resp.getcode() == 200:
37  return json.loads(resp.read())["data"][0][0]
38  return None
def get_single
Definition: hcal_runs.py:33
Definition: query.py:1
def qstring
Definition: hcal_runs.py:26
def hcal_runs.main (   rf,
  rt 
)

Definition at line 59 of file hcal_runs.py.

References get_all(), and get_single().

59 
60 def main(rf, rt):
61  ps = {}
62  if rf != None: ps["rf"] = rf
63  if rt != None: ps["rt"] = rt
64  data = get_all(SQL, ps)
65  for r in data:
66  if r[3] != None:
67  for t in ["pedestal","LED","laser"]:
68  if re.search(t, r[3], flags=re.IGNORECASE) != None:
69  d = get_single(TIME, { "p.run": int(r[0])})
70  print r[0], t, "\"" + d + "\"", r[2]
71  break
72 
def get_all
Definition: hcal_runs.py:39
def get_single
Definition: hcal_runs.py:33
def main
Definition: hcal_runs.py:59
def hcal_runs.qstring (   qstring)

Definition at line 26 of file hcal_runs.py.

Referenced by get_all(), and get_single().

26 
27 def qstring(qstring):
28  ps = ""
29  for k in qstring.keys():
30  ps += "&" if ps != "" else ""
31  ps += "%s=%s" % (k, qstring[k])
32  return ps
def qstring
Definition: hcal_runs.py:26
def hcal_runs.query (   query)

Definition at line 21 of file hcal_runs.py.

References DeadROC_duringRun.dir.

21 
22 def query(query):
23  resp = urllib2.urlopen(URL + "/query", query)
24  if "getcode" in dir(resp) and resp.getcode() == 200:
25  return resp.read()
def query
Definition: hcal_runs.py:21

Variable Documentation

tuple hcal_runs.rf = sys.argv[1]

Definition at line 75 of file hcal_runs.py.

Referenced by magneticfield::MagGeoBuilder.buildInterpolator(), MagGeoBuilderFromDDD.buildInterpolator(), StraightTrackAlignment.finish(), HGCalMouseBite.HGCalMouseBite(), and CTPPSRPAlignmentCorrectionsMethods.writeToXML().

tuple hcal_runs.rt = sys.argv[2]

Definition at line 76 of file hcal_runs.py.

Referenced by AlignableModifier.addAlignmentPositionErrorLocal(), ValidationMisalignedTracker.analyze(), MuonTrackValidator.analyze(), TrackGenAssociatorByChi2Impl.associateGenToReco(), TrackGenAssociatorByChi2Impl.associateRecoToGen(), TrackAssociatorByChi2Impl.associateRecoToSim(), TwoBodyDecayModel.convertCurvilinearToCartesian(), MultiTrackValidatorGenPs.dqmAnalyze(), MultiTrackValidator.dqmAnalyze(), MuonGeometryArrange.fillTree(), TrackerGeometryCompare.fillTree(), LMFDefFabric.getRunTag(), LMFDefFabric.getRunTagFromID(), LMFRunIOV.getTriggerType(), ApeSettingAlgorithm.initialize(), initializeRates(), L1RPCConeDefinitionProducer.L1RPCConeDefinitionProducer(), LinTrackCache.linTrack(), CaloGeometryDBEP< T, U >.produceAligned(), DTSurvey.ReadChambers(), PPSPixelTopology.setRunType(), ApeSettingAlgorithm.terminate(), and TrimmedVertexFitter.vertex().

string hcal_runs.SQL
Initial value:
1 = "select \
2  r.RUNNUMBER,\
3  r.START_TIME,\
4  r.RUN_TRIGGERS,\
5  r.RUN_TYPE\
6  from \
7  hcal.runs r \
8  where \
9  r.RUN_GLOBAL = 0 and \
10  (r.runnumber >= :rf or :rf = 0) and \
11  (r.runnumber <= :rt or :rt = 0) \
12  order by \
13  r.runnumber"

Definition at line 5 of file hcal_runs.py.

string hcal_runs.TIME = "select to_char(p.time,'YYYY-MM-DD HH24:MI:SS') time from hcal.run_parameters p where p.name like '%TRIGGERS'"

Definition at line 19 of file hcal_runs.py.

Referenced by GlobalDigisHistogrammer.analyze().

string hcal_runs.URL = "http://vocms00169:2113"

Definition at line 4 of file hcal_runs.py.

Referenced by edm::storage::XrdStorageMaker.check(), XrdAdaptor::Source.getXrootdSiteFromURL(), XrdAdaptor::Source.isDCachePool(), and edm::storage::XrdStorageMaker.stagein().