CMS/LPC Trigger Tutorial 3: L1 CSC Track Finder & L1 Global Muon Trigger

Step 1:  Login to your UAF account (or your lxplus.cern.ch account)

I’ve assumed that you are using tcsh shell and some of the scripts in this tutorial require tcsh.  If you are using bash (which is a better shell in my opinion!), then you will need to translate the scripts accordingly.

Step 2:  Setup environment:

Create a working directory, call it “trigger” if you like…

 

cd trigger

mkdir scripts

cd scripts

wget http://www.phys.ufl.edu/~cavanaug/tutorial/tutorial.tar.gz

tar -xvzf tutorial.tar.gz

source setup_l1.csh

 

The setup scripts runs scram to set up OSCAR and ORCA.  In addition it checks the two CSC trigger packages and the Global muon trigger package out of the CVS repository.  You will be prompted for the cvs password:  98passwd

 

The following directory structure should now be set up:

trigger/

     L1CSCtutorial/

          data/

              hbook/

              pool/

              root/

          ORCA/

              ORCA_8_2_0/

                   bin/

                   config/

                   lib/

                   log/

                   module/

                   src/

                        Examples/

                        Trigger/

                             L1CSCTrackFinder/

                                  test/

                             L1CSCTrigger/

                             L1GlobalMuonTrigger/

Workspace/

                   tmp/

          OSCAR/

              OSCAR_3_2_5/

     scripts/

 

In addition to checking out the trigger packages, the setup script also (w)gets the following additions/replacements to the L1CSCTrackFinding package which converts the package from HBOOK to Root:

trigger/L1CSCtutorial/ORCA/ORCA_8_2_0/src/Trigger/L1CSCTrackFinder/test/

BuildFile

L1MuCSCMakeTrackTree.cc

L1MuCSCMakeTrackTree.h

RunL1CSCTrackFinder.cpp

 

The L1CSCTrigger package still relies on HBOOK and has not yet been converted to use Root.  Hence, it is not included (yet) in this tutorial.

3. Build the CSC and Global Muon Trigger Code

SCRAM has an irritating feature of simply prepending environment variables, which can get repeatitive and rather long.  At the UAF, one often gets the following error when building from scram: “Arg list too long  The solution to this problem requires the following hack in order to get the code to compile and link.  First, comment out all “<group” and all “<use” lines in the BuildFile to “#<group” and “#<use”.   Then perform “scram build shared” followed by “scram build”.   “scram build shared” will succeed, but “scram build” will fail.  Next, reinstate the commented out lines in the BuildFile and “scram build” once more.  This builds the code bit by bit, avoiding long argument lists.

 

By sourcing the following scripts (below), this build hack is automatically performed for the CSC track finding and the Global Muon Trigger code:

 

source build_L1CSCTrackFinder.csh

source build_L1GlobalMuonTrigger.csh

 

You should see the following thee stages announced :  COMPILING, ATTEMPTING FIRST BUILD, and ATTEMPTING FINAL BUILD.  After a few minutes you should have the following built executables in your path (you may need to “set autolist” to see them with the tab completion):

 

RunL1CSCTrackFinder_fromHits

RunL1CSCTrackFinder_fromDigis

RunL1GlobalMuonTrigger_fromHits

RunL1GlobalMuonTrigger_fromDigis

4.  No pre-existing data option:

If you have hit or digis data available to you (that is, you know the name and path to a pool file catalog along with the dataset and owner names), then you can skip to the next step.  If however you have no hit or digis data available to you, then you will need to run the OSCAR Particle Gun to generate some hits and digis.  The following scripts have been prepared to run through the chain from a muon particle gun hit simulation to digitisation, producing numevts events:

./gun_maker.csh OSCAR_3_2_5 <OutputCollection1> <numevts>

./digi_maker.csh ORCA_8_2_0 <InputCollection1> <OutputCollection2> <numevts>

 

