5 from __future__
import print_function
12 patcharea=
'/afs/cern.ch/user/l/larcomm/w0/digitMon/LArCAF'
13 setupScript=
'/afs/cern.ch/atlas/tzero/software/setup/setuptrf.sh'
14 specialT0Setup=
'/afs/cern.ch/atlas/tzero/software/setup/specialsetup_tier0.sh'
15 trfsetuppath=
'/afs/cern.ch/atlas/tzero/software/setup/'
18 processConfigs[
'noisebursts'] = {
19 'inputs': {
'inputESDFile': {} },
20 'outputs': {
'outputNTUP_LARNOISEFile': {
'dstype':
'NTUP_LARNOISE'}, },
21 'tasktransinfo': {
'trfpath':
'LArNoiseBursts_tf.py',
22 'trfsetupcmd': setupScript+
' '+patcharea+
' RELEASE ' + specialT0Setup},
24 'description':
'Produced LAr noise burst ntuple from ESD files. Uses RELEASE'
27 processConfigs[
'noiseburstsmerge'] = {
28 'inputs': {
'inputNTUP_LARNOISEFile': {} },
29 'outputs': {
'outputNTUP_LARNOISE_MRGFile': {
'dstype':
'NTUP_LARNOISE_MRG'}, },
30 'tasktransinfo': {
'trfpath':
'NTUPMerge_tf.py',
31 'trfsetupcmd': setupScript+
' '+patcharea+
' RELEASE ' + specialT0Setup},
33 'description':
'Merge LAr noise burst ntuple files. Uses RELEASE'
37 processConfigs[
'reco'] = {
38 'inputs': {
'inputBSFile': {} },
39 'outputs': {
'outputNTUP_SAMPLESMONFile': {
'dstype':
'NTUP_SAMPLESMON'}, },
40 'tasktransinfo': {
'trfpath':
'LArCAF_tf.py',
41 'trfsetupcmd': setupScript+
' '+patcharea+
' RELEASE ' + specialT0Setup},
43 'description':
'Runs LAr Samples monitoring job on LArCells or LArCellsEmpty calibration streams. Uses RELEASE'
47 processConfigs[
'merge'] = {
48 'inputs': {
'inputLArFiles': {} },
49 'outputs': {
'outputLArFile': {
'dstype':
'NTUP_SAMPLESMON'}, },
50 'tasktransinfo': {
'trfpath':
'LArMerge_trf.py',
51 'trfsetupcmd': trfsetuppath+
'setuptrf.sh '+patcharea+
' RELEASE '+trfsetuppath+
'specialsetup_tier0.sh' },
53 'description':
'Merges LAr Samples monitoring ntuples. Uses RELEASE'
57 processConfigs[
'histmerge'] = {
58 'inputs': {
'inputHistFiles': {
'metatype':
'inputLFNlistDA'} },
59 'outputs': {
'outputLArHistFile': {
'dstype':
'LARHIST'}, },
60 'tasktransinfo': {
'trfpath':
'LArHistMerge_trf.py',
61 'trfsetupcmd': trfsetuppath+
'setuptrf.sh '+patcharea+
' RELEASE '+trfsetuppath+
'specialsetup_tier0.sh' },
63 'description':
'Merges LAr Monitoring Histograms. Uses RELEASE'
71 description_var =
'. Used in production from Feb 2015 onwards.'
75 if __name__ ==
'__main__':
77 print (
"##############")
78 print (
"Application to create or update AMI tags (for manager only)\n")
80 print (
"UploadAMITag.py <login> <password> create_AMITag <release> <process>")
82 print (
"UploadAMITag.py <login> <password> update_AMITag <release> <process>")
83 print (
"##############")
96 if amiTagTmp.startswith(
"create_"):
98 amiTag=amiTagTmp.replace(
"create_",
"")
99 elif amiTagTmp.startswith(
"update_"):
101 amiTag=amiTagTmp.replace(
"update_",
"")
108 trfsetupcmd = processConfigs[process][
'tasktransinfo'][
'trfsetupcmd'].
replace(
'RELEASE',
str(release))
109 trfpath = processConfigs[process][
'tasktransinfo'][
'trfpath']
110 moreInfoDic[
'tasktransinfo'] = {
'trfsetupcmd': trfsetupcmd,
'trfpath': trfpath}
126 from pyAMI.client
import Client
135 s[
'tagType']=amiTag[0]
137 s[
'AMIPass']=password
140 c[
'inputs']=
str(processConfigs[process][
'inputs'].__str__())
141 c[
'outputs']=
str(processConfigs[process][
'outputs'].__str__())
142 c[
'SWReleaseCache']=
str(release)
143 if process==
'reco' or process==
'noisebursts':
144 c[
'Geometry']=
'ATLAS-R2-2015-02-00-00'
145 c[
'ConditionsTag']=
'CURRENT'
148 c[
'ConditionsTag']=
'n/a'
149 c[
'phconfig']=
str(processConfigs[process][
'phconfig'].__str__())
150 c[
'transformation']=
str(moreInfoDic[
'tasktransinfo'][
'trfpath'])
151 c[
'trfsetupcmd']=
str(moreInfoDic[
'tasktransinfo'][
'trfsetupcmd'])
152 c[
'moreInfo']=
str(moreInfoDic.__str__())
153 c[
'description']=processConfigs[process][
'description'].
replace(
'RELEASE',
str(release)) + description_var
160 l.append(k+
"=\""+s[k]+
"\"")
162 l.append(k+
"=\""+c[k]+
"\"")
165 result=amiclient.execute(l)
167 print (
" ================================================ ")
170 print (
"\n\n###############################################")
171 print (
"# Successfully created new tag %s !! :-) #"%amiTag)
172 print (
"###############################################\n\n" )
175 elif doWhat==
"update":
181 l.append(
'separator='+s)
203 result=amiclient.execute(l)
207 print (
"\n\n#####################################################")
208 print (
"# Succesfully updated existing tag %s !!! :-) #"%amiTag)
209 print (
"#####################################################\n\n" )
212 raise SyntaxError(
"Don't know what to do... amiTagTmp='%s' doWhat='%s'"%(amiTagTmp,doWhat))
214 print (
"To see the corresponding command, do:")
215 print (
"GetCommand.py AMI=%s \n"%amiTag)
217 print (
"http://ami.in2p3.fr/AMI/servlet/net.hep.atlas.Database.Bookkeeping.AMI.Servlet.Command?linkId=501")