definition of declaration for eventCostTotal and its  calculation explanation.