Event Selection using file-based TAG

Introduction

In this segment of the tag tutorial, you will:

  • learn how to produce tags from AOD files
  • learn how to configure an Athena job to use tags as input
  • learn how to do event selection on tags

Preliminaries

For Athena-based use of tags, this tutorial will use Release 15.6.4, set up as prescribed for the exercises preceeding this one.

source cmthome/setup.sh -tag=15.6.4,AtlasProduction,32

To use the ROOT utility, you need to have enabled X forwarding in your terminal session. Do this by logging onto lxplus with the '-X' flag, e.g.

ssh -X lxplus.cern.ch

We will use input files from/afs/cern.ch/atlas/maxidisk/d39/data09 (for AOD/TAG file).

Exercises

Exercise 1.1: Create a tag file from an AOD

In this exercise, we will learn

  • how to setup a job option file to create a TAG file from an AOD. TIP You can skip this part and copy the already created TAG file from /afs/cern.ch/atlas/maxidisk/d39/data09/TAGfromAOD.pool.root and explore it (next bullet)
  • how to explore a tag file

We will use an AOD file from data09_900GeV.00142383.physics_MinBias.merge.AOD.r988_p62 as input in our example: /afs/cern.ch/atlas/maxidisk/d39/data09/AOD.102217._000006.pool.root.1

Here is an illustration of the structure of the job option:

[evinek@lxplus232]/afs/cern.ch/atlas/maxidisk/d39/data09% more aodtotag.py 

from RecExConfig.RecFlags import rec

ConditionsTag = "COMCOND-ES1PT-001-00"
DetDescrVersion  = "ATLAS-GEO-08-00-02"

from AthenaCommon.GlobalFlags import GlobalFlags
GlobalFlags.DetGeo.set_atlas()
GlobalFlags.DataSource.set_data() 
from IOVDbSvc.CondDB import conddb


#The output level  
OutputLevel = INFO

#Number of events to be processed: "-1" all events in the AOD 
if not 'EvtMax' in dir():
    EvtMax=-1

# define an AOD ntuplename if not done already
rec.doCBNT.set_Value_and_Lock(False)

# enable TAG/AOD reading and writing:
# Here we readAOD and write TAG
rec.readTAG.set_Value_and_Lock(False)
rec.readAOD.set_Value_and_Lock(True)

rec.doWriteAOD.set_Value_and_Lock(False)
rec.doWriteTAG.set_Value_and_Lock(True) 

# define a TAG filename if not done already
if not 'PoolTAGOutput' in dir():
    PoolTAGOutput="TAGfromAOD.pool.root"

# use the first tag file for processing
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
athenaCommonFlags.PoolAODInput = ["/afs/cern.ch/atlas/maxidisk/d39/data09/AOD.102217._000006.pool.root.1"]

# main jobOption - must always be included
##############################
include ("RecExCommon/RecExCommon_topOptions.py")
##############################

You can save this snippet in aodtotag.py or copy the file from the tutorial directory: /afs/cern.ch/atlas/maxidisk/d39/data09/aodtotag.py in your test area.

You can run the script in your test area:

athena.py -c 'EvtMax=500' aodtotag.py >&  log.txt &

This script will read 500 events in the /afs/cern.ch/atlas/maxidisk/d39/data09/AOD.102217._000006.pool.root.1 AOD and create a tag file called TAGfromAOD.pool.root.

To explore the tag file :

  • Open TAGfromAOD.pool.root via ROOT
  • View the content of the tag file
  • Plot some variables from this Tree (Number of muons,NLooseMuon; The highest pt of muons, LooseMuonPt1, and etc)

root TAGfromAOD.pool.root

root[0] TBrowser t

/* Print the content of the TTree*/
root[1] POOLCollectionTree->Print()

We will learn more in Exercise 1.3 about how to dump the content on the screen.

Another important output of this job is PoolFileCatalog.xml. Recall that a tag file is a list of event references. To use those references, the files to which they point (i.e. its AOD) must be locally available, and a catalog that can translate the references into local file names must be provided when tags are used.

One can also produce PoolFileCatalog.xml via:

