Wireless sensor networks have been widely used in many applications, such as climate monitoring systems, fire detection, ocean activity monitoring, and smart cities. These networks can be homogeneous or heterogeneous, depending on the types of wireless devices used. Changes in the values of the attributes measured are known as events. We distinguish atomic and composite events. Atomic events measure changes of a single attribute in the environment, for example the temperature, while composite events consist of groups of atomic events. In this paper we propose a distributed algorithm for composite event detection and reporting that uses an event-based clustering mechanism. We compare the performance of our algorithm with another related work, the Cluster-based Energy efficient Composite event detection (CEC) protocol, where clusters are formed before the sensing starts. We analyze the performance of our mechanism using WSNeT simulator, which is specially designed for event based wireless sensor networks. This simulator is a free open source tool and runs using Linux operating system. We measure various metrics such as average residual energy, number of packets received by the sink and cluster heads, average number of hops, and average number of clusters. Based on the results of the simulations, we conclude that our event-based clustering mechanism outperforms the CEC mechanism.