// @(#)root/treeplayer:$Id$
// Author: Philippe Canal   20/03/02

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers and al.        *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/


#include "TTreeFormulaManager.h"

#include "TArrayI.h"
#include "TError.h"
#include "TLeafElement.h"


ClassImp(TTreeFormulaManager)

//________________________________________________________________________________
//
//     A TreeFormulaManager is used to coordinate one or more TTreeFormula objecs
//
//  In particular it makes sure that the dimensions and size of all the formulas
//  is properly coordinated.
//


//______________________________________________________________________________
TTreeFormulaManager::TTreeFormulaManager() : TObject()
{
//*-*-*-*-*-*-*-*-*-*-*Tree FormulaManger default constructor*-*-*-*-*-*-*-*-*-*
//*-*                  ======================================

   fMultiplicity = 0;
   fMultiVarDim  = kFALSE;
   fNeedSync     = kFALSE;
   fNdata = 1;

   for(Int_t i=0; i<kMAXFORMDIM+1; i++) {
      fVarDims[i] = 0;
      fCumulUsedSizes[i] = 1;
      fUsedSizes[i] = 1;
      fVirtUsedSizes[i] = 1;
   }
   fCumulUsedVarDims = 0;
}


//______________________________________________________________________________
TTreeFormulaManager::~TTreeFormulaManager()
{
//*-*-*-*-*-*-*-*-*-*-*Tree FormulaManager default destructor*-*-*-*-*-*-*-*-*-*
//*-*                  ======================================

   for (int l = 0; l<kMAXFORMDIM; l++) {
      if (fVarDims[l]) delete fVarDims[l];
      fVarDims[l] = 0;
   }
   if (fCumulUsedVarDims) delete fCumulUsedVarDims;
}

//______________________________________________________________________________
void TTreeFormulaManager::Remove(TTreeFormula* adding)
{
   // Remove a formula from this manager

   fFormulas.Remove(adding);
}

//______________________________________________________________________________
void TTreeFormulaManager::Add(TTreeFormula* adding)
{
  // Add a new formula to the list of formulas managed
  // The manager of the formula will be changed and the old one will be deleted
  // if it is empty.

   TTreeFormulaManager * old = adding->fManager;

   if (old) {
      if (old==this) {
         if (fFormulas.FindObject(adding)) return;
      } else {
         old->fFormulas.Remove(adding);
         if (old->fFormulas.GetLast()==-1) delete adding->fManager;
      }
   }

   if (adding->TestBit(TTreeFormula::kNeedEntries)) {
      SetBit(TTreeFormula::kNeedEntries);
   }

   fFormulas.Add(adding);
   adding->fManager = this;
   fNeedSync = kTRUE;
}

//______________________________________________________________________________
void TTreeFormulaManager::AddVarDims(Int_t virt_dim)
{
   // Add a variable dimension

   if (!fVarDims[virt_dim]) fVarDims[virt_dim] = new TArrayI;
}

//______________________________________________________________________________
void TTreeFormulaManager::CancelDimension(Int_t virt_dim)
{
   // Cancel a dimension.  This is usually called when an out-of-bounds index
   // is used.

   fCumulUsedSizes[virt_dim] = 0;

}

//______________________________________________________________________________
void TTreeFormulaManager::EnableMultiVarDims()
{
   // Set the manager as handling a formula with multiple variable dimensions

   fMultiVarDim = kTRUE;
   if (!fCumulUsedVarDims) fCumulUsedVarDims = new TArrayI;

}

