CMS 3D CMS Logo

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

Functions

def allNorms
 Norm/Correction/version DML API # # Author: Zhen Xie #. More...
 
def createNorm
 
def demoteNormFromTypeDefault
 
def exportNormValue
 copy/export/import More...
 
def insertValueToNormId
 
def normIdByName
 
def normIdByType
 
def normInfoByName
 
def normValueById
 
def promoteNormToTypeDefault
 

Function Documentation

def normDML.allNorms (   schema)

Norm/Correction/version DML API # # Author: Zhen Xie #.

list all lumi norms
select DATA_ID,ENTRY_NAME,LUMITYPE,ISTYPEDEFAULT,COMMENT,CTIME FROM LUMINORMSV2
output:
{normname:[data_id,lumitype,istypedefault,comment,creationtime]}

Definition at line 13 of file normDML.py.

def normDML.createNorm (   schema,
  normname,
  lumitype,
  istypedefault,
  branchinfo,
  comment = '' 
)
branchinfo(normrevisionid,branchname)    

Definition at line 223 of file normDML.py.

def normDML.demoteNormFromTypeDefault (   schema,
  normname,
  lumitype 
)
demote norm from typedefault to non default

Definition at line 244 of file normDML.py.

def normDML.exportNormValue (   schema,
  sourcenormname,
  destnormname,
  firstsince = None,
  lastsince = None 
)

copy/export/import

copy specified piece of source norm to dest
input:
   time boundary [firstsince, lastsince]
   if None: open 

Definition at line 339 of file normDML.py.

def normDML.insertValueToNormId (   schema,
  normdataid,
  sincerun,
  corrector,
  amodetag,
  egev,
  parameters,
  comment = '' 
)
insert into LUMINORMSV2DATA(DATA_ID,SINCERUN,CORRECTOR,...) values(normdataid,)sincerun,corrector,...);
require len(parameters)>=1.
input:
  parameterDict {'NORM_OCC1':normocc1,'NORM_OCC2':normocc2,'NORM_ET':normet,'NORM_PU':normpu,'DRIFT':drift,'A1':a1,...}
output:

Definition at line 298 of file normDML.py.

def normDML.normIdByName (   schema,
  normname 
)
select max(DATA_ID) FROM LUMINORMSV2 WHERE ENTRY_NAME=:normname

Definition at line 60 of file normDML.py.

def normDML.normIdByType (   schema,
  lumitype = 'HF',
  defaultonly = True 
)
select max(DATA_ID) FROM LUMINORMSV2 WHERE LUMITYPE=:lumitype
output:
    luminormidmap {normname:normid}

Definition at line 92 of file normDML.py.

def normDML.normInfoByName (   schema,
  normname 
)
select DATA_ID,LUMITYPE,ISTYPEDEFAULT,COMMENT,TO_CHAR(CTIME,\'MM/DD/YY HH24:MI\') FROM LUMINORMS WHERE ENTRY_NAME=:normname
output:
    [data_id[0],lumitype[1],istypedefault[2],comment[3],creationtime[4]]

Definition at line 133 of file normDML.py.

def normDML.normValueById (   schema,
  normid 
)
select * from luminormsv2data where data_id=normid
output:
    {since:[corrector(0),{paramname:paramvalue}(1),amodetag(2),egev(3),comment(4)]}

Definition at line 181 of file normDML.py.

def normDML.promoteNormToTypeDefault (   schema,
  normname,
  lumitype 
)
set the named norm as default for a given type,reset the old default if any
thisnormid=normIdByName(schema,normname)
olddefaultid=normIdByType(schema,lumitype=lumitype,defaultonly=True)
if thisnormid:
    update LUMINORMSV2 set ISTYPEDEFAULT=1 where DATA_ID=:thisnormid
else:
    raise ValueError('normname does not exist, nothing to update')
if olddefaultid and olddefaultid!=thisnormid:
    update LUMINORMSV2 set ISTYPEDEFAULT=0 where DATA_ID=:olddefaultid

Definition at line 264 of file normDML.py.