ROOT logo
//
// Common macros used to analyze dst trees
// Author: Ionut-Cristian Arsene, 2012/03/04
// email: i.c.arsene@gsi.de
//
#include <iostream>
#include <fstream>
using namespace std;

#include <TObjArray.h>
#include <TChain.h>
#include <TMath.h>
#include <TFile.h>
#include <TDirectory.h>
#include <THashList.h>
#include <TH1F.h>
#include <TH2F.h>
#include <TH3F.h>
#include <TProfile.h>
#include <TProfile2D.h>
#include <TIterator.h>
#include <TKey.h>
#include <TDirectory.h>
#include <TAxis.h>

#ifndef ALICORRELATIONREDUCEDEVENT_H
#include "AliCorrelationReducedEvent.h"
#endif

namespace DstCommonMacros {

  enum ParticleId {
    kUnknown = -1,
    kElectron = 0,
    kPion,
    kKaon,
    kProton
  };

  enum Variables {
    kNothing = -1,
    // Event wise variables
    kRunNo = 0,         // run number
    kBC,                // bunch crossing
    kTriggerMask,       // trigger mask
    kOfflineTrigger,    // offline trigger
    kOfflineTriggerFired,  // offline trigger fired
    kOfflineTriggerFired2,  // offline trigger if fired, -1 if not fired
    kIsPhysicsSelection,    // physics selection
    kVtxX,              // vtx X
    kVtxY,              // vtx Y
    kVtxZ,              // vtx Z
    kVtxXtpc,           // vtx X from tpc
    kVtxYtpc,           // vtx Y from tpc
    kVtxZtpc,           // vtx Z from tpc
    kCentVZERO,         // centrality from VZERO
    kCentSPD,           // centrality from SPD
    kCentTPC,           // centrality from TPC
    kCentZDC,           // centrality from ZDC
    kCentQuality,       // centrality quality
    kNV0total,          // total number of V0s in the esd
    kNV0selected,       // number of V0s selected
    kNdielectrons,      // number of dielectron pairs
    kNpairsSelected,    // number of selected dielectron pairs per event
    kNtracksTotal,      // total number of tracks
    kNtracksSelected,   // number of selected tracks
    kSPDntracklets,     // SPD number of tracklets in |eta|<1.0
    kEventMixingId,     // Id of the event mixing category
    // VZERO event plane related variables
    kVZEROAemptyChannels,  // Number of empty VZERO channels in A side
    kVZEROCemptyChannels,  // Number of empty VZERO channels in C side
    kVZEROChannelMult,                        // VZERO multiplicity per channel
    kVZEROChannelEta = kVZEROChannelMult+64,  // pseudo-rapidity of a VZERO channel
    kVZEROQvecX      = kVZEROChannelEta+64,   // Q-vector components for harmonics 1-6 and 
    kVZEROQvecY      = kVZEROQvecX+6*3,        //  6- n-harmonics; 3- A,C and A&C options
    kVZERORP         = kVZEROQvecY+6*3,           // VZERO reaction plane from A,C and A&C sides (harmonics 1-6)
    kVZERORPres      = kVZERORP+6*3,     // VZERO reaction plane resolution (sqrt(n*(RPa-RPc)))
    kVZEROXaXc       = kVZERORPres+6,           // correlations for the components of the Q vector
    kVZEROXaYa       = kVZEROXaXc+6,
    kVZEROXaYc       = kVZEROXaYa+6,
    kVZEROYaXc       = kVZEROXaYc+6,
    kVZEROYaYc       = kVZEROYaXc+6,
    kVZEROXcYc       = kVZEROYaYc+6,
    kVZEROdeltaRPac  = kVZEROXcYc+6,         // Psi_VZEROA-Psi_VZEROC
    kVZEROdeltaRPa   = kVZEROdeltaRPac+6,      // Psi_VZEROA6-Psi_VZEROA5, Psi_VZEROA7-Psi_VZEROA5, Psi_VZEROA6-Psi_VZEROA5 
    kVZEROdeltaRPc   = kVZEROdeltaRPa+6*2,     // Psi_VZEROA2-Psi_VZEROA1, Psi_VZEROA3-Psi_VZEROA1, Psi_VZEROA4-Psi_VZEROA1
    kVZEROflowV2TPC  = kVZEROdeltaRPc+6*2,     // vzero v2 using TPC event plane
    // TPC event plane variables
    kTPCQvecX = kVZEROflowV2TPC+64,   // TPC Q-vector components for harmonics 1-6
    kTPCQvecY = kTPCQvecX+6,
    kTPCRP    = kTPCQvecY+6,                // Event plane using TPC
    kTPCRPres = kTPCRP+6,                // Event plane resolution variables sqrt(n*(RPtpc-RPvzeroa)),sqrt(n*(RPtpc-RPvzeroc))
    // Correlations between TPC and VZERO event planes
    kRPXtpcXvzeroa    = kTPCRPres+6*2,        
    kRPXtpcXvzeroc    = kRPXtpcXvzeroa+6,
    kRPYtpcYvzeroa    = kRPXtpcXvzeroc+6,
    kRPYtpcYvzeroc    = kRPYtpcYvzeroa+6,
    kRPXtpcYvzeroa    = kRPYtpcYvzeroc+6,
    kRPXtpcYvzeroc    = kRPXtpcYvzeroa+6,
    kRPYtpcXvzeroa    = kRPXtpcYvzeroc+6,
    kRPYtpcXvzeroc    = kRPYtpcXvzeroa+6,
    kRPdeltaVZEROAtpc = kRPYtpcXvzeroc+6,
    kRPdeltaVZEROCtpc = kRPdeltaVZEROAtpc+6,
    kNEventVars       = kRPdeltaVZEROCtpc+6,           // number of event variables
    // Pair variables --------------------------------------
    kMass=kNEventVars,
    kCandidateId,
    kPairType,                          // 0 ++; 1 +-; 2 --
    kPairPt,
    kPairPx,
    kPairPy,
    kPairPz,
    kPairP,
    kPairRap,
    kPairEta,
    kPairTheta,
    kPairPhi,
    kPairLxy,
    kPairOpeningAngle,
    kPairCosNPhi,                                                // cos (n*phi)
    kPairSinNPhi             = kPairCosNPhi+6,                   // sin (n*phi)
    kPairDeltaPhiVZEROFlowVn = kPairSinNPhi+6,                   // phi - Psi_{VZERO}
    kPairDeltaPhiTPCFlowVn   = kPairDeltaPhiVZEROFlowVn+6*3,     // phi - Psi_{TPC}
    kPairVZEROFlowVn         = kPairDeltaPhiTPCFlowVn+6,         // vn{Psi_{n,VZERO}}
    kPairTPCFlowVn           = kPairVZEROFlowVn+6*3,             // vn{Psi_{n,TPC}}
    kPairVZEROFlowV3Psi2     = kPairTPCFlowVn+6,                 // v3{Psi_{2,VZERO}}
    kPairTPCFlowV3Psi2       = kPairVZEROFlowV3Psi2+3,           // v3{Psi_{2,TPC}}
    // Track variables -------------------------------------
    kPt=kPairTPCFlowV3Psi2+1,
    kP,
    kTheta,
    kPhi,
    kEta,
    kRap,
    kPtTPC,
    kPhiTPC,
    kEtaTPC,
    kPin,
    kTrackDeltaPhiVZEROFlowVn,
    kTrackVZEROFlowVn = kTrackDeltaPhiVZEROFlowVn+6*2,
    kDcaXY            = kTrackVZEROFlowVn+6*2,
    kDcaZ,
    kITSncls,
    kITSsignal,
    kTPCncls,
    kTPCcrossedRows,
    kTPCnclsIter1,
    kTPCnclsF,
    kTPCnclsRatio,
    kTPCsignal,
    kTPCnSig,
    kTOFbeta=kTPCnSig+4,
    kTOFnSig,
    kTRDntracklets=kTOFnSig+4,
    kTRDntrackletsPID,
    kTRDpidProbabilities,
    kEMCALmatchedEnergy=kTRDpidProbabilities+2,
    kEMCALmatchedEOverP,
    // Calorimeter cluster variables --------------------------------------
    kEMCALclusterEnergy,
    kEMCALclusterDx,
    kEMCALclusterDz,
    kEMCALdetector,         // 0 - EMCAL; 1 - PHOS
    // Tracking flags -----------------------------------------------------
    kTrackingFlag,
    // Correlation variables ----------------------------------------------
    kDeltaPhi,
    kDeltaTheta,
    kDeltaEta,
    kNVars
  };


  Bool_t gUsedVars[kNVars] = {kFALSE};

