SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

34
1 M. Ellis - 17th May 2007 SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over) VLSB Data (unpacking to AFE, MCM, Chan) VLPC Cassette (AFE, MCM, Chan -> Module, Channel) External Waveguide (Module, Channel -> Patch Panel channel) Internal Waveguide (WG, Patch Panel Channel -> Station Connector, Channel) Station (Station Connector, Channel - > Tracker, Station, Plane, Fibre) Station 5

description

SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over). VLSB Data (unpacking to AFE, MCM, Chan) VLPC Cassette (AFE, MCM, Chan -> Module, Channel) External Waveguide (Module, Channel -> Patch Panel channel) - PowerPoint PPT Presentation

Transcript of SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

Page 1: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

1M. Ellis - 17th May 2007

SciFi Decoding(Everything you never wanted to

know but couldn’t avoid going over and over)

VLSB Data (unpacking to AFE, MCM, Chan)

VLPC Cassette (AFE, MCM, Chan -> Module, Channel)

External Waveguide (Module, Channel -> Patch Panel channel)

Internal Waveguide (WG, Patch Panel Channel -> Station Connector, Channel)

Station (Station Connector, Channel -> Tracker, Station, Plane, Fibre)

Station 5

Page 2: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

2M. Ellis - 17th May 2007

VLSB Data Unpacking

The VLSB boards read out one AFEIIT board each. There are 4 LVDS links per board, each transferring

data in parallel to a corresponding block of memory on the VLSB.

The 8 MCMs on an AFE board are grouped in pairs, and assuming the LVDS cables are attached correctly, then the connections are:

Memory Bank 0: MCMs 1 and 2 Memory Bank 1: MCMs 3 and 4 Memory Bank 2: MCMs 5 and 6 Memory Bank 3: MCMs 7 and 8

The data is readout as 32 bit words. The 21 least significant bits of these words are the

data that has been transferred over the LVDS. The 2 ADC values (for each of the two MCMs) are

packed into these 21 bit words.

Page 3: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

3M. Ellis - 17th May 2007

Page 4: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

4M. Ellis - 17th May 2007

Code to unpack Data

Lives in G4MICE in the RealData area. VlsbReadout2006.cc decodes the data taken with the

current firmware. Good events have header words that contain the

number 237 in the position where ADCs should be on all 8 MCMs before the start of good data.

Once this is found, the data is presented in the form address, ADC, address, ADC.

The code to unpack the lower and upper ADC values (e.g. MCMs 1 and 2) is below:

up = ( mod & 0x7f800 ) >> 11; low = ( mod & 0x1fe ) >> 1;

Page 5: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

5M. Ellis - 17th May 2007

ADC Values

In the current firmware the ADC values are grey encoded. This means that once the values have been determined from

the masking procedure on the previous slide, the grey encoding needs to be undone.

This is achieved with the following code:

// graydecode routine taken from wikipedia entry on gray codes//

http://en.wikipedia.org/wiki/Gray_code#Programming_algorithms

unsigned int VlsbReadout2006::graydecode( unsigned int gray ){ unsigned int bin;

for( bin = 0; gray; gray >>= 1 ) bin ^= gray;

return bin;}

Page 6: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

6M. Ellis - 17th May 2007

Channel assignment

The data does not come off the AFE board in the order of channel numbering (i.e. 1 to 64).

Instead it comes off in the order:63, 61, 59, 57, 55, 53, 52, 50, 48, 46, 44, 42, 40, 39, 37, 35, 34, 33, 36, 38, 41, 43, 45, 47, 49, 51, 54, 56, 58, 60, 62, 64, 1, 3, 5, 7, 9, 11, 14, 16, 18, 20, 22, 24, 27, 29, 32, 31, 30, 28, 26, 25, 23, 21, 19, 17, 15, 13, 12, 10, 8, 6, 4, 2

Once the VlsbReadout2006 class has unpacked an event, the result will be 512 VlpcHit objects for each AFE board, each of which will have an AFE board number (recorded in the data file), an MCM and channel number and the ADC counts for that channel.

Page 7: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

7M. Ellis - 17th May 2007

Verification of this stage

The correctness of this code has been checked on a number of occasions by using the self injection mechanism of the TRIP-t chip.

The TRIP-t chip is programmed to inject charge onto one channel of each TRIP chip (16 per board) such that each TRIP (and hence each MCM) has charge on a different chip.

This has also been done simultaneously on a LHB and RHB such that all 32 TRIPs had signal on a different channel.

The data file produced was analysed and the Board ID, MCM and channel of all hits that were found to be well above pedestal was found to agree exactly with those channels that had charge injected onto them.

So I am confident that when the data is unpacked, the board, MCM, channel and ADC values are all correct.

Page 8: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

8M. Ellis - 17th May 2007

LVDS Links

In order to ensure that the LVDS links are connected correctly, the VLSB modules should be watched as the AFE boards are programmed.

As each of the DFPGAs on a board are programmed, the pair of red LEDs near the corresponding AFPGAs will light up.

