11patcharea=
'/afs/cern.ch/user/l/larcomm/w0/digitMon/LArCAF'
12setupScript=
'/afs/cern.ch/atlas/tzero/software/setup/setuptrf.sh'
13specialT0Setup=
'/afs/cern.ch/atlas/tzero/software/setup/specialsetup_tier0.sh'
14trfsetuppath=
'/afs/cern.ch/atlas/tzero/software/setup/'
17processConfigs[
'noisebursts'] = {
18 'inputs': {
'inputESDFile': {} },
19 'outputs': {
'outputNTUP_LARNOISEFile': {
'dstype':
'NTUP_LARNOISE'}, },
20 'tasktransinfo': {
'trfpath':
'LArNoiseBursts_tf.py',
21 'trfsetupcmd': setupScript+
' '+patcharea+
' RELEASE ' + specialT0Setup},
23 'description':
'Produced LAr noise burst ntuple from ESD files. Uses RELEASE'
26processConfigs[
'noiseburstsmerge'] = {
27 'inputs': {
'inputNTUP_LARNOISEFile': {} },
28 'outputs': {
'outputNTUP_LARNOISE_MRGFile': {
'dstype':
'NTUP_LARNOISE_MRG'}, },
29 'tasktransinfo': {
'trfpath':
'NTUPMerge_tf.py',
30 'trfsetupcmd': setupScript+
' '+patcharea+
' RELEASE ' + specialT0Setup},
32 'description':
'Merge LAr noise burst ntuple files. Uses RELEASE'
36processConfigs[
'reco'] = {
37 'inputs': {
'inputBSFile': {} },
38 'outputs': {
'outputNTUP_SAMPLESMONFile': {
'dstype':
'NTUP_SAMPLESMON'}, },
39 'tasktransinfo': {
'trfpath':
'LArCAF_tf.py',
40 'trfsetupcmd': setupScript+
' '+patcharea+
' RELEASE ' + specialT0Setup},
42 'description':
'Runs LAr Samples monitoring job on LArCells or LArCellsEmpty calibration streams. Uses RELEASE'
46processConfigs[
'merge'] = {
47 'inputs': {
'inputLArFiles': {} },
48 'outputs': {
'outputLArFile': {
'dstype':
'NTUP_SAMPLESMON'}, },
49 'tasktransinfo': {
'trfpath':
'LArMerge_trf.py',
50 'trfsetupcmd': trfsetuppath+
'setuptrf.sh '+patcharea+
' RELEASE '+trfsetuppath+
'specialsetup_tier0.sh' },
52 'description':
'Merges LAr Samples monitoring ntuples. Uses RELEASE'
56processConfigs[
'histmerge'] = {
57 'inputs': {
'inputHistFiles': {
'metatype':
'inputLFNlistDA'} },
58 'outputs': {
'outputLArHistFile': {
'dstype':
'LARHIST'}, },
59 'tasktransinfo': {
'trfpath':
'LArHistMerge_trf.py',
60 'trfsetupcmd': trfsetuppath+
'setuptrf.sh '+patcharea+
' RELEASE '+trfsetuppath+
'specialsetup_tier0.sh' },
62 'description':
'Merges LAr Monitoring Histograms. Uses RELEASE'
70description_var =
'. Used in production from Feb 2015 onwards.'
74if __name__ ==
'__main__':
76 print (
"##############")
77 print (
"Application to create or update AMI tags (for manager only)\n")
79 print (
"UploadAMITag.py <login> <password> create_AMITag <release> <process>")
81 print (
"UploadAMITag.py <login> <password> update_AMITag <release> <process>")
82 print (
"##############")
95 if amiTagTmp.startswith(
"create_"):
97 amiTag=amiTagTmp.replace(
"create_",
"")
98 elif amiTagTmp.startswith(
"update_"):
100 amiTag=amiTagTmp.replace(
"update_",
"")
107 trfsetupcmd = processConfigs[process][
'tasktransinfo'][
'trfsetupcmd'].
replace(
'RELEASE', str(release))
108 trfpath = processConfigs[process][
'tasktransinfo'][
'trfpath']
109 moreInfoDic[
'tasktransinfo'] = {
'trfsetupcmd': trfsetupcmd,
'trfpath': trfpath}
125 from pyAMI.client
import Client
126 amiclient=Client(
'atlas')
134 s[
'tagType']=amiTag[0]
136 s[
'AMIPass']=password
139 c[
'inputs']=str(processConfigs[process][
'inputs'].__str__())
140 c[
'outputs']=str(processConfigs[process][
'outputs'].__str__())
141 c[
'SWReleaseCache']=str(release)
142 if process==
'reco' or process==
'noisebursts':
143 c[
'Geometry']=
'ATLAS-R2-2015-02-00-00'
144 c[
'ConditionsTag']=
'CURRENT'
147 c[
'ConditionsTag']=
'n/a'
148 c[
'phconfig']=str(processConfigs[process][
'phconfig'].__str__())
149 c[
'transformation']=str(moreInfoDic[
'tasktransinfo'][
'trfpath'])
150 c[
'trfsetupcmd']=str(moreInfoDic[
'tasktransinfo'][
'trfsetupcmd'])
151 c[
'moreInfo']=str(moreInfoDic.__str__())
152 c[
'description']=processConfigs[process][
'description'].
replace(
'RELEASE', str(release)) + description_var
159 l.append(k+
"=\""+s[k]+
"\"")
161 l.append(k+
"=\""+c[k]+
"\"")
164 result=amiclient.execute(l)
166 print (
" ================================================ ")
169 print (
"\n\n###############################################")
170 print (
"# Successfully created new tag %s !! :-) #"%amiTag)
171 print (
"###############################################\n\n" )
174 elif doWhat==
"update":
180 l.append(
'separator='+s)
202 result=amiclient.execute(l)
206 print (
"\n\n#####################################################")
207 print (
"# Succesfully updated existing tag %s !!! :-) #"%amiTag)
208 print (
"#####################################################\n\n" )
211 raise SyntaxError(
"Don't know what to do... amiTagTmp='%s' doWhat='%s'"%(amiTagTmp,doWhat))
213 print (
"To see the corresponding command, do:")
214 print (
"GetCommand.py AMI=%s \n"%amiTag)
216 print (
"http://ami.in2p3.fr/AMI/servlet/net.hep.atlas.Database.Bookkeeping.AMI.Servlet.Command?linkId=501")
std::string replace(std::string s, const std::string &s2, const std::string &s3)