  // tracking flags as in AliESDtrack.h
  // NOTE: check consistency with aliroot
  enum TrackingFlags {
    kITSin=0, 
    kITSout,
    kITSrefit,
    kITSpid,
    kTPCin,
    kTPCout,
    kTPCrefit,
    kTPCpid,
    kTRDin,
    kTRDout, 
    kTRDrefit,
    kTRDpid,
    kTOFin,
    kTOFout,
    kTOFrefit,
    kTOFpid,
    kTOFmismatch,
    kHMPIDout,
    kHMPIDpid,
    kEMCALmatch,
    kPHOSmatch,
    kTRDbackup,
    kTRDStop,
    kESDpid,
    kTIME,
    kGlobalMerge,
    kITSpureSA,
    kMultInV0,
    kMultSec,
    kTRDnPlanes,
    kEMCALNoMatch,
    kNTrackingFlags
  };

  const Char_t* gkTrackingFlagNames[kNTrackingFlags] = {
    "kITSin", "kITSout", "kITSrefit", "kITSpid",
    "kTPCin", "kTPCout", "kTPCrefit", "kTPCpid",
    "kTRDin", "kTRDout", "kTRDrefit", "kTRDpid",
    "kTOFin", "kTOFout", "kTOFrefit", "kTOFpid", "kTOFmismatch",
    "kHMPIDout", "kHMPIDpid", 
    "kEMCALmatch", "kPHOSmatch", 
    "kTRDbackup", "kTRDStop",
    "kESDpid", "kTIME", "kGlobalMerge",
    "kITSpureSA", 
    "kMultInV0",
    "kMultSec",
    "kTRDnPlanes",
    "kEMCALNoMatch"
  };

  // offline triggers as defined in AliVEvent.h
  // NOTE: Check consistency with updates in aliroot!!!
  enum EOfflineTriggerTypes { 
    kMB           = BIT(0), // Minimum bias trigger, i.e. interaction trigger, offline SPD or V0 selection
    kINT7         = BIT(1), // V0AND trigger, offline V0 selection
    kMUON         = BIT(2), // Muon trigger, offline SPD or V0 selection
    kHighMult     = BIT(3), // High-multiplicity trigger (threshold defined online), offline SPD or V0 selection
    kEMC1         = BIT(4), // EMCAL trigger
    kCINT5        = BIT(5), // Minimum bias trigger without SPD. i.e. interaction trigger, offline V0 selection
    kCMUS5        = BIT(6), // Muon trigger, offline V0 selection
    kMUSPB        = BIT(6), // idem for PbPb
    kMUSH7        = BIT(7), // Muon trigger: high pt, single muon, offline V0 selection, CINT7 suite
    kMUSHPB       = BIT(7), // idem for PbPb
    kMUL7         = BIT(8), // Muon trigger: like sign dimuon, offline V0 selection, CINT7 suite
    kMuonLikePB   = BIT(8), // idem for PbPb
    kMUU7         = BIT(9), // Muon trigger, unlike sign dimuon, offline V0 selection, CINT7 suite
    kMuonUnlikePB = BIT(9), // idem for PbPb
    kEMC7         = BIT(10), // EMCAL trigger, CINT7 suite
    kMUS7         = BIT(11), // Muon trigger: low pt, single muon, offline V0 selection, CINT7 suite
    kPHI1         = BIT(12), // PHOS trigger, CINT1 suite
    kPHI7         = BIT(13), // PHOS trigger, CINT7 suite
    kPHOSPb       = BIT(13), // idem for PbPb
    kEMCEJE       = BIT(14), // EMCAL jet patch trigger
    kEMCEGA       = BIT(15), // EMCAL gamma trigger
    kCentral      = BIT(16), // PbPb central collision trigger
    kSemiCentral  = BIT(17), // PbPb semicentral collision trigger
    kDG5          = BIT(18), // Double gap diffractive
    kZED          = BIT(19), // ZDC electromagnetic dissociation
    kUserDefined  = BIT(27), // Set when custom trigger classes are set in AliPhysicsSelection, offline SPD or V0 selection
    // Bits 28 and above are reserved for FLAGS
    kFastOnly     = BIT(30), // The fast cluster fired. This bit is set in to addition another trigger bit, e.g. kMB
    kAny          = 0xffffffff, // to accept any trigger
    kAnyINT       = kMB | kINT7 | kCINT5 // to accept any interaction (aka minimum bias) trigger
  };

  const Char_t* gkOfflineTriggerNames[64] = {
    "MB",              "INT7",              "MUON", "HighMult",    "EMC1", "CINT5",       "CMUS5/MUSPB", "MUSH7/MUSHPB",
    "MUL7/MuonLikePB", "MUU7/MuonUnlikePB", "EMC7", "MUS7",        "PHI1", "PHI7/PHOSPb", "EMCEJE",      "EMCEGA",
    "Central",         "SemiCentral",       "DG5",  "ZED",         "N/A",  "N/A",         "N/A",         "N/A",  
    "N/A",             "N/A",               "N/A",  "UserDefined", "N/A",  "N/A",         "FastOnly",    "N/A",
    "N/A",             "N/A",               "N/A",  "N/A",         "N/A",  "N/A",         "N/A",         "N/A",
    "N/A",             "N/A",               "N/A",  "N/A",         "N/A",  "N/A",         "N/A",         "N/A",
    "N/A",             "N/A",               "N/A",  "N/A",         "N/A",  "N/A",         "N/A",         "N/A",
    "N/A",             "N/A",               "N/A",  "N/A",         "N/A",  "N/A",         "N/A",         "N/A"
  };

  enum ITSLayerMap {
    kITSfirst  =  1,
    kITSsecond =  2,
    kITSthird  =  4,
    kITSfourth =  8,
    kITSfifth  = 16,
    kITSsixth  = 32
  };

  // radii of VZERO channels centers (in cm)
  const Double_t gkVZEROChannelRadii[64] = {6.0567, 6.0567, 6.0567, 6.0567, 6.0567, 6.0567, 6.0567, 6.0567,
					    9.6977, 9.6977, 9.6977, 9.6977, 9.6977, 9.6977, 9.6977, 9.6977,
					   15.9504, 15.9504, 15.9504, 15.9504, 15.9504, 15.9504, 15.9504, 15.9504,
					   26.4031, 26.4031, 26.4031, 26.4031, 26.4031, 26.4031, 26.4031, 26.4031,
					    5.9347, 5.9347, 5.9347, 5.9347, 5.9347, 5.9347, 5.9347, 5.9347,
					   10.685, 10.685, 10.685, 10.685, 10.685, 10.685, 10.685, 10.685,
					   18.116, 18.116, 18.116, 18.116, 18.116, 18.116, 18.116, 18.116,
					   31.84, 31.84, 31.84, 31.84, 31.84, 31.84, 31.84, 31.84};
  const Double_t gkVZEROAz = 340.0;   // cm
  const Double_t gkVZEROCz = 90.0;    // cm
  const Double_t gkVZEROminMult = 0.5;   // minimum VZERO channel multiplicity

  // Pointer to the current event
  AliCorrelationReducedEvent*       gCurrentEvent       = 0x0;
  AliCorrelationReducedEventFriend* gCurrentEventFriend = 0x0;

  // Event mixing variables
  Int_t gEMCategories=0;
  TString* gEMCategoryNames;

  TObjArray* gHistLists=0x0;   // main histogram list for the current running process
  TDirectoryFile* gHistListsOld=0x0;  // main directory for a standard tree analysis output (used for calibration, plotting etc.)
  TFile* gHistFile = 0x0;      // pointer to a TFile opened for reading

  TProfile2D* gVzeroAvMult[64] = {0x0};   // pointer to the array of average VZERO multiplicity per channel
  TProfile2D* gQvecCentering[AliCorrelationReducedEventFriend::kNdetectors][fgkNMaxHarmonics][2] = {{{0x0}}};  // pointer to the array of Qvec centering histograms

  // pt range for J/psi's
  const Float_t gkJpsiPtCut[2] = {0.0, 20.0};

