CMS 3D CMS Logo

Static Public Member Functions

DTExpandMap Class Reference

#include <DTExpandMap.h>

List of all members.

Static Public Member Functions

static void expandSteering (std::ifstream &file)

Detailed Description

Description: Class to build full readout map from compact map

Date:
2009/03/26 14:11:03
Revision:
1.1
Author:
Paolo Ronchese INFN Padova

See header file for a description of this class.

Date:
2012/01/29 11:23:50
Revision:
1.2
Author:
Paolo Ronchese INFN Padova

Definition at line 29 of file DTExpandMap.h.


Member Function Documentation

void DTExpandMap::expandSteering ( std::ifstream &  file) [static]

Definition at line 83 of file DTExpandMap.cc.

References gather_cfg::cout, def, DTMapEntry::k1, DTMapEntry::k2, DTMapEntry::k3, DTMapEntry::k4, DTMapEntry::k5, combine::key, DTMapEntry::v1, DTMapEntry::v2, DTMapEntry::v3, DTMapEntry::v4, DTMapEntry::v5, and DTMapEntry::v6.

                                                    {

  std::vector<int> key;
  int k1;
  int k2;
  int k3;
  int k4;
  int k5;
  int v1;
  int v2;
  int v3;
  int v4;
  int v5;
  int v6;

  std::vector<DTMapEntry> entryList;
  while ( file >> k1 >> k2 >> k3 >> k4 >> k5
               >> v1 >> v2 >> v3 >> v4 >> v5 >> v6 ) {
    std::vector<int> key;
    key.push_back( k1 );
    key.push_back( k2 );
    key.push_back( k3 );
    key.push_back( k4 );
    key.push_back( k5 );
    DTMapEntry currentEntry( k1, k2, k3, k4, k5,
                             v1, v2, v3, v4, v5, v6 );
    entryList.push_back( currentEntry );
  }

  int ddu;
  int ros;
  int rch;
  int tdc;
  int tch;
  int whe;
  int sta;
  int sec;
  int rob;
  int qua;
  int lay;
  int cel;
  int mt1;
  int mi1;
  int mt2;
  int mi2;
  int def;
  int wha;
  int sea;
  std::vector<DTMapEntry>::const_iterator iter = entryList.begin();
  std::vector<DTMapEntry>::const_iterator iend = entryList.end();
  std::vector<DTMapEntry>::const_iterator iros = entryList.end();
  std::vector<DTMapEntry>::const_iterator irob = entryList.end();
  while ( iter != iend ) {
    const DTMapEntry& rosEntry( *iter++ );
    if ( rosEntry.k1 > 0x3fffffff ) continue;
    ddu = rosEntry.k1;
    ros = rosEntry.k2;
    whe = rosEntry.v1;
    def = rosEntry.v2;
    sec = rosEntry.v3;
    rob = rosEntry.v4;
    mt1 = rosEntry.v5;
    mi1 = rosEntry.v6;
    iros = entryList.begin();
    while ( iros != iend ) {
      wha = whe;
      sea = sec;
      const DTMapEntry& rchEntry( *iros++ );
      if ( ( rchEntry.k1 != mt1 ) ||
           ( rchEntry.k2 != mi1 ) ) continue;
      rch =  rchEntry.k3;
      if (   rchEntry.v1 != def   ) wha = rchEntry.v1;
      sta =  rchEntry.v2;
      if (   rchEntry.v3 != def   ) sea = rchEntry.v3;
      rob =  rchEntry.v4;
      mt2 =  rchEntry.v5;
      mi2 =  rchEntry.v6;
      irob = entryList.begin();
      while ( irob != iend ) {
        const DTMapEntry& robEntry( *irob++ );
        if ( ( robEntry.k1 != mt2 ) ||
             ( robEntry.k2 != mi2 ) ) continue;
        if (   robEntry.k3 != rob   ) {
          std::cout << "ROB mismatch " << rob << " "
                                       << robEntry.k3 << std::endl;
        }
        tdc =  robEntry.k4;
        tch =  robEntry.k5;
        qua =  robEntry.v4;
        lay =  robEntry.v5;
        cel =  robEntry.v6;
        std::cout << ddu << " "
                  << ros << " "
                  << rch << " "
                  << tdc << " "
                  << tch << " "
                  << wha << " "
                  << sta << " "
                  << sea << " "
                  << qua << " "
                  << lay << " "
                  << cel << std::endl;
      }
    }
  }

  return;

}