FNAL 866 fastTrigger Documentation ddk/pmn 6/14/96 So you want to make a new hodoscope trigger -- =========================================== 1. The DIAGNOSTIC TRACK CORRELATOR allows you to compose a wide variety of hodoscope trigger patterns. All you need to do is to modify the contents of the SRAM in the DIAGNOSTIC TRACK CORRELATOR. The following steps will take you through this process. Once you are familiar with the process, you can skip past the examples and descriptive information, beginning at step (4). 2. The input bits you can use to make up your trigger are any of the following 14 hodoscope bank-OR's: Y1L, Y1R, X1L, X1R, Y2L, Y2R, Y3L, Y3R, X3L, X3R, Y4L, Y4R, X4L, X4R 3. You have the option to define 4 entirely different and independent triggers simultaneously in the DIAGNOSTIC TRACK CORRELATOR. Write out your four triggers, (if you are interested in less than four, that's OK) in Boolean logic using the symbolic notation shown below. An example follows: Suppose you want to form a trigger consisting of the coincidence of Y1L*Y2L .OR. Y1L*Y3L .OR. Y1L*Y4L but veto if there are any hits in any of the Y1R, Y2R, Y3R, Y4R. You don't care whether or not there are any hits in the XnL or XnR bank-OR's. This would then be written as: ((Y1L*Y2L) + (Y1L*Y3L) + (Y1L*Y4L)) * (! Y1R) * (! Y2R) * (! Y3R) * (! Y4R) where: * == AND + == OR ! == NOT For the bank-OR's not mentioned, their hit (no-hit) status will be ignored. 4. Now, follow the steps (a) through (f) to prepare your new trigger. a) Log into fn866 -- username: e866 -- NOTE: If you do not login as e866, a command you will need noted below will not be recognized. b) Go to your preferred directory in which you want to store the file which will contain your trigger information. c) copy the diagnostic track correlator trigger configuration file to your directory as follows: fn866 % cp ~e866/pnord/e866ol/camacDevices/cfg/cosmicTrig.diag7 yourFile d) use your favorite editor to modify this file as shown below. [Skip to step (e) if you are familiar with this step.] In this example we have elected to use the first output trigger bit for our new trigger - called diag1 - and we will leave the other three triggers as they were when we found the file. NOTE: If you do not want to trigger on the other three defined triggers, set their prescale value (see below) to zero. - the line in the file -- diag1 = 1 OF means that trigger "diag1" will have a prescale factor of 1 of "any", i.e., we accept every one. If you wanted to prescale this by 100, you would change this to: diag1 = 100 OF If you wanted to turn _off_ a given trigger, set the prescale value to diag1 = 0 OF - Here's the file -- /* Diagnostic trigger Mask specification file */ /* -- put your comments (and date) here for your reference */ /* */ #define diag1 trig0 #define diag2 trig1 #define diag3 trig2 #define diag4 trig3 #define Y1L bit0 #define Y1R bit1 #define X1L bit2 #define X1R bit3 #define Y2L bit4 #define Y2R bit5 #define Y3L bit6 #define Y3R bit7 #define X3L bit8 #define X3R bit9 #define Y4L bit10 #define Y4R bit11 #define X4L bit12 #define X4R bit13 diag1 = 1 OF ((Y1L*Y2L) + (Y1L*Y3L) + (Y1L*Y4L)) * (! Y1R) * (! Y2R) * (! Y3R) * (! Y4R); diag2 = 1 OF (Y1L + X1L) * Y2L; diag3 = 1 OF (Y1R + X1R) * Y2R; diag4 = 25 OF (Y2R + Y2L); /* end of file */ e) Now, run the parsing program by typing: fn866 % trigParse filename [Skip to step (f) if you are familiar with the parsing operation.] This step will produce the trigger mask patterns which will be used to calculate and load the appropriate contents into all the 2**16 SRAM locations in the DIAGNOSTIC TRACK CORRELATOR. The file will have the same name as above, but with an *.out suffix. It will look like the following: TRIG0 = 1 OF ****0***0*01**01 ****0***010***01 ****01**0*0***01 ; TRIG1 = 1 OF ***********1***1 ***********1*1** ; TRIG2 = 1 OF **********1***1* **********1*1*** ; TRIG3 = 25 OF **********1***** ***********1**** ; NOTE: The parsing program rigorously checks the input and will inform you of errors (unmatched parentheses, an unrecognized character, etc.) The error messages can be vague, e.g., Syntax error Syntax error which means - "you have a problem; fix it!" You can also look at the above mask patterns and verify that they represent what you intended as allowable triggers. f) One last step here - you need to tell the program where to find your edited file. fn866 % cd ~e866/pnord/e866ol/camacDevices/bin Edit the file called tcAlternate.cfg to have the full pathname to your configuration file. The file would then appear as: diagTc your/directory/tree/yourFile.out 5. You are now ready to LOAD your new trigger(s) into the DIAGNOSTIC TRACK CORRELATOR. a) Log into the VME VxWorks by fn866 % telnet vuvme1 b) If the VME system has been running, type: -> ftmReconfigure -> < tcLoadAllScript -> < tmLoadAllScript #This line is not _required_ since the trigger matrix modules are loaded as before. and your new trigger(s) will be downloaded into the DIAGNOSTIC TRACK CORRELATOR and subsequently verified to see that all 2**16 locations in the SRAM were loaded correctly and that the proper prescale factors were also set. c) If no errors appear on the screen during the ftmReconfigure, you are ready to proceed to take data. d) If an error does appear (e.g., the VME system crashes) you might try - -> reboot which will no only reload all of the VxWorks, but also reload the default onfiguration file as well as your tcAlternate.cfg. You should then type -> < tcLoadAllScript -> < tmLoadAllScript #This line is not _required_ since the trigger matrix modules are loaded as before. NOTE: If you do _not_ want to use a specific alternate configuration file you should remove the filename from the tcAlternate.cfg file. (Edt appears not to allow you to save an empty file.) One method of doing this is to fn866 % rm tcAlternate.cfg fn866 % touch tcAlternate.cfg You will see that this is an empty file if you fn866 % cat tcAlternate.cfg Do you want to change or verify some trigger configuration? ========================================================== There are a set of useful scripts which will invoke routines in the fastTriggerMaster. They are easily executed once you are logged into the VME. 1. Log into the VME VxWorks by fn866 % telnet vuvme1 2. Select from the following list of script names which you want to execute. The first three are operations on the Trigger Matrices. The next three are operations on the Track Correlator modules. The last one is an operation on the discriminator modules. SCRIPT NAME FUNCTION(S) CARRIED OUT ================== ================================================ tmLoadAllScript Loads configured Trigger Matrix patterns tmClearAllScript Loads zeros in all Trigger Matrix modules tmVerifyAllScript Verifies contents of all Trigger Matrix Modules tcLoadAllScript Loads configured Track Correlator patterns tcClearAllScript Loads zeros in all Track Correlator modules tcVerifyAllScript Verifies contents of all Track Correlator modules discSetAllScript Sets bit mask on all discriminators to DISC_MASK ** ** You must first set the value of DISC_MASK by issuing the following command: -> DISC_MASK = 0xFFFF #This will load all 16 bits in each discrim as 1. -> DISC_MASK = 0x0000 #This will load the 16 bits in each discrim as 0. -> DISC_MASK = .... #Or, enter your favorite 16 bit combination whick will #be repeated in every hodoscope discriminator 3. To execute these scripts from the VxWorks shell, type (example): -> < tcLoadAllScript These scripts are resident on fn866.fnal.gov. They are located in the directory which contains the VxWorks shell (from which the VME M167 is booted) and is the default reference directory. The leading "<" in the above line serves as a redirection operator, pointing the VxWorks shell to the proper fn866 (default) directory in which the scripts will be found. This (example) command will cause the VxWorks shell to open the file "tcLoadAllScript" and execute the instructions listed therein as if they had been typed in from the shell at the console.