  // Function prototypes
  void WriteOutput(TFile* saveFile);
  //void DefineHistograms(const Char_t* histClasses);
  TChain* GetChain(const Char_t* filename, Int_t howMany, Int_t offset, Long64_t& entries, TChain* friendChain=0x0, const Char_t* friendChainFile=0x0);
  void FillEventInfo(AliCorrelationReducedEvent* event, Float_t* values, AliCorrelationReducedEventFriend* eventF=0x0);
  void FillEventOfflineTriggers(UShort_t triggerBit, Float_t* values);
  void FillTrackingFlag(AliCorrelationReducedTrack* track, UShort_t flag, Float_t* values);
  void FillTrackInfo(AliCorrelationReducedTrack* p, Float_t* values);
  void FillPairInfo(AliCorrelationReducedPair* p, Float_t* values);
  void FillPairInfo(AliCorrelationReducedTrack* t1, AliCorrelationReducedTrack* t2, Int_t type, Float_t* values);
  void FillCorrelationInfo(AliCorrelationReducedPair* p, AliCorrelationReducedTrack* t, Float_t* values);
  void FillCaloClusterInfo(AliCorrelationReducedCaloCluster* cl, Float_t* values);
  void FillHistClass(const Char_t* className, Float_t* values);
  void DoEventMixing(TList* list1, TList* list2, Float_t* values, Int_t mixingType, const Char_t* histClass);
  void EventMixingPairTracks(TList* pairs, TList* tracks, Float_t* values);
  void EventMixingResonanceLegs(TList* posLegs, TList* negLegs, Float_t* values, Int_t type, const Char_t* histClass);
  Double_t DeltaPhi(Double_t phi1, Double_t phi2);  // calculate delta phi in the (-pi,+pi) interval
  Bool_t IsPairSelectedEM(Float_t* values);        // pair selection used in the mixed event
  void AddHistClass(const Char_t* histClass);
  Int_t ValidateHistogramName(THashList* hList, const Char_t* name);
  void AddHistogram(const Char_t* histClass,
		    const Char_t* name, const Char_t* title, Bool_t isProfile,
                    Int_t nXbins, Double_t xmin, Double_t xmax, Int_t varX,
		    Int_t nYbins=0, Double_t ymin=0, Double_t ymax=0, Int_t varY=kNothing,
		    Int_t nZbins=0, Double_t zmin=0, Double_t zmax=0, Int_t varZ=kNothing,
		    const Char_t* xLabels="", const Char_t* yLabels="", const Char_t* zLabels="");
  void AddHistogram(const Char_t* histClass,
		    const Char_t* name, const Char_t* title, Bool_t isProfile,
                    Int_t nXbins, Double_t* xbins, Int_t varX,
		    Int_t nYbins=0, Double_t* ybins=0x0, Int_t varY=kNothing,
		    Int_t nZbins=0, Double_t* zbins=0x0, Int_t varZ=kNothing,
  		    const Char_t* xLabels="", const Char_t* yLabels="", const Char_t* zLabels="");
  void MakeAxisLabels(TAxis* ax, const Char_t* labels);
  void InitFile(const Char_t* filename);    // open an old output filename
  void CloseFile();
  TObject* GetHistogram(const Char_t* listname, const Char_t* hname);  // get a histogram from an old output

}  // end declarations for namespace DstCommonMacros

//__________________________________________________________________
void DstCommonMacros::FillEventInfo(AliCorrelationReducedEvent* event, Float_t* values, AliCorrelationReducedEventFriend* eventF/*=0x0*/) {
  //
  // fill event wise info
  //
  values[kRunNo]       = event->RunNo();
  values[kBC]          = event->BC();
  values[kTriggerMask] = event->TriggerMask();
  values[kIsPhysicsSelection] = (event->IsPhysicsSelection() ? 1.0 : 0.0);
  values[kVtxX]        = event->Vertex(0);
  values[kVtxY]        = event->Vertex(1);
  values[kVtxZ]        = event->Vertex(2);
  values[kVtxXtpc]     = event->VertexTPC(0);
  values[kVtxYtpc]     = event->VertexTPC(1);
  values[kVtxZtpc]     = event->VertexTPC(2);
  values[kCentVZERO]   = event->CentralityVZERO();
  values[kCentSPD]     = event->CentralitySPD();
  values[kCentTPC]     = event->CentralityTPC();
  values[kCentZDC]     = event->CentralityZEMvsZDC();
  values[kCentQuality] = event->CentralityQuality();
  values[kNV0total]        = event->NV0CandidatesTotal();
  values[kNV0selected]     = event->NV0Candidates();
  values[kNdielectrons]    = event->NDielectrons();
  values[kNtracksTotal]    = event->NTracksTotal();
  values[kNtracksSelected] = event->NTracks();
  values[kSPDntracklets]   = event->SPDntracklets();
  values[kVZEROAemptyChannels] = 0;
  values[kVZEROCemptyChannels] = 0;
  for(Int_t ich=0;ich<64;++ich) gUsedVars[kVZEROChannelMult+ich] = kTRUE; 
  Float_t theta=0.0;
  for(Int_t ich=0;ich<64;++ich) {
    if(gUsedVars[kVZEROChannelMult+ich]) {
      values[kVZEROChannelMult+ich] = event->MultChannelVZERO(ich);
      if(!gVzeroAvMult[0] && values[kVZEROChannelMult+ich]<gkVZEROminMult) {
        gUsedVars[kVZEROChannelMult+ich] = kFALSE;   // will not be filled in histograms by the histogram manager
        if(ich<32) values[kVZEROCemptyChannels] += 1;
        else values[kVZEROAemptyChannels] += 1;
      }
    }
    if(gUsedVars[kVZEROChannelEta+ich]) {
      if(ich<32) theta = TMath::ATan(gkVZEROChannelRadii[ich]/(gkVZEROCz-values[kVtxZ]));
      else theta = TMath::Pi()-TMath::ATan(gkVZEROChannelRadii[ich]/(gkVZEROAz-values[kVtxZ]));
      values[kVZEROChannelEta+ich] = -1.0*TMath::Log(TMath::Tan(theta/2.0));
    }
  }
  
  if(eventF) {
    for(Int_t ih=0; ih<6; ++ih) {
      // VZERO event plane variables
      values[kVZEROQvecX+2*6+ih] = 0.0;
      values[kVZEROQvecY+2*6+ih] = 0.0;
      values[kVZERORP   +2*6+ih] = 0.0;
      for(Int_t iVZEROside=0; iVZEROside<2; ++iVZEROside) {
        values[kVZEROQvecX+iVZEROside*6+ih] = eventF->Qx(AliCorrelationReducedEventFriend::kVZEROA+iVZEROside, ih+1);
        values[kVZEROQvecY+iVZEROside*6+ih] = eventF->Qy(AliCorrelationReducedEventFriend::kVZEROA+iVZEROside, ih+1);
        values[kVZERORP   +iVZEROside*6+ih] = eventF->EventPlane(AliCorrelationReducedEventFriend::kVZEROA+iVZEROside, ih+1);
	values[kVZEROQvecX+2*6         +ih] += values[kVZEROQvecX+iVZEROside*6+ih];
	values[kVZEROQvecY+2*6         +ih] += values[kVZEROQvecY+iVZEROside*6+ih];
	// cos(n(EPtpc-EPvzero A/C))	
        values[kTPCRPres+iVZEROside*6+ih] = DeltaPhi(eventF->EventPlane(AliCorrelationReducedEventFriend::kTPC, ih+1), eventF->EventPlane(AliCorrelationReducedEventFriend::kVZEROA+iVZEROside, ih+1));
        values[kTPCRPres+iVZEROside*6+ih] = TMath::Cos(values[kTPCRPres+iVZEROside*6+ih]*(ih+1));
      }
      values[kVZERORP   +2*6+ih] = TMath::ATan2(values[kVZEROQvecY+2*6+ih],values[kVZEROQvecX+2*6+ih]);
      // cos (n*(psi_A-psi_C))
      values[kVZERORPres + ih] = DeltaPhi(eventF->EventPlane(AliCorrelationReducedEventFriend::kVZEROA, ih+1), 
					  eventF->EventPlane(AliCorrelationReducedEventFriend::kVZEROC, ih+1));
      values[kVZERORPres + ih] = TMath::Cos(values[kVZERORPres + ih]*(ih+1));
      // Qx,Qy correlations for VZERO
      values[kVZEROXaXc+ih] = eventF->Qx(AliCorrelationReducedEventFriend::kVZEROA, ih+1)*eventF->Qx(AliCorrelationReducedEventFriend::kVZEROC, ih+1);
      values[kVZEROXaYa+ih] = eventF->Qx(AliCorrelationReducedEventFriend::kVZEROA, ih+1)*eventF->Qy(AliCorrelationReducedEventFriend::kVZEROA, ih+1);
      values[kVZEROXaYc+ih] = eventF->Qx(AliCorrelationReducedEventFriend::kVZEROA, ih+1)*eventF->Qy(AliCorrelationReducedEventFriend::kVZEROC, ih+1);
      values[kVZEROYaXc+ih] = eventF->Qy(AliCorrelationReducedEventFriend::kVZEROA, ih+1)*eventF->Qx(AliCorrelationReducedEventFriend::kVZEROC, ih+1);
      values[kVZEROYaYc+ih] = eventF->Qy(AliCorrelationReducedEventFriend::kVZEROA, ih+1)*eventF->Qy(AliCorrelationReducedEventFriend::kVZEROC, ih+1);
      values[kVZEROXcYc+ih] = eventF->Qx(AliCorrelationReducedEventFriend::kVZEROC, ih+1)*eventF->Qy(AliCorrelationReducedEventFriend::kVZEROC, ih+1);
      // Psi_A - Psi_C
      values[kVZEROdeltaRPac+ih] = DeltaPhi(eventF->EventPlane(AliCorrelationReducedEventFriend::kVZEROA, ih+1), 
					    eventF->EventPlane(AliCorrelationReducedEventFriend::kVZEROC, ih+1));
      
      // TPC event plane
      values[kTPCQvecX+ih] = eventF->Qx(AliCorrelationReducedEventFriend::kTPC, ih+1);
      values[kTPCQvecY+ih] = eventF->Qy(AliCorrelationReducedEventFriend::kTPC, ih+1);
      values[kTPCRP   +ih] = eventF->EventPlane(AliCorrelationReducedEventFriend::kTPC, ih+1);
      // TPC VZERO Q-vector correlations
      values[kRPXtpcXvzeroa+ih] = values[kTPCQvecX+ih]*values[kVZEROQvecX+ih];
      values[kRPXtpcXvzeroc+ih] = values[kTPCQvecX+ih]*values[kVZEROQvecX+6+ih];
      values[kRPYtpcYvzeroa+ih] = values[kTPCQvecY+ih]*values[kVZEROQvecY+ih];
      values[kRPYtpcYvzeroc+ih] = values[kTPCQvecY+ih]*values[kVZEROQvecY+6+ih];
      values[kRPXtpcYvzeroa+ih] = values[kTPCQvecX+ih]*values[kVZEROQvecY+ih];
      values[kRPXtpcYvzeroc+ih] = values[kTPCQvecX+ih]*values[kVZEROQvecY+6+ih];
      values[kRPYtpcXvzeroa+ih] = values[kTPCQvecY+ih]*values[kVZEROQvecX+ih];
      values[kRPYtpcXvzeroc+ih] = values[kTPCQvecY+ih]*values[kVZEROQvecX+6+ih];
      // Psi_TPC - Psi_VZERO A/C      
      values[kRPdeltaVZEROAtpc+ih] = DeltaPhi(values[kVZERORP+0*6+ih], values[kTPCRP+ih]);
      values[kRPdeltaVZEROCtpc+ih] = DeltaPhi(values[kVZERORP+1*6+ih], values[kTPCRP+ih]);
    }  // end loop over harmonics
    
    // VZERO v2 using TPC event plane
    Double_t vzeroChannelPhi[8] = {0.3927, 1.1781, 1.9635, 2.7489, -2.7489, -1.9635, -1.1781, -0.3927};
    for(Int_t ich=0; ich<64; ++ich) {
      if(gUsedVars[kVZEROflowV2TPC]) {
        values[kVZEROflowV2TPC+ich] = values[kVZEROChannelMult+ich]*TMath::Cos(2.0*DeltaPhi(vzeroChannelPhi[ich%8],values[kTPCRP+1]));
      } 
    }
  }  // end if (eventF)  
}


