A generalized poincaré series associated to a hecke algebra of a finite or p-adic chevalley group