Difference: MCTCK (1 vs. 11)

Revision 112018-09-11 - RosenMatev

Line: 1 to 1
 
META TOPICPARENT name="LHCbTCK"
Changed:
<
<

Making a MC version of a TCK

>
>

Making a MC version of an existing data TCK

 
Changed:
<
<
To make an MC TCK from a pre-existing data TCK, Setup the latest version of Moore (independent of the version corresponding to the TCK you want to make an MC TCK for)

SetupProject Moore vXXX --build-env

Then check out the head of HltTCK:

>
>
First, check out the head of HltTCK, and then run iTCKsh from the prod (or latest) version of Moore (independent of the version corresponding to the TCK you want to make an MC TCK for)
 
getpack TCK/HltTCK head
Changed:
<
<
cd TCK/HltTCK/cmt cmt make
>
>
lb-run Moore iTCKsh --write TCK/HltTCK/config.cdb
 
Changed:
<
<
Then setup this Moore version:
>
>
In TCKsh import the createMCversion module and feed it your data TCK:
 
Changed:
<
<
SetupProject Moore vXXX
>
>
from TCKUtils.createMCversion import createMCversion createMCversion(tck=0x11641724, cas=default_cas)
 
Changed:
<
<
And run TCKsh. In TCKsh import the createMCversion module and feed it your data TCK:
>
>
You'll see it dump the new TCK as well as a diff of the old with the new. If everything worked, the only differences will be AcceptFractions from the prescalers being set to 1 instead of prescaled as in data.
 
Added:
>
>
Check that your new MC TCK appears under the right version of Moore with
 
Changed:
<
<
from TCKUtils.createMCversion import * tck=0x00XXXXXX cas=ConfigCDBAccessSvc(Mode='ReadWrite') createMCversion(tck=tck,cas=cas)
>
>
listConfigurations()
 
Changed:
<
<
You'll see it dump the new TCK as well as a diff of the old with the new. If everything worked, the only differences will be AcceptFractions from the prescalers being set to 1 instead of prescaled as in data. If you then do a listConfigurations() your new MC TCK should appear under the right version of Moore.

Edit the release notes of TCK/HltTCK to reflect the addition of a new MC TCK, then commit:

svn commit -m "added new TCK 0x40XXXXX for whatever reason"

You can now tag the package: Edit the doc/release notes and cmt/requirements with the new package version (increment the revision number) Then:

tag_package TCK/HltTCK vXrYY
>
>

Releasing the MC TCK

 
Added:
>
>
Copy the config.cdb file somewhere and ask Rosen to commit and release it.
 
Changed:
<
<
Once that is done, you need to add it to Appconfig:
>
>
Once that is done, you need to add it to AppConfig:
 
Changed:
<
<
getpack AppConfig head
>
>
git lb-clone-pkg AppConfig
 cd AppConfig/options/Conditions
Changed:
<
<
Copy one of the existing TCK-*.py files over to your TCK's name:
>
>
Copy one of the existing TCK-*.py files over to your TCK's name:
 
cp TCK-0x40YYYYY.py TCK-0x40XXXXX.py
Line: 67 to 47
 Moore().InitialTCK = '0x40XXXXXX'
Changed:
<
<
Finally, svn add this file, change the release notes and commit:
>
>
Finally, commit your change on a new branch, push it and open a merge request
 
Changed:
<
<
svn add TCK-0x40XXXXXX.py vim ../../doc/release.notes svn commit -m "added new TCK 0x40XXXXX for whatever reason"
>
>
git checkout -b add-MC-TCK git commit TCK-0x40YYYYY.py git push -u origin add-MC-TCK
 
Changed:
<
<
And now you need to put it into a release request for TCK/HltTCK You may potentially need to tag and request release of AppConfig - check with the simulation people first to see if they plan to commit other important updates soon.
>
>
And now you need to put it into a release request for TCK/HltTCK You may potentially need to tag and request release of AppConfig - check with the simulation people first to see if they plan to commit other important updates soon.
  Go here:
