# Multiplying a Branch with a coefficient

**URL:** <https://root-forum.cern.ch/t/multiplying-a-branch-with-a-coefficient/2474>\
**Category:** ROOT\
**Created:** [October 3, 2005, 12:06pm UTC](https://root-forum.cern.ch/t/multiplying-a-branch-with-a-coefficient/2474 "2005-10-03T12:06:14Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [October 6, 2005, 9:37pm UTC](https://root-forum.cern.ch/t/multiplying-a-branch-with-a-coefficient/2474/4 "2005-10-06T21:37:33Z")

</div>

[quote]But, as I have read somewhere else in the forum, it is impossible (or “not recommended at all”) to do something like Q2 = Q2\*A [/quote]It is possible but not recommended since the step to do so are not trivial.

[quote]So, I need to find another way to do this, with as few steps as possible. [/quote]Simply create a new tree, with just the branch Q2 and make this new tree a friend of the first tree (oldtree-\>AddFriend(…) ).  
Alternatively, Clone the old tree and add a new branch (See $ROOTSYS/tutorials/copytree3.C)

Cheers,  
Philippe.

---

_[View the full topic](https://root-forum.cern.ch/t/multiplying-a-branch-with-a-coefficient/2474)._
