Ejemplo n.º 1
0
int main() {

    std::cout << "Test current Hcal geometry" << std::endl;

    HcalTopologyMode::Mode mode = HcalTopologyMode::LHC;
    int maxDepthHB = 2;
    int maxDepthHE = 3;
    HcalTopology topology( mode, maxDepthHB, maxDepthHE );

    testValidDetIds( topology, DetId::Hcal, HcalBarrel, " BARREL " );
    testValidDetIds( topology, DetId::Hcal, HcalEndcap, " ENDCAP " );
    testValidDetIds( topology, DetId::Hcal, HcalOuter, " OUTER " );
    testValidDetIds( topology, DetId::Hcal, HcalForward, " FORWARD " );

    testTriggerGeometry( topology );

    testClosestCells( topology );

    std::cout << "Test SLHC Hcal geometry" << std::endl;

    mode = HcalTopologyMode::SLHC;
    maxDepthHB = 7;
    maxDepthHE = 7;
    HcalTopology stopology( mode, maxDepthHB, maxDepthHE );

    testValidDetIds( stopology, DetId::Hcal, HcalBarrel, " SLHC BARREL " );
    testValidDetIds( stopology, DetId::Hcal, HcalEndcap, " SLHC ENDCAP " );
    testValidDetIds( stopology, DetId::Hcal, HcalOuter, " SLHC OUTER " );
    testValidDetIds( stopology, DetId::Hcal, HcalForward, " SLHC FORWARD " );

    std::cout << "Test SLHC Hcal Flexi geometry" << std::endl;
    std::vector<int> dins;

    testFlexiValidDetIds( stopology, DetId::Hcal, HcalBarrel, " SLHC BARREL ", dins );
    testFlexiValidDetIds( stopology, DetId::Hcal, HcalEndcap, " SLHC ENDCAP ", dins );
    testFlexiValidDetIds( stopology, DetId::Hcal, HcalOuter, " SLHC OUTER ", dins );
    testFlexiValidDetIds( stopology, DetId::Hcal, HcalForward, " SLHC FORWARD ", dins );

    testTriggerGeometry( stopology );

    testClosestCells( stopology );

    return 0;
}
Ejemplo n.º 2
0
int main() {

  HcalHardcodeGeometryLoader l;
  HcalHardcodeGeometryLoader::ReturnType b=l.load(DetId::Hcal,HcalBarrel);
  HcalHardcodeGeometryLoader::ReturnType e=l.load(DetId::Hcal,HcalEndcap);
  HcalHardcodeGeometryLoader::ReturnType o=l.load(DetId::Hcal,HcalOuter);
  HcalHardcodeGeometryLoader::ReturnType f=l.load(DetId::Hcal,HcalForward);

  std::cout << std::endl << " BARREL : " << std::endl;
  const std::vector<DetId>& idshb=b->getValidDetIds(DetId::Hcal,HcalBarrel);
  for (std::vector<DetId>::const_iterator i=idshb.begin(); i!=idshb.end(); i++) {
    HcalDetId hid=(*i);
    if (hid.iphi()!=1) continue;
    const CaloCellGeometry* geom=b->getGeometry(hid);
    const CaloCellGeometry::CornersVec& corners=geom->getCorners();
    std::cout << hid << std::endl;
    for (CaloCellGeometry::CornersVec::const_iterator j=corners.begin(); j!=corners.end(); j++) {
      std::cout << "  " << *j << std::endl;
    }
  }

  std::cout << std::endl << " FORWARD : " << std::endl;
  const std::vector<DetId>& idshf=f->getValidDetIds(DetId::Hcal,HcalForward);
  for (std::vector<DetId>::const_iterator i=idshf.begin(); i!=idshf.end(); i++) {
    HcalDetId hid=(*i);
    //  if (hid.iphi()!=1 && hid.iphi()!=2 && hid.iphi()!=3) continue;
    std::cout << hid << std::endl;
    
    const CaloCellGeometry* geom=f->getGeometry(hid);
    const CaloCellGeometry::CornersVec& corners=geom->getCorners();
    for (CaloCellGeometry::CornersVec::const_iterator j=corners.begin(); j!=corners.end(); j++) {
      std::cout << "  " << *j << std::endl;
    }
  }

  std::cout << std::endl << " ENDCAP : " << std::endl;
  const std::vector<DetId>& idshe=e->getValidDetIds(DetId::Hcal,HcalEndcap);
  for (std::vector<DetId>::const_iterator i=idshe.begin(); i!=idshe.end(); i++) {
    HcalDetId hid=(*i);
    if (hid.iphi()!=1 && hid.iphi()!=2 && hid.iphi()!=3) continue;
    std::cout << hid << std::endl;
    
    const CaloCellGeometry* geom=e->getGeometry(hid);
    const CaloCellGeometry::CornersVec& corners=geom->getCorners();
    for (CaloCellGeometry::CornersVec::const_iterator j=corners.begin(); j!=corners.end(); j++) {
      std::cout << "  " << *j << std::endl;
    }
  }

  std::cout << std::endl << " OUTER : " << std::endl;
  const std::vector<DetId>& idsho=o->getValidDetIds(DetId::Hcal,HcalOuter);
  for (std::vector<DetId>::const_iterator i=idsho.begin(); i!=idsho.end(); i++) {
    HcalDetId hid=(*i);
    if (hid.iphi()!=1 && hid.iphi()!=2 && hid.iphi()!=3) continue;
    std::cout << hid << std::endl;
    
    const CaloCellGeometry* geom=o->getGeometry(hid);
    const CaloCellGeometry::CornersVec& corners=geom->getCorners();
    for (CaloCellGeometry::CornersVec::const_iterator j=corners.begin(); j!=corners.end(); j++) {
      std::cout << "  " << *j << std::endl;
    }
  }

  testTriggerGeometry();

  testClosestCells();
  return 0;
}