When they do, the corresponding LED on the VLSB will change from Red to Green.

If the sequence of changing from Red to Green is correct, then the LVDS cables have been attached correctly.

Page 9: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

9M. Ellis - 17th May 2007

VLPC Cassette

A VLPC Cassette contains 1024 channels. These are broken up into 8 128 channel modules. Each cassette is readout by two AFEIIt boards (one

Left Hand Board and one Right Hand Board). The 128 channels of a given module are read out by

one MCM of the LHB (64 channels) and one MCM of the RHB (the other 64 channels).

The VLPC cassette modules are numbered from 1 to 8, with 1 being that closest to the backplane and 8 being that farthest from the backplane.

The MCMs on a board are numbered 1 to 8, but the numbering with respect to the backplane depends on which side of the cassette the board is on.

Page 10: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

10M. Ellis - 17th May 2007

Module vs MCM Numbers

BackPlane

Mod 1

Mod 8

Left H

and B

oard

Rig

ht H

and B

oard

MC

M 1

MC

M 8

MC

M 1

MC

M 8

Page 11: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

11M. Ellis - 17th May 2007

LHB & RHB -> VLPC Channel

The mapping between a given channel on a VLPC module connector (i.e. the fibre that takes the light to the VLPC) and the electronic channel (which channel on an MCM on a LHB or RHB) involves some internal transformations inside the cassette/AFE system.

This mapping is described in a D0 document in terms of the SVX channel number on a module.

The following slides will show the D0 numbering scheme, and how the readout order can be determined with respect to this scheme.

Page 12: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

12M. Ellis - 17th May 2007

D0 Warm End Connector

View from above, backplane in the background

Pin is on the backplane end of the connector.

First overlay shows the numbering assigned to the fibres that we will call the “D0 numbering scheme”.

Second overlay shows a sample of the SVX channel assignment to the same fibres.

Note that the SVX channel numbers are repeated on the Left and Right halfs of the cassette.

1 17 1131 17 113

16 32 16 32 128128

41 9241 92

92 87 92 87 4141

Page 13: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

13M. Ellis - 17th May 2007

SVX Channel Assignments

We can now make a mapping between the fibre numbers defined on the previous slide (1-128) and these SVX channels for the LHB and RHB.

There is also a separate map showing the channel number on the MCM for each SVX channel (next slide...)

Page 14: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

14M. Ellis - 17th May 2007

128 Way Connector -> SVX Channel -> MCM Channel

Page 15: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

15M. Ellis - 17th May 2007

128 Way Warm End Connector

So it is now possible to take a hit on a known channel of a given MCM on a left or right hand board and determine which of the 128 fibres of a given module that corresponds to.

Example 1: LHB, MCM 2, Channel 10 MCM 2 on a LHB is Module 2 on the Cassette. Channel 10 on a LHB is SVX Channel 110 and is Fibre 43

on the warm end connector on the cassette. Example 2: RHB, MCM 2, Channel 45

MCM 2 on a RHB is Module 7 on the Cassette. Channel 45 on a RHB is SVX Channel 47 and is Fibre 125

on the warm end connector on the cassette. On the following slide, the module and fibre on that

module are identified for these two examples.

Page 16: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

16M. Ellis - 17th May 2007

Warm End Connector Example 1

Module 2

Fibre 43

Page 17: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

17M. Ellis - 17th May 2007

Warm End Connector Example 2

Module 7

Fibre 125

Page 18: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

18M. Ellis - 17th May 2007

Implementation in G4MICE

The VlpcCableImperial class reads in two text files (readout-left and readout-right) which contain the mapping between channel on an MCM and the fibre number on the connector.

The AFEIIt versions are called: readout-left.v2.txt readout-right.v2.txt

These files list the MCM channel ID followed by the corresponding fibre number:

TYPE = READOUT-LEFTVERSION = 12 May 2007

# MCM CHANNEL ID = HOLE ID OF EXTERNAL WAVEGUIDE @ READOUT-END

36 = 139 = 242 = 345 = 452 = 5

...

Page 19: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

19M. Ellis - 17th May 2007

Verification of this stage

Other than by inspecting the documents from D0, the mapping from AFE channel to module and fibre number on the warm end connector has not been verified.

Perhaps it is worth taking LED data with most of the fibres masked off to check that this stage is correct?

We could pick 16 different channels and mask off all but two channels (one on each side of the cassette) on each of the 8 modules and take some LED data and then look to see that the MCM, channel and board numbers of the channels that show light match the fibre numbers that were exposed to the light according to these readout files.

Page 20: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

20M. Ellis - 17th May 2007

External Waveguide

The External and Internal Waveguides and Patch Panel connection have a numbering system that is internally consistent and which has been checked by the Osaka group as the waveguides are constructed.

The numbers assigned to the 128 fibres on the D0 warm end connector on the external waveguide are not the same as those already shown for the corresponding connector on the VLPC cassette.

It is necessary to make a translation from the fibre number on the VLPC cassette to the fibre number on the D0 end of the external waveguide.

Page 21: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

