Dear Bohua,
Reweighting is performed by histograming the information from the trajectory itself, not HILLS file. In order to do it, you need to have a weight assigned to each time point. In order to assign a weight, you need to calculate rct factors. Then you subtract them from your metadynamics bias, so you have reduced bias. You can then perform histograming by reading the column with reduced bias values altogether with the column for the data that will serve as the space in which your profile will be built.
However, I do not know how to calculate rct factors aposteriori (though there may be some way, I just never needed it). What I do is that I calculate rct and reduced biases (rbias) in place, while running metadynamics simulations. It is activated by CALC_RCT keyword. Then, if your label for MetaD data is, say, M, you can output PRINT FILE=CV ARG=CV1,CV2,M.rbias STRIDE=1000 for example.
And then you write your reweight.dat file:
CV1: READ FILE=CV IGNORE_TIME IGNORE_FORCES VALUES=CV1
CV2: READ FILE=CV IGNORE_TIME IGNORE_FORCES VALUES=CV2
RW: READ FILE=CV IGNORE_TIME IGNORE_FORCES VALUES=M.rbias
weights: REWEIGHT_BIAS ARG=RW.rbias TEMP=300
HISTOGRAM ...
ARG=CV1,CV2
GRID_MIN=-0.2,-0.2 (adjust for your space)
GRID_MAX=0.2,0.2
GRID_SPACING=0.01,0.01 (adjust)
BANDWIDTH=0.01,0.01 (adjust)
LOGWEIGHTS=weights
LABEL=h1
... HISTOGRAM
ff1: CONVERT_TO_FES GRID=h1 TEMP=300
DUMPGRID GRID=ff1 FILE=fes.dat
And you get your reweighted free energy profile. Please also note that you need to throw away some initial part of your CV file ("initial transient"). The question of how do you know which part to throw away is tricky. One way that was proposed by Michele Invernizzi I suppose was to look at M.rct plotted against time and note the time point after which the graph becomes roughly linear (not flat, but just rising steadily). Than you throw away everything before this time point. You can see what errors you can get by retaining this data by simulating a toy symmetrical system (say ethane eclipsed/staggered switch, with torsion as CV). You know a priori that the truth is 3 equal minima, but if you perform reweighting on the full trajectory, the free energy minimum for the state you start your simulation from will be lower. It happens because these calculations (rct, rbias) are approximate, and a degree of this approximation is higher at the start of the trajectory, so you get weights calculated with much more uncertainty.
But, even more easy way to solve your troubles is to switch to OPES (OPES_METAD or OPES_METAD_EXPLORE). It works similarly to metadynamics but is easier to setup, and it is much easier to compare profiles and derive errorbars from it. For it, you need to compile Plumed 2.8.x with OPES module enabled at the time of configuration. These methods output "already reweighted" biases (this is technically incorrect, but works as an analogy to what was descibed for metad), and histograming as I wrote higher is a default way to build profiles in these methods (you just need to replace metad.rbias for opes.bias). This way you can run 40 simulations, get 40 profiles and compute average profile and your uncertainty in calling this average profile the one true profile with minimal effort.
Best.
Alex