Migration of PWG2/FEMTOSCOPY to PWGCF/FEMTOSCOPY
authorakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 30 Jan 2012 16:35:12 +0000 (16:35 +0000)
committerakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 30 Jan 2012 16:35:12 +0000 (16:35 +0000)
280 files changed:
PWGCF/CMakelibPWGCFFEMTOSCOPYAOD.pkg [new file with mode: 0644]
PWGCF/CMakelibPWGCFfemtoscopy.pkg [new file with mode: 0644]
PWGCF/CMakelibPWGCFfemtoscopyUser.pkg [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliAnalysisTaskFemto.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliAnalysisTaskFemto.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAODTrackCut.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAODTrackCut.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysis.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisAzimuthal.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisAzimuthal.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisCollection.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisReactionPlane.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisReactionPlane.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBPLCMS3DCorrFctn.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBPLCMS3DCorrFctn.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBasicEventCut.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBasicEventCut.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBasicTrackCut.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBasicTrackCut.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn3DLCMSSym.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn3DLCMSSym.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn3DSpherical.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn3DSpherical.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctnCollection.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctnNonIdDR.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctnNonIdDR.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCoulomb.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCoulomb.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitor.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitor.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorCollection.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventMult.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventMult.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventVertex.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventVertex.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorHandler.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorHandler.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticlePID.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticlePID.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleVertPos.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleVertPos.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleYPt.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleYPt.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoDummyPairCut.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoDummyPairCut.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEnumeration.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEvent.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEvent.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventCut.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventCutEstimators.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventCutEstimators.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReader.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReader.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderAOD.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderAOD.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderAODChain.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderAODChain.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESD.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESD.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChain.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChain.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChainKine.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChainKine.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderKinematicsChain.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderKinematicsChain.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderStandard.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderStandard.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventWriter.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventWriterCollection.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoFsiTools.F [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoFsiWeightLednicky.F [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoHelix.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoHiddenInfo.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKTPairCut.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKTPairCut.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKink.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKink.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKinkCollection.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKinkCut.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLikeSignAnalysis.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLikeSignAnalysis.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLikeSignCorrFctn.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLorentzVector.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLorentzVectorD.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoMCTrackCut.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoMCTrackCut.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoManager.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoManager.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelCorrFctn.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelCorrFctn.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelFreezeOutGenerator.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelFreezeOutGenerator.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelGausLCMSFreezeOutGenerator.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelGausLCMSFreezeOutGenerator.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelGlobalHiddenInfo.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelGlobalHiddenInfo.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelHiddenInfo.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelHiddenInfo.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelManager.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelManager.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGenerator.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGenerator.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGeneratorBasic.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGeneratorBasic.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGeneratorLednicky.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGeneratorLednicky.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoPair.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoPair.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoPairCut.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoParticle.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoParticle.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoParticleCollection.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoParticleCut.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoPicoEvent.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoPicoEvent.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoPicoEventCollection.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoPicoEventCollectionVector.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoPicoEventCollectionVectorHideAway.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoPicoEventCollectionVectorHideAway.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoQinvCorrFctn.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoQinvCorrFctn.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoSimpleAnalysis.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoSimpleAnalysis.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoString.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoThreeVector.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoThreeVectorD.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoTrack.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoTrack.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoTrackCollection.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoTrackCut.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoTypes.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoV0.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoV0.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoV0Collection.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoV0Cut.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoVector.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoVertexAnalysis.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoVertexAnalysis.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoVertexMultAnalysis.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoVertexMultAnalysis.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoXi.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoXi.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoXiCollection.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoXiCut.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFmHelix.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFmHelix.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFmHelixD.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFmLorentzVector.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFmLorentzVectorD.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFmPhysicalHelix.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFmPhysicalHelix.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFmPhysicalHelixD.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFmThreeVector.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFmThreeVectorD.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliFmThreeVectorF.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliTwoTrackRes.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/AliTwoTrackRes.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/PhysicalConstants.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/SystemOfUnits.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/TpcLocalTransform.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/TpcLocalTransform.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemto/phys_constants.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoBPLCMS3DCorrFctnEMCIC.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoBPLCMS3DCorrFctnEMCIC.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoChi2CorrFctn.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoChi2CorrFctn.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctn3DSphericalEMCIC.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctn3DSphericalEMCIC.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDEtaDPhi.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDEtaDPhi.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDirectYlm.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDirectYlm.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnGammaMonitor.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnGammaMonitor.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnTPCNcls.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnTPCNcls.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticleEtCorr.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticleEtCorr.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticleMomRes.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticleMomRes.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticlePtPDG.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticlePtPDG.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorTrackTPCchiNdof.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorTrackTPCchiNdof.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorTrackTPCncls.cxx [new file with mode: 0755]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorTrackTPCncls.h [new file with mode: 0755]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoESDTrackCut.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoESDTrackCut.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoEventReaderESDKine.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoEventReaderESDKine.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelAllHiddenInfo.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelAllHiddenInfo.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelBPLCMSCorrFctn.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelBPLCMSCorrFctn.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DLCMSSpherical.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DLCMSSpherical.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DSpherical.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DSpherical.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnDEtaDPhi.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnDEtaDPhi.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnDirectYlm.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnDirectYlm.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnNonIdDR.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnNonIdDR.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnSource.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnSource.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnTrueQ.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnTrueQ.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelGausRinvFreezeOutGenerator.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelGausRinvFreezeOutGenerator.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutAntiGamma.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutAntiGamma.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutPt.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutPt.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutRadialDistance.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutRadialDistance.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoQAEventCut.cxx [new file with mode: 0755]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoQAEventCut.h [new file with mode: 0755]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoQATrackCut.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoQATrackCut.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoQPairCut.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoQPairCut.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoQinvCorrFctnEMCIC.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoQinvCorrFctnEMCIC.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityCorrFctn.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityCorrFctn.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityKTPairCut.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityKTPairCut.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityPairCut.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityPairCut.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityQAPairCut.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityQAPairCut.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityTPCEntranceSepPairCut.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityTPCEntranceSepPairCut.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityTPCEntranceSepQAPairCut.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityTPCEntranceSepQAPairCut.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoTPCInnerCorrFctn.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoTPCInnerCorrFctn.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoYlm.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoYlm.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/Documentation/AliFemto.pdf [new file with mode: 0644]
PWGCF/FEMTOSCOPY/Documentation/AliFemto.tex [new file with mode: 0755]
PWGCF/FEMTOSCOPY/Documentation/AliFemtoTitle.pdf [new file with mode: 0644]
PWGCF/FEMTOSCOPY/Documentation/Analysis.pdf [new file with mode: 0644]
PWGCF/FEMTOSCOPY/Documentation/ExampleMacro1.pdf [new file with mode: 0644]
PWGCF/FEMTOSCOPY/Documentation/ExampleMacro2.pdf [new file with mode: 0644]
PWGCF/FEMTOSCOPY/Documentation/ExampleMacro3.pdf [new file with mode: 0644]
PWGCF/FEMTOSCOPY/Documentation/ExampleMacro4.pdf [new file with mode: 0644]
PWGCF/FEMTOSCOPY/Documentation/ExampleMacro5.pdf [new file with mode: 0644]
PWGCF/FEMTOSCOPY/Documentation/TopLevelUML.pdf [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/AddTaskFemto.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Batch/ConfigFemtoAnalysis.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Batch/runBatch.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/BatchMC/runBatch.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/ConfigFemtoAnalysis.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Local/AliFemtoSplittingMergingQA.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Local/runLocal.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Proof/runProof.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Train/AddTaskFemto.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Train/DEtaDPhi/ConfigFemtoAnalysis.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Train/DEtaDPhiKaons/ConfigFemtoAnalysis.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Train/DEtaDPhiNoPID/ConfigFemtoAnalysis.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Train/DataTrain1/ConfigFemtoAnalysis.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Train/PWG2FemtoExercise1/ConfigFemtoAnalysis.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Train/PWG2FemtoExercise1/runBatch.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Train/PWG2FemtoExercise1/runLocal.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Train/PWG2Train2/ConfigFemtoAnalysis.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Train/PWG2TrainLHC10a6/ConfigFemtoAnalysis.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Train/PionsFemtoscopy/ConfigFemtoAnalysis.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Train/ProtonFemtoscopy/ConfigFemtoAnalysis.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Train/ProtonFemtoscopy/runBatch.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Train/Train3/ConfigFemtoAnalysis.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Train/TwoTrackQA/ConfigFemtoAnalysis.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Train/TwoTrackQA/ConfigFemtoAnalysisCentral.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Train/TwoTrackQA/FemtoQAPlots.C [new file with mode: 0644]
PWGCF/PWGCFFEMTOSCOPYAODLinkDef.h [new file with mode: 0644]
PWGCF/PWGCFfemtoscopyLinkDef.h [new file with mode: 0644]
PWGCF/PWGCFfemtoscopyUserLinkDef.h [new file with mode: 0644]

diff --git a/PWGCF/CMakelibPWGCFFEMTOSCOPYAOD.pkg b/PWGCF/CMakelibPWGCFFEMTOSCOPYAOD.pkg
new file mode 100644 (file)
index 0000000..3d03438
--- /dev/null
@@ -0,0 +1,48 @@
+# -*- mode: CMake -*-
+#-----------------------------------------------------------------------#
+# Package File for PWGCFAOD                                              #
+# Author : Johny Jose (johny.jose@cern.ch)                              #
+# Variables Defined :                                                   #
+#                                                                       #
+# SRCS - C++ source files                                               #
+# HDRS - C++ header files                                               #
+# DHDR - ROOT Dictionary Linkdef header file                            #
+# CSRCS - C source files                                                #
+# CHDRS - C header files                                                #
+# EINCLUDE - Include directories                                        #
+# EDEFINE - Compiler definitions                                        #
+# ELIBS - Extra libraries to link                                       #
+# ELIBSDIR - Extra library directories                                  #
+# PACKFFLAGS - Fortran compiler flags for package                       #
+# PACKCXXFLAGS - C++ compiler flags for package                         #
+# PACKCFLAGS - C compiler flags for package                             #
+# PACKSOFLAGS - Shared library linking flags                            #
+# PACKLDFLAGS - Module linker flags                                     #
+# PACKBLIBS - Libraries to link (Executables only)                      #
+# EXPORT - Header files to be exported                                  #
+# CINTHDRS - Dictionary header files                                    #
+# CINTAUTOLINK - Set automatic dictionary generation                    #
+# ARLIBS - Archive Libraries and objects for linking (Executables only) #
+# SHLIBS - Shared Libraries and objects for linking (Executables only)  #
+#-----------------------------------------------------------------------#
+
+set ( SRCS  
+    FEMTOSCOPYAOD/AliPWG2AODTrack.cxx 
+    FEMTOSCOPYAOD/AliAnalysisTaskPWG2ESDfilter.cxx 
+    FEMTOSCOPYAOD/AliAnalysisTaskPWG2AODUpdate.cxx 
+    )
+
+string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
+
+set ( DHDR PWGCFFEMTOSCOPYAODLinkDef.h)
+
+set ( EXPORT )
+
+set ( EINCLUDE  PYTHIA6 PWGCF/FEMTOSCOPYAOD STEER/AOD STEER/STEERBase)
+
+install (FILES centraltrain/AnalysisTrainPWGCF.C 
+         DESTINATION PWGCF/centraltrain)
+
+#
+# EOF
+#
diff --git a/PWGCF/CMakelibPWGCFfemtoscopy.pkg b/PWGCF/CMakelibPWGCFfemtoscopy.pkg
new file mode 100644 (file)
index 0000000..a132088
--- /dev/null
@@ -0,0 +1,152 @@
+# -*- mode: CMake -*-
+#------------------------------------------------------------------------#
+# Package File for PWG2femtoscopy                                        #
+# Author : Johny Jose (johny.jose@cern.ch)                               #
+# Variables Defined :                                                    #
+#                                                                        #
+# SRCS - C++ source files                                                #
+# HDRS - C++ header files                                                #
+# DHDR - ROOT Dictionary Linkdef header file                             #
+# CSRCS - C source files                                                 #
+# CHDRS - C header files                                                 #
+# EINCLUDE - Include directories                                         #
+# EDEFINE - Compiler definitions                                         #
+# ELIBS - Extra libraries to link                                        #
+# ELIBSDIR - Extra library directories                                   #
+# PACKFFLAGS - Fortran compiler flags for package                        #
+# PACKCXXFLAGS - C++ compiler flags for package                          #
+# PACKCFLAGS - C compiler flags for package                              #
+# PACKSOFLAGS - Shared library linking flags                             #
+# PACKLDFLAGS - Module linker flags                                      #
+# PACKBLIBS - Libraries to link (Executables only)                       #
+# EXPORT - Header files to be exported                                   #
+# CINTHDRS - Dictionary header files                                     #
+# CINTAUTOLINK - Set automatic dictionary generation                     #
+# ARLIBS - Archive Libraries and objects for linking (Executables only)  #
+# SHLIBS - Shared Libraries and objects for linking (Executables only)   #
+#------------------------------------------------------------------------#
+
+set ( SRCS  
+    FEMTOSCOPY/AliFemto/AliFemtoSimpleAnalysis.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoLikeSignAnalysis.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoVertexAnalysis.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoVertexMultAnalysis.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoAnalysisAzimuthal.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoAnalysisReactionPlane.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoBPLCMS3DCorrFctn.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoCorrFctn3DLCMSSym.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoQinvCorrFctn.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoBasicEventCut.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoEventCutEstimators.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoBasicTrackCut.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoDummyPairCut.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoCoulomb.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoCutMonitorHandler.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoEvent.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoKink.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoManager.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoPair.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoParticle.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoPicoEvent.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoPicoEventCollectionVectorHideAway.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoTrack.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoV0.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoXi.cxx 
+    FEMTOSCOPY/AliFemto/AliFmHelix.cxx 
+    FEMTOSCOPY/AliFemto/AliFmPhysicalHelix.cxx 
+    FEMTOSCOPY/AliFemto/TpcLocalTransform.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoEventReader.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoEventReaderStandard.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoEventReaderESD.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChain.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChainKine.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoModelHiddenInfo.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoModelGlobalHiddenInfo.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoModelGausLCMSFreezeOutGenerator.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoModelWeightGenerator.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoModelWeightGeneratorBasic.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoModelManager.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoModelCorrFctn.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoModelFreezeOutGenerator.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoModelWeightGeneratorLednicky.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleYPt.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleVertPos.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticlePID.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventMult.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventVertex.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoKTPairCut.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoCorrFctnNonIdDR.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoCorrFctn3DSpherical.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoEventReaderAOD.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoEventReaderAODChain.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoAODTrackCut.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoCutMonitor.cxx 
+    FEMTOSCOPY/AliFemto/AliFemtoCorrFctn.cxx 
+    FEMTOSCOPY/AliFemto/AliAnalysisTaskFemto.cxx 
+    FEMTOSCOPY/AliFemto/AliTwoTrackRes.cxx
+    FEMTOSCOPY/AliFemto/AliFemtoMCTrackCut.cxx
+    FEMTOSCOPY/AliFemto/AliFemtoEventReaderKinematicsChain.cxx
+    )
+
+string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
+
+set ( HDRS ${HDRS}  
+    FEMTOSCOPY/AliFemto/AliFmThreeVector.h 
+    FEMTOSCOPY/AliFemto/AliFmThreeVectorF.h 
+    FEMTOSCOPY/AliFemto/AliFmThreeVectorD.h 
+    FEMTOSCOPY/AliFemto/AliFmPhysicalHelixD.h 
+    FEMTOSCOPY/AliFemto/AliFmHelixD.h 
+    FEMTOSCOPY/AliFemto/AliFmLorentzVectorD.h 
+    FEMTOSCOPY/AliFemto/AliFemtoV0Cut.h 
+    FEMTOSCOPY/AliFemto/AliFemtoKinkCut.h 
+    FEMTOSCOPY/AliFemto/AliFemtoXiCut.h 
+    FEMTOSCOPY/AliFemto/AliFemtoAnalysisCollection.h 
+    FEMTOSCOPY/AliFemto/AliFemtoAnalysis.h 
+    FEMTOSCOPY/AliFemto/AliFemtoCorrFctnCollection.h 
+    FEMTOSCOPY/AliFemto/AliFemtoEnumeration.h 
+    FEMTOSCOPY/AliFemto/AliFemtoHelix.h 
+    FEMTOSCOPY/AliFemto/AliFemtoHiddenInfo.h 
+    FEMTOSCOPY/AliFemto/AliFemtoLikeSignCorrFctn.h 
+    FEMTOSCOPY/AliFemto/AliFemtoLorentzVector.h 
+    FEMTOSCOPY/AliFemto/AliFemtoString.h 
+    FEMTOSCOPY/AliFemto/AliFemtoThreeVectorD.h 
+    FEMTOSCOPY/AliFemto/AliFemtoThreeVector.h 
+    FEMTOSCOPY/AliFemto/AliFemtoTypes.h 
+    FEMTOSCOPY/AliFemto/AliFemtoVector.h 
+    FEMTOSCOPY/AliFemto/AliFmLorentzVector.h 
+    FEMTOSCOPY/AliFemto/phys_constants.h 
+    FEMTOSCOPY/AliFemto/PhysicalConstants.h 
+    FEMTOSCOPY/AliFemto/SystemOfUnits.h 
+    FEMTOSCOPY/AliFemto/AliFemtoPairCut.h 
+    FEMTOSCOPY/AliFemto/AliFemtoEventCut.h 
+    FEMTOSCOPY/AliFemto/AliFemtoParticleCut.h 
+    FEMTOSCOPY/AliFemto/AliFemtoTrackCollection.h 
+    FEMTOSCOPY/AliFemto/AliFemtoV0Collection.h 
+    FEMTOSCOPY/AliFemto/AliFemtoXiCollection.h 
+    FEMTOSCOPY/AliFemto/AliFemtoKinkCollection.h 
+    FEMTOSCOPY/AliFemto/AliFemtoPicoEventCollection.h 
+    FEMTOSCOPY/AliFemto/AliFemtoParticleCollection.h 
+    FEMTOSCOPY/AliFemto/AliFemtoCutMonitorCollection.h 
+    FEMTOSCOPY/AliFemto/AliFemtoTrackCut.h 
+    FEMTOSCOPY/AliFemto/AliFemtoPicoEventCollectionVector.h 
+    FEMTOSCOPY/AliFemto/AliFemtoEventWriter.h 
+    FEMTOSCOPY/AliFemto/AliFemtoEventWriterCollection.h 
+    FEMTOSCOPY/AliFemto/AliFemtoMCTrackCut.h
+    FEMTOSCOPY/AliFemto/AliFemtoEventReaderKinematicsChain.h
+    )
+
+set ( FSRCS  FEMTOSCOPY/AliFemto/AliFemtoFsiTools.F FEMTOSCOPY/AliFemto/AliFemtoFsiWeightLednicky.F)
+
+set ( DHDR  PWGCFfemtoscopyLinkDef.h)
+
+set ( EXPORT )
+
+set ( EINCLUDE  PWGCF/FEMTOSCOPY/AliFemto PWGCF/AOD PWGCF/FORWARD/analysis STEER/AOD STEER/ESD STEER/STEERBase)
+
+install (DIRECTORY FEMTOSCOPY/macros
+         DESTINATION PWGCF/FEMTOSCOPY 
+         PATTERN .svn EXCLUDE)
+
+#
+# EOF
+#
diff --git a/PWGCF/CMakelibPWGCFfemtoscopyUser.pkg b/PWGCF/CMakelibPWGCFfemtoscopyUser.pkg
new file mode 100644 (file)
index 0000000..e800172
--- /dev/null
@@ -0,0 +1,41 @@
+#--------------------------------------------------------------------------------#
+# Package File for PWGCFfemtoscopyUser                                            #
+# Author : Johny Jose (johny.jose@cern.ch)                                       #
+# Variables Defined :                                                            #
+#                                                                                #
+# SRCS - C++ source files                                                        #
+# HDRS - C++ header files                                                        #
+# DHDR - ROOT Dictionary Linkdef header file                                     #
+# CSRCS - C source files                                                         #
+# CHDRS - C header files                                                         #
+# EINCLUDE - Include directories                                                 #
+# EDEFINE - Compiler definitions                                                 #
+# ELIBS - Extra libraries to link                                                #
+# ELIBSDIR - Extra library directories                                           #
+# PACKFFLAGS - Fortran compiler flags for package                                #
+# PACKCXXFLAGS - C++ compiler flags for package                                  #
+# PACKCFLAGS - C compiler flags for package                                      #
+# PACKSOFLAGS - Shared library linking flags                                     #
+# PACKLDFLAGS - Module linker flags                                              #
+# PACKBLIBS - Libraries to link (Executables only)                               #
+# EXPORT - Header files to be exported                                           #
+# CINTHDRS - Dictionary header files                                             #
+# CINTAUTOLINK - Set automatic dictionary generation                             #
+# ARLIBS - Archive Libraries and objects for linking (Executables only)          #
+# SHLIBS - Shared Libraries and objects for linking (Executables only)           #
+#--------------------------------------------------------------------------------#
+
+set ( SRCS  FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityPairCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityKTPairCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityTPCEntranceSepPairCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoESDTrackCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoTPCInnerCorrFctn.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoChi2CorrFctn.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnSource.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnDEtaDPhi.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelBPLCMSCorrFctn.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelGausRinvFreezeOutGenerator.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnTrueQ.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnNonIdDR.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DSpherical.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DLCMSSpherical.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticleMomRes.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelAllHiddenInfo.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorTrackTPCchiNdof.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoQATrackCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoQAEventCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorTrackTPCncls.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityTPCEntranceSepQAPairCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityQAPairCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityCorrFctn.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoYlm.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDirectYlm.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnDirectYlm.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticlePtPDG.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnTPCNcls.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDEtaDPhi.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnGammaMonitor.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoQinvCorrFctnEMCIC.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctn3DSphericalEMCIC.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoBPLCMS3DCorrFctnEMCIC.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutAntiGamma.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticleEtCorr.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutRadialDistance.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutPt.cxx)
+
+string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
+
+set ( DHDR  PWGCFfemtoscopyUserLinkDef.h)
+
+set ( EXPORT )
+
+set ( EINCLUDE  PWGCF/FEMTOSCOPYAOD PWGCF/FEMTOSCOPY/AliFemto PWGCF/FEMTOSCOPY/AliFemtoUser)
+if( ALICE_TARGET STREQUAL "win32gcc")
+       
+               set ( PACKSOFLAGS  ${SOFLAGS} -L${ALICE_ROOT}/lib/tgt_${ALICE_TARGET} -lPWGCFAOD -lPWGCFfemtoscopy)
+
+endif( ALICE_TARGET STREQUAL "win32gcc")
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliAnalysisTaskFemto.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliAnalysisTaskFemto.cxx
new file mode 100644 (file)
index 0000000..fe3e52b
--- /dev/null
@@ -0,0 +1,516 @@
+//------------------------------------------------------
+// AliAnalysisTaskFemto - A task for the analysis framework
+// from the FEMTOSCOPY analysis of PWG2. Creates the necessary
+// connection between the ESD or AOD input and the femtoscopic
+// code.
+// Author: Adam Kisiel, OSU; Adam.Kisiel@cern.ch
+//------------------------------------------------------
+#include "TROOT.h"
+#include "TChain.h"
+#include "TH1.h"
+#include "TCanvas.h"
+#include "TSystem.h"
+#include "TFile.h"
+#include "TInterpreter.h"
+
+#include "AliAnalysisTask.h"
+
+#include "AliESDEvent.h"
+
+#include "AliFemtoAnalysis.h"
+#include "AliAnalysisTaskFemto.h"
+#include "AliVHeader.h"
+#include "AliGenEventHeader.h"
+#include "AliGenHijingEventHeader.h"
+#include "AliGenCocktailEventHeader.h"
+
+ClassImp(AliAnalysisTaskFemto)
+
+// Default name for the setup macro of femto analysis  
+// This function MUST be defined in the separate file !!!
+// extern AliFemtoManager *ConfigFemtoAnalysis();
+
+//________________________________________________________________________
+AliAnalysisTaskFemto::AliAnalysisTaskFemto(const char *name, const char *aConfigMacro, const char *aConfigParams):
+    AliAnalysisTask(name,""), 
+    fESD(0), 
+    fESDpid(0),
+    fAOD(0),
+    fAODpidUtil(0),
+    fStack(0),
+    fOutputList(0), 
+    fReader(0x0),
+    fManager(0x0),
+    fAnalysisType(0),
+    fConfigMacro(0),
+    fConfigParams(0)
+{
+  // Constructor.
+  // Input slot #0 works with an Ntuple
+  DefineInput(0, TChain::Class());
+  // Output slot #0 writes into a TH1 container
+  DefineOutput(0, TList::Class());
+  fConfigMacro = (char *) malloc(sizeof(char) * strlen(aConfigMacro));
+  strcpy(fConfigMacro, aConfigMacro);
+  fConfigParams = (char *) malloc(sizeof(char) * strlen(aConfigParams));
+  strcpy(fConfigParams, aConfigParams);
+}
+//________________________________________________________________________
+AliAnalysisTaskFemto::AliAnalysisTaskFemto(const char *name, const char *aConfigMacro="ConfigFemtoAnalysis.C"): 
+    AliAnalysisTask(name,""), 
+    fESD(0), 
+    fESDpid(0),
+    fAOD(0),
+    fAODpidUtil(0),
+    fStack(0),
+    fOutputList(0), 
+    fReader(0x0),
+    fManager(0x0),
+    fAnalysisType(0),
+    fConfigMacro(0),
+    fConfigParams(0)
+{
+  // Constructor.
+  // Input slot #0 works with an Ntuple
+  DefineInput(0, TChain::Class());
+  // Output slot #0 writes into a TH1 container
+  DefineOutput(0, TList::Class());
+  fConfigMacro = (char *) malloc(sizeof(char) * strlen(aConfigMacro));
+  strcpy(fConfigMacro, aConfigMacro);
+  fConfigParams = (char *) malloc(sizeof(char) * 2);
+  strcpy(fConfigParams, "");
+}
+
+AliAnalysisTaskFemto::AliAnalysisTaskFemto(const AliAnalysisTaskFemto& aFemtoTask):
+    AliAnalysisTask(aFemtoTask), 
+    fESD(0), 
+    fESDpid(0),
+    fAOD(0),
+    fAODpidUtil(0),
+    fStack(0),
+    fOutputList(0), 
+    fReader(0x0),
+    fManager(0x0),
+    fAnalysisType(0),
+    fConfigMacro(0),
+    fConfigParams(0)
+{
+  // copy constructor
+  fESD = aFemtoTask.fESD; 
+  fESDpid = aFemtoTask.fESDpid; 
+  fAOD = aFemtoTask.fAOD; 
+  fAODpidUtil = aFemtoTask.fAODpidUtil;
+  fStack = aFemtoTask.fStack;
+  fOutputList = aFemtoTask.fOutputList;   
+  fReader = aFemtoTask.fReader;       
+  fManager = aFemtoTask.fManager;      
+  fAnalysisType = aFemtoTask.fAnalysisType; 
+  fConfigMacro = (char *) malloc(sizeof(char) * strlen(aFemtoTask.fConfigMacro));
+  strcpy(fConfigMacro, aFemtoTask.fConfigMacro);
+  fConfigParams = (char *) malloc(sizeof(char) * strlen(aFemtoTask.fConfigParams));
+  strcpy(fConfigParams, aFemtoTask.fConfigParams);
+}
+
+
+AliAnalysisTaskFemto& AliAnalysisTaskFemto::operator=(const AliAnalysisTaskFemto& aFemtoTask){
+  // assignment operator
+  if (this == &aFemtoTask)
+    return *this;
+
+  fESD = aFemtoTask.fESD; 
+  fESDpid = aFemtoTask.fESDpid;
+  fAOD = aFemtoTask.fAOD; 
+  fAODpidUtil = aFemtoTask.fAODpidUtil;
+  fStack = aFemtoTask.fStack;
+  fOutputList = aFemtoTask.fOutputList;   
+  fReader = aFemtoTask.fReader;       
+  fManager = aFemtoTask.fManager;      
+  fAnalysisType = aFemtoTask.fAnalysisType; 
+  if (fConfigMacro) free(fConfigMacro);
+  fConfigMacro = (char *) malloc(sizeof(char) * strlen(aFemtoTask.fConfigMacro));
+  strcpy(fConfigMacro, aFemtoTask.fConfigMacro);
+  if (fConfigParams) free(fConfigParams);
+  fConfigParams = (char *) malloc(sizeof(char) * strlen(aFemtoTask.fConfigParams));
+  strcpy(fConfigParams, aFemtoTask.fConfigParams);
+
+  return *this;
+}
+
+AliAnalysisTaskFemto::~AliAnalysisTaskFemto() 
+{
+  if (fConfigMacro) free(fConfigMacro);
+  if (fConfigParams) free(fConfigParams);
+}
+
+
+//________________________________________________________________________
+void AliAnalysisTaskFemto::ConnectInputData(Option_t *) {
+  AliInfo(Form("   ConnectInputData %s\n", GetName()));
+
+  fESD = 0;
+  fESDpid = 0;
+  fAOD = 0;
+  fAODpidUtil = 0;
+  fAnalysisType = 0;
+
+  TTree* tree = dynamic_cast<TTree*> (GetInputData(0));
+  if (!tree) {
+    AliWarning("Could not read chain from input slot 0");
+    return;
+  } 
+
+  AliFemtoEventReaderESDChain *femtoReader = dynamic_cast<AliFemtoEventReaderESDChain *> (fReader);
+  if ((dynamic_cast<AliFemtoEventReaderESDChain *> (fReader))) {
+    AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
+    
+    if(esdH) {
+      AliInfo("Selected ESD analysis");
+      fAnalysisType = 1;
+      
+//       if (!esdH) {
+//     AliWarning("Could not get ESDInputHandler");
+//       } 
+//       else {
+       fESD = esdH->GetEvent();
+        fESDpid = esdH->GetESDpid();
+        femtoReader->SetESDPid(fESDpid);
+//       }
+    }
+}
+  else if ((dynamic_cast<AliFemtoEventReaderKinematicsChain *> (fReader))) {
+    AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
+    
+    if(esdH) {
+      AliInfo("Selected ESD analysis");
+      fAnalysisType = 1;
+      
+//       if (!esdH) {
+//     AliWarning("Could not get ESDInputHandler");
+//       } 
+//       else {
+       fESD = esdH->GetEvent();
+        //fESDpid = esdH->GetESDpid();
+        //femtoReader->SetESDPid(fESDpid);
+//       }
+    }
+  }
+
+
+  AliFemtoEventReaderESDChainKine *femtoReaderESDKine = dynamic_cast<AliFemtoEventReaderESDChainKine *> (fReader);
+  if ((dynamic_cast<AliFemtoEventReaderESDChainKine *> (fReader))) {
+    AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
+    
+    if(esdH) {
+      AliInfo("Selected ESD analysis");
+      fAnalysisType = 1;
+      
+//       if (!esdH) {
+//     AliWarning("Could not get ESDInputHandler");
+//       } 
+//       else {
+       fESD = esdH->GetEvent();
+        fESDpid = esdH->GetESDpid();
+        femtoReaderESDKine->SetESDPid(fESDpid);
+//       }
+    }
+}
+
+  //  AliFemtoEventReaderKinematicsChain *femtoReaderKine = dynamic_cast<AliFemtoEventReaderKinematicsChain *> (fReader);
+  if ((dynamic_cast<AliFemtoEventReaderKinematicsChain *> (fReader))) {
+    AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
+    
+    if(esdH) {
+      AliInfo("Selected ESD analysis");
+      fAnalysisType = 1;
+      
+      //       if (!esdH) {
+      //       AliWarning("Could not get ESDInputHandler");
+      //       } 
+      //       else {
+      fESD = esdH->GetEvent();
+      //fESDpid = esdH->GetESDpid();
+      //femtoReader->SetESDPid(fESDpid);
+      //       }
+    }
+  }
+  
+  
+  AliFemtoEventReaderAODChain *femtoReaderAOD = dynamic_cast<AliFemtoEventReaderAODChain *> (fReader);
+  if (dynamic_cast<AliFemtoEventReaderAODChain *> (fReader)) {
+    AliAODInputHandler *aodH = dynamic_cast<AliAODInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
+    
+    if (!aodH) {
+      TObject *handler = AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler();
+      AliInfo("Has output handler ");
+      if( handler && handler->InheritsFrom("AliAODHandler") ) {
+       AliInfo("Selected AOD analysis");
+       
+       fAOD = ((AliAODHandler*)handler)->GetAOD();
+       fAnalysisType = 2;
+      }
+      else {
+       AliWarning("Selected AOD reader but no AOD handler found");
+      }
+    } 
+    else {
+      AliInfo("Selected AOD analysis");
+      fAnalysisType = 2;
+      
+      fAOD = aodH->GetEvent();
+
+      fAODpidUtil = aodH->GetAODpidUtil();
+      //      printf("aodH->GetAODpidUtil(): %x",aodH->GetAODpidUtil());
+      femtoReaderAOD->SetAODpidUtil(fAODpidUtil);
+    }
+  }
+
+  if ((!fAOD) && (!fESD)) {
+    AliWarning("Wrong analysis type: Only ESD and AOD types are allowed!");
+  }
+}
+
+//________________________________________________________________________
+void AliAnalysisTaskFemto::CreateOutputObjects() {
+  AliInfo("Creating Femto Analysis objects\n");
+
+  gSystem->SetIncludePath("-I$ROOTSYS/include -I./STEERBase/ -I./ESD/ -I./AOD/ -I./ANALYSIS/ -I./ANALYSISalice/ -I./PWG2AOD/AOD -I./PWG2femtoscopy/FEMTOSCOPY/AliFemto -I./PWG2femtoscopyUser/FEMTOSCOPY/AliFemtoUser");
+  //  char fcm[2000];
+//   sprintf(fcm, "%s++", fConfigMacro);
+//   gROOT->LoadMacro(fcm);
+  gROOT->LoadMacro(fConfigMacro);
+  //  fJetFinder = (AliJetFinder*) gInterpreter->ProcessLine("ConfigJetAnalysis()");
+  if (!fConfigParams)
+    SetFemtoManager((AliFemtoManager *) gInterpreter->ProcessLine("ConfigFemtoAnalysis()"));
+  else
+    SetFemtoManager((AliFemtoManager *) gInterpreter->ProcessLine(Form("ConfigFemtoAnalysis(%s)", fConfigParams)));
+
+  TList *tOL;
+  fOutputList = fManager->Analysis(0)->GetOutputList();
+
+  for (unsigned int ian = 1; ian<fManager->AnalysisCollection()->size(); ian++) {
+    tOL = fManager->Analysis(ian)->GetOutputList();
+
+    TIter nextListCf(tOL);
+    while (TObject *obj = nextListCf()) {
+      fOutputList->Add(obj);
+    }
+
+    delete tOL;
+  }
+
+  PostData(0, fOutputList);
+}
+
+//________________________________________________________________________
+void AliAnalysisTaskFemto::Exec(Option_t *) {
+  // Task making a femtoscopic analysis.
+
+  if (fAnalysisType==1) {
+    if (!fESD) {
+      AliWarning("fESD not available");
+      return;
+    }
+
+    //Get MC data
+    AliMCEventHandler*    mctruth = (AliMCEventHandler*) 
+      ((AliAnalysisManager::GetAnalysisManager())->GetMCtruthEventHandler());
+    
+    AliGenHijingEventHeader *hdh = 0;
+    if(mctruth) {
+      fStack = mctruth->MCEvent()->Stack();
+
+      AliGenCocktailEventHeader *hd = dynamic_cast<AliGenCocktailEventHeader *> (mctruth->MCEvent()->GenEventHeader());
+      
+      if (hd) {
+       
+       //      AliInfo ("Got MC cocktail event header %p\n", (void *) hd);
+       TList *lhd = hd->GetHeaders();
+       //      AliInfo ("Got list of headers %d\n", lhd->GetEntries());
+       
+       for (int iterh=0; iterh<lhd->GetEntries(); iterh++) 
+         {
+           hdh = dynamic_cast<AliGenHijingEventHeader *> (lhd->At(iterh));
+           //      AliInfo ("HIJING header at %i is %p\n", iterh, (void *) hdh);
+         }
+      }    
+    }
+
+    // Get ESD
+    AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
+    
+    if (!esdH) {
+      AliWarning("Could not get ESDInputHandler");
+      return;
+    } 
+    else {
+      fESD = esdH->GetEvent();
+      fESDpid = esdH->GetESDpid();   
+    }
+
+    AliInfo(Form("Tracks in ESD: %d \n",fESD->GetNumberOfTracks()));
+
+    if (fESD->GetNumberOfTracks() >= 0) {
+    
+      if (!fReader) {
+       AliWarning("No ESD reader for ESD analysis !\n");
+      }
+      
+      AliFemtoEventReaderESDChain* fesdc = dynamic_cast<AliFemtoEventReaderESDChain *> (fReader);
+      if (fesdc)
+       {
+         // Process the event with no Kine information
+         fesdc->SetESDSource(fESD);
+         fManager->ProcessEvent();
+       }
+
+       AliFemtoEventReaderKinematicsChain* fkinec = dynamic_cast<AliFemtoEventReaderKinematicsChain *> (fReader);
+      if (fkinec)
+       {
+         // Process the event with Kine information only
+         fkinec->SetStackSource(fStack);
+         fManager->ProcessEvent();
+       }
+
+
+      AliFemtoEventReaderESDChainKine* fesdck = dynamic_cast<AliFemtoEventReaderESDChainKine *> (fReader);
+      if (fesdck) 
+       {
+         // Process the event with Kine information
+         fesdck->SetESDSource(fESD);
+         fesdck->SetStackSource(fStack);
+         
+         fesdck->SetGenEventHeader(hdh);
+         fManager->ProcessEvent();
+       }
+      AliFemtoEventReaderStandard* fstd = dynamic_cast<AliFemtoEventReaderStandard *> (fReader);
+      if (fstd) 
+       {
+         // Process the event with Kine information
+         fstd->SetESDSource(fESD);
+         if (mctruth) {
+           fstd->SetStackSource(fStack);
+           fstd->SetGenEventHeader(hdh);
+           fstd->SetInputType(AliFemtoEventReaderStandard::kESDKine);
+         }
+         else
+           fstd->SetInputType(AliFemtoEventReaderStandard::kESD);
+         fManager->ProcessEvent();
+       }
+    } 
+
+    // Post the output histogram list
+    PostData(0, fOutputList);
+  }
+
+  if (fAnalysisType==2) {    
+    if (!fAOD) {
+      AliWarning("fAOD not available");
+      return;
+    }
+
+    // Get AOD
+//     AliAODInputHandler *aodH = dynamic_cast<AliAODInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
+      
+//     if (!aodH) {
+//       AliWarning("Could not get AODInputHandler");
+//       return;
+//     } 
+//     else {
+
+//       fAOD = aodH->GetEvent();
+//     }
+
+    AliInfo(Form("Tracks in AOD: %d \n",fAOD->GetNumberOfTracks()));
+    
+    if (fAOD->GetNumberOfTracks() > 0) {
+      if (!fReader) {
+       AliWarning("No AOD reader for AOD analysis! \n");
+      }
+      else {
+       AliFemtoEventReaderAODChain* faodc = dynamic_cast<AliFemtoEventReaderAODChain *> (fReader);
+
+       if (faodc) {
+         // Process the event
+         faodc->SetAODSource(fAOD);
+         fManager->ProcessEvent();
+       }
+       AliFemtoEventReaderStandard* fstd = dynamic_cast<AliFemtoEventReaderStandard *> (fReader);
+
+       if (fstd) {
+         // Process the event
+         fstd->SetAODSource(fAOD);
+         fstd->SetInputType(AliFemtoEventReaderStandard::kAOD);
+         fManager->ProcessEvent();
+       }
+      }
+    } 
+
+    // Post the output histogram list
+    PostData(0, fOutputList);
+  }
+}      
+
+//________________________________________________________________________
+void AliAnalysisTaskFemto::Terminate(Option_t *) {
+  // Do the final processing
+  if (fManager) {
+    fManager->Finish();
+  }
+}
+//________________________________________________________________________
+void AliAnalysisTaskFemto:: FinishTaskOutput() {
+  // Do the final processing
+  if (fManager) {
+    fManager->Finish();
+  }
+}
+//________________________________________________________________________
+void AliAnalysisTaskFemto::SetFemtoReaderESD(AliFemtoEventReaderESDChain *aReader)
+{
+  AliInfo("Selecting Femto reader for ESD\n");
+  fReader = aReader;
+}
+//________________________________________________________________________
+void AliAnalysisTaskFemto::SetFemtoReaderESDKine(AliFemtoEventReaderESDChainKine *aReader)
+{
+  AliInfo("Selecting Femto reader for ESD with Kinematics information\n");
+  fReader = aReader;
+}
+//________________________________________________________________________
+void AliAnalysisTaskFemto::SetFemtoReaderAOD(AliFemtoEventReaderAODChain *aReader)
+{
+  AliInfo("Selecting Femto reader for AOD\n");
+  fReader = aReader;
+}
+void AliAnalysisTaskFemto::SetFemtoReaderStandard(AliFemtoEventReaderStandard *aReader)
+{
+  AliInfo("Selecting Standard all-purpose Femto reader\n");
+  fReader = aReader;
+}
+void AliAnalysisTaskFemto::SetFemtoReaderKinematics(AliFemtoEventReaderKinematicsChain *aReader)
+{
+  printf("Selecting Femto reader for Kinematics (Monte Carlo) information\n");
+  fReader = aReader;
+}
+//________________________________________________________________________
+void AliAnalysisTaskFemto::SetFemtoManager(AliFemtoManager *aManager)
+{
+  fManager = aManager;
+  AliInfo(Form("Got reader %p\n", (void *) aManager->EventReader()));
+  AliFemtoEventReaderESDChain     *tReaderESDChain     = dynamic_cast<AliFemtoEventReaderESDChain *> (aManager->EventReader());
+  AliFemtoEventReaderESDChainKine *tReaderESDChainKine = dynamic_cast<AliFemtoEventReaderESDChainKine *> (aManager->EventReader());
+  AliFemtoEventReaderAODChain     *tReaderAODChain     = dynamic_cast<AliFemtoEventReaderAODChain *> (aManager->EventReader());
+  AliFemtoEventReaderStandard     *tReaderStandard     = dynamic_cast<AliFemtoEventReaderStandard *> (aManager->EventReader());
+  AliFemtoEventReaderKinematicsChain *tReaderKineChain = dynamic_cast<AliFemtoEventReaderKinematicsChain *> (aManager->EventReader());
+
+ if ((!tReaderESDChain) && (!tReaderESDChainKine) && (!tReaderAODChain) && (!tReaderStandard) && (!tReaderKineChain)) {
+    AliWarning("No AliFemto event reader created. Will not run femto analysis.\n");
+    return;
+  }
+  if (tReaderESDChain) SetFemtoReaderESD(tReaderESDChain);
+  if (tReaderESDChainKine) SetFemtoReaderESDKine(tReaderESDChainKine);
+  if (tReaderAODChain) SetFemtoReaderAOD(tReaderAODChain);
+  if (tReaderStandard) SetFemtoReaderStandard(tReaderStandard);
+  if (tReaderKineChain) SetFemtoReaderKinematics(tReaderKineChain);
+}
+
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliAnalysisTaskFemto.h b/PWGCF/FEMTOSCOPY/AliFemto/AliAnalysisTaskFemto.h
new file mode 100644 (file)
index 0000000..711f450
--- /dev/null
@@ -0,0 +1,78 @@
+//------------------------------------------------------
+// AliAnalysisTaskFemto - A task for the analysis framework
+// from the FEMTOSCOPY analysis of PWG2. Creates the necessary
+// connection between the ESD or AOD input and the femtoscopic
+// code.
+// Author: Adam Kisiel, OSU; Adam.Kisiel@cern.ch
+//------------------------------------------------------
+#ifndef ALIANALYSISTASKFEMTO_H
+#define ALIANALYSISTASKFEMTO_H
+
+#include "TH1.h"
+
+#include "AliESDInputHandler.h"
+#include "AliAODHandler.h"
+#include "AliAODInputHandler.h"
+#include "AliMCEventHandler.h"
+#include "AliESDEvent.h"
+#include "AliAODEvent.h"
+#include "AliMCEvent.h"
+
+#include "AliAnalysisTask.h"
+#include "AliAnalysisManager.h"
+#include "AliAnalysisDataContainer.h"
+
+#include "AliFemtoEventReaderESDChain.h"
+#include "AliFemtoEventReaderESDChainKine.h"
+#include "AliFemtoEventReaderAODChain.h"
+#include "AliFemtoEventReaderStandard.h"
+#include "AliFemtoEventReaderKinematicsChain.h"
+#include "AliFemtoManager.h"
+
+#include "AliESDpid.h"
+#include "AliAODpidUtil.h"
+
+
+class AliAnalysisTaskFemto : public AliAnalysisTask {
+ public:
+  AliAnalysisTaskFemto() : AliAnalysisTask(), fESD(0), fESDpid(0), fAOD(0), fAODpidUtil(0), fStack(0), fOutputList(0), fReader(0x0), fManager(0x0), fAnalysisType(0), fConfigMacro(0), fConfigParams(0) {}
+  AliAnalysisTaskFemto(const char *name, const char *aConfigMacro, const char *aConfigParams);
+  AliAnalysisTaskFemto(const char *name, const char *aConfigMacro);
+  AliAnalysisTaskFemto(const AliAnalysisTaskFemto& aFemtoTask);
+  virtual ~AliAnalysisTaskFemto();
+  
+  AliAnalysisTaskFemto& operator=(const AliAnalysisTaskFemto& aFemtoTask);
+
+  virtual void   ConnectInputData(Option_t *);
+  virtual void   CreateOutputObjects();
+  virtual void   Exec(Option_t *option);
+  virtual void   Terminate(Option_t *);
+  virtual void   FinishTaskOutput();
+
+  void SetFemtoReaderESD(AliFemtoEventReaderESDChain *aReader);
+  void SetFemtoReaderESDKine(AliFemtoEventReaderESDChainKine *aReader);
+  void SetFemtoReaderAOD(AliFemtoEventReaderAODChain *aReader);
+  void SetFemtoReaderStandard(AliFemtoEventReaderStandard *aReader);
+  void SetFemtoManager(AliFemtoManager *aManager);
+  void SetFemtoReaderKinematics(AliFemtoEventReaderKinematicsChain *aReader);
+
+ private:
+  AliESDEvent                 *fESD;          //! ESD object
+  AliESDpid                   *fESDpid;       //! ESDpid object
+  AliAODEvent                 *fAOD;          //! AOD object
+  AliAODpidUtil               *fAODpidUtil;   // AliAODpidUtil object
+
+  AliStack                    *fStack;        //! Stack from Kinematics
+  TList                       *fOutputList;   //  AliFemto results list
+  AliFemtoEventReader         *fReader;       //! Reference to the reader
+  AliFemtoManager             *fManager;      //! AliFemto top-level manager 
+  int                          fAnalysisType; //  Mark ESD of AOD analysis
+  char                        *fConfigMacro;  //  Config macro location
+  char                        *fConfigParams; //  Config macro parameters
+
+
+  ClassDef(AliAnalysisTaskFemto, 3); // example of analysis
+};
+
+#endif
+
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAODTrackCut.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAODTrackCut.cxx
new file mode 100644 (file)
index 0000000..2c60d50
--- /dev/null
@@ -0,0 +1,374 @@
+/***************************************************************************
+ *
+ * $Id: AliFemtoAODTrackCut.cxx 23733 2008-02-05 16:51:41Z akisiel $ 
+ *
+ * 
+ ***************************************************************************
+ *
+ * 
+ *              
+ *
+ ***************************************************************************
+ *
+ * $Log$
+ * Revision 1.3  2007/05/22 09:01:42  akisiel
+ * Add the possibiloity to save cut settings in the ROOT file
+ *
+ * Revision 1.2  2007/05/21 10:38:25  akisiel
+ * More coding rule conformance
+ *
+ * Revision 1.1  2007/05/16 10:25:06  akisiel
+ * Making the directory structure of AliFemtoUser flat. All files go into one common directory
+ *
+ * Revision 1.4  2007/05/03 09:46:10  akisiel
+ * Fixing Effective C++ warnings
+ *
+ * Revision 1.3  2007/04/27 07:25:59  akisiel
+ * Make revisions needed for compilation from the main AliRoot tree
+ *
+ * Revision 1.1.1.1  2007/04/25 15:38:41  panos
+ * Importing the HBT code dir
+ *
+ * Revision 1.4  2007-04-03 16:00:08  mchojnacki
+ * Changes to iprove memory managing
+ *
+ * Revision 1.3  2007/03/13 15:30:03  mchojnacki
+ * adding reader for simulated data
+ *
+ * Revision 1.2  2007/03/08 14:58:03  mchojnacki
+ * adding some alice stuff
+ *
+ * Revision 1.1.1.1  2007/03/07 10:14:49  mchojnacki
+ * First version on CVS
+ *
+ **************************************************************************/
+
+#include "AliFemtoAODTrackCut.h"
+#include <cstdio>
+
+#ifdef __ROOT__ 
+ClassImp(AliFemtoAODTrackCut)
+#endif
+
+
+// electron
+// 0.13 - 1.8
+// 0       7.594129e-02    8.256141e-03
+// 1       -5.535827e-01   8.170825e-02
+// 2       1.728591e+00    3.104210e-01
+// 3       -2.827893e+00   5.827802e-01
+// 4       2.503553e+00    5.736207e-01
+// 5       -1.125965e+00   2.821170e-01
+// 6       2.009036e-01    5.438876e-02
+
+// pion
+// 0.13 - 2.0
+// 0       1.063457e+00    8.872043e-03
+// 1       -4.222208e-01   2.534402e-02
+// 2       1.042004e-01    1.503945e-02
+
+// kaon
+// 0.18 - 2.0
+// 0       -7.289406e-02   1.686074e-03
+// 1       4.415666e-01    1.143939e-02
+// 2       -2.996790e-01   1.840964e-02
+// 3       6.704652e-02    7.783990e-03
+
+// proton
+// 0.26 - 2.0
+// 0       -3.730200e-02   2.347311e-03
+// 1       1.163684e-01    1.319316e-02
+// 2       8.354116e-02    1.997948e-02
+// 3       -4.608098e-02   8.336400e-03
+
+
+AliFemtoAODTrackCut::AliFemtoAODTrackCut() :
+    fCharge(0),
+    fLabel(0),
+    fMaxchiNdof(1000.0),
+    fMaxSigmaToVertex(1000.0),
+    fNTracksPassed(0),
+    fNTracksFailed(0),
+    fMostProbable(0)
+{
+  // Default constructor
+  fNTracksPassed = fNTracksFailed = 0;
+  fCharge = 0;  // takes both charges 0
+  fPt[0]=0.0;              fPt[1] = 100.0;//100
+  fRapidity[0]=-2;       fRapidity[1]=2;//-2 2
+  fPidProbElectron[0]=-1;fPidProbElectron[1]=2;
+  fPidProbPion[0]=-1;    fPidProbPion[1]=2;
+  fPidProbKaon[0]=-1;fPidProbKaon[1]=2;
+  fPidProbProton[0]=-1;fPidProbProton[1]=2;
+  fPidProbMuon[0]=-1;fPidProbMuon[1]=2;
+  fLabel=false;
+}
+//------------------------------
+AliFemtoAODTrackCut::~AliFemtoAODTrackCut(){
+  /* noop */
+}
+//------------------------------
+bool AliFemtoAODTrackCut::Pass(const AliFemtoTrack* track)
+{
+  // test the particle and return 
+  // true if it meets all the criteria
+  // false if it doesn't meet at least one of the criteria
+  float tMost[5];
+  
+  if (((track->ITSchi2() + track->TPCchi2())/(track->ITSncls() + track->TPCncls())) > fMaxchiNdof) {
+    return false;
+  }
+
+  if (fMaxSigmaToVertex < track->SigmaToVertex()) {
+    return false;
+  }
+  
+  if (fLabel)
+    {
+      //cout<<"labels"<<endl;
+      if(track->Label()<0)
+       {
+         fNTracksFailed++;
+         //   cout<<"No Go Through the cut"<<endl;
+         //  cout<<fLabel<<" Label="<<track->Label()<<endl;
+         return false;
+       }    
+    }
+  if (fCharge!=0)
+    {              
+      //cout<<"AliFemtoESD  cut ch "<<endl;
+      //cout<<fCharge<<" Charge="<<track->Charge()<<endl;
+      if (track->Charge()!= fCharge)   
+       {
+         fNTracksFailed++;
+         //  cout<<"No Go Through the cut"<<endl;
+         // cout<<fCharge<<" Charge="<<track->Charge()<<endl;
+         return false;
+       }
+    }
+  float tEnergy = ::sqrt(track->P().Mag2()+fMass*fMass);
+  float tRapidity = 0.5*::log((tEnergy+track->P().z())/(tEnergy-track->P().z()));
+  float tPt = ::sqrt((track->P().x())*(track->P().x())+(track->P().y())*(track->P().y()));
+  if ((tRapidity<fRapidity[0])||(tRapidity>fRapidity[1]))
+    {
+      fNTracksFailed++;
+      //cout<<"No Go Through the cut"<<endl;   
+      //cout<<fRapidity[0]<<" < Rapidity ="<<tRapidity<<" <"<<fRapidity[1]<<endl;
+      return false;
+    }
+  if ((tPt<fPt[0])||(tPt>fPt[1]))
+    {
+      fNTracksFailed++;
+      //cout<<"No Go Through the cut"<<endl;
+      //cout<<fPt[0]<<" < Pt ="<<Pt<<" <"<<fPt[1]<<endl;
+      return false;
+    }
+
+    
+  if ((track->PidProbElectron()<fPidProbElectron[0])||(track->PidProbElectron()>fPidProbElectron[1]))
+    {
+      fNTracksFailed++;
+      //cout<<"No Go Through the cut"<<endl;
+      //cout<<fPidProbElectron[0]<<" < e ="<<track->PidProbElectron()<<" <"<<fPidProbElectron[1]<<endl;
+      return false;
+    }
+  if ((track->PidProbPion()<fPidProbPion[0])||(track->PidProbPion()>fPidProbPion[1]))
+    {
+      fNTracksFailed++;
+      //cout<<"No Go Through the cut"<<endl;
+      //cout<<fPidProbPion[0]<<" < pi ="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
+      return false;
+    }
+  if ((track->PidProbKaon()<fPidProbKaon[0])||(track->PidProbKaon()>fPidProbKaon[1]))
+    {
+      fNTracksFailed++;
+      //cout<<"No Go Through the cut"<<endl;
+      //cout<<fPidProbKaon[0]<<" < k ="<<track->PidProbKaon()<<" <"<<fPidProbKaon[1]<<endl;
+      return false;
+    }
+  if ((track->PidProbProton()<fPidProbProton[0])||(track->PidProbProton()>fPidProbProton[1]))
+    {
+      fNTracksFailed++;
+      //cout<<"No Go Through the cut"<<endl;
+      //cout<<fPidProbProton[0]<<" < p  ="<<track->PidProbProton()<<" <"<<fPidProbProton[1]<<endl;
+      return false;
+    }
+  if ((track->PidProbMuon()<fPidProbMuon[0])||(track->PidProbMuon()>fPidProbMuon[1]))
+    {
+      fNTracksFailed++;
+      //cout<<"No Go Through the cut"<<endl;
+      //cout<<fPidProbMuon[0]<<" <  mi="<<track->PidProbMuon()<<" <"<<fPidProbMuon[1]<<endl;
+      return false;
+    }
+
+  if (fMostProbable) {
+    tMost[0] = track->PidProbElectron()*PidFractionElectron(track->P().Mag());
+    tMost[1] = 0.0;
+    tMost[2] = track->PidProbPion()*PidFractionPion(track->P().Mag());
+    tMost[3] = track->PidProbKaon()*PidFractionKaon(track->P().Mag());
+    tMost[4] = track->PidProbProton()*PidFractionProton(track->P().Mag());
+    int imost=0;
+    float ipidmax = 0.0;
+    for (int ip=0; ip<5; ip++)
+      if (tMost[ip] > ipidmax) { ipidmax = tMost[ip]; imost = ip; };
+    if (imost != fMostProbable) return false;
+  }
+  
+  // cout<<"Go Through the cut"<<endl;
+  // cout<<fLabel<<" Label="<<track->Label()<<endl;
+  // cout<<fCharge<<" Charge="<<track->Charge()<<endl;
+  // cout<<fPt[0]<<" < Pt ="<<Pt<<" <"<<fPt[1]<<endl;
+  //cout<<fRapidity[0]<<" < Rapidity ="<<tRapidity<<" <"<<fRapidity[1]<<endl;
+  //cout<<fPidProbElectron[0]<<" <  e="<<track->PidProbElectron()<<" <"<<fPidProbElectron[1]<<endl;
+  //cout<<fPidProbPion[0]<<" <  pi="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
+  //cout<<fPidProbKaon[0]<<" <  k="<<track->PidProbKaon()<<" <"<<fPidProbKaon[1]<<endl;
+  //cout<<fPidProbProton[0]<<" <  p="<<track->PidProbProton()<<" <"<<fPidProbProton[1]<<endl;
+  //cout<<fPidProbMuon[0]<<" <  mi="<<track->PidProbMuon()<<" <"<<fPidProbMuon[1]<<endl;
+  fNTracksPassed++ ;
+  return true;
+    
+    
+}
+//------------------------------
+AliFemtoString AliFemtoAODTrackCut::Report()
+{
+  // Prepare report from the execution
+  string tStemp;
+  char tCtemp[100];
+  snprintf(tCtemp , 100, "Particle mass:\t%E\n",this->Mass());
+  tStemp=tCtemp;
+  snprintf(tCtemp , 100, "Particle charge:\t%d\n",fCharge);
+  tStemp+=tCtemp;
+  snprintf(tCtemp , 100, "Particle pT:\t%E - %E\n",fPt[0],fPt[1]);
+  tStemp+=tCtemp;
+  snprintf(tCtemp , 100, "Particle rapidity:\t%E - %E\n",fRapidity[0],fRapidity[1]);
+  tStemp+=tCtemp;
+  snprintf(tCtemp , 100, "Number of tracks which passed:\t%ld  Number which failed:\t%ld\n",fNTracksPassed,fNTracksFailed);
+  tStemp += tCtemp;
+  AliFemtoString returnThis = tStemp;
+  return returnThis;
+}
+TList *AliFemtoAODTrackCut::ListSettings()
+{
+  // return a list of settings in a writable form
+  TList *tListSetttings = new TList();
+  char buf[200];
+  snprintf(buf, 200, "AliFemtoAODTrackCut.mass=%f", this->Mass());
+  tListSetttings->AddLast(new TObjString(buf));
+
+  snprintf(buf, 200, "AliFemtoAODTrackCut.charge=%i", fCharge);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoAODTrackCut.pidprobpion.minimum=%f", fPidProbPion[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoAODTrackCut.pidprobpion.maximum=%f", fPidProbPion[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoAODTrackCut.pidprobkaon.minimum=%f", fPidProbKaon[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoAODTrackCut.pidprobkaon.maximum=%f", fPidProbKaon[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoAODTrackCut.pidprobproton.minimum=%f", fPidProbProton[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoAODTrackCut.pidprobproton.maximum=%f", fPidProbProton[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoAODTrackCut.pidprobelectron.minimum=%f", fPidProbElectron[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoAODTrackCut.pidprobelectron.maximum=%f", fPidProbElectron[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoAODTrackCut.pidprobMuon.minimum=%f", fPidProbMuon[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoAODTrackCut.pidprobMuon.maximum=%f", fPidProbMuon[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoAODTrackCut.pt.minimum=%f", fPt[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoAODTrackCut.pt.maximum=%f", fPt[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoAODTrackCut.rapidity.minimum=%f", fRapidity[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoAODTrackCut.rapidity.maximum=%f", fRapidity[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoAODTrackCut.maxchindof=%f", fMaxchiNdof);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoAODTrackCut.maxsigmatovertex=%f", fMaxSigmaToVertex);
+  tListSetttings->AddLast(new TObjString(buf));
+  if (fMostProbable) {
+    if (fMostProbable == 2)
+      snprintf(buf, 200, "AliFemtoAODTrackCut.mostprobable=%s", "Pion");
+    if (fMostProbable == 3)
+      snprintf(buf, 200, "AliFemtoAODTrackCut.mostprobable=%s", "Kaon");
+    if (fMostProbable == 4)
+      snprintf(buf, 200, "AliFemtoAODTrackCut.mostprobable=%s", "Proton");
+    tListSetttings->AddLast(new TObjString(buf));
+  }
+  return tListSetttings;
+}
+                           // electron
+// 0.13 - 1.8
+// 0       7.594129e-02    8.256141e-03
+// 1       -5.535827e-01   8.170825e-02
+// 2       1.728591e+00    3.104210e-01
+// 3       -2.827893e+00   5.827802e-01
+// 4       2.503553e+00    5.736207e-01
+// 5       -1.125965e+00   2.821170e-01
+// 6       2.009036e-01    5.438876e-02
+float AliFemtoAODTrackCut::PidFractionElectron(float mom) const
+{
+  // Provide a parameterized fraction of electrons dependent on momentum
+  if (mom<0.13) return 0.0;
+  if (mom>1.8) return 0.0;
+  return (7.594129e-02 
+         -5.535827e-01*mom        
+         +1.728591e+00*mom*mom    
+         -2.827893e+00*mom*mom*mom 
+         +2.503553e+00*mom*mom*mom*mom    
+         -1.125965e+00*mom*mom*mom*mom*mom      
+         +2.009036e-01*mom*mom*mom*mom*mom*mom);   
+}
+
+// pion
+// 0.13 - 2.0
+// 0       1.063457e+00    8.872043e-03
+// 1       -4.222208e-01   2.534402e-02
+// 2       1.042004e-01    1.503945e-02
+float AliFemtoAODTrackCut::PidFractionPion(float mom) const
+{
+  // Provide a parameterized fraction of pions dependent on momentum
+  if (mom<0.13) return 0.0;
+  if (mom>2.0) return 0.0;
+  return ( 1.063457e+00
+          -4.222208e-01*mom
+          +1.042004e-01*mom*mom);
+}
+
+// kaon
+// 0.18 - 2.0
+// 0       -7.289406e-02   1.686074e-03
+// 1       4.415666e-01    1.143939e-02
+// 2       -2.996790e-01   1.840964e-02
+// 3       6.704652e-02    7.783990e-03
+float AliFemtoAODTrackCut::PidFractionKaon(float mom) const
+{
+  // Provide a parameterized fraction of kaons dependent on momentum
+  if (mom<0.18) return 0.0;
+  if (mom>2.0) return 0.0;
+  return (-7.289406e-02
+         +4.415666e-01*mom        
+         -2.996790e-01*mom*mom    
+         +6.704652e-02*mom*mom*mom);
+}
+
+// proton
+// 0.26 - 2.0
+// 0       -3.730200e-02   2.347311e-03
+// 1       1.163684e-01    1.319316e-02
+// 2       8.354116e-02    1.997948e-02
+// 3       -4.608098e-02   8.336400e-03
+float AliFemtoAODTrackCut::PidFractionProton(float mom) const
+{
+  // Provide a parameterized fraction of protons dependent on momentum
+  if (mom<0.26) return  0.0;
+  if (mom>2.0) return 0.0;
+  return (-3.730200e-02  
+         +1.163684e-01*mom           
+         +8.354116e-02*mom*mom       
+         -4.608098e-02*mom*mom*mom);  
+}
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAODTrackCut.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAODTrackCut.h
new file mode 100644 (file)
index 0000000..4d7454c
--- /dev/null
@@ -0,0 +1,94 @@
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// AliFemtoAODTrackCut: A basic track cut that used information from     //
+// ALICE AOD to accept or reject the track.                              //  
+// Enables the selection on charge, transverse momentum, rapidity,       //
+// pid probabilities, number of ITS and TPC clusters                     //
+// Author: Adam Kisiel (WUT, OSU), Adam.Kisiel@cern.ch                   //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+
+#ifndef ALIFEMTOAODTRACKCUT_H
+#define ALIFEMTOAODTRACKCUT_H
+
+//#ifndef StMaker_H
+//#include "StMaker.h"
+//#endif
+
+#include "AliFemtoTrackCut.h"
+
+class AliFemtoAODTrackCut : public AliFemtoTrackCut 
+{
+
+ public:
+  AliFemtoAODTrackCut();
+  virtual ~AliFemtoAODTrackCut();
+
+  virtual bool Pass(const AliFemtoTrack* aTrack);
+
+  virtual AliFemtoString Report();
+  virtual TList *ListSettings();
+  virtual AliFemtoParticleType Type(){return hbtTrack;}
+
+  void SetPt(const float& lo, const float& hi);
+  void SetRapidity(const float& lo, const float& hi);
+  void SetCharge(const int& ch);
+  void SetPidProbElectron(const float& lo, const float& hi);
+  void SetPidProbPion(const float& lo, const float& hi);
+  void SetPidProbKaon(const float& lo, const float& hi);
+  void SetPidProbProton(const float& lo, const float& hi);
+  void SetPidProbMuon(const float& lo, const float& hi);
+  void SetLabel(const bool& flag);
+  void SetMaxChiNdof(const float& maxchi);
+  void SetMaxSigmaToVertex(const float& maxsig);
+  void SetMostProbablePion();
+  void SetMostProbableKaon();
+  void SetMostProbableProton();
+  void SetNoMostProbable(); 
+
+ private:   // here are the quantities I want to cut on...
+
+  int               fCharge;             // particle charge
+  float             fPt[2];              // bounds for transverse momentum
+  float             fRapidity[2];        // bounds for rapidity
+  float             fPidProbElectron[2]; // bounds for electron probability
+  float             fPidProbPion[2];     // bounds for pion probability
+  float             fPidProbKaon[2];     // bounds for kaon probability
+  float             fPidProbProton[2];   // bounds for proton probability
+  float             fPidProbMuon[2];     // bounds for muon probability 
+  bool              fLabel;              // if true label<0 will not pass throught 
+  float             fMaxchiNdof;         // maximum allowed chi2/ndof for TPC clusters
+  float             fMaxSigmaToVertex;   // maximum allowed sigma to primary vertex
+  long              fNTracksPassed;      // passed tracks count
+  long              fNTracksFailed;      // failed tracks count
+  int               fMostProbable;       // this particle type is required to be most probable
+
+  float PidFractionElectron(float mom) const;
+  float PidFractionPion(float mom) const;
+  float PidFractionKaon(float mom) const;
+  float PidFractionProton(float mom) const;
+
+#ifdef __ROOT__ 
+  ClassDef(AliFemtoAODTrackCut, 1)
+#endif
+    };
+
+
+inline void AliFemtoAODTrackCut::SetPt(const float& lo, const float& hi){fPt[0]=lo; fPt[1]=hi;}
+inline void AliFemtoAODTrackCut::SetRapidity(const float& lo,const float& hi){fRapidity[0]=lo; fRapidity[1]=hi;}
+inline void AliFemtoAODTrackCut::SetCharge(const int& ch){fCharge = ch;}
+inline void AliFemtoAODTrackCut::SetPidProbElectron(const float& lo,const float& hi){fPidProbElectron[0]=lo; fPidProbElectron[1]=hi;}
+inline void AliFemtoAODTrackCut::SetPidProbPion(const float& lo,const float& hi){fPidProbPion[0]=lo; fPidProbPion[1]=hi;}
+inline void AliFemtoAODTrackCut::SetPidProbKaon(const float& lo,const float& hi){fPidProbKaon[0]=lo; fPidProbKaon[1]=hi;}
+inline void AliFemtoAODTrackCut::SetPidProbProton(const float& lo,const float& hi){fPidProbProton[0]=lo; fPidProbProton[1]=hi;}
+inline void AliFemtoAODTrackCut::SetPidProbMuon(const float& lo,const float& hi){fPidProbMuon[0]=lo; fPidProbMuon[1]=hi;}
+inline void AliFemtoAODTrackCut::SetLabel(const bool& flag){fLabel=flag;}
+inline void AliFemtoAODTrackCut::SetMostProbablePion() { fMostProbable = 2; }
+inline void AliFemtoAODTrackCut::SetMostProbableKaon() { fMostProbable = 3; }
+inline void AliFemtoAODTrackCut::SetMostProbableProton() { fMostProbable = 4; }
+inline void AliFemtoAODTrackCut::SetNoMostProbable() { fMostProbable = 0; }
+inline void AliFemtoAODTrackCut::SetMaxChiNdof(const float& maxchi) { fMaxchiNdof = maxchi; }
+inline void AliFemtoAODTrackCut::SetMaxSigmaToVertex(const float& maxsig) { fMaxSigmaToVertex = maxsig; }
+
+#endif
+
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysis.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysis.h
new file mode 100644 (file)
index 0000000..8a98627
--- /dev/null
@@ -0,0 +1,32 @@
+////////////////////////////////////////////////////////////////////////////////
+/// AliFemtoAnalysis - the pure virtual base class for femto analysis        ///
+/// All analysis classes must inherit from this one                          ///
+////////////////////////////////////////////////////////////////////////////////
+#ifndef AliFemtoAnalysis_hh
+#define AliFemtoAnalysis_hh
+
+#include "AliFemtoTypes.h"
+#include <TList.h>
+#include <TObjString.h>
+
+class AliFemtoEvent;
+
+class AliFemtoAnalysis{
+
+public:
+
+  AliFemtoAnalysis() { /* noop */ };
+  virtual ~AliFemtoAnalysis() { /* noop */ };
+
+  
+  virtual AliFemtoString Report() = 0;       //! returns reports of all cuts applied and correlation functions being done
+  virtual TList* ListSettings() = 0;         // return list of cut settings for the analysis
+
+  virtual TList* GetOutputList() = 0;        // Return a TList of objects to be written as output
+  virtual void ProcessEvent(const AliFemtoEvent* aEventToAnalyze) = 0;
+
+  virtual void Finish() = 0;
+
+};
+
+#endif
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisAzimuthal.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisAzimuthal.cxx
new file mode 100644 (file)
index 0000000..38cf4d2
--- /dev/null
@@ -0,0 +1,469 @@
+////////////////////////////////////////////////////////////////////////////
+//                                                                        //
+// AliFemtoAnalysisReactionPlane - Femtoscopic analysis which mixes event //
+// with respect to the z position of the primary vertex and event total   //
+// multiplicity and uses only events in certain reaction plane angle bin  //
+//                                                                        //
+////////////////////////////////////////////////////////////////////////////
+
+#include "AliFemtoAnalysisAzimuthal.h"
+#include <TMath.h>
+#include <string>
+#include <cstdio>
+#include "AliFemtoParticleCollection.h"
+#include "AliFemtoTrackCut.h"
+#include "AliFemtoV0Cut.h"
+#include "AliFemtoPairCut.h"
+#include "TVector2.h"
+#include "AliFemtoKinkCut.h"
+#include "AliFemtoPicoEventCollectionVector.h"
+#include "AliFemtoPicoEventCollectionVectorHideAway.h"
+
+#ifdef __ROOT__ 
+ClassImp(AliFemtoAnalysisAzimuthal)
+#endif
+
+extern void FillHbtParticleCollection(AliFemtoParticleCut*         partCut,
+                                     AliFemtoEvent*               hbtEvent,
+                                     AliFemtoParticleCollection*  partCollection);
+
+
+//____________________________
+AliFemtoAnalysisAzimuthal::AliFemtoAnalysisAzimuthal(unsigned int binsVertex, double minVertex, double maxVertex,
+                                                      unsigned int binsMult, double minMult, double maxMult, unsigned short binsRP) 
+  : 
+  fFemtoParticleCut(0),
+  fFlowParticleCut(0),
+  fVertexZBins(binsVertex), 
+  fOverFlowVertexZ(0), 
+  fUnderFlowVertexZ(0),
+  fMultBins(binsMult) ,
+  fOverFlowMult(0),    
+  fUnderFlowMult(0),
+  fRPBins(binsRP),
+  fPsi(0)
+{
+  //  mControlSwitch     = 0;
+  fCorrFctnCollection= 0;
+  fCorrFctnCollection = new AliFemtoCorrFctnCollection;
+  fVertexZ[0] = minVertex;
+  fVertexZ[1] = maxVertex;
+  fMult[0] = minMult;
+  fMult[1] = maxMult;
+  if (fMixingBuffer) delete fMixingBuffer;
+  fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexZBins,fVertexZ[0],fVertexZ[1],
+                                                                                    fMultBins,fMult[0],fMult[1],
+                                                                                    fRPBins,0.0,TMath::Pi());
+}
+
+//____________________________
+
+AliFemtoAnalysisAzimuthal::AliFemtoAnalysisAzimuthal(const AliFemtoAnalysisAzimuthal& a) : 
+  AliFemtoSimpleAnalysis(),
+  fFemtoParticleCut(0),
+  fFlowParticleCut(0),
+  fVertexZBins(a.fVertexZBins), 
+  fOverFlowVertexZ(0), 
+  fUnderFlowVertexZ(0),
+  fMultBins(a.fMultBins) ,
+  fOverFlowMult(0),    
+  fUnderFlowMult(0),
+  fRPBins(a.fRPBins),
+  fPsi(0)
+
+{
+  fCorrFctnCollection= 0;
+  fCorrFctnCollection = new AliFemtoCorrFctnCollection;
+  fVertexZ[0] = a.fVertexZ[0]; 
+  fVertexZ[1] = a.fVertexZ[1];
+  fMult[0] = a.fMult[0]; 
+  fMult[1] = a.fMult[1];
+  if (fMixingBuffer) delete fMixingBuffer;
+  fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexZBins,fVertexZ[0],fVertexZ[1],
+                                                                                    fMultBins,fMult[0],fMult[1],
+                                                                                    fRPBins,0.0,TMath::Pi());
+  // find the right event cut
+  fEventCut = a.fEventCut->Clone();
+  // find the right femto particle cut
+  fFemtoParticleCut = a.fFemtoParticleCut->Clone();
+  // find the right flow particle cut
+  fFlowParticleCut = a.fFlowParticleCut->Clone();
+  // find the right pair cut
+  fPairCut = a.fPairCut->Clone();
+  
+  if ( fEventCut ) {
+      SetEventCut(fEventCut); // this will set the myAnalysis pointer inside the cut
+      cout << " AliFemtoAnalysisAzimuthal::AliFemtoAnalysisAzimuthal(const AliFemtoAnalysisAzimuthal& a) - event cut set " << endl;
+  }
+  if ( fFemtoParticleCut ) {
+      SetFirstParticleCut(fFemtoParticleCut); // this will set the myAnalysis pointer inside the cut
+      cout << " AliFemtoAnalysisAzimuthal::AliFemtoAnalysisAzimuthal(const AliFemtoAnalysisAzimuthal& a) - femto particle cut set " << endl;
+  }
+  if ( fFlowParticleCut ) {
+      SetSecondParticleCut(fFlowParticleCut); // this will set the myAnalysis pointer inside the cut
+      cout << " AliFemtoAnalysisAzimuthal::AliFemtoAnalysisAzimuthal(const AliFemtoAnalysisAzimuthal& a) - flow particle cut set " << endl;
+  }
+  if ( fPairCut ) {
+      SetPairCut(fPairCut); // this will set the myAnalysis pointer inside the cut
+      cout << " AliFemtoAnalysisAzimuthal::AliFemtoAnalysisAzimuthal(const AliFemtoAnalysisAzimuthal& a) - pair cut set " << endl;
+  }
+
+  AliFemtoCorrFctnIterator iter;
+  for (iter=a.fCorrFctnCollection->begin(); iter!=a.fCorrFctnCollection->end();iter++){
+    cout << " AliFemtoAnalysisAzimuthal::AliFemtoAnalysisAzimuthal(const AliFemtoAnalysisAzimuthal& a) - looking for correlation functions " << endl;
+    AliFemtoCorrFctn* fctn = (*iter)->Clone();
+    if (fctn) AddCorrFctn(fctn);
+    else cout << " AliFemtoAnalysisAzimuthal::AliFemtoAnalysisAzimuthal(const AliFemtoAnalysisAzimuthal& a) - correlation function not found " << endl;
+  }
+  fNumEventsToMix = a.fNumEventsToMix;
+  cout << " AliFemtoAnalysisAzimuthal::AliFemtoAnalysisAzimuthal(const AliFemtoAnalysisAzimuthal& a) - analysis copied " << endl;
+}
+
+AliFemtoAnalysisAzimuthal& AliFemtoAnalysisAzimuthal::operator=(const AliFemtoAnalysisAzimuthal& a)
+{
+  // Assignment operator
+  if (this == &a)
+    return *this;
+
+  fCorrFctnCollection= 0;
+  fCorrFctnCollection = new AliFemtoCorrFctnCollection;
+  fVertexZ[0] = a.fVertexZ[0]; 
+  fVertexZ[1] = a.fVertexZ[1];
+  fMult[0] = a.fMult[0]; 
+  fMult[1] = a.fMult[1];
+  if (fMixingBuffer) delete fMixingBuffer;
+  fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexZBins,fVertexZ[0],fVertexZ[1],
+                                                                                    fMultBins,fMult[0],fMult[1],
+                                                                                    fRPBins,0.0,TMath::Pi());
+  // find the right event cut
+  fEventCut = a.fEventCut->Clone();
+  // find the right femto particle cut
+  fFemtoParticleCut = a.fFemtoParticleCut->Clone();
+  // find the right flow particle cut
+  fFlowParticleCut = a.fFlowParticleCut->Clone();
+  // find the right pair cut
+  fPairCut = a.fPairCut->Clone();
+  
+  if ( fEventCut ) {
+      SetEventCut(fEventCut); // this will set the myAnalysis pointer inside the cut
+      cout << " AliFemtoAnalysisAzimuthal::AliFemtoAnalysisAzimuthal(const AliFemtoAnalysisAzimuthal& a) - event cut set " << endl;
+  }
+  if ( fFemtoParticleCut ) {
+      SetFirstParticleCut(fFemtoParticleCut); // this will set the myAnalysis pointer inside the cut
+      cout << " AliFemtoAnalysisAzimuthal::AliFemtoAnalysisAzimuthal(const AliFemtoAnalysisAzimuthal& a) - femto particle cut set " << endl;
+  }
+  if ( fFlowParticleCut ) {
+      SetSecondParticleCut(fFlowParticleCut); // this will set the myAnalysis pointer inside the cut
+      cout << " AliFemtoAnalysisAzimuthal::AliFemtoAnalysisAzimuthal(const AliFemtoAnalysisAzimuthal& a) - flow particle cut set " << endl;
+  }
+  if ( fPairCut ) {
+      SetPairCut(fPairCut); // this will set the myAnalysis pointer inside the cut
+      cout << " AliFemtoAnalysisAzimuthal::AliFemtoAnalysisAzimuthal(const AliFemtoAnalysisAzimuthal& a) - pair cut set " << endl;
+  }
+
+  AliFemtoCorrFctnIterator iter;
+  for (iter=a.fCorrFctnCollection->begin(); iter!=a.fCorrFctnCollection->end();iter++){
+    cout << " AliFemtoAnalysisAzimuthal::AliFemtoAnalysisAzimuthal(const AliFemtoAnalysisAzimuthal& a) - looking for correlation functions " << endl;
+    AliFemtoCorrFctn* fctn = (*iter)->Clone();
+    if (fctn) AddCorrFctn(fctn);
+    else cout << " AliFemtoAnalysisAzimuthal::AliFemtoAnalysisAzimuthal(const AliFemtoAnalysisAzimuthal& a) - correlation function not found " << endl;
+  }
+  fNumEventsToMix = a.fNumEventsToMix;
+  cout << " AliFemtoAnalysisAzimuthal::AliFemtoAnalysisAzimuthal(const AliFemtoAnalysisAzimuthal& a) - analysis copied " << endl;
+
+  return *this;
+  
+}
+
+//____________________________
+AliFemtoAnalysisAzimuthal::~AliFemtoAnalysisAzimuthal(){
+  // now delete every PicoEvent in the EventMixingBuffer and then the Buffer itself
+  delete fPicoEventCollectionVectorHideAway;
+}
+
+//_________________________
+void AliFemtoAnalysisAzimuthal::ProcessEvent(const AliFemtoEvent* hbtEvent) {
+  // Perform event processing in bins of z vertex, multiplicity and Reaction Plane angle
+  // cout << " AliFemtoAnalysisAzimuthal::ProcessEvent(const AliFemtoEvent* hbtEvent) " << endl;
+
+  //****from AliFemtoSimpleAnalysis****
+
+  fPicoEvent=0; // we will get a new pico event, if not prevent corr. fctn to access old pico event
+  fNeventsProcessed++;
+
+  // startup for EbyE 
+  fFemtoParticleCut->EventBegin(hbtEvent);
+  fFlowParticleCut->EventBegin(hbtEvent);
+  fPairCut->EventBegin(hbtEvent);
+
+  for (AliFemtoCorrFctnIterator iter=fCorrFctnCollection->begin(); iter!=fCorrFctnCollection->end();iter++){
+    (*iter)->EventBegin(hbtEvent);
+  }
+
+  // event cut and event cut monitor
+  bool tmpPassEvent = fEventCut->Pass(hbtEvent);
+  if (!tmpPassEvent) 
+    fEventCut->FillCutMonitor(hbtEvent, tmpPassEvent);
+  if (tmpPassEvent) {
+    fPicoEvent = new AliFemtoPicoEvent; // this is what we will make pairs from and put in Mixing Buffer, no memory leak. we will delete picoevents when they come out of the mixing buffer
+    FillHbtParticleCollection(fFemtoParticleCut,(AliFemtoEvent*)hbtEvent,fPicoEvent->FirstParticleCollection());
+    FillHbtParticleCollection(fFlowParticleCut,(AliFemtoEvent*)hbtEvent,fPicoEvent->SecondParticleCollection());
+    
+      // get right mixing buffer
+  double vertexZ = hbtEvent->PrimVertPos().z();
+  double mult = hbtEvent->UncorrectedNumberOfPrimaries();
+  TVector2 tQ = GetQVector(fPicoEvent->SecondParticleCollection());
+  double tPsi=tQ.Phi()/2.;
+  if (tPsi > TMath::Pi()) tPsi -= TMath::Pi();
+      
+   fMixingBuffer = fPicoEventCollectionVectorHideAway->PicoEventCollection(vertexZ,mult,fPsi); 
+  if (!fMixingBuffer) {
+    if ( vertexZ < fVertexZ[0] ) fUnderFlowVertexZ++;
+    if ( vertexZ > fVertexZ[1] ) fOverFlowVertexZ++;
+    if ( mult < fMult[0] ) fUnderFlowMult++;
+    if ( mult > fMult[1] ) fOverFlowMult++;
+    return;
+  }   
+    
+    //cout << "#particles in Collection: " << fPicoEvent->FirstParticleCollection()->size() << endl;
+    
+    //switch which allows only using events with ParticleCollections containing a minimum number of entries
+    if (fPicoEvent->FirstParticleCollection()->size() >= fMinSizePartCollection ) {
+      fEventCut->FillCutMonitor(hbtEvent, tmpPassEvent);
+    }
+
+      //------ Make real pairs (assume identical) ------//
+      MakePairs("real", fPicoEvent->FirstParticleCollection() );
+      //cout << "AliFemtoAnalysisAzimuthal::ProcessEvent() - reals done ";
+
+      //---- Make pairs for mixed events, looping over events in mixingBuffer ----//
+      AliFemtoPicoEvent* storedEvent;
+      AliFemtoPicoEventIterator fPicoEventIter;
+      for (fPicoEventIter=MixingBuffer()->begin();fPicoEventIter!=MixingBuffer()->end();fPicoEventIter++){
+        storedEvent = *fPicoEventIter;
+        MakePairs("mixed",fPicoEvent->FirstParticleCollection(),
+                            storedEvent->FirstParticleCollection() );
+      }
+      //cout << " - mixed done   " << endl;
+
+      //--------- If mixing buffer is full, delete oldest event ---------//
+      if ( MixingBufferFull() ) {
+        delete MixingBuffer()->back();
+        MixingBuffer()->pop_back();
+      }
+
+      //-------- Add current event (fPicoEvent) to mixing buffer --------//
+      MixingBuffer()->push_front(fPicoEvent);
+
+    }  // if ParticleCollections are big enough (mal jun2002)
+    else{
+      fEventCut->FillCutMonitor(hbtEvent, !tmpPassEvent);
+      delete fPicoEvent;
+    }
+
+  // if currentEvent is accepted by currentAnalysis cleanup for EbyE 
+  fFemtoParticleCut->EventEnd(hbtEvent);
+  fFlowParticleCut->EventEnd(hbtEvent);
+  fPairCut->EventEnd(hbtEvent);
+  for (AliFemtoCorrFctnIterator iter=fCorrFctnCollection->begin(); iter!=fCorrFctnCollection->end();iter++){
+    (*iter)->EventEnd(hbtEvent);
+  } 
+}
+
+//_______________________________________________________________________________
+void AliFemtoAnalysisAzimuthal::MakePairs(const char* typeIn, AliFemtoParticleCollection *partCollection1,
+                                      AliFemtoParticleCollection *partCollection2){
+// Build pairs, check pair cuts, and call CFs' AddRealPair() or AddMixedPair() methods. 
+// If no second particle collection is specfied, make pairs within first particle collection.
+
+  string type = typeIn;
+
+  //  int swpart = ((long int) partCollection1) % 2;
+  int swpart = fNeventsProcessed % 2;
+
+  AliFemtoPair* tPair = new AliFemtoPair;
+  AliFemtoCorrFctnIterator tCorrFctnIter;
+  AliFemtoParticleIterator tPartIter1, tPartIter2;
+
+  AliFemtoParticleIterator tStartOuterLoop = partCollection1->begin();  // always
+  AliFemtoParticleIterator tEndOuterLoop   = partCollection1->end();    // will be one less if identical
+  AliFemtoParticleIterator tStartInnerLoop;
+  AliFemtoParticleIterator tEndInnerLoop;
+  if (partCollection2) {                         //   Two collections:
+    tStartInnerLoop = partCollection2->begin();  //   Full inner & outer loops
+    tEndInnerLoop   = partCollection2->end();    
+  }
+  else {                                         //   One collection:
+    tEndOuterLoop--;                             //   Outer loop goes to next-to-last particle
+    tEndInnerLoop = partCollection1->end() ;     //   Inner loop goes to last particle
+  }
+  for (tPartIter1=tStartOuterLoop;tPartIter1!=tEndOuterLoop;tPartIter1++) {
+    if (!partCollection2){
+      tStartInnerLoop = tPartIter1;
+      tStartInnerLoop++;
+    }
+    tPair->SetTrack1(*tPartIter1);
+    for (tPartIter2 = tStartInnerLoop; tPartIter2!=tEndInnerLoop;tPartIter2++) {
+      tPair->SetTrack2(*tPartIter2);
+
+//For getting the pair angle wrt EP
+  if (type == "real"){
+       TVector2 tQ, tQVector;
+       float tPsi=0, mQx=0, mQy=0, PairAngleEP=0;
+       tQ = GetQVector(partCollection1);
+
+       mQx = tQ.X() - cos(2*(tPair->Track1()->FourMomentum().Phi()))*(tPair->Track1()->Track()->Pt()) - cos(2*(tPair->Track2()->FourMomentum().Phi()))*(tPair->Track2()->Track()->Pt());
+       mQy = tQ.Y() - sin(2*(tPair->Track1()->FourMomentum().Phi()))*(tPair->Track1()->Track()->Pt()) - sin(2*(tPair->Track2()->FourMomentum().Phi()))*(tPair->Track2()->Track()->Pt());
+  
+       tQVector.Set(mQx,mQy);
+
+       tPsi=tQVector.Phi()/2.;
+       if (tPsi > TMath::Pi()) tPsi -= TMath::Pi();
+
+       PairAngleEP = (tPair->EmissionAngle() - tPsi);
+       tPair->SetPairAngleEP(PairAngleEP);
+  }
+
+  if (type == "mixed"){
+       float tPsi1=0, tPsi2=0, mQx1=0, mQx2=0,mQy1=0, mQy2=0, px1=0, px2=0, py1=0, py2=0, PairAngleEP=0;
+       TVector2 tQ1, tQ2, tQVector1, tQVector2, tP;
+
+       tQ1 = GetQVector(partCollection1);
+       tQ2 = GetQVector(partCollection2);
+
+       mQx1 = tQ1.X() - cos(2*(tPair->Track1()->FourMomentum().Phi()))*(tPair->Track1()->Track()->Pt());
+       mQx2 = tQ2.X() - cos(2*(tPair->Track2()->FourMomentum().Phi()))*(tPair->Track2()->Track()->Pt());
+       mQy1 = tQ1.Y() - sin(2*(tPair->Track1()->FourMomentum().Phi()))*(tPair->Track1()->Track()->Pt());
+       mQy2 = tQ2.Y() - sin(2*(tPair->Track2()->FourMomentum().Phi()))*(tPair->Track2()->Track()->Pt());
+  
+       tQVector1.Set(mQx1,mQy1);
+       tQVector2.Set(mQx2,mQy2);
+
+       tPsi1=tQVector1.Phi()/2.;
+       if (tPsi1 > TMath::Pi()) tPsi1 -= TMath::Pi();
+
+       tPsi2=tQVector2.Phi()/2.;
+       if (tPsi2 > TMath::Pi()) tPsi2 -= TMath::Pi();
+
+       px1 = (tPair->Track1()->Track()->Pt())*cos(tPair->Track1()->FourMomentum().Phi() - tPsi1);
+       px2 = (tPair->Track2()->Track()->Pt())*cos(tPair->Track2()->FourMomentum().Phi() - tPsi2);
+       py1 = (tPair->Track1()->Track()->Pt())*sin(tPair->Track1()->FourMomentum().Phi() - tPsi1);
+       py2 = (tPair->Track2()->Track()->Pt())*sin(tPair->Track2()->FourMomentum().Phi() - tPsi2);
+
+       tP.Set(px1+px2, py1+py2);
+       PairAngleEP = tP.Phi();
+
+       tPair->SetPairAngleEP(PairAngleEP);
+  }
+
+      // The following lines have to be uncommented if you want pairCutMonitors
+      // they are not in for speed reasons
+      // bool tmpPassPair = fPairCut->Pass(tPair);
+      // fPairCut->FillCutMonitor(tPair, tmpPassPair);
+      // if ( tmpPassPair )
+
+      //---- If pair passes cut, loop over CF's and add pair to real/mixed ----//
+
+      if (!partCollection2) {
+       if (swpart) {
+         tPair->SetTrack1(*tPartIter2);
+         tPair->SetTrack2(*tPartIter1);
+         swpart = 0;
+       }
+       else {
+         tPair->SetTrack1(*tPartIter1);
+         tPair->SetTrack2(*tPartIter2);
+         swpart = 1;
+       }
+      }
+
+
+      if (fPairCut->Pass(tPair)){
+        for (tCorrFctnIter=fCorrFctnCollection->begin();
+             tCorrFctnIter!=fCorrFctnCollection->end();tCorrFctnIter++){
+          AliFemtoCorrFctn* tCorrFctn = *tCorrFctnIter;
+          if(type == "real")
+            tCorrFctn->AddRealPair(tPair);
+         else if(type == "mixed")
+            tCorrFctn->AddMixedPair(tPair);
+          else
+            cout << "Problem with pair type, type = " << type.c_str() << endl;
+        }
+      }
+    }    // loop over second particle
+  }      // loop over first particle
+
+  delete tPair;
+}
+
+//_____________________________________________
+TVector2 AliFemtoAnalysisAzimuthal::GetQVector(AliFemtoParticleCollection* particlecollection){
+  
+  TVector2 mQ;
+  float mQx=0, mQy=0;
+
+  if (!particlecollection) {
+    mQ.Set(0.0, 0.0);
+    return mQ;
+  }
+
+  AliFemtoParticle* flowparticle;
+  AliFemtoParticleIterator pIter;
+  AliFemtoParticleIterator startLoop = particlecollection->begin();
+  AliFemtoParticleIterator endLoop   = particlecollection->end();
+  for (pIter=startLoop;pIter!=endLoop;pIter++){
+    flowparticle = *pIter;
+    mQx += (cos(2*flowparticle->FourMomentum().Phi()))*(flowparticle->Track()->Pt());
+    mQy += (sin(2*flowparticle->FourMomentum().Phi()))*(flowparticle->Track()->Pt());
+  }
+  
+  mQ.Set(mQx,mQy);
+  return mQ;
+}
+
+//__________________________________________________
+double AliFemtoAnalysisAzimuthal::GetCurrentReactionPlane()
+{
+  return fPsi;
+}
+
+//_________________________
+TList* AliFemtoAnalysisAzimuthal::GetOutputList()
+{
+  // Collect the list of output objects to be written
+
+  TList *tOutputList = new TList();
+  TList *p1Cut = fFemtoParticleCut->GetOutputList();
+
+  TListIter nextp1(p1Cut);
+  while (TObject *obj = nextp1.Next()) {
+    tOutputList->Add(obj);
+  }
+
+  TList *pairCut = fPairCut->GetOutputList();
+
+  TIter nextpair(pairCut);
+  while (TObject *obj = nextpair()) {
+    tOutputList->Add(obj);
+  }
+
+  TList *eventCut = fEventCut->GetOutputList();
+
+  TIter nextevent(eventCut);
+  while (TObject *obj = nextevent()) {
+    tOutputList->Add(obj);
+  }
+
+  AliFemtoCorrFctnIterator iter;
+  for (iter=fCorrFctnCollection->begin(); iter!=fCorrFctnCollection->end();iter++){
+    TList *tListCf = (*iter)->GetOutputList();
+    
+    TIter nextListCf(tListCf);
+    while (TObject *obj = nextListCf()) {
+      tOutputList->Add(obj);
+    }
+  }
+
+  return tOutputList;
+  
+}
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisAzimuthal.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisAzimuthal.h
new file mode 100644 (file)
index 0000000..d806651
--- /dev/null
@@ -0,0 +1,67 @@
+////////////////////////////////////////////////////////////////////////////
+//                                                                        //
+// AliFemtoAnalysisReactionPlane - Femtoscopic analysis which mixes event //
+// with respect to the z position of the primary vertex and event total   //
+// multiplicity and uses only events in certain reaction plane angle bin  //
+//                                                                        //
+////////////////////////////////////////////////////////////////////////////
+
+#ifndef ALIFEMTOANALYSISAZIMUTHAL_H
+#define ALIFEMTOANALYSISAZIMUTHAL_H
+
+#include "AliFemtoSimpleAnalysis.h"        // base analysis class
+
+class TVector2;
+
+class AliFemtoAnalysisAzimuthal : public AliFemtoSimpleAnalysis {
+
+public:
+
+  AliFemtoAnalysisAzimuthal(unsigned int binsVertex=10, double minVertex=-100., double maxVertex=+100., unsigned int binsMult=10, double minMult=-1.e9, double maxMult=+1.e9, unsigned short binsRP=10);
+  AliFemtoAnalysisAzimuthal(const AliFemtoAnalysisAzimuthal& TheOriginalAnalysis);  // copy constructor
+
+  AliFemtoAnalysisAzimuthal& operator=(const AliFemtoAnalysisAzimuthal& aAna);
+
+  virtual void ProcessEvent(const AliFemtoEvent* ProcessThisEvent);
+  virtual ~AliFemtoAnalysisAzimuthal();
+  virtual unsigned int OverflowVertexZ() const { return fOverFlowVertexZ;}
+  virtual unsigned int UnderflowVertexZ() const { return fUnderFlowVertexZ;}
+  virtual unsigned int OverflowMult() const { return fOverFlowMult;}
+  virtual unsigned int UnderflowMult() const { return fUnderFlowMult;}
+  double GetCurrentReactionPlane();
+  TVector2 GetQVector(AliFemtoParticleCollection* particlecollection);
+  virtual void MakePairs(const char* typeIn, AliFemtoParticleCollection *partCollection1, AliFemtoParticleCollection *partCollection2=0);
+  virtual TList* GetOutputList();
+
+ // Get the particle cuts
+  virtual AliFemtoParticleCut*   FemtoParticleCut() {return fFemtoParticleCut;}
+  virtual AliFemtoParticleCut*   FlowParticleCut() {return fFlowParticleCut;}
+ // Set the cuts
+  void SetFemtoParticleCut(AliFemtoParticleCut* x) {fFemtoParticleCut = x; x->SetAnalysis((AliFemtoAnalysis*)this);}
+  void SetFlowParticleCut(AliFemtoParticleCut* x) {fFlowParticleCut = x; x->SetAnalysis((AliFemtoAnalysis*)this);}
+  void SetEventCut(AliFemtoEventCut* x) {fEventCut = x; x->SetAnalysis((AliFemtoAnalysis*)this);}
+  void SetPairCut(AliFemtoPairCut* x) {fPairCut = x; x->SetAnalysis((AliFemtoAnalysis*)this);}
+
+protected:
+
+  AliFemtoParticleCut*                 fFemtoParticleCut;    //  select particles of type #1 
+  AliFemtoParticleCut*         fFlowParticleCut;   //  select particles of type #2 
+
+  double fVertexZ[2];                 /* min/max z-vertex position allowed to be processed */
+  unsigned int fVertexZBins;          /* number of VERTEX mixing bins in z-vertex in EventMixing Buffer */
+  unsigned int fOverFlowVertexZ;      /* number of events encountered which had too large z-vertex */
+  unsigned int fUnderFlowVertexZ;     /* number of events encountered which had too small z-vertex */
+  double fMult[2];                    /* min/max multiplicity allowed for event to be processed */
+  unsigned int fMultBins;             /* number of MULTIPLICITY mixing bins in z-vertex in EventMixing Buffer */
+  unsigned int fOverFlowMult;         /* number of events encountered which had too large multiplicity */
+  unsigned int fUnderFlowMult;        /* number of events encountered which had too small multiplicity */
+  unsigned short fRPBins;             // Number of reaction plane angle orientation bins
+  double fPsi;                         // Reaction plane angle of the current event
+
+#ifdef __ROOT__
+  ClassDef(AliFemtoAnalysisAzimuthal, 0)
+#endif
+    
+};
+
+#endif
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisCollection.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisCollection.h
new file mode 100644 (file)
index 0000000..2ef52b4
--- /dev/null
@@ -0,0 +1,54 @@
+/***************************************************************************
+ *
+ * $Id$
+ *
+ * Author: Mike Lisa, Ohio State, lisa@mps.ohio-state.edu
+ ***************************************************************************
+ *
+ * Description: part of STAR HBT Framework: AliFemtoMaker package
+ *  The AnalysisCollection is pointed to by the Manager, and holds pointers
+ *  to all Analysis objects currently active
+ *
+ ***************************************************************************
+ *
+ * $Log$
+ * Revision 1.1  2007/05/16 10:22:11  akisiel
+ * Making the directory structure of AliFemto flat. All files go into one common directory
+ *
+ * Revision 1.1.1.1  2007/04/25 15:38:41  panos
+ * Importing the HBT code dir
+ *
+ * Revision 1.1.1.1  2007/03/07 10:14:49  mchojnacki
+ * First version on CVS
+ *
+ * Revision 1.3  2000/03/17 17:23:05  laue
+ * Roberts new three particle correlations implemented.
+ *
+ * Revision 1.2  2000/02/01 00:33:31  laue
+ * namespaces changed to run on the new Solaris Compiler CC5
+ * since we can use member templates in franks1Histo.h we are doing it
+ *
+ * Revision 1.1.1.1  1999/06/29 16:02:57  lisa
+ * Installation of AliFemtoMaker
+ *
+ **************************************************************************/
+
+#ifndef AliFemtoAnalysisCollection_hh
+#define AliFemtoAnalysisCollection_hh
+
+
+#include <list>
+#if !defined(ST_NO_NAMESPACES)
+using std::list;
+#endif
+class AliFemtoAnalysis;
+
+#ifdef ST_NO_TEMPLATE_DEF_ARGS
+typedef list<AliFemtoAnalysis*, allocator<AliFemtoAnalysis*> >            AliFemtoAnalysisCollection;
+typedef list<AliFemtoAnalysis*, allocator<AliFemtoAnalysis*> >::iterator  AliFemtoSimpleAnalysisIterator;
+#else
+typedef list<AliFemtoAnalysis*>            AliFemtoAnalysisCollection;
+typedef list<AliFemtoAnalysis*>::iterator  AliFemtoSimpleAnalysisIterator;
+#endif
+
+#endif
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisReactionPlane.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisReactionPlane.cxx
new file mode 100644 (file)
index 0000000..11fbdbd
--- /dev/null
@@ -0,0 +1,255 @@
+////////////////////////////////////////////////////////////////////////////
+//                                                                        //
+// AliFemtoAnalysisReactionPlane - Femtoscopic analysis which mixes event //
+// with respect to the z position of the primary vertex and event total   //
+// multiplicity and uses only events in certain reaction plane angle bin  //
+//                                                                        //
+////////////////////////////////////////////////////////////////////////////
+
+#include <TMath.h>
+#include "AliFemtoAnalysisReactionPlane.h"
+#include "AliFemtoParticleCollection.h"
+#include "AliFemtoTrackCut.h"
+#include "AliFemtoV0Cut.h"
+#include "AliFemtoKinkCut.h"
+#include "AliFemtoPicoEventCollectionVector.h"
+#include "AliFemtoPicoEventCollectionVectorHideAway.h"
+
+#ifdef __ROOT__ 
+ClassImp(AliFemtoAnalysisReactionPlane)
+#endif
+
+extern void FillHbtParticleCollection(AliFemtoParticleCut*         partCut,
+                                     AliFemtoEvent*               hbtEvent,
+                                     AliFemtoParticleCollection*  partCollection);
+
+
+//____________________________
+AliFemtoAnalysisReactionPlane::AliFemtoAnalysisReactionPlane(unsigned int binsVertex, double minVertex, double maxVertex,
+                                                      unsigned int binsMult, double minMult, double maxMult, unsigned short binsRP) 
+  : 
+  fVertexZBins(binsVertex), 
+  fOverFlowVertexZ(0), 
+  fUnderFlowVertexZ(0),
+  fMultBins(binsMult) ,
+  fOverFlowMult(0),    
+  fUnderFlowMult(0),
+  fRPBins(binsRP),
+  fCurrentRP(0)
+{
+  //  mControlSwitch     = 0;
+  fEventCut          = 0;
+  fFirstParticleCut  = 0;
+  fSecondParticleCut = 0;
+  fPairCut           = 0;
+  fCorrFctnCollection= 0;
+  fCorrFctnCollection = new AliFemtoCorrFctnCollection;
+  fVertexZ[0] = minVertex;
+  fVertexZ[1] = maxVertex;
+  fUnderFlowVertexZ = 0; 
+  fOverFlowVertexZ = 0; 
+  fMult[0] = minMult;
+  fMult[1] = maxMult;
+  fUnderFlowMult = 0; 
+  fOverFlowMult = 0; 
+  if (fMixingBuffer) delete fMixingBuffer;
+  fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexZBins,fVertexZ[0],fVertexZ[1],
+                                                                                    fMultBins,fMult[0],fMult[1],
+                                                                                    fRPBins,0.0,TMath::Pi());
+}
+//____________________________
+
+AliFemtoAnalysisReactionPlane::AliFemtoAnalysisReactionPlane(const AliFemtoAnalysisReactionPlane& a) : 
+  AliFemtoSimpleAnalysis(),
+  fVertexZBins(a.fVertexZBins), 
+  fOverFlowVertexZ(0), 
+  fUnderFlowVertexZ(0),
+  fMultBins(a.fMultBins) ,
+  fOverFlowMult(0),    
+  fUnderFlowMult(0),
+  fRPBins(a.fRPBins),
+  fCurrentRP(0)
+{
+  //AliFemtoAnalysisReactionPlane();
+  fEventCut          = 0;
+  fFirstParticleCut  = 0;
+  fSecondParticleCut = 0;
+  fPairCut           = 0;
+  fCorrFctnCollection= 0;
+  fCorrFctnCollection = new AliFemtoCorrFctnCollection;
+  fVertexZ[0] = a.fVertexZ[0]; 
+  fVertexZ[1] = a.fVertexZ[1];
+  fUnderFlowVertexZ = 0; 
+  fOverFlowVertexZ = 0; 
+  fMult[0] = a.fMult[0]; 
+  fMult[1] = a.fMult[1];
+  fUnderFlowMult = 0; 
+  fOverFlowMult = 0; 
+  if (fMixingBuffer) delete fMixingBuffer;
+  fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexZBins,fVertexZ[0],fVertexZ[1],
+                                                                                    fMultBins,fMult[0],fMult[1],
+                                                                                    fRPBins,0.0,TMath::Pi());
+
+  // find the right event cut
+  fEventCut = a.fEventCut->Clone();
+  // find the right first particle cut
+  fFirstParticleCut = a.fFirstParticleCut->Clone();
+  // find the right second particle cut
+  if (a.fFirstParticleCut==a.fSecondParticleCut) 
+    SetSecondParticleCut(fFirstParticleCut); // identical particle hbt
+  else
+  fSecondParticleCut = a.fSecondParticleCut->Clone();
+
+  fPairCut = a.fPairCut->Clone();
+  
+  if ( fEventCut ) {
+      SetEventCut(fEventCut); // this will set the myAnalysis pointer inside the cut
+      cout << " AliFemtoAnalysisReactionPlane::AliFemtoAnalysisReactionPlane(const AliFemtoAnalysisReactionPlane& a) - event cut set " << endl;
+  }
+  if ( fFirstParticleCut ) {
+      SetFirstParticleCut(fFirstParticleCut); // this will set the myAnalysis pointer inside the cut
+      cout << " AliFemtoAnalysisReactionPlane::AliFemtoAnalysisReactionPlane(const AliFemtoAnalysisReactionPlane& a) - first particle cut set " << endl;
+  }
+  if ( fSecondParticleCut ) {
+      SetSecondParticleCut(fSecondParticleCut); // this will set the myAnalysis pointer inside the cut
+      cout << " AliFemtoAnalysisReactionPlane::AliFemtoAnalysisReactionPlane(const AliFemtoAnalysisReactionPlane& a) - second particle cut set " << endl;
+  }  if ( fPairCut ) {
+      SetPairCut(fPairCut); // this will set the myAnalysis pointer inside the cut
+      cout << " AliFemtoAnalysisReactionPlane::AliFemtoAnalysisReactionPlane(const AliFemtoAnalysisReactionPlane& a) - pair cut set " << endl;
+  }
+
+  AliFemtoCorrFctnIterator iter;
+  for (iter=a.fCorrFctnCollection->begin(); iter!=a.fCorrFctnCollection->end();iter++){
+    cout << " AliFemtoAnalysisReactionPlane::AliFemtoAnalysisReactionPlane(const AliFemtoAnalysisReactionPlane& a) - looking for correlation functions " << endl;
+    AliFemtoCorrFctn* fctn = (*iter)->Clone();
+    if (fctn) AddCorrFctn(fctn);
+    else cout << " AliFemtoAnalysisReactionPlane::AliFemtoAnalysisReactionPlane(const AliFemtoAnalysisReactionPlane& a) - correlation function not found " << endl;
+  }
+
+  fNumEventsToMix = a.fNumEventsToMix;
+
+  cout << " AliFemtoAnalysisReactionPlane::AliFemtoAnalysisReactionPlane(const AliFemtoAnalysisReactionPlane& a) - analysis copied " << endl;
+
+}
+AliFemtoAnalysisReactionPlane& AliFemtoAnalysisReactionPlane::operator=(const AliFemtoAnalysisReactionPlane& TheOriginalAnalysis)
+{
+  if (this != &TheOriginalAnalysis) {
+
+    //AliFemtoAnalysisReactionPlane();
+    fVertexZ[0] = TheOriginalAnalysis.fVertexZ[0]; 
+    fVertexZ[1] = TheOriginalAnalysis.fVertexZ[1];
+    fUnderFlowVertexZ = 0; 
+    fOverFlowVertexZ = 0; 
+    fMult[0] = TheOriginalAnalysis.fMult[0]; 
+    fMult[1] = TheOriginalAnalysis.fMult[1];
+    fUnderFlowMult = 0; 
+    fOverFlowMult = 0; 
+    if (fMixingBuffer) delete fMixingBuffer;
+    fVertexZBins = TheOriginalAnalysis.fVertexZBins;
+    fMultBins = TheOriginalAnalysis.fMultBins;
+    fRPBins = TheOriginalAnalysis.fRPBins;
+    fCurrentRP = 0;
+    
+    if (fEventCut) delete fEventCut;
+    fEventCut = TheOriginalAnalysis.fEventCut->Clone();
+    
+    if (fFirstParticleCut) delete fFirstParticleCut;
+    fFirstParticleCut = TheOriginalAnalysis.fFirstParticleCut->Clone();
+    
+    if (fSecondParticleCut) delete fSecondParticleCut;
+    if (TheOriginalAnalysis.fFirstParticleCut==TheOriginalAnalysis.fSecondParticleCut) 
+      SetSecondParticleCut(fFirstParticleCut); // identical particle hbt
+    else
+      fSecondParticleCut = TheOriginalAnalysis.fSecondParticleCut->Clone();
+    
+    if (fPairCut) delete fPairCut;
+    fPairCut = TheOriginalAnalysis.fPairCut->Clone();
+    
+    if ( fEventCut ) {
+      SetEventCut(fEventCut); // this will set the myAnalysis pointer inside the cut
+    }
+    if ( fFirstParticleCut ) {
+      SetFirstParticleCut(fFirstParticleCut); // this will set the myAnalysis pointer inside the cut
+    }
+    if ( fSecondParticleCut ) {
+      SetSecondParticleCut(fSecondParticleCut); // this will set the myAnalysis pointer inside the cut
+    }  if ( fPairCut ) {
+      SetPairCut(fPairCut); // this will set the myAnalysis pointer inside the cut
+    }
+    
+    if (fPicoEventCollectionVectorHideAway) delete fPicoEventCollectionVectorHideAway;
+    fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexZBins,fVertexZ[0],fVertexZ[1],
+                                                                                      fMultBins,fMult[0],fMult[1],
+                                                                                      fRPBins,0.0,TMath::Pi());
+    
+    AliFemtoCorrFctnIterator iter;
+    for (iter=TheOriginalAnalysis.fCorrFctnCollection->begin(); iter!=TheOriginalAnalysis.fCorrFctnCollection->end();iter++){
+      AliFemtoCorrFctn* fctn = (*iter)->Clone();
+      if (fctn) AddCorrFctn(fctn);
+    }
+    
+    fNumEventsToMix = TheOriginalAnalysis.fNumEventsToMix;
+
+  }
+
+  return *this;
+}
+
+//____________________________
+AliFemtoAnalysisReactionPlane::~AliFemtoAnalysisReactionPlane(){
+  // now delete every PicoEvent in the EventMixingBuffer and then the Buffer itself
+  delete fPicoEventCollectionVectorHideAway;
+}
+
+//____________________________
+AliFemtoString AliFemtoAnalysisReactionPlane::Report()
+{
+  // Prepare a report of the execution
+  cout << "AliFemtoAnalysisReactionPlane - constructing Report..."<<endl;
+  char ctemp[200];
+  AliFemtoString temp = "-----------\nHbt AliFemtoAnalysisReactionPlane Report:\n";
+  snprintf(ctemp , 200, "Events are mixed in %d VertexZ bins in the range %E cm to %E cm.\n",fVertexZBins,fVertexZ[0],fVertexZ[1]);
+  temp += ctemp;
+  snprintf(ctemp , 200, "Events underflowing: %d\n",fUnderFlowVertexZ);
+  temp += ctemp;
+  snprintf(ctemp , 200, "Events overflowing: %d\n",fOverFlowVertexZ);
+  temp += ctemp;
+  snprintf(ctemp , 200, "Events are mixed in %d Mult bins in the range %E cm to %E cm.\n",fMultBins,fMult[0],fMult[1]);
+  temp += ctemp;
+  snprintf(ctemp , 200, "Events underflowing: %d\n",fUnderFlowMult);
+  temp += ctemp;
+  snprintf(ctemp , 200, "Events overflowing: %d\n",fOverFlowMult);
+  temp += ctemp;
+  snprintf(ctemp , 200, "Now adding AliFemtoSimpleAnalysis(base) Report\n");
+  temp += ctemp;
+  temp += AliFemtoSimpleAnalysis::Report();
+  AliFemtoString returnThis=temp;
+  return returnThis;
+}
+//_________________________
+void AliFemtoAnalysisReactionPlane::ProcessEvent(const AliFemtoEvent* hbtEvent) {
+  // Perform event processing
+  // in bins of z vertex and multiplicity
+
+  // cout << " AliFemtoAnalysisReactionPlane::ProcessEvent(const AliFemtoEvent* hbtEvent) " << endl;
+  // get right mixing buffer
+  double vertexZ = hbtEvent->PrimVertPos().z();
+  double mult = hbtEvent->UncorrectedNumberOfPrimaries();
+  fCurrentRP = hbtEvent->ReactionPlaneAngle();
+  
+  fMixingBuffer = fPicoEventCollectionVectorHideAway->PicoEventCollection(vertexZ,mult,fCurrentRP); 
+  if (!fMixingBuffer) {
+    if ( vertexZ < fVertexZ[0] ) fUnderFlowVertexZ++;
+    if ( vertexZ > fVertexZ[1] ) fOverFlowVertexZ++;
+    if ( mult < fMult[0] ) fUnderFlowMult++;
+    if ( mult > fMult[1] ) fOverFlowMult++;
+    return;
+  }
+  // call ProcessEvent() from AliFemtoSimpleAnalysis-base
+  AliFemtoSimpleAnalysis::ProcessEvent(hbtEvent);
+}
+
+double AliFemtoAnalysisReactionPlane::GetCurrentReactionPlane()
+{
+  return fCurrentRP;
+}
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisReactionPlane.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisReactionPlane.h
new file mode 100644 (file)
index 0000000..2283efb
--- /dev/null
@@ -0,0 +1,47 @@
+////////////////////////////////////////////////////////////////////////////
+//                                                                        //
+// AliFemtoAnalysisReactionPlane - Femtoscopic analysis which mixes event //
+// with respect to the z position of the primary vertex and event total   //
+// multiplicity and uses only events in certain reaction plane angle bin  //
+//                                                                        //
+////////////////////////////////////////////////////////////////////////////
+
+#ifndef ALIFEMTOANALYSISREACTIONPLANE_H
+#define ALIFEMTOANALYSISREACTIONPLANE_H
+
+#include "AliFemtoSimpleAnalysis.h"        // base analysis class
+
+class AliFemtoAnalysisReactionPlane : public AliFemtoSimpleAnalysis {
+
+public:
+
+  AliFemtoAnalysisReactionPlane(unsigned int binsVertex=10, double minVertex=-100., double maxVertex=+100., unsigned int binsMult=10, double minMult=-1.e9, double maxMult=+1.e9, unsigned short binsRP=10);
+  AliFemtoAnalysisReactionPlane(const AliFemtoAnalysisReactionPlane& TheOriginalAnalysis);  // copy constructor
+  AliFemtoAnalysisReactionPlane& operator=(const AliFemtoAnalysisReactionPlane& TheOriginalAnalysis); 
+  virtual void ProcessEvent(const AliFemtoEvent* ProcessThisEvent);
+  virtual ~AliFemtoAnalysisReactionPlane();
+  virtual AliFemtoString Report();       //! returns reports of all cuts applied and correlation functions being done
+  virtual unsigned int OverflowVertexZ() const { return fOverFlowVertexZ;}
+  virtual unsigned int UnderflowVertexZ() const { return fUnderFlowVertexZ;}
+  virtual unsigned int OverflowMult() const { return fOverFlowMult;}
+  virtual unsigned int UnderflowMult() const { return fUnderFlowMult;}
+  double GetCurrentReactionPlane();
+
+protected:
+  double fVertexZ[2];                 /* min/max z-vertex position allowed to be processed */
+  unsigned int fVertexZBins;          /* number of VERTEX mixing bins in z-vertex in EventMixing Buffer */
+  unsigned int fOverFlowVertexZ;      /* number of events encountered which had too large z-vertex */
+  unsigned int fUnderFlowVertexZ;     /* number of events encountered which had too small z-vertex */
+  double fMult[2];                    /* min/max multiplicity allowed for event to be processed */
+  unsigned int fMultBins;             /* number of MULTIPLICITY mixing bins in z-vertex in EventMixing Buffer */
+  unsigned int fOverFlowMult;         /* number of events encountered which had too large multiplicity */
+  unsigned int fUnderFlowMult;        /* number of events encountered which had too small multiplicity */
+  unsigned short fRPBins;             // Number of reaction plane angle orientation bins
+  double fCurrentRP;                  // Reaction plane angle of the current event
+#ifdef __ROOT__
+  ClassDef(AliFemtoAnalysisReactionPlane, 0)
+#endif
+    
+};
+
+#endif
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBPLCMS3DCorrFctn.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBPLCMS3DCorrFctn.cxx
new file mode 100644 (file)
index 0000000..77900c3
--- /dev/null
@@ -0,0 +1,461 @@
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// AliFemtoBPLCMS3DCorrFctn: a class to calculate 3D correlation         //
+// for pairs of identical particles.                                     //
+// It also stored the weighted qinv per bin histogram for the coulomb    //
+// correction.                                                           //
+// In analysis the function should be first created in a macro, then     //
+// added to the analysis, and at the end of the macro the procedure to   //
+// write out histograms should be called.                                //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+
+#include "AliFemtoBPLCMS3DCorrFctn.h"
+#include "AliFemtoKTPairCut.h"
+#include "AliFemtoAnalysisReactionPlane.h"
+//#include "AliFemtoHisto.h"
+#include <cstdio>
+
+#ifdef __ROOT__ 
+ClassImp(AliFemtoBPLCMS3DCorrFctn)
+#endif
+
+//____________________________
+AliFemtoBPLCMS3DCorrFctn::AliFemtoBPLCMS3DCorrFctn(char* title, const int& nbins, const float& QLo, const float& QHi)
+  :
+  AliFemtoCorrFctn(),
+//   fIDNumHisto(0),
+//   fIDDenHisto(0),
+//   fIDRatHisto(0),
+//   fSMNumHisto(0),
+//   fSMDenHisto(0),
+//   fSMRatHisto(0),
+//   fCorrectionHisto(0),
+//   fCorrCFHisto(0),
+  fNumerator(0),
+  fDenominator(0),
+  fRatio(0),
+  fQinvHisto(0),
+  fLambda(0),
+  fRout2(0),
+  fRside2(0),
+  fRlong2(0),
+  fQinvNormLo(0),
+  fQinvNormHi(0),
+  fNumRealsNorm(0),
+  fNumMixedNorm(0),
+  fUseRPSelection(0)
+{
+  // Basic constructor
+  // set some stuff...
+  fQinvNormLo = (QHi-QLo)*0.8;
+  fQinvNormHi = (QHi-QLo)*0.8;
+  fNumRealsNorm = 0;
+  fNumMixedNorm = 0;
+  //  fCorrection = 0;  // pointer to Coulomb Correction object
+
+  //  fSmearPair = 0; // no resolution correction unless user sets SmearPair
+
+  // set up numerator
+  char tTitNum[101] = "Num";
+  strncat(tTitNum,title, 100);
+  fNumerator = new TH3D(tTitNum,title,nbins,-QHi,QHi,nbins,-QHi,QHi,nbins,-QHi,QHi);
+  // set up denominator
+  char tTitDen[101] = "Den";
+  strncat(tTitDen,title, 100);
+  fDenominator = new TH3D(tTitDen,title,nbins,-QHi,QHi,nbins,-QHi,QHi,nbins,-QHi,QHi);
+  // set up uncorrected denominator
+  char tTitDenUncoul[101] = "DenNoCoul";
+  strncat(tTitDenUncoul,title, 100);
+  //  fUncorrectedDenominator = new TH3D(tTitDenUncoul,title,nbins,-QHi,QHi,nbins,-QHi,QHi,nbins,-QHi,QHi);
+  // set up ratio
+  char tTitRat[101] = "Rat";
+  strncat(tTitRat,title, 100);
+  fRatio = new TH3D(tTitRat,title,nbins,-QHi,QHi,nbins,-QHi,QHi,nbins,-QHi,QHi);
+  // set up ave qInv
+  char tTitQinv[101] = "Qinv";
+  strncat(tTitQinv,title, 100);
+  fQinvHisto = new TH3D(tTitQinv,title,nbins,-QHi,QHi,nbins,-QHi,QHi,nbins,-QHi,QHi);
+
+  // to enable error bar calculation...
+  fNumerator->Sumw2();
+  fDenominator->Sumw2();
+  //  fUncorrectedDenominator->Sumw2();
+  fRatio->Sumw2();
+
+//   // Following histos are for the momentum resolution correction
+//   // they are filled only if a AliFemtoSmear object is plugged in
+//   // here comes the "idea" numerator and denominator and ratio...
+//   char tTitNumID[101] = "IDNum";
+//   strncat(tTitNumID,title, 100);
+//   fIDNumHisto = new TH3D(tTitNumID,title,nbins,-QHi,QHi,nbins,-QHi,QHi,nbins,-QHi,QHi);
+//   char tTitDenID[101] = "IDDen";
+//   strncat(tTitDenID,title, 100);
+//   fIDDenHisto = new TH3D(tTitDenID,title,nbins,-QHi,QHi,nbins,-QHi,QHi,nbins,-QHi,QHi);
+//   char tTitRatID[101] = "IDRat";
+//   strncat(tTitRatID,title, 100);
+//   fIDRatHisto = new TH3D(tTitRatID,title,nbins,-QHi,QHi,nbins,-QHi,QHi,nbins,-QHi,QHi);
+
+//   fIDNumHisto->Sumw2();
+//   fIDDenHisto->Sumw2();
+//   fIDRatHisto->Sumw2();
+
+//   //
+//   // here comes the "smeared" numerator and denominator...
+//   char tTitNumSM[101] = "SMNum";
+//   strncat(tTitNumSM,title, 100);
+//   fSMNumHisto = new TH3D(tTitNumSM,title,nbins,-QHi,QHi,nbins,-QHi,QHi,nbins,-QHi,QHi);
+//   char tTitDenSM[101] = "SMDen";
+//   strncat(tTitDenSM,title, 100);
+//   fSMDenHisto = new TH3D(tTitDenSM,title,nbins,-QHi,QHi,nbins,-QHi,QHi,nbins,-QHi,QHi);
+//   char tTitRatSM[101] = "SMRat";
+//   strncat(tTitRatSM,title, 100);
+//   fSMRatHisto = new TH3D(tTitRatSM,title,nbins,-QHi,QHi,nbins,-QHi,QHi,nbins,-QHi,QHi);
+//   //
+//   fSMNumHisto->Sumw2();
+//   fSMDenHisto->Sumw2();
+//   fSMRatHisto->Sumw2();
+//   //
+//   // here comes the correction factor (which is just ratio of ideal ratio to smeared ratio)
+//   char tTitCorrection[101] = "CorrectionFactor";
+//   strncat(tTitCorrection,title, 100);
+//   fCorrectionHisto = new TH3D(tTitCorrection,title,nbins,-QHi,QHi,nbins,-QHi,QHi,nbins,-QHi,QHi);  
+//   fCorrectionHisto->Sumw2();
+//   // here comes the fully corrected correlation function
+//   char tTitCorrCF[101] = "CorrectedCF";
+//   strncat(tTitCorrCF,title, 100);
+//   fCorrCFHisto = new TH3D(tTitCorrCF,title,nbins,-QHi,QHi,nbins,-QHi,QHi,nbins,-QHi,QHi);
+//   fCorrCFHisto->Sumw2();
+
+  // user can (and should) override these defaults...
+  fLambda = 0.6;
+  fRout2 = 6.0*6.0;
+  fRside2 = 6.0*6.0;
+  fRlong2 = 7.0*7.0;
+
+}
+
+AliFemtoBPLCMS3DCorrFctn::AliFemtoBPLCMS3DCorrFctn(const AliFemtoBPLCMS3DCorrFctn& aCorrFctn) :
+  AliFemtoCorrFctn(aCorrFctn),
+//   fIDNumHisto(0),
+//   fIDDenHisto(0),
+//   fIDRatHisto(0),
+//   fSMNumHisto(0),
+//   fSMDenHisto(0),
+//   fSMRatHisto(0),
+//   fCorrectionHisto(0),
+//   fCorrCFHisto(0),
+  fNumerator(0),
+  fDenominator(0),
+  fRatio(0),
+  fQinvHisto(0),
+  fLambda(0),
+  fRout2(0),
+  fRside2(0),
+  fRlong2(0),
+  fQinvNormLo(0),
+  fQinvNormHi(0),
+  fNumRealsNorm(0),
+  fNumMixedNorm(0),
+  fUseRPSelection(0)
+{
+  // Copy constructor
+//   fIDNumHisto = new TH3D(*aCorrFctn.fIDNumHisto);
+//   fIDDenHisto = new TH3D(*aCorrFctn.fIDDenHisto);
+//   fIDRatHisto = new TH3D(*aCorrFctn.fIDRatHisto);
+//   fSMNumHisto = new TH3D(*aCorrFctn.fSMNumHisto);
+//   fSMDenHisto = new TH3D(*aCorrFctn.fSMDenHisto);
+//   fSMRatHisto = new TH3D(*aCorrFctn.fSMRatHisto);
+//   fCorrectionHisto = new TH3D(*aCorrFctn.fCorrectionHisto);
+//   fCorrCFHisto = new TH3D(*aCorrFctn.fCorrCFHisto);
+  fNumerator = new TH3D(*aCorrFctn.fNumerator);
+  fDenominator = new TH3D(*aCorrFctn.fDenominator);
+  fRatio = new TH3D(*aCorrFctn.fRatio);
+  fQinvHisto = new TH3D(*aCorrFctn.fQinvHisto);
+  fLambda = aCorrFctn.fLambda;
+  fRout2 = aCorrFctn.fRout2;
+  fRside2 = aCorrFctn.fRside2;
+  fRlong2 = aCorrFctn.fRlong2;
+  fQinvNormLo = aCorrFctn.fQinvNormLo;
+  fQinvNormHi = aCorrFctn.fQinvNormHi;
+  fNumRealsNorm = aCorrFctn.fNumRealsNorm;
+  fNumMixedNorm = aCorrFctn.fNumMixedNorm;
+  fUseRPSelection = aCorrFctn.fUseRPSelection;
+}
+//____________________________
+AliFemtoBPLCMS3DCorrFctn::~AliFemtoBPLCMS3DCorrFctn(){
+  // Destructor
+  delete fNumerator;
+  delete fDenominator;
+  delete fRatio;
+  delete fQinvHisto;
+//   delete fIDNumHisto;
+//   delete fIDDenHisto;
+//   delete fIDRatHisto;
+//   delete fSMNumHisto;
+//   delete fSMDenHisto;
+//   delete fSMRatHisto;
+//   delete fCorrectionHisto;
+//   delete fCorrCFHisto;
+}
+//_________________________
+AliFemtoBPLCMS3DCorrFctn& AliFemtoBPLCMS3DCorrFctn::operator=(const AliFemtoBPLCMS3DCorrFctn& aCorrFctn)
+{
+  // assignment operator
+  if (this == &aCorrFctn)
+    return *this;
+//   if (fIDNumHisto) delete fIDNumHisto;
+//   fIDNumHisto = new TH3D(*aCorrFctn.fIDNumHisto);
+//   if (fIDDenHisto) delete fIDDenHisto;
+//   fIDDenHisto = new TH3D(*aCorrFctn.fIDDenHisto);
+//   if (fIDRatHisto) delete fIDRatHisto;
+//   fIDRatHisto = new TH3D(*aCorrFctn.fIDRatHisto);
+//   if (fSMNumHisto) delete fSMNumHisto;
+//   fSMNumHisto = new TH3D(*aCorrFctn.fSMNumHisto);
+//   if (fSMDenHisto) delete fSMDenHisto;
+//   fSMDenHisto = new TH3D(*aCorrFctn.fSMDenHisto);
+//   if (fSMRatHisto) delete fSMRatHisto;
+//   fSMRatHisto = new TH3D(*aCorrFctn.fSMRatHisto);
+
+//   if (fCorrectionHisto) delete fCorrectionHisto;
+//   fCorrectionHisto = new TH3D(*aCorrFctn.fCorrectionHisto);
+//   if (fCorrCFHisto) delete fCorrCFHisto;
+//   fCorrCFHisto = new TH3D(*aCorrFctn.fCorrCFHisto);
+  if (fNumerator) delete fNumerator;
+  fNumerator = new TH3D(*aCorrFctn.fNumerator);
+  if (fDenominator) delete fDenominator;
+  fDenominator = new TH3D(*aCorrFctn.fDenominator);
+  if (fRatio) delete fRatio;
+  fRatio = new TH3D(*aCorrFctn.fRatio);
+  if (fQinvHisto) delete fQinvHisto;
+  fQinvHisto = new TH3D(*aCorrFctn.fQinvHisto);
+
+  fLambda = aCorrFctn.fLambda;
+  fRout2 = aCorrFctn.fRout2;
+  fRside2 = aCorrFctn.fRside2;
+  fRlong2 = aCorrFctn.fRlong2;
+  fQinvNormLo = aCorrFctn.fQinvNormLo;
+  fQinvNormHi = aCorrFctn.fQinvNormHi;
+  fNumRealsNorm = aCorrFctn.fNumRealsNorm;
+  fNumMixedNorm = aCorrFctn.fNumMixedNorm;
+  fUseRPSelection = aCorrFctn.fUseRPSelection;
+
+  return *this;
+}
+
+//_________________________
+void AliFemtoBPLCMS3DCorrFctn::WriteOutHistos(){
+  // Write out all histograms to file
+  fNumerator->Write();
+  fDenominator->Write();
+  //  fUncorrectedDenominator->Write();
+  fRatio->Write();
+  fQinvHisto->Write();
+
+  /*
+    if (fSmearPair){
+    fIDNumHisto->Write();
+    fIDDenHisto->Write();
+    fIDRatHisto->Write();
+    //
+    fSMNumHisto->Write();
+    fSMDenHisto->Write();
+    fSMRatHisto->Write();
+    //
+    fCorrectionHisto->Write();
+    fCorrCFHisto->Write();
+    }
+  */
+}
+//______________________________
+TList* AliFemtoBPLCMS3DCorrFctn::GetOutputList()
+{
+  // Prepare the list of objects to be written to the output
+  TList *tOutputList = new TList();
+
+  tOutputList->Add(fNumerator); 
+  tOutputList->Add(fDenominator);  
+  tOutputList->Add(fQinvHisto);  
+
+  return tOutputList;
+}
+
+//_________________________
+void AliFemtoBPLCMS3DCorrFctn::Finish(){
+  // here is where we should normalize, fit, etc...
+  double tNumFact,tDenFact;
+  if ((fNumRealsNorm !=0) && (fNumMixedNorm !=0)){
+    tNumFact = double(fNumRealsNorm);
+    tDenFact = double(fNumMixedNorm);
+  }
+  // can happen that the fNumRealsNorm and fNumMixedNorm = 0 if you do non-standard
+  //   things like making a new CorrFctn and just setting the Numerator and Denominator
+  //   from OTHER CorrFctns which you read in (like when doing parallel processing) 
+  else{
+    cout << "Warning! - no normalization constants defined - I do the best I can..." << endl;
+    int nbins = fNumerator->GetNbinsX();
+    int half_way = nbins/2;
+    tNumFact = fNumerator->Integral(half_way,nbins,half_way,nbins,half_way,nbins);
+    tDenFact = fDenominator->Integral(half_way,nbins,half_way,nbins,half_way,nbins);
+  }
+
+  fRatio->Divide(fNumerator,fDenominator,tDenFact,tNumFact);
+  //  fQinvHisto->Divide(fUncorrectedDenominator);
+  fQinvHisto->Divide(fDenominator);
+
+  /*
+  // now do all the resolution correction stuff..
+  if (fSmearPair){  // but only do it if we have been working with a SmearPair
+  fIDRatHisto->Divide(fIDNumHisto,fIDDenHisto);
+  fSMRatHisto->Divide(fSMNumHisto,fSMDenHisto);
+  fCorrectionHisto->Divide(fIDRatHisto,fSMRatHisto);
+  fCorrCFHisto->Multiply(fRatio,fCorrectionHisto);
+  }
+  */
+
+}
+
+//____________________________
+AliFemtoString AliFemtoBPLCMS3DCorrFctn::Report(){
+  // Construct the report
+  string stemp = "LCMS Frame Bertsch-Pratt 3D Correlation Function Report:\n";
+  char ctemp[100];
+  snprintf(ctemp , 100, "Number of entries in numerator:\t%E\n",fNumerator->GetEntries());
+  stemp += ctemp;
+  snprintf(ctemp , 100, "Number of entries in denominator:\t%E\n",fDenominator->GetEntries());
+  stemp += ctemp;
+  snprintf(ctemp , 100, "Number of entries in ratio:\t%E\n",fRatio->GetEntries());
+  stemp += ctemp;
+  snprintf(ctemp , 100, "Normalization region in Qinv was:\t%E\t%E\n",fQinvNormLo,fQinvNormHi);
+  stemp += ctemp;
+  snprintf(ctemp , 100, "Number of pairs in Normalization region was:\n");
+  stemp += ctemp;
+  snprintf(ctemp , 100, "In numerator:\t%lu\t In denominator:\t%lu\n",fNumRealsNorm,fNumMixedNorm);
+  stemp += ctemp;
+  /*  if (fCorrection)
+      {
+      float radius = fCorrection->GetRadius();
+      snprintf(ctemp , 100, "Coulomb correction used radius of\t%E\n",radius);
+      }
+      else
+      {
+      snprintf(ctemp , 100, "No Coulomb Correction applied to this CorrFctn\n");
+      }
+      stemp += ctemp;
+  */
+
+  if (fPairCut){
+    snprintf(ctemp , 100, "Here is the PairCut specific to this CorrFctn\n");
+    stemp += ctemp;
+    stemp += fPairCut->Report();
+  }
+  else{
+    snprintf(ctemp , 100, "No PairCut specific to this CorrFctn\n");
+    stemp += ctemp;
+  }
+
+  //  
+  AliFemtoString returnThis = stemp;
+  return returnThis;
+}
+//____________________________
+void AliFemtoBPLCMS3DCorrFctn::AddRealPair( AliFemtoPair* pair){
+  // perform operations on real pairs
+  if (fPairCut){
+    if (fUseRPSelection) {
+      AliFemtoKTPairCut *ktc = dynamic_cast<AliFemtoKTPairCut *>(fPairCut);
+      if (!ktc) { 
+       cout << "RP aware cut requested, but not connected to the CF" << endl;
+       if (!(fPairCut->Pass(pair))) return;
+      }
+      else {
+       AliFemtoAnalysisReactionPlane *arp = dynamic_cast<AliFemtoAnalysisReactionPlane *> (HbtAnalysis());
+       if (!arp) {
+         cout << "RP aware cut requested, but not connected to the CF" << endl;
+         if (!(fPairCut->Pass(pair))) return;
+       }
+       else if (!(ktc->Pass(pair, arp->GetCurrentReactionPlane()))) return;
+      }
+    }
+    else
+      if (!(fPairCut->Pass(pair))) return;
+  }
+
+  double tQinv = fabs(pair->QInv());   // note - qInv() will be negative for identical pairs...
+  if ((tQinv < fQinvNormHi) && (tQinv > fQinvNormLo)) fNumRealsNorm++;
+  double qOut = (pair->QOutCMS());
+  double qSide = (pair->QSideCMS());
+  double qLong = (pair->QLongCMS());
+
+  fNumerator->Fill(qOut,qSide,qLong);
+}
+//____________________________
+void AliFemtoBPLCMS3DCorrFctn::AddMixedPair( AliFemtoPair* pair){
+  // perform operations on mixed pairs
+//   if (fPairCut){
+//     if (!(fPairCut->Pass(pair))) return;
+//   }
+  if (fPairCut){
+    if (fUseRPSelection) {
+      AliFemtoKTPairCut *ktc = dynamic_cast<AliFemtoKTPairCut *>(fPairCut);
+      if (!ktc) { 
+       cout << "RP aware cut requested, but not connected to the CF" << endl;
+       if (!(fPairCut->Pass(pair))) return;
+      }
+      else {
+       AliFemtoAnalysisReactionPlane *arp = dynamic_cast<AliFemtoAnalysisReactionPlane *> (HbtAnalysis());
+       if (!arp) {
+         cout << "RP aware cut requested, but not connected to the CF" << endl;
+         if (!(fPairCut->Pass(pair))) return;
+       }
+       else if (!(ktc->Pass(pair, arp->GetCurrentReactionPlane()))) return;
+      }
+    }
+    else
+      if (!(fPairCut->Pass(pair))) return;
+  }
+
+  //  double CoulombWeight = (fCorrection ? fCorrection->CoulombCorrect(pair) : 1.0);
+  double tCoulombWeight = 1.0;
+
+  double tQinv = fabs(pair->QInv());   // note - qInv() will be negative for identical pairs...
+  if ((tQinv < fQinvNormHi) && (tQinv > fQinvNormLo)) fNumMixedNorm++;
+  double qOut = (pair->QOutCMS());
+  double qSide = (pair->QSideCMS());
+  double qLong = (pair->QLongCMS());
+
+  fDenominator->Fill(qOut,qSide,qLong,tCoulombWeight);
+  //  fUncorrectedDenominator->Fill(qOut,qSide,qLong,1.0);
+  fQinvHisto->Fill(qOut,qSide,qLong,tQinv);
+
+  /*
+  // now for the momentum resolution stuff...
+  if (fSmearPair){
+      double CorrWeight =  1.0 + 
+      fLambda*exp((-qOut*qOut*fRout2 -qSide*qSide*fRside2 -qLong*qLong*fRlong2)/0.038936366329);
+    CorrWeight *= CoulombWeight;  // impt.
+
+    fIDNumHisto->Fill(qOut,qSide,qLong,CorrWeight);
+    fIDDenHisto->Fill(qOut,qSide,qLong,CoulombWeight);
+
+    fSmearPair->SetUnsmearedPair(pair);
+    double qOut_prime = fabs(fSmearPair->SmearedPair().qOutCMS());
+    double qSide_prime = fabs(fSmearPair->SmearedPair().qSideCMS());
+    double qLong_prime = fabs(fSmearPair->SmearedPair().qLongCMS());
+
+    fSMNumHisto->Fill(qOut_prime,qSide_prime,qLong_prime,CorrWeight);
+
+    double SmearedCoulombWeight = ( fCorrection ? 
+                                   fCorrection->CoulombCorrect(&(fSmearPair->SmearedPair())) : 
+                                   1.0);
+
+    fSMDenHisto->Fill(qOut_prime,qSide_prime,qLong_prime,SmearedCoulombWeight);
+  }
+  */
+}
+
+
+void AliFemtoBPLCMS3DCorrFctn::SetUseRPSelection(unsigned short aRPSel)
+{
+  fUseRPSelection = aRPSel;
+}
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBPLCMS3DCorrFctn.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBPLCMS3DCorrFctn.h
new file mode 100644 (file)
index 0000000..053eb8c
--- /dev/null
@@ -0,0 +1,121 @@
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// AliFemtoBPLCMS3DCorrFctn: a class to calculate 3D correlation         //
+// for pairs of identical particles.                                     //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+
+#ifndef ALIFEMTOBPLCMS3DCORRFCTN_H
+#define ALIFEMTOBPLCMS3DCORRFCTN_H
+
+#include "AliFemtoCorrFctn.h"
+//#include "AliFemtoCoulomb.h"
+#include "AliFemtoPairCut.h"
+//#include "AliFemtoHisto.h"
+#include "TH3D.h"
+//#include "AliFemtoSmearPair.h"
+
+class AliFemtoBPLCMS3DCorrFctn : public AliFemtoCorrFctn {
+public:
+  AliFemtoBPLCMS3DCorrFctn(char* title, const int& nbins, const float& QLo, const float& QHi);
+  AliFemtoBPLCMS3DCorrFctn(const AliFemtoBPLCMS3DCorrFctn& aCorrFctn);
+  virtual ~AliFemtoBPLCMS3DCorrFctn();
+
+  AliFemtoBPLCMS3DCorrFctn& operator=(const AliFemtoBPLCMS3DCorrFctn& aCorrFctn);
+
+  virtual AliFemtoString Report();
+  virtual void AddRealPair( AliFemtoPair* aPair);
+  virtual void AddMixedPair( AliFemtoPair* aPair);
+
+  virtual void Finish();
+
+  TH3D* Numerator();
+  TH3D* Denominator();
+  TH3D* Ratio();
+  TH3D* QinvHisto();
+
+  // here are get and set for the range over which the correlation function 
+  // is normalized (in Qinv).  The range is set to 0.15..0.18 in the constuctor
+  // by default, but the Set's below override this
+  void SetNormRangeLo(float qLo);
+  void SetNormRangeHi(float qHi);
+  float GetNormRangeLo() const;
+  float GetNormRangeHi() const;
+
+  void WriteOutHistos();
+  virtual TList* GetOutputList();
+
+  //  void SetCoulombCorrection(AliFemtoCoulomb* Correction);
+
+  void SetUseRPSelection(unsigned short aRPSel);
+
+  //  void SetSmearPair(AliFemtoSmearPair*);
+  void SetRout(double guess);
+  void SetRside(double guess);
+  void SetRlong(double guess);
+  void SetLambda(double guess);
+
+private:
+/*   // here are a whole bunch of histos that get filled if we do resolution correction */
+/*   TH3D* fIDNumHisto;        // true pairs numerator   */
+/*   TH3D* fIDDenHisto;        // true pairs denominator */
+/*   TH3D* fIDRatHisto;        // true pairs ratio       */
+/*   //  */
+/*   TH3D* fSMNumHisto;        // mixed pairs numerator   */
+/*   TH3D* fSMDenHisto;            // mixed pairs denominator */
+/*   TH3D* fSMRatHisto;            // mixed pairs ratio       */
+/*   // */
+/*   TH3D* fCorrectionHisto;   // correction histogram */
+/*   TH3D* fCorrCFHisto;       // Corrected CF */
+
+  TH3D* fNumerator;         // numerator
+  TH3D* fDenominator;       // denominator
+  //  TH3D* fUncorrectedDenominator;
+  TH3D* fRatio;             // ratio - the correlation function
+  TH3D* fQinvHisto;         // Qinv weights
+
+  // for resolution correction
+  //  AliFemtoSmearPair* fSmearPair; //!
+  double fLambda;           // lambda for smearing correction
+  double fRout2;            // Rout for smearing correction
+  double fRside2;           // Rside for smearing correction
+  double fRlong2;           // Rlong for smearing correction
+
+  // upper and lower bounds of Qinv region where to do normalization
+  float fQinvNormLo;        // Lower bound of Qinv normalization range
+  float fQinvNormHi;        // Upper bound of Qinv normalization range
+
+  // and here are the number of pairs in that region...
+  unsigned long int fNumRealsNorm; // pairs in numerator in Qinv normalization range
+  unsigned long int fNumMixedNorm; // pairs in denominator in Qinv normalization range
+
+ protected:
+  unsigned short fUseRPSelection;  // The pair cut uses RP selection
+
+  //  AliFemtoCoulomb* fCorrection; //!
+  
+
+#ifdef __ROOT__
+  ClassDef(AliFemtoBPLCMS3DCorrFctn, 1)
+#endif
+};
+
+inline  TH3D* AliFemtoBPLCMS3DCorrFctn::Numerator(){return fNumerator;}
+inline  TH3D* AliFemtoBPLCMS3DCorrFctn::Denominator(){return fDenominator;}
+//inline  TH3D* AliFemtoBPLCMS3DCorrFctn::UncorrectedDenominator(){return fUncorrectedDenominator;}
+inline  TH3D* AliFemtoBPLCMS3DCorrFctn::Ratio(){return fRatio;}
+inline  TH3D* AliFemtoBPLCMS3DCorrFctn::QinvHisto(){return fQinvHisto;}
+inline  void AliFemtoBPLCMS3DCorrFctn::SetNormRangeLo(float qLo){fQinvNormLo = qLo;}
+inline  void AliFemtoBPLCMS3DCorrFctn::SetNormRangeHi(float qHi){fQinvNormHi = qHi;}
+inline  float AliFemtoBPLCMS3DCorrFctn::GetNormRangeLo() const{return fQinvNormLo;}
+inline  float AliFemtoBPLCMS3DCorrFctn::GetNormRangeHi() const{return fQinvNormHi;}
+//inline  void AliFemtoBPLCMS3DCorrFctn::SetCoulombCorrection(AliFemtoCoulomb* Correction){fCorrection = Correction;}
+//inline  void AliFemtoBPLCMS3DCorrFctn::SetSmearPair(AliFemtoSmearPair* sp){fSmearPair = sp;}
+
+inline  void AliFemtoBPLCMS3DCorrFctn::SetRout(double r){fRout2 = r*r;}
+inline  void AliFemtoBPLCMS3DCorrFctn::SetRside(double r){fRside2 = r*r;}
+inline  void AliFemtoBPLCMS3DCorrFctn::SetRlong(double r){fRlong2 = r*r;}
+inline  void AliFemtoBPLCMS3DCorrFctn::SetLambda(double l){fLambda = l;}
+
+#endif
+
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBasicEventCut.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBasicEventCut.cxx
new file mode 100644 (file)
index 0000000..149a99c
--- /dev/null
@@ -0,0 +1,87 @@
+////////////////////////////////////////////////////////////////////////////////
+//                                                                            //
+// AliFemtoBasicEventCut - the basic cut for events.                          //
+// Only cuts on event multiplicity and z-vertex position                      //
+//                                                                            //
+////////////////////////////////////////////////////////////////////////////////
+
+#include "AliFemtoBasicEventCut.h"
+//#include <cstdio>
+
+#ifdef __ROOT__
+ClassImp(AliFemtoBasicEventCut)
+#endif
+
+AliFemtoBasicEventCut::AliFemtoBasicEventCut() :
+  AliFemtoEventCut(),
+  fEventMult(),
+  fVertZPos(),
+  fAcceptBadVertex(false), 
+  fNEventsPassed(0), 
+  fNEventsFailed(0),
+  fAcceptOnlyPhysics(true),
+  fSelectTrigger(0)
+{
+  // Default constructor
+  fEventMult[0] = 0;
+  fEventMult[1] = 100000;
+  fVertZPos[0] = -100.0;
+  fVertZPos[1] = 100.0;
+} 
+//------------------------------
+AliFemtoBasicEventCut::~AliFemtoBasicEventCut(){
+  // Default destructor
+}
+//------------------------------
+bool AliFemtoBasicEventCut::Pass(const AliFemtoEvent* event){
+  // Pass events if they fall within the multiplicity and z-vertex
+  // position range. Fail otherwise
+  //  int mult =  event->NumberOfTracks();
+  int mult = (int) event->UncorrectedNumberOfPrimaries();
+  double vertexZPos = event->PrimVertPos().z();
+//   cout << "AliFemtoBasicEventCut:: mult:       " << fEventMult[0] << " < " << mult << " < " << fEventMult[1] << endl;
+//   cout << "AliFemtoBasicEventCut:: VertexZPos: " << fVertZPos[0] << " < " << vertexZPos << " < " << fVertZPos[1] << endl;
+//   cout << "AliFemtoBasicEventCut:: VertexZErr: " << event->PrimVertCov()[4] << endl;
+  bool goodEvent =
+    ((mult >= fEventMult[0]) && 
+     (mult <= fEventMult[1]) && 
+     (vertexZPos > fVertZPos[0]) &&
+     (vertexZPos < fVertZPos[1]) &&
+     ((!fAcceptBadVertex) || (event->ZDCParticipants() > 1.0)) &&
+     ((!fAcceptOnlyPhysics) || (event->IsCollisionCandidate())) &&
+     ((!fSelectTrigger) || (event->TriggerCluster() == fSelectTrigger)));
+  goodEvent ? fNEventsPassed++ : fNEventsFailed++ ;
+//   cout << "AliFemtoBasicEventCut:: return : " << goodEvent << endl;
+//     (fAcceptBadVertex || (event->PrimVertCov()[4] > -1000.0)) &&
+  return (goodEvent);
+}
+//------------------------------
+AliFemtoString AliFemtoBasicEventCut::Report(){
+  // Prepare report
+  string stemp;
+  char ctemp[100];
+  snprintf(ctemp , 100, "\nMultiplicity:\t %d-%d",fEventMult[0],fEventMult[1]);
+  stemp = ctemp;
+  snprintf(ctemp , 100, "\nVertex Z-position:\t %E-%E",fVertZPos[0],fVertZPos[1]);
+  stemp += ctemp;
+  snprintf(ctemp , 100, "\nNumber of events which passed:\t%ld  Number which failed:\t%ld",fNEventsPassed,fNEventsFailed);
+  stemp += ctemp;
+  AliFemtoString returnThis = stemp;
+  return returnThis;
+}
+void AliFemtoBasicEventCut::SetAcceptBadVertex(bool b)
+{
+  fAcceptBadVertex = b;
+}
+bool AliFemtoBasicEventCut::GetAcceptBadVertex()
+{
+  return fAcceptBadVertex;
+}
+void AliFemtoBasicEventCut::SetAcceptOnlyPhysics(bool b)
+{
+  fAcceptOnlyPhysics = b;
+}
+bool AliFemtoBasicEventCut::GetAcceptOnlyPhysics()
+{
+  return fAcceptOnlyPhysics;
+}
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBasicEventCut.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBasicEventCut.h
new file mode 100644 (file)
index 0000000..f991459
--- /dev/null
@@ -0,0 +1,84 @@
+////////////////////////////////////////////////////////////////////////////////
+//                                                                            //
+// AliFemtoBasicEventCut - the basic cut for events.                          //
+// Only cuts on event multiplicity and z-vertex position                      //
+//                                                                            //
+////////////////////////////////////////////////////////////////////////////////
+
+#ifndef ALIFEMTOBASICEVENTCUT_H
+#define ALIFEMTOBASICEVENTCUT_H
+
+// do I need these lines ?
+//#ifndef StMaker_H
+//#include "StMaker.h"
+//#endif
+
+#include "AliFemtoEventCut.h"
+
+class AliFemtoBasicEventCut : public AliFemtoEventCut {
+
+public:
+
+  AliFemtoBasicEventCut();
+  AliFemtoBasicEventCut(AliFemtoBasicEventCut& c);
+  virtual ~AliFemtoBasicEventCut();
+  AliFemtoBasicEventCut& operator=(AliFemtoBasicEventCut& c);
+
+  void SetEventMult(const int& lo,const int& hi);
+  void SetVertZPos(const float& lo, const float& hi);
+  void SetAcceptBadVertex(bool b);
+  void SetAcceptOnlyPhysics(bool b);
+  int NEventsPassed() const;
+  int NEventsFailed() const;
+  bool GetAcceptBadVertex();
+  bool GetAcceptOnlyPhysics();
+  void SetTriggerSelection(int trig);
+
+  virtual AliFemtoString Report();
+  virtual bool Pass(const AliFemtoEvent* event);
+
+  AliFemtoBasicEventCut* Clone();
+
+private:   // here are the quantities I want to cut on...
+
+  int fEventMult[2];      // range of multiplicity
+  float fVertZPos[2];     // range of z-position of vertex
+  bool fAcceptBadVertex;  // Set to true to accept events with bad vertex
+  long fNEventsPassed;    // Number of events checked by this cut that passed
+  long fNEventsFailed;    // Number of events checked by this cut that failed
+  bool fAcceptOnlyPhysics;// Accept only physics events
+  int  fSelectTrigger;    // If set, only given trigger will be selected
+
+#ifdef __ROOT__
+  ClassDef(AliFemtoBasicEventCut, 1)
+#endif
+
+};
+
+inline void AliFemtoBasicEventCut::SetEventMult(const int& lo, const int& hi){fEventMult[0]=lo; fEventMult[1]=hi;}
+inline void AliFemtoBasicEventCut::SetVertZPos(const float& lo, const float& hi){fVertZPos[0]=lo; fVertZPos[1]=hi;}
+inline int  AliFemtoBasicEventCut::NEventsPassed() const {return fNEventsPassed;}
+inline int  AliFemtoBasicEventCut::NEventsFailed() const {return fNEventsFailed;}
+inline void AliFemtoBasicEventCut::SetTriggerSelection(int trig) { fSelectTrigger = trig; }
+inline AliFemtoBasicEventCut* AliFemtoBasicEventCut::Clone() { AliFemtoBasicEventCut* c = new AliFemtoBasicEventCut(*this); return c;}
+inline AliFemtoBasicEventCut::AliFemtoBasicEventCut(AliFemtoBasicEventCut& c) : AliFemtoEventCut(c), fAcceptBadVertex(false), fNEventsPassed(0), fNEventsFailed(0), fAcceptOnlyPhysics(false), fSelectTrigger(0) {
+  fEventMult[0] = c.fEventMult[0];
+  fEventMult[1] = c.fEventMult[1];
+  fVertZPos[0] = c.fVertZPos[0];
+  fVertZPos[1] = c.fVertZPos[1];
+}
+
+inline AliFemtoBasicEventCut& AliFemtoBasicEventCut::operator=(AliFemtoBasicEventCut& c) {   
+  if (this != &c) {
+    AliFemtoEventCut::operator=(c);
+    fEventMult[0] = c.fEventMult[0];
+    fEventMult[1] = c.fEventMult[1];
+    fVertZPos[0] = c.fVertZPos[0];
+    fVertZPos[1] = c.fVertZPos[1];
+  }
+
+  return *this;
+}
+
+
+#endif
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBasicTrackCut.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBasicTrackCut.cxx
new file mode 100644 (file)
index 0000000..34d0f28
--- /dev/null
@@ -0,0 +1,178 @@
+////////////////////////////////////////////////////////////////////////////////
+//                                                                            //
+// AliFemtoBasicTrackCut - the basic cut for tracks.                          //
+// Cuts on particle identification, transverse momentum, rapidity, distance   //
+// of closest approach to primary vertex and charge                           //
+//                                                                            //
+////////////////////////////////////////////////////////////////////////////////
+
+#include "AliFemtoBasicTrackCut.h"
+#include <cstdio>
+
+#ifdef __ROOT__ 
+ClassImp(AliFemtoBasicTrackCut)
+#endif
+
+AliFemtoBasicTrackCut::AliFemtoBasicTrackCut():
+  fCharge(0),
+  fNTracksPassed(0),
+  fNTracksFailed(0)
+{
+  // Default constructor
+  fNTracksPassed = fNTracksFailed = 0;
+  fCharge = 1;  // takes both charges 0
+  fNSigmaPion[0] = -100.0;   fNSigmaPion[1] = 100.0;
+  fNSigmaKaon[0] = -100.0;   fNSigmaKaon[1] = 100.0;
+  fNSigmaProton[0] = -100.0; fNSigmaProton[1] = 100.0;
+  fNHits[0] = 10;          fNHits[1] = 180;
+  fPt[0]=0.0;              fPt[1] = 100.0;//100
+  fRapidity[0]=-2;       fRapidity[1]=2;//-2 2
+  fDCA[0] = -1.0;           fDCA[1] = 20.0;
+
+}
+//------------------------------
+//AliFemtoBasicTrackCut::~AliFemtoBasicTrackCut(){
+//  /* noop */
+//}
+//------------------------------
+bool AliFemtoBasicTrackCut::Pass(const AliFemtoTrack* track){
+  // test the particle and return 
+  // true if it meets all the criteria
+  // false if it doesn't meet at least one of the criteria
+
+  //  return true ;  // THIS CUT IS A STHBTDUMMY!!
+
+  /*
+    cout << endl;
+    cout << "#track " << trackCount++;
+    cout << " * pion " << (track->NSigmaPion() > fNSigmaPion[0]) && (track->NSigmaPion() < fNSigmaPion[1]);
+    cout << " * kaon " << (track->NSigmaKaon() > fNSigmaKaon[0]) && (track->NSigmaKaon() < fNSigmaKaon[1]);
+    cout << " * proton " << (track->NSigmaProton() > fNSigmaProton[0]) && (track->NSigmaProton() < fNSigmaProton[1]);
+    cout << " * charge " << (track->Charge() == fCharge);
+  */
+  bool goodPID = 1;  
+  /* ----- NOT DOING PID CUTS !!!! ------
+  bool goodPID = ((track->NSigmaPion()   > fNSigmaPion[0]) &&
+                  (track->NSigmaPion()   < fNSigmaPion[1]) &&
+                  (track->NSigmaKaon()   > fNSigmaKaon[0]) &&
+                  (track->NSigmaKaon()   < fNSigmaKaon[1]) &&
+                  (track->NSigmaProton() > fNSigmaProton[0]) &&
+                  (track->NSigmaProton() < fNSigmaProton[1]));
+  ----- NOT DOING PID CUTS !!!! ------ */
+  if (fCharge !=0){               // if user requests "charge=0" then that means ignore charge
+    goodPID = (goodPID&&(track->Charge() == fCharge));
+  }
+  if (goodPID){
+    float tEnergy = ::sqrt(track->P().Mag2()+fMass*fMass);
+    float tRapidity = 0.5*::log((tEnergy+track->P().z())/
+                           (tEnergy-track->P().z()));
+
+    float tPt = ::sqrt((track->P().x())*(track->P().x())+
+                    (track->P().y())*(track->P().y()));
+
+    
+    /*
+      cout << " * DCAxy " << (track->DCAxy()  > fDCA[0]) && (track->DCAxy()  < fDCA[1]);
+      cout << " * fDCA[0] " << fDCA[0];
+      cout << " * fDCA[1] " << fDCA[1];
+      cout << " * track->DCAxy " << track->DCAxy();
+      cout << " * NHits " <<  (track->NHits() > fNHits[0]) && (track->NHits() < fNHits[1]); 
+      cout << " * tPt " << (tPt > fPt[0]) && (tPt < fPt[1]);
+      cout << " * y " << (tRapidity > fRapidity[0]) && (tRapidity < fRapidity[1]);
+      cout << endl;
+    */
+
+    bool goodTrack=
+      (//(track->DCAxy()  > fDCA[0]) &&
+     //  (track->DCAxy()  < fDCA[1]) &&
+  //     (track->NHits() > fNHits[0]) &&
+    //   (track->NHits() < fNHits[1]) &&
+       (tPt             > fPt[0]) &&
+       (tPt             < fPt[1]) &&
+       (tRapidity      > fRapidity[0]) &&
+       (tRapidity      < fRapidity[1]));
+    //  &&
+    //       (track->PidProbPion()>0.5)&&//moje
+    //       (track->PidProbMuon()<0.47)&&//moje
+    //       (track->Label()>0);//moje
+
+    //    cout << track->DCAxy() << " " << track->NHits() << " " << Pt << " " << tRapidity << " " << tEnergy << endl;
+
+    goodTrack ? fNTracksPassed++ : fNTracksFailed++;
+    return (goodTrack);
+  }
+  else{
+    fNTracksFailed++;
+    return (goodPID);
+  }
+}
+//------------------------------
+AliFemtoString AliFemtoBasicTrackCut::Report(){
+  // construct report
+  string tStemp;
+  char tCtemp[100];
+  snprintf(tCtemp , 100, "Particle mass:\t%E\n",this->Mass());
+  tStemp=tCtemp;
+  snprintf(tCtemp , 100, "Particle charge:\t%d\n",fCharge);
+  tStemp=tCtemp;
+  snprintf(tCtemp , 100, "Particle Nsigma from pion:\t%E - %E\n",fNSigmaPion[0],fNSigmaPion[1]);
+  tStemp+=tCtemp;
+  snprintf(tCtemp , 100, "Particle Nsigma from kaon:\t%E - %E\n",fNSigmaKaon[0],fNSigmaKaon[1]);
+  tStemp+=tCtemp;
+  snprintf(tCtemp , 100, "Particle Nsigma from proton:\t%E - %E\n",fNSigmaProton[0],fNSigmaProton[1]);
+  tStemp+=tCtemp;
+  snprintf(tCtemp , 100, "Particle #hits:\t%d - %d\n",fNHits[0],fNHits[1]);
+  tStemp+=tCtemp;
+  snprintf(tCtemp , 100, "Particle pT:\t%E - %E\n",fPt[0],fPt[1]);
+  tStemp+=tCtemp;
+  snprintf(tCtemp , 100, "Particle rapidity:\t%E - %E\n",fRapidity[0],fRapidity[1]);
+  tStemp+=tCtemp;
+  snprintf(tCtemp , 100, "Particle DCA:\t%E - %E\n",fDCA[0],fDCA[1]);
+  tStemp+=tCtemp;
+  snprintf(tCtemp , 100, "Number of tracks which passed:\t%ld  Number which failed:\t%ld\n",fNTracksPassed,fNTracksFailed);
+  tStemp += tCtemp;
+  AliFemtoString returnThis = tStemp;
+  return returnThis;
+}
+
+TList *AliFemtoBasicTrackCut::ListSettings()
+{
+  // return a list of settings in a writable form
+  TList *tListSetttings = new TList();
+  char buf[200];
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.mass=%f", this->Mass());
+  tListSetttings->AddLast(new TObjString(buf));
+
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.charge=%i", fCharge);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.nsigmapion.minimum=%f", fNSigmaPion[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.nsigmapion.maximum=%f", fNSigmaPion[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.nsigmakaon.minimum=%f", fNSigmaKaon[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.nsigmakaon.maximum=%f", fNSigmaKaon[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.nsigmaproton.minimum=%f", fNSigmaProton[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.nsigmaproton.maximum=%f", fNSigmaProton[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.nhits.minimum=%i", fNHits[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.nhits.maximum=%i", fNHits[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.pt.minimum=%f", fPt[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.pt.maximum=%f", fPt[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.rapidity.minimum=%f", fRapidity[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.rapidity.maximum=%f", fRapidity[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.dca.minimum=%f", fDCA[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.dca.maximum=%f", fDCA[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+
+  return tListSetttings;
+}
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBasicTrackCut.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBasicTrackCut.h
new file mode 100644 (file)
index 0000000..d7ba801
--- /dev/null
@@ -0,0 +1,71 @@
+////////////////////////////////////////////////////////////////////////////////
+//                                                                            //
+// AliFemtoBasicTrackCut - the basic cut for tracks.                          //
+// Cuts on particle identification, transverse momentum, rapidity, distance   //
+// of closest approach to primary vertex and charge                           //
+//                                                                            //
+////////////////////////////////////////////////////////////////////////////////
+
+#ifndef ALIFEMTOBASICTRACKCUT_H
+#define ALIFEMTOBASICTRACKCUT_H
+
+//#ifndef StMaker_H
+//#include "StMaker.h"
+//#endif
+
+#include "AliFemtoTrackCut.h"
+
+class AliFemtoBasicTrackCut : public AliFemtoTrackCut {
+
+public:
+
+  AliFemtoBasicTrackCut();
+  //~mikesTrackCut();
+
+  virtual bool Pass(const AliFemtoTrack* tr);
+
+  virtual AliFemtoString Report();
+  virtual TList *ListSettings();
+
+  void SetNSigmaPion(const float& lo, const float& hi);
+  void SetNSigmaKaon(const float& lo, const float& hi);
+  void SetNSigmaProton(const float& lo, const float& hi);
+
+  void SetNHits(const int& lo, const int& hi);
+  void SetPt(const float& lo, const float& hi);
+  void SetRapidity(const float& lo, const float& hi);
+  void SetDCA(const float& lo, const float& hi);
+  void SetCharge(const int& ch);
+
+
+private:   // here are the quantities I want to cut on...
+
+  int               fCharge;             // charge of the track
+  float             fNSigmaPion[2];      // bounds for nsigma dEdx from pion band 
+  float             fNSigmaKaon[2];      // bounds for nsigma dEdx from kaon band
+  float             fNSigmaProton[2];    // bounds for nsigma dEdx from proton band
+  int               fNHits[2];           // bounds for number of hits
+  float             fPt[2];              // bounds for transverse momentum
+  float             fRapidity[2];        // bounds for rapidity
+  float             fDCA[2];             // bounds for DCA to primary vertex
+
+  long              fNTracksPassed;      // passed tracks counter
+  long              fNTracksFailed;      // falied tracks counter
+
+#ifdef __ROOT__ 
+  ClassDef(AliFemtoBasicTrackCut, 1)
+#endif
+};
+
+
+inline void AliFemtoBasicTrackCut::SetNSigmaPion(const float& lo, const float& hi){fNSigmaPion[0]=lo; fNSigmaPion[1]=hi;}
+inline void AliFemtoBasicTrackCut::SetNSigmaKaon(const float& lo, const float& hi){fNSigmaKaon[0]=lo; fNSigmaKaon[1]=hi;}
+inline void AliFemtoBasicTrackCut::SetNSigmaProton(const float& lo, const float& hi){fNSigmaProton[0]=lo; fNSigmaProton[1]=hi;}
+
+inline void AliFemtoBasicTrackCut::SetNHits(const int& lo, const int& hi){fNHits[0]=lo;fNHits[1]=hi;}
+inline void AliFemtoBasicTrackCut::SetPt(const float& lo, const float& hi){fPt[0]=lo; fPt[1]=hi;}
+inline void AliFemtoBasicTrackCut::SetRapidity(const float& lo,const float& hi){fRapidity[0]=lo; fRapidity[1]=hi;}
+inline void AliFemtoBasicTrackCut::SetDCA(const float& lo,const float& hi){fDCA[0]=lo; fDCA[1]=hi;}
+inline void AliFemtoBasicTrackCut::SetCharge(const int& ch){fCharge = ch;}
+
+#endif
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn.cxx
new file mode 100644 (file)
index 0000000..0e25566
--- /dev/null
@@ -0,0 +1,21 @@
+////////////////////////////////////////////////////////////////////////////////
+/// AliFemtoCorrFctn - the pure virtual base class for correlation function  ///
+/// All correlation function classes must inherit from this one              ///
+////////////////////////////////////////////////////////////////////////////////
+#include "AliFemtoCorrFctn.h"
+
+void AliFemtoCorrFctn::AddRealPair(AliFemtoPair*) { cout << "Not implemented" << endl; }
+void AliFemtoCorrFctn::AddMixedPair(AliFemtoPair*) { cout << "Not implemented" << endl; }
+
+AliFemtoCorrFctn::AliFemtoCorrFctn(const AliFemtoCorrFctn& /* c */):fyAnalysis(0),fPairCut(0x0) {}
+AliFemtoCorrFctn::AliFemtoCorrFctn(): fyAnalysis(0),fPairCut(0x0) {/* no-op */}
+void AliFemtoCorrFctn::SetAnalysis(AliFemtoAnalysis* analysis) { fyAnalysis = analysis; }
+AliFemtoCorrFctn& AliFemtoCorrFctn::operator=(const AliFemtoCorrFctn& aCorrFctn) { if (this == &aCorrFctn) return *this; fyAnalysis = aCorrFctn.fyAnalysis; fPairCut = aCorrFctn.fPairCut; return *this; }
+
+void AliFemtoCorrFctn::EventBegin(const AliFemtoEvent* /* aEvent */) { /* no-op */ }
+void AliFemtoCorrFctn::EventEnd(const AliFemtoEvent* /* aEvent */) { /* no-op */ }
+void AliFemtoCorrFctn::SetPairSelectionCut(AliFemtoPairCut* aCut) { fPairCut =  aCut; }
+
+#ifdef __ROOT__
+ClassImp(AliFemtoCorrFctn)
+#endif
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn.h
new file mode 100644 (file)
index 0000000..a8f6e08
--- /dev/null
@@ -0,0 +1,51 @@
+////////////////////////////////////////////////////////////////////////////////
+/// AliFemtoCorrFctn - the pure virtual base class for correlation function  ///
+/// All correlation function classes must inherit from this one              ///
+////////////////////////////////////////////////////////////////////////////////
+#ifndef AliFemtoCorrFctn_hh
+#define AliFemtoCorrFctn_hh
+
+#include "AliFemtoAnalysis.h"
+#include "AliFemtoEvent.h"
+#include "AliFemtoPair.h"
+#include "AliFemtoPairCut.h"
+
+class AliFemtoCorrFctn{
+
+  friend class AliFemtoAnalysis;
+
+public:
+  AliFemtoCorrFctn();
+  AliFemtoCorrFctn(const AliFemtoCorrFctn& aCorrFctn);
+  virtual ~AliFemtoCorrFctn(){/* no-op */};
+  AliFemtoCorrFctn& operator=(const AliFemtoCorrFctn& aCorrFctn);
+
+  virtual AliFemtoString Report() = 0;
+
+  virtual void AddRealPair(AliFemtoPair* aPair);
+  virtual void AddMixedPair(AliFemtoPair* aPir);
+
+  virtual void EventBegin(const AliFemtoEvent* aEvent);
+  virtual void EventEnd(const AliFemtoEvent* aEvent);
+  virtual void Finish() = 0;
+
+  virtual TList* GetOutputList() = 0;
+
+  virtual AliFemtoCorrFctn* Clone() { return 0;}
+
+  AliFemtoAnalysis* HbtAnalysis(){return fyAnalysis;};
+  void SetAnalysis(AliFemtoAnalysis* aAnalysis);
+  void SetPairSelectionCut(AliFemtoPairCut* aCut);
+
+protected:
+  AliFemtoAnalysis* fyAnalysis; //! link to the analysis
+  AliFemtoPairCut* fPairCut;    //! this is a PairSelection criteria for this Correlation Function
+
+  private:
+
+#ifdef __ROOT__
+  ClassDef(AliFemtoCorrFctn, 1)
+#endif
+};
+
+#endif
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn3DLCMSSym.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn3DLCMSSym.cxx
new file mode 100644 (file)
index 0000000..9d6926d
--- /dev/null
@@ -0,0 +1,153 @@
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// AliFemtoCorrFctn3DLCMSSym: a class to calculate 3D correlation        //
+// for pairs of identical particles.                                     //
+// In analysis the function should be first created in a macro, then     //
+// added to the analysis, and at the end of the macro the procedure to   //
+// write out histograms should be called.                                //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+
+#include "AliFemtoCorrFctn3DLCMSSym.h"
+#include <cstdio>
+
+#ifdef __ROOT__ 
+ClassImp(AliFemtoCorrFctn3DLCMSSym)
+#endif
+
+//____________________________
+AliFemtoCorrFctn3DLCMSSym::AliFemtoCorrFctn3DLCMSSym(char* title, const int& nbins, const float& QHi)
+  :
+  AliFemtoCorrFctn(),
+  fNumerator(0),
+  fDenominator(0)
+{
+  // Basic constructor
+
+  // set up numerator
+  char tTitNum[101] = "Num";
+  strncat(tTitNum,title, 100);
+  fNumerator = new TH3F(tTitNum,title,nbins,-QHi,QHi,nbins,-QHi,QHi,nbins/2,0.0,QHi);
+  // set up denominator
+  char tTitDen[101] = "Den";
+  strncat(tTitDen,title, 100);
+  fDenominator = new TH3F(tTitDen,title,nbins,-QHi,QHi,nbins,-QHi,QHi,nbins/2,0.0,QHi);
+
+  // to enable error bar calculation...
+  fNumerator->Sumw2();
+  fDenominator->Sumw2();
+}
+
+AliFemtoCorrFctn3DLCMSSym::AliFemtoCorrFctn3DLCMSSym(const AliFemtoCorrFctn3DLCMSSym& aCorrFctn) :
+  AliFemtoCorrFctn(aCorrFctn),
+  fNumerator(0),
+  fDenominator(0)
+{
+  // Copy constructor
+  fNumerator = new TH3F(*aCorrFctn.fNumerator);
+  fDenominator = new TH3F(*aCorrFctn.fDenominator);
+}
+//____________________________
+AliFemtoCorrFctn3DLCMSSym::~AliFemtoCorrFctn3DLCMSSym(){
+  // Destructor
+  delete fNumerator;
+  delete fDenominator;
+}
+//_________________________
+AliFemtoCorrFctn3DLCMSSym& AliFemtoCorrFctn3DLCMSSym::operator=(const AliFemtoCorrFctn3DLCMSSym& aCorrFctn)
+{
+  // assignment operator
+  if (this == &aCorrFctn)
+    return *this;
+
+  if (fNumerator) delete fNumerator;
+  fNumerator = new TH3F(*aCorrFctn.fNumerator);
+  if (fDenominator) delete fDenominator;
+  fDenominator = new TH3F(*aCorrFctn.fDenominator);
+
+  return *this;
+}
+
+//_________________________
+void AliFemtoCorrFctn3DLCMSSym::WriteOutHistos(){
+  // Write out all histograms to file
+  fNumerator->Write();
+  fDenominator->Write();
+}
+//______________________________
+TList* AliFemtoCorrFctn3DLCMSSym::GetOutputList()
+{
+  // Prepare the list of objects to be written to the output
+  TList *tOutputList = new TList();
+
+  tOutputList->Add(fNumerator); 
+  tOutputList->Add(fDenominator);  
+
+  return tOutputList;
+}
+
+//_________________________
+void AliFemtoCorrFctn3DLCMSSym::Finish(){
+  // here is where we should normalize, fit, etc...
+
+}
+
+//____________________________
+AliFemtoString AliFemtoCorrFctn3DLCMSSym::Report(){
+  // Construct the report
+  string stemp = "LCMS Frame Bertsch-Pratt 3D Correlation Function Report:\n";
+  char ctemp[100];
+  snprintf(ctemp , 100, "Number of entries in numerator:\t%E\n",fNumerator->GetEntries());
+  stemp += ctemp;
+  snprintf(ctemp , 100, "Number of entries in denominator:\t%E\n",fDenominator->GetEntries());
+  stemp += ctemp;
+
+  if (fPairCut){
+    snprintf(ctemp , 100, "Here is the PairCut specific to this CorrFctn\n");
+    stemp += ctemp;
+    stemp += fPairCut->Report();
+  }
+  else{
+    snprintf(ctemp , 100, "No PairCut specific to this CorrFctn\n");
+    stemp += ctemp;
+  }
+
+  //  
+  AliFemtoString returnThis = stemp;
+  return returnThis;
+}
+//____________________________
+void AliFemtoCorrFctn3DLCMSSym::AddRealPair( AliFemtoPair* pair){
+  // perform operations on real pairs
+  if (fPairCut){
+    if (!(fPairCut->Pass(pair))) return;
+  }
+
+  double qOut = (pair->QOutCMS());
+  double qSide = (pair->QSideCMS());
+  double qLong = (pair->QLongCMS());
+
+  if (qLong > 0.0)
+    fNumerator->Fill(qOut,qSide,qLong);
+  else
+    fNumerator->Fill(-qOut,-qSide,-qLong);
+    
+}
+//____________________________
+void AliFemtoCorrFctn3DLCMSSym::AddMixedPair( AliFemtoPair* pair){
+  // perform operations on mixed pairs
+  if (fPairCut){
+    if (!(fPairCut->Pass(pair))) return;
+  }
+
+  double qOut = (pair->QOutCMS());
+  double qSide = (pair->QSideCMS());
+  double qLong = (pair->QLongCMS());
+
+  if (qLong > 0.0)
+    fDenominator->Fill(qOut,qSide,qLong,1.0);
+  else
+    fDenominator->Fill(-qOut,-qSide,-qLong,1.0);
+}
+
+
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn3DLCMSSym.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn3DLCMSSym.h
new file mode 100644 (file)
index 0000000..561d68c
--- /dev/null
@@ -0,0 +1,49 @@
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// AliFemtoCorrFctn3DLCMSSym: a class to calculate 3D correlation        //
+// for pairs of identical particles vs. Bertsh-Pratt coordinates.        //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+
+#ifndef ALIFEMTOCORRFCTN3DLCMS_H
+#define ALIFEMTOCORRFCTN3DLCMS_H
+
+#include "AliFemtoCorrFctn.h"
+#include "AliFemtoPairCut.h"
+#include "TH3F.h"
+
+class AliFemtoCorrFctn3DLCMSSym : public AliFemtoCorrFctn {
+public:
+  AliFemtoCorrFctn3DLCMSSym(char* title, const int& nbins, const float& QHi);
+  AliFemtoCorrFctn3DLCMSSym(const AliFemtoCorrFctn3DLCMSSym& aCorrFctn);
+  virtual ~AliFemtoCorrFctn3DLCMSSym();
+
+  AliFemtoCorrFctn3DLCMSSym& operator=(const AliFemtoCorrFctn3DLCMSSym& aCorrFctn);
+
+  virtual AliFemtoString Report();
+  virtual void AddRealPair( AliFemtoPair* aPair);
+  virtual void AddMixedPair( AliFemtoPair* aPair);
+
+  virtual void Finish();
+
+  TH3F* Numerator();
+  TH3F* Denominator();
+
+  void WriteOutHistos();
+  virtual TList* GetOutputList();
+
+private:
+
+  TH3F* fNumerator;         // numerator
+  TH3F* fDenominator;       // denominator
+
+#ifdef __ROOT__
+  ClassDef(AliFemtoCorrFctn3DLCMSSym, 1)
+#endif
+};
+
+inline  TH3F* AliFemtoCorrFctn3DLCMSSym::Numerator(){return fNumerator;}
+inline  TH3F* AliFemtoCorrFctn3DLCMSSym::Denominator(){return fDenominator;}
+
+#endif
+
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn3DSpherical.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn3DSpherical.cxx
new file mode 100644 (file)
index 0000000..e0cd28f
--- /dev/null
@@ -0,0 +1,159 @@
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// AliFemtoCorrFctn3DSpherical: a class to calculate 3D correlation      //
+// for pairs of identical particles, binned in spherical coordinates.    //
+// In analysis the function should be first created in a macro, then     //
+// added to the analysis, and at the end of the macro the procedure to   //
+// write out histograms should be called.                                //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+
+#include "AliFemtoCorrFctn3DSpherical.h"
+#include <TMath.h>
+#include <cstdio>
+
+#ifdef __ROOT__ 
+ClassImp(AliFemtoCorrFctn3DSpherical)
+#endif
+
+//____________________________
+  AliFemtoCorrFctn3DSpherical::AliFemtoCorrFctn3DSpherical(char* title, const int& nqbins, const float& QLo, const float& QHi, const int& nphibins, const int& ncthetabins):
+  fNumerator(0),
+  fDenominator(0) //,
+                                                         //  fPairCut(0x0)
+{
+  // set up numerator
+  char tTitNum[101] = "Num";
+  strncat(tTitNum,title, 100);
+  fNumerator = new TH3D(tTitNum,title,nqbins,QLo,QHi,nphibins,-TMath::Pi(),TMath::Pi(),ncthetabins,-1.0,1.0);
+  // set up denominator
+  char tTitDen[101] = "Den";
+  strncat(tTitDen,title, 100);
+  fDenominator = new TH3D(tTitDen,title,nqbins,QLo,QHi,nphibins,-TMath::Pi(),TMath::Pi(),ncthetabins,-1.0,1.0);
+
+  // to enable error bar calculation...
+  fNumerator->Sumw2();
+  fDenominator->Sumw2();
+}
+
+AliFemtoCorrFctn3DSpherical::AliFemtoCorrFctn3DSpherical(const AliFemtoCorrFctn3DSpherical& aCorrFctn) :
+  AliFemtoCorrFctn(aCorrFctn),
+  fNumerator(0),
+  fDenominator(0) //,
+                                                       //  fPairCut(0x0)
+{
+  // Copy constructor
+  fNumerator = new TH3D(*aCorrFctn.fNumerator);
+  fDenominator = new TH3D(*aCorrFctn.fDenominator);
+  //  fPairCut = aCorrFctn.fPairCut;
+}
+//____________________________
+AliFemtoCorrFctn3DSpherical::~AliFemtoCorrFctn3DSpherical(){
+  // Destructor
+  delete fNumerator;
+  delete fDenominator;
+}
+//_________________________
+AliFemtoCorrFctn3DSpherical& AliFemtoCorrFctn3DSpherical::operator=(const AliFemtoCorrFctn3DSpherical& aCorrFctn)
+{
+  // assignment operator
+  if (this == &aCorrFctn)
+    return *this;
+
+  if (fNumerator) delete fNumerator;
+  fNumerator = new TH3D(*aCorrFctn.fNumerator);
+  if (fDenominator) delete fDenominator;
+  fDenominator = new TH3D(*aCorrFctn.fDenominator);
+  
+  //  fPairCut = aCorrFctn.fPairCut;
+  
+  return *this;
+}
+
+//_________________________
+void AliFemtoCorrFctn3DSpherical::WriteOutHistos(){
+  // Write out all histograms to file
+  fNumerator->Write();
+  fDenominator->Write();
+}
+//______________________________
+TList* AliFemtoCorrFctn3DSpherical::GetOutputList()
+{
+  // Prepare the list of objects to be written to the output
+  TList *tOutputList = new TList();
+
+  tOutputList->Add(fNumerator); 
+  tOutputList->Add(fDenominator);  
+
+  return tOutputList;
+}
+
+//_________________________
+void AliFemtoCorrFctn3DSpherical::Finish(){
+  // here is where we should normalize, fit, etc...
+}
+
+//____________________________
+AliFemtoString AliFemtoCorrFctn3DSpherical::Report(){
+  // Construct the report
+  string stemp = "PRF Frame Spherical 3D Correlation Function Report:\n";
+  char ctemp[100];
+  snprintf(ctemp , 100, "Number of entries in numerator:\t%E\n",fNumerator->GetEntries());
+  stemp += ctemp;
+  snprintf(ctemp , 100, "Number of entries in denominator:\t%E\n",fDenominator->GetEntries());
+  stemp += ctemp;
+
+  if (fPairCut){
+    snprintf(ctemp , 100, "Here is the PairCut specific to this CorrFctn\n");
+    stemp += ctemp;
+    stemp += fPairCut->Report();
+  }
+  else{
+    snprintf(ctemp , 100, "No PairCut specific to this CorrFctn\n");
+    stemp += ctemp;
+  }
+
+  //  
+  AliFemtoString returnThis = stemp;
+  return returnThis;
+}
+//____________________________
+void AliFemtoCorrFctn3DSpherical::AddRealPair( AliFemtoPair* pair){
+  // perform operations on real pairs
+  if (fPairCut){
+    if (!(fPairCut->Pass(pair))) return;
+  }
+
+  double tKO = pair->KOut();
+  double tKS = pair->KSide();
+  double tKL = pair->KLong();
+
+  double tKR = sqrt(tKO*tKO + tKS*tKS + tKL*tKL);
+  double tKC;
+  if ( fabs(tKR) < 1e-10 ) tKC = 0.0;
+  else tKC=tKL/tKR;
+  double tKP=atan2(tKS,tKO);
+
+  fNumerator->Fill(tKR,tKP,tKC);
+}
+//____________________________
+void AliFemtoCorrFctn3DSpherical::AddMixedPair( AliFemtoPair* pair){
+  // perform operations on mixed pairs
+  if (fPairCut){
+    if (!(fPairCut->Pass(pair))) return;
+  }
+
+  double tKO = pair->KOut();
+  double tKS = pair->KSide();
+  double tKL = pair->KLong();
+
+  double tKR = sqrt(tKO*tKO + tKS*tKS + tKL*tKL);
+  double tKC;
+  if ( fabs(tKR) < 1e-10 ) tKC = 0.0;
+  else tKC=tKL/tKR;
+  double tKP=atan2(tKS,tKO);
+
+  fDenominator->Fill(tKR,tKP,tKC);
+}
+
+
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn3DSpherical.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn3DSpherical.h
new file mode 100644 (file)
index 0000000..de5b207
--- /dev/null
@@ -0,0 +1,52 @@
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// AliFemtoCorrFctn3DSpherical: a class to calculate 3D correlation      //
+// for pairs of identical particles, binned in spherical coordinates     //
+// (q_inv, phi, cos(theta))
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+
+#ifndef ALIFEMTOCORRFCTN3DSPHERICAL_H
+#define ALIFEMTOCORRFCTN3DSPHERICAL_H
+
+#include "AliFemtoCorrFctn.h"
+#include "AliFemtoPairCut.h"
+#include "TH3D.h"
+
+class AliFemtoCorrFctn3DSpherical : public AliFemtoCorrFctn {
+public:
+  AliFemtoCorrFctn3DSpherical(char* title, 
+                             const int& nqbins, const float& QLo, const float& QHi,
+                             const int& nphibins, const int& ncthetabins);
+  AliFemtoCorrFctn3DSpherical(const AliFemtoCorrFctn3DSpherical& aCorrFctn);
+  virtual ~AliFemtoCorrFctn3DSpherical();
+
+  AliFemtoCorrFctn3DSpherical& operator=(const AliFemtoCorrFctn3DSpherical& aCorrFctn);
+
+  virtual AliFemtoString Report();
+  virtual void AddRealPair( AliFemtoPair* aPair);
+  virtual void AddMixedPair( AliFemtoPair* aPair);
+
+  virtual void Finish();
+
+  void WriteOutHistos();
+  virtual TList* GetOutputList();
+
+  //  void SetSpecificPairCut(AliFemtoPairCut* aCut);
+
+private:
+  // here are a whole bunch of histos that get filled if we do resolution correction
+  TH3D* fNumerator;         // numerator
+  TH3D* fDenominator;       // denominator
+
+  //  AliFemtoPairCut* fPairCut;    //! this is a PairCut specific to THIS CorrFctn, not the Analysis
+
+#ifdef __ROOT__
+  ClassDef(AliFemtoCorrFctn3DSpherical, 1)
+#endif
+};
+
+//inline  void AliFemtoCorrFctn3DSpherical::SetSpecificPairCut(AliFemtoPairCut* pc){fPairCut=pc;}
+
+#endif
+
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctnCollection.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctnCollection.h
new file mode 100644 (file)
index 0000000..0f3ce92
--- /dev/null
@@ -0,0 +1,48 @@
+/***************************************************************************
+ *
+ * $Id$
+ *
+ * Author: Mike Lisa, Ohio State, lisa@mps.ohio-state.edu
+ ***************************************************************************
+ *
+ * Description: part of STAR HBT Framework: AliFemtoMaker package
+ *   The CorrFctnCollection contains pointers to all Correlation Functions
+ *   that are associated with a particular Analysis object.
+ *
+ ***************************************************************************
+ *
+ * $Log$
+ * Revision 1.1.1.1  2007/04/25 15:38:41  panos
+ * Importing the HBT code dir
+ *
+ * Revision 1.1.1.1  2007/03/07 10:14:49  mchojnacki
+ * First version on CVS
+ *
+ * Revision 1.2  2000/02/01 00:33:32  laue
+ * namespaces changed to run on the new Solaris Compiler CC5
+ * since we can use member templates in franks1Histo.h we are doing it
+ *
+ * Revision 1.1.1.1  1999/06/29 16:02:57  lisa
+ * Installation of AliFemtoMaker
+ *
+ **************************************************************************/
+
+#ifndef AliFemtoCorrFctnCollection_hh
+#define AliFemtoCorrFctnCollection_hh
+
+
+#include <list>
+#if !defined(ST_NO_NAMESPACES)
+using std::list;
+#endif
+class AliFemtoCorrFctn;
+
+#ifdef ST_NO_TEMPLATE_DEF_ARGS
+typedef list<AliFemtoCorrFctn*, allocator<AliFemtoCorrFctn*> >            AliFemtoCorrFctnCollection;
+typedef list<AliFemtoCorrFctn*, allocator<AliFemtoCorrFctn*> >::iterator  AliFemtoCorrFctnIterator;
+#else
+typedef list<AliFemtoCorrFctn*>            AliFemtoCorrFctnCollection;
+typedef list<AliFemtoCorrFctn*>::iterator  AliFemtoCorrFctnIterator;
+#endif
+
+#endif
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctnNonIdDR.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctnNonIdDR.cxx
new file mode 100644 (file)
index 0000000..2e85c43
--- /dev/null
@@ -0,0 +1,272 @@
+////////////////////////////////////////////////////////////////////////////////
+//                                                                            //
+// AliFemtoCorrFctnNonIdDR - correlation function for non-identical particles //
+// uses k* as a function variable. Stores the correlation function separately //
+// for positive and negative signs of k* projections into out, side and long  //
+// directions, enabling the calculations of double ratios                     //
+//                                                                            //
+////////////////////////////////////////////////////////////////////////////////
+
+#include "AliFemtoCorrFctnNonIdDR.h"
+//#include "AliFemtoHisto.h"
+#include <cstdio>
+
+#ifdef __ROOT__ 
+ClassImp(AliFemtoCorrFctnNonIdDR)
+#endif
+
+//____________________________
+AliFemtoCorrFctnNonIdDR::AliFemtoCorrFctnNonIdDR(char* title, const int& nbins, const float& QinvLo, const float& QinvHi):
+  fNumOutP(0), 
+  fNumOutN(0),  
+  fNumSideP(0), 
+  fNumSideN(0), 
+  fNumLongP(0), 
+  fNumLongN(0), 
+  fDenOutP(0),  
+  fDenOutN(0),  
+  fDenSideP(0), 
+  fDenSideN(0), 
+  fDenLongP(0), 
+  fDenLongN(0)
+{
+  // Default constructor
+  // set up numerators
+  char bufname[200];
+  snprintf(bufname, 200, "NumOutP%s", title);
+  fNumOutP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "NumOutN%s", title);
+  fNumOutN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "NumSideP%s", title);
+  fNumSideP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "NumSideN%s", title);
+  fNumSideN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "NumLongP%s", title);
+  fNumLongP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "NumLongN%s", title);
+  fNumLongN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+
+  // set up denominators
+  snprintf(bufname, 200, "DenOutP%s", title);
+  fDenOutP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "DenOutN%s", title);
+  fDenOutN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "DenSideP%s", title);
+  fDenSideP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "DenSideN%s", title);
+  fDenSideN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "DenLongP%s", title);
+  fDenLongP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+  snprintf(bufname, 200, "DenLongN%s", title);
+  fDenLongN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
+
+  // to enable error bar calculation...
+  fNumOutP->Sumw2(); 
+  fNumOutN->Sumw2();  
+  fNumSideP->Sumw2(); 
+  fNumSideN->Sumw2(); 
+  fNumLongP->Sumw2(); 
+  fNumLongN->Sumw2(); 
+  fDenOutP->Sumw2();  
+  fDenOutN->Sumw2();  
+  fDenSideP->Sumw2(); 
+  fDenSideN->Sumw2(); 
+  fDenLongP->Sumw2(); 
+  fDenLongN->Sumw2();
+}
+
+//____________________________
+AliFemtoCorrFctnNonIdDR::AliFemtoCorrFctnNonIdDR(const AliFemtoCorrFctnNonIdDR& aCorrFctn) :
+  AliFemtoCorrFctn(),
+  fNumOutP(0), 
+  fNumOutN(0),  
+  fNumSideP(0), 
+  fNumSideN(0), 
+  fNumLongP(0), 
+  fNumLongN(0), 
+  fDenOutP(0),  
+  fDenOutN(0),  
+  fDenSideP(0), 
+  fDenSideN(0), 
+  fDenLongP(0), 
+  fDenLongN(0)
+{
+  // copy constructor
+  if (aCorrFctn.fNumOutP)
+    fNumOutP = new TH1D(*aCorrFctn.fNumOutP);
+  if (aCorrFctn.fNumOutN)
+    fNumOutN = new TH1D(*aCorrFctn.fNumOutN);
+  if (aCorrFctn.fNumSideP)
+    fNumSideP = new TH1D(*aCorrFctn.fNumSideP);
+  if (aCorrFctn.fNumSideN)
+    fNumSideN = new TH1D(*aCorrFctn.fNumSideN);
+  if (aCorrFctn.fNumLongP)
+    fNumLongP = new TH1D(*aCorrFctn.fNumLongP);
+  if (aCorrFctn.fNumLongN)
+    fNumLongN = new TH1D(*aCorrFctn.fNumLongN);
+
+  if (aCorrFctn.fDenOutP)
+    fDenOutP = new TH1D(*aCorrFctn.fDenOutP);
+  if (aCorrFctn.fDenOutN)
+    fDenOutN = new TH1D(*aCorrFctn.fDenOutN);
+  if (aCorrFctn.fDenSideP)
+    fDenSideP = new TH1D(*aCorrFctn.fDenSideP);
+  if (aCorrFctn.fDenSideN)
+    fDenSideN = new TH1D(*aCorrFctn.fDenSideN);
+  if (aCorrFctn.fDenLongP)
+    fDenLongP = new TH1D(*aCorrFctn.fDenLongP);
+  if (aCorrFctn.fDenLongN)
+    fDenLongN = new TH1D(*aCorrFctn.fDenLongN);
+}
+//____________________________
+AliFemtoCorrFctnNonIdDR::~AliFemtoCorrFctnNonIdDR(){
+  delete fNumOutP; 
+  delete fNumOutN;  
+  delete fNumSideP; 
+  delete fNumSideN; 
+  delete fNumLongP; 
+  delete fNumLongN; 
+  delete fDenOutP;  
+  delete fDenOutN;  
+  delete fDenSideP; 
+  delete fDenSideN; 
+  delete fDenLongP; 
+  delete fDenLongN;
+}
+//_________________________
+AliFemtoCorrFctnNonIdDR& AliFemtoCorrFctnNonIdDR::operator=(const AliFemtoCorrFctnNonIdDR& aCorrFctn)
+{
+  // assignment operator
+  if (this == &aCorrFctn)
+    return *this;
+
+  if (aCorrFctn.fNumOutP)
+    fNumOutP = new TH1D(*aCorrFctn.fNumOutP);
+  if (aCorrFctn.fNumOutN)
+    fNumOutN = new TH1D(*aCorrFctn.fNumOutN);
+  if (aCorrFctn.fNumSideP)
+    fNumSideP = new TH1D(*aCorrFctn.fNumSideP);
+  if (aCorrFctn.fNumSideN)
+    fNumSideN = new TH1D(*aCorrFctn.fNumSideN);
+  if (aCorrFctn.fNumLongP)
+    fNumLongP = new TH1D(*aCorrFctn.fNumLongP);
+  if (aCorrFctn.fNumLongN)
+    fNumLongN = new TH1D(*aCorrFctn.fNumLongN);
+
+  if (aCorrFctn.fDenOutP)
+    fDenOutP = new TH1D(*aCorrFctn.fDenOutP);
+  if (aCorrFctn.fDenOutN)
+    fDenOutN = new TH1D(*aCorrFctn.fDenOutN);
+  if (aCorrFctn.fDenSideP)
+    fDenSideP = new TH1D(*aCorrFctn.fDenSideP);
+  if (aCorrFctn.fDenSideN)
+    fDenSideN = new TH1D(*aCorrFctn.fDenSideN);
+  if (aCorrFctn.fDenLongP)
+    fDenLongP = new TH1D(*aCorrFctn.fDenLongP);
+  if (aCorrFctn.fDenLongN)
+    fDenLongN = new TH1D(*aCorrFctn.fDenLongN);
+
+  return *this;
+}
+
+//_________________________
+void AliFemtoCorrFctnNonIdDR::Finish(){
+  // here is where we should normalize, fit, etc...
+  // we should NOT Draw() the histos (as I had done it below),
+  // since we want to insulate ourselves from root at this level
+  // of the code.  Do it instead at root command line with browser.
+  //  fNumerator->Draw();
+  //fDenominator->Draw();
+  //fRatio->Draw();
+  //  fRatio->Divide(fNumerator,fDenominator,1.0,1.0);
+
+}
+
+//____________________________
+AliFemtoString AliFemtoCorrFctnNonIdDR::Report(){
+  // construct report
+  string stemp = "Non-identical particles Correlation Function Report:\n";
+  char ctemp[100];
+  snprintf(ctemp , 100, "Number of entries in numerators:\t%E\n",fNumOutP->GetEntries()+fNumOutN->GetEntries());
+  stemp += ctemp;
+  snprintf(ctemp , 100, "Number of entries in denominators:\t%E\n",fDenOutP->GetEntries()+fDenOutN->GetEntries());
+  stemp += ctemp;
+  //  stemp += mCoulombWeight->Report();
+  AliFemtoString returnThis = stemp;
+  return returnThis;
+}
+//____________________________
+void AliFemtoCorrFctnNonIdDR::AddRealPair(AliFemtoPair* pair){
+  // add true pair
+  double tKStar = pair->KStar();
+  if (pair->KOut()>0.0)
+    fNumOutP->Fill(tKStar);
+  else
+    fNumOutN->Fill(tKStar);
+
+  if (pair->KSide()>0.0)
+    fNumSideP->Fill(tKStar);
+  else
+    fNumSideN->Fill(tKStar);
+
+  if (pair->KLong()>0.0)
+    fNumLongP->Fill(tKStar);
+  else
+    fNumLongN->Fill(tKStar);
+
+}
+//____________________________
+void AliFemtoCorrFctnNonIdDR::AddMixedPair(AliFemtoPair* pair){
+  // add mixed (background) pair
+  double tKStar = pair->KStar();
+  if (pair->KOut()>0.0)
+    fDenOutP->Fill(tKStar);
+  else
+    fDenOutN->Fill(tKStar);
+
+  if (pair->KSide()>0.0)
+    fDenSideP->Fill(tKStar);
+  else
+    fDenSideN->Fill(tKStar);
+
+  if (pair->KLong()>0.0)
+    fDenLongP->Fill(tKStar);
+  else
+    fDenLongN->Fill(tKStar);
+}
+//____________________________
+void AliFemtoCorrFctnNonIdDR::Write(){
+  fNumOutP->Write(); 
+  fNumOutN->Write();  
+  fNumSideP->Write(); 
+  fNumSideN->Write(); 
+  fNumLongP->Write(); 
+  fNumLongN->Write(); 
+  fDenOutP->Write();  
+  fDenOutN->Write();  
+  fDenSideP->Write(); 
+  fDenSideN->Write(); 
+  fDenLongP->Write(); 
+  fDenLongN->Write();
+}
+
+TList* AliFemtoCorrFctnNonIdDR::GetOutputList()
+{
+  // Prepare the list of objects to be written to the output
+  TList *tOutputList = new TList();
+
+  tOutputList->Add(fNumOutP); 
+  tOutputList->Add(fNumOutN);  
+  tOutputList->Add(fNumSideP); 
+  tOutputList->Add(fNumSideN); 
+  tOutputList->Add(fNumLongP); 
+  tOutputList->Add(fNumLongN); 
+  tOutputList->Add(fDenOutP);  
+  tOutputList->Add(fDenOutN);  
+  tOutputList->Add(fDenSideP); 
+  tOutputList->Add(fDenSideN); 
+  tOutputList->Add(fDenLongP); 
+  tOutputList->Add(fDenLongN);
+
+  return tOutputList;
+}
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctnNonIdDR.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctnNonIdDR.h
new file mode 100644 (file)
index 0000000..45edb66
--- /dev/null
@@ -0,0 +1,54 @@
+////////////////////////////////////////////////////////////////////////////////
+//                                                                            //
+// AliFemtoCorrFctnNonIdDR - correlation function for non-identical particles //
+// uses k* as a function variable. Stores the correlation function separately //
+// for positive and negative signs of k* projections into out, side and long  //
+// directions, enabling the calculations of double ratios                     //
+//                                                                            //
+////////////////////////////////////////////////////////////////////////////////
+#ifndef ALIFEMTOCORRFCTNNONIDDR_H
+#define ALIFEMTOCORRFCTNNONIDDR_H
+
+#include "TH1D.h"
+#include "AliFemtoCorrFctn.h"
+
+class AliFemtoCorrFctnNonIdDR : public AliFemtoCorrFctn {
+public:
+  AliFemtoCorrFctnNonIdDR(char* title, const int& nbins, const float& QinvLo, const float& QinvHi);
+  AliFemtoCorrFctnNonIdDR(const AliFemtoCorrFctnNonIdDR& aCorrFctn);
+  virtual ~AliFemtoCorrFctnNonIdDR();
+
+  AliFemtoCorrFctnNonIdDR& operator=(const AliFemtoCorrFctnNonIdDR& aCorrFctn);
+
+  virtual AliFemtoString Report();
+  virtual void AddRealPair(AliFemtoPair* aPair);
+  virtual void AddMixedPair(AliFemtoPair* aPair);
+
+  virtual void Finish();
+
+  virtual TList* GetOutputList();
+  void Write();
+
+private:
+  TH1D *fNumOutP;     // Numerator for pair with positive k*out
+  TH1D *fNumOutN;     // Numerator for pair with negative k*out
+  TH1D *fNumSideP;    // Numerator for pair with positive k*side
+  TH1D *fNumSideN;    // Numerator for pair with negative k*side
+  TH1D *fNumLongP;    // Numerator for pair with positive k*long
+  TH1D *fNumLongN;    // Numerator for pair with negative k*long
+
+  TH1D *fDenOutP;     // Denominator for pair with positive k*out
+  TH1D *fDenOutN;     // Denominator for pair with negative k*out
+  TH1D *fDenSideP;    // Denominator for pair with positive k*side
+  TH1D *fDenSideN;    // Denominator for pair with negative k*side
+  TH1D *fDenLongP;    // Denominator for pair with positive k*long
+  TH1D *fDenLongN;    // Denominator for pair with negative k*long
+
+#ifdef __ROOT__
+  ClassDef(AliFemtoCorrFctnNonIdDR, 1)
+#endif
+};
+
+
+#endif
+
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCoulomb.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCoulomb.cxx
new file mode 100644 (file)
index 0000000..7f905df
--- /dev/null
@@ -0,0 +1,472 @@
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// AliFemtoCoulomb: This is a Coulomb correction class which             //
+//  1. Reads in the dat from a file                                      //  
+//  2. Performs a linear interpolation in R and creates any array of     //
+//     interpolations                                                    //
+//  3. Interpolates in eta and returns the Coulomb correction to user    //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+
+#include "AliFemtoCoulomb.h"
+//#include "Stiostream.h"
+#include <stdio.h>
+#include <cassert>
+//#include "PhysicalConstants.h"
+#define fine_structure_const 0.00729735
+
+#ifdef __ROOT__
+ClassImp(AliFemtoCoulomb)
+#endif
+
+AliFemtoCoulomb::AliFemtoCoulomb() :
+  fFile(""),
+  fRadius(-1.0),
+  fZ1Z2(1.0),
+  fNLines(0)
+{
+  // Default constructor
+  fFile = "/afs/rhic/star/hbt/coul/AliFemtoCorrectionFiles/correctionpp.dat";
+  if (!fFile) {
+    cout << " No file, dummy!" << endl;
+    assert(0);
+  }
+  cout << "You have 1 default Coulomb correction!" << endl;
+
+  for (int ie=0; ie<1000; ie++) {
+    fEta[ie] = 0.0;
+    fCoulomb[ie] = 0.0;
+  }
+}
+
+AliFemtoCoulomb::AliFemtoCoulomb(const AliFemtoCoulomb& aCoul) :
+  fFile(aCoul.fFile),
+  fRadius(aCoul.fRadius),
+  fZ1Z2(aCoul.fZ1Z2),
+  fNLines(0)
+{
+  // copy constructor
+  CreateLookupTable(fRadius);
+}
+
+AliFemtoCoulomb::AliFemtoCoulomb(const char* readFile, const double& radius, const double& charge) :
+  fFile(readFile),
+  fRadius(radius),
+  fZ1Z2(0),
+  fNLines(0)
+{
+  // constructor with explicit filename
+  fFile = readFile;
+  fRadius = radius;
+  CreateLookupTable(fRadius);
+  fZ1Z2 = charge;
+  cout << "You have 1 Coulomb correction!" << endl;
+}
+
+AliFemtoCoulomb::~AliFemtoCoulomb() {
+  // destructor
+}
+
+AliFemtoCoulomb& AliFemtoCoulomb::operator=(const AliFemtoCoulomb& aCoul)
+{
+  // assignment operator
+  if (this == &aCoul)
+    return *this;
+
+  fFile = aCoul.fFile;
+  fRadius = aCoul.fRadius;
+  fZ1Z2 = aCoul.fZ1Z2;
+
+  CreateLookupTable(fRadius);
+  
+  return *this;
+}
+
+
+void AliFemtoCoulomb::SetRadius(const double& radius) {
+  // set the coulomb radius
+  cout << " AliFemtoCoulomb::setRadius() " << endl;
+  fRadius = radius;
+  CreateLookupTable(fRadius);
+}
+
+double AliFemtoCoulomb::GetRadius() const {
+  // return coulomb radius
+  return (fRadius);
+}
+
+void AliFemtoCoulomb::SetFile(const char* readFile) {
+  // set the filename with coulomb calculations
+  cout << " AliFemtoCoulomb::SetFile() " << endl;
+  fFile = readFile;
+  // Create new lookup table since file has changed
+  if (fRadius>0.0) {
+    CreateLookupTable(fRadius);
+  }
+}
+
+void AliFemtoCoulomb::SetChargeProduct(const double& charge) {
+  // set pair charge
+  cout << " AliFemtoCoulomb::SetChargeProduct() " << endl;
+  if ( fZ1Z2!=charge ) { 
+    fZ1Z2 = charge;
+    if ( fZ1Z2>0 ) {
+      fFile = "/afs/rhic/star/hbt/coul/AliFemtoCorrectionFiles/correctionpp.dat";
+    }
+    else {
+      fFile = "/afs/rhic/star/hbt/coul/AliFemtoCorrectionFiles/correctionpm.dat";
+    }
+    CreateLookupTable(fRadius);
+  }
+}
+
+void AliFemtoCoulomb::CreateLookupTable(const double& radius) {
+  // Read radii from fFile
+  // Create array(pair) of linear interpolation between radii
+  cout << " AliFemtoCoulomb::CreateLookupTable() " << endl;
+
+  if (radius<0.0) {
+    cout << " AliFemtoCoulomb::CreateLookupTable -> NEGATIVE RADIUS " << endl;
+    cout << "  call AliFemtoCoulomb::SetRadius(r) with positive r " << endl;
+    cerr << " AliFemtoCoulomb::CreateLookupTable -> NEGATIVE RADIUS " << endl;
+    cerr << "  call AliFemtoCoulomb::SetRadius(r) with positive r " << endl;
+    assert(0);
+  }
+  ifstream mystream(fFile);
+  if (!mystream) {
+    cout << "Could not open file" << endl;
+    assert(0);
+  }
+  else {
+    cout << "Input correction file opened" << endl;
+  }
+
+  static char tempstring[2001];
+  static float radii[2000];
+  static int tNRadii = 0;
+  tNRadii = 0;
+  if (!mystream.getline(tempstring,2000)) {
+    cout << "Could not read radii from file" << endl;
+    assert(0);
+  }
+  for (unsigned int ii=0; ii<strlen(tempstring); ii++) {
+    while (tempstring[ii]==' ') ii++;
+    sscanf(&tempstring[ii++],"%f",&radii[++tNRadii]);
+    while ( tempstring[ii]!=' ' && (ii)<strlen(tempstring) )ii++;
+  }
+  cout << " Read " << tNRadii << " radii from file" << endl;
+
+  static double tLowRadius = -1.0;
+  static double tHighRadius = -1.0;
+  static int tLowIndex = 0;
+  tLowRadius = -1.0;
+  tHighRadius = -1.0;
+  tLowIndex = 0;
+  for(int iii=1; iii<=tNRadii-1; iii++) { // Loop to one less than #radii
+    if ( radius >= radii[iii] && radius <= radii[iii+1] ) {
+      tLowRadius = radii[iii];
+      tHighRadius = radii[iii+1];
+      tLowIndex = iii;
+    }
+  }
+  if ( (tLowRadius < 0.0) || (tHighRadius < 0.0) ) {
+    cout << "AliFemtoCoulomb::CreateLookupTable --> Problem interpolating radius" << endl;
+    cout << "  Check range of radii in lookup file...." << endl;
+    cerr << "AliFemtoCoulomb::CreateLookupTable --> Problem interpolating radius" << endl;
+    cerr << "  Check range of radii in lookup file...." << endl;
+    assert(0);
+  }
+
+  static double corr[100];           // array of corrections ... must be > tNRadii
+  fNLines = 0;
+  static double tempEta = 0;
+  tempEta = 0;
+  while (mystream >> tempEta) {
+    for (int i=1; i<=tNRadii; i++) {
+      mystream >> corr[i];
+    }
+    static double tLowCoulomb = 0;
+    static double tHighCoulomb = 0;
+    static double nCorr = 0;
+    tLowCoulomb = corr[tLowIndex];
+    tHighCoulomb = corr[tLowIndex+1];
+    nCorr = ( (radius-tLowRadius)*tHighCoulomb+(tHighRadius-radius)*tLowCoulomb )/(tHighRadius-tLowRadius);
+      fEta[fNLines] = tempEta;     // Eta
+      fCoulomb[fNLines] = nCorr;   // Interpolated Coulomb correction for radius
+      fNLines++;
+  }
+  mystream.close();
+  cout << "Lookup Table is created with " << fNLines << " points" << endl;
+}
+
+double AliFemtoCoulomb::CoulombCorrect(const double& eta) {
+  // Interpolates in eta
+  if (fRadius < 0.0) {
+    cout << "AliFemtoCoulomb::CoulombCorrect(eta) --> Trying to correct for negative radius!" << endl;
+    cerr << "AliFemtoCoulomb::CoulombCorrect(eta) --> Trying to correct for negative radius!" << endl;
+    assert(0);
+  }
+  static int middle=0;
+  middle=int( (fNLines-1)/2 );
+  if (eta*fEta[middle]<0.0) {
+    cout << "AliFemtoCoulomb::CoulombCorrect(eta) --> eta: " << eta << " has wrong sign for data file! " << endl;
+    cerr << "AliFemtoCoulomb::CoulombCorrect(eta) --> eta: " << eta << " has wrong sign for data file! " << endl;
+    assert(0);
+  }
+
+  static double tCorr = 0;
+  tCorr = -1.0;
+  
+  if ( (eta>fEta[0]) && (fEta[0]>0.0) ) {
+    tCorr = fCoulomb[0];
+    return (tCorr);
+  }
+  if ( (eta<fEta[fNLines-1]) && (fEta[fNLines-1]<0.0) ) {
+    tCorr = fCoulomb[fNLines-1];
+    return (tCorr);
+  }
+  // This is a binary search for the bracketing pair of data points
+  static int high = 0;
+  static int low = 0;
+  static int width = 0;
+  high = fNLines-1;
+  low = 0;
+  width = high-low;
+  middle = int(width/2.0); // Was instantiated above
+  while (middle > 0) {
+    if (fEta[low+middle] < eta) {
+      // eta is in the 1st half
+      high-=middle;
+      width = high-low;
+      middle = int(width/2.0);
+    }
+    else {
+      // eta is in the 2nd half
+      low+=middle;
+      width = high-low;
+      middle = int(width/2.0);
+    }
+  }
+  // Make sure we found the right one
+  if ( (fEta[low] >= eta) && (eta >= fEta[low+1]) ) {
+    static double tLowEta = 0;
+    static double tHighEta = 0;    
+    static double tLowCoulomb = 0;
+    static double tHighCoulomb = 0;
+    tLowEta = fEta[low];
+    tHighEta = fEta[low+1];    
+    tLowCoulomb = fCoulomb[low];
+    tHighCoulomb = fCoulomb[low+1];
+    //      cout << tLowEta << " *** Eta *** " << tHighEta << endl;
+    //      cout << tLowCoulomb << " *** Coulomb *** " << tHighCoulomb << endl;
+    tCorr = ( (eta-tLowEta)*tHighCoulomb+(tHighEta-eta)*tLowCoulomb )/(tHighEta-tLowEta);
+  }
+  if (tCorr<0.0) {
+    cout << "AliFemtoCoulomb::CoulombCorrect(eta) --> No correction" << endl;
+    cout << "  Check range of eta in file: Input eta  " << eta << endl;
+    cerr << "AliFemtoCoulomb::CoulombCorrect(eta) --> No correction" << endl;
+    cerr << "  Check range of eta in file: Input eta  " << eta << endl;
+    assert(0);
+  } 
+  return (tCorr);
+
+}
+
+double AliFemtoCoulomb::CoulombCorrect(const double& eta,
+                               const double& radius) {
+  // Checks radii ... input radius and fRadius
+  // Calls createLookupTable if neccessary
+  // Interpolate(linear) between etas in the created lookup table
+
+  if (radius < 0.0) {
+    if (fRadius < 0.0) {
+      // Both radii are negative
+      cout << "AliFemtoCoulomb::CoulombCorrect(eta,r) --> input and member radii are negative!" << endl;
+      cerr << "AliFemtoCoulomb::CoulombCorrect(eta,r) --> input and member radii are negative!" << endl;
+      assert(0);
+    }
+  }
+  else {
+    // radius > 0.0
+    if (radius == fRadius) {
+      // Both radii are positive and equal
+      //      cout << "Radii are the same!!!" << endl;
+    }
+    else {
+      // Both radii are positive but not equal
+      fRadius = radius;
+      CreateLookupTable(fRadius);
+    }
+  }
+
+  // Interpolate in eta
+  return ( CoulombCorrect(eta) );
+}
+
+double AliFemtoCoulomb::CoulombCorrect(const AliFemtoPair* pair) {
+  return ( CoulombCorrect( Eta(pair) ) );;
+}
+
+double AliFemtoCoulomb::CoulombCorrect(const AliFemtoPair* pair, const double& radius) {
+  return ( CoulombCorrect( Eta(pair),radius ) );
+}
+
+double AliFemtoCoulomb::Eta(const AliFemtoPair* pair) {
+  // calculate eta
+  static double px1,py1,pz1,px2,py2,pz2;
+  static double px1new,py1new,pz1new;
+  static double px2new,py2new,pz2new;
+  static double vx1cms,vy1cms,vz1cms;
+  static double vx2cms,vy2cms,vz2cms;
+  static double tVcmsX,tVcmsY,tVcmsZ;
+  static double dv = 0.0;
+  static double e1,e2,e1new,e2new;
+  static double psi,theta;
+  static double beta,gamma;
+  static double tVcmsXnew;
+
+  px1 = pair->Track1()->FourMomentum().px();
+  py1 = pair->Track1()->FourMomentum().py();
+  pz1 = pair->Track1()->FourMomentum().pz();
+  e1 = pair->Track1()->FourMomentum().e();
+  px2 = pair->Track2()->FourMomentum().px();
+  py2 = pair->Track2()->FourMomentum().py();
+  pz2 = pair->Track2()->FourMomentum().pz();
+  e2 = pair->Track2()->FourMomentum().e();
+  
+  tVcmsX = ( px1+px2 )/( e1+e2 );
+  tVcmsY = ( py1+py2 )/( e1+e2 );
+  tVcmsZ = ( pz1+pz2 )/( e1+e2 );
+  // Rotate tVcms to x-direction
+  psi = atan(tVcmsY/tVcmsX);
+  tVcmsXnew = tVcmsX*cos(psi)+tVcmsY*sin(psi);
+  tVcmsX = tVcmsXnew;
+  theta = atan(tVcmsZ/tVcmsX);
+  tVcmsXnew = tVcmsX*cos(theta)+tVcmsZ*sin(theta);
+  tVcmsX = tVcmsXnew;
+  // Gamma and Beta
+  beta = tVcmsX;
+  gamma = 1.0/::sqrt( 1.0-beta*beta );
+
+  // Rotate p1 and p2 to new frame
+  px1new = px1*cos(psi)+py1*sin(psi);
+  py1new = -px1*sin(psi)+py1*cos(psi);
+  px1 = px1new;
+  px1new = px1*cos(theta)+pz1*sin(theta);
+  pz1new = -px1*sin(theta)+pz1*cos(theta);
+  px1 = px1new;
+  py1 = py1new;
+  pz1 = pz1new;
+
+  px2new = px2*cos(psi)+py2*sin(psi);
+  py2new = -px2*sin(psi)+py2*cos(psi);
+  px2 = px2new;
+  px2new = px2*cos(theta)+pz2*sin(theta);
+  pz2new = -px2*sin(theta)+pz2*cos(theta);
+  px2 = px2new;
+  py2 = py2new;
+  pz2 = pz2new;
+
+  // Lorentz transform the x component and energy
+  e1new = gamma*e1 - gamma*beta*px1;
+  px1new = -gamma*beta*e1 + gamma*px1;
+  e2new = gamma*e2 - gamma*beta*px2;
+  px2new = -gamma*beta*e2 + gamma*px2;
+  px1 = px1new;
+  px2 = px2new;
+
+  // New velocities
+  vx1cms = px1/e1new;
+  vy1cms = py1/e1new;
+  vz1cms = pz1/e1new;
+  vx2cms = px2/e2new;
+  vy2cms = py2/e2new;
+  vz2cms = pz2/e2new;
+
+  // Velocity difference in CMS frame
+  dv = ::sqrt( (vx1cms-vx2cms)*(vx1cms-vx2cms) +
+            (vy1cms-vy2cms)*(vy1cms-vy2cms) +
+            (vz1cms-vz2cms)*(vz1cms-vz2cms) );
+
+  return ( fZ1Z2*fine_structure_const/(dv) );
+}
+
+TH1D* AliFemtoCoulomb::CorrectionHistogram(const double& mass1, const double& mass2, const int& nBins, 
+                                               const double& low, const double& high) {
+  // return correction histogram
+
+  if ( mass1!=mass2 ) {
+    cout << "Masses not equal ... try again.  No histogram created." << endl;
+    assert(0);
+  }
+  TH1D* correction = new TH1D("correction","Coulomb correction",nBins,low,high);
+  const double kReducedMass = mass1*mass2/(mass1+mass2);
+  double qInv = low;
+  //double dQinv = (high-low)/( (double)nBins );
+  double eta;
+  for (int ii=1; ii<=nBins; ii++) 
+    {
+      qInv = correction->GetBinCenter(ii);
+      eta = 2.0*fZ1Z2*kReducedMass*fine_structure_const/( qInv );
+      CoulombCorrect( eta );
+      correction->Fill( qInv, CoulombCorrect(eta,fRadius) );
+    }
+
+  return (correction);
+}
+
+#ifdef __ROOT__
+TH1D* AliFemtoCoulomb::CorrectionHistogram(const TH1D* histo, const double mass) {
+  // return correction histogram - 1D case
+  TH1D* correction = (TH1D*) ((TH1D*)histo)->Clone();
+  correction->Reset();
+  correction->SetDirectory(0);
+  int    nBins = correction->GetXaxis()->GetNbins();
+  const double kReducedMass = 0.5*mass;
+  double qInv;
+  double eta;
+  for (int ii=1; ii<=nBins; ii++) 
+    {
+      qInv = correction->GetBinCenter(ii);
+      eta = 2.0*fZ1Z2*kReducedMass*fine_structure_const/( qInv );
+      correction->Fill( qInv, CoulombCorrect(eta,fRadius) );
+    }
+
+  return (correction);
+}
+
+TH3D* AliFemtoCoulomb::CorrectionHistogram(const TH3D* histo, const double mass) {
+  // return correction histogram - 3D case
+  TH3D* correction = (TH3D*) ((TH3D*)histo)->Clone();
+  correction->Reset();
+  correction->SetDirectory(0);
+  int    nBinsX = correction->GetXaxis()->GetNbins();
+  int    nBinsY = correction->GetYaxis()->GetNbins();
+  int    nBinsZ = correction->GetZaxis()->GetNbins();
+  const double kReducedMass = 0.5*mass;
+  double eta;
+  double qInv;
+  int binNumber;
+  for (int ii=1; ii<=nBinsX; ii++) { 
+    for (int iii=1; iii<=nBinsY; iii++) {
+      for (int iv=1; iv<=nBinsZ; iv++) {
+       binNumber = histo->GetBin(ii,iii,iv);
+       qInv = histo->GetBinContent(binNumber);
+       eta = 2.0*fZ1Z2*kReducedMass*fine_structure_const/( qInv );
+       correction->SetBinContent(binNumber, CoulombCorrect(eta,fRadius) );
+      }
+    }
+  }
+  return (correction);
+}
+#endif
+
+double AliFemtoCoulomb::CoulombCorrect(const double& mass, const double& charge,
+                                   const double& radius, const double& qInv) {
+  // return correction factor
+  fRadius = radius;
+  fZ1Z2 = charge;
+  const double kReducedMass = 0.5*mass; // must be same mass particles
+  double eta = 2.0*fZ1Z2*kReducedMass*fine_structure_const/( qInv );
+  return ( CoulombCorrect(eta,fRadius) );
+}
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCoulomb.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCoulomb.h
new file mode 100644 (file)
index 0000000..468ab2b
--- /dev/null
@@ -0,0 +1,65 @@
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// AliFemtoCoulomb: This is a Coulomb correction class which             //
+//  1. Reads in the dat from a file                                      //  
+//  2. Performs a linear interpolation in R and creates any array of     //
+//     interpolations                                                    //
+//  3. Interpolates in eta and returns the Coulomb correction to user    //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+
+#ifndef ALIFEMTOCOULOMB_H
+#define ALIFEMTOCOULOMB_H
+
+#include <stdio.h>
+#include "AliFemtoTypes.h"
+#include "AliFemtoPair.h"
+#include "AliFemtoParticle.h"
+#include "TH1D.h"
+#include "TH3D.h"
+
+class AliFemtoCoulomb {
+
+public:
+  AliFemtoCoulomb();
+  AliFemtoCoulomb(const char *readFile, const double& radius, const double& charge);
+  AliFemtoCoulomb(const AliFemtoCoulomb& aCoul);
+  virtual ~AliFemtoCoulomb();
+
+  AliFemtoCoulomb& operator=(const AliFemtoCoulomb& aCoul);
+
+  void SetRadius(const double& radius);
+  double GetRadius() const;
+  void SetFile(const char *readFile);
+  void SetChargeProduct(const double& charge);
+
+  // These have different names so eta/Qinv don't confuse the compiler
+  double CoulombCorrect(const double& eta);
+  double CoulombCorrect(const double& eta, const double& radius);
+  double CoulombCorrect(const AliFemtoPair* pair);
+  double CoulombCorrect(const AliFemtoPair* pair, const double& radius);
+  double CoulombCorrect(const double& mass, const double& charge,
+                       const double& radius, const double& qInv);
+  TH1D* CorrectionHistogram(const double& mass1, const double& mass2, const int& nBins, 
+                                   const double& low, const double& high);
+#ifdef __ROOT__
+  TH1D* CorrectionHistogram(const TH1D*, const double);
+  TH3D* CorrectionHistogram(const TH3D*, const double);
+#endif
+private:
+  double Eta(const AliFemtoPair* pair);          // Calculates eta
+  void CreateLookupTable(const double& radius);  // Creates look-up table
+  const char* fFile;                             // File to interpolate corrections from    
+  double fRadius;                                // Radius from previous iteration
+  double fZ1Z2;                                  // Charge product of particles
+  double fEta[1000];                             // interpolated Coulomb correction table
+  double fCoulomb[1000];                         // interpolated Coulomb correction table
+  int fNLines;                                   // Number of Eta's in lookup-table
+
+#ifdef __ROOT__
+  ClassDef(AliFemtoCoulomb, 0)
+#endif
+};
+
+
+#endif
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitor.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitor.cxx
new file mode 100644 (file)
index 0000000..24abd40
--- /dev/null
@@ -0,0 +1,63 @@
+////////////////////////////////////////////////////////////////////////////////
+//                                                                            //
+// AliFemtoCutMonitor - the  base class for cut monitor                       //
+// A cut monitor saves the entities that passed and failed the given cut      //
+//                                                                            //
+////////////////////////////////////////////////////////////////////////////////
+#include "AliFemtoCutMonitor.h"
+
+inline void AliFemtoCutMonitor::EventBegin(const AliFemtoEvent* /* aEvent */ ) 
+{ /* no-op */ }
+
+inline void AliFemtoCutMonitor::EventEnd(const AliFemtoEvent* /* aEvent */ ) 
+{ /* no-op */ }
+
+inline void AliFemtoCutMonitor::Fill(const AliFemtoEvent* /* aEvent */) { 
+  // cut event
+#ifdef STHBTDEBUG
+    cout << " *** no user defined Fill(const AliFemtoEvent*), take from base class" << endl;
+#endif
+  }
+
+inline void AliFemtoCutMonitor::Fill(const AliFemtoTrack* /* aTrack */) { 
+  // cut track
+#ifdef STHBTDEBUG
+  cout << " *** no user defined Fill(const AliFemtoTrack*), take from base class" << endl;
+#endif
+}
+
+inline void AliFemtoCutMonitor::Fill(const AliFemtoV0* /* aV0 */ ) { 
+  // cut V0
+#ifdef STHBTDEBUG
+  cout << " *** no user defined Fill(const AliFemtoV0Track*), take from base class" << endl;
+#endif
+}
+inline void AliFemtoCutMonitor::Fill(const AliFemtoKink* /* aKink */) { 
+  // cut Kink
+#ifdef STHBTDEBUG
+  cout << " *** no user defined Fill(const AliFemtoKink*), take from base class" << endl;
+#endif
+}
+//-----------------------------------Gael 12/04/02------------------------------------
+inline void AliFemtoCutMonitor::Fill(const AliFemtoPair* /* aPair */) { 
+  // cut pair
+#ifdef STHBTDEBUG
+  cout << " *** no user defined Fill(const AliFemtoPair*), take from base class" << endl;
+#endif
+}
+//-----------------------------------Gael 19/06/02------------------------------------
+inline void AliFemtoCutMonitor::Fill(const AliFemtoParticleCollection* /* aCollection */) {
+  // cut particle collection
+#ifdef STHBTDEBUG
+  cout << " *** no user defined Fill(const AliFemtoParticleCollection*), take from base class" << endl;
+#endif
+}
+//-----------------------------------Gael 19/06/02------------------------------------
+inline void AliFemtoCutMonitor::Fill(const AliFemtoEvent* /* aEvent */,const AliFemtoParticleCollection* /* aCollection */) {
+  // cut event and particle collection
+#ifdef STHBTDEBUG
+  cout << " *** no user defined Fill(const AliFemtoEvent*,const AliFemtoParticleCollection*), take from base class" << endl;
+#endif
+}
+
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitor.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitor.h
new file mode 100644 (file)
index 0000000..e6c0bd7
--- /dev/null
@@ -0,0 +1,49 @@
+////////////////////////////////////////////////////////////////////////////////
+/// AliFemtoCutMonitor - the  base class for cut monitor                     ///
+/// A cut monitor saves the entities that passed and failed the given cut    ///
+////////////////////////////////////////////////////////////////////////////////
+#ifndef ALIFEMTOCUTMONITOR_H
+#define ALIFEMTOCUTMONITOR_H
+
+class AliFemtoEvent;
+class AliFemtoTrack;
+class AliFemtoV0;
+class AliFemtoKink;
+class AliFemtoPair; // Gael 12/04/02
+#include "AliFemtoString.h"
+#include "AliFemtoParticleCollection.h" // Gael 19/06/02
+#include <TList.h>
+
+class AliFemtoCutMonitor{
+  
+public:
+  AliFemtoCutMonitor(){/* no-op */};
+  virtual ~AliFemtoCutMonitor(){/* no-op */};
+  virtual AliFemtoString Report(){ 
+    string Stemp = "*** no user defined Fill(const AliFemtoEvent*), take from base class"; 
+    AliFemtoString returnThis = Stemp;
+    return returnThis; 
+  }
+  virtual void EventBegin(const AliFemtoEvent* aEvent);
+  virtual void EventEnd(const AliFemtoEvent* aEvent);
+  virtual TList *GetOutputList() { TList *tOutputList = new TList(); return tOutputList; };
+  virtual void Fill(const AliFemtoEvent* aEvent);
+  virtual void Fill(const AliFemtoTrack* aTrack);
+  virtual void Fill(const AliFemtoV0* aV0);
+  virtual void Fill(const AliFemtoKink* aKink);
+  virtual void Fill(const AliFemtoPair* aPair);
+  virtual void Fill(const AliFemtoParticleCollection* aCollection);
+  virtual void Fill(const AliFemtoEvent* aEvent,const AliFemtoParticleCollection* aCollection);
+  virtual void Finish() { 
+#ifdef STHBTDEBUG
+    cout << " *** no user defined Finish(), take from base class" << endl;
+#endif
+  }
+  virtual void Init() { 
+#ifdef STHBTDEBUG
+    cout << " *** no user defined Init(), take from base class" << endl;
+#endif
+  }
+};
+
+#endif
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorCollection.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorCollection.h
new file mode 100644 (file)
index 0000000..fd1d947
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef AliFemtoCutMonitorCollection_hh
+#define AliFemtoCutMonitorCollection_hh
+
+
+//#include <list>
+#include <vector>
+#if !defined(ST_NO_NAMESPACES)
+using std::vector;
+#endif
+class AliFemtoCutMonitor;
+
+#ifdef ST_NO_TEMPLATE_DEF_ARGS
+typedef vector<AliFemtoCutMonitor*, allocator<AliFemtoCutMonitor*> >            AliFemtoCutMonitorCollection;
+typedef vector<AliFemtoCutMonitor*, allocator<AliFemtoCutMonitor*> >::iterator  AliFemtoCutMonitorIterator;
+#else
+typedef vector<AliFemtoCutMonitor*>            AliFemtoCutMonitorCollection;
+typedef vector<AliFemtoCutMonitor*>::iterator  AliFemtoCutMonitorIterator;
+#endif
+
+#endif
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventMult.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventMult.cxx
new file mode 100644 (file)
index 0000000..830010d
--- /dev/null
@@ -0,0 +1,336 @@
+////////////////////////////////////////////////////////////////////////////////
+//                                                                            //
+// AliFemtoCutMonitorEventMult - the cut monitor for particles to study    //
+// the difference between reconstructed and true momentum                     //
+//                                                                            //
+////////////////////////////////////////////////////////////////////////////////
+#include "AliFemtoCutMonitorEventMult.h"
+#include "AliFemtoModelHiddenInfo.h"
+#include "AliFemtoEvent.h"
+#include <TH1D.h>
+#include <TH2D.h>
+#include <TList.h>
+
+AliFemtoCutMonitorEventMult::AliFemtoCutMonitorEventMult():
+  fEvMult(0),
+  fNormEvMult(0),
+  fSPDMult(0),
+  fMultSumPt(0),
+  freadMC(kFALSE),
+  faddhists(kFALSE),
+  fEstimateITSTPC(0),
+  fEstimateTracklets(0),
+  fEstimateITSPure(0),
+  fEst1Est2(0),
+  fEst1Est3(0),
+  fEst2Est3(0),
+  fEst1Norm(0),
+  fEst2Norm(0),
+  fEst3Norm(0)
+{
+  // Default constructor
+  fEvMult = new TH1D("EvMult", "Event Multiplicity", 5001, -0.5, 5000.5);
+  fMultSumPt = new TH2D("EvMultSumPt","Event Multiplicity vs Total pT",5001,-0.5,5000.5,1000,0.0,100.0);
+}
+
+AliFemtoCutMonitorEventMult::AliFemtoCutMonitorEventMult(const char *aName):
+  AliFemtoCutMonitor(),
+  fEvMult(0),
+  fNormEvMult(0),
+  fSPDMult(0),
+  fMultSumPt(0),
+  freadMC(kFALSE),
+  faddhists(kFALSE),
+  fEstimateITSTPC(0),
+  fEstimateTracklets(0),
+  fEstimateITSPure(0),
+  fEst1Est2(0),
+  fEst1Est3(0),
+  fEst2Est3(0),
+  fEst1Norm(0),
+  fEst2Norm(0),
+  fEst3Norm(0)
+{
+  // Normal constructor
+  char name[200];
+  snprintf(name, 200, "EvMult%s", aName);
+  fEvMult = new TH1D(name, "Event Multiplicity", 5001, -0.5, 5000.5);
+
+  snprintf(name, 200, "NormEvMult%s", aName);
+  fNormEvMult = new TH1D(name, "Normalized Event Multiplicity", 5001, -0.5, 5000.5);
+
+  if(!freadMC) {
+    snprintf(name, 200, "SPDEvMult%s", aName);
+    fSPDMult = new TH1D(name, "SPD Tracklet Multiplicity", 5001, -0.5, 5000.5);
+  }
+
+  snprintf(name, 200, "EvMultTotPt%s", aName);
+  fMultSumPt = new TH2D(name,"Event Multiplicity vs Total pT",501,-0.5,500.5,1000,0.0,100.0);
+
+  if(faddhists)
+    {
+      snprintf(name, 200, "EvMultEstITSTPC%s", aName);
+      fEstimateITSTPC = new TH1D(name, "ITS+TPC Multiplicity Estimate", 5001, -0.5, 5000.5);
+
+      snprintf(name, 200, "EvMultEstTracklets%s", aName);
+      fEstimateTracklets = new TH1D(name, "Tracklets Multiplicity Estimate", 5001, -0.5, 5000.5);
+
+      snprintf(name, 200, "EvMultEstITSPure%s", aName);
+      fEstimateITSPure = new TH1D(name, "ITS Pure Multiplicity Estimate", 8001, -0.5, 8000.5);
+
+      snprintf(name, 200, "EstITSTPCEstTracklet%s", aName);
+      fEst1Est2 = new TH2D(name,"ITS+TPC vs Tracklets",501,-0.5,5000.5,501,-0.5,500.5);
+
+      snprintf(name, 200, "EstITSTPCEstITSPure%s", aName);
+      fEst1Est3 = new TH2D(name,"ITS+TPC vs ITS Pure",501,-0.5,5000.5,801,-0.5,8000.5);
+
+      snprintf(name, 200, "EstTrackletEstITSPure%s", aName);
+      fEst2Est3 = new TH2D(name,"Tracklets vs ITS Pure",501,-0.5,5000.5,801,-0.5,8000.5);
+
+      snprintf(name, 200, "EstITSTPCNormMult%s", aName);
+      fEst1Norm = new TH2D(name,"ITS+TPC vs Normalized Mult",501,-0.5,5000.5,501,-0.5,5000.5);
+
+      snprintf(name, 200, "EstTrackletsNormMult%s", aName);
+      fEst2Norm = new TH2D(name,"Tracklets vs Normalized Mult",501,-0.5,5000.5,501,-0.5,5000.5);
+
+      snprintf(name, 200, "EstITSPureNormMult%s", aName);
+      fEst3Norm = new TH2D(name,"ITS Pure vs Normalized Mult",501,-0.5,5000.5,501,-0.5,5000.5);
+    }
+
+}
+
+AliFemtoCutMonitorEventMult::AliFemtoCutMonitorEventMult(const AliFemtoCutMonitorEventMult &aCut):
+  AliFemtoCutMonitor(),
+  fEvMult(0),
+  fNormEvMult(0),
+  fSPDMult(0),
+  fMultSumPt(0),
+  freadMC(kFALSE),
+  faddhists(kFALSE),
+  fEstimateITSTPC(0),
+  fEstimateTracklets(0),
+  fEstimateITSPure(0),
+  fEst1Est2(0),
+  fEst1Est3(0),
+  fEst2Est3(0),
+  fEst1Norm(0),
+  fEst2Norm(0),
+  fEst3Norm(0)
+{
+  // copy constructor
+  if (fEvMult) delete fEvMult;
+  fEvMult = new TH1D(*aCut.fEvMult);
+
+  if (fNormEvMult) delete fNormEvMult;
+  fNormEvMult = new TH1D(*aCut.fNormEvMult);
+
+  
+  if(!freadMC){
+    if (fSPDMult) delete fSPDMult;
+    fSPDMult = new TH1D(*aCut.fSPDMult);
+  }
+
+  if (fMultSumPt) delete fMultSumPt;
+  fMultSumPt = new TH2D(*aCut.fMultSumPt);
+
+
+  if(faddhists)
+    {
+      if (fEstimateITSTPC) delete fEstimateITSTPC;
+      fEstimateITSTPC = new TH1D(*aCut.fEstimateITSTPC);
+
+      if (fEstimateTracklets) delete fEstimateTracklets;
+      fEstimateTracklets = new TH1D(*aCut.fEstimateTracklets);
+
+      if (fEstimateITSPure) delete fEstimateITSPure;
+      fEstimateITSPure = new TH1D(*aCut.fEstimateITSPure);
+
+      if (fEst1Est2) delete fEst1Est2;
+      fEst1Est2 = new TH2D(*aCut.fEst1Est2);
+
+      if (fEst1Est3) delete fEst1Est3;
+      fEst1Est3 = new TH2D(*aCut.fEst1Est3);
+
+      if (fEst2Est3) delete fEst2Est3;
+      fEst2Est3 = new TH2D(*aCut.fEst2Est3);
+
+      if (fEst1Norm) delete fEst1Norm;
+      fEst1Norm = new TH2D(*aCut.fEst1Norm);
+
+      if (fEst2Norm) delete fEst2Norm;
+      fEst2Norm = new TH2D(*aCut.fEst2Norm);
+
+      if (fEst3Norm) delete fEst3Norm;
+      fEst3Norm = new TH2D(*aCut.fEst3Norm);
+    }
+}
+
+AliFemtoCutMonitorEventMult::~AliFemtoCutMonitorEventMult()
+{
+  // Destructor
+  delete fEvMult;
+  delete fNormEvMult;
+  if(!freadMC){
+    delete fSPDMult;
+  }
+  delete fMultSumPt;
+
+  if(faddhists)
+    {
+      delete fEstimateITSTPC;
+      delete fEstimateTracklets;
+      delete fEstimateITSPure;
+      delete fEst1Est2;
+      delete fEst1Est3;
+      delete fEst2Est3;
+      delete fEst1Norm;
+      delete fEst2Norm;
+      delete fEst3Norm;
+    }      
+}
+
+AliFemtoCutMonitorEventMult& AliFemtoCutMonitorEventMult::operator=(const AliFemtoCutMonitorEventMult& aCut)
+{
+  // assignment operator
+  if (this == &aCut) 
+    return *this;
+
+  if (fEvMult) delete fEvMult;
+  fEvMult = new TH1D(*aCut.fEvMult);
+  
+  if (fNormEvMult) delete fNormEvMult;
+  fNormEvMult = new TH1D(*aCut.fNormEvMult);
+  
+  if(!freadMC){
+    if (fSPDMult) delete fSPDMult;
+    fSPDMult = new TH1D(*aCut.fSPDMult);
+  }
+  
+  if (fMultSumPt) delete fMultSumPt;
+  fMultSumPt = new TH2D(*aCut.fMultSumPt);
+
+
+  if(faddhists)
+    {
+      if (fEstimateITSTPC) delete fEstimateITSTPC;
+      fEstimateITSTPC = new TH1D(*aCut.fEstimateITSTPC);
+
+      if (fEstimateTracklets) delete fEstimateTracklets;
+      fEstimateTracklets = new TH1D(*aCut.fEstimateTracklets);
+
+      if (fEstimateITSPure) delete fEstimateITSPure;
+      fEstimateITSPure = new TH1D(*aCut.fEstimateITSPure);
+
+      if (fEst1Est2) delete fEst1Est2;
+      fEst1Est2 = new TH2D(*aCut.fEst1Est2);
+
+      if (fEst1Est3) delete fEst1Est3;
+      fEst1Est3 = new TH2D(*aCut.fEst1Est3);
+
+      if (fEst2Est3) delete fEst2Est3;
+      fEst2Est3 = new TH2D(*aCut.fEst2Est3);
+
+      if (fEst1Norm) delete fEst1Norm;
+      fEst1Norm = new TH2D(*aCut.fEst1Norm);
+
+      if (fEst2Norm) delete fEst2Norm;
+      fEst2Norm = new TH2D(*aCut.fEst2Norm);
+
+      if (fEst3Norm) delete fEst3Norm;
+      fEst3Norm = new TH2D(*aCut.fEst3Norm);
+    }
+
+  return *this;
+}
+
+AliFemtoString AliFemtoCutMonitorEventMult::Report(){ 
+  // Prepare report from the execution
+  string stemp = "*** AliFemtoCutMonitorEventMult report"; 
+  AliFemtoString returnThis = stemp;
+  return returnThis; 
+}
+
+void AliFemtoCutMonitorEventMult::Fill(const AliFemtoEvent* aEvent)
+{
+  // Fill in the monitor histograms with the values from the current track
+  fEvMult->Fill(aEvent->NumberOfTracks());
+  fNormEvMult->Fill(aEvent->UncorrectedNumberOfPrimaries());
+  if(!freadMC){
+    fSPDMult->Fill(aEvent->SPDMultiplicity());
+  }
+  fMultSumPt->Fill(aEvent->UncorrectedNumberOfPrimaries(), aEvent->ZDCEMEnergy());
+
+  if(faddhists)
+    {
+      fEstimateITSTPC->Fill(aEvent->MultiplicityEstimateITSTPC());
+      fEstimateTracklets->Fill(aEvent->MultiplicityEstimateTracklets());
+      fEstimateITSPure->Fill(aEvent->MultiplicityEstimateITSPure());
+      fEst1Est2->Fill(aEvent->MultiplicityEstimateITSTPC(),aEvent->MultiplicityEstimateTracklets());
+      fEst1Est3->Fill(aEvent->MultiplicityEstimateITSTPC(),aEvent->MultiplicityEstimateITSPure());
+      fEst2Est3->Fill(aEvent->MultiplicityEstimateTracklets(),aEvent->MultiplicityEstimateITSPure());
+      fEst1Norm->Fill(aEvent->MultiplicityEstimateITSTPC(),aEvent->UncorrectedNumberOfPrimaries());
+      fEst2Norm->Fill(aEvent->MultiplicityEstimateTracklets(),aEvent->UncorrectedNumberOfPrimaries());
+      fEst3Norm->Fill(aEvent->MultiplicityEstimateITSPure(),aEvent->UncorrectedNumberOfPrimaries());
+    }
+
+}
+
+void AliFemtoCutMonitorEventMult::Write()
+{
+  // Write out the relevant histograms
+  fEvMult->Write();
+  fNormEvMult->Write();
+  if(!freadMC){
+    fSPDMult->Write();
+  }
+  fMultSumPt->Write();
+
+  if(faddhists)
+    {
+      fEstimateITSTPC->Write();
+      fEstimateTracklets->Write();
+      fEstimateITSPure->Write();
+      fEst1Est2->Write();
+      fEst1Est3->Write();
+      fEst2Est3->Write();
+      fEst1Norm->Write();
+      fEst2Norm->Write();
+      fEst3Norm->Write();
+    }
+
+}
+
+TList *AliFemtoCutMonitorEventMult::GetOutputList()
+{
+  TList *tOutputList = new TList();
+  tOutputList->Add(fEvMult);
+  tOutputList->Add(fNormEvMult);
+  tOutputList->Add(fSPDMult);
+  tOutputList->Add(fMultSumPt);
+
+  if(faddhists)
+    {
+      tOutputList->Add(fEstimateITSTPC);
+      tOutputList->Add(fEstimateTracklets);
+      tOutputList->Add(fEstimateITSPure);
+      tOutputList->Add(fEst1Est2);
+      tOutputList->Add(fEst1Est3);
+      tOutputList->Add(fEst2Est3);
+      tOutputList->Add(fEst1Norm);
+      tOutputList->Add(fEst2Norm);
+      tOutputList->Add(fEst3Norm);
+    }
+  
+  return tOutputList;
+}
+
+void AliFemtoCutMonitorEventMult::SetReadMC(Bool_t mc)
+{
+  freadMC=mc;
+}
+
+void AliFemtoCutMonitorEventMult::AdditionalMultHistsOn(Bool_t addhists)
+{
+  faddhists=addhists;
+}
+
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventMult.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventMult.h
new file mode 100644 (file)
index 0000000..143109d
--- /dev/null
@@ -0,0 +1,70 @@
+////////////////////////////////////////////////////////////////////////////////
+///                                                                          ///
+/// AliFemtoCutMonitorEventMult - the cut monitor for events to study        ///
+/// the multiplicity distribution of events                                  ///
+///                                                                          ///
+////////////////////////////////////////////////////////////////////////////////
+#ifndef AliFemtoCutMonitorEventMult_hh
+#define AliFemtoCutMonitorEventMult_hh
+
+class AliFemtoEvent;
+class AliFemtoTrack;
+class AliFemtoV0;
+class AliFemtoKink;
+class AliFemtoPair; 
+class TH1D;
+class TH2D;
+class TList;
+#include "AliFemtoString.h"
+#include "AliFemtoParticleCollection.h"
+#include "AliFemtoCutMonitor.h"
+
+class AliFemtoCutMonitorEventMult : public AliFemtoCutMonitor{
+  
+ public:
+  AliFemtoCutMonitorEventMult();
+  AliFemtoCutMonitorEventMult(const char *aName);
+  AliFemtoCutMonitorEventMult(const AliFemtoCutMonitorEventMult &aCut);
+  virtual ~AliFemtoCutMonitorEventMult();
+
+  AliFemtoCutMonitorEventMult& operator=(const AliFemtoCutMonitorEventMult& aCut);
+
+  virtual AliFemtoString Report();
+  virtual void Fill(const AliFemtoEvent* aEvent);
+  virtual void Fill(const AliFemtoTrack* aTrack) {AliFemtoCutMonitor::Fill(aTrack);}
+  virtual void Fill(const AliFemtoV0* aV0) {AliFemtoCutMonitor::Fill(aV0);}
+  virtual void Fill(const AliFemtoKink* aKink) {AliFemtoCutMonitor::Fill(aKink);}
+  virtual void Fill(const AliFemtoPair* aPair) {AliFemtoCutMonitor::Fill(aPair);}
+  virtual void Fill(const AliFemtoParticleCollection* aCollection) {AliFemtoCutMonitor::Fill(aCollection);}
+  virtual void Fill(const AliFemtoEvent* aEvent,const AliFemtoParticleCollection* aCollection)
+  {AliFemtoCutMonitor::Fill(aEvent, aCollection);}
+
+  void SetReadMC(Bool_t mc);
+  void AdditionalMultHistsOn(Bool_t addhists);
+  void Write();
+
+  virtual TList *GetOutputList();
+
+ private:
+  TH1D *fEvMult;     // Multiplicity distribution
+  TH1D *fNormEvMult; // Normalized event multiplicity distribution
+  TH1D *fSPDMult;    // SPD tracklet multiplicity
+  TH2D *fMultSumPt;  // Event total pT vs. multiplicity
+
+  Bool_t freadMC;     // If true - add only one histogram to the output
+  Bool_t faddhists;   // If true - add only additional multiplicity histograms
+  
+  TH1D *fEstimateITSTPC;     // Multiplicity estimate ITS+TPC
+  TH1D *fEstimateTracklets;  // Multiplicity estimate Tracklets
+  TH1D *fEstimateITSPure;    // Multiplicity estimate ITS Pure
+
+  TH2D *fEst1Est2;           // ITS+TPC vs Tracklets
+  TH2D *fEst1Est3;           // ITS+TPC vs ITS Pure
+  TH2D *fEst2Est3;           // Tracklets vs ITS Pure
+  TH2D *fEst1Norm;           // ITS+TPC vs Normalized
+  TH2D *fEst2Norm;           // Tracklets vs Normalized
+  TH2D *fEst3Norm;           // ITS Pure vs Normalized
+
+};
+
+#endif
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventVertex.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventVertex.cxx
new file mode 100644 (file)
index 0000000..df5b93e
--- /dev/null
@@ -0,0 +1,141 @@
+////////////////////////////////////////////////////////////////////////////////
+//                                                                            //
+// AliFemtoCutMonitorEventVertex - the cut monitor for events to study        //
+// the distribution and error of the primary vertex                           //
+//                                                                            //
+////////////////////////////////////////////////////////////////////////////////
+#include "AliFemtoCutMonitorEventVertex.h"
+#include "AliFemtoModelHiddenInfo.h"
+#include "AliFemtoEvent.h"
+#include <TH1D.h>
+#include <TH2D.h>
+#include <TList.h>
+#include <TMath.h>
+
+AliFemtoCutMonitorEventVertex::AliFemtoCutMonitorEventVertex():
+  AliFemtoCutMonitor(),
+  fEvVertRad(0),
+  fEvVertXY(0),
+  fEvVertSigXY(0),
+  fEvVertZ(0),
+  fEvVertSigZ(0)
+{
+  // Default constructor
+  fEvVertRad   = new TH1D("EvVertRad",   "Vertex position radial", 200, 0.0, 0.2);
+  fEvVertXY    = new TH2D("EvVertXY",    "Vertex position xy plane", 200, -0.2, 0.2, 200, -0.2, 0.2);
+  fEvVertSigXY = new TH1D("EvVertSigXY", "Vertex error in xy plane", 200, 0.0, 0.2);
+  fEvVertZ     = new TH1D("EvVertZ",     "Vertex position in z", 500, -50.0, 50.0);
+  fEvVertSigZ  = new TH1D("EvVertSigZ",  "Vertex error in z", 100, 0.0, 0.2);
+}
+
+AliFemtoCutMonitorEventVertex::AliFemtoCutMonitorEventVertex(const char *aName):
+  AliFemtoCutMonitor(),
+  fEvVertRad(0),
+  fEvVertXY(0),
+  fEvVertSigXY(0),
+  fEvVertZ(0),
+  fEvVertSigZ(0)
+{
+  // Normal constructor
+  char name[200];
+  snprintf(name, 200, "EvVertRad%s", aName);
+  fEvVertRad   = new TH1D(name,   "Vertex position radial", 200, 0.0, 0.2);
+  snprintf(name, 200, "EvVertXY%s", aName);
+  fEvVertXY    = new TH2D(name,    "Vertex position xy plane", 200, -0.2, 0.2, 200, -0.2, 0.2);
+  snprintf(name, 200, "EvVertSigXY%s", aName);
+  fEvVertSigXY = new TH1D(name, "Vertex error in xy plane", 200, 0.0, 0.2);
+  snprintf(name, 200, "EvVertZ%s", aName);
+  fEvVertZ     = new TH1D(name,     "Vertex position in z", 500, -50.0, 50.0);
+  snprintf(name, 200, "EvVertSigZ%s", aName);
+  fEvVertSigZ  = new TH1D(name,  "Vertex error in z", 100, 0.0, 0.2);
+}
+
+AliFemtoCutMonitorEventVertex::AliFemtoCutMonitorEventVertex(const AliFemtoCutMonitorEventVertex &aCut):
+  AliFemtoCutMonitor(),
+  fEvVertRad(0),
+  fEvVertXY(0),
+  fEvVertSigXY(0),
+  fEvVertZ(0),
+  fEvVertSigZ(0)
+{
+  // copy constructor
+  if (fEvVertRad) delete fEvVertRad;
+  fEvVertRad = new TH1D(*aCut.fEvVertRad);
+  if (fEvVertXY) delete fEvVertXY;
+  fEvVertXY = new TH2D(*aCut.fEvVertXY);
+  if (fEvVertSigXY) delete fEvVertSigXY;
+  fEvVertSigXY = new TH1D(*aCut.fEvVertSigXY);
+  if (fEvVertZ) delete fEvVertZ;
+  fEvVertZ = new TH1D(*aCut.fEvVertZ);
+  if (fEvVertSigZ) delete fEvVertSigZ;
+  fEvVertSigZ = new TH1D(*aCut.fEvVertSigZ);
+}
+
+AliFemtoCutMonitorEventVertex::~AliFemtoCutMonitorEventVertex()
+{
+  // Destructor
+  delete fEvVertRad;
+  delete fEvVertXY;
+  delete fEvVertSigXY;
+  delete fEvVertZ;
+  delete fEvVertSigZ;
+}
+
+AliFemtoCutMonitorEventVertex& AliFemtoCutMonitorEventVertex::operator=(const AliFemtoCutMonitorEventVertex& aCut)
+{
+  // assignment operator
+  if (this == &aCut) 
+    return *this;
+
+  if (fEvVertRad) delete fEvVertRad;
+  fEvVertRad = new TH1D(*aCut.fEvVertRad);
+  if (fEvVertXY) delete fEvVertXY;
+  fEvVertXY = new TH2D(*aCut.fEvVertXY);
+  if (fEvVertSigXY) delete fEvVertSigXY;
+  fEvVertSigXY = new TH1D(*aCut.fEvVertSigXY);
+  if (fEvVertZ) delete fEvVertZ;
+  fEvVertZ = new TH1D(*aCut.fEvVertZ);
+  if (fEvVertSigZ) delete fEvVertSigZ;
+  fEvVertSigZ = new TH1D(*aCut.fEvVertSigZ);
+  
+  return *this;
+}
+
+AliFemtoString AliFemtoCutMonitorEventVertex::Report(){ 
+  // Prepare report from the execution
+  string stemp = "*** AliFemtoCutMonitorEventVertex report"; 
+  AliFemtoString returnThis = stemp;
+  return returnThis; 
+}
+
+void AliFemtoCutMonitorEventVertex::Fill(const AliFemtoEvent* aEvent)
+{
+  // Fill in the monitor histograms with the values from the current track
+  fEvVertRad->Fill(TMath::Hypot(aEvent->PrimVertPos().x(), aEvent->PrimVertPos().y()));
+  fEvVertXY->Fill(aEvent->PrimVertPos().x(), aEvent->PrimVertPos().y());
+  fEvVertSigXY->Fill(TMath::Sqrt(aEvent->PrimVertCov()[0]+aEvent->PrimVertCov()[2]));
+  fEvVertZ->Fill(aEvent->PrimVertPos().z());
+  fEvVertSigZ->Fill(TMath::Sqrt(aEvent->PrimVertCov()[5]));
+}
+
+void AliFemtoCutMonitorEventVertex::Write()
+{
+  // Write out the relevant histograms
+  fEvVertRad->Write();
+  fEvVertXY->Write();
+  fEvVertSigXY->Write();
+  fEvVertZ->Write();
+  fEvVertSigZ->Write();
+}
+
+TList *AliFemtoCutMonitorEventVertex::GetOutputList()
+{
+  TList *tOutputList = new TList();
+  tOutputList->Add(fEvVertRad);
+  tOutputList->Add(fEvVertXY);
+  tOutputList->Add(fEvVertSigXY);
+  tOutputList->Add(fEvVertZ);
+  tOutputList->Add(fEvVertSigZ);
+
+  return tOutputList;
+}
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventVertex.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventVertex.h
new file mode 100644 (file)
index 0000000..7d0640a
--- /dev/null
@@ -0,0 +1,54 @@
+////////////////////////////////////////////////////////////////////////////////
+///                                                                          ///
+/// AliFemtoCutMonitorEventVertex - the cut monitor for events to study      ///
+/// the distribution and error of the primary vertex                         ///
+///                                                                          ///
+////////////////////////////////////////////////////////////////////////////////
+#ifndef AliFemtoCutMonitorEventVertex_hh
+#define AliFemtoCutMonitorEventVertex_hh
+
+class AliFemtoEvent;
+class AliFemtoTrack;
+class AliFemtoV0;
+class AliFemtoKink;
+class AliFemtoPair; 
+class TH1D;
+class TH2D;
+class TList;
+#include "AliFemtoString.h"
+#include "AliFemtoParticleCollection.h"
+#include "AliFemtoCutMonitor.h"
+
+class AliFemtoCutMonitorEventVertex : public AliFemtoCutMonitor{
+  
+public:
+  AliFemtoCutMonitorEventVertex();
+  AliFemtoCutMonitorEventVertex(const char *aName);
+  AliFemtoCutMonitorEventVertex(const AliFemtoCutMonitorEventVertex &aCut);
+  virtual ~AliFemtoCutMonitorEventVertex();
+
+  AliFemtoCutMonitorEventVertex& operator=(const AliFemtoCutMonitorEventVertex& aCut);
+
+  virtual AliFemtoString Report();
+  virtual void Fill(const AliFemtoEvent* aEvent);
+  virtual void Fill(const AliFemtoTrack* aTrack) {AliFemtoCutMonitor::Fill(aTrack);}
+  virtual void Fill(const AliFemtoV0* aV0) {AliFemtoCutMonitor::Fill(aV0);}
+  virtual void Fill(const AliFemtoKink* aKink) {AliFemtoCutMonitor::Fill(aKink);}
+  virtual void Fill(const AliFemtoPair* aPair) {AliFemtoCutMonitor::Fill(aPair);}
+  virtual void Fill(const AliFemtoParticleCollection* aCollection) {AliFemtoCutMonitor::Fill(aCollection);}
+  virtual void Fill(const AliFemtoEvent* aEvent,const AliFemtoParticleCollection* aCollection)
+  {AliFemtoCutMonitor::Fill(aEvent, aCollection);}
+
+  void Write();
+
+  virtual TList *GetOutputList();
+
+private:
+  TH1D *fEvVertRad;     // Vertex position in radial direction
+  TH2D *fEvVertXY;      // Vertex position in XY plane
+  TH1D *fEvVertSigXY;   // Sigma in XY plane
+  TH1D *fEvVertZ;       // Vertex position in Z direction
+  TH1D *fEvVertSigZ;    // Sigma in Z direction
+};
+
+#endif
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorHandler.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorHandler.cxx
new file mode 100644 (file)
index 0000000..efdb4b7
--- /dev/null
@@ -0,0 +1,318 @@
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// AliFemtoCutMonitorHandler: a handler for cut monitors                 //
+// You add cut monitors to the collection which are stored in two        //
+// separate collections - one which stores characteristics of the        //
+// entities (tracks, particles, pairs, events) that pass the respective  //
+// cuts and the other for the ones that fail the cut.                    //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+
+#include <TList.h>
+#include "AliFemtoCutMonitorHandler.h"
+#include "AliFemtoTypes.h"
+
+#ifdef __ROOT__
+ClassImp(AliFemtoCutMonitorHandler)
+#endif
+// ---------------------------------------------------------------------------
+AliFemtoCutMonitorHandler::AliFemtoCutMonitorHandler():
+  fCollectionsEmpty(0), fPassColl(0), fFailColl(0)
+{
+  // Default constructor
+  cout << " *** AliFemtoCutMonitorHandler::AliFemtoCutMonitorHandler() " << endl;
+  fCollectionsEmpty = 0;
+  fPassColl = new AliFemtoCutMonitorCollection();
+  fFailColl = new AliFemtoCutMonitorCollection();
+}
+// ---------------------------------------------------------------------------
+AliFemtoCutMonitorHandler::AliFemtoCutMonitorHandler(const AliFemtoCutMonitorHandler& aHan):
+  fCollectionsEmpty(0), fPassColl(0), fFailColl(0)
+{
+  // Copy constructor
+  fCollectionsEmpty = aHan.fCollectionsEmpty;
+  fPassColl = new AliFemtoCutMonitorCollection();
+  AliFemtoCutMonitorIterator iter;
+  for (iter=aHan.fPassColl->begin(); iter!=aHan.fPassColl->end(); iter++){
+    fPassColl->push_back(*iter);
+  }
+  fFailColl = new AliFemtoCutMonitorCollection();
+  for (iter=aHan.fFailColl->begin(); iter!=aHan.fFailColl->end(); iter++){
+    fFailColl->push_back(*iter);
+  }
+}
+
+// ---------------------------------------------------------------------------
+AliFemtoCutMonitorHandler::~AliFemtoCutMonitorHandler() { 
+  // Default destructor
+  delete fPassColl;
+  delete fFailColl;
+}   
+//__________________________
+AliFemtoCutMonitorHandler& AliFemtoCutMonitorHandler::operator=(const AliFemtoCutMonitorHandler& aHan)
+{
+  // assignment operator
+  if (this == &aHan)
+    return *this;
+
+  AliFemtoCutMonitorIterator iter;
+  if (fPassColl) {
+    fPassColl->clear();
+    delete fPassColl;
+  }
+  if (fFailColl) {
+    fFailColl->clear();
+    delete fFailColl;
+  }
+  fPassColl = new AliFemtoCutMonitorCollection();
+  for (iter=aHan.fPassColl->begin(); iter!=aHan.fPassColl->end(); iter++){
+    fPassColl->push_back(*iter);
+  }
+  fFailColl = new AliFemtoCutMonitorCollection();
+  for (iter=aHan.fFailColl->begin(); iter!=aHan.fFailColl->end(); iter++){
+    fFailColl->push_back(*iter);
+  }
+  return *this;
+}
+
+// ---------------------------------------------------------------------------
+void AliFemtoCutMonitorHandler::FillCutMonitor(const AliFemtoEvent* event, bool pass) { 
+  // fill event cut monitors
+  if (fCollectionsEmpty) return;
+  AliFemtoCutMonitorIterator iter;
+  AliFemtoCutMonitor* tCM;
+  if ( pass) {
+    for (iter=fPassColl->begin(); iter!=fPassColl->end(); iter++){
+      tCM = *iter;
+      tCM->Fill(event);
+    }
+  } else {
+    for (iter=fFailColl->begin(); iter!=fFailColl->end(); iter++){
+      tCM = *iter;
+      tCM->Fill(event);
+    }
+  }
+}
+// ---------------------------------------------------------------------------
+void AliFemtoCutMonitorHandler::FillCutMonitor(const AliFemtoTrack* track, bool pass) { 
+  // Fill track cut monitors
+  if (fCollectionsEmpty) return;
+  AliFemtoCutMonitorIterator iter;
+  AliFemtoCutMonitor* tCM;
+  if ( pass) {
+    for (iter=fPassColl->begin(); iter!=fPassColl->end(); iter++){
+      tCM = *iter;
+      tCM->Fill(track);
+    }
+  } else {
+    for (iter=fFailColl->begin(); iter!=fFailColl->end(); iter++){
+      tCM = *iter;
+      tCM->Fill(track);
+    }
+  }
+}
+// ---------------------------------------------------------------------------
+void AliFemtoCutMonitorHandler::FillCutMonitor(const AliFemtoV0* v0, bool pass) { 
+  // fill V0 cut monitors
+  if (fCollectionsEmpty) return;
+  AliFemtoCutMonitorIterator iter;
+  AliFemtoCutMonitor* tCM;
+  if ( pass) {
+    for (iter=fPassColl->begin(); iter!=fPassColl->end(); iter++){
+      tCM = *iter;
+      tCM->Fill(v0);
+    }
+  } else {
+    for (iter=fFailColl->begin(); iter!=fFailColl->end(); iter++){
+      tCM = *iter;
+      tCM->Fill(v0);
+    }
+  }
+}
+// ---------------------------------------------------------------------------
+void AliFemtoCutMonitorHandler::FillCutMonitor(const AliFemtoKink* kink, bool pass) { 
+  // fill kink cut monitors
+  if (fCollectionsEmpty) return;
+  AliFemtoCutMonitorIterator iter;
+  AliFemtoCutMonitor* tCM;
+  if ( pass) {
+    for (iter=fPassColl->begin(); iter!=fPassColl->end(); iter++){
+      tCM = *iter;
+      tCM->Fill(kink);
+    }
+  } else {
+    for (iter=fFailColl->begin(); iter!=fFailColl->end(); iter++){
+      tCM = *iter;
+      tCM->Fill(kink);
+    }
+  }
+}
+// ---------------------------------Gael/12/04/02-----------------------------
+void AliFemtoCutMonitorHandler::FillCutMonitor(const AliFemtoPair* pair, bool pass) { 
+  // fill pair cut monitors
+  if (fCollectionsEmpty) return;
+  AliFemtoCutMonitorIterator iter;
+  AliFemtoCutMonitor* tCM;
+  if ( pass) {
+    for (iter=fPassColl->begin(); iter!=fPassColl->end(); iter++){
+      tCM = *iter;
+      tCM->Fill(pair);
+    }
+  } else {
+    for (iter=fFailColl->begin(); iter!=fFailColl->end(); iter++){
+      tCM = *iter;
+      tCM->Fill(pair);
+    }
+  }
+}
+// ---------------------------------Gael/19/06/02-----------------------------
+void AliFemtoCutMonitorHandler::FillCutMonitor(const AliFemtoParticleCollection* partColl) {
+  // fill particle collection cut monitor 
+  if (fCollectionsEmpty) return;
+  AliFemtoCutMonitorIterator iter;
+  AliFemtoCutMonitor* tCM;
+  
+  for (iter=fPassColl->begin(); iter!=fPassColl->end(); iter++){
+    tCM = *iter;
+    tCM->Fill(partColl);
+  }
+}
+// ------------------------------------Gael/19/06/02-------------------------
+void AliFemtoCutMonitorHandler::FillCutMonitor(const AliFemtoEvent* event,const AliFemtoParticleCollection* partColl) {
+  // Fill event particle collection
+  cout<<"In AliFemtoCutMonitorHandler::FillCutMonitor(const AliFemtoEvent* event, AliFemtoPicoEvent* picoEvent)"<<endl;
+  if (fCollectionsEmpty) return;
+  AliFemtoCutMonitorIterator iter;
+  AliFemtoCutMonitor* tCM;
+  
+  for (iter=fPassColl->begin(); iter!=fPassColl->end(); iter++){
+    tCM = *iter;
+    tCM->Fill(event,partColl);
+  }
+}
+// ---------------------------------------------------------------------------
+void AliFemtoCutMonitorHandler::Finish() { 
+  // Perform finish operations on cut monitors
+  AliFemtoCutMonitorIterator iter;
+  for (iter=fPassColl->begin(); iter!=fPassColl->end(); iter++){
+    (*iter)->Finish();
+  }
+  for (iter=fFailColl->begin(); iter!=fFailColl->end(); iter++){
+    (*iter)->Finish();
+  }
+}
+// ---------------------------------------------------------------------------
+void AliFemtoCutMonitorHandler::AddCutMonitor(AliFemtoCutMonitor* cutMoni1, AliFemtoCutMonitor* cutMoni2) { 
+  // Add cut monitors to collections
+  fPassColl->push_back(cutMoni1);
+  fFailColl->push_back(cutMoni2);
+  fCollectionsEmpty=false;
+}
+// ---------------------------------------------------------------------------
+void AliFemtoCutMonitorHandler::AddCutMonitor(AliFemtoCutMonitor* cutMoni) { 
+  // make a copy of the cut monitor
+  cout << " make a copy of the cutmonitor and push both into the collections " << endl;
+  cout << " not yet implemented" << endl;
+  fPassColl->push_back(cutMoni);
+  cout << " only pass collection pushed" << endl;
+  fCollectionsEmpty=false;
+}
+// ---------------------------------------------------------------------------
+void AliFemtoCutMonitorHandler::AddCutMonitorPass(AliFemtoCutMonitor* cutMoni) { 
+  // add monitors to pass
+  fPassColl->push_back(cutMoni);
+  fCollectionsEmpty=false;
+}
+// ---------------------------------------------------------------------------
+void AliFemtoCutMonitorHandler::AddCutMonitorFail(AliFemtoCutMonitor* cutMoni) { 
+  // add monitors to fail
+  fFailColl->push_back(cutMoni);
+  fCollectionsEmpty=false;
+}
+// ---------------------------------------------------------------------------
+AliFemtoCutMonitor* AliFemtoCutMonitorHandler::PassMonitor(int n) { 
+  // return pass monitor number n
+  AliFemtoCutMonitorIterator iter = fPassColl->begin();
+  if ( (int)fPassColl->size() <= n ) return NULL;
+  for ( int i=0; i<n; i++)
+    iter++;
+  return *iter;
+}
+// ---------------------------------------------------------------------------
+AliFemtoCutMonitor* AliFemtoCutMonitorHandler::FailMonitor(int n) { 
+  // return fail monitor number n
+  AliFemtoCutMonitorIterator iter = fFailColl->begin();
+  if ( (int)fFailColl->size() <= n ) return NULL;
+  for ( int i=0; i<n; i++)
+    iter++;
+  return *iter;
+}
+//_____________________________________________________________________________
+TList *AliFemtoCutMonitorHandler::GetOutputList()
+{
+  TList *tOutputList = new TList();
+
+  for (unsigned int ipass=0; ipass<fPassColl->size(); ipass++) {
+    TList *tLp = PassMonitor(ipass)->GetOutputList();
+
+    TIter nextLp(tLp);
+    while (TObject *obj = nextLp()) {
+      tOutputList->Add(obj);
+    }
+    
+    delete tLp;
+  }
+
+  for (unsigned int ipass=0; ipass<fFailColl->size(); ipass++) {
+    TList *tLf = FailMonitor(ipass)->GetOutputList();
+
+    TIter nextLf(tLf);
+    while (TObject *obj = nextLf()) {
+      tOutputList->Add(obj);
+    }
+    
+    delete tLf;
+  }
+
+  return tOutputList;
+}
+//_____________________________________________________________________________
+void AliFemtoCutMonitorHandler::EventBegin(const AliFemtoEvent* aEvent) 
+{ 
+  if (fCollectionsEmpty) return;
+
+  AliFemtoCutMonitorIterator iter;
+  AliFemtoCutMonitor* tCM;
+
+  for (iter=fPassColl->begin(); iter!=fPassColl->end(); iter++){
+    tCM = *iter;
+    tCM->EventBegin(aEvent);
+  }
+  
+  for (iter=fFailColl->begin(); iter!=fFailColl->end(); iter++){
+    tCM = *iter;
+    tCM->EventBegin(aEvent);
+  }
+}
+//_____________________________________________________________________________
+void AliFemtoCutMonitorHandler::EventEnd(const AliFemtoEvent* aEvent) 
+{ 
+  if (fCollectionsEmpty) return;
+
+  AliFemtoCutMonitorIterator iter;
+  AliFemtoCutMonitor* tCM;
+
+  for (iter=fPassColl->begin(); iter!=fPassColl->end(); iter++){
+    tCM = *iter;
+    tCM->EventEnd(aEvent);
+  }
+  
+  for (iter=fFailColl->begin(); iter!=fFailColl->end(); iter++){
+    tCM = *iter;
+    tCM->EventEnd(aEvent);
+  }
+}
+
+
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorHandler.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorHandler.h
new file mode 100644 (file)
index 0000000..78d912b
--- /dev/null
@@ -0,0 +1,64 @@
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// AliFemtoCutMonitorHandler: a handler for cut monitors                 //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+#ifndef AliFemtoCutMonitorHandler_hh
+#define AliFemtoCutMonitorHandler_hh
+
+
+#include "AliFemtoTypes.h"
+#include "AliFemtoEvent.h"
+#include "AliFemtoTrack.h"
+#include "AliFemtoV0.h"
+#include "AliFemtoKink.h"
+#include "AliFemtoPair.h" //Gael 12/04/02
+#include "AliFemtoParticleCollection.h" // Gael 19/06/02
+#include "AliFemtoCutMonitorCollection.h"
+#include "AliFemtoCutMonitor.h"
+
+class AliFemtoCutMonitorHandler{
+  
+ public:
+  
+  AliFemtoCutMonitorHandler();
+  AliFemtoCutMonitorHandler(const AliFemtoCutMonitorHandler& aHan);
+  virtual ~AliFemtoCutMonitorHandler();
+  AliFemtoCutMonitorHandler& operator=(const AliFemtoCutMonitorHandler& aHan);
+
+  AliFemtoCutMonitorCollection* PassMonitorColl(); 
+  AliFemtoCutMonitorCollection* FailMonitorColl(); 
+  AliFemtoCutMonitor* PassMonitor(int n); 
+  AliFemtoCutMonitor* FailMonitor(int n); 
+  void AddCutMonitor(AliFemtoCutMonitor* cutMoni1, AliFemtoCutMonitor* cutMoni2); 
+  void AddCutMonitor(AliFemtoCutMonitor* cutMoni); 
+  void AddCutMonitorPass(AliFemtoCutMonitor* cutMoni); 
+  void AddCutMonitorFail(AliFemtoCutMonitor* cutMoni); 
+  void FillCutMonitor(const AliFemtoEvent* event, bool pass); 
+  void FillCutMonitor(const AliFemtoTrack* track, bool pass); 
+  void FillCutMonitor(const AliFemtoV0* v0, bool pass); 
+  void FillCutMonitor(const AliFemtoKink* kink, bool pass);
+  void FillCutMonitor(const AliFemtoPair* pair, bool pass);//Gael 11/04/02
+  void FillCutMonitor(const AliFemtoParticleCollection* partColl);// Gael 19/06/02
+  void FillCutMonitor(const AliFemtoEvent* event, const AliFemtoParticleCollection* partColl);// Gael 19/06/02
+  void Finish();
+
+  virtual TList *GetOutputList();
+
+  virtual void EventBegin(const AliFemtoEvent* aEvent);
+  virtual void EventEnd(const AliFemtoEvent* aEvent);
+  
+ private:
+  bool fCollectionsEmpty;                  // Are the collections empty?
+  AliFemtoCutMonitorCollection* fPassColl; // Collection of cut monitors for passed entities
+  AliFemtoCutMonitorCollection* fFailColl; // Collection of cut monitors for failed entities
+#ifdef __ROOT__  
+  ClassDef(AliFemtoCutMonitorHandler, 0)
+#endif  
+  
+};
+
+inline AliFemtoCutMonitorCollection* AliFemtoCutMonitorHandler::PassMonitorColl() { return fPassColl;}
+inline AliFemtoCutMonitorCollection* AliFemtoCutMonitorHandler::FailMonitorColl() { return fFailColl;}
+
+#endif
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticlePID.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticlePID.cxx
new file mode 100644 (file)
index 0000000..f225bcd
--- /dev/null
@@ -0,0 +1,128 @@
+////////////////////////////////////////////////////////////////////////////////
+//                                                                            //
+// AliFemtoCutMonitorParticlePID - the cut monitor for particles to study     //
+// various aspects of the PID determination                                   //
+//                                                                            //
+////////////////////////////////////////////////////////////////////////////////
+#include "AliFemtoCutMonitorParticlePID.h"
+#include "AliFemtoModelHiddenInfo.h"
+#include <TH1D.h>
+#include <TH2D.h>
+#include <TList.h>
+#include <TMath.h>
+
+AliFemtoCutMonitorParticlePID::AliFemtoCutMonitorParticlePID():
+  fTPCdEdx(0),
+  fTOFParticle(0),
+  fTOFTime(0x0),
+  ftofHist(0)
+{
+  // Default constructor
+  fTPCdEdx =  new TH2D("TPCdEdx", "TPC dEdx vs. momentum", 200, 0.1, 4.0, 250, 0.0, 500.0);
+  fTOFTime = new TH2D("TOFTime", "TOF Time vs. momentum", 190, 0.1, 2.0, 400, -4000.0, 4000.0);
+  ftofHist=new TH2D("TOFHist","TOF momentum vs v",100,0.,1.1,100,0.,3.0);
+}
+
+AliFemtoCutMonitorParticlePID::AliFemtoCutMonitorParticlePID(const char *aName, Int_t aTOFParticle):
+  AliFemtoCutMonitor(),
+  fTPCdEdx(0),
+  fTOFParticle(aTOFParticle),
+  fTOFTime(0x0),
+  ftofHist(0)
+{
+  // Normal constructor
+  char name[200];
+  snprintf(name, 200, "TPCdEdx%s", aName);
+  fTPCdEdx = new TH2D(name, "TPC dEdx vs. momentum", 200, 0.1, 4.0, 250, 0.0, 500.0);
+
+  snprintf(name, 200, "TOFTime%s", aName);
+  fTOFTime = new TH2D(name, "TOF Time vs. momentum", 190, 0.1, 2.0, 400, -4000.0, 4000.0);
+
+  snprintf(name, 200, "TOFHist%s", aName);
+  ftofHist=new TH2D(name,"TOF momentum vs v",100,0.,1.1,100,0.,3.0);
+}
+
+AliFemtoCutMonitorParticlePID::AliFemtoCutMonitorParticlePID(const AliFemtoCutMonitorParticlePID &aCut):
+  AliFemtoCutMonitor(),
+  fTPCdEdx(0),
+  fTOFParticle(0),
+  fTOFTime(0x0),
+  ftofHist(0)
+{
+  // copy constructor
+  if (fTPCdEdx) delete fTPCdEdx;
+  fTPCdEdx = new TH2D(*aCut.fTPCdEdx);
+
+  if (fTOFTime) delete fTOFTime;
+  fTOFTime = new TH2D(*aCut.fTOFTime);
+
+  if (ftofHist) delete ftofHist; 
+  ftofHist= new TH2D(*aCut.ftofHist);
+}
+
+AliFemtoCutMonitorParticlePID::~AliFemtoCutMonitorParticlePID()
+{
+  // Destructor
+  delete fTPCdEdx;
+  delete fTOFTime;
+  delete ftofHist;
+}
+
+AliFemtoCutMonitorParticlePID& AliFemtoCutMonitorParticlePID::operator=(const AliFemtoCutMonitorParticlePID& aCut)
+{
+  // assignment operator
+  if (this == &aCut) 
+    return *this;
+
+  if (fTPCdEdx) delete fTPCdEdx;
+  fTPCdEdx = new TH2D(*aCut.fTPCdEdx);
+
+  if (fTOFTime) delete fTOFTime;
+  fTOFTime = new TH2D(*aCut.fTOFTime);
+  
+  if(ftofHist) delete ftofHist;
+  ftofHist = new TH2D(*aCut.ftofHist);
+  return *this;
+}
+
+AliFemtoString AliFemtoCutMonitorParticlePID::Report(){ 
+  // Prepare report from the execution
+  string stemp = "*** AliFemtoCutMonitorParticlePID report"; 
+  AliFemtoString returnThis = stemp;
+  return returnThis; 
+}
+
+void AliFemtoCutMonitorParticlePID::Fill(const AliFemtoTrack* aTrack)
+{
+  // Fill in the monitor histograms with the values from the current track
+  float tMom = aTrack->P().Mag();
+  float tdEdx = aTrack->TPCsignal();
+  float tTOF = 0.0;
+  //  short tchg = aTrack->Charge();
+  if (fTOFParticle == 0) tTOF = aTrack->TOFpionTime();
+  if (fTOFParticle == 1) tTOF = aTrack->TOFkaonTime();
+  if (fTOFParticle == 2) tTOF = aTrack->TOFprotonTime();
+
+  fTPCdEdx->Fill(tMom, tdEdx);
+  fTOFTime->Fill(tMom, tTOF);
+
+  float vp= aTrack->VTOF();
+  ftofHist->Fill(vp,tMom);
+}
+
+void AliFemtoCutMonitorParticlePID::Write()
+{
+  // Write out the relevant histograms
+  fTPCdEdx->Write();
+  fTOFTime->Write();
+  ftofHist->Write();
+}
+
+TList *AliFemtoCutMonitorParticlePID::GetOutputList()
+{
+  TList *tOutputList = new TList();
+  tOutputList->Add(fTPCdEdx);
+  tOutputList->Add(fTOFTime);
+  tOutputList->Add(ftofHist);
+  return tOutputList;
+}
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticlePID.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticlePID.h
new file mode 100644 (file)
index 0000000..920de21
--- /dev/null
@@ -0,0 +1,56 @@
+////////////////////////////////////////////////////////////////////////////////
+///                                                                          ///
+/// AliFemtoCutMonitorParticlePID - the cut monitor for particles to study   ///
+/// various aspects of the PID determination                                 ///
+///                                                                          ///
+////////////////////////////////////////////////////////////////////////////////
+#ifndef AliFemtoCutMonitorParticlePID_hh
+#define AliFemtoCutMonitorParticlePID_hh
+
+class AliFemtoEvent;
+class AliFemtoTrack;
+class AliFemtoV0;
+class AliFemtoKink;
+class AliFemtoPair; // Gael 12/04/02
+class TH1D;
+class TH2D;
+class TList;
+#include "AliFemtoString.h"
+#include "AliFemtoParticleCollection.h"
+#include "AliFemtoCutMonitor.h"
+
+class AliFemtoCutMonitorParticlePID : public AliFemtoCutMonitor{
+  
+public:
+  AliFemtoCutMonitorParticlePID();
+  AliFemtoCutMonitorParticlePID(const char *aName, Int_t aTOFParticle);
+  AliFemtoCutMonitorParticlePID(const AliFemtoCutMonitorParticlePID &aCut);
+  virtual ~AliFemtoCutMonitorParticlePID();
+
+  AliFemtoCutMonitorParticlePID& operator=(const AliFemtoCutMonitorParticlePID& aCut);
+
+  virtual AliFemtoString Report();
+  virtual void Fill(const AliFemtoEvent* aEvent) {AliFemtoCutMonitor::Fill(aEvent);}
+  virtual void Fill(const AliFemtoTrack* aTrack);
+  virtual void Fill(const AliFemtoV0* aV0) {AliFemtoCutMonitor::Fill(aV0);}
+  virtual void Fill(const AliFemtoKink* aKink) {AliFemtoCutMonitor::Fill(aKink);}
+  virtual void Fill(const AliFemtoPair* aPair) {AliFemtoCutMonitor::Fill(aPair);}
+  virtual void Fill(const AliFemtoParticleCollection* aCollection) {AliFemtoCutMonitor::Fill(aCollection);}
+  virtual void Fill(const AliFemtoEvent* aEvent,const AliFemtoParticleCollection* aCollection)
+  {AliFemtoCutMonitor::Fill(aEvent, aCollection);}
+
+  void SetTOFParticle(Int_t ipart);
+
+  void Write();
+
+  virtual TList *GetOutputList();
+
+private:
+  TH2D *fTPCdEdx;     // TPC dEdx information
+  Int_t fTOFParticle; // Select TOF time hypothesis, 0-pion, 1-kaon, 2-proton
+  TH2D *fTOFTime;     // TOF time
+  TH2D* ftofHist;     // TOF hist with vp
+
+};
+
+#endif
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleVertPos.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleVertPos.cxx
new file mode 100644 (file)
index 0000000..f752c15
--- /dev/null
@@ -0,0 +1,178 @@
+////////////////////////////////////////////////////////////////////////////////
+//                                                                            //
+// AliFemtoCutMonitorParticleVertPos - the cut monitor for particles to study    //
+// the difference between reconstructed and true momentum                     //
+//                                                                            //
+////////////////////////////////////////////////////////////////////////////////
+#include "AliFemtoCutMonitorParticleVertPos.h"
+#include "AliFemtoModelHiddenInfo.h"
+#include "AliFemtoModelGlobalHiddenInfo.h"
+#include <TH1D.h>
+#include <TH2D.h>
+#include <TList.h>
+#include <TMath.h>
+
+AliFemtoCutMonitorParticleVertPos::AliFemtoCutMonitorParticleVertPos():
+  fVertPos(0),
+  fEtaZ(0),
+  fRadPos(0),
+  fEmPointX(0),
+  fEmPointY(0),
+  fEmPointZ(0),
+  fEmPointT(0)
+{
+  // Default constructor
+  fVertPos = new TH2D("VertPos", "Vertex position", 200, -20.0, 20.0, 200, -20.0, 20.0);
+  fEtaZ    = new TH2D("EtaZPos", "Z vs. Eta", 200, -100.0, 100.0, 100, -1.5, 1.5);
+  fRadPos  = new TH1D("RadPos",  "Radial position", 200, 0.0, 1.0);
+  fEmPointX = new TH1D("EmPointX","Emission point x", 400, -200.0, 200.0);
+  fEmPointY = new TH1D("EmPointY","Emission point y", 400, -200.0, 200.0);
+  fEmPointZ = new TH1D("EmPointZ","Emission point z", 400, -200.0, 200.0);
+  fEmPointT = new TH1D("EmPointT","Emission point t", 400, -200.0, 200.0);
+
+}
+
+AliFemtoCutMonitorParticleVertPos::AliFemtoCutMonitorParticleVertPos(const char *aName):
+  AliFemtoCutMonitor(),
+  fVertPos(0),
+  fEtaZ(0),
+  fRadPos(0),
+  fEmPointX(0),
+  fEmPointY(0),
+  fEmPointZ(0),
+  fEmPointT(0)
+{
+  // Normal constructor
+  char name[200];
+  snprintf(name, 200, "VertPos%s", aName);
+  fVertPos = new TH2D(name, "Rapdity vs Pt", 200, -20.0, 20.0, 200, -20.0, 20.0);
+  snprintf(name, 200, "EtaZPos%s", aName);
+  fEtaZ    = new TH2D(name, "Z vs. Eta", 200, -100.0, 100.0, 100, -1.5, 1.5);
+  snprintf(name, 200, "RadPos%s", aName);
+  fRadPos  = new TH1D(name,  "Radial position", 200, 0.0, 1.0);
+  snprintf(name, 200, "EmPosX%s", aName);
+  fEmPointX = new TH1D(name,"Emission point x", 400, -200.0, 200.0);
+  snprintf(name, 200, "EmPosY%s", aName);
+  fEmPointY = new TH1D(name,"Emission point y", 400, -200.0, 200.0);
+  snprintf(name, 200, "EmPosZ%s", aName);
+  fEmPointZ = new TH1D(name,"Emission point z", 400, -200.0, 200.0);
+  snprintf(name, 200, "EmPosT%s", aName);
+  fEmPointT = new TH1D(name,"Emission point t", 400, -200.0, 200.0);
+}
+
+AliFemtoCutMonitorParticleVertPos::AliFemtoCutMonitorParticleVertPos(const AliFemtoCutMonitorParticleVertPos &aCut):
+  AliFemtoCutMonitor(),
+  fVertPos(0),
+  fEtaZ(0),
+  fRadPos(0),
+  fEmPointX(0),
+  fEmPointY(0),
+  fEmPointZ(0),
+  fEmPointT(0)
+{
+  // copy constructor
+  if (fVertPos) delete fVertPos;
+  fVertPos = new TH2D(*aCut.fVertPos);
+  if (fEtaZ) delete fEtaZ;
+  fEtaZ = new TH2D(*aCut.fEtaZ);
+  if (fRadPos) delete fRadPos;
+  fRadPos = new TH1D(*aCut.fRadPos);
+  if (fEmPointX) delete fEmPointX;
+  fEmPointX = new TH1D(*aCut.fEmPointX);
+  if (fEmPointY) delete fEmPointY;
+  fEmPointY = new TH1D(*aCut.fEmPointY);
+  if (fEmPointZ) delete fEmPointZ;
+  fEmPointZ = new TH1D(*aCut.fEmPointZ);
+  if (fEmPointT) delete fEmPointT;
+  fEmPointT = new TH1D(*aCut.fEmPointT);
+}
+
+AliFemtoCutMonitorParticleVertPos::~AliFemtoCutMonitorParticleVertPos()
+{
+  // Destructor
+  delete fVertPos;
+  delete fEtaZ;
+  delete fRadPos;
+  delete fEmPointX;
+  delete fEmPointY;
+  delete fEmPointZ;
+  delete fEmPointT;
+}
+
+AliFemtoCutMonitorParticleVertPos& AliFemtoCutMonitorParticleVertPos::operator=(const AliFemtoCutMonitorParticleVertPos& aCut)
+{
+  // assignment operator
+  if (this == &aCut) 
+    return *this;
+
+  if (fVertPos) delete fVertPos;
+  fVertPos = new TH2D(*aCut.fVertPos);
+  if (fEtaZ) delete fEtaZ;
+  fEtaZ = new TH2D(*aCut.fEtaZ);
+  if (fRadPos) delete fRadPos;
+  fRadPos = new TH1D(*aCut.fRadPos);
+  if (fEmPointX) delete fEmPointX;
+  fEmPointX = new TH1D(*aCut.fEmPointX);
+  if (fEmPointY) delete fEmPointY;
+  fEmPointY = new TH1D(*aCut.fEmPointY);
+  if (fEmPointZ) delete fEmPointZ;
+  fEmPointZ = new TH1D(*aCut.fEmPointZ);
+  if (fEmPointT) delete fEmPointT;
+  fEmPointT = new TH1D(*aCut.fEmPointT);
+  
+  return *this;
+}
+
+AliFemtoString AliFemtoCutMonitorParticleVertPos::Report(){ 
+  // Prepare report from the execution
+  string stemp = "*** AliFemtoCutMonitorParticleVertPos report"; 
+  AliFemtoString returnThis = stemp;
+  return returnThis; 
+}
+
+void AliFemtoCutMonitorParticleVertPos::Fill(const AliFemtoTrack* aTrack)
+{
+  // Fill in the monitor histograms with the values from the current track
+  AliFemtoModelGlobalHiddenInfo *hinfo = dynamic_cast<AliFemtoModelGlobalHiddenInfo *>(aTrack->GetHiddenInfo());
+  if (hinfo) {
+    float tEta = -TMath::Log(TMath::Tan(hinfo->GetTrueMomentum()->Theta()/2.0));
+
+    fVertPos->Fill(hinfo->GetGlobalEmissionPoint()->x(), hinfo->GetGlobalEmissionPoint()->y());
+    fEtaZ->Fill(hinfo->GetGlobalEmissionPoint()->z(), tEta);
+    fRadPos->Fill(hinfo->GetGlobalEmissionPoint()->Perp());
+  }
+  
+  AliFemtoModelHiddenInfo *hminfo = dynamic_cast<AliFemtoModelHiddenInfo *>(aTrack->GetHiddenInfo());
+  if (hminfo) {
+    fEmPointX->Fill(hminfo->GetEmissionPoint()->x());
+    fEmPointY->Fill(hminfo->GetEmissionPoint()->y());
+    fEmPointZ->Fill(hminfo->GetEmissionPoint()->z());
+    fEmPointT->Fill(hminfo->GetEmissionPoint()->t());
+  }
+}
+
+void AliFemtoCutMonitorParticleVertPos::Write()
+{
+  // Write out the relevant histograms
+  fVertPos->Write();
+  fEtaZ->Write();
+  fRadPos->Write();
+  fEmPointX->Write();
+  fEmPointY->Write();
+  fEmPointZ->Write();
+  fEmPointT->Write();
+}
+
+TList *AliFemtoCutMonitorParticleVertPos::GetOutputList()
+{
+  TList *tOutputList = new TList();
+  tOutputList->Add(fVertPos);
+  tOutputList->Add(fEtaZ);
+  tOutputList->Add(fRadPos);
+  tOutputList->Add(fEmPointX);
+  tOutputList->Add(fEmPointY);
+  tOutputList->Add(fEmPointZ);
+  tOutputList->Add(fEmPointT);
+
+  return tOutputList;
+}
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleVertPos.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleVertPos.h
new file mode 100644 (file)
index 0000000..806a427
--- /dev/null
@@ -0,0 +1,58 @@
+////////////////////////////////////////////////////////////////////////////////
+///                                                                          ///
+/// AliFemtoCutMonitorParticleVertPos - the cut monitor for particles to study  ///
+/// the difference between reconstructed and true momentum    ///
+///                                                                          ///
+////////////////////////////////////////////////////////////////////////////////
+#ifndef AliFemtoCutMonitorParticleVertPos_hh
+#define AliFemtoCutMonitorParticleVertPos_hh
+
+class AliFemtoEvent;
+class AliFemtoTrack;
+class AliFemtoV0;
+class AliFemtoKink;
+class AliFemtoPair; // Gael 12/04/02
+class TH1D;
+class TH2D;
+class TList;
+#include "AliFemtoString.h"
+#include "AliFemtoParticleCollection.h"
+#include "AliFemtoCutMonitor.h"
+
+class AliFemtoCutMonitorParticleVertPos : public AliFemtoCutMonitor{
+  
+public:
+  AliFemtoCutMonitorParticleVertPos();
+  AliFemtoCutMonitorParticleVertPos(const char *aName);
+  AliFemtoCutMonitorParticleVertPos(const AliFemtoCutMonitorParticleVertPos &aCut);
+  virtual ~AliFemtoCutMonitorParticleVertPos();
+
+  AliFemtoCutMonitorParticleVertPos& operator=(const AliFemtoCutMonitorParticleVertPos& aCut);
+
+  virtual AliFemtoString Report();
+  virtual void Fill(const AliFemtoEvent* aEvent) {AliFemtoCutMonitor::Fill(aEvent);}
+  virtual void Fill(const AliFemtoTrack* aTrack);
+  virtual void Fill(const AliFemtoV0* aV0) {AliFemtoCutMonitor::Fill(aV0);}
+  virtual void Fill(const AliFemtoKink* aKink) {AliFemtoCutMonitor::Fill(aKink);}
+  virtual void Fill(const AliFemtoPair* aPair) {AliFemtoCutMonitor::Fill(aPair);}
+  virtual void Fill(const AliFemtoParticleCollection* aCollection) {AliFemtoCutMonitor::Fill(aCollection);}
+  virtual void Fill(const AliFemtoEvent* aEvent,const AliFemtoParticleCollection* aCollection)
+  {AliFemtoCutMonitor::Fill(aEvent, aCollection);}
+
+
+  void Write();
+
+  virtual TList *GetOutputList();
+
+private:
+  TH2D *fVertPos;    // Vertex position x vs. y monitor
+  TH2D *fEtaZ;       // Vertex z position vs. eta monitor
+  TH1D *fRadPos;     // Radial position close to vertex
+  TH1D *fEmPointX;   // Emission point - x
+  TH1D *fEmPointY;   // Emission point - y
+  TH1D *fEmPointZ;   // Emission point - z
+  TH1D *fEmPointT;   // Emission point - t
+  
+};
+
+#endif
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleYPt.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleYPt.cxx
new file mode 100644 (file)
index 0000000..a844d51
--- /dev/null
@@ -0,0 +1,206 @@
+////////////////////////////////////////////////////////////////////////////////
+//                                                                            //
+// AliFemtoCutMonitorParticleYPt - the cut monitor for particles to study    //
+// the difference between reconstructed and true momentum                     //
+//                                                                            //
+////////////////////////////////////////////////////////////////////////////////
+#include "AliFemtoCutMonitorParticleYPt.h"
+#include "AliFemtoModelHiddenInfo.h"
+#include <TH1D.h>
+#include <TH2D.h>
+#include <TList.h>
+#include <TMath.h>
+
+AliFemtoCutMonitorParticleYPt::AliFemtoCutMonitorParticleYPt():
+  fYPt(0),
+  fYPhi(0),
+  fPtPhi(0),
+  fEtaPhi(0),
+  fEtaPt(0),
+  fEtaPhiW(0),
+  fEtaPtW(0),
+  fDCARPt(0),
+  fDCAZPt(0),
+  fMass(0.13957)
+{
+  // Default constructor
+  fYPt = new TH2D("YPt", "Rapidity vs Pt",              140, -1.4, 1.4, 100, 0.0, 2.0);
+  fYPhi = new TH2D("YPhi", "Rapidity vs Phi",           140, -1.4, 1.4, 100, -TMath::Pi(), TMath::Pi());
+  fPtPhi = new TH2D("PtPhi", "Pt vs Phi",               100,  0.0, 2.0, 100, -TMath::Pi(), TMath::Pi());
+  fEtaPhi = new TH2D("EtaPhi", "Pseudorapidity vs Phi", 140, -1.4, 1.4, 100, -TMath::Pi(), TMath::Pi());
+  fEtaPt = new TH2D("EtaPt", "Pseudorapidity vs Pt",    140, -1.4, 1.4, 100, 0.0, 2.0);
+  // fEtaPhiW = new TH2D("EtaPhiW", "Pseudorapidity vs Phi chi2/N weighted", 140, -1.4, 1.4, 100, -TMath::Pi(), TMath::Pi());
+  // fEtaPtW = new TH2D("EtaPtW", "Pseudorapidity vs Pt chi2/N weighted",    140, -1.4, 1.4, 100, 0.0, 2.0)
+    ;
+  fDCARPt = new TH2D("DCARPt", "DCA in XY vs. Pt", 400, -2.0, 2.0, 100,0.0,2.0);
+  fDCAZPt = new TH2D("DCAZPt", "DCA in Z vs. Pt", 400, -2.0, 2.0, 100,0.0,2.0);
+}
+
+AliFemtoCutMonitorParticleYPt::AliFemtoCutMonitorParticleYPt(const char *aName, float aMass):
+  AliFemtoCutMonitor(),
+  fYPt(0),
+  fYPhi(0),
+  fPtPhi(0),
+  fEtaPhi(0),
+  fEtaPt(0),
+  fEtaPhiW(0),
+  fEtaPtW(0),
+  fDCARPt(0),
+  fDCAZPt(0),
+  fMass(aMass)
+{
+  // Normal constructor
+  char name[200];
+  snprintf(name, 200, "YPt%s", aName);
+  fYPt = new TH2D(name, "Rapdity vs Pt", 140, -1.4, 1.4, 100, 0.0, 2.0);
+  snprintf(name, 200, "YPhi%s", aName);
+  fYPhi = new TH2D(name, "Rapidity vs Phi",           140, -1.4, 1.4, 100, -TMath::Pi(), TMath::Pi());
+  snprintf(name, 200, "PtPhi%s", aName);
+  fPtPhi = new TH2D(name, "Pt vs Phi",               100,  0.0, 2.0, 100, -TMath::Pi(), TMath::Pi());
+  snprintf(name, 200, "EtaPhi%s", aName);
+  fEtaPhi = new TH2D(name, "Pseudorapidity vs Phi", 140, -1.4, 1.4, 100, -TMath::Pi(), TMath::Pi());
+  snprintf(name, 200, "EtaPt%s", aName);
+  fEtaPt = new TH2D(name, "Pseudorapidity vs Pt",    140, -1.4, 1.4, 100, 0.0, 2.0);
+  // snprintf(name, 200, "EtaPhiW%s", aName);
+  // fEtaPhiW = new TH2D(name, "Pseudorapidity vs Phi chi2/N weighted", 140, -1.4, 1.4, 100, -TMath::Pi(), TMath::Pi());
+  // snprintf(name, 200, "EtaPtW%s", aName);
+  // fEtaPtW = new TH2D(name, "Pseudorapidity vs Pt chi2/N weighted",    140, -1.4, 1.4, 100, 0.0, 2.0);
+  snprintf(name, 200, "DCARPt%s", aName);
+  fDCARPt = new TH2D(name, "DCA in XY vs. Pt", 400, -2.0, 2.0, 100,0.0,2.0);
+  snprintf(name, 200, "DCAZPt%s", aName);
+  fDCAZPt = new TH2D(name, "DCA in Z vs. Pt", 400, -2.0, 2.0, 100,0.0,2.0);
+}
+
+AliFemtoCutMonitorParticleYPt::AliFemtoCutMonitorParticleYPt(const AliFemtoCutMonitorParticleYPt &aCut):
+  AliFemtoCutMonitor(),
+  fYPt(0),
+  fYPhi(0),
+  fPtPhi(0),
+  fEtaPhi(0),
+  fEtaPt(0),
+  fEtaPhiW(0),
+  fEtaPtW(0),
+  fDCARPt(0),
+  fDCAZPt(0),
+  fMass(0.13957)
+{
+  // copy constructor
+  fYPt = new TH2D(*aCut.fYPt);
+  fYPhi = new TH2D(*aCut.fYPhi);
+  fPtPhi = new TH2D(*aCut.fPtPhi);
+  fEtaPhi = new TH2D(*aCut.fEtaPhi);
+  fEtaPt = new TH2D(*aCut.fEtaPt);
+  // fEtaPhiW = new TH2D(*aCut.fEtaPhiW);
+  // fEtaPtW = new TH2D(*aCut.fEtaPtW);
+  fDCARPt = new TH2D(*aCut.fDCARPt);
+  fDCAZPt = new TH2D(*aCut.fDCAZPt);
+  fMass = aCut.fMass; 
+}
+
+AliFemtoCutMonitorParticleYPt::~AliFemtoCutMonitorParticleYPt()
+{
+  // Destructor
+  delete fYPt;
+  delete fYPhi;
+  delete fPtPhi;
+  delete fEtaPhi;
+  delete fEtaPt;
+  // delete fEtaPhiW;
+  // delete fEtaPtW;
+  delete fDCARPt;
+  delete fDCAZPt;
+}
+
+AliFemtoCutMonitorParticleYPt& AliFemtoCutMonitorParticleYPt::operator=(const AliFemtoCutMonitorParticleYPt& aCut)
+{
+  // assignment operator
+  if (this == &aCut) 
+    return *this;
+
+  if (fYPt) delete fYPt;
+  fYPt = new TH2D(*aCut.fYPt);
+  if (fYPhi) delete fYPhi;
+  fYPhi = new TH2D(*aCut.fYPhi);
+  if (fPtPhi) delete fPtPhi;
+  fPtPhi = new TH2D(*aCut.fPtPhi);
+  if (fEtaPhi) delete fEtaPhi;
+  fEtaPhi = new TH2D(*aCut.fEtaPhi);
+  if (fEtaPt) delete fEtaPt;
+  fEtaPt = new TH2D(*aCut.fEtaPt);
+  // if (fEtaPhiW) delete fEtaPhiW;
+  // fEtaPhiW = new TH2D(*aCut.fEtaPhiW);
+  // if (fEtaPtW) delete fEtaPtW;
+  // fEtaPtW = new TH2D(*aCut.fEtaPtW);
+  if (fDCARPt) delete fDCARPt;
+  fDCARPt = new TH2D(*aCut.fDCARPt);
+  if (fDCAZPt) delete fDCAZPt;
+  fDCAZPt = new TH2D(*aCut.fDCAZPt);
+  
+  return *this;
+}
+
+AliFemtoString AliFemtoCutMonitorParticleYPt::Report(){ 
+  // Prepare report from the execution
+  string stemp = "*** AliFemtoCutMonitorParticleYPt report"; 
+  AliFemtoString returnThis = stemp;
+  return returnThis; 
+}
+
+void AliFemtoCutMonitorParticleYPt::Fill(const AliFemtoTrack* aTrack)
+{
+  // Fill in the monitor histograms with the values from the current track
+  float tEnergy = ::sqrt(aTrack->P().Mag2()+fMass*fMass);
+  float tRapidity = 0.5*::log((tEnergy+aTrack->P().z())/(tEnergy-aTrack->P().z()));
+  float tPt = ::sqrt((aTrack->P().x())*(aTrack->P().x())+(aTrack->P().y())*(aTrack->P().y()));
+  float tEta = -TMath::Log(TMath::Tan(aTrack->P().Theta()/2.0));
+  float tPhi = aTrack->P().Phi();
+  // float chi2w;
+  float dcar = aTrack->ImpactD();
+  float dcaz = aTrack->ImpactZ();
+  // if (aTrack->TPCncls() > 0)
+  //   chi2w = aTrack->TPCchi2()/aTrack->TPCncls();
+  // else
+  //   chi2w = 6.0;
+
+  //  cout << " CMYPt: " << fYPt << " " << fYPt->GetEntries() << " " << tRapidity << " " << tPt << endl;
+
+  fYPt->Fill(tRapidity, tPt);
+  fYPhi->Fill(tRapidity, tPhi);
+  fPtPhi->Fill(tPt, tPhi);
+  fEtaPhi->Fill(tEta, tPhi);
+  fEtaPt->Fill(tEta, tPt);
+  // fEtaPhiW->Fill(tEta, tPhi, chi2w);
+  // fEtaPtW->Fill(tEta, tPt, chi2w);
+  fDCARPt->Fill(dcar, tPt);
+  fDCAZPt->Fill(dcaz, tPt);
+}
+
+void AliFemtoCutMonitorParticleYPt::Write()
+{
+  // Write out the relevant histograms
+  fYPt->Write();
+  fYPhi->Write();
+  fPtPhi->Write();
+  fEtaPhi->Write();
+  fEtaPt->Write();
+  // fEtaPhiW->Write();
+  // fEtaPtW->Write();
+  fDCARPt->Write();
+  fDCAZPt->Write();
+}
+
+TList *AliFemtoCutMonitorParticleYPt::GetOutputList()
+{
+  TList *tOutputList = new TList();
+  tOutputList->Add(fYPt);
+  tOutputList->Add(fYPhi);
+  tOutputList->Add(fPtPhi);
+  tOutputList->Add(fEtaPhi);
+  tOutputList->Add(fEtaPt);
+  // tOutputList->Add(fEtaPhiW);
+  // tOutputList->Add(fEtaPtW);
+  tOutputList->Add(fDCARPt);
+  tOutputList->Add(fDCAZPt);
+
+  return tOutputList;
+}
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleYPt.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleYPt.h
new file mode 100644 (file)
index 0000000..c7501d5
--- /dev/null
@@ -0,0 +1,60 @@
+////////////////////////////////////////////////////////////////////////////////
+///                                                                          ///
+/// AliFemtoCutMonitorParticleYPt - the cut monitor for particles to study  ///
+/// the difference between reconstructed and true momentum    ///
+///                                                                          ///
+////////////////////////////////////////////////////////////////////////////////
+#ifndef AliFemtoCutMonitorParticleYPt_hh
+#define AliFemtoCutMonitorParticleYPt_hh
+
+class AliFemtoEvent;
+class AliFemtoTrack;
+class AliFemtoV0;
+class AliFemtoKink;
+class AliFemtoPair; // Gael 12/04/02
+class TH1D;
+class TH2D;
+class TList;
+#include "AliFemtoString.h"
+#include "AliFemtoParticleCollection.h"
+#include "AliFemtoCutMonitor.h"
+
+class AliFemtoCutMonitorParticleYPt : public AliFemtoCutMonitor{
+  
+public:
+  AliFemtoCutMonitorParticleYPt();
+  AliFemtoCutMonitorParticleYPt(const char *aName, float aMass);
+  AliFemtoCutMonitorParticleYPt(const AliFemtoCutMonitorParticleYPt &aCut);
+  virtual ~AliFemtoCutMonitorParticleYPt();
+
+  AliFemtoCutMonitorParticleYPt& operator=(const AliFemtoCutMonitorParticleYPt& aCut);
+
+  virtual AliFemtoString Report();
+  virtual void Fill(const AliFemtoEvent* aEvent) {AliFemtoCutMonitor::Fill(aEvent);}
+  virtual void Fill(const AliFemtoTrack* aTrack);
+  virtual void Fill(const AliFemtoV0* aV0) {AliFemtoCutMonitor::Fill(aV0);}
+  virtual void Fill(const AliFemtoKink* aKink) {AliFemtoCutMonitor::Fill(aKink);}
+  virtual void Fill(const AliFemtoPair* aPair) {AliFemtoCutMonitor::Fill(aPair);}
+  virtual void Fill(const AliFemtoParticleCollection* aCollection) {AliFemtoCutMonitor::Fill(aCollection);}
+  virtual void Fill(const AliFemtoEvent* aEvent,const AliFemtoParticleCollection* aCollection)
+  {AliFemtoCutMonitor::Fill(aEvent, aCollection);}
+
+
+  void Write();
+
+  virtual TList *GetOutputList();
+
+private:
+  TH2D *fYPt;    // Rapidity vs. Pt monitor
+  TH2D *fYPhi;   // Rapidity cs. Phi monitor
+  TH2D *fPtPhi;  // Pt vs. Phi monitor
+  TH2D *fEtaPhi; // Pseudorapidity vs. Phi monitor
+  TH2D *fEtaPt;  // Pseudorapidity vs. Pt monitor
+  TH2D *fEtaPhiW;// Pseudorapidity vs. Phi monitor chi2 weighted
+  TH2D *fEtaPtW; // Pseudorapidity vs. Pt monitor chi2 weighted
+  TH2D *fDCARPt; // Pt vs. DCA XY
+  TH2D *fDCAZPt; // Pt vs. DCA Z 
+  float fMass;   // Mass hypothesis
+};
+
+#endif
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoDummyPairCut.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoDummyPairCut.cxx
new file mode 100644 (file)
index 0000000..1d60033
--- /dev/null
@@ -0,0 +1,100 @@
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// AliFemtoDummyPairCut: a summy pair cut. Accepts all pairs             //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+/***************************************************************************
+ *
+ * $Id$
+ *
+ * Author: Mike Lisa, Ohio State, lisa@mps.ohio-state.edu
+ ***************************************************************************
+ *
+ * Description: part of STAR HBT Framework: AliFemtoMaker package
+ *   a do-nothing pair cut that simply says "true" to every pair           
+ *
+ ***************************************************************************
+ *
+ * $Log$
+ * Revision 1.2.2.1  2007/10/12 14:28:37  akisiel
+ * New wave of cleanup and rule conformance
+ *
+ * Revision 1.2  2007/05/22 09:01:42  akisiel
+ * Add the possibiloity to save cut settings in the ROOT file
+ *
+ * Revision 1.1  2007/05/16 10:22:11  akisiel
+ * Making the directory structure of AliFemto flat. All files go into one common directory
+ *
+ * Revision 1.2  2007/05/03 09:41:06  akisiel
+ * Fixing Effective C++ warnings
+ *
+ * Revision 1.1.1.1  2007/04/25 15:38:41  panos
+ * Importing the HBT code dir
+ *
+ * Revision 1.1.1.1  2007-03-07 10:14:49  mchojnacki
+ * First version on CVS
+ *
+ * Revision 1.3  2000/01/25 17:35:02  laue
+ * I. In order to run the stand alone version of the AliFemtoMaker the following
+ * changes have been done:
+ * a) all ClassDefs and ClassImps have been put into #ifdef __ROOT__ statements
+ * b) unnecessary includes of StMaker.h have been removed
+ * c) the subdirectory AliFemtoMaker/doc/Make has been created including everything
+ * needed for the stand alone version
+ *
+ * II. To reduce the amount of compiler warning
+ * a) some variables have been type casted
+ * b) some destructors have been declared as virtual
+ *
+ * Revision 1.2  1999/07/06 22:33:21  lisa
+ * Adjusted all to work in pro and new - dev itself is broken
+ *
+ * Revision 1.1.1.1  1999/06/29 16:02:56  lisa
+ * Installation of AliFemtoMaker
+ *
+ **************************************************************************/
+
+#include "AliFemtoDummyPairCut.h"
+#include <string>
+#include <cstdio>
+
+#ifdef __ROOT__
+ClassImp(AliFemtoDummyPairCut)
+#endif
+
+//__________________
+AliFemtoDummyPairCut::AliFemtoDummyPairCut() :
+  fNPairsPassed(0),
+  fNPairsFailed(0)
+{
+  /* no-op */
+}
+//__________________
+AliFemtoDummyPairCut::~AliFemtoDummyPairCut(){
+  /* no-op */
+}
+//__________________
+bool AliFemtoDummyPairCut::Pass(const AliFemtoPair* /* pair */){
+  // Pass all pairs
+  bool temp = true;
+  temp ? fNPairsPassed++ : fNPairsFailed++;
+  return true;
+}
+//__________________
+AliFemtoString AliFemtoDummyPairCut::Report(){
+  // prepare a report from the execution
+  string stemp = "AliFemtoDummy Pair Cut - total dummy-- always returns true\n";
+  char ctemp[100];
+  snprintf(ctemp , 100, "Number of pairs which passed:\t%ld  Number which failed:\t%ld\n",fNPairsPassed,fNPairsFailed);
+  stemp += ctemp;
+  AliFemtoString returnThis = stemp;
+  return returnThis;
+}
+//__________________
+TList *AliFemtoDummyPairCut::ListSettings()
+{
+  // return a list of settings in a writable form
+  TList *tListSetttings = new TList();
+
+  return tListSetttings;
+}
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoDummyPairCut.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoDummyPairCut.h
new file mode 100644 (file)
index 0000000..49a14ef
--- /dev/null
@@ -0,0 +1,113 @@
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// AliFemtoDummyPairCut: a summy pair cut. Accepts all pairs             //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+/***************************************************************************
+ *
+ * $Id$
+ *
+ * Author: Mike Lisa, Ohio State, lisa@mps.ohio-state.edu
+ ***************************************************************************
+ *
+ * Description: part of STAR HBT Framework: AliFemtoMaker package
+ *   a do-nothing pair cut that simply says "true" to every pair           
+ *
+ ***************************************************************************
+ *
+ * $Log$
+ * Revision 1.2.2.1  2007/10/12 14:28:37  akisiel
+ * New wave of cleanup and rule conformance
+ *
+ * Revision 1.2  2007/05/22 09:01:42  akisiel
+ * Add the possibiloity to save cut settings in the ROOT file
+ *
+ * Revision 1.1  2007/05/16 10:22:11  akisiel
+ * Making the directory structure of AliFemto flat. All files go into one common directory
+ *
+ * Revision 1.2  2007/05/03 09:41:06  akisiel
+ * Fixing Effective C++ warnings
+ *
+ * Revision 1.1.1.1  2007/04/25 15:38:41  panos
+ * Importing the HBT code dir
+ *
+ * Revision 1.1.1.1  2007/03/07 10:14:49  mchojnacki
+ * First version on CVS
+ *
+ * Revision 1.5  2000/03/23 22:57:28  laue
+ * Clone() function implemented
+ *
+ * Revision 1.4  2000/01/25 17:35:03  laue
+ * I. In order to run the stand alone version of the AliFemtoMaker the following
+ * changes have been done:
+ * a) all ClassDefs and ClassImps have been put into #ifdef __ROOT__ statements
+ * b) unnecessary includes of StMaker.h have been removed
+ * c) the subdirectory AliFemtoMaker/doc/Make has been created including everything
+ * needed for the stand alone version
+ *
+ * II. To reduce the amount of compiler warning
+ * a) some variables have been type casted
+ * b) some destructors have been declared as virtual
+ *
+ * Revision 1.3  1999/10/15 01:57:05  lisa
+ * Important enhancement of AliFemtoMaker - implement Franks CutMonitors
+ * ----------------------------------------------------------
+ * This means 3 new files in Infrastructure area (CutMonitor),
+ * several specific CutMonitor classes in the Cut area
+ * and a new base class in the Base area (AliFemtoCutMonitor).
+ * This means also changing all Cut Base class header files from .h to .h
+ * so we have access to CutMonitor methods from Cint command line.
+ * This last means
+ * 1) files which include these header files are slightly modified
+ * 2) a side benefit: the TrackCuts and V0Cuts no longer need
+ * a SetMass() implementation in each Cut class, which was stupid.
+ * Also:
+ * -----
+ * Include Franks AliFemtoAssociationReader
+ * ** None of these changes should affect any user **
+ *
+ * Revision 1.2  1999/07/06 22:33:21  lisa
+ * Adjusted all to work in pro and new - dev itself is broken
+ *
+ * Revision 1.1.1.1  1999/06/29 16:02:56  lisa
+ * Installation of AliFemtoMaker
+ *
+ **************************************************************************/
+
+
+#ifndef ALIFEMTODUMMYPAIRCUT_H
+#define ALIFEMTODUMMYPAIRCUT_H
+
+// do I need these lines ?
+//#ifndef StMaker_H
+//#include "StMaker.h"
+//#endif
+
+#include "AliFemtoPairCut.h"
+
+class AliFemtoDummyPairCut : public AliFemtoPairCut{
+public:
+  AliFemtoDummyPairCut();
+  AliFemtoDummyPairCut(const AliFemtoDummyPairCut&);
+  virtual ~AliFemtoDummyPairCut();
+  AliFemtoDummyPairCut& operator=(const AliFemtoDummyPairCut&);
+
+  virtual bool Pass(const AliFemtoPair*);
+  virtual AliFemtoString Report();
+  virtual TList *ListSettings();
+  AliFemtoDummyPairCut* Clone();
+
+private:
+  long fNPairsPassed;  // number of pairs analyzed by this cut that passed
+  long fNPairsFailed;  // number of pairs analyzed by this cut that failed
+
+#ifdef __ROOT__
+  ClassDef(AliFemtoDummyPairCut, 1)
+#endif
+};
+
+inline AliFemtoDummyPairCut::AliFemtoDummyPairCut(const AliFemtoDummyPairCut& c) : AliFemtoPairCut(c), fNPairsPassed(0), fNPairsFailed(0) { /* no-op */ }
+inline AliFemtoDummyPairCut& AliFemtoDummyPairCut::operator=(const AliFemtoDummyPairCut& c) {   if (this != &c) { AliFemtoPairCut::operator=(c); }  return *this; }
+inline AliFemtoDummyPairCut* AliFemtoDummyPairCut::Clone() { AliFemtoDummyPairCut* c = new AliFemtoDummyPairCut(*this); return c;}
+
+#endif
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEnumeration.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEnumeration.h
new file mode 100644 (file)
index 0000000..5c88e50
--- /dev/null
@@ -0,0 +1,45 @@
+/***************************************************************************
+ *
+ * $Id$
+ *
+ * Author: Frank Laue, BNL, laue@bnl.gov
+ ***************************************************************************
+ *
+ ***************************************************************************
+ *
+ * $Log$
+ * Revision 1.1.1.1  2007/04/25 15:38:41  panos
+ * Importing the HBT code dir
+ *
+ * Revision 1.1.1.1  2007/03/07 10:14:49  mchojnacki
+ * First version on CVS
+ *
+ * Revision 1.3  2003/01/08 19:43:12  perev
+ * CleanUp
+ *
+ * Revision 1.2  2001/09/05 20:41:42  laue
+ * Updates of the hbtMuDstTree microDSTs
+ *
+ * Revision 1.1  2001/06/21 19:15:45  laue
+ * Modified fiels:
+ *   CTH.h : new constructor added
+ *   AliFemtoEvent, AliFemtoKink, AliFemtoTrack : constructors from the persistent
+ *                                   (TTree) classes added
+ *   AliFemtoLikeSignAnalysis : minor changes, for debugging
+ *   AliFemtoTypes: split into different files
+ * Added files: for the new TTree muDst's
+ *   StExceptions.cxx StExceptions.h AliFemtoEnumeration.h
+ *   AliFemtoHelix.h AliFemtoHisto.h AliFemtoString.h AliFemtoTFile.h
+ *   AliFemtoTTreeEvent.cxx AliFemtoTTreeEvent.h AliFemtoTTreeKink.cxx
+ *   AliFemtoTTreeKink.h AliFemtoTTreeTrack.cxx AliFemtoTTreeTrack.h
+ *   AliFemtoTTreeV0.cxx AliFemtoTTreeV0.h AliFemtoVector.h
+ *
+ *
+ ***************************************************************************/
+#ifndef AliFemtoEnumeration_hh
+#define AliFemtoEnumeration_hh
+
+enum AliFemtoParticleType {hbtUndefined, hbtTrack, hbtV0, hbtKink, hbtXi};
+enum AliFemtoIOMode {hbtRead, hbtWrite};
+
+#endif
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEvent.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEvent.cxx
new file mode 100644 (file)
index 0000000..f09b0a8
--- /dev/null
@@ -0,0 +1,551 @@
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+//  AliFemtoEvent: hold the information specific to the event and a      //
+//  track list                                                           //
+//  AliFemtoEvent is the "transient microDST"  Objects of this class are //
+//   generated from the input data by a Reader, and then presented to   //
+//   the Cuts of the various active Analyses.                           //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+#include "AliFemtoEvent.h"
+#include "AliFemtoTrack.h"
+#include "AliFemtoV0.h"
+#include "AliFemtoXi.h"
+#include "AliFemtoKink.h"
+#include "AliFemtoTrackCut.h"
+#include "AliFemtoV0Cut.h"
+#include "AliFemtoXiCut.h"
+#include "AliFemtoKinkCut.h"
+#include "PhysicalConstants.h"
+#include "SystemOfUnits.h"
+#include "AliEventplane.h"
+
+// Mike removed all of the AliFemtoTTree stuff here 21apr2006 - it was not used for a long time.
+
+//___________________
+AliFemtoEvent::AliFemtoEvent():
+  fEventNumber(0),
+  fRunNumber(0),
+  fNumberOfTracks(0),
+  fNormalizedMult(-2),
+  fSPDMult(0),
+  fEstimateITSTPC(0),
+  fEstimateTracklets(0),
+  fEstimateITSPure(0),
+  fCentralityV0(0),
+  fCentralityFMD(0),
+  fCentralitySPD1(0),
+  fCentralityTrk(0),
+  fMagneticField(0),
+  fIsCollisionCandidate(kTRUE),
+  fPrimVertPos(0,0,0),
+  fPrimVertCov(),
+  fTrackCollection(0),
+  fV0Collection(0),
+  fXiCollection(0),
+  fKinkCollection(0),
+  fZDCN1Energy(0),   
+  fZDCP1Energy(0),   
+  fZDCN2Energy(0),   
+  fZDCP2Energy(0),   
+  fZDCEMEnergy(0),   
+  fZDCParticipants(0),
+  fTriggerMask(0),  
+  fTriggerCluster(0),
+  fReactionPlaneAngle(0),
+  fEP(0)
+{
+  // Default constructor
+  fPrimVertPos[0]=-999.0;
+  fPrimVertPos[1]=-999.0;
+  fPrimVertPos[2]=-999.0;
+  fPrimVertCov[0]=0.000000000001;
+  fPrimVertCov[1]=0.000000000001;
+  fPrimVertCov[2]=0.000000000001;
+  fPrimVertCov[3]=0.000000000001;
+  fPrimVertCov[4]=0.000000000001;
+  fPrimVertCov[5]=0.000000000001;
+  fTrackCollection = new AliFemtoTrackCollection;
+  fV0Collection = new AliFemtoV0Collection;
+  fXiCollection = new AliFemtoXiCollection;
+  fKinkCollection = new AliFemtoKinkCollection;
+  fMagneticField=0.0;
+}
+//___________________
+AliFemtoEvent::AliFemtoEvent(const AliFemtoEvent& ev, AliFemtoTrackCut* tCut, AliFemtoV0Cut* vCut, AliFemtoXiCut* xCut, AliFemtoKinkCut* kCut):
+  fEventNumber(0),
+  fRunNumber(0),
+  fNumberOfTracks(0),
+  fNormalizedMult(-2),
+  fSPDMult(0),
+  fEstimateITSTPC(0),
+  fEstimateTracklets(0),
+  fEstimateITSPure(0),
+  fCentralityV0(0),
+  fCentralityFMD(0),
+  fCentralitySPD1(0),
+  fCentralityTrk(0),
+  fMagneticField(0),
+  fIsCollisionCandidate(kTRUE),
+  fPrimVertPos(0,0,0),
+  fPrimVertCov(),
+  fTrackCollection(0),
+  fV0Collection(0),
+  fXiCollection(0),
+  fKinkCollection(0),
+  fZDCN1Energy(0),   
+  fZDCP1Energy(0),   
+  fZDCN2Energy(0),   
+  fZDCP2Energy(0),   
+  fZDCEMEnergy(0),   
+  fZDCParticipants(0),
+  fTriggerMask(0),  
+  fTriggerCluster(0),
+  fReactionPlaneAngle(0),
+  fEP(0)
+{ // copy constructor with track and v0 cuts
+  //cout << "AliFemtoEvent::AliFemtoEvent(const AliFemtoEvent& ev, AliFemtoTrackCut* tCut, AliFemtoV0Cut* vCut, AliFemtoV0Cut* kCut)" << endl;
+  fEventNumber = ev.fEventNumber;
+  fRunNumber = ev.fRunNumber;
+  
+  SetPrimVertCov(ev.PrimVertCov());
+
+  fZDCN1Energy=ev.fZDCN1Energy;     
+  fZDCP1Energy=ev.fZDCP1Energy;      
+  fZDCN2Energy=ev.fZDCN2Energy;      
+  fZDCP2Energy=ev.fZDCP2Energy;      
+  fZDCEMEnergy=ev.fZDCEMEnergy;
+  fZDCParticipants=ev.fZDCParticipants;
+  fNumberOfTracks = ev.fNumberOfTracks;
+  fNormalizedMult = ev.fNormalizedMult;
+  fEstimateITSTPC = ev.fEstimateITSTPC;
+  fEstimateTracklets = ev.fEstimateTracklets;
+  fEstimateITSPure = ev.fEstimateITSPure;
+  fCentralityV0 = ev.fCentralityV0; 
+  fCentralityFMD = ev.fCentralityFMD;
+  fCentralitySPD1 = ev.fCentralitySPD1;
+  fCentralityTrk = ev.fCentralityTrk;
+  fMagneticField= ev.fMagneticField;
+  fIsCollisionCandidate = ev.fIsCollisionCandidate;
+
+  fTriggerMask=ev.fTriggerMask;     // Trigger Type (mask)
+  fTriggerCluster=ev.fTriggerCluster;
+  fReactionPlaneAngle=ev.fReactionPlaneAngle;
+  fEP=ev.fEP;
+
+  // create collections
+  fTrackCollection = new AliFemtoTrackCollection;
+  fV0Collection = new AliFemtoV0Collection;
+  fXiCollection = new AliFemtoXiCollection;
+  fKinkCollection = new AliFemtoKinkCollection;
+  // copy track collection  
+  for ( AliFemtoTrackIterator tIter=ev.fTrackCollection->begin(); tIter!=ev.fTrackCollection->end(); tIter++) {
+    if ( !tCut || tCut->Pass(*tIter) ) {
+      AliFemtoTrack* trackCopy = new AliFemtoTrack(**tIter);
+      fTrackCollection->push_back(trackCopy);
+    }
+  }
+  // copy v0 collection
+  for ( AliFemtoV0Iterator vIter=ev.fV0Collection->begin(); vIter!=ev.fV0Collection->end(); vIter++) {
+    if ( !vCut || vCut->Pass(*vIter) ) {
+      AliFemtoV0* v0Copy = new AliFemtoV0(**vIter);
+      fV0Collection->push_back(v0Copy);
+    }
+  }
+  // copy xi collection
+  for ( AliFemtoXiIterator xIter=ev.fXiCollection->begin(); xIter!=ev.fXiCollection->end(); xIter++) {
+    if ( !xCut || xCut->Pass(*xIter) ) {
+      AliFemtoXi* xiCopy = new AliFemtoXi(**xIter);
+      fXiCollection->push_back(xiCopy);
+    }
+  }
+  // copy kink collection  
+  for ( AliFemtoKinkIterator kIter=ev.fKinkCollection->begin(); kIter!=ev.fKinkCollection->end(); kIter++) {
+    if ( !kCut || kCut->Pass(*kIter) ) {
+      //cout << " kinkCut passed " << endl;
+      AliFemtoKink* kinkCopy = new AliFemtoKink(**kIter);
+      fKinkCollection->push_back(kinkCopy);
+    }
+  }
+}
+//___________________
+AliFemtoEvent::AliFemtoEvent(const AliFemtoEvent& ev):
+  fEventNumber(0),
+  fRunNumber(0),
+  fNumberOfTracks(0),
+  fNormalizedMult(-2),
+  fSPDMult(0),
+  fEstimateITSTPC(0),
+  fEstimateTracklets(0),
+  fEstimateITSPure(0),
+  fCentralityV0(0),
+  fCentralityFMD(0),
+  fCentralitySPD1(0),
+  fCentralityTrk(0),
+  fMagneticField(0),
+  fIsCollisionCandidate(kTRUE),
+  fPrimVertPos(0,0,0),
+  fPrimVertCov(),
+  fTrackCollection(0),
+  fV0Collection(0),
+  fXiCollection(0),
+  fKinkCollection(0),
+  fZDCN1Energy(0),   
+  fZDCP1Energy(0),   
+  fZDCN2Energy(0),   
+  fZDCP2Energy(0),   
+  fZDCEMEnergy(0),   
+  fZDCParticipants(0),
+  fTriggerMask(0),  
+  fTriggerCluster(0),
+  fReactionPlaneAngle(0),
+  fEP(0)
+{ 
+  // copy constructor 
+  fEventNumber = ev.fEventNumber;
+  fRunNumber = ev.fRunNumber;
+  
+  SetPrimVertCov(ev.PrimVertCov());
+
+  fZDCN1Energy=ev.fZDCN1Energy;     
+  fZDCP1Energy=ev.fZDCP1Energy;      
+  fZDCN2Energy=ev.fZDCN2Energy;      
+  fZDCP2Energy=ev.fZDCP2Energy;      
+  fZDCEMEnergy=ev.fZDCEMEnergy;
+  fZDCParticipants=ev.fZDCParticipants;
+  fNumberOfTracks = ev.fNumberOfTracks;
+  fEstimateITSTPC = ev.fEstimateITSTPC;
+  fEstimateTracklets = ev.fEstimateTracklets;
+  fEstimateITSPure = ev.fEstimateITSPure;
+  fCentralityV0 = ev.fCentralityV0; 
+  fCentralityFMD = ev.fCentralityFMD;
+  fCentralitySPD1 = ev.fCentralitySPD1;
+  fCentralityTrk = ev.fCentralityTrk;
+  fMagneticField= ev.fMagneticField;
+  fIsCollisionCandidate = ev.fIsCollisionCandidate;
+  fTriggerMask=ev.fTriggerMask;     // Trigger Type (mask)
+  fTriggerCluster=ev.fTriggerCluster;
+  fReactionPlaneAngle=ev.fReactionPlaneAngle;
+  fEP=ev.fEP;
+  // create collections
+  fTrackCollection = new AliFemtoTrackCollection;
+  fV0Collection = new AliFemtoV0Collection;
+  fXiCollection = new AliFemtoXiCollection;
+  fKinkCollection = new AliFemtoKinkCollection;
+  // copy track collection  
+  for ( AliFemtoTrackIterator tIter=ev.fTrackCollection->begin(); tIter!=ev.fTrackCollection->end(); tIter++) {
+    AliFemtoTrack* trackCopy = new AliFemtoTrack(**tIter);
+    fTrackCollection->push_back(trackCopy);
+  }
+  // copy v0 collection
+  for ( AliFemtoV0Iterator vIter=ev.fV0Collection->begin(); vIter!=ev.fV0Collection->end(); vIter++) {
+    AliFemtoV0* v0Copy = new AliFemtoV0(**vIter);
+    fV0Collection->push_back(v0Copy);
+  }
+  // copy xi collection
+  for ( AliFemtoXiIterator xIter=ev.fXiCollection->begin(); xIter!=ev.fXiCollection->end(); xIter++) {
+    AliFemtoXi* xiCopy = new AliFemtoXi(**xIter);
+    fXiCollection->push_back(xiCopy);
+  }
+  // copy kink collection  
+  for ( AliFemtoKinkIterator kIter=ev.fKinkCollection->begin(); kIter!=ev.fKinkCollection->end(); kIter++) {
+    //cout << " kinkCut passed " << endl;
+    AliFemtoKink* kinkCopy = new AliFemtoKink(**kIter);
+    fKinkCollection->push_back(kinkCopy);
+  }
+}
+//______________________________
+AliFemtoEvent& AliFemtoEvent::operator=(const AliFemtoEvent& aEvent)
+{
+  // assignment operator
+  if (this == &aEvent)
+    return *this;
+
+  fEventNumber = aEvent.fEventNumber;
+  fRunNumber = aEvent.fRunNumber;
+  
+  fZDCN1Energy=aEvent.fZDCN1Energy;     
+  fZDCP1Energy=aEvent.fZDCP1Energy;      
+  fZDCN2Energy=aEvent.fZDCN2Energy;      
+  fZDCP2Energy=aEvent.fZDCP2Energy;      
+  fZDCEMEnergy=aEvent.fZDCEMEnergy;
+  fZDCParticipants=aEvent.fZDCParticipants;
+  fNumberOfTracks = aEvent.fNumberOfTracks;
+  fEstimateITSTPC = aEvent.fEstimateITSTPC;
+  fEstimateTracklets = aEvent.fEstimateTracklets;
+  fEstimateITSPure = aEvent.fEstimateITSPure;
+  fCentralityV0 = aEvent.fCentralityV0; 
+  fCentralityFMD = aEvent.fCentralityFMD;
+  fCentralitySPD1 = aEvent.fCentralitySPD1;
+  fCentralityTrk = aEvent.fCentralityTrk;
+  fNormalizedMult = aEvent.fNormalizedMult;
+  fEstimateITSTPC = aEvent.fEstimateITSTPC;
+  fEstimateTracklets = aEvent.fEstimateTracklets;
+  fEstimateITSPure = aEvent.fEstimateITSPure;
+  fMagneticField= aEvent.fMagneticField;
+  fIsCollisionCandidate = aEvent.fIsCollisionCandidate;
+
+  fTriggerMask=aEvent.fTriggerMask;     // Trigger Type (mask)
+  fTriggerCluster=aEvent.fTriggerCluster;
+  fReactionPlaneAngle=aEvent.fReactionPlaneAngle;
+  fEP=aEvent.fEP;
+  if (fTrackCollection) {
+    for (AliFemtoTrackIterator iter=fTrackCollection->begin();iter!=fTrackCollection->end();iter++){
+      delete *iter;
+    }
+    fTrackCollection->clear();
+    delete fTrackCollection;
+  }
+  fTrackCollection = new AliFemtoTrackCollection;
+
+  if (fV0Collection) {
+    for (AliFemtoV0Iterator tV0iter=fV0Collection->begin();tV0iter!=fV0Collection->end();tV0iter++){
+      delete *tV0iter;
+    }//added by M Chojnacki To avodid memory leak 
+    fV0Collection->clear();
+    delete fV0Collection;
+  }
+
+  fV0Collection = new AliFemtoV0Collection;
+
+  if (fXiCollection) {
+    for (AliFemtoXiIterator tXiIter=fXiCollection->begin();tXiIter!=fXiCollection->end();tXiIter++){
+      delete *tXiIter;
+    }
+    fXiCollection->clear();
+    delete fXiCollection;
+  }
+  fXiCollection = new AliFemtoXiCollection;
+  
+  if (fKinkCollection) {
+    for (AliFemtoKinkIterator kinkIter=fKinkCollection->begin();kinkIter!=fKinkCollection->end();kinkIter++){
+      delete *kinkIter;
+    }
+    fKinkCollection->clear();
+    delete fKinkCollection;
+  }
+  fKinkCollection = new AliFemtoKinkCollection;
+
+  // copy track collection  
+  for ( AliFemtoTrackIterator tIter=aEvent.fTrackCollection->begin(); tIter!=aEvent.fTrackCollection->end(); tIter++) {
+    AliFemtoTrack* trackCopy = new AliFemtoTrack(**tIter);
+    fTrackCollection->push_back(trackCopy);
+  }
+  // copy v0 collection
+  for ( AliFemtoV0Iterator vIter=aEvent.fV0Collection->begin(); vIter!=aEvent.fV0Collection->end(); vIter++) {
+    AliFemtoV0* v0Copy = new AliFemtoV0(**vIter);
+    fV0Collection->push_back(v0Copy);
+  }
+  // copy xi collection
+  for ( AliFemtoXiIterator xIter=aEvent.fXiCollection->begin(); xIter!=aEvent.fXiCollection->end(); xIter++) {
+    AliFemtoXi* xiCopy = new AliFemtoXi(**xIter);
+    fXiCollection->push_back(xiCopy);
+  }
+  // copy kink collection  
+  for ( AliFemtoKinkIterator kIter=aEvent.fKinkCollection->begin(); kIter!=aEvent.fKinkCollection->end(); kIter++) {
+    AliFemtoKink* kinkCopy = new AliFemtoKink(**kIter);
+    fKinkCollection->push_back(kinkCopy);
+  }
+
+  return *this;
+}
+
+//___________________
+AliFemtoEvent::~AliFemtoEvent(){
+  // destructor
+#ifdef STHBTDEBUG
+  cout << " AliFemtoEvent::~AliFemtoEvent() " << endl;
+#endif
+  for (AliFemtoTrackIterator iter=fTrackCollection->begin();iter!=fTrackCollection->end();iter++){
+    delete *iter;
+  }
+  fTrackCollection->clear();
+  delete fTrackCollection;
+  //must do the same for the V0 collection
+  for (AliFemtoV0Iterator tV0iter=fV0Collection->begin();tV0iter!=fV0Collection->end();tV0iter++){
+    delete *tV0iter;
+  }//added by M Chojnacki To avodid memory leak 
+  fV0Collection->clear();
+  delete fV0Collection;
+  //must do the same for the Xi collection
+  for (AliFemtoXiIterator tXiIter=fXiCollection->begin();tXiIter!=fXiCollection->end();tXiIter++){
+    delete *tXiIter;
+  }
+  fXiCollection->clear();
+  delete fXiCollection;
+  //must do the same for the Kink collection
+  for (AliFemtoKinkIterator kinkIter=fKinkCollection->begin();kinkIter!=fKinkCollection->end();kinkIter++){
+    delete *kinkIter;
+  }
+  fKinkCollection->clear();
+  delete fKinkCollection;
+}
+//___________________
+
+
+
+void AliFemtoEvent::SetEventNumber(const unsigned short& event){fEventNumber = event;}
+void AliFemtoEvent::SetRunNumber(const int& runNum){fRunNumber = runNum;}
+
+
+void AliFemtoEvent::SetZDCN1Energy(const float& aZDCN1Energy){fZDCN1Energy=aZDCN1Energy;}
+void AliFemtoEvent::SetZDCP1Energy(const float& aZDCP1Energy){fZDCP1Energy=aZDCP1Energy;}      
+void AliFemtoEvent::SetZDCN2Energy(const float& aZDCN2Energy){fZDCN2Energy=aZDCN2Energy;}      
+void AliFemtoEvent::SetZDCP2Energy(const float& aZDCP2Energy){fZDCP2Energy=aZDCP2Energy;}      
+void AliFemtoEvent::SetZDCEMEnergy(const float& aZDCEMEnergy){fZDCEMEnergy=aZDCEMEnergy;}    
+void AliFemtoEvent::SetZDCParticipants(const unsigned int& aZDCParticipants){fZDCParticipants=aZDCParticipants;}
+
+void AliFemtoEvent::SetNumberOfTracks(const unsigned short& tracks){fNumberOfTracks = tracks;}
+void AliFemtoEvent::SetNormalizedMult(const int& i){fNormalizedMult = i;}
+void AliFemtoEvent::SetSPDMult(const int& i){fSPDMult = i;}
+
+void AliFemtoEvent::SetPrimVertPos(const AliFemtoThreeVector& vp){fPrimVertPos = vp;}
+void AliFemtoEvent::SetPrimVertCov(const double* v){
+  fPrimVertCov[0] = v[0];
+  fPrimVertCov[1] = v[1];
+  fPrimVertCov[2] = v[2];
+  fPrimVertCov[3] = v[3];
+  fPrimVertCov[4] = v[4];
+  fPrimVertCov[5] = v[5];
+}
+void AliFemtoEvent::SetMagneticField(const double& magF){fMagneticField = magF;}
+void AliFemtoEvent::SetIsCollisionCandidate(const bool& is){fIsCollisionCandidate = is;}
+
+void AliFemtoEvent::SetTriggerMask(const unsigned long int& aTriggerMask) {fTriggerMask=aTriggerMask;}
+void AliFemtoEvent::SetTriggerCluster(const unsigned char& aTriggerCluster) {fTriggerCluster=aTriggerCluster;}
+
+
+unsigned short AliFemtoEvent::EventNumber() const {return fEventNumber;}
+int            AliFemtoEvent::RunNumber() const {return fRunNumber;}
+
+
+
+unsigned short AliFemtoEvent::NumberOfTracks() const {return fNumberOfTracks;}
+
+AliFemtoV0Collection* AliFemtoEvent::V0Collection() const {return fV0Collection;}
+AliFemtoXiCollection* AliFemtoEvent::XiCollection() const {return fXiCollection;}
+AliFemtoKinkCollection* AliFemtoEvent::KinkCollection() const {return fKinkCollection;}
+AliFemtoTrackCollection* AliFemtoEvent::TrackCollection() const {return fTrackCollection;}
+AliFemtoThreeVector AliFemtoEvent::PrimVertPos() const {return fPrimVertPos;}
+const double* AliFemtoEvent::PrimVertCov() const {return fPrimVertCov;}
+double AliFemtoEvent::MagneticField() const {return fMagneticField;}
+unsigned long int AliFemtoEvent::TriggerMask() const {return fTriggerMask;}
+unsigned char AliFemtoEvent::TriggerCluster() const {return fTriggerCluster;}
+bool AliFemtoEvent::IsCollisionCandidate() const {return fIsCollisionCandidate;}
+
+
+float AliFemtoEvent::ZDCN1Energy() const {return fZDCN1Energy;}       
+float AliFemtoEvent::ZDCP1Energy() const {return fZDCP1Energy;}       
+float AliFemtoEvent::ZDCN2Energy() const {return fZDCN2Energy;}       
+float AliFemtoEvent::ZDCP2Energy() const {return fZDCP2Energy;}       
+float AliFemtoEvent::ZDCEMEnergy() const {return fZDCEMEnergy;}   
+unsigned int  AliFemtoEvent::ZDCParticipants() const {return fZDCParticipants;}
+
+void AliFemtoEvent::SetReactionPlaneAngle(const float& a) { fReactionPlaneAngle = a;}
+float AliFemtoEvent::ReactionPlaneAngle() const { return fReactionPlaneAngle; }
+void AliFemtoEvent::SetEP(AliEventplane* ep) { fEP = ep;}
+AliEventplane* AliFemtoEvent::EP() const {return fEP; }
+
+//----------------------------- below here is only for star
+
+int AliFemtoEvent::UncorrectedNumberOfNegativePrimaries() const
+{
+  return NumberOfTracks()/2;
+}
+
+int AliFemtoEvent::SPDMultiplicity() const
+{
+  return fSPDMult;
+}
+
+int AliFemtoEvent::UncorrectedNumberOfPrimaries() const
+{
+  if (fNormalizedMult < -1) {
+    // Count number of normalized charged tracks 
+    Int_t tNormTrackCount = 0;
+    for (AliFemtoTrackIterator iter=fTrackCollection->begin();iter!=fTrackCollection->end();iter++){
+      if (!((*iter)->Flags()&(AliFemtoTrack::kTPCrefit))) continue;
+      if ((*iter)->TPCncls() < 50) continue;
+      if ((*iter)->TPCchi2()/(*iter)->TPCncls() > 60.0) continue;
+      if ((*iter)->ImpactD() > 6.0) continue;
+      if ((*iter)->ImpactZ() > 6.0) continue;
+      if (fabs((*iter)->P().PseudoRapidity()) > 0.9) continue;
+      
+      tNormTrackCount++;
+    }
+    return tNormTrackCount;
+  }
+
+  return fNormalizedMult;
+  //  return NumberOfTracks();
+}
+
+unsigned short AliFemtoEvent::MultiplicityEstimateITSTPC() const
+{
+  return fEstimateITSTPC;
+}
+
+unsigned short AliFemtoEvent::MultiplicityEstimateTracklets() const
+{
+  return fEstimateTracklets;
+}
+
+unsigned short AliFemtoEvent::MultiplicityEstimateITSPure() const
+{
+  return fEstimateITSPure;
+}
+
+void AliFemtoEvent::SetMultiplicityEstimateITSTPC(const unsigned short &s)
+{
+  fEstimateITSTPC = s;
+}
+
+void AliFemtoEvent::SetMultiplicityEstimateTracklets(const unsigned short &s)
+{
+  fEstimateTracklets = s;
+}
+
+void AliFemtoEvent::SetMultiplicityEstimateITSPure(const unsigned short &s)
+{
+  fEstimateITSPure = s;
+}
+
+void AliFemtoEvent::SetCentralityV0(const float &c)
+{
+  fCentralityV0 = c;
+}
+
+void AliFemtoEvent::SetCentralityFMD(const float &c)
+{
+  fCentralityFMD = c;
+}
+
+void AliFemtoEvent::SetCentralitySPD1(const float &c)
+{
+  fCentralitySPD1 = c;
+}
+
+void AliFemtoEvent::SetCentralityTrk(const float &c)
+{
+  fCentralityTrk = c;
+}
+
+float AliFemtoEvent::CentralityV0() const
+{
+  return fCentralityV0;
+}
+
+float AliFemtoEvent::CentralityFMD() const
+{
+  return fCentralityFMD;
+}
+
+float AliFemtoEvent::CentralitySPD1() const
+{
+  return fCentralitySPD1;
+}
+
+float AliFemtoEvent::CentralityTrk() const
+{
+  return fCentralityTrk;
+}
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEvent.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEvent.h
new file mode 100644 (file)
index 0000000..1b56114
--- /dev/null
@@ -0,0 +1,157 @@
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+//  AliFemtoEvent: hold the information specific to the event and a      //
+//  track list                                                           //
+//  AliFemtoEvent is the "transient microDST"  Objects of this class are //
+//   generated from the input data by a Reader, and then presented to   //
+//   the Cuts of the various active Analyses.                           //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+
+#ifndef ALIFEMTOEVENT_H
+#define ALIFEMTOEVENT_H
+
+#include "AliFemtoTypes.h"
+#include "AliFemtoTrackCollection.h"
+#include "AliFemtoV0Collection.h"
+#include "AliFemtoXiCollection.h"
+#include "AliFemtoKinkCollection.h"
+
+class AliFemtoTrackCut;
+class AliFemtoV0Cut;
+class AliFemtoXiCut;
+class AliFemtoKinkCut;
+class AliEventplane;
+
+#ifdef __ROOT__
+// the following encapsulation by malisa 21apr2006
+#ifndef __NO_STAR_DEPENDENCE_ALLOWED__
+class StMuDst;
+#endif
+#endif
+
+class AliFemtoEvent{
+public:
+  AliFemtoEvent();
+#ifdef __ROOT__
+#ifndef __NO_STAR_DEPENDENCE_ALLOWED__
+//
+#endif
+#endif
+  
+  AliFemtoEvent(const AliFemtoEvent& ev, AliFemtoTrackCut* tCut=0, AliFemtoV0Cut* vCut=0,  AliFemtoXiCut* xCut=0, AliFemtoKinkCut* kCut=0); // copy constructor with track and v0 cuts
+  AliFemtoEvent(const AliFemtoEvent& ev); // copy constructor
+  ~AliFemtoEvent();
+  AliFemtoEvent& operator=(const AliFemtoEvent& aEvent);
+
+  unsigned short EventNumber() const;
+  int RunNumber() const;
+  unsigned short NumberOfTracks() const;
+  AliFemtoThreeVector PrimVertPos() const;
+  const double* PrimVertCov() const;
+  AliFemtoV0Collection* V0Collection() const;
+  AliFemtoXiCollection* XiCollection() const;
+  AliFemtoKinkCollection* KinkCollection() const;
+  AliFemtoTrackCollection* TrackCollection() const;
+  double MagneticField() const;
+  bool IsCollisionCandidate() const;
+
+  //functions for alice variables
+  float ZDCN1Energy() const;      
+  float ZDCP1Energy() const;      
+  float ZDCN2Energy() const;      
+  float ZDCP2Energy() const;      
+  float ZDCEMEnergy() const;    
+  unsigned int ZDCParticipants() const; 
+
+  unsigned long int     TriggerMask() const;     
+  unsigned char      TriggerCluster() const;  
+
+  float ReactionPlaneAngle() const;
+  AliEventplane* EP() const;
+  
+  void SetEventNumber(const unsigned short& s);
+  void SetRunNumber(const int& i);
+  void SetNumberOfTracks(const unsigned short& s);
+  void SetNormalizedMult(const int& i);
+  void SetMultiplicityEstimateITSTPC(const unsigned short &s);
+  void SetMultiplicityEstimateTracklets(const unsigned short &s);
+  void SetMultiplicityEstimateITSPure(const unsigned short &s);
+  void SetCentralityV0(const float &c);
+  void SetCentralityFMD(const float &c);
+  void SetCentralitySPD1(const float &c);
+  void SetCentralityTrk(const float &c);
+  void SetSPDMult(const int& i);
+  void SetPrimVertPos(const AliFemtoThreeVector& v);
+  void SetPrimVertCov(const double* v);
+  void SetMagneticField(const double& x);
+  void SetIsCollisionCandidate(const bool& is);
+
+   //functions for alice variables
+  void SetZDCN1Energy(const float& x);      
+  void SetZDCP1Energy(const float& x);      
+  void SetZDCN2Energy(const float& x);      
+  void SetZDCP2Energy(const float& x);      
+  void SetZDCEMEnergy(const float& x);    
+  void SetZDCParticipants(const unsigned int& i);
+  
+  void SetTriggerMask(const unsigned long int& i);     
+  void SetTriggerCluster(const unsigned char& c); 
+
+  void SetReactionPlaneAngle(const float& a);
+  void SetEP(AliEventplane* ep);
+  
+  int UncorrectedNumberOfNegativePrimaries() const;
+  int UncorrectedNumberOfPrimaries() const;
+  int SPDMultiplicity() const;
+
+  unsigned short MultiplicityEstimateITSTPC() const;
+  unsigned short MultiplicityEstimateTracklets() const;
+  unsigned short MultiplicityEstimateITSPure() const;
+
+  float CentralityV0() const;
+  float CentralityFMD() const;
+  float CentralitySPD1() const;
+  float CentralityTrk() const;
+
+private:
+  unsigned short fEventNumber;           // Event number in file
+  unsigned short fRunNumber;             // run number the event belong to
+  unsigned short fNumberOfTracks;        // total number of TPC tracks
+  int   fNormalizedMult;                 // normalized multiplicity
+  int   fSPDMult;                        // Multiplicity of SPD tracklets
+  unsigned short fEstimateITSTPC;        // Official multiplicity estimate ITS+TPC
+  unsigned short fEstimateTracklets;     // Official multiplicity estimate Tracklets
+  unsigned short fEstimateITSPure;       // Official multiplicity estimate ITS SA
+  float fCentralityV0;                   // Official centrality from V0
+  float fCentralityFMD;                  // Official centrality from FMD
+  float fCentralitySPD1;                 // Official centrality from SPD layer 1
+  float fCentralityTrk;                  // Official centrality from tracks
+  double fMagneticField;                 // magnetic field in Z direction
+  bool fIsCollisionCandidate;            // is collision candidate
+  
+  AliFemtoThreeVector fPrimVertPos;      // primary vertex position
+  double fPrimVertCov[6];                // primary vertex covariances
+  AliFemtoTrackCollection* fTrackCollection; // collection of tracks
+  AliFemtoV0Collection* fV0Collection;   // collection of V0s
+  AliFemtoXiCollection* fXiCollection;   // collection of Xis
+  AliFemtoKinkCollection* fKinkCollection; // collection of kinks
+
+  //for alice changed by Marek Chojnacki
+  float      fZDCN1Energy;      // reconstructed energy in the neutron ZDC
+  float      fZDCP1Energy;      // reconstructed energy in the proton ZDC
+  float      fZDCN2Energy;      // reconstructed energy in the neutron ZDC
+  float      fZDCP2Energy;      // reconstructed energy in the proton ZDC
+  float      fZDCEMEnergy;     // reconstructed energy in the electromagnetic ZDC
+  unsigned int        fZDCParticipants; // number of participants estimated by the ZDC
+  
+  unsigned long int     fTriggerMask;     // Trigger Type (mask)
+  unsigned char      fTriggerCluster;  // Trigger cluster (mask)
+
+  float      fReactionPlaneAngle; // reconstructed reaction plane angle
+  AliEventplane*  fEP; // pointer to full event plane information
+};
+
+
+
+#endif 
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventCut.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventCut.h
new file mode 100644 (file)
index 0000000..b7916a1
--- /dev/null
@@ -0,0 +1,46 @@
+////////////////////////////////////////////////////////////////////////////////
+/// AliFemtoEventCut - the pure virtual base class for the event cut         ///
+/// All event cuts must inherit from this one                                ///
+////////////////////////////////////////////////////////////////////////////////
+#ifndef AliFemtoEventCut_hh
+#define AliFemtoEventCut_hh
+
+class AliFemtoEvent;
+class AliFemtoAnalysis;
+
+#include "AliFemtoCutMonitorHandler.h"
+#include "AliFemtoString.h"
+
+class AliFemtoEventCut : public AliFemtoCutMonitorHandler {
+
+  friend class AliFemtoAnalysis;
+
+public:
+
+  AliFemtoEventCut();                // default constructor. - Users should write their own
+  AliFemtoEventCut(const AliFemtoEventCut& c); // copy constructor
+  virtual ~AliFemtoEventCut(){/* no-op */};       // destructor
+  AliFemtoEventCut& operator=(const AliFemtoEventCut& aCut);
+
+  virtual bool Pass(const AliFemtoEvent* event) =0;  // true if passes, false if not
+
+  virtual AliFemtoString Report() =0;    // user-written method to return string describing cuts
+  virtual AliFemtoEventCut* Clone() { return 0;}
+
+
+  AliFemtoAnalysis* HbtAnalysis(){return fyAnalysis;};
+  void SetAnalysis(AliFemtoAnalysis* aAnalysis);
+
+protected:
+  AliFemtoAnalysis* fyAnalysis;
+
+#ifdef __ROOT__
+  ClassDef(AliFemtoEventCut, 0)
+#endif
+};
+
+inline AliFemtoEventCut::AliFemtoEventCut(const AliFemtoEventCut& /* c */) : AliFemtoCutMonitorHandler(), fyAnalysis(0) { }
+inline void AliFemtoEventCut::SetAnalysis(AliFemtoAnalysis* analysis) { fyAnalysis = analysis; }
+inline AliFemtoEventCut::AliFemtoEventCut(): AliFemtoCutMonitorHandler(), fyAnalysis(0){}                // default constructor. - Users should write their own
+inline AliFemtoEventCut& AliFemtoEventCut::operator=(const AliFemtoEventCut& aCut) { if (this == &aCut) return *this; fyAnalysis = aCut.fyAnalysis; return *this; }
+#endif
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventCutEstimators.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventCutEstimators.cxx
new file mode 100644 (file)
index 0000000..f9d8b99
--- /dev/null
@@ -0,0 +1,119 @@
+////////////////////////////////////////////////////////////////////////////////
+//                                                                            //
+// AliFemtoEventCutEstimators - the basic cut for events.                          //
+// Only cuts on event multiplicity and z-vertex position                      //
+//                                                                            //
+////////////////////////////////////////////////////////////////////////////////
+
+#include "AliFemtoEventCutEstimators.h"
+//#include <cstdio>
+
+#ifdef __ROOT__
+ClassImp(AliFemtoEventCutEstimators)
+#endif
+
+AliFemtoEventCutEstimators::AliFemtoEventCutEstimators() :
+  AliFemtoEventCut(),
+  fEventMultEst1(),
+  fEventMultEst2(),
+  fEventMultEst3(),
+  fUseMultEst1(0), 
+  fUseMultEst2(0), 
+  fUseMultEst3(0), 
+  fEventCentEst1(),
+  fEventCentEst2(),
+  fEventCentEst3(),
+  fEventCentEst4(),
+  fUseCentEst1(0), 
+  fUseCentEst2(0), 
+  fUseCentEst3(0), 
+  fUseCentEst4(0),
+  fNEventsPassed(0), 
+  fNEventsFailed(0) 
+{
+  // Default constructor
+  fEventMultEst1[0] = 0;  fEventMultEst1[1] = 10000;
+  fEventMultEst2[0] = 0;  fEventMultEst2[1] = 10000;
+  fEventMultEst3[0] = 0;  fEventMultEst3[1] = 10000;
+  fEventCentEst1[0] = 0;  fEventCentEst1[1] = 1000.0;
+  fEventCentEst2[0] = 0;  fEventCentEst2[1] = 1000.0;
+  fEventCentEst3[0] = 0;  fEventCentEst3[1] = 1000.0;
+  fEventCentEst4[0] = 0;  fEventCentEst4[1] = 1000.0;
+  fVertZPos[0] = -100.0;
+  fVertZPos[1] = 100.0;
+} 
+//------------------------------
+AliFemtoEventCutEstimators::~AliFemtoEventCutEstimators(){
+  // Default destructor
+}
+//------------------------------
+AliFemtoEventCutEstimators& AliFemtoEventCutEstimators::operator=(AliFemtoEventCutEstimators& c)
+{
+  if (this != &c) {
+    fEventMultEst1[0] = c.fEventMultEst1[0];  fEventMultEst1[1] = c.fEventMultEst1[1];
+    fEventMultEst2[0] = c.fEventMultEst2[0];  fEventMultEst2[1] = c.fEventMultEst2[1];
+    fEventMultEst3[0] = c.fEventMultEst3[0];  fEventMultEst3[1] = c.fEventMultEst3[1];
+    fEventCentEst1[0] = c.fEventCentEst1[0];  fEventCentEst1[1] = c.fEventCentEst1[1];
+    fEventCentEst2[0] = c.fEventCentEst2[0];  fEventCentEst2[1] = c.fEventCentEst2[1];
+    fEventCentEst3[0] = c.fEventCentEst3[0];  fEventCentEst3[1] = c.fEventCentEst3[1];
+    fEventCentEst4[0] = c.fEventCentEst4[0];  fEventCentEst4[1] = c.fEventCentEst4[1];
+    fVertZPos[0] = c.fVertZPos[0];
+    fVertZPos[1] = c.fVertZPos[1];
+  }
+
+  return *this;
+}
+
+//------------------------------
+bool AliFemtoEventCutEstimators::Pass(const AliFemtoEvent* event){
+  // Pass events if they fall within the multiplicity and z-vertex
+  // position range. Fail otherwise
+  //  int mult =  event->NumberOfTracks();
+  
+  bool goodEvent = true;
+
+  printf("Cutting event with %i %i %i - %i %i %i %i\n", fUseMultEst1, fUseMultEst2, fUseMultEst3, fUseCentEst1, fUseCentEst2, fUseCentEst3, fUseCentEst4);
+  printf("  On %i %i %i - %f %f %f %f\n", event->MultiplicityEstimateTracklets(), event->MultiplicityEstimateITSTPC(), event->MultiplicityEstimateITSPure(),
+        event->CentralityV0(), event->CentralityFMD(), event->CentralitySPD1(), event->CentralityTrk());
+
+  if (fUseMultEst1) { goodEvent &= ((event->MultiplicityEstimateTracklets() >= fEventMultEst1[0]) &&
+                                   (event->MultiplicityEstimateTracklets() <= fEventMultEst1[1])); }
+  if (fUseMultEst2) { goodEvent &= ((event->MultiplicityEstimateITSTPC() >= fEventMultEst2[0]) &&
+                                   (event->MultiplicityEstimateITSTPC() <= fEventMultEst2[1])); }
+  if (fUseMultEst3) { goodEvent &= ((event->MultiplicityEstimateITSPure() >= fEventMultEst3[0]) &&
+                                   (event->MultiplicityEstimateITSPure() <= fEventMultEst3[1])); }
+
+  if (fUseCentEst1) { goodEvent &= ((event->CentralityV0() > fEventCentEst1[0]) &&
+                                   (event->CentralityV0() < fEventCentEst1[1])); }
+  if (fUseCentEst2) { goodEvent &= ((event->CentralityFMD() > fEventCentEst2[0]) &&
+                                   (event->CentralityFMD() < fEventCentEst2[1])); }
+  if (fUseCentEst3) { goodEvent &= ((event->CentralitySPD1() > fEventCentEst3[0]) &&
+                                   (event->CentralitySPD1() < fEventCentEst3[1])); }
+  if (fUseCentEst4) { goodEvent &= ((event->CentralityTrk() > fEventCentEst4[0]) &&
+                                   (event->CentralityTrk() < fEventCentEst4[1])); }
+  double vertexZPos = event->PrimVertPos().z();
+  //   cout << "AliFemtoEventCutEstimators:: mult:       " << fEventMult[0] << " < " << mult << " < " << fEventMult[1] << endl;
+  //   cout << "AliFemtoEventCutEstimators:: VertexZPos: " << fVertZPos[0] << " < " << vertexZPos << " < " << fVertZPos[1] << endl;
+  //   cout << "AliFemtoEventCutEstimators:: VertexZErr: " << event->PrimVertCov()[4] << endl;
+  goodEvent &=
+    ((vertexZPos > fVertZPos[0]) &&
+     (vertexZPos < fVertZPos[1]));
+  goodEvent ? fNEventsPassed++ : fNEventsFailed++ ;
+  //   cout << "AliFemtoEventCutEstimators:: return : " << goodEvent << endl;
+  //     (fAcceptBadVertex || (event->PrimVertCov()[4] > -1000.0)) &&
+  return (goodEvent);
+}
+  //------------------------------
+AliFemtoString AliFemtoEventCutEstimators::Report(){
+  // Prepare report
+  string stemp;
+  char ctemp[100];
+  snprintf(ctemp , 100, "\nMultiplicity:\t %d-%d",fEventMultEst2[0],fEventMultEst2[1]);
+  stemp = ctemp;
+  snprintf(ctemp , 100, "\nVertex Z-position:\t %E-%E",fVertZPos[0],fVertZPos[1]);
+  stemp += ctemp;
+  snprintf(ctemp , 100, "\nNumber of events which passed:\t%ld  Number which failed:\t%ld",fNEventsPassed,fNEventsFailed);
+  stemp += ctemp;
+  AliFemtoString returnThis = stemp;
+  return returnThis;
+}
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventCutEstimators.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventCutEstimators.h
new file mode 100644 (file)
index 0000000..a868436
--- /dev/null
@@ -0,0 +1,102 @@
+////////////////////////////////////////////////////////////////////////////////
+//                                                                            //
+// AliFemtoEventCutEstimators - the basic cut for events.                          //
+// Only cuts on event multiplicity and z-vertex position                      //
+//                                                                            //
+////////////////////////////////////////////////////////////////////////////////
+
+#ifndef ALIFEMTOEVENTCUTESTIMATORS_H
+#define ALIFEMTOEVENTCUTESTIMATORS_H
+
+// do I need these lines ?
+//#ifndef StMaker_H
+//#include "StMaker.h"
+//#endif
+
+#include "AliFemtoEventCut.h"
+#include "AliFemtoEventReaderESDChain.h"
+
+class AliFemtoEventCutEstimators : public AliFemtoEventCut {
+
+public:
+
+  AliFemtoEventCutEstimators();
+  AliFemtoEventCutEstimators(AliFemtoEventCutEstimators& c);
+  virtual ~AliFemtoEventCutEstimators();
+  AliFemtoEventCutEstimators& operator=(AliFemtoEventCutEstimators& c);
+
+  void SetMultEst1Range(const unsigned short &lo, const unsigned short &hi);
+  void SetMultEst2Range(const unsigned short &lo, const unsigned short &hi);
+  void SetMultEst3Range(const unsigned short &lo, const unsigned short &hi);
+  
+  void SetCentEst1Range(const float &lo, const float &hi);
+  void SetCentEst2Range(const float &lo, const float &hi);
+  void SetCentEst3Range(const float &lo, const float &hi);
+  void SetCentEst4Range(const float &lo, const float &hi);
+
+  void SetVertZPos(const float& lo, const float& hi);
+  int NEventsPassed() const;
+  int NEventsFailed() const;
+
+  virtual AliFemtoString Report();
+  virtual bool Pass(const AliFemtoEvent* event);
+
+  AliFemtoEventCutEstimators* Clone();
+
+private:   // here are the quantities I want to cut on...
+
+  unsigned short fEventMultEst1[2];      // range of multiplicity
+  unsigned short fEventMultEst2[2];      // range of multiplicity
+  unsigned short fEventMultEst3[2];      // range of multiplicity
+  unsigned char fUseMultEst1;  // if 1 cut on Mult Est 1
+  unsigned char fUseMultEst2;  // if 1 cut on Mult Est 2
+  unsigned char fUseMultEst3;  // if 1 cut on Mult Est 3
+  
+  float fEventCentEst1[2];      // range of multiplicity
+  float fEventCentEst2[2];      // range of multiplicity
+  float fEventCentEst3[2];      // range of multiplicity
+  float fEventCentEst4[2];      // range of multiplicity
+  unsigned char fUseCentEst1;  // if 1 cut on Mult Est 1
+  unsigned char fUseCentEst2;  // if 1 cut on Mult Est 2
+  unsigned char fUseCentEst3;  // if 1 cut on Mult Est 3
+  unsigned char fUseCentEst4;  // if 1 cut on Mult Est 4
+
+  float fVertZPos[2];     // range of z-position of vertex
+  long fNEventsPassed;    // Number of events checked by this cut that passed
+  long fNEventsFailed;    // Number of events checked by this cut that failed
+
+#ifdef __ROOT__
+  ClassDef(AliFemtoEventCutEstimators, 1)
+#endif
+
+};
+
+inline void AliFemtoEventCutEstimators::SetMultEst1Range(const unsigned short& lo, const unsigned short& hi){fEventMultEst1[0]=lo; fEventMultEst1[1]=hi; fUseMultEst1=1;}
+inline void AliFemtoEventCutEstimators::SetMultEst2Range(const unsigned short& lo, const unsigned short& hi){fEventMultEst2[0]=lo; fEventMultEst2[1]=hi; fUseMultEst2=1;}
+inline void AliFemtoEventCutEstimators::SetMultEst3Range(const unsigned short& lo, const unsigned short& hi){fEventMultEst3[0]=lo; fEventMultEst3[1]=hi; fUseMultEst3=1;}
+inline void AliFemtoEventCutEstimators::SetCentEst1Range(const float& lo, const float& hi){fEventCentEst1[0]=lo; fEventCentEst1[1]=hi; fUseCentEst1=1;}
+inline void AliFemtoEventCutEstimators::SetCentEst2Range(const float& lo, const float& hi){fEventCentEst2[0]=lo; fEventCentEst2[1]=hi; fUseCentEst2=1;}
+inline void AliFemtoEventCutEstimators::SetCentEst3Range(const float& lo, const float& hi){fEventCentEst3[0]=lo; fEventCentEst3[1]=hi; fUseCentEst3=1;}
+inline void AliFemtoEventCutEstimators::SetCentEst4Range(const float& lo, const float& hi){fEventCentEst4[0]=lo; fEventCentEst4[1]=hi; fUseCentEst4=1;}
+inline void AliFemtoEventCutEstimators::SetVertZPos(const float& lo, const float& hi){fVertZPos[0]=lo; fVertZPos[1]=hi;}
+inline int  AliFemtoEventCutEstimators::NEventsPassed() const {return fNEventsPassed;}
+inline int  AliFemtoEventCutEstimators::NEventsFailed() const {return fNEventsFailed;}
+inline AliFemtoEventCutEstimators* AliFemtoEventCutEstimators::Clone() { AliFemtoEventCutEstimators* c = new AliFemtoEventCutEstimators(*this); return c;}
+inline AliFemtoEventCutEstimators::AliFemtoEventCutEstimators(AliFemtoEventCutEstimators& c) : 
+  AliFemtoEventCut(c), 
+  fUseMultEst1(0), fUseMultEst2(0), fUseMultEst3(0), 
+  fUseCentEst1(0), fUseCentEst2(0), fUseCentEst3(0), fUseCentEst4(0),
+  fNEventsPassed(0), fNEventsFailed(0) {
+  fEventMultEst1[0] = c.fEventMultEst1[0];  fEventMultEst1[1] = c.fEventMultEst1[1];
+  fEventMultEst2[0] = c.fEventMultEst2[0];  fEventMultEst2[1] = c.fEventMultEst2[1];
+  fEventMultEst3[0] = c.fEventMultEst3[0];  fEventMultEst3[1] = c.fEventMultEst3[1];
+  fEventCentEst1[0] = c.fEventCentEst1[0];  fEventCentEst1[1] = c.fEventCentEst1[1];
+  fEventCentEst2[0] = c.fEventCentEst2[0];  fEventCentEst2[1] = c.fEventCentEst2[1];
+  fEventCentEst3[0] = c.fEventCentEst3[0];  fEventCentEst3[1] = c.fEventCentEst3[1];
+  fEventCentEst4[0] = c.fEventCentEst4[0];  fEventCentEst4[1] = c.fEventCentEst4[1];
+  fVertZPos[0] = c.fVertZPos[0];
+  fVertZPos[1] = c.fVertZPos[1];
+}
+
+
+#endif
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReader.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReader.cxx
new file mode 100644 (file)
index 0000000..8caa5ab
--- /dev/null
@@ -0,0 +1,124 @@
+////////////////////////////////////////////////////////////////////////////////
+///                                                                          ///
+/// AliFemtoEventReader - the pure virtual base class for the event reader   ///
+/// All event readers must inherit from this one                             ///
+///                                                                          ///
+////////////////////////////////////////////////////////////////////////////////
+#include "AliFemtoEvent.h"
+#include "AliFemtoEventCut.h"
+#include "AliFemtoTrackCut.h"
+#include "AliFemtoV0Cut.h"
+#include "AliFemtoXiCut.h"
+#include "AliFemtoKinkCut.h"
+#include "AliFemtoEventReader.h"
+
+#ifdef __ROOT__
+ClassImp(AliFemtoEventReader)
+#endif
+
+AliFemtoEventReader::AliFemtoEventReader(const AliFemtoEventReader& aReader):
+  fEventCut(0),  
+  fTrackCut(0),    
+  fV0Cut(0),       
+  fXiCut(0),       
+  fKinkCut(0),    
+  fReaderStatus(0),  
+  fDebug(0)
+{
+  // Copy constructor
+  fEventCut = aReader.fEventCut;
+  fTrackCut = aReader.fTrackCut;
+  fV0Cut    = aReader.fV0Cut;
+  fXiCut    = aReader.fXiCut;
+  fKinkCut  = aReader.fKinkCut;
+  fReaderStatus = aReader.fReaderStatus;
+  fDebug = aReader.fDebug;
+}
+
+AliFemtoEventReader& AliFemtoEventReader::operator=(const AliFemtoEventReader& aReader)
+{
+  // Assignment operator
+  if (this == &aReader) 
+    return *this;
+
+  fEventCut = aReader.fEventCut;
+  fTrackCut = aReader.fTrackCut;
+  fV0Cut    = aReader.fV0Cut;
+  fXiCut    = aReader.fXiCut;
+  fKinkCut  = aReader.fKinkCut;
+  fReaderStatus = aReader.fReaderStatus;
+  fDebug = aReader.fDebug;
+
+  return *this;
+}
+
+
+AliFemtoString AliFemtoEventReader::Report(){
+  // Create a simple report from the workings of the reader
+  AliFemtoString temp = "\n This is the base class AliFemtoEventReader reporting";
+  temp += "\n---> EventCuts in Reader: ";
+  if (fEventCut) {
+    temp += fEventCut->Report();
+  }
+  else {
+    temp += "NONE";
+  }
+  temp += "\n---> TrackCuts in Reader: ";
+  if (fTrackCut) {
+    temp += fTrackCut->Report();
+  }
+  else {
+    temp += "NONE";
+  }
+  temp += "\n---> V0Cuts in Reader: ";
+  if (fV0Cut) {
+    temp += fV0Cut->Report();
+  }
+  else {
+    temp += "NONE";
+  }
+  temp += "\n---> XiCuts in Reader: ";
+  if (fXiCut) {
+    temp += fXiCut->Report();
+  }
+  else {
+    temp += "NONE";
+  }
+  temp += "\n---> KinkCuts in Reader: ";
+  if (fKinkCut) {
+    temp += fKinkCut->Report();
+  }
+  else {
+    temp += "NONE";
+  }
+  temp += "\n";
+  return temp;
+}
+//______________________________________
+void AliFemtoEventReader::SetEventCut(AliFemtoEventCut* ecut){fEventCut=ecut;}
+//______________________________________
+void AliFemtoEventReader::SetTrackCut(AliFemtoTrackCut* pcut){cout << pcut << endl; fTrackCut=pcut;}
+//______________________________________
+void AliFemtoEventReader::SetV0Cut(AliFemtoV0Cut* pcut){fV0Cut=pcut;}
+//______________________________________
+void AliFemtoEventReader::SetXiCut(AliFemtoXiCut* pcut){fXiCut=pcut;}
+//______________________________________
+void AliFemtoEventReader::SetKinkCut(AliFemtoKinkCut* pcut){fKinkCut=pcut;}
+//______________________________________
+AliFemtoEventCut* AliFemtoEventReader::EventCut(){return fEventCut;}
+//______________________________________
+AliFemtoTrackCut* AliFemtoEventReader::TrackCut(){return fTrackCut;}
+//______________________________________
+AliFemtoV0Cut*    AliFemtoEventReader::V0Cut(){return fV0Cut;} 
+//______________________________________
+AliFemtoXiCut*    AliFemtoEventReader::XiCut(){return fXiCut;} 
+//______________________________________
+AliFemtoKinkCut*    AliFemtoEventReader::KinkCut(){return fKinkCut;}
+//______________________________________
+int AliFemtoEventReader::Init(const char* /* ReadWrite */, AliFemtoString& /* Message */)
+{
+  cout << "do-nothing AliFemtoEventReader::Init()\n"; 
+  return(0);
+}
+
+
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReader.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReader.h
new file mode 100644 (file)
index 0000000..d90b90a
--- /dev/null
@@ -0,0 +1,82 @@
+////////////////////////////////////////////////////////////////////////////////
+/// AliFemtoEventReader - the pure virtual base class for the event reader   ///
+/// All event readers must inherit from this one                             ///
+////////////////////////////////////////////////////////////////////////////////
+#ifndef ALIFEMTOEVENTREADER_H
+#define ALIFEMTOEVENTREADER_H
+
+class AliFemtoEvent;
+class AliFemtoEventCut;
+class AliFemtoTrackCut;
+class AliFemtoV0Cut;
+class AliFemtoXiCut;
+class AliFemtoKinkCut;
+
+#include "AliFemtoString.h"
+#include <iostream>
+#include <fstream>
+#include <stdio.h>
+
+using namespace std;
+
+class AliFemtoEventReader {
+  
+ public:
+  // even tho it's only a base class and never constructed, if you don't have an implementation,
+  // you get "AliFemtoEventReader type_info node" upon dynamical loading
+  AliFemtoEventReader() : fEventCut(0), fTrackCut(0), fV0Cut(0), fXiCut(0), fKinkCut(0), fReaderStatus(0), fDebug(1) { /* no-op */ };
+  AliFemtoEventReader(const AliFemtoEventReader& aReader);
+  virtual ~AliFemtoEventReader(){/* no-op */}
+  
+  AliFemtoEventReader& operator=(const AliFemtoEventReader& aReader);
+  
+  virtual AliFemtoEvent* ReturnHbtEvent() =0;
+
+  virtual AliFemtoString Report();    // user-written method to return string describing reader
+                                      // Including whatever "early" cuts are being done
+
+  // this next method does NOT need to be implemented, in which case the 
+  // "default" method below is executed
+  virtual int WriteHbtEvent(AliFemtoEvent*){cout << "No WriteHbtEvent implemented\n"; return (0);}
+
+  // these next two are optional but would make sense for, e.g., opening and closing a file
+  virtual int Init(const char* ReadWrite, AliFemtoString& Message);
+  virtual void Finish(){/*no-op*/};
+  
+  int Status() const {return fReaderStatus;} // AliFemtoManager looks at this for guidance if it gets null pointer from ReturnHbtEvent
+
+  virtual void SetEventCut(AliFemtoEventCut* ecut);
+  virtual void SetTrackCut(AliFemtoTrackCut* pcut);
+  virtual void SetV0Cut(AliFemtoV0Cut* pcut);
+  virtual void SetXiCut(AliFemtoXiCut* pcut);
+  virtual void SetKinkCut(AliFemtoKinkCut* pcut);
+  virtual AliFemtoEventCut* EventCut();
+  virtual AliFemtoTrackCut* TrackCut();
+  virtual AliFemtoV0Cut*    V0Cut();
+  virtual AliFemtoXiCut*    XiCut();
+  virtual AliFemtoKinkCut*    KinkCut();
+
+  /* control of debug informations print out, my rule is: */
+  /* 0: no output at all                                  */
+  /* 1: once (e.g. in constructor, finsh                  */
+  /* 2: once per event                                    */
+  /* 3: once per track                                    */
+  /* 4: once per pair                                     */
+  int Debug() const {return fDebug;} 
+  void SetDebug(int d){fDebug=d;}
+
+protected:
+  AliFemtoEventCut* fEventCut;     //! link to the front-loaded event cut
+  AliFemtoTrackCut* fTrackCut;     //! link to the front-loaded track cut
+  AliFemtoV0Cut* fV0Cut;           //! link to the front-loaded V0 cut
+  AliFemtoXiCut* fXiCut;           //! link to the front-loaded Xi cut
+  AliFemtoKinkCut* fKinkCut;       //! link to the front-loaded Kink cut
+  int fReaderStatus;               // 0="good"
+  int fDebug;                      // Debug information level
+#ifdef __ROOT__
+  ClassDef(AliFemtoEventReader,0)
+#endif
+};
+
+#endif
+
diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderAOD.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderAOD.cxx
new file mode 100644 (file)
index 0000000..0b0e4f5
--- /dev/null
@@ -0,0 +1,866 @@
+////////////////////////////////////////////////////////////////////////////////
+//                                                                            //
+// AliFemtoEventReaderAOD - the reader class for the Alice AOD                //
+// Reads in AOD information and converts it into internal AliFemtoEvent       //
+// Authors: Marek Chojnacki mchojnacki@knf.pw.edu.pl                          //
+//          Adam Kisiel kisiel@mps.ohio-state.edu                             //
+//                                                                            //
+////////////////////////////////////////////////////////////////////////////////
+
+#include "AliFemtoEventReaderAOD.h"
+
+#include "TFile.h"
+#include "TTree.h"
+#include "AliAODEvent.h"
+#include "AliAODTrack.h"
+#include "AliAODVertex.h"
+#include "AliAODMCHeader.h"
+#include "AliESDtrack.h"
+
+#include "AliFmPhysicalHelixD.h"
+#include "AliFmThreeVectorF.h"
+
+#include "SystemOfUnits.h"
+
+#include "AliFemtoEvent.h"
+#include "AliFemtoModelHiddenInfo.h"
+#include "AliFemtoModelGlobalHiddenInfo.h"
+#include "AliPID.h"
+
+#include "AliAODpidUtil.h"
+
+ClassImp(AliFemtoEventReaderAOD)
+
+#if !(ST_NO_NAMESPACES)
+  using namespace units;
+#endif
+
+using namespace std;
+//____________________________
+//constructor with 0 parameters , look at default settings 
+AliFemtoEventReaderAOD::AliFemtoEventReaderAOD():
+  fNumberofEvent(0),
+  fCurEvent(0),
+  fEvent(0x0),
+  fAllTrue(160),
+  fAllFalse(160),
+  fFilterBit(0),
+  //  fPWG2AODTracks(0x0),
+  fReadMC(0),
+  fUsePreCent(0),
+  fAODpidUtil(0),
+  fInputFile(" "),
+  fFileName(" "),
+  fTree(0x0),
+  fAodFile(0x0)
+{
+  // default constructor
+  fAllTrue.ResetAllBits(kTRUE);
+  fAllFalse.ResetAllBits(kFALSE);
+  fCentRange[0] = 0;
+  fCentRange[1] = 1000;
+}
+
+AliFemtoEventReaderAOD::AliFemtoEventReaderAOD(const AliFemtoEventReaderAOD &aReader) :
+  AliFemtoEventReader(),
+  fNumberofEvent(0),
+  fCurEvent(0),
+  fEvent(0x0),
+  fAllTrue(160),
+  fAllFalse(160),
+  fFilterBit(0),
+  //  fPWG2AODTracks(0x0),
+  fReadMC(0),
+  fUsePreCent(0),
+  fAODpidUtil(0),
+  fInputFile(" "),
+  fFileName(" "),
+  fTree(0x0),
+  fAodFile(0x0)
+{
+  // copy constructor
+  fInputFile = aReader.fInputFile;
+  fFileName  = aReader.fFileName;
+  fNumberofEvent = aReader.fNumberofEvent;
+  fCurEvent = aReader.fCurEvent;
+  fEvent = new AliAODEvent();
+  fAodFile = new TFile(aReader.fAodFile->GetName());
+  fAllTrue.ResetAllBits(kTRUE);
+  fAllFalse.ResetAllBits(kFALSE);
+  fFilterBit = aReader.fFilterBit;
+  //  fPWG2AODTracks = aReader.fPWG2AODTracks;
+  fAODpidUtil = aReader.fAODpidUtil;
+  fCentRange[0] = aReader.fCentRange[0];
+  fCentRange[1] = aReader.fCentRange[1];
+}
+//__________________
+//Destructor
+AliFemtoEventReaderAOD::~AliFemtoEventReaderAOD()
+{
+  // destructor
+  delete fTree;
+  delete fEvent;
+  delete fAodFile;
+//   if (fPWG2AODTracks) {
+//     fPWG2AODTracks->Delete();
+//     delete fPWG2AODTracks;
+//   }
+}
+
+//__________________
+AliFemtoEventReaderAOD& AliFemtoEventReaderAOD::operator=(const AliFemtoEventReaderAOD& aReader)
+{
+  // assignment operator
+  if (this == &aReader)
+    return *this;
+
+  fInputFile = aReader.fInputFile;
+  fFileName  = aReader.fFileName;
+  fNumberofEvent = aReader.fNumberofEvent;
+  fCurEvent = aReader.fCurEvent;
+  if (fTree) delete fTree;
+  if (fEvent) delete fEvent;
+  fEvent = new AliAODEvent();
+  if (fAodFile) delete fAodFile;
+  fAodFile = new TFile(aReader.fAodFile->GetName());
+  fAllTrue.ResetAllBits(kTRUE);
+  fAllFalse.ResetAllBits(kFALSE);
+  fFilterBit = aReader.fFilterBit;
+  //  fPWG2AODTracks = aReader.fPWG2AODTracks;
+  fAODpidUtil = aReader.fAODpidUtil;
+  fCentRange[0] = aReader.fCentRange[0];
+  fCentRange[1] = aReader.fCentRange[1];
+
+  return *this;
+}
+//__________________
+AliFemtoString AliFemtoEventReaderAOD::Report()
+{
+  // create reader report
+  AliFemtoString temp = "\n This is the AliFemtoEventReaderAOD\n";
+  return temp;
+}
+
+//__________________
+void AliFemtoEventReaderAOD::SetInputFile(const char* inputFile)