I am overriding Mage_Catalog_Model_Product method getProductUrl($useSid = null). how to check whether the product is assigned to specific "Root Category A" or its sub categories or not?
You can get the categories a product is assigned to by using the method
getCategoryIds() on your product object. In your case, since you have extended the product model,
$this->getCategoryIds() will work.
You will get an array of category ids.
From further comments, an update to the answer.
Once you have the category ids you would need to load the categories, and form the category object, get the Path of the category. ($category->getPath())
This will result in a values like such : 2/4/56/78/90 - the ids listed is the category ids up to the category you are currently looking at. The path values = the category tree path of that category all the way up to the root category.
Does that help?