Changed:
<
<
https://sft.its.cern.ch/jira/browse/LHCBDEP/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel Login, select Create, change the issue to "task", and specify TCK/HltTCK with the right version number. Not every box needs to be filled in. Once the form is filled out click submit.
>
>
https://its.cern.ch/jira/browse/LHCBDEP/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel Login, select Create, change the issue to "task", and specify TCK/HltTCK with the right version number. Not every box needs to be filled in. Once the form is filled out click submit.
 
Changed:
<
<
Lastly, contact the production people so that they know to release a new Appconfig and you're done.
>
>
Lastly, contact the production people so that they know to release a new AppConfig and you're done.
 

Adding TCKs for Moore v14 or older

The config.cdb files did not exist in v14 or older, so the TCKs need to be in the config.tar file.

Revision 102016-11-21 - RosenMatev

Line: 1 to 1
 
META TOPICPARENT name="LHCbTCK"

Making a MC version of a TCK

Line: 84 to 84
  Lastly, contact the production people so that they know to release a new Appconfig and you're done.
Added:
>
>

Adding TCKs for Moore v14 or older

The config.cdb files did not exist in v14 or older, so the TCKs need to be in the config.tar file. First add the MC TCKs to the config.cdb as usual and then copy them to config.tar following this example:
from TCKUtils.utils import *
from TCKUtils.backend import *

cdb_file = 'config.cdb'
tar_file = 'config.tar'

cdb_cas = ConfigCDBAccessSvc("ConfigAccessSvcSource", File=cdb_file)
tar_cas = ConfigTarFileAccessSvc("ConfigAccessSvcTarget", File=tar_file, Mode='ReadWrite')

copy(source=cdb_cas, target=tar_cas, glob='TCK/0x40a30044')
copy(source=cdb_cas, target=tar_cas, glob='TCK/0x40ac0046')

To check the TCKs were indeed copied, within TCKsh do:

cas = ConfigTarFileAccessSvc(File='config.tar')
listConfigurations(cas=cas)

 --Main.WilliamBarter - 2016-10-05 \ No newline at end of file

Revision 92016-11-01 - MarkWhitehead

Line: 1 to 1
 
META TOPICPARENT name="LHCbTCK"

Making a MC version of a TCK

Changed:
<
<
To make an MC TCK from a pre-existing data TCK, Setup the version of Moore corresponding to the TCK you want to make an MC TCK for:
>
>
To make an MC TCK from a pre-existing data TCK, Setup the latest version of Moore (independent of the version corresponding to the TCK you want to make an MC TCK for)
 
SetupProject Moore vXXX --build-env

Revision 82016-10-05 - WilliamBarter

Line: 1 to 1
 
META TOPICPARENT name="LHCbTCK"

Making a MC version of a TCK

Line: 39 to 39
 svn commit -m "added new TCK 0x40XXXXX for whatever reason"
Added:
>
>
You can now tag the package: Edit the doc/release notes and cmt/requirements with the new package version (increment the revision number) Then:
tag_package TCK/HltTCK vXrYY
 Once that is done, you need to add it to Appconfig:
Line: 67 to 75
 svn commit -m "added new TCK 0x40XXXXX for whatever reason"
Changed:
<
<
You can now tag the package: Edit the doc/release notes and cmt/requirements with the new package version (increment the revision number) Then:
tag_package TCK/HltTCK vXrYY

And now you need to put it into a Savannah release request.

>
>
And now you need to put it into a release request for TCK/HltTCK You may potentially need to tag and request release of AppConfig - check with the simulation people first to see if they plan to commit other important updates soon.
  Go here: https://sft.its.cern.ch/jira/browse/LHCBDEP/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel
Changed:
<
<
Login, select Tasks->Submit, and specify TCK/HltTCK with the right version number. Once the form is filled out click submit.
>
>
Login, select Create, change the issue to "task", and specify TCK/HltTCK with the right version number. Not every box needs to be filled in. Once the form is filled out click submit.
  Lastly, contact the production people so that they know to release a new Appconfig and you're done.
Deleted:
<
<
-- ConorFitzpatrick - 26-Sep-2013
 \ No newline at end of file