//______________________________________________________________________________
Int_t TTreeFormulaManager::GetNdata(Bool_t forceLoadDim)
{
//*-*-*-*-*-*-*-*Return number of available instances in the formulas*-*-*-*-*-*
//*-*            ====================================================
//

   Int_t k;

   // new version of GetNData:
   // Possible problem: we only allow one variable dimension so far.
   if (fMultiplicity==0) return fNdata;

   if (fMultiplicity==2) return fNdata; // CumulUsedSizes[0];

   // We have at least one leaf with a variable size:

   // Reset the registers.
   for(k=0; k<=kMAXFORMDIM; k++) {
      fUsedSizes[k] = TMath::Abs(fVirtUsedSizes[k]);
      if (fVarDims[k]) {
         for(Int_t i0=0;i0<fVarDims[k]->GetSize();i0++) {
            fVarDims[k]->AddAt(0,i0);
         }
      }
   }
   if (fCumulUsedVarDims) {
      for(Int_t i0=0;i0<fCumulUsedVarDims->GetSize();++i0) {
         fCumulUsedVarDims->AddAt(0,i0);
      }
   }

   TTreeFormula* current = 0;

   Int_t size = fFormulas.GetLast()+1;

   for(Int_t i=0; i<size; i++) {

      current = (TTreeFormula*)fFormulas.UncheckedAt(i);
      if (current->fMultiplicity!=1 && !current->fHasCast) continue;
      if (!current->LoadCurrentDim() ) {
         if (forceLoadDim) {
            for(Int_t j=i+1; j<size; j++) {
               current = (TTreeFormula*)fFormulas.UncheckedAt(j);
               if (current->fMultiplicity!=1 && !current->fHasCast) continue;
               current->LoadCurrentDim();
            }
         }
         fNdata = 0;
         return 0;
      }
   }

   if (fMultiplicity==-1) { fNdata = 1; return fCumulUsedSizes[0]; }

   Int_t overall = 1;
   if (!fMultiVarDim) {
      for (k = kMAXFORMDIM; (k >= 0) ; k--) {
         if (fUsedSizes[k]>=0) {
            overall *= fUsedSizes[k];
            fCumulUsedSizes[k] = overall;
         } else {
            Error("GetNdata","a dimension is still negative!");
         }
      }
   } else {
      overall = 0; // Since we work with additions in this section
      if (fCumulUsedVarDims && fUsedSizes[0]>fCumulUsedVarDims->GetSize()) fCumulUsedVarDims->Set(fUsedSizes[0]);
      for(Int_t i = 0; i < fUsedSizes[0]; i++) {
         Int_t local_overall = 1;
         for (k = kMAXFORMDIM; (k > 0) ; k--) {
            if (fVarDims[k]) {
               Int_t index = fVarDims[k]->At(i);
               if (fCumulUsedVarDims && fCumulUsedVarDims->At(i)==1 && index) index = 1;
               if (fUsedSizes[k]==1 || (index!=1 && index<fUsedSizes[k]))
                  local_overall *= index;
               else local_overall *= fUsedSizes[k];
            } else {
               local_overall *= fUsedSizes[k];
            }
         }
         // a negative value indicates that this value of the primary index
         // will lead to an invalid index; So we skip it.
         if (fCumulUsedVarDims->At(i)<0) fCumulUsedVarDims->AddAt(0,i);
         else {
            fCumulUsedVarDims->AddAt(local_overall,i);
            overall += local_overall;
         }
      }
   }
   fNdata = overall;
   return overall;

}

//______________________________________________________________________________
Bool_t TTreeFormulaManager::Sync()
{
   // Synchronize all the formulae.

   if (!fNeedSync) return true;

   TTreeFormula* current = 0;
   Bool_t hasCast = kFALSE;

   fMultiplicity = 0;
   // We do not use an intermediary variable because ResetDimensions
   // might add more formulas (TCutG).
   for(Int_t i=0; i<fFormulas.GetLast()+1; i++) {
      current = (TTreeFormula*)fFormulas.UncheckedAt(i);

      hasCast |= current->fHasCast;

      // We probably need to reset the formula's dimension

      current->ResetDimensions();
      switch (current->GetMultiplicity()) {
         case 0:
            // nothing to do
            break;
         case 1:
            fMultiplicity = 1;
            break;
         case 2:
            if (fMultiplicity!=1) fMultiplicity = 2;
            break;
         default:
            Error("Sync","Unexpected case!");
      }


   } // end of for each formulas

   // For now we keep fCumulUsedSizes sign aware.
   // This will be reset properly (if needed) by GetNdata.
   fCumulUsedSizes[kMAXFORMDIM] = fUsedSizes[kMAXFORMDIM];
   for (Int_t k = kMAXFORMDIM; (k > 0) ; k--) {
      if (fUsedSizes[k-1]>=0) {
         fCumulUsedSizes[k-1] = fUsedSizes[k-1] * fCumulUsedSizes[k];
      } else {
         fCumulUsedSizes[k-1] = - TMath::Abs(fCumulUsedSizes[k]);
      }
   }

   // Now that we know the virtual dimension we know if a loop over EvalInstance
   // is needed or not.
   if (fCumulUsedSizes[0]==1 && fMultiplicity>0) {
      // Case where even though we have an array.  We know that they will always
      // only be one element.
      fMultiplicity -= 2;
   } else if (fCumulUsedSizes[0]<0 && fMultiplicity==2) {
      // Case of a fixed length array that have one of its indices given
      // by a variable.
      fMultiplicity = 1;
   } else if (fMultiplicity==0 && hasCast) {
      fMultiplicity = -1;
   }

   switch(fMultiplicity) {
      case 0: fNdata = 1; break;
      case 2: fNdata = fCumulUsedSizes[0]; break;
      default: fNdata = 0;
   }
   fNeedSync = kFALSE;

   return true;
}

