We present a multiwavelength study of the ( catalog W40 ) star-forming region using infrared ( IR ) observations in UKIRT JHK bands , Spitzer IRAC bands , and Herschel PACS bands ; 2.12 \mu m H _ { 2 } narrow-band imaging ; and radio continuum observations from GMRT ( 610 and 1280 MHz ) , in a field of view ( FoV ) of \sim 34′ \times 40′ . Archival Spitzer observations in conjunction with near-IR ( NIR ) observations are used to identify 1162 Class II/III and 40 Class I sources in the FoV . The nearest-neighbour stellar surface density analysis shows that majority of these young stellar objects ( YSOs ) constitute the embedded cluster centered on the high-mass source IRS 1A South . Some YSOs , predominantly younger population , are distributed along and trace the filamentary structures at lower stellar surface density . The cluster radius is obtained as 0.44 pc - matching well with the extent of radio emission - with a peak density of 650 pc ^ { -2 } . The JHK data is used to map the extinction in the region which is subsequently used to compute the cloud mass . It has resulted in 126 M _ { \odot } and 71 M _ { \odot } for the central cluster and the northern IRS 5 region , respectively . H _ { 2 } narrow-band imaging displays significant emission , which prominently resembles fluorescent emission arising at the borders of dense regions . Radio continuum analysis shows this region as having blister morphology , with the radio peak coinciding with a protostellar source . Free-free emission spectral energy distribution ( SED ) analysis is used to obtain physical parameters of the overall photoionized region and the IRS 5 sub-region . This multiwavelength scenario is suggestive of star formation having resulted from merging of multiple filaments to form a hub . Star formation seems to have taken place in two successive epochs , with the first epoch traced by the central cluster and the high-mass star ( s ) - followed by a second epoch which is spreading into the filaments as uncovered by the Class I sources and even younger protostellar sources along the filaments . The IRS 5 H ii region displays indications of swept-up material which has possibly led to the formation of protostars .