21M. Ellis - 17th May 2007

VLPC Cassette vs D0 Connector on WG

Page 22: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

22M. Ellis - 17th May 2007

VLPC Cassette vs D0 Connector on WG

1 2 3 4 5 6 7 8

121 122 123 124 125 126 127 128

Dowel

1 1131 113

1616 128128

Hole

Page 23: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

23M. Ellis - 17th May 2007

Patch Panel Connector

The Patch Panel connector has 128 fibres and the numbering scheme is identical to that on the 128 way D0 connector.

So fibre 1 on the D0 connector of the external waveguide is connected to fibre 1 of the patch panel connector on the same waveguide and so on:

1 2 3 4 5 6 7 8

121 122 123 124 125 126 127 128

Page 24: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

24M. Ellis - 17th May 2007

Internal Waveguide

The Patch Panel connector of the internal waveguide has 128 fibres.

The station connector side consists of 6 individual bundles of between 20 and 22 fibres.

1-20

21-42

43-64

65-86

87-108

109-128

1

2

3

4

5

6

1-128

Page 25: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

25M. Ellis - 17th May 2007

Internal Waveguide Connections

The channels on the 128 way interface have the mapping shown below to each of the 6 station connectors.

The channel numbering on the station connector is also shown:

1 - 20

1 - 22

1 - 22

1 - 22

1 - 22

1 - 20

1-1

1-2

1-3

1-4

1-5

1-6

Station Connector

Page 26: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

26M. Ellis - 17th May 2007

Station Connections

The station connectors can in theory be attached to any of the station connectors on a station.

For station 5, the 5 waveguides’ station connectors were numbered from 1 to 30 and corresponding numbers were marked on the station:

Page 27: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

27M. Ellis - 17th May 2007

Station Connectors

Plane V used Station Connectors 1- 10

Plane X used Station Connectors 11 – 20

Plane W used Station Connectors 21 – 30

The station connector numbering increased clockwise when the station is viewed as shown on the photo in the previous slide.

Page 28: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

28M. Ellis - 17th May 2007

Fibre Numbering

Each bundle of seven 350 m fibres will be referred to as a “fibre”.

The detailed description of the mapping of the fibres from the plane to the station connector can be found here:

http://mice.iit.edu/modules/tracker/html/TrackerAssembly/QA/Visio-view-v.pdf

http://mice.iit.edu/modules/tracker/html/TrackerAssembly/QA/Visio-view-x.pdf

http://mice.iit.edu/modules/tracker/html/TrackerAssembly/QA/Visio-view-w.pdf

Page 29: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

29M. Ellis - 17th May 2007

Page 30: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

30M. Ellis - 17th May 2007

Page 31: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

31M. Ellis - 17th May 2007

Page 32: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

32

Implementation in G4MICE

All of the connections that have been shown on the previous slide are described in another file that is used by the VlpcCableOsaka class:

TYPE = WAVEGUIDEVERSION = 11 May 2007

# STATION FIBRE: station, view, fibre id =# STATION CONNECTOR: connector id, hole id =# INTERNAL WAVEGUIDE @ STATION: waveguide id, connector id, hole id =# INTERNAL WAVEGUIDE @ PATCH-PANEL: hole id =# EXTERNAL WAVEGUIDE @ PATCH-PANEL: waveguide id, hole id =# EXTERNAL WAVEGUIDE @ READOUT-END: hole id

# station 5, view V5 0 1 = 1 1 = 1 1 1 = 1 = 1 128 = 1135 0 2 = 1 2 = 1 1 2 = 2 = 1 120 = 1145 0 3 = 1 3 = 1 1 3 = 3 = 1 112 = 1155 0 4 = 1 4 = 1 1 4 = 4 = 1 104 = 1165 0 5 = 1 5 = 1 1 5 = 5 = 1 96 = 1175 0 6 = 1 6 = 1 1 6 = 6 = 1 88 = 1185 0 7 = 1 7 = 1 1 7 = 7 = 1 80 = 119

Page 33: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

33M. Ellis - 17th May 2007

Waveguide Connections

Another file is used to describe which external waveguide is connected to which module on a given VLPC cassette:

TYPE = FIBRE-CASSETTEVERSION = 21 March 2007

# EXTERNAL WAVEGUIDE ID = CASSETTE ID, MODULE ID = AFE LEFT ID, AFE RIGHT ID 1 = 105 8 = 574264 574359 2 = 105 7 = 574264 574359 3 = 105 6 = 574264 574359 4 = 105 5 = 574264 574359 5 = 105 4 = 574264 574359# eof

Page 34: SciFi Decoding (Everything you never wanted to know but couldn’t avoid going over and over)

34M. Ellis - 17th May 2007

Decoding Setup

A final text file is used to select which version of each of the previously described files should be used in combination to achieve the decoding:

#########

RO_RIGHT = readout-right.v2.txtRO_LEFT = readout-left.v2.txtCONNECTION = fibre2cassetteStation5.V3.txtFIBRE_MAP = cabling_station5test.V4.dat

# eof