CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

L1RCTORCAMap Class Reference

#include <L1RCTORCAMap.h>

List of all members.

Public Member Functions

unsigned short combine (unsigned short et, unsigned short fg)
std::vector< unsigned short > combVec (std::vector< unsigned short > et, std::vector< unsigned short > fg)
std::vector< std::vector
< std::vector< unsigned short > > > 
giveBarrel ()
std::vector< std::vector
< unsigned short > > 
giveHF ()
 L1RCTORCAMap ()
void makeBarrelData ()
void makeHFData ()
std::vector< int > orcamap (int eta, int phi)
void readData (std::vector< unsigned > emet, std::vector< unsigned > hdet, std::vector< bool > emfg, std::vector< bool > hdfg, std::vector< unsigned > hfet)

Private Member Functions

std::vector< int > highEtaMap (int eta, int phi)
std::vector< int > lowEtaMap (int eta, int phi)

Private Attributes

std::vector< std::vector
< std::vector< unsigned short > > > 
barrelData
std::vector< unsigned short > combEM
std::vector< unsigned short > combHD
std::vector< std::vector
< unsigned short > > 
hfData
std::vector< unsigned short > rawEMET
std::vector< unsigned short > rawEMFG
std::vector< unsigned short > rawHDET
std::vector< unsigned short > rawHDFG
std::vector< unsigned short > rawHFET

Detailed Description

Definition at line 6 of file L1RCTORCAMap.h.


Constructor & Destructor Documentation

L1RCTORCAMap::L1RCTORCAMap ( )

Definition at line 6 of file L1RCTORCAMap.cc.

References barrelData, combEM, combHD, hfData, rawEMET, rawEMFG, rawHDET, rawHDFG, and rawHFET.

                          {
  rawEMET = std::vector<unsigned short>(56*72);
  rawHDET = std::vector<unsigned short>(56*72);
  rawEMFG = std::vector<unsigned short>(56*72);
  rawHDFG = std::vector<unsigned short>(56*72);
  rawHFET = std::vector<unsigned short>(8*18);
  combEM = std::vector<unsigned short>(56*72);
  combHD = std::vector<unsigned short>(56*72);

  barrelData = std::vector<std::vector<std::vector<unsigned short> > >(18,std::vector<std::vector<unsigned short> >(7,
                                                           std::vector<unsigned short>(64)));
  hfData = std::vector<std::vector<unsigned short> >(18,std::vector<unsigned short>(8));
  
}

Member Function Documentation

unsigned short L1RCTORCAMap::combine ( unsigned short  et,
unsigned short  fg 
)

Definition at line 67 of file L1RCTORCAMap.cc.

Referenced by combVec().

                                                                        {
  unsigned short newfg = fg << 8;
  return newfg + et;
}
vector< unsigned short > L1RCTORCAMap::combVec ( std::vector< unsigned short >  et,
std::vector< unsigned short >  fg 
)

Definition at line 72 of file L1RCTORCAMap.cc.

References bookConverter::comb, combine(), and i.

Referenced by readData().

                                                                          {
  std::vector<unsigned short> comb(56*72);
  for(int i = 0; i<(int)et.size(); i++)
    comb.at(i) = combine(et.at(i),fg.at(i));
  return comb;
}
vector< std::vector< std::vector< unsigned short > > > L1RCTORCAMap::giveBarrel ( )

Definition at line 20 of file L1RCTORCAMap.cc.

References barrelData.

                                                                       {
  return barrelData;
}
vector< std::vector< unsigned short > > L1RCTORCAMap::giveHF ( )

Definition at line 24 of file L1RCTORCAMap.cc.

References hfData.

                                                       {
  return hfData;
}
vector< int > L1RCTORCAMap::highEtaMap ( int  eta,
int  phi 
) [private]

Definition at line 186 of file L1RCTORCAMap.cc.

References eta(), and phi.

