Workbook for SLD Offline Users - Processors Ex.2: The Jetfinder

In this example we play with the jetfinder for the first time. The purpose of this exercise is:

The following example uses the jetfinder JETFND.PREPMORT its parameter bank JETFINDP.TEMPLATE and its output bank PHJETA.TEMPLATE. It is recommended that you look at a copy of JETFNDP.TEMPLATE and PHJETA.TEMPLATE while doing this exercise. You may do this by typing:

 EVE DUCSSEARCH:JETFNDP.TEMPLATE
 EVE DUCSSEARCH:PHJETA.TEMPLATE 
OR
 TYPE DUCSSEARCH:JETFNDP.TEMPLATE
 TYPE DUCSSEARCH:PHJETA.TEMPLATE 
In they following program we will loop over the maximum allowed YCUT (Invariant jet mass/visible energy in the event) varying the value from 0.01 to 0.1 in steps of 0.01. At each step we will call the jetfinder to get the number of jets the event has for a particular ycut.Note the jetfinder may be called a number of times per event with different parameter settings as we are doing here. Each time the Jetfinder is called it directs its output to a new PHJETA Bank. We will then loop over the resulting PHJETA Banks filling out histograms for the number of jets found for different YCUTS.

The following exercise may be done interactively by entering each line at the Ida prompt, or you may wish to enter the commands in a file (Jet.ida for instance) then run it with the @ command. Remember anything following a "!" is just a comment.


PROGRAM JET.IDA

        VAR NJETS,YCUT
        PROCESSOR JETFND             ! Initialize Processor

        POKE JETFNDP.MODE=KAL   ! Tell Jetfinder to use calorimetry clusters
                                ! in finding routine 
        DEF EVANAL
           DO YCUT = 0.01 TO 0.1 BY 0.01   !Loop over values of YC
              _JETFNDP%(YC)=YCUT             ! Set Parameter for jetfinder
              CALL JETFND(DOIT)              ! Call Jetfinder
           ENDDO  
In the above we set the values of the parameters MODE and YC in the bank JETFNDP using 2 different methods. We set the value of mode using the command POKE JETFNDP.MODE=KAL, which is the standard way to do things. However, in the DO loop we set the value of YC a number of times by looping over YCUT and using the command _JETFNDP%(YC) = YCUT, instead of using POKE JETFNDP.YC =YCUT . The reason for this is YCUT is a variable whose value is set in the ida session and unfortunately we can not pass ida variables to the POKE command. We were able to pass KAL via the poke command because its value 1 is a parameter defined in the JETFNDP template. In general we recommend using poke if you can!

           BANKLOOP PHJETA           ! Loop over output banks 1 for each call to jetfnd
             NUMJ=PHJETA%(NJETS)       ! Get Number of Jets
             YCUT=PHJETA%(PAR(1))      ! Get YC

      ! Book and fill histograms

             IF NUMJ=1                 ! Plot # of 1 jet events for various YC.
               Hist YCUT from 0 to .1 step .01 ms R*4 ID 10 -
               title " # of 1 JET  Events at YC @"
             ENDIF
             IF NUMJ=2                 ! Plot # of 2 jet events for various YC.
               Hist YCUT from 0 to .1 step .01 ms R*4 ID 20 -
               title " # of 2 JET  Events at YC @"
             ENDIF
             IF NUMJ=3                 ! Plot # of 3 jet events for various YC.
               Hist YCUT from 0 to .1 step .01 ms R*4 ID 30 -
               title " # of 3 JET  Events at YC @"
             ENDIF
             IF NUMJ=4                 ! Plot # of 4 jet events for various YC.
               Hist YCUT from 0 to .1 step .01 ms R*4 ID 40 -
               title " # of 4 JET  Events at YC @"
             ENDIF
             IF NUMJ=5                 ! Plot # of 5 jet events for various YC.
               Hist YCUT from 0 to .1 step .01 ms R*4 ID 50 -
               title " # of 5 JET  Events at YC @"
             ENDIF
           ENDLOOP
        ENDDEF

        OPENTAPE READ REC94_MDST STAGE WAIT

        GO 100   
Now lets view the output. If You wrote the above in an editor fire up an IDA session run your file with the @filename command. At the following prompt do the below example.
 
      hout 10 sddxwdo
      hout 20 sddxwdo
      hout 30 sddxwdo
      hout 40 sddxwdo
      hout 50 sddxwdo   
These histograms give us the general shape but since we only sampled at points it might be nicer to view them as points opposed to bins. We can use the DOPT command to change the display.
 
      DOPT LINE 0   ! No lines, only points. Default is 2 for histograms
      DOPT MARKER 4 ! Turn markers into boxes
      hout 20 sddxwdo ! output fancy histograms. 
      hout 30 sddxwdo
      hout 40 sddxwdo
      hout 50 sddxwdo   
Now if we want to connect the points to see the shape of each we can again use the DOPT command. And we can use different options to output them on the same page or overlay them.
 
      DOPT LINE 1  ! Connect points with line.
      hout 20 30 40 50 four sddxwdo !Output all four on same page
      hout 20 30 over sddxwdo ! overlay them 
You may want to print some of your plots out. You never know they might come in handy someday.
Eric Weiss
7 February 1995