AbstractWe study the cohomology of connected components of Shimura varieties coming from the group GSp2g, by an approach modeled on the stabilization of the twisted trace formula, due to Kottwitz and Shelstad. More precisely, for each character ϖ on the group of connected components of we define an operator L(ω) on the cohomology groups with compact supports Hic(, ), and then we prove that the virtual trace of the composition of L(ω) with a Hecke operator f away from p and a sufficiently high power of a geometric Frobenius , can be expressed as a sum of ω-weighted (twisted) orbital integrals (where ω-weighted means that the orbital integrals and twisted orbital integrals occuring here each have a weighting factor coming from the character ϖ). As the crucial step, we define and study a new invariant α1(γ0; γ, δ) which is a refinement of the invariant α(γ0; γ, δ) defined by Kottwitz. This is done by using a theorem of Reimann and Zink.