示例#1
0
bool ClicECAL::acceptance(const Cluster& cluster) const {
  double energy = cluster.energy();
  double eta = fabs(cluster.eta());
  if (eta < volumeCylinder().inner().etaJunction())
    return (energy > m_emin[0]);  // barrel
  else if (eta < m_etaAcceptance)
    return energy > m_emin[1];  // endcap
  else
    return false;
}
示例#2
0
void cylinderMenu(Cylinder** cy) {
  int option;
  do {
    cout <<
      "\n  CYLINDER MENU                                  "
      "\n    1. Create two Cylinder objects               "
      "\n    2. Compare by volume                         "
      "\n    3. Compare by area                           "
      "\n    4. Print two Cylinder objects                "
      "\n    5. Quit                                      ";

    cout << "\n  Enter your option (1 to 5): ";
    cin >> option;

    switch (option) {
    case 1:
      delete *cy;
      *cy = 0;
      *cy = new Cylinder[2];
      cout << "\n    Cylinder #1:" << endl;
      cin >> (*cy)[0];
      cout << "\n    Cylinder #2:" << endl;
      cin >> (*cy)[1];
      break;
    case 2:
		  volumeCylinder(*cy);
      break;
    case 3:
      if (*cy != 0)
        cout << "\n    The cylinder has 0 area." << endl;
      else
        cout << "\n    Cylinder ojbects are not fully available." << endl;
      break;
    case 4:
      if (*cy != 0) {
        cout << "\n    Cylinder #1:" << endl;
        cout << (*cy)[0];
        cout << "\n    Cylinder #2:" << endl;
        cout << (*cy)[1];
      } else {
        cout << "\n    Cylinder ojbects are not fully available." << endl;
      }
      break;
    case 5:
      break;
    default:
      cout << "\n    Wrong Option!" << endl;
    }
  } while (option != 5);
}