//______________________________________________________________________________
void TTreeFormulaManager::UpdateFormulaLeaves()
{
   // this function could be called TTreePlayer::UpdateFormulaLeaves, itself
   // called by TChain::LoadTree when a new Tree is loaded.
   // Because Trees in a TChain may have a different list of leaves, one
   // must update the leaves numbers in the TTreeFormula used by the TreePlayer.

   // A safer alternative would be to recompile the whole thing .... However
   // currently compile HAS TO be called from the constructor!

   Int_t size = fFormulas.GetLast()+1;

   for(Int_t i=0; i<size; i++) {

      TTreeFormula *current = (TTreeFormula*)fFormulas.UncheckedAt(i);
      current->UpdateFormulaLeaves();

   }

}

//______________________________________________________________________________
void TTreeFormulaManager::UpdateUsedSize(Int_t &virt_dim, Int_t vsize)
{
   // Reload the array sizes

   if (vsize<0)
      fVirtUsedSizes[virt_dim] = -1 * TMath::Abs(fVirtUsedSizes[virt_dim]);
   else
      if ( TMath::Abs(fVirtUsedSizes[virt_dim])==1
          || (vsize < TMath::Abs(fVirtUsedSizes[virt_dim]) ) ) {
         // Absolute values represent the min of all real dimensions
         // that are known.  The fact that it is negatif indicates
         // that one of the leaf has a variable size for this
         // dimensions.
         if (fVirtUsedSizes[virt_dim] < 0) {
            fVirtUsedSizes[virt_dim] = -1 * vsize;
         } else {
            fVirtUsedSizes[virt_dim] = vsize;
         }
      }
   fUsedSizes[virt_dim] = fVirtUsedSizes[virt_dim];
   virt_dim++;

}
 TTreeFormulaManager.cxx:1
 TTreeFormulaManager.cxx:2
 TTreeFormulaManager.cxx:3
 TTreeFormulaManager.cxx:4
 TTreeFormulaManager.cxx:5
 TTreeFormulaManager.cxx:6
 TTreeFormulaManager.cxx:7
 TTreeFormulaManager.cxx:8
 TTreeFormulaManager.cxx:9
 TTreeFormulaManager.cxx:10
 TTreeFormulaManager.cxx:11
 TTreeFormulaManager.cxx:12
 TTreeFormulaManager.cxx:13
 TTreeFormulaManager.cxx:14
 TTreeFormulaManager.cxx:15
 TTreeFormulaManager.cxx:16
 TTreeFormulaManager.cxx:17
 TTreeFormulaManager.cxx:18
 TTreeFormulaManager.cxx:19
 TTreeFormulaManager.cxx:20
 TTreeFormulaManager.cxx:21
 TTreeFormulaManager.cxx:22
 TTreeFormulaManager.cxx:23
 TTreeFormulaManager.cxx:24
 TTreeFormulaManager.cxx:25
 TTreeFormulaManager.cxx:26
 TTreeFormulaManager.cxx:27
 TTreeFormulaManager.cxx:28
 TTreeFormulaManager.cxx:29
 TTreeFormulaManager.cxx:30
 TTreeFormulaManager.cxx:31
 TTreeFormulaManager.cxx:32
 TTreeFormulaManager.cxx:33
 TTreeFormulaManager.cxx:34
 TTreeFormulaManager.cxx:35
 TTreeFormulaManager.cxx:36
 TTreeFormulaManager.cxx:37
 TTreeFormulaManager.cxx:38
 TTreeFormulaManager.cxx:39
 TTreeFormulaManager.cxx:40
 TTreeFormulaManager.cxx:41
 TTreeFormulaManager.cxx:42
 TTreeFormulaManager.cxx:43
 TTreeFormulaManager.cxx:44
 TTreeFormulaManager.cxx:45
 TTreeFormulaManager.cxx:46
 TTreeFormulaManager.cxx:47
 TTreeFormulaManager.cxx:48
 TTreeFormulaManager.cxx:49
 TTreeFormulaManager.cxx:50
 TTreeFormulaManager.cxx:51
 TTreeFormulaManager.cxx:52
 TTreeFormulaManager.cxx:53
 TTreeFormulaManager.cxx:54
 TTreeFormulaManager.cxx:55
 TTreeFormulaManager.cxx:56
 TTreeFormulaManager.cxx:57
 TTreeFormulaManager.cxx:58
 TTreeFormulaManager.cxx:59
 TTreeFormulaManager.cxx:60
 TTreeFormulaManager.cxx:61
 TTreeFormulaManager.cxx:62
 TTreeFormulaManager.cxx:63
 TTreeFormulaManager.cxx:64
 TTreeFormulaManager.cxx:65
 TTreeFormulaManager.cxx:66
 TTreeFormulaManager.cxx:67
 TTreeFormulaManager.cxx:68
 TTreeFormulaManager.cxx:69
 TTreeFormulaManager.cxx:70
 TTreeFormulaManager.cxx:71
 TTreeFormulaManager.cxx:72
 TTreeFormulaManager.cxx:73
 TTreeFormulaManager.cxx:74
 TTreeFormulaManager.cxx:75
 TTreeFormulaManager.cxx:76
 TTreeFormulaManager.cxx:77
 TTreeFormulaManager.cxx:78
 TTreeFormulaManager.cxx:79
 TTreeFormulaManager.cxx:80
 TTreeFormulaManager.cxx:81
 TTreeFormulaManager.cxx:82
 TTreeFormulaManager.cxx:83
 TTreeFormulaManager.cxx:84
 TTreeFormulaManager.cxx:85
 TTreeFormulaManager.cxx:86
 TTreeFormulaManager.cxx:87
 TTreeFormulaManager.cxx:88
 TTreeFormulaManager.cxx:89
 TTreeFormulaManager.cxx:90
 TTreeFormulaManager.cxx:91
 TTreeFormulaManager.cxx:92
 TTreeFormulaManager.cxx:93
 TTreeFormulaManager.cxx:94
 TTreeFormulaManager.cxx:95
 TTreeFormulaManager.cxx:96
 TTreeFormulaManager.cxx:97
 TTreeFormulaManager.cxx:98
 TTreeFormulaManager.cxx:99
 TTreeFormulaManager.cxx:100
 TTreeFormulaManager.cxx:101
 TTreeFormulaManager.cxx:102
 TTreeFormulaManager.cxx:103
 TTreeFormulaManager.cxx:104
 TTreeFormulaManager.cxx:105
 TTreeFormulaManager.cxx:106
 TTreeFormulaManager.cxx:107
 TTreeFormulaManager.cxx:108
 TTreeFormulaManager.cxx:109
 TTreeFormulaManager.cxx:110
 TTreeFormulaManager.cxx:111
 TTreeFormulaManager.cxx:112
 TTreeFormulaManager.cxx:113
 TTreeFormulaManager.cxx:114
 TTreeFormulaManager.cxx:115
 TTreeFormulaManager.cxx:116
 TTreeFormulaManager.cxx:117
 TTreeFormulaManager.cxx:118
 TTreeFormulaManager.cxx:119
 TTreeFormulaManager.cxx:120
 TTreeFormulaManager.cxx:121
 TTreeFormulaManager.cxx:122
 TTreeFormulaManager.cxx:123
 TTreeFormulaManager.cxx:124
 TTreeFormulaManager.cxx:125
 TTreeFormulaManager.cxx:126
 TTreeFormulaManager.cxx:127
 TTreeFormulaManager.cxx:128
 TTreeFormulaManager.cxx:129
 TTreeFormulaManager.cxx:130
 TTreeFormulaManager.cxx:131
 TTreeFormulaManager.cxx:132
 TTreeFormulaManager.cxx:133
 TTreeFormulaManager.cxx:134
 TTreeFormulaManager.cxx:135
 TTreeFormulaManager.cxx:136
 TTreeFormulaManager.cxx:137
 TTreeFormulaManager.cxx:138
 TTreeFormulaManager.cxx:139
 TTreeFormulaManager.cxx:140
 TTreeFormulaManager.cxx:141
 TTreeFormulaManager.cxx:142
 TTreeFormulaManager.cxx:143
 TTreeFormulaManager.cxx:144
 TTreeFormulaManager.cxx:145
 TTreeFormulaManager.cxx:146
 TTreeFormulaManager.cxx:147
 TTreeFormulaManager.cxx:148
 TTreeFormulaManager.cxx:149
 TTreeFormulaManager.cxx:150
 TTreeFormulaManager.cxx:151
 TTreeFormulaManager.cxx:152
 TTreeFormulaManager.cxx:153
 TTreeFormulaManager.cxx:154
 TTreeFormulaManager.cxx:155
 TTreeFormulaManager.cxx:156
 TTreeFormulaManager.cxx:157
 TTreeFormulaManager.cxx:158
 TTreeFormulaManager.cxx:159
 TTreeFormulaManager.cxx:160
 TTreeFormulaManager.cxx:161
 TTreeFormulaManager.cxx:162
 TTreeFormulaManager.cxx:163
 TTreeFormulaManager.cxx:164
 TTreeFormulaManager.cxx:165
 TTreeFormulaManager.cxx:166
 TTreeFormulaManager.cxx:167
 TTreeFormulaManager.cxx:168
 TTreeFormulaManager.cxx:169
 TTreeFormulaManager.cxx:170
 TTreeFormulaManager.cxx:171
 TTreeFormulaManager.cxx:172
 TTreeFormulaManager.cxx:173
 TTreeFormulaManager.cxx:174
 TTreeFormulaManager.cxx:175
 TTreeFormulaManager.cxx:176
 TTreeFormulaManager.cxx:177
 TTreeFormulaManager.cxx:178
 TTreeFormulaManager.cxx:179
 TTreeFormulaManager.cxx:180
 TTreeFormulaManager.cxx:181
 TTreeFormulaManager.cxx:182
 TTreeFormulaManager.cxx:183
 TTreeFormulaManager.cxx:184
 TTreeFormulaManager.cxx:185
 TTreeFormulaManager.cxx:186
 TTreeFormulaManager.cxx:187
 TTreeFormulaManager.cxx:188
 TTreeFormulaManager.cxx:189
 TTreeFormulaManager.cxx:190
 TTreeFormulaManager.cxx:191
 TTreeFormulaManager.cxx:192
 TTreeFormulaManager.cxx:193
 TTreeFormulaManager.cxx:194
 TTreeFormulaManager.cxx:195
 TTreeFormulaManager.cxx:196
 TTreeFormulaManager.cxx:197
 TTreeFormulaManager.cxx:198
 TTreeFormulaManager.cxx:199
 TTreeFormulaManager.cxx:200
 TTreeFormulaManager.cxx:201
 TTreeFormulaManager.cxx:202
 TTreeFormulaManager.cxx:203
 TTreeFormulaManager.cxx:204
 TTreeFormulaManager.cxx:205
 TTreeFormulaManager.cxx:206
 TTreeFormulaManager.cxx:207
 TTreeFormulaManager.cxx:208
 TTreeFormulaManager.cxx:209
 TTreeFormulaManager.cxx:210
 TTreeFormulaManager.cxx:211
 TTreeFormulaManager.cxx:212
 TTreeFormulaManager.cxx:213
 TTreeFormulaManager.cxx:214
 TTreeFormulaManager.cxx:215
 TTreeFormulaManager.cxx:216
 TTreeFormulaManager.cxx:217
 TTreeFormulaManager.cxx:218
 TTreeFormulaManager.cxx:219
 TTreeFormulaManager.cxx:220
 TTreeFormulaManager.cxx:221
 TTreeFormulaManager.cxx:222
 TTreeFormulaManager.cxx:223
 TTreeFormulaManager.cxx:224
 TTreeFormulaManager.cxx:225
 TTreeFormulaManager.cxx:226
 TTreeFormulaManager.cxx:227
 TTreeFormulaManager.cxx:228
 TTreeFormulaManager.cxx:229
 TTreeFormulaManager.cxx:230
 TTreeFormulaManager.cxx:231
 TTreeFormulaManager.cxx:232
 TTreeFormulaManager.cxx:233
 TTreeFormulaManager.cxx:234
 TTreeFormulaManager.cxx:235
 TTreeFormulaManager.cxx:236
 TTreeFormulaManager.cxx:237
 TTreeFormulaManager.cxx:238
 TTreeFormulaManager.cxx:239
 TTreeFormulaManager.cxx:240
 TTreeFormulaManager.cxx:241
 TTreeFormulaManager.cxx:242
 TTreeFormulaManager.cxx:243
 TTreeFormulaManager.cxx:244
 TTreeFormulaManager.cxx:245
 TTreeFormulaManager.cxx:246
 TTreeFormulaManager.cxx:247
 TTreeFormulaManager.cxx:248
 TTreeFormulaManager.cxx:249
 TTreeFormulaManager.cxx:250
 TTreeFormulaManager.cxx:251
 TTreeFormulaManager.cxx:252
 TTreeFormulaManager.cxx:253
 TTreeFormulaManager.cxx:254
 TTreeFormulaManager.cxx:255
 TTreeFormulaManager.cxx:256
 TTreeFormulaManager.cxx:257
 TTreeFormulaManager.cxx:258
 TTreeFormulaManager.cxx:259
 TTreeFormulaManager.cxx:260
 TTreeFormulaManager.cxx:261
 TTreeFormulaManager.cxx:262
 TTreeFormulaManager.cxx:263
 TTreeFormulaManager.cxx:264
 TTreeFormulaManager.cxx:265
 TTreeFormulaManager.cxx:266
 TTreeFormulaManager.cxx:267
 TTreeFormulaManager.cxx:268
 TTreeFormulaManager.cxx:269
 TTreeFormulaManager.cxx:270
 TTreeFormulaManager.cxx:271
 TTreeFormulaManager.cxx:272
 TTreeFormulaManager.cxx:273
 TTreeFormulaManager.cxx:274
 TTreeFormulaManager.cxx:275
 TTreeFormulaManager.cxx:276
 TTreeFormulaManager.cxx:277
 TTreeFormulaManager.cxx:278
 TTreeFormulaManager.cxx:279
 TTreeFormulaManager.cxx:280
 TTreeFormulaManager.cxx:281
 TTreeFormulaManager.cxx:282
 TTreeFormulaManager.cxx:283
 TTreeFormulaManager.cxx:284
 TTreeFormulaManager.cxx:285
 TTreeFormulaManager.cxx:286
 TTreeFormulaManager.cxx:287
 TTreeFormulaManager.cxx:288
 TTreeFormulaManager.cxx:289
 TTreeFormulaManager.cxx:290
 TTreeFormulaManager.cxx:291
 TTreeFormulaManager.cxx:292
 TTreeFormulaManager.cxx:293
 TTreeFormulaManager.cxx:294
 TTreeFormulaManager.cxx:295
 TTreeFormulaManager.cxx:296
 TTreeFormulaManager.cxx:297
 TTreeFormulaManager.cxx:298
 TTreeFormulaManager.cxx:299
 TTreeFormulaManager.cxx:300
 TTreeFormulaManager.cxx:301
 TTreeFormulaManager.cxx:302
 TTreeFormulaManager.cxx:303
 TTreeFormulaManager.cxx:304
 TTreeFormulaManager.cxx:305
 TTreeFormulaManager.cxx:306
 TTreeFormulaManager.cxx:307
 TTreeFormulaManager.cxx:308
 TTreeFormulaManager.cxx:309
 TTreeFormulaManager.cxx:310
 TTreeFormulaManager.cxx:311
 TTreeFormulaManager.cxx:312
 TTreeFormulaManager.cxx:313
 TTreeFormulaManager.cxx:314
 TTreeFormulaManager.cxx:315
 TTreeFormulaManager.cxx:316
 TTreeFormulaManager.cxx:317
 TTreeFormulaManager.cxx:318
 TTreeFormulaManager.cxx:319
 TTreeFormulaManager.cxx:320
 TTreeFormulaManager.cxx:321
 TTreeFormulaManager.cxx:322
 TTreeFormulaManager.cxx:323
 TTreeFormulaManager.cxx:324
 TTreeFormulaManager.cxx:325
 TTreeFormulaManager.cxx:326
 TTreeFormulaManager.cxx:327
 TTreeFormulaManager.cxx:328
 TTreeFormulaManager.cxx:329
 TTreeFormulaManager.cxx:330
 TTreeFormulaManager.cxx:331
 TTreeFormulaManager.cxx:332
 TTreeFormulaManager.cxx:333
 TTreeFormulaManager.cxx:334
 TTreeFormulaManager.cxx:335
 TTreeFormulaManager.cxx:336
 TTreeFormulaManager.cxx:337
 TTreeFormulaManager.cxx:338
 TTreeFormulaManager.cxx:339
 TTreeFormulaManager.cxx:340
 TTreeFormulaManager.cxx:341