How to write AC++ code to read XFFD and XFLD bank?

How to write AC++ code to read XFFD and XFLD bank?


Sometimes, You feel that you need to read XFFD and XFLD bank using AC++ modules. "TriggerObjects" CDF RunII package provides various classes to access each storable bank information. If you want to access XFFD or XFLD bank, you need to use "XFFD_StorableBank" or "XFLD_StorableBank" class. This classes provide several accessors which are methods to get information from such banks. Followings are the explanation about how to use such accessors for appropriate purposes.

1. Accessors for XFLD_StorableBank


int get_board(const ConstBlockIterTDC& card) returns XFT Linker board number (0 to 23)
int get_block(const ConstBlockIterTDC& card)
returns XFT Linker crate index (0 to 2)
int get_slot(const ConstBlockIterTDC& card)
returns XFT Linker slot number in each crate (4 to 18)
int get_phiIndex(const ConstBlockIterTDC& card, int chipOffset)
returns index corresponding to phi location of Linker chip (0 to 287 starting from 0 degree of detector)
int get_ptBin(const ConstBlockIterTDC& card, int chipOffset)
returns XFT Linker track pt bin value
int get_localPhiSL6(const ConstBlockIterTDC& card, int chipOffset)
returns XFT Linker track phi bit(within one Linker chip) catched in SL6.
int get_isolation(const ConstBlockIterTDC& card, int chipOffset)
returns isolation bit
int get_short(const ConstBlockIterTDC& card, int chipOffset)
returns short track bit
double get_ptValue(const ConstBlockIterTDC& card, int chipOffset)
returns pt value of Linker track
double get_absPhiSL6(const ConstBlockIterTDC& card, int chipOffset)
returns absolute phi value of linker track catched at SL6.

  • argument chipOffset is chip index in each linker board (0 to 11)
  • 2. How to write linker code in AC++ module
    Here an example of how to write with card iterator.


    for (EventRecord::ConstIterator iter( record, "XFLD_StorableBank" ); iter.is_valid() ; ++iter) {
    ConstHandle<XFLD_StorableBank> handle(iter);
    for(ConstBankIterTDC block(handle); block.is_valid(); ++block) {
    for(ConstBlockIterTDC card(block); card.is_valid(); ++card) {
    int l = handle->get_block(card) ;
    int nc = handle->get_board(card)%8 ;
    for (int word = 0 ; word < 60 ; word ++){
    int linker_word = card.data_word(word);
    }
    for (int chip = 0 ; chip < 12 ; chip ++){
    double ptvalue = handle->get_ptValue(card, chip);
    }
    }
    }
    }
  • As you can see above, if you want to extract data word itself, use data_word method of card iterator.

    3. Accessors for XFFD_StorableBank
    Finder doesn't provide high level physical variables, so it has only limited kinds of accessors.
    Following accessors can be used in very similar fashion with linker case above.

    int get_board(const ConstBlockIterTDC& card) returns XFT Finder board number (caution! it runs 0 to 7)
    int get_block(const ConstBlockIterTDC& card)
    returns XFT Finder crate index (0 to 5)
    int get_slot(const ConstBlockIterTDC& card)
    returns XFT Finder slot number in each crate (4 to 20)

  • In Finder case, you can still use data_word method of card iterator.