On some vessels the Chief of Security is also head of the Tactical Department. Whilst on others s/he isn't. If s/he is, all Tactical personnel fall under the operation of the Security Department.
The Chief Security Officer is called Chief of Security. Her/his duty is to ensure the safety of ship and crew. Some take it as their personal duty to protect the Commanding/Executive Officer on away teams. She/he is also responsible for people under arrest and the safety of guests, liked or not.
S/he also is a department head and a member of the senior staff, responsible for all the crewmembers in her/his department and duty rosters. Security could be called the 24th century police force.
The role of Chief Tactical Officer is that of the vessel's gunman. S/he is responsible for the ships weapon system, and is also the COs tactical advisor in Star Ship Combat matters. Very often Tactical Officers are also trained in ground combat and small unit tactics. The Chief tactical Officer should be aware of current Diplomatic situations and up to date on the latest technological capabilities of all threat alien races, and even the capabilities of allied alien species.
There is much more to tactical than simply overseeing the weapons console on the bridge. Tactical maintains the weapons systems aboard the ship/starbase, maintaining and reloading photon magazines. Tactical planning and current Intelligence analysis (if no Intelligence operatives are aboard) is also overseen by the tactical department.