Re: Proposal for T4-T5 unpacking format

From: Christian Holm Christensen (cholm@hehi03.nbi.dk)
Date: Fri Mar 23 2001 - 07:27:38 EST

  • Next message: Konstantin Olchanski: "Re: Proposal for T4-T5 unpacking format"

    On Thu, 22 Mar 2001 22:47:39 -0500
    Konstantin Olchanski <olchansk@ux1.phy.bnl.gov> wrote
    concerning ": Proposal for T4-T5 unpacking format":
    > 
    > prompt wires 1 through 99 are defined as channel numbers 1 through
    > 99 (same as T3). delayed wires 1 through 99 are defined as channel
    > numbers 101 through 199. 
    
    Since the TDC records are 8 bit objects, why not split it into two 4
    bit "psuedo-object", so that prompt channel numbers are in the lower 4
    bits, and delayed channel numbers are in the upper 4 bits. 
    
    I.e., channel 4 is "wire 5, prompt" and channel 149 means "wire 22,
    delayed". 
    
    In this way, you only need to do a shift of bits, 
    
      UShort_t ch = number_from_daq; 
      if (delayed) 
        ch <<= 4; 
    
    rather then a more expensive modulus calculation: 
    
      UShort_t ch = number_from_daq; 
      if (delayed) 
        ch %= 100; 
    
    I believe using the bit shift is more "natural". And if you really
    want to start in 0 rather then 1, you can just add 1 afterwards. 
    
    BTW, IMHO, I think the 1 based scheme is enterily
    confusing. Everything else that we do is zero based, so why not have
    the ADC/TDC channels be zero based as well? 
    
    Anyway, that's my two pennies worth. 
    
    Christian  -----------------------------------------------------------
    Holm Christensen                             Phone:  (+45) 35 35 96 91 
      Sankt Hansgade 23, 1. th.                  Office: (+45) 353  25 305 
      DK-2200 Copenhagen N                       Web:    www.nbi.dk/~cholm    
      Denmark                                    Email:       cholm@nbi.dk
    



    This archive was generated by hypermail 2b29 : Fri Mar 23 2001 - 07:28:06 EST