In this example we will learn how to run a reconstruction job. We will take some Raw Data reconstruct it and write the output to tape in Mini-DST format. If you do not already have a tape of your own you will need to get one. For instructions on how to do this please consult The Tape System: GETFREE.
As previously stated all processors have control banks that let users set the parameters for how they will run. The convention for naming the control banks is the processor name amended with a p. So in our case we will be using the processor RECSLD so the control bank we want is RECSLDP.TEMPLATE.
To do the following example it is recommended that you use two x windows. In the first get a copy of the template RECSLDP. you can do this by typing at the VMS prompt:
EVE DUCSSEARCH:RECSLDP.TEMPLATE
You should notice there are two main sections one that looks like:
!----------------------------------------------------------------------- ! Subsystem flags - !----------------------------------------------------------------------- logical VTX / .TRUE./ "do VTX" logical DC / .TRUE./ "do DC" logical CRID / .TRUE./ "do CRID" logical KAL / .TRUE./ "do KAL" logical WIC / .TRUE./ "do WIC"These flags control what subsystems should be reconstructed. The next section that looks like:
----------------------------------------------------------------------- ! Stage flags - !----------------------------------------------------------------------- logical PREP / .TRUE./ "do pre-processing" logical PATREC / .TRUE./ "do pattern recognitions" logical FIT / .TRUE./ "do fits" logical EXTRAP / .TRUE./ "extrapolate DC tracks" logical ASSOC / .TRUE./ "associate to other subsystems" logical FILL / .TRUE./ "do PHFILL" logical PID / .TRUE./ "do PID from DST" logical LINK / .TRUE./ "do PH <--> MCPART linkage" logical MATCH / .TRUE./ "match extrapolated DC tracks to WIC tracks" logical BEAM / .TRUE./ "fill PHBEAM" logical EVCL / .TRUE./ "fill PHEVCL"Contains the flags that control how the reconstruction is done.
Normally one would not reconstruct events interactively since it requires a fair amount of CPU. However in this case since we will only reconstruct a couple of events so it is ok.
In your other x window get an Ida session running. To do this issue the command IDA at the VMS prompt.
Ida> PROCESSOR KALKLU Ida> PROCESSOR RECSLDA couple of screens worth of messages should scroll by as the processor loads. Don't worry it takes a few minutes.
Now we want to set what system will be reconstructed. For the purpose of this exercise let us turn the Crid and End Cap Drift chamber off. Also it is pointless to link the Monte Carlo particles to the PHPART bank since we will be using real data. To turn the crid reconstruction and MCPART linkage off all we have to do is:
Ida> POKE RECSLDP.CRID F Ida> POKE RECSLDP.LINK FTurning off the Endcap Drift Chamber takes a little detective work since RECSLDP only has a flag for DC and we want to keep the barrel on. Remember RECSLD is a composition of many different processors, so we must find the appropriate one and poke its control bank to turn the endcap DC off. The easiest way to do this in your x window not running ida get a copy of RECSLD.PREPMORT. So from the VMS command line type.
EVE DUCSSEARCH:RECSLD.PREPMORTYou should see a section in the header that looks like this.
Defined stages: " " " " Stage Driver Description " " ----------- ------ -------------------------------- " " " " Prepare RPREP Prepare raw data for recon start " " " " DC TRKREC Tracking " " " " Extrapolate REXTRA Extrapolate tracking info thru SLD " " " " CRID CRDREC CRID processing " " " " KAL KALREC KAL processing " " " " WIC WUGETXY WIC processing " " " " MATCH WUFIND Muon Identification " " " " FILL PHFILL fill PHPART etc " " " " PID PHPID do particle ID from DST " " " " LINK PHMCLK link PHPART <--> MCPART " " " " BEAM RECBM fill PHBEAM " " "From this we see the driver for the DC reconstruction is TRKREC. So we want to look at the template TRKRECP.TEMPLATE . To do this at the VMS command line issue:
EVE DUCSSEARCH:TRKRECP.TEMPLATEOr from the command line of the editor (hit the Do key to get there)
GET DUCSSEARCH:TRKRECP.TEMPLATEYou should see some lines that say:
LOGICAL DBREC /.TRUE./ "Do DB reconstruction" LOGICAL DEREC /.TRUE./ "Do DE reconstruction" LOGICAL TRKBLD /.TRUE./ "Do track association" LOGICAL VXRECON /.TRUE./ "Do VTX detector reconstruction"So now we see the variable we want to poke is DEREC. So from the IDA command line type.
Ida> POKE TRKRECP.DEREC FNow we must create a Seglist for our Mini-DST output file.
Ida> SEGLIST CREATE OUTLIST MINIDSTNow our EVANAL is quite simple all we have to do is call our processors and give the write command.
Ida> DEF EVANAL Ida> CALL KALKLU(DOIT) Ida> CALL RECSLD(DOIT) Ida> WRITE USING OUTLIST Ida> ENDDEFNow before we can give a GO we must specify the dataset to be reconstructed and the tape to write the output to. Assuming you did the exercise An Ida Job to Write to Your Own Tape the first file on your tape is used. So we will write to the second file your_tape_id.2 .
Ida> OPENTAPE READ NURAW94 STAGE WAIT Ida> OPENTAPE WRITE your_tape_id.2/MDSTREC Ida> GO 2 Ida> INDEX Ida> CLOSE INFILE Ida> CLOSE OUTFILEWe see when we type index that we now have reconstructed DST/MDST banks.
PROCESSOR KALKLU !declare and initialize processors. PROCESSOR RECSLD !for Raw Data KALKLU must be called first. POKE RECSLDP.CRID F !turn crid reconstruction off POKE RECSLDP.LINK F !turn mcpart link off POKE TRKRECP.DEREC F !turn end cap drift reconstruction off SEGLIST CREATE OUTLIST MINIDST !set up context for writing DEF EVANAL CALL KALKLU(DOIT) !digitize the data CALL RECSLD(DOIT) !reconstruct the event WRITE USING OUTLIST !write out the minidst of the rec event ENDDEF OPENTAPE READ NURAW94 STAGE WAIT !open input raw data file OPENTAPE WRITE your_tape_id.2/MDSREC !open output file GO 2 !run for 2 events CLOSE INFILE !close input file CLOSE OUTFILE !dismount tape