I have a pir file with more than one template.
Each template has its distance restraints in the rsr-file.
Are you sure? That's not how Modeller builds restraints when using
multiple templates. There should be a single restraint for each distance
in the model; if you have multiple templates that restraint simply
incorporates data from all of them.
How can I weight the distance restraints for each template individually,
i.e. all CA_CA-distance restraints for template t1 are weighted by a
factor w_t1, for template t2 w_t2 and so on, so that templates with
higher weight have more influence on the final structure.
You can't really, since it doesn't work that way. If you have two
templates for a given distance, one of which has a distance of 5A and
the other 10A, Modeller doesn't create two restraints on the distance,
one at 5A and 10A, since that wouldn't work, of course - what you'd end
up with would probably be a structure with a distance of 7.5A, which
doesn't match either template. Instead, it combines the two observations
into a single multi-modal restraint. See the 1993 JMB Modeller paper for
the details.
If you really wanted to do it your way, you could run Modeller twice,
once for each template, then combine the two restraint files using
whatever scheme you like.
Rewriting the distance restraints and adding a weight as parameter maybe
is a solution
That seems unnecessarily complicated - you can simply reduce the
standard deviation of a harmonic distance restraint to get the same
effect as increasing the weight.