You are at liberty to choose the Output/InputCollection to be as you wish, but it must follow the /System/dataset/owner format.  For example

 

<OutputCollection1> =/System/ParticleGun/Cavanaugh

<InputCollection1>  =/System/ParticleGun/Cavanaugh

<OutputCollection2> =/System/ParticleGunNoPu/Cavanaugh

 

This will produce a pool file catalog located at

trigger/L1CSCtutorial/data/pool/PoolFileCatalog.xml

along with a pool database containing both Hits and Digis located in the same directory.  To Run the CSC Track Finder and the Global Muon Trigger code on the Hits dataset, for example, execute the following scripts:

 

./l1_from_hits.csh ORCA_8_2_0 <PoolFileCat> <InputCollection> <numevts>

./RunL1GlobalMuonTrigger_from_hits.csh ORCA_8_2_0 <PoolFileCat> <InputCollection> <numevts>

 

For example:

 

./l1_from_hits.csh ORCA_8_2_0 \

xmlcatalog_file:/tmp/trigger/L1CSCtutorial/data/pool/PoolFileCatalog.xml \

/System/ParticleGun/Cavanaugh \

10

./RunL1GlobalMuonTrigger_from_hits.csh ORCA_8_2_0 \

xmlcatalog_file:/tmp/trigger/L1CSCtutorial/data/pool/PoolFileCatalog.xml \

/System/ParticleGun/Cavanaugh \

10

5.  Pre-existing data option:

There is a very nice Dataset Service web page maintained by the UAF:

http://www.uscms.org/scpages/general/uaf/farm/dataset_service.html

By clicking on the orcarc fragment links for any of the listed datasets, one obtains the location to the pool file catalog as well as the dataset, owner, and collection names at the UAF.  For example, for the W + Jets digis sample produced within a pT range of between 20 and 50 GeV, the pool file catalog is:

xmlcatalog_file:/storage/data2/METADATA/jm_2x1033PU761_TkMu_2_g133_OSC/jm03b_Wjets_20_50/POOL_Catalogue_PCP.jm_2x1033PU761_TkMu_2_g133_OSC.jm03b_Wjets_20_50.xml

 

and the input collection (dataset, owner, collection name) is:

 

/System/jm_2x1033PU761_TkMu_2_g133_OSC/jm03b_Wjets_20_50/jm03b_Wjets_20_50

 

To run the CSC Track Finder and the Global Muon Trigger code, execute the following scripts :

 

./l1_from_digis.csh ORCA_8_2_0 <PoolFileCat> <InputCollection> <numevts>

./RunL1GlobalMuonTrigger_from_digis.csh ORCA_8_2_0 <PoolFileCat> <InputCollection> <numevts>

 

For example,

 

./l1_from_digis.csh ORCA_8_2_0 xmlcatalog_file:/storage/data2/METADATA/jm_2x1033PU761_TkMu_2_g133_OSC/jm03b_Wjets_20_50/POOL_Catalogue_PCP.jm_2x1033PU761_TkMu_2_g133_OSC.jm03b_Wjets_20_50.xml /System/jm_2x1033PU761_TkMu_2_g133_OSC/jm03b_Wjets_20_50/jm03b_Wjets_20_50 10

 

./RunL1GlobalMuonTrigger_from_digis.csh ORCA_8_2_0 xmlcatalog_file:/storage/data2/METADATA/jm_2x1033PU761_TkMu_2_g133_OSC/jm03b_Wjets_20_50/POOL_Catalogue_PCP.jm_2x1033PU761_TkMu_2_g133_OSC.jm03b_Wjets_20_50.xml /System/jm_2x1033PU761_TkMu_2_g133_OSC/jm03b_Wjets_20_50/jm03b_Wjets_20_50 10

6.  Voila!

After a few minutes, you should have the following root files located at:

trigger/L1CSCtutorial/data/root/csc_track_fromDigis.root

trigger/L1CSCtutorial/data/root/gmt.root