ArgumentChecker.notNull(capFloorSecurity, "cap/floor security");
final ZonedDateTime startDate = capFloorSecurity.getStartDate();
final ZonedDateTime endDate = capFloorSecurity.getMaturityDate();
final double notional = capFloorSecurity.getNotional();
final Currency currency = capFloorSecurity.getCurrency();
final Frequency payFreq = capFloorSecurity.getFrequency();
// FIXME: convert frequency to period in a better way
final Period tenorPayment = getTenor(payFreq);
final boolean isIbor = capFloorSecurity.isIbor();
final String iborConventionName = getConventionName(currency, IBOR);
final IborIndexConvention iborIndexConvention = _conventionSource.getConvention(IborIndexConvention.class, ExternalId.of(SCHEME_NAME, iborConventionName));
if (iborIndexConvention == null) {
throw new OpenGammaRuntimeException("Could not get ibor convention called " + iborConventionName);
}
final Frequency freqIbor = capFloorSecurity.getFrequency();
final Period iborTenor = getTenor(freqIbor);
final int spotLag = iborIndexConvention.getSettlementDays();
final IborIndex iborIndex = new IborIndex(currency, iborTenor, spotLag, iborIndexConvention.getDayCount(),
iborIndexConvention.getBusinessDayConvention(), iborIndexConvention.isIsEOM(), iborIndexConvention.getName());
final ExternalId regionId = iborIndexConvention.getRegionCalendar();