//_________________________________________________________________
void DstCommonMacros::FillTrackingFlag(AliCorrelationReducedTrack* track, UShort_t flag, Float_t* values) {
  //
  // fill the tracking flag
  //
  values[kTrackingFlag] = -1;
  if(track->CheckTrackStatus(flag)) values[kTrackingFlag] = flag;
}


//_________________________________________________________________
void DstCommonMacros::FillEventOfflineTriggers(UShort_t triggerBit, Float_t* values) {
  //
  // fill the trigger bit input
  //
  if(triggerBit>=64) return;
  if(!gCurrentEvent) return;
  ULong64_t trigger = BIT(0);
  values[kOfflineTrigger] = triggerBit;
  values[kOfflineTriggerFired] = (gCurrentEvent->TriggerMask()&(trigger<<triggerBit) ? 1.0 : 0.0);
  values[kOfflineTriggerFired2] = (values[kOfflineTriggerFired]>0.01 ? triggerBit : -1.0); 
}


//_________________________________________________________________
void DstCommonMacros::FillTrackInfo(AliCorrelationReducedTrack* p, Float_t* values) {
  //
  // fill track information
  //
                        values[kPt]     = p->Pt();
                        values[kPtTPC]  = p->PtTPC();
  if(gUsedVars[kP])     values[kP]      = p->P();
  if(gUsedVars[kTheta]) values[kTheta]  = p->Theta();
                        values[kPhi]    = p->Phi();
                        values[kPhiTPC] = p->PhiTPC();
                        values[kEta]    = p->Eta();
                        values[kEtaTPC] = p->EtaTPC();
                        values[kPin]    = p->Pin();
                        values[kDcaXY]  = p->DCAxy();
                        values[kDcaZ]   = p->DCAz();
  
  if(gUsedVars[kITSncls]) values[kITSncls] = p->ITSncls();
                          values[kITSsignal] = p->ITSsignal();
  
  values[kTPCncls] = p->TPCncls();
  if(gUsedVars[kTPCnclsRatio]) 
    values[kTPCnclsRatio] = (p->TPCFindableNcls()>0 ? Float_t(p->TPCncls())/Float_t(p->TPCFindableNcls()) : 0.0);
  values[kTPCnclsIter1]   = p->TPCnclsIter1();
  values[kTPCnclsF]       = p->TPCFindableNcls();
  values[kTPCsignal]      = p->TPCsignal();
  
  values[kTOFbeta] = p->TOFbeta();
  for(Int_t specie=kElectron; specie<=kProton; ++specie) {
    values[kTPCnSig+specie] = p->TPCnSig(specie);
    values[kTOFnSig+specie] = p->TOFnSig(specie);
  }
  values[kTRDpidProbabilities]   = p->TRDpid(0);
  values[kTRDpidProbabilities+1] = p->TRDpid(1);
  
  values[kTRDntracklets]    = p->TRDntracklets(0);
  values[kTRDntrackletsPID] = p->TRDntracklets(1);
  
  if(gUsedVars[kEMCALmatchedEnergy] || gUsedVars[kEMCALmatchedEOverP]) {
    AliCorrelationReducedCaloCluster* cluster = gCurrentEvent->GetCaloCluster(p->CaloClusterId());
    values[kEMCALmatchedEnergy] = (cluster ? cluster->Energy() : -999.0);
    Float_t mom = p->P();
    values[kEMCALmatchedEnergy] = (TMath::Abs(mom)>1.e-8 && cluster ? values[kEMCALmatchedEOverP]/mom : -999.0);
  }
  
  // Fill track flow variables
  for(Int_t iVZEROside=0; iVZEROside<2; ++iVZEROside) {
    for(Int_t ih=0; ih<6; ++ih) {
      if(gUsedVars[kTrackVZEROFlowVn+iVZEROside*6+ih] || gUsedVars[kTrackDeltaPhiVZEROFlowVn+iVZEROside*6+ih]) {
        values[kTrackVZEROFlowVn+iVZEROside*6+ih]         = TMath::Cos(DeltaPhi(values[kPhi],values[kVZERORP+iVZEROside*6+ih])*(ih+1));
        values[kTrackDeltaPhiVZEROFlowVn+iVZEROside*6+ih] = DeltaPhi(values[kPhi],values[kVZERORP+iVZEROside*6+ih]);
      }
    }
  }
}


//_________________________________________________________________
void DstCommonMacros::FillCaloClusterInfo(AliCorrelationReducedCaloCluster* cl, Float_t* values) {
  //
  // Fill calorimeter cluster information
  //
  values[kEMCALclusterEnergy] = cl->Energy();
  values[kEMCALclusterDx] = cl->Dx();
  values[kEMCALclusterDz] = cl->Dz();
  values[kEMCALdetector] = (cl->IsEMCAL() ? AliCorrelationReducedCaloCluster::kEMCAL : AliCorrelationReducedCaloCluster::kPHOS);
}


//_________________________________________________________________
void DstCommonMacros::FillPairInfo(AliCorrelationReducedPair* p, Float_t* values) {
  //
  // fill pair information
  //
  
  values[kCandidateId] = p->CandidateId();
  values[kPairType]    = p->PairType();
  if(gUsedVars[kMass]) {
    values[kMass] = p->Mass();
    if(p->CandidateId()==AliCorrelationReducedPair::kLambda0ToPPi) values[kMass] = p->Mass(1);
    if(p->CandidateId()==AliCorrelationReducedPair::kALambda0ToPPi) values[kMass] = p->Mass(2);
  }
                            values[kPairPt]           = p->Pt();
  if(gUsedVars[kPairP])     values[kPairP]            = p->P();
  if(gUsedVars[kPairPx])    values[kPairPx]           = p->Px();
  if(gUsedVars[kPairPy])    values[kPairPy]           = p->Py();
  if(gUsedVars[kPairPz])    values[kPairPz]           = p->Pz();
                            values[kPairEta]          = p->Eta();
  if(gUsedVars[kPairRap])   values[kPairRap]          = p->Rapidity();
                            values[kPairPhi]          = p->Phi();
                            values[kPairLxy]          = p->Lxy();
                            values[kPairOpeningAngle] = p->OpeningAngle();
  if(gUsedVars[kPairTheta]) values[kPairTheta]        = p->Theta();
  
  // Flow variables
  // cos(n*phi), sin(n*phi)
  for(Int_t ih=0; ih<6; ++ih) {
    if(gUsedVars[kPairCosNPhi+ih]) values[kPairCosNPhi+ih] = TMath::Cos(values[kPairPhi]*(1.0+ih));
    if(gUsedVars[kPairSinNPhi+ih]) values[kPairSinNPhi+ih] = TMath::Sin(values[kPairPhi]*(1.0+ih));
  }
  // VZERO  
  for(Int_t iVZEROside=0; iVZEROside<3; ++iVZEROside) {
    // v3 using VZERO Psi_2
    if(gUsedVars[kPairVZEROFlowV3Psi2+iVZEROside]) 
      values[kPairVZEROFlowV3Psi2+iVZEROside] = TMath::Cos(3.0*DeltaPhi(values[kPairPhi],values[kVZERORP+iVZEROside*6+1]));
    for(Int_t ih=0; ih<6; ++ih) {
      // vn using VZERO Psi_n
      if(gUsedVars[kPairVZEROFlowVn+iVZEROside*6+ih]) 
	values[kPairVZEROFlowVn+iVZEROside*6+ih] = TMath::Cos(DeltaPhi(values[kPairPhi], values[kVZERORP+iVZEROside*6+ih])*(ih+1));
      // phi - Psi_n
      if(gUsedVars[kPairDeltaPhiVZEROFlowVn+iVZEROside*6+ih])
        values[kPairDeltaPhiVZEROFlowVn+iVZEROside*6+ih] = DeltaPhi(values[kPairPhi], values[kVZERORP+iVZEROside*6+ih]);
    }
  }
  // TPC
  // v3 using Psi_2
  if(gUsedVars[kPairTPCFlowV3Psi2]) 
    values[kPairTPCFlowV3Psi2] = TMath::Cos(3.0*DeltaPhi(values[kPairPhi],values[kTPCRP+1]));
  for(Int_t ih=0; ih<6; ++ih) {
    // vn using Psi_n
    if(gUsedVars[kPairTPCFlowVn+ih]) 
      values[kPairTPCFlowVn+ih] = TMath::Cos(DeltaPhi(values[kPairPhi],values[kTPCRP+ih])*(ih+1));
    if(gUsedVars[kPairDeltaPhiTPCFlowVn+ih])
      values[kPairDeltaPhiTPCFlowVn+ih] = DeltaPhi(values[kPairPhi], values[kTPCRP+ih]);
  }
}


//_________________________________________________________________
void DstCommonMacros::FillPairInfo(AliCorrelationReducedTrack* t1, AliCorrelationReducedTrack* t2, Int_t type, Float_t* values) {
  //
  // fill pair information from 2 tracks
  //
  // type - Parameter encoding the resonance type 
  //        This is needed for making a mass assumption on the legs
  //
  if(gUsedVars[kPairType])  {
    if(t1->Charge()*t2->Charge()<0) values[kPairType]  = 1;
    else if(t1->Charge()>0)         values[kPairType]  = 0;
    else                            values[kPairType]  = 2;
  }
  Float_t kMass1 = 0.0;
  Float_t kMass2 = 0.0;
  switch (type) {
    case AliCorrelationReducedPair::kK0sToPiPi :
      kMass1 = 0.13957; kMass2 = 0.13957;
      break;
    case AliCorrelationReducedPair::kPhiToKK :
      kMass1 = 0.493677; kMass2 = 0.493677;
      break;
    case AliCorrelationReducedPair::kLambda0ToPPi :
      kMass1 = 0.938272; kMass2 = 0.13957;
      break;
    case AliCorrelationReducedPair::kALambda0ToPPi :
      kMass1 = 0.13957; kMass2 = 0.938272;
      break;
    case AliCorrelationReducedPair::kJpsiToEE :
      kMass1 = 0.000511; kMass2 = 0.000511;
      break;
    default :
      break;
  }
  
  if(gUsedVars[kMass]) {     
    values[kMass]      = kMass1*kMass1+kMass2*kMass2 + 
                         2.0*(TMath::Sqrt(kMass1*kMass1+t1->P()*t1->P())*TMath::Sqrt(kMass2*kMass2+t2->P()*t2->P()) - 
                         t1->Px()*t2->Px() - t1->Py()*t2->Py() - t1->Pz()*t2->Pz());
    if(values[kMass]<0.0) {
      cout << "FillPairInfo(track, track, type, values): Warning: Very small squared mass found. "
           << "   Could be negative due to resolution of Float_t so it will be set to a small positive value." << endl; 
      cout << "   mass2: " << values[kMass] << endl;
      cout << "p1(p,x,y,z): " << t1->P() << ", " << t1->Px() << ", " << t1->Py() << ", " << t1->Pz() << endl;
      cout << "p2(p,x,y,z): " << t2->P() << ", " << t2->Px() << ", " << t2->Py() << ", " << t2->Pz() << endl;
      values[kMass] = 0.0;
    }
    else
      values[kMass]      = TMath::Sqrt(values[kMass]);
  }
  
  if(gUsedVars[kPairPt])    values[kPairPt]    = TMath::Sqrt((t1->Px()+t2->Px())*(t1->Px()+t2->Px()) +
                                                             (t1->Py()+t2->Py())*(t1->Py()+t2->Py()));
  if(gUsedVars[kPairP])     values[kPairP]     = TMath::Sqrt((t1->Px()+t2->Px())*(t1->Px()+t2->Px()) +
                                                             (t1->Py()+t2->Py())*(t1->Py()+t2->Py()) +
                                                             (t1->Pz()+t2->Pz())*(t1->Pz()+t2->Pz()));
  if(gUsedVars[kPairEta])   {
    Float_t p = TMath::Sqrt((t1->Px()+t2->Px())*(t1->Px()+t2->Px()) +
                            (t1->Py()+t2->Py())*(t1->Py()+t2->Py()) +
                            (t1->Pz()+t2->Pz())*(t1->Pz()+t2->Pz()));
    values[kPairEta] = p-t1->Pz()-t2->Pz();
    values[kPairEta] = (TMath::Abs(values[kPairEta])>1.0e-8 ? (p+t1->Pz()+t2->Pz())/values[kPairEta] : 0.0);
    values[kPairEta]   = (values[kPairEta]>1.0e-8 ? 0.5*TMath::Log(values[kPairEta]) : -999.);
  }
  if(gUsedVars[kPairRap])   {
    Float_t mass = kMass1*kMass1+kMass2*kMass2 +
                   2.0*(TMath::Sqrt(kMass1*kMass1+t1->P()*t1->P())*TMath::Sqrt(kMass2*kMass2+t2->P()*t2->P()) - 
                   t1->Px()*t2->Px() - t1->Py()*t2->Py() - t1->Pz()*t2->Pz());
    if(mass<0.0) {
      cout << "Negative squared mass (Float_t resolution). Setting mass to zero" << endl;
      mass = 0.0;
    }
    else mass = TMath::Sqrt(mass);
    Float_t e = TMath::Sqrt(mass*mass+
                            (t1->Px()+t2->Px())*(t1->Px()+t2->Px()) +
                            (t1->Py()+t2->Py())*(t1->Py()+t2->Py()) +
                            (t1->Pz()+t2->Pz())*(t1->Pz()+t2->Pz()));
    values[kPairRap]   = 0.5*TMath::Log((e+t1->Pz()+t2->Pz())/(e-t1->Pz()-t2->Pz()));
  }
  if(gUsedVars[kPairPhi])   {
    values[kPairPhi]   = TMath::ATan2(t1->Py()+t2->Py(),t1->Px()+t2->Px());
    if(values[kPairPhi]<0.0) values[kPairPhi] = 2.0*TMath::Pi() + values[kPairPhi];
  }
  if(gUsedVars[kPairTheta]) values[kPairTheta] = TMath::ACos((t1->Pz()+t2->Pz())/
                                                             TMath::Sqrt((t1->Px()+t2->Px())*(t1->Px()+t2->Px()) +
                                                                         (t1->Py()+t2->Py())*(t1->Py()+t2->Py()) +
                                                                         (t1->Pz()+t2->Pz())*(t1->Pz()+t2->Pz())));
  // Flow variables
  // cos(n*phi), sin(n*phi)
  for(Int_t ih=0; ih<6; ++ih) {
    if(gUsedVars[kPairCosNPhi+ih]) values[kPairCosNPhi+ih] = TMath::Cos(values[kPairPhi]*(1.0+ih));
    if(gUsedVars[kPairSinNPhi+ih]) values[kPairSinNPhi+ih] = TMath::Sin(values[kPairPhi]*(1.0+ih));
  }
  // VZERO  
  for(Int_t iVZEROside=0; iVZEROside<3; ++iVZEROside) {
    // v3 using VZERO Psi_2
    if(gUsedVars[kPairVZEROFlowV3Psi2+iVZEROside]) 
      values[kPairVZEROFlowV3Psi2+iVZEROside] = TMath::Cos(3.0*DeltaPhi(values[kPairPhi],values[kVZERORP+iVZEROside*6+1]));
    for(Int_t ih=0; ih<6; ++ih) {
      // vn using VZERO Psi_n
      if(gUsedVars[kPairVZEROFlowVn+iVZEROside*6+ih]) 
	values[kPairVZEROFlowVn+iVZEROside*6+ih] = TMath::Cos(DeltaPhi(values[kPairPhi], values[kVZERORP+iVZEROside*6+ih])*(ih+1));
      // phi - Psi_n
      if(gUsedVars[kPairDeltaPhiVZEROFlowVn+iVZEROside*6+ih])
        values[kPairDeltaPhiVZEROFlowVn+iVZEROside*6+ih] = DeltaPhi(values[kPairPhi], values[kVZERORP+iVZEROside*6+ih]);
    }
  }
  // TPC
  // v3 using Psi_2
  if(gUsedVars[kPairTPCFlowV3Psi2]) 
    values[kPairTPCFlowV3Psi2] = TMath::Cos(3.0*DeltaPhi(values[kPairPhi],values[kTPCRP+1]));
  for(Int_t ih=0; ih<6; ++ih) {
    // vn using Psi_n
    if(gUsedVars[kPairTPCFlowVn+ih]) 
      values[kPairTPCFlowVn+ih] = TMath::Cos(DeltaPhi(values[kPairPhi],values[kTPCRP+ih])*(ih+1));
    if(gUsedVars[kPairDeltaPhiTPCFlowVn+ih])
      values[kPairDeltaPhiTPCFlowVn+ih] = DeltaPhi(values[kPairPhi], values[kTPCRP+ih]);
  }
}


//__________________________________________________________________
void DstCommonMacros::FillCorrelationInfo(AliCorrelationReducedPair* p, AliCorrelationReducedTrack* t, Float_t* values) {
  //
  // fill pair-track correlation information
  //
  if(gUsedVars[kDeltaPhi]) 
    values[kDeltaPhi] = DeltaPhi(p->Phi(), t->Phi());
  
  if(gUsedVars[kDeltaTheta]) 
    values[kDeltaTheta] = p->Theta() - t->Theta();
  
  if(gUsedVars[kDeltaEta]) values[kDeltaEta] = p->Eta() - t->Eta();
}


//__________________________________________________________________
void DstCommonMacros::DoEventMixing(TList* list1, TList* list2, Float_t* values, Int_t type, const Char_t* histClass) {
  //
  // Do the event mixing
  //
  if(type==0) return;
    
  cout << "mixing ..." << endl; 
  switch(type) {
    case -1:
      EventMixingPairTracks(list1, list2, values);    // list1 contains pairs; list2 contains tracks
      break;
    case AliCorrelationReducedPair::kJpsiToEE:
      // type is needed to encode the type of resonance which is needed for the mass assumption of legs when calculating the invariant mass
      EventMixingResonanceLegs(list1, list2, values, type, histClass);  // list1 contains positive legs; list2 contains negative legs
      break;
    default:
      break;
  }
  
  for(Int_t i=list1->GetEntries()-1; i>=0; --i) ((TList*)list1->At(i))->RemoveAll();
  for(Int_t j=list2->GetEntries()-1; j>=0; --j) ((TList*)list2->At(j))->RemoveAll();
  list1->Clear();
  list2->Clear();
}


//__________________________________________________________________
void DstCommonMacros::EventMixingPairTracks(TList* pairLists, TList* trackLists, Float_t* values) {
  //
  //  Make event mixing for pair - track correlations
  //
  cout << "Mixing category " << gEMCategoryNames[TMath::Nint(values[kEventMixingId])].Data() << endl;
  Int_t entries = pairLists->GetEntries();   // we should have the same number of entries in both pair and track lists
  if(entries<2) return;
  
  TList* pairs = 0x0;
  TList* tracks = 0x0;
  AliCorrelationReducedPair* pair = 0x0;
  AliCorrelationReducedTrack* track = 0x0;
  
  TIter nextPairList(pairLists);
  for(Int_t ie1=0; ie1<entries; ++ie1) {
    pairs = (TList*)nextPairList();
    
    TIter nextTrackList(trackLists); 
    for(Int_t ie2=0; ie2<entries; ++ie2) {
      tracks = (TList*)nextTrackList();
      if(ie1==ie2) continue;
      
      TIter nextPair(pairs);
      for(Int_t ip=0; ip<pairs->GetEntries(); ++ip) {
        pair = (AliCorrelationReducedPair*)nextPair();
        FillPairInfo(pair, values);

        TIter nextTrack(tracks);
	Int_t leadingIdx = -1;
	Float_t leadingPt = 0.0;
        for(Int_t it=0; it<tracks->GetEntries(); ++it) {
          track = (AliCorrelationReducedTrack*)nextTrack();
          FillTrackInfo(track, values);

          FillCorrelationInfo(pair, track, values);
          if(pair->PairType()==1) 
            FillHistClass(Form("Correlation_ME_US%s", gEMCategoryNames[TMath::Nint(values[kEventMixingId])].Data()),values);
          if(pair->PairType()==0) {
            FillHistClass(Form("Correlation_ME_LS%s", gEMCategoryNames[TMath::Nint(values[kEventMixingId])].Data()), values); 
            FillHistClass(Form("Correlation_ME_LSpp%s", gEMCategoryNames[TMath::Nint(values[kEventMixingId])].Data()), values);
          }
          if(pair->PairType()==2) {
            FillHistClass(Form("Correlation_ME_LS%s", gEMCategoryNames[TMath::Nint(values[kEventMixingId])].Data()), values); 
            FillHistClass(Form("Correlation_ME_LSmm%s", gEMCategoryNames[TMath::Nint(values[kEventMixingId])].Data()), values);
          }
          if(track->Pt()>leadingPt) {
	    leadingPt = track->Pt();
	    leadingIdx = it;
	  }
        }   // end loop over tracks
        if(leadingIdx!=-1) {
	  track = (AliCorrelationReducedTrack*)tracks->At(leadingIdx);
	  FillTrackInfo(track, values);
	  FillCorrelationInfo(pair, track, values);
          if(pair->PairType()==1) 
	    FillHistClass(Form("Correlation_LeadingPt_ME_US%s", gEMCategoryNames[TMath::Nint(values[kEventMixingId])].Data()),values);
          if(pair->PairType()==0) {
            FillHistClass(Form("Correlation_LeadingPt_ME_LS%s", gEMCategoryNames[TMath::Nint(values[kEventMixingId])].Data()),values);
            FillHistClass(Form("Correlation_LeadingPt_ME_LSpp%s", gEMCategoryNames[TMath::Nint(values[kEventMixingId])].Data()),values);
          }
          if(pair->PairType()==2) {
            FillHistClass(Form("Correlation_LeadingPt_ME_LS%s", gEMCategoryNames[TMath::Nint(values[kEventMixingId])].Data()),values);
            FillHistClass(Form("Correlation_LeadingPt_ME_LSmm%s", gEMCategoryNames[TMath::Nint(values[kEventMixingId])].Data()),values);
	  }
	}
      }   // end loop over pairs      
    }  // end loop over second event
  }  // end loop over first event
}


//__________________________________________________________________
void DstCommonMacros::EventMixingResonanceLegs(TList* posLists, TList* negLists, Float_t* values, Int_t type, const Char_t* histClass) {
  //
  // Do event mixing with the legs of a resonance to obtain the background
  //
  cout << "Mixing event class " << histClass << ", (cent/vtx): " << values[kCentVZERO] << "/" << values[kVtxZ] << endl;
  Int_t entries = posLists->GetEntries();
  cout << "mixing positives: " << entries << endl;
  cout << "mixing negatives: " << negLists->GetEntries() << endl;
  if(entries<2) return;
  
  TList* positives1 = 0x0;   // list of tracks in the first event
  //TList* negatives1 = 0x0;
  //TList* positives2 = 0x0;   // list of tracks in the second event
  TList* negatives2 = 0x0;
  AliCorrelationReducedTrack* posTrack1 = 0x0;
  //AliCorrelationReducedTrack* negTrack1 = 0x0;
  //AliCorrelationReducedTrack* posTrack2 = 0x0;
  AliCorrelationReducedTrack* negTrack2 = 0x0;
  
  TIter nextPosList1(posLists);
  TIter nextNegList1(negLists);
  for(Int_t ie1=0; ie1<entries; ++ie1) {
    positives1 = (TList*)nextPosList1();
    //negatives1 = (TList*)nextNegList1();
    
    TIter nextPosList2(posLists);
    TIter nextNegList2(negLists);
    for(Int_t ie2=0; ie2<entries; ++ie2) {
      //positives2 = (TList*)nextPosList2();
      negatives2 = (TList*)nextNegList2();
      if(ie1==ie2) continue;    // no SE mixing
      
      TIter nextPosLeg1(positives1);
      while((posTrack1=(AliCorrelationReducedTrack*)nextPosLeg1())) {
        /*TIter nextPosLeg2(positives2);
        while((posTrack2=(AliCorrelationReducedTrack*)nextPosLeg2())) {
          FillPairInfo(posTrack1, posTrack2, type, values);             // ++ combinations
          FillHistClass(Form("%s_LSpp", histClass),values);
        }    // end while over pos legs in event 2
        */
        TIter nextNegLeg2(negatives2);
        while((negTrack2=(AliCorrelationReducedTrack*)nextNegLeg2())) {
          FillPairInfo(posTrack1, negTrack2, type, values);             // +- combinations
	  if(IsPairSelectedEM(values))
            FillHistClass(histClass, values);
        }    // end while over neg legs in event 2
      }    // end while over pos legs in event 1
      /*TIter nextNegLeg1(negatives1);
      while((negTrack1=(AliCorrelationReducedTrack*)nextNegLeg1())) {
        TIter nextNegLeg2(negatives2);
        while((negTrack2=(AliCorrelationReducedTrack*)nextNegLeg2())) {
          FillPairInfo(negTrack1, negTrack2, type, values);             // -- combinations
          FillHistClass(Form("%s_LSmm", histClass),values);
        }    // end while over neg legs in event 2
      }    // end while over neg legs in event 1
      */
    }    // end for over event 2
  }    // end for over event 1
}




//________________________________________________________________
Double_t DstCommonMacros::DeltaPhi(Double_t phi1, Double_t phi2) {
  //
  // compute the delta of two angles defined in the (-pi,+pi) interval
  //
  Double_t delta = phi1-phi2;
  if(delta>2.0*TMath::Pi()) delta -= 2.0*TMath::Pi();
  if(delta<0.0) delta += 2.0*TMath::Pi();
  /*Double_t delta = phi2;
  if(phi2<0.0) delta += 2.0*TMath::Pi();
  delta = phi1-delta;
  if(delta>TMath::Pi()) delta = delta - 2.0*TMath::Pi();
  if(delta<-1.*TMath::Pi()) delta = 2.0*TMath::Pi() + delta;
  */
  return delta;
}


//__________________________________________________________________
void DstCommonMacros::FillHistClass(const Char_t* className, Float_t* values) {
  //
  //  fill a class of histograms
  //
  THashList* hList = (THashList*)gHistLists->FindObject(className);
  if(!hList) {
    //cout << "Warning in FillHistClass(): Histogram class " << className << " not found" << endl;
    return;
  }
    
  TIter next(hList);
  TObject* h=0x0;
  while((h=next())) {
    UInt_t id = h->GetUniqueID();
    UInt_t varX = id%kNVars;
    UInt_t varY = (id/kNVars)%kNVars;
    UInt_t varZ = (id/kNVars/kNVars)%kNVars;
    if(id<kNVars) { 
      ((TH1F*)h)->Fill(values[varX]);
    } else if(id<kNVars*kNVars) {
      if(((TH1*)h)->GetDimension()==1) ((TProfile*)h)->Fill(values[varX],values[varY]);
      if(((TH1*)h)->GetDimension()==2) ((TH2F*)h)->Fill(values[varX],values[varY]);
    } else {
      if(((TH1*)h)->GetDimension()==2) ((TProfile2D*)h)->Fill(values[varX],values[varY],values[varZ]);
      if(((TH1*)h)->GetDimension()==3) ((TH3F*)h)->Fill(values[varX],values[varY],values[varZ]);
    };
  }
}


//__________________________________________________________________
void DstCommonMacros::AddHistClass(const Char_t* histClass) {
  //
  // Add a new histogram list
  //
  if(!gHistLists)
    gHistLists = new TObjArray();
  gHistLists->SetOwner();
  gHistLists->SetName("histos");
  
  if(gHistLists->FindObject(histClass)) {
    cout << "Warning in AddHistClass: Cannot add histogram class " << histClass
         << " because it already exists." << endl;
    return;
  }
  THashList* hList=new THashList;
  hList->SetOwner(kTRUE);
  hList->SetName(histClass);
  gHistLists->Add(hList);
}


//_________________________________________________________________
Int_t DstCommonMacros::ValidateHistogramName(THashList* hList, const Char_t* name) {
  //
  // check whether a histogram with this name already exist, and how many of them
  //
  for(Int_t i=0; i<hList->GetEntries(); ++i) {
    TString hname = hList->At(i)->GetName();
    TObjArray* arr=hname.Tokenize("#");
    TString nameRoot = arr->At(0)->GetName();
    if(nameRoot.CompareTo(name)==0) {
      cout << "Warning in AddHistogram(): Histogram " << name << " already exists in this list (" << nameRoot.Data() << ")" << endl;
      return -1;
    }
  }
  Int_t nnames = 0;
  for(Int_t il=0; il<gHistLists->GetEntries(); ++il) {
    THashList* tlist = (THashList*)gHistLists->At(il);
    for(Int_t ih=0; ih<tlist->GetEntries(); ++ih) {
      TString hname = tlist->At(ih)->GetName();
      TObjArray* arr=hname.Tokenize("#");
      TString nameRoot = arr->At(0)->GetName();
      if(nameRoot.CompareTo(name)==0) ++nnames;
    }
  }
  return nnames;
}


//_________________________________________________________________
void DstCommonMacros::AddHistogram(const Char_t* histClass,
		                   const Char_t* name, const Char_t* title, Bool_t isProfile,
                                   Int_t nXbins, Double_t xmin, Double_t xmax, Int_t varX,
		                   Int_t nYbins, Double_t ymin, Double_t ymax, Int_t varY,
		                   Int_t nZbins, Double_t zmin, Double_t zmax, Int_t varZ,
		                   const Char_t* xLabels, const Char_t* yLabels, const Char_t* zLabels) {
  //
  // add a histogram
  //
  THashList* hList = (THashList*)gHistLists->FindObject(histClass);
  if(hList->FindObject(name)) {
    cout << "Warning in AddHistogram(): Histogram " << name << " already exists" << endl;
    return;
  }
  /*Int_t nnames = ValidateHistogramName(hList, name);
  if(nnames<0) return;
  TString hname = Form("%s#v%d", name, nnames);
  cout << "Assigned name " << hname.Data() << endl;*/
  TString hname = name;
  
  Int_t dimension = 1;
  if(varY!=kNothing) dimension = 2;
  if(varZ!=kNothing) dimension = 3;
  
  TString titleStr(title);
  TObjArray* arr=titleStr.Tokenize(";");
  
  TH1* h=0x0;
  switch(dimension) {
    case 1:
      h=new TH1F(hname.Data(),arr->At(0)->GetName(),nXbins,xmin,xmax);
      //cout << "HISTOGRAM " << hname.Data() << ", ID: " << UInt_t(varX) << endl;
      h->SetUniqueID(UInt_t(varX));
      if(arr->At(1)) h->GetXaxis()->SetTitle(arr->At(1)->GetName());
      if(xLabels[0]!='\0') MakeAxisLabels(h->GetXaxis(), xLabels);
      gUsedVars[varX] = kTRUE;
      hList->Add(h);
      break;
    case 2:
      if(isProfile)
	h=new TProfile(hname.Data(),arr->At(0)->GetName(),nXbins,xmin,xmax);
      else
	h=new TH2F(hname.Data(),arr->At(0)->GetName(),nXbins,xmin,xmax,nYbins,ymin,ymax);
      //cout << "HISTOGRAM " << hname.Data() << ", ID: " << UInt_t(varX+kNVars*varY) << endl;
      h->SetUniqueID(UInt_t(varX+kNVars*varY));
      if(arr->At(1)) h->GetXaxis()->SetTitle(arr->At(1)->GetName());
      if(xLabels[0]!='\0') MakeAxisLabels(h->GetXaxis(), xLabels);
      if(arr->At(2)) h->GetYaxis()->SetTitle(arr->At(2)->GetName());
      if(yLabels[0]!='\0') MakeAxisLabels(h->GetYaxis(), yLabels);
      gUsedVars[varX] = kTRUE;
      gUsedVars[varY] = kTRUE;
      hList->Add(h);
      break;
    case 3:
      if(isProfile)
	h=new TProfile2D(hname.Data(),arr->At(0)->GetName(),nXbins,xmin,xmax,nYbins,ymin,ymax);
      else
	h=new TH3F(hname.Data(),arr->At(0)->GetName(),nXbins,xmin,xmax,nYbins,ymin,ymax,nZbins,zmin,zmax);
      //cout << "HISTOGRAM " << hname.Data() << ", ID: " << UInt_t(varX+kNVars*varY+kNVars*kNVars*varZ) << endl;
      h->SetUniqueID(UInt_t(varX+kNVars*varY+kNVars*kNVars*varZ));
      if(arr->At(1)) h->GetXaxis()->SetTitle(arr->At(1)->GetName());
      if(xLabels[0]!='\0') MakeAxisLabels(h->GetXaxis(), xLabels);
      if(arr->At(2)) h->GetYaxis()->SetTitle(arr->At(2)->GetName());
      if(yLabels[0]!='\0') MakeAxisLabels(h->GetYaxis(), yLabels);
      if(arr->At(3)) h->GetZaxis()->SetTitle(arr->At(3)->GetName());
      if(zLabels[0]!='\0') MakeAxisLabels(h->GetZaxis(), zLabels);
      gUsedVars[varX] = kTRUE;
      gUsedVars[varY] = kTRUE;
      gUsedVars[varZ] = kTRUE;
      hList->Add(h);
      break;
  }
}

//_________________________________________________________________
void DstCommonMacros::AddHistogram(const Char_t* histClass,
		                   const Char_t* name, const Char_t* title, Bool_t isProfile,
                                   Int_t nXbins, Double_t* xbins, Int_t varX,
		                   Int_t nYbins, Double_t* ybins, Int_t varY,
		                   Int_t nZbins, Double_t* zbins, Int_t varZ,
		                   const Char_t* xLabels, const Char_t* yLabels, const Char_t* zLabels) {
  //
  // add a histogram
  //
  THashList* hList = (THashList*)gHistLists->FindObject(histClass);
  if(hList->FindObject(name)) {
    cout << "Warning in AddHistogram(): Histogram " << name << " already exists" << endl;
    return;
  }
  //Int_t nnames = ValidateHistogramName(hList, name);
  //if(nnames<0) return;
  //TString hname = Form("%s#v%d", name, nnames);
  TString hname = name;
  
  Int_t dimension = 1;
  if(varY!=kNothing) dimension = 2;
  if(varZ!=kNothing) dimension = 3;
  
  TString titleStr(title);
  TObjArray* arr=titleStr.Tokenize(";");
  
  TH1* h=0x0;
  switch(dimension) {
    case 1:
      h=new TH1F(hname.Data(),arr->At(0)->GetName(),nXbins,xbins);
      //cout << "HISTOGRAM " << hname.Data() << ", ID: " << UInt_t(varX) << endl;
      h->SetUniqueID(UInt_t(varX));
      if(arr->At(1)) h->GetXaxis()->SetTitle(arr->At(1)->GetName());
      if(xLabels[0]!='\0') MakeAxisLabels(h->GetXaxis(), xLabels);
      gUsedVars[varX] = kTRUE;
      hList->Add(h);
      break;
    case 2:
      if(isProfile)
	h=new TProfile(hname.Data(),arr->At(0)->GetName(),nXbins,xbins);
      else
	h=new TH2F(hname.Data(),arr->At(0)->GetName(),nXbins,xbins,nYbins,ybins);
      //cout << "HISTOGRAM " << hname.Data() << ", ID: " << UInt_t(varX+kNVars*varY) << endl;
      h->SetUniqueID(UInt_t(varX+kNVars*varY));
      if(arr->At(1)) h->GetXaxis()->SetTitle(arr->At(1)->GetName());
      if(xLabels[0]!='\0') MakeAxisLabels(h->GetXaxis(), xLabels);
      if(arr->At(2)) h->GetYaxis()->SetTitle(arr->At(2)->GetName());
      if(yLabels[0]!='\0') MakeAxisLabels(h->GetYaxis(), yLabels);
      gUsedVars[varX] = kTRUE;
      gUsedVars[varY] = kTRUE;
      hList->Add(h);
      break;
    case 3:
      if(isProfile)
	h=new TProfile2D(hname.Data(),arr->At(0)->GetName(),nXbins,xbins,nYbins,ybins);
      else
	h=new TH3F(hname.Data(),arr->At(0)->GetName(),nXbins,xbins,nYbins,ybins,nZbins,zbins);
      //cout << "HISTOGRAM " << hname.Data() << ", ID: " << UInt_t(varX+kNVars*varY+kNVars*kNVars*varZ) << endl;
      h->SetUniqueID(UInt_t(varX+kNVars*varY+kNVars*kNVars*varZ));
      if(arr->At(1)) h->GetXaxis()->SetTitle(arr->At(1)->GetName());
      if(xLabels[0]!='\0') MakeAxisLabels(h->GetXaxis(), xLabels);
      if(arr->At(2)) h->GetYaxis()->SetTitle(arr->At(2)->GetName());
      if(yLabels[0]!='\0') MakeAxisLabels(h->GetYaxis(), yLabels);
      if(arr->At(3)) h->GetZaxis()->SetTitle(arr->At(3)->GetName());
      if(zLabels[0]!='\0') MakeAxisLabels(h->GetZaxis(), zLabels);
      gUsedVars[varX] = kTRUE;
      gUsedVars[varY] = kTRUE;
      gUsedVars[varZ] = kTRUE;
      hList->Add(h);
      break;
  }
}


//____________________________________________________________________________________
void DstCommonMacros::MakeAxisLabels(TAxis* ax, const Char_t* labels) {
  //
  // add bin labels to an axis
  //
  TString labelsStr(labels);
  TObjArray* arr=labelsStr.Tokenize(";");
  for(Int_t ib=1; ib<=ax->GetNbins(); ++ib) {
    if(ib>=arr->GetEntries()+1) break;
    ax->SetBinLabel(ib, arr->At(ib-1)->GetName());
  }
}


//____________________________________________________________________________________
void DstCommonMacros::InitFile(const Char_t* filename) {
  //
  // Open an existing ROOT file containing lists of histograms and initialize the global list pointer
  //
  //if(gHistFile) gHistFile->Close();
  TString histfilename="";
  if(gHistFile) histfilename = gHistFile->GetName();
  if(!histfilename.Contains(filename)) 
    gHistFile = new TFile(filename);    // open file only if not already open
  
  if(!gHistFile) {
    cout << "GlobalMacros.C::GetHistogram() : File " << filename << " not opened!!" << endl;
    return;
  }
  if(gHistFile->IsZombie()) {
    cout << "GlobalMacros.C::GetHistogram() : File " << filename << " not opened!!" << endl;
    return;
  }
  TList* list1 = gHistFile->GetListOfKeys();
  TKey* key1 = (TKey*)list1->At(0);
  gHistListsOld = (TDirectoryFile*)key1->ReadObj();
}


//____________________________________________________________________________________
void DstCommonMacros::CloseFile() {
  //
  // Close the opened file
  //
  gHistListsOld = 0x0;
  if(gHistFile && gHistFile->IsOpen()) gHistFile->Close();
}


//____________________________________________________________________________________
TObject* DstCommonMacros::GetHistogram(const Char_t* listname, const Char_t* hname) {
  //
  // Retrieve a histogram from the list hlist
  //
  if(!gHistListsOld) {
    cout << "GlobalMacros.C::GetHistogram() : The main list was not initialized." << endl;
    cout << "                   A ROOT file must pe initialized first!!" << endl;
    return 0x0;
  }
  TKey* listKey = gHistListsOld->FindKey(listname);
  TDirectoryFile* hlist = (TDirectoryFile*)listKey->ReadObj();
  TKey* key = hlist->FindKey(hname);
  return key->ReadObj();
}


//_________________________________________________________________
TChain* DstCommonMacros::GetChain(const Char_t* filename, Int_t howMany, Int_t offset, Long64_t& entries,
                                  TChain* friendChain/*=0x0*/, const Char_t* friendChainFile/*=0x0*/) {
  //
  // read an ascii file containing a list of root files with reduced trees
  // and build a TChain
  //
  cout << "Creating the data chain from " << filename << " ..." << flush; 
  TChain* chain = new TChain("DstTree");
  ifstream inBuf;
  inBuf.open(filename);
  Int_t index = 0;
  while(inBuf.good()) {
    Char_t str[512];
    inBuf.getline(str,512,'\n');
    
    if(index<offset) {++index; continue;}
    if(index>=offset+howMany) break;
    
    TString strstr = str;
    if(!strstr.Contains(".root")) continue;
    cout << endl << "Adding file " << str << endl;
    chain->Add(str);
    if(friendChain) {
      TObjArray* arr = strstr.Tokenize("/");
      strstr.ReplaceAll(arr->At(arr->GetEntries()-1)->GetName(),friendChainFile);
      friendChain->Add(strstr.Data());
    }    
    ++index;
  }
  inBuf.close();
  entries = chain->GetEntries();
  Long64_t entriesFriend = (friendChain ? friendChain->GetEntries() : 0);
  cout << "DstCommonMacros::GetChain() Chain entries = " << entries << endl;
  if(friendChain)
    cout << "DstCommonMacros::GetChain() Friend chain entries = " << entriesFriend << endl;
  if(friendChain && (entries!=entriesFriend)) {
    cout << "DstCommonMacros::GetChain() The friend chain does not have the same number of entries as the main chain!!!" << endl;
    cout << "                            Check it out and retry !!" << endl;
    return 0x0;
  }
  cout << " done" << endl;
  return chain;
}


//__________________________________________________________________
void DstCommonMacros::WriteOutput(TFile* save) {
  //
  // Write the histogram lists in the output file
  //
  cout << "Writing the output to " << save->GetName() << " ... " << flush;
  //TFile* save=new TFile(filename,"RECREATE");
  TDirectory* mainDir = save->mkdir(gHistLists->GetName());
  mainDir->cd();
  for(Int_t i=0; i<gHistLists->GetEntries(); ++i) {
    THashList* list = (THashList*)gHistLists->At(i);
    TDirectory* dir = mainDir->mkdir(list->GetName());
    dir->cd();
    list->Write();
    mainDir->cd();
  }
  save->Close();
  cout << "done" << endl;
}


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