ROOT logo
#include "CommonDefs.C"

#define DISPLAY 0

/* SIGNAL SHAPE */
Bool_t GAUSSIAN_SIGNAL = kFALSE;
Bool_t GAUSSIANTAIL_SIGNAL = kFALSE;
Bool_t GAUSSIANTAIL2_SIGNAL = kFALSE;
Bool_t GAUSSIANPLUSGAUSSIANTAIL_SIGNAL = kFALSE;
Bool_t GAUSSIANPLUSEXPONENTIAL_SIGNAL = kFALSE;
Bool_t EXPECTED_SIGNAL_TAIL = kTRUE;
Bool_t EXPECTED_SIGNAL_TEMPLATE = kTRUE;
Bool_t EXPECTED_SIGNAL_FIT = kFALSE;
/* SIGNAL PARAMETERS */
Bool_t FIX_SIGNAL_MEAN = kFALSE;
Bool_t FIX_SIGNAL_SIGMA = kFALSE;
Bool_t FIX_SIGNAL_TAIL = kFALSE;
Float_t SCALE_SIGNAL_SIGMA = 1.;
Float_t SCALE_SIGNAL_TAIL = 1.;
/* OTHER STUFF */
Char_t *SIGNAL_PARAM_FILE = NULL;//"signalParamFile.root";
Float_t DEFAULT_SIGNAL_MEAN = 0.;
Float_t MIN_SIGNAL_MEAN = -0.2;
Float_t MAX_SIGNAL_MEAN = 0.2.;
Float_t DEFAULT_SIGNAL_SIGMA = 1.;
Float_t MIN_SIGNAL_SIGMA = 0.8;
Float_t MAX_SIGNAL_SIGMA = 1.2;
Float_t DEFAULT_SIGNAL_TAIL = 1.;
Float_t MIN_SIGNAL_TAIL = 0.5;
Float_t MAX_SIGNAL_TAIL = 1.5;
/* BACKGROUND */
Bool_t EXPECTED_BACKGROUND_TAIL = kTRUE;
Bool_t EXPECTED_BACKGROUND_TEMPLATE = kTRUE;
Bool_t EXPECTED_BACKGROUND_FIT = kFALSE;
Bool_t GAUSSIAN_BACKGROUND = kFALSE;
Bool_t USE_ELECTRON_BACKGROUND = kTRUE;
/* BACKGROUND PARAMETERS */
Bool_t FIX_BACKGROUND_MEAN = kTRUE;
Bool_t FIX_BACKGROUND_SIGMA = kTRUE;
Bool_t FIX_BACKGROUND_TAIL = kTRUE;
Float_t SCALE_BACKGROUND_SIGMA = 1.;
Float_t SCALE_BACKGROUND_TAIL = 1.;
/* MISMATCH */
Bool_t NO_MISMATCH = kFALSE;
Bool_t EXPECTED_MISMATCH = kTRUE;
Bool_t EXPONENTIAL_MISMATCH = kFALSE;
Bool_t UNIFORM_MISMATCH = kFALSE;
Bool_t DOUBLEEXPONENTIAL_MISMATCH = kFALSE;
Bool_t UNIFORMPLUSEXPONENTIAL_MISMATCH = kFALSE;
/* AUTOMATIC CONSTRAINS */
Float_t FIT_ELECTRONS_PT_MIN = 0.;
Float_t FIT_ELECTRONS_PT_MAX = 1.0;
Float_t FIT_MUONS_PT_MIN = 0.7;
Float_t FIT_MUONS_PT_MAX = 0.;
Float_t FIT_PIONS_PT_MIN = 0.;
Float_t FIT_PIONS_PT_MAX = 5.;

Float_t CONSTRAINSIGNAL_LIMIT = 0.;
Float_t CONSTRAINTAIL_LIMIT = 0.;

enum EFitParams_t {
  kMean,
  kSigma,
  kTail,
  kTotalCounts,
  kIntegralCounts,
  kSignalCounts,
  kBkg1Counts,
  kBkg2Counts,
  kBkg3Counts,
  kBkg4Counts,
  kMismatchCounts,
  kNFitParams
};

/* fit output params name */
const Char_t *fitParamName[kNFitParams] = {
  "Mean",
  "Sigma",
  "Tail",
  "TotalCounts",
  "IntegralCounts",
  "SignalCounts",
  "Bkg1Counts",
  "Bkg2Counts",
  "Bkg3Counts",
  "Bkg4Counts",
  "MismatchCounts"
};

/* fit output params title */
const Char_t *fitParamTitle[kNFitParams] = {
  "Signal mean;p_{T} (GeV/c);#mu (ps)",
  "Signal sigma;p_{T} (GeV/c);#sigma (ps)",
  "Signal tail;p_{T} (GeV/c);#sigma_{tail} (ps)",
  "Total counts;p_{T} (GeV/c);counts",
  "Total counts within fit range;p_{T} (GeV/c);counts",
  "Signal counts;p_{T} (GeV/c);counts",
  "Background-1 counts;p_{T} (GeV/c);counts",
  "Background-2 counts;p_{T} (GeV/c);counts",
  "Background-3 counts;p_{T} (GeV/c);counts",
  "Background-4 counts;p_{T} (GeV/c);counts",
  "Mismatch counts within fit range;p_{T} (GeV/c);counts"
};

/**************************************************************/
/*** GENERATION OF TEMPLATE HISTOS ****************************/
/**************************************************************/

const Int_t NmismatchTrials = 1;
const Int_t NexpectedTrials = 1;

/**************************************************************/
/*** HISTOS AND BINNING ***************************************/
/**************************************************************/

/**************************************************************/
/**************************************************************/
enum EHistoParam_t {
  kCentrality,
  kTOFsigma,
  kPt,
  kTPCsigma,
  kNHistoParams
};
/**************************************************************/
/**************************************************************/
const Int_t NtofsigmaBins = 1750;
Double_t tofsigmaBin[NtofsigmaBins + 1];
Double_t tofsigmaMin = -100., tofsigmaMax = 250., tofsigmaStep = (tofsigmaMax - tofsigmaMin) / NtofsigmaBins;
/**************************************************************/
const Int_t NtofsignalBins = 2000;
Double_t tofsignalBin[NtofsignalBins + 1];
Double_t tofsignalMin = -24400., tofsignalMax = 24400., tofsignalStep = (tofsignalMax - tofsignalMin) / NtofsignalBins;
/**************************************************************/
const Int_t NtofresoBins = 500;
Double_t tofresoBin[NtofsignalBins + 1];
Double_t tofresoMin = 0., tofresoMax = 500., tofresoStep = (tofresoMax - tofresoMin) / NtofresoBins;
/**************************************************************/
/**************************************************************/
const Int_t NtpcsigmaBins = 10;
Double_t tpcsigmaBin[NtpcsigmaBins + 1];
Double_t tpcsigmaMin = -5., tpcsigmaMax = 5., tpcsigmaStep = (tpcsigmaMax - tpcsigmaMin) / NtpcsigmaBins;
/**************************************************************/
Int_t NparamsBins[kNHistoParams] = {NcentralityBins, NtofsigmaBins, NptBins, NtpcsigmaBins};
Double_t *paramBin[kNHistoParams] = {centralityBin, tofsigmaBin, ptBin, tpcsigmaBin};
/**************************************************************/

/**************************************************************/
/**************************************************************/
/**************************************************************/

/**************************************************************/

AliTOFGeometry tofGeo;
Float_t c = TMath::C() * 1.e2 / 1.e12; /* cm/ps */
Float_t c_1 = 1. / c;

Double_t
GenerateRandomHit(TH1F *hT0Fill, Double_t t0fill, Int_t index)
{
  
  Int_t det[5];
  Float_t length, timeexp, pos[3];
  
  /* compute length and expected time */
  tofGeo.GetVolumeIndices(index, det);
  tofGeo.GetPosPar(det, pos);
  length = 0.;
  for (Int_t i = 0; i < 3; i++) length += pos[i] * pos[i];
  length = TMath::Sqrt(length);
  timeexp = length * c_1;
  
  Double_t hittime = hT0Fill->GetRandom() - t0fill + timeexp;
  return hittime;

}

/**************************************************************/

TOFpid(const Char_t *filename, Int_t ipart, Int_t icharge, Int_t iipart, Bool_t dorapidityCut = kTRUE, Bool_t electronCut = kFALSE, Bool_t cutOnTPC = kFALSE, Float_t tpcsignalMin = -2., Float_t tpcsignalMax = 2., Int_t evMax = kMaxInt, Int_t startEv = 0, Bool_t mcFlag = kFALSE)
{
  
  printf("****************************************\n");
  printf("RUNNING TOF PID:\n");
  if (dorapidityCut)
    printf("RAPIDITY-CUT:   %s\n", AliPID::ParticleName(ipart));
  else
    printf("NO RAPIDITY-CUT\n");
  printf("CHARGE:         %s\n", chargeName[icharge]);
  printf("PARTICLE-ID:    %s\n", AliPID::ParticleName(iipart));
  if (electronCut)
    printf("-> ELECTRON CUT REQUESTED\n");
  if (cutOnTPC)
    printf(" -> CUT-ON-TPC [%3.1f,%3.1f]\n", tpcsignalMin, tpcsignalMax);
  printf("****************************************\n");

  /* include path for ACLic */
  gSystem->AddIncludePath("-I$ALICE_ROOT/include");
  gSystem->AddIncludePath("-I$ALICE_ROOT/TOF");
  /* load libraries */
  gSystem->Load("libANALYSIS");
  gSystem->Load("libANALYSISalice");
  /* build analysis task class */
  gROOT->LoadMacro("AliAnalysisParticle.cxx+g");
  gROOT->LoadMacro("AliAnalysisEvent.cxx+g");
  gROOT->LoadMacro("AliAnalysisTrack.cxx+g");

  /* create TOF response with tail */
  //  gROOT->LoadMacro("~/ALICE.2011/ANALYSIS/TOFSpectraPbPb/macros/TOFsignal.C");
  gROOT->LoadMacro("TOFsignal.C");
  TF1 *fTOFsignal = new TF1("fTOFsignal", TOFsignal, -2440., 2440., 4);
  fTOFsignal->SetParameter(0, 1.);
  fTOFsignal->SetParameter(1, 0.);
  fTOFsignal->SetParameter(2, tofReso);
  fTOFsignal->SetParameter(3, tofTail);
  
  /* open file, get tree and connect */
  TFile *filein = TFile::Open(filename);
  TTree *treein = (TTree *)filein->Get("aodTree");
  printf("got \"aodTree\": %d entries\n", treein->GetEntries());
  AliAnalysisEvent *analysisEvent = new AliAnalysisEvent();
  TClonesArray *analysisTrackArray = new TClonesArray("AliAnalysisTrack");
  AliAnalysisTrack *analysisTrack = NULL;
  treein->SetBranchAddress("AnalysisEvent", &analysisEvent);
  treein->SetBranchAddress("AnalysisTrack", &analysisTrackArray);

  /* open hT0fill for mismatch */
  TFile *filein_T0Fill = TFile::Open(t0FillOnlineFileName);
  TH1F *hT0Fill = (TH1F *)filein_T0Fill->Get("hT0Fill");
  Double_t t0fill = t0Fill_offset;

  /* open enabled flag map */
  TH1F *hEnabledFlag = NULL;
  if (enabledChannelsFileName) {
    TFile *enabledfile = TFile::Open(enabledChannelsFileName);
    hEnabledFlag = (TH1F *)enabledfile->Get("hEnabledFlag");
  }

  /**************************************************************/
  /*** HISTOS ***************************************************/
  /**************************************************************/

  /* run-time binning */
  for (Int_t ibin = 0; ibin < NtofsigmaBins + 1; ibin++)
    tofsigmaBin[ibin] = tofsigmaMin + ibin * tofsigmaStep;
  for (Int_t ibin = 0; ibin < NtofsignalBins + 1; ibin++)
    tofsignalBin[ibin] = tofsignalMin + ibin * tofsignalStep;
  for (Int_t ibin = 0; ibin < NtpcsigmaBins + 1; ibin++)
    tpcsigmaBin[ibin] = tpcsigmaMin + ibin * tpcsigmaStep;
  for (Int_t ibin = 0; ibin < NtofresoBins + 1; ibin++)
    tofresoBin[ibin] = tofresoMin + ibin * tofresoStep;

  /* histos */
  TH1F *hAcceptedEvents = new TH1F(Form("hAcceptedEvents_%s_%s_%sID", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart)), "", NcentralityBins, centralityBin);
  TH2I *hAcceptedTracks = new TH2I(Form("hAcceptedTracks_%s_%s_%sID", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart)), "", NcentralityBins, centralityBin, NptBins, ptBin);

  TH3I *hTOFreso = new TH3I(Form("hTOFreso_%s_%s_%sID", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart)), "", NcentralityBins, centralityBin, NptBins, ptBin, NtofresoBins, tofresoBin);

  TH3I *hTOFpid = new TH3I(Form("hTOFpid_%s_%s_%sID", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart)), "", NcentralityBins, centralityBin, NptBins, ptBin, NtofsigmaBins, tofsigmaBin);
  TH3I *hTOFpid_withTZERO = new TH3I(Form("hTOFpid_withTZERO_%s_%s_%sID", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart)), "", NcentralityBins, centralityBin, NptBins, ptBin, NtofsigmaBins, tofsigmaBin);
  TH3I *hTOFmismatch = new TH3I(Form("hTOFmismatch_%s_%s_%sID", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart)), "", NcentralityBins, centralityBin, NptBins, ptBin, NtofsigmaBins, tofsigmaBin);
  TH3I *hTOFexpected[AliPID::kSPECIES];
  for (Int_t iiipart = 0; iiipart < AliPID::kSPECIES; iiipart++) {
    hTOFexpected[iiipart] = new TH3I(Form("hTOFexpected_%s_%s_%sID_%sBKG", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart), AliPID::ParticleName(iiipart)), "", NcentralityBins, centralityBin, NptBins, ptBin, NtofsigmaBins, tofsigmaBin);
  }
  
  TH3I *hTOFpid_delta = new TH3I(Form("hTOFpid_delta_%s_%s_%sID", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart)), "", NcentralityBins, centralityBin, NptBins, ptBin, NtofsignalBins, tofsignalBin);
  TH3I *hTOFmismatch_delta = new TH3I(Form("hTOFmismatch_delta_%s_%s_%sID", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart)), "", NcentralityBins, centralityBin, NptBins, ptBin, NtofsignalBins, tofsignalBin);
  TH3I *hTOFexpected_delta[AliPID::kSPECIES];
  for (Int_t iiipart = 0; iiipart < AliPID::kSPECIES; iiipart++) {
    hTOFexpected_delta[iiipart] = new TH3I(Form("hTOFexpected_delta_%s_%s_%sID_%sBKG", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart), AliPID::ParticleName(iiipart)), "", NcentralityBins, centralityBin, NptBins, ptBin, NtofsignalBins, tofsignalBin);
  }
  
  /**************************************************************/
  /**************************************************************/
  /**************************************************************/

  /* TOF PID response */
  AliTOFPIDResponse tofResponse;
  tofResponse.SetTimeResolution(tofReso);
  /* TPC PID response */
  AliTPCPIDResponse *tpcResponse = AliAnalysisTrack::GetTPCResponse();

  /* start stopwatch */
  TStopwatch timer;
  timer.Start();

  /* verbose */
  printf("***** RUNNING for %s %s *****\n", chargeName[icharge], AliPID::ParticleName(ipart));
  if (!dorapidityCut)
    printf("***** NO RAPIDITY CUT REQUESTED *****\n");
  if (cutOnTPC) {
    printf("***** CUT-ON-TPC requested %3.1f-%3.1f *****\n", tpcsignalMin, tpcsignalMax);
  }

  /* loop over events */
  Bool_t hastofpid;
  Int_t charge, index;
  UShort_t dedxN;
  Double_t cent, p, pt, mt, tofsignal, tpcsignal;
  Double_t dedx, bethe, deltadedx, dedx_sigma, ptpc;
  Double_t time, time_sigma, timezero, timezeroTOF, timezeroA, timezeroC, timezero_sigmaTOF, timezero_sigma, tof, tof_sigma, texp, texp_sigma, deltat, deltat_sigma, tof_rnd, tof_th, signal_smear, timezero_smear, texp_smear;

  /* open TZERO calibfile */
  TH1 *hCentrality_TZEROA_mean = NULL;
  TH1 *hCentrality_TZEROA_sigma = NULL;
  TH1 *hCentrality_TZEROC_mean = NULL;
  TH1 *hCentrality_TZEROC_sigma = NULL;
  TH1 *hCentrality_TOF_mean = NULL;
  TH1 *hCentrality_TOF_TZEROA_mean = NULL;
  TH1 *hCentrality_TOF_TZEROC_mean = NULL;
  TH1 *hCentrality_TOF_TZEROTOF_mean = NULL;
  TH1 *hCentrality_TZEROA_reso = NULL;
  TH1 *hCentrality_TZEROC_reso = NULL;
  TH1 *hCentrality_TZEROAND_reso = NULL;
  if (1) {
    TFile *calibfile = TFile::Open("TZEROcalibration.root");
    hCentrality_TZEROA_mean = (TH1 *)calibfile->Get("hCentrality_TZEROA_mean");
    hCentrality_TZEROA_sigma = (TH1 *)calibfile->Get("hCentrality_TZEROA_sigma");
    hCentrality_TZEROC_mean = (TH1 *)calibfile->Get("hCentrality_TZEROC_calib");
    hCentrality_TZEROC_sigma = (TH1 *)calibfile->Get("hCentrality_TZEROC_sigma");
    hCentrality_TOF_mean = (TH1 *)calibfile->Get("hCentrality_TOF_mean");
    hCentrality_TOF_TZEROA_mean = (TH1 *)calibfile->Get("hCentrality_TOF_TZEROA_mean");
    hCentrality_TOF_TZEROC_mean = (TH1 *)calibfile->Get("hCentrality_TOF_TZEROC_mean");
    hCentrality_TOF_TZEROTOF_mean = (TH1 *)calibfile->Get("hCentrality_TOF_TZEROTOF_mean");

    TFile *resofile = TFile::Open("TZEROresolution.root");
    hCentrality_TZEROA_reso = (TH1 *)resofile->Get("hTZEROA_reso");
    hCentrality_TZEROC_reso = (TH1 *)resofile->Get("hTZEROC_reso");
    hCentrality_TZEROAND_reso = (TH1 *)resofile->Get("hTZEROAND_reso");
  }
  Double_t TZEROA_mean;
  Double_t TZEROA_sigma;
  Double_t TZEROC_mean;
  Double_t TZEROC_sigma;
  Double_t TOF_mean;
  Double_t TOF_TZEROA_mean;
  Double_t TOF_TZEROC_mean;
  Double_t TOF_TZEROTOF_mean;
  Double_t TZEROA;
  Double_t TZEROA_reso;
  Bool_t hasTZEROA;
  Double_t TZEROC;
  Double_t TZEROC_reso;
  Bool_t hasTZEROC;
  Double_t TZEROAND;
  Double_t TZEROAND_reso;
  Bool_t hasTZEROAND;
  Double_t TZEROTOF;
  Double_t TZEROTOF_reso;
  Bool_t hasTZEROTOF;
  Double_t TZEROMEAN;
  Double_t TZEROMEAN_weight;
  Double_t TZEROBEST;
  Double_t TZEROBEST_reso;

  Double_t param[kNHistoParams];
  for (Int_t iev = startEv; iev < treein->GetEntries() && iev < evMax; iev++) {
    /* get event */
    treein->GetEvent(iev);
    if (iev % 10000 == 0) printf("iev = %d\n", iev);
    /* check event */
    if (!analysisEvent->AcceptEvent(acceptEventType)) continue;

    /*** ACCEPTED EVENT ***/

    /* apply time-zero TOF correction */
    //    analysisEvent->ApplyTimeZeroTOFCorrection();

    /* get centrality */
    cent = analysisEvent->GetCentralityPercentile(centralityEstimator);

    /* vertex */
    Double_t vertexz = analysisEvent->GetVertexZ();

    /* fill histos */
    hAcceptedEvents->Fill(cent);

    /* TZERO corrections */
    Int_t icent;
    for (icent = 0; icent < NcentralityBins; icent++)
      if (cent < centralityBin[icent + 1])
	break;
    TZEROA_mean = hCentrality_TZEROA_mean ? hCentrality_TZEROA_mean->GetBinContent(icent + 1) : 0.;
    TZEROA_sigma = hCentrality_TZEROA_sigma ? hCentrality_TZEROA_sigma->GetBinContent(icent + 1) : 1000.;
    TZEROC_mean  = hCentrality_TZEROC_mean ? hCentrality_TZEROC_mean->GetBinContent(icent + 1) : 0.;
    TZEROC_sigma = hCentrality_TZEROC_sigma ? hCentrality_TZEROC_sigma->GetBinContent(icent + 1) : 1000.;

    TOF_mean = hCentrality_TOF_mean ? hCentrality_TOF_mean->GetBinContent(icent + 1) : 0.;
    TOF_TZEROA_mean = hCentrality_TOF_TZEROA_mean ? hCentrality_TOF_TZEROA_mean->GetBinContent(icent + 1) : 0.;
    TOF_TZEROC_mean = hCentrality_TOF_TZEROC_mean ? hCentrality_TOF_TZEROC_mean->GetBinContent(icent + 1) : 0.;
    TOF_TZEROTOF_mean = hCentrality_TOF_TZEROTOF_mean ? hCentrality_TOF_TZEROTOF_mean->GetBinContent(icent + 1) : 0.;

    TZEROA_reso = hCentrality_TZEROA_reso ? hCentrality_TZEROA_reso->GetBinContent(icent + 1) : 70.;
    TZEROC_reso = hCentrality_TZEROC_reso ? hCentrality_TZEROC_reso->GetBinContent(icent + 1) : 70.;
    TZEROAND_reso = hCentrality_TZEROAND_reso ? hCentrality_TZEROAND_reso->GetBinContent(icent + 1) : 50.;

    /* simulate inefficient TZERO */
    Bool_t resetTZERO = kFALSE; 
    if (forcetimezeroineff > 0.) 
      if (gRandom->Uniform() < forcetimezeroineff) 
	resetTZERO = kTRUE;
    
    /* loop over tracks */
    for (Int_t itrk = 0; itrk < analysisTrackArray->GetEntries(); itrk++) {
      /* get track */
      analysisTrack = (AliAnalysisTrack *)analysisTrackArray->At(itrk);
      if (!analysisTrack) continue;
      /* check accepted track */
      if (!analysisTrack->AcceptTrack()) continue;
      /* check rapidity */
      if (dorapidityCut)
	if (analysisTrack->GetY(AliPID::ParticleMass(ipart)) - rapidityShift > rapidityMaxCut || 
	    analysisTrack->GetY(AliPID::ParticleMass(ipart)) - rapidityShift < rapidityMinCut) continue;
 
      /* check charge */
      charge = analysisTrack->GetSign() > 0. ? kPositive : kNegative;
      if (charge != icharge) continue;

      /*** ACCEPTED TRACK ***/

      /* get track info */
      p = analysisTrack->GetP();
      pt = analysisTrack->GetPt();
      
      /* compute track mt */
      mt = TMath::Sqrt(pt * pt + AliPID::ParticleMass(ipart) * AliPID::ParticleMass(ipart));
	
      /* get TPC info */
      dedx = analysisTrack->GetTPCdEdx();
      dedxN = analysisTrack->GetTPCdEdxN();
      ptpc = analysisTrack->GetTPCmomentum();
      
      /* TPC signal */
      bethe = tpcResponse->GetExpectedSignal(ptpc, iipart);
      /* fix electron signal */
      if (iipart == AliPID::kElectron)
	bethe += 23.;
      deltadedx = dedx - bethe;
      dedx_sigma = 0.07 * bethe;
      tpcsignal = deltadedx / dedx_sigma;

      /* electronCut requested, remove electrons */
      if (electronCut) {
	/* TPC signal */
	bethe = tpcResponse->GetExpectedSignal(ptpc, AliPID::kElectron);
	/* fix electron signal */
	bethe += 23.;
	deltadedx = dedx - bethe;
	dedx_sigma = 0.07 * bethe;
	tpcsignal = deltadedx / dedx_sigma;
	if (TMath::Abs(tpcsignal) < 1.5) continue;
      }
      
      /* cut on TPC signal if requested */
      if (cutOnTPC && (tpcsignal < tpcsignalMin || tpcsignal > tpcsignalMax))
	continue;
      
      /* fill histos */
      hAcceptedTracks->Fill(cent, pt);
      
      /* set TOF pid flag */
      hastofpid = analysisTrack->HasTOFPID(hEnabledFlag);
      
      /* check TOF pid */
      if (!hastofpid)
	continue;
      
      /*** ACCEPTED TRACK WITH TOF PID ***/
      
      /* apply expected time correction */
      //      analysisTrack->ApplyTOFExpectedTimeCorrection();
      
      /* get TOF info */
      index = analysisTrack->GetTOFIndex();
      time = analysisTrack->GetTOFTime() - TOF_mean;
      time_sigma = tofReso;
      /* TZEROTOF */
      TZEROTOF = analysisEvent->GetTimeZeroTOF(analysisTrack->GetP());
      TZEROTOF_reso = analysisEvent->GetTimeZeroTOFSigma(analysisTrack->GetP());
      hasTZEROTOF = TZEROTOF_reso < 150.;
      if (hasTZEROTOF) {
	TZEROTOF += TOF_TZEROTOF_mean - TOF_mean;
	TZEROTOF_reso *= TZEROTOF_resoScaleFactor;
      }
      /* TZEROA */
      TZEROA = analysisEvent->GetTimeZeroT0(1) - TZEROA_shift;
      //      TZEROA_reso = TZEROA_resolution[icent];
      hasTZEROA = TMath::Abs(TZEROA - TZEROA_mean) < 3. * TZEROA_sigma;
      TZEROA += TOF_TZEROA_mean - TOF_mean;
      /* TZEROC */
      TZEROC = analysisEvent->GetTimeZeroT0(2) - TZEROC_shift;
      //      TZEROC_reso = TZEROC_resolution[icent];
      hasTZEROC = TMath::Abs(TZEROC - TZEROC_mean) < 3. * TZEROC_sigma;
      TZEROC += TOF_TZEROC_mean - TOF_mean;
      /* TZEROAND */
      TZEROAND = (TZEROA + TZEROC) * 0.5;
      //      TZEROAND_reso = TZEROAND_resolution[icent];
      hasTZEROAND = hasTZEROA && hasTZEROC;
      /* TZEROMEAN */
      TZEROMEAN = TZEROTOF / TZEROTOF_reso / TZEROTOF_reso;
      TZEROMEAN_weight = 1. / TZEROTOF_reso / TZEROTOF_reso;
      if (hasTZEROAND) {
	//	printf("TZEROAND\n");
	TZEROMEAN += TZEROAND / TZEROAND_reso / TZEROAND_reso;
	TZEROMEAN_weight = 1. / TZEROAND_reso / TZEROAND_reso;
      }
      else if (hasTZEROA) {
	//	printf("TZEROA\n");
	TZEROMEAN += TZEROA / TZEROA_reso / TZEROA_reso;
	TZEROMEAN_weight = 1. / TZEROA_reso / TZEROA_reso;
      }
      else if (hasTZEROC) {
	//	printf("TZEROC\n");
	TZEROMEAN += TZEROC / TZEROC_reso / TZEROC_reso;
	TZEROMEAN_weight = 1. / TZEROC_reso / TZEROC_reso;
      }
      timezero = TZEROMEAN / TZEROMEAN_weight;
      timezero_sigma = TMath::Sqrt(1. / TZEROMEAN_weight);
      /* TZEROBEST */
      TZEROBEST = TZEROTOF;
      TZEROBEST_reso = TZEROTOF_reso;
      if (hasTZEROAND && TZEROAND_reso < TZEROBEST_reso) {
	TZEROBEST = TZEROAND;
	TZEROBEST_reso = TZEROAND_reso;
      }
      else if (hasTZEROA && TZEROA_reso < TZEROBEST_reso) {
	TZEROBEST = TZEROA;
	TZEROBEST_reso = TZEROA_reso;
      }
      if (hasTZEROC && TZEROC_reso < TZEROBEST_reso) {
	TZEROBEST = TZEROC;
	TZEROBEST_reso = TZEROC_reso;
      }
      timezero = TZEROBEST;
      timezero_sigma = TZEROBEST_reso;

      /* DEBUG */
      //      timezero = 0.;//TZEROTOF;
      //      timezero_sigma = 203.854691;//TZEROTOF_reso;

      //      if (timezero == 0.)
      //	printf("%f %f\n", timezero, timezero_sigma);

      timezero_sigma *= scaletimezerosigma;

      if (resetTZERO) {
	timezero = 0.;
	timezero_sigma = timezero_spread;
      }


      tof = time - timezero;
      tof_sigma = TMath::Sqrt(time_sigma * time_sigma + timezero_sigma * timezero_sigma);
      
      /* TOF expected time */
      texp = analysisTrack->GetTOFExpTime(iipart);
      texp_sigma = analysisTrack->GetTOFExpTimeSigma(iipart) * scaletexpreso[iipart];
      
      /* TOF signal */
      deltat = tof - texp;
      deltat_sigma = TMath::Sqrt(tof_sigma * tof_sigma + texp_sigma * texp_sigma);
      tofsignal = deltat / deltat_sigma;
      
      /* fill histo */
      hTOFpid->Fill(cent, pt, tofsignal);
      hTOFpid_delta->Fill(cent, p, deltat);
      hTOFreso->Fill(cent, pt, deltat_sigma);
      if (hasTZEROTOF || hasTZEROA || hasTZEROC || hasTZEROAND)
	hTOFpid_withTZERO->Fill(cent, pt, tofsignal);


      /*** EXPECTED MISMATCH ***/
      
      /* loop to generated random hits */
      for (Int_t irnd = 0; irnd < NmismatchTrials; irnd++) {
	
	/* generate ramdom tof values */
	tof_rnd = GenerateRandomHit(hT0Fill, t0fill, index);

	/* TOF signal */
	deltat = tof_rnd - texp;
	tofsignal = deltat / deltat_sigma;
	
	/* fill histo */
	hTOFmismatch->Fill(cent, pt, tofsignal);
	hTOFmismatch_delta->Fill(cent, p, deltat);
	
      } /* end of loop over generated random hits */
	
      /*** EXPECTED SIGNALS ***/
      
      /* loop over other particles */
      for (Int_t iiipart = 0; iiipart < AliPID::kSPECIES; iiipart++) {
	
	/* generate expected tof value */
	tof_th = analysisTrack->GetTOFExpTime(iiipart);
	texp_sigma = analysisTrack->GetTOFExpTimeSigma(iiipart) * scaletexpreso[iiipart];
	 	
	/* loop over many trials */
	for (Int_t irnd = 0; irnd < NexpectedTrials; irnd++) {
	  
	  /* tof response smearing */
	  signal_smear = fTOFsignal->GetRandom();
	  /* timezero resolution smearing */
	  timezero_smear = gRandom->Gaus(0., timezero_sigma);
	  /* texp resolution smearing */
	  texp_smear = gRandom->Gaus(0., texp_sigma);
	  
	  /* deltat and sigma */
	  deltat = tof_th - texp + signal_smear + timezero_smear + texp_smear;
	  tofsignal = deltat / deltat_sigma;
	  
	  /* fill histo */
	  hTOFexpected[iiipart]->Fill(cent, pt, tofsignal);
	  hTOFexpected_delta[iiipart]->Fill(cent, p, deltat);
	    
	} /* end of loop over many trials */
      } /* end of loop over other particle */
    } /* end of loop over tracks */
  } /* end of loop over events */
  
  /* stop stopwatch */
  timer.Stop();
  timer.Print();
  
  /* output */
  TString outputstring = "TOFpid";
  if (!dorapidityCut)
    outputstring += "_noRapidityCut";
  if (electronCut)
    outputstring += "_electronCut";
  if (cutOnTPC)
    outputstring += Form("_cutOnTPC[%3.1f,%3.1f]", , tpcsignalMin, tpcsignalMax);
  outputstring += Form("_%s_%s_%sID.%s", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart), filename);
  TFile *fileout = TFile::Open(outputstring.Data(), "RECREATE");
  hAcceptedEvents->Write();
  hAcceptedTracks->Write();
  hTOFpid->Write();
  hTOFreso->Write();
  hTOFpid_withTZERO->Write();
  hTOFmismatch->Write();
  for (Int_t iiipart = 0; iiipart < AliPID::kSPECIES; iiipart++)
    hTOFexpected[iiipart]->Write();
  hTOFpid_delta->Write();
  hTOFmismatch_delta->Write();
  for (Int_t iiipart = 0; iiipart < AliPID::kSPECIES; iiipart++)
    hTOFexpected_delta[iiipart]->Write();
  
  fileout->Close();
  
}

