In first step you will need to get the root category id and after that join product collection with the category product to get the products of that category. Use the following below code.

$root_Cat_Id = Mage::app()->getStore()->getRootCategoryId();
$Productcollection = Mage::getResourceModel('catalog/product_collection')
->joinField('category_id','catalog/category_product','category_id','product_id=entity_id',null,'left')
->addAttributeToFilter('category_id', array('in' => $root_Cat_Id))
->addAttributeToSelect('*')
->load();
foreach($Productcollection as $product){ 
echo $product->getName()."<br/>"; 
echo $product->getId()."<br/>"; 
}