Reco_tf Example -- Condition Override

Last update: 06 Jul 2021 [History] [Edit]

Included within the repository cloned at the beginning of the tutorial (if you skipped ahead, go find it! 😇 ) is batch script reco_tf.sh. This contains an example to run that is similar (but not the same, instead only running tracking instead of the full reconstruction, and only on a single event) to the one we just inspected from an AMI tag.

Make sure your environment is still set up and then from your run directory do

cp ../trackingworkshophandson/reco_tf.sh .
source reco_tf.sh

Like the standalone job option, this will take a minute or two. Once this is done you should again have physval.AOD.root and monitoring plots physval.ntuple.root. Nothing incredibly radical, we’ve just used the full reconstruction transform command rather than a standalone job options. Make a copy of the output files with a new name, e.g defaultntuple.root, as we may need them in the next section. Now let’s assume we want to make a change to see the effects. Included in the repo is postInclude_Alignmentoverride.py :

######### INFO #######
#This post Include changes the beam spot database tag to a different tag.
#This override has to be done after the main RecExCommon setup either via a 
#postinclude or directly using the postExec functionality.
#Note, similar override options are possible for local DB files, but will not
#be covered here. For this example the DB tag has to be within the ATLAS conditional DB
#
#Examples of misaligned MC DBs are e.g.:
#InDetAlign_R2_FTKtest_PixelTy_10um        (10mu shift of Pixel in Ty)
#InDetAlign_R2_2016postTS1_d0biased        (misalignment that should mimic 2016 d0 bias)
#InDetAlign_R2_IBLDistortion_p02C_4muPixY  (0.2K temperature change of IBL and 4mu shift of Pixel in Ty)
#InDetAlign_R2_IBLDistortion_p05C          (0.5K temperature change of IBL)
######################


from IOVDbSvc.CondDB import conddb
conddb.addOverride("/Indet/Align"  ,"InDetAlign_R2_FTKtest_PixelTy_10um" )

As advertised this postInclude will override the alignment database, with the option currently selected being a 10um shift of the Pixel in the y direction. Copy this file to your run area

cp ../trackingworkshophandson/postInclude_Alignmentoverride.py .

then open up the reco_tf.sh in your favorite editor and add it into the postIncludes, like so:

...
  --postInclude 'default:PyJobTransforms/UseFrontier.py' 'all:postInclude_Alignmentoverride.py' \
...

Now delete the *.xml" files in your run directory (these can sometimes cause unwanted behavior when rerunning) and rerun the script again with your new addition. How do we know it worked? If the mis-alignment is large enough it will be clearly visible in the monitoring plots, but the best way to check is to just check the log file directly. In log.RAWtoESD we can see a line like:

and thus we know that our override has been incorporated. Yay!

In the same file there are a few different options in the comments, swap any of these in and rerun and explore the effects in the monitoring plots! Some changes are more subtle than others. A second file is also included in the repo, postInclude_BSoverride.py, which overrides the beamspot database (i.e, we change the interaction point position). Again copy this file to your run directory and add it to your reco_tf.sh like:

...
  --postInclude 'default:PyJobTransforms/UseFrontier.py' 'all:postInclude_BSoverride.py' \
...

and rinse and repeat. Again you should be able to see in the log that this worked!

Next