# Anonymous TFormula

**URL:** <https://root-forum.cern.ch/t/anonymous-tformula/47249>\
**Category:** Evolution Proposals, Apps & Ideas\
**Created:** [October 15, 2021, 6:32am UTC](https://root-forum.cern.ch/t/anonymous-tformula/47249 "2021-10-15T06:32:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rlalik](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/rlalik/32/25117_2.png) [@rlalik](https://root-forum.cern.ch/u/rlalik)\
**Post date:** [October 15, 2021, 6:32am UTC](https://root-forum.cern.ch/t/anonymous-tformula/47249/1 "2021-10-15T06:32:29Z")

</div>

Hi,

often I have situation that I need to create `TFormula` and read the properties of it, like number of parameters, but this is not yet time to name in. Name is created dynamically and later in the code.

But currently one has to name the `TFormula` object. Is there smart way to have unnamed formulas?

I see two ways:

- put empty string `""` as formula name; or
- put random-generated string as a name, and later rename it.

but I am not sure whether the first solution will not break somewhere later if I have couple `""` named formulas in the code.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [October 15, 2021, 6:40am UTC](https://root-forum.cern.ch/t/anonymous-tformula/47249/2 "2021-10-15T06:40:38Z")

</div>

I would suggest to try it.  
I am not sure if have several TFormula with the same name is  
a problem or not (again try), but in any case it should be easy to name  
them differently with a “random-generated string” as you suggested.

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [October 15, 2021, 7:10am UTC](https://root-forum.cern.ch/t/anonymous-tformula/47249/3 "2021-10-15T07:10:06Z")

</div>

Hi,

When you construct TFormula objects you can pass false the flag addToGlobalList in the Formula constructor, see [ROOT: TFormula Class Reference](https://root.cern.ch/doc/master/classTFormula.html#ad15ea6b17353112371a285587058eb08).  
In this case you can use just an empty string.

Lorenzo