pool_insertFileToCatalog <directory>/<filename>

e.g.
pool_insertFileToCatalog /afs/cern.ch/atlas/maxidisk/d39/data09/AOD.102217._000006.pool.root.1
However, note that the previous athena run generated a PoolFileCatalog.xml file which looks like:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!-- Edited By POOL -->
<!DOCTYPE POOLFILECATALOG SYSTEM "InMemory"><POOLFILECATALOG>
  <File ID="02E14F86-99EF-DE11-AF7C-003048C693FC">
    <physical>
      <pfn filetype="ROOT_All" name="/afs/cern.ch/atlas/maxidisk/d39/data09/AOD.102217._000006.pool.root.1"/>
    </physical>
    <logical/>
  </File>

  <File ID="BCE8801F-3112-DF11-9FE4-000423D94890">
    <physical>
      <pfn filetype="PoolCollection" name="RootCollection||PFN:TAGfromAOD.pool.root"/>
    </physical>
    <logical/>
  </File>

Exercise 1.2: Using a tag file as input

In this exercise, we will learn how to create an AOD. To do so, we will use the tag file produced in the previous exercise. Here is an example for the job option:

from RecExConfig.RecFlags import rec

ConditionsTag = "COMCOND-ES1PT-001-00"
DetDescrVersion  = "ATLAS-GEO-08-00-02"

from AthenaCommon.GlobalFlags import GlobalFlags
GlobalFlags.DetGeo.set_atlas()
GlobalFlags.DataSource.set_data() 
from IOVDbSvc.CondDB import conddb

#The output level  
OutputLevel = INFO

#Number of events to be processed
if not 'EvtMax' in dir():
    EvtMax=-1

# define an AOD nutputname if not done already
rec.doCBNT.set_Value_and_Lock(False)

# enable TAG/AOD reading and TAG/AOD writing if needed
rec.readTAG.set_Value_and_Lock(True)
rec.readAOD.set_Value_and_Lock(True)
rec.doWriteAOD.set_Value_and_Lock(True)
rec.doWriteTAG.set_Value_and_Lock(False) 


if not 'PoolAODOutput' in dir():
    PoolAODOutput="AODfromTAG.pool.root"

if not 'PoolTAGOutput' in dir():
    PoolTAGOutput="TAGfromTAG.pool.root"

# use the first tag file for processing
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
athenaCommonFlags.PoolTAGInput = ["TAGfromAOD.pool.root"]

# setup the PoolSvc to find the needed input AOD files
from AthenaCommon.AppMgr import ServiceMgr as svcMgr  
include( "AthenaPoolCnvSvc/ReadAthenaPool_jobOptions.py" )

from PoolSvc.PoolSvcConf import PoolSvc
svcMgr.PoolSvc.ReadCatalog +=["xmlcatalog_file:PoolFileCatalog.xml"]

# main jobOption - must always be included
##############################
include ("RecExCommon/RecExCommon_topOptions.py")
##############################

You can save this snippet as tagtoaod.py in your test area or copy /afs/cern.ch/atlas/maxidisk/d39/data09/tagtoaod.py. Pay attention to the differences from the previous exercise. Note that:

  • the input is the output from the previous example
  • to resolve references from the tags to AOD events, the following line has been added

           svcMgr.PoolSvc.ReadCatalog +=["xmlcatalog_file:PoolFileCatalog.xml"]
      

  • AOD writing is switched on, and tag writing is switched off.

Now run athena with these job options as in earlier exercises, e.g.,

athena.py tagtoaod.py >& log1.txt &

When your job finishes, your AOD should appear in a file named AODfromTAG.pool.root.

One way to check what happened is to grep for specific messages in your log file:

grep "done processing" log1.txt

  • You could write another tag by switching on doWriteTAG.

Exercise 1.3: Filtering your input tag collection

In this exercise, we will produce skimmed TAG or AOD using the TAG attributes.

The file-based TAGs, like the TAGs in Oracle, can be queried, and selection predicates applied. This means that you can tighten the selection you made in Oracle to produce your tag file. We will use the PoolInputQuery property from athenaCommonFlags to specify selection predicates.