Added:
>
>
--Main.WilliamBarter - 2016-10-05

Revision 72015-06-01 - WilliamBarter

Line: 1 to 1
 
META TOPICPARENT name="LHCbTCK"

Making a MC version of a TCK

Line: 27 to 27
 
from TCKUtils.createMCversion import *
tck=0x00XXXXXX
Changed:
<
<
cas=ConfigTarFileAccessSvc(Mode='ReadWrite')
>
>
cas=ConfigCDBAccessSvc(Mode='ReadWrite')
 createMCversion(tck=tck,cas=cas)

Revision 62015-05-22 - WilliamBarter

Line: 1 to 1
 
META TOPICPARENT name="LHCbTCK"

Making a MC version of a TCK

Line: 77 to 77
 And now you need to put it into a Savannah release request.

Go here:

Changed:
<
<
https://savannah.cern.ch/task/?group=lhcbdeployment
>
>
https://sft.its.cern.ch/jira/browse/LHCBDEP/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel
 Login, select Tasks->Submit, and specify TCK/HltTCK with the right version number. Once the form is filled out click submit.

Lastly, contact the production people so that they know to release a new Appconfig and you're done.

Revision 52013-10-03 - ConorFitzpatrick

Line: 1 to 1
 
META TOPICPARENT name="LHCbTCK"

Making a MC version of a TCK

Line: 67 to 67
 svn commit -m "added new TCK 0x40XXXXX for whatever reason"
Changed:
<
<
You can now add TCK/HltTCK to the tagcollector, and contact the production people so that they know to release a new Appconfig.
>
>
You can now tag the package: Edit the doc/release notes and cmt/requirements with the new package version (increment the revision number) Then:
tag_package TCK/HltTCK vXrYY

And now you need to put it into a Savannah release request.

Go here: https://savannah.cern.ch/task/?group=lhcbdeployment Login, select Tasks->Submit, and specify TCK/HltTCK with the right version number. Once the form is filled out click submit.

 
Changed:
<
<
And you're done.
>
>
Lastly, contact the production people so that they know to release a new Appconfig and you're done.
  -- ConorFitzpatrick - 26-Sep-2013

Revision 42013-09-26 - ConorFitzpatrick

Line: 1 to 1
 
META TOPICPARENT name="LHCbTCK"

Making a MC version of a TCK

Changed:
<
<

Using createMCversion

This can be done with the following python script:
def createMCversion( tck, newtck = None, cas = ConfigTarFileAccessSvc() ) :
    if not newtck : newtck = tck | 0x40000000
    props = getProperties(tck,'DeterministicPrescaler/.*','AcceptFraction')
    exceptions = { 'LumiStripper.*'     : '0',
         '.*Debug.*'          : None,
         'Hlt1ODINTechnical.*': None,
         'Hlt1Lumi.*'         : None,
         'Hlt1L0.*'           : None,
         'Hlt1MBMicroBias.*'  : None }
    update = { } 
    for n,v in props.iteritems() :
       v = v['AcceptFraction']
       if v == '1' or v == '0' : continue # do not modify these
       vorig = v
       m = 0  # count # of matching exceptions
       for (e,o) in exceptions.iteritems() :
          import re
          if re.match(e,n) : 
             if o : v = o
             m = m+1
       if m == 0 : v = '1'   # if no exception, put at 1
       if vorig == v : continue  # if not 
       update[ n ] = { 'AcceptFraction' : '%s'%v }
    from pprint import pprint
    print "==================> dump update <===================="
    pprint(update)
    label = None
    for (i,j) in getConfigurations(cas).iteritems() :
       if tck in j['TCK'] : label = j['label']
    id  = updateProperties( resolveTCK(tck,cas),update,label='%s - MC version of 0x%08x' % (label,tck), cas=cas)
    createTCKEntries({newtck:id},cas)


    print "==================> diff data / MC TCK <===================="
    diff (tck, newtck)


##
## main
##

if __name__ == "__main__":

    dataTCK = 0x760037
    print "Create MC TCK for TCK %x" % (dataTCK)
    #listHlt1Lines(dataTCK)
    createMCversion( tck = dataTCK, cas=ConfigTarFileAccessSvc(Mode='ReadWrite',CompressOnWrite=True) )