//___________________________________________________________________________________

TOFspectra_defaultFit(const Char_t *filename)
{

Bool_t EXPECTED_SIGNAL_TEMPLATE = kTRUE;
Bool_t EXPECTED_SIGNAL_FIT = kFALSE;
Bool_t EXPECTED_BACKGROUND_TEMPLATE = kFALSE;
Bool_t EXPECTED_BACKGROUND_FIT = kTRUE;

}

//___________________________________________________________________________________

TOFspectra_defaultFit_fitElectrons(const Char_t *filename, Float_t electronLimit = 5.)
{


  TOFspectra(filename, electronLimit);
}

//___________________________________________________________________________________

TOFspectra_signalFit(Bool_t fixParams = kTRUE, Float_t scaleSigma = 1., Float_t scaleTail = 1.)
{

  EXPECTED_SIGNAL_TEMPLATE = kFALSE;
  EXPECTED_SIGNAL_FIT = kTRUE;
  FIX_SIGNAL_MEAN = fixParams;
  FIX_SIGNAL_SIGMA = fixParams;
  FIX_SIGNAL_TAIL = fixParams;
  SCALE_SIGNAL_SIGMA = scaleSigma;
  SCALE_SIGNAL_TAIL = scaleTail;
  
}

//___________________________________________________________________________________

TOFspectra_bkgFit(Bool_t fixParams = kTRUE, Float_t scaleSigma = 1., Float_t scaleTail = 1.)
{

  EXPECTED_BACKGROUND_TEMPLATE = kFALSE;
  EXPECTED_BACKGROUND_FIT = kTRUE;
  FIX_BACKGROUND_MEAN = fixParams;
  FIX_BACKGROUND_SIGMA = fixParams;
  FIX_BACKGROUND_TAIL = fixParams;
  SCALE_BACKGROUND_SIGMA = scaleSigma;
  SCALE_BACKGROUND_TAIL = scaleTail;
  
  TOFspectra(filename);

}

//___________________________________________________________________________________

void
TOFspectra(const Char_t *filename, Float_t electronLimit = 0.)
{

  for (Int_t icent = 0; icent < NcentralityBins; icent++)
    for (Int_t icharge = 0; icharge < kNCharges; icharge++)
      for (Int_t ipart = 2; ipart < AliPID::kSPECIES; ipart++)
	TOFspectrum(filename, ipart, icharge, ipart, icent, -1., -1., electronLimit);
  
}

//___________________________________________________________________________________

#define USENSIGMA 1

/* fit ranges */
Double_t fitPtMin[AliPID::kSPECIES] = {0.5, 0.5, 0.3, 0.4, 0.5};
Double_t fitPtMax[AliPID::kSPECIES] = {3.0, 3.0, 3.0, 3.0, 5.0};
#if USENSIGMA
Double_t fitSigmaMin[AliPID::kSPECIES] = {tofsigmaMin, tofsigmaMin, -25., -75., -65.};
Double_t fitSigmaMax[AliPID::kSPECIES] = {tofsigmaMax, tofsigmaMax, 225., 200., 100.};
#else
Double_t fitSigmaMin[AliPID::kSPECIES] = {-24400., -24400., -24400., -24400., -24400.};
Double_t fitSigmaMax[AliPID::kSPECIES] = {24400., 24400., 24400., 24400., 24400.};
#endif

void
TOFspectrum(const Char_t *filename, Int_t ipart, Int_t icharge, Int_t iipart, Int_t icent, Float_t ptMin = -1., Float_t ptMax = -1., Bool_t checkHistoFlag = kFALSE)
{

  printf("****************************************\n");
  printf("RUNNING SPECTRA FIT:\n");
  printf("RAPIDITY-CUT:   %s\n", AliPID::ParticleName(ipart));
  printf("RAPIDITY-CUT:   %s\n", AliPID::ParticleName(ipart));
  printf("CHARGE:         %s\n", chargeName[icharge]);
  printf("PARTICLE:       %s\n", AliPID::ParticleName(iipart));
  printf("CENTRALITY BIN: %d\n", icent);
  printf("****************************************\n");

  /* mismatch balance functions */
  TF1 *fMismatchBalanceFunction[5][2];
  Double_t mismatchBalanceParam0[5][2] = {
    0., 0., 
    0., 0.,
    0.669488, 0.599374,
    -1.2582, -2.53613,
    5.48850e-01, 10.1622
  };
  Double_t mismatchBalanceParam1[5][2] = {
    0., 0.,
    0., 0.,
    -1.64894, -0.825764,
    -1.63683, -2.55156,
    -1.64894, -7.09531
  };
  for (Int_t iiipart = 0; iiipart < AliPID::kSPECIES; iiipart++) {
    for (Int_t iiicharge = 0; iiicharge < 2; iiicharge++) {
      fMismatchBalanceFunction[iiipart][iiicharge] = new TF1(Form(""), "1. - [0]*TMath::Exp(x*[1])", 0., 5.);
      fMismatchBalanceFunction[iiipart][iiicharge]->SetParameter(0, mismatchBalanceParam0[iiipart][iiicharge]);
      fMismatchBalanceFunction[iiipart][iiicharge]->SetParameter(1, mismatchBalanceParam1[iiipart][iiicharge]);
    }
  }

  /* open data */
  TFile *filein = TFile::Open(filename);

  /* get number of events */
  TH1F *hAcceptedEvents = (TH1F *)filein->Get(Form("hAcceptedEvents_%s_%s_%sID", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart)));
  if (!hAcceptedEvents) {
    printf("cannot find %s\n", Form("hAcceptedEvents_%s_%s", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart)));
    return;
  }
  Double_t nevents;
  if (icent < 0 || icent >= NcentralityBins)
    nevents = hAcceptedEvents->GetEntries();
  else
    nevents = hAcceptedEvents->Integral(icent + 1, icent + 1);
  printf("N_EVENTS      : %d\n", nevents);
  printf("****************************************\n");
  
  /* get histos */
  TH2I *hAcceptedTracks = (TH2I *)filein->Get(Form("hAcceptedTracks_%s_%s_%sID", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart)));
  if (!hAcceptedTracks) {
    printf("cannot find %s\n", Form("hAcceptedTracks_%s_%s_%sID", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart)));
    //    return;
  }
#if USENSIGMA
  TH3I *hTOFpid = (TH3I *)filein->Get(Form("hTOFpid_%s_%s_%sID", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart)));
#else
  TH3I *hTOFpid = (TH3I *)filein->Get(Form("hTOFpid_delta_%s_%s_%sID", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart)));
#endif
  if (!hTOFpid) {
    printf("cannot find %s\n", Form("hTOFpid_%s_%s_%sID", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart)));
    return;
  }
#if USENSIGMA
  TH3I *hTOFmismatch = (TH3I *)filein->Get(Form("hTOFmismatch_%s_%s_%sID", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart)));
#else
  TH3I *hTOFmismatch = (TH3I *)filein->Get(Form("hTOFmismatch_delta_%s_%s_%sID", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart)));
#endif
  if (!hTOFmismatch) {
    printf("cannot find %s\n", Form("hTOFpid_%s_%s_%sID", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart)));
    return;
  }
  TH3I *hTOFexpected[AliPID::kSPECIES];
  for (Int_t iiipart = 0; iiipart < AliPID::kSPECIES; iiipart++) {
#if USENSIGMA
    hTOFexpected[iiipart] = (TH3I *)filein->Get(Form("hTOFexpected_%s_%s_%sID_%sBKG", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart), AliPID::ParticleName(iiipart)));
#else
    hTOFexpected[iiipart] = (TH3I *)filein->Get(Form("hTOFexpected_delta_%s_%s_%sID_%sBKG", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart), AliPID::ParticleName(iiipart)));
#endif
    if (!hTOFexpected[iiipart]) {
      printf("cannot find %s\n", Form("hTOFexpected_%s_%s_%sID_%sBKG", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart), AliPID::ParticleName(iiipart)));
      return;
    }
  }

  /* setup centrality range */
  if (icent < 0 || icent >= NcentralityBins) {
    printf("WARNING: undefined centrality -> using 00-90\% range\n");
    if (hAcceptedTracks) hAcceptedTracks->GetXaxis()->SetRange(1, NcentralityBins);
    hTOFpid->GetXaxis()->SetRange(1, NcentralityBins);
    hTOFmismatch->GetXaxis()->SetRange(1, NcentralityBins);
    for (Int_t iiipart = 0; iiipart < AliPID::kSPECIES; iiipart++)
      hTOFexpected[iiipart]->GetXaxis()->SetRange(1, NcentralityBins);
  }
  else {
    printf("***** FITTING CENTRALITY-BIN [%02d, %02d] %% *****\n", centralityBin[icent], centralityBin[icent + 1]);
    if (hAcceptedTracks) hAcceptedTracks->GetXaxis()->SetRange(icent + 1, icent + 1);
    hTOFpid->GetXaxis()->SetRange(icent + 1, icent + 1);
    hTOFmismatch->GetXaxis()->SetRange(icent + 1, icent + 1);
    for (Int_t iiipart = 0; iiipart < AliPID::kSPECIES; iiipart++)
      hTOFexpected[iiipart]->GetXaxis()->SetRange(icent + 1, icent + 1);
  }

  /* init flags */
  Bool_t requestedRange = kFALSE;
  Bool_t fitElectrons = kTRUE;
  Bool_t fitMuons = kTRUE;
  Bool_t fitPions = kTRUE;

  /* setup pt range if requested */
  if (ptMin > -0.001 && ptMax > -0.001 && ptMax > ptMin) {
    printf("***** FITTING PT-BIN [%f, %f] GeV/c *****\n", ptMin, ptMax);
    requestedRange = kTRUE;

    /* check electron-fit is allowed */
    fitElectrons = kTRUE;
    if ((ptMin + 0.001) < FIT_ELECTRONS_PT_MIN || (ptMax - 0.001) > FIT_ELECTRONS_PT_MAX)
      fitElectrons = kFALSE;
    /* check muon-fit is allowed */
    fitMuons = kTRUE;
    if ((ptMin + 0.001) < FIT_MUONS_PT_MIN || (ptMax - 0.001) > FIT_MUONS_PT_MAX)
      fitMuons = kFALSE;
    /* check pion-fit is allowed */
    fitPions = kTRUE;
    if ((ptMin + 0.001) < FIT_PIONS_PT_MIN || (ptMax - 0.001) > FIT_PIONS_PT_MAX)
      fitPions = kFALSE;

    
    hTOFpid->GetYaxis()->SetRangeUser(ptMin + 0.001, ptMax - 0.001);
    hTOFmismatch->GetYaxis()->SetRangeUser(ptMin + 0.001, ptMax - 0.001);
    for (Int_t iiipart = 0; iiipart < AliPID::kSPECIES; iiipart++)
      hTOFexpected[iiipart]->GetYaxis()->SetRangeUser(ptMin + 0.001, ptMax - 0.001);
  }

  /* output */
  Char_t outfilename[1024];
  if (icent < 0 || icent >= NcentralityBins)
    sprintf(outfilename, "TOFspectrum_cent0090_%s_%s_%sID.root", AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart));
  else {
    sprintf(outfilename, "TOFspectrum_cent%02d%02d_%s_%s_%sID.root", centralityBin[icent], centralityBin[icent + 1], AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart));
  }
  TFile *fileout = TFile::Open(outfilename, "RECREATE");
  TDirectory *fitDir = fileout->mkdir("FitParams");
  /* canvas */
  TCanvas *canvas = new TCanvas("canvas");
  canvas->SetLogy();
  /* histo */
  TH1D *hFitParamHisto[kNFitParams];
  for (Int_t iparam = 0; iparam < kNFitParams; iparam++)
    hFitParamHisto[iparam] = new TH1D(Form("h%s", fitParamName[iparam]), fitParamTitle[iparam], NptBins, ptBin);

  /* loop over ptBins */
  for (Int_t ipt = 0; ipt < NptBins; ipt++) {
    
    if (!requestedRange) {
      if ((ptBin[ipt] + 0.001) < fitPtMin[ipart] || (ptBin[ipt + 1] - 0.001) > fitPtMax[ipart]) continue;
      printf("***** FITTING PT-BIN [%f, %f] GeV/c *****\n", ptBin[ipt], ptBin[ipt + 1]);

      /* check electron-fit is allowed */
      fitElectrons = kTRUE;
      if ((ptBin[ipt] + 0.001) < FIT_ELECTRONS_PT_MIN || (ptBin[ipt + 1] - 0.001) > FIT_ELECTRONS_PT_MAX)
	fitElectrons = kFALSE;
      /* check muon-fit is allowed */
      fitMuons = kTRUE;
      if ((ptBin[ipt] + 0.001) < FIT_MUONS_PT_MIN || (ptBin[ipt + 1] - 0.001) > FIT_MUONS_PT_MAX)
	fitMuons = kFALSE;
      /* check pion-fit is allowed */
      fitPions = kTRUE;
      if ((ptBin[ipt] + 0.001) < FIT_PIONS_PT_MIN || (ptBin[ipt + 1] - 0.001) > FIT_PIONS_PT_MAX)
	fitPions = kFALSE;

      hTOFpid->GetYaxis()->SetRange(ipt + 1, ipt + 1);
      hTOFmismatch->GetYaxis()->SetRange(ipt + 1, ipt + 1);
      for (Int_t iiipart = 0; iiipart < AliPID::kSPECIES; iiipart++)
	hTOFexpected[iiipart]->GetYaxis()->SetRange(ipt + 1, ipt + 1);
    }
    
    /* nsigma projections */
    TH1 *hSignal_py = hTOFpid->Project3D("z");
    TH1 *hMismatch_py = hTOFmismatch->Project3D("z");
    TH1 *hSignalExp_py[AliPID::kSPECIES];
    TH1 *hSignalExpTail_py[AliPID::kSPECIES];
    for (Int_t iiipart = 0; iiipart < AliPID::kSPECIES; iiipart++) {
      hSignalExp_py[iiipart] = hTOFexpected[iiipart]->Project3D("z");
      hSignalExpTail_py[iiipart] = hTOFexpected[iiipart]->Project3D("z");
    }

    /* prepare histos for the fitter */
    Int_t partbkg1[AliPID::kSPECIES] = {AliPID::kKaon, AliPID::kKaon, AliPID::kKaon, AliPID::kPion, AliPID::kPion};
    Int_t partbkg2[AliPID::kSPECIES] = {AliPID::kProton, AliPID::kProton, AliPID::kProton, AliPID::kProton, AliPID::kKaon};
    Int_t partbkg3[AliPID::kSPECIES] = {AliPID::kPion, AliPID::kPion, AliPID::kElectron, AliPID::kElectron, AliPID::kElectron};
    Int_t partbkg4[AliPID::kSPECIES] = {AliPID::kMuon, AliPID::kElectron, AliPID::kMuon, AliPID::kMuon, AliPID::kMuon};
    TH1 *hSigExp_py, *hBkgExp1_py, *hBkgExp2_py, *hBkgExp3_py, *hBkgExp4_py;
    hSigExp_py = EXPECTED_SIGNAL_TAIL ? hSignalExpTail_py[iipart] : hSignalExp_py[iipart];
    hBkgExp1_py = EXPECTED_BACKGROUND_TAIL ? hSignalExpTail_py[partbkg1[iipart]] : hSignalExp_py[partbkg1[iipart]];
    hBkgExp2_py = EXPECTED_BACKGROUND_TAIL ? hSignalExpTail_py[partbkg2[iipart]] : hSignalExp_py[partbkg2[iipart]];
    hBkgExp3_py = EXPECTED_BACKGROUND_TAIL ? hSignalExpTail_py[partbkg3[iipart]] : hSignalExp_py[partbkg3[iipart]];
    hBkgExp4_py = EXPECTED_BACKGROUND_TAIL ? hSignalExpTail_py[partbkg4[iipart]] : hSignalExp_py[partbkg4[iipart]];

    /* check histos if requested */
    if (checkHistoFlag) {
      TCanvas *cCheckHisto = new TCanvas("cCheckHisto");
      cCheckHisto->Divide(2, 3);
      cCheckHisto->cd(1);
      hSignal_py->Draw();
      cCheckHisto->cd(2);
      hSigExp_py->Draw();
      cCheckHisto->cd(3);
      hBkgExp1_py->Draw();
      cCheckHisto->cd(4);
      hBkgExp2_py->Draw();
      cCheckHisto->cd(5);
      hBkgExp3_py->Draw();
      cCheckHisto->cd(6);
      hMismatch_py->Draw();
      return;
    }

    Double_t rangeMin = fitSigmaMin[iipart], rangeMax = fitSigmaMax[iipart];
    Bool_t constrainSignal = kFALSE;
    Bool_t constrainBkg1 = kFALSE;
    Bool_t constrainBkg2 = kFALSE;
    Bool_t forceGaussianSignal = kFALSE;
    Bool_t fitBkg1 = kTRUE, fitBkg2 = kTRUE, fitBkg3 = kTRUE, fitBkg4 = kTRUE;

    /* check whether we can fit electrons */
    if (!fitElectrons) {
      printf("INHIBIT FIT ELECTRONS\n");
      if (partbkg1[iipart] == AliPID::kElectron) fitBkg1 = kFALSE;
      if (partbkg2[iipart] == AliPID::kElectron) fitBkg2 = kFALSE;
      if (partbkg3[iipart] == AliPID::kElectron) fitBkg3 = kFALSE;
      if (partbkg4[iipart] == AliPID::kElectron) fitBkg4 = kFALSE;
    }
    /* check whether we can fit muons */
    if (!fitMuons) {
      printf("INHIBIT FIT MUONS\n");
      if (partbkg1[iipart] == AliPID::kMuon) fitBkg1 = kFALSE;
      if (partbkg2[iipart] == AliPID::kMuon) fitBkg2 = kFALSE;
      if (partbkg3[iipart] == AliPID::kMuon) fitBkg3 = kFALSE;
      if (partbkg4[iipart] == AliPID::kMuon) fitBkg4 = kFALSE;
    }
    /* check whether we can fit pions */
    if (!fitPions) {
      printf("INHIBIT FIT PIONS\n");
      if (partbkg1[iipart] == AliPID::kPion) fitBkg1 = kFALSE;
      if (partbkg2[iipart] == AliPID::kPion) fitBkg2 = kFALSE;
      if (partbkg3[iipart] == AliPID::kPion) fitBkg3 = kFALSE;
      if (partbkg4[iipart] == AliPID::kPion) fitBkg4 = kFALSE;
    }


    /* fit */
    Double_t param[kNFitParams];
    Double_t param_err[kNFitParams];
    TOFpid_fit(hSignal_py, hSigExp_py, hBkgExp1_py, hBkgExp2_py, hBkgExp3_py, hBkgExp4_py, hMismatch_py, rangeMin, rangeMax, fitBkg1, fitBkg2, fitBkg3, fitBkg4, constrainSignal, constrainBkg1, constrainBkg2, forceGaussianSignal, param, param_err, canvas);


    /* if fitting pions add electrons and to the signal */
    if (iipart == 2) {
      param[kSignalCounts] += param[kBkg3Counts] + param[kBkg4Counts];
      param_err[kSignalCounts] = TMath::Sqrt(param_err[kSignalCounts] * param_err[kSignalCounts] + param_err[kBkg3Counts] * param_err[kBkg3Counts] + param_err[kBkg4Counts] * param_err[kBkg3Counts]);
    }
    /* else add to bkg1 (pions) */
    else {
      param[kBkg1Counts] += param[kBkg3Counts] + param[kBkg4Counts];
      param_err[kBkg1Counts] = TMath::Sqrt(param_err[kBkg1Counts] * param_err[kBkg1Counts] + param_err[kBkg3Counts] * param_err[kBkg3Counts] + param_err[kBkg4Counts] * param_err[kBkg3Counts]);
    }

    /* check requested pt-range */
    if (requestedRange)
      return;

    /* write canvas */
    fitDir->cd();
    canvas->Write(Form("fitDisplay_ptBin_%3.2f_%3.2f", ptBin[ipt], ptBin[ipt + 1]));

    /* set histo */
    for (Int_t iparam = 0; iparam < kNFitParams; iparam++) {
      hFitParamHisto[iparam]->SetBinContent(ipt + 1, param[iparam]);
      hFitParamHisto[iparam]->SetBinError(ipt + 1, param_err[iparam]);
    }

    /* delete */
    delete hSignal_py;
    delete hMismatch_py;
    for (Int_t iiipart = 0; iiipart < AliPID::kSPECIES; iiipart++) {
      delete hSignalExp_py[iiipart];
      //      delete hSignalExpTail_py[iiipart];
    }
  }

  /* check requested pt-range */
  if (requestedRange)
    return;

  /*** POST-ANALYSIS ***/

  TDirectory *postDir = fileout->mkdir("PostAnalysis");
 
  /* compute overflows */
  TH1D *hOverflowCounts = new TH1D(*hFitParamHisto[kTotalCounts]);
  hOverflowCounts->SetNameTitle("hOverflowCounts", "Overflow counts: TotalCounts - IntegralCounts;p_{T} (GeV/c);counts");
  hOverflowCounts->Add(hFitParamHisto[kIntegralCounts], -1.);
  /* compute total mismatch counts */
  TH1D *hTotalMismatchCounts = new TH1D(*hFitParamHisto[kMismatchCounts]);
  hTotalMismatchCounts->SetNameTitle("hTotalMismatchCounts", "Total mismatch counts: MismatchCounts + OverflowCounts;p_{T} (GeV/c);counts");
  hTotalMismatchCounts->Add(hOverflowCounts);
  /* computed mismatch fraction */
  TH1D *hTotalMismatchFraction = new TH1D(*hTotalMismatchCounts);
  hTotalMismatchFraction->SetNameTitle("hTotalMismatchFraction", "Total mismatch fraction: TotalMismatchCounts / TotalCounts;p_{T} (GeV/c);");
  hTotalMismatchFraction->Divide(hFitParamHisto[kTotalCounts]);
  /* compute identified counts */
  TH1D *hIdentifiedCounts = new TH1D(*hFitParamHisto[kSignalCounts]);
  hIdentifiedCounts->SetNameTitle("hIdentifiedCounts", "Identified counts: SignalCounts + sum(BkgCounts);p_{T} (GeV/c);counts");
  hIdentifiedCounts->Add(hFitParamHisto[kBkg1Counts]);
  hIdentifiedCounts->Add(hFitParamHisto[kBkg2Counts]);
  //  hIdentifiedCounts->Add(hFitParamHisto[kBkg3Counts]);
  //  hIdentifiedCounts->Add(hFitParamHisto[kBkg4Counts]);
  /* compute signal fraction */
  TH1D *hSignalFraction = new TH1D(*hFitParamHisto[kSignalCounts]);
  hSignalFraction->SetNameTitle("hSignalFraction", "Signal fraction: SignalCounts / IdentifiedCounts;p_{T} (GeV/c);");
  hSignalFraction->Divide(hSignalFraction, hIdentifiedCounts, 1., 1., "B");
  /* compute bkg1 fraction */
  TH1D *hBkg1Fraction = new TH1D(*hFitParamHisto[kBkg1Counts]);
  hBkg1Fraction->SetNameTitle("hBkg1Fraction", "Bkg1 fraction: Bkg1Counts / IdentifiedCounts;p_{T} (GeV/c);");
  hBkg1Fraction->Divide(hBkg1Fraction, hIdentifiedCounts, 1., 1., "B");
  /* compute bkg2 fraction */
  TH1D *hBkg2Fraction = new TH1D(*hFitParamHisto[kBkg2Counts]);
  hBkg2Fraction->SetNameTitle("hBkg2Fraction", "Bkg2 fraction: Bkg2Counts / IdentifiedCounts;p_{T} (GeV/c);");
  hBkg2Fraction->Divide(hBkg2Fraction, hIdentifiedCounts, 1., 1., "B");
  /* compute bkg3 fraction */
  TH1D *hBkg3Fraction = new TH1D(*hFitParamHisto[kBkg3Counts]);
  hBkg3Fraction->SetNameTitle("hBkg3Fraction", "Bkg3 fraction: Bkg3Counts / IdentifiedCounts;p_{T} (GeV/c);");
  hBkg3Fraction->Divide(hBkg3Fraction, hIdentifiedCounts, 1., 1., "B");
  /* compute bkg4 fraction */
  TH1D *hBkg4Fraction = new TH1D(*hFitParamHisto[kBkg4Counts]);
  hBkg4Fraction->SetNameTitle("hBkg4Fraction", "Bkg4 fraction: Bkg4Counts / IdentifiedCounts;p_{T} (GeV/c);");
  hBkg4Fraction->Divide(hBkg4Fraction, hIdentifiedCounts, 1., 1., "B");
  /* rework */
  TH1D *hSignalFractionReworked = new TH1D(*hFitParamHisto[kSignalCounts]);
  hSignalFractionReworked->SetNameTitle("hSignalFractionReworked", "Signal fraction reworked: SignalCounts / IdentifiedCounts;p_{T} (GeV/c);");
  hSignalFractionReworked->Multiply(fMismatchBalanceFunction[iipart][icharge]);
  TH1D *hBkg1FractionReworked = new TH1D(*hFitParamHisto[kBkg1Counts]);
  hBkg1FractionReworked->SetNameTitle("hBkg1FractionReworked", "Bkg1 fraction reworked: SignalCounts / IdentifiedCounts;p_{T} (GeV/c);");
  hBkg1FractionReworked->Multiply(fMismatchBalanceFunction[partbkg1[iipart]][icharge]);
  TH1D *hBkg2FractionReworked = new TH1D(*hFitParamHisto[kBkg2Counts]);
  hBkg2FractionReworked->SetNameTitle("hBkg2FractionReworked", "Bkg1 fraction reworked: SignalCounts / IdentifiedCounts;p_{T} (GeV/c);");
  hBkg2FractionReworked->Multiply(fMismatchBalanceFunction[partbkg2[iipart]][icharge]);
  TH1D *hIdentifiedCountsReworked = new TH1D(*hSignalFractionReworked);
  hIdentifiedCountsReworked->SetNameTitle("hIdentifiedCountsReworked", "Identified counts reworked: SignalCounts / IdentifiedCounts;p_{T} (GeV/c);");
  hIdentifiedCountsReworked->Add(hBkg1FractionReworked);
  hIdentifiedCountsReworked->Add(hBkg2FractionReworked);

  hSignalFractionReworked->Divide(hSignalFractionReworked, hIdentifiedCountsReworked, 1., 1., "B");

  /* compute mismatch-correction counts */
  TH1D *hMismatchCorrectionCounts = new TH1D(*hTotalMismatchCounts);
  hMismatchCorrectionCounts->SetNameTitle("hMismatchCorrectionCounts", "Mismatch-correction counts: TotalMismatchCounts * SignalFraction;p_{T} (GeV/c);counts");
  hMismatchCorrectionCounts->Multiply(hSignalFractionReworked);
  /* compute mismatch-corrected signal counts */
  TH1D *hMismatchCorrectedSignalCounts = new TH1D(*hFitParamHisto[kSignalCounts]);
  hMismatchCorrectedSignalCounts->SetNameTitle("hMismatchCorrectedSignalCounts", "Mismatch-corrected signal counts: SignalCounts + MismatchCorrectionCounts;p_{T} (GeV/c);counts");
  hMismatchCorrectedSignalCounts->Add(hMismatchCorrectionCounts);


  /* accepted tracks histo */
  if (hAcceptedTracks) {
    TH1D *hAcceptedTracks_py = hAcceptedTracks->ProjectionY();
    hAcceptedTracks_py->SetNameTitle("hAcceptedTracks", "Accepted tracks;p_{T} (GeV/c);");
    hAcceptedTracks_py->Sumw2();
  }

  /*** RAW SPECTRA ***/

  TDirectory *rawDir = fileout->mkdir("RawSpectra");

  /* compute normalized raw yield */
  TH1D *hNormalizedRawYield = new TH1D(*hFitParamHisto[kSignalCounts]);
  hNormalizedRawYield->SetNameTitle("hNormalizedRawYield", "Raw yield;p_{T} (GeV/c);#frac{1}{N_{ev}} #frac{d^{2}N}{dy dp_{T}}");
  TOFpid_normalize(hNormalizedRawYield, nevents);
  /* compute normalized mismatch-corrected raw yield */
  TH1D *hNormalizedMismatchCorrectedRawYield = new TH1D(*hMismatchCorrectedSignalCounts);
  hNormalizedMismatchCorrectedRawYield->SetNameTitle("hNormalizedMismatchCorrectedRawYield", "Mismatch-corrected raw yield;p_{T} (GeV/c);#frac{1}{N_{ev}} #frac{d^{2}N}{dy dp_{T}}");
  TOFpid_normalize(hNormalizedMismatchCorrectedRawYield, nevents);

  /*** OUTPUT ***/

  /* write fir params histos */
  fitDir->cd();
  for (Int_t iparam = 0; iparam < kNFitParams; iparam++)
    hFitParamHisto[iparam]->Write();
  /* write post-analysis histos */
  postDir->cd();
  hOverflowCounts->Write();
  hTotalMismatchCounts->Write();
  hTotalMismatchFraction->Write();
  hIdentifiedCounts->Write();
  hSignalFraction->Write();
  hSignalFractionReworked->Write();
  hBkg1Fraction->Write();
  hBkg2Fraction->Write();
  hBkg3Fraction->Write();
  hBkg4Fraction->Write();
  hMismatchCorrectionCounts->Write();
  hMismatchCorrectedSignalCounts->Write();
  if (hAcceptedTracks) hAcceptedTracks_py->Write();
  /* write raw spectra histos */
  rawDir->cd();
  hNormalizedRawYield->Write();
  hNormalizedMismatchCorrectedRawYield->Write();

  /* clean up */
  delete canvas;
  for (Int_t iparam = 0; iparam < kNFitParams; iparam++)
    delete hFitParamHisto[iparam];
  delete hOverflowCounts;
  delete hTotalMismatchCounts;
  delete hTotalMismatchFraction;
  delete hIdentifiedCounts;
  delete hSignalFraction;
  delete hBkg1Fraction;
  delete hBkg2Fraction;
  delete hBkg3Fraction;
  delete hBkg4Fraction;
  delete hMismatchCorrectionCounts;
  delete hMismatchCorrectedSignalCounts;
  if (hAcceptedTracks) {
    delete hAcceptedTracks_py;
  }
  delete hNormalizedRawYield;
  delete hNormalizedMismatchCorrectedRawYield;

  /* close file */
  fileout->Close();
}

//___________________________________________________________________________________

Float_t 
TOFpid_histomin(TH1 *h)
{

  for (Int_t ibin = 0; ibin < h->GetNbinsX(); ibin++)
    if (h->GetBinContent(ibin + 1) > 0.)
      return h->GetXaxis()->GetBinCenter(ibin + 1);
  return kMaxInt;
}

//___________________________________________________________________________________

Float_t 
TOFpid_histomax(TH1 *h)
{

  for (Int_t ibin = h->GetNbinsX(); ibin > 0; ibin--)
    if (h->GetBinContent(ibin) > 0.)
      return h->GetXaxis()->GetBinCenter(ibin);
  return -kMaxInt;
}

//___________________________________________________________________________________

TOFpid_checkneg(TH1 *h)
{

  for (Int_t ibin = 0; ibin < h->GetNbinsX(); ibin++)
    if (h->GetBinContent(ibin + 1) <= 0.) {
      h->SetBinContent(ibin + 1, 1.e-300);
      //      h->SetBinError(ibin + 1, 0.1);
    }
}

//___________________________________________________________________________________

Double_t
TOFpid_fit(TH1 *hSignal, TH1 *hSigExp, TH1 *hBkgExp1, TH1 *hBkgExp2, TH1 *hBkgExp3, TH1 *hBkgExp4, TH1 *hMismatch, Double_t rangeMin, Double_t rangeMax, Bool_t fitBkg1, Bool_t fitBkg2, Bool_t fitBkg3, Bool_t fitBkg4, Bool_t constrainSignal, Bool_t constrainBkg1, Bool_t constrainBkg2, Bool_t forceGaussianSignal, Double_t *param = NULL, Double_t *param_err = NULL, TCanvas *canvas = NULL)
{

  /** ROOFIT ***/
  gSystem->Load("libRooFit");
  using namespace RooFit;
 /*** LOAD GAUSSIANTAIL CLASS ***/
  gSystem->Load("RooFermiCutoff_cxx.so");
  gSystem->Load("RooGaussianTail_cxx.so");

  /*** DEFINE FIT RANGE ***/

  printf("***** FIT RANGE DEFINITION *****\n");

  /* check mismatch histogram to define min/max fit range */
  //  rangeMin = TMath::Max(rangeMin, TOFpid_histomin(hMismatch));
  //  rangeMax = TMath::Min(rangeMax, TOFpid_histomax(hMismatch));
  /* fix zeroes */
  TOFpid_checkneg(hMismatch);
  
  /* define range */
  RooRealVar x("x", "n_{#sigma}", 0., rangeMin, rangeMax, "");
  printf("FIT RANGE DEFINED: %f -> %f\n", rangeMin, rangeMax);
  printf("********************************\n");

  /*** DEFINE HISTOGRAM DATA ***/
  
  /* define data to fit and background from input histogram */
  RooDataHist hdata("hdata", "hdata", x, hSignal);
  RooDataHist hsig("hsig", "hsig", x, hSigExp);
  RooDataHist hbkg1("hbkg1", "hbkg1", x, hBkgExp1);
  RooDataHist hbkg2("hbkg2", "hbkg2", x, hBkgExp2);
  RooDataHist hbkg3("hbkg3", "hbkg3", x, hBkgExp3);
  RooDataHist hbkg4("hbkg4", "hbkg4", x, hBkgExp4);
  RooDataHist hmismatch("hmismatch", "hmismatch", x, hMismatch);

  /*** DEFINE SIGNAL SHAPE ***/

  printf("***** SIGNAL SHAPE DEFINITION *****\n");

  /* variables */
  if (FIX_SIGNAL_MEAN) {
    RooRealVar mean("mean", "mean", DEFAULT_SIGNAL_MEAN, "");
    printf("FIXED SIGNAL_MEAN = %f\n", mean.getVal());
  }
  else {
    RooRealVar mean("mean", "mean", DEFAULT_SIGNAL_MEAN, MIN_SIGNAL_MEAN, MAX_SIGNAL_MEAN, "");
    printf("FREE SIGNAL_MEAN = %f [%f, %f]\n", mean.getVal(), MIN_SIGNAL_MEAN, MAX_SIGNAL_MEAN);
  }
  if (FIX_SIGNAL_SIGMA) {
    RooRealVar sigma("sigma", "sigma", DEFAULT_SIGNAL_SIGMA, "");
    printf("FIXED SIGNAL_SIGMA = %f\n", sigma.getVal());
  }
  else {
    RooRealVar sigma("sigma", "sigma", DEFAULT_SIGNAL_SIGMA, MIN_SIGNAL_SIGMA, MAX_SIGNAL_SIGMA, "");
    printf("FREE SIGNAL_SIGMA = %f\n", sigma.getVal());
  }
  if (FIX_SIGNAL_TAIL) {
    RooRealVar tail("tail", "tail", DEFAULT_SIGNAL_TAIL, "");
    printf("FIXED SIGNAL_TAIL = %f\n", tail.getVal());
  }
  else {
    RooRealVar tail("tail", "tail", DEFAULT_SIGNAL_TAIL, MIN_SIGNAL_TAIL, MAX_SIGNAL_TAIL, "");
    printf("FREE SIGNAL_TAIL = %f\n", tail.getVal());
  }
  RooRealVar gaussianfrac("gaussianfrac", "gaussianfrac", 1., 0., 1., "");
  RooRealVar sigalpha("sigalpha", "sigalpha", 0., -10., 0.);
  
  /* shapes */
  if (GAUSSIAN_SIGNAL || forceGaussianSignal) {
    printf("USING GAUSSIAN_SIGNAL SHAPE\n");
    RooGaussian signal("signal", "signal", x, mean, sigma);
  }
  else if (GAUSSIANTAIL_SIGNAL) {
    printf("USING GAUSSIANTAIL_SIGNAL SHAPE\n");
    RooGaussianTail signal("signal", "signal", x, mean, sigma, tail);
  }
  else if (GAUSSIANTAIL2_SIGNAL) {
    printf("USING GAUSSIANTAIL2_SIGNAL SHAPE\n");
    RooGaussianTail signal("signal", "signal", x, mean, sigma, sigma);
  }
  else if (GAUSSIANPLUSGAUSSIANTAIL_SIGNAL) {
    printf("USING GAUSSIANPLUSGAUSSIANTAIL_SIGNAL SHAPE\n");
    RooGaussian gaussian("gaussian", "gaussian", x, mean, sigma);
    RooGaussianTail gaussiantail("gaussiantail", "gaussiantail", x, mean, sigma, tail);
    RooAddPdf signal("signal", "signal", RooArgList(gaussian, gaussiantail), gaussianfrac, kTRUE);

  }
  else if (GAUSSIANPLUSEXPONENTIAL_SIGNAL) {
    printf("USING GAUSSIANPLUSEXPONENTIAL_SIGNAL SHAPE\n");
    RooGaussian gaussian("gaussian", "gaussian", x, mean, sigma);
    RooExponential sigexpo("sigexpo", "sigexpo", x, sigalpha);
    RooRealVar sigcutoff("sigcutoff", "sigcutoff", 0.);
    RooRealVar sigpower("sigpower", "sigpower", 0.1);
    RooFermiCutoff sigfermi("sigfermi", "sigfermi", x, sigcutoff, sigpower);
    RooProdPdf exposignal("exposignal", "exposignal", sigfermi, sigexpo, -100.);
    RooRealVar gaussianfrac("gaussianfrac", "gaussianfrac", 0.9, 0.7, 1., "");
    RooAddPdf signal("signal", "signal", RooArgList(gaussian, exposignal), gaussianfrac, kTRUE);
  }
  else if (EXPECTED_SIGNAL_TEMPLATE) {
    printf("SHAPE OF SIGNAL FROM TEMPLATE HISTOGRAM\n");
    RooHistPdf signal("signal", "signal", x, hsig);
  }
  else if (EXPECTED_SIGNAL_FIT) {
    /* fitting bkg1 */
    TF1 *fGaus = (TF1 *)gROOT->GetFunction("gaus");
    hSigExp->Fit(fGaus, "0q");
    Double_t sig_mean = fGaus->GetParameter(1);
    Double_t sig_sigma = fGaus->GetParameter(2);
    mean.setConstant(kFALSE);
    mean.setVal(sig_mean);
    mean.setRange(sig_mean - 10., sig_mean + 10.);
    mean.setConstant(kFALSE);
    sigma.setConstant(kFALSE);
    sigma.setVal(sig_sigma);
    sigma.setRange(sig_sigma * 0.5, sig_sigma * 1.5);
    tail.setConstant(kFALSE);
    tail.setVal(1.);
    tail.setRange(0.5, 5.);
    RooGaussianTail signal("signal", "signal", x, mean, sigma, tail);
    signal.fitTo(hsig, Range(sig_mean - 5. * sig_sigma, sig_mean + 10. * sig_sigma), SumW2Error(kFALSE), Verbose(kFALSE), PrintEvalErrors(10));
#if DISPLAY
    TCanvas *cSig_fit = new TCanvas("cSig_fit");
    RooPlot *sig_frame = x.frame();
    hsig.plotOn(sig_frame);
    signal.plotOn(sig_frame, LineColor(kRed));
    sig_frame->Draw();
    cSig_fit->Update();
#endif
    printf("SIGNAL PARAMETERS AFTER FIT OF EXPECTED SIGNAL\n");
    printf("mean  = %f +- %f\n", mean.getVal(), mean.getError());
    printf("sigma = %f +- %f\n", sigma.getVal(), sigma.getError());
    printf("tail  = %f +- %f\n", tail.getVal(), tail.getError());
    /* scale parameters if requested */
    if (SCALE_SIGNAL_SIGMA != 1.) {
      printf("SCALE FITTED SIGNAL SIGMA BY %f\n", SCALE_SIGNAL_SIGMA);
      sigma.setVal(sigma.getVal() * SCALE_SIGNAL_SIGMA);
    }
    if (SCALE_SIGNAL_TAIL != 1.) {
      printf("SCALE FITTED SIGNAL TAIL BY %f\n", SCALE_SIGNAL_TAIL);
      tail.setVal(tail.getVal() * SCALE_SIGNAL_TAIL);
    }
    /* fix/release parameters if requested */
    if (FIX_SIGNAL_MEAN) {
      printf("SETTING FITTED SIGNAL MEAN AS CONSTANTS\n");
      mean.setConstant(kTRUE);
    }
    else {
      printf("SETTING FITTED SIGNAL MEAN AS FREE\n");
      //      mean.setRange(mean.getVal() - 0.25 * TMath::Abs(mean.getVal()), mean.getVal() + 0.25 * TMath::Abs(mean.getVal()));
      //      mean.setRange(mean.getVal() - 0.5 * TMath::Abs(mean.getVal()), mean.getVal() + 0.5 * TMath::Abs(mean.getVal()));
      mean.setRange(mean.getVal() - 0.2, mean.getVal() + 0.2);
    }
    if (FIX_SIGNAL_SIGMA) {
      printf("SETTING FITTED SIGNAL SIGMA AS CONSTANTS\n");
      sigma.setConstant(kTRUE);
    }
    else {
      printf("SETTING FITTED SIGNAL SIGMA AS FREE\n");
      sigma.setRange(sigma.getVal() * 0.8, sigma.getVal() * 1.2);
      //      sigma.setRange(sigma.getVal() - 0.5, sigma.getVal() + 0.5);
    }
    if (FIX_SIGNAL_TAIL) {
      printf("SETTING FITTED SIGNAL TAIL AS CONSTANTS\n");
      tail.setConstant(kTRUE);
    }
    else {
      printf("SETTING FITTED SIGNAL TAIL AS FREE\n");
      //      tail.setRange(0.5, 5.0);
      tail.setRange(tail.getVal() * 0.8, tail.getVal() * 1.2);
      //      tail.setRange(tail.getVal() - 0.5, tail.getVal() + 0.5);
    }
  }
  else {
    printf("SHAPE OF SIGNAL NOT DEFINE: using GAUSSIAN_SIGNAL\n");
    RooGaussian signal("signal", "signal", x, mean, sigma);
  }


#if 0
  if (constrainSignal) {
#if 0
  /* fix expected signal and constrain parameters if requested */
  signal.fitTo(hsig);
#if 0
  TCanvas *cConstrainSignal = new TCanvas("cConstrainSignal");
  RooPlot *xfr = x.frame();
  hsig.plotOn(xfr);
  signal.plotOn(xfr, LineColor(kRed));
  xfr->Draw();
  cConstrainSignal->Update();
#endif
  printf("SIGNAL PARAMETERS AFTER FIT OF EXPECTED SIGNAL\n");
  printf("mean  = %f +- %f\n", mean.getVal(), mean.getError());
  printf("sigma = %f +- %f\n", sigma.getVal(), sigma.getError());
  printf("tail  = %f +- %f\n", tail.getVal(), tail.getError());
  if (constrainSignal) {
    mean.setConstant(kTRUE);
    sigma.setConstant(kTRUE);
    tail.setConstant(kTRUE);
  printf("SIGNAL PARAMETERS CONSTRAINED AFTER FIT OF EXPECTED SIGNAL\n");
  }
#endif
  }
#endif

  if (constrainSignal) {
    mean.setConstant(kTRUE);
    sigma.setConstant(kTRUE);
    tail.setConstant(kTRUE);
    //    mean.setRange(-0.1, 0.1);
    //    sigma.setRange(0.95, 1.05);
    //    tail.setRange(0.95, 1.25);
  }

  printf("***********************************\n");

  /*** DEFINE IDENTIFIED BACKGROUND SHAPES ***/

  printf("***** IDENTIFIED BACKGROUND SHAPE DEFINITION *****\n");

  /* shapes */
if (EXPECTED_BACKGROUND_TEMPLATE) {
  printf("USING EXPECTED BACKGROUND TEMPLATE SHAPES FROM HISTOGRAMS\n");
    RooHistPdf bkg1("bkg1", "bkg1", x, hbkg1, 0);
    RooHistPdf bkg2("bkg2", "bkg2", x, hbkg2, 0);
      RooHistPdf bkg3("bkg3", "bkg3", x, hbkg3, 0);
      RooHistPdf bkg4("bkg4", "bkg4", x, hbkg4, 0);
  }
 else if (EXPECTED_BACKGROUND_FIT) {
    printf("USING EXPECTED BACKGROUND FITTED SHAPES FROM HISTOGRAMS\n");
    /* fitting bkg1 */
    TF1 *fGaus = (TF1 *)gROOT->GetFunction("gaus");
    hBkgExp1->Fit(fGaus, "0q");
    Double_t bkgexp1_mean = fGaus->GetParameter(1);
    Double_t bkgexp1_sigma = fGaus->GetParameter(2);
    RooRealVar mean_bkg1("mean_bkg1", "mean_bkg1", bkgexp1_mean, bkgexp1_mean - 10., bkgexp1_mean + 10., "");
    RooRealVar sigma_bkg1("sigma_bkg1", "sigma_bkg1", bkgexp1_sigma, bkgexp1_sigma * 0.5, bkgexp1_sigma * 1.5, "");
    RooRealVar tail_bkg1("tail_bkg1", "tail_bkg1", 1.0, 0.5, 5., "");
    RooGaussianTail bkg1("bkg1", "bkg1", x, mean_bkg1, sigma_bkg1, tail_bkg1);
    bkg1.fitTo(hbkg1, Range(bkgexp1_mean - 5. * bkgexp1_sigma, bkgexp1_mean + 10. * bkgexp1_sigma), SumW2Error(kFALSE), Verbose(kFALSE), PrintEvalErrors(10));
#if DISPLAY
    TCanvas *cBkg1_fit = new TCanvas("cBkg1_fit");
    RooPlot *bkg1_frame = x.frame();
    hbkg1.plotOn(bkg1_frame);
    bkg1.plotOn(bkg1_frame, LineColor(kCyan+1));
    bkg1_frame->Draw();
    cBkg1_fit->Update();
#endif
    printf("BACKGROUND-1 PARAMETERS AFTER FIT OF EXPECTED BACKGROUND-1\n");
    printf("mean_bkg1  = %f +- %f\n", mean_bkg1.getVal(), mean_bkg1.getError());
    printf("sigma_bkg1 = %f +- %f\n", sigma_bkg1.getVal(), sigma_bkg1.getError());
    printf("tail_bkg1  = %f +- %f\n", tail_bkg1.getVal(), tail_bkg1.getError());
    /* scale parameters if requested */
    if (SCALE_BACKGROUND_SIGMA != 1.) {
      printf("SCALE FITTED BACKGROUND-1 SIGMA BY %f\n", SCALE_BACKGROUND_SIGMA);
      sigma_bkg1.setVal(sigma_bkg1.getVal() * SCALE_BACKGROUND_SIGMA);
    }
    if (SCALE_BACKGROUND_TAIL != 1.) {
      printf("SCALE FITTED BACKGROUND-1 TAIL BY %f\n", SCALE_BACKGROUND_TAIL);
      tail_bkg1.setVal(tail_bkg1.getVal() * SCALE_BACKGROUND_TAIL);
    }
    /* fix/release parameters if requested */
    if (FIX_BACKGROUND_MEAN) {
      printf("SETTING BACKGROUND-1 FITTED MEAN AS CONSTANTS\n");
      mean_bkg1.setConstant(kTRUE);
    }
    else {
      printf("SETTING BACKGROUND-1 FITTED MEAN AS FREE\n");
      mean_bkg1.setRange(mean_bkg1.getVal() - 0.25 * TMath::Abs(mean_bkg1.getVal()), mean_bkg1.getVal() + 0.25 * TMath::Abs(mean_bkg1.getVal()));
    }
    if (FIX_BACKGROUND_SIGMA) {
      printf("SETTING BACKGROUND-1 FITTED SIGMA AS CONSTANTS\n");
      sigma_bkg1.setConstant(kTRUE);
    }
    else {
      printf("SETTING BACKGROUND-1 FITTED SIGMA AS FREE\n");
      sigma_bkg1.setRange(sigma_bkg1.getVal() * 0.75, sigma_bkg1.getVal() * 1.25);
    }
    if (FIX_BACKGROUND_TAIL) {
      printf("SETTING BACKGROUND-1 FITTED TAIL AS CONSTANTS\n");
      tail_bkg1.setConstant(kTRUE);
    }
    else {
      printf("SETTING BACKGROUND-1 FITTED TAIL AS FREE\n");
      tail_bkg1.setRange(tail_bkg1.getVal() * 0.75, tail_bkg1.getVal() * 1.25);
    }
    /* fitting bkg2 */
    TF1 *fGaus = (TF1 *)gROOT->GetFunction("gaus");
    hBkgExp2->Fit(fGaus, "0q");
    Double_t bkgexp2_mean = fGaus->GetParameter(1);
    Double_t bkgexp2_sigma = fGaus->GetParameter(2);
    RooRealVar mean_bkg2("mean_bkg2", "mean_bkg2", bkgexp2_mean, bkgexp2_mean - 10., bkgexp2_mean + 10., "");
    RooRealVar sigma_bkg2("sigma_bkg2", "sigma_bkg2", bkgexp2_sigma, bkgexp2_sigma * 0.5, bkgexp2_sigma * 1.5, "");
    RooRealVar tail_bkg2("tail_bkg2", "tail_bkg2", 1.0, 0.5, 5., "");
    RooGaussianTail bkg2("bkg2", "bkg2", x, mean_bkg2, sigma_bkg2, tail_bkg2);
    bkg2.fitTo(hbkg2, Range(bkgexp2_mean - 5. * bkgexp2_sigma, bkgexp2_mean + 10. * bkgexp2_sigma), SumW2Error(kFALSE), Verbose(kFALSE), PrintEvalErrors(10));
#if DISPLAY
    TCanvas *cBkg2_fit = new TCanvas("cBkg2_fit");
    RooPlot *bkg2_frame = x.frame();
    hbkg2.plotOn(bkg2_frame);
    bkg2.plotOn(bkg2_frame,  LineColor(kGreen+1));
    bkg2_frame->Draw();
    cBkg2_fit->Update();
#endif
    printf("BACKGROUND-2 PARAMETERS AFTER FIT OF EXPECTED BACKGROUND-2\n");
    printf("mean_bkg2  = %f +- %f\n", mean_bkg2.getVal(), mean_bkg2.getError());
    printf("sigma_bkg2 = %f +- %f\n", sigma_bkg2.getVal(), sigma_bkg2.getError());
    printf("tail_bkg2  = %f +- %f\n", tail_bkg2.getVal(), tail_bkg2.getError());
    /* scale parameters if requested */
    if (SCALE_BACKGROUND_SIGMA != 1.) {
      printf("SCALE FITTED BACKGROUND-2 SIGMA BY %f\n", SCALE_BACKGROUND_SIGMA);
      sigma_bkg2.setVal(sigma_bkg2.getVal() * SCALE_BACKGROUND_SIGMA);
    }
    if (SCALE_BACKGROUND_TAIL != 1.) {
      printf("SCALE FITTED BACKGROUND-2 TAIL BY %f\n", SCALE_BACKGROUND_TAIL);
      tail_bkg2.setVal(tail_bkg2.getVal() * SCALE_BACKGROUND_TAIL);
    }
    /* fix/release parameters if requested */
    if (FIX_BACKGROUND_MEAN) {
      printf("SETTING BACKGROUND-2 FITTED MEAN AS CONSTANTS\n");
      mean_bkg2.setConstant(kTRUE);
    }
    else {
      printf("SETTING BACKGROUND-2 FITTED MEAN AS FREE\n");
      mean_bkg2.setRange(mean_bkg2.getVal() - 0.25 * TMath::Abs(mean_bkg2.getVal()), mean_bkg2.getVal() + 0.25 * TMath::Abs(mean_bkg2.getVal()));
    }
    if (FIX_BACKGROUND_SIGMA) {
      printf("SETTING BACKGROUND-2 FITTED SIGMA AS CONSTANTS\n");
      sigma_bkg2.setConstant(kTRUE);
    }
    else {
      printf("SETTING BACKGROUND-2 FITTED SIGMA AS FREE\n");
      sigma_bkg2.setRange(sigma_bkg2.getVal() * 0.75, sigma_bkg2.getVal() * 1.25);
    }
    if (FIX_BACKGROUND_TAIL) {
      printf("SETTING BACKGROUND-2 FITTED TAIL AS CONSTANTS\n");
      tail_bkg2.setConstant(kTRUE);
    }
    else {
      printf("SETTING BACKGROUND-2 FITTED TAIL AS FREE\n");
      tail_bkg2.setRange(tail_bkg2.getVal() * 0.75, tail_bkg2.getVal() * 1.25);
    }
    /* fitting bkg3 */
    TF1 *fGaus = (TF1 *)gROOT->GetFunction("gaus");
    hBkgExp3->Fit(fGaus, "0q");
    Double_t bkgexp3_mean = fGaus->GetParameter(1);
    Double_t bkgexp3_sigma = fGaus->GetParameter(2);
    RooRealVar mean_bkg3("mean_bkg3", "mean_bkg3", bkgexp3_mean, bkgexp3_mean - 10., bkgexp3_mean + 10., "");
    RooRealVar sigma_bkg3("sigma_bkg3", "sigma_bkg3", bkgexp3_sigma, bkgexp3_sigma * 0.5, bkgexp3_sigma * 1.5, "");
    RooRealVar tail_bkg3("tail_bkg3", "tail_bkg3", 1., 0.5, 5., "");
    RooGaussianTail bkg3("bkg3", "bkg3", x, mean_bkg3, sigma_bkg3, tail_bkg3);
    bkg3.fitTo(hbkg3, Range(bkgexp3_mean - 5. * bkgexp3_sigma, bkgexp3_mean + 10. * bkgexp3_sigma), SumW2Error(kFALSE), Verbose(kFALSE), PrintEvalErrors(10));
#if DISPLAY
    TCanvas *cBkg3_fit = new TCanvas("cBkg3_fit");
    RooPlot *bkg3_frame = x.frame();
    hbkg3.plotOn(bkg3_frame);
    bkg3.plotOn(bkg3_frame,  LineColor(kYellow+1));
    bkg3_frame->Draw();
    cBkg3_fit->Update();
#endif
    printf("BACKGROUND-3 PARAMETERS AFTER FIT OF EXPECTED BACKGROUND-3\n");
    printf("mean_bkg3  = %f +- %f\n", mean_bkg3.getVal(), mean_bkg3.getError());
    printf("sigma_bkg3 = %f +- %f\n", sigma_bkg3.getVal(), sigma_bkg3.getError());
    printf("tail_bkg3  = %f +- %f\n", tail_bkg3.getVal(), tail_bkg3.getError());
    /* scale parameters if requested */
    if (SCALE_BACKGROUND_SIGMA != 1.) {
      printf("SCALE FITTED BACKGROUND-3 SIGMA BY %f\n", SCALE_BACKGROUND_SIGMA);
      sigma_bkg3.setVal(sigma_bkg3.getVal() * SCALE_BACKGROUND_SIGMA);
    }
    if (SCALE_BACKGROUND_TAIL != 1.) {
      printf("SCALE FITTED BACKGROUND-3 TAIL BY %f\n", SCALE_BACKGROUND_TAIL);
      tail_bkg3.setVal(tail_bkg3.getVal() * SCALE_BACKGROUND_TAIL);
    }
    /* fix/release parameters if requested */
    if (FIX_BACKGROUND_MEAN) {
      printf("SETTING BACKGROUND-3 FITTED MEAN AS CONSTANTS\n");
      mean_bkg3.setConstant(kTRUE);
    }
    else {
      printf("SETTING BACKGROUND-3 FITTED MEAN AS FREE\n");
      mean_bkg3.setRange(mean_bkg3.getVal() - 0.25 * TMath::Abs(mean_bkg3.getVal()), mean_bkg3.getVal() + 0.25 * TMath::Abs(mean_bkg3.getVal()));
    }
    if (FIX_BACKGROUND_SIGMA) {
      printf("SETTING BACKGROUND-3 FITTED SIGMA AS CONSTANTS\n");
      sigma_bkg3.setConstant(kTRUE);
    }
    else {
      printf("SETTING BACKGROUND-3 FITTED SIGMA AS FREE\n");
      sigma_bkg3.setRange(sigma_bkg3.getVal() * 0.75, sigma_bkg3.getVal() * 1.25);
    }
    if (FIX_BACKGROUND_TAIL) {
      printf("SETTING BACKGROUND-3 FITTED TAIL AS CONSTANTS\n");
      tail_bkg3.setConstant(kTRUE);
    }
    else {
      printf("SETTING BACKGROUND-3 FITTED TAIL AS FREE\n");
      tail_bkg3.setRange(tail_bkg3.getVal() * 0.75, tail_bkg3.getVal() * 1.25);
    }
    /* fitting bkg4 */
    TF1 *fGaus = (TF1 *)gROOT->GetFunction("gaus");
    hBkgExp4->Fit(fGaus, "0q");
    Double_t bkgexp4_mean = fGaus->GetParameter(1);
    Double_t bkgexp4_sigma = fGaus->GetParameter(2);
    RooRealVar mean_bkg4("mean_bkg4", "mean_bkg4", bkgexp4_mean, bkgexp4_mean - 10., bkgexp4_mean + 10., "");
    RooRealVar sigma_bkg4("sigma_bkg4", "sigma_bkg4", bkgexp4_sigma, bkgexp4_sigma * 0.5, bkgexp4_sigma * 1.5, "");
    RooRealVar tail_bkg4("tail_bkg4", "tail_bkg4", 1., 0.5, 5., "");
    RooGaussianTail bkg4("bkg4", "bkg4", x, mean_bkg4, sigma_bkg4, tail_bkg4);
    bkg4.fitTo(hbkg4, Range(bkgexp4_mean - 5. * bkgexp4_sigma, bkgexp4_mean + 10. * bkgexp4_sigma), SumW2Error(kFALSE), Verbose(kFALSE), PrintEvalErrors(10));
#if DISPLAY
    TCanvas *cBkg4_fit = new TCanvas("cBkg4_fit");
    RooPlot *bkg4_frame = x.frame();
    hbkg4.plotOn(bkg4_frame);
    bkg4.plotOn(bkg4_frame,  LineColor(kYellow+2));
    bkg4_frame->Draw();
    cBkg4_fit->Update();
#endif
    printf("BACKGROUND-4 PARAMETERS AFTER FIT OF EXPECTED BACKGROUND-4\n");
    printf("mean_bkg4  = %f +- %f\n", mean_bkg4.getVal(), mean_bkg4.getError());
    printf("sigma_bkg4 = %f +- %f\n", sigma_bkg4.getVal(), sigma_bkg4.getError());
    printf("tail_bkg4  = %f +- %f\n", tail_bkg4.getVal(), tail_bkg4.getError());
    /* scale parameters if requested */
    if (SCALE_BACKGROUND_SIGMA != 1.) {
      printf("SCALE FITTED BACKGROUND-4 SIGMA BY %f\n", SCALE_BACKGROUND_SIGMA);
      sigma_bkg4.setVal(sigma_bkg4.getVal() * SCALE_BACKGROUND_SIGMA);
    }
    if (SCALE_BACKGROUND_TAIL != 1.) {
      printf("SCALE FITTED BACKGROUND-4 TAIL BY %f\n", SCALE_BACKGROUND_TAIL);
      tail_bkg4.setVal(tail_bkg4.getVal() * SCALE_BACKGROUND_TAIL);
    }
    /* fix/release parameters if requested */
    if (FIX_BACKGROUND_MEAN) {
      printf("SETTING BACKGROUND-4 FITTED MEAN AS CONSTANTS\n");
      mean_bkg4.setConstant(kTRUE);
    }
    else {
      printf("SETTING BACKGROUND-4 FITTED MEAN AS FREE\n");
      mean_bkg4.setRange(mean_bkg4.getVal() - 0.25 * TMath::Abs(mean_bkg4.getVal()), mean_bkg4.getVal() + 0.25 * TMath::Abs(mean_bkg4.getVal()));
    }
    if (FIX_BACKGROUND_SIGMA) {
      printf("SETTING BACKGROUND-4 FITTED SIGMA AS CONSTANTS\n");
      sigma_bkg4.setConstant(kTRUE);
    }
    else {
      printf("SETTING BACKGROUND-4 FITTED SIGMA AS FREE\n");
      sigma_bkg4.setRange(sigma_bkg4.getVal() * 0.75, sigma_bkg4.getVal() * 1.25);
    }
    if (FIX_BACKGROUND_TAIL) {
      printf("SETTING BACKGROUND-4 FITTED TAIL AS CONSTANTS\n");
      tail_bkg4.setConstant(kTRUE);
    }
    else {
      printf("SETTING BACKGROUND-4 FITTED TAIL AS FREE\n");
      tail_bkg4.setRange(tail_bkg4.getVal() * 0.75, tail_bkg4.getVal() * 1.25);
    }
  }
  else if (GAUSSIAN_BACKGROUND) {
    printf("USING GAUSSIAN BACKGROUND SHAPES (not reccomended)\n"); 
    RooRealVar mean1("mean1", "mean1", hBkgExp1->GetMean(), hBkgExp1->GetMean() * 0.95, hBkgExp1->GetMean() * 1.05, "");
    RooRealVar sigma1("sigma1", "sigma1", hBkgExp1->GetRMS(), hBkgExp1->GetRMS() * 0.5, hBkgExp1->GetRMS() * 1.5, "");
    RooGaussian bkg1("bkg1", "bkg1", x, mean1, sigma1);
    
    RooRealVar mean2("mean2", "mean2", hBkgExp2->GetMean(), hBkgExp2->GetMean() * 0.95, hBkgExp2->GetMean() * 1.05, "");
    RooRealVar sigma2("sigma2", "sigma2", hBkgExp2->GetRMS(), hBkgExp2->GetRMS() * 0.5, hBkgExp2->GetRMS() * 1.5, "");
    RooGaussian bkg2("bkg2", "bkg2", x, mean2, sigma2);

    RooRealVar mean3("mean3", "mean3", hBkgExp3->GetMean(), hBkgExp3->GetMean() * 0.95, hBkgExp3->GetMean() * 1.05, "");
    RooRealVar sigma3("sigma3", "sigma3", hBkgExp3->GetRMS(), hBkgExp3->GetRMS() * 0.5, hBkgExp3->GetRMS() * 1.5, "");
    RooGaussian bkg3("bkg3", "bkg3", x, mean3, sigma3);
  }
  else {
    printf("SHAPE OF BACKGROUND NOT DEFINE: using EXPECTED_BACKGROUND\n");
    RooHistPdf bkg1("bkg1", "bkg1", x, hbkg1, 0);
    RooHistPdf bkg2("bkg2", "bkg2", x, hbkg2, 0);
    RooHistPdf bkg3("bkg3", "bkg3", x, hbkg3, 0);
    RooHistPdf bkg4("bkg4", "bkg4", x, hbkg4, 0);
  }
  printf("**************************************************\n");

  /*** DEFINE MISMATCH BACKGROUND SHAPE ***/

  printf("***** MISMATCH BACKGROUND SHAPE DEFINITION *****\n");
  
  /* variables and generic shapes */
  Double_t expectedCutoff = hBkgExp3->GetMean();
  Double_t expectedCutoffRMS = hBkgExp3->GetRMS();
  //    RooRealVar cutoff("cutoff", "cutoff", -30., -50., 0., "");
  RooRealVar cutoff("cutoff", "cutoff", expectedCutoff, expectedCutoff - 3. * expectedCutoffRMS, expectedCutoff, "");
  //  RooRealVar cutoff("cutoff", "cutoff", expectedCutoff, "");
  //  RooRealVar power("power", "power", 1., 0.5, 5.0, "");
  RooRealVar power("power", "power", 1., "");
  RooFermiCutoff fermi("fermi", "fermi", x, cutoff, power);
  RooRealVar alpha("alpha", "alpha", 0., -10., 0., "");
  RooExponential expo("expo", "expo", x, alpha);
  RooUniform uniform("uniform", "uniform", x);

  /* mismatch shape */
  if (EXPECTED_MISMATCH) {
    printf("USING EXPECTED MISMATCH SHAPE FROM HISTOGRAMS\n");
    RooHistPdf mismatch("mismatch", "mismatch", x, hmismatch, 0);
  }
  else if (UNIFORM_MISMATCH) {
    printf("USING UNIFORM BACKGROUND SHAPE WITH CUTOFF\n");
    RooProdPdf mismatch("mismatch", "mismatch", fermi, uniform, -100.);
  }
  else if (EXPONENTIAL_MISMATCH) {
    printf("USING EXPONENTIAL BACKGROUND SHAPE WITH CUTOFF\n");
    RooProdPdf mismatch("mismatch", "mismatch", fermi, expo, -100.);
  }
  else if (DOUBLEEXPONENTIAL_MISMATCH) {
    printf("USING DOUBLE-EXPONENTIAL BACKGROUND SHAPE WITH CUTOFF\n");
    RooRealVar alpha1("alpha1", "alpha1", 0., -10., 0., "");
    RooRealVar alpha2("alpha2", "alpha2", 0., -10., 0., "");
    RooRealVar frac("frac", "frac", 0.5, 0., 1., "");
    RooGenericPdf doubleexpo("doubleexpo", "TMath::Exp(alpha1 * x) + frac * TMath::Exp(alpha2 * x)", RooArgSet(x, alpha1, alpha2, frac));
    RooProdPdf mismatch("mismatch", "mismatch", fermi, doubleexpo, -100.);
  }
  else if (UNIFORMPLUSEXPONENTIAL_MISMATCH) {
    printf("USING UNIFORM-PLUS-EXPONENTIAL BACKGROUND SHAPE WITH CUTOFF\n");
    RooRealVar funiform("funiform", "funiform", 100., 0., 100000., "");
    RooRealVar fexpo("fexpo", "fexpo", 100., 0., 100000., "");
    RooAddPdf uniformplusexpo("uniformplusexpo", "uniformplusexpo", RooArgList(uniform, expo), RooArgList(funiform, fexpo), kFALSE);
    RooProdPdf mismatch("mismatch", "mismatch", fermi, uniformplusexpo, -100.);
  }
  else {
    printf("SHAPE OF MISMATCH NOT DEFINE: using EXPECTED_MISMATCH\n");
    RooHistPdf mismatch("mismatch", "mismatch", x, hmismatch, 0);
  }
  printf("************************************************\n");

  /*** DEFINE THE MODEL ***/

  printf("***** MODEL DEFINITION *****\n");

  /* variables */
  Double_t integral = hdata.sumEntries();
  RooRealVar nsignal("nsignal", "nsignal", 0.3 * integral, 0., integral);
  RooRealVar nbkg1("nbkg1", "nbkg1", 0.3 * integral, 0., integral);
  RooRealVar nbkg2("nbkg2", "nbkg2", 0.3 * integral, 0., integral);
  RooRealVar nbkg3("nbkg3", "nbkg3", 0.3 * integral, 0., integral);
  RooRealVar nbkg4("nbkg4", "nbkg4", 0.3 * integral, 0., integral);
  RooRealVar nmismatch("nmismatch", "nmismatch", 0.1 * integral, 0., integral);

if (!fitBkg1) {
  nbkg1.setVal(0.);
  nbkg1.setConstant(kTRUE);  
 }
if (!fitBkg2) {
  nbkg2.setVal(0.);
  nbkg2.setConstant(kTRUE);  
 }
if (!fitBkg3) {
  nbkg3.setVal(0.);
  nbkg3.setConstant(kTRUE);  
 }
if (!fitBkg4) {
  nbkg4.setVal(0.);
  nbkg4.setConstant(kTRUE);  
 }

  RooAddPdf model("model", "model p.d.f.", RooArgList(signal, bkg1, bkg2, bkg3, bkg4, mismatch), RooArgList(nsignal, nbkg1, nbkg2, nbkg3, nbkg4, nmismatch));

#if 0
  /* the model */
  if (USE_ELECTRON_BACKGROUND && fitElectrons && fitPions) {
    printf("USING ELECTRON BACKGROUND\n");
    if (NO_MISMATCH) {
      printf("NOT USING MISMATCH BACKGROUND\n");
      nmismatch.setVal(0.);
      RooAddPdf model("model", "model p.d.f.", RooArgList(signal, bkg1, bkg2, bkg3/*, bkg4*/), RooArgList(nsignal, nbkg1, nbkg2, nbkg3/*, nbkg4*/));
    }
    else {
      printf("USING MISMATCH BACKGROUND\n");
      RooAddPdf model("model", "model p.d.f.", RooArgList(signal, bkg1, bkg2, bkg3/*, bkg4*/, mismatch), RooArgList(nsignal, nbkg1, nbkg2, nbkg3/*, nbkg4*/, nmismatch));
    }
  }
  else if (!USE_ELECTRON_BACKGROUND || !fitElectrons) {
    printf("NOT USING ELECTRON BACKGROUND\n");
    nbkg3.setVal(0.);
    nbkg4.setVal(0.);
    if (NO_MISMATCH) {
      printf("NOT USING MISMATCH BACKGROUND\n");
      nmismatch.setVal(0.);
      RooAddPdf model("model", "model p.d.f.", RooArgList(signal, bkg1, bkg2), RooArgList(nsignal, nbkg1, nbkg2));
    }
    else {
      printf("USING MISMATCH BACKGROUND\n");
      RooAddPdf model("model", "model p.d.f.", RooArgList(signal, bkg1, bkg2, mismatch), RooArgList(nsignal, nbkg1, nbkg2, nmismatch));
    }
  }
  printf("****************************\n");
#endif




  /*** FIT ***/

  printf("***** FIT *****\n");

  printf("SIGNAL PARAMETERS BEFORE GLOBAL FIT\n");
  printf("mean  = %f +- %f\n", mean.getVal(), mean.getError());
  printf("sigma = %f +- %f\n", sigma.getVal(), sigma.getError());
  printf("tail  = %f +- %f\n", tail.getVal(), tail.getError());

  /* fit and draw */
  if (canvas) canvas->cd();
  //  model.chi2FitTo(hdata, Extended(kTRUE), Verbose(kFALSE), SumW2Error(kFALSE), Range(-40., 140.), Binned(kTRUE));
//  model.fitTo(hdata, Extended(kTRUE), SumW2Error(kFALSE), Verbose(kFALSE), PrintEvalErrors(10), Range(-10., 10.));
model.fitTo(hdata, Range(rangeMin, rangeMax), Extended(kTRUE), SumW2Error(kFALSE), Verbose(kFALSE), PrintEvalErrors(10));

  printf("***************\n");

  /*** DRAW ***/
#if DISPLAY
  RooPlot *xframe = x.frame();
hdata.plotOn(xframe, XErrorSize(0), DrawOption("PZ"));
 printf("plotting model...\n");
model.plotOn(xframe, LineWidth(2)/*, Precision(1.e-4)*/);
 printf("plotting signal...\n");
model.plotOn(xframe, Components(signal), LineWidth(2), LineColor(kRed)/*, Precision(1.e-4)*/);
 printf("plotting bkg1...\n");
  model.plotOn(xframe, Components(bkg1), LineWidth(2), LineStyle(kDashed), LineColor(kCyan+1));
 printf("plotting bkg2...\n");
  model.plotOn(xframe, Components(bkg2), LineWidth(2), LineStyle(kDashed), LineColor(kGreen+1));
  if (USE_ELECTRON_BACKGROUND) {
    model.plotOn(xframe, Components(bkg3), LineWidth(2), LineStyle(kDashed), LineColor(kYellow+1));
    model.plotOn(xframe, Components(bkg4), LineWidth(2), LineStyle(kDashed), LineColor(kYellow+2));
  }
  if (!NO_MISMATCH)
    model.plotOn(xframe, Components(mismatch), LineWidth(2), LineStyle(kDashed), LineColor(kGray+1));
  hSignal->SetFillColor(kYellow);
  hSignal->SetLineWidth(0);
  hSignal->SetFillStyle(0);
  hSignal->SetMinimum(0.1);
  hSignal->GetXaxis()->SetRangeUser(rangeMin, rangeMax);
//  hSignal->Draw();
xframe->SetMinimum(0.1);
  xframe->Draw();
#endif
  if (canvas) canvas->Update();

  /*** COMPUTE CHI2 ***/
  Double_t datax, datapoint, datapoint_err, modelpoint;
  Double_t chi2 = 0.;
  Int_t ndf = 0;
  for (Int_t ibin = 0; ibin < hSignal->GetNbinsX(); ibin++) {
    datax = hSignal->GetBinCenter(ibin + 1);
    if (datax < rangeMin || datax > rangeMax) continue;
    datapoint = hSignal->GetBinContent(ibin + 1);
    datapoint_err = hSignal->GetBinError(ibin + 1);
    if (datapoint_err == 0.) continue;
    x.setVal(datax);
    modelpoint = model.getVal();
    chi2 += (datapoint - modelpoint) * (datapoint - modelpoint) / (datapoint_err * datapoint_err);
    ndf++;
  }


/*** PRINT FIT OUTPUT ***/
printf("***** CHI-SQUARE *****\n");
  printf("chi-square = %f\n", chi2);
  printf("NDF        = %d\n", ndf);
  printf("chi2/NDF   = %f\n", ndf > 0 ? chi2 / ndf : 0.);
  printf("***** SIGNAL-SHAPE INFO *****\n");
  printf("mean      = %f +- %f\n", mean.getVal(), mean.getError());
  printf("sigma     = %f +- %f\n", sigma.getVal(), sigma.getError());
  printf("tail      = %f +- %f\n", tail.getVal(), tail.getError());
  printf("pure gaus = %f +- %f\n", gaussianfrac.getVal(), gaussianfrac.getError());
printf("*****************************\n");
printf("***** COUNTS *****\n");
printf("total     = %f\n", hSignal->Integral(-1, -1));
  printf("integral  = %f\n", hdata.sumEntries());
  printf("nsignal   = %f +- %f\n", nsignal.getVal(), nsignal.getError());
  printf("nbkg1     = %f +- %f\n", nbkg1.getVal(), nbkg1.getError());
  printf("nbkg2     = %f +- %f\n", nbkg2.getVal(), nbkg2.getError());
  printf("nbkg3     = %f +- %f\n", nbkg3.getVal(), nbkg3.getError());
  printf("nbkg4     = %f +- %f\n", nbkg4.getVal(), nbkg4.getError());
  printf("nmismatch = %f +- %f\n", nmismatch.getVal(), nmismatch.getError());
  printf("******************\n");

  /*** OUTPUT FIT PARAMS ***/
  
  param[kMean] = mean.getVal();
  param_err[kMean] = mean.getError();
  param[kSigma] = sigma.getVal();
  param_err[kSigma] = sigma.getError();
  param[kTail] = tail.getVal();
  param_err[kTail] = tail.getError();
  param[kTotalCounts] = hSignal->GetEntries();
  param_err[kTotalCounts] = sqrt(hSignal->GetEntries());
  param[kIntegralCounts] = hdata.sumEntries();
  param_err[kIntegralCounts] = sqrt(hdata.sumEntries());
  param[kSignalCounts] = nsignal.getVal();
  param_err[kSignalCounts] = nsignal.getError();
  param[kBkg1Counts] = nbkg1.getVal();
  param_err[kBkg1Counts] = nbkg1.getError();
  param[kBkg2Counts] = nbkg2.getVal();
  param_err[kBkg2Counts] = nbkg2.getError();
  param[kBkg3Counts] = nbkg3.getVal();
  param_err[kBkg3Counts] = nbkg3.getError();
  param[kBkg4Counts] = nbkg4.getVal();
  param_err[kBkg4Counts] = nbkg4.getError();
  param[kMismatchCounts] = nmismatch.getVal();
  param_err[kMismatchCounts] = nmismatch.getError();

  return;
}

//___________________________________________________________________________________

TOFpid_efficiency(Int_t ipart, Int_t icharge, Int_t icent, Int_t useTPCcut = -1, Double_t minsignalFrac = 0., Int_t nTrials = 1000)
{

  /* prepare centrality name */
  Char_t centName[1024];
  if (icent < 0 || icent >= NcentralityBins)
    sprintf(centName, "cent0090");
  else
    sprintf(centName, "cent%02d%02d", centralityBin[icent], centralityBin[icent + 1]);

  /* fraction names */
  const Char_t *fractionName[AliPID::kSPECIES][AliPID::kSPECIES] = {
    "hSignalFraction", "hBkg4Fraction", "hBkg3Fraction", "hBkg1Fraction", "hBkg2Fraction",
    "hBkg4Fraction", "hSignalFraction", "hBkg3Fraction", "hBkg1Fraction", "hBkg2Fraction",
    "hBkg3Fraction", "hBkg4Fraction", "hSignalFraction", "hBkg1Fraction", "hBkg2Fraction",
    "hBkg3Fraction", "hBkg4Fraction", "hBkg1Fraction", "hSignalFraction", "hBkg2Fraction",
    "hBkg3Fraction", "hBkg4Fraction", "hBkg1Fraction", "hBkg2Fraction", "hSignalFraction"
  };

  enum ETPCcut_t {
    kCurrentDir,
    k11Cut,
    k12Cut,
    k21Cut,
    k22Cut,
    k23Cut,
    k32Cut,
    k33Cut,
    kNTPCcuts
  };
  const Char_t *tpccutdir[8] = {
    ".",
    "TOFpid_cutOnTPC[-1.0,1.0]",
    "TOFpid_cutOnTPC[1.0,2.0]",
    "TOFpid_cutOnTPC[-2.0,-1.0]",
    "TOFpid_cutOnTPC[-2.0,2.0]",
    "TOFpid_cutOnTPC[2.0,3.0]",
    "TOFpid_cutOnTPC[-3.0,-2.0]",
    "TOFpid_cutOnTPC[-3.0,3.0]"
  };

  /* get data */
  Char_t filename[1024];
  TH1D *hAccepted[AliPID::kSPECIES][kNTPCcuts];
  TH1D *hIdentified[AliPID::kSPECIES][kNTPCcuts];
  TH1D *hEfficiencyIn[AliPID::kSPECIES][kNTPCcuts];
  TH1D *hFraction[AliPID::kSPECIES][AliPID::kSPECIES][kNTPCcuts];
  for (Int_t itpccut = 0; itpccut < kNTPCcuts; itpccut++) {

    /* check whether we use this cut */
    if (useTPCcut >= 0 && itpccut != useTPCcut) 
      continue;

    for (Int_t iipart = 0; iipart < AliPID::kSPECIES; iipart++) {
      /* skip electrons and muons */
      if (iipart == AliPID::kMuon)
	continue;
      
      /* open file */
      sprintf(filename, "%s/TOFspectrum_%s_%s_%s_%sID.root", tpccutdir[itpccut], centName, AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart));
      TFile *filein = TFile::Open(filename);
      if (!filein || !filein->IsOpen()) {
	printf("cannot open %s\n", filename);
	return;
      }
      
      /* get accepted tracks */
      hAccepted[iipart][itpccut] = (TH1D *)filein->Get("PostAnalysis/hAcceptedTracks");
      if (!hAccepted[iipart][itpccut]) {
	printf("cannot find PostAnalysis/hAcceptedTracks in %s\n", filename);
	return;
      }
      
      /* get identified tracks */
      hIdentified[iipart][itpccut] = (TH1D *)filein->Get("PostAnalysis/hIdentifiedCounts");
      if (!hIdentified[iipart][itpccut]) {
	printf("cannot find PostAnalysis/hIdentifiedCounts in %s\n", filename);
	return;
      }
      
      /* compute efficiency */
      hEfficiencyIn[iipart][itpccut] = new TH1D(*hIdentified[iipart][itpccut]);
      hEfficiencyIn[iipart][itpccut]->Divide(hEfficiencyIn[iipart][itpccut], hAccepted[iipart][itpccut], 1., 1., "B");
      
      /* get fractions */
      for (Int_t iiipart = 0; iiipart < AliPID::kSPECIES; iiipart++) {
	/* skip muons */
	if (iiipart == AliPID::kMuon)
	  continue;
	
	hFraction[iipart][iiipart][itpccut] = (TH1D *)filein->Get(Form("PostAnalysis/%s", fractionName[iipart][iiipart]));
	if (!hFraction[iipart][iiipart][itpccut]) {
	  printf("cannot find PostAnalysis/%s in %s\n", fractionName[iipart][iiipart], filename);
	  return;
	}
      }
    }
  }

  /* prepare output efficiency histos */
  TH1D *hEfficiencyOut[AliPID::kSPECIES];
  for (Int_t iipart = 0; iipart < AliPID::kSPECIES; iipart++) {
    hEfficiencyOut[iipart] = new TH1D(Form("hPIDEff_%d_%s_%s_%sID", icent, AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(iipart)), "", NptBins, ptBin);
  }
 

  /*** MATRIX ***/

  const Int_t nPart = 4;
  Int_t partIndex[4] = {AliPID::kElectron, AliPID::kPion, AliPID::kKaon, AliPID::kProton};

  TMatrixD Meffin(nPart, 1);
  TMatrixD Meffout(nPart, 1);
  TMatrixD Mfrac(nPart, nPart);

  Double_t eff[4], effe[4], frac[4][4], frace[4][4], geneff, genfrac;
  Bool_t gotbestcut[4];

  TH1F *hEffTemp[4];
  for (Int_t iipart = 0; iipart < nPart; iipart++)
    hEffTemp[iipart] = new TH1F(Form("hEffTemp_%d", iipart), "", 20000, -10., 10.);

  /* loop over pt-bins */
  for (Int_t ibin = 0; ibin < NptBins; ibin++) {

    /* reset temp histos */
    for (Int_t iipart = 0; iipart < nPart; iipart++)
      hEffTemp[iipart]->Reset();

    /* get measured data */
    for (Int_t iipart = 0; iipart < nPart; iipart++) {

      /* select the best set of cuts */
      Double_t signalFrac, maxsignalFrac = minsignalFrac;
      Int_t bestcut = -1;
      gotbestcut[iipart] = kFALSE;
      for (Int_t itpccut = 0; itpccut < kNTPCcuts; itpccut++) {

	/* check whether we use this cut */
	if (useTPCcut >= 0 && itpccut != useTPCcut) 
	  continue;
	
	/* maximize the signal fraction */
	signalFrac = hFraction[partIndex[iipart]][partIndex[iipart]][itpccut]->GetBinContent(ibin + 1);
	if (signalFrac > maxsignalFrac) {
	  maxsignalFrac = signalFrac;
	  bestcut = itpccut;
	  gotbestcut[iipart] = kTRUE;
	}
      }
      if (bestcut < 0)
	continue;

      eff[iipart] = hEfficiencyIn[partIndex[iipart]][bestcut]->GetBinContent(ibin + 1);
      effe[iipart] = hEfficiencyIn[partIndex[iipart]][bestcut]->GetBinError(ibin + 1);
      for (Int_t iiipart = 0; iiipart < nPart; iiipart++) {
	frac[iipart][iiipart] = hFraction[partIndex[iipart]][partIndex[iiipart]][bestcut]->GetBinContent(ibin + 1);
	frace[iipart][iiipart] = hFraction[partIndex[iipart]][partIndex[iiipart]][bestcut]->GetBinError(ibin + 1);
      }
    }

    /* check best cuts */
    Bool_t skip = kFALSE;
    for (Int_t iipart = 0; iipart < nPart; iipart++)
      if (!gotbestcut[iipart])
	skip = kTRUE;
    if (skip) continue;
    
    /* loop over trials */
    for (Int_t itry = 0; itry < nTrials; itry++) {
      
      /* setup matrix */
      for (Int_t iipart = 0; iipart < nPart; iipart++) {
	geneff = gRandom->Gaus(eff[iipart], effe[iipart]);
	if (geneff < 0.) geneff = 0.;
	if (geneff > 1.) geneff = 1.;
	Meffin[iipart] = geneff != 0. ? 1. / geneff : 0.;
	for (Int_t iiipart = 0; iiipart < nPart; iiipart++) {
	  genfrac = gRandom->Gaus(frac[iipart][iiipart], frace[iipart][iiipart]);
	  if (genfrac < 0.) genfrac = 0.;
	  if (genfrac > 1.) genfrac = 1.;
	  Mfrac[iipart][iiipart] = genfrac;
	}
      }

      /* invert matrix */
      TDecompLU lu(Mfrac);
      TMatrixD Minv(nPart, nPart);
      if (!lu.Decompose()) continue;
      lu.Invert(Minv);
      Meffout = Minv * Meffin;
      
      /* fill histos */
      for (Int_t iipart = 0; iipart < nPart; iipart++) {
	if (Meffout.GetMatrixArray()[iipart] > 0.)
	  hEffTemp[iipart]->Fill(1. / Meffout.GetMatrixArray()[iipart]);
      }

    } /* end of loop over trials */

    
    /* get average and RMS */
    for (Int_t iipart = 0; iipart < nPart; iipart++) {
      hEfficiencyOut[partIndex[iipart]]->SetBinContent(ibin + 1, hEffTemp[iipart]->GetMean());
      hEfficiencyOut[partIndex[iipart]]->SetBinError(ibin + 1, hEffTemp[iipart]->GetRMS());
    }

  } /* end of loop over pt-bins */

  
  hEfficiencyOut[AliPID::kPion]->SetMarkerStyle(20);
  hEfficiencyOut[AliPID::kKaon]->SetMarkerStyle(20);
  hEfficiencyOut[AliPID::kProton]->SetMarkerStyle(20);
  hEfficiencyOut[AliPID::kElectron]->SetMarkerStyle(20);

  hEfficiencyOut[AliPID::kPion]->SetMarkerColor(4);
  hEfficiencyOut[AliPID::kKaon]->SetMarkerColor(8);
  hEfficiencyOut[AliPID::kProton]->SetMarkerColor(2);
  hEfficiencyOut[AliPID::kElectron]->SetMarkerColor(1);
 
  hEfficiencyOut[AliPID::kPion]->Draw();
  hEfficiencyOut[AliPID::kKaon]->Draw("same");
  hEfficiencyOut[AliPID::kProton]->Draw("same");
  hEfficiencyOut[AliPID::kElectron]->Draw("same");


  /* output */
  TFile *fileout = TFile::Open(Form("TOFpid_efficiency_cent%d_%s_%s.root", icent, AliPID::ParticleName(ipart), chargeName[icharge]), "RECREATE");
  hEfficiencyOut[AliPID::kPion]->Write();
  hEfficiencyOut[AliPID::kKaon]->Write();
  hEfficiencyOut[AliPID::kProton]->Write();
  hEfficiencyOut[AliPID::kElectron]->Write();
  fileout->Close();

}

TOFpid_normalize(TH1D *h, Double_t nevents = 8.42446600000000000e+06)
{
  
  Double_t counts, counts_err;
  for (Int_t ibin = 0; ibin < h->GetNbinsX(); ibin++) {
    counts = h->GetBinContent(ibin + 1);
    counts_err = h->GetBinError(ibin + 1);
    counts /= h->GetBinWidth(ibin + 1);
    counts_err /= h->GetBinWidth(ibin + 1);
    h->SetBinContent(ibin + 1, counts);
    h->SetBinError(ibin + 1, counts_err);
  }
  
  h->Scale(1. / nevents);
  
}

TOFpid_normalizeAndwrite(const Char_t *fileoutname, const Char_t *corrstring = "")
{

  TFile *fpiplus = TFile::Open("TOFpid_spectrum_pion_plus.root");
  TFile *fpiminus = TFile::Open("TOFpid_spectrum_pion_minus.root");
  TFile *fkaplus = TFile::Open("TOFpid_spectrum_kaon_plus.root");
  TFile *fkaminus = TFile::Open("TOFpid_spectrum_kaon_minus.root");
  TFile *fprplus = TFile::Open("TOFpid_spectrum_proton_plus.root");
  TFile *fprminus = TFile::Open("TOFpid_spectrum_proton_minus.root");

  hpiplus = (TH1F *)fpiplus->Get(Form("hSignal%sCounts", corrstring));
  hpiminus = (TH1F *)fpiminus->Get(Form("hSignal%sCounts", corrstring));
  hkaplus = (TH1F *)fkaplus->Get(Form("hSignal%sCounts", corrstring));
  hkaminus = (TH1F *)fkaminus->Get(Form("hSignal%sCounts", corrstring));
  hprplus = (TH1F *)fprplus->Get(Form("hSignal%sCounts", corrstring));
  hprminus = (TH1F *)fprminus->Get(Form("hSignal%sCounts", corrstring));

  hpiplus->SetName("hpiplus");
  hpiminus->SetName("hpiminus");
  hkaplus->SetName("hkaplus");
  hkaminus->SetName("hkaminus");
  hprplus->SetName("hprplus");
  hprminus->SetName("hprminus");

  TOFpid_normalize(hpiplus);
  TOFpid_normalize(hpiminus);
  TOFpid_normalize(hkaplus);
  TOFpid_normalize(hkaminus);
  TOFpid_normalize(hprplus);
  TOFpid_normalize(hprminus);

  TFile *fileout = TFile::Open(fileoutname, "RECREATE");
  hpiplus->Write("hpiplus");
  hpiminus->Write("hpiminus");
  hkaplus->Write("hkaplus");
  hkaminus->Write("hkaminus");
  hprplus->Write("hprplus");
  hprminus->Write("hprminus");
  fileout->Close();

}

/**************************************************************/

TOFpid_rawSpectra(const Char_t *destdir = ".")
{

  Int_t marker[2] = {20, 21};
  Int_t color[AliPID::kSPECIES] = {1, 1, 4, 8, 2};
  Char_t *partLatex[AliPID::kSPECIES][2] = {
    "", "", "", "", "#pi^{+}", "#pi^{-}", "K^{+}", "K^{-}", "p", "#bar{p}"
  };

  Float_t deltaRapidity = rapidityMaxCut - rapidityMinCut;

  TFile *fileout = TFile::Open("TOF_rawSpectra.root", "RECREATE");
  TH1D *hRaw;
  Char_t title[1024];
  for (Int_t icent = -1; icent < NcentralityBins; icent++)
    for (Int_t icharge = 0; icharge < kNCharges; icharge++)
      for (Int_t ipart = 2; ipart < AliPID::kSPECIES; ipart++) {
	hRaw = TOFpid_rawSpectra(destdir, ipart, icharge, icent);
	if (!hRaw) continue;
	hRaw->Scale(1. / deltaRapidity);
	hRaw->SetMarkerStyle(marker[icharge]);
	hRaw->SetMarkerColor(color[ipart]);
	hRaw->SetLineColor(1);
	hRaw->SetLineWidth(1);
	if (icent == -1)
	  sprintf(title, "%s (MB);p_{T} (GeV/c);#frac{d^{2}N}{dy dp_{T}} (c/GeV);", partLatex[ipart][icharge]);
	else
	  sprintf(title, "%s (%d-%d%%);p_{T} (GeV/c);#frac{d^{2}N}{dy dp_{T}} (c/GeV);", partLatex[ipart][icharge], (Int_t)centralityBin[icent], (Int_t)centralityBin[icent + 1]);
	hRaw->SetTitle(title);
	if (icent == -1)
	  hRaw->SetName(Form("hRaw_MB_%s_%s", AliPID::ParticleName(ipart), chargeName[icharge]));
	else
	  hRaw->SetName(Form("hRaw_cent%d_%s_%s", icent, AliPID::ParticleName(ipart), chargeName[icharge]));
	fileout->cd();
	hRaw->Write();
      }

  fileout->Close();
}

TH1D *
TOFpid_rawSpectra(const Char_t *dirname, Int_t ipart, Int_t icharge, Int_t icent)
{

  /* open data */
  Char_t outfilename[1024];
  if (icent < 0 || icent >= NcentralityBins) {
    sprintf(outfilename, "%s/TOFspectrum_cent0090_%s_%s_%sID.root", dirname, AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(ipart));
  }
  else {
    sprintf(outfilename, "%s/TOFspectrum_cent%02d%02d_%s_%s_%sID.root", dirname, centralityBin[icent], centralityBin[icent + 1], AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(ipart));
  }
  TFile *filein = TFile::Open(outfilename);
  if (!filein || !filein->IsOpen()) {
    printf("cannot open %s\n", outfilename);
    return NULL;
  }
  /* get data */
  TH1D *h = (TH1D *)filein->Get("RawSpectra/hNormalizedRawYield");
  if (!h) {
    printf("cannot get RawSpectra/hNormalizedRawYield from %s\n", outfilename);
    return NULL;
  }

  return h;

}

TOFpid_rawSpectra_mismatchCorrected(const Char_t *destdir = ".")
{

  Int_t marker[2] = {20, 21};
  Int_t color[AliPID::kSPECIES] = {1, 1, 4, 8, 2};
  Char_t *partLatex[AliPID::kSPECIES][2] = {
    "", "", "", "", "#pi^{+}", "#pi^{-}", "K^{+}", "K^{-}", "p", "#bar{p}"
  };

  Float_t deltaRapidity = rapidityMaxCut - rapidityMinCut;

  TFile *fileout = TFile::Open("TOF_rawSpectra_mismatchCorrected.root", "RECREATE");
  TH1D *hRaw;
  Char_t title[1024];
  for (Int_t icent = -1; icent < NcentralityBins; icent++)
    for (Int_t icharge = 0; icharge < kNCharges; icharge++)
      for (Int_t ipart = 2; ipart < AliPID::kSPECIES; ipart++) {
	hRaw = TOFpid_rawSpectra_mismatchCorrected(destdir, ipart, icharge, icent);
	if (!hRaw) continue;
	hRaw->Scale(1. / deltaRapidity);
	hRaw->SetMarkerStyle(marker[icharge]);
	hRaw->SetMarkerColor(color[ipart]);
	hRaw->SetLineColor(1);
	hRaw->SetLineWidth(1);
	if (icent == -1)
	  sprintf(title, "%s (MB);p_{T} (GeV/c);#frac{d^{2}N}{dy dp_{T}} (c/GeV);", partLatex[ipart][icharge]);
	else
	  sprintf(title, "%s (%d-%d%%);p_{T} (GeV/c);#frac{d^{2}N}{dy dp_{T}} (c/GeV);", partLatex[ipart][icharge], (Int_t)centralityBin[icent], (Int_t)centralityBin[icent + 1]);
	hRaw->SetTitle(title);
	if (icent == -1)
	  hRaw->SetName(Form("hRaw_MB_%s_%s", AliPID::ParticleName(ipart), chargeName[icharge]));
	else
	  hRaw->SetName(Form("hRaw_cent%d_%s_%s", icent, AliPID::ParticleName(ipart), chargeName[icharge]));
	fileout->cd();
	hRaw->Write();
      }

  fileout->Close();
}

TH1D *
TOFpid_rawSpectra_mismatchCorrected(const Char_t *dirname, Int_t ipart, Int_t icharge, Int_t icent)
{

  /* open data */
  Char_t outfilename[1024];
  if (icent < 0 || icent >= NcentralityBins) {
    sprintf(outfilename, "%s/TOFspectrum_cent0090_%s_%s_%sID.root", dirname, AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(ipart));
  }
  else {
    sprintf(outfilename, "%s/TOFspectrum_cent%02d%02d_%s_%s_%sID.root", dirname, centralityBin[icent], centralityBin[icent + 1], AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(ipart));
  }
  TFile *filein = TFile::Open(outfilename);
  if (!filein || !filein->IsOpen()) {
    printf("cannot open %s\n", outfilename);
    return NULL;
  }
  /* get data */
  TH1D *h = (TH1D *)filein->Get("RawSpectra/hNormalizedMismatchCorrectedRawYield");
  if (!h) {
    printf("cannot get RawSpectra/hNormalizedRawYield from %s\n", outfilename);
    return NULL;
  }

  return h;

}

/**************************************************************/

TOFpid_electronCorrection()
{

    Int_t marker[2] = {20, 21};
  Int_t color[AliPID::kSPECIES] = {1, 1, 4, 8, 2};
  Char_t *partLatex[AliPID::kSPECIES][2] = {
    "", "", "", "", "#pi^{+}", "#pi^{-}", "K^{+}", "K^{-}", "p", "#bar{p}"
  };

  
  TFile *fileout = TFile::Open("TOF_electronCorrection.root", "RECREATE");
  TH1D *hCorr;
  TProfile *pCorrAv = new TProfile("pCorrAv", "", NptBins, ptBin, "s");
  Char_t title[1024];
  for (Int_t icent = 0; icent < NcentralityBins; icent++)
    for (Int_t icharge = 0; icharge < kNCharges; icharge++)
      for (Int_t ipart = 2; ipart < 3; ipart++) {
	hCorr = TOFpid_electronCorrection(ipart, icharge, icent);
	hCorr->SetMarkerStyle(marker[icharge]);
	hCorr->SetMarkerColor(color[ipart]);
	hCorr->SetLineColor(1);
	hCorr->SetLineWidth(1);
	sprintf(title, "%s (%d-%d%%);p_{T} (GeV/c);electron-subtracted pion fraction;", partLatex[ipart][icharge], (Int_t)centralityBin[icent], (Int_t)centralityBin[icent + 1]);
	hCorr->SetTitle(title);
	hCorr->SetName(Form("hElectronCorr_cent%d_%s_%s", icent, AliPID::ParticleName(ipart), chargeName[icharge]));
	fileout->cd();
	hCorr->Write();
	/* fill for average correction */
	for (Int_t ipt = 0; ipt < NptBins; ipt++) {
	  pCorrAv->Fill(hCorr->GetBinCenter(ipt + 1), hCorr->GetBinContent(ipt + 1));
	}
      }
  hCorr = new TH1D("hElectronCorr_average", ";p_{T} (GeV/c);electron-subtracted pion fraction;", NptBins, ptBin);
  for (Int_t ipt = 0; ipt < NptBins; ipt++) {
    hCorr->SetBinContent(ipt + 1, pCorrAv->GetBinContent(ipt + 1));
    hCorr->SetBinError(ipt + 1, pCorrAv->GetBinError(ipt + 1));
  }
  hCorr->Write();
  fileout->Close();
}

TH1D *
TOFpid_electronCorrection(Int_t ipart, Int_t icharge, Int_t icent)
{

  Int_t marker[2] = {20, 21};
  Int_t color[AliPID::kSPECIES] = {1, 1, 4, 8, 2};
  Char_t *partLatex[AliPID::kSPECIES][2] = {
    "", "", "", "", "#pi^{+}", "#pi^{-}", "K^{+}", "K^{-}", "p", "#bar{p}"
  };

  TH1D *hr = TOFpid_systematics_ratio("defaultFit_electronCut", "defaultFit", ipart, icharge, icent, "electronCorrection", "", marker[icharge], color[ipart], kTRUE);
  TF1 fOne("fOne", "1.", fitPtMin[ipart], fitPtMax[ipart]);
  hr->Add(&fOne, -1.);
  hr->Scale(1. / 0.866);
  hr->Add(&fOne, 1.);

  return hr;
}

/**************************************************************/

SystematicCheck(const Char_t *defaultname = "defaultFit")
{

  const Int_t ndata = 6;
  const Char_t *name[ndata] = {
    "signalFit_fixed_scaleSigma_09",
    "signalFit_fixed_scaleSigma_11",
    "signalFit_fixed_scaleTail_09",
    "signalFit_fixed_scaleTail_11",
    "signalFit_fixed_scaleSigma_09_scaleTail_11",
    "signalFit_fixed_scaleSigma_11_scaleTail_09"
  };
  for (Int_t idata = 0; idata < ndata; idata++)
    SystematicCheck(name[idata], defaultname);

}

SystematicCheck(const Char_t *checkname, const Char_t *defaultname = "defaultFit")
{

  gROOT->LoadMacro("HistoUtils.C");

  Char_t filename1[1024];
  Char_t filename2[1024];

  Int_t marker[2] = {20, 25};
  Int_t color[AliPID::kSPECIES] = {1, 1, 4, 8, 2};
  Char_t *partLatex[AliPID::kSPECIES][2] = {
    "", "", "", "", "#pi^{+}", "#pi^{-}", "K^{+}", "K^{-}", "p", "#bar{p}"
  };


  TFile *fileout = TFile::Open(Form("SystematicCheck_%s.root", checkname), "RECREATE");
  Char_t title[1024];
  TH1 *hd;
  for (Int_t icent = 0; icent < NcentralityBins; icent++)
    for (Int_t ipart = 2; ipart < AliPID::kSPECIES; ipart++)
      for (Int_t icharge = 0; icharge < kNCharges; icharge++) {

	if (icent < 0 || icent >= NcentralityBins) {
	  sprintf(filename1, "%s/TOFspectrum_cent0090_%s_%s_%sID.root", checkname, AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(ipart));
	  sprintf(filename2, "%s/TOFspectrum_cent0090_%s_%s_%sID.root", defaultname, AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(ipart));
	}
	else {
	  sprintf(filename1, "%s/TOFspectrum_cent%02d%02d_%s_%s_%sID.root", checkname, centralityBin[icent], centralityBin[icent + 1], AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(ipart));
	  sprintf(filename2, "%s/TOFspectrum_cent%02d%02d_%s_%s_%sID.root", defaultname, centralityBin[icent], centralityBin[icent + 1], AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(ipart));
	}
	
	hd = HistoUtils_systematics(filename1, filename2, "RawSpectra/hNormalizedRawYield", NULL);
	hd->SetName(Form("hRaw_cent%d_%s_%s", icent, AliPID::ParticleName(ipart), chargeName[icharge]));
	sprintf(title, "%s (%d-%d%%);p_{T} (GeV/c);#frac{d^{2}N}{dy dp_{T}} (c/GeV);", partLatex[ipart][icharge], centralityBin[icent], centralityBin[icent + 1]);
	hd->SetTitle(title);
	hd->SetLineColor(1);
	hd->SetLineWidth(1);
	hd->SetMarkerStyle(marker[icharge]);
	hd->SetMarkerColor(color[ipart]);
	fileout->cd();
	hd->Write();
	delete hd;
      }
  fileout->Close();

}

/**************************************************************/

TOFpid_systematics()
{

  TFile *fileout = TFile::Open("TOFpid_systematics.root", "RECREATE");
  TH1D *hSys;
  for (Int_t icent = 0; icent < NcentralityBins; icent++)
    for (Int_t icharge = 0; icharge < kNCharges; icharge++)
      for (Int_t ipart = 2; ipart < AliPID::kSPECIES; ipart++) {
	hSys = TOFpid_systematics(ipart, icharge, icent);
	fileout->cd();
	hSys->Write(Form("hRawSys_cent%d_%s_%s", icent, AliPID::ParticleName(ipart), chargeName[icharge]));
	delete hSys;
      }

  fileout->Close();
}

TH1D *
TOFpid_systematics(Int_t ipart, Int_t icharge, Int_t icent)
{
  
  TH1D *hSignalFit = TOFpid_systematics_signalFit(ipart, icharge, icent);
  TH1D *hBkgFit = TOFpid_systematics_bkgFit(ipart, icharge, icent);
  TH1D *hFitRange = TOFpid_systematics_fitRange(ipart, icharge, icent);

  TH1D *hSys = new TH1D("hSys", "", NptBins, ptBin);
  Double_t sigsys, bkgsys, rangesys, totsys = 0.;
  for (Int_t ipt = 0; ipt < NptBins; ipt++) {
    sigsys = hSignalFit->GetBinError(ipt + 1);
    bkgsys = hBkgFit->GetBinError(ipt + 1);
    rangesys = hFitRange->GetBinError(ipt + 1);
    totsys = TMath::Sqrt(sigsys * sigsys + bkgsys * bkgsys + rangesys * rangesys);
    hSys->SetBinContent(ipt + 1, totsys);
  }

  hSys->Draw();

  delete hSignalFit;
  delete hBkgFit;
  delete hFitRange;

  return hSys;
}

TH1D *
TOFpid_systematics_fitRange(Int_t ipart, Int_t icharge, Int_t icent)
{
  
  TH1D *hArea = new TH1D("hArea", "", NptBins, ptBin);
  hArea->SetMinimum(0.8);
  hArea->SetMaximum(1.2);
  hArea->Draw();

  TH1D *hr = TOFpid_systematics_ratio("default_wideRange", "default", ipart, icharge, icent, "wide", "wide-range fit;p_{T} (GeV/c);ratio wrt. default;", 20, 4);
  hr->Draw("same");

  TH1D *hSys = new TH1D("hSys", "", NptBins, ptBin);
  hSys->SetFillStyle(0);
  hSys->SetMarkerSize(0);
  for (Int_t ipt = 0; ipt < NptBins; ipt++) {
    Double_t val, max = 0.;
    if (hr->GetBinContent(ipt + 1) == 0.) continue;
    val = TMath::Abs(hr->GetBinContent(ipt + 1) - 1.);
    hSys->SetBinContent(ipt + 1, 1.);
    hSys->SetBinError(ipt + 1, val);
  }
  hSys->Draw("same, E2");
  
  delete hr;

  return hSys;
}

TH1D *
TOFpid_systematics_signalFit(Int_t ipart, Int_t icharge, Int_t icent)
{

  const Int_t ndata = 6;
  const Char_t *name[ndata] = {
    "signalFit_fixed_scaleSigma_09",
    "signalFit_fixed_scaleSigma_11",
    "signalFit_fixed_scaleTail_09",
    "signalFit_fixed_scaleTail_11",
    "signalFit_fixed_scaleSigma_09_scaleTail_11",
    "signalFit_fixed_scaleSigma_11_scaleTail_09"
  };
  const Char_t *title[ndata] = {
    "-10% #sigma;p_{T} (GeV/c); ratio",
    "+10% #sigma;p_{T} (GeV/c); ratio",
    "-10% #tau;p_{T} (GeV/c); ratio",
    "+10% #tau;p_{T} (GeV/c); ratio",
    "-10% #sigma, +10% #tau;p_{T} (GeV/c); ratio",
    "+10% #sigma, -10% #tau;p_{T} (GeV/c); ratio"
  };
  Int_t marker[ndata] = {22, 28, 22, 28, 22, 28};
  Int_t color[ndata] = {2, 2, 8, 8, 4, 4};

  TH1D *hArea = new TH1D("hArea", "", NptBins, ptBin);
  hArea->SetMinimum(0.8);
  hArea->SetMaximum(1.2);
  hArea->Draw();
  
  TH1D *hr[ndata];
  for (Int_t idata = 0; idata < ndata; idata++) {
    hr[idata] = TOFpid_systematics_ratio(name[idata], "defaultFit", ipart, icharge, icent, name[idata], title[idata], marker[idata], color[idata]);
    hr[idata]->Draw("same");
  }

  TH1D *hSys = new TH1D("hSys", "", NptBins, ptBin);
  hSys->SetFillStyle(0);
  hSys->SetMarkerSize(0);
  for (Int_t ipt = 0; ipt < NptBins; ipt++) {
    Double_t val, max = 0.;
    for (Int_t idata = 0; idata < ndata; idata++) {
      if (hr[idata]->GetBinContent(ipt + 1) == 0.) continue;
      val = TMath::Abs(hr[idata]->GetBinContent(ipt + 1) - 1.);
      if (val > 0.9) continue;
      if (val > max)
	max = val;
    }
    hSys->SetBinContent(ipt + 1, 1.);
    hSys->SetBinError(ipt + 1, max);
  }
  hSys->Draw("same, E2");

  //  delete hArea;
  //  for (Int_t idata = 0; idata < ndata; idata++)
  //    delete hr[idata];
  
  return hSys;
}

TH1D *
TOFpid_systematics_bkgFit(Int_t ipart, Int_t icharge, Int_t icent)
{

  const Int_t ndata = 6;
  const Char_t *name[ndata] = {
    "bkgFit_fixed_scaleSigma_09",
    "bkgFit_fixed_scaleSigma_11",
    "bkgFit_fixed_scaleTail_09",
    "bkgFit_fixed_scaleTail_11",
    "bkgFit_fixed_scaleSigma_09_scaleTail_11",
    "bkgFit_fixed_scaleSigma_11_scaleTail_09"
  };
  const Char_t *title[ndata] = {
    "-10% #sigma;p_{T} (GeV/c); ratio",
    "+10% #sigma;p_{T} (GeV/c); ratio",
    "-10% #tau;p_{T} (GeV/c); ratio",
    "+10% #tau;p_{T} (GeV/c); ratio",
    "-10% #sigma, +10% #tau;p_{T} (GeV/c); ratio",
    "+10% #sigma, -10% #tau;p_{T} (GeV/c); ratio"
  };
  Int_t marker[ndata] = {22, 28, 22, 28, 22, 28};
  Int_t color[ndata] = {2, 2, 8, 8, 4, 4};

  TH1D *hArea = new TH1D("hArea", "", NptBins, ptBin);
  hArea->SetMinimum(0.5);
  hArea->SetMaximum(1.5);
  hArea->Draw();
  
  TH1D *hr[ndata];
  for (Int_t idata = 0; idata < ndata; idata++) {
    hr[idata] = TOFpid_systematics_ratio(name[idata], "defaultFit", ipart, icharge, icent, name[idata], title[idata], marker[idata], color[idata]);
    hr[idata]->Draw("same");
  }

  TH1D *hSys = new TH1D("hSys", "", NptBins, ptBin);
  hSys->SetFillStyle(0);
  hSys->SetMarkerSize(0);
  for (Int_t ipt = 0; ipt < NptBins; ipt++) {
    Double_t val, max = 0.;
    for (Int_t idata = 0; idata < ndata; idata++) {
      if (hr[idata]->GetBinContent(ipt + 1) == 0.) continue;
      val = TMath::Abs(hr[idata]->GetBinContent(ipt + 1) - 1.);
      if (val > 0.9) continue;
      if (val > max)
	max = val;
    }
    hSys->SetBinContent(ipt + 1, 1.);
    hSys->SetBinError(ipt + 1, max);
  }
  hSys->Draw("same, E2");
  
  //  delete hArea;
  //  for (Int_t idata = 0; idata < ndata; idata++)
  //    delete hr[idata];

  return hSys;
}

TH1D *
TOFpid_systematics_ratio(const Char_t *dirname1, const Char_t *dirname2, Int_t ipart, Int_t icharge, Int_t icent, const Char_t *name = "rawRatio", const Char_t *title = ";p_{T} (GeV/c);raw yield ratio;", Int_t marker = 20, Int_t color = 2, Bool_t correlated = kFALSE)
{
  
  TH1D *hr = new TH1D("hr", "", NptBins, ptBin);

  /* open data */
  Char_t outfilename1[1024];
  Char_t outfilename2[1024];
  if (icent < 0 || icent >= NcentralityBins) {
    sprintf(outfilename1, "%s/TOFspectrum_cent0090_%s_%s_%sID.root", dirname1, AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(ipart));
    sprintf(outfilename2, "%s/TOFspectrum_cent0090_%s_%s_%sID.root", dirname2, AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(ipart));
  }
  else {
    sprintf(outfilename1, "%s/TOFspectrum_cent%02d%02d_%s_%s_%sID.root", dirname1, centralityBin[icent], centralityBin[icent + 1], AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(ipart));
    sprintf(outfilename2, "%s/TOFspectrum_cent%02d%02d_%s_%s_%sID.root", dirname2, centralityBin[icent], centralityBin[icent + 1], AliPID::ParticleName(ipart), chargeName[icharge], AliPID::ParticleName(ipart));
  }
  TFile *filein1 = TFile::Open(outfilename1);
  if (!filein1 || !filein1->IsOpen()) {
    printf("cannot open %s\n", outfilename1);
    return;
  }
  TFile *filein2 = TFile::Open(outfilename2);
  if (!filein2 || !filein2->IsOpen()) {
    printf("cannot open %s\n", outfilename2);
    return;
  }
  /* get data */
  TH1D *h1 = (TH1D *)filein1->Get("RawSpectra/hNormalizedRawYield");
  if (!h1) {
    printf("cannot get RawSpectra/hNormalizedRawYield from %s\n", outfilename1);
    return;
  }
  TH1D *h2 = (TH1D *)filein2->Get("RawSpectra/hNormalizedRawYield");
  if (!h2) {
    printf("cannot get RawSpectra/hNormalizedRawYield from %s\n", outfilename2);
    return;
  }
  /* ratio */
  if (correlated) hr->Divide(h1, h2, 1., 1., "B");
  else hr->Divide(h1, h2);
  hr->SetNameTitle(name, title);
  hr->SetMarkerStyle(marker);
  hr->SetMarkerColor(color);

  filein1->Close();
  filein2->Close();
  
  return hr;
  
}

 TOFpid.C:1
 TOFpid.C:2
 TOFpid.C:3
 TOFpid.C:4
 TOFpid.C:5
 TOFpid.C:6
 TOFpid.C:7
 TOFpid.C:8
 TOFpid.C:9
 TOFpid.C:10
 TOFpid.C:11
 TOFpid.C:12
 TOFpid.C:13
 TOFpid.C:14
 TOFpid.C:15
 TOFpid.C:16
 TOFpid.C:17
 TOFpid.C:18
 TOFpid.C:19
 TOFpid.C:20
 TOFpid.C:21
 TOFpid.C:22
 TOFpid.C:23
 TOFpid.C:24
 TOFpid.C:25
 TOFpid.C:26
 TOFpid.C:27
 TOFpid.C:28
 TOFpid.C:29
 TOFpid.C:30
 TOFpid.C:31
 TOFpid.C:32
 TOFpid.C:33
 TOFpid.C:34
 TOFpid.C:35
 TOFpid.C:36
 TOFpid.C:37
 TOFpid.C:38
 TOFpid.C:39
 TOFpid.C:40
 TOFpid.C:41
 TOFpid.C:42
 TOFpid.C:43
 TOFpid.C:44
 TOFpid.C:45
 TOFpid.C:46
 TOFpid.C:47
 TOFpid.C:48
 TOFpid.C:49
 TOFpid.C:50
 TOFpid.C:51
 TOFpid.C:52
 TOFpid.C:53
 TOFpid.C:54
 TOFpid.C:55
 TOFpid.C:56
 TOFpid.C:57
 TOFpid.C:58
 TOFpid.C:59
 TOFpid.C:60
 TOFpid.C:61
 TOFpid.C:62
 TOFpid.C:63
 TOFpid.C:64
 TOFpid.C:65
 TOFpid.C:66
 TOFpid.C:67
 TOFpid.C:68
 TOFpid.C:69
 TOFpid.C:70
 TOFpid.C:71
 TOFpid.C:72
 TOFpid.C:73
 TOFpid.C:74
 TOFpid.C:75
 TOFpid.C:76
 TOFpid.C:77
 TOFpid.C:78
 TOFpid.C:79
 TOFpid.C:80
 TOFpid.C:81
 TOFpid.C:82
 TOFpid.C:83
 TOFpid.C:84
 TOFpid.C:85
 TOFpid.C:86
 TOFpid.C:87
 TOFpid.C:88
 TOFpid.C:89
 TOFpid.C:90
 TOFpid.C:91
 TOFpid.C:92
 TOFpid.C:93
 TOFpid.C:94
 TOFpid.C:95
 TOFpid.C:96
 TOFpid.C:97
 TOFpid.C:98
 TOFpid.C:99
 TOFpid.C:100
 TOFpid.C:101
 TOFpid.C:102
 TOFpid.C:103
 TOFpid.C:104
 TOFpid.C:105
 TOFpid.C:106
 TOFpid.C:107
 TOFpid.C:108
 TOFpid.C:109
 TOFpid.C:110
 TOFpid.C:111
 TOFpid.C:112
 TOFpid.C:113
 TOFpid.C:114
 TOFpid.C:115
 TOFpid.C:116
 TOFpid.C:117
 TOFpid.C:118
 TOFpid.C:119
 TOFpid.C:120
 TOFpid.C:121
 TOFpid.C:122
 TOFpid.C:123
 TOFpid.C:124
 TOFpid.C:125
 TOFpid.C:126
 TOFpid.C:127
 TOFpid.C:128
 TOFpid.C:129
 TOFpid.C:130
 TOFpid.C:131
 TOFpid.C:132
 TOFpid.C:133
 TOFpid.C:134
 TOFpid.C:135
 TOFpid.C:136
 TOFpid.C:137
 TOFpid.C:138
 TOFpid.C:139
 TOFpid.C:140
 TOFpid.C:141
 TOFpid.C:142
 TOFpid.C:143
 TOFpid.C:144
 TOFpid.C:145
 TOFpid.C:146
 TOFpid.C:147
 TOFpid.C:148
 TOFpid.C:149
 TOFpid.C:150
 TOFpid.C:151
 TOFpid.C:152
 TOFpid.C:153
 TOFpid.C:154
 TOFpid.C:155
 TOFpid.C:156
 TOFpid.C:157
 TOFpid.C:158
 TOFpid.C:159
 TOFpid.C:160
 TOFpid.C:161
 TOFpid.C:162
 TOFpid.C:163
 TOFpid.C:164
 TOFpid.C:165
 TOFpid.C:166
 TOFpid.C:167
 TOFpid.C:168
 TOFpid.C:169
 TOFpid.C:170
 TOFpid.C:171
 TOFpid.C:172
 TOFpid.C:173
 TOFpid.C:174
 TOFpid.C:175
 TOFpid.C:176
 TOFpid.C:177
 TOFpid.C:178
 TOFpid.C:179
 TOFpid.C:180
 TOFpid.C:181
 TOFpid.C:182
 TOFpid.C:183
 TOFpid.C:184
 TOFpid.C:185
 TOFpid.C:186
 TOFpid.C:187
 TOFpid.C:188
 TOFpid.C:189
 TOFpid.C:190
 TOFpid.C:191
 TOFpid.C:192
 TOFpid.C:193
 TOFpid.C:194
 TOFpid.C:195
 TOFpid.C:196
 TOFpid.C:197
 TOFpid.C:198
 TOFpid.C:199
 TOFpid.C:200
 TOFpid.C:201
 TOFpid.C:202
 TOFpid.C:203
 TOFpid.C:204
 TOFpid.C:205
 TOFpid.C:206
 TOFpid.C:207
 TOFpid.C:208
 TOFpid.C:209
 TOFpid.C:210
 TOFpid.C:211
 TOFpid.C:212
 TOFpid.C:213
 TOFpid.C:214
 TOFpid.C:215
 TOFpid.C:216
 TOFpid.C:217
 TOFpid.C:218
 TOFpid.C:219
 TOFpid.C:220
 TOFpid.C:221
 TOFpid.C:222
 TOFpid.C:223
 TOFpid.C:224
 TOFpid.C:225
 TOFpid.C:226
 TOFpid.C:227
 TOFpid.C:228
 TOFpid.C:229
 TOFpid.C:230
 TOFpid.C:231
 TOFpid.C:232
 TOFpid.C:233
 TOFpid.C:234
 TOFpid.C:235
 TOFpid.C:236
 TOFpid.C:237
 TOFpid.C:238
 TOFpid.C:239
 TOFpid.C:240
 TOFpid.C:241
 TOFpid.C:242
 TOFpid.C:243
 TOFpid.C:244
 TOFpid.C:245
 TOFpid.C:246
 TOFpid.C:247
 TOFpid.C:248
 TOFpid.C:249
 TOFpid.C:250
 TOFpid.C:251
 TOFpid.C:252
 TOFpid.C:253
 TOFpid.C:254
 TOFpid.C:255
 TOFpid.C:256
 TOFpid.C:257
 TOFpid.C:258
 TOFpid.C:259
 TOFpid.C:260
 TOFpid.C:261
 TOFpid.C:262
 TOFpid.C:263
 TOFpid.C:264
 TOFpid.C:265
 TOFpid.C:266
 TOFpid.C:267
 TOFpid.C:268
 TOFpid.C:269
 TOFpid.C:270
 TOFpid.C:271
 TOFpid.C:272
 TOFpid.C:273
 TOFpid.C:274
 TOFpid.C:275
 TOFpid.C:276
 TOFpid.C:277
 TOFpid.C:278
 TOFpid.C:279
 TOFpid.C:280
 TOFpid.C:281
 TOFpid.C:282
 TOFpid.C:283
 TOFpid.C:284
 TOFpid.C:285
 TOFpid.C:286
 TOFpid.C:287
 TOFpid.C:288
 TOFpid.C:289
 TOFpid.C:290
 TOFpid.C:291
 TOFpid.C:292
 TOFpid.C:293
 TOFpid.C:294
 TOFpid.C:295
 TOFpid.C:296
 TOFpid.C:297
 TOFpid.C:298
 TOFpid.C:299
 TOFpid.C:300
 TOFpid.C:301
 TOFpid.C:302
 TOFpid.C:303
 TOFpid.C:304
 TOFpid.C:305
 TOFpid.C:306
 TOFpid.C:307
 TOFpid.C:308
 TOFpid.C:309
 TOFpid.C:310
 TOFpid.C:311
 TOFpid.C:312
 TOFpid.C:313
 TOFpid.C:314
 TOFpid.C:315
 TOFpid.C:316
 TOFpid.C:317
 TOFpid.C:318
 TOFpid.C:319
 TOFpid.C:320
 TOFpid.C:321
 TOFpid.C:322
 TOFpid.C:323
 TOFpid.C:324
 TOFpid.C:325
 TOFpid.C:326
 TOFpid.C:327
 TOFpid.C:328
 TOFpid.C:329
 TOFpid.C:330
 TOFpid.C:331
 TOFpid.C:332
 TOFpid.C:333
 TOFpid.C:334
 TOFpid.C:335
 TOFpid.C:336
 TOFpid.C:337
 TOFpid.C:338
 TOFpid.C:339
 TOFpid.C:340
 TOFpid.C:341
 TOFpid.C:342
 TOFpid.C:343
 TOFpid.C:344
 TOFpid.C:345
 TOFpid.C:346
 TOFpid.C:347
 TOFpid.C:348
 TOFpid.C:349
 TOFpid.C:350
 TOFpid.C:351
 TOFpid.C:352
 TOFpid.C:353
 TOFpid.C:354
 TOFpid.C:355
 TOFpid.C:356
 TOFpid.C:357
 TOFpid.C:358
 TOFpid.C:359
 TOFpid.C:360
 TOFpid.C:361
 TOFpid.C:362
 TOFpid.C:363
 TOFpid.C:364
 TOFpid.C:365
 TOFpid.C:366
 TOFpid.C:367
 TOFpid.C:368
 TOFpid.C:369
 TOFpid.C:370
 TOFpid.C:371
 TOFpid.C:372
 TOFpid.C:373
 TOFpid.C:374
 TOFpid.C:375
 TOFpid.C:376
 TOFpid.C:377
 TOFpid.C:378
 TOFpid.C:379
 TOFpid.C:380
 TOFpid.C:381
 TOFpid.C:382
 TOFpid.C:383
 TOFpid.C:384
 TOFpid.C:385
 TOFpid.C:386
 TOFpid.C:387
 TOFpid.C:388
 TOFpid.C:389
 TOFpid.C:390
 TOFpid.C:391
 TOFpid.C:392
 TOFpid.C:393
 TOFpid.C:394
 TOFpid.C:395
 TOFpid.C:396
 TOFpid.C:397
 TOFpid.C:398
 TOFpid.C:399
 TOFpid.C:400
 TOFpid.C:401
 TOFpid.C:402
 TOFpid.C:403
 TOFpid.C:404
 TOFpid.C:405
 TOFpid.C:406
 TOFpid.C:407
 TOFpid.C:408
 TOFpid.C:409
 TOFpid.C:410
 TOFpid.C:411
 TOFpid.C:412
 TOFpid.C:413
 TOFpid.C:414
 TOFpid.C:415
 TOFpid.C:416
 TOFpid.C:417
 TOFpid.C:418
 TOFpid.C:419
 TOFpid.C:420
 TOFpid.C:421
 TOFpid.C:422
 TOFpid.C:423
 TOFpid.C:424
 TOFpid.C:425
 TOFpid.C:426
 TOFpid.C:427
 TOFpid.C:428
 TOFpid.C:429
 TOFpid.C:430
 TOFpid.C:431
 TOFpid.C:432
 TOFpid.C:433
 TOFpid.C:434
 TOFpid.C:435
 TOFpid.C:436
 TOFpid.C:437
 TOFpid.C:438
 TOFpid.C:439
 TOFpid.C:440
 TOFpid.C:441
 TOFpid.C:442
 TOFpid.C:443
 TOFpid.C:444
 TOFpid.C:445
 TOFpid.C:446
 TOFpid.C:447
 TOFpid.C:448
 TOFpid.C:449
 TOFpid.C:450
 TOFpid.C:451
 TOFpid.C:452
 TOFpid.C:453
 TOFpid.C:454
 TOFpid.C:455
 TOFpid.C:456
 TOFpid.C:457
 TOFpid.C:458
 TOFpid.C:459
 TOFpid.C:460
 TOFpid.C:461
 TOFpid.C:462
 TOFpid.C:463
 TOFpid.C:464
 TOFpid.C:465
 TOFpid.C:466
 TOFpid.C:467
 TOFpid.C:468
 TOFpid.C:469
 TOFpid.C:470
 TOFpid.C:471
 TOFpid.C:472
 TOFpid.C:473
 TOFpid.C:474
 TOFpid.C:475
 TOFpid.C:476
 TOFpid.C:477
 TOFpid.C:478
 TOFpid.C:479
 TOFpid.C:480
 TOFpid.C:481
 TOFpid.C:482
 TOFpid.C:483
 TOFpid.C:484
 TOFpid.C:485
 TOFpid.C:486
 TOFpid.C:487
 TOFpid.C:488
 TOFpid.C:489
 TOFpid.C:490
 TOFpid.C:491
 TOFpid.C:492
 TOFpid.C:493
 TOFpid.C:494
 TOFpid.C:495
 TOFpid.C:496
 TOFpid.C:497
 TOFpid.C:498
 TOFpid.C:499
 TOFpid.C:500
 TOFpid.C:501
 TOFpid.C:502
 TOFpid.C:503
 TOFpid.C:504
 TOFpid.C:505
 TOFpid.C:506
 TOFpid.C:507
 TOFpid.C:508
 TOFpid.C:509
 TOFpid.C:510
 TOFpid.C:511
 TOFpid.C:512
 TOFpid.C:513
 TOFpid.C:514
 TOFpid.C:515
 TOFpid.C:516
 TOFpid.C:517
 TOFpid.C:518
 TOFpid.C:519
 TOFpid.C:520
 TOFpid.C:521
 TOFpid.C:522
 TOFpid.C:523
 TOFpid.C:524
 TOFpid.C:525
 TOFpid.C:526
 TOFpid.C:527
 TOFpid.C:528
 TOFpid.C:529
 TOFpid.C:530
 TOFpid.C:531
 TOFpid.C:532
 TOFpid.C:533
 TOFpid.C:534
 TOFpid.C:535
 TOFpid.C:536
 TOFpid.C:537
 TOFpid.C:538
 TOFpid.C:539
 TOFpid.C:540
 TOFpid.C:541
 TOFpid.C:542
 TOFpid.C:543
 TOFpid.C:544
 TOFpid.C:545
 TOFpid.C:546
 TOFpid.C:547
 TOFpid.C:548
 TOFpid.C:549
 TOFpid.C:550
 TOFpid.C:551
 TOFpid.C:552
 TOFpid.C:553
 TOFpid.C:554
 TOFpid.C:555
 TOFpid.C:556
 TOFpid.C:557
 TOFpid.C:558
 TOFpid.C:559
 TOFpid.C:560
 TOFpid.C:561
 TOFpid.C:562
 TOFpid.C:563
 TOFpid.C:564
 TOFpid.C:565
 TOFpid.C:566
 TOFpid.C:567
 TOFpid.C:568
 TOFpid.C:569
 TOFpid.C:570
 TOFpid.C:571
 TOFpid.C:572
 TOFpid.C:573
 TOFpid.C:574
 TOFpid.C:575
 TOFpid.C:576
 TOFpid.C:577
 TOFpid.C:578
 TOFpid.C:579
 TOFpid.C:580
 TOFpid.C:581
 TOFpid.C:582
 TOFpid.C:583
 TOFpid.C:584
 TOFpid.C:585
 TOFpid.C:586
 TOFpid.C:587
 TOFpid.C:588
 TOFpid.C:589
 TOFpid.C:590
 TOFpid.C:591
 TOFpid.C:592
 TOFpid.C:593
 TOFpid.C:594
 TOFpid.C:595
 TOFpid.C:596
 TOFpid.C:597
 TOFpid.C:598
 TOFpid.C:599
 TOFpid.C:600
 TOFpid.C:601
 TOFpid.C:602
 TOFpid.C:603
 TOFpid.C:604
 TOFpid.C:605
 TOFpid.C:606
 TOFpid.C:607
 TOFpid.C:608
 TOFpid.C:609
 TOFpid.C:610
 TOFpid.C:611
 TOFpid.C:612
 TOFpid.C:613
 TOFpid.C:614
 TOFpid.C:615
 TOFpid.C:616
 TOFpid.C:617
 TOFpid.C:618
 TOFpid.C:619
 TOFpid.C:620
 TOFpid.C:621
 TOFpid.C:622
 TOFpid.C:623
 TOFpid.C:624
 TOFpid.C:625
 TOFpid.C:626
 TOFpid.C:627
 TOFpid.C:628
 TOFpid.C:629
 TOFpid.C:630
 TOFpid.C:631
 TOFpid.C:632
 TOFpid.C:633
 TOFpid.C:634
 TOFpid.C:635
 TOFpid.C:636
 TOFpid.C:637
 TOFpid.C:638
 TOFpid.C:639
 TOFpid.C:640
 TOFpid.C:641
 TOFpid.C:642
 TOFpid.C:643
 TOFpid.C:644
 TOFpid.C:645
 TOFpid.C:646
 TOFpid.C:647
 TOFpid.C:648
 TOFpid.C:649
 TOFpid.C:650
 TOFpid.C:651
 TOFpid.C:652
 TOFpid.C:653
 TOFpid.C:654
 TOFpid.C:655
 TOFpid.C:656
 TOFpid.C:657
 TOFpid.C:658
 TOFpid.C:659
 TOFpid.C:660
 TOFpid.C:661
 TOFpid.C:662
 TOFpid.C:663
 TOFpid.C:664
 TOFpid.C:665
 TOFpid.C:666
 TOFpid.C:667
 TOFpid.C:668
 TOFpid.C:669
 TOFpid.C:670
 TOFpid.C:671
 TOFpid.C:672
 TOFpid.C:673
 TOFpid.C:674
 TOFpid.C:675
 TOFpid.C:676
 TOFpid.C:677
 TOFpid.C:678
 TOFpid.C:679
 TOFpid.C:680
 TOFpid.C:681
 TOFpid.C:682
 TOFpid.C:683
 TOFpid.C:684
 TOFpid.C:685
 TOFpid.C:686
 TOFpid.C:687
 TOFpid.C:688
 TOFpid.C:689
 TOFpid.C:690
 TOFpid.C:691
 TOFpid.C:692
 TOFpid.C:693
 TOFpid.C:694
 TOFpid.C:695
 TOFpid.C:696
 TOFpid.C:697
 TOFpid.C:698
 TOFpid.C:699
 TOFpid.C:700
 TOFpid.C:701
 TOFpid.C:702
 TOFpid.C:703
 TOFpid.C:704
 TOFpid.C:705
 TOFpid.C:706
 TOFpid.C:707
 TOFpid.C:708
 TOFpid.C:709
 TOFpid.C:710
 TOFpid.C:711
 TOFpid.C:712
 TOFpid.C:713
 TOFpid.C:714
 TOFpid.C:715
 TOFpid.C:716
 TOFpid.C:717
 TOFpid.C:718
 TOFpid.C:719
 TOFpid.C:720
 TOFpid.C:721
 TOFpid.C:722
 TOFpid.C:723
 TOFpid.C:724
 TOFpid.C:725
 TOFpid.C:726
 TOFpid.C:727
 TOFpid.C:728
 TOFpid.C:729
 TOFpid.C:730
 TOFpid.C:731
 TOFpid.C:732
 TOFpid.C:733
 TOFpid.C:734
 TOFpid.C:735
 TOFpid.C:736
 TOFpid.C:737
 TOFpid.C:738
 TOFpid.C:739
 TOFpid.C:740
 TOFpid.C:741
 TOFpid.C:742
 TOFpid.C:743
 TOFpid.C:744
 TOFpid.C:745
 TOFpid.C:746
 TOFpid.C:747
 TOFpid.C:748
 TOFpid.C:749
 TOFpid.C:750
 TOFpid.C:751
 TOFpid.C:752
 TOFpid.C:753
 TOFpid.C:754
 TOFpid.C:755
 TOFpid.C:756
 TOFpid.C:757
 TOFpid.C:758
 TOFpid.C:759
 TOFpid.C:760
 TOFpid.C:761
 TOFpid.C:762
 TOFpid.C:763
 TOFpid.C:764
 TOFpid.C:765
 TOFpid.C:766
 TOFpid.C:767
 TOFpid.C:768
 TOFpid.C:769
 TOFpid.C:770
 TOFpid.C:771
 TOFpid.C:772
 TOFpid.C:773
 TOFpid.C:774
 TOFpid.C:775
 TOFpid.C:776
 TOFpid.C:777
 TOFpid.C:778
 TOFpid.C:779
 TOFpid.C:780
 TOFpid.C:781
 TOFpid.C:782
 TOFpid.C:783
 TOFpid.C:784
 TOFpid.C:785
 TOFpid.C:786
 TOFpid.C:787
 TOFpid.C:788
 TOFpid.C:789
 TOFpid.C:790
 TOFpid.C:791
 TOFpid.C:792
 TOFpid.C:793
 TOFpid.C:794
 TOFpid.C:795
 TOFpid.C:796
 TOFpid.C:797
 TOFpid.C:798
 TOFpid.C:799
 TOFpid.C:800
 TOFpid.C:801
 TOFpid.C:802
 TOFpid.C:803
 TOFpid.C:804
 TOFpid.C:805
 TOFpid.C:806
 TOFpid.C:807
 TOFpid.C:808
 TOFpid.C:809
 TOFpid.C:810
 TOFpid.C:811
 TOFpid.C:812
 TOFpid.C:813
 TOFpid.C:814
 TOFpid.C:815
 TOFpid.C:816
 TOFpid.C:817
 TOFpid.C:818
 TOFpid.C:819
 TOFpid.C:820
 TOFpid.C:821
 TOFpid.C:822
 TOFpid.C:823
 TOFpid.C:824
 TOFpid.C:825
 TOFpid.C:826
 TOFpid.C:827
 TOFpid.C:828
 TOFpid.C:829
 TOFpid.C:830
 TOFpid.C:831
 TOFpid.C:832
 TOFpid.C:833
 TOFpid.C:834
 TOFpid.C:835
 TOFpid.C:836
 TOFpid.C:837
 TOFpid.C:838
 TOFpid.C:839
 TOFpid.C:840
 TOFpid.C:841
 TOFpid.C:842
 TOFpid.C:843
 TOFpid.C:844
 TOFpid.C:845
 TOFpid.C:846
 TOFpid.C:847
 TOFpid.C:848
 TOFpid.C:849
 TOFpid.C:850
 TOFpid.C:851
 TOFpid.C:852
 TOFpid.C:853
 TOFpid.C:854
 TOFpid.C:855
 TOFpid.C:856
 TOFpid.C:857
 TOFpid.C:858
 TOFpid.C:859
 TOFpid.C:860
 TOFpid.C:861
 TOFpid.C:862
 TOFpid.C:863
 TOFpid.C:864
 TOFpid.C:865
 TOFpid.C:866
 TOFpid.C:867
 TOFpid.C:868
 TOFpid.C:869
 TOFpid.C:870
 TOFpid.C:871
 TOFpid.C:872
 TOFpid.C:873
 TOFpid.C:874
 TOFpid.C:875
 TOFpid.C:876
 TOFpid.C:877
 TOFpid.C:878
 TOFpid.C:879
 TOFpid.C:880
 TOFpid.C:881
 TOFpid.C:882
 TOFpid.C:883
 TOFpid.C:884
 TOFpid.C:885
 TOFpid.C:886
 TOFpid.C:887
 TOFpid.C:888
 TOFpid.C:889
 TOFpid.C:890
 TOFpid.C:891
 TOFpid.C:892
 TOFpid.C:893
 TOFpid.C:894
 TOFpid.C:895
 TOFpid.C:896
 TOFpid.C:897
 TOFpid.C:898
 TOFpid.C:899
 TOFpid.C:900
 TOFpid.C:901
 TOFpid.C:902
 TOFpid.C:903
 TOFpid.C:904
 TOFpid.C:905
 TOFpid.C:906
 TOFpid.C:907
 TOFpid.C:908
 TOFpid.C:909
 TOFpid.C:910
 TOFpid.C:911
 TOFpid.C:912
 TOFpid.C:913
 TOFpid.C:914
 TOFpid.C:915
 TOFpid.C:916
 TOFpid.C:917
 TOFpid.C:918
 TOFpid.C:919
 TOFpid.C:920
 TOFpid.C:921
 TOFpid.C:922
 TOFpid.C:923
 TOFpid.C:924
 TOFpid.C:925
 TOFpid.C:926
 TOFpid.C:927
 TOFpid.C:928
 TOFpid.C:929
 TOFpid.C:930
 TOFpid.C:931
 TOFpid.C:932
 TOFpid.C:933
 TOFpid.C:934
 TOFpid.C:935
 TOFpid.C:936
 TOFpid.C:937
 TOFpid.C:938
 TOFpid.C:939
 TOFpid.C:940
 TOFpid.C:941
 TOFpid.C:942
 TOFpid.C:943
 TOFpid.C:944
 TOFpid.C:945
 TOFpid.C:946
 TOFpid.C:947
 TOFpid.C:948
 TOFpid.C:949
 TOFpid.C:950
 TOFpid.C:951
 TOFpid.C:952
 TOFpid.C:953
 TOFpid.C:954
 TOFpid.C:955
 TOFpid.C:956
 TOFpid.C:957
 TOFpid.C:958
 TOFpid.C:959
 TOFpid.C:960
 TOFpid.C:961
 TOFpid.C:962
 TOFpid.C:963
 TOFpid.C:964
 TOFpid.C:965
 TOFpid.C:966
 TOFpid.C:967
 TOFpid.C:968
 TOFpid.C:969
 TOFpid.C:970
 TOFpid.C:971
 TOFpid.C:972
 TOFpid.C:973
 TOFpid.C:974
 TOFpid.C:975
 TOFpid.C:976
 TOFpid.C:977
 TOFpid.C:978
 TOFpid.C:979
 TOFpid.C:980
 TOFpid.C:981
 TOFpid.C:982
 TOFpid.C:983
 TOFpid.C:984
 TOFpid.C:985
 TOFpid.C:986
 TOFpid.C:987
 TOFpid.C:988
 TOFpid.C:989
 TOFpid.C:990
 TOFpid.C:991
 TOFpid.C:992
 TOFpid.C:993
 TOFpid.C:994
 TOFpid.C:995
 TOFpid.C:996
 TOFpid.C:997
 TOFpid.C:998
 TOFpid.C:999
 TOFpid.C:1000
 TOFpid.C:1001
 TOFpid.C:1002
 TOFpid.C:1003
 TOFpid.C:1004
 TOFpid.C:1005
 TOFpid.C:1006
 TOFpid.C:1007
 TOFpid.C:1008
 TOFpid.C:1009
 TOFpid.C:1010
 TOFpid.C:1011
 TOFpid.C:1012
 TOFpid.C:1013
 TOFpid.C:1014
 TOFpid.C:1015
 TOFpid.C:1016
 TOFpid.C:1017
 TOFpid.C:1018
 TOFpid.C:1019
 TOFpid.C:1020
 TOFpid.C:1021
 TOFpid.C:1022
 TOFpid.C:1023
 TOFpid.C:1024
 TOFpid.C:1025
 TOFpid.C:1026
 TOFpid.C:1027
 TOFpid.C:1028
 TOFpid.C:1029
 TOFpid.C:1030
 TOFpid.C:1031
 TOFpid.C:1032
 TOFpid.C:1033
 TOFpid.C:1034
 TOFpid.C:1035
 TOFpid.C:1036
 TOFpid.C:1037
 TOFpid.C:1038
 TOFpid.C:1039
 TOFpid.C:1040
 TOFpid.C:1041
 TOFpid.C:1042
 TOFpid.C:1043
 TOFpid.C:1044
 TOFpid.C:1045
 TOFpid.C:1046
 TOFpid.C:1047
 TOFpid.C:1048
 TOFpid.C:1049
 TOFpid.C:1050
 TOFpid.C:1051
 TOFpid.C:1052
 TOFpid.C:1053
 TOFpid.C:1054
 TOFpid.C:1055
 TOFpid.C:1056
 TOFpid.C:1057
 TOFpid.C:1058
 TOFpid.C:1059
 TOFpid.C:1060
 TOFpid.C:1061
 TOFpid.C:1062
 TOFpid.C:1063
 TOFpid.C:1064
 TOFpid.C:1065
 TOFpid.C:1066
 TOFpid.C:1067
 TOFpid.C:1068
 TOFpid.C:1069
 TOFpid.C:1070
 TOFpid.C:1071
 TOFpid.C:1072
 TOFpid.C:1073
 TOFpid.C:1074
 TOFpid.C:1075
 TOFpid.C:1076
 TOFpid.C:1077
 TOFpid.C:1078
 TOFpid.C:1079
 TOFpid.C:1080
 TOFpid.C:1081
 TOFpid.C:1082
 TOFpid.C:1083
 TOFpid.C:1084
 TOFpid.C:1085
 TOFpid.C:1086
 TOFpid.C:1087
 TOFpid.C:1088
 TOFpid.C:1089
 TOFpid.C:1090
 TOFpid.C:1091
 TOFpid.C:1092
 TOFpid.C:1093
 TOFpid.C:1094
 TOFpid.C:1095
 TOFpid.C:1096
 TOFpid.C:1097
 TOFpid.C:1098
 TOFpid.C:1099
 TOFpid.C:1100
 TOFpid.C:1101
 TOFpid.C:1102
 TOFpid.C:1103
 TOFpid.C:1104
 TOFpid.C:1105
 TOFpid.C:1106
 TOFpid.C:1107
 TOFpid.C:1108
 TOFpid.C:1109
 TOFpid.C:1110
 TOFpid.C:1111
 TOFpid.C:1112
 TOFpid.C:1113
 TOFpid.C:1114
 TOFpid.C:1115
 TOFpid.C:1116
 TOFpid.C:1117
 TOFpid.C:1118
 TOFpid.C:1119
 TOFpid.C:1120
 TOFpid.C:1121
 TOFpid.C:1122
 TOFpid.C:1123
 TOFpid.C:1124
 TOFpid.C:1125
 TOFpid.C:1126
 TOFpid.C:1127
 TOFpid.C:1128
 TOFpid.C:1129
 TOFpid.C:1130
 TOFpid.C:1131
 TOFpid.C:1132
 TOFpid.C:1133
 TOFpid.C:1134
 TOFpid.C:1135
 TOFpid.C:1136
 TOFpid.C:1137
 TOFpid.C:1138
 TOFpid.C:1139
 TOFpid.C:1140
 TOFpid.C:1141
 TOFpid.C:1142
 TOFpid.C:1143
 TOFpid.C:1144
 TOFpid.C:1145
 TOFpid.C:1146
 TOFpid.C:1147
 TOFpid.C:1148
 TOFpid.C:1149
 TOFpid.C:1150
 TOFpid.C:1151
 TOFpid.C:1152
 TOFpid.C:1153
 TOFpid.C:1154
 TOFpid.C:1155
 TOFpid.C:1156
 TOFpid.C:1157
 TOFpid.C:1158
 TOFpid.C:1159
 TOFpid.C:1160
 TOFpid.C:1161
 TOFpid.C:1162
 TOFpid.C:1163
 TOFpid.C:1164
 TOFpid.C:1165
 TOFpid.C:1166
 TOFpid.C:1167
 TOFpid.C:1168
 TOFpid.C:1169
 TOFpid.C:1170
 TOFpid.C:1171
 TOFpid.C:1172
 TOFpid.C:1173
 TOFpid.C:1174
 TOFpid.C:1175
 TOFpid.C:1176
 TOFpid.C:1177
 TOFpid.C:1178
 TOFpid.C:1179
 TOFpid.C:1180
 TOFpid.C:1181
 TOFpid.C:1182
 TOFpid.C:1183
 TOFpid.C:1184
 TOFpid.C:1185
 TOFpid.C:1186
 TOFpid.C:1187
 TOFpid.C:1188
 TOFpid.C:1189
 TOFpid.C:1190
 TOFpid.C:1191
 TOFpid.C:1192
 TOFpid.C:1193
 TOFpid.C:1194
 TOFpid.C:1195
 TOFpid.C:1196
 TOFpid.C:1197
 TOFpid.C:1198
 TOFpid.C:1199
 TOFpid.C:1200
 TOFpid.C:1201
 TOFpid.C:1202
 TOFpid.C:1203
 TOFpid.C:1204
 TOFpid.C:1205
 TOFpid.C:1206
 TOFpid.C:1207
 TOFpid.C:1208
 TOFpid.C:1209
 TOFpid.C:1210
 TOFpid.C:1211
 TOFpid.C:1212
 TOFpid.C:1213
 TOFpid.C:1214
 TOFpid.C:1215
 TOFpid.C:1216
 TOFpid.C:1217
 TOFpid.C:1218
 TOFpid.C:1219
 TOFpid.C:1220
 TOFpid.C:1221
 TOFpid.C:1222
 TOFpid.C:1223
 TOFpid.C:1224
 TOFpid.C:1225
 TOFpid.C:1226
 TOFpid.C:1227
 TOFpid.C:1228
 TOFpid.C:1229
 TOFpid.C:1230
 TOFpid.C:1231
 TOFpid.C:1232
 TOFpid.C:1233
 TOFpid.C:1234
 TOFpid.C:1235
 TOFpid.C:1236
 TOFpid.C:1237
 TOFpid.C:1238
 TOFpid.C:1239
 TOFpid.C:1240
 TOFpid.C:1241
 TOFpid.C:1242
 TOFpid.C:1243
 TOFpid.C:1244
 TOFpid.C:1245
 TOFpid.C:1246
 TOFpid.C:1247
 TOFpid.C:1248
 TOFpid.C:1249
 TOFpid.C:1250
 TOFpid.C:1251
 TOFpid.C:1252
 TOFpid.C:1253
 TOFpid.C:1254
 TOFpid.C:1255
 TOFpid.C:1256
 TOFpid.C:1257
 TOFpid.C:1258
 TOFpid.C:1259
 TOFpid.C:1260
 TOFpid.C:1261
 TOFpid.C:1262
 TOFpid.C:1263
 TOFpid.C:1264
 TOFpid.C:1265
 TOFpid.C:1266
 TOFpid.C:1267
 TOFpid.C:1268
 TOFpid.C:1269
 TOFpid.C:1270
 TOFpid.C:1271
 TOFpid.C:1272
 TOFpid.C:1273
 TOFpid.C:1274
 TOFpid.C:1275
 TOFpid.C:1276
 TOFpid.C:1277
 TOFpid.C:1278
 TOFpid.C:1279
 TOFpid.C:1280
 TOFpid.C:1281
 TOFpid.C:1282
 TOFpid.C:1283
 TOFpid.C:1284
 TOFpid.C:1285
 TOFpid.C:1286
 TOFpid.C:1287
 TOFpid.C:1288
 TOFpid.C:1289
 TOFpid.C:1290
 TOFpid.C:1291
 TOFpid.C:1292
 TOFpid.C:1293
 TOFpid.C:1294
 TOFpid.C:1295
 TOFpid.C:1296
 TOFpid.C:1297
 TOFpid.C:1298
 TOFpid.C:1299
 TOFpid.C:1300
 TOFpid.C:1301
 TOFpid.C:1302
 TOFpid.C:1303
 TOFpid.C:1304
 TOFpid.C:1305
 TOFpid.C:1306
 TOFpid.C:1307
 TOFpid.C:1308
 TOFpid.C:1309
 TOFpid.C:1310
 TOFpid.C:1311
 TOFpid.C:1312
 TOFpid.C:1313
 TOFpid.C:1314
 TOFpid.C:1315
 TOFpid.C:1316
 TOFpid.C:1317
 TOFpid.C:1318
 TOFpid.C:1319
 TOFpid.C:1320
 TOFpid.C:1321
 TOFpid.C:1322
 TOFpid.C:1323
 TOFpid.C:1324
 TOFpid.C:1325
 TOFpid.C:1326
 TOFpid.C:1327
 TOFpid.C:1328
 TOFpid.C:1329
 TOFpid.C:1330
 TOFpid.C:1331
 TOFpid.C:1332
 TOFpid.C:1333
 TOFpid.C:1334
 TOFpid.C:1335
 TOFpid.C:1336
 TOFpid.C:1337
 TOFpid.C:1338
 TOFpid.C:1339
 TOFpid.C:1340
 TOFpid.C:1341
 TOFpid.C:1342
 TOFpid.C:1343
 TOFpid.C:1344
 TOFpid.C:1345
 TOFpid.C:1346
 TOFpid.C:1347
 TOFpid.C:1348
 TOFpid.C:1349
 TOFpid.C:1350
 TOFpid.C:1351
 TOFpid.C:1352
 TOFpid.C:1353
 TOFpid.C:1354
 TOFpid.C:1355
 TOFpid.C:1356
 TOFpid.C:1357
 TOFpid.C:1358
 TOFpid.C:1359
 TOFpid.C:1360
 TOFpid.C:1361
 TOFpid.C:1362
 TOFpid.C:1363
 TOFpid.C:1364
 TOFpid.C:1365
 TOFpid.C:1366
 TOFpid.C:1367
 TOFpid.C:1368
 TOFpid.C:1369
 TOFpid.C:1370
 TOFpid.C:1371
 TOFpid.C:1372
 TOFpid.C:1373
 TOFpid.C:1374
 TOFpid.C:1375
 TOFpid.C:1376
 TOFpid.C:1377
 TOFpid.C:1378
 TOFpid.C:1379
 TOFpid.C:1380
 TOFpid.C:1381
 TOFpid.C:1382
 TOFpid.C:1383
 TOFpid.C:1384
 TOFpid.C:1385
 TOFpid.C:1386
 TOFpid.C:1387
 TOFpid.C:1388
 TOFpid.C:1389
 TOFpid.C:1390
 TOFpid.C:1391
 TOFpid.C:1392
 TOFpid.C:1393
 TOFpid.C:1394
 TOFpid.C:1395
 TOFpid.C:1396
 TOFpid.C:1397
 TOFpid.C:1398
 TOFpid.C:1399
 TOFpid.C:1400
 TOFpid.C:1401
 TOFpid.C:1402
 TOFpid.C:1403
 TOFpid.C:1404
 TOFpid.C:1405
 TOFpid.C:1406
 TOFpid.C:1407
 TOFpid.C:1408
 TOFpid.C:1409
 TOFpid.C:1410
 TOFpid.C:1411
 TOFpid.C:1412
 TOFpid.C:1413
 TOFpid.C:1414
 TOFpid.C:1415
 TOFpid.C:1416
 TOFpid.C:1417
 TOFpid.C:1418
 TOFpid.C:1419
 TOFpid.C:1420
 TOFpid.C:1421
 TOFpid.C:1422
 TOFpid.C:1423
 TOFpid.C:1424
 TOFpid.C:1425
 TOFpid.C:1426
 TOFpid.C:1427
 TOFpid.C:1428
 TOFpid.C:1429
 TOFpid.C:1430
 TOFpid.C:1431
 TOFpid.C:1432
 TOFpid.C:1433
 TOFpid.C:1434
 TOFpid.C:1435
 TOFpid.C:1436
 TOFpid.C:1437
 TOFpid.C:1438
 TOFpid.C:1439
 TOFpid.C:1440
 TOFpid.C:1441
 TOFpid.C:1442
 TOFpid.C:1443
 TOFpid.C:1444
 TOFpid.C:1445
 TOFpid.C:1446
 TOFpid.C:1447
 TOFpid.C:1448
 TOFpid.C:1449
 TOFpid.C:1450
 TOFpid.C:1451
 TOFpid.C:1452
 TOFpid.C:1453
 TOFpid.C:1454
 TOFpid.C:1455
 TOFpid.C:1456
 TOFpid.C:1457
 TOFpid.C:1458
 TOFpid.C:1459
 TOFpid.C:1460
 TOFpid.C:1461
 TOFpid.C:1462
 TOFpid.C:1463
 TOFpid.C:1464
 TOFpid.C:1465
 TOFpid.C:1466
 TOFpid.C:1467
 TOFpid.C:1468
 TOFpid.C:1469
 TOFpid.C:1470
 TOFpid.C:1471
 TOFpid.C:1472
 TOFpid.C:1473
 TOFpid.C:1474
 TOFpid.C:1475
 TOFpid.C:1476
 TOFpid.C:1477
 TOFpid.C:1478
 TOFpid.C:1479
 TOFpid.C:1480
 TOFpid.C:1481
 TOFpid.C:1482
 TOFpid.C:1483
 TOFpid.C:1484
 TOFpid.C:1485
 TOFpid.C:1486
 TOFpid.C:1487
 TOFpid.C:1488
 TOFpid.C:1489
 TOFpid.C:1490
 TOFpid.C:1491
 TOFpid.C:1492
 TOFpid.C:1493
 TOFpid.C:1494
 TOFpid.C:1495
 TOFpid.C:1496
 TOFpid.C:1497
 TOFpid.C:1498
 TOFpid.C:1499
 TOFpid.C:1500
 TOFpid.C:1501
 TOFpid.C:1502
 TOFpid.C:1503
 TOFpid.C:1504
 TOFpid.C:1505
 TOFpid.C:1506
 TOFpid.C:1507
 TOFpid.C:1508
 TOFpid.C:1509
 TOFpid.C:1510
 TOFpid.C:1511
 TOFpid.C:1512
 TOFpid.C:1513
 TOFpid.C:1514
 TOFpid.C:1515
 TOFpid.C:1516
 TOFpid.C:1517
 TOFpid.C:1518
 TOFpid.C:1519
 TOFpid.C:1520
 TOFpid.C:1521
 TOFpid.C:1522
 TOFpid.C:1523
 TOFpid.C:1524
 TOFpid.C:1525
 TOFpid.C:1526
 TOFpid.C:1527
 TOFpid.C:1528
 TOFpid.C:1529
 TOFpid.C:1530
 TOFpid.C:1531
 TOFpid.C:1532
 TOFpid.C:1533
 TOFpid.C:1534
 TOFpid.C:1535
 TOFpid.C:1536
 TOFpid.C:1537
 TOFpid.C:1538
 TOFpid.C:1539
 TOFpid.C:1540
 TOFpid.C:1541
 TOFpid.C:1542
 TOFpid.C:1543
 TOFpid.C:1544
 TOFpid.C:1545
 TOFpid.C:1546
 TOFpid.C:1547
 TOFpid.C:1548
 TOFpid.C:1549
 TOFpid.C:1550
 TOFpid.C:1551
 TOFpid.C:1552
 TOFpid.C:1553
 TOFpid.C:1554
 TOFpid.C:1555
 TOFpid.C:1556
 TOFpid.C:1557
 TOFpid.C:1558
 TOFpid.C:1559
 TOFpid.C:1560
 TOFpid.C:1561
 TOFpid.C:1562
 TOFpid.C:1563
 TOFpid.C:1564
 TOFpid.C:1565
 TOFpid.C:1566
 TOFpid.C:1567
 TOFpid.C:1568
 TOFpid.C:1569
 TOFpid.C:1570
 TOFpid.C:1571
 TOFpid.C:1572
 TOFpid.C:1573
 TOFpid.C:1574
 TOFpid.C:1575
 TOFpid.C:1576
 TOFpid.C:1577
 TOFpid.C:1578
 TOFpid.C:1579
 TOFpid.C:1580
 TOFpid.C:1581
 TOFpid.C:1582
 TOFpid.C:1583
 TOFpid.C:1584
 TOFpid.C:1585
 TOFpid.C:1586
 TOFpid.C:1587
 TOFpid.C:1588
 TOFpid.C:1589
 TOFpid.C:1590
 TOFpid.C:1591
 TOFpid.C:1592
 TOFpid.C:1593
 TOFpid.C:1594
 TOFpid.C:1595
 TOFpid.C:1596
 TOFpid.C:1597
 TOFpid.C:1598
 TOFpid.C:1599
 TOFpid.C:1600
 TOFpid.C:1601
 TOFpid.C:1602
 TOFpid.C:1603
 TOFpid.C:1604
 TOFpid.C:1605
 TOFpid.C:1606
 TOFpid.C:1607
 TOFpid.C:1608
 TOFpid.C:1609
 TOFpid.C:1610
 TOFpid.C:1611
 TOFpid.C:1612
 TOFpid.C:1613
 TOFpid.C:1614
 TOFpid.C:1615
 TOFpid.C:1616
 TOFpid.C:1617
 TOFpid.C:1618
 TOFpid.C:1619
 TOFpid.C:1620
 TOFpid.C:1621
 TOFpid.C:1622
 TOFpid.C:1623
 TOFpid.C:1624
 TOFpid.C:1625
 TOFpid.C:1626
 TOFpid.C:1627
 TOFpid.C:1628
 TOFpid.C:1629
 TOFpid.C:1630
 TOFpid.C:1631
 TOFpid.C:1632
 TOFpid.C:1633
 TOFpid.C:1634
 TOFpid.C:1635
 TOFpid.C:1636
 TOFpid.C:1637
 TOFpid.C:1638
 TOFpid.C:1639
 TOFpid.C:1640
 TOFpid.C:1641
 TOFpid.C:1642
 TOFpid.C:1643
 TOFpid.C:1644
 TOFpid.C:1645
 TOFpid.C:1646
 TOFpid.C:1647
 TOFpid.C:1648
 TOFpid.C:1649
 TOFpid.C:1650
 TOFpid.C:1651
 TOFpid.C:1652
 TOFpid.C:1653
 TOFpid.C:1654
 TOFpid.C:1655
 TOFpid.C:1656
 TOFpid.C:1657
 TOFpid.C:1658
 TOFpid.C:1659
 TOFpid.C:1660
 TOFpid.C:1661
 TOFpid.C:1662
 TOFpid.C:1663
 TOFpid.C:1664
 TOFpid.C:1665
 TOFpid.C:1666
 TOFpid.C:1667
 TOFpid.C:1668
 TOFpid.C:1669
 TOFpid.C:1670
 TOFpid.C:1671
 TOFpid.C:1672
 TOFpid.C:1673
 TOFpid.C:1674
 TOFpid.C:1675
 TOFpid.C:1676
 TOFpid.C:1677
 TOFpid.C:1678
 TOFpid.C:1679
 TOFpid.C:1680
 TOFpid.C:1681
 TOFpid.C:1682
 TOFpid.C:1683
 TOFpid.C:1684
 TOFpid.C:1685
 TOFpid.C:1686
 TOFpid.C:1687
 TOFpid.C:1688
 TOFpid.C:1689
 TOFpid.C:1690
 TOFpid.C:1691
 TOFpid.C:1692
 TOFpid.C:1693
 TOFpid.C:1694
 TOFpid.C:1695
 TOFpid.C:1696
 TOFpid.C:1697
 TOFpid.C:1698
 TOFpid.C:1699
 TOFpid.C:1700
 TOFpid.C:1701
 TOFpid.C:1702
 TOFpid.C:1703
 TOFpid.C:1704
 TOFpid.C:1705
 TOFpid.C:1706
 TOFpid.C:1707
 TOFpid.C:1708
 TOFpid.C:1709
 TOFpid.C:1710
 TOFpid.C:1711
 TOFpid.C:1712
 TOFpid.C:1713
 TOFpid.C:1714
 TOFpid.C:1715
 TOFpid.C:1716
 TOFpid.C:1717
 TOFpid.C:1718
 TOFpid.C:1719
 TOFpid.C:1720
 TOFpid.C:1721
 TOFpid.C:1722
 TOFpid.C:1723
 TOFpid.C:1724
 TOFpid.C:1725
 TOFpid.C:1726
 TOFpid.C:1727
 TOFpid.C:1728
 TOFpid.C:1729
 TOFpid.C:1730
 TOFpid.C:1731
 TOFpid.C:1732
 TOFpid.C:1733
 TOFpid.C:1734
 TOFpid.C:1735
 TOFpid.C:1736
 TOFpid.C:1737
 TOFpid.C:1738
 TOFpid.C:1739
 TOFpid.C:1740
 TOFpid.C:1741
 TOFpid.C:1742
 TOFpid.C:1743
 TOFpid.C:1744
 TOFpid.C:1745
 TOFpid.C:1746
 TOFpid.C:1747
 TOFpid.C:1748
 TOFpid.C:1749
 TOFpid.C:1750
 TOFpid.C:1751
 TOFpid.C:1752
 TOFpid.C:1753
 TOFpid.C:1754
 TOFpid.C:1755
 TOFpid.C:1756
 TOFpid.C:1757
 TOFpid.C:1758
 TOFpid.C:1759
 TOFpid.C:1760
 TOFpid.C:1761
 TOFpid.C:1762
 TOFpid.C:1763
 TOFpid.C:1764
 TOFpid.C:1765
 TOFpid.C:1766
 TOFpid.C:1767
 TOFpid.C:1768
 TOFpid.C:1769
 TOFpid.C:1770
 TOFpid.C:1771
 TOFpid.C:1772
 TOFpid.C:1773
 TOFpid.C:1774
 TOFpid.C:1775
 TOFpid.C:1776
 TOFpid.C:1777
 TOFpid.C:1778
 TOFpid.C:1779
 TOFpid.C:1780
 TOFpid.C:1781
 TOFpid.C:1782
 TOFpid.C:1783
 TOFpid.C:1784
 TOFpid.C:1785
 TOFpid.C:1786
 TOFpid.C:1787
 TOFpid.C:1788
 TOFpid.C:1789
 TOFpid.C:1790
 TOFpid.C:1791
 TOFpid.C:1792
 TOFpid.C:1793
 TOFpid.C:1794
 TOFpid.C:1795
 TOFpid.C:1796
 TOFpid.C:1797
 TOFpid.C:1798
 TOFpid.C:1799
 TOFpid.C:1800
 TOFpid.C:1801
 TOFpid.C:1802
 TOFpid.C:1803
 TOFpid.C:1804
 TOFpid.C:1805
 TOFpid.C:1806
 TOFpid.C:1807
 TOFpid.C:1808
 TOFpid.C:1809
 TOFpid.C:1810
 TOFpid.C:1811
 TOFpid.C:1812
 TOFpid.C:1813
 TOFpid.C:1814
 TOFpid.C:1815
 TOFpid.C:1816
 TOFpid.C:1817
 TOFpid.C:1818
 TOFpid.C:1819
 TOFpid.C:1820
 TOFpid.C:1821
 TOFpid.C:1822
 TOFpid.C:1823
 TOFpid.C:1824
 TOFpid.C:1825
 TOFpid.C:1826
 TOFpid.C:1827
 TOFpid.C:1828
 TOFpid.C:1829
 TOFpid.C:1830
 TOFpid.C:1831
 TOFpid.C:1832
 TOFpid.C:1833
 TOFpid.C:1834
 TOFpid.C:1835
 TOFpid.C:1836
 TOFpid.C:1837
 TOFpid.C:1838
 TOFpid.C:1839
 TOFpid.C:1840
 TOFpid.C:1841
 TOFpid.C:1842
 TOFpid.C:1843
 TOFpid.C:1844
 TOFpid.C:1845
 TOFpid.C:1846
 TOFpid.C:1847
 TOFpid.C:1848
 TOFpid.C:1849
 TOFpid.C:1850
 TOFpid.C:1851
 TOFpid.C:1852
 TOFpid.C:1853
 TOFpid.C:1854
 TOFpid.C:1855
 TOFpid.C:1856
 TOFpid.C:1857
 TOFpid.C:1858
 TOFpid.C:1859
 TOFpid.C:1860
 TOFpid.C:1861
 TOFpid.C:1862
 TOFpid.C:1863
 TOFpid.C:1864
 TOFpid.C:1865
 TOFpid.C:1866
 TOFpid.C:1867
 TOFpid.C:1868
 TOFpid.C:1869
 TOFpid.C:1870
 TOFpid.C:1871
 TOFpid.C:1872
 TOFpid.C:1873
 TOFpid.C:1874
 TOFpid.C:1875
 TOFpid.C:1876
 TOFpid.C:1877
 TOFpid.C:1878
 TOFpid.C:1879
 TOFpid.C:1880
 TOFpid.C:1881
 TOFpid.C:1882
 TOFpid.C:1883
 TOFpid.C:1884
 TOFpid.C:1885
 TOFpid.C:1886
 TOFpid.C:1887
 TOFpid.C:1888
 TOFpid.C:1889
 TOFpid.C:1890
 TOFpid.C:1891
 TOFpid.C:1892
 TOFpid.C:1893
 TOFpid.C:1894
 TOFpid.C:1895
 TOFpid.C:1896
 TOFpid.C:1897
 TOFpid.C:1898
 TOFpid.C:1899
 TOFpid.C:1900
 TOFpid.C:1901
 TOFpid.C:1902
 TOFpid.C:1903
 TOFpid.C:1904
 TOFpid.C:1905
 TOFpid.C:1906
 TOFpid.C:1907
 TOFpid.C:1908
 TOFpid.C:1909
 TOFpid.C:1910
 TOFpid.C:1911
 TOFpid.C:1912
 TOFpid.C:1913
 TOFpid.C:1914
 TOFpid.C:1915
 TOFpid.C:1916
 TOFpid.C:1917
 TOFpid.C:1918
 TOFpid.C:1919
 TOFpid.C:1920
 TOFpid.C:1921
 TOFpid.C:1922
 TOFpid.C:1923
 TOFpid.C:1924
 TOFpid.C:1925
 TOFpid.C:1926
 TOFpid.C:1927
 TOFpid.C:1928
 TOFpid.C:1929
 TOFpid.C:1930
 TOFpid.C:1931
 TOFpid.C:1932
 TOFpid.C:1933
 TOFpid.C:1934
 TOFpid.C:1935
 TOFpid.C:1936
 TOFpid.C:1937
 TOFpid.C:1938
 TOFpid.C:1939
 TOFpid.C:1940
 TOFpid.C:1941
 TOFpid.C:1942
 TOFpid.C:1943
 TOFpid.C:1944
 TOFpid.C:1945
 TOFpid.C:1946
 TOFpid.C:1947
 TOFpid.C:1948
 TOFpid.C:1949
 TOFpid.C:1950
 TOFpid.C:1951
 TOFpid.C:1952
 TOFpid.C:1953
 TOFpid.C:1954
 TOFpid.C:1955
 TOFpid.C:1956
 TOFpid.C:1957
 TOFpid.C:1958
 TOFpid.C:1959
 TOFpid.C:1960
 TOFpid.C:1961
 TOFpid.C:1962
 TOFpid.C:1963
 TOFpid.C:1964
 TOFpid.C:1965
 TOFpid.C:1966
 TOFpid.C:1967
 TOFpid.C:1968
 TOFpid.C:1969
 TOFpid.C:1970
 TOFpid.C:1971
 TOFpid.C:1972
 TOFpid.C:1973
 TOFpid.C:1974
 TOFpid.C:1975
 TOFpid.C:1976
 TOFpid.C:1977
 TOFpid.C:1978
 TOFpid.C:1979
 TOFpid.C:1980
 TOFpid.C:1981
 TOFpid.C:1982
 TOFpid.C:1983
 TOFpid.C:1984
 TOFpid.C:1985
 TOFpid.C:1986
 TOFpid.C:1987
 TOFpid.C:1988
 TOFpid.C:1989
 TOFpid.C:1990
 TOFpid.C:1991
 TOFpid.C:1992
 TOFpid.C:1993
 TOFpid.C:1994
 TOFpid.C:1995
 TOFpid.C:1996
 TOFpid.C:1997
 TOFpid.C:1998
 TOFpid.C:1999
 TOFpid.C:2000
 TOFpid.C:2001
 TOFpid.C:2002
 TOFpid.C:2003
 TOFpid.C:2004
 TOFpid.C:2005
 TOFpid.C:2006
 TOFpid.C:2007
 TOFpid.C:2008
 TOFpid.C:2009
 TOFpid.C:2010
 TOFpid.C:2011
 TOFpid.C:2012
 TOFpid.C:2013
 TOFpid.C:2014
 TOFpid.C:2015
 TOFpid.C:2016
 TOFpid.C:2017
 TOFpid.C:2018
 TOFpid.C:2019
 TOFpid.C:2020
 TOFpid.C:2021
 TOFpid.C:2022
 TOFpid.C:2023
 TOFpid.C:2024
 TOFpid.C:2025
 TOFpid.C:2026
 TOFpid.C:2027
 TOFpid.C:2028
 TOFpid.C:2029
 TOFpid.C:2030
 TOFpid.C:2031
 TOFpid.C:2032
 TOFpid.C:2033
 TOFpid.C:2034
 TOFpid.C:2035
 TOFpid.C:2036
 TOFpid.C:2037
 TOFpid.C:2038
 TOFpid.C:2039
 TOFpid.C:2040
 TOFpid.C:2041
 TOFpid.C:2042
 TOFpid.C:2043
 TOFpid.C:2044
 TOFpid.C:2045
 TOFpid.C:2046
 TOFpid.C:2047
 TOFpid.C:2048
 TOFpid.C:2049
 TOFpid.C:2050
 TOFpid.C:2051
 TOFpid.C:2052
 TOFpid.C:2053
 TOFpid.C:2054
 TOFpid.C:2055
 TOFpid.C:2056
 TOFpid.C:2057
 TOFpid.C:2058
 TOFpid.C:2059
 TOFpid.C:2060
 TOFpid.C:2061
 TOFpid.C:2062
 TOFpid.C:2063
 TOFpid.C:2064
 TOFpid.C:2065
 TOFpid.C:2066
 TOFpid.C:2067
 TOFpid.C:2068
 TOFpid.C:2069
 TOFpid.C:2070
 TOFpid.C:2071
 TOFpid.C:2072
 TOFpid.C:2073
 TOFpid.C:2074
 TOFpid.C:2075
 TOFpid.C:2076
 TOFpid.C:2077
 TOFpid.C:2078
 TOFpid.C:2079
 TOFpid.C:2080
 TOFpid.C:2081
 TOFpid.C:2082
 TOFpid.C:2083
 TOFpid.C:2084
 TOFpid.C:2085
 TOFpid.C:2086
 TOFpid.C:2087
 TOFpid.C:2088
 TOFpid.C:2089
 TOFpid.C:2090
 TOFpid.C:2091
 TOFpid.C:2092
 TOFpid.C:2093
 TOFpid.C:2094
 TOFpid.C:2095
 TOFpid.C:2096
 TOFpid.C:2097
 TOFpid.C:2098
 TOFpid.C:2099
 TOFpid.C:2100
 TOFpid.C:2101
 TOFpid.C:2102
 TOFpid.C:2103
 TOFpid.C:2104
 TOFpid.C:2105
 TOFpid.C:2106
 TOFpid.C:2107
 TOFpid.C:2108
 TOFpid.C:2109
 TOFpid.C:2110
 TOFpid.C:2111
 TOFpid.C:2112
 TOFpid.C:2113
 TOFpid.C:2114
 TOFpid.C:2115
 TOFpid.C:2116
 TOFpid.C:2117
 TOFpid.C:2118
 TOFpid.C:2119
 TOFpid.C:2120
 TOFpid.C:2121
 TOFpid.C:2122
 TOFpid.C:2123
 TOFpid.C:2124
 TOFpid.C:2125
 TOFpid.C:2126
 TOFpid.C:2127
 TOFpid.C:2128
 TOFpid.C:2129
 TOFpid.C:2130
 TOFpid.C:2131
 TOFpid.C:2132
 TOFpid.C:2133
 TOFpid.C:2134
 TOFpid.C:2135
 TOFpid.C:2136
 TOFpid.C:2137
 TOFpid.C:2138
 TOFpid.C:2139
 TOFpid.C:2140
 TOFpid.C:2141
 TOFpid.C:2142
 TOFpid.C:2143
 TOFpid.C:2144
 TOFpid.C:2145
 TOFpid.C:2146
 TOFpid.C:2147
 TOFpid.C:2148
 TOFpid.C:2149
 TOFpid.C:2150
 TOFpid.C:2151
 TOFpid.C:2152
 TOFpid.C:2153
 TOFpid.C:2154
 TOFpid.C:2155
 TOFpid.C:2156
 TOFpid.C:2157
 TOFpid.C:2158
 TOFpid.C:2159
 TOFpid.C:2160
 TOFpid.C:2161
 TOFpid.C:2162
 TOFpid.C:2163
 TOFpid.C:2164
 TOFpid.C:2165
 TOFpid.C:2166
 TOFpid.C:2167
 TOFpid.C:2168
 TOFpid.C:2169
 TOFpid.C:2170
 TOFpid.C:2171
 TOFpid.C:2172
 TOFpid.C:2173
 TOFpid.C:2174
 TOFpid.C:2175
 TOFpid.C:2176
 TOFpid.C:2177
 TOFpid.C:2178
 TOFpid.C:2179
 TOFpid.C:2180
 TOFpid.C:2181
 TOFpid.C:2182
 TOFpid.C:2183
 TOFpid.C:2184
 TOFpid.C:2185
 TOFpid.C:2186
 TOFpid.C:2187
 TOFpid.C:2188
 TOFpid.C:2189
 TOFpid.C:2190
 TOFpid.C:2191
 TOFpid.C:2192
 TOFpid.C:2193
 TOFpid.C:2194
 TOFpid.C:2195
 TOFpid.C:2196
 TOFpid.C:2197
 TOFpid.C:2198
 TOFpid.C:2199
 TOFpid.C:2200
 TOFpid.C:2201
 TOFpid.C:2202
 TOFpid.C:2203
 TOFpid.C:2204
 TOFpid.C:2205
 TOFpid.C:2206
 TOFpid.C:2207
 TOFpid.C:2208
 TOFpid.C:2209
 TOFpid.C:2210
 TOFpid.C:2211
 TOFpid.C:2212
 TOFpid.C:2213
 TOFpid.C:2214
 TOFpid.C:2215
 TOFpid.C:2216
 TOFpid.C:2217
 TOFpid.C:2218
 TOFpid.C:2219
 TOFpid.C:2220
 TOFpid.C:2221
 TOFpid.C:2222
 TOFpid.C:2223
 TOFpid.C:2224
 TOFpid.C:2225
 TOFpid.C:2226
 TOFpid.C:2227
 TOFpid.C:2228
 TOFpid.C:2229
 TOFpid.C:2230
 TOFpid.C:2231
 TOFpid.C:2232
 TOFpid.C:2233
 TOFpid.C:2234
 TOFpid.C:2235
 TOFpid.C:2236
 TOFpid.C:2237
 TOFpid.C:2238
 TOFpid.C:2239
 TOFpid.C:2240
 TOFpid.C:2241
 TOFpid.C:2242
 TOFpid.C:2243
 TOFpid.C:2244
 TOFpid.C:2245
 TOFpid.C:2246
 TOFpid.C:2247
 TOFpid.C:2248
 TOFpid.C:2249
 TOFpid.C:2250
 TOFpid.C:2251
 TOFpid.C:2252
 TOFpid.C:2253
 TOFpid.C:2254
 TOFpid.C:2255
 TOFpid.C:2256
 TOFpid.C:2257
 TOFpid.C:2258
 TOFpid.C:2259
 TOFpid.C:2260
 TOFpid.C:2261
 TOFpid.C:2262
 TOFpid.C:2263
 TOFpid.C:2264
 TOFpid.C:2265
 TOFpid.C:2266
 TOFpid.C:2267
 TOFpid.C:2268
 TOFpid.C:2269
 TOFpid.C:2270
 TOFpid.C:2271
 TOFpid.C:2272
 TOFpid.C:2273
 TOFpid.C:2274
 TOFpid.C:2275
 TOFpid.C:2276
 TOFpid.C:2277
 TOFpid.C:2278
 TOFpid.C:2279
 TOFpid.C:2280
 TOFpid.C:2281
 TOFpid.C:2282
 TOFpid.C:2283
 TOFpid.C:2284
 TOFpid.C:2285
 TOFpid.C:2286
 TOFpid.C:2287
 TOFpid.C:2288
 TOFpid.C:2289
 TOFpid.C:2290
 TOFpid.C:2291
 TOFpid.C:2292
 TOFpid.C:2293
 TOFpid.C:2294
 TOFpid.C:2295
 TOFpid.C:2296
 TOFpid.C:2297
 TOFpid.C:2298
 TOFpid.C:2299
 TOFpid.C:2300
 TOFpid.C:2301
 TOFpid.C:2302
 TOFpid.C:2303
 TOFpid.C:2304
 TOFpid.C:2305
 TOFpid.C:2306
 TOFpid.C:2307
 TOFpid.C:2308
 TOFpid.C:2309
 TOFpid.C:2310
 TOFpid.C:2311
 TOFpid.C:2312
 TOFpid.C:2313
 TOFpid.C:2314
 TOFpid.C:2315
 TOFpid.C:2316
 TOFpid.C:2317
 TOFpid.C:2318
 TOFpid.C:2319
 TOFpid.C:2320
 TOFpid.C:2321
 TOFpid.C:2322
 TOFpid.C:2323
 TOFpid.C:2324
 TOFpid.C:2325
 TOFpid.C:2326
 TOFpid.C:2327
 TOFpid.C:2328
 TOFpid.C:2329
 TOFpid.C:2330
 TOFpid.C:2331
 TOFpid.C:2332
 TOFpid.C:2333
 TOFpid.C:2334
 TOFpid.C:2335
 TOFpid.C:2336
 TOFpid.C:2337
 TOFpid.C:2338
 TOFpid.C:2339
 TOFpid.C:2340
 TOFpid.C:2341
 TOFpid.C:2342
 TOFpid.C:2343
 TOFpid.C:2344
 TOFpid.C:2345
 TOFpid.C:2346
 TOFpid.C:2347
 TOFpid.C:2348
 TOFpid.C:2349
 TOFpid.C:2350
 TOFpid.C:2351
 TOFpid.C:2352
 TOFpid.C:2353
 TOFpid.C:2354
 TOFpid.C:2355
 TOFpid.C:2356
 TOFpid.C:2357
 TOFpid.C:2358
 TOFpid.C:2359
 TOFpid.C:2360
 TOFpid.C:2361
 TOFpid.C:2362
 TOFpid.C:2363
 TOFpid.C:2364
 TOFpid.C:2365
 TOFpid.C:2366
 TOFpid.C:2367
 TOFpid.C:2368
 TOFpid.C:2369
 TOFpid.C:2370
 TOFpid.C:2371
 TOFpid.C:2372
 TOFpid.C:2373
 TOFpid.C:2374
 TOFpid.C:2375
 TOFpid.C:2376
 TOFpid.C:2377
 TOFpid.C:2378
 TOFpid.C:2379
 TOFpid.C:2380
 TOFpid.C:2381
 TOFpid.C:2382
 TOFpid.C:2383
 TOFpid.C:2384
 TOFpid.C:2385
 TOFpid.C:2386
 TOFpid.C:2387
 TOFpid.C:2388
 TOFpid.C:2389
 TOFpid.C:2390
 TOFpid.C:2391
 TOFpid.C:2392
 TOFpid.C:2393
 TOFpid.C:2394
 TOFpid.C:2395
 TOFpid.C:2396
 TOFpid.C:2397
 TOFpid.C:2398
 TOFpid.C:2399
 TOFpid.C:2400
 TOFpid.C:2401
 TOFpid.C:2402
 TOFpid.C:2403
 TOFpid.C:2404
 TOFpid.C:2405
 TOFpid.C:2406
 TOFpid.C:2407
 TOFpid.C:2408
 TOFpid.C:2409
 TOFpid.C:2410
 TOFpid.C:2411
 TOFpid.C:2412
 TOFpid.C:2413
 TOFpid.C:2414
 TOFpid.C:2415
 TOFpid.C:2416
 TOFpid.C:2417
 TOFpid.C:2418
 TOFpid.C:2419
 TOFpid.C:2420
 TOFpid.C:2421
 TOFpid.C:2422
 TOFpid.C:2423
 TOFpid.C:2424
 TOFpid.C:2425
 TOFpid.C:2426
 TOFpid.C:2427
 TOFpid.C:2428
 TOFpid.C:2429
 TOFpid.C:2430
 TOFpid.C:2431
 TOFpid.C:2432
 TOFpid.C:2433
 TOFpid.C:2434
 TOFpid.C:2435
 TOFpid.C:2436
 TOFpid.C:2437
 TOFpid.C:2438
 TOFpid.C:2439
 TOFpid.C:2440
 TOFpid.C:2441
 TOFpid.C:2442
 TOFpid.C:2443
 TOFpid.C:2444
 TOFpid.C:2445
 TOFpid.C:2446
 TOFpid.C:2447
 TOFpid.C:2448
 TOFpid.C:2449
 TOFpid.C:2450
 TOFpid.C:2451
 TOFpid.C:2452
 TOFpid.C:2453
 TOFpid.C:2454
 TOFpid.C:2455
 TOFpid.C:2456
 TOFpid.C:2457
 TOFpid.C:2458
 TOFpid.C:2459
 TOFpid.C:2460
 TOFpid.C:2461
 TOFpid.C:2462
 TOFpid.C:2463
 TOFpid.C:2464
 TOFpid.C:2465
 TOFpid.C:2466
 TOFpid.C:2467
 TOFpid.C:2468
 TOFpid.C:2469
 TOFpid.C:2470
 TOFpid.C:2471
 TOFpid.C:2472
 TOFpid.C:2473
 TOFpid.C:2474
 TOFpid.C:2475
 TOFpid.C:2476
 TOFpid.C:2477
 TOFpid.C:2478
 TOFpid.C:2479
 TOFpid.C:2480
 TOFpid.C:2481
 TOFpid.C:2482
 TOFpid.C:2483
 TOFpid.C:2484
 TOFpid.C:2485
 TOFpid.C:2486
 TOFpid.C:2487
 TOFpid.C:2488
 TOFpid.C:2489
 TOFpid.C:2490
 TOFpid.C:2491
 TOFpid.C:2492
 TOFpid.C:2493
 TOFpid.C:2494
 TOFpid.C:2495
 TOFpid.C:2496
 TOFpid.C:2497
 TOFpid.C:2498
 TOFpid.C:2499
 TOFpid.C:2500
 TOFpid.C:2501
 TOFpid.C:2502
 TOFpid.C:2503
 TOFpid.C:2504
 TOFpid.C:2505
 TOFpid.C:2506
 TOFpid.C:2507
 TOFpid.C:2508
 TOFpid.C:2509
 TOFpid.C:2510
 TOFpid.C:2511
 TOFpid.C:2512
 TOFpid.C:2513
 TOFpid.C:2514
 TOFpid.C:2515
 TOFpid.C:2516
 TOFpid.C:2517
 TOFpid.C:2518
 TOFpid.C:2519
 TOFpid.C:2520
 TOFpid.C:2521
 TOFpid.C:2522
 TOFpid.C:2523
 TOFpid.C:2524
 TOFpid.C:2525
 TOFpid.C:2526
 TOFpid.C:2527
 TOFpid.C:2528
 TOFpid.C:2529
 TOFpid.C:2530
 TOFpid.C:2531
 TOFpid.C:2532
 TOFpid.C:2533
 TOFpid.C:2534
 TOFpid.C:2535
 TOFpid.C:2536
 TOFpid.C:2537
 TOFpid.C:2538
 TOFpid.C:2539
 TOFpid.C:2540
 TOFpid.C:2541
 TOFpid.C:2542
 TOFpid.C:2543
 TOFpid.C:2544
 TOFpid.C:2545
 TOFpid.C:2546
 TOFpid.C:2547
 TOFpid.C:2548
 TOFpid.C:2549
 TOFpid.C:2550
 TOFpid.C:2551
 TOFpid.C:2552
 TOFpid.C:2553
 TOFpid.C:2554
 TOFpid.C:2555
 TOFpid.C:2556
 TOFpid.C:2557
 TOFpid.C:2558
 TOFpid.C:2559
 TOFpid.C:2560
 TOFpid.C:2561
 TOFpid.C:2562
 TOFpid.C:2563
 TOFpid.C:2564
 TOFpid.C:2565
 TOFpid.C:2566
 TOFpid.C:2567
 TOFpid.C:2568
 TOFpid.C:2569
 TOFpid.C:2570
 TOFpid.C:2571
 TOFpid.C:2572
 TOFpid.C:2573
 TOFpid.C:2574
 TOFpid.C:2575
 TOFpid.C:2576
 TOFpid.C:2577
 TOFpid.C:2578
 TOFpid.C:2579
 TOFpid.C:2580
 TOFpid.C:2581
 TOFpid.C:2582
 TOFpid.C:2583
 TOFpid.C:2584
 TOFpid.C:2585
 TOFpid.C:2586
 TOFpid.C:2587
 TOFpid.C:2588
 TOFpid.C:2589
 TOFpid.C:2590
 TOFpid.C:2591
 TOFpid.C:2592
 TOFpid.C:2593
 TOFpid.C:2594
 TOFpid.C:2595
 TOFpid.C:2596
 TOFpid.C:2597
 TOFpid.C:2598
 TOFpid.C:2599
 TOFpid.C:2600
 TOFpid.C:2601
 TOFpid.C:2602
 TOFpid.C:2603
 TOFpid.C:2604
 TOFpid.C:2605
 TOFpid.C:2606
 TOFpid.C:2607
 TOFpid.C:2608
 TOFpid.C:2609
 TOFpid.C:2610
 TOFpid.C:2611
 TOFpid.C:2612
 TOFpid.C:2613
 TOFpid.C:2614
 TOFpid.C:2615
 TOFpid.C:2616
 TOFpid.C:2617
 TOFpid.C:2618
 TOFpid.C:2619
 TOFpid.C:2620
 TOFpid.C:2621
 TOFpid.C:2622
 TOFpid.C:2623
 TOFpid.C:2624
 TOFpid.C:2625
 TOFpid.C:2626
 TOFpid.C:2627
 TOFpid.C:2628
 TOFpid.C:2629
 TOFpid.C:2630
 TOFpid.C:2631
 TOFpid.C:2632
 TOFpid.C:2633
 TOFpid.C:2634
 TOFpid.C:2635
 TOFpid.C:2636
 TOFpid.C:2637
 TOFpid.C:2638
 TOFpid.C:2639
 TOFpid.C:2640
 TOFpid.C:2641
 TOFpid.C:2642
 TOFpid.C:2643
 TOFpid.C:2644
 TOFpid.C:2645
 TOFpid.C:2646
 TOFpid.C:2647
 TOFpid.C:2648
 TOFpid.C:2649
 TOFpid.C:2650
 TOFpid.C:2651
 TOFpid.C:2652
 TOFpid.C:2653
 TOFpid.C:2654
 TOFpid.C:2655
 TOFpid.C:2656
 TOFpid.C:2657
 TOFpid.C:2658
 TOFpid.C:2659
 TOFpid.C:2660
 TOFpid.C:2661
 TOFpid.C:2662
 TOFpid.C:2663
 TOFpid.C:2664
 TOFpid.C:2665
 TOFpid.C:2666
 TOFpid.C:2667
 TOFpid.C:2668
 TOFpid.C:2669
 TOFpid.C:2670
 TOFpid.C:2671
 TOFpid.C:2672
 TOFpid.C:2673
 TOFpid.C:2674
 TOFpid.C:2675
 TOFpid.C:2676
 TOFpid.C:2677
 TOFpid.C:2678
 TOFpid.C:2679
 TOFpid.C:2680
 TOFpid.C:2681
 TOFpid.C:2682
 TOFpid.C:2683
 TOFpid.C:2684
 TOFpid.C:2685
 TOFpid.C:2686
 TOFpid.C:2687
 TOFpid.C:2688
 TOFpid.C:2689
 TOFpid.C:2690
 TOFpid.C:2691
 TOFpid.C:2692
 TOFpid.C:2693
 TOFpid.C:2694
 TOFpid.C:2695
 TOFpid.C:2696
 TOFpid.C:2697
 TOFpid.C:2698
 TOFpid.C:2699
 TOFpid.C:2700
 TOFpid.C:2701
 TOFpid.C:2702
 TOFpid.C:2703
 TOFpid.C:2704
 TOFpid.C:2705
 TOFpid.C:2706
 TOFpid.C:2707
 TOFpid.C:2708
 TOFpid.C:2709
 TOFpid.C:2710
 TOFpid.C:2711
 TOFpid.C:2712
 TOFpid.C:2713
 TOFpid.C:2714
 TOFpid.C:2715
 TOFpid.C:2716
 TOFpid.C:2717
 TOFpid.C:2718
 TOFpid.C:2719
 TOFpid.C:2720
 TOFpid.C:2721
 TOFpid.C:2722
 TOFpid.C:2723
 TOFpid.C:2724
 TOFpid.C:2725
 TOFpid.C:2726
 TOFpid.C:2727
 TOFpid.C:2728
 TOFpid.C:2729
 TOFpid.C:2730
 TOFpid.C:2731
 TOFpid.C:2732
 TOFpid.C:2733
 TOFpid.C:2734