ROOT logo
#include "CommonDefs.C"

enum EHisto_t {
  kAcceptedTracks,
  kMatchedTracks,
  kMismatchedTracks,
  kUncorrelatedTracks,
  kMatchedCorrelatedTracks,
  kMatchedGoodTracks,
  kNHistos
};
const Char_t *histoName[kNHistos] = {
  "hAcceptedTracks",
  "hMatchedTracks",
  "hMismatchedTracks",
  "hUncorrelatedTracks",
  "hMatchedCorrelatedTracks",
  "hMatchedGoodTracks"
};

enum EParam_t {
  kCentrality,
  kPt,
  kEta,
  kPhi,
  kNParams
};

#define USEHISTOPID 0

TOFmatchEff(const Char_t *filename, Int_t evMax = kMaxInt)
{
  
  /* 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");
 
  /* 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 enabled flag map */
  TH1F *hEnabledFlag = NULL;
  if (enabledChannelsFileName) {
    TFile *enabledfile = TFile::Open(enabledChannelsFileName);
    hEnabledFlag = (TH1F *)enabledfile->Get("hEnabledFlag");
  }

  /* binning */
  for (Int_t ieta = 0; ieta < NetaBins + 1; ieta++)
    etaBin[ieta] = etaMin + ieta * etaStep;
  for (Int_t iphi = 0; iphi < NphiBins + 1; iphi++)
    phiBin[iphi] = phiMin + iphi * phiStep;
  /* THnSparse */
  Int_t NparamBins[kNParams] = {NcentralityBins, NptBins, NetaBins, NphiBins};
  Double_t *paramBin[kNParams] = {centralityBin, ptBin, etaBin, phiBin};
  THnSparseF *hHisto[kNHistos][kNCharges];
  for (Int_t ihisto = 0; ihisto < kNHistos; ihisto++)
    for (Int_t icharge = 0; icharge < kNCharges; icharge++) {
      hHisto[ihisto][icharge] = new THnSparseF(Form("hHisto_%s_%s", histoName[ihisto], chargeName[icharge]), "", kNParams, NparamBins);
      for (Int_t iparam = 0; iparam < kNParams; iparam++)
	hHisto[ihisto][icharge]->SetBinEdges(iparam, paramBin[iparam]);
    }
#if USEHISTOPID
  TH2F *hHistoPID[kNHistos][AliPID::kSPECIES][kNCharges];
  for (Int_t ihisto = 0; ihisto < kNHistos; ihisto++)
    for (Int_t ipart = 0; ipart < AliPID::kSPECIES; ipart++)
      for (Int_t icharge = 0; icharge < kNCharges; icharge++) {



	hHistoPID[ihisto][ipart][icharge] = new TH2F(Form("hHistoPID_%s_%s_%s", histoName[ihisto], AliPID::ParticleName(ipart), chargeName[icharge]), "", NcentralityBins, centralityBin, NptBins, ptBin);
      }
#endif
  /* histos */
  TH2F *hFEAMap = new TH2F("hFEAMap", "", 72, 0., 18., 91, 0., 91.);

  /* start stopwatch */
  TStopwatch timer;
  timer.Start();
  
  /* loop over events */
  Double_t param[kNParams];
  Int_t charge;
  Int_t index, sector, sectorStrip, padx, fea;
  Float_t hitmapx, hitmapy;
  AliTOFcalibHisto calib;
  calib.LoadCalibHisto();
  for (Int_t iev = 0; iev < treein->GetEntries() && iev < evMax; iev++) {
    /* get event */
    treein->GetEvent(iev);
    if (iev % 10000 == 0) printf("iev = %d\n", iev);
    /* check vertex */
    if (!analysisEvent->AcceptEvent(acceptEventType)) continue;

    /*** ACCEPTED EVENT ***/

    /* get centrality */
    param[kCentrality] = analysisEvent->GetCentralityPercentile(centralityEstimator);
    
    /* 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;

      /*** ACCEPTED TRACK ***/
      
      /* get track info */
      param[kPt] = analysisTrack->GetPt();
      param[kEta] = analysisTrack->GetEta();
      param[kPhi] = analysisTrack->GetPhi();
      charge = analysisTrack->GetSign() > 0. ? kPositive : kNegative;
      index = analysisTrack->GetTOFIndex();
      
      /* fill accepted tracks histos */
      hHisto[kAcceptedTracks][charge]->Fill(param);
#if USEHISTOPID
      for (Int_t ipart = 0; ipart < AliPID::kSPECIES; ipart++) {
	
	if (analysisTrack->GetY(AliPID::ParticleMass(ipart)) - rapidityShift > rapidityMaxCut || 
	    analysisTrack->GetY(AliPID::ParticleMass(ipart)) - rapidityShift < rapidityMinCut) continue;

	hHistoPID[kAcceptedTracks][ipart][charge]->Fill(param[kCentrality], param[kPt]);
      }
#endif

      /* check TOF PID */
      if (!analysisTrack->HasTOFPID(hEnabledFlag)) continue;

      /*** ACCEPTED TRACK WITH TOF SIGNAL ***/

      /* fill FEA map */
      sector = calib.GetCalibMap(AliTOFcalibHisto::kSector, index);
      sectorStrip = calib.GetCalibMap(AliTOFcalibHisto::kSectorStrip, index);
      padx = calib.GetCalibMap(AliTOFcalibHisto::kPadX, index);
      fea = padx / 12;
      hitmapx = sector + ((Double_t)(3 - fea) + 0.5) / 4.;
      hitmapy = sectorStrip;
      hFEAMap->Fill(hitmapx, hitmapy);
      
      /* fill matched tracks histos */
      hHisto[kMatchedTracks][charge]->Fill(param);
      if (!analysisTrack->IsMismatchMC()) {
	hHisto[kMatchedGoodTracks][charge]->Fill(param);
	hHisto[kMatchedCorrelatedTracks][charge]->Fill(param);
      }
      else {
	hHisto[kMismatchedTracks][charge]->Fill(param);
	if (!analysisTrack->IsUncorrelatedMismatchMC())
	  hHisto[kMatchedCorrelatedTracks][charge]->Fill(param);
	else
	  hHisto[kUncorrelatedTracks][charge]->Fill(param);
      }
#if USEHISTOPID
      for (Int_t ipart = 0; ipart < AliPID::kSPECIES; ipart++) {
	if (analysisTrack->GetY(AliPID::ParticleMass(ipart)) - rapidityShift > rapidityMaxCut || 
	    analysisTrack->GetY(AliPID::ParticleMass(ipart)) - rapidityShift < rapidityMinCut) continue;
	hHistoPID[kMatchedTracks][ipart][charge]->Fill(param[kCentrality], param[kPt]);
	if (!analysisTrack->IsMismatchMC()) {
	  hHistoPID[kMatchedGoodTracks][ipart][charge]->Fill(param);
	  hHistoPID[kMatchedCorrelatedTracks][ipart][charge]->Fill(param);
	}
	else {
	  hHistoPID[kMismatchedTracks][ipart][charge]->Fill(param);
	  if (!analysisTrack->IsUncorrelatedMismatchMC())
	    hHistoPID[kMatchedCorrelatedTracks][ipart][charge]->Fill(param);
	  else
	    hHistoPID[kUncorrelatedTracks][ipart][charge]->Fill(param);
	}
      }
#endif
    }
  }

  /* stop stopwatch */
  timer.Stop();
  timer.Print();

  TFile *fileout = TFile::Open(Form("TOFmatchEff.%s", filename), "RECREATE");
  hFEAMap->Write();
  for (Int_t ihisto = 0; ihisto < kNHistos; ihisto++)
    for (Int_t icharge = 0; icharge < kNCharges; icharge++) {
      hHisto[ihisto][icharge]->Write();
    }
#if USEHISTOPID
  for (Int_t ihisto = 0; ihisto < kNHistos; ihisto++)
    for (Int_t ipart = 0; ipart < AliPID::kSPECIES; ipart++)
      for (Int_t icharge = 0; icharge < kNCharges; icharge++) {
	hHistoPID[ihisto][ipart][icharge]->Write();
      }
#endif
  fileout->Close();
  
  TString str = Form("TOFmatchEff.%s", filename);
  TOFmatchEff_efficiencyPt(str.Data());
  TOFmatchEff_efficiencyEta(str.Data());
  TOFmatchEff_efficiencyPhi(str.Data());
}

//_____________________________________________________________________________-

TOFmatchEff_efficiencyPt(const Char_t *filename)
{

  /* get data */
  TFile *filein = TFile::Open(filename);
  THnSparseF *hHisto[kNHistos][kNCharges];
  TH2F *hHistoPID[kNHistos][AliPID::kSPECIES][kNCharges];
  TH1D *hHistoPt_MB[kNHistos][kNCharges], *hHistoPt_centrality[NcentralityBins][kNHistos][kNCharges];
  TH1D *hHistoPIDPt_MB[kNHistos][AliPID::kSPECIES][kNCharges], *hHistoPIDPt_centrality[NcentralityBins][kNHistos][AliPID::kSPECIES][kNCharges];
  TH1D *hHistoAllPt_MB[kNHistos], *hHistoAllPt_centrality[NcentralityBins][kNHistos];
  /* loop over histos */
  for (Int_t ihisto = 0; ihisto < kNHistos; ihisto++) {

    /* INCLUSIVE */

    hHistoAllPt_MB[ihisto] = new TH1D(Form("hHistoAllPt_MB_%s", histoName[ihisto]), "", NptBins, ptBin);
    for (Int_t icent = 0; icent < NcentralityBins; icent++)
      hHistoAllPt_centrality[icent][ihisto] = new TH1D(Form("hHistoAllPt_centrality%d_%s", icent, histoName[ihisto]), "", NptBins, ptBin);

    /* SINGLE PARTICLE */

    for (Int_t icharge = 0; icharge < kNCharges; icharge++) {
      
      /* get histo */
      hHisto[ihisto][icharge] = (THnSparseF *)filein->Get(Form("hHisto_%s_%s", histoName[ihisto], chargeName[icharge]));
      
      /* MB projection */
      hHistoPt_MB[ihisto][icharge] = hHisto[ihisto][icharge]->Projection(kPt);
      hHistoPt_MB[ihisto][icharge]->SetName(Form("hHistoPt_MB_%s_%s", histoName[ihisto], chargeName[icharge]));
      hHistoPt_MB[ihisto][icharge]->Sumw2();
      hHistoAllPt_MB[ihisto]->Add(hHistoPt_MB[ihisto][icharge]);
	
      /* centrality projection */
      for (Int_t icent = 0; icent < NcentralityBins; icent++) {

	hHisto[ihisto][icharge]->GetAxis(kCentrality)->SetRange(icent + 1, icent + 1);
	hHistoPt_centrality[icent][ihisto][icharge] = hHisto[ihisto][icharge]->Projection(kPt);
	hHistoPt_centrality[icent][ihisto][icharge]->SetName(Form("hHistoPt_centrality%d_%s_%s", icent, histoName[ihisto], chargeName[icharge]));
	hHistoPt_centrality[icent][ihisto][icharge]->Sumw2();
	hHistoAllPt_centrality[icent][ihisto]->Add(hHistoPt_centrality[icent][ihisto][icharge]);
      }
      
#if USEHISTOPID
      for (Int_t ipart = 0; ipart < AliPID::kSPECIES; ipart++) {

	/* get histo */
	hHistoPID[ihisto][ipart][icharge] = (TH2F *)filein->Get(Form("hHistoPID_%s_%s_%s", histoName[ihisto], AliPID::ParticleName(ipart), chargeName[icharge]));

	/* MB projection */
	hHistoPIDPt_MB[ihisto][ipart][icharge] = hHistoPID[ihisto][ipart][icharge]->ProjectionY("hpy");
	hHistoPIDPt_MB[ihisto][ipart][icharge]->SetName(Form("hHistoPIDPt_MB_%s_%s_%s", histoName[ihisto], AliPID::ParticleName(ipart), chargeName[icharge]));
	hHistoPIDPt_MB[ihisto][ipart][icharge]->Sumw2();
	
	/* centrality projection */
	for (Int_t icent = 0; icent < NcentralityBins; icent++) {
	  hHistoPIDPt_centrality[icent][ihisto][ipart][icharge] = hHistoPID[ihisto][ipart][icharge]->ProjectionY("hpy", icent + 1, icent + 1);
	  hHistoPIDPt_centrality[icent][ihisto][ipart][icharge]->SetName(Form("hHistoPIDPt_centrality%d_%s_%s_%s", icent, histoName[ihisto], AliPID::ParticleName(ipart), chargeName[icharge]));
	  hHistoPIDPt_centrality[icent][ihisto][ipart][icharge]->Sumw2();

	}
	
      }
#endif
      
    }
  }

  /* output */
  TString str = filename;
  str.Insert(str.Length() - TString(".root").Length(), ".efficiencyPt");
  TFile *fileout = TFile::Open(str.Data(), "RECREATE");
  
  /* efficiencies/fractions and write */
  TH1D *hEfficiencyPt_MB[kNHistos][kNCharges], *hEfficiencyPt_centrality[NcentralityBins][kNHistos][kNCharges], *hEfficiencyPt_ratioMB_centrality[NcentralityBins][kNHistos][kNCharges];
  TH1D *hEfficiencyPIDPt_MB[kNHistos][AliPID::kSPECIES][kNCharges], *hEfficiencyPIDPt_centrality[NcentralityBins][kNHistos][AliPID::kSPECIES][kNCharges], *hEfficiencyPIDPt_ratioMB_centrality[NcentralityBins][kNHistos][AliPID::kSPECIES][kNCharges];
  TH1D *hEfficiencyAllPt_MB[kNHistos], *hEfficiencyAllPt_centrality[NcentralityBins][kNHistos], *hEfficiencyAllPt_ratioMB_centrality[NcentralityBins][kNHistos];

  TH1D *hFractionPt_MB[kNHistos][kNCharges], *hFractionPt_centrality[NcentralityBins][kNHistos][kNCharges], *hFractionPt_ratioMB_centrality[NcentralityBins][kNHistos][kNCharges];
  for (Int_t ihisto = 0; ihisto < kNHistos; ihisto++) {
    
    if (ihisto == kAcceptedTracks) continue;
    
    /* INCLUSIVE */
    
    /* MB efficiency */
    hEfficiencyAllPt_MB[ihisto] = new TH1D(*hHistoAllPt_MB[ihisto]);
    hEfficiencyAllPt_MB[ihisto]->SetName(Form("hEfficiencyAllPt_MB_%s", histoName[ihisto]));
    hEfficiencyAllPt_MB[ihisto]->SetLineWidth(2);
    hEfficiencyAllPt_MB[ihisto]->SetLineColor(1);
    hEfficiencyAllPt_MB[ihisto]->SetMarkerStyle(20);
    hEfficiencyAllPt_MB[ihisto]->SetMarkerColor(1);
    hEfficiencyAllPt_MB[ihisto]->Divide(hEfficiencyAllPt_MB[ihisto], hHistoAllPt_MB[kAcceptedTracks], 1, 1, "B");
    hEfficiencyAllPt_MB[ihisto]->Write();
    
    /* multiplicity/centrality efficiency */
    for (Int_t icent = 0; icent < NcentralityBins; icent++) {
      hEfficiencyAllPt_centrality[icent][ihisto] = new TH1D(*hHistoAllPt_centrality[icent][ihisto]);
      hEfficiencyAllPt_centrality[icent][ihisto]->SetName(Form("hEfficiencyAllPt_centrality%d_%s", icent, histoName[ihisto]));
      hEfficiencyAllPt_centrality[icent][ihisto]->SetLineWidth(2);
      hEfficiencyAllPt_centrality[icent][ihisto]->SetLineColor(multcentColor[icent]);
      hEfficiencyAllPt_centrality[icent][ihisto]->SetMarkerStyle(20);
      hEfficiencyAllPt_centrality[icent][ihisto]->SetMarkerColor(multcentColor[icent]);
      hEfficiencyAllPt_centrality[icent][ihisto]->Divide(hEfficiencyAllPt_centrality[icent][ihisto], hHistoAllPt_centrality[icent][kAcceptedTracks], 1, 1, "B");
      hEfficiencyAllPt_centrality[icent][ihisto]->Write();
      
      /* ratio wrt. MB */
      hEfficiencyAllPt_ratioMB_centrality[icent][ihisto] = new TH1D(*hEfficiencyAllPt_centrality[icent][ihisto]);
      hEfficiencyAllPt_ratioMB_centrality[icent][ihisto]->SetName(Form("hEfficiencyAllPt_ratioMB_centrality%d_%s", icent, histoName[ihisto]));
      hEfficiencyAllPt_ratioMB_centrality[icent][ihisto]->SetLineWidth(2);
      hEfficiencyAllPt_ratioMB_centrality[icent][ihisto]->SetLineColor(multcentColor[icent]);
      hEfficiencyAllPt_ratioMB_centrality[icent][ihisto]->SetMarkerStyle(20);
      hEfficiencyAllPt_ratioMB_centrality[icent][ihisto]->SetMarkerColor(multcentColor[icent]);
      hEfficiencyAllPt_ratioMB_centrality[icent][ihisto]->Divide(hEfficiencyAllPt_MB[ihisto]);
      hEfficiencyAllPt_ratioMB_centrality[icent][ihisto]->Write();
    }
    
    /* SINGLE PARTICLE */
    
    for (Int_t icharge = 0; icharge < kNCharges; icharge++) {
      
      /* MB efficiency */
      hEfficiencyPt_MB[ihisto][icharge] = new TH1D(*hHistoPt_MB[ihisto][icharge]);
      hEfficiencyPt_MB[ihisto][icharge]->SetName(Form("hEfficiencyPt_MB_%s_%s", histoName[ihisto], chargeName[icharge]));
      hEfficiencyPt_MB[ihisto][icharge]->SetLineWidth(2);
      hEfficiencyPt_MB[ihisto][icharge]->SetLineColor(1);
      hEfficiencyPt_MB[ihisto][icharge]->SetMarkerStyle(20);
      hEfficiencyPt_MB[ihisto][icharge]->SetMarkerColor(1);
      hEfficiencyPt_MB[ihisto][icharge]->Divide(hEfficiencyPt_MB[ihisto][icharge], hHistoPt_MB[kAcceptedTracks][icharge], 1, 1, "B");
      hEfficiencyPt_MB[ihisto][icharge]->Write();
      
      /* multiplicity/centrality efficiency */
      for (Int_t icent = 0; icent < NcentralityBins; icent++) {
	hEfficiencyPt_centrality[icent][ihisto][icharge] = new TH1D(*hHistoPt_centrality[icent][ihisto][icharge]);
	hEfficiencyPt_centrality[icent][ihisto][icharge]->SetName(Form("hEfficiencyPt_centrality%d_%s_%s", icent, histoName[ihisto], chargeName[icharge]));
	hEfficiencyPt_centrality[icent][ihisto][icharge]->SetLineWidth(2);
	hEfficiencyPt_centrality[icent][ihisto][icharge]->SetLineColor(multcentColor[icent]);
	hEfficiencyPt_centrality[icent][ihisto][icharge]->SetMarkerStyle(20);
	hEfficiencyPt_centrality[icent][ihisto][icharge]->SetMarkerColor(multcentColor[icent]);
	hEfficiencyPt_centrality[icent][ihisto][icharge]->Divide(hEfficiencyPt_centrality[icent][ihisto][icharge], hHistoPt_centrality[icent][kAcceptedTracks][icharge], 1, 1, "B");
	hEfficiencyPt_centrality[icent][ihisto][icharge]->Write();
	
	/* ratio wrt. MB */
	hEfficiencyPt_ratioMB_centrality[icent][ihisto][icharge] = new TH1D(*hEfficiencyPt_centrality[icent][ihisto][icharge]);
	hEfficiencyPt_ratioMB_centrality[icent][ihisto][icharge]->SetName(Form("hEfficiencyPt_ratioMB_centrality%d_%s_%s", icent, histoName[ihisto], chargeName[icharge]));
	hEfficiencyPt_ratioMB_centrality[icent][ihisto][icharge]->SetLineWidth(2);
	hEfficiencyPt_ratioMB_centrality[icent][ihisto][icharge]->SetLineColor(multcentColor[icent]);
	hEfficiencyPt_ratioMB_centrality[icent][ihisto][icharge]->SetMarkerStyle(20);
	hEfficiencyPt_ratioMB_centrality[icent][ihisto][icharge]->SetMarkerColor(multcentColor[icent]);
	hEfficiencyPt_ratioMB_centrality[icent][ihisto][icharge]->Divide(hEfficiencyPt_MB[ihisto][icharge]);
	hEfficiencyPt_ratioMB_centrality[icent][ihisto][icharge]->Write();
      }
     
#if USEHISTOPID
      for (Int_t ipart = 0; ipart < AliPID::kSPECIES; ipart++) {

	/* MB efficiency */
	hEfficiencyPIDPt_MB[ihisto][ipart][icharge] = new TH1D(*hHistoPIDPt_MB[ihisto][ipart][icharge]);
	hEfficiencyPIDPt_MB[ihisto][ipart][icharge]->SetName(Form("hEfficiencyPIDPt_MB_%s_%s_%s", histoName[ihisto], AliPID::ParticleName(ipart), chargeName[icharge]));
	hEfficiencyPIDPt_MB[ihisto][ipart][icharge]->SetLineWidth(2);
	hEfficiencyPIDPt_MB[ihisto][ipart][icharge]->SetLineColor(1);
	hEfficiencyPIDPt_MB[ihisto][ipart][icharge]->SetMarkerStyle(20);
	hEfficiencyPIDPt_MB[ihisto][ipart][icharge]->SetMarkerColor(1);
	hEfficiencyPIDPt_MB[ihisto][ipart][icharge]->Divide(hEfficiencyPIDPt_MB[ihisto][ipart][icharge], hHistoPIDPt_MB[kAcceptedTracks][ipart][icharge], 1, 1, "B");
	hEfficiencyPIDPt_MB[ihisto][ipart][icharge]->Write();
	
	/* multiplicity/centrality efficiency */
	for (Int_t icent = 0; icent < NcentralityBins; icent++) {

	  hEfficiencyPIDPt_centrality[icent][ihisto][ipart][icharge] = new TH1D(*hHistoPIDPt_centrality[icent][ihisto][ipart][icharge]);
	  hEfficiencyPIDPt_centrality[icent][ihisto][ipart][icharge]->SetName(Form("hEfficiencyPIDPt_centrality%d_%s_%s_%s", icent, histoName[ihisto], AliPID::ParticleName(ipart), chargeName[icharge]));
	  hEfficiencyPIDPt_centrality[icent][ihisto][ipart][icharge]->SetLineWidth(2);
	  hEfficiencyPIDPt_centrality[icent][ihisto][ipart][icharge]->SetLineColor(multcentColor[icent]);
	  hEfficiencyPIDPt_centrality[icent][ihisto][ipart][icharge]->SetMarkerStyle(20);
	  hEfficiencyPIDPt_centrality[icent][ihisto][ipart][icharge]->SetMarkerColor(multcentColor[icent]);

	  hEfficiencyPIDPt_centrality[icent][ihisto][ipart][icharge]->Divide(hEfficiencyPIDPt_centrality[icent][ihisto][ipart][icharge], hHistoPIDPt_centrality[icent][kAcceptedTracks][ipart][icharge], 1, 1, "B");
	  hEfficiencyPIDPt_centrality[icent][ihisto][ipart][icharge]->Write();

	  /* ratio wrt. MB */
	  hEfficiencyPIDPt_ratioMB_centrality[icent][ihisto][ipart][icharge] = new TH1D(*hEfficiencyPIDPt_centrality[icent][ihisto][ipart][icharge]);
	  hEfficiencyPIDPt_ratioMB_centrality[icent][ihisto][ipart][icharge]->SetName(Form("hEfficiencyPIDPt_ratioMB_centrality%d_%s_%s_%s", icent, histoName[ihisto], AliPID::ParticleName(ipart), chargeName[icharge]));
	  hEfficiencyPIDPt_ratioMB_centrality[icent][ihisto][ipart][icharge]->SetLineWidth(2);
	  hEfficiencyPIDPt_ratioMB_centrality[icent][ihisto][ipart][icharge]->SetLineColor(multcentColor[icent]);
	  hEfficiencyPIDPt_ratioMB_centrality[icent][ihisto][ipart][icharge]->SetMarkerStyle(20);
	  hEfficiencyPIDPt_ratioMB_centrality[icent][ihisto][ipart][icharge]->SetMarkerColor(multcentColor[icent]);
	  hEfficiencyPIDPt_ratioMB_centrality[icent][ihisto][ipart][icharge]->Divide(hEfficiencyPIDPt_MB[ihisto][ipart][icharge]);
	  hEfficiencyPIDPt_ratioMB_centrality[icent][ihisto][ipart][icharge]->Write();
	}
	
	
      }
#endif
      
    }       
  }
  
  fileout->Close();

}