Referenced by orcamap().

                                                    {
  int cardnum;
  int towernum;
  std::vector<int> returnVec(2);
  if(eta < 8){
    if(phi < 4){
      cardnum = 0;
      towernum = eta*4+phi;
    }
    else{
      cardnum = 1;
      towernum = eta*4+(phi-4);
    }
  }
  else if(eta < 16){
    if(phi < 4){
      cardnum = 2;
      towernum = (eta-8)*4+phi;
    }
    else{
      cardnum = 3;
      towernum = (eta-8)*4+(phi-4);
    }
  }
  else if(eta < 24){
    if(phi < 4){
      cardnum = 4;
      towernum = (eta-16)*4+phi;
    }
    else{
      cardnum = 5;
      towernum = (eta-16)*4+(phi-4);
    }
  }
  else{
    cardnum = 6;
    if(phi < 4)
      towernum = (27-eta)*4+phi;
    else
      towernum = (27-eta)*4+phi+12;
  }

  returnVec.at(0)=cardnum;
  returnVec.at(1)=towernum;
  return returnVec;
}
vector< int > L1RCTORCAMap::lowEtaMap ( int  eta,
int  phi 
) [private]

Definition at line 120 of file L1RCTORCAMap.cc.

References eta().

Referenced by orcamap().

                                                   {
  int cardnum = 0;
  int towernum = 0;
  std::vector<int> returnVec(2);
  if(eta < 4){
    cardnum = 6;
    if(phi < 4)
      towernum = (3-eta)*4 + phi;
    else
      towernum = eta*4 + phi + 12;
  }
  else if(eta <12){
    if(phi < 4){
      cardnum = 4;
      if(eta < 8)
        towernum = (7-eta)*4+phi+16;
      else
        towernum = (11-eta)*4+phi;
    }
    else{
      cardnum = 5;
      if(eta < 8)
        towernum = (7-eta)*4+(phi-4)+16;
      else
        towernum = (11-eta)*4+(phi-4);
    }
  }
  else if(eta < 20){
    if(phi < 4){
      cardnum = 2;
      if(eta < 16)
        towernum = (15-eta)*4+phi+16;
      else
        towernum = (19-eta)*4+phi;
    }
    else{
      cardnum = 3;
      if(eta < 16)
        towernum = (15-eta)*4+(phi-4)+16;
      else
        towernum = (19-eta)*4+(phi-4);
    }
  }
  else if(eta < 28){
    if(phi < 4){
      cardnum = 0;
      if(eta < 24)
        towernum = (23-eta)*4+phi+16;
      else
        towernum = (27-eta)*4+phi;
    }
    else{
      cardnum = 1;
      if(eta < 24)
        towernum = (23-eta)*4+(phi-4)+16;
      else
        towernum = (27-eta)*4+(phi-4);
    }
  }
  
  returnVec.at(0) = cardnum;
  returnVec.at(1) = towernum;
  return returnVec;
}
void L1RCTORCAMap::makeBarrelData ( )

Definition at line 37 of file L1RCTORCAMap.cc.

References asciidump::at, barrelData, combEM, combHD, eta(), orcamap(), and phi.

Referenced by readData().

                                 {
  std::vector<int> indices;
  for(int phi = 0; phi<72;phi++){
    for(int eta = 0; eta<56;eta++){
      indices = orcamap(eta,phi);
      (barrelData.at(indices.at(0))).at(indices.at(1)).at(indices.at(2)) = combEM.at(phi*56 + eta);
      (barrelData.at(indices.at(0))).at(indices.at(1)).at(indices.at(2)+32) = combHD.at(phi*56 + eta);
    }
  }
}
void L1RCTORCAMap::makeHFData ( )

Definition at line 27 of file L1RCTORCAMap.cc.

References hfData, i, j, and rawHFET.

Referenced by readData().

                             {
  std::vector<unsigned short> crate(16);
  for(int i = 0; i< 9; i++){
    for(int j = 0; j<16; j++){
      crate.at(j) = rawHFET.at(16*i+j);
    }
    hfData.at(i) = crate;
  }  
}  
vector< int > L1RCTORCAMap::orcamap ( int  eta,
int  phi 
)

Definition at line 80 of file L1RCTORCAMap.cc.

References highEtaMap(), i, and lowEtaMap().

Referenced by makeBarrelData().

                                                 {
  int crateNum(20);
  std::vector<int> cardTower(2,0);
  std::vector<int> returnVec(3,0);
  int modEta = eta%28;
  int modPhi = phi%8;
  if(phi < 8)
    crateNum = 0;  
  else if( phi < 16)
    crateNum = 1;
  else if( phi < 24)
    crateNum = 2;
  else if( phi < 32)
    crateNum = 3;
  else if( phi < 40)
    crateNum = 4;
  else if( phi < 48)
    crateNum = 5;
  else if( phi < 56)
    crateNum = 6;
  else if( phi < 64)
    crateNum = 7;
  else if( phi < 72)
    crateNum = 8;

  if(eta < 28)
    cardTower = lowEtaMap(modEta,modPhi);
  else {
    cardTower = highEtaMap(modEta,modPhi);
    crateNum = crateNum + 9;
  }

  returnVec.at(0) = crateNum;
  for(int i =0; i<2; i++){
    returnVec.at(i+1) = cardTower.at(i);
  }
  return returnVec;
}
void L1RCTORCAMap::readData ( std::vector< unsigned >  emet,
std::vector< unsigned >  hdet,
std::vector< bool >  emfg,
std::vector< bool >  hdfg,
std::vector< unsigned >  hfet 
)

Definition at line 48 of file L1RCTORCAMap.cc.

References combEM, combHD, combVec(), i, makeBarrelData(), makeHFData(), rawEMET, rawEMFG, rawHDET, rawHDFG, and rawHFET.

                                                     {
  for(int i = 0; i<4032; i++){
    rawEMET.at(i) = emet.at(i);
    rawHDET.at(i) = hdet.at(i);
    rawEMFG.at(i) = emfg.at(i);
    rawHDFG.at(i) = hdfg.at(i);
  }
  for(int i = 0; i<144; i++)
    rawHFET.at(i) = hfet.at(i);

  combEM = combVec(rawEMET,rawEMFG);
  combHD = combVec(rawHDET,rawHDFG);

  makeBarrelData();
  makeHFData();
}

Member Data Documentation

std::vector<std::vector<std::vector<unsigned short> > > L1RCTORCAMap::barrelData [private]

Definition at line 30 of file L1RCTORCAMap.h.

Referenced by giveBarrel(), L1RCTORCAMap(), and makeBarrelData().

std::vector<unsigned short> L1RCTORCAMap::combEM [private]

Definition at line 46 of file L1RCTORCAMap.h.

Referenced by L1RCTORCAMap(), makeBarrelData(), and readData().

std::vector<unsigned short> L1RCTORCAMap::combHD [private]

Definition at line 47 of file L1RCTORCAMap.h.

Referenced by L1RCTORCAMap(), makeBarrelData(), and readData().

std::vector<std::vector<unsigned short> > L1RCTORCAMap::hfData [private]

Definition at line 31 of file L1RCTORCAMap.h.

Referenced by giveHF(), L1RCTORCAMap(), and makeHFData().

std::vector<unsigned short> L1RCTORCAMap::rawEMET [private]

Definition at line 41 of file L1RCTORCAMap.h.

Referenced by L1RCTORCAMap(), and readData().

std::vector<unsigned short> L1RCTORCAMap::rawEMFG [private]

Definition at line 42 of file L1RCTORCAMap.h.

Referenced by L1RCTORCAMap(), and readData().

std::vector<unsigned short> L1RCTORCAMap::rawHDET [private]

Definition at line 43 of file L1RCTORCAMap.h.

Referenced by L1RCTORCAMap(), and readData().

std::vector<unsigned short> L1RCTORCAMap::rawHDFG [private]

Definition at line 44 of file L1RCTORCAMap.h.

Referenced by L1RCTORCAMap(), and readData().

std::vector<unsigned short> L1RCTORCAMap::rawHFET [private]

Definition at line 45 of file L1RCTORCAMap.h.

Referenced by L1RCTORCAMap(), makeHFData(), and readData().