def reactionStrToInt(reactionStr):
    """ Groups GENIE reaction string into following categories

    Reactions can be divided into two basic categories:
    1) CC, 2) NC
    These can then be further divided into subcategories of
    interaction modes
    1) QES, 2) RES, 3)DIS, 4) COH
    And the target nucleon can be either:
    1) n, 2) p, 3) other (e.g. C12 in case of COH)
    We use a three digit integer to represent all the different
    possibilities, with the order being:
    first digit = target_nucleon
    second digit = CC_NC
    third digit = interaction_mode
    In the case of a string that doesn't fit any of the
    possibilities, a "0" is returned
    """
    reactionInt = 0
    if 'QES' in reactionStr:
        reactionInt += 1
    elif 'RES' in reactionStr:
        reactionInt += 2
    elif 'DIS' in reactionStr:
        reactionInt += 3
    elif 'COH' in reactionStr:
        reactionInt += 4

    if 'CC' in reactionStr:
        reactionInt += 10
    elif 'NC' in reactionStr:
        reactionInt += 20

    if '2112' in reactionStr:
        reactionInt += 100
    elif '2212' in reactionStr:
        reactionInt += 200
    else:
        reactionInt += 300

    return reactionInt