To do it, Setup the version of Moore corresponding to the TCK you want to make an MC TCK for:

>
>
To make an MC TCK from a pre-existing data TCK, Setup the version of Moore corresponding to the TCK you want to make an MC TCK for:
 
SetupProject Moore vXXX --build-env
Line: 74 to 22
 SetupProject Moore vXXX
Changed:
<
<
Copy the script at the top of this document to somewhere and change "dataTCK =" so that it points to the TCK you want to make an MC tck for. Now run it in TCKsh:
>
>
And run TCKsh. In TCKsh import the createMCversion module and feed it your data TCK:
 
Changed:
<
<
TCKsh >>> execfile('createMC.py')
>
>
from TCKUtils.createMCversion import * tck=0x00XXXXXX cas=ConfigTarFileAccessSvc(Mode='ReadWrite') createMCversion(tck=tck,cas=cas)
 
Deleted:
<
<
This method is good if you want to run your own createMCversion.py file (because you made changes to it). To run createMCversion.py from TCKUtils, see below.
 You'll see it dump the new TCK as well as a diff of the old with the new. If everything worked, the only differences will be AcceptFractions from the prescalers being set to 1 instead of prescaled as in data. If you then do a listConfigurations() your new MC TCK should appear under the right version of Moore.

Edit the release notes of TCK/HltTCK to reflect the addition of a new MC TCK, then commit:

Changed:
<
<
svn commit -m "added new TCK XXXXXXXXX for whatever reason"
>
>
svn commit -m "added new TCK 0x40XXXXX for whatever reason"
 

Once that is done, you need to add it to Appconfig:

Line: 116 to 64
 
svn add TCK-0x40XXXXXX.py
vim ../../doc/release.notes
Changed:
<
<
svn commit -m "added new TCK XXXXXXXXX for whatever reason"
>
>
svn commit -m "added new TCK 0x40XXXXX for whatever reason"
 

You can now add TCK/HltTCK to the tagcollector, and contact the production people so that they know to release a new Appconfig.

And you're done.

Deleted:
<
<

Using createMCversion from TCKUtils