//_____________________________________________________________________________-

TOFmatchEff_efficiencyPhi(const Char_t *filename)
{

  /* get data */
  TFile *filein = TFile::Open(filename);
  THnSparseF *hHisto[kNHistos][kNCharges];
  TH1D *hHistoPhi_MB[kNHistos][kNCharges], *hHistoPhi_centrality[NcentralityBins][kNHistos][kNCharges];
  TH1D *hHistoPhi_MB_pt[NptsubBins][kNHistos][kNCharges], *hHistoPhi_centrality_pt[NcentralityBins][NptsubBins][kNHistos][kNCharges];
  /* loop over histos */
  for (Int_t ihisto = 0; ihisto < kNHistos; ihisto++)
    for (Int_t icharge = 0; icharge < kNCharges; icharge++) {
      
      /* get histo */
      hHisto[ihisto][icharge] = (THnSparseF *)filein->Get(Form("hHisto_%s_%s", histoName[ihisto], chargeName[icharge]));
      
      /* MB projection */
      hHisto[ihisto][icharge]->GetAxis(kPt)->SetRange(0, 0);
      hHisto[ihisto][icharge]->GetAxis(kCentrality)->SetRange(0, 0);
      hHistoPhi_MB[ihisto][icharge] = hHisto[ihisto][icharge]->Projection(kPhi);
      hHistoPhi_MB[ihisto][icharge]->SetName(Form("hHistoPhi_MB_%s_%s", histoName[ihisto], chargeName[icharge]));
      hHistoPhi_MB[ihisto][icharge]->Sumw2();
      /* pt bins */
      for (Int_t ipt = 0; ipt < NptsubBins; ipt++) {
	hHisto[ihisto][icharge]->GetAxis(kPt)->SetRange(ptsubBinMin[ipt] + 1, ptsubBinMax[ipt] + 1);
	hHisto[ihisto][icharge]->GetAxis(kCentrality)->SetRange(0, 0);
	hHistoPhi_MB_pt[ipt][ihisto][icharge] = hHisto[ihisto][icharge]->Projection(kPhi);
	hHistoPhi_MB_pt[ipt][ihisto][icharge]->SetName(Form("hHistoPhi_MB_pt%d_%s_%s", ipt, histoName[ihisto], chargeName[icharge]));
	hHistoPhi_MB_pt[ipt][ihisto][icharge]->Sumw2();
      }
      
      /* centrality projection */
      for (Int_t icent = 0; icent < NcentralityBins; icent++) {
	hHisto[ihisto][icharge]->GetAxis(kPt)->SetRange(0, 0);
	hHisto[ihisto][icharge]->GetAxis(kCentrality)->SetRange(icent + 1, icent + 1);
	hHistoPhi_centrality[icent][ihisto][icharge] = hHisto[ihisto][icharge]->Projection(kPhi);
	hHistoPhi_centrality[icent][ihisto][icharge]->SetName(Form("hHistoPhi_centrality%d_%s_%s", icent, histoName[ihisto], chargeName[icharge]));
	hHistoPhi_centrality[icent][ihisto][icharge]->Sumw2();
	/* pt bins */
	for (Int_t ipt = 0; ipt < NptsubBins; ipt++) {
	  hHisto[ihisto][icharge]->GetAxis(kPt)->SetRange(ptsubBinMin[ipt] + 1, ptsubBinMax[ipt] + 1);
	  hHisto[ihisto][icharge]->GetAxis(kCentrality)->SetRange(icent + 1, icent + 1);
	  hHistoPhi_centrality_pt[icent][ipt][ihisto][icharge] = hHisto[ihisto][icharge]->Projection(kPhi);
	  hHistoPhi_centrality_pt[icent][ipt][ihisto][icharge]->SetName(Form("hHistoPhi_centrality%d_pt%d_%s_%s", icent, ipt, histoName[ihisto], chargeName[icharge]));
	  hHistoPhi_centrality_pt[icent][ipt][ihisto][icharge]->Sumw2();
	}
      }
    }
  
  /* output */
  TString str = filename;
  str.Insert(str.Length() - TString(".root").Length(), ".efficiencyPhi");
  TFile *fileout = TFile::Open(str.Data(), "RECREATE");
  
  /* efficiencies/fractions and write */
  TH1D *hEfficiencyPhi_MB[kNHistos][kNCharges], *hEfficiencyPhi_centrality[NcentralityBins][kNHistos][kNCharges], *hEfficiencyPhi_ratioMB_centrality[NcentralityBins][kNHistos][kNCharges];
  TH1D *hEfficiencyPhi_MB_pt[NptsubBins][kNHistos][kNCharges], *hEfficiencyPhi_centrality_pt[NcentralityBins][NptsubBins][kNHistos][kNCharges], *hEfficiencyPhi_ratioMB_centrality_pt[NcentralityBins][NptsubBins][kNHistos][kNCharges];


  TH1D *hFractionPhi_MB[kNHistos][kNCharges], *hFractionPhi_centrality[NcentralityBins][kNHistos][kNCharges], *hFractionPhi_ratioMB_centrality[NcentralityBins][kNHistos][kNCharges];
  for (Int_t ihisto = 0; ihisto < kNHistos; ihisto++) {
    for (Int_t icharge = 0; icharge < kNCharges; icharge++) {
      
      if (ihisto == kAcceptedTracks) continue;
      
      /* MB efficiency */
      hEfficiencyPhi_MB[ihisto][icharge] = new TH1D(*hHistoPhi_MB[ihisto][icharge]);
      hEfficiencyPhi_MB[ihisto][icharge]->SetName(Form("hEfficiencyPhi_MB_%s_%s", histoName[ihisto], chargeName[icharge]));
      hEfficiencyPhi_MB[ihisto][icharge]->SetLineWidth(2);
      hEfficiencyPhi_MB[ihisto][icharge]->SetLineColor(1);
      hEfficiencyPhi_MB[ihisto][icharge]->SetMarkerStyle(20);
      hEfficiencyPhi_MB[ihisto][icharge]->SetMarkerColor(1);
      hEfficiencyPhi_MB[ihisto][icharge]->Divide(hEfficiencyPhi_MB[ihisto][icharge], hHistoPhi_MB[kAcceptedTracks][icharge], 1, 1, "B");
      hEfficiencyPhi_MB[ihisto][icharge]->Write();
      /* pt bins */
      for (Int_t ipt = 0; ipt < NptsubBins; ipt++) {
	hEfficiencyPhi_MB_pt[ipt][ihisto][icharge] = new TH1D(*hHistoPhi_MB_pt[ipt][ihisto][icharge]);
	hEfficiencyPhi_MB_pt[ipt][ihisto][icharge]->SetName(Form("hEfficiencyPhi_MB_pt%d_%s_%s", ipt, histoName[ihisto], chargeName[icharge]));
	hEfficiencyPhi_MB_pt[ipt][ihisto][icharge]->SetLineWidth(2);
	hEfficiencyPhi_MB_pt[ipt][ihisto][icharge]->SetLineColor(1);
	hEfficiencyPhi_MB_pt[ipt][ihisto][icharge]->SetMarkerStyle(20);
	hEfficiencyPhi_MB_pt[ipt][ihisto][icharge]->SetMarkerColor(1);
	hEfficiencyPhi_MB_pt[ipt][ihisto][icharge]->Divide(hEfficiencyPhi_MB_pt[ipt][ihisto][icharge], hHistoPhi_MB_pt[ipt][kAcceptedTracks][icharge], 1, 1, "B");
	hEfficiencyPhi_MB_pt[ipt][ihisto][icharge]->Write();
      }
      
      /* multiplicity/centrality efficiency */
      for (Int_t icent = 0; icent < NcentralityBins; icent++) {
	hEfficiencyPhi_centrality[icent][ihisto][icharge] = new TH1D(*hHistoPhi_centrality[icent][ihisto][icharge]);
	hEfficiencyPhi_centrality[icent][ihisto][icharge]->SetName(Form("hEfficiencyPhi_centrality%d_%s_%s", icent, histoName[ihisto], chargeName[icharge]));
	hEfficiencyPhi_centrality[icent][ihisto][icharge]->SetLineWidth(2);
	hEfficiencyPhi_centrality[icent][ihisto][icharge]->SetLineColor(multcentColor[icent]);
	hEfficiencyPhi_centrality[icent][ihisto][icharge]->SetMarkerStyle(20);
	hEfficiencyPhi_centrality[icent][ihisto][icharge]->SetMarkerColor(multcentColor[icent]);
	hEfficiencyPhi_centrality[icent][ihisto][icharge]->Divide(hEfficiencyPhi_centrality[icent][ihisto][icharge], hHistoPhi_centrality[icent][kAcceptedTracks][icharge], 1, 1, "B");
	hEfficiencyPhi_centrality[icent][ihisto][icharge]->Write();
	
	/* ratio wrt. MB */
	hEfficiencyPhi_ratioMB_centrality[icent][ihisto][icharge] = new TH1D(*hEfficiencyPhi_centrality[icent][ihisto][icharge]);
	hEfficiencyPhi_ratioMB_centrality[icent][ihisto][icharge]->SetName(Form("hEfficiencyPhi_ratioMB_centrality%d_%s_%s", icent, histoName[ihisto], chargeName[icharge]));
	hEfficiencyPhi_ratioMB_centrality[icent][ihisto][icharge]->SetLineWidth(2);
	hEfficiencyPhi_ratioMB_centrality[icent][ihisto][icharge]->SetLineColor(multcentColor[icent]);
	hEfficiencyPhi_ratioMB_centrality[icent][ihisto][icharge]->SetMarkerStyle(20);
	hEfficiencyPhi_ratioMB_centrality[icent][ihisto][icharge]->SetMarkerColor(multcentColor[icent]);
	hEfficiencyPhi_ratioMB_centrality[icent][ihisto][icharge]->Divide(hEfficiencyPhi_MB[ihisto][icharge]);
	hEfficiencyPhi_ratioMB_centrality[icent][ihisto][icharge]->Write();
      }
      
    }       
  }
  
  fileout->Close();
	     
}

//_____________________________________________________________________________-