One way to remind yourself of what the queryable attributes in your TAG file are, is to use either ROOT (as in Exercise 1.1) or to use POOL's CollListAttrib command line utility.

Type:

   CollListAttrib -src <your collection name, without the .root suffix> RootCollection

e.g., for the tag file we generated in Exercise 1.1

   CollListAttrib -src TAGfromAOD.pool RootCollection

You should see something like:

--------------------------------------------------------------
Collection list: 
NAME: TAGfromAOD.pool   TYPE: RootCollection   NFRAG: 1
--------------------------------------------------------------
Number of Tokens is: 3
Tokens are: 
 NAME: StreamAOD_ref      TYPE: Token      INFO: 
 NAME: StreamESD_ref      TYPE: Token      INFO: 
 NAME: StreamRAW_ref      TYPE: Token      INFO: 
--------------------------------------------------------------
Number of Attributes is: 220
Attributes are: 
 NAME: RunNumber                    TYPE: unsigned int      INFO: UNIT=NUMBER;GRP=TIME;
 NAME: EventNumber                  TYPE: unsigned int      INFO: UNIT=NUMBER;GRP=TIME;
 NAME: isSimulation                 TYPE: bool              INFO: UNIT=BITMASK;GRP=QUALITY;
 NAME: isCalibration                TYPE: bool              INFO: UNIT=BITMASK;GRP=QUALITY;
 NAME: isTestBeam                   TYPE: bool              INFO: UNIT=BITMASK;GRP=QUALITY;
 NAME: isRealData                   TYPE: bool              INFO: UNIT=BITMASK;GRP=QUALITY;
 NAME: Luminosity                   TYPE: float             INFO: UNIT=INV_PB;GRP=VERTEX;
 NAME: TimeStamp                    TYPE: unsigned int      INFO: UNIT=NUMBER;GRP=TIME;
 NAME: LumiBlockN                   TYPE: unsigned int      INFO: UNIT=NUMBER;GRP=TIME;
 NAME: BunchId                      TYPE: unsigned int      INFO: UNIT=NUMBER;GRP=TIME;
 NAME: Stream                       TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_STREAM;
 NAME: RandomNumber                 TYPE: float             INFO: UNIT=NUMBER;GRP=QUALITY;
 NAME: NTrk                         TYPE: unsigned int      INFO: UNIT=NUMBER;GRP=VERTEX;
 NAME: Nvx                          TYPE: unsigned int      INFO: UNIT=NUMBER;GRP=VERTEX;
 NAME: VtxX                         TYPE: float             INFO: UNIT=MM;GRP=VERTEX;
 NAME: VtxY                         TYPE: float             INFO: UNIT=MM;GRP=VERTEX;
 NAME: VtxZ                         TYPE: float             INFO: UNIT=MM;GRP=VERTEX;
 NAME: PixelFlags                   TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_DETECTOR;
 NAME: SCTFlags                     TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_DETECTOR;
 NAME: TRTFlags                     TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_DETECTOR;
 NAME: LArFlags                     TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_DETECTOR;
 NAME: TileFlags                    TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_DETECTOR;
 NAME: MuonFlags                    TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_DETECTOR;
 NAME: ForwardDetFlags              TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_DETECTOR;
 NAME: CoreFlags                    TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_DETECTOR;
 NAME: LooseElectronEta1            TYPE: float             INFO: UNIT=PSEUDO_RAP;GRP=PHYSICS_ELECTRON;
 NAME: LooseElectronEta2            TYPE: float             INFO: UNIT=PSEUDO_RAP;GRP=PHYSICS_ELECTRON;
 NAME: LooseElectronEta3            TYPE: float             INFO: UNIT=PSEUDO_RAP;GRP=PHYSICS_ELECTRON;
 NAME: LooseElectronEta4            TYPE: float             INFO: UNIT=PSEUDO_RAP;GRP=PHYSICS_ELECTRON;
 NAME: LooseElectronPhi1            TYPE: float             INFO: UNIT=RAD;GRP=PHYSICS_ELECTRON;
 NAME: LooseElectronPhi2            TYPE: float             INFO: UNIT=RAD;GRP=PHYSICS_ELECTRON;
 NAME: LooseElectronPhi3            TYPE: float             INFO: UNIT=RAD;GRP=PHYSICS_ELECTRON;
 NAME: LooseElectronPhi4            TYPE: float             INFO: UNIT=RAD;GRP=PHYSICS_ELECTRON;
 NAME: LooseElectronPt1             TYPE: float             INFO: UNIT=MEV/c;GRP=PHYSICS_ELECTRON;
 NAME: LooseElectronPt2             TYPE: float             INFO: UNIT=MEV/c;GRP=PHYSICS_ELECTRON;
 NAME: LooseElectronPt3             TYPE: float             INFO: UNIT=MEV/c;GRP=PHYSICS_ELECTRON;
 NAME: LooseElectronPt4             TYPE: float             INFO: UNIT=MEV/c;GRP=PHYSICS_ELECTRON;
 NAME: LooseElectronTightness1      TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=PHYSICS_ELECTRON;
 NAME: LooseElectronTightness2      TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=PHYSICS_ELECTRON;
 NAME: LooseElectronTightness3      TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=PHYSICS_ELECTRON;
 NAME: LooseElectronTightness4      TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=PHYSICS_ELECTRON;
 NAME: NLooseElectron               TYPE: unsigned int      INFO: UNIT=NUMBER;GRP=PHYSICS_ELECTRON;
 NAME: LoosePhotonEta1              TYPE: float             INFO: UNIT=PSEUDO_RAP;GRP=PHYSICS_PHOTON;
 NAME: LoosePhotonEta2              TYPE: float             INFO: UNIT=PSEUDO_RAP;GRP=PHYSICS_PHOTON;
 NAME: LoosePhotonPhi1              TYPE: float             INFO: UNIT=RAD;GRP=PHYSICS_PHOTON;
 NAME: LoosePhotonPhi2              TYPE: float             INFO: UNIT=RAD;GRP=PHYSICS_PHOTON;
 NAME: LoosePhotonPt1               TYPE: float             INFO: UNIT=MEV/c;GRP=PHYSICS_PHOTON;
 NAME: LoosePhotonPt2               TYPE: float             INFO: UNIT=MEV/c;GRP=PHYSICS_PHOTON;
 NAME: LoosePhotonTightness1        TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=PHYSICS_PHOTON;
 NAME: LoosePhotonTightness2        TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=PHYSICS_PHOTON;
 NAME: NConvertedLoosePhoton        TYPE: unsigned int      INFO: UNIT=NUMBER;GRP=PHYSICS_PHOTON;
 NAME: NLoosePhoton                 TYPE: unsigned int      INFO: UNIT=NUMBER;GRP=PHYSICS_PHOTON;
 NAME: LooseMuonEta1                TYPE: float             INFO: UNIT=PSEUDO_RAP;GRP=PHYSICS_MUON;
 NAME: LooseMuonEta2                TYPE: float             INFO: UNIT=PSEUDO_RAP;GRP=PHYSICS_MUON;
 NAME: LooseMuonEta3                TYPE: float             INFO: UNIT=PSEUDO_RAP;GRP=PHYSICS_MUON;
 NAME: LooseMuonEta4                TYPE: float             INFO: UNIT=PSEUDO_RAP;GRP=PHYSICS_MUON;
 NAME: LooseMuonIsolEt1             TYPE: float             INFO: UNIT=MEV;GRP=PHYSICS_MUON;
 NAME: LooseMuonIsolEt2             TYPE: float             INFO: UNIT=MEV;GRP=PHYSICS_MUON;
 NAME: LooseMuonIsolEt3             TYPE: float             INFO: UNIT=MEV;GRP=PHYSICS_MUON;
 NAME: LooseMuonIsolEt4             TYPE: float             INFO: UNIT=MEV;GRP=PHYSICS_MUON;
 NAME: LooseMuonIsolN1              TYPE: unsigned int      INFO: UNIT=RAD;GRP=PHYSICS_MUON;
 NAME: LooseMuonIsolN2              TYPE: unsigned int      INFO: UNIT=RAD;GRP=PHYSICS_MUON;
 NAME: LooseMuonIsolN3              TYPE: unsigned int      INFO: UNIT=RAD;GRP=PHYSICS_MUON;
 NAME: LooseMuonIsolN4              TYPE: unsigned int      INFO: UNIT=RAD;GRP=PHYSICS_MUON;
 NAME: LooseMuonPhi1                TYPE: float             INFO: UNIT=RAD;GRP=PHYSICS_MUON;
 NAME: LooseMuonPhi2                TYPE: float             INFO: UNIT=RAD;GRP=PHYSICS_MUON;
 NAME: LooseMuonPhi3                TYPE: float             INFO: UNIT=RAD;GRP=PHYSICS_MUON;
 NAME: LooseMuonPhi4                TYPE: float             INFO: UNIT=RAD;GRP=PHYSICS_MUON;
 NAME: LooseMuonPt1                 TYPE: float             INFO: UNIT=MEV/c;GRP=PHYSICS_MUON;
 NAME: LooseMuonPt2                 TYPE: float             INFO: UNIT=MEV/c;GRP=PHYSICS_MUON;
 NAME: LooseMuonPt3                 TYPE: float             INFO: UNIT=MEV/c;GRP=PHYSICS_MUON;
 NAME: LooseMuonPt4                 TYPE: float             INFO: UNIT=MEV/c;GRP=PHYSICS_MUON;
 NAME: LooseMuonTightness1          TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=PHYSICS_MUON;
 NAME: LooseMuonTightness2          TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=PHYSICS_MUON;
 NAME: LooseMuonTightness3          TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=PHYSICS_MUON;
 NAME: LooseMuonTightness4          TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=PHYSICS_MUON;
 NAME: NLooseMuon                   TYPE: unsigned int      INFO: UNIT=NUMBER;GRP=PHYSICS_MUON;
 NAME: NTau                         TYPE: unsigned int      INFO: UNIT=NUMBER;GRP=PHYSICS_TAU;
 NAME: TauJetEta1                   TYPE: float             INFO: UNIT=PSEUDO_RAP;GRP=PHYSICS_TAU;
 NAME: TauJetEta2                   TYPE: float             INFO: UNIT=PSEUDO_RAP;GRP=PHYSICS_TAU;
 NAME: TauJetLikelihood1            TYPE: float             INFO: UNIT=NUMBER;GRP=PHYSICS_TAU;
 NAME: TauJetLikelihood2            TYPE: float             INFO: UNIT=NUMBER;GRP=PHYSICS_TAU;
 NAME: TauJetNTrk1                  TYPE: unsigned int      INFO: UNIT=NUMBER;GRP=PHYSICS_TAU;
 NAME: TauJetNTrk2                  TYPE: unsigned int      INFO: UNIT=NUMBER;GRP=PHYSICS_TAU;
 NAME: TauJetPhi1                   TYPE: float             INFO: UNIT=RAD;GRP=PHYSICS_TAU;
 NAME: TauJetPhi2                   TYPE: float             INFO: UNIT=RAD;GRP=PHYSICS_TAU;
 NAME: TauJetPt1                    TYPE: float             INFO: UNIT=MEV/c;GRP=PHYSICS_TAU;
 NAME: TauJetPt2                    TYPE: float             INFO: UNIT=MEV/c;GRP=PHYSICS_TAU;
 NAME: BJetLikelihood1              TYPE: float             INFO: UNIT=NUMBER;GRP=PHYSICS_JETMET;
 NAME: BJetLikelihood2              TYPE: float             INFO: UNIT=NUMBER;GRP=PHYSICS_JETMET;
 NAME: BJetLikelihood3              TYPE: float             INFO: UNIT=NUMBER;GRP=PHYSICS_JETMET;
 NAME: BJetLikelihood4              TYPE: float             INFO: UNIT=NUMBER;GRP=PHYSICS_JETMET;
 NAME: BJetLikelihood5              TYPE: float             INFO: UNIT=NUMBER;GRP=PHYSICS_JETMET;
 NAME: BJetLikelihood6              TYPE: float             INFO: UNIT=NUMBER;GRP=PHYSICS_JETMET;
 NAME: JetEta1                      TYPE: float             INFO: UNIT=PSEUDO_RAP;GRP=PHYSICS_JETMET;
 NAME: JetEta2                      TYPE: float             INFO: UNIT=PSEUDO_RAP;GRP=PHYSICS_JETMET;
 NAME: JetEta3                      TYPE: float             INFO: UNIT=PSEUDO_RAP;GRP=PHYSICS_JETMET;
 NAME: JetEta4                      TYPE: float             INFO: UNIT=PSEUDO_RAP;GRP=PHYSICS_JETMET;
 NAME: JetEta5                      TYPE: float             INFO: UNIT=PSEUDO_RAP;GRP=PHYSICS_JETMET;
 NAME: JetEta6                      TYPE: float             INFO: UNIT=PSEUDO_RAP;GRP=PHYSICS_JETMET;
 NAME: JetPhi1                      TYPE: float             INFO: UNIT=RAD;GRP=PHYSICS_JETMET;
 NAME: JetPhi2                      TYPE: float             INFO: UNIT=RAD;GRP=PHYSICS_JETMET;
 NAME: JetPhi3                      TYPE: float             INFO: UNIT=RAD;GRP=PHYSICS_JETMET;
 NAME: JetPhi4                      TYPE: float             INFO: UNIT=RAD;GRP=PHYSICS_JETMET;
 NAME: JetPhi5                      TYPE: float             INFO: UNIT=RAD;GRP=PHYSICS_JETMET;
 NAME: JetPhi6                      TYPE: float             INFO: UNIT=RAD;GRP=PHYSICS_JETMET;
 NAME: JetPt1                       TYPE: float             INFO: UNIT=MEV/c;GRP=PHYSICS_JETMET;
 NAME: JetPt2                       TYPE: float             INFO: UNIT=MEV/c;GRP=PHYSICS_JETMET;
 NAME: JetPt3                       TYPE: float             INFO: UNIT=MEV/c;GRP=PHYSICS_JETMET;
 NAME: JetPt4                       TYPE: float             INFO: UNIT=MEV/c;GRP=PHYSICS_JETMET;
 NAME: JetPt5                       TYPE: float             INFO: UNIT=MEV/c;GRP=PHYSICS_JETMET;
 NAME: JetPt6                       TYPE: float             INFO: UNIT=MEV/c;GRP=PHYSICS_JETMET;
 NAME: JetSumET                     TYPE: float             INFO: UNIT=MEV;GRP=PHYSICS_JETMET;
 NAME: NBJet                        TYPE: unsigned int      INFO: UNIT=NUMBER;GRP=PHYSICS_JETMET;
 NAME: NJet                         TYPE: unsigned int      INFO: UNIT=NUMBER;GRP=PHYSICS_JETMET;
 NAME: MissingET                    TYPE: float             INFO: UNIT=MEV;GRP=PHYSICS_JETMET;
 NAME: MissingETPhi                 TYPE: float             INFO: UNIT=RAD;GRP=PHYSICS_JETMET;
 NAME: SumET                        TYPE: float             INFO: UNIT=MEV;GRP=PHYSICS_JETMET;
 NAME: EFPassedTrigMask0            TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask1            TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask10           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask11           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask12           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask13           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask14           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask15           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask16           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask17           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask18           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask19           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask2            TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask20           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask21           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask22           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask23           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask24           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask25           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask26           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask27           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask28           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask29           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask3            TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask30           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask31           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask4            TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask5            TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask6            TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask7            TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask8            TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: EFPassedTrigMask9            TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_EF;
 NAME: L1PassedTrigMaskTAP0         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L1PassedTrigMaskTAP1         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L1PassedTrigMaskTAP2         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L1PassedTrigMaskTAP3         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L1PassedTrigMaskTAP4         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L1PassedTrigMaskTAP5         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L1PassedTrigMaskTAP6         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L1PassedTrigMaskTAP7         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L1PassedTrigMaskTAV0         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L1PassedTrigMaskTAV1         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L1PassedTrigMaskTAV2         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L1PassedTrigMaskTAV3         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L1PassedTrigMaskTAV4         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L1PassedTrigMaskTAV5         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L1PassedTrigMaskTAV6         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L1PassedTrigMaskTAV7         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L1PassedTrigMaskTBP0         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L1PassedTrigMaskTBP1         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L1PassedTrigMaskTBP2         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L1PassedTrigMaskTBP3         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L1PassedTrigMaskTBP4         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L1PassedTrigMaskTBP5         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L1PassedTrigMaskTBP6         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L1PassedTrigMaskTBP7         TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L1;
 NAME: L2PassedTrigMask0            TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask1            TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask10           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask11           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask12           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask13           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask14           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask15           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask16           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask17           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask18           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask19           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask2            TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask20           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask21           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask22           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask23           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask24           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask25           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask26           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask27           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask28           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask29           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask3            TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask30           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask31           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask4            TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask5            TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask6            TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask7            TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask8            TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: L2PassedTrigMask9            TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TRIGGER_L2;
 NAME: Level1TriggerType            TYPE: unsigned int      INFO: UNIT=;GRP=TRIGGER_L1;
 NAME: BPhysWord                    TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_PHYSICS;
 NAME: CombinedMuonWord             TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_PHYSICS;
 NAME: DPDWord                      TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_PHYSICS;
 NAME: EgammaWord                   TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_PHYSICS;
 NAME: ExoticWord                   TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_PHYSICS;
 NAME: HeavyIonWord                 TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_PHYSICS;
 NAME: HiggsWord                    TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_PHYSICS;
 NAME: JetMissingEtWord             TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_PHYSICS;
 NAME: JetTagWord                   TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_PHYSICS;
 NAME: SMWord                       TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_PHYSICS;
 NAME: SUSYWord                     TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_PHYSICS;
 NAME: TauIdWord                    TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_PHYSICS;
 NAME: TopWord                      TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_PHYSICS;
