L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.cc
unsigned int CSCMotherboard::findQuality(const CSCALCTDigi& aLCT,
                                         const CSCCLCTDigi& cLCT) const
{
  unsigned int quality = 0;

  // 2008 definition.
  if (!(aLCT.isValid()) || !(cLCT.isValid())) {
    if (aLCT.isValid() && !(cLCT.isValid()))      quality = 1; // no CLCT
    else if (!(aLCT.isValid()) && cLCT.isValid()) quality = 2; // no ALCT
    else quality = 0; // both absent; should never happen.
  }
  else {
    int pattern = cLCT.getPattern();
    if (pattern == 1) quality = 3; // layer-trigger in CLCT
    else {
      // CLCT quality is the number of layers hit minus 3.
      // CLCT quality is the number of layers hit.
      bool a4 = (aLCT.getQuality() >= 1);
      bool c4 = (cLCT.getQuality() >= 4);
      //              quality = 4; "reserved for low-quality muons in future"
      if      (!a4 && !c4) quality = 5; // marginal anode and cathode
      else if ( a4 && !c4) quality = 6; // HQ anode, but marginal cathode
      else if (!a4 &&  c4) quality = 7; // HQ cathode, but marginal anode
      else if ( a4 &&  c4) {
        if (aLCT.getAccelerator()) quality = 8; // HQ muon, but accel ALCT
        else {
          // quality =  9; "reserved for HQ muons with future patterns
          // quality = 10; "reserved for HQ muons with future patterns
          if (pattern == 2 || pattern == 3)      quality = 11;
          else if (pattern == 4 || pattern == 5) quality = 12;
          else if (pattern == 6 || pattern == 7) quality = 13;
          else if (pattern == 8 || pattern == 9) quality = 14;
          else if (pattern == 10)                quality = 15;
          else {
            if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorWrongValues")
                              << "+++ findQuality: Unexpected CLCT pattern id = "
                              << pattern << "+++\n";
          }
        }
      }
    }
  }
  return quality;
}
// 4-bit LCT quality number.
4-bit LCT quality number.
4 - bit LCT quality number .
unsigned int CSCMotherboard::findQuality(const CSCALCTDigi& aLCT,
                                         const CSCCLCTDigi& cLCT) const
{
  unsigned int quality = 0;
  if (!(aLCT.isValid()) || !(cLCT.isValid())) {
    if (aLCT.isValid() && !(cLCT.isValid()))      quality = 1; 
    else if (!(aLCT.isValid()) && cLCT.isValid()) quality = 2; 
    else quality = 0; 
  }
  else {
    int pattern = cLCT.getPattern();
    if (pattern == 1) quality = 3; 
    else {
      bool a4 = (aLCT.getQuality() >= 1);
      bool c4 = (cLCT.getQuality() >= 4);
      if      (!a4 && !c4) quality = 5; 
      else if ( a4 && !c4) quality = 6; 
      else if (!a4 &&  c4) quality = 7; 
      else if ( a4 &&  c4) {
        if (aLCT.getAccelerator()) quality = 8; 
        else {
          if (pattern == 2 || pattern == 3)      quality = 11;
          else if (pattern == 4 || pattern == 5) quality = 12;
          else if (pattern == 6 || pattern == 7) quality = 13;
          else if (pattern == 8 || pattern == 9) quality = 14;
          else if (pattern == 10)                quality = 15;
          else {
            if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorWrongValues")
                              << "+++ findQuality: Unexpected CLCT pattern id = "
                              << pattern << "+++\n";
          }
        }
      }
    }
  }
  return quality;
}
unsigned int CSCMotherboard :: findQuality ( const CSCALCTDigi & aLCT , const CSCCLCTDigi & cLCT ) const { unsigned int quality = 0 ; if ( ! ( aLCT . isValid ( ) ) || ! ( cLCT . isValid ( ) ) ) { if ( aLCT . isValid ( ) && ! ( cLCT . isValid ( ) ) ) quality = 1 ; else if ( ! ( aLCT . isValid ( ) ) && cLCT . isValid ( ) ) quality = 2 ; else quality = 0 ; } else { int pattern = cLCT . getPattern ( ) ; if ( pattern == 1 ) quality = 3 ; else { bool a4 = ( aLCT . getQuality ( ) >= 1 ) ; bool c4 = ( cLCT . getQuality ( ) >= 4 ) ; if ( ! a4 && ! c4 ) quality = 5 ; else if ( a4 && ! c4 ) quality = 6 ; else if ( ! a4 && c4 ) quality = 7 ; else if ( a4 && c4 ) { if ( aLCT . getAccelerator ( ) ) quality = 8 ; else { if ( pattern == 2 || pattern == 3 ) quality = 11 ; else if ( pattern == 4 || pattern == 5 ) quality = 12 ; else if ( pattern == 6 || pattern == 7 ) quality = 13 ; else if ( pattern == 8 || pattern == 9 ) quality = 14 ; else if ( pattern == 10 ) quality = 15 ; else { if ( infoV >= 0 ) edm :: LogWarning ( " " ) << " " << pattern << " \n " ; } } } } } return quality ; }
4-bit LCT quality number.
4 - bit LCT quality number .
// 2008 definition. // no CLCT // no ALCT // both absent; should never happen. // layer-trigger in CLCT // CLCT quality is the number of layers hit minus 3. // CLCT quality is the number of layers hit. //              quality = 4; "reserved for low-quality muons in future" // marginal anode and cathode // HQ anode, but marginal cathode // HQ cathode, but marginal anode // HQ muon, but accel ALCT // quality =  9; "reserved for HQ muons with future patterns // quality = 10; "reserved for HQ muons with future patterns