TOFmatchEff_efficiencyEta(const Char_t *filename)
{

  /* get data */
  TFile *filein = TFile::Open(filename);
  THnSparseF *hHisto[kNHistos][kNCharges];
  TH1D *hHistoEta_MB[kNHistos][kNCharges], *hHistoEta_centrality[NcentralityBins][kNHistos][kNCharges];
  TH1D *hHistoEta_MB_pt[NptsubBins][kNHistos][kNCharges], *hHistoEta_centrality_pt[NcentralityBins][NptsubBins][kNHistos][kNCharges];
  /* loop over histos */
  for (Int_t ihisto = 0; ihisto < kNHistos; ihisto++)
    for (Int_t icharge = 0; icharge < kNCharges; icharge++) {
      
      /* get histo */
      hHisto[ihisto][icharge] = (THnSparseF *)filein->Get(Form("hHisto_%s_%s", histoName[ihisto], chargeName[icharge]));
      
      /* MB projection */
      hHisto[ihisto][icharge]->GetAxis(kPt)->SetRange(0, 0);
      hHisto[ihisto][icharge]->GetAxis(kCentrality)->SetRange(0, 0);
      hHistoEta_MB[ihisto][icharge] = hHisto[ihisto][icharge]->Projection(kEta);
      hHistoEta_MB[ihisto][icharge]->SetName(Form("hHistoEta_MB_%s_%s", histoName[ihisto], chargeName[icharge]));
      hHistoEta_MB[ihisto][icharge]->Sumw2();
      /* pt bins */
      for (Int_t ipt = 0; ipt < NptsubBins; ipt++) {
	hHisto[ihisto][icharge]->GetAxis(kPt)->SetRange(ptsubBinMin[ipt] + 1, ptsubBinMax[ipt] + 1);
	hHisto[ihisto][icharge]->GetAxis(kCentrality)->SetRange(0, 0);
	hHistoEta_MB_pt[ipt][ihisto][icharge] = hHisto[ihisto][icharge]->Projection(kEta);
	hHistoEta_MB_pt[ipt][ihisto][icharge]->SetName(Form("hHistoEta_MB_pt%d_%s_%s", ipt, histoName[ihisto], chargeName[icharge]));
	hHistoEta_MB_pt[ipt][ihisto][icharge]->Sumw2();
      }
      
      /* centrality projection */
      for (Int_t icent = 0; icent < NcentralityBins; icent++) {
	hHisto[ihisto][icharge]->GetAxis(kPt)->SetRange(0, 0);
	hHisto[ihisto][icharge]->GetAxis(kCentrality)->SetRange(icent + 1, icent + 1);
	hHistoEta_centrality[icent][ihisto][icharge] = hHisto[ihisto][icharge]->Projection(kEta);
	hHistoEta_centrality[icent][ihisto][icharge]->SetName(Form("hHistoEta_centrality%d_%s_%s", icent, histoName[ihisto], chargeName[icharge]));
	hHistoEta_centrality[icent][ihisto][icharge]->Sumw2();
	/* pt bins */
	for (Int_t ipt = 0; ipt < NptsubBins; ipt++) {
	  hHisto[ihisto][icharge]->GetAxis(kPt)->SetRange(ptsubBinMin[ipt] + 1, ptsubBinMax[ipt] + 1);
	  hHisto[ihisto][icharge]->GetAxis(kCentrality)->SetRange(icent + 1, icent + 1);
	  hHistoEta_centrality_pt[icent][ipt][ihisto][icharge] = hHisto[ihisto][icharge]->Projection(kEta);
	  hHistoEta_centrality_pt[icent][ipt][ihisto][icharge]->SetName(Form("hHistoEta_centrality%d_pt%d_%s_%s", icent, ipt, histoName[ihisto], chargeName[icharge]));
	  hHistoEta_centrality_pt[icent][ipt][ihisto][icharge]->Sumw2();
	}
      }
    }
  
  /* output */
  TString str = filename;
  str.Insert(str.Length() - TString(".root").Length(), ".efficiencyEta");
  TFile *fileout = TFile::Open(str.Data(), "RECREATE");
  
  /* efficiencies/fractions and write */
  TH1D *hEfficiencyEta_MB[kNHistos][kNCharges], *hEfficiencyEta_centrality[NcentralityBins][kNHistos][kNCharges], *hEfficiencyEta_ratioMB_centrality[NcentralityBins][kNHistos][kNCharges];
  TH1D *hEfficiencyEta_MB_pt[NptsubBins][kNHistos][kNCharges], *hEfficiencyEta_centrality_pt[NcentralityBins][NptsubBins][kNHistos][kNCharges], *hEfficiencyEta_ratioMB_centrality_pt[NcentralityBins][NptsubBins][kNHistos][kNCharges];


  TH1D *hFractionEta_MB[kNHistos][kNCharges], *hFractionEta_centrality[NcentralityBins][kNHistos][kNCharges], *hFractionEta_ratioMB_centrality[NcentralityBins][kNHistos][kNCharges];
  for (Int_t ihisto = 0; ihisto < kNHistos; ihisto++) {
    for (Int_t icharge = 0; icharge < kNCharges; icharge++) {
      
      if (ihisto == kAcceptedTracks) continue;
      
      /* MB efficiency */
      hEfficiencyEta_MB[ihisto][icharge] = new TH1D(*hHistoEta_MB[ihisto][icharge]);
      hEfficiencyEta_MB[ihisto][icharge]->SetName(Form("hEfficiencyEta_MB_%s_%s", histoName[ihisto], chargeName[icharge]));
      hEfficiencyEta_MB[ihisto][icharge]->SetLineWidth(2);
      hEfficiencyEta_MB[ihisto][icharge]->SetLineColor(1);
      hEfficiencyEta_MB[ihisto][icharge]->SetMarkerStyle(20);
      hEfficiencyEta_MB[ihisto][icharge]->SetMarkerColor(1);
      hEfficiencyEta_MB[ihisto][icharge]->Divide(hEfficiencyEta_MB[ihisto][icharge], hHistoEta_MB[kAcceptedTracks][icharge], 1, 1, "B");
      hEfficiencyEta_MB[ihisto][icharge]->Write();
      /* pt bins */
      for (Int_t ipt = 0; ipt < NptsubBins; ipt++) {
	hEfficiencyEta_MB_pt[ipt][ihisto][icharge] = new TH1D(*hHistoEta_MB_pt[ipt][ihisto][icharge]);
	hEfficiencyEta_MB_pt[ipt][ihisto][icharge]->SetName(Form("hEfficiencyEta_MB_pt%d_%s_%s", ipt, histoName[ihisto], chargeName[icharge]));
	hEfficiencyEta_MB_pt[ipt][ihisto][icharge]->SetLineWidth(2);
	hEfficiencyEta_MB_pt[ipt][ihisto][icharge]->SetLineColor(1);
	hEfficiencyEta_MB_pt[ipt][ihisto][icharge]->SetMarkerStyle(20);
	hEfficiencyEta_MB_pt[ipt][ihisto][icharge]->SetMarkerColor(1);
	hEfficiencyEta_MB_pt[ipt][ihisto][icharge]->Divide(hEfficiencyEta_MB_pt[ipt][ihisto][icharge], hHistoEta_MB_pt[ipt][kAcceptedTracks][icharge], 1, 1, "B");
	hEfficiencyEta_MB_pt[ipt][ihisto][icharge]->Write();
      }
      
      /* multiplicity/centrality efficiency */
      for (Int_t icent = 0; icent < NcentralityBins; icent++) {
	hEfficiencyEta_centrality[icent][ihisto][icharge] = new TH1D(*hHistoEta_centrality[icent][ihisto][icharge]);
	hEfficiencyEta_centrality[icent][ihisto][icharge]->SetName(Form("hEfficiencyEta_centrality%d_%s_%s", icent, histoName[ihisto], chargeName[icharge]));
	hEfficiencyEta_centrality[icent][ihisto][icharge]->SetLineWidth(2);
	hEfficiencyEta_centrality[icent][ihisto][icharge]->SetLineColor(multcentColor[icent]);
	hEfficiencyEta_centrality[icent][ihisto][icharge]->SetMarkerStyle(20);
	hEfficiencyEta_centrality[icent][ihisto][icharge]->SetMarkerColor(multcentColor[icent]);
	hEfficiencyEta_centrality[icent][ihisto][icharge]->Divide(hEfficiencyEta_centrality[icent][ihisto][icharge], hHistoEta_centrality[icent][kAcceptedTracks][icharge], 1, 1, "B");
	hEfficiencyEta_centrality[icent][ihisto][icharge]->Write();
	
	/* ratio wrt. MB */
	hEfficiencyEta_ratioMB_centrality[icent][ihisto][icharge] = new TH1D(*hEfficiencyEta_centrality[icent][ihisto][icharge]);
	hEfficiencyEta_ratioMB_centrality[icent][ihisto][icharge]->SetName(Form("hEfficiencyEta_ratioMB_centrality%d_%s_%s", icent, histoName[ihisto], chargeName[icharge]));
	hEfficiencyEta_ratioMB_centrality[icent][ihisto][icharge]->SetLineWidth(2);
	hEfficiencyEta_ratioMB_centrality[icent][ihisto][icharge]->SetLineColor(multcentColor[icent]);
	hEfficiencyEta_ratioMB_centrality[icent][ihisto][icharge]->SetMarkerStyle(20);
	hEfficiencyEta_ratioMB_centrality[icent][ihisto][icharge]->SetMarkerColor(multcentColor[icent]);
	hEfficiencyEta_ratioMB_centrality[icent][ihisto][icharge]->Divide(hEfficiencyEta_MB[ihisto][icharge]);
	hEfficiencyEta_ratioMB_centrality[icent][ihisto][icharge]->Write();
      }
      
    }       
  }
  
  fileout->Close();
	     
}

#if 0
//_____________________________________________________________________________-

TOFmatchMC_efficiencyCent(const Char_t *filename, const Char_t *particle = "", const Char_t *charge = "", const Char_t *trdmode = "")
{

  const Int_t npt = 4;
  Double_t pt[npt + 1] = {0., 0.5, 1.0, 1.5, 5.0};

  /* get data */
  TFile *filein = TFile::Open(filename);
  THnSparseF *hHisto[kNHistos];
  TH1D *hHisto_all[kNHistos], *hHisto_MB_all[kNHistos], *hHisto_pt[kNHistos][MAXMULTCENTBINS], *hHisto_MB_pt[kNHistos][MAXMULTCENTBINS];
  /* loop over histos */
  for (Int_t ihisto = 0; ihisto < kNHistos; ihisto++) {
    if (ihisto == kMatchedCorrelatedTracks) continue;
    /* get histo */
    hHisto[ihisto] = (THnSparseF *)filein->Get(histoName[ihisto]);
    /* set range limits */
    hHisto[ihisto]->GetAxis(kRapidity)->SetRangeUser(-0.5 + kEpsilon, 0.5 - kEpsilon);
    hHisto[ihisto]->GetAxis(kEta)->SetRangeUser(-0.8 + kEpsilon, 0.8 - kEpsilon);
    hHisto[ihisto]->GetAxis(kPt)->SetRangeUser(0. + kEpsilon, 5.0 - kEpsilon);
    /* select particle if requested */
    for (Int_t ipart = 0; ipart < AliPID::kSPECIES; ipart++)
      if (TString(particle) == AliPID::ParticleName(ipart))
	hHisto[ihisto]->GetAxis(kParticle)->SetRange(ipart + 1, ipart + 1);
    /* select charge if requested */
    if (TString(charge) == "plus")
      hHisto[ihisto]->GetAxis(kCharge)->SetRange(1, 1);
    else if (TString(charge) == "minus")
      hHisto[ihisto]->GetAxis(kCharge)->SetRange(2, 2);
    /* select TRD mode if requested */
    if (TString(trdmode) == "trdout")
      hHisto[ihisto]->GetAxis(kTRDmode)->SetRange(1, 1);
    else if (TString(trdmode) == "notrdout")
      hHisto[ihisto]->GetAxis(kTRDmode)->SetRange(2, 2);
    /* all projection */
    hHisto_all[ihisto] = hHisto[ihisto]->Projection(kMultCent);
    hHisto_all[ihisto]->SetName(Form("%s_all", histoName[ihisto]));
    hHisto_all[ihisto]->Sumw2();
    /* MB all projection */
    hHisto_MB_all[ihisto] = new TH1D(*hHisto_all[ihisto]);
    hHisto_MB_all[ihisto]->SetName(Form("%s_MB_all", histoName[ihisto]));
    for (Int_t i = 0; i < hHisto_MB_all[ihisto]->GetNbinsX(); i++) {
      hHisto_MB_all[ihisto]->SetBinContent(i + 1, hHisto_all[ihisto]->Integral());
      hHisto_MB_all[ihisto]->SetBinError(i + 1, TMath::Sqrt(hHisto_all[ihisto]->Integral()));
    }
    /* pt projection */
    for (Int_t ibin = 0; ibin < npt; ibin++) {
      hHisto[ihisto]->GetAxis(kPt)->SetRangeUser(pt[ibin] + kEpsilon, pt[ibin + 1] - kEpsilon);
      hHisto_pt[ihisto][ibin] = hHisto[ihisto]->Projection(kMultCent);
      hHisto_pt[ihisto][ibin]->SetName(Form("%s_pt%3.1f-%3.1f", histoName[ihisto], pt[ibin], pt[ibin + 1]));
      hHisto_pt[ihisto][ibin]->Sumw2();
      /* MB pt projection */
      hHisto_MB_pt[ihisto][ibin] = new TH1D(*hHisto_pt[ihisto][ibin]);
      hHisto_MB_pt[ihisto][ibin]->SetName(Form("%s_MB_pt%3.1f-%3.1f", histoName[ihisto], pt[ibin], pt[ibin + 1]));
      for (Int_t i = 0; i < hHisto_MB_pt[ihisto][ibin]->GetNbinsX(); i++) {
      	hHisto_MB_pt[ihisto][ibin]->SetBinContent(i + 1, hHisto_pt[ihisto][ibin]->Integral());
	hHisto_MB_pt[ihisto][ibin]->SetBinError(i + 1, TMath::Sqrt(hHisto_pt[ihisto][ibin]->Integral()));
      }
    }
  }
  /*** matched correlated histos ***/
  /* all projection */
  hHisto_all[kMatchedCorrelatedTracks] = new TH1D(*hHisto_all[kMatchedTracks]);
  hHisto_all[kMatchedCorrelatedTracks]->Add(hHisto_all[kUncorrelatedTracks], -1.);
  hHisto_all[kMatchedCorrelatedTracks]->SetName(Form("%s_all", histoName[kMatchedCorrelatedTracks]));
  /* MB all projection */
  hHisto_MB_all[kMatchedCorrelatedTracks] = new TH1D(*hHisto_MB_all[kMatchedTracks]);
  hHisto_MB_all[kMatchedCorrelatedTracks]->Add(hHisto_MB_all[kUncorrelatedTracks], -1.);
  hHisto_MB_all[kMatchedCorrelatedTracks]->SetName(Form("%s_MB_all", histoName[kMatchedCorrelatedTracks]));
  /* pt projection */
  for (Int_t ibin = 0; ibin < npt; ibin++) {
    hHisto_pt[kMatchedCorrelatedTracks][ibin] = new TH1D(*hHisto_pt[kMatchedTracks][ibin]);
    hHisto_pt[kMatchedCorrelatedTracks][ibin]->Add(hHisto_pt[kUncorrelatedTracks][ibin], -1.);
    hHisto_pt[kMatchedCorrelatedTracks][ibin]->SetName(Form("%s_pt%3.1f-%3.1f", histoName[kMatchedCorrelatedTracks], pt[ibin], pt[ibin + 1]));
    /* MB pt projection */
    hHisto_MB_pt[kMatchedCorrelatedTracks][ibin] = new TH1D(*hHisto_MB_pt[kMatchedTracks][ibin]);
    hHisto_MB_pt[kMatchedCorrelatedTracks][ibin]->Add(hHisto_MB_pt[kUncorrelatedTracks][ibin], -1.);
    hHisto_MB_pt[kMatchedCorrelatedTracks][ibin]->SetName(Form("%s_MB_pt%3.1f-%3.1f", histoName[kMatchedCorrelatedTracks], pt[ibin], pt[ibin + 1]));
  }

  /* output */
  TString str = filename;
  str.Insert(str.Length() - TString(".root").Length(), ".efficiencyCent");
  for (Int_t ipart = 0; ipart < AliPID::kSPECIES; ipart++)
    if (TString(particle) == AliPID::ParticleName(ipart))
      str.Insert(str.Length() - TString(".root").Length(), Form(".%s", AliPID::ParticleName(ipart)));
  if (TString(charge) == "plus")
    str.Insert(str.Length() - TString(".root").Length(), ".plus");
  else if (TString(charge) == "minus")
    str.Insert(str.Length() - TString(".root").Length(), ".minus");
  if (TString(trdmode) == "trdout")
    str.Insert(str.Length() - TString(".root").Length(), ".trdout");
  else if (TString(trdmode) == "notrdout")
    str.Insert(str.Length() - TString(".root").Length(), ".notrdout");
  TFile *fileout = TFile::Open(str.Data(), "RECREATE");
  
  /* efficiencies/fractions and write */
  TH1D *hEfficiency_all[kNHistos], *hEfficiency_MB_all[kNHistos], *hEfficiency_ratioMB_all[kNHistos], *hEfficiency_pt[kNHistos][MAXMULTCENTBINS], *hEfficiency_MB_pt[kNHistos][MAXMULTCENTBINS], *hEfficiency_ratioMB_pt[kNHistos][MAXMULTCENTBINS];


  //  TH1D *hEfficiency_MB[kNHistos], *hEfficiency_multcent[kNHistos][MAXMULTCENTBINS], *hEfficiency_ratioMB_multcent[kNHistos][MAXMULTCENTBINS];
  //  TH1D *hFraction_MB[kNHistos], *hFraction_multcent[kNHistos][MAXMULTCENTBINS], *hFraction_ratioMB_multcent[kNHistos][MAXMULTCENTBINS];
  for (Int_t ihisto = 0; ihisto < kNHistos; ihisto++) {
    if (ihisto == kAcceptedTracks) continue;
    /* all efficiency */
    hEfficiency_all[ihisto] = new TH1D(*hHisto_all[ihisto]);
    hEfficiency_all[ihisto]->SetName(Form("%s_efficiency_all", histoName[ihisto]));
    hEfficiency_all[ihisto]->SetLineWidth(2);
    hEfficiency_all[ihisto]->SetLineColor(1);
    hEfficiency_all[ihisto]->SetMarkerStyle(20);
    hEfficiency_all[ihisto]->SetMarkerColor(1);
    hEfficiency_all[ihisto]->Divide(hHisto_all[kAcceptedTracks]);
    hEfficiency_all[ihisto]->Write();
    /* MB all efficiency */
    hEfficiency_MB_all[ihisto] = new TH1D(*hHisto_MB_all[ihisto]);
    hEfficiency_MB_all[ihisto]->SetName(Form("%s_efficiency_MB_all", histoName[ihisto]));
    hEfficiency_MB_all[ihisto]->Divide(hHisto_MB_all[kAcceptedTracks]);
    hEfficiency_MB_all[ihisto]->Write();
    /* ratio wrt. MB */
    hEfficiency_ratioMB_all[ihisto] = new TH1D(*hEfficiency_all[ihisto]);
    hEfficiency_ratioMB_all[ihisto]->SetName(Form("%s_efficiency_ratioMB_all", histoName[ihisto]));
    hEfficiency_ratioMB_all[ihisto]->Divide(hEfficiency_MB_all[ihisto]);
    hEfficiency_ratioMB_all[ihisto]->Write();
    /* pt efficiency */
    for (Int_t ibin = 0; ibin < npt; ibin++) {
      hEfficiency_pt[ihisto][ibin] = new TH1D(*hHisto_pt[ihisto][ibin]);
      hEfficiency_pt[ihisto][ibin]->SetName(Form("%s_efficiency_pt%3.1f-%3.1f", histoName[ihisto], pt[ibin], pt[ibin + 1]));
      hEfficiency_pt[ihisto][ibin]->SetLineWidth(2);
      hEfficiency_pt[ihisto][ibin]->SetLineColor(multcentColor[ibin]);
      hEfficiency_pt[ihisto][ibin]->SetMarkerStyle(20);
      hEfficiency_pt[ihisto][ibin]->SetMarkerColor(multcentColor[ibin]);
      hEfficiency_pt[ihisto][ibin]->Divide(hHisto_pt[kAcceptedTracks][ibin]);
      hEfficiency_pt[ihisto][ibin]->Write();
      /* MB pt efficiency */
      hEfficiency_MB_pt[ihisto][ibin] = new TH1D(*hHisto_MB_pt[ihisto][ibin]);
      hEfficiency_MB_pt[ihisto][ibin]->SetName(Form("%s_efficiency_MB_pt%3.1f-%3.1f", histoName[ihisto], pt[ibin], pt[ibin + 1]));
      hEfficiency_MB_pt[ihisto][ibin]->Divide(hHisto_MB_pt[kAcceptedTracks][ibin]);
      hEfficiency_MB_pt[ihisto][ibin]->Write();
      /* ratio wrt. central */
      hEfficiency_ratioMB_pt[ihisto][ibin] = new TH1D(*hEfficiency_pt[ihisto][ibin]);
      hEfficiency_ratioMB_pt[ihisto][ibin]->SetName(Form("%s_efficiency_ratioMB_pt%3.1f-%3.1f", histoName[ihisto], pt[ibin], pt[ibin + 1]));
      hEfficiency_ratioMB_pt[ihisto][ibin]->Divide(hEfficiency_MB_pt[ihisto][ibin]);
      hEfficiency_ratioMB_pt[ihisto][ibin]->Write();
    }

#if 0

    if (ihisto == kAcceptedTracks || ihisto == kMatchedTracks) continue;
    /* MB fraction */
    hFraction_MB[ihisto] = new TH1D(*hHisto_MB[ihisto]);
    hFraction_MB[ihisto]->SetName(Form("%s_fraction_MB", histoName[ihisto]));
    hFraction_MB[ihisto]->SetLineWidth(2);
    hFraction_MB[ihisto]->SetLineColor(1);
    hFraction_MB[ihisto]->SetMarkerStyle(20);
    hFraction_MB[ihisto]->SetMarkerColor(1);
    hFraction_MB[ihisto]->Divide(hHisto_MB[kMatchedTracks]);
    hFraction_MB[ihisto]->Write();
    /* multiplicity/centrality fraction */
    for (Int_t ibin = 0; ibin < hHisto[kMatchedTracks]->GetAxis(kMultCent)->GetNbins(); ibin++) {
       hFraction_multcent[ihisto][ibin] = new TH1D(*hHisto_multcent[ihisto][ibin]);
       hFraction_multcent[ihisto][ibin]->SetName(Form("%s_fraction_multcent%d", histoName[ihisto], ibin));
       hFraction_multcent[ihisto][ibin]->SetLineWidth(2);
       hFraction_multcent[ihisto][ibin]->SetLineColor(multcentColor[ibin]);
       hFraction_multcent[ihisto][ibin]->SetMarkerStyle(20);
       hFraction_multcent[ihisto][ibin]->SetMarkerColor(multcentColor[ibin]);
       hFraction_multcent[ihisto][ibin]->Divide(hHisto_multcent[kMatchedTracks][ibin]);
       hFraction_multcent[ihisto][ibin]->Write();
       /* ratio wrt. MB */
       hFraction_ratioMB_multcent[ihisto][ibin] = new TH1D(*hFraction_multcent[ihisto][ibin]);
       hFraction_ratioMB_multcent[ihisto][ibin]->SetName(Form("%s_fraction_ratioMB_multcent%d", histoName[ihisto], ibin));
       hFraction_ratioMB_multcent[ihisto][ibin]->SetLineWidth(2);
       hFraction_ratioMB_multcent[ihisto][ibin]->SetLineColor(multcentColor[ibin]);
       hFraction_ratioMB_multcent[ihisto][ibin]->SetMarkerStyle(20);
       hFraction_ratioMB_multcent[ihisto][ibin]->SetMarkerColor(multcentColor[ibin]);
       hFraction_ratioMB_multcent[ihisto][ibin]->Divide(hFraction_MB[ihisto]);
       hFraction_ratioMB_multcent[ihisto][ibin]->Write();
    }

    #endif
 
  }
  fileout->Close();
  
}
#endif