---------------------------------------------------------

Number of collections scanned is: 1

The job option in Exercise 1.2 can be modified to add the following selection criteria based upon the available attributes:

athenaCommonFlags.PoolInputQuery="NLooseMuon>0"

or

athenaCommonFlags.PoolInputQuery = "NLooseMuon>0 && TriggerPassed(L1_MBTS_1_1)."

or something else entirely! All the necessary changes are in /afs/cern.ch/atlas/maxidisk/d36/tutorial/tag/tagtoaod-query.py. Please copy this into your test area and run

athena.py  tagtoaod-query.py >& log2.txt

If you repeat the "grep" exercises above on log2.txt, you should see a smaller number of events processed, and probably a small number of records written to the new tag/AOD file with selected events only.

Indexing your data by building a tag file

As part of the Tier0 production chain, event tags are created for all events in physics stream AODs as part of the standard Tier 0 production process, so you should not need to build your own tags for such AOD data. If you use AOD from certain Monte Carlo samples, or produce AOD yourself, you may wish to build a tag file to index your data.

Standard AOD

If the AOD file content is the standard output of Tier0 reconstruction, you may use the same transformation that is used in production releases to build tags with standard content: AODtoTAG_trf.py; get the tag building script by executing:
get_files -scripts AODtoTAG_trf.py

