TH2F *H_TDC = new TH2F("H_TDC","TDCA vs TDCB",100,0.,600.,100,0.,600.); ... delete H_TDC;delete first calls the object's termination routine (i.e. its destructor) and then releases the space the object occupied on the heap memory. If an array of objects was created using new, then delete must be told that it is dealing with an array by preceding the name with an empty []:-
Int_t *my_ints = new Int_t[10]; ... delete []my_ints;This tells the delete operator to go and find the array size, and delete all the objects.
See operator precedence