//_____________________________________________________________________________-

TH1D *
TOFmatchMC_get(const Char_t *filename, const Char_t *name, Option_t *opt = "", Int_t color = 1, Int_t marker = 20)
{

  TFile *f = TFile::Open(filename);
  if (!f || !f->IsOpen())
    return NULL;
  TH1D *h = (TH1D *)f->Get(name);
  if (!h)
    return NULL;
  h->SetLineColor(color);
  h->SetLineWidth(2);
  h->SetMarkerColor(color);
  h->SetMarkerStyle(marker);
  h->Draw(opt);
  return h;
}

//_____________________________________________________________________________-

TH1D *
TOFmatchMC_divide(const Char_t *filename, const Char_t *name1, const Char_t *name2, Option_t *opt = "")
{

  TFile *f = TFile::Open(filename);
  if (!f || !f->IsOpen())
    return NULL;
  TH1D *h1 = (TH1D *)f->Get(name1);
  TH1D *h2 = (TH1D *)f->Get(name2);
  if (!h1 || !h2)
    return NULL;
  TH1D *hr = new TH1D(*h1);
  hr->Divide(h2);
  hr->Draw(opt);
  return hr;
}

//_____________________________________________________________________________-

TH1D *
TOFmatchMC_sub(const Char_t *filename, const Char_t *name1, const Char_t *name2, Option_t *opt = "", Int_t color = 1, Int_t marker = 20)
{

  TFile *f = TFile::Open(filename);
  if (!f || !f->IsOpen())
    return NULL;
  TH1D *h1 = (TH1D *)f->Get(name1);
  TH1D *h2 = (TH1D *)f->Get(name2);
  if (!h1 || !h2)
    return NULL;
  TH1D *hr = new TH1D(*h1);
  hr->Add(h2, -1.);
  hr->SetLineColor(color);
  hr->SetLineWidth(2);
  hr->SetMarkerColor(color);
  hr->SetMarkerStyle(marker);
  hr->Draw(opt);
  return hr;
}

//_____________________________________________________________________________-

TH1D *
TOFmatchMC_compare(const Char_t *filename1, const Char_t *filename2, const Char_t *name, Option_t *opt = "", Int_t color = 1, Int_t marker = 20)
{

  TFile *f1 = TFile::Open(filename1);
  TFile *f2 = TFile::Open(filename2);
  if (!f1 || !f2 || !f1->IsOpen() || !f2->IsOpen())
    return NULL;
  TH1D *h1 = (TH1D *)f1->Get(name);
  TH1D *h2 = (TH1D *)f2->Get(name);
  if (!h1 || !h2)
    return NULL;
  TH1D *hr = new TH1D(*h1);
  hr->Divide(h2);
  hr->SetLineColor(color);
  hr->SetLineWidth(2);
  hr->SetMarkerColor(color);
  hr->SetMarkerStyle(marker);
  hr->Draw(opt);
  return hr;
}

//_____________________________________________________________________________-

TH1D *
TOFmatchMC_comparesub(const Char_t *filename1, const Char_t *filename2, const Char_t *name1, const Char_t *name2, Option_t *opt = "", Int_t color = 1, Int_t marker = 20)
{

  TFile *f1 = TFile::Open(filename1);
  TFile *f2 = TFile::Open(filename2);
  if (!f1 || !f2 || !f1->IsOpen() || !f2->IsOpen())
    return NULL;
  TH1D *h11 = (TH1D *)f1->Get(name1);
  TH1D *h21 = (TH1D *)f2->Get(name1);
  TH1D *h12 = (TH1D *)f1->Get(name2);
  TH1D *h22 = (TH1D *)f2->Get(name2);
  if (!h11 || !h21 || !h12 || !h22)
    return NULL;
  TH1D *hs1 = new TH1D(*h11);
  hs1->Add(h12, -1.);
  TH1D *hs2 = new TH1D(*h21);
  hs2->Add(h22, -1.);
  TH1D *hr = new TH1D(*hs1);
  hr->Divide(hs2);
  hr->SetLineColor(color);
  hr->SetLineWidth(2);
  hr->SetMarkerColor(color);
  hr->SetMarkerStyle(marker);
  hr->Draw(opt);
  return hr;
}


TH1D *
TOFmatchEff_efficiencyPt_MB_plot(const Char_t *filename, Int_t ihisto = kMatchedTracks, Int_t icharge, Int_t marker = 20, Int_t color = 2, Option_t *opt = "")
{
  
  TCanvas *cCanvas1 = new TCanvas("cCanvas1");
  TCanvas *cCanvas2 = new TCanvas("cCanvas2");
  const Char_t *destdir = "matchingEfficiency_DATA";
  
  Double_t ptMin = 0.5;
  Double_t ptMax = 5.0;

  TF1 *fEff = new TF1("fEff", "[0] + [1] * x - [2] * TMath::Exp(-[3] * TMath::Power(x, [4]))", 0., 5.0);
  fEff->SetParameter(0, 0.5);
  fEff->SetParameter(1, 0.);
  fEff->SetParameter(2, 0.5);
  fEff->SetParameter(3, 1.);
  fEff->SetParameter(4, 2.);


  TFile *filein = TFile::Open(filename);
  TH1D *hEfficiencyPt = (TH1D *)filein->Get(Form("hEfficiencyPt_MB_%s_%s", histoName[ihisto], chargeName[icharge]));
  hEfficiencyPt->Fit(fEff, "0", "", 0.5, 5.0);
  hEfficiencyPt->SetTitle(Form("%s tracks;p_{T} (GeV/c);acceptance #times efficiency;", chargeName[icharge]));
  hEfficiencyPt->SetMinimum(0.4);
  hEfficiencyPt->SetMaximum(0.8);
  hEfficiencyPt->SetMarkerStyle(marker);
  hEfficiencyPt->SetMarkerColor(color);
  hEfficiencyPt->SetMarkerSize(1.5);
  hEfficiencyPt->SetLineWidth(2);
  hEfficiencyPt->SetLineColor(color);
  hEfficiencyPt->GetXaxis()->SetRangeUser(ptMin + 0.001, ptMax - 0.001);
  hEfficiencyPt->SetStats(kFALSE);
  cCanvas1->cd();
  hEfficiencyPt->Draw(opt);
  fEff->Draw("same");

  cCanvas1->SetGridx();
  cCanvas1->SetGridy();
  cCanvas1->SaveAs(Form("%s/efficiencyPt_MB_%s.C", destdir, chargeName[icharge]));
  cCanvas1->SaveAs(Form("%s/efficiencyPt_MB_%s.root", destdir, chargeName[icharge]));
  cCanvas1->SaveAs(Form("%s/efficiencyPt_MB_%s.png", destdir, chargeName[icharge]));
  cCanvas1->SaveAs(Form("%s/efficiencyPt_MB_%s.eps", destdir, chargeName[icharge]));
  
  TH1D *hRatioPt = new TH1D(*hEfficiencyPt);
  hRatioPt->Divide(fEff);
  hRatioPt->SetTitle(Form("%s tracks;p_{T} (GeV/c);ratio wrt. fitted dependence;", chargeName[icharge]));
  hRatioPt->SetMinimum(0.9);
  hRatioPt->SetMaximum(1.1);
  cCanvas2->cd();
  hRatioPt->Draw();

  cCanvas2->SetGridx();
  cCanvas2->SetGridy();
  cCanvas2->SaveAs(Form("%s/efficiencyPt_ratioFit_MB_%s.C", destdir, chargeName[icharge]));
  cCanvas2->SaveAs(Form("%s/efficiencyPt_ratioFit_MB_%s.root", destdir, chargeName[icharge]));
  cCanvas2->SaveAs(Form("%s/efficiencyPt_ratioFit_MB_%s.png", destdir, chargeName[icharge]));
  cCanvas2->SaveAs(Form("%s/efficiencyPt_ratioFit_MB_%s.eps", destdir, chargeName[icharge]));
  

  //  hEfficiencyPt->Add(fEff, -1.);
  return hEfficiencyPt;
}


//_____________________________________________________________________________-

TH1D *
TOFmatchEff_efficiencyPt_centrality_all_plot(const Char_t *filename, Int_t ihisto = kMatchedTracks, Int_t marker = 20, Int_t color = 1, Option_t *opt = "")
{
  
  TCanvas *cCanvas1 = new TCanvas("cCanvas1");
  TCanvas *cCanvas2 = new TCanvas("cCanvas2");
  const Char_t *destdir = "matchingEfficiency_DATA";
  
  Double_t ptMin = 0.5;
  Double_t ptMax = 5.0;

  TF1 *fMismatchFrac = new TF1("fMismatchFrac", "([0]+[1]*TMath::Exp(-[2]*TMath::Power(x,[3])))*[4]", 0., 5.0);
  fMismatchFrac->SetParameter(0, 0.0447133);
  fMismatchFrac->SetParameter(1, 0.179172);
  fMismatchFrac->SetParameter(2, 2.54333);
  fMismatchFrac->SetParameter(3, 1.16819);
  fMismatchFrac->SetParameter(4, 1.);
  
  TF1 *fEff = new TF1("fEff", "([0] + [1] * x - [2] * TMath::Exp(-[3] * TMath::Power(x, [4]))) * [5]", 0., 5.0);
  fEff->SetParameter(0, 0.5);
  fEff->SetParameter(1, 0.);
  fEff->SetParameter(2, 0.5);
  fEff->SetParameter(3, 1.);
  fEff->SetParameter(4, 2.);
  fEff->FixParameter(5, 1.);
  
  TFile *filein = TFile::Open(filename);
  TH1D *hEfficiencyPt = (TH1D *)filein->Get(Form("hEfficiencyAllPt_MB_%s", histoName[ihisto]));
  hEfficiencyPt->Fit(fEff, "0", "", 0.5, 5.0);
  hEfficiencyPt->SetTitle("all particles;p_{T} (GeV/c);acceptance #times efficiency;");
  hEfficiencyPt->SetMinimum(0.4);
  hEfficiencyPt->SetMaximum(0.8);
  hEfficiencyPt->SetMarkerStyle(marker);
  hEfficiencyPt->SetMarkerColor(color);
  hEfficiencyPt->SetMarkerSize(1.5);
  hEfficiencyPt->SetLineWidth(2);
  hEfficiencyPt->SetLineColor(color);
  hEfficiencyPt->GetXaxis()->SetRangeUser(0.5 + 0.001, 5.0 - 0.001);
  hEfficiencyPt->SetStats(kFALSE);
  cCanvas1->cd();
  hEfficiencyPt->Draw(opt);
  fEff->Draw("same");

  cCanvas1->SetGridx();
  cCanvas1->SetGridy();
  cCanvas1->SaveAs(Form("%s/efficiencyPt_MB_all.C", destdir));
  cCanvas1->SaveAs(Form("%s/efficiencyPt_MB_all.root", destdir));
  cCanvas1->SaveAs(Form("%s/efficiencyPt_MB_all.png", destdir));
  cCanvas1->SaveAs(Form("%s/efficiencyPt_MB_all.eps", destdir));

  TH1D *hRatioPt = new TH1D(*hEfficiencyPt);
  hRatioPt->Divide(fEff);
  hRatioPt->SetTitle("all particles;p_{T} (GeV/c);ratio wrt. fitted dependence;");
  hRatioPt->SetMinimum(0.9);
  hRatioPt->SetMaximum(1.1);
  cCanvas2->cd();
  hRatioPt->Draw();

  cCanvas2->SetGridx();
  cCanvas2->SetGridy();
  cCanvas2->SaveAs(Form("%s/efficiencyPt_ratioFit_MB_all.C", destdir));
  cCanvas2->SaveAs(Form("%s/efficiencyPt_ratioFit_MB_all.root", destdir));
  cCanvas2->SaveAs(Form("%s/efficiencyPt_ratioFit_MB_all.png", destdir));
  cCanvas2->SaveAs(Form("%s/efficiencyPt_ratioFit_MB_all.eps", destdir));
  
  /* fix efficiency shape and release scale factor */
  fEff->FixParameter(0, fEff->GetParameter(0));
  fEff->FixParameter(1, fEff->GetParameter(1));
  fEff->FixParameter(2, fEff->GetParameter(2));
  fEff->FixParameter(3, fEff->GetParameter(3));
  fEff->FixParameter(4, fEff->GetParameter(4));
  fEff->ReleaseParameter(5);
  
  TH1D *hEfficiencyCent = new TH1D("hEfficiencyCent", "all particles;centrality percentile;acceptance x efficiency scale factor;", NcentralityBins, centralityBin);
  hEfficiencyCent->SetMinimum(0.95);
  hEfficiencyCent->SetMaximum(1.05);
  hEfficiencyCent->SetMarkerStyle(marker);
  hEfficiencyCent->SetMarkerColor(color);
  hEfficiencyCent->SetMarkerSize(1.5);
  hEfficiencyCent->SetLineWidth(2);
  hEfficiencyCent->SetLineColor(color);
  hEfficiencyCent->SetStats(kFALSE);
  
  
  TH1D *hEfficiencyPt_cent[NcentralityBins];
  TH1D *hRatioPt_cent[NcentralityBins];
  for (Int_t icent = 0; icent < NcentralityBins; icent++) {
    
  
    hEfficiencyPt_cent[icent] = (TH1D *)filein->Get(Form("hEfficiencyAllPt_centrality%d_%s", icent, histoName[ihisto]));
    hEfficiencyPt_cent[icent]->Fit(fEff, "", "", 0.5, 5.0);
    
    hEfficiencyPt_cent[icent]->SetTitle(Form("all particles (%d-%d\%);p_{T} (GeV/c);acceptance #times efficiency;", (Int_t)centralityBin[icent], (Int_t)centralityBin[icent + 1]));
    hEfficiencyPt_cent[icent]->SetMinimum(0.2);
    hEfficiencyPt_cent[icent]->SetMaximum(0.8);
    hEfficiencyPt_cent[icent]->SetMarkerStyle(marker);
    hEfficiencyPt_cent[icent]->SetMarkerColor(color);
    hEfficiencyPt_cent[icent]->SetMarkerSize(1.5);
    hEfficiencyPt_cent[icent]->SetLineWidth(2);
    hEfficiencyPt_cent[icent]->SetLineColor(color);
    hEfficiencyPt_cent[icent]->GetXaxis()->SetRangeUser(0.5 + 0.001, 5.0 - 0.001);
    hEfficiencyPt_cent[icent]->SetStats(kFALSE);
    cCanvas1->cd();
    hEfficiencyPt_cent[icent]->Draw(opt);
    fEff->Draw("same");
    
    hEfficiencyCent->SetBinContent(icent + 1, fEff->GetParameter(5));
    hEfficiencyCent->SetBinError(icent + 1, fEff->GetParError(5));
    
    cCanvas1->SetGridx();
    cCanvas1->SetGridy();
    cCanvas1->SaveAs(Form("%s/efficiencyPt_centrality%d_all.C", destdir, icent));
    cCanvas1->SaveAs(Form("%s/efficiencyPt_centrality%d_all.root", destdir, icent));
    cCanvas1->SaveAs(Form("%s/efficiencyPt_centrality%d_all.png", destdir, icent));
    cCanvas1->SaveAs(Form("%s/efficiencyPt_centrality%d_all.eps", destdir, icent));
    
    hRatioPt_cent[icent] = new TH1D(*hEfficiencyPt_cent[icent]);
    hRatioPt_cent[icent]->Divide(fEff);
    hRatioPt_cent[icent]->SetTitle(Form("all particles (%d-%d\%);p_{T} (GeV/c);ratio wrt. fitted dependence;", (Int_t)centralityBin[icent], (Int_t)centralityBin[icent + 1]));
    hRatioPt_cent[icent]->SetMinimum(0.9);
    hRatioPt_cent[icent]->SetMaximum(1.1);
    cCanvas2->cd();
    hRatioPt_cent[icent]->Draw();

    cCanvas2->SetGridx();
    cCanvas2->SetGridy();
    cCanvas2->SaveAs(Form("%s/efficiencyPt_ratioFit_centrality%d_all.C", destdir, icent));
    cCanvas2->SaveAs(Form("%s/efficiencyPt_ratioFit_centrality%d_all.root", destdir, icent));
    cCanvas2->SaveAs(Form("%s/efficiencyPt_ratioFit_centrality%d_all.png", destdir, icent));
    cCanvas2->SaveAs(Form("%s/efficiencyPt_ratioFit_centrality%d_all.eps", destdir, icent));

    
  }

  TF1 *fEffCent = new TF1("fEffCent", "[0] - [1] * TMath::Exp(-[2] * TMath::Power(x, [3]))", 0., 90.);
  fEffCent->SetParameter(0, 1.02);
  fEffCent->SetParameter(1, 0.04);
  fEffCent->SetParameter(2, 0.001);
  fEffCent->SetParameter(3, 2.);
  //  hEfficiencyCent->Fit(fEffCent, "q0", "", 0., 90.);
  
  TCanvas *cCanvas3 = new TCanvas("cCanvas3");
  hEfficiencyCent->Draw();
  //  fEffCent->Draw("same");
  
  cCanvas3->SetGridx();
  cCanvas3->SetGridy();
  cCanvas3->SaveAs(Form("%s/efficiencyCentrality_scaleFactor_all.C", destdir));
  cCanvas3->SaveAs(Form("%s/efficiencyCentrality_scaleFactor_all.root", destdir));
  cCanvas3->SaveAs(Form("%s/efficiencyCentrality_scaleFactor_all.png", destdir));
  cCanvas3->SaveAs(Form("%s/efficiencyCentrality_scaleFactor_all.eps", destdir));

  TCanvas *cCanvas4 = new TCanvas("cCanvas4");

  TH1D *hRatioCent = new TH1D(*hEfficiencyCent);
  hRatioCent->Divide(fEffCent);
  hRatioCent->SetTitle(Form("all particles;centrality percentile;ratio wrt. fitted dependence;"));
  hRatioCent->SetMinimum(0.95);
  hRatioCent->SetMaximum(1.05);
  cCanvas4->cd();
  hRatioCent->Draw();

  cCanvas4->SetGridx();
  cCanvas4->SetGridy();
  cCanvas4->SaveAs(Form("%s/efficiencyCentrality_scaleFactor_ratioFit_all.C", destdir));
  cCanvas4->SaveAs(Form("%s/efficiencyCentrality_scaleFactor_ratioFit_all.root", destdir));
  cCanvas4->SaveAs(Form("%s/efficiencyCentrality_scaleFactor_ratioFit_all.png", destdir));
  cCanvas4->SaveAs(Form("%s/efficiencyCentrality_scaleFactor_ratioFit_all.eps", destdir));
  


  //  hEfficiencyPt->Add(fEff, -1.);
  return hEfficiencyCent;
}


//_____________________________________________________________________________-

TH1D *
TOFmatchEff_efficiencyPt_centrality_all_plot_nomismatch(const Char_t *filename, Int_t ihisto = kMatchedTracks, Int_t marker = 20, Int_t color = 1, Option_t *opt = "")
{

  TF1 *fpol0 = (TF1 *)gROOT->GetFunction("pol0");
  fpol0->SetRange(0., 5.0);

  TCanvas *cCanvas1 = new TCanvas("cCanvas1");
  TCanvas *cCanvas2 = new TCanvas("cCanvas2");
  const Char_t *destdir = "matchingEfficiency_DATA";
  
  Double_t ptMin = 0.5;
  Double_t ptMax = 5.0;

  TF1 *fMismatchCorr = new TF1("fMismatchCorr", "1. - ([0]+[1]*TMath::Exp(-[2]*TMath::Power(x,[3])))*[4]", 0., 5.0);
  fMismatchCorr->SetParameter(0, 4.47133e-02);
  fMismatchCorr->SetParameter(1, 1.79172e-01);
  fMismatchCorr->SetParameter(2, 2.54333e+00);
  fMismatchCorr->SetParameter(3, 1.16819e+00);
  fMismatchCorr->SetParameter(4, 1.);

  TF1 *fMismatchScale = new TF1("fMismatchScale", "[0] + [1] * TMath::Exp(-[2] * x)", 0., 100.);
  fMismatchScale->SetParameter(0, -6.36877e-02);
  fMismatchScale->SetParameter(1, 1.74818e+00);
  fMismatchScale->SetParameter(2, 3.00818e-02);
  
  TFile *filein = TFile::Open(filename);
  TH1D *hEfficiencyPt = (TH1D *)filein->Get(Form("hEfficiencyAllPt_MB_%s", histoName[ihisto]));
  if (ihisto != kMatchedCorrelatedTracks)
    hEfficiencyPt->Multiply(fMismatchCorr);
  hEfficiencyPt->SetTitle("all particles;p_{T} (GeV/c);acceptance #times efficiency;");
  hEfficiencyPt->SetMinimum(0.4);
  hEfficiencyPt->SetMaximum(0.8);
  hEfficiencyPt->SetMarkerStyle(marker);
  hEfficiencyPt->SetMarkerColor(color);
  hEfficiencyPt->SetMarkerSize(1.5);
  hEfficiencyPt->SetLineWidth(2);
  hEfficiencyPt->SetLineColor(color);
  hEfficiencyPt->GetXaxis()->SetRangeUser(0.5 + 0.001, 5.0 - 0.001);
  hEfficiencyPt->SetStats(kFALSE);
  cCanvas1->cd();
  hEfficiencyPt->Draw(opt);

  cCanvas1->SetGridx();
  cCanvas1->SetGridy();
  cCanvas1->SaveAs(Form("%s/efficiencyPt_MB_all.C", destdir));
  cCanvas1->SaveAs(Form("%s/efficiencyPt_MB_all.root", destdir));
  cCanvas1->SaveAs(Form("%s/efficiencyPt_MB_all.png", destdir));
  cCanvas1->SaveAs(Form("%s/efficiencyPt_MB_all.eps", destdir));

  TH1D *hEfficiencyCent = new TH1D("hEfficiencyCent", "all particles;centrality percentile;acceptance x efficiency scale factor;", NcentralityBins, centralityBin);
  hEfficiencyCent->SetMinimum(0.95);
  hEfficiencyCent->SetMaximum(1.05);
  hEfficiencyCent->SetMarkerStyle(marker);
  hEfficiencyCent->SetMarkerColor(color);
  hEfficiencyCent->SetMarkerSize(1.5);
  hEfficiencyCent->SetLineWidth(2);
  hEfficiencyCent->SetLineColor(color);
  hEfficiencyCent->SetStats(kFALSE);
  
  
  TH1D *hEfficiencyPt_cent[NcentralityBins];
  TH1D *hRatioPt_cent[NcentralityBins];
  Double_t centmean;
  for (Int_t icent = 0; icent < NcentralityBins; icent++) {
    
    centmean = 0.5 * (centralityBin[icent] + centralityBin[icent + 1]);
    hEfficiencyPt_cent[icent] = (TH1D *)filein->Get(Form("hEfficiencyAllPt_centrality%d_%s", icent, histoName[ihisto]));
    fMismatchCorr->SetParameter(4, fMismatchScale->Eval(centmean));
    if (ihisto != kMatchedCorrelatedTracks)
      hEfficiencyPt_cent[icent]->Multiply(fMismatchCorr);
    hEfficiencyPt_cent[icent]->Divide(hEfficiencyPt);
    hEfficiencyPt_cent[icent]->Fit(fpol0, "q0", "", 0.5, 5.0);
    hEfficiencyPt_cent[icent]->SetTitle(Form("all particles (%d-%d\%);p_{T} (GeV/c);acceptance #times efficiency;", (Int_t)centralityBin[icent], (Int_t)centralityBin[icent + 1]));
    hEfficiencyPt_cent[icent]->SetMinimum(0.2);
    hEfficiencyPt_cent[icent]->SetMaximum(0.8);
    hEfficiencyPt_cent[icent]->SetMarkerStyle(marker);
    hEfficiencyPt_cent[icent]->SetMarkerColor(color);
    hEfficiencyPt_cent[icent]->SetMarkerSize(1.5);
    hEfficiencyPt_cent[icent]->SetLineWidth(2);
    hEfficiencyPt_cent[icent]->SetLineColor(color);
    hEfficiencyPt_cent[icent]->GetXaxis()->SetRangeUser(0.5 + 0.001, 5.0 - 0.001);
    hEfficiencyPt_cent[icent]->SetStats(kFALSE);
    cCanvas1->cd();
    hEfficiencyPt_cent[icent]->Draw(opt);
    fpol0->Draw("same");
    
    hEfficiencyCent->SetBinContent(icent + 1, fpol0->GetParameter(0));
    hEfficiencyCent->SetBinError(icent + 1, fpol0->GetParError(0));
    
    cCanvas1->SetGridx();
    cCanvas1->SetGridy();
    cCanvas1->SaveAs(Form("%s/efficiencyPt_centrality%d_all.C", destdir, icent));
    cCanvas1->SaveAs(Form("%s/efficiencyPt_centrality%d_all.root", destdir, icent));
    cCanvas1->SaveAs(Form("%s/efficiencyPt_centrality%d_all.png", destdir, icent));
    cCanvas1->SaveAs(Form("%s/efficiencyPt_centrality%d_all.eps", destdir, icent));
    
    hRatioPt_cent[icent] = new TH1D(*hEfficiencyPt_cent[icent]);
    hRatioPt_cent[icent]->Divide(fpol0);
    hRatioPt_cent[icent]->SetTitle(Form("all particles (%d-%d\%);p_{T} (GeV/c);ratio wrt. fitted dependence;", (Int_t)centralityBin[icent], (Int_t)centralityBin[icent + 1]));
    hRatioPt_cent[icent]->SetMinimum(0.9);
    hRatioPt_cent[icent]->SetMaximum(1.1);
    cCanvas2->cd();
    hRatioPt_cent[icent]->Draw();

    cCanvas2->SetGridx();
    cCanvas2->SetGridy();
    cCanvas2->SaveAs(Form("%s/efficiencyPt_ratioFit_centrality%d_all.C", destdir, icent));
    cCanvas2->SaveAs(Form("%s/efficiencyPt_ratioFit_centrality%d_all.root", destdir, icent));
    cCanvas2->SaveAs(Form("%s/efficiencyPt_ratioFit_centrality%d_all.png", destdir, icent));
    cCanvas2->SaveAs(Form("%s/efficiencyPt_ratioFit_centrality%d_all.eps", destdir, icent));

    
  }

  TF1 *fEffCent = new TF1("fEffCent", "[0] - [1] * TMath::Exp(-[2] * TMath::Power(x, [3]))", 0., 90.);
  fEffCent->SetParameter(0, 1.02);
  fEffCent->SetParameter(1, 0.04);
  fEffCent->SetParameter(2, 0.001);
  fEffCent->SetParameter(3, 2.);
  //  hEfficiencyCent->Fit(fEffCent, "q0", "", 0., 90.);
  
  TCanvas *cCanvas3 = new TCanvas("cCanvas3");
  hEfficiencyCent->Draw();
  //  fEffCent->Draw("same");
  
  cCanvas3->SetGridx();
  cCanvas3->SetGridy();
  cCanvas3->SaveAs(Form("%s/efficiencyCentrality_scaleFactor_all.C", destdir));
  cCanvas3->SaveAs(Form("%s/efficiencyCentrality_scaleFactor_all.root", destdir));
  cCanvas3->SaveAs(Form("%s/efficiencyCentrality_scaleFactor_all.png", destdir));
  cCanvas3->SaveAs(Form("%s/efficiencyCentrality_scaleFactor_all.eps", destdir));

  TCanvas *cCanvas4 = new TCanvas("cCanvas4");

  TH1D *hRatioCent = new TH1D(*hEfficiencyCent);
  hRatioCent->Divide(fEffCent);
  hRatioCent->SetTitle(Form("all particles;centrality percentile;ratio wrt. fitted dependence;"));
  hRatioCent->SetMinimum(0.95);
  hRatioCent->SetMaximum(1.05);
  cCanvas4->cd();
  hRatioCent->Draw();

  cCanvas4->SetGridx();
  cCanvas4->SetGridy();
  cCanvas4->SaveAs(Form("%s/efficiencyCentrality_scaleFactor_ratioFit_all.C", destdir));
  cCanvas4->SaveAs(Form("%s/efficiencyCentrality_scaleFactor_ratioFit_all.root", destdir));
  cCanvas4->SaveAs(Form("%s/efficiencyCentrality_scaleFactor_ratioFit_all.png", destdir));
  cCanvas4->SaveAs(Form("%s/efficiencyCentrality_scaleFactor_ratioFit_all.eps", destdir));
  


  //  hEfficiencyPt->Add(fEff, -1.);
  return hEfficiencyCent;
}


TH1D *
TOFmatchEff_rapidityCut(const Char_t *filename, Int_t ipart, Int_t icharge, Int_t color = 2, Int_t marker = 20, Option_t *opt = "")
{

  TFile *filein = TFile::Open(filename);
  TH1D *hEfficiency_MB = (TH1D *)filein->Get(Form("hEfficiencyPt_MB_hMatchedTracks_%s", chargeName[icharge]));
  TH1D *hEfficiencyPID_MB = (TH1D *)filein->Get(Form("hEfficiencyPIDPt_MB_hMatchedTracks_%s_%s", AliPID::ParticleName(ipart), chargeName[icharge]));

  TH1D *hRatio = new TH1D(*hEfficiencyPID_MB);
  hRatio->Divide(hEfficiency_MB);
  hRatio->SetLineColor(color);
  hRatio->SetLineWidth(2);
  hRatio->SetMarkerColor(color);
  hRatio->SetMarkerStyle(marker);
  hRatio->Draw(opt);
  return hRatio;
}

void
TOFmatchEff_checkFEAmap(const Char_t *filename)
{

  TFile *filein = TFile::Open(filename);
  TH2F *hFEAMap = (TH2F *)filein->Get("hFEAMap");
  TH2F *hEmptyFEA = new TH2F("hEmptyFEA", "", 72, 0., 18., 91, 0., 91.);

  Float_t nhits = hFEAMap->GetEntries();
  if (nhits <= 0) {
    printf("found not hits.\n");
    return;
  }
  printf("found %d hits\n", nhits);
  Float_t avhits = nhits / (hFEAMap->GetNbinsX() * hFEAMap->GetNbinsX());
  printf("on average %f hits/FEA\n", avhits);
  
  TH1F *hFEANormHit = new TH1F("hFEANormHit", "", 1000, 0., 3.);
  for (Int_t ibinx = 0; ibinx < hFEAMap->GetNbinsX(); ibinx++)
    for (Int_t ibiny = 0; ibiny < hFEAMap->GetNbinsY(); ibiny++) {
      if (hFEAMap->GetBinContent(ibinx + 1, ibiny + 1) == 0.) {
	hEmptyFEA->SetBinContent(ibinx + 1, ibiny + 1, 1.);
	continue;
      }
      hFEANormHit->Fill(hFEAMap->GetBinContent(ibinx + 1, ibiny + 1) / avhits);
    }

  TCanvas *cCanvas1 = new TCanvas("cCanvas1");
  cCanvas1->Divide(1, 2);
  cCanvas1->cd(1);
  hFEAMap->Draw("colz");
  cCanvas1->cd(2);
  hEmptyFEA->Draw("colz");

  TCanvas *cCanvas2 = new TCanvas("cCanvas2");
  hFEANormHit->Draw();


  TFile *fileout = TFile::Open(Form("TOFmatchEff_checkFEAmap.%s", filename), "RECREATE");
  hFEAMap->Write();
  hFEANormHit->Write();
  hEmptyFEA->Write();
  fileout->Close();
}
 TOFmatchEff.C:1
 TOFmatchEff.C:2
 TOFmatchEff.C:3
 TOFmatchEff.C:4
 TOFmatchEff.C:5
 TOFmatchEff.C:6
 TOFmatchEff.C:7
 TOFmatchEff.C:8
 TOFmatchEff.C:9
 TOFmatchEff.C:10
 TOFmatchEff.C:11
 TOFmatchEff.C:12
 TOFmatchEff.C:13
 TOFmatchEff.C:14
 TOFmatchEff.C:15
 TOFmatchEff.C:16
 TOFmatchEff.C:17
 TOFmatchEff.C:18
 TOFmatchEff.C:19
 TOFmatchEff.C:20
 TOFmatchEff.C:21
 TOFmatchEff.C:22
 TOFmatchEff.C:23
 TOFmatchEff.C:24
 TOFmatchEff.C:25
 TOFmatchEff.C:26
 TOFmatchEff.C:27
 TOFmatchEff.C:28
 TOFmatchEff.C:29
 TOFmatchEff.C:30
 TOFmatchEff.C:31
 TOFmatchEff.C:32
 TOFmatchEff.C:33
 TOFmatchEff.C:34
 TOFmatchEff.C:35
 TOFmatchEff.C:36
 TOFmatchEff.C:37
 TOFmatchEff.C:38
 TOFmatchEff.C:39
 TOFmatchEff.C:40
 TOFmatchEff.C:41
 TOFmatchEff.C:42
 TOFmatchEff.C:43
 TOFmatchEff.C:44
 TOFmatchEff.C:45
 TOFmatchEff.C:46
 TOFmatchEff.C:47
 TOFmatchEff.C:48
 TOFmatchEff.C:49
 TOFmatchEff.C:50
 TOFmatchEff.C:51
 TOFmatchEff.C:52
 TOFmatchEff.C:53
 TOFmatchEff.C:54
 TOFmatchEff.C:55
 TOFmatchEff.C:56
 TOFmatchEff.C:57
 TOFmatchEff.C:58
 TOFmatchEff.C:59
 TOFmatchEff.C:60
 TOFmatchEff.C:61
 TOFmatchEff.C:62
 TOFmatchEff.C:63
 TOFmatchEff.C:64
 TOFmatchEff.C:65
 TOFmatchEff.C:66
 TOFmatchEff.C:67
 TOFmatchEff.C:68
 TOFmatchEff.C:69
 TOFmatchEff.C:70
 TOFmatchEff.C:71
 TOFmatchEff.C:72
 TOFmatchEff.C:73
 TOFmatchEff.C:74
 TOFmatchEff.C:75
 TOFmatchEff.C:76
 TOFmatchEff.C:77
 TOFmatchEff.C:78
 TOFmatchEff.C:79
 TOFmatchEff.C:80
 TOFmatchEff.C:81
 TOFmatchEff.C:82
 TOFmatchEff.C:83
 TOFmatchEff.C:84
 TOFmatchEff.C:85
 TOFmatchEff.C:86
 TOFmatchEff.C:87
 TOFmatchEff.C:88
 TOFmatchEff.C:89
 TOFmatchEff.C:90
 TOFmatchEff.C:91
 TOFmatchEff.C:92
 TOFmatchEff.C:93
 TOFmatchEff.C:94
 TOFmatchEff.C:95
 TOFmatchEff.C:96
 TOFmatchEff.C:97
 TOFmatchEff.C:98
 TOFmatchEff.C:99
 TOFmatchEff.C:100
 TOFmatchEff.C:101
 TOFmatchEff.C:102
 TOFmatchEff.C:103
 TOFmatchEff.C:104
 TOFmatchEff.C:105
 TOFmatchEff.C:106
 TOFmatchEff.C:107
 TOFmatchEff.C:108
 TOFmatchEff.C:109
 TOFmatchEff.C:110
 TOFmatchEff.C:111
 TOFmatchEff.C:112
 TOFmatchEff.C:113
 TOFmatchEff.C:114
 TOFmatchEff.C:115
 TOFmatchEff.C:116
 TOFmatchEff.C:117
 TOFmatchEff.C:118
 TOFmatchEff.C:119
 TOFmatchEff.C:120
 TOFmatchEff.C:121
 TOFmatchEff.C:122
 TOFmatchEff.C:123
 TOFmatchEff.C:124
 TOFmatchEff.C:125
 TOFmatchEff.C:126
 TOFmatchEff.C:127
 TOFmatchEff.C:128
 TOFmatchEff.C:129
 TOFmatchEff.C:130
 TOFmatchEff.C:131
 TOFmatchEff.C:132
 TOFmatchEff.C:133
 TOFmatchEff.C:134
 TOFmatchEff.C:135
 TOFmatchEff.C:136
 TOFmatchEff.C:137
 TOFmatchEff.C:138
 TOFmatchEff.C:139
 TOFmatchEff.C:140
 TOFmatchEff.C:141
 TOFmatchEff.C:142
 TOFmatchEff.C:143
 TOFmatchEff.C:144
 TOFmatchEff.C:145
 TOFmatchEff.C:146
 TOFmatchEff.C:147
 TOFmatchEff.C:148
 TOFmatchEff.C:149
 TOFmatchEff.C:150
 TOFmatchEff.C:151
 TOFmatchEff.C:152
 TOFmatchEff.C:153
 TOFmatchEff.C:154
 TOFmatchEff.C:155
 TOFmatchEff.C:156
 TOFmatchEff.C:157
 TOFmatchEff.C:158
 TOFmatchEff.C:159
 TOFmatchEff.C:160
 TOFmatchEff.C:161
 TOFmatchEff.C:162
 TOFmatchEff.C:163
 TOFmatchEff.C:164
 TOFmatchEff.C:165
 TOFmatchEff.C:166
 TOFmatchEff.C:167
 TOFmatchEff.C:168
 TOFmatchEff.C:169
 TOFmatchEff.C:170
 TOFmatchEff.C:171
 TOFmatchEff.C:172
 TOFmatchEff.C:173
 TOFmatchEff.C:174
 TOFmatchEff.C:175
 TOFmatchEff.C:176
 TOFmatchEff.C:177
 TOFmatchEff.C:178
 TOFmatchEff.C:179
 TOFmatchEff.C:180
 TOFmatchEff.C:181
 TOFmatchEff.C:182
 TOFmatchEff.C:183
 TOFmatchEff.C:184
 TOFmatchEff.C:185
 TOFmatchEff.C:186
 TOFmatchEff.C:187
 TOFmatchEff.C:188
 TOFmatchEff.C:189
 TOFmatchEff.C:190
 TOFmatchEff.C:191
 TOFmatchEff.C:192
 TOFmatchEff.C:193
 TOFmatchEff.C:194
 TOFmatchEff.C:195
 TOFmatchEff.C:196
 TOFmatchEff.C:197
 TOFmatchEff.C:198
 TOFmatchEff.C:199
 TOFmatchEff.C:200
 TOFmatchEff.C:201
 TOFmatchEff.C:202
 TOFmatchEff.C:203
 TOFmatchEff.C:204
 TOFmatchEff.C:205
 TOFmatchEff.C:206
 TOFmatchEff.C:207
 TOFmatchEff.C:208
 TOFmatchEff.C:209
 TOFmatchEff.C:210
 TOFmatchEff.C:211
 TOFmatchEff.C:212
 TOFmatchEff.C:213
 TOFmatchEff.C:214
 TOFmatchEff.C:215
 TOFmatchEff.C:216
 TOFmatchEff.C:217
 TOFmatchEff.C:218
 TOFmatchEff.C:219
 TOFmatchEff.C:220
 TOFmatchEff.C:221
 TOFmatchEff.C:222
 TOFmatchEff.C:223
 TOFmatchEff.C:224
 TOFmatchEff.C:225
 TOFmatchEff.C:226
 TOFmatchEff.C:227
 TOFmatchEff.C:228
 TOFmatchEff.C:229
 TOFmatchEff.C:230
 TOFmatchEff.C:231
 TOFmatchEff.C:232
 TOFmatchEff.C:233
 TOFmatchEff.C:234
 TOFmatchEff.C:235
 TOFmatchEff.C:236
 TOFmatchEff.C:237
 TOFmatchEff.C:238
 TOFmatchEff.C:239
 TOFmatchEff.C:240
 TOFmatchEff.C:241
 TOFmatchEff.C:242
 TOFmatchEff.C:243
 TOFmatchEff.C:244
 TOFmatchEff.C:245
 TOFmatchEff.C:246
 TOFmatchEff.C:247
 TOFmatchEff.C:248
 TOFmatchEff.C:249
 TOFmatchEff.C:250
 TOFmatchEff.C:251
 TOFmatchEff.C:252
 TOFmatchEff.C:253
 TOFmatchEff.C:254
 TOFmatchEff.C:255
 TOFmatchEff.C:256
 TOFmatchEff.C:257
 TOFmatchEff.C:258
 TOFmatchEff.C:259
 TOFmatchEff.C:260
 TOFmatchEff.C:261
 TOFmatchEff.C:262
 TOFmatchEff.C:263
 TOFmatchEff.C:264
 TOFmatchEff.C:265
 TOFmatchEff.C:266
 TOFmatchEff.C:267
 TOFmatchEff.C:268
 TOFmatchEff.C:269
 TOFmatchEff.C:270
 TOFmatchEff.C:271
 TOFmatchEff.C:272
 TOFmatchEff.C:273
 TOFmatchEff.C:274
 TOFmatchEff.C:275
 TOFmatchEff.C:276
 TOFmatchEff.C:277
 TOFmatchEff.C:278
 TOFmatchEff.C:279
 TOFmatchEff.C:280
 TOFmatchEff.C:281
 TOFmatchEff.C:282
 TOFmatchEff.C:283
 TOFmatchEff.C:284
 TOFmatchEff.C:285
 TOFmatchEff.C:286
 TOFmatchEff.C:287
 TOFmatchEff.C:288
 TOFmatchEff.C:289
 TOFmatchEff.C:290
 TOFmatchEff.C:291
 TOFmatchEff.C:292
 TOFmatchEff.C:293
 TOFmatchEff.C:294
 TOFmatchEff.C:295
 TOFmatchEff.C:296
 TOFmatchEff.C:297
 TOFmatchEff.C:298
 TOFmatchEff.C:299
 TOFmatchEff.C:300
 TOFmatchEff.C:301
 TOFmatchEff.C:302
 TOFmatchEff.C:303
 TOFmatchEff.C:304
 TOFmatchEff.C:305
 TOFmatchEff.C:306
 TOFmatchEff.C:307
 TOFmatchEff.C:308
 TOFmatchEff.C:309
 TOFmatchEff.C:310
 TOFmatchEff.C:311
 TOFmatchEff.C:312
 TOFmatchEff.C:313
 TOFmatchEff.C:314
 TOFmatchEff.C:315
 TOFmatchEff.C:316
 TOFmatchEff.C:317
 TOFmatchEff.C:318
 TOFmatchEff.C:319
 TOFmatchEff.C:320
 TOFmatchEff.C:321
 TOFmatchEff.C:322
 TOFmatchEff.C:323
 TOFmatchEff.C:324
 TOFmatchEff.C:325
 TOFmatchEff.C:326
 TOFmatchEff.C:327
 TOFmatchEff.C:328
 TOFmatchEff.C:329
 TOFmatchEff.C:330
 TOFmatchEff.C:331
 TOFmatchEff.C:332
 TOFmatchEff.C:333
 TOFmatchEff.C:334
 TOFmatchEff.C:335
 TOFmatchEff.C:336
 TOFmatchEff.C:337
 TOFmatchEff.C:338
 TOFmatchEff.C:339
 TOFmatchEff.C:340
 TOFmatchEff.C:341
 TOFmatchEff.C:342
 TOFmatchEff.C:343
 TOFmatchEff.C:344
 TOFmatchEff.C:345
 TOFmatchEff.C:346
 TOFmatchEff.C:347
 TOFmatchEff.C:348
 TOFmatchEff.C:349
 TOFmatchEff.C:350
 TOFmatchEff.C:351
 TOFmatchEff.C:352
 TOFmatchEff.C:353
 TOFmatchEff.C:354
 TOFmatchEff.C:355
 TOFmatchEff.C:356
 TOFmatchEff.C:357
 TOFmatchEff.C:358
 TOFmatchEff.C:359
 TOFmatchEff.C:360
 TOFmatchEff.C:361
 TOFmatchEff.C:362
 TOFmatchEff.C:363
 TOFmatchEff.C:364
 TOFmatchEff.C:365
 TOFmatchEff.C:366
 TOFmatchEff.C:367
 TOFmatchEff.C:368
 TOFmatchEff.C:369
 TOFmatchEff.C:370
 TOFmatchEff.C:371
 TOFmatchEff.C:372
 TOFmatchEff.C:373
 TOFmatchEff.C:374
 TOFmatchEff.C:375
 TOFmatchEff.C:376
 TOFmatchEff.C:377
 TOFmatchEff.C:378
 TOFmatchEff.C:379
 TOFmatchEff.C:380
 TOFmatchEff.C:381
 TOFmatchEff.C:382
 TOFmatchEff.C:383
 TOFmatchEff.C:384
 TOFmatchEff.C:385
 TOFmatchEff.C:386
 TOFmatchEff.C:387
 TOFmatchEff.C:388
 TOFmatchEff.C:389
 TOFmatchEff.C:390
 TOFmatchEff.C:391
 TOFmatchEff.C:392
 TOFmatchEff.C:393
 TOFmatchEff.C:394
 TOFmatchEff.C:395
 TOFmatchEff.C:396
 TOFmatchEff.C:397
 TOFmatchEff.C:398
 TOFmatchEff.C:399
 TOFmatchEff.C:400
 TOFmatchEff.C:401
 TOFmatchEff.C:402
 TOFmatchEff.C:403
 TOFmatchEff.C:404
 TOFmatchEff.C:405
 TOFmatchEff.C:406
 TOFmatchEff.C:407
 TOFmatchEff.C:408
 TOFmatchEff.C:409
 TOFmatchEff.C:410
 TOFmatchEff.C:411
 TOFmatchEff.C:412
 TOFmatchEff.C:413
 TOFmatchEff.C:414
 TOFmatchEff.C:415
 TOFmatchEff.C:416
 TOFmatchEff.C:417
 TOFmatchEff.C:418
 TOFmatchEff.C:419
 TOFmatchEff.C:420
 TOFmatchEff.C:421
 TOFmatchEff.C:422
 TOFmatchEff.C:423
 TOFmatchEff.C:424
 TOFmatchEff.C:425
 TOFmatchEff.C:426
 TOFmatchEff.C:427
 TOFmatchEff.C:428
 TOFmatchEff.C:429
 TOFmatchEff.C:430
 TOFmatchEff.C:431
 TOFmatchEff.C:432
 TOFmatchEff.C:433
 TOFmatchEff.C:434
 TOFmatchEff.C:435
 TOFmatchEff.C:436
 TOFmatchEff.C:437
 TOFmatchEff.C:438
 TOFmatchEff.C:439
 TOFmatchEff.C:440
 TOFmatchEff.C:441
 TOFmatchEff.C:442
 TOFmatchEff.C:443
 TOFmatchEff.C:444
 TOFmatchEff.C:445
 TOFmatchEff.C:446
 TOFmatchEff.C:447
 TOFmatchEff.C:448
 TOFmatchEff.C:449
 TOFmatchEff.C:450
 TOFmatchEff.C:451
 TOFmatchEff.C:452
 TOFmatchEff.C:453
 TOFmatchEff.C:454
 TOFmatchEff.C:455
 TOFmatchEff.C:456
 TOFmatchEff.C:457
 TOFmatchEff.C:458
 TOFmatchEff.C:459
 TOFmatchEff.C:460
 TOFmatchEff.C:461
 TOFmatchEff.C:462
 TOFmatchEff.C:463
 TOFmatchEff.C:464
 TOFmatchEff.C:465
 TOFmatchEff.C:466
 TOFmatchEff.C:467
 TOFmatchEff.C:468
 TOFmatchEff.C:469
 TOFmatchEff.C:470
 TOFmatchEff.C:471
 TOFmatchEff.C:472
 TOFmatchEff.C:473
 TOFmatchEff.C:474
 TOFmatchEff.C:475
 TOFmatchEff.C:476
 TOFmatchEff.C:477
 TOFmatchEff.C:478
 TOFmatchEff.C:479
 TOFmatchEff.C:480
 TOFmatchEff.C:481
 TOFmatchEff.C:482
 TOFmatchEff.C:483
 TOFmatchEff.C:484
 TOFmatchEff.C:485
 TOFmatchEff.C:486
 TOFmatchEff.C:487
 TOFmatchEff.C:488
 TOFmatchEff.C:489
 TOFmatchEff.C:490
 TOFmatchEff.C:491
 TOFmatchEff.C:492
 TOFmatchEff.C:493
 TOFmatchEff.C:494
 TOFmatchEff.C:495
 TOFmatchEff.C:496
 TOFmatchEff.C:497
 TOFmatchEff.C:498
 TOFmatchEff.C:499
 TOFmatchEff.C:500
 TOFmatchEff.C:501
 TOFmatchEff.C:502
 TOFmatchEff.C:503
 TOFmatchEff.C:504
 TOFmatchEff.C:505
 TOFmatchEff.C:506
 TOFmatchEff.C:507
 TOFmatchEff.C:508
 TOFmatchEff.C:509
 TOFmatchEff.C:510
 TOFmatchEff.C:511
 TOFmatchEff.C:512
 TOFmatchEff.C:513
 TOFmatchEff.C:514
 TOFmatchEff.C:515
 TOFmatchEff.C:516
 TOFmatchEff.C:517
 TOFmatchEff.C:518
 TOFmatchEff.C:519
 TOFmatchEff.C:520
 TOFmatchEff.C:521
 TOFmatchEff.C:522
 TOFmatchEff.C:523
 TOFmatchEff.C:524
 TOFmatchEff.C:525
 TOFmatchEff.C:526
 TOFmatchEff.C:527
 TOFmatchEff.C:528
 TOFmatchEff.C:529
 TOFmatchEff.C:530
 TOFmatchEff.C:531
 TOFmatchEff.C:532
 TOFmatchEff.C:533
 TOFmatchEff.C:534
 TOFmatchEff.C:535
 TOFmatchEff.C:536
 TOFmatchEff.C:537
 TOFmatchEff.C:538
 TOFmatchEff.C:539
 TOFmatchEff.C:540
 TOFmatchEff.C:541
 TOFmatchEff.C:542
 TOFmatchEff.C:543
 TOFmatchEff.C:544
 TOFmatchEff.C:545
 TOFmatchEff.C:546
 TOFmatchEff.C:547
 TOFmatchEff.C:548
 TOFmatchEff.C:549
 TOFmatchEff.C:550
 TOFmatchEff.C:551
 TOFmatchEff.C:552
 TOFmatchEff.C:553
 TOFmatchEff.C:554
 TOFmatchEff.C:555
 TOFmatchEff.C:556
 TOFmatchEff.C:557
 TOFmatchEff.C:558
 TOFmatchEff.C:559
 TOFmatchEff.C:560
 TOFmatchEff.C:561
 TOFmatchEff.C:562
 TOFmatchEff.C:563
 TOFmatchEff.C:564
 TOFmatchEff.C:565
 TOFmatchEff.C:566
 TOFmatchEff.C:567
 TOFmatchEff.C:568
 TOFmatchEff.C:569
 TOFmatchEff.C:570
 TOFmatchEff.C:571
 TOFmatchEff.C:572
 TOFmatchEff.C:573
 TOFmatchEff.C:574
 TOFmatchEff.C:575
 TOFmatchEff.C:576
 TOFmatchEff.C:577
 TOFmatchEff.C:578
 TOFmatchEff.C:579
 TOFmatchEff.C:580
 TOFmatchEff.C:581
 TOFmatchEff.C:582
 TOFmatchEff.C:583
 TOFmatchEff.C:584
 TOFmatchEff.C:585
 TOFmatchEff.C:586
 TOFmatchEff.C:587
 TOFmatchEff.C:588
 TOFmatchEff.C:589
 TOFmatchEff.C:590
 TOFmatchEff.C:591
 TOFmatchEff.C:592
 TOFmatchEff.C:593
 TOFmatchEff.C:594
 TOFmatchEff.C:595
 TOFmatchEff.C:596
 TOFmatchEff.C:597
 TOFmatchEff.C:598
 TOFmatchEff.C:599
 TOFmatchEff.C:600
 TOFmatchEff.C:601
 TOFmatchEff.C:602
 TOFmatchEff.C:603
 TOFmatchEff.C:604
 TOFmatchEff.C:605
 TOFmatchEff.C:606
 TOFmatchEff.C:607
 TOFmatchEff.C:608
 TOFmatchEff.C:609
 TOFmatchEff.C:610
 TOFmatchEff.C:611
 TOFmatchEff.C:612
 TOFmatchEff.C:613
 TOFmatchEff.C:614
 TOFmatchEff.C:615
 TOFmatchEff.C:616
 TOFmatchEff.C:617
 TOFmatchEff.C:618
 TOFmatchEff.C:619
 TOFmatchEff.C:620
 TOFmatchEff.C:621
 TOFmatchEff.C:622
 TOFmatchEff.C:623
 TOFmatchEff.C:624
 TOFmatchEff.C:625
 TOFmatchEff.C:626
 TOFmatchEff.C:627
 TOFmatchEff.C:628
 TOFmatchEff.C:629
 TOFmatchEff.C:630
 TOFmatchEff.C:631
 TOFmatchEff.C:632
 TOFmatchEff.C:633
 TOFmatchEff.C:634
 TOFmatchEff.C:635
 TOFmatchEff.C:636
 TOFmatchEff.C:637
 TOFmatchEff.C:638
 TOFmatchEff.C:639
 TOFmatchEff.C:640
 TOFmatchEff.C:641
 TOFmatchEff.C:642
 TOFmatchEff.C:643
 TOFmatchEff.C:644
 TOFmatchEff.C:645
 TOFmatchEff.C:646
 TOFmatchEff.C:647
 TOFmatchEff.C:648
 TOFmatchEff.C:649
 TOFmatchEff.C:650
 TOFmatchEff.C:651
 TOFmatchEff.C:652
 TOFmatchEff.C:653
 TOFmatchEff.C:654
 TOFmatchEff.C:655
 TOFmatchEff.C:656
 TOFmatchEff.C:657
 TOFmatchEff.C:658
 TOFmatchEff.C:659
 TOFmatchEff.C:660
 TOFmatchEff.C:661
 TOFmatchEff.C:662
 TOFmatchEff.C:663
 TOFmatchEff.C:664
 TOFmatchEff.C:665
 TOFmatchEff.C:666
 TOFmatchEff.C:667
 TOFmatchEff.C:668
 TOFmatchEff.C:669
 TOFmatchEff.C:670
 TOFmatchEff.C:671
 TOFmatchEff.C:672
 TOFmatchEff.C:673
 TOFmatchEff.C:674
 TOFmatchEff.C:675
 TOFmatchEff.C:676
 TOFmatchEff.C:677
 TOFmatchEff.C:678
 TOFmatchEff.C:679
 TOFmatchEff.C:680
 TOFmatchEff.C:681
 TOFmatchEff.C:682
 TOFmatchEff.C:683
 TOFmatchEff.C:684
 TOFmatchEff.C:685
 TOFmatchEff.C:686
 TOFmatchEff.C:687
 TOFmatchEff.C:688
 TOFmatchEff.C:689
 TOFmatchEff.C:690
 TOFmatchEff.C:691
 TOFmatchEff.C:692
 TOFmatchEff.C:693
 TOFmatchEff.C:694
 TOFmatchEff.C:695
 TOFmatchEff.C:696
 TOFmatchEff.C:697
 TOFmatchEff.C:698
 TOFmatchEff.C:699
 TOFmatchEff.C:700
 TOFmatchEff.C:701
 TOFmatchEff.C:702
 TOFmatchEff.C:703
 TOFmatchEff.C:704
 TOFmatchEff.C:705
 TOFmatchEff.C:706
 TOFmatchEff.C:707
 TOFmatchEff.C:708
 TOFmatchEff.C:709
 TOFmatchEff.C:710
 TOFmatchEff.C:711
 TOFmatchEff.C:712
 TOFmatchEff.C:713
 TOFmatchEff.C:714
 TOFmatchEff.C:715
 TOFmatchEff.C:716
 TOFmatchEff.C:717
 TOFmatchEff.C:718
 TOFmatchEff.C:719
 TOFmatchEff.C:720
 TOFmatchEff.C:721
 TOFmatchEff.C:722
 TOFmatchEff.C:723
 TOFmatchEff.C:724
 TOFmatchEff.C:725
 TOFmatchEff.C:726
 TOFmatchEff.C:727
 TOFmatchEff.C:728
 TOFmatchEff.C:729
 TOFmatchEff.C:730
 TOFmatchEff.C:731
 TOFmatchEff.C:732
 TOFmatchEff.C:733
 TOFmatchEff.C:734
 TOFmatchEff.C:735
 TOFmatchEff.C:736
 TOFmatchEff.C:737
 TOFmatchEff.C:738
 TOFmatchEff.C:739
 TOFmatchEff.C:740
 TOFmatchEff.C:741
 TOFmatchEff.C:742
 TOFmatchEff.C:743
 TOFmatchEff.C:744
 TOFmatchEff.C:745
 TOFmatchEff.C:746
 TOFmatchEff.C:747
 TOFmatchEff.C:748
 TOFmatchEff.C:749
 TOFmatchEff.C:750
 TOFmatchEff.C:751
 TOFmatchEff.C:752
 TOFmatchEff.C:753
 TOFmatchEff.C:754
 TOFmatchEff.C:755
 TOFmatchEff.C:756
 TOFmatchEff.C:757
 TOFmatchEff.C:758
 TOFmatchEff.C:759
 TOFmatchEff.C:760
 TOFmatchEff.C:761
 TOFmatchEff.C:762
 TOFmatchEff.C:763
 TOFmatchEff.C:764
 TOFmatchEff.C:765
 TOFmatchEff.C:766
 TOFmatchEff.C:767
 TOFmatchEff.C:768
 TOFmatchEff.C:769
 TOFmatchEff.C:770
 TOFmatchEff.C:771
 TOFmatchEff.C:772
 TOFmatchEff.C:773
 TOFmatchEff.C:774
 TOFmatchEff.C:775
 TOFmatchEff.C:776
 TOFmatchEff.C:777
 TOFmatchEff.C:778
 TOFmatchEff.C:779
 TOFmatchEff.C:780
 TOFmatchEff.C:781
 TOFmatchEff.C:782
 TOFmatchEff.C:783
 TOFmatchEff.C:784
 TOFmatchEff.C:785
 TOFmatchEff.C:786
 TOFmatchEff.C:787
 TOFmatchEff.C:788
 TOFmatchEff.C:789
 TOFmatchEff.C:790
 TOFmatchEff.C:791
 TOFmatchEff.C:792
 TOFmatchEff.C:793
 TOFmatchEff.C:794
 TOFmatchEff.C:795
 TOFmatchEff.C:796
 TOFmatchEff.C:797
 TOFmatchEff.C:798
 TOFmatchEff.C:799
 TOFmatchEff.C:800
 TOFmatchEff.C:801
 TOFmatchEff.C:802
 TOFmatchEff.C:803
 TOFmatchEff.C:804
 TOFmatchEff.C:805
 TOFmatchEff.C:806
 TOFmatchEff.C:807
 TOFmatchEff.C:808
 TOFmatchEff.C:809
 TOFmatchEff.C:810
 TOFmatchEff.C:811
 TOFmatchEff.C:812
 TOFmatchEff.C:813
 TOFmatchEff.C:814
 TOFmatchEff.C:815
 TOFmatchEff.C:816
 TOFmatchEff.C:817
 TOFmatchEff.C:818
 TOFmatchEff.C:819
 TOFmatchEff.C:820
 TOFmatchEff.C:821
 TOFmatchEff.C:822
 TOFmatchEff.C:823
 TOFmatchEff.C:824
 TOFmatchEff.C:825
 TOFmatchEff.C:826
 TOFmatchEff.C:827
 TOFmatchEff.C:828
 TOFmatchEff.C:829
 TOFmatchEff.C:830
 TOFmatchEff.C:831
 TOFmatchEff.C:832
 TOFmatchEff.C:833
 TOFmatchEff.C:834
 TOFmatchEff.C:835
 TOFmatchEff.C:836
 TOFmatchEff.C:837
 TOFmatchEff.C:838
 TOFmatchEff.C:839
 TOFmatchEff.C:840
 TOFmatchEff.C:841
 TOFmatchEff.C:842
 TOFmatchEff.C:843
 TOFmatchEff.C:844
 TOFmatchEff.C:845
 TOFmatchEff.C:846
 TOFmatchEff.C:847
 TOFmatchEff.C:848
 TOFmatchEff.C:849
 TOFmatchEff.C:850
 TOFmatchEff.C:851
 TOFmatchEff.C:852
 TOFmatchEff.C:853
 TOFmatchEff.C:854
 TOFmatchEff.C:855
 TOFmatchEff.C:856
 TOFmatchEff.C:857
 TOFmatchEff.C:858
 TOFmatchEff.C:859
 TOFmatchEff.C:860
 TOFmatchEff.C:861
 TOFmatchEff.C:862
 TOFmatchEff.C:863
 TOFmatchEff.C:864
 TOFmatchEff.C:865
 TOFmatchEff.C:866
 TOFmatchEff.C:867
 TOFmatchEff.C:868
 TOFmatchEff.C:869
 TOFmatchEff.C:870
 TOFmatchEff.C:871
 TOFmatchEff.C:872
 TOFmatchEff.C:873
 TOFmatchEff.C:874
 TOFmatchEff.C:875
 TOFmatchEff.C:876
 TOFmatchEff.C:877
 TOFmatchEff.C:878
 TOFmatchEff.C:879
 TOFmatchEff.C:880
 TOFmatchEff.C:881
 TOFmatchEff.C:882
 TOFmatchEff.C:883
 TOFmatchEff.C:884
 TOFmatchEff.C:885
 TOFmatchEff.C:886
 TOFmatchEff.C:887
 TOFmatchEff.C:888
 TOFmatchEff.C:889
 TOFmatchEff.C:890
 TOFmatchEff.C:891
 TOFmatchEff.C:892
 TOFmatchEff.C:893
 TOFmatchEff.C:894
 TOFmatchEff.C:895
 TOFmatchEff.C:896
 TOFmatchEff.C:897
 TOFmatchEff.C:898
 TOFmatchEff.C:899
 TOFmatchEff.C:900
 TOFmatchEff.C:901
 TOFmatchEff.C:902
 TOFmatchEff.C:903
 TOFmatchEff.C:904
 TOFmatchEff.C:905
 TOFmatchEff.C:906
 TOFmatchEff.C:907
 TOFmatchEff.C:908
 TOFmatchEff.C:909
 TOFmatchEff.C:910
 TOFmatchEff.C:911
 TOFmatchEff.C:912
 TOFmatchEff.C:913
 TOFmatchEff.C:914
 TOFmatchEff.C:915
 TOFmatchEff.C:916
 TOFmatchEff.C:917
 TOFmatchEff.C:918
 TOFmatchEff.C:919
 TOFmatchEff.C:920
 TOFmatchEff.C:921
 TOFmatchEff.C:922
 TOFmatchEff.C:923
 TOFmatchEff.C:924
 TOFmatchEff.C:925
 TOFmatchEff.C:926
 TOFmatchEff.C:927
 TOFmatchEff.C:928
 TOFmatchEff.C:929
 TOFmatchEff.C:930
 TOFmatchEff.C:931
 TOFmatchEff.C:932
 TOFmatchEff.C:933
 TOFmatchEff.C:934
 TOFmatchEff.C:935
 TOFmatchEff.C:936
 TOFmatchEff.C:937
 TOFmatchEff.C:938
 TOFmatchEff.C:939
 TOFmatchEff.C:940
 TOFmatchEff.C:941
 TOFmatchEff.C:942
 TOFmatchEff.C:943
 TOFmatchEff.C:944
 TOFmatchEff.C:945
 TOFmatchEff.C:946
 TOFmatchEff.C:947
 TOFmatchEff.C:948
 TOFmatchEff.C:949
 TOFmatchEff.C:950
 TOFmatchEff.C:951
 TOFmatchEff.C:952
 TOFmatchEff.C:953
 TOFmatchEff.C:954
 TOFmatchEff.C:955
 TOFmatchEff.C:956
 TOFmatchEff.C:957
 TOFmatchEff.C:958
 TOFmatchEff.C:959
 TOFmatchEff.C:960
 TOFmatchEff.C:961
 TOFmatchEff.C:962
 TOFmatchEff.C:963
 TOFmatchEff.C:964
 TOFmatchEff.C:965
 TOFmatchEff.C:966
 TOFmatchEff.C:967
 TOFmatchEff.C:968
 TOFmatchEff.C:969
 TOFmatchEff.C:970
 TOFmatchEff.C:971
 TOFmatchEff.C:972
 TOFmatchEff.C:973
 TOFmatchEff.C:974
 TOFmatchEff.C:975
 TOFmatchEff.C:976
 TOFmatchEff.C:977
 TOFmatchEff.C:978
 TOFmatchEff.C:979
 TOFmatchEff.C:980
 TOFmatchEff.C:981
 TOFmatchEff.C:982
 TOFmatchEff.C:983
 TOFmatchEff.C:984
 TOFmatchEff.C:985
 TOFmatchEff.C:986
 TOFmatchEff.C:987
 TOFmatchEff.C:988
 TOFmatchEff.C:989
 TOFmatchEff.C:990
 TOFmatchEff.C:991
 TOFmatchEff.C:992
 TOFmatchEff.C:993
 TOFmatchEff.C:994
 TOFmatchEff.C:995
 TOFmatchEff.C:996
 TOFmatchEff.C:997
 TOFmatchEff.C:998
 TOFmatchEff.C:999
 TOFmatchEff.C:1000
 TOFmatchEff.C:1001
 TOFmatchEff.C:1002
 TOFmatchEff.C:1003
 TOFmatchEff.C:1004
 TOFmatchEff.C:1005
 TOFmatchEff.C:1006
 TOFmatchEff.C:1007
 TOFmatchEff.C:1008
 TOFmatchEff.C:1009
 TOFmatchEff.C:1010
 TOFmatchEff.C:1011
 TOFmatchEff.C:1012
 TOFmatchEff.C:1013
 TOFmatchEff.C:1014
 TOFmatchEff.C:1015
 TOFmatchEff.C:1016
 TOFmatchEff.C:1017
 TOFmatchEff.C:1018
 TOFmatchEff.C:1019
 TOFmatchEff.C:1020
 TOFmatchEff.C:1021
 TOFmatchEff.C:1022
 TOFmatchEff.C:1023
 TOFmatchEff.C:1024
 TOFmatchEff.C:1025
 TOFmatchEff.C:1026
 TOFmatchEff.C:1027
 TOFmatchEff.C:1028
 TOFmatchEff.C:1029
 TOFmatchEff.C:1030
 TOFmatchEff.C:1031
 TOFmatchEff.C:1032
 TOFmatchEff.C:1033
 TOFmatchEff.C:1034
 TOFmatchEff.C:1035
 TOFmatchEff.C:1036
 TOFmatchEff.C:1037
 TOFmatchEff.C:1038
 TOFmatchEff.C:1039
 TOFmatchEff.C:1040
 TOFmatchEff.C:1041
 TOFmatchEff.C:1042
 TOFmatchEff.C:1043
 TOFmatchEff.C:1044
 TOFmatchEff.C:1045
 TOFmatchEff.C:1046
 TOFmatchEff.C:1047
 TOFmatchEff.C:1048
 TOFmatchEff.C:1049
 TOFmatchEff.C:1050
 TOFmatchEff.C:1051
 TOFmatchEff.C:1052
 TOFmatchEff.C:1053
 TOFmatchEff.C:1054
 TOFmatchEff.C:1055
 TOFmatchEff.C:1056
 TOFmatchEff.C:1057
 TOFmatchEff.C:1058
 TOFmatchEff.C:1059
 TOFmatchEff.C:1060
 TOFmatchEff.C:1061
 TOFmatchEff.C:1062
 TOFmatchEff.C:1063
 TOFmatchEff.C:1064
 TOFmatchEff.C:1065
 TOFmatchEff.C:1066
 TOFmatchEff.C:1067
 TOFmatchEff.C:1068
 TOFmatchEff.C:1069
 TOFmatchEff.C:1070
 TOFmatchEff.C:1071
 TOFmatchEff.C:1072
 TOFmatchEff.C:1073
 TOFmatchEff.C:1074
 TOFmatchEff.C:1075
 TOFmatchEff.C:1076
 TOFmatchEff.C:1077
 TOFmatchEff.C:1078
 TOFmatchEff.C:1079
 TOFmatchEff.C:1080
 TOFmatchEff.C:1081
 TOFmatchEff.C:1082
 TOFmatchEff.C:1083
 TOFmatchEff.C:1084
 TOFmatchEff.C:1085
 TOFmatchEff.C:1086
 TOFmatchEff.C:1087
 TOFmatchEff.C:1088
 TOFmatchEff.C:1089
 TOFmatchEff.C:1090
 TOFmatchEff.C:1091
 TOFmatchEff.C:1092
 TOFmatchEff.C:1093
 TOFmatchEff.C:1094
 TOFmatchEff.C:1095
 TOFmatchEff.C:1096
 TOFmatchEff.C:1097
 TOFmatchEff.C:1098
 TOFmatchEff.C:1099
 TOFmatchEff.C:1100
 TOFmatchEff.C:1101
 TOFmatchEff.C:1102
 TOFmatchEff.C:1103
 TOFmatchEff.C:1104
 TOFmatchEff.C:1105
 TOFmatchEff.C:1106
 TOFmatchEff.C:1107
 TOFmatchEff.C:1108
 TOFmatchEff.C:1109
 TOFmatchEff.C:1110
 TOFmatchEff.C:1111
 TOFmatchEff.C:1112
 TOFmatchEff.C:1113
 TOFmatchEff.C:1114
 TOFmatchEff.C:1115
 TOFmatchEff.C:1116
 TOFmatchEff.C:1117
 TOFmatchEff.C:1118
 TOFmatchEff.C:1119
 TOFmatchEff.C:1120
 TOFmatchEff.C:1121
 TOFmatchEff.C:1122
 TOFmatchEff.C:1123
 TOFmatchEff.C:1124
 TOFmatchEff.C:1125
 TOFmatchEff.C:1126
 TOFmatchEff.C:1127
 TOFmatchEff.C:1128
 TOFmatchEff.C:1129
 TOFmatchEff.C:1130
 TOFmatchEff.C:1131
 TOFmatchEff.C:1132
 TOFmatchEff.C:1133
 TOFmatchEff.C:1134
 TOFmatchEff.C:1135
 TOFmatchEff.C:1136
 TOFmatchEff.C:1137
 TOFmatchEff.C:1138
 TOFmatchEff.C:1139
 TOFmatchEff.C:1140
 TOFmatchEff.C:1141
 TOFmatchEff.C:1142
 TOFmatchEff.C:1143
 TOFmatchEff.C:1144
 TOFmatchEff.C:1145
 TOFmatchEff.C:1146
 TOFmatchEff.C:1147
 TOFmatchEff.C:1148
 TOFmatchEff.C:1149
 TOFmatchEff.C:1150
 TOFmatchEff.C:1151
 TOFmatchEff.C:1152
 TOFmatchEff.C:1153
 TOFmatchEff.C:1154
 TOFmatchEff.C:1155
 TOFmatchEff.C:1156
 TOFmatchEff.C:1157
 TOFmatchEff.C:1158
 TOFmatchEff.C:1159
 TOFmatchEff.C:1160
 TOFmatchEff.C:1161
 TOFmatchEff.C:1162
 TOFmatchEff.C:1163
 TOFmatchEff.C:1164
 TOFmatchEff.C:1165
 TOFmatchEff.C:1166
 TOFmatchEff.C:1167
 TOFmatchEff.C:1168
 TOFmatchEff.C:1169
 TOFmatchEff.C:1170
 TOFmatchEff.C:1171
 TOFmatchEff.C:1172
 TOFmatchEff.C:1173
 TOFmatchEff.C:1174
 TOFmatchEff.C:1175
 TOFmatchEff.C:1176
 TOFmatchEff.C:1177
 TOFmatchEff.C:1178
 TOFmatchEff.C:1179
 TOFmatchEff.C:1180
 TOFmatchEff.C:1181
 TOFmatchEff.C:1182
 TOFmatchEff.C:1183
 TOFmatchEff.C:1184
 TOFmatchEff.C:1185
 TOFmatchEff.C:1186
 TOFmatchEff.C:1187
 TOFmatchEff.C:1188
 TOFmatchEff.C:1189
 TOFmatchEff.C:1190
 TOFmatchEff.C:1191
 TOFmatchEff.C:1192
 TOFmatchEff.C:1193
 TOFmatchEff.C:1194
 TOFmatchEff.C:1195
 TOFmatchEff.C:1196
 TOFmatchEff.C:1197
 TOFmatchEff.C:1198
 TOFmatchEff.C:1199
 TOFmatchEff.C:1200
 TOFmatchEff.C:1201
 TOFmatchEff.C:1202
 TOFmatchEff.C:1203
 TOFmatchEff.C:1204
 TOFmatchEff.C:1205
 TOFmatchEff.C:1206
 TOFmatchEff.C:1207
 TOFmatchEff.C:1208
 TOFmatchEff.C:1209
 TOFmatchEff.C:1210
 TOFmatchEff.C:1211
 TOFmatchEff.C:1212
 TOFmatchEff.C:1213
 TOFmatchEff.C:1214
 TOFmatchEff.C:1215
 TOFmatchEff.C:1216
 TOFmatchEff.C:1217
 TOFmatchEff.C:1218
 TOFmatchEff.C:1219
 TOFmatchEff.C:1220
 TOFmatchEff.C:1221
 TOFmatchEff.C:1222
 TOFmatchEff.C:1223
 TOFmatchEff.C:1224
 TOFmatchEff.C:1225
 TOFmatchEff.C:1226
 TOFmatchEff.C:1227
 TOFmatchEff.C:1228
 TOFmatchEff.C:1229
 TOFmatchEff.C:1230
 TOFmatchEff.C:1231
 TOFmatchEff.C:1232
 TOFmatchEff.C:1233
 TOFmatchEff.C:1234
 TOFmatchEff.C:1235
 TOFmatchEff.C:1236
 TOFmatchEff.C:1237
 TOFmatchEff.C:1238
 TOFmatchEff.C:1239
 TOFmatchEff.C:1240
 TOFmatchEff.C:1241
 TOFmatchEff.C:1242
 TOFmatchEff.C:1243
 TOFmatchEff.C:1244
 TOFmatchEff.C:1245
 TOFmatchEff.C:1246
 TOFmatchEff.C:1247
 TOFmatchEff.C:1248
 TOFmatchEff.C:1249
 TOFmatchEff.C:1250
 TOFmatchEff.C:1251
 TOFmatchEff.C:1252
 TOFmatchEff.C:1253
 TOFmatchEff.C:1254
 TOFmatchEff.C:1255
 TOFmatchEff.C:1256
 TOFmatchEff.C:1257
 TOFmatchEff.C:1258
 TOFmatchEff.C:1259
 TOFmatchEff.C:1260
 TOFmatchEff.C:1261
 TOFmatchEff.C:1262
 TOFmatchEff.C:1263
 TOFmatchEff.C:1264
 TOFmatchEff.C:1265
 TOFmatchEff.C:1266
 TOFmatchEff.C:1267
 TOFmatchEff.C:1268
 TOFmatchEff.C:1269
 TOFmatchEff.C:1270
 TOFmatchEff.C:1271
 TOFmatchEff.C:1272
 TOFmatchEff.C:1273
 TOFmatchEff.C:1274
 TOFmatchEff.C:1275
 TOFmatchEff.C:1276
 TOFmatchEff.C:1277
 TOFmatchEff.C:1278
 TOFmatchEff.C:1279
 TOFmatchEff.C:1280
 TOFmatchEff.C:1281
 TOFmatchEff.C:1282
 TOFmatchEff.C:1283
 TOFmatchEff.C:1284
 TOFmatchEff.C:1285
 TOFmatchEff.C:1286
 TOFmatchEff.C:1287
 TOFmatchEff.C:1288
 TOFmatchEff.C:1289
 TOFmatchEff.C:1290
 TOFmatchEff.C:1291
 TOFmatchEff.C:1292
 TOFmatchEff.C:1293
 TOFmatchEff.C:1294
 TOFmatchEff.C:1295
 TOFmatchEff.C:1296
 TOFmatchEff.C:1297
 TOFmatchEff.C:1298
 TOFmatchEff.C:1299
 TOFmatchEff.C:1300
 TOFmatchEff.C:1301
 TOFmatchEff.C:1302
 TOFmatchEff.C:1303
 TOFmatchEff.C:1304
 TOFmatchEff.C:1305
 TOFmatchEff.C:1306
 TOFmatchEff.C:1307
 TOFmatchEff.C:1308
 TOFmatchEff.C:1309
 TOFmatchEff.C:1310
 TOFmatchEff.C:1311
 TOFmatchEff.C:1312
 TOFmatchEff.C:1313
 TOFmatchEff.C:1314
 TOFmatchEff.C:1315
 TOFmatchEff.C:1316
 TOFmatchEff.C:1317
 TOFmatchEff.C:1318
 TOFmatchEff.C:1319
 TOFmatchEff.C:1320
 TOFmatchEff.C:1321
 TOFmatchEff.C:1322
 TOFmatchEff.C:1323
 TOFmatchEff.C:1324
 TOFmatchEff.C:1325
 TOFmatchEff.C:1326
 TOFmatchEff.C:1327
 TOFmatchEff.C:1328
 TOFmatchEff.C:1329
 TOFmatchEff.C:1330
 TOFmatchEff.C:1331
 TOFmatchEff.C:1332
 TOFmatchEff.C:1333
 TOFmatchEff.C:1334
 TOFmatchEff.C:1335
 TOFmatchEff.C:1336
 TOFmatchEff.C:1337
 TOFmatchEff.C:1338
 TOFmatchEff.C:1339
 TOFmatchEff.C:1340
 TOFmatchEff.C:1341
 TOFmatchEff.C:1342
 TOFmatchEff.C:1343
 TOFmatchEff.C:1344
 TOFmatchEff.C:1345
 TOFmatchEff.C:1346
 TOFmatchEff.C:1347
 TOFmatchEff.C:1348
 TOFmatchEff.C:1349
 TOFmatchEff.C:1350
 TOFmatchEff.C:1351
 TOFmatchEff.C:1352
 TOFmatchEff.C:1353
 TOFmatchEff.C:1354
 TOFmatchEff.C:1355
 TOFmatchEff.C:1356
 TOFmatchEff.C:1357
 TOFmatchEff.C:1358
 TOFmatchEff.C:1359
 TOFmatchEff.C:1360
 TOFmatchEff.C:1361
 TOFmatchEff.C:1362
 TOFmatchEff.C:1363
 TOFmatchEff.C:1364
 TOFmatchEff.C:1365
 TOFmatchEff.C:1366
 TOFmatchEff.C:1367
 TOFmatchEff.C:1368
 TOFmatchEff.C:1369
 TOFmatchEff.C:1370
 TOFmatchEff.C:1371
 TOFmatchEff.C:1372
 TOFmatchEff.C:1373
 TOFmatchEff.C:1374
 TOFmatchEff.C:1375
 TOFmatchEff.C:1376
 TOFmatchEff.C:1377
 TOFmatchEff.C:1378
 TOFmatchEff.C:1379
 TOFmatchEff.C:1380
 TOFmatchEff.C:1381
 TOFmatchEff.C:1382
 TOFmatchEff.C:1383
 TOFmatchEff.C:1384
 TOFmatchEff.C:1385
 TOFmatchEff.C:1386
 TOFmatchEff.C:1387
 TOFmatchEff.C:1388
 TOFmatchEff.C:1389
 TOFmatchEff.C:1390
 TOFmatchEff.C:1391
 TOFmatchEff.C:1392
 TOFmatchEff.C:1393
 TOFmatchEff.C:1394
 TOFmatchEff.C:1395
 TOFmatchEff.C:1396
 TOFmatchEff.C:1397
 TOFmatchEff.C:1398
 TOFmatchEff.C:1399
 TOFmatchEff.C:1400
 TOFmatchEff.C:1401
 TOFmatchEff.C:1402
 TOFmatchEff.C:1403
 TOFmatchEff.C:1404
 TOFmatchEff.C:1405
 TOFmatchEff.C:1406
 TOFmatchEff.C:1407
 TOFmatchEff.C:1408
 TOFmatchEff.C:1409
 TOFmatchEff.C:1410
 TOFmatchEff.C:1411
 TOFmatchEff.C:1412
 TOFmatchEff.C:1413
 TOFmatchEff.C:1414
 TOFmatchEff.C:1415
 TOFmatchEff.C:1416
 TOFmatchEff.C:1417
 TOFmatchEff.C:1418