In TCKsh type:
from TCKUtils.createMCversion import *
tck='0x00520033'
cas=ConfigTarFileAccessSvc(Mode='ReadWrite)
createMCversion(tck=tck,cas=cas)

-- ConorFitzpatrick - 23-Jul-2013

 \ No newline at end of file
Added:
>
>
-- ConorFitzpatrick - 26-Sep-2013

Revision 32013-08-19 - EricvanHerwijnen

Line: 1 to 1
 
META TOPICPARENT name="LHCbTCK"

Making a MC version of a TCK

Added:
>
>

Using createMCversion

 This can be done with the following python script:
def createMCversion( tck, newtck = None, cas = ConfigTarFileAccessSvc() ) :
Line: 80 to 81
 >>> execfile('createMC.py')
Added:
>
>
This method is good if you want to run your own createMCversion.py file (because you made changes to it). To run createMCversion.py from TCKUtils, see below.
 You'll see it dump the new TCK as well as a diff of the old with the new. If everything worked, the only differences will be AcceptFractions from the prescalers being set to 1 instead of prescaled as in data. If you then do a listConfigurations() your new MC TCK should appear under the right version of Moore.

Edit the release notes of TCK/HltTCK to reflect the addition of a new MC TCK, then commit:

Line: 120 to 123
  And you're done.
Added:
>
>

Using createMCversion from TCKUtils

In TCKsh type:
from TCKUtils.createMCversion import *
tck='0x00520033'
cas=ConfigTarFileAccessSvc(Mode='ReadWrite)
createMCversion(tck=tck,cas=cas)
 -- ConorFitzpatrick - 23-Jul-2013

Revision 22013-07-23 - ConorFitzpatrick

Line: 1 to 1
 
META TOPICPARENT name="LHCbTCK"
Deleted:
<
<
 

Making a MC version of a TCK

This can be done with the following python script:

Line: 54 to 53
  createMCversion( tck = dataTCK, cas=ConfigTarFileAccessSvc(Mode='ReadWrite',CompressOnWrite=True) )
Added:
>
>
To do it, Setup the version of Moore corresponding to the TCK you want to make an MC TCK for:

SetupProject Moore vXXX --build-env

Then check out the head of HltTCK:

getpack TCK/HltTCK head
cd TCK/HltTCK/cmt
cmt make

Then setup this Moore version:

SetupProject Moore vXXX

Copy the script at the top of this document to somewhere and change "dataTCK =" so that it points to the TCK you want to make an MC tck for. Now run it in TCKsh:

TCKsh
>>> execfile('createMC.py')

You'll see it dump the new TCK as well as a diff of the old with the new. If everything worked, the only differences will be AcceptFractions from the prescalers being set to 1 instead of prescaled as in data. If you then do a listConfigurations() your new MC TCK should appear under the right version of Moore.

Edit the release notes of TCK/HltTCK to reflect the addition of a new MC TCK, then commit:

svn commit -m "added new TCK XXXXXXXXX for whatever reason"

Once that is done, you need to add it to Appconfig:

getpack AppConfig head
cd AppConfig/options/Conditions

Copy one of the existing TCK-*.py files over to your TCK's name:

cp TCK-0x40YYYYY.py TCK-0x40XXXXX.py

Then edit the file to contain your TCK:

from Configurables import Moore
Moore().InitialTCK = '0x40XXXXXX'

Finally, svn add this file, change the release notes and commit:

svn add TCK-0x40XXXXXX.py
vim ../../doc/release.notes
svn commit -m "added new TCK XXXXXXXXX for whatever reason"

You can now add TCK/HltTCK to the tagcollector, and contact the production people so that they know to release a new Appconfig.

And you're done.

 
Deleted:
<
<
-- EricvanHerwijnen - 09-Sep-2011
 \ No newline at end of file
Added:
>
>
-- ConorFitzpatrick - 23-Jul-2013

Revision 12011-09-09 - EricvanHerwijnen

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="LHCbTCK"

Making a MC version of a TCK

This can be done with the following python script:

def createMCversion( tck, newtck = None, cas = ConfigTarFileAccessSvc() ) :
    if not newtck : newtck = tck | 0x40000000
    props = getProperties(tck,'DeterministicPrescaler/.*','AcceptFraction')
    exceptions = { 'LumiStripper.*'     : '0',
         '.*Debug.*'          : None,
         'Hlt1ODINTechnical.*': None,
         'Hlt1Lumi.*'         : None,
         'Hlt1L0.*'           : None,
         'Hlt1MBMicroBias.*'  : None }
    update = { } 
    for n,v in props.iteritems() :
       v = v['AcceptFraction']
       if v == '1' or v == '0' : continue # do not modify these
       vorig = v
       m = 0  # count # of matching exceptions
       for (e,o) in exceptions.iteritems() :
          import re
          if re.match(e,n) : 
             if o : v = o
             m = m+1
       if m == 0 : v = '1'   # if no exception, put at 1
       if vorig == v : continue  # if not 
       update[ n ] = { 'AcceptFraction' : '%s'%v }
    from pprint import pprint
    print "==================> dump update <===================="
    pprint(update)
    label = None
    for (i,j) in getConfigurations(cas).iteritems() :
       if tck in j['TCK'] : label = j['label']
    id  = updateProperties( resolveTCK(tck,cas),update,label='%s - MC version of 0x%08x' % (label,tck), cas=cas)
    createTCKEntries({newtck:id},cas)


    print "==================> diff data / MC TCK <===================="
    diff (tck, newtck)


##
## main
##

if __name__ == "__main__":

    dataTCK = 0x760037
    print "Create MC TCK for TCK %x" % (dataTCK)
    #listHlt1Lines(dataTCK)
    createMCversion( tck = dataTCK, cas=ConfigTarFileAccessSvc(Mode='ReadWrite',CompressOnWrite=True) )

-- EricvanHerwijnen - 09-Sep-2011

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback