#include "QFramework/TQNamedTaggable.h"
#include "QFramework/TQSampleFolder.h"
#include "QFramework/TQCutflowPrinter.h"
#include "QFramework/TQStringUtils.h"
#include "QFramework/TQHistogramUtils.h"
#include "QFramework/TQCounter.h"
#include "TNamed.h"
#include "QFramework/TQUtils.h"
#include "QFramework/TQIterator.h"
#include "TList.h"
#include "TObjString.h"
#include "TObjArray.h"
#include "TMath.h"
#include <time.h>

#include <iostream>
#include <fstream>
#include <sstream>
#include <cstdlib>
#include <string>

#include "QFramework/TQTable.h"
//#define _DEBUG_

#include "QFramework/TQLibrary.h"

////////////////////////////////////////////////////////////////////////////////////////////////
//
// TQCutflowPrinter:
//
// The TQCutflowPrinter class uses an TQSampleDataReader to obtain
// cutflow numbers to print cutflow tables in ordinary text style, in
// latex style or in HTML style.
//
////////////////////////////////////////////////////////////////////////////////////////////////

ClassImp(TQCutflowPrinter)


//______________________________________________________________________________________________

TQCutflowPrinter::TQCutflowPrinter() :
TQPresenter()
{
  // Default constructor of TQCutflowPrinter class:
}

//______________________________________________________________________________________________

TQCutflowPrinter::TQCutflowPrinter(TQSampleFolder * samples) :
  TQPresenter(samples)
{
  // Constructor of TQCutflowPrinter class:
}

//__________________________________________________________________________________|___________

TQCutflowPrinter::TQCutflowPrinter(TQSampleDataReader * reader) :
  TQPresenter(reader)
{
  // Constructor of TQCutflowPrinter class:
}

//__________________________________________________________________________________|___________

void TQCutflowPrinter::addCutflowCut(TString cutName, TString cutTitle, int sfPolicy) {
  // add a cut to be listed in the cutflow.

  /* the default title is the cut name itself */
  if (cutTitle.IsNull())
    cutTitle = cutName;
  TQNamedTaggable* cut = new TQNamedTaggable(cutName);
  cut->setTag(".name",TQStringUtils::trim(cutName));
  cut->setTag(".title",TQStringUtils::trim(cutTitle));
  cut->setTag(".sfPolicy",sfPolicy);
  fCuts->Add(cut);
}


//__________________________________________________________________________________|___________

void TQCutflowPrinter::addCutflowProcess(TString processName, TString processTitle) {
  // Add a process to be listed in the cutflow. The first argument (processName)
  // specifies the process path (e.g. "bkg/ee/top"), the second (optional) argument
  // may be used to specify a title shown in the table for this process. You can
  // specify additional format specifications (e.g. "bkg/ee/top,raw" to obtain raw
  // numbers).
  //
  // There are several additional numbers which can be plotted:
  //
  // - the ratio of two processes at a given cut stage
  //
  // addCutflowProcess("$ratio(data/ee,bkg/ee)");
  //
  // - the signal significance at a given cut stage
  //
  // addCutflowProcess("$signif(sig/ee,bkg/ee)");
  //
  // - the pull of two processes
  //
  // addCutflowProcess("$pull(data/ee,bkg/ee)");
  //

  TQNamedTaggable* process = new TQNamedTaggable(processName);
  process->SetName(processName);
  process->SetTitle(processTitle);

  TString processOptions = "";

  int commaPos = kNPOS;
  if ( processName.BeginsWith("$") ){
    commaPos = processName.Index(")");
    commaPos = processName.Index(",", commaPos);
  } else {
    commaPos = processName.Index(",");
  }
  if (commaPos != kNPOS) {
    processOptions = processName(commaPos + 1, processName.Length());
    processName.Remove(commaPos, processName.Length());
  }

  process->setTagString(".name",TQFolder::makeValidIdentifier(processName));

  bool removeSpecial = false;
  if (processName.BeginsWith("$ratio(")){
    process->setTagString(".special","ratio");
    removeSpecial=true;
  }
  if (processName.BeginsWith("$pull(")){
    process->setTagString(".special","pull");
    removeSpecial=true;
  }
  if (processName.BeginsWith("$signif(")){
    process->setTagString(".special","significance");
    removeSpecial=true;
  }

  TString special;
  if(removeSpecial){
    /* remove "$ratio(" or "$pull(" */
    TString function = processName(0, processName.Index("("));
    DEBUGclass("found special process '%s' with old notation",special.Data());
    processName.Remove(0, processName.Index("(") + 1);
    /* extract the two processes */
    Ssiz_t commaPos = processName.Index(",");
    Ssiz_t bracePos = processName.Index(")");
    TString process1 = processName(0, commaPos);
    TString process2 = processName(commaPos + 1, bracePos - commaPos - 1);

    process->setTagString(".path1",process1);
    process->setTagString(".path2",process2);
    process->setTagString(".path",process1+","+process2);
    //@tag: [.special] If this process tag is set, the process is marked as a special process. Possible values are "ratio", "pull" and "significance"
  }
  //it seems, this code is never executed. TODO: remove if no problems appear.
  /*else if(process->getTagString(".special",special)){
    if(process->hasTagString(".path1") && process->hasTagString(".path2")){
      DEBUGclass("found fully specified special process '%s'",special.Data());
      // nothing to do here
    } else {
      DEBUGclass("found incomplete special process '%s', auto-fixing",special.Data());
      int commaPos = processName.First(",");
      TString process1 = processName(0, commaPos);
      TString process2 = processName(commaPos);
    }
  }*/
   else {
    process->setTagString(".path",TQStringUtils::trim(processName));
  }

  if(processOptions.Contains("raw",TString::kIgnoreCase)) {
    process->setTagBool(".showRaw",true);
  }
  if(processOptions.Contains("scaled",TString::kIgnoreCase)) {
    process->setTagBool(".showScaled",true);
  }
  if(processOptions.Contains("errors",TString::kIgnoreCase)) {
    process->setTagBool(".showErrors",true);
  }
  if(processOptions.Contains("sys",TString::kIgnoreCase)) {
    process->setTagString(".includeSysError","*");
  }

  process->setTagString(".title",TQStringUtils::trim(processTitle));
  fProcesses->Add(process);
}

//__________________________________________________________________________________|___________

TQTable * TQCutflowPrinter::createTable(const TString& tags) {
  // create a TQTable object

  /* create the taggable object and import the tags */
  TQTaggable taggable(tags);

  return this->createTable(taggable);
}

//__________________________________________________________________________________|___________

TQTable * TQCutflowPrinter::createTable(TQTaggable* tags) {
  // create a TQTable object
  if(tags) return this->createTable(*tags);

  TQTaggable newTags;
  return this->createTable(newTags);
}

//__________________________________________________________________________________|___________

bool TQCutflowPrinter::getScaleFactors(TQTaggable& tags, TQNamedTaggable* cut, TList* sfList, double& number, double& error, bool& applied, bool& equal, TString& info){
  // retrieve scale factors for some cut/process combination

  TString cutName = tags.replaceInText(cut->getTagStringDefault(".name",cut->GetName()));
  //TODO: enable this functionality//@tag: [.scaleScheme] This cut tag can be used to use a different set of NFs. If not specified defaults to '.default'
  //TString scaleScheme = tags.replaceInText(cut->getTagStringDefault(".scaleScheme",".default"));

  std::map<double,TList*> infomap;

  number = 1;
  error = 0;
  applied = false;
  equal = true;
  TQSampleFolderIterator subitr(sfList);
  while(subitr.hasNext()){
    TQSampleFolder* sf = subitr.readNext();
    if(!sf) continue;
    TQCounter* nf = sf->getScaleFactorCounterRecursive(cutName);
    if(!nf) continue;
    double val = nf->getCounter();
    if(infomap.find(val) == infomap.end()){
      infomap[val] = new TList();
    }
    infomap[val]->Add(sf);
    if (!applied){
      number = val;
      error = nf->getError();
      applied = true;
    } else {
      if (!TMath::AreEqualRel(val, number, 10E-5)) equal = false;
    }
    delete nf;
  }

  for(const auto& it:infomap){
    TQFolder* base = fReader->getSampleFolder()->findCommonBaseFolder(it.second,true);
    if(!info.IsNull()) info += ", ";
    info += base->getPathWildcarded() + TString::Format(":%g",it.first);
    it.second->SetOwner(false);
    delete it.second;
  }

  return true;
}


//__________________________________________________________________________________|___________
bool TQCutflowPrinter::getValues(TQTaggable& tags, TQNamedTaggable* cut, TQNamedTaggable* process, double& number, double& err, int& raw, TString& info, TString& defaultTitle, TList* sfList){
  double statError = 0;
  double expSysError = 0;
  double theoSysError = 0;
  bool includeScaleUncertainty = process->getTagBoolDefault(".includeScaleUncertainty",tags.getTagBoolDefault("includeScaleUncertainty", false));
  bool res = getValues(tags, cut, process, number, statError, expSysError, theoSysError, includeScaleUncertainty, raw, info, defaultTitle, sfList);
  bool includeStatUncertainty = process->getTagBoolDefault(".includeStatError",tags.getTagBoolDefault("includeStatError",true));
  double errSqNoTheo = pow(statError, 2) + pow(expSysError, 2);
  if (includeScaleUncertainty && includeStatUncertainty) {
    err = sqrt(errSqNoTheo + pow(theoSysError, 2));
  } else if (includeStatUncertainty) {
    err = sqrt(errSqNoTheo);
  } else if (includeScaleUncertainty) {
    err = theoSysError;
  } else {
    err = 0;
  }
  int precision;
  tags.getTagInteger("style.precision", precision);
  return res;
}

bool TQCutflowPrinter::getValues(TQTaggable& tags, TQNamedTaggable* cut, TQNamedTaggable* process, double& number, double& statErr, double& expSysErr, double& theoSysErr, bool includeScaleUncertainty, int& raw, TString& info, TString& defaultTitle, TList* sfList){
  // retrieve counter values for some cut/process combination

  TString processName = tags.replaceInText(process->getTagStringDefault(".path",process->GetName()));
  TString cutName = tags.replaceInText(cut->getTagStringDefault(".name",cut->GetName()));
  std::shared_ptr<TQTaggable> masterCfg = TQTaggable::getGlobalTaggable("master");
  
  bool showNumbers = false;
  number = 0.;
  raw = 0 ;
  info = "";
  DEBUGclass("processName '%s' ",processName.Data());
  TString specialProcess,specialCut;
  TQTaggable tmpTags(tags);
  if (process->getTagString(".special",specialProcess) || cut->getTagString(".special",specialCut)){
    double number1 = 0;
    double number2 = 0;
    double statErr1 = 0;
    double statErr2 = 0;
    double theoSysErr1 = 0;
    double theoSysErr2 = 0;
    TString info1;
    TString info2;
    if(specialCut == "ratio"){
      TString otherCut(tags.replaceInText(cut->getTagStringDefault(".denominator","")));
      if (includeScaleUncertainty) {
        this->getCounterValueAndErrors(processName, cutName, number1, statErr1, theoSysErr1, raw, info1, tags, nullptr);
        this->getCounterValueAndErrors(processName, otherCut, number2, statErr2, theoSysErr2, raw, info2, tags, nullptr);
      } else {
        this->getCounterValueAndStatError(processName, cutName, number1, statErr1, raw, info1, tags, nullptr);
        this->getCounterValueAndStatError(processName, otherCut, number2, statErr2, raw, info2, tags, nullptr);
      }
      DEBUG("making cut ratio");
      showNumbers = true;
      number = number1 / number2;
      // https://gitlab.cern.ch/atlas-caf/CAFCore/merge_requests/89#note_911591
      statErr = sqrt(pow(statErr1 / number2, 2) + pow(statErr2 * number / number2, 2)  );
      if (includeScaleUncertainty) {
        theoSysErr = sqrt(pow(theoSysErr1 / number2, 2) + pow(theoSysErr2 * number / number2, 2)  );
      }
      // Check for NaN
      if(statErr != statErr) statErr = 0;
      if(theoSysErr != theoSysErr) theoSysErr = 0;
      raw = -1;
      if (includeScaleUncertainty) {
        info = info1 + ", " + info2 + ", " + info.Append(TString::Format("ratio = %g +/- %g(stat) +/- %g(sys)",number,statErr,theoSysErr));
      } else {
        info = info1 + ", " + info2 + ", " + info.Append(TString::Format("ratio = %g +/- %g(stat)",number,statErr));
      }
    }
    else if (specialProcess == "ratio"){
      TString path1(tags.replaceInText(process->getTagStringDefault(".numerator",process->getTagStringDefault(".path1",""))));
      TString path2(tags.replaceInText(process->getTagStringDefault(".denominator",process->getTagStringDefault(".path2",""))));
      //TQCounter * cnt1 = fReader->getCounter(path1, cutName, &tags);
      //TQCounter * cnt2 = fReader->getCounter(path2, cutName, &tags);
      if (includeScaleUncertainty) {
        this->getCounterValueAndErrors(path1, cutName, number1, statErr1, theoSysErr1, raw, info1, tags, nullptr);
        this->getCounterValueAndErrors(path2, cutName, number2, statErr2, theoSysErr2, raw, info2, tags, nullptr);
      } else {
        this->getCounterValueAndStatError(path1, cutName, number1, statErr1, raw, info1, tags, nullptr);
        this->getCounterValueAndStatError(path2, cutName, number2, statErr2, raw, info2, tags, nullptr);
      }
      DEBUG("making ratio");
      showNumbers = true;
      number = number1 / number2;
      statErr = number * sqrt(pow(statErr1 / number1, 2) + pow(statErr2 / number2, 2));
      if (includeScaleUncertainty) {
        theoSysErr = number * sqrt(pow(theoSysErr1 / number1, 2) + pow(theoSysErr2 / number2, 2));
      }
      // Check for NaN
      if(statErr != statErr) statErr = 0;
      if(theoSysErr != theoSysErr) theoSysErr = 0;
      raw = -1;
      if (includeScaleUncertainty) {
        info = info1 + ", " + info2 + ", " + info.Append(TString::Format("ratio = %g +/- %g(stat) +/- %g(sys)",number,statErr,theoSysErr));
      } else {
        info = info1 + ", " + info2 + ", " + info.Append(TString::Format("ratio = %g +/- %g(stat)",number,statErr));
      }
    } else if (specialProcess == "significance"){
    
      TString path1(tags.replaceInText(process->getTagStringDefault(".signal",process->getTagStringDefault(".path1",""))));
      TString path2(tags.replaceInText(process->getTagStringDefault(".background",process->getTagStringDefault(".path2",""))));
      
      double bkgSystErrorSq = 0.;
      //@tag: [significance.bkgErrorFromPath] This global("master") tag allows to specify a list of paths (including $(channel) and $(campaign) placeholders) to be used to determine a (systematic) uncertainty of the background estimate to be used with the Poisson significance estimate with accounting for a background systematics estimate (see https://cds.cern.ch/record/2643488/files/ATL-COM-GEN-2018-026.pdf). The usual path arithmetics can be used to, e.g., define the error to be a fraction of some process' yield: "0.3*bkg/$(channel)/$(campaign)/fakes" . If multiple, comma seperated paths are given they are summed in quadrature to determine the full systematic uncertainty.
      std::vector<TString> bkgSysSources = masterCfg->getTagVString("significance.bkgErrorFromPath");
      for (TString& systSource: bkgSysSources) { //on purpuse *not* const -> replace tags in place (channel, campaigns,...)
        systSource = tags.replaceInText(systSource);
        //we don't care about additional info here, so be a little faster and use getCounter directly...
        TQCounter* cnt = fReader->getCounter(systSource, cutName, &tags);
        if (!cnt) {
          ERRORclass("Failed to obtain systematic uncertainty source with path specification '%s'", systSource.Data());
          continue;
        }
        bkgSystErrorSq += pow(cnt->getCounter(),2);
        delete cnt;
      }
      
      if (includeScaleUncertainty) { //what is called "theoSys" is an uncertainty hacked-in via the NF machinery. It should therefore be read as an uncertainty of what the central value for some processes normalization will be and less of an uncertainty of the background yield... (hence it is only considered in the uncertainty of the significance,not in the significance itself...)
          //-> we should really have a better way for adding systematics in cutflows, for now keeping support for this user-supplied feature
        this->getCounterValueAndErrors(path1, cutName, number1, statErr1, theoSysErr1, raw, info1, tags, nullptr);
        this->getCounterValueAndErrors(path2, cutName, number2, statErr2, theoSysErr2, raw, info2, tags, nullptr);
      } else {
        this->getCounterValueAndStatError(path1, cutName, number1, statErr1, raw, info1, tags, nullptr);
        this->getCounterValueAndStatError(path2, cutName, number2, statErr2, raw, info2, tags, nullptr);
      }
      DEBUG("making significance");
      showNumbers = true;
      double statPlusSystErr2 = std::sqrt( pow(statErr2,2) + bkgSystErrorSq );
      number = TQHistogramUtils::getPoissonWithError(number2, statPlusSystErr2, number1); //for the central value include also the bkg syst error
      statErr = TQHistogramUtils::getPoissonWithErrorError(number2, number1, statErr2, statErr1); //statistical precision of significance estimate, don't consider bkg syst here
      if (includeScaleUncertainty) {
        theoSysErr = TQHistogramUtils::getPoissonWithErrorError(number2, number1, theoSysErr2, theoSysErr1);
      }
      raw = -1;
      if (includeScaleUncertainty) {
        info = info1 + ", " + info2 + ", " + info.Append(TString::Format("signif. = %g +/- %g(stat) +/- %g(sys)",number,statErr,theoSysErr));
      } else {
        info = info1 + ", " + info2 + ", " + info.Append(TString::Format("signif = %g +/- %g(stat)",number,statErr));
      }
      
    } else if (specialProcess == "pull"){
      TString path1(tags.replaceInText(process->getTagStringDefault(".path1","")));
      TString path2(tags.replaceInText(process->getTagStringDefault(".path2","")));
      if (includeScaleUncertainty) {
        this->getCounterValueAndErrors(path1, cutName, number1, statErr1, theoSysErr1, raw, info1, tags, nullptr);
        this->getCounterValueAndErrors(path2, cutName, number2, statErr2, theoSysErr2, raw, info2, tags, nullptr);
      } else {
        this->getCounterValueAndStatError(path1, cutName, number1, statErr1, raw, info1, tags, nullptr);
        this->getCounterValueAndStatError(path2, cutName, number2, statErr2, raw, info2, tags, nullptr);
      }
      DEBUG("making pull");
      showNumbers = true;
      double totalErr = 0;
      if (includeScaleUncertainty) {
        totalErr = sqrt(pow(statErr1, 2) + pow(statErr2, 2) + pow(theoSysErr1, 2) + pow(theoSysErr2, 2));
      } else {
        totalErr = sqrt(pow(statErr1, 2) + pow(statErr2, 2));
      }
      number = (number1 - number2) / totalErr;
      raw = -1;
      statErr = std::numeric_limits<double>::quiet_NaN();
      theoSysErr = std::numeric_limits<double>::quiet_NaN();
      info = info1 + ", " + info2 +  ", " + TString::Format("pull=%g",number);
    } else if (specialProcess == "acceptance"){
      TString otherCut(tags.replaceInText(process->getTagStringDefault(".denominator","")));
      bool isEfficiency = process->getTagStringDefault(".isEfficiency",true);
      if (includeScaleUncertainty) {
        this->getCounterValueAndErrors(processName, cutName, number1, statErr1, theoSysErr1, raw, info1, tags, nullptr);
        this->getCounterValueAndErrors(processName, otherCut, number2, statErr2, theoSysErr2, raw, info2, tags, nullptr);
      } else {
        this->getCounterValueAndStatError(processName, cutName, number1, statErr1, raw, info1, tags, nullptr);
        this->getCounterValueAndStatError(processName, otherCut, number2, statErr2, raw, info2, tags, nullptr);
      }
      DEBUG("making acceptance");
      showNumbers = true;
      number = number1 / number2;
      double relStatErr1 = statErr1/number1;
      double relStatErr2 = statErr2/number2;
      if((isEfficiency) && (number <= 1)){
        // If isEfficiency, then the errors between number1 and number2 are correlated.
        // The error propagation is the same, but has an additional term to take into
        // account the correlation. This error will be smaller than the uncorrelated
        // error. See also CAFDocumentation/equations.tex.
        statErr = number * sqrt( pow(relStatErr1, 2) + pow(relStatErr2, 2) - 2*relStatErr1*relStatErr2*number );
        if (includeScaleUncertainty) {
          double relTheoSysErr1 = theoSysErr1/number1;
          double relTheoSysErr2 = theoSysErr2/number2;
          theoSysErr = number * sqrt( pow(relTheoSysErr1, 2) + pow(relTheoSysErr2, 2) - 2*relTheoSysErr1*relTheoSysErr2*number );
        }
      } else {
        statErr = sqrt(pow(statErr1 / number2, 2) + pow(statErr2 * number / number2, 2));
        if (includeScaleUncertainty) {
          theoSysErr = sqrt(pow(theoSysErr1 / number2, 2) + pow(theoSysErr2 * number / number2, 2));
        }
      }
      // Check for NaN
      if(statErr != statErr) statErr = 0;
      if(theoSysErr != theoSysErr) theoSysErr = 0;
      raw = -1;
      if (includeScaleUncertainty) {
        info = info1 + ", " + info2 + ", " + info.Append(TString::Format("acceptance = %g +/- %g(stat) +/- %g(sys)",number,statErr, theoSysErr));
      } else {
        info = info1 + ", " + info2 + ", " + info.Append(TString::Format("acceptance = %g +/- %g(stat)",number,statErr));
      }
    }
  } else {
    DEBUGclass("Processing non-special case");
    tmpTags.importTags(process);
    tmpTags.importTags(cut);

    if (includeScaleUncertainty) {
      this->getCounterValueAndErrors(processName, cutName, number, statErr, theoSysErr, raw, info, tags, sfList);
    } else {
      this->getCounterValueAndStatError(processName, cutName, number, statErr, raw, info, tags, sfList);
    }
    showNumbers = true;
    TString systID;
    if(process->getTagString(".includeSysError",systID)){
      DEBUGclass("including syst. error with systID '%s'",systID.Data());
      TQFolder* sysFolder = this->fSystematics->getFolder(TQFolder::concatPaths(systID,cutName));
      if(sysFolder) {
        double expSysErrorFrac = sysFolder->getTagDoubleDefault("yield",0);
        expSysErr = expSysErrorFrac * number;
      }
    }
    if(defaultTitle.IsNull()) {
      DEBUGclass("no default title found, trying to obtain it from a counter");
      #ifdef _DEBUG_
        tags.printTags();
      #endif
      TQCounter* counter = fReader->getCounter(processName, cutName, &tags);
      if (!counter) {
        defaultTitle = "";
      } else {
        defaultTitle = counter->GetTitle();
        delete counter;
      }
    }
    int precision = tags.getTagIntegerDefault("style.precision", 10);
    DEBUGclass("building info string, precision: %d",precision);
    if (expSysErr == 0 && theoSysErr == 0) {
      info = TString::Format(
          "%*f +/- %*f (stat) [raw: %*i]",
          precision,
          number,
          precision,
          statErr,
          precision,
          raw
      );
    } else {
      info = TString::Format(
          "%*f +/- %*f (stat) +/- %*f (sys) [raw: %*i]",
          precision,
          number,
          precision,
          statErr,
          precision,
          sqrt(pow(expSysErr, 2) + pow(theoSysErr, 2)),
          precision,
          raw
      );
    }
  }

  double scale = tags.getTagDoubleDefault ("scale",1.);
  number *= scale;
  statErr *= scale;
  expSysErr *= scale;
  theoSysErr *= scale;
  DEBUGclass("getValue is returning now");
  return showNumbers;
}

void TQCutflowPrinter::getCounterValueAndStatError(
    const TString& processName,
    const TString& cutName,
    double& count,
    double& statErr,
    int& raw,
    TString& info,
    TQTaggable tags,
    TList* sfList
) {
  tags.setTagBool("includeScaleUncertainty", false);
  auto cnt = fReader->getCounter(processName, cutName, &tags, sfList);
  if (!cnt) {
    count = 0;
    statErr = 0;
    if(fVerbose){
      ERRORclass( "Error in TQCutflowPrinter::getCounterValueAndStatError - failed to retrieve counter for process with name '%s'and cut '%s'",processName.Data(),cutName.Data());
    }
    return;
  }
  count = cnt->getCounter();
  statErr = cnt->getError();
  raw = cnt->getRawCounter();
  info = cnt->getAsString();
  delete cnt;
}

//__________________________________________________________________________________|___________

void TQCutflowPrinter::getCounterValueAndErrors(
    const TString& processName,
    const TString& cutName,
    double& count,
    double& statErr,
    double& theoSysErr,
    int& raw,
    TString& info,
    TQTaggable tags,
    TList* sfList
) {
  getCounterValueAndStatError(processName, cutName, count, statErr, raw, info, tags, sfList);
  tags.setTagBool("includeScaleUncertainty", true);
  auto cnt = fReader->getCounter(processName, cutName, &tags, sfList);
  if (!cnt) {
    theoSysErr = 0;
    raw = 0;
    info = "";
    if(fVerbose){
      ERRORclass( "Error in TQCutflowPrinter::getCounterValueAndErrors - failed to retrieve counter");
    }
    return;
  }
  double statPlusTheoErr = cnt->getError();
  theoSysErr = sqrt(pow(statPlusTheoErr, 2) - pow(statErr, 2));
  info = cnt->getAsString();
  delete cnt;
}

//__________________________________________________________________________________|___________

void TQCutflowPrinter::setVerbose(bool v){
  this->fVerbose = v;
}

//__________________________________________________________________________________|___________

int TQCutflowPrinter::sanitizeProcesses() {
  // sanitize all processes
  TQTaggableIterator itr(fProcesses);
  std::vector<TQNamedTaggable*> removals;
  int retval = 0;
  while(itr.hasNext()){
    TQNamedTaggable* process = itr.readNext();
    if(!process) continue;
    TString path,special;
    if(!process->getTagString(".path",path) && !process->getTagString(".special",special)){
      removals.push_back(process);
    } else if(!process->getTagString(".name",path)){
      if(path.IsNull()){
        process->setTagString(".name",TQFolder::makeValidIdentifier(special));
        process->SetName(special);
      } else {
        process->setTagString(".name",TQFolder::makeValidIdentifier(path));
        process->SetName(path);
      }
    }
  }
  for(size_t i=0; i<removals.size(); i++){
    fProcesses->Remove(removals[i]);
    delete removals[i];
    retval++;
  }
  return retval;
}

//__________________________________________________________________________________|___________

int TQCutflowPrinter::sanitizeCuts() {
  // sanitize all cuts
  TQTaggableIterator itr(fCuts);
  std::vector<TQNamedTaggable*> removals;
  int retval = 0;
  while(itr.hasNext()){
    TQNamedTaggable* cut = itr.readNext();
    if(!cut) continue;
    TString name;
    if(!cut->getTagString(".name",name)){
      removals.push_back(cut);
    }
  }
  for(size_t i=0; i<removals.size(); i++){
    fCuts->Remove(removals[i]);
    delete removals[i];
    retval++;
  }
  return retval;
}


//__________________________________________________________________________________|___________

TQTable * TQCutflowPrinter::createTable(TQTaggable tags) {
  // create a TQTable object
  tags.importTags(this);

  if(!fCuts){
    ERRORclass("cannot create cutflow: no cuts scheduled");
    return NULL;
  }
  if(!fProcesses){
    ERRORclass("cannot create cutflow: no processes scheduled");
    return NULL;
  }

  DEBUGclass("retrieving tags");

  int cellWidth = -1;
  int firstColumnWidth = -1;
  int precision = 2;
  double scale = 1.;
  bool hideAllSf = false;
  bool showAllSf = false;
  bool forceAllSf = false;
  TString nfPrefixText = this->getTagStringDefault("nfPrefixText","NF = ");
  this->getTagString("sfPrefixText",nfPrefixText);

  //@tag: [style.cutline,style.cellWidth,style.firstColumnWidth,style.cellAlign,style.firstColumnAlign,style.precision,style.usePercNotn,style.useExpNotn] These tags control various style settings for the cell contents of the cutflow table. The tags "cutline" (default: true) and "usePercNotn" (default:false) are boolean valued tags, all others are integer valued tags. Argument tag overrides object tag.
  //@tag: [style.latex] Boolean argument tag determining if cutflow is produced in LaTeX format. Default: true. Argument tag overrides object tag.
  bool useCutline = tags.getTagBoolDefault ("style.cutline", true);
  tags.getTagInteger ("style.cellWidth", cellWidth);
  tags.getTagInteger ("style.firstColumnWidth", firstColumnWidth);
  tags.getTagInteger ("style.precision", precision);
  tags.getTagDouble ("scale", scale);
  tags.getTagBool ("style.hideSF", hideAllSf);
  tags.getTagBool ("style.showSF", showAllSf);
  bool sfAfter = tags.getTagBoolDefault("style.showSFsAfter", false);
  tags.getTagBool ("style.forceSF", forceAllSf);
  bool usePercNotn = tags.getTagBoolDefault ("style.usePercNotn",false);
  bool useExpNotn = tags.getTagBoolDefault ("style.useExpNotn",false);

  // Hide data from the cutflow unless otherwise specified
  bool showData = tags.getTagBoolDefault("showData", false);

  // Create the list of cuts to show for data.
  std::vector<TString> showDataAtCuts;
  if (showData) {
    tags.getTag("showDataAtCuts", showDataAtCuts);
  }


  //@tag: [.showErrors] If this tag is set to true, uncertainties are shown in addition to nominal values. Default: true. argument tag overrides object tag.
  bool showErrors = tags.getTagBoolDefault("style.showErrors",true);

  int nCuts = fCuts->GetEntries();
  int nProcesses = fProcesses->GetEntries();

  int row = 0;
  int col = 0;
  /* ----- prepare the table --- */

  TQTable* table = new TQTable("Cutflow");
  table->setTagString("colAlign",tags.getTagStringDefault("style.cellAlign","r"));
  table->setTagInteger("cellWidth",tags.getTagIntegerDefault("style.cellWidth",20));
  table->setColAlign(0,tags.getTagStringDefault("style.firstColumnAlign",tags.getTagStringDefault("style.cellAlign","r")));
  table->setTagBool("standalone",false);
  table->setTagInteger("format.nSignificantDigits",precision);
  if(usePercNotn) table->setTagBool("format.useRelativeUncertainties",true);
  if(useExpNotn) table->setTagBool("format.useExponentialNotation",true);

  DEBUGclass("creating preamble and comments");

  TString comment = "created on ";
  comment.Append(TQUtils::getTimeStamp());
  comment.Append(" from TQSampleFolder '");
  comment.Append(fReader->getSampleFolder()->getName());
  comment.Append("' with TQLibrary ");
  comment.Append(TQLibrary::getQLibrary()->getVersion());
  comment.Append(" compiled with GCC ");
  comment.Append(TQLibrary::getQLibrary()->getGCCVersion());
  comment.Append(" against ROOT ");
  comment.Append(TQLibrary::getQLibrary()->getROOTVersion());
  table->setTagString("comment",comment);

  TString preamble;
  if(tags.getTagString("style.preamble",preamble)) table->setTagString("preamble.latex",preamble);

  if(useCutline) table->expand(2*nCuts+1,nProcesses+1);
  else table->expand(nProcesses+1,2*nCuts+1);

  TString titlecell;
  if(tags.getTagString("style.title",titlecell)) table->setEntry(0,0,titlecell,TQStringUtils::findFormat(titlecell));
  if(tags.getTagString("style.title.latex",titlecell)) table->setProperty(0,0,"content.latex",titlecell);
  if(tags.getTagString("style.title.html",titlecell)) table->setProperty(0,0,"content.html",titlecell);

  TQTaggableIterator pitr(fProcesses);
  while(pitr.hasNext()){
    // get the name of the process
    TQNamedTaggable* process = pitr.readNext();
    if(!process) continue;
    TString processName = tags.replaceInText(process->getTagStringDefault(".path",process->GetName()));

    DEBUGclass("looping over process '%s' with path '%s'",process->GetName(),processName.Data());

    if(processName.Length() < 1) continue;
    if (processName.Contains("|")){
      if(useCutline) table->setVline(col+1,TQStringUtils::countText(processName,"|"));
      else table->setHline(row+1,TQStringUtils::countText(processName,"|"));
      continue;
    }
    // get the title of the process
    TString processTitle;
    TList* l = fReader->getListOfSampleFolders(processName);
    if(l){
      TQFolder* f = fReader->getSampleFolder()->findCommonBaseFolder(l);
      if(f){
        processTitle = f->getTagStringDefault("style.default.title","");
        bool showRaw = process->getTagBoolDefault(".showRaw",f->getTagBoolDefault("style.default.showRaw",process->getTagBoolDefault(".isData",this->getTagBoolDefault("style.default.showRaw",false))));
        if(!process->hasTagBool(".showRaw")) process->setTagBool(".showRaw",showRaw);
      }
      delete l;
    }
    if(processTitle.IsNull()){
      processTitle = process->GetTitle();
    }
    if(processTitle.IsNull()){
      processTitle = process->GetName();
    }
    process->getTagString(".title",processTitle);
    processTitle = tags.replaceInText(processTitle);
    // set name and title
    if(useCutline){
      col++;
      table->setEntry(0,col,processTitle,TQStringUtils::findFormat(processTitle));
      table->setProperty(0,col,"tooltip",processName);
    } else {
      row++;
      table->setEntry(row,0,processTitle,TQStringUtils::findFormat(processTitle));
      table->setProperty(row,0,"tooltip",processName);
    }
  }
  TQTaggableIterator citr(fCuts);
  while(citr.hasNext()){
    /* get the name and description of the cut */
    TQNamedTaggable* cut = citr.readNext();
    if(!cut) continue;
    TString cutName = tags.replaceInText(cut->getTagStringDefault(".name",cut->GetName()));
    if(!tags.hasTag(".previousCut")){
      tags.setTagString(".previousCut",cutName);
    }
    DEBUGclass("looping over cut '%s'",cutName.Data());
    int sfPolicy = cut->getTagIntegerDefault(".sfPolicy",1);
    if(hideAllSf) sfPolicy = -1;
    if(cutName.Length() < 1){
      WARNclass("skipping empty cut!");
      continue;
    }

    if (cutName.Contains("|")){
      if(useCutline) table->setHline(row+1,TQStringUtils::countText(cutName,"|"));
      else table->setVline(col+1,TQStringUtils::countText(cutName,"|"));
      tags.removeTag(".previousCut");
      continue;
    }

    if (cutName == "!" && useCutline){
      TString cutTitle = tags.replaceInText(cut->getTagStringDefault(".title","Section"));
      table->setEntry (row,0,cutTitle);
      table->setProperty(row,0,"multicol",-1);
      row++;
      continue;
    }

    if(useCutline){
      col = 0;
      row++;
    } else {
      row = 0;
      col++;
    }

    TString defaultTitle;
    int valrow = useCutline ? (row + !sfAfter) : 0;
    int valcol = useCutline ? 0 : (col + !sfAfter);
    int sfrow = useCutline ? (row + sfAfter) : 0;
    int sfcol = useCutline ? 0 : (col + sfAfter);
    bool cutHasSF = false;

    pitr.reset();
    while(pitr.hasNext()){
      /* get the name and description of the process */
      TQNamedTaggable* process = pitr.readNext();

      if(!process) continue;
      TString processName = tags.replaceInText(process->getTagStringDefault(".path",process->GetName()));
      TString processTitle = tags.replaceInText(process->getTagStringDefault(".title",process->GetTitle()));
      bool special = process->hasTagString(".special");
      if (processName.Length() < 1) continue;
      if (processName.Contains("|")) continue;

      // Hide data from the table unless specified in the configuration
      // that this cut can be shown for data.
      if (process->getTagBoolDefault(".isData", false)) {
        if (std::find(showDataAtCuts.begin(), showDataAtCuts.end(), cutName) == showDataAtCuts.end()) {
          continue; 
        } 
      }

      if(useCutline){
        col++;
        valcol++;
        sfcol++;
      } else {
        row++;
        valrow++;
        sfrow++;
      }

      double value, error;
      double statErr, expSysErr, theoSysErr;
      double sfValue,sfError;
      int raw;
      TString info;
      TString sfInfo;
      bool sfApplied, sfEqual;
      bool showNumbers = false;
      bool splitUncertainties = tags.getTagBoolDefault("splitUncertainties", false);
      TList* sfList = new TList();
      if (splitUncertainties) {
        showNumbers = this->getValues(tags,cut,process,value,statErr,expSysErr,theoSysErr,true,raw,info,defaultTitle, sfList);
      } else {
        showNumbers = this->getValues(tags,cut,process,value,error,raw,info,defaultTitle, sfList);
      }
      bool sfset = special ? false : this->getScaleFactors(tags,cut,sfList,sfValue,sfError,sfApplied,sfEqual,sfInfo);
      delete sfList;
      if (!showNumbers) { continue; }
      bool sfUnity = TMath::AreEqualRel(sfValue,1., 10E-5);
      bool sfZero = TMath::AreEqualRel(sfValue,0., 10E-5);
      bool sfErrorZero = TMath::AreEqualRel(sfError,0., 10E-5);
      bool showSF = false;
      if(sfPolicy > 0){
        if(forceAllSf || (sfPolicy == 2)) showSF = true;
        else if((sfset && sfApplied)
                && (sfPolicy == 1 || showAllSf)
                && !sfUnity && !sfZero) showSF = true;
        else if((sfset && sfApplied)
                && (sfPolicy == 3 || showAllSf)
                && !sfErrorZero) showSF = true;
      }
      DEBUGclass("@%s:%s: showSF=%d with NF=%.3f +/- %.3f (unity=%d,equal=%d,applied=%d,policy=%d)",cutName.Data(),processName.Data(),showSF,sfValue,sfError,sfUnity,sfEqual,sfApplied,sfPolicy);

      //@tag: [.showRaw] If this process tag is set to true, raw numbers are shown instead of weighted ones. Default: false.
      //the following documentation might seem a bit odd, but due to the structure of this code, simply setting showRaw=true won't do anything: We set the tag explicitly on each process earlier on taking a defualt value from style.default.showRaw
      //@tag: [style.default.showRaw] If this tag is set to true, raw numbers are shown everywhere instead of weighted ones. Default: false.
      if(process->getTagBoolDefault(".showRaw",tags.getTagBoolDefault("showRaw",false))){
        table->setEntryValue(valrow,valcol,raw);
        DEBUGclass("@%s:%s: %d (raw)",cutName.Data(),processName.Data(),raw);
      } else if(process->getTagBoolDefault(".showErrors",showErrors) && TQUtils::isNum(error) && error>0){
        if (splitUncertainties) {
          double sysErr = sqrt(pow(expSysErr, 2) + pow(theoSysErr, 2));
          table->setEntryValueAndSplitUncertainties(valrow,valcol,value,statErr,sysErr);
        } else {
          DEBUGclass("@%s:%s: %g +/- %g (error)",cutName.Data(),processName.Data(),value,error);
          table->setEntryValueAndUncertainty(valrow,valcol,value,error);
        }
      } else {
        DEBUGclass("@%s:%s: %g (noError)",cutName.Data(),processName.Data(),value,error);
        table->setEntryValue(valrow,valcol,value);
      }
      int nDigits;
      if(process->getTagInteger("precision",nDigits)){
        table->setProperty(valrow,valcol,"format.nSignificantDigits",nDigits);
      }
      if(!info.IsNull()){
        table->setProperty(valrow,valcol,"tooltip",info);
      }

      if(showSF){
        cutHasSF = true;
        if(sfEqual){
          table->setProperty (sfrow,sfcol,"prefixText.latex",nfPrefixText);
          table->setProperty (sfrow,sfcol,"prefixText.html", nfPrefixText);
          table->setProperty (sfrow,sfcol,"prefixText.plain",nfPrefixText);
          if(sfError != 0){
            table->setProperty (sfrow,sfcol,"format.splitUncertainties",false);
            table->setEntryValueAndUncertainty (sfrow,sfcol,sfValue,sfError);
          } else if(sfValue){
            table->setEntryValue (sfrow,sfcol,sfValue);
          }
        } else {
          table->setEntry (sfrow,sfcol,"NFs Applied");
        }
        table->setProperty(sfrow,sfcol,"textcolor","blue");
        if(!sfInfo.IsNull()){
          table->setProperty(sfrow,sfcol,"tooltip",sfInfo);
        } else if(!sfApplied && sfUnity){
          table->setProperty(sfrow,sfcol,"tooltip","no explicit NF set");
        } else if(sfZero){
          table->setProperty(sfrow,sfcol,"tooltip","NF explicity set to zero");
        } else {
          table->setProperty(sfrow,sfcol,"tooltip","undefined");
        }
      }
    }

    int labelRow = (useCutline ? valrow : 0);
    int labelCol = (useCutline ? 0 : valcol);
    TString cutTitle;
    if(cut->getTagString(".title",cutTitle) || cut->getTagString("title",cutTitle)){
      table->setEntry (labelRow,labelCol,tags.replaceInText(cutTitle));
    } else if(!defaultTitle.IsNull()){
      table->setEntry (labelRow,labelCol,defaultTitle);
    } else {
      table->setEntry (labelRow,labelCol,cutName, "plain");
    }
    table->setProperty(labelRow,labelCol,"tooltip",cutName);
    if(cutHasSF){
      int sfLabelRow = (useCutline ? sfrow : 0);
      int sfLabelCol = (useCutline ? 0 : sfcol);
      table->setEntry (sfLabelRow,sfLabelCol,"Scale factors");
      table->setProperty(sfLabelRow,sfLabelCol,"tooltip",TString::Format("Scale factors for %s",cutName.Data()));

      table->setProperty(sfLabelRow,sfLabelCol,"textcolor","blue");
    }

    if(useCutline){
      row+= 1;
    } else {
      col+= 1;
    }
    tags.setTagString(".previousCut",cutName);
  }
  table->shrink();
  return table;
}

//______________________________________________________________________________________________

TQCutflowPrinter::~TQCutflowPrinter() {
  // Destructor of TQCutflowPrinter class:
}

//______________________________________________________________________________________________

bool TQCutflowPrinter::readProcessesFromFile(TString fileName,TString channel){
  // read processes from a config file (deprecated, please use importProcessesFromFile)
  std::vector<TString>* lines = TQStringUtils::readFileLines(TQStringUtils::trim(fileName));
  if(!lines){
    ERRORclass( "unable to open file '%s'",fileName.Data());
    return false;
  }
  // parse the config file for processes and labels
  for(size_t i=0; i<lines->size(); i++){
    TString process("");
    TString label("");
    TQStringUtils::readUpTo(lines->at(i),process,";");
    TQStringUtils::removeLeading(lines->at(i),"; \t");
    TQStringUtils::readUpTo(lines->at(i),label,";");
    TQStringUtils::removeLeading(lines->at(i),"; \t");
    this->addCutflowProcess(TQStringUtils::trim(process).ReplaceAll("%ch%",channel),label);
  }
  return true;
}

//______________________________________________________________________________________________

bool TQCutflowPrinter::readCutsFromFile(TString fileName, bool addscline){
  // read cuts from a config file (deprecated, please use importCutsFromFile)
  std::vector<TString>* lines = TQStringUtils::readFileLines(TQStringUtils::trim(fileName));
  if(!lines){
    ERRORclass( "unable to open file '%s'",fileName.Data());
    return false;
  }
  for(size_t i=0; i<lines->size(); i++){
    TString cut("");
    TString label("");
    TQStringUtils::readUpTo(lines->at(i),cut,";");
    TQStringUtils::removeLeading(lines->at(i),"; \t");
    TQStringUtils::readUpTo(lines->at(i),label,";");
    TQStringUtils::removeLeading(lines->at(i),"; \t");
    int sfPolicy = 1;
    TString str = TQStringUtils::trim(lines->at(i));
    if(str.Length() > 0)
      sfPolicy = atoi(str.Data());
    if(addscline)
      sfPolicy = 2;
    this->addCutflowCut(cut, label, sfPolicy);
  }
  return true;
}

//______________________________________________________________________________________________

void TQCutflowPrinter::dumpProcesses(std::ostream& out){
  // dump processes to a config file (deprecated, please use exportProcessesToFile)
  for (int iProcess = 0; iProcess < fProcesses->GetEntries(); iProcess++) {
    out << dynamic_cast<TNamed*>(fProcesses->At(iProcess))->GetName() << ";\t";
    TString title = dynamic_cast<TNamed*>(fProcesses->At(iProcess))->GetTitle();
    if(title.Length() > 0)
      out << title << ";";
    out << std::endl;
  }
}

//______________________________________________________________________________________________

void TQCutflowPrinter::dumpCuts(std::ostream& out){
  // dump cuts to a config file (deprecated, please use exportCutsToFile)
  TQIterator itr(fCuts);
  while(itr.hasNext()){
    TQNamedTaggable* cut = dynamic_cast<TQNamedTaggable*>(itr.readNext());
    TString cutName = cut->getTagStringDefault(".name","");
    TString cutTitle = cut->getTagStringDefault(".title","");
    int sfPolicy = cut->getTagIntegerDefault(".sfPolicy",1);
    out << TQStringUtils::fixedWidth(cutName,30);
    if(cutTitle.Length() > 0){
      out << TQStringUtils::fixedWidth(cutTitle,70) << " ; ";
      out << sfPolicy << std::endl;
    }
    out << std::endl;
  }
}
 TQCutflowPrinter.cxx:1
 TQCutflowPrinter.cxx:2
 TQCutflowPrinter.cxx:3
 TQCutflowPrinter.cxx:4
 TQCutflowPrinter.cxx:5
 TQCutflowPrinter.cxx:6
 TQCutflowPrinter.cxx:7
 TQCutflowPrinter.cxx:8
 TQCutflowPrinter.cxx:9
 TQCutflowPrinter.cxx:10
 TQCutflowPrinter.cxx:11
 TQCutflowPrinter.cxx:12
 TQCutflowPrinter.cxx:13
 TQCutflowPrinter.cxx:14
 TQCutflowPrinter.cxx:15
 TQCutflowPrinter.cxx:16
 TQCutflowPrinter.cxx:17
 TQCutflowPrinter.cxx:18
 TQCutflowPrinter.cxx:19
 TQCutflowPrinter.cxx:20
 TQCutflowPrinter.cxx:21
 TQCutflowPrinter.cxx:22
 TQCutflowPrinter.cxx:23
 TQCutflowPrinter.cxx:24
 TQCutflowPrinter.cxx:25
 TQCutflowPrinter.cxx:26
 TQCutflowPrinter.cxx:27
 TQCutflowPrinter.cxx:28
 TQCutflowPrinter.cxx:29
 TQCutflowPrinter.cxx:30
 TQCutflowPrinter.cxx:31
 TQCutflowPrinter.cxx:32
 TQCutflowPrinter.cxx:33
 TQCutflowPrinter.cxx:34
 TQCutflowPrinter.cxx:35
 TQCutflowPrinter.cxx:36
 TQCutflowPrinter.cxx:37
 TQCutflowPrinter.cxx:38
 TQCutflowPrinter.cxx:39
 TQCutflowPrinter.cxx:40
 TQCutflowPrinter.cxx:41
 TQCutflowPrinter.cxx:42
 TQCutflowPrinter.cxx:43
 TQCutflowPrinter.cxx:44
 TQCutflowPrinter.cxx:45
 TQCutflowPrinter.cxx:46
 TQCutflowPrinter.cxx:47
 TQCutflowPrinter.cxx:48
 TQCutflowPrinter.cxx:49
 TQCutflowPrinter.cxx:50
 TQCutflowPrinter.cxx:51
 TQCutflowPrinter.cxx:52
 TQCutflowPrinter.cxx:53
 TQCutflowPrinter.cxx:54
 TQCutflowPrinter.cxx:55
 TQCutflowPrinter.cxx:56
 TQCutflowPrinter.cxx:57
 TQCutflowPrinter.cxx:58
 TQCutflowPrinter.cxx:59
 TQCutflowPrinter.cxx:60
 TQCutflowPrinter.cxx:61
 TQCutflowPrinter.cxx:62
 TQCutflowPrinter.cxx:63
 TQCutflowPrinter.cxx:64
 TQCutflowPrinter.cxx:65
 TQCutflowPrinter.cxx:66
 TQCutflowPrinter.cxx:67
 TQCutflowPrinter.cxx:68
 TQCutflowPrinter.cxx:69
 TQCutflowPrinter.cxx:70
 TQCutflowPrinter.cxx:71
 TQCutflowPrinter.cxx:72
 TQCutflowPrinter.cxx:73
 TQCutflowPrinter.cxx:74
 TQCutflowPrinter.cxx:75
 TQCutflowPrinter.cxx:76
 TQCutflowPrinter.cxx:77
 TQCutflowPrinter.cxx:78
 TQCutflowPrinter.cxx:79
 TQCutflowPrinter.cxx:80
 TQCutflowPrinter.cxx:81
 TQCutflowPrinter.cxx:82
 TQCutflowPrinter.cxx:83
 TQCutflowPrinter.cxx:84
 TQCutflowPrinter.cxx:85
 TQCutflowPrinter.cxx:86
 TQCutflowPrinter.cxx:87
 TQCutflowPrinter.cxx:88
 TQCutflowPrinter.cxx:89
 TQCutflowPrinter.cxx:90
 TQCutflowPrinter.cxx:91
 TQCutflowPrinter.cxx:92
 TQCutflowPrinter.cxx:93
 TQCutflowPrinter.cxx:94
 TQCutflowPrinter.cxx:95
 TQCutflowPrinter.cxx:96
 TQCutflowPrinter.cxx:97
 TQCutflowPrinter.cxx:98
 TQCutflowPrinter.cxx:99
 TQCutflowPrinter.cxx:100
 TQCutflowPrinter.cxx:101
 TQCutflowPrinter.cxx:102
 TQCutflowPrinter.cxx:103
 TQCutflowPrinter.cxx:104
 TQCutflowPrinter.cxx:105
 TQCutflowPrinter.cxx:106
 TQCutflowPrinter.cxx:107
 TQCutflowPrinter.cxx:108
 TQCutflowPrinter.cxx:109
 TQCutflowPrinter.cxx:110
 TQCutflowPrinter.cxx:111
 TQCutflowPrinter.cxx:112
 TQCutflowPrinter.cxx:113
 TQCutflowPrinter.cxx:114
 TQCutflowPrinter.cxx:115
 TQCutflowPrinter.cxx:116
 TQCutflowPrinter.cxx:117
 TQCutflowPrinter.cxx:118
 TQCutflowPrinter.cxx:119
 TQCutflowPrinter.cxx:120
 TQCutflowPrinter.cxx:121
 TQCutflowPrinter.cxx:122
 TQCutflowPrinter.cxx:123
 TQCutflowPrinter.cxx:124
 TQCutflowPrinter.cxx:125
 TQCutflowPrinter.cxx:126
 TQCutflowPrinter.cxx:127
 TQCutflowPrinter.cxx:128
 TQCutflowPrinter.cxx:129
 TQCutflowPrinter.cxx:130
 TQCutflowPrinter.cxx:131
 TQCutflowPrinter.cxx:132
 TQCutflowPrinter.cxx:133
 TQCutflowPrinter.cxx:134
 TQCutflowPrinter.cxx:135
 TQCutflowPrinter.cxx:136
 TQCutflowPrinter.cxx:137
 TQCutflowPrinter.cxx:138
 TQCutflowPrinter.cxx:139
 TQCutflowPrinter.cxx:140
 TQCutflowPrinter.cxx:141
 TQCutflowPrinter.cxx:142
 TQCutflowPrinter.cxx:143
 TQCutflowPrinter.cxx:144
 TQCutflowPrinter.cxx:145
 TQCutflowPrinter.cxx:146
 TQCutflowPrinter.cxx:147
 TQCutflowPrinter.cxx:148
 TQCutflowPrinter.cxx:149
 TQCutflowPrinter.cxx:150
 TQCutflowPrinter.cxx:151
 TQCutflowPrinter.cxx:152
 TQCutflowPrinter.cxx:153
 TQCutflowPrinter.cxx:154
 TQCutflowPrinter.cxx:155
 TQCutflowPrinter.cxx:156
 TQCutflowPrinter.cxx:157
 TQCutflowPrinter.cxx:158
 TQCutflowPrinter.cxx:159
 TQCutflowPrinter.cxx:160
 TQCutflowPrinter.cxx:161
 TQCutflowPrinter.cxx:162
 TQCutflowPrinter.cxx:163
 TQCutflowPrinter.cxx:164
 TQCutflowPrinter.cxx:165
 TQCutflowPrinter.cxx:166
 TQCutflowPrinter.cxx:167
 TQCutflowPrinter.cxx:168
 TQCutflowPrinter.cxx:169
 TQCutflowPrinter.cxx:170
 TQCutflowPrinter.cxx:171
 TQCutflowPrinter.cxx:172
 TQCutflowPrinter.cxx:173
 TQCutflowPrinter.cxx:174
 TQCutflowPrinter.cxx:175
 TQCutflowPrinter.cxx:176
 TQCutflowPrinter.cxx:177
 TQCutflowPrinter.cxx:178
 TQCutflowPrinter.cxx:179
 TQCutflowPrinter.cxx:180
 TQCutflowPrinter.cxx:181
 TQCutflowPrinter.cxx:182
 TQCutflowPrinter.cxx:183
 TQCutflowPrinter.cxx:184
 TQCutflowPrinter.cxx:185
 TQCutflowPrinter.cxx:186
 TQCutflowPrinter.cxx:187
 TQCutflowPrinter.cxx:188
 TQCutflowPrinter.cxx:189
 TQCutflowPrinter.cxx:190
 TQCutflowPrinter.cxx:191
 TQCutflowPrinter.cxx:192
 TQCutflowPrinter.cxx:193
 TQCutflowPrinter.cxx:194
 TQCutflowPrinter.cxx:195
 TQCutflowPrinter.cxx:196
 TQCutflowPrinter.cxx:197
 TQCutflowPrinter.cxx:198
 TQCutflowPrinter.cxx:199
 TQCutflowPrinter.cxx:200
 TQCutflowPrinter.cxx:201
 TQCutflowPrinter.cxx:202
 TQCutflowPrinter.cxx:203
 TQCutflowPrinter.cxx:204
 TQCutflowPrinter.cxx:205
 TQCutflowPrinter.cxx:206
 TQCutflowPrinter.cxx:207
 TQCutflowPrinter.cxx:208
 TQCutflowPrinter.cxx:209
 TQCutflowPrinter.cxx:210
 TQCutflowPrinter.cxx:211
 TQCutflowPrinter.cxx:212
 TQCutflowPrinter.cxx:213
 TQCutflowPrinter.cxx:214
 TQCutflowPrinter.cxx:215
 TQCutflowPrinter.cxx:216
 TQCutflowPrinter.cxx:217
 TQCutflowPrinter.cxx:218
 TQCutflowPrinter.cxx:219
 TQCutflowPrinter.cxx:220
 TQCutflowPrinter.cxx:221
 TQCutflowPrinter.cxx:222
 TQCutflowPrinter.cxx:223
 TQCutflowPrinter.cxx:224
 TQCutflowPrinter.cxx:225
 TQCutflowPrinter.cxx:226
 TQCutflowPrinter.cxx:227
 TQCutflowPrinter.cxx:228
 TQCutflowPrinter.cxx:229
 TQCutflowPrinter.cxx:230
 TQCutflowPrinter.cxx:231
 TQCutflowPrinter.cxx:232
 TQCutflowPrinter.cxx:233
 TQCutflowPrinter.cxx:234
 TQCutflowPrinter.cxx:235
 TQCutflowPrinter.cxx:236
 TQCutflowPrinter.cxx:237
 TQCutflowPrinter.cxx:238
 TQCutflowPrinter.cxx:239
 TQCutflowPrinter.cxx:240
 TQCutflowPrinter.cxx:241
 TQCutflowPrinter.cxx:242
 TQCutflowPrinter.cxx:243
 TQCutflowPrinter.cxx:244
 TQCutflowPrinter.cxx:245
 TQCutflowPrinter.cxx:246
 TQCutflowPrinter.cxx:247
 TQCutflowPrinter.cxx:248
 TQCutflowPrinter.cxx:249
 TQCutflowPrinter.cxx:250
 TQCutflowPrinter.cxx:251
 TQCutflowPrinter.cxx:252
 TQCutflowPrinter.cxx:253
 TQCutflowPrinter.cxx:254
 TQCutflowPrinter.cxx:255
 TQCutflowPrinter.cxx:256
 TQCutflowPrinter.cxx:257
 TQCutflowPrinter.cxx:258
 TQCutflowPrinter.cxx:259
 TQCutflowPrinter.cxx:260
 TQCutflowPrinter.cxx:261
 TQCutflowPrinter.cxx:262
 TQCutflowPrinter.cxx:263
 TQCutflowPrinter.cxx:264
 TQCutflowPrinter.cxx:265
 TQCutflowPrinter.cxx:266
 TQCutflowPrinter.cxx:267
 TQCutflowPrinter.cxx:268
 TQCutflowPrinter.cxx:269
 TQCutflowPrinter.cxx:270
 TQCutflowPrinter.cxx:271
 TQCutflowPrinter.cxx:272
 TQCutflowPrinter.cxx:273
 TQCutflowPrinter.cxx:274
 TQCutflowPrinter.cxx:275
 TQCutflowPrinter.cxx:276
 TQCutflowPrinter.cxx:277
 TQCutflowPrinter.cxx:278
 TQCutflowPrinter.cxx:279
 TQCutflowPrinter.cxx:280
 TQCutflowPrinter.cxx:281
 TQCutflowPrinter.cxx:282
 TQCutflowPrinter.cxx:283
 TQCutflowPrinter.cxx:284
 TQCutflowPrinter.cxx:285
 TQCutflowPrinter.cxx:286
 TQCutflowPrinter.cxx:287
 TQCutflowPrinter.cxx:288
 TQCutflowPrinter.cxx:289
 TQCutflowPrinter.cxx:290
 TQCutflowPrinter.cxx:291
 TQCutflowPrinter.cxx:292
 TQCutflowPrinter.cxx:293
 TQCutflowPrinter.cxx:294
 TQCutflowPrinter.cxx:295
 TQCutflowPrinter.cxx:296
 TQCutflowPrinter.cxx:297
 TQCutflowPrinter.cxx:298
 TQCutflowPrinter.cxx:299
 TQCutflowPrinter.cxx:300
 TQCutflowPrinter.cxx:301
 TQCutflowPrinter.cxx:302
 TQCutflowPrinter.cxx:303
 TQCutflowPrinter.cxx:304
 TQCutflowPrinter.cxx:305
 TQCutflowPrinter.cxx:306
 TQCutflowPrinter.cxx:307
 TQCutflowPrinter.cxx:308
 TQCutflowPrinter.cxx:309
 TQCutflowPrinter.cxx:310
 TQCutflowPrinter.cxx:311
 TQCutflowPrinter.cxx:312
 TQCutflowPrinter.cxx:313
 TQCutflowPrinter.cxx:314
 TQCutflowPrinter.cxx:315
 TQCutflowPrinter.cxx:316
 TQCutflowPrinter.cxx:317
 TQCutflowPrinter.cxx:318
 TQCutflowPrinter.cxx:319
 TQCutflowPrinter.cxx:320
 TQCutflowPrinter.cxx:321
 TQCutflowPrinter.cxx:322
 TQCutflowPrinter.cxx:323
 TQCutflowPrinter.cxx:324
 TQCutflowPrinter.cxx:325
 TQCutflowPrinter.cxx:326
 TQCutflowPrinter.cxx:327
 TQCutflowPrinter.cxx:328
 TQCutflowPrinter.cxx:329
 TQCutflowPrinter.cxx:330
 TQCutflowPrinter.cxx:331
 TQCutflowPrinter.cxx:332
 TQCutflowPrinter.cxx:333
 TQCutflowPrinter.cxx:334
 TQCutflowPrinter.cxx:335
 TQCutflowPrinter.cxx:336
 TQCutflowPrinter.cxx:337
 TQCutflowPrinter.cxx:338
 TQCutflowPrinter.cxx:339
 TQCutflowPrinter.cxx:340
 TQCutflowPrinter.cxx:341
 TQCutflowPrinter.cxx:342
 TQCutflowPrinter.cxx:343
 TQCutflowPrinter.cxx:344
 TQCutflowPrinter.cxx:345
 TQCutflowPrinter.cxx:346
 TQCutflowPrinter.cxx:347
 TQCutflowPrinter.cxx:348
 TQCutflowPrinter.cxx:349
 TQCutflowPrinter.cxx:350
 TQCutflowPrinter.cxx:351
 TQCutflowPrinter.cxx:352
 TQCutflowPrinter.cxx:353
 TQCutflowPrinter.cxx:354
 TQCutflowPrinter.cxx:355
 TQCutflowPrinter.cxx:356
 TQCutflowPrinter.cxx:357
 TQCutflowPrinter.cxx:358
 TQCutflowPrinter.cxx:359
 TQCutflowPrinter.cxx:360
 TQCutflowPrinter.cxx:361
 TQCutflowPrinter.cxx:362
 TQCutflowPrinter.cxx:363
 TQCutflowPrinter.cxx:364
 TQCutflowPrinter.cxx:365
 TQCutflowPrinter.cxx:366
 TQCutflowPrinter.cxx:367
 TQCutflowPrinter.cxx:368
 TQCutflowPrinter.cxx:369
 TQCutflowPrinter.cxx:370
 TQCutflowPrinter.cxx:371
 TQCutflowPrinter.cxx:372
 TQCutflowPrinter.cxx:373
 TQCutflowPrinter.cxx:374
 TQCutflowPrinter.cxx:375
 TQCutflowPrinter.cxx:376
 TQCutflowPrinter.cxx:377
 TQCutflowPrinter.cxx:378
 TQCutflowPrinter.cxx:379
 TQCutflowPrinter.cxx:380
 TQCutflowPrinter.cxx:381
 TQCutflowPrinter.cxx:382
 TQCutflowPrinter.cxx:383
 TQCutflowPrinter.cxx:384
 TQCutflowPrinter.cxx:385
 TQCutflowPrinter.cxx:386
 TQCutflowPrinter.cxx:387
 TQCutflowPrinter.cxx:388
 TQCutflowPrinter.cxx:389
 TQCutflowPrinter.cxx:390
 TQCutflowPrinter.cxx:391
 TQCutflowPrinter.cxx:392
 TQCutflowPrinter.cxx:393
 TQCutflowPrinter.cxx:394
 TQCutflowPrinter.cxx:395
 TQCutflowPrinter.cxx:396
 TQCutflowPrinter.cxx:397
 TQCutflowPrinter.cxx:398
 TQCutflowPrinter.cxx:399
 TQCutflowPrinter.cxx:400
 TQCutflowPrinter.cxx:401
 TQCutflowPrinter.cxx:402
 TQCutflowPrinter.cxx:403
 TQCutflowPrinter.cxx:404
 TQCutflowPrinter.cxx:405
 TQCutflowPrinter.cxx:406
 TQCutflowPrinter.cxx:407
 TQCutflowPrinter.cxx:408
 TQCutflowPrinter.cxx:409
 TQCutflowPrinter.cxx:410
 TQCutflowPrinter.cxx:411
 TQCutflowPrinter.cxx:412
 TQCutflowPrinter.cxx:413
 TQCutflowPrinter.cxx:414
 TQCutflowPrinter.cxx:415
 TQCutflowPrinter.cxx:416
 TQCutflowPrinter.cxx:417
 TQCutflowPrinter.cxx:418
 TQCutflowPrinter.cxx:419
 TQCutflowPrinter.cxx:420
 TQCutflowPrinter.cxx:421
 TQCutflowPrinter.cxx:422
 TQCutflowPrinter.cxx:423
 TQCutflowPrinter.cxx:424
 TQCutflowPrinter.cxx:425
 TQCutflowPrinter.cxx:426
 TQCutflowPrinter.cxx:427
 TQCutflowPrinter.cxx:428
 TQCutflowPrinter.cxx:429
 TQCutflowPrinter.cxx:430
 TQCutflowPrinter.cxx:431
 TQCutflowPrinter.cxx:432
 TQCutflowPrinter.cxx:433
 TQCutflowPrinter.cxx:434
 TQCutflowPrinter.cxx:435
 TQCutflowPrinter.cxx:436
 TQCutflowPrinter.cxx:437
 TQCutflowPrinter.cxx:438
 TQCutflowPrinter.cxx:439
 TQCutflowPrinter.cxx:440
 TQCutflowPrinter.cxx:441
 TQCutflowPrinter.cxx:442
 TQCutflowPrinter.cxx:443
 TQCutflowPrinter.cxx:444
 TQCutflowPrinter.cxx:445
 TQCutflowPrinter.cxx:446
 TQCutflowPrinter.cxx:447
 TQCutflowPrinter.cxx:448
 TQCutflowPrinter.cxx:449
 TQCutflowPrinter.cxx:450
 TQCutflowPrinter.cxx:451
 TQCutflowPrinter.cxx:452
 TQCutflowPrinter.cxx:453
 TQCutflowPrinter.cxx:454
 TQCutflowPrinter.cxx:455
 TQCutflowPrinter.cxx:456
 TQCutflowPrinter.cxx:457
 TQCutflowPrinter.cxx:458
 TQCutflowPrinter.cxx:459
 TQCutflowPrinter.cxx:460
 TQCutflowPrinter.cxx:461
 TQCutflowPrinter.cxx:462
 TQCutflowPrinter.cxx:463
 TQCutflowPrinter.cxx:464
 TQCutflowPrinter.cxx:465
 TQCutflowPrinter.cxx:466
 TQCutflowPrinter.cxx:467
 TQCutflowPrinter.cxx:468
 TQCutflowPrinter.cxx:469
 TQCutflowPrinter.cxx:470
 TQCutflowPrinter.cxx:471
 TQCutflowPrinter.cxx:472
 TQCutflowPrinter.cxx:473
 TQCutflowPrinter.cxx:474
 TQCutflowPrinter.cxx:475
 TQCutflowPrinter.cxx:476
 TQCutflowPrinter.cxx:477
 TQCutflowPrinter.cxx:478
 TQCutflowPrinter.cxx:479
 TQCutflowPrinter.cxx:480
 TQCutflowPrinter.cxx:481
 TQCutflowPrinter.cxx:482
 TQCutflowPrinter.cxx:483
 TQCutflowPrinter.cxx:484
 TQCutflowPrinter.cxx:485
 TQCutflowPrinter.cxx:486
 TQCutflowPrinter.cxx:487
 TQCutflowPrinter.cxx:488
 TQCutflowPrinter.cxx:489
 TQCutflowPrinter.cxx:490
 TQCutflowPrinter.cxx:491
 TQCutflowPrinter.cxx:492
 TQCutflowPrinter.cxx:493
 TQCutflowPrinter.cxx:494
 TQCutflowPrinter.cxx:495
 TQCutflowPrinter.cxx:496
 TQCutflowPrinter.cxx:497
 TQCutflowPrinter.cxx:498
 TQCutflowPrinter.cxx:499
 TQCutflowPrinter.cxx:500
 TQCutflowPrinter.cxx:501
 TQCutflowPrinter.cxx:502
 TQCutflowPrinter.cxx:503
 TQCutflowPrinter.cxx:504
 TQCutflowPrinter.cxx:505
 TQCutflowPrinter.cxx:506
 TQCutflowPrinter.cxx:507
 TQCutflowPrinter.cxx:508
 TQCutflowPrinter.cxx:509
 TQCutflowPrinter.cxx:510
 TQCutflowPrinter.cxx:511
 TQCutflowPrinter.cxx:512
 TQCutflowPrinter.cxx:513
 TQCutflowPrinter.cxx:514
 TQCutflowPrinter.cxx:515
 TQCutflowPrinter.cxx:516
 TQCutflowPrinter.cxx:517
 TQCutflowPrinter.cxx:518
 TQCutflowPrinter.cxx:519
 TQCutflowPrinter.cxx:520
 TQCutflowPrinter.cxx:521
 TQCutflowPrinter.cxx:522
 TQCutflowPrinter.cxx:523
 TQCutflowPrinter.cxx:524
 TQCutflowPrinter.cxx:525
 TQCutflowPrinter.cxx:526
 TQCutflowPrinter.cxx:527
 TQCutflowPrinter.cxx:528
 TQCutflowPrinter.cxx:529
 TQCutflowPrinter.cxx:530
 TQCutflowPrinter.cxx:531
 TQCutflowPrinter.cxx:532
 TQCutflowPrinter.cxx:533
 TQCutflowPrinter.cxx:534
 TQCutflowPrinter.cxx:535
 TQCutflowPrinter.cxx:536
 TQCutflowPrinter.cxx:537
 TQCutflowPrinter.cxx:538
 TQCutflowPrinter.cxx:539
 TQCutflowPrinter.cxx:540
 TQCutflowPrinter.cxx:541
 TQCutflowPrinter.cxx:542
 TQCutflowPrinter.cxx:543
 TQCutflowPrinter.cxx:544
 TQCutflowPrinter.cxx:545
 TQCutflowPrinter.cxx:546
 TQCutflowPrinter.cxx:547
 TQCutflowPrinter.cxx:548
 TQCutflowPrinter.cxx:549
 TQCutflowPrinter.cxx:550
 TQCutflowPrinter.cxx:551
 TQCutflowPrinter.cxx:552
 TQCutflowPrinter.cxx:553
 TQCutflowPrinter.cxx:554
 TQCutflowPrinter.cxx:555
 TQCutflowPrinter.cxx:556
 TQCutflowPrinter.cxx:557
 TQCutflowPrinter.cxx:558
 TQCutflowPrinter.cxx:559
 TQCutflowPrinter.cxx:560
 TQCutflowPrinter.cxx:561
 TQCutflowPrinter.cxx:562
 TQCutflowPrinter.cxx:563
 TQCutflowPrinter.cxx:564
 TQCutflowPrinter.cxx:565
 TQCutflowPrinter.cxx:566
 TQCutflowPrinter.cxx:567
 TQCutflowPrinter.cxx:568
 TQCutflowPrinter.cxx:569
 TQCutflowPrinter.cxx:570
 TQCutflowPrinter.cxx:571
 TQCutflowPrinter.cxx:572
 TQCutflowPrinter.cxx:573
 TQCutflowPrinter.cxx:574
 TQCutflowPrinter.cxx:575
 TQCutflowPrinter.cxx:576
 TQCutflowPrinter.cxx:577
 TQCutflowPrinter.cxx:578
 TQCutflowPrinter.cxx:579
 TQCutflowPrinter.cxx:580
 TQCutflowPrinter.cxx:581
 TQCutflowPrinter.cxx:582
 TQCutflowPrinter.cxx:583
 TQCutflowPrinter.cxx:584
 TQCutflowPrinter.cxx:585
 TQCutflowPrinter.cxx:586
 TQCutflowPrinter.cxx:587
 TQCutflowPrinter.cxx:588
 TQCutflowPrinter.cxx:589
 TQCutflowPrinter.cxx:590
 TQCutflowPrinter.cxx:591
 TQCutflowPrinter.cxx:592
 TQCutflowPrinter.cxx:593
 TQCutflowPrinter.cxx:594
 TQCutflowPrinter.cxx:595
 TQCutflowPrinter.cxx:596
 TQCutflowPrinter.cxx:597
 TQCutflowPrinter.cxx:598
 TQCutflowPrinter.cxx:599
 TQCutflowPrinter.cxx:600
 TQCutflowPrinter.cxx:601
 TQCutflowPrinter.cxx:602
 TQCutflowPrinter.cxx:603
 TQCutflowPrinter.cxx:604
 TQCutflowPrinter.cxx:605
 TQCutflowPrinter.cxx:606
 TQCutflowPrinter.cxx:607
 TQCutflowPrinter.cxx:608
 TQCutflowPrinter.cxx:609
 TQCutflowPrinter.cxx:610
 TQCutflowPrinter.cxx:611
 TQCutflowPrinter.cxx:612
 TQCutflowPrinter.cxx:613
 TQCutflowPrinter.cxx:614
 TQCutflowPrinter.cxx:615
 TQCutflowPrinter.cxx:616
 TQCutflowPrinter.cxx:617
 TQCutflowPrinter.cxx:618
 TQCutflowPrinter.cxx:619
 TQCutflowPrinter.cxx:620
 TQCutflowPrinter.cxx:621
 TQCutflowPrinter.cxx:622
 TQCutflowPrinter.cxx:623
 TQCutflowPrinter.cxx:624
 TQCutflowPrinter.cxx:625
 TQCutflowPrinter.cxx:626
 TQCutflowPrinter.cxx:627
 TQCutflowPrinter.cxx:628
 TQCutflowPrinter.cxx:629
 TQCutflowPrinter.cxx:630
 TQCutflowPrinter.cxx:631
 TQCutflowPrinter.cxx:632
 TQCutflowPrinter.cxx:633
 TQCutflowPrinter.cxx:634
 TQCutflowPrinter.cxx:635
 TQCutflowPrinter.cxx:636
 TQCutflowPrinter.cxx:637
 TQCutflowPrinter.cxx:638
 TQCutflowPrinter.cxx:639
 TQCutflowPrinter.cxx:640
 TQCutflowPrinter.cxx:641
 TQCutflowPrinter.cxx:642
 TQCutflowPrinter.cxx:643
 TQCutflowPrinter.cxx:644
 TQCutflowPrinter.cxx:645
 TQCutflowPrinter.cxx:646
 TQCutflowPrinter.cxx:647
 TQCutflowPrinter.cxx:648
 TQCutflowPrinter.cxx:649
 TQCutflowPrinter.cxx:650
 TQCutflowPrinter.cxx:651
 TQCutflowPrinter.cxx:652
 TQCutflowPrinter.cxx:653
 TQCutflowPrinter.cxx:654
 TQCutflowPrinter.cxx:655
 TQCutflowPrinter.cxx:656
 TQCutflowPrinter.cxx:657
 TQCutflowPrinter.cxx:658
 TQCutflowPrinter.cxx:659
 TQCutflowPrinter.cxx:660
 TQCutflowPrinter.cxx:661
 TQCutflowPrinter.cxx:662
 TQCutflowPrinter.cxx:663
 TQCutflowPrinter.cxx:664
 TQCutflowPrinter.cxx:665
 TQCutflowPrinter.cxx:666
 TQCutflowPrinter.cxx:667
 TQCutflowPrinter.cxx:668
 TQCutflowPrinter.cxx:669
 TQCutflowPrinter.cxx:670
 TQCutflowPrinter.cxx:671
 TQCutflowPrinter.cxx:672
 TQCutflowPrinter.cxx:673
 TQCutflowPrinter.cxx:674
 TQCutflowPrinter.cxx:675
 TQCutflowPrinter.cxx:676
 TQCutflowPrinter.cxx:677
 TQCutflowPrinter.cxx:678
 TQCutflowPrinter.cxx:679
 TQCutflowPrinter.cxx:680
 TQCutflowPrinter.cxx:681
 TQCutflowPrinter.cxx:682
 TQCutflowPrinter.cxx:683
 TQCutflowPrinter.cxx:684
 TQCutflowPrinter.cxx:685
 TQCutflowPrinter.cxx:686
 TQCutflowPrinter.cxx:687
 TQCutflowPrinter.cxx:688
 TQCutflowPrinter.cxx:689
 TQCutflowPrinter.cxx:690
 TQCutflowPrinter.cxx:691
 TQCutflowPrinter.cxx:692
 TQCutflowPrinter.cxx:693
 TQCutflowPrinter.cxx:694
 TQCutflowPrinter.cxx:695
 TQCutflowPrinter.cxx:696
 TQCutflowPrinter.cxx:697
 TQCutflowPrinter.cxx:698
 TQCutflowPrinter.cxx:699
 TQCutflowPrinter.cxx:700
 TQCutflowPrinter.cxx:701
 TQCutflowPrinter.cxx:702
 TQCutflowPrinter.cxx:703
 TQCutflowPrinter.cxx:704
 TQCutflowPrinter.cxx:705
 TQCutflowPrinter.cxx:706
 TQCutflowPrinter.cxx:707
 TQCutflowPrinter.cxx:708
 TQCutflowPrinter.cxx:709
 TQCutflowPrinter.cxx:710
 TQCutflowPrinter.cxx:711
 TQCutflowPrinter.cxx:712
 TQCutflowPrinter.cxx:713
 TQCutflowPrinter.cxx:714
 TQCutflowPrinter.cxx:715
 TQCutflowPrinter.cxx:716
 TQCutflowPrinter.cxx:717
 TQCutflowPrinter.cxx:718
 TQCutflowPrinter.cxx:719
 TQCutflowPrinter.cxx:720
 TQCutflowPrinter.cxx:721
 TQCutflowPrinter.cxx:722
 TQCutflowPrinter.cxx:723
 TQCutflowPrinter.cxx:724
 TQCutflowPrinter.cxx:725
 TQCutflowPrinter.cxx:726
 TQCutflowPrinter.cxx:727
 TQCutflowPrinter.cxx:728
 TQCutflowPrinter.cxx:729
 TQCutflowPrinter.cxx:730
 TQCutflowPrinter.cxx:731
 TQCutflowPrinter.cxx:732
 TQCutflowPrinter.cxx:733
 TQCutflowPrinter.cxx:734
 TQCutflowPrinter.cxx:735
 TQCutflowPrinter.cxx:736
 TQCutflowPrinter.cxx:737
 TQCutflowPrinter.cxx:738
 TQCutflowPrinter.cxx:739
 TQCutflowPrinter.cxx:740
 TQCutflowPrinter.cxx:741
 TQCutflowPrinter.cxx:742
 TQCutflowPrinter.cxx:743
 TQCutflowPrinter.cxx:744
 TQCutflowPrinter.cxx:745
 TQCutflowPrinter.cxx:746
 TQCutflowPrinter.cxx:747
 TQCutflowPrinter.cxx:748
 TQCutflowPrinter.cxx:749
 TQCutflowPrinter.cxx:750
 TQCutflowPrinter.cxx:751
 TQCutflowPrinter.cxx:752
 TQCutflowPrinter.cxx:753
 TQCutflowPrinter.cxx:754
 TQCutflowPrinter.cxx:755
 TQCutflowPrinter.cxx:756
 TQCutflowPrinter.cxx:757
 TQCutflowPrinter.cxx:758
 TQCutflowPrinter.cxx:759
 TQCutflowPrinter.cxx:760
 TQCutflowPrinter.cxx:761
 TQCutflowPrinter.cxx:762
 TQCutflowPrinter.cxx:763
 TQCutflowPrinter.cxx:764
 TQCutflowPrinter.cxx:765
 TQCutflowPrinter.cxx:766
 TQCutflowPrinter.cxx:767
 TQCutflowPrinter.cxx:768
 TQCutflowPrinter.cxx:769
 TQCutflowPrinter.cxx:770
 TQCutflowPrinter.cxx:771
 TQCutflowPrinter.cxx:772
 TQCutflowPrinter.cxx:773
 TQCutflowPrinter.cxx:774
 TQCutflowPrinter.cxx:775
 TQCutflowPrinter.cxx:776
 TQCutflowPrinter.cxx:777
 TQCutflowPrinter.cxx:778
 TQCutflowPrinter.cxx:779
 TQCutflowPrinter.cxx:780
 TQCutflowPrinter.cxx:781
 TQCutflowPrinter.cxx:782
 TQCutflowPrinter.cxx:783
 TQCutflowPrinter.cxx:784
 TQCutflowPrinter.cxx:785
 TQCutflowPrinter.cxx:786
 TQCutflowPrinter.cxx:787
 TQCutflowPrinter.cxx:788
 TQCutflowPrinter.cxx:789
 TQCutflowPrinter.cxx:790
 TQCutflowPrinter.cxx:791
 TQCutflowPrinter.cxx:792
 TQCutflowPrinter.cxx:793
 TQCutflowPrinter.cxx:794
 TQCutflowPrinter.cxx:795
 TQCutflowPrinter.cxx:796
 TQCutflowPrinter.cxx:797
 TQCutflowPrinter.cxx:798
 TQCutflowPrinter.cxx:799
 TQCutflowPrinter.cxx:800
 TQCutflowPrinter.cxx:801
 TQCutflowPrinter.cxx:802
 TQCutflowPrinter.cxx:803
 TQCutflowPrinter.cxx:804
 TQCutflowPrinter.cxx:805
 TQCutflowPrinter.cxx:806
 TQCutflowPrinter.cxx:807
 TQCutflowPrinter.cxx:808
 TQCutflowPrinter.cxx:809
 TQCutflowPrinter.cxx:810
 TQCutflowPrinter.cxx:811
 TQCutflowPrinter.cxx:812
 TQCutflowPrinter.cxx:813
 TQCutflowPrinter.cxx:814
 TQCutflowPrinter.cxx:815
 TQCutflowPrinter.cxx:816
 TQCutflowPrinter.cxx:817
 TQCutflowPrinter.cxx:818
 TQCutflowPrinter.cxx:819
 TQCutflowPrinter.cxx:820
 TQCutflowPrinter.cxx:821
 TQCutflowPrinter.cxx:822
 TQCutflowPrinter.cxx:823
 TQCutflowPrinter.cxx:824
 TQCutflowPrinter.cxx:825
 TQCutflowPrinter.cxx:826
 TQCutflowPrinter.cxx:827
 TQCutflowPrinter.cxx:828
 TQCutflowPrinter.cxx:829
 TQCutflowPrinter.cxx:830
 TQCutflowPrinter.cxx:831
 TQCutflowPrinter.cxx:832
 TQCutflowPrinter.cxx:833
 TQCutflowPrinter.cxx:834
 TQCutflowPrinter.cxx:835
 TQCutflowPrinter.cxx:836
 TQCutflowPrinter.cxx:837
 TQCutflowPrinter.cxx:838
 TQCutflowPrinter.cxx:839
 TQCutflowPrinter.cxx:840
 TQCutflowPrinter.cxx:841
 TQCutflowPrinter.cxx:842
 TQCutflowPrinter.cxx:843
 TQCutflowPrinter.cxx:844
 TQCutflowPrinter.cxx:845
 TQCutflowPrinter.cxx:846
 TQCutflowPrinter.cxx:847
 TQCutflowPrinter.cxx:848
 TQCutflowPrinter.cxx:849
 TQCutflowPrinter.cxx:850
 TQCutflowPrinter.cxx:851
 TQCutflowPrinter.cxx:852
 TQCutflowPrinter.cxx:853
 TQCutflowPrinter.cxx:854
 TQCutflowPrinter.cxx:855
 TQCutflowPrinter.cxx:856
 TQCutflowPrinter.cxx:857
 TQCutflowPrinter.cxx:858
 TQCutflowPrinter.cxx:859
 TQCutflowPrinter.cxx:860
 TQCutflowPrinter.cxx:861
 TQCutflowPrinter.cxx:862
 TQCutflowPrinter.cxx:863
 TQCutflowPrinter.cxx:864
 TQCutflowPrinter.cxx:865
 TQCutflowPrinter.cxx:866
 TQCutflowPrinter.cxx:867
 TQCutflowPrinter.cxx:868
 TQCutflowPrinter.cxx:869
 TQCutflowPrinter.cxx:870
 TQCutflowPrinter.cxx:871
 TQCutflowPrinter.cxx:872
 TQCutflowPrinter.cxx:873
 TQCutflowPrinter.cxx:874
 TQCutflowPrinter.cxx:875
 TQCutflowPrinter.cxx:876
 TQCutflowPrinter.cxx:877
 TQCutflowPrinter.cxx:878
 TQCutflowPrinter.cxx:879
 TQCutflowPrinter.cxx:880
 TQCutflowPrinter.cxx:881
 TQCutflowPrinter.cxx:882
 TQCutflowPrinter.cxx:883
 TQCutflowPrinter.cxx:884
 TQCutflowPrinter.cxx:885
 TQCutflowPrinter.cxx:886
 TQCutflowPrinter.cxx:887
 TQCutflowPrinter.cxx:888
 TQCutflowPrinter.cxx:889
 TQCutflowPrinter.cxx:890
 TQCutflowPrinter.cxx:891
 TQCutflowPrinter.cxx:892
 TQCutflowPrinter.cxx:893
 TQCutflowPrinter.cxx:894
 TQCutflowPrinter.cxx:895
 TQCutflowPrinter.cxx:896
 TQCutflowPrinter.cxx:897
 TQCutflowPrinter.cxx:898
 TQCutflowPrinter.cxx:899
 TQCutflowPrinter.cxx:900
 TQCutflowPrinter.cxx:901
 TQCutflowPrinter.cxx:902
 TQCutflowPrinter.cxx:903
 TQCutflowPrinter.cxx:904
 TQCutflowPrinter.cxx:905
 TQCutflowPrinter.cxx:906
 TQCutflowPrinter.cxx:907
 TQCutflowPrinter.cxx:908
 TQCutflowPrinter.cxx:909
 TQCutflowPrinter.cxx:910
 TQCutflowPrinter.cxx:911
 TQCutflowPrinter.cxx:912
 TQCutflowPrinter.cxx:913
 TQCutflowPrinter.cxx:914
 TQCutflowPrinter.cxx:915
 TQCutflowPrinter.cxx:916
 TQCutflowPrinter.cxx:917
 TQCutflowPrinter.cxx:918
 TQCutflowPrinter.cxx:919
 TQCutflowPrinter.cxx:920
 TQCutflowPrinter.cxx:921
 TQCutflowPrinter.cxx:922
 TQCutflowPrinter.cxx:923
 TQCutflowPrinter.cxx:924
 TQCutflowPrinter.cxx:925
 TQCutflowPrinter.cxx:926
 TQCutflowPrinter.cxx:927
 TQCutflowPrinter.cxx:928
 TQCutflowPrinter.cxx:929
 TQCutflowPrinter.cxx:930
 TQCutflowPrinter.cxx:931
 TQCutflowPrinter.cxx:932
 TQCutflowPrinter.cxx:933
 TQCutflowPrinter.cxx:934
 TQCutflowPrinter.cxx:935
 TQCutflowPrinter.cxx:936
 TQCutflowPrinter.cxx:937
 TQCutflowPrinter.cxx:938
 TQCutflowPrinter.cxx:939
 TQCutflowPrinter.cxx:940
 TQCutflowPrinter.cxx:941
 TQCutflowPrinter.cxx:942
 TQCutflowPrinter.cxx:943
 TQCutflowPrinter.cxx:944
 TQCutflowPrinter.cxx:945
 TQCutflowPrinter.cxx:946
 TQCutflowPrinter.cxx:947
 TQCutflowPrinter.cxx:948
 TQCutflowPrinter.cxx:949
 TQCutflowPrinter.cxx:950
 TQCutflowPrinter.cxx:951
 TQCutflowPrinter.cxx:952
 TQCutflowPrinter.cxx:953
 TQCutflowPrinter.cxx:954
 TQCutflowPrinter.cxx:955
 TQCutflowPrinter.cxx:956
 TQCutflowPrinter.cxx:957
 TQCutflowPrinter.cxx:958
 TQCutflowPrinter.cxx:959
 TQCutflowPrinter.cxx:960
 TQCutflowPrinter.cxx:961
 TQCutflowPrinter.cxx:962
 TQCutflowPrinter.cxx:963
 TQCutflowPrinter.cxx:964
 TQCutflowPrinter.cxx:965
 TQCutflowPrinter.cxx:966
 TQCutflowPrinter.cxx:967
 TQCutflowPrinter.cxx:968
 TQCutflowPrinter.cxx:969
 TQCutflowPrinter.cxx:970
 TQCutflowPrinter.cxx:971
 TQCutflowPrinter.cxx:972
 TQCutflowPrinter.cxx:973
 TQCutflowPrinter.cxx:974
 TQCutflowPrinter.cxx:975
 TQCutflowPrinter.cxx:976
 TQCutflowPrinter.cxx:977
 TQCutflowPrinter.cxx:978
 TQCutflowPrinter.cxx:979
 TQCutflowPrinter.cxx:980
 TQCutflowPrinter.cxx:981
 TQCutflowPrinter.cxx:982
 TQCutflowPrinter.cxx:983
 TQCutflowPrinter.cxx:984
 TQCutflowPrinter.cxx:985
 TQCutflowPrinter.cxx:986
 TQCutflowPrinter.cxx:987
 TQCutflowPrinter.cxx:988
 TQCutflowPrinter.cxx:989
 TQCutflowPrinter.cxx:990
 TQCutflowPrinter.cxx:991
 TQCutflowPrinter.cxx:992
 TQCutflowPrinter.cxx:993
 TQCutflowPrinter.cxx:994
 TQCutflowPrinter.cxx:995
 TQCutflowPrinter.cxx:996
 TQCutflowPrinter.cxx:997
 TQCutflowPrinter.cxx:998
 TQCutflowPrinter.cxx:999
 TQCutflowPrinter.cxx:1000
 TQCutflowPrinter.cxx:1001
 TQCutflowPrinter.cxx:1002
 TQCutflowPrinter.cxx:1003
 TQCutflowPrinter.cxx:1004
 TQCutflowPrinter.cxx:1005
 TQCutflowPrinter.cxx:1006
 TQCutflowPrinter.cxx:1007
 TQCutflowPrinter.cxx:1008
 TQCutflowPrinter.cxx:1009
 TQCutflowPrinter.cxx:1010
 TQCutflowPrinter.cxx:1011
 TQCutflowPrinter.cxx:1012
 TQCutflowPrinter.cxx:1013
 TQCutflowPrinter.cxx:1014
 TQCutflowPrinter.cxx:1015
 TQCutflowPrinter.cxx:1016
 TQCutflowPrinter.cxx:1017
 TQCutflowPrinter.cxx:1018
 TQCutflowPrinter.cxx:1019
 TQCutflowPrinter.cxx:1020
 TQCutflowPrinter.cxx:1021
 TQCutflowPrinter.cxx:1022
 TQCutflowPrinter.cxx:1023
 TQCutflowPrinter.cxx:1024
 TQCutflowPrinter.cxx:1025
 TQCutflowPrinter.cxx:1026
 TQCutflowPrinter.cxx:1027
 TQCutflowPrinter.cxx:1028
 TQCutflowPrinter.cxx:1029
 TQCutflowPrinter.cxx:1030
 TQCutflowPrinter.cxx:1031
 TQCutflowPrinter.cxx:1032
 TQCutflowPrinter.cxx:1033
 TQCutflowPrinter.cxx:1034
 TQCutflowPrinter.cxx:1035
 TQCutflowPrinter.cxx:1036
 TQCutflowPrinter.cxx:1037
 TQCutflowPrinter.cxx:1038
 TQCutflowPrinter.cxx:1039
 TQCutflowPrinter.cxx:1040
 TQCutflowPrinter.cxx:1041
 TQCutflowPrinter.cxx:1042
 TQCutflowPrinter.cxx:1043
 TQCutflowPrinter.cxx:1044
 TQCutflowPrinter.cxx:1045
 TQCutflowPrinter.cxx:1046
 TQCutflowPrinter.cxx:1047
 TQCutflowPrinter.cxx:1048
 TQCutflowPrinter.cxx:1049
 TQCutflowPrinter.cxx:1050
 TQCutflowPrinter.cxx:1051
 TQCutflowPrinter.cxx:1052
 TQCutflowPrinter.cxx:1053
 TQCutflowPrinter.cxx:1054
 TQCutflowPrinter.cxx:1055
 TQCutflowPrinter.cxx:1056
 TQCutflowPrinter.cxx:1057
 TQCutflowPrinter.cxx:1058
 TQCutflowPrinter.cxx:1059
 TQCutflowPrinter.cxx:1060
 TQCutflowPrinter.cxx:1061
 TQCutflowPrinter.cxx:1062
 TQCutflowPrinter.cxx:1063
 TQCutflowPrinter.cxx:1064
 TQCutflowPrinter.cxx:1065
 TQCutflowPrinter.cxx:1066
 TQCutflowPrinter.cxx:1067
 TQCutflowPrinter.cxx:1068
 TQCutflowPrinter.cxx:1069
 TQCutflowPrinter.cxx:1070
 TQCutflowPrinter.cxx:1071
 TQCutflowPrinter.cxx:1072
 TQCutflowPrinter.cxx:1073
 TQCutflowPrinter.cxx:1074
 TQCutflowPrinter.cxx:1075