then run the following command:

AODtoTAG_trf.py \
inputAODFile="/afs/cern.ch/atlas/maxidisk/d36/topmix/user.RichardHawkings.0108175.topmix_Muon.AOD.v5/user.RichardHawkings.0108175.topmix_Muon.AOD.v4._00001.pool.root" maxEvents=50

This should create a tag file, TAGfromAOD.pool.root .

Non-standard AOD

If your AOD content is nonstandard (e.g., you have omitted some objects), a simpler utility, MakeSimpleCollection.py, is available to produce highly reduced tags, containing only a handful of event properties like RunNumber, EventNumber, and so on. This may be useful if all you wish to do is to process specific events, or to skip specific {run, event} pairs that give your algorithms headaches.

To try this, execute

get_files -jo MakeSimpleCollection.py

To run this utility on a file in the tutorial group area, type

athena.py -c 'InColl=["PFN:/afs/cern.ch/atlas/maxidisk/d36/topmix/user.RichardHawkings.0108175.topmix_Muon.AOD.v5/user.RichardHawkings.0108175.topmix_Muon.AOD.v4._00001.pool.root"]' MakeSimpleCollection.py >& simpletest.log &

or substitute your own file name. This produces a tag file with the default name TAG.pool.root .

To see the difference in tag content, type

CollListAttrib -src TAG.pool RootCollection

You should see something like


--------------------------------------------------------------
Collection list:
NAME: TAG.pool   TYPE: RootCollection   NFRAG: 1
--------------------------------------------------------------
Number of Tokens is: 3
Tokens are:
 NAME: StreamAOD_ref      TYPE: Token      INFO:
 NAME: StreamESD_ref      TYPE: Token      INFO:
 NAME: Stream1_ref        TYPE: Token      INFO:
--------------------------------------------------------------
Number of Attributes is: 23
Attributes are:
 NAME: RunNumber            TYPE: unsigned int      INFO: UNIT=NUMBER;GRP=TIME;
 NAME: EventNumber          TYPE: unsigned int      INFO: UNIT=NUMBER;GRP=TIME;
 NAME: isSimulation         TYPE: bool              INFO: UNIT=NUMBER;GRP=QUALITY;
 NAME: isCalibration        TYPE: bool              INFO: UNIT=NUMBER;GRP=QUALITY;
 NAME: isTestBeam           TYPE: bool              INFO: UNIT=NUMBER;GRP=QUALITY;
 NAME: isRealData           TYPE: bool              INFO: UNIT=NUMBER;GRP=QUALITY;
 NAME: Luminosity           TYPE: float             INFO: UNIT=INV_PB;GRP=VERTEX;
 NAME: TimeStamp            TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=TIME;
 NAME: Stream               TYPE: unsigned int      INFO: UNIT=NUMBER;GRP=TRIGGER_STREAM;
 NAME: RandomNumber         TYPE: float             INFO: UNIT=NUMBER;GRP=QUALITY;
 NAME: LumiBlockN           TYPE: unsigned int      INFO: UNIT=NUMBER;GRP=TIME;
 NAME: NTrk                 TYPE: unsigned int      INFO: UNIT=NUMBER;GRP=VERTEX;
 NAME: Nvx                  TYPE: unsigned int      INFO: UNIT=NUMBER;GRP=VERTEX;
 NAME: VtxX                 TYPE: float             INFO: UNIT=MM;GRP=VERTEX;
 NAME: VtxY                 TYPE: float             INFO: UNIT=MM;GRP=VERTEX;
 NAME: VtxZ                 TYPE: float             INFO: UNIT=MM;GRP=VERTEX;
 NAME: PixelFlags           TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_DETECTOR;
 NAME: SCTFlags             TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_DETECTOR;
 NAME: TRTFlags             TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_DETECTOR;
 NAME: LArFlags             TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_DETECTOR;
 NAME: TileFlags            TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_DETECTOR;
 NAME: MuonFlags            TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_DETECTOR;
 NAME: ForwardDetFlags      TYPE: unsigned int      INFO: UNIT=BITMASK;GRP=QUALITY_DETECTOR;
---------------------------------------------------------

Number of collections scanned is: 1

Note the reduced tag contents produced by MakeSimpleCollection.py. With what you learned in the preceding exercises, you should be able to process this file while skipping a specific EventNumber by setting the athenaCommonFlags.PoolInputQuery property appropriately.

Some useful links


Major updates:
-- ElisabethVinek - 02 Feb 2010, TulayCuhadarDonszelmann - 21-Oct-2009, TulayCuhadarDonszelmann - 02 Mar 2009, TulayCuhadarDonszelmann - 21 Oct 2008, DavidMalon - 17 July 2008

%RESPONSIBLE% DavidMalon
%REVIEW% Never reviewed

Edit | Attach | Watch | Print version | History: r9 < r8 < r7 < r6 < r5 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r9 - 2010-07-22 - unknown
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

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