From 76ce4b5bf0c39239721712c4cc2f23151ba6e9f4 Mon Sep 17 00:00:00 2001 From: akisiel Date: Mon, 30 Jan 2012 16:35:12 +0000 Subject: [PATCH] Migration of PWG2/FEMTOSCOPY to PWGCF/FEMTOSCOPY --- PWGCF/CMakelibPWGCFFEMTOSCOPYAOD.pkg | 48 + PWGCF/CMakelibPWGCFfemtoscopy.pkg | 152 ++ PWGCF/CMakelibPWGCFfemtoscopyUser.pkg | 41 + .../AliFemto/AliAnalysisTaskFemto.cxx | 516 ++++++ .../AliFemto/AliAnalysisTaskFemto.h | 78 + .../AliFemto/AliFemtoAODTrackCut.cxx | 374 ++++ .../FEMTOSCOPY/AliFemto/AliFemtoAODTrackCut.h | 94 + PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysis.h | 32 + .../AliFemto/AliFemtoAnalysisAzimuthal.cxx | 469 +++++ .../AliFemto/AliFemtoAnalysisAzimuthal.h | 67 + .../AliFemto/AliFemtoAnalysisCollection.h | 54 + .../AliFemtoAnalysisReactionPlane.cxx | 255 +++ .../AliFemto/AliFemtoAnalysisReactionPlane.h | 47 + .../AliFemto/AliFemtoBPLCMS3DCorrFctn.cxx | 461 +++++ .../AliFemto/AliFemtoBPLCMS3DCorrFctn.h | 121 ++ .../AliFemto/AliFemtoBasicEventCut.cxx | 87 + .../AliFemto/AliFemtoBasicEventCut.h | 84 + .../AliFemto/AliFemtoBasicTrackCut.cxx | 178 ++ .../AliFemto/AliFemtoBasicTrackCut.h | 71 + .../FEMTOSCOPY/AliFemto/AliFemtoCorrFctn.cxx | 21 + PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn.h | 51 + .../AliFemto/AliFemtoCorrFctn3DLCMSSym.cxx | 153 ++ .../AliFemto/AliFemtoCorrFctn3DLCMSSym.h | 49 + .../AliFemto/AliFemtoCorrFctn3DSpherical.cxx | 159 ++ .../AliFemto/AliFemtoCorrFctn3DSpherical.h | 52 + .../AliFemto/AliFemtoCorrFctnCollection.h | 48 + .../AliFemto/AliFemtoCorrFctnNonIdDR.cxx | 272 +++ .../AliFemto/AliFemtoCorrFctnNonIdDR.h | 54 + PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCoulomb.cxx | 472 +++++ PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCoulomb.h | 65 + .../AliFemto/AliFemtoCutMonitor.cxx | 63 + .../FEMTOSCOPY/AliFemto/AliFemtoCutMonitor.h | 49 + .../AliFemto/AliFemtoCutMonitorCollection.h | 20 + .../AliFemto/AliFemtoCutMonitorEventMult.cxx | 336 ++++ .../AliFemto/AliFemtoCutMonitorEventMult.h | 70 + .../AliFemtoCutMonitorEventVertex.cxx | 141 ++ .../AliFemto/AliFemtoCutMonitorEventVertex.h | 54 + .../AliFemto/AliFemtoCutMonitorHandler.cxx | 318 ++++ .../AliFemto/AliFemtoCutMonitorHandler.h | 64 + .../AliFemtoCutMonitorParticlePID.cxx | 128 ++ .../AliFemto/AliFemtoCutMonitorParticlePID.h | 56 + .../AliFemtoCutMonitorParticleVertPos.cxx | 178 ++ .../AliFemtoCutMonitorParticleVertPos.h | 58 + .../AliFemtoCutMonitorParticleYPt.cxx | 206 +++ .../AliFemto/AliFemtoCutMonitorParticleYPt.h | 60 + .../AliFemto/AliFemtoDummyPairCut.cxx | 100 ++ .../AliFemto/AliFemtoDummyPairCut.h | 113 ++ .../FEMTOSCOPY/AliFemto/AliFemtoEnumeration.h | 45 + PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEvent.cxx | 551 ++++++ PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEvent.h | 157 ++ PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventCut.h | 46 + .../AliFemto/AliFemtoEventCutEstimators.cxx | 119 ++ .../AliFemto/AliFemtoEventCutEstimators.h | 102 ++ .../AliFemto/AliFemtoEventReader.cxx | 124 ++ .../FEMTOSCOPY/AliFemto/AliFemtoEventReader.h | 82 + .../AliFemto/AliFemtoEventReaderAOD.cxx | 866 +++++++++ .../AliFemto/AliFemtoEventReaderAOD.h | 85 + .../AliFemto/AliFemtoEventReaderAODChain.cxx | 108 ++ .../AliFemto/AliFemtoEventReaderAODChain.h | 51 + .../AliFemto/AliFemtoEventReaderESD.cxx | 408 +++++ .../AliFemto/AliFemtoEventReaderESD.h | 86 + .../AliFemto/AliFemtoEventReaderESDChain.cxx | 828 +++++++++ .../AliFemto/AliFemtoEventReaderESDChain.h | 99 ++ .../AliFemtoEventReaderESDChainKine.cxx | 890 ++++++++++ .../AliFemtoEventReaderESDChainKine.h | 94 + .../AliFemtoEventReaderKinematicsChain.cxx | 347 ++++ .../AliFemtoEventReaderKinematicsChain.h | 69 + .../AliFemto/AliFemtoEventReaderStandard.cxx | 880 +++++++++ .../AliFemto/AliFemtoEventReaderStandard.h | 85 + .../FEMTOSCOPY/AliFemto/AliFemtoEventWriter.h | 12 + .../AliFemto/AliFemtoEventWriterCollection.h | 34 + PWGCF/FEMTOSCOPY/AliFemto/AliFemtoFsiTools.F | 363 ++++ .../AliFemto/AliFemtoFsiWeightLednicky.F | 1577 +++++++++++++++++ PWGCF/FEMTOSCOPY/AliFemto/AliFemtoHelix.h | 40 + .../FEMTOSCOPY/AliFemto/AliFemtoHiddenInfo.h | 32 + .../FEMTOSCOPY/AliFemto/AliFemtoKTPairCut.cxx | 211 +++ PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKTPairCut.h | 64 + PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKink.cxx | 170 ++ PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKink.h | 145 ++ .../AliFemto/AliFemtoKinkCollection.h | 46 + PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKinkCut.h | 35 + .../AliFemto/AliFemtoLikeSignAnalysis.cxx | 298 ++++ .../AliFemto/AliFemtoLikeSignAnalysis.h | 53 + .../AliFemto/AliFemtoLikeSignCorrFctn.h | 35 + .../AliFemto/AliFemtoLorentzVector.h | 743 ++++++++ .../AliFemto/AliFemtoLorentzVectorD.h | 22 + .../AliFemto/AliFemtoMCTrackCut.cxx | 186 ++ .../FEMTOSCOPY/AliFemto/AliFemtoMCTrackCut.h | 68 + PWGCF/FEMTOSCOPY/AliFemto/AliFemtoManager.cxx | 254 +++ PWGCF/FEMTOSCOPY/AliFemto/AliFemtoManager.h | 71 + .../AliFemto/AliFemtoModelCorrFctn.cxx | 174 ++ .../AliFemto/AliFemtoModelCorrFctn.h | 55 + .../AliFemtoModelFreezeOutGenerator.cxx | 44 + .../AliFemtoModelFreezeOutGenerator.h | 40 + ...liFemtoModelGausLCMSFreezeOutGenerator.cxx | 145 ++ .../AliFemtoModelGausLCMSFreezeOutGenerator.h | 50 + .../AliFemtoModelGlobalHiddenInfo.cxx | 96 + .../AliFemto/AliFemtoModelGlobalHiddenInfo.h | 48 + .../AliFemto/AliFemtoModelHiddenInfo.cxx | 177 ++ .../AliFemto/AliFemtoModelHiddenInfo.h | 58 + .../AliFemto/AliFemtoModelManager.cxx | 190 ++ .../AliFemto/AliFemtoModelManager.h | 48 + .../AliFemto/AliFemtoModelWeightGenerator.cxx | 129 ++ .../AliFemto/AliFemtoModelWeightGenerator.h | 112 ++ .../AliFemtoModelWeightGeneratorBasic.cxx | 200 +++ .../AliFemtoModelWeightGeneratorBasic.h | 42 + .../AliFemtoModelWeightGeneratorLednicky.cxx | 672 +++++++ .../AliFemtoModelWeightGeneratorLednicky.h | 110 ++ PWGCF/FEMTOSCOPY/AliFemto/AliFemtoPair.cxx | 1212 +++++++++++++ PWGCF/FEMTOSCOPY/AliFemto/AliFemtoPair.h | 414 +++++ PWGCF/FEMTOSCOPY/AliFemto/AliFemtoPairCut.h | 61 + .../FEMTOSCOPY/AliFemto/AliFemtoParticle.cxx | 772 ++++++++ PWGCF/FEMTOSCOPY/AliFemto/AliFemtoParticle.h | 161 ++ .../AliFemto/AliFemtoParticleCollection.h | 46 + .../FEMTOSCOPY/AliFemto/AliFemtoParticleCut.h | 69 + .../FEMTOSCOPY/AliFemto/AliFemtoPicoEvent.cxx | 198 +++ PWGCF/FEMTOSCOPY/AliFemto/AliFemtoPicoEvent.h | 71 + .../AliFemto/AliFemtoPicoEventCollection.h | 47 + .../AliFemtoPicoEventCollectionVector.h | 44 + ...FemtoPicoEventCollectionVectorHideAway.cxx | 128 ++ ...liFemtoPicoEventCollectionVectorHideAway.h | 48 + .../AliFemto/AliFemtoQinvCorrFctn.cxx | 165 ++ .../AliFemto/AliFemtoQinvCorrFctn.h | 90 + .../AliFemto/AliFemtoSimpleAnalysis.cxx | 617 +++++++ .../AliFemto/AliFemtoSimpleAnalysis.h | 130 ++ PWGCF/FEMTOSCOPY/AliFemto/AliFemtoString.h | 26 + .../FEMTOSCOPY/AliFemto/AliFemtoThreeVector.h | 863 +++++++++ .../AliFemto/AliFemtoThreeVectorD.h | 20 + PWGCF/FEMTOSCOPY/AliFemto/AliFemtoTrack.cxx | 398 +++++ PWGCF/FEMTOSCOPY/AliFemto/AliFemtoTrack.h | 229 +++ .../AliFemto/AliFemtoTrackCollection.h | 47 + PWGCF/FEMTOSCOPY/AliFemto/AliFemtoTrackCut.h | 37 + PWGCF/FEMTOSCOPY/AliFemto/AliFemtoTypes.h | 45 + PWGCF/FEMTOSCOPY/AliFemto/AliFemtoV0.cxx | 290 +++ PWGCF/FEMTOSCOPY/AliFemto/AliFemtoV0.h | 397 +++++ .../AliFemto/AliFemtoV0Collection.h | 33 + PWGCF/FEMTOSCOPY/AliFemto/AliFemtoV0Cut.h | 35 + PWGCF/FEMTOSCOPY/AliFemto/AliFemtoVector.h | 39 + .../AliFemto/AliFemtoVertexAnalysis.cxx | 264 +++ .../AliFemto/AliFemtoVertexAnalysis.h | 43 + .../AliFemto/AliFemtoVertexMultAnalysis.cxx | 294 +++ .../AliFemto/AliFemtoVertexMultAnalysis.h | 44 + PWGCF/FEMTOSCOPY/AliFemto/AliFemtoXi.cxx | 100 ++ PWGCF/FEMTOSCOPY/AliFemto/AliFemtoXi.h | 280 +++ .../AliFemto/AliFemtoXiCollection.h | 33 + PWGCF/FEMTOSCOPY/AliFemto/AliFemtoXiCut.h | 35 + PWGCF/FEMTOSCOPY/AliFemto/AliFmHelix.cxx | 650 +++++++ PWGCF/FEMTOSCOPY/AliFemto/AliFmHelix.h | 190 ++ PWGCF/FEMTOSCOPY/AliFemto/AliFmHelixD.h | 23 + .../FEMTOSCOPY/AliFemto/AliFmLorentzVector.h | 741 ++++++++ .../FEMTOSCOPY/AliFemto/AliFmLorentzVectorD.h | 22 + .../AliFemto/AliFmPhysicalHelix.cxx | 136 ++ .../FEMTOSCOPY/AliFemto/AliFmPhysicalHelix.h | 45 + .../FEMTOSCOPY/AliFemto/AliFmPhysicalHelixD.h | 22 + PWGCF/FEMTOSCOPY/AliFemto/AliFmThreeVector.h | 858 +++++++++ PWGCF/FEMTOSCOPY/AliFemto/AliFmThreeVectorD.h | 20 + PWGCF/FEMTOSCOPY/AliFemto/AliFmThreeVectorF.h | 30 + PWGCF/FEMTOSCOPY/AliFemto/AliTwoTrackRes.cxx | 359 ++++ PWGCF/FEMTOSCOPY/AliFemto/AliTwoTrackRes.h | 96 + PWGCF/FEMTOSCOPY/AliFemto/PhysicalConstants.h | 146 ++ PWGCF/FEMTOSCOPY/AliFemto/SystemOfUnits.h | 313 ++++ .../FEMTOSCOPY/AliFemto/TpcLocalTransform.cxx | 89 + PWGCF/FEMTOSCOPY/AliFemto/TpcLocalTransform.h | 0 PWGCF/FEMTOSCOPY/AliFemto/phys_constants.h | 21 + .../AliFemtoBPLCMS3DCorrFctnEMCIC.cxx | 431 +++++ .../AliFemtoBPLCMS3DCorrFctnEMCIC.h | 89 + .../AliFemtoUser/AliFemtoChi2CorrFctn.cxx | 381 ++++ .../AliFemtoUser/AliFemtoChi2CorrFctn.h | 57 + .../AliFemtoCorrFctn3DSphericalEMCIC.cxx | 365 ++++ .../AliFemtoCorrFctn3DSphericalEMCIC.h | 60 + .../AliFemtoUser/AliFemtoCorrFctnDEtaDPhi.cxx | 389 ++++ .../AliFemtoUser/AliFemtoCorrFctnDEtaDPhi.h | 61 + .../AliFemtoCorrFctnDirectYlm.cxx | 1001 +++++++++++ .../AliFemtoUser/AliFemtoCorrFctnDirectYlm.h | 115 ++ .../AliFemtoCorrFctnGammaMonitor.cxx | 208 +++ .../AliFemtoCorrFctnGammaMonitor.h | 49 + .../AliFemtoUser/AliFemtoCorrFctnTPCNcls.cxx | 138 ++ .../AliFemtoUser/AliFemtoCorrFctnTPCNcls.h | 45 + .../AliFemtoCutMonitorParticleEtCorr.cxx | 175 ++ .../AliFemtoCutMonitorParticleEtCorr.h | 61 + .../AliFemtoCutMonitorParticleMomRes.cxx | 179 ++ .../AliFemtoCutMonitorParticleMomRes.h | 56 + .../AliFemtoCutMonitorParticlePtPDG.cxx | 296 ++++ .../AliFemtoCutMonitorParticlePtPDG.h | 74 + .../AliFemtoCutMonitorTrackTPCchiNdof.cxx | 104 ++ .../AliFemtoCutMonitorTrackTPCchiNdof.h | 50 + .../AliFemtoCutMonitorTrackTPCncls.cxx | 102 ++ .../AliFemtoCutMonitorTrackTPCncls.h | 50 + .../AliFemtoUser/AliFemtoESDTrackCut.cxx | 923 ++++++++++ .../AliFemtoUser/AliFemtoESDTrackCut.h | 160 ++ .../AliFemtoEventReaderESDKine.cxx | 602 +++++++ .../AliFemtoUser/AliFemtoEventReaderESDKine.h | 88 + .../AliFemtoModelAllHiddenInfo.cxx | 319 ++++ .../AliFemtoUser/AliFemtoModelAllHiddenInfo.h | 83 + .../AliFemtoModelBPLCMSCorrFctn.cxx | 246 +++ .../AliFemtoModelBPLCMSCorrFctn.h | 63 + .../AliFemtoModelCorrFctn3DLCMSSpherical.cxx | 179 ++ .../AliFemtoModelCorrFctn3DLCMSSpherical.h | 53 + .../AliFemtoModelCorrFctn3DSpherical.cxx | 180 ++ .../AliFemtoModelCorrFctn3DSpherical.h | 53 + .../AliFemtoModelCorrFctnDEtaDPhi.cxx | 496 ++++++ .../AliFemtoModelCorrFctnDEtaDPhi.h | 67 + .../AliFemtoModelCorrFctnDirectYlm.cxx | 209 +++ .../AliFemtoModelCorrFctnDirectYlm.h | 56 + .../AliFemtoModelCorrFctnNonIdDR.cxx | 382 ++++ .../AliFemtoModelCorrFctnNonIdDR.h | 64 + .../AliFemtoModelCorrFctnSource.cxx | 285 +++ .../AliFemtoModelCorrFctnSource.h | 58 + .../AliFemtoModelCorrFctnTrueQ.cxx | 138 ++ .../AliFemtoUser/AliFemtoModelCorrFctnTrueQ.h | 49 + ...liFemtoModelGausRinvFreezeOutGenerator.cxx | 179 ++ .../AliFemtoModelGausRinvFreezeOutGenerator.h | 52 + .../AliFemtoUser/AliFemtoPairCutAntiGamma.cxx | 165 ++ .../AliFemtoUser/AliFemtoPairCutAntiGamma.h | 61 + .../AliFemtoUser/AliFemtoPairCutPt.cxx | 123 ++ .../AliFemtoUser/AliFemtoPairCutPt.h | 44 + .../AliFemtoPairCutRadialDistance.cxx | 151 ++ .../AliFemtoPairCutRadialDistance.h | 62 + .../AliFemtoUser/AliFemtoQAEventCut.cxx | 132 ++ .../AliFemtoUser/AliFemtoQAEventCut.h | 89 + .../AliFemtoUser/AliFemtoQATrackCut.cxx | 494 ++++++ .../AliFemtoUser/AliFemtoQATrackCut.h | 133 ++ .../AliFemtoUser/AliFemtoQPairCut.cxx | 136 ++ .../AliFemtoUser/AliFemtoQPairCut.h | 88 + .../AliFemtoQinvCorrFctnEMCIC.cxx | 241 +++ .../AliFemtoUser/AliFemtoQinvCorrFctnEMCIC.h | 78 + .../AliFemtoShareQualityCorrFctn.cxx | 382 ++++ .../AliFemtoShareQualityCorrFctn.h | 50 + .../AliFemtoShareQualityKTPairCut.cxx | 112 ++ .../AliFemtoShareQualityKTPairCut.h | 52 + .../AliFemtoShareQualityPairCut.cxx | 172 ++ .../AliFemtoShareQualityPairCut.h | 76 + .../AliFemtoShareQualityQAPairCut.cxx | 230 +++ .../AliFemtoShareQualityQAPairCut.h | 100 ++ ...FemtoShareQualityTPCEntranceSepPairCut.cxx | 108 ++ ...liFemtoShareQualityTPCEntranceSepPairCut.h | 59 + ...mtoShareQualityTPCEntranceSepQAPairCut.cxx | 147 ++ ...FemtoShareQualityTPCEntranceSepQAPairCut.h | 66 + .../AliFemtoUser/AliFemtoTPCInnerCorrFctn.cxx | 235 +++ .../AliFemtoUser/AliFemtoTPCInnerCorrFctn.h | 49 + PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoYlm.cxx | 269 +++ PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoYlm.h | 49 + PWGCF/FEMTOSCOPY/Documentation/AliFemto.pdf | Bin 0 -> 343915 bytes PWGCF/FEMTOSCOPY/Documentation/AliFemto.tex | 811 +++++++++ .../Documentation/AliFemtoTitle.pdf | Bin 0 -> 8408 bytes PWGCF/FEMTOSCOPY/Documentation/Analysis.pdf | Bin 0 -> 25841 bytes .../Documentation/ExampleMacro1.pdf | Bin 0 -> 32096 bytes .../Documentation/ExampleMacro2.pdf | Bin 0 -> 39350 bytes .../Documentation/ExampleMacro3.pdf | Bin 0 -> 32125 bytes .../Documentation/ExampleMacro4.pdf | Bin 0 -> 42187 bytes .../Documentation/ExampleMacro5.pdf | Bin 0 -> 38363 bytes .../FEMTOSCOPY/Documentation/TopLevelUML.pdf | Bin 0 -> 24755 bytes PWGCF/FEMTOSCOPY/macros/AddTaskFemto.C | 67 + .../macros/Batch/ConfigFemtoAnalysis.C | 131 ++ PWGCF/FEMTOSCOPY/macros/Batch/runBatch.C | 147 ++ PWGCF/FEMTOSCOPY/macros/BatchMC/runBatch.C | 106 ++ PWGCF/FEMTOSCOPY/macros/ConfigFemtoAnalysis.C | 133 ++ .../macros/Local/AliFemtoSplittingMergingQA.C | 165 ++ PWGCF/FEMTOSCOPY/macros/Local/runLocal.C | 141 ++ PWGCF/FEMTOSCOPY/macros/Proof/runProof.C | 108 ++ PWGCF/FEMTOSCOPY/macros/Train/AddTaskFemto.C | 67 + .../Train/DEtaDPhi/ConfigFemtoAnalysis.C | 387 ++++ .../Train/DEtaDPhiKaons/ConfigFemtoAnalysis.C | 386 ++++ .../Train/DEtaDPhiNoPID/ConfigFemtoAnalysis.C | 386 ++++ .../Train/DataTrain1/ConfigFemtoAnalysis.C | 539 ++++++ .../PWG2FemtoExercise1/ConfigFemtoAnalysis.C | 391 ++++ .../Train/PWG2FemtoExercise1/runBatch.C | 147 ++ .../Train/PWG2FemtoExercise1/runLocal.C | 146 ++ .../Train/PWG2Train2/ConfigFemtoAnalysis.C | 488 +++++ .../PWG2TrainLHC10a6/ConfigFemtoAnalysis.C | 360 ++++ .../PionsFemtoscopy/ConfigFemtoAnalysis.C | 356 ++++ .../ProtonFemtoscopy/ConfigFemtoAnalysis.C | 359 ++++ .../macros/Train/ProtonFemtoscopy/runBatch.C | 257 +++ .../macros/Train/Train3/ConfigFemtoAnalysis.C | 970 ++++++++++ .../Train/TwoTrackQA/ConfigFemtoAnalysis.C | 456 +++++ .../TwoTrackQA/ConfigFemtoAnalysisCentral.C | 499 ++++++ .../macros/Train/TwoTrackQA/FemtoQAPlots.C | 423 +++++ PWGCF/PWGCFFEMTOSCOPYAODLinkDef.h | 11 + PWGCF/PWGCFfemtoscopyLinkDef.h | 68 + PWGCF/PWGCFfemtoscopyUserLinkDef.h | 44 + 280 files changed, 53418 insertions(+) create mode 100644 PWGCF/CMakelibPWGCFFEMTOSCOPYAOD.pkg create mode 100644 PWGCF/CMakelibPWGCFfemtoscopy.pkg create mode 100644 PWGCF/CMakelibPWGCFfemtoscopyUser.pkg create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliAnalysisTaskFemto.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliAnalysisTaskFemto.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAODTrackCut.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAODTrackCut.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysis.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisAzimuthal.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisAzimuthal.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisCollection.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisReactionPlane.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisReactionPlane.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBPLCMS3DCorrFctn.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBPLCMS3DCorrFctn.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBasicEventCut.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBasicEventCut.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBasicTrackCut.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBasicTrackCut.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn3DLCMSSym.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn3DLCMSSym.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn3DSpherical.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn3DSpherical.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctnCollection.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctnNonIdDR.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctnNonIdDR.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCoulomb.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCoulomb.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitor.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitor.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorCollection.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventMult.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventMult.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventVertex.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventVertex.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorHandler.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorHandler.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticlePID.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticlePID.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleVertPos.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleVertPos.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleYPt.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleYPt.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoDummyPairCut.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoDummyPairCut.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEnumeration.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEvent.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEvent.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventCut.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventCutEstimators.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventCutEstimators.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReader.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReader.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderAOD.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderAOD.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderAODChain.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderAODChain.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESD.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESD.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChain.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChain.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChainKine.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChainKine.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderKinematicsChain.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderKinematicsChain.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderStandard.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderStandard.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventWriter.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventWriterCollection.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoFsiTools.F create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoFsiWeightLednicky.F create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoHelix.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoHiddenInfo.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKTPairCut.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKTPairCut.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKink.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKink.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKinkCollection.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKinkCut.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLikeSignAnalysis.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLikeSignAnalysis.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLikeSignCorrFctn.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLorentzVector.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLorentzVectorD.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoMCTrackCut.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoMCTrackCut.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoManager.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoManager.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelCorrFctn.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelCorrFctn.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelFreezeOutGenerator.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelFreezeOutGenerator.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelGausLCMSFreezeOutGenerator.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelGausLCMSFreezeOutGenerator.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelGlobalHiddenInfo.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelGlobalHiddenInfo.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelHiddenInfo.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelHiddenInfo.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelManager.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelManager.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGenerator.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGenerator.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGeneratorBasic.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGeneratorBasic.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGeneratorLednicky.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGeneratorLednicky.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoPair.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoPair.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoPairCut.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoParticle.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoParticle.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoParticleCollection.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoParticleCut.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoPicoEvent.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoPicoEvent.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoPicoEventCollection.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoPicoEventCollectionVector.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoPicoEventCollectionVectorHideAway.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoPicoEventCollectionVectorHideAway.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoQinvCorrFctn.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoQinvCorrFctn.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoSimpleAnalysis.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoSimpleAnalysis.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoString.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoThreeVector.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoThreeVectorD.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoTrack.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoTrack.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoTrackCollection.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoTrackCut.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoTypes.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoV0.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoV0.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoV0Collection.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoV0Cut.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoVector.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoVertexAnalysis.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoVertexAnalysis.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoVertexMultAnalysis.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoVertexMultAnalysis.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoXi.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoXi.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoXiCollection.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFemtoXiCut.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFmHelix.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFmHelix.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFmHelixD.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFmLorentzVector.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFmLorentzVectorD.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFmPhysicalHelix.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFmPhysicalHelix.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFmPhysicalHelixD.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFmThreeVector.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFmThreeVectorD.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliFmThreeVectorF.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliTwoTrackRes.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/AliTwoTrackRes.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/PhysicalConstants.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/SystemOfUnits.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/TpcLocalTransform.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/TpcLocalTransform.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemto/phys_constants.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoBPLCMS3DCorrFctnEMCIC.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoBPLCMS3DCorrFctnEMCIC.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoChi2CorrFctn.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoChi2CorrFctn.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctn3DSphericalEMCIC.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctn3DSphericalEMCIC.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDEtaDPhi.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDEtaDPhi.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDirectYlm.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDirectYlm.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnGammaMonitor.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnGammaMonitor.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnTPCNcls.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnTPCNcls.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticleEtCorr.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticleEtCorr.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticleMomRes.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticleMomRes.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticlePtPDG.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticlePtPDG.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorTrackTPCchiNdof.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorTrackTPCchiNdof.h create mode 100755 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorTrackTPCncls.cxx create mode 100755 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorTrackTPCncls.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoESDTrackCut.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoESDTrackCut.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoEventReaderESDKine.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoEventReaderESDKine.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelAllHiddenInfo.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelAllHiddenInfo.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelBPLCMSCorrFctn.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelBPLCMSCorrFctn.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DLCMSSpherical.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DLCMSSpherical.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DSpherical.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DSpherical.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnDEtaDPhi.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnDEtaDPhi.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnDirectYlm.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnDirectYlm.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnNonIdDR.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnNonIdDR.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnSource.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnSource.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnTrueQ.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnTrueQ.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelGausRinvFreezeOutGenerator.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoModelGausRinvFreezeOutGenerator.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutAntiGamma.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutAntiGamma.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutPt.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutPt.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutRadialDistance.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutRadialDistance.h create mode 100755 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoQAEventCut.cxx create mode 100755 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoQAEventCut.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoQATrackCut.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoQATrackCut.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoQPairCut.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoQPairCut.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoQinvCorrFctnEMCIC.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoQinvCorrFctnEMCIC.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityCorrFctn.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityCorrFctn.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityKTPairCut.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityKTPairCut.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityPairCut.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityPairCut.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityQAPairCut.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityQAPairCut.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityTPCEntranceSepPairCut.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityTPCEntranceSepPairCut.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityTPCEntranceSepQAPairCut.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityTPCEntranceSepQAPairCut.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoTPCInnerCorrFctn.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoTPCInnerCorrFctn.h create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoYlm.cxx create mode 100644 PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoYlm.h create mode 100644 PWGCF/FEMTOSCOPY/Documentation/AliFemto.pdf create mode 100755 PWGCF/FEMTOSCOPY/Documentation/AliFemto.tex create mode 100644 PWGCF/FEMTOSCOPY/Documentation/AliFemtoTitle.pdf create mode 100644 PWGCF/FEMTOSCOPY/Documentation/Analysis.pdf create mode 100644 PWGCF/FEMTOSCOPY/Documentation/ExampleMacro1.pdf create mode 100644 PWGCF/FEMTOSCOPY/Documentation/ExampleMacro2.pdf create mode 100644 PWGCF/FEMTOSCOPY/Documentation/ExampleMacro3.pdf create mode 100644 PWGCF/FEMTOSCOPY/Documentation/ExampleMacro4.pdf create mode 100644 PWGCF/FEMTOSCOPY/Documentation/ExampleMacro5.pdf create mode 100644 PWGCF/FEMTOSCOPY/Documentation/TopLevelUML.pdf create mode 100644 PWGCF/FEMTOSCOPY/macros/AddTaskFemto.C create mode 100644 PWGCF/FEMTOSCOPY/macros/Batch/ConfigFemtoAnalysis.C create mode 100644 PWGCF/FEMTOSCOPY/macros/Batch/runBatch.C create mode 100644 PWGCF/FEMTOSCOPY/macros/BatchMC/runBatch.C create mode 100644 PWGCF/FEMTOSCOPY/macros/ConfigFemtoAnalysis.C create mode 100644 PWGCF/FEMTOSCOPY/macros/Local/AliFemtoSplittingMergingQA.C create mode 100644 PWGCF/FEMTOSCOPY/macros/Local/runLocal.C create mode 100644 PWGCF/FEMTOSCOPY/macros/Proof/runProof.C create mode 100644 PWGCF/FEMTOSCOPY/macros/Train/AddTaskFemto.C create mode 100644 PWGCF/FEMTOSCOPY/macros/Train/DEtaDPhi/ConfigFemtoAnalysis.C create mode 100644 PWGCF/FEMTOSCOPY/macros/Train/DEtaDPhiKaons/ConfigFemtoAnalysis.C create mode 100644 PWGCF/FEMTOSCOPY/macros/Train/DEtaDPhiNoPID/ConfigFemtoAnalysis.C create mode 100644 PWGCF/FEMTOSCOPY/macros/Train/DataTrain1/ConfigFemtoAnalysis.C create mode 100644 PWGCF/FEMTOSCOPY/macros/Train/PWG2FemtoExercise1/ConfigFemtoAnalysis.C create mode 100644 PWGCF/FEMTOSCOPY/macros/Train/PWG2FemtoExercise1/runBatch.C create mode 100644 PWGCF/FEMTOSCOPY/macros/Train/PWG2FemtoExercise1/runLocal.C create mode 100644 PWGCF/FEMTOSCOPY/macros/Train/PWG2Train2/ConfigFemtoAnalysis.C create mode 100644 PWGCF/FEMTOSCOPY/macros/Train/PWG2TrainLHC10a6/ConfigFemtoAnalysis.C create mode 100644 PWGCF/FEMTOSCOPY/macros/Train/PionsFemtoscopy/ConfigFemtoAnalysis.C create mode 100644 PWGCF/FEMTOSCOPY/macros/Train/ProtonFemtoscopy/ConfigFemtoAnalysis.C create mode 100644 PWGCF/FEMTOSCOPY/macros/Train/ProtonFemtoscopy/runBatch.C create mode 100644 PWGCF/FEMTOSCOPY/macros/Train/Train3/ConfigFemtoAnalysis.C create mode 100644 PWGCF/FEMTOSCOPY/macros/Train/TwoTrackQA/ConfigFemtoAnalysis.C create mode 100644 PWGCF/FEMTOSCOPY/macros/Train/TwoTrackQA/ConfigFemtoAnalysisCentral.C create mode 100644 PWGCF/FEMTOSCOPY/macros/Train/TwoTrackQA/FemtoQAPlots.C create mode 100644 PWGCF/PWGCFFEMTOSCOPYAODLinkDef.h create mode 100644 PWGCF/PWGCFfemtoscopyLinkDef.h create mode 100644 PWGCF/PWGCFfemtoscopyUserLinkDef.h diff --git a/PWGCF/CMakelibPWGCFFEMTOSCOPYAOD.pkg b/PWGCF/CMakelibPWGCFFEMTOSCOPYAOD.pkg new file mode 100644 index 00000000000..3d03438c303 --- /dev/null +++ b/PWGCF/CMakelibPWGCFFEMTOSCOPYAOD.pkg @@ -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 index 00000000000..a132088dcc2 --- /dev/null +++ b/PWGCF/CMakelibPWGCFfemtoscopy.pkg @@ -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 index 00000000000..e800172295f --- /dev/null +++ b/PWGCF/CMakelibPWGCFfemtoscopyUser.pkg @@ -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 index 00000000000..fe3e52b4ade --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliAnalysisTaskFemto.cxx @@ -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 (GetInputData(0)); + if (!tree) { + AliWarning("Could not read chain from input slot 0"); + return; + } + + AliFemtoEventReaderESDChain *femtoReader = dynamic_cast (fReader); + if ((dynamic_cast (fReader))) { + AliESDInputHandler *esdH = dynamic_cast (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 (fReader))) { + AliESDInputHandler *esdH = dynamic_cast (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 (fReader); + if ((dynamic_cast (fReader))) { + AliESDInputHandler *esdH = dynamic_cast (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 (fReader); + if ((dynamic_cast (fReader))) { + AliESDInputHandler *esdH = dynamic_cast (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 (fReader); + if (dynamic_cast (fReader)) { + AliAODInputHandler *aodH = dynamic_cast (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; ianAnalysisCollection()->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 (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; iterhGetEntries(); iterh++) + { + hdh = dynamic_cast (lhd->At(iterh)); + // AliInfo ("HIJING header at %i is %p\n", iterh, (void *) hdh); + } + } + } + + // Get ESD + AliESDInputHandler *esdH = dynamic_cast (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 (fReader); + if (fesdc) + { + // Process the event with no Kine information + fesdc->SetESDSource(fESD); + fManager->ProcessEvent(); + } + + AliFemtoEventReaderKinematicsChain* fkinec = dynamic_cast (fReader); + if (fkinec) + { + // Process the event with Kine information only + fkinec->SetStackSource(fStack); + fManager->ProcessEvent(); + } + + + AliFemtoEventReaderESDChainKine* fesdck = dynamic_cast (fReader); + if (fesdck) + { + // Process the event with Kine information + fesdck->SetESDSource(fESD); + fesdck->SetStackSource(fStack); + + fesdck->SetGenEventHeader(hdh); + fManager->ProcessEvent(); + } + AliFemtoEventReaderStandard* fstd = dynamic_cast (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 (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 (fReader); + + if (faodc) { + // Process the event + faodc->SetAODSource(fAOD); + fManager->ProcessEvent(); + } + AliFemtoEventReaderStandard* fstd = dynamic_cast (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 (aManager->EventReader()); + AliFemtoEventReaderESDChainKine *tReaderESDChainKine = dynamic_cast (aManager->EventReader()); + AliFemtoEventReaderAODChain *tReaderAODChain = dynamic_cast (aManager->EventReader()); + AliFemtoEventReaderStandard *tReaderStandard = dynamic_cast (aManager->EventReader()); + AliFemtoEventReaderKinematicsChain *tReaderKineChain = dynamic_cast (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 index 00000000000..711f450717d --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliAnalysisTaskFemto.h @@ -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 index 00000000000..2c60d50abd1 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAODTrackCut.cxx @@ -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 + +#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"<Label()<0) + { + fNTracksFailed++; + // cout<<"No Go Through the cut"<fPt[1])) + { + fNTracksFailed++; + //cout<<"No Go Through the cut"<PidProbElectron()PidProbElectron()>fPidProbElectron[1])) + { + fNTracksFailed++; + //cout<<"No Go Through the cut"<PidProbPion()PidProbPion()>fPidProbPion[1])) + { + fNTracksFailed++; + //cout<<"No Go Through the cut"<PidProbKaon()PidProbKaon()>fPidProbKaon[1])) + { + fNTracksFailed++; + //cout<<"No Go Through the cut"<PidProbProton()PidProbProton()>fPidProbProton[1])) + { + fNTracksFailed++; + //cout<<"No Go Through the cut"<PidProbMuon()PidProbMuon()>fPidProbMuon[1])) + { + fNTracksFailed++; + //cout<<"No Go Through the cut"<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"<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 index 00000000000..4d7454cebb3 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAODTrackCut.h @@ -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 index 00000000000..8a986270051 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysis.h @@ -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 +#include + +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 index 00000000000..38cf4d22a99 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisAzimuthal.cxx @@ -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 +#include +#include +#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 index 00000000000..d806651bcfd --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisAzimuthal.h @@ -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 index 00000000000..2ef52b48e9b --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisCollection.h @@ -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 +#if !defined(ST_NO_NAMESPACES) +using std::list; +#endif +class AliFemtoAnalysis; + +#ifdef ST_NO_TEMPLATE_DEF_ARGS +typedef list > AliFemtoAnalysisCollection; +typedef list >::iterator AliFemtoSimpleAnalysisIterator; +#else +typedef list AliFemtoAnalysisCollection; +typedef list::iterator AliFemtoSimpleAnalysisIterator; +#endif + +#endif diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisReactionPlane.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisReactionPlane.cxx new file mode 100644 index 00000000000..11fbdbd166d --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisReactionPlane.cxx @@ -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 +#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..."<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 index 00000000000..2283efb83b2 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoAnalysisReactionPlane.h @@ -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 index 00000000000..77900c35a88 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBPLCMS3DCorrFctn.cxx @@ -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 + +#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(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 (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(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 (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 index 00000000000..053eb8c711e --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBPLCMS3DCorrFctn.h @@ -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 index 00000000000..149a99ceb23 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBasicEventCut.cxx @@ -0,0 +1,87 @@ +//////////////////////////////////////////////////////////////////////////////// +// // +// AliFemtoBasicEventCut - the basic cut for events. // +// Only cuts on event multiplicity and z-vertex position // +// // +//////////////////////////////////////////////////////////////////////////////// + +#include "AliFemtoBasicEventCut.h" +//#include + +#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 index 00000000000..f991459ac09 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBasicEventCut.h @@ -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 index 00000000000..34d0f283e72 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBasicTrackCut.cxx @@ -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 + +#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 index 00000000000..d7ba801e0db --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoBasicTrackCut.h @@ -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 index 00000000000..0e25566a517 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn.cxx @@ -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 index 00000000000..a8f6e080c49 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn.h @@ -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 index 00000000000..9d6926d114a --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn3DLCMSSym.cxx @@ -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 + +#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 index 00000000000..561d68c7166 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn3DLCMSSym.h @@ -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 index 00000000000..e0cd28fc5f9 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn3DSpherical.cxx @@ -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 +#include + +#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 index 00000000000..de5b207b715 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctn3DSpherical.h @@ -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 index 00000000000..0f3ce92465d --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctnCollection.h @@ -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 +#if !defined(ST_NO_NAMESPACES) +using std::list; +#endif +class AliFemtoCorrFctn; + +#ifdef ST_NO_TEMPLATE_DEF_ARGS +typedef list > AliFemtoCorrFctnCollection; +typedef list >::iterator AliFemtoCorrFctnIterator; +#else +typedef list AliFemtoCorrFctnCollection; +typedef list::iterator AliFemtoCorrFctnIterator; +#endif + +#endif diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctnNonIdDR.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctnNonIdDR.cxx new file mode 100644 index 00000000000..2e85c438410 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctnNonIdDR.cxx @@ -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 + +#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 index 00000000000..45edb6672bd --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCorrFctnNonIdDR.h @@ -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 index 00000000000..7f905df037b --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCoulomb.cxx @@ -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 +#include +//#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= 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 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 index 00000000000..468ab2b1652 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCoulomb.h @@ -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 +#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 index 00000000000..24abd406daa --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitor.cxx @@ -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 index 00000000000..e6c0bd7f092 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitor.h @@ -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 + +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 index 00000000000..fd1d94704ad --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorCollection.h @@ -0,0 +1,20 @@ +#ifndef AliFemtoCutMonitorCollection_hh +#define AliFemtoCutMonitorCollection_hh + + +//#include +#include +#if !defined(ST_NO_NAMESPACES) +using std::vector; +#endif +class AliFemtoCutMonitor; + +#ifdef ST_NO_TEMPLATE_DEF_ARGS +typedef vector > AliFemtoCutMonitorCollection; +typedef vector >::iterator AliFemtoCutMonitorIterator; +#else +typedef vector AliFemtoCutMonitorCollection; +typedef vector::iterator AliFemtoCutMonitorIterator; +#endif + +#endif diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventMult.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventMult.cxx new file mode 100644 index 00000000000..830010d4fb7 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventMult.cxx @@ -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 +#include +#include + +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 index 00000000000..143109ddb41 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventMult.h @@ -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 index 00000000000..df5b93ed829 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventVertex.cxx @@ -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 +#include +#include +#include + +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 index 00000000000..7d0640a7559 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventVertex.h @@ -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 index 00000000000..efdb4b74c25 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorHandler.cxx @@ -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 +#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)"<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; ibegin(); + if ( (int)fFailColl->size() <= n ) return NULL; + for ( int i=0; isize(); ipass++) { + TList *tLp = PassMonitor(ipass)->GetOutputList(); + + TIter nextLp(tLp); + while (TObject *obj = nextLp()) { + tOutputList->Add(obj); + } + + delete tLp; + } + + for (unsigned int ipass=0; ipasssize(); 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 index 00000000000..78d912b72be --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorHandler.h @@ -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 index 00000000000..f225bcd8774 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticlePID.cxx @@ -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 +#include +#include +#include + +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 index 00000000000..920de21bac8 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticlePID.h @@ -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 index 00000000000..f752c15c64e --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleVertPos.cxx @@ -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 +#include +#include +#include + +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(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(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 index 00000000000..806a4271304 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleVertPos.h @@ -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 index 00000000000..a844d51ab94 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleYPt.cxx @@ -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 +#include +#include +#include + +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 index 00000000000..c7501d5f308 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleYPt.h @@ -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 index 00000000000..1d600338f57 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoDummyPairCut.cxx @@ -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 +#include + +#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 index 00000000000..49a14ef69cf --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoDummyPairCut.h @@ -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 index 00000000000..5c88e5008f1 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEnumeration.h @@ -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 index 00000000000..f09b0a884a3 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEvent.cxx @@ -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 index 00000000000..1b5611468c7 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEvent.h @@ -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 index 00000000000..b7916a1366d --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventCut.h @@ -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 index 00000000000..f9d8b99bc40 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventCutEstimators.cxx @@ -0,0 +1,119 @@ +//////////////////////////////////////////////////////////////////////////////// +// // +// AliFemtoEventCutEstimators - the basic cut for events. // +// Only cuts on event multiplicity and z-vertex position // +// // +//////////////////////////////////////////////////////////////////////////////// + +#include "AliFemtoEventCutEstimators.h" +//#include + +#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 index 00000000000..a868436bafa --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventCutEstimators.h @@ -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 index 00000000000..8caa5abc920 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReader.cxx @@ -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 index 00000000000..d90b90a353b --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReader.h @@ -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 +#include +#include + +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 index 00000000000..0b0e4f5b9bc --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderAOD.cxx @@ -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) +{ + //setting the name of file where names of AOD file are written + //it takes only this files which have good trees + char buffer[256]; + fInputFile=string(inputFile); + ifstream infile(inputFile); + + fTree = new TChain("aodTree"); + + if(infile.good()==true) + { + //checking if all give files have good tree inside + while (infile.eof()==false) + { + infile.getline(buffer,256); + TFile *aodFile=TFile::Open(buffer,"READ"); + if (aodFile!=0x0) + { + TTree* tree = (TTree*) aodFile->Get("aodTree"); + if (tree!=0x0) + { + // cout<<"putting file "<AddFile(buffer); + delete tree; + } + aodFile->Close(); + } + delete aodFile; + } + } +} + +AliFemtoEvent* AliFemtoEventReaderAOD::ReturnHbtEvent() +{ + // read in a next hbt event from the chain + // convert it to AliFemtoEvent and return + // for further analysis + AliFemtoEvent *hbtEvent = 0; + cout<<"reader"<ReadFromTree(fTree); + + // Check for the existence of the additional information +// fPWG2AODTracks = (TClonesArray *) fEvent->GetList()->FindObject("pwg2aodtracks"); + +// if (fPWG2AODTracks) { +// cout << "Found additional PWG2 specific information in the AOD!" << endl; +// cout << "Reading only tracks with the additional information" << endl; +// } + + fNumberofEvent=fTree->GetEntries(); + // cout<<"Number of Entries in file "<GetEvent(fCurEvent);//getting next event + // cout << "Read event " << fEvent << " from file " << fTree << endl; + + hbtEvent = new AliFemtoEvent; + + CopyAODtoFemtoEvent(hbtEvent); + fCurEvent++; + + + return hbtEvent; +} + +void AliFemtoEventReaderAOD::CopyAODtoFemtoEvent(AliFemtoEvent *tEvent) +{ + + // A function that reads in the AOD event + // and transfers the neccessary information into + // the internal AliFemtoEvent + + // setting global event characteristics + tEvent->SetRunNumber(fEvent->GetRunNumber()); + tEvent->SetMagneticField(fEvent->GetMagneticField()*kilogauss);//to check if here is ok + tEvent->SetZDCN1Energy(fEvent->GetZDCN1Energy()); + tEvent->SetZDCP1Energy(fEvent->GetZDCP1Energy()); + tEvent->SetZDCN2Energy(fEvent->GetZDCN2Energy()); + tEvent->SetZDCP2Energy(fEvent->GetZDCP2Energy()); + tEvent->SetZDCEMEnergy(fEvent->GetZDCEMEnergy(0)); + tEvent->SetZDCParticipants(0); + tEvent->SetTriggerMask(fEvent->GetTriggerMask()); + tEvent->SetTriggerCluster(fEvent->GetTriggerCluster()); + + // Attempt to access MC header + AliAODMCHeader *mcH; + TClonesArray *mcP=0; + if (fReadMC) { + mcH = (AliAODMCHeader *) fEvent->FindListObject(AliAODMCHeader::StdBranchName()); + if (!mcH) { + cout << "AOD MC information requested, but no header found!" << endl; + } + + mcP = (TClonesArray *) fEvent->FindListObject(AliAODMCParticle::StdBranchName()); + if (!mcP) { + cout << "AOD MC information requested, but no particle array found!" << endl; + } + } + + tEvent->SetReactionPlaneAngle(fEvent->GetHeader()->GetQTheta(0)/2.0); + + Int_t *motherids=0; + if (mcP) { + motherids = new Int_t[((AliAODMCParticle *) mcP->At(mcP->GetEntries()-1))->GetLabel()]; + for (int ip=0; ipGetEntries(); ip++) motherids[ip] = 0; + + // Read in mother ids + AliAODMCParticle *motherpart; + for (int ip=0; ipGetEntries(); ip++) { + motherpart = (AliAODMCParticle *) mcP->At(ip); + if (motherpart->GetDaughter(0) > 0) + motherids[motherpart->GetDaughter(0)] = ip; + if (motherpart->GetDaughter(1) > 0) + motherids[motherpart->GetDaughter(1)] = ip; + } + } + + // Primary Vertex position + double fV1[3]; + fEvent->GetPrimaryVertex()->GetPosition(fV1); + + AliFmThreeVectorF vertex(fV1[0],fV1[1],fV1[2]); + tEvent->SetPrimVertPos(vertex); + + //starting to reading tracks + int nofTracks=0; //number of reconstructed tracks in event + + // Check to see whether the additional info exists +// if (fPWG2AODTracks) +// nofTracks=fPWG2AODTracks->GetEntries(); +// else + nofTracks=fEvent->GetNumberOfTracks(); + cout<<"nofTracks: "<GetCentrality(); + + if (cent && fUsePreCent) { + if ((cent->GetCentralityPercentile("V0M")*10 < fCentRange[0]) || + (cent->GetCentralityPercentile("V0M")*10 > fCentRange[1])) + { + cout << "Centrality " << cent->GetCentralityPercentile("V0M") << " outside of preselection range " << fCentRange[0] << " - " << fCentRange[1] << endl; + + return; + } + } + + int realnofTracks=0; // number of track which we use in a analysis + int tracksPrim=0; + + int labels[20000]; + for (int il=0; il<20000; il++) labels[il] = -1; + + // looking for global tracks and saving their numbers to copy from them PID information to TPC-only tracks in the main loop over tracks + for (int i=0;iGetTrack(i); + if (!aodtrack->TestFilterBit(fFilterBit)) { + labels[aodtrack->GetID()] = i; + } + } + + // int tNormMult = 0; + for (int i=0;iAt(i); + +// // Getting the AOD track through the ref of the additional info +// AliAODTrack *aodtrack = pwg2aodtrack->GetRefAODTrack(); +// if (!aodtrack->TestFilterBit(fFilterBit)) { +// delete trackCopy; +// continue; +// } + + +// if (aodtrack->IsOn(AliESDtrack::kTPCrefit)) +// if (aodtrack->Chi2perNDF() < 6.0) +// if (aodtrack->Eta() < 0.9) +// tNormMult++; + + +// CopyAODtoFemtoTrack(aodtrack, trackCopy, pwg2aodtrack); + +// if (mcP) { +// // Fill the hidden information with the simulated data +// // Int_t pLabel = aodtrack->GetLabel(); +// AliAODMCParticle *tPart = GetParticleWithLabel(mcP, (TMath::Abs(aodtrack->GetLabel()))); + +// // Check the mother information + +// // Using the new way of storing the freeze-out information +// // Final state particle is stored twice on the stack +// // one copy (mother) is stored with original freeze-out information +// // and is not tracked +// // the other one (daughter) is stored with primary vertex position +// // and is tracked + +// // Freeze-out coordinates +// double fpx=0.0, fpy=0.0, fpz=0.0, fpt=0.0; +// fpx = tPart->Xv() - fV1[0]; +// fpy = tPart->Yv() - fV1[1]; +// fpz = tPart->Zv() - fV1[2]; +// fpt = tPart->T(); + +// AliFemtoModelGlobalHiddenInfo *tInfo = new AliFemtoModelGlobalHiddenInfo(); +// tInfo->SetGlobalEmissionPoint(fpx, fpy, fpz); + +// fpx *= 1e13; +// fpy *= 1e13; +// fpz *= 1e13; +// fpt *= 1e13; + +// // cout << "Looking for mother ids " << endl; +// if (motherids[TMath::Abs(aodtrack->GetLabel())]>0) { +// // cout << "Got mother id" << endl; +// AliAODMCParticle *mother = GetParticleWithLabel(mcP, motherids[TMath::Abs(aodtrack->GetLabel())]); +// // Check if this is the same particle stored twice on the stack +// if ((mother->GetPdgCode() == tPart->GetPdgCode() || (mother->Px() == tPart->Px()))) { +// // It is the same particle +// // Read in the original freeze-out information +// // and convert it from to [fm] + +// // EPOS style +// // fpx = mother->Xv()*1e13*0.197327; +// // fpy = mother->Yv()*1e13*0.197327; +// // fpz = mother->Zv()*1e13*0.197327; +// // fpt = mother->T() *1e13*0.197327*0.5; + + +// // Therminator style +// fpx = mother->Xv()*1e13; +// fpy = mother->Yv()*1e13; +// fpz = mother->Zv()*1e13; +// fpt = mother->T() *1e13*3e10; + +// } +// } + +// // if (fRotateToEventPlane) { +// // double tPhi = TMath::ATan2(fpy, fpx); +// // double tRad = TMath::Hypot(fpx, fpy); + +// // fpx = tRad*TMath::Cos(tPhi - tReactionPlane); +// // fpy = tRad*TMath::Sin(tPhi - tReactionPlane); +// // } + +// tInfo->SetPDGPid(tPart->GetPdgCode()); + +// // if (fRotateToEventPlane) { +// // double tPhi = TMath::ATan2(tPart->Py(), tPart->Px()); +// // double tRad = TMath::Hypot(tPart->Px(), tPart->Py()); + +// // tInfo->SetTrueMomentum(tRad*TMath::Cos(tPhi - tReactionPlane), +// // tRad*TMath::Sin(tPhi - tReactionPlane), +// // tPart->Pz()); +// // } +// // else +// tInfo->SetTrueMomentum(tPart->Px(), tPart->Py(), tPart->Pz()); +// Double_t mass2 = (tPart->E() *tPart->E() - +// tPart->Px()*tPart->Px() - +// tPart->Py()*tPart->Py() - +// tPart->Pz()*tPart->Pz()); +// if (mass2>0.0) +// tInfo->SetMass(TMath::Sqrt(mass2)); +// else +// tInfo->SetMass(0.0); + +// tInfo->SetEmissionPoint(fpx, fpy, fpz, fpt); +// trackCopy->SetHiddenInfo(tInfo); + +// } + +// double pxyz[3]; +// aodtrack->PxPyPz(pxyz);//reading noconstarined momentum +// const AliFmThreeVectorD ktP(pxyz[0],pxyz[1],pxyz[2]); +// // Check the sanity of the tracks - reject zero momentum tracks +// if (ktP.Mag() == 0) { +// delete trackCopy; +// continue; +// } +// } +// else { + // No additional information exists + // Read in the normal AliAODTracks + + // const AliAODTrack *aodtrack=fEvent->GetTrack(i); // getting the AODtrack directly + AliAODTrack *aodtrack=fEvent->GetTrack(i); // getting the AODtrack directly + + if (aodtrack->IsPrimaryCandidate()) tracksPrim++; + + if (!aodtrack->TestFilterBit(fFilterBit)) { + delete trackCopy; + continue; + } + + CopyAODtoFemtoTrack(aodtrack, trackCopy); + + // copying PID information from the correspondent track + // const AliAODTrack *aodtrackpid = fEvent->GetTrack(labels[-1-fEvent->GetTrack(i)->GetID()]); + AliAODTrack *aodtrackpid = fEvent->GetTrack(labels[-1-fEvent->GetTrack(i)->GetID()]); + CopyPIDtoFemtoTrack(aodtrackpid, trackCopy); + + if (mcP) { + // Fill the hidden information with the simulated data + // Int_t pLabel = aodtrack->GetLabel(); + AliAODMCParticle *tPart = GetParticleWithLabel(mcP, (TMath::Abs(aodtrack->GetLabel()))); + + AliFemtoModelGlobalHiddenInfo *tInfo = new AliFemtoModelGlobalHiddenInfo(); + double fpx=0.0, fpy=0.0, fpz=0.0, fpt=0.0; + if (!tPart) { + fpx = fV1[0]; + fpy = fV1[1]; + fpz = fV1[2]; + tInfo->SetGlobalEmissionPoint(fpx, fpy, fpz); + tInfo->SetPDGPid(0); + tInfo->SetTrueMomentum(0.0, 0.0, 0.0); + tInfo->SetEmissionPoint(0.0, 0.0, 0.0, 0.0); + tInfo->SetMass(0); + } + else { + // Check the mother information + + // Using the new way of storing the freeze-out information + // Final state particle is stored twice on the stack + // one copy (mother) is stored with original freeze-out information + // and is not tracked + // the other one (daughter) is stored with primary vertex position + // and is tracked + + // Freeze-out coordinates + fpx = tPart->Xv() - fV1[0]; + fpy = tPart->Yv() - fV1[1]; + fpz = tPart->Zv() - fV1[2]; + // fpt = tPart->T(); + + tInfo->SetGlobalEmissionPoint(fpx, fpy, fpz); + + fpx *= 1e13; + fpy *= 1e13; + fpz *= 1e13; + // fpt *= 1e13; + + // cout << "Looking for mother ids " << endl; + if (motherids[TMath::Abs(aodtrack->GetLabel())]>0) { + // cout << "Got mother id" << endl; + AliAODMCParticle *mother = GetParticleWithLabel(mcP, motherids[TMath::Abs(aodtrack->GetLabel())]); + // Check if this is the same particle stored twice on the stack + if (mother) { + if ((mother->GetPdgCode() == tPart->GetPdgCode() || (mother->Px() == tPart->Px()))) { + // It is the same particle + // Read in the original freeze-out information + // and convert it from to [fm] + + // EPOS style + // fpx = mother->Xv()*1e13*0.197327; + // fpy = mother->Yv()*1e13*0.197327; + // fpz = mother->Zv()*1e13*0.197327; + // fpt = mother->T() *1e13*0.197327*0.5; + + + // Therminator style + fpx = mother->Xv()*1e13; + fpy = mother->Yv()*1e13; + fpz = mother->Zv()*1e13; + // fpt = mother->T() *1e13*3e10; + + } + } + } + + // if (fRotateToEventPlane) { + // double tPhi = TMath::ATan2(fpy, fpx); + // double tRad = TMath::Hypot(fpx, fpy); + + // fpx = tRad*TMath::Cos(tPhi - tReactionPlane); + // fpy = tRad*TMath::Sin(tPhi - tReactionPlane); + // } + + tInfo->SetPDGPid(tPart->GetPdgCode()); + + // if (fRotateToEventPlane) { + // double tPhi = TMath::ATan2(tPart->Py(), tPart->Px()); + // double tRad = TMath::Hypot(tPart->Px(), tPart->Py()); + + // tInfo->SetTrueMomentum(tRad*TMath::Cos(tPhi - tReactionPlane), + // tRad*TMath::Sin(tPhi - tReactionPlane), + // tPart->Pz()); + // } + // else + tInfo->SetTrueMomentum(tPart->Px(), tPart->Py(), tPart->Pz()); + Double_t mass2 = (tPart->E() *tPart->E() - + tPart->Px()*tPart->Px() - + tPart->Py()*tPart->Py() - + tPart->Pz()*tPart->Pz()); + if (mass2>0.0) + tInfo->SetMass(TMath::Sqrt(mass2)); + else + tInfo->SetMass(0.0); + + tInfo->SetEmissionPoint(fpx, fpy, fpz, fpt); + } + trackCopy->SetHiddenInfo(tInfo); + } + + double pxyz[3]; + aodtrack->PxPyPz(pxyz);//reading noconstarined momentum + const AliFmThreeVectorD ktP(pxyz[0],pxyz[1],pxyz[2]); + // Check the sanity of the tracks - reject zero momentum tracks + if (ktP.Mag() == 0) { + delete trackCopy; + continue; + } + // } + + + tEvent->TrackCollection()->push_back(trackCopy);//adding track to analysis + realnofTracks++;//real number of tracks + } + + tEvent->SetNumberOfTracks(realnofTracks);//setting number of track which we read in event + tEvent->SetNormalizedMult(tracksPrim); + + // AliCentrality *cent = fEvent->GetCentrality(); + if (cent) tEvent->SetNormalizedMult(lrint(10*cent->GetCentralityPercentile("V0M"))); + // if (cent) tEvent->SetNormalizedMult((int) cent->GetCentralityPercentile("V0M")); + + if (cent) { + tEvent->SetCentralityV0(cent->GetCentralityPercentile("V0M")); + // tEvent->SetCentralityFMD(cent->GetCentralityPercentile("FMD")); + tEvent->SetCentralitySPD1(cent->GetCentralityPercentile("CL1")); + // tEvent->SetCentralityTrk(cent->GetCentralityPercentile("TRK")); + } + + + if (mcP) delete [] motherids; + + cout<<"end of reading nt "<GetPrimaryVertex()->GetPosition(fV1); + // fEvent->GetPrimaryVertex()->GetXYZ(fV1); + + tFemtoTrack->SetCharge(tAodTrack->Charge()); + + double pxyz[3]; + tAodTrack->PxPyPz(pxyz);//reading noconstrained momentum + AliFemtoThreeVector v(pxyz[0],pxyz[1],pxyz[2]); + tFemtoTrack->SetP(v);//setting momentum + tFemtoTrack->SetPt(sqrt(pxyz[0]*pxyz[0]+pxyz[1]*pxyz[1])); + const AliFmThreeVectorD kOrigin(fV1[0],fV1[1],fV1[2]); + //setting track helix + const AliFmThreeVectorD ktP(pxyz[0],pxyz[1],pxyz[2]); + AliFmPhysicalHelixD helix(ktP,kOrigin,(double)(fEvent->GetMagneticField())*kilogauss,(double)(tFemtoTrack->Charge())); + tFemtoTrack->SetHelix(helix); + + // Flags + tFemtoTrack->SetTrackId(tAodTrack->GetID()); + tFemtoTrack->SetFlags(tAodTrack->GetFlags()); + tFemtoTrack->SetLabel(tAodTrack->GetLabel()); + + // Track quality information + float covmat[6]; + tAodTrack->GetCovMatrix(covmat); + + double impact[2]; + double covimpact[3]; + + if (!tAodTrack->PropagateToDCA(fEvent->GetPrimaryVertex(),fEvent->GetMagneticField(),10000,impact,covimpact)) { + //cout << "sth went wrong with dca propagation" << endl; + tFemtoTrack->SetImpactD(-1000.0); + tFemtoTrack->SetImpactZ(-1000.0); + + } + else { + tFemtoTrack->SetImpactD(impact[0]); + tFemtoTrack->SetImpactZ(impact[1]); + } + + // if (TMath::Abs(tAodTrack->Xv()) > 0.00000000001) + // tFemtoTrack->SetImpactD(TMath::Hypot(tAodTrack->Xv(), tAodTrack->Yv())*(tAodTrack->Xv()/TMath::Abs(tAodTrack->Xv()))); + // else + // tFemtoTrack->SetImpactD(0.0); + // tFemtoTrack->SetImpactD(tAodTrack->DCA()); + + // tFemtoTrack->SetImpactZ(tAodTrack->ZAtDCA()); + + + // tFemtoTrack->SetImpactD(TMath::Hypot(tAodTrack->Xv() - fV1[0], tAodTrack->Yv() - fV1[1])); + // tFemtoTrack->SetImpactZ(tAodTrack->Zv() - fV1[2]); + + + // cout + // << "dca" << TMath::Hypot(tAodTrack->Xv() - fV1[0], tAodTrack->Yv() - fV1[1]) + // << "xv - fv10 = "<< tAodTrack->Xv() - fV1[0] + // << tAodTrack->Yv() - fV1[1] +// << "xv = " << tAodTrack->Xv() << endl +// << "fv1[0] = " << fV1[0] << endl +// << "yv = " << tAodTrack->Yv() << endl +// << "fv1[1] = " << fV1[1] << endl +// << "zv = " << tAodTrack->Zv() << endl +// << "fv1[2] = " << fV1[2] << endl +// << "impact[0] = " << impact[0] << endl +// << "impact[1] = " << impact[1] << endl +// << endl << endl ; + + tFemtoTrack->SetCdd(covmat[0]); + tFemtoTrack->SetCdz(covmat[1]); + tFemtoTrack->SetCzz(covmat[2]); + tFemtoTrack->SetITSchi2(tAodTrack->Chi2perNDF()); + tFemtoTrack->SetITSncls(tAodTrack->GetITSNcls()); + tFemtoTrack->SetTPCchi2(tAodTrack->Chi2perNDF()); + tFemtoTrack->SetTPCncls(tAodTrack->GetTPCNcls()); + tFemtoTrack->SetTPCnclsF(tAodTrack->GetTPCNcls()); + tFemtoTrack->SetTPCsignalN(1); + tFemtoTrack->SetTPCsignalS(1); + tFemtoTrack->SetTPCsignal(tAodTrack->GetTPCsignal()); + +// if (tPWG2AODTrack) { +// // Copy the PWG2 specific information if it exists +// tFemtoTrack->SetTPCClusterMap(tPWG2AODTrack->GetTPCClusterMap()); +// tFemtoTrack->SetTPCSharedMap(tPWG2AODTrack->GetTPCSharedMap()); + +// double xtpc[3] = {0,0,0}; +// tPWG2AODTrack->GetTPCNominalEntrancePoint(xtpc); +// tFemtoTrack->SetNominalTPCEntrancePoint(xtpc); +// tPWG2AODTrack->GetTPCNominalExitPoint(xtpc); +// tFemtoTrack->SetNominalTPCExitPoint(xtpc); +// } +// else { + // If not use dummy values + tFemtoTrack->SetTPCClusterMap(tAodTrack->GetTPCClusterMap()); + tFemtoTrack->SetTPCSharedMap(tAodTrack->GetTPCSharedMap()); + + double xtpc[3] = {0,0,0}; + tFemtoTrack->SetNominalTPCEntrancePoint(xtpc); + tFemtoTrack->SetNominalTPCExitPoint(xtpc); + // } + + // // cout << "Track has " << TMath::Hypot(tAodTrack->Xv(), tAodTrack->Yv()) << " " << tAodTrack->Zv() << " " << tAodTrack->GetTPCNcls() << endl; + + + int indexes[3]; + for (int ik=0; ik<3; ik++) { + indexes[ik] = 0; + } + tFemtoTrack->SetKinkIndexes(indexes); +} + +void AliFemtoEventReaderAOD::SetFilterBit(UInt_t ibit) +{ + fFilterBit = (1 << (ibit)); +} + +void AliFemtoEventReaderAOD::SetReadMC(unsigned char a) +{ + fReadMC = a; +} + +AliAODMCParticle* AliFemtoEventReaderAOD::GetParticleWithLabel(TClonesArray *mcP, Int_t aLabel) +{ + if (aLabel < 0) return 0; + AliAODMCParticle *aodP; + Int_t posstack = 0; + if (aLabel > mcP->GetEntries()) + posstack = mcP->GetEntries(); + else + posstack = aLabel; + + aodP = (AliAODMCParticle *) mcP->At(posstack); + if (aodP->GetLabel() > posstack) { + do { + aodP = (AliAODMCParticle *) mcP->At(posstack); + if (aodP->GetLabel() == aLabel) return aodP; + posstack--; + } + while (posstack > 0); + } + else { + do { + aodP = (AliAODMCParticle *) mcP->At(posstack); + if (aodP->GetLabel() == aLabel) return aodP; + posstack++; + } + while (posstack < mcP->GetEntries()); + } + + return 0; +} + +void AliFemtoEventReaderAOD::CopyPIDtoFemtoTrack(AliAODTrack *tAodTrack, + AliFemtoTrack *tFemtoTrack) +{ + double aodpid[10]; + tAodTrack->GetPID(aodpid); + tFemtoTrack->SetPidProbElectron(aodpid[0]); + tFemtoTrack->SetPidProbMuon(aodpid[1]); + tFemtoTrack->SetPidProbPion(aodpid[2]); + tFemtoTrack->SetPidProbKaon(aodpid[3]); + tFemtoTrack->SetPidProbProton(aodpid[4]); + + aodpid[0] = -100000.0; + aodpid[1] = -100000.0; + aodpid[2] = -100000.0; + aodpid[3] = -100000.0; + aodpid[4] = -100000.0; + + double tTOF = 0.0; + + if (tAodTrack->GetStatus() & AliESDtrack::kTOFpid) { //AliESDtrack::kTOFpid=0x8000 + tTOF = tAodTrack->GetTOFsignal(); + tAodTrack->GetIntegratedTimes(aodpid); + } + + tFemtoTrack->SetTofExpectedTimes(tTOF-aodpid[2], tTOF-aodpid[3], tTOF-aodpid[4]); + + ////// TPC //////////////////////////////////////////// + + float nsigmaTPCK=-1000.; + float nsigmaTPCPi=-1000.; + float nsigmaTPCP=-1000.; + + // cout<<"in reader fESDpid"<IsOn(AliESDtrack::kTPCpid)){ //AliESDtrack::kTPCpid=0x0080 + nsigmaTPCK = fAODpidUtil->NumberOfSigmasTPC(tAodTrack,AliPID::kKaon); + nsigmaTPCPi = fAODpidUtil->NumberOfSigmasTPC(tAodTrack,AliPID::kPion); + nsigmaTPCP = fAODpidUtil->NumberOfSigmasTPC(tAodTrack,AliPID::kProton); + } + + tFemtoTrack->SetNSigmaTPCPi(nsigmaTPCPi); + tFemtoTrack->SetNSigmaTPCK(nsigmaTPCK); + tFemtoTrack->SetNSigmaTPCP(nsigmaTPCP); + + tFemtoTrack->SetTPCchi2(tAodTrack->Chi2perNDF()); + tFemtoTrack->SetTPCncls(tAodTrack->GetTPCNcls()); + tFemtoTrack->SetTPCnclsF(tAodTrack->GetTPCNcls()); + + tFemtoTrack->SetTPCsignalN(1); + tFemtoTrack->SetTPCsignalS(1); + tFemtoTrack->SetTPCsignal(tAodTrack->GetTPCsignal()); + + ///////TOF////////////////////// + + float vp=-1000.; + float nsigmaTOFPi=-1000.; + float nsigmaTOFK=-1000.; + float nsigmaTOFP=-1000.; + + if ((tAodTrack->GetStatus() & AliESDtrack::kTOFpid) && //AliESDtrack::kTOFpid=0x8000 + (tAodTrack->GetStatus() & AliESDtrack::kTOFout) && //AliESDtrack::kTOFout=0x2000 + (tAodTrack->GetStatus() & AliESDtrack::kTIME) && //AliESDtrack::kTIME=0x80000000 + !(tAodTrack->GetStatus() & AliESDtrack::kTOFmismatch)) //AliESDtrack::kTOFmismatch=0x100000 + { + if(tAodTrack->IsOn(AliESDtrack::kTOFpid)) //AliESDtrack::kTOFpid=0x8000 + { + + nsigmaTOFPi = fAODpidUtil->NumberOfSigmasTOF(tAodTrack,AliPID::kPion); + nsigmaTOFK = fAODpidUtil->NumberOfSigmasTOF(tAodTrack,AliPID::kKaon); + nsigmaTOFP = fAODpidUtil->NumberOfSigmasTOF(tAodTrack,AliPID::kProton); + + Double_t len=200;// esdtrack->GetIntegratedLength(); !!!!! + Double_t tof=tAodTrack->GetTOFsignal(); + if(tof > 0.) vp=len/tof/0.03; + } + } + tFemtoTrack->SetVTOF(vp); + tFemtoTrack->SetNSigmaTOFPi(nsigmaTOFPi); + tFemtoTrack->SetNSigmaTOFK(nsigmaTOFK); + tFemtoTrack->SetNSigmaTOFP(nsigmaTOFP); + + + ////////////////////////////////////// + +} + +void AliFemtoEventReaderAOD::SetCentralityPreSelection(double min, double max) +{ + fCentRange[0] = min; fCentRange[1] = max; + fUsePreCent = 1; +} + + +void AliFemtoEventReaderAOD::SetAODpidUtil(AliAODpidUtil *aAODpidUtil) +{ + fAODpidUtil = aAODpidUtil; + // printf("fAODpidUtil: %x\n",fAODpidUtil); +} + + + + + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderAOD.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderAOD.h new file mode 100644 index 00000000000..0ab8727a64c --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderAOD.h @@ -0,0 +1,85 @@ +//////////////////////////////////////////////////////////////////////////////// +// // +// AliFemtoEventReaderAOD - the reader class for the Alice AOD // +// Reads in AOD information and converts it into internal AliFemtoEvent // +// Authors: Adam Kisiel kisiel@mps.ohio-state.edu // +// // +//////////////////////////////////////////////////////////////////////////////// + +#ifndef ALIFEMTOEVENTREADERAOD_H +#define ALIFEMTOEVENTREADERAOD_H +#include "AliFemtoEventReader.h" +#include "AliFemtoEnumeration.h" + +#include +#include +#include "TTree.h" +#include "TChain.h" +#include "TBits.h" +#include "AliAODEvent.h" +#include +//#include "AliPWG2AODTrack.h" +#include "AliAODMCParticle.h" + +#include "AliAODpidUtil.h" + +class AliFemtoEvent; +class AliFemtoTrack; + +class AliFemtoEventReaderAOD : public AliFemtoEventReader +{ + public: + AliFemtoEventReaderAOD(); + AliFemtoEventReaderAOD(const AliFemtoEventReaderAOD &aReader); + virtual ~AliFemtoEventReaderAOD(); + + AliFemtoEventReaderAOD& operator=(const AliFemtoEventReaderAOD& aReader); + + virtual AliFemtoEvent* ReturnHbtEvent(); + AliFemtoString Report(); + void SetInputFile(const char* inputFile); + void SetFilterBit(UInt_t ibit); + void SetReadMC(unsigned char a); + void SetCentralityPreSelection(double min, double max); + void SetAODpidUtil(AliAODpidUtil *aAODpidUtil); + + protected: + virtual void CopyAODtoFemtoEvent(AliFemtoEvent *tEvent); + virtual void CopyAODtoFemtoTrack( AliAODTrack *tAodTrack, + AliFemtoTrack *tFemtoTrack + // AliPWG2AODTrack *tPWG2AODTrack + ); + virtual void CopyPIDtoFemtoTrack( AliAODTrack *tAodTrack, + AliFemtoTrack *tFemtoTrack); + + int fNumberofEvent; // number of Events in AOD file + int fCurEvent; // number of current event + AliAODEvent* fEvent; // AOD event + TBits fAllTrue; // Bit set with all true bits + TBits fAllFalse; // Bit set with all false bits + UInt_t fFilterBit; // Bitmap bit for AOD filters + // TClonesArray* fPWG2AODTracks; // Link to PWG2 specific AOD information (if it exists) + + unsigned char fReadMC; // Attempt to read the MC information from the AOD + unsigned char fUsePreCent; // Use centrality pre-selection to speed up analysis + double fCentRange[2]; // Centrality pre-selection range + AliAODpidUtil* fAODpidUtil; + + private: + + AliAODMCParticle* GetParticleWithLabel(TClonesArray *mcP, Int_t aLabel); + + string fInputFile; // name of input file with AOD filenames + string fFileName; // name of current AOD file + TChain* fTree; // AOD tree + TFile* fAodFile; // AOD file + +#ifdef __ROOT__ + ClassDef(AliFemtoEventReaderAOD, 11) +#endif + +}; + +#endif + + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderAODChain.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderAODChain.cxx new file mode 100644 index 00000000000..202d0a2a07b --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderAODChain.cxx @@ -0,0 +1,108 @@ +//////////////////////////////////////////////////////////////////////////////// +// // +// AliFemtoEventReaderAODChain - the reader class for the Alice AOD from Chain// +// Reads in AOD information and converts it into internal AliFemtoEvent // +// Authors: Adam Kisiel kisiel@mps.ohio-state.edu // +// // +//////////////////////////////////////////////////////////////////////////////// + +#include "AliFemtoEventReaderAODChain.h" + +#include "TFile.h" +#include "TTree.h" +#include "AliAODEvent.h" +#include "AliAODTrack.h" +#include "AliAODVertex.h" + +#include "AliFmPhysicalHelixD.h" +#include "AliFmThreeVectorF.h" + +#include "SystemOfUnits.h" + +#include "AliFemtoEvent.h" +#include "AliFemtoModelHiddenInfo.h" + +ClassImp(AliFemtoEventReaderAODChain) + +#if !(ST_NO_NAMESPACES) + using namespace units; +#endif + +using namespace std; +//____________________________ +//constructor with 0 parameters , look at default settings +AliFemtoEventReaderAODChain::AliFemtoEventReaderAODChain(): + AliFemtoEventReaderAOD() +{ + // default constructor +} + +AliFemtoEventReaderAODChain::AliFemtoEventReaderAODChain(const AliFemtoEventReaderAODChain &aReader) : + AliFemtoEventReaderAOD(aReader) +{ + // copy constructor +} +//__________________ +//Destructor +AliFemtoEventReaderAODChain::~AliFemtoEventReaderAODChain() +{ + // destructor +} + +//__________________ +AliFemtoEventReaderAODChain& AliFemtoEventReaderAODChain::operator=(const AliFemtoEventReaderAODChain& aReader) +{ + // assignment operator + if (this == &aReader) + return *this; + + *this = aReader; + + return *this; +} +//__________________ +AliFemtoString AliFemtoEventReaderAODChain::Report() +{ + // create reader report + AliFemtoString temp = "\n This is the AliFemtoEventReaderAODChain\n"; + return temp; +} + +AliFemtoEvent* AliFemtoEventReaderAODChain::ReturnHbtEvent() +{ + // read in a next hbt event from the chain + // convert it to AliFemtoEvent and return + // for further analysis + if (!fEvent) return 0; + + AliFemtoEvent *hbtEvent = 0; + + // Get the PWG2 specific information if it exists +// fPWG2AODTracks = (TClonesArray *) fEvent->GetList()->FindObject("pwg2aodtracks"); + +// if (fPWG2AODTracks) { +// cout << "Found additional PWG2 specific information in the AOD!" << endl; +// cout << "Reading only tracks with the additional information" << endl; +// } + + cout<<"starting to read event "< +#include +#include "TTree.h" +#include "TChain.h" +#include "TBits.h" +#include "AliAODEvent.h" +#include +/* #include "AliPWG2AODTrack.h" */ +#include "AliFemtoEventReaderAOD.h" + +class AliFemtoEvent; +class AliFemtoTrack; + +class AliFemtoEventReaderAODChain : public AliFemtoEventReaderAOD +{ + public: + AliFemtoEventReaderAODChain(); + AliFemtoEventReaderAODChain(const AliFemtoEventReaderAODChain &aReader); + virtual ~AliFemtoEventReaderAODChain(); + + AliFemtoEventReaderAODChain& operator=(const AliFemtoEventReaderAODChain& aReader); + + virtual AliFemtoEvent* ReturnHbtEvent(); + AliFemtoString Report(); + void SetAODSource(AliAODEvent *aAOD); + + protected: + + private: + +#ifdef __ROOT__ + ClassDef(AliFemtoEventReaderAODChain, 1) +#endif + + }; + +#endif + + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESD.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESD.cxx new file mode 100644 index 00000000000..dc82e4b4c53 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESD.cxx @@ -0,0 +1,408 @@ +//////////////////////////////////////////////////////////////////////////////// +/// /// +/// AliFemtoEventReaderESD - the reader class for the Alice ESD /// +/// Reads in ESD information and converts it into internal AliFemtoEvent /// +/// Reads in AliESDfriend to create shared hit/quality information /// +/// Authors: Marek Chojnacki mchojnacki@knf.pw.edu.pl /// +/// Adam Kisiel kisiel@mps.ohio-state.edu /// +/// /// +//////////////////////////////////////////////////////////////////////////////// + +/* + *$Id$ + *$Log$ + *Revision 1.2.2.2 2007/10/04 13:10:52 akisiel + *Add Kink index storageAliFemtoEventReaderESD.cxx AliFemtoTrack.cxx AliFemtoTrack.h + * + *Revision 1.2.2.1 2007/09/30 11:38:59 akisiel + *Adapt the readers to the new AliESDEvent structure + * + *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.5 2007/05/03 09:45:20 akisiel + *Fixing Effective C++ warnings + * + *Revision 1.4 2007/04/27 07:28:34 akisiel + *Remove event number reading due to interface changes + * + *Revision 1.3 2007/04/27 07:25:16 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 + * + */ + +#include "AliFemtoEventReaderESD.h" + +#include "TFile.h" +#include "TTree.h" +#include "AliESDEvent.h" +#include "AliESDtrack.h" +#include "AliESDVertex.h" + +//#include "TSystem.h" + +#include "AliFmPhysicalHelixD.h" +#include "AliFmThreeVectorF.h" + +#include "SystemOfUnits.h" + +#include "AliFemtoEvent.h" +#include "AliFemtoModelHiddenInfo.h" + +ClassImp(AliFemtoEventReaderESD) + +#if !(ST_NO_NAMESPACES) + using namespace units; +#endif + +using namespace std; +//____________________________ +//constructor with 0 parameters , look at default settings +AliFemtoEventReaderESD::AliFemtoEventReaderESD(): + fInputFile(" "), + fFileName(" "), + fConstrained(true), + fReadInner(false), + fNumberofEvent(0), + fCurEvent(0), + fTree(0x0), + fEsdFile(0x0), + fEvent(0x0) +{ + // default constructor +} + +AliFemtoEventReaderESD::AliFemtoEventReaderESD(const AliFemtoEventReaderESD &aReader) : + AliFemtoEventReader(aReader), + fInputFile(" "), + fFileName(" "), + fConstrained(true), + fReadInner(false), + fNumberofEvent(0), + fCurEvent(0), + fTree(0x0), + fEsdFile(0x0), + fEvent(0x0) +{ + // copy constructor + fInputFile = aReader.fInputFile; + fFileName = aReader.fFileName; + fConstrained = aReader.fConstrained; + fReadInner = aReader.fReadInner; + fNumberofEvent = aReader.fNumberofEvent; + fCurEvent = aReader.fCurEvent; + // fTree = aReader.fTree->CloneTree(); + // fEvent = new AliESD(*aReader.fEvent); + fEvent = new AliESDEvent(); + fEsdFile = new TFile(aReader.fEsdFile->GetName()); +} +//__________________ +//Destructor +AliFemtoEventReaderESD::~AliFemtoEventReaderESD() +{ + // destructor + //delete fListOfFiles; + delete fTree; + delete fEvent; + delete fEsdFile; +} + +//__________________ +AliFemtoEventReaderESD& AliFemtoEventReaderESD::operator=(const AliFemtoEventReaderESD& aReader) +{ + // assignment operator + if (this == &aReader) + return *this; + + fInputFile = aReader.fInputFile; + fFileName = aReader.fFileName; + fConstrained = aReader.fConstrained; + fReadInner = aReader.fReadInner; + fNumberofEvent = aReader.fNumberofEvent; + fCurEvent = aReader.fCurEvent; + if (fTree) delete fTree; + // fTree = aReader.fTree->CloneTree(); + if (fEvent) delete fEvent; + fEvent = new AliESDEvent(); + if (fEsdFile) delete fEsdFile; + fEsdFile = new TFile(aReader.fEsdFile->GetName()); + + return *this; +} +//__________________ +AliFemtoString AliFemtoEventReaderESD::Report() +{ + // create reader report + AliFemtoString temp = "\n This is the AliFemtoEventReaderESD\n"; + return temp; +} + +//__________________ +void AliFemtoEventReaderESD::SetInputFile(const char* inputFile) +{ + //setting the name of file where names of ESD file are written + //it takes only this files which have good trees + char buffer[256]; + fInputFile=string(inputFile); + cout<<"Input File set on "<Get("esdTree"); + if (tree!=0x0) + { + cout<<"putting file "<AddFile(buffer); + delete tree; + } + esdFile->Close(); + } + delete esdFile; + } + } +} + +void AliFemtoEventReaderESD::SetConstrained(const bool constrained) +{ + fConstrained=constrained; +} + +bool AliFemtoEventReaderESD::GetConstrained() const +{ + return fConstrained; +} + +void AliFemtoEventReaderESD::SetReadTPCInner(const bool readinner) +{ + fReadInner=readinner; +} + +bool AliFemtoEventReaderESD::GetReadTPCInner() const +{ + return fReadInner; +} + +AliFemtoEvent* AliFemtoEventReaderESD::ReturnHbtEvent() +{ + // read in a next hbt event from the chain + // convert it to AliFemtoEvent and return + // for further analysis + AliFemtoEvent *hbtEvent = 0; + + if (fCurEvent==fNumberofEvent)//open next file + { + if(fNumberofEvent==0) + { + // delete fEvent;//added 1.04.2007 + fEvent=new AliESDEvent(); + // delete fTree; + //fTree=0; + // delete fEsdFile; + + //ESD data + // fEsdFile=TFile::Open(fFileName.c_str(),"READ"); + // fTree = (TTree*) fEsdFile->Get("esdTree"); + // fTree->SetBranchAddress("ESD", &fEvent); + fTree->SetBranchStatus("MuonTracks*",0); + fTree->SetBranchStatus("PmdTracks*",0); + fTree->SetBranchStatus("TrdTracks*",0); + fTree->SetBranchStatus("V0s*",0); + fTree->SetBranchStatus("Cascades*",0); + fTree->SetBranchStatus("Kinks*",0); + fTree->SetBranchStatus("CaloClusters*",0); + fTree->SetBranchStatus("AliRawDataErrorLogs*",0); + fTree->SetBranchStatus("ESDfriend*",0); + fEvent->ReadFromTree(fTree); + + fNumberofEvent=fTree->GetEntries(); + cout<<"Number of Entries in file "<GetEvent(fCurEvent);//getting next event + cout << "Read event " << fEvent << " from file " << fTree << endl; + // vector tLabelTable;//to check labels + + hbtEvent = new AliFemtoEvent; + //setting basic things + // hbtEvent->SetEventNumber(fEvent->GetEventNumber()); + hbtEvent->SetRunNumber(fEvent->GetRunNumber()); + //hbtEvent->SetNumberOfTracks(fEvent->GetNumberOfTracks()); + hbtEvent->SetMagneticField(fEvent->GetMagneticField()*kilogauss);//to check if here is ok + hbtEvent->SetZDCN1Energy(fEvent->GetZDCN1Energy()); + hbtEvent->SetZDCP1Energy(fEvent->GetZDCP1Energy()); + hbtEvent->SetZDCN2Energy(fEvent->GetZDCN2Energy()); + hbtEvent->SetZDCP2Energy(fEvent->GetZDCP2Energy()); + hbtEvent->SetZDCEMEnergy(fEvent->GetZDCEMEnergy()); + hbtEvent->SetZDCParticipants(fEvent->GetZDCParticipants()); + hbtEvent->SetTriggerMask(fEvent->GetTriggerMask()); + hbtEvent->SetTriggerCluster(fEvent->GetTriggerCluster()); + + //Vertex + double fV1[3]; + fEvent->GetVertex()->GetXYZ(fV1); + + AliFmThreeVectorF vertex(fV1[0],fV1[1],fV1[2]); + hbtEvent->SetPrimVertPos(vertex); + + //starting to reading tracks + int nofTracks=0; //number of reconstructed tracks in event + nofTracks=fEvent->GetNumberOfTracks(); + int realnofTracks=0;//number of track which we use ina analysis + cout << "Event has " << nofTracks << " tracks " << endl; + + for (int i=0;iGetTrack(i);//getting next track + // const AliESDfriendTrack *tESDfriendTrack = esdtrack->GetFriendTrack(); + + trackCopy->SetCharge((short)esdtrack->GetSign()); + + //in aliroot we have AliPID + //0-electron 1-muon 2-pion 3-kaon 4-proton 5-photon 6-pi0 7-neutron 8-kaon0 9-eleCon + //we use only 5 first + double esdpid[5]; + esdtrack->GetESDpid(esdpid); + trackCopy->SetPidProbElectron(esdpid[0]); + trackCopy->SetPidProbMuon(esdpid[1]); + trackCopy->SetPidProbPion(esdpid[2]); + trackCopy->SetPidProbKaon(esdpid[3]); + trackCopy->SetPidProbProton(esdpid[4]); + + double pxyz[3]; + if (fReadInner == true) { + + if (esdtrack->GetTPCInnerParam()) { + AliExternalTrackParam *param = new AliExternalTrackParam(*esdtrack->GetTPCInnerParam()); + param->PropagateToDCA(fEvent->GetPrimaryVertex(), (fEvent->GetMagneticField()), 10000); + param->GetPxPyPz(pxyz);//reading noconstarined momentum + delete param; + + AliFemtoModelHiddenInfo *tInfo = new AliFemtoModelHiddenInfo(); + tInfo->SetPDGPid(211); + tInfo->SetTrueMomentum(pxyz[0], pxyz[1], pxyz[2]); + tInfo->SetMass(0.13957); + trackCopy->SetHiddenInfo(tInfo); + } + } + if (fConstrained==true) + tGoodMomentum=esdtrack->GetConstrainedPxPyPz(pxyz); //reading constrained momentum + else + tGoodMomentum=esdtrack->GetPxPyPz(pxyz);//reading noconstarined momentum + AliFemtoThreeVector v(pxyz[0],pxyz[1],pxyz[2]); + trackCopy->SetP(v);//setting momentum + trackCopy->SetPt(sqrt(pxyz[0]*pxyz[0]+pxyz[1]*pxyz[1])); + const AliFmThreeVectorD ktP(pxyz[0],pxyz[1],pxyz[2]); + if (ktP.Mag() == 0) { + delete trackCopy; + continue; + } + const AliFmThreeVectorD origin(fV1[0],fV1[1],fV1[2]); + //setting helix I do not if it is ok + AliFmPhysicalHelixD helix(ktP,origin,(double)(fEvent->GetMagneticField())*kilogauss,(double)(trackCopy->Charge())); + trackCopy->SetHelix(helix); + + trackCopy->SetTrackId(esdtrack->GetID()); + trackCopy->SetFlags(esdtrack->GetStatus()); + trackCopy->SetLabel(esdtrack->GetLabel()); + + //some stuff which could be useful + float impact[2]; + float covimpact[3]; + esdtrack->GetImpactParameters(impact,covimpact); + trackCopy->SetImpactD(impact[0]); + trackCopy->SetImpactZ(impact[1]); + trackCopy->SetCdd(covimpact[0]); + trackCopy->SetCdz(covimpact[1]); + trackCopy->SetCzz(covimpact[2]); + trackCopy->SetITSchi2(esdtrack->GetITSchi2()); + trackCopy->SetITSncls(esdtrack->GetNcls(0)); + trackCopy->SetTPCchi2(esdtrack->GetTPCchi2()); + trackCopy->SetTPCncls(esdtrack->GetTPCNcls()); + trackCopy->SetTPCnclsF(esdtrack->GetTPCNclsF()); + trackCopy->SetTPCsignalN((short)esdtrack->GetTPCsignalN()); //due to bug in aliesdtrack class + trackCopy->SetTPCsignalS(esdtrack->GetTPCsignalSigma()); + + trackCopy->SetTPCClusterMap(esdtrack->GetTPCClusterMap()); + trackCopy->SetTPCSharedMap(esdtrack->GetTPCSharedMap()); + + double pvrt[3]; + fEvent->GetPrimaryVertex()->GetXYZ(pvrt); + + double xtpc[3]; + esdtrack->GetInnerXYZ(xtpc); + xtpc[2] -= pvrt[2]; + trackCopy->SetNominalTPCEntrancePoint(xtpc); + + esdtrack->GetOuterXYZ(xtpc); + xtpc[2] -= pvrt[2]; + trackCopy->SetNominalTPCExitPoint(xtpc); + + int indexes[3]; + for (int ik=0; ik<3; ik++) { + indexes[ik] = esdtrack->GetKinkIndex(ik); + } + trackCopy->SetKinkIndexes(indexes); + //decision if we want this track + //if we using diffrent labels we want that this label was use for first time + //if we use hidden info we want to have match between sim data and ESD + if (tGoodMomentum==true) + { + hbtEvent->TrackCollection()->push_back(trackCopy);//adding track to analysis + realnofTracks++;//real number of tracks + } + else + { + delete trackCopy; + } + + } + + hbtEvent->SetNumberOfTracks(realnofTracks);//setting number of track which we read in event + fCurEvent++; + cout<<"end of reading nt "<Reset(); +// delete fTree; +// fEsdFile->Close(); +// } + return hbtEvent; +} + + + + + + + + + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESD.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESD.h new file mode 100644 index 00000000000..36567aa8e79 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESD.h @@ -0,0 +1,86 @@ +//////////////////////////////////////////////////////////////////////////////// +/// /// +/// AliFemtoEventReaderESD - the reader class for the Alice ESD /// +/// Reads in ESD information and converts it into internal AliFemtoEvent /// +/// Reads in AliESDfriend to create shared hit/quality information /// +/// Authors: Marek Chojnacki mchojnacki@knf.pw.edu.pl /// +/// Adam Kisiel kisiel@mps.ohio-state.edu /// +/// /// +//////////////////////////////////////////////////////////////////////////////// + +/* + *$Id$ + *$Log$ + *Revision 1.1.2.1 2007/09/30 11:38:59 akisiel + *Adapt the readers to the new AliESDEvent structure + * + *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.4 2007/05/03 09:45:20 akisiel + *Fixing Effective C++ warnings + * + *Revision 1.3 2007/04/27 07:25:16 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 + * + */ + + +#ifndef ALIFEMTOEVENTREADERESD_H +#define ALIFEMTOEVENTREADERESD_H +#include "AliFemtoEventReader.h" +#include "AliFemtoEnumeration.h" + +#include +#include +#include "TTree.h" +#include "TChain.h" +#include "AliESDEvent.h" +#include + +class AliFemtoEvent; + +class AliFemtoEventReaderESD : public AliFemtoEventReader +{ + public: + AliFemtoEventReaderESD(); + AliFemtoEventReaderESD(const AliFemtoEventReaderESD &aReader); + virtual ~AliFemtoEventReaderESD(); + + AliFemtoEventReaderESD& operator=(const AliFemtoEventReaderESD& aReader); + + virtual AliFemtoEvent* ReturnHbtEvent(); + AliFemtoString Report(); + //void SetFileName(const char* fileName); + void SetInputFile(const char* inputFile); + void SetConstrained(const bool constrained); + bool GetConstrained() const; + void SetReadTPCInner(const bool readinner); + bool GetReadTPCInner() const; + + protected: + + private: + string fInputFile; // name of input file with ESD filenames + string fFileName; // name of current ESD file + bool fConstrained; // flag to set which momentum from ESD file will be use + bool fReadInner; // flag to set if one wants to read TPC-only momentum + // instead of the global one + int fNumberofEvent; // number of Events in ESD file + int fCurEvent; // number of current event + TChain* fTree; // ESD tree + TFile* fEsdFile; // ESD file + AliESDEvent* fEvent; // ESD event + +#ifdef __ROOT__ + ClassDef(AliFemtoEventReaderESD, 11) +#endif + + }; + +#endif + + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChain.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChain.cxx new file mode 100644 index 00000000000..606d407da34 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChain.cxx @@ -0,0 +1,828 @@ +//////////////////////////////////////////////////////////////////////////////// +/// /// +/// AliFemtoEventReaderESDChain - the reader class for the Alice ESD /// +/// tailored for the Task framework /// +/// Reads in AliESDfriend to create shared hit/quality information /// +/// Authors: Adam Kisiel kisiel@mps.ohio-state.edu /// +/// /// +//////////////////////////////////////////////////////////////////////////////// +#include "AliFemtoEventReaderESDChain.h" + +#include "TFile.h" +#include "TTree.h" +#include "AliESDEvent.h" +#include "AliESDtrack.h" +#include "AliESDVertex.h" +#include "AliMultiplicity.h" +#include "AliCentrality.h" +#include "AliEventplane.h" +#include "AliESDVZERO.h" +#include "AliFmPhysicalHelixD.h" +#include "AliFmThreeVectorF.h" +#include "SystemOfUnits.h" +#include "AliFemtoEvent.h" +#include "AliFemtoModelHiddenInfo.h" +#include "AliPID.h" + +ClassImp(AliFemtoEventReaderESDChain) + +#if !(ST_NO_NAMESPACES) + using namespace units; +#endif + +using namespace std; +//____________________________ +AliFemtoEventReaderESDChain::AliFemtoEventReaderESDChain(): + fFileName(" "), + fConstrained(true), + fReadInner(false), + fUseTPCOnly(false), + fNumberofEvent(0), + fCurEvent(0), + fCurFile(0), + fEvent(0x0), + fUsePhysicsSel(kFALSE), + fSelect(0x0), + fTrackType(kGlobal), + fEstEventMult(kITSTPC), + fEventTrig(AliVEvent::kMB), //trigger + fESDpid(0), + fIsPidOwner(0) +{ + //constructor with 0 parameters , look at default settings + // fClusterPerPadrow = (list **) malloc(sizeof(list *) * AliESDfriendTrack::kMaxTPCcluster); + // for (int tPad=0; tPad(); + // } + // fSharedList = (list **) malloc(sizeof(list *) * AliESDfriendTrack::kMaxTPCcluster); + // for (int tPad=0; tPad(); + // } +} + +//__________________ +AliFemtoEventReaderESDChain::AliFemtoEventReaderESDChain(const AliFemtoEventReaderESDChain& aReader): + AliFemtoEventReader(aReader), + fFileName(" "), + fConstrained(true), + fReadInner(false), + fUseTPCOnly(false), + fNumberofEvent(0), + fCurEvent(0), + fCurFile(0), + fEvent(0x0), + fUsePhysicsSel(kFALSE), + fSelect(0x0), + fTrackType(kGlobal), + fEstEventMult(kITSTPC), + fEventTrig(AliVEvent::kMB), //trigger + fESDpid(0), + fIsPidOwner(0) +{ + // Copy constructor + fConstrained = aReader.fConstrained; + fReadInner = aReader.fReadInner; + fUseTPCOnly = aReader.fUseTPCOnly; + fNumberofEvent = aReader.fNumberofEvent; + fCurEvent = aReader.fCurEvent; + fCurFile = aReader.fCurFile; + // fEvent = new AliESD(*aReader.fEvent); + fEvent = new AliESDEvent(); + fUsePhysicsSel = aReader.fUsePhysicsSel; + if (aReader.fUsePhysicsSel) + fSelect = new AliPhysicsSelection(); + fTrackType = aReader.fTrackType; + fEstEventMult = aReader.fEstEventMult; + fEventTrig = aReader.fEventTrig; //trigger + + // fEventFriend = aReader.fEventFriend; + // fClusterPerPadrow = (list **) malloc(sizeof(list *) * AliESDfriendTrack::kMaxTPCcluster); + // for (int tPad=0; tPad(); + // list::iterator iter; + // for (iter=aReader.fClusterPerPadrow[tPad]->begin(); iter!=aReader.fClusterPerPadrow[tPad]->end(); iter++) { + // fClusterPerPadrow[tPad]->push_back(*iter); + // } + // } + // fSharedList = (list **) malloc(sizeof(list *) * AliESDfriendTrack::kMaxTPCcluster); + // for (int tPad=0; tPad(); + // list::iterator iter; + // for (iter=aReader.fSharedList[tPad]->begin(); iter!=aReader.fSharedList[tPad]->end(); iter++) { + // fSharedList[tPad]->push_back(*iter); + // } + // } +} +//__________________ +AliFemtoEventReaderESDChain::~AliFemtoEventReaderESDChain() +{ + //Destructor + delete fEvent; + + // for (int tPad=0; tPadclear(); + // delete fClusterPerPadrow[tPad]; + // } + // delete [] fClusterPerPadrow; + // for (int tPad=0; tPadclear(); + // delete fSharedList[tPad]; + // } + // delete [] fSharedList; + if (fSelect) delete fSelect; +} + +//__________________ +AliFemtoEventReaderESDChain& AliFemtoEventReaderESDChain::operator=(const AliFemtoEventReaderESDChain& aReader) +{ + // Assignment operator + if (this == &aReader) + return *this; + + fConstrained = aReader.fConstrained; + fReadInner = aReader.fReadInner; + fUseTPCOnly = aReader.fUseTPCOnly; + fNumberofEvent = aReader.fNumberofEvent; + fCurEvent = aReader.fCurEvent; + fCurFile = aReader.fCurFile; + if (fEvent) delete fEvent; + fEvent = new AliESDEvent(); + fTrackType = aReader.fTrackType; + fEstEventMult = aReader.fEstEventMult; + + fUsePhysicsSel = aReader.fUsePhysicsSel; + if (aReader.fUsePhysicsSel) + fSelect = new AliPhysicsSelection(); + // fEventFriend = aReader.fEventFriend; + + // if (fClusterPerPadrow) { + // for (int tPad=0; tPadclear(); + // delete fClusterPerPadrow[tPad]; + // } + // delete [] fClusterPerPadrow; + // } + + // if (fSharedList) { + // for (int tPad=0; tPadclear(); + // delete fSharedList[tPad]; + // } + // delete [] fSharedList; + // } + + // fClusterPerPadrow = (list **) malloc(sizeof(list *) * AliESDfriendTrack::kMaxTPCcluster); + // for (int tPad=0; tPad(); + // list::iterator iter; + // for (iter=aReader.fClusterPerPadrow[tPad]->begin(); iter!=aReader.fClusterPerPadrow[tPad]->end(); iter++) { + // fClusterPerPadrow[tPad]->push_back(*iter); + // } + // } + // fSharedList = (list **) malloc(sizeof(list *) * AliESDfriendTrack::kMaxTPCcluster); + // for (int tPad=0; tPad(); + // list::iterator iter; + // for (iter=aReader.fSharedList[tPad]->begin(); iter!=aReader.fSharedList[tPad]->end(); iter++) { + // fSharedList[tPad]->push_back(*iter); + // } + // } + + return *this; +} +//__________________ +// Simple report +AliFemtoString AliFemtoEventReaderESDChain::Report() +{ + AliFemtoString temp = "\n This is the AliFemtoEventReaderESDChain\n"; + return temp; +} + +//__________________ +void AliFemtoEventReaderESDChain::SetConstrained(const bool constrained) +{ + // Select whether to read constrained or not constrained momentum + fConstrained=constrained; +} +//__________________ +bool AliFemtoEventReaderESDChain::GetConstrained() const +{ + // Check whether we read constrained or not constrained momentum + return fConstrained; +} +//__________________ +void AliFemtoEventReaderESDChain::SetReadTPCInner(const bool readinner) +{ + fReadInner=readinner; +} + +bool AliFemtoEventReaderESDChain::GetReadTPCInner() const +{ + return fReadInner; +} + +//__________________ +void AliFemtoEventReaderESDChain::SetUseTPCOnly(const bool usetpconly) +{ + fUseTPCOnly=usetpconly; +} + +bool AliFemtoEventReaderESDChain::GetUseTPCOnly() const +{ + return fUseTPCOnly; +} + +void AliFemtoEventReaderESDChain::SetUsePhysicsSelection(const bool usephysics) +{ + fUsePhysicsSel = usephysics; + if (!fSelect) fSelect = new AliPhysicsSelection(); +} + +void AliFemtoEventReaderESDChain::SetUseMultiplicity(EstEventMult aType) +{ + fEstEventMult = aType; +} + +AliFemtoEvent* AliFemtoEventReaderESDChain::ReturnHbtEvent() +{ + // Get the event, read all the relevant information + // and fill the AliFemtoEvent class + // Returns a valid AliFemtoEvent + AliFemtoEvent *hbtEvent = 0; + string tFriendFileName; + + // Get the friend information + if (Debug()>1) cout<<"starting to read event "<SetESDfriend(fEventFriend); + if(fEvent->GetAliESDOld())fEvent->CopyFromOldESD(); + + hbtEvent = new AliFemtoEvent; + + if (fUsePhysicsSel) { + hbtEvent->SetIsCollisionCandidate(fSelect->IsCollisionCandidate(fEvent)); + if (!(fSelect->IsCollisionCandidate(fEvent))) + printf("Event not a collision candidate\n"); + } + else + hbtEvent->SetIsCollisionCandidate(kTRUE); + + //setting basic things + // hbtEvent->SetEventNumber(fEvent->GetEventNumber()); + hbtEvent->SetRunNumber(fEvent->GetRunNumber()); + //hbtEvent->SetNumberOfTracks(fEvent->GetNumberOfTracks()); + hbtEvent->SetMagneticField(fEvent->GetMagneticField()*kilogauss);//to check if here is ok + hbtEvent->SetZDCN1Energy(fEvent->GetZDCN1Energy()); + hbtEvent->SetZDCP1Energy(fEvent->GetZDCP1Energy()); + hbtEvent->SetZDCN2Energy(fEvent->GetZDCN2Energy()); + hbtEvent->SetZDCP2Energy(fEvent->GetZDCP2Energy()); + hbtEvent->SetZDCEMEnergy(fEvent->GetZDCEMEnergy()); + hbtEvent->SetZDCParticipants(fEvent->GetZDCParticipants()); + hbtEvent->SetTriggerMask(fEvent->GetTriggerMask()); + // hbtEvent->SetTriggerCluster(fEvent->GetTriggerCluster()); + + if ((fEvent->IsTriggerClassFired("CINT1WU-B-NOPF-ALL")) || + (fEvent->IsTriggerClassFired("CINT1B-ABCE-NOPF-ALL")) || + (fEvent->IsTriggerClassFired("CINT1-B-NOPF-ALLNOTRD")) || + (fEvent->IsTriggerClassFired("CINT1-B-NOPF-FASTNOTRD"))) + hbtEvent->SetTriggerCluster(1); + else if ((fEvent->IsTriggerClassFired("CSH1WU-B-NOPF-ALL")) || + (fEvent->IsTriggerClassFired("CSH1-B-NOPF-ALLNOTRD"))) + hbtEvent->SetTriggerCluster(2); + else + hbtEvent->SetTriggerCluster(0); + + //Vertex + double fV1[3]; + double fVCov[6]; + if (fUseTPCOnly) { + fEvent->GetPrimaryVertexTPC()->GetXYZ(fV1); + fEvent->GetPrimaryVertexTPC()->GetCovMatrix(fVCov); + if (!fEvent->GetPrimaryVertexTPC()->GetStatus()) + fVCov[4] = -1001.0; + } + else { + fEvent->GetPrimaryVertex()->GetXYZ(fV1); + fEvent->GetPrimaryVertex()->GetCovMatrix(fVCov); + if (!fEvent->GetPrimaryVertex()->GetStatus()) + fVCov[4] = -1001.0; + } + + AliFmThreeVectorF vertex(fV1[0],fV1[1],fV1[2]); + hbtEvent->SetPrimVertPos(vertex); + hbtEvent->SetPrimVertCov(fVCov); + + Int_t spdetaonecount = 0; + + for (int iter=0; iterGetMultiplicity()->GetNumberOfTracklets(); iter++) + if (fabs(fEvent->GetMultiplicity()->GetEta(iter)) < 1.0) + spdetaonecount++; + + // hbtEvent->SetSPDMult(fEvent->GetMultiplicity()->GetNumberOfTracklets()); + hbtEvent->SetSPDMult(spdetaonecount); + + //starting to reading tracks + int nofTracks=0; //number of reconstructed tracks in event + nofTracks=fEvent->GetNumberOfTracks(); + int realnofTracks=0;//number of track which we use ina analysis + + // // Clear the shared cluster list + // for (int tPad=0; tPadclear(); + // } + // for (int tPad=0; tPadclear(); + // } + + + // for (int i=0;iGetTrack(i);//getting next track + + // list::iterator tClustIter; + + // Int_t tTrackIndices[AliESDfriendTrack::kMaxTPCcluster]; + // Int_t tNClusters = esdtrack->GetTPCclusters(tTrackIndices); + // for (int tNcl=0; tNcl= 0) { + // tClustIter = find(fClusterPerPadrow[tNcl]->begin(), fClusterPerPadrow[tNcl]->end(), tTrackIndices[tNcl]); + // if (tClustIter == fClusterPerPadrow[tNcl]->end()) { + // fClusterPerPadrow[tNcl]->push_back(tTrackIndices[tNcl]); + // } + // else { + // fSharedList[tNcl]->push_back(tTrackIndices[tNcl]); + // } + // } + // } + + // } + + int tNormMult = 0; + int tNormMultPos = 0; + int tNormMultNeg = 0; + + Float_t tTotalPt = 0.0; + + Float_t b[2]; + Float_t bCov[3]; + + Int_t tTracklet=0, tITSTPC=0, tITSPure=0; + + fEvent->EstimateMultiplicity(tTracklet, tITSTPC, tITSPure, 1.2); + + hbtEvent->SetMultiplicityEstimateITSTPC(tITSTPC); + hbtEvent->SetMultiplicityEstimateTracklets(tTracklet); + // hbtEvent->SetMultiplicityEstimateITSPure(tITSPure); + hbtEvent->SetMultiplicityEstimateITSPure(fEvent->GetMultiplicity()->GetNumberOfITSClusters(1)); + + for (int i=0;iGetTrack(i);//getting next track + // const AliESDfriendTrack *tESDfriendTrack = esdtrack->GetFriendTrack(); + + if ((esdtrack->GetStatus() & AliESDtrack::kTPCrefit) && + (esdtrack->GetStatus() & AliESDtrack::kITSrefit)) { + if (esdtrack->GetTPCNcls() > 70) + if (esdtrack->GetTPCchi2()/esdtrack->GetTPCNcls() < 4.0) { + if (TMath::Abs(esdtrack->Eta()) < 1.2) { + esdtrack->GetImpactParameters(b,bCov); + if ((b[0]<0.2) && (b[1] < 0.25)) { + tNormMult++; + tTotalPt += esdtrack->Pt(); + } + } + } + } + else if (esdtrack->GetStatus() & AliESDtrack::kTPCrefit) { + if (esdtrack->GetTPCNcls() > 100) + if (esdtrack->GetTPCchi2()/esdtrack->GetTPCNcls() < 4.0) { + if (TMath::Abs(esdtrack->Eta()) < 1.2) { + esdtrack->GetImpactParameters(b,bCov); + if ((b[0]<2.4) && (b[1] < 3.2)) { + tNormMult++; + tTotalPt += esdtrack->Pt(); + } + } + } + } + + hbtEvent->SetZDCEMEnergy(tTotalPt); + // if (esdtrack->GetStatus() & AliESDtrack::kTPCrefit) + // if (esdtrack->GetTPCNcls() > 80) + // if (esdtrack->GetTPCchi2()/esdtrack->GetTPCNcls() < 6.0) + // if (esdtrack->GetConstrainedParam()) + // if (fabs(esdtrack->GetConstrainedParam()->Eta()) < 0.5) + // if (esdtrack->GetConstrainedParam()->Pt() < 1.0) { + // if (esdtrack->GetSign() > 0) + // tNormMultPos++; + // else if (esdtrack->GetSign() < 0) + // tNormMultNeg--; + // } + + // If reading ITS-only tracks, reject all with TPC + if (fTrackType == kITSOnly) { + if (esdtrack->GetStatus() & AliESDtrack::kTPCrefit) continue; + if (!(esdtrack->GetStatus() & AliESDtrack::kITSrefit)) continue; + if (esdtrack->GetStatus() & AliESDtrack::kTPCin) continue; + UChar_t iclm = esdtrack->GetITSClusterMap(); + Int_t incls = 0; + for (int iter=0; iter<6; iter++) if (iclm&(1<1) cout << "Rejecting track with " << incls << " clusters" << endl; + continue; + } + } + + AliFemtoTrack* trackCopy = new AliFemtoTrack(); + trackCopy->SetCharge((short)esdtrack->GetSign()); + + //in aliroot we have AliPID + //0-electron 1-muon 2-pion 3-kaon 4-proton 5-photon 6-pi0 7-neutron 8-kaon0 9-eleCon + //we use only 5 first + double esdpid[5]; + // esdtrack->GetESDpid(esdpid); + esdtrack->GetTPCpid(esdpid); + trackCopy->SetPidProbElectron(esdpid[0]); + trackCopy->SetPidProbMuon(esdpid[1]); + trackCopy->SetPidProbPion(esdpid[2]); + trackCopy->SetPidProbKaon(esdpid[3]); + trackCopy->SetPidProbProton(esdpid[4]); + + esdpid[0] = -100000.0; + esdpid[1] = -100000.0; + esdpid[2] = -100000.0; + esdpid[3] = -100000.0; + esdpid[4] = -100000.0; + + double tTOF = 0.0; + + if (esdtrack->GetStatus()&AliESDtrack::kTOFpid) { + tTOF = esdtrack->GetTOFsignal(); + esdtrack->GetIntegratedTimes(esdpid); + } + + trackCopy->SetTofExpectedTimes(tTOF-esdpid[2], tTOF-esdpid[3], tTOF-esdpid[4]); + + ////// TPC //////////////////////////////////////////// + + float nsigmaTPCK=-1000.; + float nsigmaTPCPi=-1000.; + float nsigmaTPCP=-1000.; + + + if ((fESDpid) && (esdtrack->IsOn(AliESDtrack::kTPCpid))){ + nsigmaTPCK = fESDpid->NumberOfSigmasTPC(esdtrack,AliPID::kKaon); + nsigmaTPCPi = fESDpid->NumberOfSigmasTPC(esdtrack,AliPID::kPion); + nsigmaTPCP = fESDpid->NumberOfSigmasTPC(esdtrack,AliPID::kProton); + + } + trackCopy->SetNSigmaTPCPi(nsigmaTPCPi); + trackCopy->SetNSigmaTPCK(nsigmaTPCK); + trackCopy->SetNSigmaTPCP(nsigmaTPCP); + + ///// TOF /////////////////////////////////////////////// + + float vp=-1000.; + float nsigmaTOFPi=-1000.; + float nsigmaTOFK=-1000.; + float nsigmaTOFP=-1000.; + + if ((esdtrack->GetStatus()&AliESDtrack::kTOFpid) && + (esdtrack->GetStatus()&AliESDtrack::kTOFout) && + (esdtrack->GetStatus()&AliESDtrack::kTIME) && + !(esdtrack->GetStatus()&AliESDtrack::kTOFmismatch)) + { + + //if ((esdtrack->GetStatus()&AliESDtrack::kTOFpid) && + //(esdtrack->GetStatus()&AliESDtrack::kTOFout) && + //(esdtrack->GetStatus()&AliESDtrack::kTIME)){ + // collect info from ESDpid class + + if ((fESDpid) && (esdtrack->IsOn(AliESDtrack::kTOFpid))) { + + + double tZero = fESDpid->GetTOFResponse().GetStartTime(esdtrack->P()); + + nsigmaTOFPi = fESDpid->NumberOfSigmasTOF(esdtrack,AliPID::kPion,tZero); + nsigmaTOFK = fESDpid->NumberOfSigmasTOF(esdtrack,AliPID::kKaon,tZero); + nsigmaTOFP = fESDpid->NumberOfSigmasTOF(esdtrack,AliPID::kProton,tZero); + + Double_t len=esdtrack->GetIntegratedLength(); + Double_t tof=esdtrack->GetTOFsignal(); + if(tof > 0.) vp=len/tof/0.03; + } + } + + trackCopy->SetVTOF(vp); + trackCopy->SetNSigmaTOFPi(nsigmaTOFPi); + trackCopy->SetNSigmaTOFK(nsigmaTOFK); + trackCopy->SetNSigmaTOFP(nsigmaTOFP); + + double pxyz[3]; + double rxyz[3]; + double impact[2]; + double covimpact[3]; + + if (fUseTPCOnly) { + if (!esdtrack->GetTPCInnerParam()) { + delete trackCopy; + continue; + } + + + AliExternalTrackParam *param = new AliExternalTrackParam(*esdtrack->GetTPCInnerParam()); + param->GetXYZ(rxyz); + param->PropagateToDCA(fEvent->GetPrimaryVertexTPC(), (fEvent->GetMagneticField()), 10000, impact, covimpact); + param->GetPxPyPz(pxyz);//reading noconstarined momentum + + if (fReadInner == true) { + AliFemtoModelHiddenInfo *tInfo = new AliFemtoModelHiddenInfo(); + tInfo->SetPDGPid(211); + tInfo->SetTrueMomentum(pxyz[0], pxyz[1], pxyz[2]); + tInfo->SetMass(0.13957); + // tInfo->SetEmissionPoint(rxyz[0], rxyz[1], rxyz[2], 0.0); + // tInfo->SetEmissionPoint(fV1[0], fV1[1], fV1[2], 0.0); + tInfo->SetEmissionPoint(rxyz[0]-fV1[0], rxyz[1]-fV1[1], rxyz[2]-fV1[2], 0.0); + trackCopy->SetHiddenInfo(tInfo); + } + + AliFemtoThreeVector v(pxyz[0],pxyz[1],pxyz[2]); + if (v.Mag() < 0.0001) { + // cout << "Found 0 momentum ???? " <SetP(v);//setting momentum + trackCopy->SetPt(sqrt(pxyz[0]*pxyz[0]+pxyz[1]*pxyz[1])); + + const AliFmThreeVectorD kP(pxyz[0],pxyz[1],pxyz[2]); + const AliFmThreeVectorD kOrigin(fV1[0],fV1[1],fV1[2]); + //setting helix I do not if it is ok + AliFmPhysicalHelixD helix(kP,kOrigin,(double)(fEvent->GetMagneticField())*kilogauss,(double)(trackCopy->Charge())); + trackCopy->SetHelix(helix); + + //some stuff which could be useful + trackCopy->SetImpactD(impact[0]); + trackCopy->SetImpactZ(impact[1]); + trackCopy->SetCdd(covimpact[0]); + trackCopy->SetCdz(covimpact[1]); + trackCopy->SetCzz(covimpact[2]); + trackCopy->SetSigmaToVertex(GetSigmaToVertex(impact, covimpact)); + + delete param; + } + else { + if (fReadInner == true) { + + if (esdtrack->GetTPCInnerParam()) { + AliExternalTrackParam *param = new AliExternalTrackParam(*esdtrack->GetTPCInnerParam()); + param->GetXYZ(rxyz); + // param->PropagateToDCA(fEvent->GetPrimaryVertex(), (fEvent->GetMagneticField()), 10000); + param->GetPxPyPz(pxyz);//reading noconstarined momentum + delete param; + + AliFemtoModelHiddenInfo *tInfo = new AliFemtoModelHiddenInfo(); + tInfo->SetPDGPid(211); + tInfo->SetTrueMomentum(pxyz[0], pxyz[1], pxyz[2]); + tInfo->SetMass(0.13957); + // tInfo->SetEmissionPoint(rxyz[0], rxyz[1], rxyz[2], 0.0); + //tInfo->SetEmissionPoint(fV1[0], fV1[1], fV1[2], 0.0); + tInfo->SetEmissionPoint(rxyz[0]-fV1[0], rxyz[1]-fV1[1], rxyz[2]-fV1[2], 0.0); + trackCopy->SetHiddenInfo(tInfo); + } + } + + if (fTrackType == kGlobal) { + if (fConstrained==true) + tGoodMomentum=esdtrack->GetConstrainedPxPyPz(pxyz); //reading constrained momentum + else + tGoodMomentum=esdtrack->GetPxPyPz(pxyz);//reading noconstarined momentum + } + else if (fTrackType == kTPCOnly) { + if (esdtrack->GetTPCInnerParam()) + esdtrack->GetTPCInnerParam()->GetPxPyPz(pxyz); + else { + delete trackCopy; + continue; + } + } + else if (fTrackType == kITSOnly) { + if (fConstrained==true) + tGoodMomentum=esdtrack->GetConstrainedPxPyPz(pxyz); //reading constrained momentum + else + tGoodMomentum=esdtrack->GetPxPyPz(pxyz);//reading noconstarined momentum + } + + + AliFemtoThreeVector v(pxyz[0],pxyz[1],pxyz[2]); + if (v.Mag() < 0.0001) { + // cout << "Found 0 momentum ???? " <SetP(v);//setting momentum + trackCopy->SetPt(sqrt(pxyz[0]*pxyz[0]+pxyz[1]*pxyz[1])); + const AliFmThreeVectorD kP(pxyz[0],pxyz[1],pxyz[2]); + const AliFmThreeVectorD kOrigin(fV1[0],fV1[1],fV1[2]); + //setting helix I do not if it is ok + AliFmPhysicalHelixD helix(kP,kOrigin,(double)(fEvent->GetMagneticField())*kilogauss,(double)(trackCopy->Charge())); + trackCopy->SetHelix(helix); + + //some stuff which could be useful + float imp[2]; + float cim[3]; + // if (fTrackType == kTPCOnly) { + // esdtrack->GetTPCInnerParam()->GetImpactParameters(imp,cim); + // } + // else { + esdtrack->GetImpactParameters(imp,cim); + // } + + impact[0] = imp[0]; + impact[1] = imp[1]; + covimpact[0] = cim[0]; + covimpact[1] = cim[1]; + covimpact[2] = cim[2]; + + trackCopy->SetImpactD(impact[0]); + trackCopy->SetImpactZ(impact[1]); + trackCopy->SetCdd(covimpact[0]); + trackCopy->SetCdz(covimpact[1]); + trackCopy->SetCzz(covimpact[2]); + trackCopy->SetSigmaToVertex(GetSigmaToVertex(impact,covimpact)); + } + + trackCopy->SetTrackId(esdtrack->GetID()); + trackCopy->SetFlags(esdtrack->GetStatus()); + trackCopy->SetLabel(esdtrack->GetLabel()); + + trackCopy->SetITSchi2(esdtrack->GetITSchi2()); + if (esdtrack->GetITSFakeFlag()) + trackCopy->SetITSncls(-esdtrack->GetNcls(0)); + else + trackCopy->SetITSncls(esdtrack->GetNcls(0)); + trackCopy->SetTPCchi2(esdtrack->GetTPCchi2()); + trackCopy->SetTPCncls(esdtrack->GetTPCNcls()); + trackCopy->SetTPCnclsF(esdtrack->GetTPCNclsF()); + trackCopy->SetTPCsignal(esdtrack->GetTPCsignal()); + trackCopy->SetTPCsignalN((short)esdtrack->GetTPCsignalN()); //due to bug in aliesdtrack class + trackCopy->SetTPCsignalS(esdtrack->GetTPCsignalSigma()); + + trackCopy->SetTPCClusterMap(esdtrack->GetTPCClusterMap()); + trackCopy->SetTPCSharedMap(esdtrack->GetTPCSharedMap()); + + double xtpc[3]; + esdtrack->GetInnerXYZ(xtpc); + xtpc[2] -= fV1[2]; + trackCopy->SetNominalTPCEntrancePoint(xtpc); + + esdtrack->GetOuterXYZ(xtpc); + xtpc[2] -= fV1[2]; + trackCopy->SetNominalTPCExitPoint(xtpc); + + int indexes[3]; + for (int ik=0; ik<3; ik++) { + indexes[ik] = esdtrack->GetKinkIndex(ik); + } + trackCopy->SetKinkIndexes(indexes); + //decision if we want this track + //if we using diffrent labels we want that this label was use for first time + //if we use hidden info we want to have match between sim data and ESD + if (tGoodMomentum==true) + { + hbtEvent->TrackCollection()->push_back(trackCopy);//adding track to analysis + realnofTracks++;//real number of tracks + // delete trackCopy; + } + else + { + delete trackCopy; + } + + } + + hbtEvent->SetNumberOfTracks(realnofTracks);//setting number of track which we read in event + + AliCentrality *cent = fEvent->GetCentrality(); + if (cent) { + hbtEvent->SetCentralityV0(cent->GetCentralityPercentile("V0M")); + // hbtEvent->SetCentralityFMD(cent->GetCentralityPercentile("FMD")); + hbtEvent->SetCentralitySPD1(cent->GetCentralityPercentile("CL1")); + // hbtEvent->SetCentralityTrk(cent->GetCentralityPercentile("TRK")); + + if (Debug()>1) printf(" FemtoReader Got Event with %f %f %f %f\n", cent->GetCentralityPercentile("V0M"), 0.0, cent->GetCentralityPercentile("CL1"), 0.0); + } + + if (fEstEventMult == kGlobalCount) + hbtEvent->SetNormalizedMult(tNormMult); + else if (fEstEventMult == kTracklet) + hbtEvent->SetNormalizedMult(tTracklet); + else if (fEstEventMult == kITSTPC) + hbtEvent->SetNormalizedMult(tITSTPC); + else if (fEstEventMult == kITSPure) + hbtEvent->SetNormalizedMult(tITSPure); + else if (fEstEventMult == kSPDLayer1) + hbtEvent->SetNormalizedMult(fEvent->GetMultiplicity()->GetNumberOfITSClusters(1)); + else if (fEstEventMult == kV0Centrality) { + // centrality between 0 (central) and 1 (very peripheral) + + if (cent) { + if (cent->GetCentralityPercentile("V0M") < 0.00001) + hbtEvent->SetNormalizedMult(-1); + else + hbtEvent->SetNormalizedMult(lrint(10.0*cent->GetCentralityPercentile("V0M"))); + if (Debug()>1) printf ("Set Centrality %i %f %li\n", hbtEvent->UncorrectedNumberOfPrimaries(), + 10.0*cent->GetCentralityPercentile("V0M"), lrint(10.0*cent->GetCentralityPercentile("V0M"))); + } + } + + if (tNormMultPos > tNormMultNeg) + hbtEvent->SetZDCParticipants(tNormMultPos); + else + hbtEvent->SetZDCParticipants(tNormMultNeg); + + AliEventplane* ep = fEvent->GetEventplane(); + if (ep) { + hbtEvent->SetEP(ep); + hbtEvent->SetReactionPlaneAngle(ep->GetEventplane("Q")); + } + + fCurEvent++; + if (Debug()>1) cout<<"end of reading nt "< Erf(d/Sqrt(2)) for a 1-dim gauss (d = n_sigma) + // -> 1 - Exp(-d**2) for a 2-dim gauss (d*d = dx*dx + dy*dy != n_sigma) + // + // It means that for a 2-dim gauss: n_sigma(d) = Sqrt(2)*ErfInv(1 - Exp((-x**2)/2) + // Can this be expressed in a different way? + + if (bRes[0] == 0 || bRes[1] ==0) + return -1; + + Float_t d = TMath::Sqrt(TMath::Power(b[0]/bRes[0],2) + TMath::Power(b[1]/bRes[1],2)); + + // stupid rounding problem screws up everything: + // if d is too big, TMath::Exp(...) gets 0, and TMath::ErfInverse(1) that should be infinite, gets 0 :( + if (TMath::Exp(-d * d / 2) < 1e-10) + return 1000; + + d = TMath::ErfInverse(1 - TMath::Exp(-d * d / 2)) * TMath::Sqrt(2); + return d; +} + +void AliFemtoEventReaderESDChain::SetReadTrackType(ReadTrackType aType) +{ + fTrackType = aType; +} + +//trigger +void AliFemtoEventReaderESDChain::SetEventTrigger(UInt_t eventtrig) +{ + fEventTrig = eventtrig; +} + + + + + + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChain.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChain.h new file mode 100644 index 00000000000..fb3b3a162f0 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChain.h @@ -0,0 +1,99 @@ +//////////////////////////////////////////////////////////////////////////////// +// // +// AliFemtoEventReaderESDChain - the reader class for the Alice ESD // +// tailored for the Task framework // +// Reads in AliESDfriend to create shared hit/quality information // +// Authors: Adam Kisiel kisiel@mps.ohio-state.edu // +// // +//////////////////////////////////////////////////////////////////////////////// +#ifndef ALIFEMTOEVENTREADERESDCHAIN_H +#define ALIFEMTOEVENTREADERESDCHAIN_H + +#include "AliFemtoEventReader.h" +#include "AliFemtoEnumeration.h" + +#include +#include +#include "TTree.h" +#include "TGraph.h" +#include "AliESDEvent.h" +#include "AliESDfriend.h" +#include "AliPhysicsSelection.h" +#include + +#include "AliESDpid.h" + +class AliFemtoEvent; + +class AliFemtoEventReaderESDChain : public AliFemtoEventReader +{ + public: + enum TrackType {kGlobal=0, kTPCOnly=1, kITSOnly=2, kSPDTracklet=3}; + typedef enum TrackType ReadTrackType; + + enum EventMult {kTracklet=0, kITSTPC=1, kITSPure=2, kGlobalCount=3, kSPDLayer1=4, kV0Centrality=5 }; + typedef enum EventMult EstEventMult; + + AliFemtoEventReaderESDChain(); + AliFemtoEventReaderESDChain(const AliFemtoEventReaderESDChain& aReader); + ~AliFemtoEventReaderESDChain(); + + AliFemtoEventReaderESDChain& operator=(const AliFemtoEventReaderESDChain& aReader); + + AliFemtoEvent* ReturnHbtEvent(); + AliFemtoString Report(); + void SetConstrained(const bool constrained); + void SetReadTPCInner(const bool readinner); + void SetUseTPCOnly(const bool usetpconly); + + void SetUsePhysicsSelection(const bool usephysics); + void SetUseMultiplicity(EstEventMult aType); + void SetEventTrigger(UInt_t eventtrig); //trigger + + bool GetConstrained() const; + bool GetReadTPCInner() const; + bool GetUseTPCOnly() const; + + void SetReadTrackType(ReadTrackType aType); + + void SetESDSource(AliESDEvent *aESD); + // void SetESDfriendSource(AliESDfriend *aFriend); + void SetESDPid(AliESDpid *esdPid) { fESDpid = esdPid; } + protected: + + private: + string fFileName; //name of current ESD file + bool fConstrained; //flag to set which momentum from ESD file will be use + bool fReadInner; // flag to set if one wants to read TPC-only momentum + // and store it in the hidden info + bool fUseTPCOnly; // flag to set if one wants to replace the global parameters + // by the TPC only ones + int fNumberofEvent; //number of Events in ESD file + int fCurEvent; //number of current event + unsigned int fCurFile; //number of current file + AliESDEvent* fEvent; //ESD event + // AliESDfriend* fEventFriend; + bool fUsePhysicsSel; //if true the physics selection class will be used + AliPhysicsSelection *fSelect; //Class to select only physics events + ReadTrackType fTrackType; // Type of track read + EstEventMult fEstEventMult; // Type of the event multiplicity estimator + UInt_t fEventTrig; //event trigger + +/* list **fSharedList; //! Table (one list per padrow) of clusters which are shared */ +/* list **fClusterPerPadrow; //! Table (one list per padrow) of clusters in each padrow */ + + Float_t GetSigmaToVertex(double *impact, double *covar); + + + AliESDpid *fESDpid; + Bool_t fIsPidOwner; + +#ifdef __ROOT__ + ClassDef(AliFemtoEventReaderESDChain, 1) +#endif + + }; + +#endif + + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChainKine.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChainKine.cxx new file mode 100644 index 00000000000..a49f97db5d1 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChainKine.cxx @@ -0,0 +1,890 @@ +//////////////////////////////////////////////////////////////////////////////// +// // +// AliFemtoEventReaderESDChainKine - the reader class for the Alice ESD and // +// the model Kinematics information tailored for the Task framework and the // +// Reads in AliESDfriend to create shared hit/quality information // +// Authors: Adam Kisiel kisiel@mps.ohio-state.edu // +// // +//////////////////////////////////////////////////////////////////////////////// +#include "AliFemtoEventReaderESDChainKine.h" + +#include "TFile.h" +#include "TTree.h" +#include "TList.h" +#include "AliESDEvent.h" +#include "AliESDtrack.h" +#include "AliESDVertex.h" + +#include "AliMultiplicity.h" +#include "AliCentrality.h" +#include "AliEventplane.h" + +#include "AliFmPhysicalHelixD.h" +#include "AliFmThreeVectorF.h" + +#include "SystemOfUnits.h" + +#include "AliFemtoEvent.h" + +#include "TParticle.h" +#include "AliFemtoModelHiddenInfo.h" +#include "AliFemtoModelGlobalHiddenInfo.h" +#include "AliGenHijingEventHeader.h" +#include "AliGenCocktailEventHeader.h" + +#include "AliVertexerTracks.h" + +#include "AliPID.h" + +ClassImp(AliFemtoEventReaderESDChainKine) + +#if !(ST_NO_NAMESPACES) + using namespace units; +#endif + +using namespace std; +//____________________________ +AliFemtoEventReaderESDChainKine::AliFemtoEventReaderESDChainKine(): + fFileName(" "), + fConstrained(true), + fReadInner(false), + fUseTPCOnly(false), + fNumberofEvent(0), + fCurEvent(0), + fCurFile(0), + fEvent(0x0), + fStack(0x0), + fGenHeader(0x0), + fTrackType(kGlobal), + fEstEventMult(kV0Centrality), + fRotateToEventPlane(0), + fESDpid(0), + fIsPidOwner(0) + +{ + //constructor with 0 parameters , look at default settings +} + +//__________________ +AliFemtoEventReaderESDChainKine::AliFemtoEventReaderESDChainKine(const AliFemtoEventReaderESDChainKine& aReader): + AliFemtoEventReader(aReader), + fFileName(" "), + fConstrained(true), + fReadInner(false), + fUseTPCOnly(false), + fNumberofEvent(0), + fCurEvent(0), + fCurFile(0), + fEvent(0x0), + fStack(0x0), + fGenHeader(0x0), + fTrackType(kGlobal), + fEstEventMult(kV0Centrality), + fRotateToEventPlane(0), + fESDpid(0), + fIsPidOwner(0) +{ + // Copy constructor + fConstrained = aReader.fConstrained; + fReadInner = aReader.fReadInner; + fUseTPCOnly = aReader.fUseTPCOnly; + fNumberofEvent = aReader.fNumberofEvent; + fCurEvent = aReader.fCurEvent; + fCurFile = aReader.fCurFile; + fEvent = new AliESDEvent(); + fStack = aReader.fStack; + fTrackType = aReader.fTrackType; + fEstEventMult = aReader.fEstEventMult; + fRotateToEventPlane = aReader.fRotateToEventPlane; + fESDpid = aReader.fESDpid; + fIsPidOwner = aReader.fIsPidOwner; +} +//__________________ +AliFemtoEventReaderESDChainKine::~AliFemtoEventReaderESDChainKine() +{ + //Destructor + delete fEvent; +} + +//__________________ +AliFemtoEventReaderESDChainKine& AliFemtoEventReaderESDChainKine::operator=(const AliFemtoEventReaderESDChainKine& aReader) +{ + // Assignment operator + if (this == &aReader) + return *this; + + fConstrained = aReader.fConstrained; + fUseTPCOnly = aReader.fUseTPCOnly; + fNumberofEvent = aReader.fNumberofEvent; + fCurEvent = aReader.fCurEvent; + fCurFile = aReader.fCurFile; + if (fEvent) delete fEvent; + fEvent = new AliESDEvent(); + fStack = aReader.fStack; + fGenHeader = aReader.fGenHeader; + fRotateToEventPlane = aReader.fRotateToEventPlane; + fESDpid = aReader.fESDpid; + fIsPidOwner = aReader.fIsPidOwner; + + return *this; +} +//__________________ +// Simple report +AliFemtoString AliFemtoEventReaderESDChainKine::Report() +{ + AliFemtoString temp = "\n This is the AliFemtoEventReaderESDChainKine\n"; + return temp; +} + +//__________________ +void AliFemtoEventReaderESDChainKine::SetConstrained(const bool constrained) +{ + // Select whether to read constrained or not constrained momentum + fConstrained=constrained; +} +//__________________ +bool AliFemtoEventReaderESDChainKine::GetConstrained() const +{ + // Check whether we read constrained or not constrained momentum + return fConstrained; +} +//__________________ +void AliFemtoEventReaderESDChainKine::SetReadTPCInner(const bool readinner) +{ + fReadInner=readinner; +} + +bool AliFemtoEventReaderESDChainKine::GetReadTPCInner() const +{ + return fReadInner; +} + +//__________________ +void AliFemtoEventReaderESDChainKine::SetUseTPCOnly(const bool usetpconly) +{ + fUseTPCOnly=usetpconly; +} + +bool AliFemtoEventReaderESDChainKine::GetUseTPCOnly() const +{ + return fUseTPCOnly; +} +void AliFemtoEventReaderESDChainKine::SetUseMultiplicity(EstEventMult aType) +{ + fEstEventMult = aType; +} +//__________________ +AliFemtoEvent* AliFemtoEventReaderESDChainKine::ReturnHbtEvent() +{ + // Get the event, read all the relevant information + // and fill the AliFemtoEvent class + // Returns a valid AliFemtoEvent + AliFemtoEvent *hbtEvent = 0; + string tFriendFileName; + + // Get the friend information + cout << "AliFemtoEventReaderESDChainKine::Starting to read event: "<SetESDfriend(fEventFriend); + + hbtEvent = new AliFemtoEvent; + //setting basic things + // hbtEvent->SetEventNumber(fEvent->GetEventNumber()); + hbtEvent->SetRunNumber(fEvent->GetRunNumber()); + //hbtEvent->SetNumberOfTracks(fEvent->GetNumberOfTracks()); + hbtEvent->SetMagneticField(fEvent->GetMagneticField()*kilogauss);//to check if here is ok + hbtEvent->SetZDCN1Energy(fEvent->GetZDCN1Energy()); + hbtEvent->SetZDCP1Energy(fEvent->GetZDCP1Energy()); + hbtEvent->SetZDCN2Energy(fEvent->GetZDCN2Energy()); + hbtEvent->SetZDCP2Energy(fEvent->GetZDCP2Energy()); + hbtEvent->SetZDCEMEnergy(fEvent->GetZDCEMEnergy()); + hbtEvent->SetZDCParticipants(fEvent->GetZDCParticipants()); + hbtEvent->SetTriggerMask(fEvent->GetTriggerMask()); + //hbtEvent->SetTriggerCluster(fEvent->GetTriggerCluster()); + + if ((fEvent->IsTriggerClassFired("CINT1WU-B-NOPF-ALL")) || + (fEvent->IsTriggerClassFired("CINT1B-ABCE-NOPF-ALL")) || + (fEvent->IsTriggerClassFired("CINT1-B-NOPF-ALLNOTRD")) || + (fEvent->IsTriggerClassFired("CINT1-B-NOPF-FASTNOTRD"))) + hbtEvent->SetTriggerCluster(1); + else if ((fEvent->IsTriggerClassFired("CSH1WU-B-NOPF-ALL")) || + (fEvent->IsTriggerClassFired("CSH1-B-NOPF-ALLNOTRD"))) + hbtEvent->SetTriggerCluster(2); + else + hbtEvent->SetTriggerCluster(0); + + //Vertex + double fV1[3]; + double fVCov[6]; + if (fUseTPCOnly) { + fEvent->GetPrimaryVertexTPC()->GetXYZ(fV1); + fEvent->GetPrimaryVertexTPC()->GetCovMatrix(fVCov); + if (!fEvent->GetPrimaryVertexTPC()->GetStatus()) + fVCov[4] = -1001.0; + } + else { + fEvent->GetPrimaryVertex()->GetXYZ(fV1); + fEvent->GetPrimaryVertex()->GetCovMatrix(fVCov); + if (!fEvent->GetPrimaryVertex()->GetStatus()) + fVCov[4] = -1001.0; + } + + AliFmThreeVectorF vertex(fV1[0],fV1[1],fV1[2]); + hbtEvent->SetPrimVertPos(vertex); + hbtEvent->SetPrimVertCov(fVCov); + + Double_t tReactionPlane = 0; + + AliGenHijingEventHeader *hdh = dynamic_cast (fGenHeader); + if (!hdh) { + AliGenCocktailEventHeader *cdh = dynamic_cast (fGenHeader); + if (cdh) { + TList *tGenHeaders = cdh->GetHeaders(); + for (int ihead = 0; iheadGetEntries(); ihead++) { + hdh = dynamic_cast (fGenHeader); + if (hdh) break; + } + } + } + + if (hdh) + { + tReactionPlane = hdh->ReactionPlaneAngle(); + cout << "Got reaction plane " << tReactionPlane << endl; + } + + hbtEvent->SetReactionPlaneAngle(tReactionPlane); + + Int_t spdetaonecount = 0; + + for (int iter=0; iterGetMultiplicity()->GetNumberOfTracklets(); iter++) + if (fabs(fEvent->GetMultiplicity()->GetEta(iter)) < 1.0) + spdetaonecount++; + + // hbtEvent->SetSPDMult(fEvent->GetMultiplicity()->GetNumberOfTracklets()); + hbtEvent->SetSPDMult(spdetaonecount); + + //starting to reading tracks + int nofTracks=0; //number of reconstructed tracks in event + nofTracks=fEvent->GetNumberOfTracks(); + int realnofTracks=0;//number of track which we use ina analysis + + int tNormMult = 0; + int tNormMultPos = 0; + int tNormMultNeg = 0; + + Float_t tTotalPt = 0.0; + + Float_t b[2]; + Float_t bCov[3]; + + Int_t tTracklet=0, tITSTPC=0, tITSPure=0; + + fEvent->EstimateMultiplicity(tTracklet, tITSTPC, tITSPure, 1.2); + + hbtEvent->SetMultiplicityEstimateITSTPC(tITSTPC); + hbtEvent->SetMultiplicityEstimateTracklets(tTracklet); + // hbtEvent->SetMultiplicityEstimateITSPure(tITSPure); + hbtEvent->SetMultiplicityEstimateITSPure(fEvent->GetMultiplicity()->GetNumberOfITSClusters(1)); + + Int_t *motherids; + if (fStack) { + motherids = new Int_t[fStack->GetNtrack()]; + for (int ip=0; ipGetNtrack(); ip++) motherids[ip] = 0; + + // Read in mother ids + TParticle *motherpart; + for (int ip=0; ipGetNtrack(); ip++) { + motherpart = fStack->Particle(ip); + if (motherpart->GetDaughter(0) > 0) + motherids[motherpart->GetDaughter(0)] = ip; + if (motherpart->GetDaughter(1) > 0) + motherids[motherpart->GetDaughter(1)] = ip; + +// if (motherpart->GetPdgCode() == 211) { +// cout << "Mother " << ip << " has daughters " +// << motherpart->GetDaughter(0) << " " +// << motherpart->GetDaughter(1) << " " +// << motherpart->Vx() << " " +// << motherpart->Vy() << " " +// << motherpart->Vz() << " " +// << endl; + +// } + } + } + else { + printf ("No Stack ???\n"); + delete hbtEvent; + return 0; + } + + for (int i=0;iGetTrack(i);//getting next track + // const AliESDfriendTrack *tESDfriendTrack = esdtrack->GetFriendTrack(); + + + if ((esdtrack->GetStatus() & AliESDtrack::kTPCrefit) && + (esdtrack->GetStatus() & AliESDtrack::kITSrefit)) { + if (esdtrack->GetTPCNcls() > 70) + if (esdtrack->GetTPCchi2()/esdtrack->GetTPCNcls() < 4.0) { + if (TMath::Abs(esdtrack->Eta()) < 1.2) { + esdtrack->GetImpactParameters(b,bCov); + if ((b[0]<0.2) && (b[1] < 0.25)) { + tNormMult++; + tTotalPt += esdtrack->Pt(); + } + } + } + } + else if (esdtrack->GetStatus() & AliESDtrack::kTPCrefit) { + if (esdtrack->GetTPCNcls() > 100) + if (esdtrack->GetTPCchi2()/esdtrack->GetTPCNcls() < 4.0) { + if (TMath::Abs(esdtrack->Eta()) < 1.2) { + esdtrack->GetImpactParameters(b,bCov); + if ((b[0]<2.4) && (b[1] < 3.2)) { + tNormMult++; + tTotalPt += esdtrack->Pt(); + } + } + } + } + + hbtEvent->SetZDCEMEnergy(tTotalPt); + // if (esdtrack->GetStatus() & AliESDtrack::kTPCrefit) + // if (esdtrack->GetTPCNcls() > 80) + // if (esdtrack->GetTPCchi2()/esdtrack->GetTPCNcls() < 6.0) + // if (esdtrack->GetConstrainedParam()) + // if (fabs(esdtrack->GetConstrainedParam()->Eta()) < 0.5) + // if (esdtrack->GetConstrainedParam()->Pt() < 1.0) { + // if (esdtrack->GetSign() > 0) + // tNormMultPos++; + // else if (esdtrack->GetSign() < 0) + // tNormMultNeg--; + // } + + // If reading ITS-only tracks, reject all with TPC + if (fTrackType == kITSOnly) { + if (esdtrack->GetStatus() & AliESDtrack::kTPCrefit) continue; + if (!(esdtrack->GetStatus() & AliESDtrack::kITSrefit)) continue; + if (esdtrack->GetStatus() & AliESDtrack::kTPCin) continue; + UChar_t iclm = esdtrack->GetITSClusterMap(); + Int_t incls = 0; + for (int iter=0; iter<6; iter++) if (iclm&(1<1) cout << "Rejecting track with " << incls << " clusters" << endl; + continue; + } + } + + + + AliFemtoTrack* trackCopy = new AliFemtoTrack(); + trackCopy->SetCharge((short)esdtrack->GetSign()); + + //in aliroot we have AliPID + //0-electron 1-muon 2-pion 3-kaon 4-proton 5-photon 6-pi0 7-neutron 8-kaon0 9-eleCon + //we use only 5 first + double esdpid[5]; + esdtrack->GetESDpid(esdpid); + trackCopy->SetPidProbElectron(esdpid[0]); + trackCopy->SetPidProbMuon(esdpid[1]); + trackCopy->SetPidProbPion(esdpid[2]); + trackCopy->SetPidProbKaon(esdpid[3]); + trackCopy->SetPidProbProton(esdpid[4]); + + esdpid[0] = -100000.0; + esdpid[1] = -100000.0; + esdpid[2] = -100000.0; + esdpid[3] = -100000.0; + esdpid[4] = -100000.0; + + double tTOF = 0.0; + + if (esdtrack->GetStatus()&AliESDtrack::kTOFpid) { + tTOF = esdtrack->GetTOFsignal(); + esdtrack->GetIntegratedTimes(esdpid); + } + + trackCopy->SetTofExpectedTimes(tTOF-esdpid[2], tTOF-esdpid[3], tTOF-esdpid[4]); + + + ////// TPC //////////////////////////////////////////// + float nsigmaTPCK=-1000.; + float nsigmaTPCPi=-1000.; + float nsigmaTPCP=-1000.; + + if ((fESDpid) && (esdtrack->IsOn(AliESDtrack::kTPCpid))){ + nsigmaTPCK = fESDpid->NumberOfSigmasTPC(esdtrack,AliPID::kKaon); + nsigmaTPCPi = fESDpid->NumberOfSigmasTPC(esdtrack,AliPID::kPion); + nsigmaTPCP = fESDpid->NumberOfSigmasTPC(esdtrack,AliPID::kProton); + + } + trackCopy->SetNSigmaTPCPi(nsigmaTPCPi); + trackCopy->SetNSigmaTPCK(nsigmaTPCK); + trackCopy->SetNSigmaTPCP(nsigmaTPCP); + + ///// TOF /////////////////////////////////////////////// + + float vp=-1000.; + float nsigmaTOFPi=-1000.; + float nsigmaTOFK=-1000.; + float nsigmaTOFP=-1000.; + + if ((esdtrack->GetStatus()&AliESDtrack::kTOFpid) && + (esdtrack->GetStatus()&AliESDtrack::kTOFout) && + (esdtrack->GetStatus()&AliESDtrack::kTIME) && + !(esdtrack->GetStatus()&AliESDtrack::kTOFmismatch)) + { + + //if ((esdtrack->GetStatus()&AliESDtrack::kTOFpid) && + //(esdtrack->GetStatus()&AliESDtrack::kTOFout) && + //(esdtrack->GetStatus()&AliESDtrack::kTIME)){ + // collect info from ESDpid class + + if ((fESDpid) && (esdtrack->IsOn(AliESDtrack::kTOFpid))) { + + + double tZero = fESDpid->GetTOFResponse().GetStartTime(esdtrack->P()); + + nsigmaTOFPi = fESDpid->NumberOfSigmasTOF(esdtrack,AliPID::kPion,tZero); + nsigmaTOFK = fESDpid->NumberOfSigmasTOF(esdtrack,AliPID::kKaon,tZero); + nsigmaTOFP = fESDpid->NumberOfSigmasTOF(esdtrack,AliPID::kProton,tZero); + + Double_t len=esdtrack->GetIntegratedLength(); + Double_t tof=esdtrack->GetTOFsignal(); + if(tof > 0.) vp=len/tof/0.03; + } + } + + trackCopy->SetVTOF(vp); + trackCopy->SetNSigmaTOFPi(nsigmaTOFPi); + trackCopy->SetNSigmaTOFK(nsigmaTOFK); + trackCopy->SetNSigmaTOFP(nsigmaTOFP); + + + double pxyz[3]; + double rxyz[3]; + double impact[2]; + double covimpact[3]; + + if (fUseTPCOnly) { + if (!esdtrack->GetTPCInnerParam()) { + cout << "No TPC inner param !" << endl; + delete trackCopy; + continue; + } + + AliExternalTrackParam *param = new AliExternalTrackParam(*esdtrack->GetTPCInnerParam()); + param->GetXYZ(rxyz); + param->PropagateToDCA(fEvent->GetPrimaryVertexTPC(), (fEvent->GetMagneticField()), 10000, impact, covimpact); + param->GetPxPyPz(pxyz);//reading noconstarined momentum + + if (fReadInner == true) { + AliFemtoModelHiddenInfo *tInfo = new AliFemtoModelHiddenInfo(); + tInfo->SetPDGPid(211); + tInfo->SetTrueMomentum(pxyz[0], pxyz[1], pxyz[2]); + tInfo->SetMass(0.13957); + // tInfo->SetEmissionPoint(rxyz[0], rxyz[1], rxyz[2], 0.0); + // tInfo->SetEmissionPoint(fV1[0], fV1[1], fV1[2], 0.0); + tInfo->SetEmissionPoint(rxyz[0]-fV1[0], rxyz[1]-fV1[1], rxyz[2]-fV1[2], 0.0); + trackCopy->SetHiddenInfo(tInfo); + } + + if (fRotateToEventPlane) { + double tPhi = TMath::ATan2(pxyz[1], pxyz[0]); + double tRad = TMath::Hypot(pxyz[0], pxyz[1]); + + pxyz[0] = tRad*TMath::Cos(tPhi - tReactionPlane); + pxyz[1] = tRad*TMath::Sin(tPhi - tReactionPlane); + } + + AliFemtoThreeVector v(pxyz[0],pxyz[1],pxyz[2]); + if (v.Mag() < 0.0001) { + // cout << "Found 0 momentum ???? " << pxyz[0] << " " << pxyz[1] << " " << pxyz[2] << endl; + delete trackCopy; + continue; + } + trackCopy->SetP(v);//setting momentum + trackCopy->SetPt(sqrt(pxyz[0]*pxyz[0]+pxyz[1]*pxyz[1])); + + const AliFmThreeVectorD kP(pxyz[0],pxyz[1],pxyz[2]); + const AliFmThreeVectorD kOrigin(fV1[0],fV1[1],fV1[2]); + //setting helix I do not if it is ok + AliFmPhysicalHelixD helix(kP,kOrigin,(double)(fEvent->GetMagneticField())*kilogauss,(double)(trackCopy->Charge())); + trackCopy->SetHelix(helix); + + //some stuff which could be useful + trackCopy->SetImpactD(impact[0]); + trackCopy->SetImpactZ(impact[1]); + trackCopy->SetCdd(covimpact[0]); + trackCopy->SetCdz(covimpact[1]); + trackCopy->SetCzz(covimpact[2]); + trackCopy->SetSigmaToVertex(GetSigmaToVertex(impact, covimpact)); + + delete param; + } + else { + if (fReadInner == true) { + + if (esdtrack->GetTPCInnerParam()) { + AliExternalTrackParam *param = new AliExternalTrackParam(*esdtrack->GetTPCInnerParam()); + param->GetXYZ(rxyz); + // param->PropagateToDCA(fEvent->GetPrimaryVertex(), (fEvent->GetMagneticField()), 10000); + param->GetPxPyPz(pxyz);//reading noconstarined momentum + delete param; + + AliFemtoModelHiddenInfo *tInfo = new AliFemtoModelHiddenInfo(); + tInfo->SetPDGPid(211); + tInfo->SetTrueMomentum(pxyz[0], pxyz[1], pxyz[2]); + tInfo->SetMass(0.13957); + // tInfo->SetEmissionPoint(rxyz[0], rxyz[1], rxyz[2], 0.0); + //tInfo->SetEmissionPoint(fV1[0], fV1[1], fV1[2], 0.0); + tInfo->SetEmissionPoint(rxyz[0]-fV1[0], rxyz[1]-fV1[1], rxyz[2]-fV1[2], 0.0); + trackCopy->SetHiddenInfo(tInfo); + } + } + + + if(fTrackType == kGlobal) { + if (fConstrained==true) + tGoodMomentum=esdtrack->GetConstrainedPxPyPz(pxyz); //reading constrained momentum + else + tGoodMomentum=esdtrack->GetPxPyPz(pxyz);//reading noconstarined momentum + } + else if (fTrackType == kTPCOnly) { + if (esdtrack->GetTPCInnerParam()) + esdtrack->GetTPCInnerParam()->GetPxPyPz(pxyz); + else { + delete trackCopy; + continue; + } + } + else if (fTrackType == kITSOnly) { + if (fConstrained==true) + tGoodMomentum=esdtrack->GetConstrainedPxPyPz(pxyz); //reading constrained momentum + else + tGoodMomentum=esdtrack->GetPxPyPz(pxyz);//reading noconstarined momentum + } + + if (fRotateToEventPlane) { + double tPhi = TMath::ATan2(pxyz[1], pxyz[0]); + double tRad = TMath::Hypot(pxyz[0], pxyz[1]); + + pxyz[0] = tRad*TMath::Cos(tPhi - tReactionPlane); + pxyz[1] = tRad*TMath::Sin(tPhi - tReactionPlane); + } + + AliFemtoThreeVector v(pxyz[0],pxyz[1],pxyz[2]); + if (v.Mag() < 0.0001) { + // cout << "Found 0 momentum ???? " << pxyz[0] << " " << pxyz[1] << " " << pxyz[2] << endl; + delete trackCopy; + continue; + } + + trackCopy->SetP(v);//setting momentum + trackCopy->SetPt(sqrt(pxyz[0]*pxyz[0]+pxyz[1]*pxyz[1])); + const AliFmThreeVectorD kP(pxyz[0],pxyz[1],pxyz[2]); + const AliFmThreeVectorD kOrigin(fV1[0],fV1[1],fV1[2]); + //setting helix I do not if it is ok + AliFmPhysicalHelixD helix(kP,kOrigin,(double)(fEvent->GetMagneticField())*kilogauss,(double)(trackCopy->Charge())); + trackCopy->SetHelix(helix); + + //some stuff which could be useful + float imp[2]; + float cim[3]; + esdtrack->GetImpactParameters(imp,cim); + + impact[0] = imp[0]; + impact[1] = imp[1]; + covimpact[0] = cim[0]; + covimpact[1] = cim[1]; + covimpact[2] = cim[2]; + + trackCopy->SetImpactD(impact[0]); + trackCopy->SetImpactZ(impact[1]); + trackCopy->SetCdd(covimpact[0]); + trackCopy->SetCdz(covimpact[1]); + trackCopy->SetCzz(covimpact[2]); + trackCopy->SetSigmaToVertex(GetSigmaToVertex(impact,covimpact)); + } + + trackCopy->SetTrackId(esdtrack->GetID()); + trackCopy->SetFlags(esdtrack->GetStatus()); + trackCopy->SetLabel(esdtrack->GetLabel()); + + trackCopy->SetITSchi2(esdtrack->GetITSchi2()); + trackCopy->SetITSncls(esdtrack->GetNcls(0)); + trackCopy->SetTPCchi2(esdtrack->GetTPCchi2()); + trackCopy->SetTPCncls(esdtrack->GetTPCNcls()); + trackCopy->SetTPCnclsF(esdtrack->GetTPCNclsF()); + trackCopy->SetTPCsignalN((short)esdtrack->GetTPCsignalN()); //due to bug in aliesdtrack class + trackCopy->SetTPCsignalS(esdtrack->GetTPCsignalSigma()); + + + trackCopy->SetTPCClusterMap(esdtrack->GetTPCClusterMap()); + trackCopy->SetTPCSharedMap(esdtrack->GetTPCSharedMap()); + + double xtpc[3]; + esdtrack->GetInnerXYZ(xtpc); + xtpc[2] -= fV1[2]; + trackCopy->SetNominalTPCEntrancePoint(xtpc); + + esdtrack->GetOuterXYZ(xtpc); + xtpc[2] -= fV1[2]; + trackCopy->SetNominalTPCExitPoint(xtpc); + + int indexes[3]; + for (int ik=0; ik<3; ik++) { + indexes[ik] = esdtrack->GetKinkIndex(ik); + } + trackCopy->SetKinkIndexes(indexes); + + + // Fill the hidden information with the simulated data + if (TMath::Abs(esdtrack->GetLabel()) < fStack->GetNtrack()) { + TParticle *tPart = fStack->Particle(TMath::Abs(esdtrack->GetLabel())); + + // Check the mother information + + // Using the new way of storing the freeze-out information + // Final state particle is stored twice on the stack + // one copy (mother) is stored with original freeze-out information + // and is not tracked + // the other one (daughter) is stored with primary vertex position + // and is tracked + + // Freeze-out coordinates + double fpx=0.0, fpy=0.0, fpz=0.0, fpt=0.0; + fpx = tPart->Vx() - fV1[0]; + fpy = tPart->Vy() - fV1[1]; + fpz = tPart->Vz() - fV1[2]; + fpt = tPart->T(); + + AliFemtoModelGlobalHiddenInfo *tInfo = new AliFemtoModelGlobalHiddenInfo(); + tInfo->SetGlobalEmissionPoint(fpx, fpy, fpz); + + fpx *= 1e13; + fpy *= 1e13; + fpz *= 1e13; + fpt *= 1e13; + + // cout << "Looking for mother ids " << endl; + if (motherids[TMath::Abs(esdtrack->GetLabel())]>0) { + // cout << "Got mother id" << endl; + TParticle *mother = fStack->Particle(motherids[TMath::Abs(esdtrack->GetLabel())]); + // Check if this is the same particle stored twice on the stack + if ((mother->GetPdgCode() == tPart->GetPdgCode() || (mother->Px() == tPart->Px()))) { + // It is the same particle + // Read in the original freeze-out information + // and convert it from to [fm] + + // EPOS style + fpx = mother->Vx()*1e13*0.197327; + fpy = mother->Vy()*1e13*0.197327; + fpz = mother->Vz()*1e13*0.197327; + fpt = mother->T() *1e13*0.197327; + + + // Therminator style +// fpx = mother->Vx()*1e13; +// fpy = mother->Vy()*1e13; +// fpz = mother->Vz()*1e13; +// fpt = mother->T() *1e13*3e10; + + } + } + + if (fRotateToEventPlane) { + double tPhi = TMath::ATan2(fpy, fpx); + double tRad = TMath::Hypot(fpx, fpy); + + fpx = tRad*TMath::Cos(tPhi - tReactionPlane); + fpy = tRad*TMath::Sin(tPhi - tReactionPlane); + } + + tInfo->SetPDGPid(tPart->GetPdgCode()); + + if (fRotateToEventPlane) { + double tPhi = TMath::ATan2(tPart->Py(), tPart->Px()); + double tRad = TMath::Hypot(tPart->Px(), tPart->Py()); + + tInfo->SetTrueMomentum(tRad*TMath::Cos(tPhi - tReactionPlane), + tRad*TMath::Sin(tPhi - tReactionPlane), + tPart->Pz()); + } + else + tInfo->SetTrueMomentum(tPart->Px(), tPart->Py(), tPart->Pz()); + Double_t mass2 = (tPart->Energy() *tPart->Energy() - + tPart->Px()*tPart->Px() - + tPart->Py()*tPart->Py() - + tPart->Pz()*tPart->Pz()); + if (mass2>0.0) + tInfo->SetMass(TMath::Sqrt(mass2)); + else + tInfo->SetMass(0.0); + + tInfo->SetEmissionPoint(fpx, fpy, fpz, fpt); + trackCopy->SetHiddenInfo(tInfo); + } + else { + AliFemtoModelGlobalHiddenInfo *tInfo = new AliFemtoModelGlobalHiddenInfo(); + tInfo->SetMass(0.0); + double fpx=0.0, fpy=0.0, fpz=0.0, fpt=0.0; + fpx = fV1[0]*1e13; + fpy = fV1[1]*1e13; + fpz = fV1[2]*1e13; + fpt = 0.0; + tInfo->SetEmissionPoint(fpx, fpy, fpz, fpt); + + tInfo->SetTrueMomentum(pxyz[0],pxyz[1],pxyz[2]); + + trackCopy->SetHiddenInfo(tInfo); + } + // cout << "Got freeze-out " << fpx << " " << fpy << " " << fpz << " " << fpt << " " << mass2 << " " << tPart->GetPdgCode() << endl; + + //decision if we want this track + //if we using diffrent labels we want that this label was use for first time + //if we use hidden info we want to have match between sim data and ESD + if (tGoodMomentum==true) + { + hbtEvent->TrackCollection()->push_back(trackCopy);//adding track to analysis + realnofTracks++;//real number of tracks + // delete trackCopy; + } + else + { + delete trackCopy; + } + + } + + delete [] motherids; + + hbtEvent->SetNumberOfTracks(realnofTracks);//setting number of track which we read in event + + AliCentrality *cent = fEvent->GetCentrality(); + if (cent) { + hbtEvent->SetCentralityV0(cent->GetCentralityPercentile("V0M")); + // hbtEvent->SetCentralityFMD(cent->GetCentralityPercentile("FMD")); + hbtEvent->SetCentralitySPD1(cent->GetCentralityPercentile("CL1")); + // hbtEvent->SetCentralityTrk(cent->GetCentralityPercentile("TRK")); + + if (Debug()>1) printf(" FemtoReader Got Event with %f %f %f %f\n", cent->GetCentralityPercentile("V0M"), 0.0, cent->GetCentralityPercentile("CL1"), 0.0); + } + + if (fEstEventMult == kGlobalCount) + hbtEvent->SetNormalizedMult(tNormMult); + else if (fEstEventMult == kTracklet) + hbtEvent->SetNormalizedMult(tTracklet); + else if (fEstEventMult == kITSTPC) + hbtEvent->SetNormalizedMult(tITSTPC); + else if (fEstEventMult == kITSPure) + hbtEvent->SetNormalizedMult(tITSPure); + else if (fEstEventMult == kSPDLayer1) + hbtEvent->SetNormalizedMult(fEvent->GetMultiplicity()->GetNumberOfITSClusters(1)); + else if (fEstEventMult == kV0Centrality) { + // centrality between 0 (central) and 1 (very peripheral) + + if (cent) { + if (cent->GetCentralityPercentile("V0M") < 0.00001) + hbtEvent->SetNormalizedMult(-1); + else + hbtEvent->SetNormalizedMult(lrint(10.0*cent->GetCentralityPercentile("V0M"))); + if (Debug()>1) printf ("Set Centrality %i %f %li\n", hbtEvent->UncorrectedNumberOfPrimaries(), + 10.0*cent->GetCentralityPercentile("V0M"), lrint(10.0*cent->GetCentralityPercentile("V0M"))); + } + } + + if (tNormMultPos > tNormMultNeg) + hbtEvent->SetZDCParticipants(tNormMultPos); + else + hbtEvent->SetZDCParticipants(tNormMultNeg); + + AliEventplane* ep = fEvent->GetEventplane(); + if (ep) { + hbtEvent->SetEP(ep); + hbtEvent->SetReactionPlaneAngle(ep->GetEventplane("Q")); + } + + + fCurEvent++; + // cout<<"end of reading nt "< Erf(d/Sqrt(2)) for a 1-dim gauss (d = n_sigma) + // -> 1 - Exp(-d**2) for a 2-dim gauss (d*d = dx*dx + dy*dy != n_sigma) + // + // It means that for a 2-dim gauss: n_sigma(d) = Sqrt(2)*ErfInv(1 - Exp((-x**2)/2) + // Can this be expressed in a different way? + + if (bRes[0] == 0 || bRes[1] ==0) + return -1; + + Float_t d = TMath::Sqrt(TMath::Power(b[0]/bRes[0],2) + TMath::Power(b[1]/bRes[1],2)); + + // stupid rounding problem screws up everything: + // if d is too big, TMath::Exp(...) gets 0, and TMath::ErfInverse(1) that should be infinite, gets 0 :( + if (TMath::Exp(-d * d / 2) < 1e-10) + return 1000; + + d = TMath::ErfInverse(1 - TMath::Exp(-d * d / 2)) * TMath::Sqrt(2); + return d; +} + +void AliFemtoEventReaderESDChainKine::SetReadTrackType(ReadTrackType aType) +{ + fTrackType = aType; +} + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChainKine.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChainKine.h new file mode 100644 index 00000000000..09f07bc45f6 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChainKine.h @@ -0,0 +1,94 @@ +//////////////////////////////////////////////////////////////////////////////// +// // +// AliFemtoEventReaderESDChainKine - the reader class for the Alice ESD and // +// the model Kinematics information tailored for the Task framework and the // +// Reads in AliESDfriend to create shared hit/quality information // +// Authors: Adam Kisiel kisiel@mps.ohio-state.edu // +// // +//////////////////////////////////////////////////////////////////////////////// +#ifndef ALIFEMTOEVENTREADERESDCHAINKINE_H +#define ALIFEMTOEVENTREADERESDCHAINKINE_H + +#include "AliFemtoEventReader.h" +#include "AliFemtoEnumeration.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "AliESDpid.h" + +class AliFemtoEvent; + +class AliFemtoEventReaderESDChainKine : public AliFemtoEventReader +{ + public: + enum TrackType {kGlobal=0, kTPCOnly=1, kITSOnly=2, kSPDTracklet=3}; + typedef enum TrackType ReadTrackType; + + enum EventMult {kTracklet=0, kITSTPC=1, kITSPure=2, kGlobalCount=3, kSPDLayer1=4, kV0Centrality=5 }; + typedef enum EventMult EstEventMult; + + AliFemtoEventReaderESDChainKine(); + AliFemtoEventReaderESDChainKine(const AliFemtoEventReaderESDChainKine& aReader); + ~AliFemtoEventReaderESDChainKine(); + + AliFemtoEventReaderESDChainKine& operator=(const AliFemtoEventReaderESDChainKine& aReader); + + AliFemtoEvent* ReturnHbtEvent(); + AliFemtoString Report(); + void SetConstrained(const bool constrained); + bool GetConstrained() const; + void SetUseTPCOnly(const bool usetpconly); + bool GetUseTPCOnly() const; + void SetReadTPCInner(const bool readinner); + bool GetReadTPCInner() const; + + void SetUseMultiplicity(EstEventMult aType); + + void SetReadTrackType(ReadTrackType aType); + + void SetESDSource(AliESDEvent *aESD); + void SetStackSource(AliStack *aStack); + void SetGenEventHeader(AliGenEventHeader *aGenHeader); + void SetRotateToEventPlane(short dorotate); + + void SetESDPid(AliESDpid *esdPid) { fESDpid = esdPid; } + + protected: + + private: + string fFileName; // name of current ESD file + bool fConstrained; // flag to set which momentum from ESD file will be use + bool fReadInner; // flag to set if one wants to read TPC-only momentum + bool fUseTPCOnly; // flog to set to read TPC only momentum instead of the full + int fNumberofEvent; // number of Events in ESD file + int fCurEvent; // number of current event + unsigned int fCurFile; // number of current file + AliESDEvent* fEvent; // ESD event + AliStack *fStack; // Kinematics stack pointer + AliGenEventHeader *fGenHeader; // Link to the generator event header + ReadTrackType fTrackType; // Type of track read + EstEventMult fEstEventMult; // Type of the event multiplicity estimator + + short fRotateToEventPlane; // Rotate the event so that event plane is at x=0 + + Float_t GetSigmaToVertex(double *impact, double *covar); + + AliESDpid *fESDpid; + Bool_t fIsPidOwner; + +#ifdef __ROOT__ + ClassDef(AliFemtoEventReaderESDChainKine, 1) +#endif + + }; + +#endif + + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderKinematicsChain.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderKinematicsChain.cxx new file mode 100644 index 00000000000..a53dea430b0 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderKinematicsChain.cxx @@ -0,0 +1,347 @@ +///////////////////////////////////////////////////////////////////////////////////// +// // +// AliFemtoEventReaderKinematicsChain - the reader class for the Alice ESD and // +// the model Kinematics information tailored for the Task framework and the // +// Reads in AliESDfriend to create shared hit/quality information // +// Authors: Malgorzata Janik, Warsaw University of Technology, majanik@cern.ch // +// Lukasz Graczykowski, Warsaw University of Technology, lgraczyk@cern.ch // +// // +///////////////////////////////////////////////////////////////////////////////////// + +#include "AliFemtoEventReaderKinematicsChain.h" + +#include "TFile.h" +#include "TTree.h" +#include "TList.h" + +#include "AliFmPhysicalHelixD.h" +#include "AliFmThreeVectorF.h" + +#include "SystemOfUnits.h" + +#include "AliFemtoEvent.h" + +#include "TParticle.h" +#include "AliStack.h" +#include "TParticlePDG.h" +#include "AliFemtoModelHiddenInfo.h" +#include "AliFemtoModelGlobalHiddenInfo.h" +#include "AliGenHijingEventHeader.h" +#include "AliGenCocktailEventHeader.h" + +#include "AliVertexerTracks.h" + +ClassImp(AliFemtoEventReaderKinematicsChain) + +#if !(ST_NO_NAMESPACES) + using namespace units; +#endif + +using namespace std; +//____________________________ +AliFemtoEventReaderKinematicsChain::AliFemtoEventReaderKinematicsChain(): + fFileName(" "), + fConstrained(true), + fNumberofEvent(0), + fCurEvent(0), + fCurFile(0), + fStack(0x0), + fGenHeader(0x0), + fRotateToEventPlane(0) +{ + //constructor with 0 parameters , look at default settings +} + +//__________________ +AliFemtoEventReaderKinematicsChain::AliFemtoEventReaderKinematicsChain(const AliFemtoEventReaderKinematicsChain& aReader): + AliFemtoEventReader(aReader), + fFileName(" "), + fConstrained(true), + fNumberofEvent(0), + fCurEvent(0), + fCurFile(0), + fStack(0x0), + fGenHeader(0x0), + fRotateToEventPlane(0) +{ + // Copy constructor + fConstrained = aReader.fConstrained; + fNumberofEvent = aReader.fNumberofEvent; + fCurEvent = aReader.fCurEvent; + fCurFile = aReader.fCurFile; + fStack = aReader.fStack; + fRotateToEventPlane = aReader.fRotateToEventPlane; +} +//__________________ +AliFemtoEventReaderKinematicsChain::~AliFemtoEventReaderKinematicsChain() +{ + //Destructor + //delete fEvent; +} + +//__________________ +AliFemtoEventReaderKinematicsChain& AliFemtoEventReaderKinematicsChain::operator=(const AliFemtoEventReaderKinematicsChain& aReader) +{ + // Assignment operator + if (this == &aReader) + return *this; + + fConstrained = aReader.fConstrained; + fNumberofEvent = aReader.fNumberofEvent; + fCurEvent = aReader.fCurEvent; + fCurFile = aReader.fCurFile; + fStack = aReader.fStack; + fGenHeader = aReader.fGenHeader; + fRotateToEventPlane = aReader.fRotateToEventPlane; + return *this; +} +//__________________ +// Simple report +AliFemtoString AliFemtoEventReaderKinematicsChain::Report() +{ + AliFemtoString temp = "\n This is the AliFemtoEventReaderKinematicsChain\n"; + return temp; +} + +//__________________ +void AliFemtoEventReaderKinematicsChain::SetConstrained(const bool constrained) +{ + // Select whether to read constrained or not constrained momentum + fConstrained=constrained; +} +//__________________ +bool AliFemtoEventReaderKinematicsChain::GetConstrained() const +{ + // Check whether we read constrained or not constrained momentum + return fConstrained; +} +//__________________ +AliFemtoEvent* AliFemtoEventReaderKinematicsChain::ReturnHbtEvent() +{ + // Get the event, read all the relevant information from the stack + // and fill the AliFemtoEvent class + // Returns a valid AliFemtoEvent + AliFemtoEvent *hbtEvent = 0; + string tFriendFileName; + + cout << "AliFemtoEventReaderKinematlaicsChain::Starting to read event: "<SetEventNumber(fEvent->GetEventNumber()); + hbtEvent->SetRunNumber(0); //No Run number in Kinematics! + hbtEvent->SetMagneticField(0*kilogauss);//to check if here is ok + hbtEvent->SetZDCN1Energy(0); + hbtEvent->SetZDCP1Energy(0); + hbtEvent->SetZDCN2Energy(0); + hbtEvent->SetZDCP2Energy(0); + hbtEvent->SetZDCEMEnergy(0); + hbtEvent->SetZDCParticipants(0); + hbtEvent->SetTriggerMask(0); + hbtEvent->SetTriggerCluster(0); + + //Vertex + double fV1[3] = {0.0,0.0,0.0}; + double fVCov[6] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; + + + AliFmThreeVectorF vertex(0,0,0); + + + hbtEvent->SetPrimVertPos(vertex); + hbtEvent->SetPrimVertCov(fVCov); + + Double_t tReactionPlane = 0; + + AliGenHijingEventHeader *hdh = dynamic_cast (fGenHeader); + if (!hdh) { + AliGenCocktailEventHeader *cdh = dynamic_cast (fGenHeader); + if (cdh) { + TList *tGenHeaders = cdh->GetHeaders(); + for (int ihead = 0; iheadGetEntries(); ihead++) { + hdh = dynamic_cast (fGenHeader); + if (hdh) break; + } + } + } + + if (hdh) + { + tReactionPlane = hdh->ReactionPlaneAngle(); + cout << "Got reaction plane " << tReactionPlane << endl; + } + + hbtEvent->SetReactionPlaneAngle(tReactionPlane); + + //starting to reading tracks + int nofTracks=0; //number of all tracks in MC event + nofTracks=fStack->GetNtrack(); + int realnofTracks=0;//number of track which we use in analysis + + + int tNormMult = 0; + for (int i=0;iIsPhysicalPrimary(i)) {continue;} + + AliFemtoTrack* trackCopy = new AliFemtoTrack(); + + //getting next track + TParticle *kinetrack= fStack->Particle(i); + + //setting multiplicity + realnofTracks++;//real number of tracks (only primary particles) + + //setting normalized multiplicity + if (kinetrack->Eta() < 0.9) + if(kinetrack->GetPDG()->Charge()/3!=0) + tNormMult++; + + + //charge + trackCopy->SetCharge((short)(fStack->Particle(i)->GetPDG()->Charge()/3)); + + + //in aliroot we have AliPID + //0-electron 1-muon 2-pion 3-kaon 4-proton 5-photon 6-pi0 7-neutron 8-kaon0 9-eleCon + //we use only 5 first + double kinepid[5]; + for(int pid_iter=0;pid_iter<5;pid_iter++) + kinepid[pid_iter]=0; + + int pdgcode = kinetrack->GetPdgCode(); + //proton + if(pdgcode==2212 || pdgcode==-2212) + kinepid[4]=1000; + //kaon + if(pdgcode==321 || pdgcode==-321 ) + kinepid[3]=1000; + //pion + if( pdgcode==211 || pdgcode==-211) + kinepid[2]=1000; + //electron + if(pdgcode==11 || pdgcode==-11) + kinepid[0]=1000; + //muon + if(pdgcode==13 || pdgcode==-13) + kinepid[1]=1000; + + trackCopy->SetPidProbElectron(kinepid[0]); + trackCopy->SetPidProbMuon(kinepid[1]); + trackCopy->SetPidProbPion(kinepid[2]); + trackCopy->SetPidProbKaon(kinepid[3]); + trackCopy->SetPidProbProton(kinepid[4]); + + + //Momentum + double pxyz[3]; + double rxyz[3]; + + pxyz[0]=kinetrack->Px(); + pxyz[1]=kinetrack->Py(); + pxyz[2]=kinetrack->Pz(); + + rxyz[0]=kinetrack->Vx(); + rxyz[1]=kinetrack->Vy(); + rxyz[2]=kinetrack->Vz(); + + if (fRotateToEventPlane) { + double tPhi = TMath::ATan2(pxyz[1], pxyz[0]); + double tRad = TMath::Hypot(pxyz[0], pxyz[1]); + + pxyz[0] = tRad*TMath::Cos(tPhi - tReactionPlane); + pxyz[1] = tRad*TMath::Sin(tPhi - tReactionPlane); + } + + AliFemtoThreeVector v(pxyz[0],pxyz[1],pxyz[2]); + if (v.Mag() < 0.0001) { + // cout << "Found 0 momentum ???? " << pxyz[0] << " " << pxyz[1] << " " << pxyz[2] << endl; + delete trackCopy; + continue; + } + + trackCopy->SetP(v);//setting momentum + trackCopy->SetPt(sqrt(pxyz[0]*pxyz[0]+pxyz[1]*pxyz[1])); + const AliFmThreeVectorD kP(pxyz[0],pxyz[1],pxyz[2]); + const AliFmThreeVectorD kOrigin(fV1[0],fV1[1],fV1[2]); + + //label + trackCopy->SetLabel(i); + + + hbtEvent->TrackCollection()->push_back(trackCopy);//adding track to analysis + + + } + + hbtEvent->SetNumberOfTracks(realnofTracks);//setting number of track which we read in event + hbtEvent->SetNormalizedMult(tNormMult); + fCurEvent++; + + return hbtEvent; +} + +//___________________ +void AliFemtoEventReaderKinematicsChain::SetStackSource(AliStack *aStack) +{ + // The chain loads the stack for us + // You must provide the address where it can be found + fStack = aStack; +} +//___________________ +void AliFemtoEventReaderKinematicsChain::SetGenEventHeader(AliGenEventHeader *aGenHeader) +{ + // The chain loads the generator event header for us + // You must provide the address where it can be found + fGenHeader = aGenHeader; +} + +//__________________ +void AliFemtoEventReaderKinematicsChain::SetRotateToEventPlane(short dorotate) +{ + fRotateToEventPlane=dorotate; +} + +Float_t AliFemtoEventReaderKinematicsChain::GetSigmaToVertex(double *impact, double *covar) +{ + // Calculates the number of sigma to the vertex. + + Float_t b[2]; + Float_t bRes[2]; + Float_t bCov[3]; + + b[0] = impact[0]; + b[1] = impact[1]; + bCov[0] = covar[0]; + bCov[1] = covar[1]; + bCov[2] = covar[2]; + + bRes[0] = TMath::Sqrt(bCov[0]); + bRes[1] = TMath::Sqrt(bCov[2]); + + // ----------------------------------- + // How to get to a n-sigma cut? + // + // The accumulated statistics from 0 to d is + // + // -> Erf(d/Sqrt(2)) for a 1-dim gauss (d = n_sigma) + // -> 1 - Exp(-d**2) for a 2-dim gauss (d*d = dx*dx + dy*dy != n_sigma) + // + // It means that for a 2-dim gauss: n_sigma(d) = Sqrt(2)*ErfInv(1 - Exp((-x**2)/2) + // Can this be expressed in a different way? + + if (bRes[0] == 0 || bRes[1] ==0) + return -1; + + Float_t d = TMath::Sqrt(TMath::Power(b[0]/bRes[0],2) + TMath::Power(b[1]/bRes[1],2)); + + // stupid rounding problem screws up everything: + // if d is too big, TMath::Exp(...) gets 0, and TMath::ErfInverse(1) that should be infinite, gets 0 :( + if (TMath::Exp(-d * d / 2) < 1e-10) + return 1000; + + d = TMath::ErfInverse(1 - TMath::Exp(-d * d / 2)) * TMath::Sqrt(2); + return d; +} diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderKinematicsChain.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderKinematicsChain.h new file mode 100644 index 00000000000..2b610455e4f --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderKinematicsChain.h @@ -0,0 +1,69 @@ +///////////////////////////////////////////////////////////////////////////////////// +// // +// AliFemtoEventReaderKinematicsChain - the reader class for the Alice ESD and // +// the model Kinematics information tailored for the Task framework and the // +// Reads in AliESDfriend to create shared hit/quality information // +// Authors: Malgorzata Janik, Warsaw University of Technology, majanik@cern.ch // +// Lukasz Graczykowski, Warsaw University of Technology, lgraczyk@cern.ch // +// // +///////////////////////////////////////////////////////////////////////////////////// + + +#ifndef ALIFEMTOEVENTREADERKINEMATICSCHAIN_H +#define ALIFEMTOEVENTREADERKINEMATICSCHAIN_H + +#include "AliFemtoEventReader.h" +#include "AliFemtoEnumeration.h" + +#include +#include +#include +#include +#include +#include + +class AliFemtoEvent; + +class AliFemtoEventReaderKinematicsChain : public AliFemtoEventReader +{ + public: + AliFemtoEventReaderKinematicsChain(); + AliFemtoEventReaderKinematicsChain(const AliFemtoEventReaderKinematicsChain& aReader); + ~AliFemtoEventReaderKinematicsChain(); + + AliFemtoEventReaderKinematicsChain& operator=(const AliFemtoEventReaderKinematicsChain& aReader); + + AliFemtoEvent* ReturnHbtEvent(); + AliFemtoString Report(); + void SetConstrained(const bool constrained); + bool GetConstrained() const; + + //void SetESDSource(AliESDEvent *aESD); + void SetStackSource(AliStack *aStack); + void SetGenEventHeader(AliGenEventHeader *aGenHeader); + void SetRotateToEventPlane(short dorotate); + + protected: + + private: + string fFileName; // name of current ESD file + bool fConstrained; // flag to set which momentum from ESD file will be use + int fNumberofEvent; // number of Events in ESD file + int fCurEvent; // number of current event + unsigned int fCurFile; // number of current file + AliStack *fStack; // Kinematics stack pointer + AliGenEventHeader *fGenHeader; // Link to the generator event header + + short fRotateToEventPlane; // Rotate the event so that event plane is at x=0 + + Float_t GetSigmaToVertex(double *impact, double *covar); + +#ifdef __ROOT__ + ClassDef(AliFemtoEventReaderKinematicsChain, 1) +#endif + + }; + +#endif + + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderStandard.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderStandard.cxx new file mode 100644 index 00000000000..5c2aa673040 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderStandard.cxx @@ -0,0 +1,880 @@ +//////////////////////////////////////////////////////////////////////////////// +// // +// AliFemtoEventReaderStandard - the reader class for the Alice ESD, AOD // +// the model Kinematics information tailored for the Task framework // +// Authors: Adam Kisiel Adam.Kisiel@cern.ch // +// // +//////////////////////////////////////////////////////////////////////////////// +#include "AliFemtoEventReaderStandard.h" + +#include "TFile.h" +#include "TTree.h" +#include "TList.h" +#include "TBits.h" +#include "AliESDEvent.h" +#include "AliESDtrack.h" +#include "AliESDVertex.h" + +#include "AliFmPhysicalHelixD.h" +#include "AliFmThreeVectorF.h" + +#include "SystemOfUnits.h" + +#include "AliFemtoEvent.h" + +#include "TParticle.h" +#include "AliFemtoModelHiddenInfo.h" +#include "AliFemtoModelGlobalHiddenInfo.h" +#include "AliGenHijingEventHeader.h" +#include "AliGenCocktailEventHeader.h" + +#include "AliAODMCHeader.h" +#include "AliAODMCParticle.h" + +#include "AliVertexerTracks.h" + +ClassImp(AliFemtoEventReaderStandard) + +#if !(ST_NO_NAMESPACES) + using namespace units; +#endif + +using namespace std; +//____________________________ +AliFemtoEventReaderStandard::AliFemtoEventReaderStandard(): + AliFemtoEventReader(), + fFileName(" "), + fNumberofEvent(0), + fCurEvent(0), + fCurFile(0), + fESDEvent(0x0), + fAODEvent(0x0), + fStack(0x0), + fGenHeader(0x0), + fInputType(kUnknown), + fUsePhysicsSel(kFALSE), + fSelect(0), + fTrackCuts(0x0), + fUseTPCOnly(kFALSE) +{ + //constructor with 0 parameters , look at default settings +} + +//__________________ +AliFemtoEventReaderStandard::AliFemtoEventReaderStandard(const AliFemtoEventReaderStandard& aReader): + AliFemtoEventReader(aReader), + fFileName(" "), + fNumberofEvent(0), + fCurEvent(0), + fCurFile(0), + fESDEvent(0x0), + fAODEvent(0x0), + fStack(0x0), + fGenHeader(0x0), + fInputType(kUnknown), + fUsePhysicsSel(kFALSE), + fSelect(0), + fTrackCuts(0x0), + fUseTPCOnly(kFALSE) +{ + // Copy constructor + fCurEvent = aReader.fCurEvent; + fCurFile = aReader.fCurFile; + fESDEvent = new AliESDEvent(); + fAODEvent = new AliAODEvent(); + fStack = aReader.fStack; + fInputType = aReader.fInputType; + fUsePhysicsSel = aReader.fUsePhysicsSel; + if (fUsePhysicsSel) fSelect = new AliPhysicsSelection(); + fTrackCuts = new AliESDtrackCuts(*(aReader.fTrackCuts)); + fUseTPCOnly = aReader.fUseTPCOnly; +} +//__________________ +AliFemtoEventReaderStandard::~AliFemtoEventReaderStandard() +{ + //Destructor + delete fESDEvent; + delete fAODEvent; + if (fTrackCuts) delete fTrackCuts; +} + +//__________________ +AliFemtoEventReaderStandard& AliFemtoEventReaderStandard::operator=(const AliFemtoEventReaderStandard& aReader) +{ + // Assignment operator + if (this == &aReader) + return *this; + + fCurEvent = aReader.fCurEvent; + fCurFile = aReader.fCurFile; + if (fESDEvent) delete fESDEvent; + fESDEvent = new AliESDEvent(); + if (fAODEvent) delete fAODEvent; + fAODEvent = new AliAODEvent(); + fStack = aReader.fStack; + fGenHeader = aReader.fGenHeader; + fInputType = aReader.fInputType; + fUsePhysicsSel = aReader.fUsePhysicsSel; + if (fUsePhysicsSel) fSelect = new AliPhysicsSelection(); + if (fTrackCuts) delete fTrackCuts; + fTrackCuts = new AliESDtrackCuts(*(aReader.fTrackCuts)); + fUseTPCOnly = aReader.fUseTPCOnly; + + return *this; +} +//__________________ +// Simple report +AliFemtoString AliFemtoEventReaderStandard::Report() +{ + AliFemtoString temp = "\n This is the AliFemtoEventReaderStandard\n"; + return temp; +} +//__________________ +AliFemtoEvent* AliFemtoEventReaderStandard::ReturnHbtEvent() +{ + // Get the event, read all the relevant information + // and fill the AliFemtoEvent class + // Returns a valid AliFemtoEvent + AliFemtoEvent *hbtEvent = 0; + string tFriendFileName; + + hbtEvent = new AliFemtoEvent; + + // Get the friend information + cout<<"starting to read event "<GetAliESDOld())fESDEvent->CopyFromOldESD(); + + if (fUsePhysicsSel) { + hbtEvent->SetIsCollisionCandidate(fSelect->IsCollisionCandidate(fESDEvent)); + if (!(fSelect->IsCollisionCandidate(fESDEvent))) + printf("Event not a collision candidate\n"); + } + else + hbtEvent->SetIsCollisionCandidate(kTRUE); + } + else { + hbtEvent->SetIsCollisionCandidate(kTRUE); + } + + double fV1[3]; + + //setting basic things + if ((fInputType == kESD) || (fInputType == kESDKine)) { + hbtEvent->SetRunNumber(fESDEvent->GetRunNumber()); + hbtEvent->SetMagneticField(fESDEvent->GetMagneticField()*kilogauss);//to check if here is ok + hbtEvent->SetZDCN1Energy(fESDEvent->GetZDCN1Energy()); + hbtEvent->SetZDCP1Energy(fESDEvent->GetZDCP1Energy()); + hbtEvent->SetZDCN2Energy(fESDEvent->GetZDCN2Energy()); + hbtEvent->SetZDCP2Energy(fESDEvent->GetZDCP2Energy()); + hbtEvent->SetZDCEMEnergy(fESDEvent->GetZDCEMEnergy()); + hbtEvent->SetZDCParticipants(fESDEvent->GetZDCParticipants()); + hbtEvent->SetTriggerMask(fESDEvent->GetTriggerMask()); + hbtEvent->SetTriggerCluster(fESDEvent->GetTriggerCluster()); + + printf("Got event type %i\n", fESDEvent->GetEventType()); + + //Vertex + double fVCov[6]; + // if (fUseTPCOnly) { + // fESDEvent->GetPrimaryVertexTPC()->GetXYZ(fV1); + // fESDEvent->GetPrimaryVertexTPC()->GetCovMatrix(fVCov); + // if (!fESDEvent->GetPrimaryVertexTPC()->GetStatus()) + // fVCov[4] = -1001.0; + // } + // else { + if (fESDEvent->GetPrimaryVertex()) { + fESDEvent->GetPrimaryVertex()->GetXYZ(fV1); + fESDEvent->GetPrimaryVertex()->GetCovMatrix(fVCov); + + if (!fESDEvent->GetPrimaryVertex()->GetStatus()) { + // Get the vertex from SPD + fESDEvent->GetPrimaryVertexSPD()->GetXYZ(fV1); + fESDEvent->GetPrimaryVertexSPD()->GetCovMatrix(fVCov); + + + if (!fESDEvent->GetPrimaryVertexSPD()->GetStatus()) + fVCov[4] = -1001.0; + else { + fESDEvent->GetPrimaryVertexSPD()->GetXYZ(fV1); + fESDEvent->GetPrimaryVertexSPD()->GetCovMatrix(fVCov); + } + } + } + else { + if (fESDEvent->GetPrimaryVertexSPD()) { + fESDEvent->GetPrimaryVertexSPD()->GetXYZ(fV1); + fESDEvent->GetPrimaryVertexSPD()->GetCovMatrix(fVCov); + } + } + if ((!fESDEvent->GetPrimaryVertex()) && (!fESDEvent->GetPrimaryVertexSPD())) + { + cout << "No vertex found !!!" << endl; + fV1[0] = 10000.0; + fV1[1] = 10000.0; + fV1[2] = 10000.0; + fVCov[4] = -1001.0; + } + + AliFmThreeVectorF vertex(fV1[0],fV1[1],fV1[2]); + + hbtEvent->SetPrimVertPos(vertex); + hbtEvent->SetPrimVertCov(fVCov); + } + + if ((fInputType == kAOD) || (fInputType == kAODKine)) { + hbtEvent->SetRunNumber(fAODEvent->GetRunNumber()); + hbtEvent->SetMagneticField(fAODEvent->GetMagneticField()*kilogauss);//to check if here is ok + hbtEvent->SetZDCN1Energy(fAODEvent->GetZDCN1Energy()); + hbtEvent->SetZDCP1Energy(fAODEvent->GetZDCP1Energy()); + hbtEvent->SetZDCN2Energy(fAODEvent->GetZDCN2Energy()); + hbtEvent->SetZDCP2Energy(fAODEvent->GetZDCP2Energy()); + hbtEvent->SetZDCEMEnergy(fAODEvent->GetZDCEMEnergy(0)); + hbtEvent->SetZDCParticipants(0); + hbtEvent->SetTriggerMask(fAODEvent->GetTriggerMask()); + hbtEvent->SetTriggerCluster(fAODEvent->GetTriggerCluster()); + + // Primary Vertex position + fAODEvent->GetPrimaryVertex()->GetPosition(fV1); + + AliFmThreeVectorF vertex(fV1[0],fV1[1],fV1[2]); + hbtEvent->SetPrimVertPos(vertex); + } + + if ((fInputType == kESDKine) || (fInputType == kAODKine)) { + Double_t tReactionPlane = 0; + + AliGenHijingEventHeader *hdh = dynamic_cast (fGenHeader); + if (!hdh) { + AliGenCocktailEventHeader *cdh = dynamic_cast (fGenHeader); + if (cdh) { + TList *tGenHeaders = cdh->GetHeaders(); + for (int ihead = 0; iheadGetEntries(); ihead++) { + hdh = dynamic_cast (fGenHeader); + if (hdh) break; + } + } + } + if (hdh) + { + tReactionPlane = hdh->ReactionPlaneAngle(); + cout << "Got reaction plane " << tReactionPlane << endl; + } + + hbtEvent->SetReactionPlaneAngle(tReactionPlane); + } + + //starting to reading tracks + int nofTracks=0; //number of reconstructed tracks in event + if ((fInputType == kESD) || (fInputType == kESDKine)) + nofTracks = fESDEvent->GetNumberOfTracks(); + else if ((fInputType == kAOD) || (fInputType == kAODKine)) + nofTracks = fAODEvent->GetNumberOfTracks(); + + int realnofTracks=0;//number of track which we use ina analysis + + TClonesArray *mcP = 0; + Int_t *motherids=0; + + if (fInputType == kAODKine) { + // Attempt to access MC header + AliAODMCHeader *mcH; + mcH = (AliAODMCHeader *) fAODEvent->FindListObject(AliAODMCHeader::StdBranchName()); + if (!mcH) { + cout << "AOD MC information requested, but no header found!" << endl; + } + + mcP = (TClonesArray *) fAODEvent->FindListObject(AliAODMCParticle::StdBranchName()); + if (!mcP) { + cout << "AOD MC information requested, but no particle array found!" << endl; + } + + hbtEvent->SetReactionPlaneAngle(fAODEvent->GetHeader()->GetQTheta(0)/2.0); + + if (mcP) { + motherids = new Int_t[((AliAODMCParticle *) mcP->At(mcP->GetEntries()-1))->GetLabel()]; + for (int ip=0; ipGetEntries(); ip++) motherids[ip] = 0; + + // Read in mother ids + AliAODMCParticle *motherpart; + for (int ip=0; ipGetEntries(); ip++) { + motherpart = (AliAODMCParticle *) mcP->At(ip); + if (motherpart->GetDaughter(0) > 0) + motherids[motherpart->GetDaughter(0)] = ip; + if (motherpart->GetDaughter(1) > 0) + motherids[motherpart->GetDaughter(1)] = ip; + } + } + } + + if (fInputType == kESDKine) { + motherids = new Int_t[fStack->GetNtrack()]; + for (int ip=0; ipGetNtrack(); ip++) motherids[ip] = 0; + + // Read in mother ids + TParticle *motherpart; + for (int ip=0; ipGetNtrack(); ip++) { + motherpart = fStack->Particle(ip); + if (motherpart->GetDaughter(0) > 0) + motherids[motherpart->GetDaughter(0)] = ip; + if (motherpart->GetDaughter(1) > 0) + motherids[motherpart->GetDaughter(1)] = ip; + } + } + + for (int i=0;iGetTrack(i); + esdtrack = AliESDtrackCuts::GetTPCOnlyTrack(fESDEvent, mcp->GetID()); + // printf("Got %p for track %i | ", esdtrack, mcp->GetID()); + } + else { + esdtrack = fESDEvent->GetTrack(i);//getting next track + } + + if (esdtrack && (fTrackCuts->AcceptTrack(esdtrack))) { + + trackCopy->SetCharge((short)esdtrack->GetSign()); + + //in aliroot we have AliPID + //0-electron 1-muon 2-pion 3-kaon 4-proton 5-photon 6-pi0 7-neutron 8-kaon0 9-eleCon + //we use only 5 first + double esdpid[5]; + esdtrack->GetESDpid(esdpid); + trackCopy->SetPidProbElectron(esdpid[0]); + trackCopy->SetPidProbMuon(esdpid[1]); + trackCopy->SetPidProbPion(esdpid[2]); + trackCopy->SetPidProbKaon(esdpid[3]); + trackCopy->SetPidProbProton(esdpid[4]); + + double pxyz[3]; + double impact[2]; + double covimpact[3]; + + // if (fUseTPCOnly) { + // if (!esdtrack->GetTPCInnerParam()) { + // cout << "No TPC inner param !" << endl; + // delete trackCopy; + // continue; + // } + + // AliExternalTrackParam *param = new AliExternalTrackParam(*esdtrack->GetTPCInnerParam()); + // param->GetXYZ(rxyz); + // param->PropagateToDCA(fESDEvent->GetPrimaryVertexTPC(), (fESDEvent->GetMagneticField()), 10000, impact, covimpact); + // param->GetPxPyPz(pxyz);//reading noconstarined momentum + + // if (fRotateToEventPlane) { + // double tPhi = TMath::ATan2(pxyz[1], pxyz[0]); + // double tRad = TMath::Hypot(pxyz[0], pxyz[1]); + + // pxyz[0] = tRad*TMath::Cos(tPhi - tReactionPlane); + // pxyz[1] = tRad*TMath::Sin(tPhi - tReactionPlane); + // } + + // AliFemtoThreeVector v(pxyz[0],pxyz[1],pxyz[2]); + // if (v.mag() < 0.0001) { + // // cout << "Found 0 momentum ???? " << pxyz[0] << " " << pxyz[1] << " " << pxyz[2] << endl; + // delete trackCopy; + // continue; + // } + + // trackCopy->SetP(v);//setting momentum + // trackCopy->SetPt(sqrt(pxyz[0]*pxyz[0]+pxyz[1]*pxyz[1])); + + // const AliFmThreeVectorD kP(pxyz[0],pxyz[1],pxyz[2]); + // const AliFmThreeVectorD kOrigin(fV1[0],fV1[1],fV1[2]); + // //setting helix I do not if it is ok + // AliFmPhysicalHelixD helix(kP,kOrigin,(double)(fESDEvent->GetMagneticField())*kilogauss,(double)(trackCopy->Charge())); + // trackCopy->SetHelix(helix); + + // //some stuff which could be useful + // trackCopy->SetImpactD(impact[0]); + // trackCopy->SetImpactZ(impact[1]); + // trackCopy->SetCdd(covimpact[0]); + // trackCopy->SetCdz(covimpact[1]); + // trackCopy->SetCzz(covimpact[2]); + // trackCopy->SetSigmaToVertex(GetSigmaToVertex(impact, covimpact)); + + // delete param; + // } + // else { + if (fUseTPCOnly) + tGoodMomentum=esdtrack->GetPxPyPz(pxyz); + else + tGoodMomentum=esdtrack->GetConstrainedPxPyPz(pxyz); //reading constrained momentum + // printf("Got good momentum %i\n", tGoodMomentum); + + AliFemtoThreeVector v(pxyz[0],pxyz[1],pxyz[2]); + if (v.Mag() < 0.0001) { + + delete trackCopy; + continue; + } + + trackCopy->SetP(v);//setting momentum + trackCopy->SetPt(sqrt(pxyz[0]*pxyz[0]+pxyz[1]*pxyz[1])); + const AliFmThreeVectorD kP(pxyz[0],pxyz[1],pxyz[2]); + const AliFmThreeVectorD kOrigin(fV1[0],fV1[1],fV1[2]); + //setting helix I do not if it is ok + AliFmPhysicalHelixD helix(kP,kOrigin,(double)(fESDEvent->GetMagneticField())*kilogauss,(double)(trackCopy->Charge())); + trackCopy->SetHelix(helix); + + //some stuff which could be useful + float imp[2]; + float cim[3]; + esdtrack->GetImpactParameters(imp,cim); + + impact[0] = imp[0]; + impact[1] = imp[1]; + covimpact[0] = cim[0]; + covimpact[1] = cim[1]; + covimpact[2] = cim[2]; + + trackCopy->SetImpactD(impact[0]); + trackCopy->SetImpactZ(impact[1]); + trackCopy->SetCdd(covimpact[0]); + trackCopy->SetCdz(covimpact[1]); + trackCopy->SetCzz(covimpact[2]); + trackCopy->SetSigmaToVertex(AliESDtrackCuts::GetSigmaToVertex(esdtrack)); + + trackCopy->SetTrackId(esdtrack->GetID()); + trackCopy->SetFlags(esdtrack->GetStatus()); + trackCopy->SetLabel(esdtrack->GetLabel()); + + trackCopy->SetITSchi2(esdtrack->GetITSchi2()); + trackCopy->SetITSncls(esdtrack->GetNcls(0)); + trackCopy->SetTPCchi2(esdtrack->GetTPCchi2()); + trackCopy->SetTPCncls(esdtrack->GetTPCNcls()); + trackCopy->SetTPCnclsF(esdtrack->GetTPCNclsF()); + trackCopy->SetTPCsignalN((short)esdtrack->GetTPCsignalN()); //due to bug in aliesdtrack class + trackCopy->SetTPCsignalS(esdtrack->GetTPCsignalSigma()); + + trackCopy->SetTPCClusterMap(esdtrack->GetTPCClusterMap()); + trackCopy->SetTPCSharedMap(esdtrack->GetTPCSharedMap()); + + double xtpc[3]; + esdtrack->GetInnerXYZ(xtpc); + xtpc[2] -= fV1[2]; + trackCopy->SetNominalTPCEntrancePoint(xtpc); + + esdtrack->GetOuterXYZ(xtpc); + xtpc[2] -= fV1[2]; + trackCopy->SetNominalTPCExitPoint(xtpc); + + int indexes[3]; + for (int ik=0; ik<3; ik++) { + indexes[ik] = esdtrack->GetKinkIndex(ik); + } + trackCopy->SetKinkIndexes(indexes); + + // Fill the hidden information with the simulated data + if (fInputType == kESDKine) { + if (TMath::Abs(esdtrack->GetLabel()) < fStack->GetNtrack()) { + TParticle *tPart = fStack->Particle(TMath::Abs(esdtrack->GetLabel())); + + // Check the mother information + + // Using the new way of storing the freeze-out information + // Final state particle is stored twice on the stack + // one copy (mother) is stored with original freeze-out information + // and is not tracked + // the other one (daughter) is stored with primary vertex position + // and is tracked + + // Freeze-out coordinates + double fpx=0.0, fpy=0.0, fpz=0.0, fpt=0.0; + fpx = tPart->Vx() - fV1[0]; + fpy = tPart->Vy() - fV1[1]; + fpz = tPart->Vz() - fV1[2]; + fpt = tPart->T(); + + AliFemtoModelGlobalHiddenInfo *tInfo = new AliFemtoModelGlobalHiddenInfo(); + tInfo->SetGlobalEmissionPoint(fpx, fpy, fpz); + + fpx *= 1e13; + fpy *= 1e13; + fpz *= 1e13; + fpt *= 1e13; + + if (motherids[TMath::Abs(esdtrack->GetLabel())]>0) { + TParticle *mother = fStack->Particle(motherids[TMath::Abs(esdtrack->GetLabel())]); + // Check if this is the same particle stored twice on the stack + if ((mother->GetPdgCode() == tPart->GetPdgCode() || (mother->Px() == tPart->Px()))) { + // It is the same particle + // Read in the original freeze-out information + // and convert it from to [fm] + + // EPOS style + fpx = mother->Vx()*1e13*0.197327; + fpy = mother->Vy()*1e13*0.197327; + fpz = mother->Vz()*1e13*0.197327; + fpt = mother->T() *1e13*0.197327; + + + // Therminator style + // fpx = mother->Vx()*1e13; + // fpy = mother->Vy()*1e13; + // fpz = mother->Vz()*1e13; + // fpt = mother->T() *1e13*3e10; + + } + } + + tInfo->SetPDGPid(tPart->GetPdgCode()); + + tInfo->SetTrueMomentum(tPart->Px(), tPart->Py(), tPart->Pz()); + Double_t mass2 = (tPart->Energy() *tPart->Energy() - + tPart->Px()*tPart->Px() - + tPart->Py()*tPart->Py() - + tPart->Pz()*tPart->Pz()); + if (mass2>0.0) + tInfo->SetMass(TMath::Sqrt(mass2)); + else + tInfo->SetMass(0.0); + + tInfo->SetEmissionPoint(fpx, fpy, fpz, fpt); + trackCopy->SetHiddenInfo(tInfo); + } + else { + AliFemtoModelGlobalHiddenInfo *tInfo = new AliFemtoModelGlobalHiddenInfo(); + tInfo->SetMass(0.0); + double fpx=0.0, fpy=0.0, fpz=0.0, fpt=0.0; + fpx = fV1[0]*1e13; + fpy = fV1[1]*1e13; + fpz = fV1[2]*1e13; + fpt = 0.0; + tInfo->SetEmissionPoint(fpx, fpy, fpz, fpt); + + tInfo->SetTrueMomentum(pxyz[0],pxyz[1],pxyz[2]); + + trackCopy->SetHiddenInfo(tInfo); + } + } + // cout << "Got freeze-out " << fpx << " " << fpy << " " << fpz << " " << fpt << " " << mass2 << " " << tPart->GetPdgCode() << endl; + } + else + tGoodMomentum = false; + + if (fUseTPCOnly) + if (esdtrack) delete esdtrack; + } + + if ((fInputType == kAOD) || (fInputType == kAODKine)) { + // Read in the normal AliAODTracks + const AliAODTrack *aodtrack=fAODEvent->GetTrack(i); // getting the AODtrack directly + + // if (!aodtrack->TestFilterBit(fFilterBit)) + // continue; + + CopyAODtoFemtoTrack(aodtrack, trackCopy); + + if (mcP) { + // Fill the hidden information with the simulated data + // Int_t pLabel = aodtrack->GetLabel(); + AliAODMCParticle *tPart = GetParticleWithLabel(mcP, (TMath::Abs(aodtrack->GetLabel()))); + + AliFemtoModelGlobalHiddenInfo *tInfo = new AliFemtoModelGlobalHiddenInfo(); + double fpx=0.0, fpy=0.0, fpz=0.0, fpt=0.0; + if (!tPart) { + fpx = fV1[0]; + fpy = fV1[1]; + fpz = fV1[2]; + tInfo->SetGlobalEmissionPoint(fpx, fpy, fpz); + tInfo->SetPDGPid(0); + tInfo->SetTrueMomentum(0.0, 0.0, 0.0); + tInfo->SetEmissionPoint(0.0, 0.0, 0.0, 0.0); + tInfo->SetMass(0); + } + else { + // Check the mother information + + // Using the new way of storing the freeze-out information + // Final state particle is stored twice on the stack + // one copy (mother) is stored with original freeze-out information + // and is not tracked + // the other one (daughter) is stored with primary vertex position + // and is tracked + + // Freeze-out coordinates + fpx = tPart->Xv() - fV1[0]; + fpy = tPart->Yv() - fV1[1]; + fpz = tPart->Zv() - fV1[2]; + // fpt = tPart->T(); + + tInfo->SetGlobalEmissionPoint(fpx, fpy, fpz); + + fpx *= 1e13; + fpy *= 1e13; + fpz *= 1e13; + // fpt *= 1e13; + + // cout << "Looking for mother ids " << endl; + if (motherids[TMath::Abs(aodtrack->GetLabel())]>0) { + // cout << "Got mother id" << endl; + AliAODMCParticle *mother = GetParticleWithLabel(mcP, motherids[TMath::Abs(aodtrack->GetLabel())]); + // Check if this is the same particle stored twice on the stack + if (mother) { + if ((mother->GetPdgCode() == tPart->GetPdgCode() || (mother->Px() == tPart->Px()))) { + // It is the same particle + // Read in the original freeze-out information + // and convert it from to [fm] + + // EPOS style + // fpx = mother->Xv()*1e13*0.197327; + // fpy = mother->Yv()*1e13*0.197327; + // fpz = mother->Zv()*1e13*0.197327; + // fpt = mother->T() *1e13*0.197327*0.5; + + + // Therminator style + fpx = mother->Xv()*1e13; + fpy = mother->Yv()*1e13; + fpz = mother->Zv()*1e13; + // fpt = mother->T() *1e13*3e10; + + } + } + } + + // if (fRotateToEventPlane) { + // double tPhi = TMath::ATan2(fpy, fpx); + // double tRad = TMath::Hypot(fpx, fpy); + + // fpx = tRad*TMath::Cos(tPhi - tReactionPlane); + // fpy = tRad*TMath::Sin(tPhi - tReactionPlane); + // } + + tInfo->SetPDGPid(tPart->GetPdgCode()); + + // if (fRotateToEventPlane) { + // double tPhi = TMath::ATan2(tPart->Py(), tPart->Px()); + // double tRad = TMath::Hypot(tPart->Px(), tPart->Py()); + + // tInfo->SetTrueMomentum(tRad*TMath::Cos(tPhi - tReactionPlane), + // tRad*TMath::Sin(tPhi - tReactionPlane), + // tPart->Pz()); + // } + // else + tInfo->SetTrueMomentum(tPart->Px(), tPart->Py(), tPart->Pz()); + Double_t mass2 = (tPart->E() *tPart->E() - + tPart->Px()*tPart->Px() - + tPart->Py()*tPart->Py() - + tPart->Pz()*tPart->Pz()); + if (mass2>0.0) + tInfo->SetMass(TMath::Sqrt(mass2)); + else + tInfo->SetMass(0.0); + + tInfo->SetEmissionPoint(fpx, fpy, fpz, fpt); + } + trackCopy->SetHiddenInfo(tInfo); + } + + double pxyz[3]; + aodtrack->PxPyPz(pxyz);//reading noconstarined momentum + const AliFmThreeVectorD ktP(pxyz[0],pxyz[1],pxyz[2]); + // Check the sanity of the tracks - reject zero momentum tracks + if (ktP.Mag() == 0) { + delete trackCopy; + continue; + } + + + } + + + //decision if we want this track + //if we using diffrent labels we want that this label was use for first time + //if we use hidden info we want to have match between sim data and ESD + if (tGoodMomentum==true) + { + hbtEvent->TrackCollection()->push_back(trackCopy);//adding track to analysis + realnofTracks++;//real number of tracks + // delete trackCopy; + } + else + { + delete trackCopy; + } + + } + + if (motherids) + delete [] motherids; + + hbtEvent->SetNumberOfTracks(realnofTracks);//setting number of track which we read in event + fCurEvent++; + // cout<<"end of reading nt "<GetPrimaryVertex()->GetPosition(fV1); + + tFemtoTrack->SetCharge(tAodTrack->Charge()); + + //in aliroot we have AliPID + //0-electron 1-muon 2-pion 3-kaon 4-proton 5-photon 6-pi0 7-neutron 8-kaon0 9-eleCon + //we use only 5 first + + // AOD pid has 10 components + double aodpid[10]; + tAodTrack->GetPID(aodpid); + tFemtoTrack->SetPidProbElectron(aodpid[0]); + tFemtoTrack->SetPidProbMuon(aodpid[1]); + tFemtoTrack->SetPidProbPion(aodpid[2]); + tFemtoTrack->SetPidProbKaon(aodpid[3]); + tFemtoTrack->SetPidProbProton(aodpid[4]); + + double pxyz[3]; + tAodTrack->PxPyPz(pxyz);//reading noconstrained momentum + AliFemtoThreeVector v(pxyz[0],pxyz[1],pxyz[2]); + tFemtoTrack->SetP(v);//setting momentum + tFemtoTrack->SetPt(sqrt(pxyz[0]*pxyz[0]+pxyz[1]*pxyz[1])); + const AliFmThreeVectorD kOrigin(fV1[0],fV1[1],fV1[2]); + //setting track helix + const AliFmThreeVectorD ktP(pxyz[0],pxyz[1],pxyz[2]); + AliFmPhysicalHelixD helix(ktP,kOrigin,(double)(fAODEvent->GetMagneticField())*kilogauss,(double)(tFemtoTrack->Charge())); + tFemtoTrack->SetHelix(helix); + + // Flags + tFemtoTrack->SetTrackId(tAodTrack->GetID()); + tFemtoTrack->SetFlags(1); + tFemtoTrack->SetLabel(tAodTrack->GetLabel()); + + // Track quality information + float covmat[6]; + tAodTrack->GetCovMatrix(covmat); + tFemtoTrack->SetImpactD(covmat[0]); + tFemtoTrack->SetImpactZ(covmat[2]); + tFemtoTrack->SetCdd(covmat[3]); + tFemtoTrack->SetCdz(covmat[4]); + tFemtoTrack->SetCzz(covmat[5]); + // This information is only available in the ESD + // We put in fake values or reasonable estimates + tFemtoTrack->SetITSchi2(tAodTrack->Chi2perNDF()); + tFemtoTrack->SetITSncls(1); + tFemtoTrack->SetTPCchi2(tAodTrack->Chi2perNDF()); + tFemtoTrack->SetTPCncls(1); + tFemtoTrack->SetTPCnclsF(1); + tFemtoTrack->SetTPCsignalN(1); + tFemtoTrack->SetTPCsignalS(1); + + TBits tAllTrue; + TBits tAllFalse; + tAllTrue.ResetAllBits(kTRUE); + tAllFalse.ResetAllBits(kFALSE); + + + // If not use dummy values + tFemtoTrack->SetTPCClusterMap(tAllTrue); + tFemtoTrack->SetTPCSharedMap(tAllFalse); + + double xtpc[3] = {0,0,0}; + tFemtoTrack->SetNominalTPCEntrancePoint(xtpc); + tFemtoTrack->SetNominalTPCExitPoint(xtpc); + + int indexes[3]; + for (int ik=0; ik<3; ik++) { + indexes[ik] = 0; + } + tFemtoTrack->SetKinkIndexes(indexes); +} + +AliAODMCParticle* AliFemtoEventReaderStandard::GetParticleWithLabel(TClonesArray *mcP, Int_t aLabel) +{ + if (aLabel < 0) return 0; + AliAODMCParticle *aodP; + Int_t posstack = 0; + if (aLabel > mcP->GetEntries()) + posstack = mcP->GetEntries(); + else + posstack = aLabel; + + aodP = (AliAODMCParticle *) mcP->At(posstack); + if (aodP->GetLabel() > posstack) { + do { + aodP = (AliAODMCParticle *) mcP->At(posstack); + if (aodP->GetLabel() == aLabel) return aodP; + posstack--; + } + while (posstack > 0); + } + else { + do { + aodP = (AliAODMCParticle *) mcP->At(posstack); + if (aodP->GetLabel() == aLabel) return aodP; + posstack++; + } + while (posstack < mcP->GetEntries()); + } + + return 0; +} diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderStandard.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderStandard.h new file mode 100644 index 00000000000..cd912b475ae --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderStandard.h @@ -0,0 +1,85 @@ +//////////////////////////////////////////////////////////////////////////////// +// // +// AliFemtoEventReaderStandard - the reader class for the Alice ESD, AOD // +// the model Kinematics information tailored for the Task framework // +// Authors: Adam Kisiel Adam.Kisiel@cern.ch // +// // +//////////////////////////////////////////////////////////////////////////////// +#ifndef ALIFEMTOEVENTREADERSTANDARD_H +#define ALIFEMTOEVENTREADERSTANDARD_H + +#include "AliFemtoEventReader.h" +#include "AliFemtoEnumeration.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class AliFemtoEvent; +class AliFemtoTrack; + +class AliFemtoEventReaderStandard : public AliFemtoEventReader +{ + public: + enum InputType {kUnknown = -1, kESD=0, kAOD=1, kESDKine=2, kAODKine=3}; + typedef enum InputType AliFemtoInputType; + + AliFemtoEventReaderStandard(); + AliFemtoEventReaderStandard(const AliFemtoEventReaderStandard& aReader); + ~AliFemtoEventReaderStandard(); + + AliFemtoEventReaderStandard& operator=(const AliFemtoEventReaderStandard& aReader); + + AliFemtoEvent* ReturnHbtEvent(); + AliFemtoString Report(); + + void SetESDSource(AliESDEvent *aESD); + void SetAODSource(AliAODEvent *aAOD); + void SetStackSource(AliStack *aStack); + void SetInputType(AliFemtoInputType aInput); + void SetGenEventHeader(AliGenEventHeader *aGenHeader); + void SetUsePhysicsSelection(const bool usephysics); + + void SetESDTrackCuts(AliESDtrackCuts *esdcuts); + void SetUseTPCOnly(const bool usetpconly); + + protected: + + void CopyAODtoFemtoTrack(const AliAODTrack *tAodTrack, AliFemtoTrack *tFemtoTrack); + AliAODMCParticle* GetParticleWithLabel(TClonesArray *mcP, Int_t aLabel); + + private: + string fFileName; // name of current ESD file + int fNumberofEvent; // number of Events in ESD file + int fCurEvent; // number of current event + unsigned int fCurFile; // number of current file + AliESDEvent *fESDEvent; //! ESD event + AliAODEvent *fAODEvent; //! AOD event + AliStack *fStack; //! Kinematics stack pointer + AliGenEventHeader *fGenHeader; //! Link to the generator event header + AliFemtoInputType fInputType; // Select data input type + + bool fUsePhysicsSel; // if true the physics selection class will be used + AliPhysicsSelection *fSelect; // Class to select only physics events + + AliESDtrackCuts *fTrackCuts; // Link to external ESD track cut + bool fUseTPCOnly; // if true the TPC only parameters will be used + +#ifdef __ROOT__ + ClassDef(AliFemtoEventReaderStandard, 1) +#endif + +}; + +#endif + + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventWriter.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventWriter.h new file mode 100644 index 00000000000..ddd796ec63e --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventWriter.h @@ -0,0 +1,12 @@ +//////////////////////////////////////////////////////////////////////////////// +/// AliFemtoEventWrite - a wrapper for the base class /// +//////////////////////////////////////////////////////////////////////////////// +#ifndef AliFemtoEventWriter_hh +#define AliFemtoEventWriter_hh + +#include "AliFemtoEventReader.h" + +typedef AliFemtoEventReader AliFemtoEventWriter;//! // yes, because our writer are reader-writers + +#endif + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventWriterCollection.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventWriterCollection.h new file mode 100644 index 00000000000..a486d1ae613 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventWriterCollection.h @@ -0,0 +1,34 @@ +/*************************************************************************** + * + * $Id$ + * + * Author: Frank Laue, Ohio State, laue@mps.ohio-state.edu + *************************************************************************** + * + * Description: part of STAR HBT Framework: AliFemtoMaker package + * The EventWriterCollection is pointed to by the Manager, and holds pointers + * to all EventWriter objects currently active + * + *************************************************************************** + * + **************************************************************************/ + +#ifndef AliFemtoEventWriterCollection_hh +#define AliFemtoEventWriterCollection_hh + +#include "AliFemtoEventWriter.h" + +#include +#if !defined(ST_NO_NAMESPACES) +using std::list; +#endif + +#ifdef ST_NO_TEMPLATE_DEF_ARGS +typedef list > AliFemtoEventWriterCollection; +typedef list >::iterator AliFemtoEventWriterIterator; +#else +typedef list AliFemtoEventWriterCollection; +typedef list::iterator AliFemtoEventWriterIterator; +#endif + +#endif diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoFsiTools.F b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoFsiTools.F new file mode 100644 index 00000000000..09ad1ec9061 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoFsiTools.F @@ -0,0 +1,363 @@ +* +* $Id$ +* +* $Log$ +* Revision 1.1.1.1 2007/03/07 10:14:49 mchojnacki +* First version on CVS +* +* Revision 1.1.1.1 1996/04/01 15:01:55 mclareni +* Mathlib gen +* +* + FUNCTION CGAMMA(Z) + + DIMENSION C(0:15) + COMPLEX*8 Z,CGAMMA + COMPLEX*8 U,V,F,H,S + CHARACTER NAME*(*) + CHARACTER*80 ERRTXT + PARAMETER (NAME = 'CGAMMA') + + PARAMETER (Z1 = 1, HF = Z1/2) + + DATA PI /3.14159 26535 89793 24D0/ + DATA C1 /2.50662 82746 31000 50D0/ + + DATA C( 0) / 41.62443 69164 39068D0/ + DATA C( 1) /-51.22424 10223 74774D0/ + DATA C( 2) / 11.33875 58134 88977D0/ + DATA C( 3) / -0.74773 26877 72388D0/ + DATA C( 4) / 0.00878 28774 93061D0/ + DATA C( 5) / -0.00000 18990 30264D0/ + DATA C( 6) / 0.00000 00019 46335D0/ + DATA C( 7) / -0.00000 00001 99345D0/ + DATA C( 8) / 0.00000 00000 08433D0/ + DATA C( 9) / 0.00000 00000 01486D0/ + DATA C(10) / -0.00000 00000 00806D0/ + DATA C(11) / 0.00000 00000 00293D0/ + DATA C(12) / -0.00000 00000 00102D0/ + DATA C(13) / 0.00000 00000 00037D0/ + DATA C(14) / -0.00000 00000 00014D0/ + DATA C(15) / 0.00000 00000 00006D0/ + + + U=Z + X=U + IF(AIMAG(U) .EQ. 0 .AND. -ABS(X) .EQ. INT(X)) THEN + F=0 + H=0 + WRITE(ERRTXT,101) X +c CALL MTLPRT(NAME,'C305.1',ERRTXT) + ELSE + IF(X .GE. 1) THEN + F=1 + V=U + ELSEIF(X .GE. 0) THEN + F=1/U + V=1+U + ELSE + F=1 + V=1-U + END IF + H=1 + S=C(0) + DO 1 K = 1,15 + H=((V-K)/(V+(K-1)))*H + 1 S=S+C(K)*H + H=V+(4+HF) + H=C1*EXP((V-HF)*LOG(H)-H)*S + IF(X .LT. 0) H=PI/(SIN(PI*U)*H) + ENDIF + CGAMMA=F*H + RETURN + 101 FORMAT('ARGUMENT EQUALS NON-POSITIVE INTEGER = ',1P,E15.1) + END + +* +* $Id$ +* +* $Log$ +* Revision 1.1.1.1 2007/03/07 10:14:49 mchojnacki +* First version on CVS +* +* Revision 1.1.1.1 1996/04/01 15:02:02 mclareni +* Mathlib gen +* +* + FUNCTION DFRSIN(X) + + IMPLICIT REAL*8 (A-H,O-Z) + DIMENSION A(0:16),B(0:15),C1(0:25),C2(0:28) + + PARAMETER (Z1 = 1, R8 = Z1/8, R32 = Z1/32) + + DATA C0 /1.25331 41373 15500 3D0/ + + DATA NA,NB,NC1,NC2 /16,15,25,28/ + + DATA A( 0) / 0.76435 13866 41860 002D0/ + DATA A( 1) /-0.43135 54754 76601 793D0/ + DATA A( 2) / 0.43288 19997 97266 531D0/ + DATA A( 3) /-0.26973 31033 83871 110D0/ + DATA A( 4) / 0.08416 04532 08769 354D0/ + DATA A( 5) /-0.01546 52448 44613 820D0/ + DATA A( 6) / 0.00187 85542 34398 220D0/ + DATA A( 7) /-0.00016 26497 76188 875D0/ + DATA A( 8) / 0.00001 05739 76563 833D0/ + DATA A( 9) /-0.00000 05360 93398 892D0/ + DATA A(10) / 0.00000 00218 16584 549D0/ + DATA A(11) /-0.00000 00007 29016 212D0/ + DATA A(12) / 0.00000 00000 20373 325D0/ + DATA A(13) /-0.00000 00000 00483 440D0/ + DATA A(14) / 0.00000 00000 00009 865D0/ + DATA A(15) /-0.00000 00000 00000 175D0/ + DATA A(16) / 0.00000 00000 00000 003D0/ + + DATA B( 0) / 0.63041 40431 45705 392D0/ + DATA B( 1) /-0.42344 51140 57053 335D0/ + DATA B( 2) / 0.37617 17264 33436 566D0/ + DATA B( 3) /-0.16249 48915 45095 674D0/ + DATA B( 4) / 0.03822 25577 86330 087D0/ + DATA B( 5) /-0.00564 56347 71321 909D0/ + DATA B( 6) / 0.00057 45495 19768 974D0/ + DATA B( 7) /-0.00004 28707 15321 020D0/ + DATA B( 8) / 0.00000 24512 07499 233D0/ + DATA B( 9) /-0.00000 01109 88418 409D0/ + DATA B(10) / 0.00000 00040 82497 317D0/ + DATA B(11) /-0.00000 00001 24498 302D0/ + DATA B(12) / 0.00000 00000 03200 484D0/ + DATA B(13) /-0.00000 00000 00070 324D0/ + DATA B(14) / 0.00000 00000 00001 336D0/ + DATA B(15) /-0.00000 00000 00000 022D0/ + + DATA C1( 0) / 0.99056 04793 73497 549D0/ + DATA C1( 1) /-0.01218 35098 31478 997D0/ + DATA C1( 2) /-0.00248 27428 23113 060D0/ + DATA C1( 3) / 0.00026 60949 52647 247D0/ + DATA C1( 4) /-0.00000 10790 68987 406D0/ + DATA C1( 5) /-0.00000 48836 81753 933D0/ + DATA C1( 6) / 0.00000 09990 55266 368D0/ + DATA C1( 7) /-0.00000 00750 92717 372D0/ + DATA C1( 8) /-0.00000 00190 79487 573D0/ + DATA C1( 9) / 0.00000 00090 90797 293D0/ + DATA C1(10) /-0.00000 00019 66236 033D0/ + DATA C1(11) / 0.00000 00001 64772 911D0/ + DATA C1(12) / 0.00000 00000 63079 714D0/ + DATA C1(13) /-0.00000 00000 36432 219D0/ + DATA C1(14) / 0.00000 00000 10536 930D0/ + DATA C1(15) /-0.00000 00000 01716 438D0/ + DATA C1(16) /-0.00000 00000 00107 124D0/ + DATA C1(17) / 0.00000 00000 00204 099D0/ + DATA C1(18) /-0.00000 00000 00090 064D0/ + DATA C1(19) / 0.00000 00000 00025 506D0/ + DATA C1(20) /-0.00000 00000 00004 036D0/ + DATA C1(21) /-0.00000 00000 00000 570D0/ + DATA C1(22) / 0.00000 00000 00000 762D0/ + DATA C1(23) /-0.00000 00000 00000 363D0/ + DATA C1(24) / 0.00000 00000 00000 118D0/ + DATA C1(25) /-0.00000 00000 00000 025D0/ + + DATA C2( 0) / 0.04655 77987 37516 4561D0/ + DATA C2( 1) / 0.04499 21302 01239 4140D0/ + DATA C2( 2) /-0.00175 42871 39651 4532D0/ + DATA C2( 3) /-0.00014 65340 02581 0678D0/ + DATA C2( 4) / 0.00003 91330 40863 0159D0/ + DATA C2( 5) /-0.00000 34932 28659 7731D0/ + DATA C2( 6) /-0.00000 03153 53003 2345D0/ + DATA C2( 7) / 0.00000 01876 58200 8529D0/ + DATA C2( 8) /-0.00000 00377 55280 4930D0/ + DATA C2( 9) / 0.00000 00026 65516 5010D0/ + DATA C2(10) / 0.00000 00010 88144 8122D0/ + DATA C2(11) /-0.00000 00005 35500 7671D0/ + DATA C2(12) / 0.00000 00001 31576 5447D0/ + DATA C2(13) /-0.00000 00000 15286 0881D0/ + DATA C2(14) /-0.00000 00000 03394 7646D0/ + DATA C2(15) / 0.00000 00000 02702 0267D0/ + DATA C2(16) /-0.00000 00000 00946 3142D0/ + DATA C2(17) / 0.00000 00000 00207 1565D0/ + DATA C2(18) /-0.00000 00000 00012 6931D0/ + DATA C2(19) /-0.00000 00000 00013 9756D0/ + DATA C2(20) / 0.00000 00000 00008 5929D0/ + DATA C2(21) /-0.00000 00000 00003 1070D0/ + DATA C2(22) / 0.00000 00000 00000 7515D0/ + DATA C2(23) /-0.00000 00000 00000 0648D0/ + DATA C2(24) /-0.00000 00000 00000 0522D0/ + DATA C2(25) / 0.00000 00000 00000 0386D0/ + DATA C2(26) /-0.00000 00000 00000 0165D0/ + DATA C2(27) / 0.00000 00000 00000 0050D0/ + DATA C2(28) /-0.00000 00000 00000 0009D0/ + + V=ABS(X) + IF(V .LT. 8) THEN + Y=R8*V + H=2*Y**2-1 + ALFA=H+H + B1=0 + B2=0 + DO 4 I = NB,0,-1 + B0=B(I)+ALFA*B1-B2 + B2=B1 + 4 B1=B0 + H=SQRT(V)*Y*(B0-B2) + ELSE + R=1/V + H=10*R-1 + ALFA=H+H + B1=0 + B2=0 + DO 5 I = NC1,0,-1 + B0=C1(I)+ALFA*B1-B2 + B2=B1 + 5 B1=B0 + S=B0-H*B2 + B1=0 + B2=0 + DO 6 I = NC2,0,-1 + B0=C2(I)+ALFA*B1-B2 + B2=B1 + 6 B1=B0 + H=C0-SQRT(R)*(S*COS(V)+(B0-H*B2)*SIN(V)) + END IF + IF(X .LT. 0) H=-H + DFRSIN=H + return + end + + + function DFRCOS(X) + + IMPLICIT REAL*8 (A-H,O-Z) + DIMENSION A(0:16),B(0:15),C1(0:25),C2(0:28) + + PARAMETER (Z1 = 1, R8 = Z1/8, R32 = Z1/32) + + DATA C0 /1.25331 41373 15500 3D0/ + + DATA NA,NB,NC1,NC2 /16,15,25,28/ + + DATA A( 0) / 0.76435 13866 41860 002D0/ + DATA A( 1) /-0.43135 54754 76601 793D0/ + DATA A( 2) / 0.43288 19997 97266 531D0/ + DATA A( 3) /-0.26973 31033 83871 110D0/ + DATA A( 4) / 0.08416 04532 08769 354D0/ + DATA A( 5) /-0.01546 52448 44613 820D0/ + DATA A( 6) / 0.00187 85542 34398 220D0/ + DATA A( 7) /-0.00016 26497 76188 875D0/ + DATA A( 8) / 0.00001 05739 76563 833D0/ + DATA A( 9) /-0.00000 05360 93398 892D0/ + DATA A(10) / 0.00000 00218 16584 549D0/ + DATA A(11) /-0.00000 00007 29016 212D0/ + DATA A(12) / 0.00000 00000 20373 325D0/ + DATA A(13) /-0.00000 00000 00483 440D0/ + DATA A(14) / 0.00000 00000 00009 865D0/ + DATA A(15) /-0.00000 00000 00000 175D0/ + DATA A(16) / 0.00000 00000 00000 003D0/ + + DATA B( 0) / 0.63041 40431 45705 392D0/ + DATA B( 1) /-0.42344 51140 57053 335D0/ + DATA B( 2) / 0.37617 17264 33436 566D0/ + DATA B( 3) /-0.16249 48915 45095 674D0/ + DATA B( 4) / 0.03822 25577 86330 087D0/ + DATA B( 5) /-0.00564 56347 71321 909D0/ + DATA B( 6) / 0.00057 45495 19768 974D0/ + DATA B( 7) /-0.00004 28707 15321 020D0/ + DATA B( 8) / 0.00000 24512 07499 233D0/ + DATA B( 9) /-0.00000 01109 88418 409D0/ + DATA B(10) / 0.00000 00040 82497 317D0/ + DATA B(11) /-0.00000 00001 24498 302D0/ + DATA B(12) / 0.00000 00000 03200 484D0/ + DATA B(13) /-0.00000 00000 00070 324D0/ + DATA B(14) / 0.00000 00000 00001 336D0/ + DATA B(15) /-0.00000 00000 00000 022D0/ + + DATA C1( 0) / 0.99056 04793 73497 549D0/ + DATA C1( 1) /-0.01218 35098 31478 997D0/ + DATA C1( 2) /-0.00248 27428 23113 060D0/ + DATA C1( 3) / 0.00026 60949 52647 247D0/ + DATA C1( 4) /-0.00000 10790 68987 406D0/ + DATA C1( 5) /-0.00000 48836 81753 933D0/ + DATA C1( 6) / 0.00000 09990 55266 368D0/ + DATA C1( 7) /-0.00000 00750 92717 372D0/ + DATA C1( 8) /-0.00000 00190 79487 573D0/ + DATA C1( 9) / 0.00000 00090 90797 293D0/ + DATA C1(10) /-0.00000 00019 66236 033D0/ + DATA C1(11) / 0.00000 00001 64772 911D0/ + DATA C1(12) / 0.00000 00000 63079 714D0/ + DATA C1(13) /-0.00000 00000 36432 219D0/ + DATA C1(14) / 0.00000 00000 10536 930D0/ + DATA C1(15) /-0.00000 00000 01716 438D0/ + DATA C1(16) /-0.00000 00000 00107 124D0/ + DATA C1(17) / 0.00000 00000 00204 099D0/ + DATA C1(18) /-0.00000 00000 00090 064D0/ + DATA C1(19) / 0.00000 00000 00025 506D0/ + DATA C1(20) /-0.00000 00000 00004 036D0/ + DATA C1(21) /-0.00000 00000 00000 570D0/ + DATA C1(22) / 0.00000 00000 00000 762D0/ + DATA C1(23) /-0.00000 00000 00000 363D0/ + DATA C1(24) / 0.00000 00000 00000 118D0/ + DATA C1(25) /-0.00000 00000 00000 025D0/ + + DATA C2( 0) / 0.04655 77987 37516 4561D0/ + DATA C2( 1) / 0.04499 21302 01239 4140D0/ + DATA C2( 2) /-0.00175 42871 39651 4532D0/ + DATA C2( 3) /-0.00014 65340 02581 0678D0/ + DATA C2( 4) / 0.00003 91330 40863 0159D0/ + DATA C2( 5) /-0.00000 34932 28659 7731D0/ + DATA C2( 6) /-0.00000 03153 53003 2345D0/ + DATA C2( 7) / 0.00000 01876 58200 8529D0/ + DATA C2( 8) /-0.00000 00377 55280 4930D0/ + DATA C2( 9) / 0.00000 00026 65516 5010D0/ + DATA C2(10) / 0.00000 00010 88144 8122D0/ + DATA C2(11) /-0.00000 00005 35500 7671D0/ + DATA C2(12) / 0.00000 00001 31576 5447D0/ + DATA C2(13) /-0.00000 00000 15286 0881D0/ + DATA C2(14) /-0.00000 00000 03394 7646D0/ + DATA C2(15) / 0.00000 00000 02702 0267D0/ + DATA C2(16) /-0.00000 00000 00946 3142D0/ + DATA C2(17) / 0.00000 00000 00207 1565D0/ + DATA C2(18) /-0.00000 00000 00012 6931D0/ + DATA C2(19) /-0.00000 00000 00013 9756D0/ + DATA C2(20) / 0.00000 00000 00008 5929D0/ + DATA C2(21) /-0.00000 00000 00003 1070D0/ + DATA C2(22) / 0.00000 00000 00000 7515D0/ + DATA C2(23) /-0.00000 00000 00000 0648D0/ + DATA C2(24) /-0.00000 00000 00000 0522D0/ + DATA C2(25) / 0.00000 00000 00000 0386D0/ + DATA C2(26) /-0.00000 00000 00000 0165D0/ + DATA C2(27) / 0.00000 00000 00000 0050D0/ + DATA C2(28) /-0.00000 00000 00000 0009D0/ + + V=ABS(X) + IF(V .LT. 8) THEN + H=R32*V**2-1 + ALFA=H+H + B1=0 + B2=0 + DO 1 I = NA,0,-1 + B0=A(I)+ALFA*B1-B2 + B2=B1 + 1 B1=B0 + H=SQRT(V)*(B0-H*B2) + ELSE + R=1/V + H=10*R-1 + ALFA=H+H + B1=0 + B2=0 + DO 2 I = NC1,0,-1 + B0=C1(I)+ALFA*B1-B2 + B2=B1 + 2 B1=B0 + S=B0-H*B2 + B1=0 + B2=0 + DO 3 I = NC2,0,-1 + B0=C2(I)+ALFA*B1-B2 + B2=B1 + 3 B1=B0 + H=C0-SQRT(R)*((B0-H*B2)*COS(V)-S*SIN(V)) + END IF + IF(X .LT. 0) H=-H + DFRCOS=H + RETURN + END diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoFsiWeightLednicky.F b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoFsiWeightLednicky.F new file mode 100644 index 00000000000..0b51e60da1f --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoFsiWeightLednicky.F @@ -0,0 +1,1577 @@ +c 1 2 3 4 5 6 7 8 +c---------|---------|---------|---------|---------|---------|---------|---------| +*-- Author : R.Lednicky 20/01/95 + SUBROUTINE FSIW(J,WEIF,WEI,WEIN) + +C======================================================================= +C Calculates final state interaction (FSI) weights +C WEIF = weight due to particle - (effective) nucleus FSI (p-N) +C WEI = weight due to p-p-N FSI +C WEIN = weight due to p-p FSI; note that WEIN=WEI if I3C=0; +C note that if I3C=1 the calculation of +C WEIN can be skipped by putting J=0 +C....................................................................... +C Correlation Functions: +C CF(p-p-N) = sum(WEI)/sum(WEIF) +C CF(p-p) = sum(WEIN)/sum(1); here the nucleus is completely +C inactive +C CF(p-p-"N") = sum(WEIN*WEIF')/sum(WEIF'), where WEIN and WEIF' +C are not correlated (calculated at different emission +C points, e.g., for different events); +C thus here the nucleus affects one-particle +C spectra but not the correlation +C....................................................................... +C User must supply data file on unit NUNIT (e.g. =11) specifying +C LL : particle pair +C NS : approximation used to calculate Bethe-Salpeter amplitude +C ITEST: test switch +C If ITEST=1 then also following parameters are required +C ICH : 1(0) Coulomb interaction between the two particles ON (OFF) +C IQS : 1(0) quantum statistics for the two particles ON (OFF) +C ISI : 1(0) strong interaction between the two particles ON (OFF) +C I3C : 1(0) Coulomb interaction with residual nucleus ON (OFF) +C This data file can contain other information useful for the user. +C It is read by subroutines READINT4 and READREA8(4) (or READ_FILE). +C---------------------------------------------------------------------- +C- LL 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 +C- part. 1: n p n a pi+ pi0 pi+ n p pi+ pi+ pi+ pi- K+ K+ K+ K- +C- part. 2: n p p a pi- pi0 pi+ d d K- K+ p p K- K+ p p +C NS=1 y/n: + + + + + - - - - - - - - - - - - +C---------------------------------------------------------------------- +C- LL 18 19 20 21 22 23 24 25 26 27 28 29 30 +C- part. 1: d d t t K0 K0 d p p p n lam p +C- part. 2: d a t a K0 K0b t t a lam lam lam pb +C NS=1 y/n: - - - - - - - - - + + + - +C---------------------------------------------------------------------- +C NS=1 Square well potential, +C NS=3 not used +C NS=4 scattered wave approximated by the spherical wave, +C NS=2 same as NS=4 but the approx. of equal emission times in PRF +C not required (t=0 approx. used in all other cases). +C Note: if NS=2,4, the B-S amplitude diverges at zero distance r* in +C the two-particle c.m.s.; user can specify a cutoff AA in +C SUBROUTINE FSIINI, for example: +C IF(NS.EQ.2.OR.NS.EQ.4)AA=5.D0 !! in 1/GeV --> AA=1. fm +C--------------------------------------------------------------------- +C ITEST=1 any values of parameters ICH, IQS, ISI, I3C are allowed +C and should be given in data file +C ITEST=0 physical values of these parameters are put automatically +C in FSIINI (their values are not required in data file) +C===================================================================== +C At the beginning of calculation user should call FSIINI, +C which reads LL, NS, ITEST (and eventually ICH, IQS, ISI, I3C) +C and initializes various parameters. +C In particular the constants in +C COMMON/FSI_CONS/PI,PI2,SPI,DR,W +C may be useful for the user: +C W=1/.1973D0 ! from fm to 1/GeV +C PI=4*DATAN(1.D0) +C PI2=2*PI +C SPI=DSQRT(PI) +C DR=180.D0/PI ! from radian to degree +C _______________________________________________________ +C !! |Important note: all real quantities are assumed REAL*8 | !! +C ------------------------------------------------------- +C For each event user should fill in the following information +C in COMMONs (all COMMONs in FSI calculation start with FSI_): +C ................................................................... +C COMMON/FSI_POC/AMN,AM1,AM2,CN,C1,C2,AC1,AC2 +C Only +C AMN = mass of the effective nucleus [GeV/c**2] +C CN = charge of the effective nucleus [elem. charge units] +C are required +C ................................................................... +C COMMON/FSI_MOM/P1X,P1Y,P1Z,E1,P1, !part. momenta in the rest frame +C 1 P2X,P2Y,P2Z,E2,P2 !of effective nucleus (NRF) +C Only the components +C PiX,PiY,PiZ [GeV/c] +C in NRF are required. +C To make the corresponding Lorentz transformation user can use the +C subroutines LTRAN and LTRANB +C ................................................................... +C COMMON/FSI_COOR/X1,Y1,Z1,T1,R1, ! 4-coord. of emission +C 1 X2,Y2,Z2,T2,R2 ! points in NRF +C The componets +C Xi,Yi,Zi [fm] +C and emission times +C Ti [fm/c] +C should be given in NRF with the origin assumed at the center +C of the effective nucleus. If the effect of residual nucleus is +C not calculated within FSIW, the NRF can be any fixed frame. +C----------------------------------------------------------------------- +C Before calling FSIW the user must call +C CALL LTRAN12 +C Besides Lorentz transformation to pair rest frame: +C (p1-p2)/2 --> k* it also transforms 4-coordinates of +C emission points from fm to 1/GeV and calculates Ei,Pi and Ri. +C Note that |k*|=AK in COMMON/FSI_PRF/ +C----------------------------------------------------------------------- +C After making some additional filtering using k* (say k* < k*max) +C or direction of vector k*, +C user can finally call FSIW to calculate the FSI weights +C to be used to construct the correlation function +C======================================================================= + + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_JR/JRAT + COMMON/FSI_POC/AMN,AM1,AM2,CN,C1,C2,AC1,AC2 + COMMON/FSI_MOM/P1X,P1Y,P1Z,E1,P1, ! particle momenta in NRF + 1 P2X,P2Y,P2Z,E2,P2 + COMMON/FSI_PRF/PPX,PPY,PPZ,AK,AKS, ! k*=(p1-p2)/2 and x1-x2 + 1 X,Y,Z,T,RP,RPS ! in pair rest frame (PRF) + COMMON/FSI_COOR/X1,Y1,Z1,T1,R1, !4-coord. of emis. points in NRF + 1 X2,Y2,Z2,T2,R2 + COMMON/FSI_NS/LL,NS,ICH,ISI,IQS,I3C,I3S + COMMON/FSI_FFPN/FF12,FF21 + COMPLEX*16 FF12,FF21 +C------------------------------------------------------------------ +C==> AC1,2 = "relativistic" Bohr radii for particle-nucleus systems + C1N=C1*CN + IF(C1N.NE.0.D0)AC1=137.036D0/(C1N*E1) !m1-->E1 + C2N=C2*CN + IF(C2N.NE.0.D0)AC2=137.036D0/(C2N*E2) !m2-->E2 + +C----------------------------------------------------------- + CALL FSIPN(WEIF) !weight due to particle-nucleus FSI + JRAT=0 + call BoostToPrf() + CALL FSIWF(WEI) !weight due to particle-particle-nucleus FSI + WEIN=WEI + IF(I3C*J.NE.0) THEN + FF12=DCMPLX(1.D0,0.D0) + FF21=DCMPLX(1.D0,0.D0) + JRAT=1 + CALL VZ(WEIN) ! weight due to particle-particle FSI + ENDIF + RETURN + END +C======================================================================= + + SUBROUTINE LTRAN(P0,P,PS) +C==>calculating particle 4-momentum PS={PSX,PSY,PSZ,ES} +C in rest frame of a system 0 with 4-momentum P0={P0X,P0Y,P0Z,E0} +C from its 4-momentum P={PX,PY,PZ,E} + + IMPLICIT REAL*8 (A-H,O-Z) + DIMENSION P0(4),P(4),PS(4) +C----------------------------------------------------------------------- + P0S=P0(1)**2+P0(2)**2+P0(3)**2 + AM0=DSQRT(P0(4)**2-P0S) + EPM=P0(4)+AM0 + PP0=P(1)*P0(1)+P(2)*P0(2)+P(3)*P0(3) + H=(PP0/EPM-P(4))/AM0 + PS(1)=P(1)+P0(1)*H + PS(2)=P(2)+P0(2)*H + PS(3)=P(3)+P0(3)*H + PS(4)=(P0(4)*P(4)-PP0)/AM0 + RETURN + END + + SUBROUTINE LTRANB(P0,PS,P) +C==>calculating particle 4-momentum P={PX,PY,PZ,E} +C from its 4-momentum PS={PSX,PSY,PSZ,ES} +C in rest frame of a system 0 with 4-momentum P0={P0X,P0Y,P0Z,E0} + + IMPLICIT REAL*8 (A-H,O-Z) + DIMENSION P0(4),P(4),PS(4) +C----------------------------------------------------------------------- + P0S=P0(1)**2+P0(2)**2+P0(3)**2 + AM0=DSQRT(P0(4)**2-P0S) + EPM=P0(4)+AM0 + PSP0=PS(1)*P0(1)+PS(2)*P0(2)+PS(3)*P0(3) + HS=(PSP0/EPM+PS(4))/AM0 + P(1)=PS(1)+P0(1)*HS + P(2)=PS(2)+P0(2)*HS + P(3)=PS(3)+P0(3)*HS + P(4)=(P0(4)*PS(4)+PSP0)/AM0 + RETURN + END + + SUBROUTINE LTRAN12 +C==>calculating particle momentum in PRF {EE,PPX,PPY,PPZ} from +C- the momentum of the first particle {E1,P1X,P1Y,P1Z) in NRF + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_MOM/P1X,P1Y,P1Z,E1,P1, !part. momenta in NRF + 1 P2X,P2Y,P2Z,E2,P2 + COMMON/FSI_PRF/PPX,PPY,PPZ,AK,AKS, + 1 X,Y,Z,T,RP,RPS + COMMON/FSI_POC/AMN,AM1,AM2,CN,C1,C2,AC1,AC2 + COMMON/FSI_P12/P12X,P12Y,P12Z,E12,P12,AM12,EPM + COMMON/FSI_COOR/X1,Y1,Z1,T1,R1, !4-coord. of emis. points in NRF + 1 X2,Y2,Z2,T2,R2 + COMMON/FSI_CONS/PI,PI2,SPI,DR,W + +C fm --> 1/GeV + X1=X1*W + Y1=Y1*W + Z1=Z1*W + T1=T1*W + X2=X2*W + Y2=Y2*W + Z2=Z2*W + T2=T2*W +C calculating Ri, Pi and Ei + R1=DSQRT(X1*X1+Y1*Y1+Z1*Z1) + R2=DSQRT(X2*X2+Y2*Y2+Z2*Z2) + P1S=P1X*P1X+P1Y*P1Y+P1Z*P1Z + P2S=P2X*P2X+P2Y*P2Y+P2Z*P2Z + P1=DSQRT(P1S) + P2=DSQRT(P2S) + E1=DSQRT(AM1*AM1+P1S) + E2=DSQRT(AM2*AM2+P2S) +C----------------------------------------------------------------------- + E12=E1+E2 + P12X=P1X+P2X + P12Y=P1Y+P2Y + P12Z=P1Z+P2Z + P12S=P12X**2+P12Y**2+P12Z**2 + AM12=DSQRT(E12**2-P12S) + EPM=E12+AM12 + P12=DSQRT(P12S) + P112=P1X*P12X+P1Y*P12Y+P1Z*P12Z + H1=(P112/EPM-E1)/AM12 + PPX=P1X+P12X*H1 + PPY=P1Y+P12Y*H1 + PPZ=P1Z+P12Z*H1 + EE=(E12*E1-P112)/AM12 + AKS=EE**2-AM1**2 + AK=DSQRT(AKS) + +CW WRITE(6,38)'AK ',AK,'K ',PPX,PPY,PPZ,EE +38 FORMAT(A7,E11.4,A7,4E11.4) + RETURN + END + + SUBROUTINE FSIPN(WEIF) +C calculating particle-nucleus Coulomb Wave functions FFij + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_POC/AMN,AM1,AM2,CN,C1,C2,AC1,AC2 + COMMON/FSI_MOM/P1X,P1Y,P1Z,E1,P1, !part. momenta in NRF + 1 P2X,P2Y,P2Z,E2,P2 + COMMON/FSI_COOR/X1,Y1,Z1,T1,R1, ! 4-coord. of emis. points in NRF + 1 X2,Y2,Z2,T2,R2 + COMMON/FSI_NS/LL,NS,ICH,ISI,IQS,I3C,I3S + COMMON/FSI_ACH/HPR,AC,ACH,ACHR,ISPIN,MSPIN + COMMON/FSI_ICH1/ICH1 + COMMON/FSI_ETA/ETA + COMMON/FSI_FFPN/FF12,FF21 + COMPLEX*16 FF1,FF12,FF21 + FF12=DCMPLX(1.D0,0.D0) + FF21=DCMPLX(1.D0,0.D0) +C ACH=1.D0 +C WEIF=1.D0 + IF(I3C.EQ.0)RETURN + ICH1=IDINT(C1) + IF(ICH1.EQ.0)GOTO 11 + XH=AC1*P1 + ACH=ACP(XH) + ACHR=DSQRT(ACH) + ETA=0.D0 + IF(XH.NE.0.D0)ETA=1/XH + RHOS=P1*R1 + HS=X1*P1X+Y1*P1Y+Z1*P1Z + FF12=FF12*FF1(RHOS,HS) + IF(IQS.EQ.0)GOTO 11 + RHOS=P1*R2 + HS=X2*P1X+Y2*P1Y+Z2*P1Z + FF21=FF21*FF1(RHOS,HS) + 11 ICH1=IDINT(C2) + IF(ICH1.EQ.0)GOTO 10 + XH=AC2*P2 + ACH=ACP(XH) + ACHR=DSQRT(ACH) + ETA=0.D0 + IF(XH.NE.0.D0)ETA=1/XH + RHOS=P2*R2 + HS=X2*P2X+Y2*P2Y+Z2*P2Z + FF12=FF12*FF1(RHOS,HS) +CW WRITE(6,41)'AC2 ',AC2,'ACH ',ACH,'ETA ',ETA,'RHOS ',RHOS,'HS ',HS +41 FORMAT(5(A5,E11.4)) +CW WRITE(6,40)'FF12 ',DREAL(FF12),DIMAG(FF12) + IF(IQS.EQ.0)GOTO 10 + RHOS=P2*R1 + HS=X1*P2X+Y1*P2Y+Z1*P2Z + FF21=FF21*FF1(RHOS,HS) +CW WRITE(6,41)'AC1 ',AC1,'ACH ',ACH,'ETA ',ETA,'RHOS ',RHOS,'HS ',HS +CW WRITE(6,40)'FF21 ',DREAL(FF21),DIMAG(FF21) +40 FORMAT(A7,2E12.4) + 10 CONTINUE + +C WEIF = the weight due to the Coulomb particle-nucleus interaction + WEIF=DREAL(FF12)**2+DIMAG(FF12)**2 + IF(IQS.EQ.1)WEIF=0.5D0*(WEIF+DREAL(FF21)**2+DIMAG(FF21)**2) + RETURN + END + + FUNCTION GPIPI(X,J) +C--- GPIPI = k*COTG(DELTA), X=k^2 +C-- J=1(2) corresponds to isospin=0(2) + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_AAPI/AAPI(20,2) + COMMON/FSI_C/HELP(20),AM,AMS,DM + OM=DSQRT(X+AMS) + XX=X/AMS + GPIPI=OM/AAPI(1,J) + GPIPI=GPIPI*(1+(AAPI(3,J)-AAPI(1,J)**2)*XX+AAPI(4,J)*XX*XX) + GPIPI=GPIPI/(1+(AAPI(3,J)+AAPI(2,J)/AAPI(1,J))*XX) + RETURN + END + + FUNCTION GPIN(X,J) +C--- GPIN = k*COTG(DELTA), X=k^2 +C-- J=1(2) corresponds to piN isospin=1/2(3/2) + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_AAPIN/AAPIN(20,2) + GPIN=1/AAPIN(1,J)+.5D0*AAPIN(2,J)*X + RETURN + END + + FUNCTION GND(X,J) +C--- GND = k*COTG(DELTA), X=k^2 +C--- J=1(2) corresp. to nd(pd), S=1/2, +C--- J=3(4) corresp. to nd(pd), S=3/2 + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_AAND/AAND(20,4) + XX=X + GND=1/AAND(1,J)+.5D0*AAND(2,J)*X + DO 1 I=4,4 + XX=XX*X + 1 GND=GND+AAND(I,J)*XX + GND=GND/(1+AAND(3,J)*X) + RETURN + END + FUNCTION GDD(X,J) +C--- GDD = k*COTG(DELTA), X=k^2 +C--- J=1,2,3 corresp. to S=0,1,2 + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_AADD/AADD(20,3) + COMMON/FSI_C/C(10),AM,AMS,DM + COMMON/FSI_CONS/PI,PI2,SPI,DR,W + COMPLEX*16 C + E=X/2/AM + ER=DSQRT(E) + IF(J.EQ.1)THEN + GDD=ER*(AADD(1,1)*DEXP(-E/AADD(2,1))-AADD(3,1)) + GDD=GDD/DR ! from degree to radian + TAND=DTAN(GDD) + IF(TAND.EQ.0.D0)TAND=1.D-10 + GDD=DSQRT(X)/TAND + END IF + IF(J.EQ.2)THEN + GDD=1.D10 + END IF + IF(J.EQ.3)THEN + GDD=ER*(AADD(1,3)+AADD(2,3)*E) + GDD=GDD/DR ! from degree to radian + TAND=DTAN(GDD) + IF(TAND.EQ.0.D0)TAND=1.D-10 + GDD=DSQRT(X)/TAND + END IF + RETURN + END + BLOCK DATA + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_AAPI/AAPI(20,2)/FSI_AAND/AAND(20,4) + COMMON/FSI_AADD/AADD(20,3)/FSI_AAPIN/AAPIN(20,2) + COMMON/FSI_AAKK/AAKK(9)/FSI_AAPAP/AAPAPR(3,2),AAPAPI(3,2) +C---Parameters for GPIPI (I,J), J=1,2 -> isospin=0,2 + DATA AAPI/.2600D00, .2500D00, .3480D00,-.0637D00, 16*0.D0, + 1 -.0280D00,-.0820D00, .2795D00,-.0086D00, 16*0.D0/ +C---Parameters for GPIN (I,J), J=1,2 -> piN isospin=1/2,3/2 + DATA AAPIN/ .12265D1, .1563D2, 18*0.D0, + 1 -.750D0, .7688D2, 18*0.D0/ +C---Parameters for GND (I,J), J=1(2) corresp. to nd(pd), S=1/2, +C--- J=3(4) corresp. to nd(pd), S=3/2 + DATA AAND/-.3295D1,-.8819D3, .4537D4, .28645D5, 16*0.D0, + 1 -.13837D2, .11505D2, .0D0, .10416D2, 16*0.D0, + 2 -.32180D2, .1014D2, .0D0, .0D0, 16*0.D0, + 3 -.60213D2, .1333D2, .0D0,-.70309D2, 16*0.D0/ + DATA AADD/ .10617D4, .3194D-2, .56849D3, 17*0.D0, + 1 20*0.D0, + 2 -.1085D4, .1987D5, 18*0.D0/ +C--- AAKK= m_K^2, m_pi^2, m_eta^2, m_S*^2, m_delta^2, +C--- gam(S*-->KK-b), gam(S*-->pipi), gam(delta-->KK-b), +C--- gam(delta-->pi eta) + DATA AAKK/.247677D00,.01947977D00,.2997015D00,.9604D00, + 1 .96511D00, +cc 2 .792D00, .199D00, .333D00, .222D00/ ! Martin (77) + 2 .094D00, .110D00, .333D00, .222D00/ ! Morgan (93) +C---Parameters for PAP (I,J), j=1,2 -> isospin I=0,2 +C--- i=1-3 -> a_singlet, a_triplet, d [fm] +C--- Im a_IS (I=isospin, S=spin) are fixed by atomic data and +C n-bar survival time up to one free parameter, e.g. Im a_00 +C--- Batty (89), Kerbikov (93): +C--- Ima_10=1.96-Ima_00, Ima_01=0.367-Ima_00/3, Ima_11=0.453+Ima_00/3 +C--- In DATA we put Ima_00=0.3. +C--- Re a_IS are fixed by atomic data up to three free parameters +C--- Batty (89): +C--- Rea_aver(pp-bar)=Re[(a_00+a_10)+3(a_01+a_11)]/8=-0.9 +C--- In DATA we used Rea_IS from Paris potential Pignone (94) +C--- rescaled by 1.67 to satisfy the atomic constraint. +C--- Effective radius is is taken independent of IS from the phase +C--- shift fit by Pirner et al. (91). + DATA AAPAPR/-0.94D0, -1.98D0, .1D0, + 1 -1.40D0, 0.37D0, .1D0/ ! Re + DATA AAPAPI/ 0.3 D0, .267D0,-.01D0, + 1 1.66D0, .553D0,-.01D0/ ! Im + END + SUBROUTINE CKKB ! calculates KK-b scattering amplitude, + ! saturated by S*(980) and delta(982) resonances + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_PRF/PPX,PPY,PPZ,AK,AKS, + 1 X,Y,Z,T,RP,RPS + COMMON/FSI_AAKK/AAKK(9) + COMMON/FSI_C/C(10),AM,AMS,DM + COMPLEX*16 C + S4=AKS+AAKK(1) + S=4*S4 + AKPIPI=DSQRT(S4-AAKK(2)) + EETA2=(S+AAKK(3)-AAKK(2))**2/4/S + AKPIETA=DSQRT(EETA2-AAKK(3)) + C(1)=AAKK(6)/2/DCMPLX(AAKK(4)-S, + ,-AK*AAKK(6)-AKPIPI*AAKK(7)) + C(1)=C(1)+AAKK(8)/2/DCMPLX(AAKK(5)-S, + ,-AK*AAKK(8)-AKPIETA*AAKK(9)) + RETURN + END + SUBROUTINE CPAP ! calculates pp-bar scattering amplitude + ! accounting for nn-bar->pp-bar channel + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_ACH/HPR,AC,ACH,ACHR,ISPIN,MSPIN + COMMON/FSI_PRF/PPX,PPY,PPZ,AK,AKS, + 1 X,Y,Z,T,RP,RPS + COMMON/FSI_AAPAP/AAPAPR(3,2),AAPAPI(3,2) + COMMON/FSI_C/C(10),AM,AMS,DM + COMMON/FSI_2CHA/AK2,AK2S,AAK,HCP2,AMU2_AMU1 ! k* (kappa) for 2-nd channel + COMPLEX*16 C + DATA AM2/.93956563D0/ + AMU2_AMU1=AM2/AM ! AM2=2*mu(nn-bar), AM=2*mu(pp-bar) + AK2S0=AMU2_AMU1*AKS + AK2S =AK2S0-2*AM2*(AM2-AM) + IF(AK2S.GE.0.D0)THEN + AK2=DCMPLX(DSQRT(AK2S),0.D0) ! k2 + ELSE + AK2=DCMPLX(0.D0,DSQRT(-AK2S)) ! kappa2 + ENDIF + C(10)=C(6+(ISPIN-1)*2)+ + + DCMPLX(AAPAPR(3,ISPIN)*AKS/2-0.016D0-HCP2, + , AAPAPI(3,ISPIN)*AKS/2-AAK) ! (1/f)11 + C(5)=C(6+(ISPIN-1)*2)+ + + DCMPLX(AAPAPR(3,ISPIN)*AK2S0/2, + , AAPAPI(3,ISPIN)*AK2S0/2) + IF(AK2S.GE.0.D0)THEN + C(5)=C(5)-DCMPLX(0.D0,AK2) + ELSE + C(5)=C(5)+DCMPLX(AK2,0.D0) ! (1/f)22 + ENDIF + C(10)=C(10)*C(5)-C(7+(ISPIN-1)*2)*C(7+(ISPIN-1)*2) + C(ISPIN)=C(5)/C(10) ! f11 + C(ISPIN+2)=-C(7+(ISPIN-1)*2)/C(10) ! f12 + RETURN + END + + SUBROUTINE FSIIN(I_ITEST,I_ICH,I_IQS,I_ISI,I_I3C) +C SUBROUTINE FSIINI +C---Note: +C-- ICH= 0 (1) if the Coulomb interaction is absent (present); +C-- ISPIN= JJ= 1,2,..,MSPIN denote increasing values of the pair +C-- total spin S. +C-- To calculate the CF of two particles (with masses m1, m2 and +C-- charges C1, C2) the following information is required: +C-- AM= twice the reduced mass= 2*m1*m2/(m1+m2) in GeV/c^2, +C-- DM= (m1-m2)/(m1+m2), required if NS=2; +C-- AC= Bohr radius= 2*137.036*0.1973/(C1*C2*AMH) in fm; +C-- AC > 1.D9 if C1*C2= 0, AC < 0 if C1*C2 < 0; +C-- MSPIN= MSPINH(LL)= number of the values of the total pair spin S; +C-- FD= FDH(LL,JJ), RD= RDH(LL,JJ)= scattering length and effective +C-- radius for each value of the total pair spin S, JJ= 1,..,MSPIN; ; +C-- the corresponding square well parameters EB= EBH(LL,JJ), RB= +C-- RBH(LL,JJ) (required if NS=1) may be calculated by sear.f; +C-- if the effective range approximation is not valid (as is the case, +C-- e.g., for two-pion system) a code for calculation of the scattering +C-- amplitude should be supplemented; +C-- RHO= RHOH(LL,JJ), SF= SFH(LL,JJ), SE= SEH(LL) are spin factors; +C-- RHO= the probability that the spins j1 and j2 of the two particles +C-- will combine in a total spin S; +C-- RHO= (2*S+1)/[(2j1+1)*(2j2+1)] for unpolarized particles; +C-- RHO= (1-P1*P2)/4 and (3+P1*P2)/4 correspond to S=0 and 1 in the +C-- case of spin-1/2 particles with polarizations P1 and P2; +C----------------------------------------------------------------------- + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_POC/AMN,AM1,AM2,CN,C1,C2,AC1,AC2 + COMMON/FSI_PRF/PPX,PPY,PPZ,AK,AKS, + 1 X,Y,Z,T,RP,RPS + COMMON/FSI_SPIN/RHO(10) + COMMON/FSI_ACH/HPR,AC,ACH,ACHR,ISPIN,MSPIN + COMMON/FSI_NS/LL,NS,ICH,ISI,IQS,I3C,I3S + COMMON/FSI_FD/FD(10),RD(10) + COMMON/FSI_C/C(10),AM,AMS,DM + COMMON/FSI_CONS/PI,PI2,SPI,DR,W + COMPLEX*16 C + COMMON/FSI_AA/AA + COMMON/FSI_AAPI/AAPI(20,2)/FSI_AAND/AAND(20,4) + COMMON/FSI_AAPIN/AAPIN(20,2) + COMMON/FSI_AAPAP/AAPAPR(3,2),AAPAPI(3,2) + COMMON/FSI_SW/RB(10),EB(10),BK(10),CDK(10),SDK(10), + 1 SBKRB(10),SDKK(10) + COMMON/FSI_FDH/FDH(30,10),RDH(30,10),EBH(30,10),RBH(30,10) + COMMON/FSI_RHOH/RHOH(30,10) + COMMON/FSI_AMCH/AM1H(30),AM2H(30),C1H(30),C2H(30),MSPINH(30) +C============= declarations pour l'appel de READ_FILE()============ +c CHARACTER*10 KEY +c CHARACTER*8 CH8 +c INTEGER*4 INT4 +c REAL*8 REAL8 +c INTEGER*4 IERR +C +C--- mass of the first and second particle + DATA AM1H/.93956563D0,.93827231D0,.93956563D0,3.72737978D0, + C .13957D0,.13498D0,.13957D0, .93956563D0, .93827231D0, + C 4*.13957D0,4*.493677D0, + C 2*1.87561339D0,2*2.80892165D0,2*.497672D0, + C 1.87561339D0,3*.93827231D0,.93956563D0, + C 1.115684D0,.93827231D0/ + DATA AM2H/.93956563D0,.93827231D0,.93827231D0,3.72737978D0, + C .13957D0,.13498D0,.13957D0, 2*1.87561339D0, + C 2*.493677D0,2*.93827231D0, + C 2*.493677D0,2*.93827231D0, + C 1.87561339D0,3.72737978D0,2.80892165D0,3.72737978D0, + C 2*.497672D0,2*2.80892165D0,3.72737978D0, + C 3*1.115684D0,.93827231D0/ +c--------|---------|---------|---------|---------|---------|---------|---------- +C--- charge of the first and second particle + DATA C1H/0.D0,1.D0,0.D0,2.D0, 1.D0,0.D0,1.D0,0.D0,1.D0, + C 3*1.D0,-1.D0,3*1.D0,-1.D0, + C 4*1.D0,2*0.D0,4*1.D0,2*0.D0, 1.D0/ + DATA C2H/0.D0,1.D0,1.D0,2.D0,-1.D0,0.D0,3*1.D0, + C -1.D0,3*1.D0,-1.D0,3*1.D0, + C 1.D0,2.D0,1.D0,2.D0,2*0.D0,2*1.D0,2.D0,3*0.D0,-1.D0/ +C---MSPIN vs (LL) + DATA MSPINH/3*2,4*1,2*2,8*1,3,1,2,1,2*1,2*2,1,3*2, 2/ +C---Spin factors ======================== + W=1/.1973D0 ! from fm to 1/GeV + PI=4*DATAN(1.D0) + PI2=2*PI + SPI=DSQRT(PI) + DR=180.D0/PI ! from radian to degree + AC1=1.D10 + AC2=1.D10 +C=======< condition de calculs >============= + NUNIT=11 ! for IBM in Nantes +C NUNIT=4 ! for SUN in Prague +C++ CALL readint4(NUNIT,'ITEST ',ITEST) +C++ CALL readint4(NUNIT,'NS ',NS) + ITEST=I_ITEST + IF(ITEST.EQ.1)THEN +C++ CALL readint4(NUNIT,'ICH ',ICH) +C++ CALL readint4(NUNIT,'IQS ',IQS) +C++ CALL readint4(NUNIT,'ISI ',ISI) +C++ CALL readint4(NUNIT,'I3C ',I3C) + ICH=I_ICH + IQS=I_IQS + ISI=I_ISI + I3C=I_I3C + ENDIF +C============================================ + IF (IFIRST.LE.1) THEN + DO 3 J1=1,30 + DO 3 J2=1,10 + FDH(J1,J2)=FDH(J1,J2)*W + RDH(J1,J2)=RDH(J1,J2)*W + 3 RBH(J1,J2)=RBH(J1,J2)*W +C print *,"FD,RD,EB,RB: ",FDH(J1,J2),RDH(J1,J2),EBH(J1,J2),RBH(J1,J2) + + ENDIF +C=================================== + RETURN + END +C + SUBROUTINE LLINI(lll,I_NS,I_ITEST) +C===> Initialisation for a given LL value. +C =========================================== + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_POC/AMN,AM1,AM2,CN,C1,C2,AC1,AC2 + COMMON/FSI_SPIN/RHO(10) + COMMON/FSI_ACH/HPR,AC,ACH,ACHR,ISPIN,MSPIN + COMMON/FSI_NS/LL,NS,ICH,ISI,IQS,I3C,I3S + COMMON/FSI_FD/FD(10),RD(10) + COMMON/FSI_C/C(10),AM,AMS,DM + COMMON/FSI_CONS/PI,PI2,SPI,DR,W + COMPLEX*16 C + COMMON/FSI_AA/AA + COMMON/FSI_PRF/PPX,PPY,PPZ,AK,AKS, + 1 X,Y,Z,T,RP,RPS + COMMON/FSI_AAPI/AAPI(20,2)/FSI_AAND/AAND(20,4) + COMMON/FSI_AAPIN/AAPIN(20,2) + COMMON/FSI_SW/RB(10),EB(10),BK(10),CDK(10),SDK(10), + 1 SBKRB(10),SDKK(10) + COMMON/FSI_FDH/FDH(30,10),RDH(30,10),EBH(30,10),RBH(30,10) + COMMON/FSI_RHOH/RHOH(30,10) + COMMON/FSI_AMCH/AM1H(30),AM2H(30),C1H(30),C2H(30),MSPINH(30) + COMMON/FSI_AAKK/AAKK(9)/FSI_AAPAP/AAPAPR(3,2),AAPAPI(3,2) + +C++----- add to be able to call several time------- + integer ifirst + data ifirst/0/ + ifirst=ifirst+1 + +C===> LL - Initialisation ======================================== +C---- Setting particle masses and charges + LL=lll + NS=I_NS + AM1=AM1H(LL) + AM2=AM2H(LL) + C1=C1H(LL) + C2=C2H(LL) +C print *,"llini: ",AM1,AM2,C1,C2 +C---> Switches: +C ISI=1(0) the strong interaction between the two particles ON (OFF) +C IQS=1(0) the quantum statistics ON (OFF); +C should be OFF for nonidentical particles +C I3C=1(0) the Coulomb interaction with the nucleus ON (OFF) +C I3S=1(0) the strong interaction with the nucleus ON (OFF) +C ICH=1(0) if C1*C2 is different from 0 (is equal to 0) +C- To switch off the Coulomb force between the two particles +C put ICH=0 and substitute the strong amplitude parameters by +C the ones not affected by Coulomb interaction +C---- -------------------------------------------------------------------- + IF (I_ITEST.NE.1) THEN + ICH=0 + IF(C1*C2.NE.0.D0) ICH=1 + IQS=0 + IF(C1+AM1.EQ.C2+AM2) IQS=1 + I3S=0 ! only this option is available + ISI=1 + I3C=1 + ENDIF +C---> Calcul. twice the reduced mass (AM), the relative +C mass difference (DM) and the Bohr radius (AC) + AM=2*AM1*AM2/(AM1+AM2) + AMS=AM*AM + DM=(AM1-AM2)/(AM1+AM2) + AC=1.D10 + C12=C1*C2 + IF(C12.NE.0.D0)AC=2*137.036D0/(C12*AM) +C---Setting spin factors + MSPIN=MSPINH(LL) +C print *,"MSPIN: ",MSPIN + MSP=MSPIN + DO 91 ISPIN=1,10 + 91 RHO(ISPIN)=RHOH(LL,ISPIN) +C 91 print *,"RHO: ",ISPIN,RHO(ISPIN) +C---> Integration limit AA in the spherical wave approximation + AA=0.D0 +cc IF(NS.EQ.2.OR.NS.EQ.4)AA=.5D0 !!in 1/GeV --> 0.1 fm + IF(NS.EQ.2.OR.NS.EQ.4)AA=6.D0 !!in 1/GeV --> 1.2 fm +C---> Setting scatt. length (FD), eff. radius (RD) and, if possible, +C-- also the corresp. square well parameters (EB, RB) + DO 55 JJ=1,MSP + ISPIN=JJ + FD(JJ)=FDH(LL,JJ) + RD(JJ)=RDH(LL,JJ) + EB(JJ)=EBH(LL,JJ) + RB(JJ)=RBH(LL,JJ) +C print *,"FD,RD,EB,RB: ",FD(JJ),RD(JJ),EB(JJ),RB(JJ) +C---Resets FD and RD for a nucleon-deuteron system (LL=8,9) + IF(LL.EQ.8.OR.LL.EQ.9)THEN + JH=LL-7+2*JJ-2 + FD(JJ)=AAND(1,JH) + RD(JJ)=AAND(2,JH)-2*AAND(3,JH)/AAND(1,JH) + ENDIF +C---Resets FD and RD for a pion-pion system (LL=5,6,7) + IF(LL.EQ.5.OR.LL.EQ.6.OR.LL.EQ.7)THEN + IF(LL.EQ.7)FD(JJ)=AAPI(1,2)/AM + IF(LL.EQ.5)FD(JJ)=(.6667D0*AAPI(1,1)+.3333D0*AAPI(1,2))/AM + IF(LL.EQ.6)FD(JJ)=(.3333D0*AAPI(1,1)+.6667D0*AAPI(1,2))/AM + AKS=0.D0 + DAKS=1.D-5 + AKSH=AKS+DAKS + AKH=DSQRT(AKSH) + GPI1H=GPIPI(AKSH,1) + GPI2H=GPIPI(AKSH,2) + H=1/FD(JJ) + IF(LL.EQ.7)C(JJ)=1/DCMPLX(GPI2H,-AKH) + IF(LL.EQ.5) + + C(JJ)=.6667D0/DCMPLX(GPI1H,-AKH)+.3333D0/DCMPLX(GPI2H,-AKH) + IF(LL.EQ.6) + + C(JJ)=.3333D0/DCMPLX(GPI1H,-AKH)+.6667D0/DCMPLX(GPI2H,-AKH) + HH=DREAL(1/C(JJ)) + RD(JJ)=2*(HH-H)/DAKS + ENDIF +C---Resets FD and RD for a pion-nucleon system (LL=12,13) + IF(LL.EQ.12.OR.LL.EQ.13)THEN + IF(LL.EQ.12)FD(JJ)=AAPIN(1,2) + IF(LL.EQ.13)FD(JJ)=(.6667D0*AAPIN(1,1)+.3333D0*AAPIN(1,2)) + AKS=0.D0 + DAKS=1.D-5 + AKSH=AKS+DAKS + AKH=DSQRT(AKSH) + GPI1H=GPIN(AKSH,1) + GPI2H=GPIN(AKSH,2) + H=1/FD(JJ) + IF(LL.EQ.12)C(JJ)=1/DCMPLX(GPI2H,-AKH) + IF(LL.EQ.13) + + C(JJ)=.6667D0/DCMPLX(GPI1H,-AKH)+.3333D0/DCMPLX(GPI2H,-AKH) + HH=DREAL(1/C(JJ)) + RD(JJ)=2*(HH-H)/DAKS + ENDIF +C---fm to 1/GeV for pp-bar system + IF(LL.EQ.30)THEN + IF(IFIRST.LE.1)THEN + DO 4 I3=1,3 + AAPAPR(I3,JJ)=AAPAPR(I3,JJ)*W + 4 AAPAPI(I3,JJ)=AAPAPI(I3,JJ)*W +C 4 print *,"AAPAPR,AAPAPI: ",AAPAPR(I3,JJ),AAPAPI(I3,JJ) +C--- Calculates complex elements M11=M22=C(6), M12=M21=C(7) for I=0 +C--- at k*=0 M11=M22=C(8), M12=M21=C(9) for I=1 + C(7+(JJ-1)*2)=2*DCMPLX(AAPAPR(1,JJ),AAPAPI(1,JJ))* + * DCMPLX(AAPAPR(2,JJ),AAPAPI(2,JJ)) ! 2a_0Sa_1S + C(6+(JJ-1)*2)=DCMPLX(AAPAPR(1,JJ)+AAPAPR(2,JJ), + , AAPAPI(1,JJ)+AAPAPI(2,JJ))/ + / C(7+(JJ-1)*2) ! M11=M22 + C(7+(JJ-1)*2)=-DCMPLX(AAPAPR(1,JJ)-AAPAPR(2,JJ), + , AAPAPI(1,JJ)-AAPAPI(2,JJ))/ + / C(7+(JJ-1)*2) ! M12=M21 + ENDIF + ENDIF +C---Calculation continues for any system (any LL) + 55 CONTINUE + RETURN + END +C======================================================= +C + +c++ This routine is used to init mass and charge of the nucleus. + + SUBROUTINE FSINUCL(R_AMN,R_CN) + + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_POC/AMN,AM1,AM2,CN,C1,C2,AC1,AC2 + + AMN=R_AMN + CN=R_CN + + RETURN + END + +C====================================================== +C + + SUBROUTINE FSIMOMENTUM(PP1,PP2) + + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_MOM/P1X,P1Y,P1Z,E1,P1, ! particle momenta in NRF + 1 P2X,P2Y,P2Z,E2,P2 + + + REAL*8 PP1(3),PP2(3) +c Print *,"momentum",pp1,pp2 + P1X=PP1(1) + P1Y=PP1(2) + P1Z=PP1(3) + P2X=PP2(1) + P2Y=PP2(2) + P2Z=PP2(3) + RETURN + END + + + +C====================================================== +C + + SUBROUTINE FSIPOSITION(XT1,XT2) + + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_COOR/X1,Y1,Z1,T1,R1, !4-coord. of emis. points in NRF + 1 X2,Y2,Z2,T2,R2 + + REAL*8 XT1(4),XT2(4) +clc print *,'fsi',xt1,xt2 + X1=XT1(1) + Y1=XT1(2) + Z1=XT1(3) + T1=XT1(4) + X2=XT2(1) + Y2=XT2(2) + Z2=XT2(3) + T2=XT2(4) + RETURN + END + + +C====================================================== +C====================================================== +C + subroutine BoostToPrf() + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_CVK/V,CVK + COMMON/FSI_MOM/P1X,P1Y,P1Z,E1,P1, !part. momenta in NRF + 1 P2X,P2Y,P2Z,E2,P2 + COMMON/FSI_PRF/PPX,PPY,PPZ,AK,AKS, + 1 X,Y,Z,T,RP,RPS + COMMON/FSI_COOR/X1,Y1,Z1,T1,R1, ! 4-coord. of emis. points in NRF + 1 X2,Y2,Z2,T2,R2 + COMMON/FSI_P12/P12X,P12Y,P12Z,E12,P12,AM12,EPM + + XS=X1-X2 + YS=Y1-Y2 + ZS=Z1-Z2 + TS=T1-T2 + RS12=XS*P12X+YS*P12Y+ZS*P12Z + H1=(RS12/EPM-TS)/AM12 + X=XS+P12X*H1 + Y=YS+P12Y*H1 + Z=ZS+P12Z*H1 + T=(E12*TS-RS12)/AM12 + RPS=X*X+Y*Y+Z*Z + RP=DSQRT(RPS) +CW WRITE(6,38)'RP ',RP,'X ',X,Y,Z,T +38 FORMAT(A7,E11.4,A7,4E11.4) + + CVK=(P12X*PPX+P12Y*PPY+P12Z*PPZ)/(P12*AK) + V=P12/E12 + return + end + + SUBROUTINE FSIWF(WEI) +C==> Prepares necessary quantities and call VZ(WEI) to calculate +C the weight due to FSI + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_CVK/V,CVK + COMMON/FSI_MOM/P1X,P1Y,P1Z,E1,P1, !part. momenta in NRF + 1 P2X,P2Y,P2Z,E2,P2 + COMMON/FSI_PRF/PPX,PPY,PPZ,AK,AKS, + 1 X,Y,Z,T,RP,RPS + COMMON/FSI_COOR/X1,Y1,Z1,T1,R1, ! 4-coord. of emis. points in NRF + 1 X2,Y2,Z2,T2,R2 + COMMON/FSI_POC/AMN,AM1,AM2,CN,C1,C2,AC1,AC2 + COMMON/FSI_SPIN/RHO(10) + COMMON/FSI_BP/B,P + COMMON/FSI_ETA/ETA + COMMON/FSI_ACH/HPR,AC,ACH,ACHR,ISPIN,MSPIN + COMMON/FSI_SW/RB(10),EB(10),BK(10),CDK(10),SDK(10), + 1 SBKRB(10),SDKK(10) + COMMON/FSI_NS/LL,NS,ICH,ISI,IQS,I3C,I3S + COMMON/FSI_RR/F(10) + COMMON/FSI_FD/FD(10),RD(10) + COMMON/FSI_C/C(10),AM,AMS,DM + COMPLEX*16 C,F + COMMON/FSI_AA/AA + COMMON/FSI_SHH/SH,CHH + COMMON/FSI_AAPI/AAPI(20,2)/FSI_AAND/AAND(20,4) + COMMON/FSI_AAPIN/AAPIN(20,2) + COMMON/FSI_P12/P12X,P12Y,P12Z,E12,P12,AM12,EPM + COMMON/FSI_2CHA/AK2,AK2S,AAK,HCP2,AMU2_AMU1 ! k* (kappa) for 2-nd channel +C==>calculating relative 4-coordinates of the particles in PRF +C- {T,X,Y,Z} from the relative coordinates {TS,XS,YS,ZS} in NRF + XS=X1-X2 + YS=Y1-Y2 + ZS=Z1-Z2 + TS=T1-T2 + RS12=XS*P12X+YS*P12Y+ZS*P12Z + H1=(RS12/EPM-TS)/AM12 + X=XS+P12X*H1 + Y=YS+P12Y*H1 + Z=ZS+P12Z*H1 + T=(E12*TS-RS12)/AM12 + RPS=X*X+Y*Y+Z*Z + RP=DSQRT(RPS) +CW WRITE(6,38)'RP ',RP,'X ',X,Y,Z,T +38 FORMAT(A7,E11.4,A7,4E11.4) + + CVK=(P12X*PPX+P12Y*PPY+P12Z*PPZ)/(P12*AK) + V=P12/E12 + +C ACH=1.D0 + IF(ICH.EQ.0)GOTO 21 + XH=AC*AK + ACH=ACP(XH) + ACHR=DSQRT(ACH) + ETA=0.D0 + IF(XH.NE.0.D0)ETA=1/XH +C---HCP, HPR needed (e.g. in GST) if ICH=1 + HCP=HC(XH) + HPR=HCP+.1544313298D0 +C AAK=ACH*AK ! +C HCP2=2*HCP/AC ! needed to calculate C(JJ) for charged particles + 21 CONTINUE + MSP=MSPIN + DO 30 JJ=1,MSP + ISPIN=JJ + IF(NS.NE.1)GOTO22 +C---Calc. quantities for the square well potential; +C-- for LL=6-26 the square well potential is not possible or available + IF(LL.EQ.4)GOTO 22 + BK(JJ)=DSQRT(EB(JJ)**2+AKS) + XRA=2*RB(JJ)/AC + HRA=BK(JJ)*RB(JJ) + CALL SEQ(XRA,HRA) + SBKRB(JJ)=HRA*B + HRA=AK*RB(JJ) + CALL GST(XRA,HRA) + SDK(JJ)=SH + CDK(JJ)=CHH + SDKK(JJ)=RB(JJ) + IF(AK.NE.0.D0)SDKK(JJ)=SH/AK + IF(ICH.EQ.1)SDK(JJ)=ACH*SDK(JJ) + 22 CONTINUE +C----------------------------------------------------------------------- +C---Calc. the strong s-wave scattering amplitude = C(JJ) +C-- divided by Coulomb penetration factor squared (if ICH=1) + IF(NS.NE.1)GOTO 230 + IF(LL.NE.4)GOTO 230 ! SW scat. amplitude used for alfa-alfa only + GAK=G(AK) + AKACH=AK + IF(ICH.EQ.1)AKACH=AK*ACH + C(JJ)=1/DCMPLX(GAK,-AKACH) ! amplitude for the SW-potential + GOTO 30 + 230 IF(LL.EQ.5.OR.LL.EQ.6.OR.LL.EQ.7)GOTO20 ! pipi + IF(LL.EQ.12.OR.LL.EQ.13)GOTO20 ! piN + IF(LL.EQ.8.OR.LL.EQ.9.OR.LL.EQ.18)GOTO20 ! Nd, dd + IF(LL.EQ.14.OR.LL.EQ.17.OR.LL.EQ.23)GOTO27 ! K+K-, K-p, K0K0-b + IF(LL.EQ.30)GOTO 28 ! pp-bar + A1=RD(JJ)*FD(JJ)*AKS + A2=1+.5D0*A1 + IF(ICH.EQ.1)A2=A2-2*HCP*FD(JJ)/AC + AKF=AK*FD(JJ) + IF(ICH.EQ.1)AKF=AKF*ACH + C(JJ)=FD(JJ)/DCMPLX(A2,-AKF) + GOTO30 + 20 CONTINUE +C---Calc. scatt. ampl. C(JJ) for pipi, piN and Nd, dd + JH=LL-7+2*JJ-2 + IF(LL.EQ.8.OR.LL.EQ.9)GPI2=GND(AKS,JH) + IF(LL.EQ.18)GPI2=GDD(AKS,JJ) + IF(LL.EQ.5.OR.LL.EQ.6.OR.LL.EQ.7)GPI2=GPIPI(AKS,2) + IF(LL.EQ.12.OR.LL.EQ.13)GPI2=GPIN(AKS,2) + C(JJ)=1.D0/DCMPLX(GPI2,-AK) !pi+pi+, nd, pd, pi+p, dd + IF(LL.NE.5.AND.LL.NE.6.AND.LL.NE.13)GOTO27 + IF(LL.EQ.5.OR.LL.EQ.6)GPI1=GPIPI(AKS,1) + IF(LL.EQ.13)GPI1=GPIN(AKS,1) + IF(LL.EQ.5.OR.LL.EQ.13) + c C(JJ)=.6667D0/DCMPLX(GPI1,-AK)+.3333D0*C(JJ) !pi+pi-,pi-p + IF(LL.EQ.6)C(JJ)=.3333D0/DCMPLX(GPI1,-AK)+.6667D0*C(JJ) !pi0pi0 + 27 CONTINUE +C---Calc. K+K-, K0K0-b or K-p s-wave scatt. ampl. + IF(LL.EQ.14.OR.LL.EQ.23)CALL CKKB +c IF(LL.EQ.17)C(JJ)=DCMPLX(-3.29D0,3.55D0) ! Martin'76 (K-p) +c IF(LL.EQ.17)C(JJ)=DCMPLX(3.29D0,3.55D0) ! Martin'76 (K-p) WRONG SIGN!!! + IF(LL.EQ.17)C(JJ)=DCMPLX(-2.585D0,4.156D0) ! Borasoy'04 (K-p) +c IF(LL.EQ.17)C(JJ)=DCMPLX(-3.371D0,3.244D0) ! Martin'81 (K-p) +C---Calc. pi+pi-, pi+pi+, pd, pi+p, pi-p, K+K- or K-p s-wave scatt. ampl. +C-- divided by Coulomb penetration factor squared (if ICH=1) + IF(ICH.EQ.0)GOTO 30 + AAK=ACH*AK ! + HCP2=2*HCP/AC ! needed to calculate C(JJ) for charged particles + C(JJ)=1/(1/C(JJ)-HCP2+DCMPLX(0.D0,AK-AAK)) + GOTO 30 + 28 CONTINUE +C---Calc. pp-bar s-wave scatt. ampl. + CALL CPAP + 30 CONTINUE +C*********************************************************************** + CALL VZ(WEI) + RETURN + END + SUBROUTINE VZ(WEI) +C==> Calculates the weight WEI due to FSI + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_JR/JRAT + COMMON/FSI_PRF/PPX,PPY,PPZ,AK,AKS, + 1 X,Y,Z,T,RP,RPS + COMMON/FSI_SPIN/RHO(10) + COMMON/FSI_ETA/ETA + COMMON/FSI_AA/AA + COMMON/FSI_FFF/F12,F21 + COMMON/FSI_ACH/HPR,AC,ACH,ACHR,ISPIN,MSPIN + COMMON/FSI_NS/LL,NS,ICH,ISI,IQS,I3C,I3S + COMMON/FSI_FD/FD(10),RD(10) + COMMON/FSI_RR/F(10) + COMMON/FSI_C/C(10),AM,AMS,DM + COMMON/FSI_COULPH/EIDC + COMPLEX*16 F,C,G,PSI12,PSI21 + COMPLEX*16 F12,F21 + COMPLEX*16 EIDC + COMPLEX*8 Z8,CGAMMA + COMMON/FSI_FFPN/FF12,FF21 + COMPLEX*16 FF12,FF21 + COMMON/FSI_2CHA/AK2,AK2S,AAK,HCP2,AMU2_AMU1 ! k* (kappa) for 2-nd channel + WEI=0.D0 + IF(JRAT.EQ.1)GOTO 11 + RHOS=AK*RP + HS=X*PPX+Y*PPY+Z*PPZ + IF(RHOS.LT.15.D0.AND.RHOS+DABS(HS).LT.20.D0)GOTO 2 +C---Calc. EIDC=exp(i*Coul.Ph.); +C-- used in calc. of hypergeom. f-s in SEQA, FAS at k*R > 15, 20 + Z8=CMPLX(1.,SNGL(ETA)) + Z8=CGAMMA(Z8) + EIDC=Z8/CABS(Z8) + 2 CALL FF(RHOS,HS) + 11 MSP=MSPIN + IF(ISI.EQ.0)GOTO 4 ! the strong interaction ON (OFF) if ISI=1(0) + IF(RP.LT.AA)GOTO 4 + IF(JRAT.NE.1) CALL FIRT + IF(IQS.EQ.0)GOTO 5 ! the quantum statistics ON (OFF) if IQS=1(0) + JSIGN=-1 + DO 1 JJ=1,MSP + JSIGN=-JSIGN + G=F(JJ)*C(JJ) + IF(ICH.EQ.1)G=G*ACHR + PSI12=FF12*(F12+G) + PSI21=FF21*(F21+G) + G=PSI12+JSIGN*PSI21 + 1 WEI=WEI+RHO(JJ)*(DREAL(G)**2+DIMAG(G)**2) + GOTO 8 + 5 DO 6 JJ=1,MSP + G=F(JJ)*C(JJ) + IF(ICH.EQ.1)G=G*ACHR +CW WRITE(6,38)'JJ ',JJ,'F ',DREAL(F(JJ)),DIMAG(F(JJ)) +CW WRITE(6,38)'JJ ',JJ,'C ',DREAL(C(JJ)),DIMAG(C(JJ)) +CW WRITE(6,38)'JJ ',JJ,'G ',DREAL(G),DIMAG(G) +CW WRITE(6,38)'JJ ',JJ,'F12+G ',DREAL(F12+G),DIMAG(F12+G) +CW WRITE(6,38)'JJ ',JJ,'F21+G ',DREAL(F21+G),DIMAG(F21+G) +38 FORMAT(A7,I3,A7,2E11.4) + PSI12=FF12*(F12+G) + 6 WEI=WEI+RHO(JJ)*(DREAL(PSI12)**2+DIMAG(PSI12)**2) +c--- Account for nn-bar->pp-bar channel --------------------------- + IF(LL.EQ.30)THEN + DO 61 JJ=1,MSP + HH=RHO(JJ)*(DREAL(C(JJ+2))**2+DIMAG(C(JJ+2))**2)* + * AMU2_AMU1*ACH/RPS + IF(AK2S.LT.0)HH=HH*DEXP(-2*RP*AK2) + 61 WEI=WEI+HH + ENDIF +c------------------------------------------------------------------ + RETURN + 4 PSI12=FF12*F12 + IF(IQS.EQ.0)GOTO 50 ! the quantum statistics ON (OFF) if IQS=1(0) + PSI21=FF21*F21 + JSIGN=-1 + DO 3 JJ=1,MSP + JSIGN=-JSIGN + G=PSI12+JSIGN*PSI21 + 3 WEI=WEI+RHO(JJ)*(DREAL(G)**2+DIMAG(G)**2) + GOTO 8 + 50 WEI=DREAL(PSI12)**2+DIMAG(PSI12)**2 + RETURN + 8 WEI=WEI/2 + RETURN + END + SUBROUTINE FIRT +C---CALC. THE F(JJ) +C-- F(JJ)*C(JJ)= DEVIATION OF THE BETHE-SALPETER AMPL. FROM PLANE WAVE + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_PRF/PPX,PPY,PPZ,AK,AKS, + 1 X,Y,Z,T,RP,RPS + COMMON/FSI_SHH/SH,CHH + COMMON/FSI_BP/B,P + COMMON/FSI_ACH/HPR,AC,ACH,ACHR,ISPIN,MSPIN + COMMON/FSI_C/C(10),AM,AMS,DM + COMMON/FSI_SW/RB(10),EB(10),BK(10),CDK(10),SDK(10), + 1 SBKRB(10),SDKK(10) + COMMON/FSI_NS/LL,NS,ICH,ISI,IQS,I3C,I3S + COMMON/FSI_RR/F(10) + EQUIVALENCE(RSS,RP),(TSS,T) + COMPLEX*16 F,C,CH1 + MSP=MSPIN + DO 10 JJ=1,MSP + IF(JJ.GT.1)GOTO 3 + XRA=2*RSS/AC + IF(AK.NE.0.D0)GOTO2 + SHK=1.D0 + SH=.0D0 + SHH=SH + CHH=1/RSS + GOTO3 + 2 H=AK*RSS + CALL GST(XRA,H) + SH=SH/RSS + CHH=CHH/RSS + SHH=SH + IF(ICH.EQ.1) SHH=ACH*SH + 3 IF(NS.EQ.2)GOTO1 +C---F= ASYMPTOTIC FORMULA (T= 0 APPROX.); NS= 4 + 6 F(JJ)=DCMPLX(CHH,SHH) + IF(NS.NE.1)GOTO 10 +C---F INSIDE THE SQUARE-WELL (T= 0 APPROX.); NS= 1 + IF(RSS.GE.RB(JJ)) GOTO 10 + IF(AK.NE.0.D0.AND.JJ.EQ.1)SHK=SH/AK + H=BK(JJ)*RSS + CALL GST(XRA,H) + SKR=B*BK(JJ) + F(JJ)=DCMPLX(CDK(JJ),SDK(JJ))*SKR + CH1=(SDKK(JJ)*SKR-SHK*SBKRB(JJ))/C(JJ) + F(JJ)=(F(JJ)+CH1)/SBKRB(JJ) + GOTO 10 + 1 CONTINUE +C---F= ASYMPTOTIC FORMULA (T= 0 NOT REQUIRED); NS= 2 + IF(JJ.GT.1)GOTO 8 + IF(TSS.EQ.0.D0)GOTO6 + TSSA=DABS(TSS) + IF(DM.NE.0.D0)GOTO 11 + H=AM*.5D0/TSSA + IF(AK.NE.0.D0)GOTO4 + HM=H*RPS + IF(HM.GE.3.D15)GOTO6 + FS1=DFRSIN(HM) + FC1=DFRCOS(HM) + FC2=FC1 + FS2=FS1 + GOTO5 + 4 CONTINUE + H1=AK*TSSA/AM + HM=H*(RSS-H1)**2 + HP=H*(RSS+H1)**2 + IF(HP.GE.3.D15)GOTO6 + FS1=DFRSIN(HM) + FC1=DFRCOS(HM) + FS2=DFRSIN(HP) + FC2=DFRCOS(HP) + GOTO 5 + 11 CONTINUE + FS1=0.D0 + FS2=0.D0 + FC1=0.D0 + FC2=0.D0 + DO 13 I=1,2 + IF(I.EQ.1)TSSH=TSSA*(1+DM) + IF(I.EQ.2)TSSH=TSSA*(1-DM) + H=AM*.5D0/TSSH + IF(AK.NE.0.D0)GOTO 12 + HM=H*RPS + IF(HM.GE.3.D15)GOTO6 + FS1=FS1+DFRSIN(HM)/2 + FC1=FC1+DFRCOS(HM)/2 + IF(I.EQ.1)GOTO 13 + FC2=FC1 + FS2=FS1 + GOTO 13 + 12 CONTINUE + H1=AK*TSSH/AM + HM=H*(RSS-H1)**2 + HP=H*(RSS+H1)**2 + IF(HP.GE.3.D15)GOTO6 + FS1=FS1+DFRSIN(HM)/2 + FC1=FC1+DFRCOS(HM)/2 + FS2=FS2+DFRSIN(HP)/2 + FC2=FC2+DFRCOS(HP)/2 + 13 CONTINUE + 5 C12=FC1+FS2 + S12=FS1+FC2 + A12=FS1-FC2 + A21=FS2-FC1 + A2=.5D0*(CHH*(A12+A21)+SH*(A12-A21))+SHH + A1=.5D0*(CHH*(C12+S12)+SH*(C12-S12)) + F(JJ)=.3989422D0*DCMPLX(A1,A2) + GOTO 10 + 8 F(JJ)=F(1) + 10 CONTINUE + RETURN + END + FUNCTION EXF(X) + IMPLICIT REAL*8 (A-H,O-Z) + IF(X.LT.-15.D0) GO TO 1 + EXF=DEXP(X) + RETURN + 1 EXF=.0D0 + RETURN + END + SUBROUTINE SEQ(X,H) +C---CALC. FUNCTIONS B, P (EQS. (17) OF G-K-L-L); +C-- NEEDED TO CALC. THE CONFLUENT HYPERGEOMETRIC FUNCTION GST. + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_BP/B,P + DIMENSION BH(3),PH(3) + DATA ERR/1.D-7/ + BH(1)=1.D0 + PH(1)=1.D0 + PH(2)=.0D0 + BH(2)=.5D0*X + B=1+BH(2) + P=1.D0 + HS=H*H + J=0 + 2 J=J+1 + BH(3)=(X*BH(2)-HS*BH(1))/((J+1)*(J+2)) + PH(3)=(X*PH(2)-HS*PH(1)-(2*J+1)*X*BH(2))/(J*(J+1)) + B=B+BH(3) + P=P+PH(3) + Z=DABS(BH(2))+DABS(BH(3))+DABS(PH(2))+DABS(PH(3)) + IF(Z.LT.ERR)RETURN + BH(1)=BH(2) + BH(2)=BH(3) + PH(1)=PH(2) + PH(2)=PH(3) + GOTO 2 + END + SUBROUTINE SEQA(X,H) +C---CALC. FUNCTIONS CHH=REAL(GST), SH=IMAG(GST)/ACH, B=SH/H +C-- IN THE ASYMPTOTIC REGION H=K*R >> 1. + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_BP/B,P + COMMON/FSI_SHH/SH,CHH + COMMON/FSI_ETA/ETA + COMMON/FSI_ACH/HPR,AC,ACH,ACHR,ISPIN,MSPIN + COMMON/FSI_COULPH/EIDC + COMPLEX*16 EIDC,GST + ARG=H-ETA*DLOG(2*H) + GST=DCMPLX(DCOS(ARG),DSIN(ARG)) + GST=ACHR*EIDC*GST + CHH=DREAL(GST) + SH=DIMAG(GST)/ACH + B=SH/H + RETURN + END + SUBROUTINE FF(RHO,H) +C---Calc. F12, F21; +C-- F12= FF0* plane wave, FF0=F*ACHR, +C---F is the confluent hypergeometric function, +C-- ACHR=sqrt(ACH), where ACH is the Coulomb factor + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_ACH/HPR,AC,ACH,ACHR,ISPIN,MSPIN + COMMON/FSI_NS/LL,NS,ICH,ISI,IQS,I3C,I3S + COMMON/FSI_ETA/ETA + COMMON/FSI_FFF/F12,F21 + COMPLEX*16 FF0,F12,F21 + C=DCOS(H) + S=DSIN(H) + F12=DCMPLX(C,-S) + F21=DCMPLX(C,S) + IF(ICH.EQ.0)RETURN + RHOP=RHO+H + RHOM=RHO-H + F12=FF0(RHO,H)*F12 + F21=FF0(RHO,-H)*F21 + RETURN + END + FUNCTION FAS(RKS) +C-- FAS=F*ACHR +C---F is the confluent hypergeometric function at k*r >> 1 +C-- ACHR=sqrt(ACH), where ACH is the Coulomb factor + IMPLICIT REAL*8 (A-H,O-Z) + COMPLEX*16 FAS,EIDC,ZZ1 + COMMON/FSI_ACH/HPR,AC,ACH,ACHR,ISPIN,MSPIN + COMMON/FSI_ETA/ETA + COMMON/FSI_COULPH/EIDC + D1=DLOG(RKS)*ETA + D2=ETA*ETA/RKS + ZZ1=DCMPLX(DCOS(D1),DSIN(D1))/EIDC + FAS=DCMPLX(1.D0,-D2)*ZZ1 + FAS=FAS-DCMPLX(DCOS(RKS),DSIN(RKS))*ETA/RKS/ZZ1 + RETURN + END + FUNCTION FF0(RHO,H) +C-- FF0=F*ACHR +C-- F is the confluent hypergeometric function +C-- (Eq. (15) of G-K-L-L), F= 1 at r* << AC +C-- ACHR=sqrt(ACH), where ACH is the Coulomb factor + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_ACH/HPR,AC,ACH,ACHR,ISPIN,MSPIN + COMMON/FSI_NS/LL,NS,ICH,ISI,IQS,I3C,I3S + COMMON/FSI_ETA/ETA + COMPLEX*16 ALF,ALF1,Z,S,A,FF0,FAS + DATA ERR/1.D-5/ + S=DCMPLX(1.D0,0.D0) + FF0=S + RHOP=RHO+H +CC GOTO 5 ! rejects the approx. calcul. of hyperg. f-ion F + IF(RHOP.LT.20.D0)GOTO5 + FF0=FAS(RHOP) ! approx. calc. + RETURN + 5 ALF=DCMPLX(.0D0,-ETA) + ALF1=ALF-1 + Z=DCMPLX(.0D0,RHOP) + J=0 + 3 J=J+1 + A=(ALF1+J)/(J*J) + S=S*A*Z + FF0=FF0+S + ZR=DABS(DREAL(S)) + ZI=DABS(DIMAG(S)) + IF((ZR+ZI).GT.ERR)GOTO3 + FF0=FF0*ACHR + RETURN + END + FUNCTION HC(XA) +C---HC = h-function of Landau-Lifshitz: h(x)=Re[psi(1-i/x)]+ln(x) +C-- psi(x) is the digamma function (the logarithmic derivative of +C-- the gamma function) + IMPLICIT REAL*8 (A-H,O-Z) + DIMENSION BN(15) + DATA BN/.8333333333D-1,.8333333333D-2,.396825396825D-2, + 1 .4166666667D-2,.7575757576D-2,.2109279609D-1, + 2 .8333333333D-1,.4432598039D0 ,.305395433D1, + 3 .2645621212D2, .2814601449D3, .3607510546D4, + 4 .5482758333D5, .9749368235D6, .200526958D8/ + X=DABS(XA) + IF(X.LT..33D0) GOTO 1 +CC IF(X.GE.3.5D0) GO TO 2 + S=.0D0 + N=0 + 3 N=N+1 + DS=1.D0/N/((N*X)**2+1) + S=S+DS + IF(DS.GT.0.1D-12) GOTO 3 +C---Provides 7 digit accuracy + HC=S-.5772156649D0+DLOG(X) + RETURN +CC 2 HC=1.2D0/X**2+DLOG(X)-.5772156649 D0 +CC RETURN + 1 X2=X*X + XP=X2 + HC=0.D0 + IMA=9 + IF(X.LT.0.1D0)IMA=3 + DO 4 I=1,IMA + HC=HC+XP*BN(I) + 4 XP=X2*XP + RETURN + END + FUNCTION ACP(X) +C--- ACP = COULOMB PENETRATION FACTOR + IMPLICIT REAL*8 (A-H,O-Z) + IF(X.LT.0.05D0.AND.X.GE.0.D0) GO TO 1 + Y=6.2831853D0/X + ACP=Y/(EXF(Y)-1) + RETURN + 1 ACP=1.D-6 + RETURN + END + SUBROUTINE GST(X,H) +C---CALC. THE CONFL. HYPERGEOM. F-N = CHH+i*SH +C-- AND THE COULOMB F-S B, P (CALLS SEQ OR SEQA). + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_ACH/HPR,AC,ACH,ACHR,ISPIN,MSPIN + COMMON/FSI_NS/LL,NS,ICH,ISI,IQS,I3C,I3S + COMMON/FSI_SHH/SH,CHH + COMMON/FSI_BP/B,P + 1 IF(ICH.EQ.1)GOTO 2 + 3 SH=DSIN(H) + CHH=DCOS(H) + B=1.D0 + IF(H.NE.0.D0)B=SH/H + P=CHH + RETURN + 2 CONTINUE + IF(H.GT.15.D0)GOTO4 ! comment out if you want to reject + ! the approximate calculation of hyperg. f-ion G + CALL SEQ(X,H) ! exact calculation + SH=H*B + CHH=P+B*X*(DLOG(DABS(X))+HPR) + RETURN + 4 CALL SEQA(X,H) + RETURN + END + FUNCTION FF1(RHO,H) +C---FF1=FF0; used for particle-nucleus system +C-- FF0=F12*ACHR +C-- F12 is the confluent hypergeometric function +C-- (Eq. (15) of G-K-L-L), F12= 1 at r* << AC +C-- ACHR=sqrt(ACH), where ACH is the Coulomb factor + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_ACH/HPR,AC,ACH,ACHR,ISPIN,MSPIN + COMMON/FSI_NS/LL,NS,ICH,ISI,IQS,I3C,I3S + COMMON/FSI_ETA/ETA + COMMON/FSI_COULPH/EIDC + COMMON/FSI_ICH1/ICH1 + COMPLEX*16 FF0,FF1 + COMPLEX*16 EIDC + COMPLEX*8 Z8,CGAMMA + FF1=DCMPLX(1.D0,0.D0) + IF(ICH1.EQ.0)GOTO 2 + IF(RHO.LT.15.D0.AND.RHO+H.LT.20.D0)GOTO 2 +C---Calc. EIDC=exp(i*Coul.Ph.); +C-- used in calc. of hypergeom. f-s in SEQA, FAS at k*R > 15, 20 + Z8=CMPLX(1.,SNGL(ETA)) + Z8=CGAMMA(Z8) + EIDC=Z8/CABS(Z8) + 2 FF1=FF0(RHO,H) + RETURN + END + + FUNCTION G(AK) +C---Used to calculate SW scattering amplitude for alpa-alpha system +C-- and for sear.f (square well potential search) +C---NOTE THAT SCATT. AMPL.= 1/CMPLX(G(AK),-AK*ACH) + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_SW/RB(10),EB(10),BK(10),CDK(10),SDK(10), + 1 SBKRB(10),SDKK(10) + COMMON/FSI_NS/LL,NS,ICH,ISI,IQS,I3C,I3S + COMMON/FSI_ACH/HPR,AC,ACH,ACHR,JJ,MSPIN + COMMON/FSI_BP/B,P/FSI_DERIV/BPR,PPR/FSI_SHH/SH,CHH + COMMON/FSI_DAK/DAK,HAC,IFUN + HAC=.0D0 + ACH=1.D0 + IF(ICH.EQ.0)GOTO 1 + XH=AC*AK + HCP=HC(XH) + HPR=HCP+.1544313298D0 + ACH=ACP(XH) + HAC=2*HCP/AC + 1 AKS=AK**2 + BK(JJ)=DSQRT(AKS+EB(JJ)**2) ! kappa=kp + X=2*RB(JJ)/AC + H=BK(JJ)*RB(JJ) ! kp*d + CALL GST(X,H) + BRHO=B ! B(kp,d) + SBKRB(JJ)=SH ! kp*d*B(kp,d) + CALL DERIW(X,H) + BRHOP=BPR ! B'(kp,d)= dB(kp,r)/dln(r) at r=d + H=AK*RB(JJ) + CALL GST(X,H) + CDK(JJ)=CHH ! ReG(k,d) + BRHOS=B ! B(k,d) + PRHOS=P ! P(k,d) + SDK(JJ)=SH + IF(ICH.EQ.0)GOTO 2 + SDK(JJ)=ACH*SH ! ImG(k,d) + IF(AK.EQ.0.D0.AND.AC.LT.0.D0)SDK(JJ)=3.14159*X*B + 2 SDKK(JJ)=RB(JJ) + IF(AK.NE.0.D0)SDKK(JJ)=SH/AK ! d*B(k,d) + CALL DERIW(X,H) ! PPR=P'(k,d)= dP(k,r)/dln(r) at r=d + ZZ=PPR-PRHOS + IF(ICH.EQ.1)ZZ=ZZ+X*(BRHOS+BPR*(DLOG(DABS(X))+HPR)) +C ZZ= P'(k,d)-P(k,d)+x*{B(k,d)+B'(k,d)*[ln!x!+2*C-1+h(k*ac)]} + GG=(BRHOP*CDK(JJ)-BRHO*ZZ)/RB(JJ) +C GG= [B'(kp,d)*ReG(k,d)-B(kp,d)*ZZ]/d + G=GG/(BRHO*BPR-BRHOP*BRHOS) +C G= GG/[B(kp,d)*B'(k,d)-B'(kp,d)*B(k,d)] + RETURN + END + SUBROUTINE DERIW(X,H) +C---CALLED BY F-N G(AK) + IMPLICIT REAL*8 (A-H,O-Z) + COMMON/FSI_NS/LL,NS,ICH,ISI,IQS,I3C,I3S + COMMON/FSI_BP/B,P/FSI_DERIV/BPR,PPR + HH=.1D-3 + CALL GST(X,H-HH) + Q1=P + B1=B + CALL GST(X,H+HH) + HHH=HH+HH + BPR=H*(B-B1)/HHH + PPR=H*(P-Q1)/HHH + IF(ICH.EQ.0)RETURN + CALL GST(X-HH,H) + Q1=P + B1=B + CALL GST(X+HH,H) + BPR=BPR+X*(B-B1)/HHH + PPR=PPR+X*(P-Q1)/HHH + RETURN + END +C================================================================ + + SUBROUTINE READ_FILE(KEY,CH8,INT4,REAL8,IERR,NUNIT) +C ========== +C +C Routine to read one parameter of the program in the file +C DATA NUNIT defined in FSI3B EXEC +C NUNIT=11 for IBM in Nantes, 4 for SUN in Prague +C +C INPUT : KEY (CHARACTER*10) : +C OUTPUT : case of KEY : CH8 : (CHARACTER*8) +C INT4 : (INTEGER*4) +C REAL8 : (REAL*8) +C (only one of them) +C IERR (INTEGER) : 0 : no error +C 1 : key not found + + CHARACTER*10 KEY,TEST + CHARACTER*4 TYPE + CHARACTER*8 CH8 + INTEGER*4 INT4 + REAL*8 REAL8 + INTEGER*4 IERR + + IERR=0 + REWIND(NUNIT) +1 READ(NUNIT,FMT='(A10,2X,A4)')TEST,TYPE + IF (TEST.EQ.KEY) THEN + BACKSPACE(NUNIT) + IF (TYPE.EQ.'CHAR') READ(NUNIT,FMT='(18X,A8,54X)')CH8 + IF (TYPE.EQ.'INT4') READ(NUNIT,FMT='(18X,I8,54X)')INT4 + IF (TYPE.EQ.'REA8') READ(NUNIT,FMT='(18X,F10.5,52X)')REAL8 + ELSE + IF (TEST.NE.'* E.O.F. *') THEN + GOTO 1 + ELSE + IERR=1 + ENDIF + ENDIF +c IF(IERR.EQ.1)STOP + RETURN + END + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoHelix.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoHelix.h new file mode 100644 index 00000000000..c63bfb0a5d4 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoHelix.h @@ -0,0 +1,40 @@ +/*************************************************************************** + * + * $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.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 AliFemtoHelix_hh +#define AliFemtoHelix_hh + +#include "AliFmHelix.h" +typedef AliFmHelix AliFemtoHelix;//! +#include "AliFmPhysicalHelixD.h" +typedef AliFmPhysicalHelixD AliFemtoPhysicalHelix;//! +#endif diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoHiddenInfo.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoHiddenInfo.h new file mode 100644 index 00000000000..f6256b23b4e --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoHiddenInfo.h @@ -0,0 +1,32 @@ +//////////////////////////////////////////////////////////////////////////////// +/// AliFemtoHiddenInfo - pure virtual base class for the hidden info /// +/// Hidden info stores additional information, which is not in a standard /// +/// track. +//////////////////////////////////////////////////////////////////////////////// + +#ifndef AliFemtoHiddenInfo_hh +#define AliFemtoHiddenInfo_hh + +#include "AliFemtoTypes.h" + +class AliFemtoHiddenInfo{ + + public: + AliFemtoHiddenInfo(){/* no-op */}; + virtual ~AliFemtoHiddenInfo(){/* no-op */}; + + // !!! MANDATORY !!! + // --- Copy the hidden info from AliFemtoTrack to AliFemtoParticle + virtual AliFemtoHiddenInfo* Clone() const; + + protected: + virtual AliFemtoHiddenInfo* GetParticleHiddenInfo() const =0; + +}; +//_______________________________________ +inline AliFemtoHiddenInfo* AliFemtoHiddenInfo::Clone() const{ + // return exact copy of this hidden info + return GetParticleHiddenInfo(); +} + +#endif diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKTPairCut.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKTPairCut.cxx new file mode 100644 index 00000000000..fddd0f05004 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKTPairCut.cxx @@ -0,0 +1,211 @@ +///////////////////////////////////////////////////////////////////////////// +// // +// AliFemtoKTPairCut - a pair cut which selects pairs based on their // +// transverse momentum kT // +// // +///////////////////////////////////////////////////////////////////////////// +/*************************************************************************** + * + * $Id: AliFemtoKTPairCut.cxx,v 1.1.2.2 2007/11/09 11:20:35 akisiel Exp $ + * + * Author: Adam Kisiel, Ohio State, kisiel@mps.ohio-state.edu + *************************************************************************** + * + * Description: part of STAR HBT Framework: AliFemtoMaker package + * a cut to remove "shared" and "split" pairs + * + *************************************************************************** + * + * + **************************************************************************/ +#include "AliFemtoKTPairCut.h" +#include +#include +#include + +#ifdef __ROOT__ +ClassImp(AliFemtoKTPairCut) +#endif + +//__________________ +AliFemtoKTPairCut::AliFemtoKTPairCut(): + AliFemtoPairCut(), + fKTMin(0), + fKTMax(1.0e6), + fPhiMin(0), + fPhiMax(360.0), + fPtMin(0.0), + fPtMax(1000.0) +{ + fKTMin = 0; + fKTMax = 1.0e6; +} +//__________________ +AliFemtoKTPairCut::AliFemtoKTPairCut(double lo, double hi) : + AliFemtoPairCut(), + fKTMin(lo), + fKTMax(hi), + fPhiMin(0), + fPhiMax(360), + fPtMin(0.0), + fPtMax(1000.0) +{ +} +//__________________ +AliFemtoKTPairCut::AliFemtoKTPairCut(const AliFemtoKTPairCut& c) : + AliFemtoPairCut(c), + fKTMin(0), + fKTMax(1.0e6), + fPhiMin(0), + fPhiMax(360), + fPtMin(0.0), + fPtMax(1000.0) +{ + fKTMin = c.fKTMin; + fKTMax = c.fKTMax; + fPhiMin = c.fPhiMin; + fPhiMax = c.fPhiMax; + fPtMin = c.fPtMin; + fPtMax = c.fPtMax; +} + +//__________________ +AliFemtoKTPairCut::~AliFemtoKTPairCut(){ + /* no-op */ +} +AliFemtoKTPairCut& AliFemtoKTPairCut::operator=(const AliFemtoKTPairCut& c) +{ + if (this != &c) { + fKTMin = c.fKTMin; + fKTMax = c.fKTMax; + fPhiMin = c.fPhiMin; + fPhiMax = c.fPhiMax; + fPtMin = c.fPtMin; + fPtMax = c.fPtMax; + } + + return *this; +} +//__________________ +/*bool AliFemtoKTPairCut::Pass(const AliFemtoPair* pair){ + bool temp = true; + + if (pair->KT() < fKTMin) + temp = false; + + if (pair->KT() > fKTMax) + temp = false; + + return temp; +}*/ +//__________________ +AliFemtoString AliFemtoKTPairCut::Report(){ + // Prepare a report from the execution + string stemp = "AliFemtoKT Pair Cut \n"; char ctemp[100]; + snprintf(ctemp , 100, "Accept pair with kT in range %f , %f",fKTMin,fKTMax); + snprintf(ctemp , 100, "Accept pair with angle in range %f , %f",fPhiMin,fPhiMax); + stemp += ctemp; + AliFemtoString returnThis = stemp; + return returnThis;} +//__________________ + +TList *AliFemtoKTPairCut::ListSettings() +{ + // return a list of settings in a writable form + TList *tListSetttings = new TList(); + char buf[200]; + snprintf(buf, 200, "AliFemtoKTPairCut.ktmax=%f", fKTMax); + tListSetttings->AddLast(new TObjString(buf)); + snprintf(buf, 200, "AliFemtoKTPairCut.ktmin=%f", fKTMin); + tListSetttings->AddLast(new TObjString(buf)); + snprintf(buf, 200, "AliFemtoKTPairCut.phimax=%f", fPhiMax); + tListSetttings->AddLast(new TObjString(buf)); + snprintf(buf, 200, "AliFemtoKTPairCut.phimin=%f", fPhiMin); + tListSetttings->AddLast(new TObjString(buf)); + snprintf(buf, 200, "AliFemtoKTPairCut.ptmin=%f", fPtMin); + tListSetttings->AddLast(new TObjString(buf)); + snprintf(buf, 200, "AliFemtoKTPairCut.ptmax=%f", fPtMax); + tListSetttings->AddLast(new TObjString(buf)); + + return tListSetttings; +} + +void AliFemtoKTPairCut::SetKTRange(double ktmin, double ktmax) +{ + fKTMin = ktmin; + fKTMax = ktmax; +} + +void AliFemtoKTPairCut::SetPhiRange(double phimin, double phimax) +{ + fPhiMin = phimin; + fPhiMax = phimax; +} + +void AliFemtoKTPairCut::SetPTMin(double ptmin, double ptmax) +{ + fPtMin = ptmin; + fPtMax = ptmax; +} + +//______________________________________________________ +bool AliFemtoKTPairCut::Pass(const AliFemtoPair* pair) +{ + bool temp = true; + +//Taking care of the Kt cut + if (pair->KT() < fKTMin) + temp = false; + + if (pair->KT() > fKTMax) + temp = false; + + if (!temp) return temp; + + if ((fPtMin > 0.0) || (fPtMax<1000.0)) { +// double px1 = pair->Track1()->Track()->P().x(); +// double py1 = pair->Track1()->Track()->P().y(); + +// double px2 = pair->Track2()->Track()->P().x(); +// double py2 = pair->Track2()->Track()->P().y(); + +// double pt1 = TMath::Hypot(px1, py1); +// double pt2 = TMath::Hypot(px2, py2); + +// if ((pt1fPtMax)) return false; +// if ((pt2fPtMax)) return false; + if ((pair->Track1()->Track()->Pt()Track1()->Track()->Pt()>fPtMax)) return false; + if ((pair->Track2()->Track()->Pt()Track2()->Track()->Pt()>fPtMax)) return false; + } + +//Taking care of the Phi cut +// double rpangle = (pair->GetPairAngleEP())*180/TMath::Pi(); + double rpangle = pair->GetPairAngleEP(); + + if (rpangle > 180.0) rpangle -= 180.0; + if (rpangle < 0.0) rpangle += 180.0; + + if (fPhiMin < 0) { + if ((rpangle > fPhiMax) && (rpangle < 180.0+fPhiMin)) + temp = false; + } + else { + if ((rpangle < fPhiMin) || (rpangle > fPhiMax)) + temp = false; + } + return temp; +} + +//_____________________________________ +bool AliFemtoKTPairCut::Pass(const AliFemtoPair* pair, double aRPAngle) +{ +//The same as above, but it is defined with RP Angle as input in all the Correlatin function classes. + + bool temp = (aRPAngle > 0.); + aRPAngle = true; + + if (!Pass(pair)) + temp = false; + + return temp; +} diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKTPairCut.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKTPairCut.h new file mode 100644 index 00000000000..2f42379031c --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKTPairCut.h @@ -0,0 +1,64 @@ +///////////////////////////////////////////////////////////////////////////// +// // +// AliFemtoKTPairCut - a pair cut which selects pairs based on their // +// transverse momentum kT // +// // +///////////////////////////////////////////////////////////////////////////// +/*************************************************************************** + * + * $Id: AliFemtoKTPairCut.h,v 1.1.2.1 2007/10/19 13:28:14 akisiel Exp $ + * + * Author: Adam Kisiel, Ohio State University, kisiel@mps.ohio-state.edu + *************************************************************************** + * + * Description: part of STAR HBT Framework: AliFemtoMaker package + * a cut to remove "shared" and "split" pairs + * + *************************************************************************** + * + * + **************************************************************************/ + +#ifndef ALIFEMTOKTPAIRCUT_H +#define ALIFEMTOKTPAIRCUT_H + +// do I need these lines ? +//#ifndef StMaker_H +//#include "StMaker.h" +//#endif + +#include "AliFemtoPairCut.h" + +class AliFemtoKTPairCut : public AliFemtoPairCut{ +public: + AliFemtoKTPairCut(); + AliFemtoKTPairCut(double lo, double hi); + AliFemtoKTPairCut(const AliFemtoKTPairCut& c); + virtual ~AliFemtoKTPairCut(); + AliFemtoKTPairCut& operator=(const AliFemtoKTPairCut& c); + + virtual AliFemtoString Report(); + virtual TList *ListSettings(); + AliFemtoPairCut* Clone(); + void SetKTRange(double ktmin, double ktmax); + void SetPhiRange(double phimin, double phimax); + void SetPTMin(double ptmin, double ptmax=1000.0); + virtual bool Pass(const AliFemtoPair* pair); + virtual bool Pass(const AliFemtoPair* pair, double aRPAngle); + + protected: + Double_t fKTMin; // Minimum allowed pair transverse momentum + Double_t fKTMax; // Maximum allowed pair transverse momentum + Double_t fPhiMin; // Minimum angle vs. reaction plane + Double_t fPhiMax; // Maximum angle vs. reaction plane + Double_t fPtMin; // Minimum per-particle pT + Double_t fPtMax; // Maximum per-particle pT + +#ifdef __ROOT__ + ClassDef(AliFemtoKTPairCut, 0) +#endif +}; + +inline AliFemtoPairCut* AliFemtoKTPairCut::Clone() { AliFemtoKTPairCut* c = new AliFemtoKTPairCut(*this); return c;} + +#endif diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKink.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKink.cxx new file mode 100644 index 00000000000..663ad066ad4 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKink.cxx @@ -0,0 +1,170 @@ +/////////////////////////////////////////////////////////////////////////// +// // +// AliFemtoKink: main class holding all the necessary information // +// about a kink (before the identification) that is required during // +// femtoscopic analysis. This class is filled with information from the // +// input stream by the reader. A particle has a link back to the Kink // +// it was created from, so we do not copy the information. // +// // +/////////////////////////////////////////////////////////////////////////// +/*********************************************************************** + * + * $Id$ + * + * Author: Mike Lisa, Ohio State, 23May2001 + * + *********************************************************************** + * + * Description: Kink class with information gotten from the StKinkVertex + * of Wenshen Deng and Spiros Margetis + * + *********************************************************************** + * + * $Log$ + * Revision 1.4 2007/05/03 09:42:29 akisiel + * Fixing Effective C++ warnings + * + * Revision 1.3 2007/04/27 07:24:34 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.1.1.1 2007/03/07 10:14:49 mchojnacki + * First version on CVS + * + * Revision 1.4 2001/11/14 21:07:21 lisa + * Fixed several small things (mostly discarded const) that caused fatal errors with gcc2.95.3 + * + * Revision 1.3 2001/09/05 21:55:23 laue + * typo fixed + * + * Revision 1.2 2001/06/21 19:15:46 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 + * + * Revision 1.1 2001/05/25 23:23:59 lisa + * Added in AliFemtoKink stuff + * + * + * + ***********************************************************************/ + +#include "AliFemtoKink.h" +#include "phys_constants.h" +#include "AliFemtoTrack.h" +// ----------------------------------------------------------------------- +AliFemtoKink::AliFemtoKink(): + fDcaParentDaughter(0), fDcaDaughterPrimaryVertex(0), + fDcaParentPrimaryVertex(0), fHitDistanceParentDaughter(0), + fHitDistanceParentVertex(0), + fDecayAngle(0), fDecayAngleCM(0), + fDaughter(), + fParent(), + fPosition(0,0,0) +{ + for (int id=0; id<3; id++) fDeltaEnergy[id] = 0.0; +} +// ----------------------------------------------------------------------- +AliFemtoKink::AliFemtoKink(const AliFemtoKink& k): + fDcaParentDaughter(0), fDcaDaughterPrimaryVertex(0), + fDcaParentPrimaryVertex(0), fHitDistanceParentDaughter(0), + fHitDistanceParentVertex(0), + fDecayAngle(0), fDecayAngleCM(0), + fDaughter(), + fParent(), + fPosition(0,0,0) +{ // copy constructor + + fDcaParentDaughter = k.fDcaParentDaughter; + fDcaDaughterPrimaryVertex = k.fDcaDaughterPrimaryVertex; + fDcaParentPrimaryVertex = k.fDcaParentPrimaryVertex; + fHitDistanceParentDaughter = k.fHitDistanceParentDaughter; + fHitDistanceParentVertex = k.fHitDistanceParentVertex; + fDeltaEnergy[0] = k.fDeltaEnergy[0]; + fDeltaEnergy[1] = k.fDeltaEnergy[1]; + fDeltaEnergy[2] = k.fDeltaEnergy[2]; + fDecayAngle = k.fDecayAngle; + fDecayAngleCM = k.fDecayAngleCM; + fDaughter = k.fDaughter; + fParent = k.fParent; + fPosition = k.fPosition; + +} +// ----------------------------------------------------------------------- +AliFemtoKink& AliFemtoKink::operator=( const AliFemtoKink& k) +{ + if (this != &k) { + fDcaParentDaughter = k.fDcaParentDaughter; + fDcaDaughterPrimaryVertex = k.fDcaDaughterPrimaryVertex; + fDcaParentPrimaryVertex = k.fDcaParentPrimaryVertex; + fHitDistanceParentDaughter = k.fHitDistanceParentDaughter; + fHitDistanceParentVertex = k.fHitDistanceParentVertex; + fDeltaEnergy[0] = k.fDeltaEnergy[0]; + fDeltaEnergy[1] = k.fDeltaEnergy[1]; + fDeltaEnergy[2] = k.fDeltaEnergy[2]; + fDecayAngle = k.fDecayAngle; + fDecayAngleCM = k.fDecayAngleCM; + fDaughter = k.fDaughter; + fParent = k.fParent; + fPosition = k.fPosition; + } + + return *this; +} + + +//--------------------- below here is ONLY star ---------------- +#ifndef __NO_STAR_DEPENDENCE_ALLOWED__ +#ifdef __ROOT__ +#include "StEvent/StTrack.h" +#include "StEvent/StKinkVertex.h" +AliFemtoKink::AliFemtoKink( const StKinkVertex& SKV, AliFemtoThreeVector PrimaryVertex ) +{ + + fDcaParentDaughter = SKV.dcaParentDaughter(); + fDcaDaughterPrimaryVertex = SKV.dcaDaughterPrimaryVertex(); + fDcaParentPrimaryVertex = SKV.dcaParentPrimaryVertex(); + fHitDistanceParentDaughter = SKV.hitDistanceParentDaughter(); + fHitDistanceParentVertex = SKV.hitDistanceParentVertex(); + fDeltaEnergy[0] = SKV.dE(0); + fDeltaEnergy[1] = SKV.dE(1); + fDeltaEnergy[2] = SKV.dE(2); + fDecayAngle = SKV.decayAngle(); + fDecayAngleCM = SKV.decayAngleCM(); + + // now fill member AliFemtoTrack data... + const StTrack* StTrk; + AliFemtoTrack* HbtTrk; + // Daughter + StTrk = SKV.daughter(0); + HbtTrk = new AliFemtoTrack(StTrk,PrimaryVertex); // generate NEW HbtTrack from StTrack + fDaughter = *HbtTrk; // invoke copy ctr of AliFemtoTrack + delete HbtTrk; // get rid of the NEW HbtTrack - we are done with that + // Parent + StTrk = SKV.parent(); + HbtTrk = new AliFemtoTrack(StTrk,PrimaryVertex); // generate NEW HbtTrack from StTrack + fParent = *HbtTrk; // invoke copy ctr of AliFemtoTrack + delete HbtTrk; // get rid of the NEW HbtTrack - we are done with that + + // finally, the kink position + fPosition.setX(SKV.position().x()); + fPosition.setY(SKV.position().y()); + fPosition.setZ(SKV.position().z()); + +} + +// mike removed all AliFemtoTTree stuff 21apr2006 + +#endif // __ROOT__ +#endif // __NO_STAR_DEPENDENCE_ALLOWED__ diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKink.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKink.h new file mode 100644 index 00000000000..b7873eff1ec --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKink.h @@ -0,0 +1,145 @@ +/////////////////////////////////////////////////////////////////////////// +// // +// AliFemtoKink: main class holding all the necessary information // +// about a kink (before the identification) that is required during // +// femtoscopic analysis. This class is filled with information from the // +// input stream by the reader. A particle has a link back to the Kink // +// it was created from, so we do not copy the information. // +// // +/////////////////////////////////////////////////////////////////////////// +/*********************************************************************** + * + * $Id$ + * + * Author: Mike Lisa, Ohio State, 23May2001 + * + *********************************************************************** + * + * Description: Kink class with information gotten from the StKinkVertex + * of Wenshen Deng and Spiros Margetis + * + *********************************************************************** + * + * $Log$ + * Revision 1.2 2007/05/03 09:42:29 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.4 2003/09/02 17:58:32 perev + * gcc 3.2 updates + WarnOff + * + * Revision 1.3 2001/11/14 21:07:21 lisa + * Fixed several small things (mostly discarded const) that caused fatal errors with gcc2.95.3 + * + * Revision 1.2 2001/06/21 19:15:46 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 + * + * Revision 1.1 2001/05/25 23:23:59 lisa + * Added in AliFemtoKink stuff + * + * + * + ***********************************************************************/ +#ifndef ALIFEMTOKINK_H +#define ALIFEMTOKINK_H + +class StKinkVertex; +//#include "StEvent/StKinkVertex.h" // from StEvent +#include "AliFemtoTrack.h" + +#include "AliFemtoTypes.h" //same as in AliFemtoTrack.h + +class AliFemtoKink { +public: + AliFemtoKink(); + AliFemtoKink( const AliFemtoKink& k); // copy constructor +#ifndef __NO_STAR_DEPENDENCE_ALLOWED__ +#ifdef __ROOT__ + AliFemtoKink( const StKinkVertex&, AliFemtoThreeVector PrimaryVertex); // create a AliFemtoKink from a StKinkVertex +#endif +#endif + ~AliFemtoKink(){/* no-op */} + AliFemtoKink& operator=( const AliFemtoKink& k); // copy constructor + + // Get's + float DcaParentDaughter() const; + float DcaDaughterPrimaryVertex() const; + float DcaParentPrimaryVertex() const; + float HitDistanceParentDaughter() const; + float HitDistanceParentVertex() const; + float DeltaEnergy(int i=0) const; + float DecayAngle() const; + float DecayAngleCM() const; + AliFemtoTrack Daughter() const; + AliFemtoTrack Parent() const; + AliFemtoThreeVector Position() const; + + + +protected: + + float fDcaParentDaughter; // from StKinkVertex class directly + float fDcaDaughterPrimaryVertex; // from StKinkVertex class directly + float fDcaParentPrimaryVertex; // from StKinkVertex class directly + float fHitDistanceParentDaughter; // from StKinkVertex class directly + float fHitDistanceParentVertex; // from StKinkVertex class directly + float fDeltaEnergy[3]; // from StKinkVertex class directly + float fDecayAngle; // from StKinkVertex class directly + float fDecayAngleCM; // from StKinkVertex class directly + AliFemtoTrack fDaughter; // from StKinkVertex class directly + AliFemtoTrack fParent; // from StVertex class (which StKinkVertex inherits from) + AliFemtoThreeVector fPosition; // from StMeasuredPoint class (which StVertex inherits from) + +}; + +// Get's +inline float AliFemtoKink::DcaParentDaughter() const {return fDcaParentDaughter;} +inline float AliFemtoKink::DcaDaughterPrimaryVertex() const {return fDcaDaughterPrimaryVertex;} +inline float AliFemtoKink::DcaParentPrimaryVertex() const {return fDcaParentPrimaryVertex;} +inline float AliFemtoKink::HitDistanceParentDaughter() const {return fHitDistanceParentDaughter;} +inline float AliFemtoKink::HitDistanceParentVertex() const {return fHitDistanceParentVertex;} +inline float AliFemtoKink::DeltaEnergy(int i) const {return fDeltaEnergy[i];} +inline float AliFemtoKink::DecayAngle() const {return fDecayAngle;} +inline float AliFemtoKink::DecayAngleCM() const {return fDecayAngleCM;} +inline AliFemtoTrack AliFemtoKink::Daughter() const {return fDaughter;} +inline AliFemtoTrack AliFemtoKink::Parent() const {return fParent;} +inline AliFemtoThreeVector AliFemtoKink::Position() const {return fPosition;} + + + + +#endif + + + + + + + + + + + + + + + + + + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKinkCollection.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKinkCollection.h new file mode 100644 index 00000000000..c578748bf59 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKinkCollection.h @@ -0,0 +1,46 @@ +/*************************************************************************** + * + * $Id$ + * + * Author: Mike Lisa, Ohio State, lisa@mps.ohio-state.edu + *************************************************************************** + * + * Description: part of STAR HBT Framework: AliFemtoMaker package + * The Collection of Kinks is the a component of the HbtEvent, + * which is essentially the transient microDST + * + **************************************************************************** + * + * $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.1 2001/05/25 23:23:59 lisa + * Added in AliFemtoKink stuff + * + * + ***************************************************************************/ + + +#ifndef AliFemtoKinkCollection_hh +#define AliFemtoKinkCollection_hh +#include "AliFemtoKink.h" +#include + +#if !defined(ST_NO_NAMESPACES) +using std::list; +#endif + +#ifdef ST_NO_TEMPLATE_DEF_ARGS +typedef list > AliFemtoKinkCollection; +typedef list >::iterator AliFemtoKinkIterator; +#else +typedef list AliFemtoKinkCollection; +typedef list::iterator AliFemtoKinkIterator; +#endif + +#endif + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKinkCut.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKinkCut.h new file mode 100644 index 00000000000..ca6d456b06c --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoKinkCut.h @@ -0,0 +1,35 @@ +//////////////////////////////////////////////////////////////////////////////// +/// AliFemtoKinkCut - the pure virtual base class for the kink cut /// +/// All kink cuts must inherit from this one /// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef AliFemtoKinkCut_hh +#define AliFemtoKinkCut_hh + +#include "AliFemtoTypes.h" +#include "AliFemtoKink.h" +#include "AliFemtoParticleCut.h" + +class AliFemtoKinkCut : public AliFemtoParticleCut { + +public: + + AliFemtoKinkCut(){/* no-op */}; // default constructor. - Users should write their own + AliFemtoKinkCut(const AliFemtoKinkCut&); // copy constructor + virtual ~AliFemtoKinkCut(){/* no-op */}; // destructor + AliFemtoKinkCut& operator=(const AliFemtoKinkCut&); // copy constructor + + virtual bool Pass(const AliFemtoKink* aKink)=0; // true if passes, false if not + + virtual AliFemtoParticleType Type(){return hbtKink;} + virtual AliFemtoKinkCut* Clone() { return 0;} + +#ifdef __ROOT__ + ClassDef(AliFemtoKinkCut, 0) +#endif +}; +//_____________________________ +inline AliFemtoKinkCut::AliFemtoKinkCut(const AliFemtoKinkCut& c) : AliFemtoParticleCut(c) { /* no-op */ } +inline AliFemtoKinkCut& AliFemtoKinkCut::operator=(const AliFemtoKinkCut& aCorrFctn) { if (this != &aCorrFctn) { AliFemtoParticleCut::operator=(aCorrFctn); } return *this; } + +#endif diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLikeSignAnalysis.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLikeSignAnalysis.cxx new file mode 100644 index 00000000000..907003994a9 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLikeSignAnalysis.cxx @@ -0,0 +1,298 @@ +/////////////////////////////////////////////////////////////////////////// +// // +// This is an analysis which calculated the background from like sign // +// pairs in the same event // +// // +/////////////////////////////////////////////////////////////////////////// + +#include "AliFemtoLikeSignAnalysis.h" +#include "AliFemtoParticleCollection.h" +#include "AliFemtoPicoEventCollectionVector.h" +#include "AliFemtoPicoEventCollectionVectorHideAway.h" + +#ifdef __ROOT__ +ClassImp(AliFemtoLikeSignAnalysis) +#endif + +// this little function used to apply ParticleCuts (TrackCuts or V0Cuts) and fill ParticleCollections of picoEvent +// it is called from AliFemtoSimpleAnalysis::ProcessEvent() + + +extern void FillHbtParticleCollection(AliFemtoParticleCut* partCut, + AliFemtoEvent* hbtEvent, + AliFemtoParticleCollection* partCollection); + + +//____________________________ +AliFemtoLikeSignAnalysis::AliFemtoLikeSignAnalysis(unsigned int bins, double min, double max) : + AliFemtoSimpleAnalysis(), + fVertexBins(0), + fOverFlow(0), + fUnderFlow(0) +{ + // standard constructor + fVertexBins = bins; + fVertexZ[0] = min; + fVertexZ[1] = max; + fUnderFlow = 0; + fOverFlow = 0; + if (fMixingBuffer) delete fMixingBuffer; + fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexBins,fVertexZ[0],fVertexZ[1]); + /* no-op */ +} +//____________________________ +AliFemtoLikeSignAnalysis::AliFemtoLikeSignAnalysis(const AliFemtoLikeSignAnalysis& a) : + AliFemtoSimpleAnalysis(a) , + fVertexBins(0), + fOverFlow(0), + fUnderFlow(0) +{ + // copy constructor + fVertexBins = a.fVertexBins; + fVertexZ[0] = a.fVertexZ[0]; + fVertexZ[1] = a.fVertexZ[1]; + fUnderFlow = 0; + fOverFlow = 0; + if (fMixingBuffer) delete fMixingBuffer; + fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexBins,fVertexZ[0],fVertexZ[1]); + } +AliFemtoLikeSignAnalysis& AliFemtoLikeSignAnalysis::operator=(const AliFemtoLikeSignAnalysis& OriginalAnalysis) +{ + if (this != &OriginalAnalysis) { + fVertexBins = OriginalAnalysis.fVertexBins; + fVertexZ[0] = OriginalAnalysis.fVertexZ[0]; + fVertexZ[1] = OriginalAnalysis.fVertexZ[1]; + fUnderFlow = 0; + fOverFlow = 0; + if (fMixingBuffer) delete fMixingBuffer; + if (fPicoEventCollectionVectorHideAway) delete fPicoEventCollectionVectorHideAway; + fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexBins,fVertexZ[0],fVertexZ[1]); + } + + return *this; + +} + +//____________________________ +AliFemtoLikeSignAnalysis::~AliFemtoLikeSignAnalysis(){ + // destructor + delete fPicoEventCollectionVectorHideAway; fPicoEventCollectionVectorHideAway=0; +} +//____________________________ +AliFemtoString AliFemtoLikeSignAnalysis::Report() +{ + // prepare report + char tCtemp[200]; + cout << "AliFemtoLikeSignAnalysis - constructing Report..."<PrimVertPos().z(); + fMixingBuffer = fPicoEventCollectionVectorHideAway->PicoEventCollection(vertexZ); + if (!fMixingBuffer) { + if ( vertexZ < fVertexZ[0] ) fUnderFlow++; + if ( vertexZ > fVertexZ[1] ) fOverFlow++; + return; + } + + // startup for EbyE + EventBegin(hbtEvent); + // event cut and event cut monitor + bool tmpPassEvent = fEventCut->Pass(hbtEvent); + fEventCut->FillCutMonitor(hbtEvent, tmpPassEvent); + if (tmpPassEvent) { + fNeventsProcessed++; + cout << "AliFemtoLikeSignAnalysis::ProcessEvent() - " << hbtEvent->TrackCollection()->size(); + cout << " #track=" << hbtEvent->TrackCollection()->size(); + // OK, analysis likes the event-- build a pico event from it, using tracks the analysis likes... + AliFemtoPicoEvent* picoEvent = new AliFemtoPicoEvent; // this is what we will make pairs from and put in Mixing Buffer + FillHbtParticleCollection(fFirstParticleCut,(AliFemtoEvent*)hbtEvent,picoEvent->FirstParticleCollection()); + if ( !(AnalyzeIdenticalParticles()) ) + FillHbtParticleCollection(fSecondParticleCut,(AliFemtoEvent*)hbtEvent,picoEvent->SecondParticleCollection()); + cout <<" #particles in First, Second Collections: " << + picoEvent->FirstParticleCollection()->size() << " " << + picoEvent->SecondParticleCollection()->size() << endl; + + if (picoEvent->SecondParticleCollection()->size()*picoEvent->FirstParticleCollection()->size()==0) { + delete picoEvent; + cout << "AliFemtoLikeSignAnalysis - picoEvent deleted due to empty collection " <FirstParticleCollection()->begin(); // always + AliFemtoParticleIterator tEndOuterLoop = picoEvent->FirstParticleCollection()->end(); // will be one less if identical + AliFemtoParticleIterator tStartInnerLoop; + AliFemtoParticleIterator tEndInnerLoop; + if (AnalyzeIdenticalParticles()) { // only use First collection + tEndOuterLoop--; // outer loop goes to next-to-last particle in First collection + tEndInnerLoop = picoEvent->FirstParticleCollection()->end() ; // inner loop goes to last particle in First collection + } + else { // nonidentical - loop over First and Second collections + tStartInnerLoop = picoEvent->SecondParticleCollection()->begin(); // inner loop starts at first particle in Second collection + tEndInnerLoop = picoEvent->SecondParticleCollection()->end() ; // inner loop goes to last particle in Second collection + } + // real pairs + for (tPartIter1=tStartOuterLoop;tPartIter1!=tEndOuterLoop;tPartIter1++){ + if (AnalyzeIdenticalParticles()){ + tStartInnerLoop = tPartIter1; + tStartInnerLoop++; + } + tThePair->SetTrack1(*tPartIter1); + for (tPartIter2 = tStartInnerLoop; tPartIter2!=tEndInnerLoop;tPartIter2++){ + tThePair->SetTrack2(*tPartIter2); + // The following lines have to be uncommented if you want pairCutMonitors + // they are not in for speed reasons + // bool tmpPassPair = mPairCut->Pass(tThePair); + // mPairCut->FillCutMonitor(tThePair, tmpPassPair); + // if ( tmpPassPair ) { + if (fPairCut->Pass(tThePair)){ + for (tCorrFctnIter=fCorrFctnCollection->begin(); + tCorrFctnIter!=fCorrFctnCollection->end();tCorrFctnIter++){ + AliFemtoLikeSignCorrFctn* tCorrFctn = dynamic_cast(*tCorrFctnIter); + if (tCorrFctn) tCorrFctn->AddRealPair(tThePair); + } + } // if passed pair cut + } // loop over second particle + } // loop over first particle +#ifdef STHBTDEBUG + cout << "AliFemtoLikeSignAnalysis::ProcessEvent() - reals done" << endl; +#endif + + AliFemtoParticleIterator nextIter; + AliFemtoParticleIterator prevIter; + + // like sign first partilce collection pairs + prevIter = tEndOuterLoop; + prevIter--; + for (tPartIter1=tStartOuterLoop;tPartIter1!=prevIter;tPartIter1++){ + tThePair->SetTrack1(*tPartIter1); + nextIter = tPartIter1; + nextIter++; + for (tPartIter2 = nextIter; tPartIter2!=tEndOuterLoop;tPartIter2++){ + tThePair->SetTrack2(*tPartIter2); + // The following lines have to be uncommented if you want pairCutMonitors + // they are not in for speed reasons + // bool tmpPassPair = mPairCut->Pass(tThePair); + // mPairCut->FillCutMonitor(tThePair, tmpPassPair); + // if ( tmpPassPair ) { + if (fPairCut->Pass(tThePair)){ + for (tCorrFctnIter=fCorrFctnCollection->begin(); + tCorrFctnIter!=fCorrFctnCollection->end();tCorrFctnIter++){ + AliFemtoLikeSignCorrFctn* tCorrFctn = dynamic_cast(*tCorrFctnIter); + if (tCorrFctn) tCorrFctn->AddLikeSignPositivePair(tThePair); + } + } // if passed pair cut + } // loop over second particle + } // loop over first particle +#ifdef STHBTDEBUG + cout << "AliFemtoLikeSignAnalysis::ProcessEvent() - like sign first collection done" << endl; +#endif + // like sign second partilce collection pairs + prevIter = tEndInnerLoop; + prevIter--; + for (tPartIter1=tStartInnerLoop;tPartIter1!=prevIter;tPartIter1++){ + tThePair->SetTrack1(*tPartIter1); + nextIter = tPartIter1; + nextIter++; + for (tPartIter2 = nextIter; tPartIter2!=tEndInnerLoop;tPartIter2++){ + tThePair->SetTrack2(*tPartIter2); + // The following lines have to be uncommented if you want pairCutMonitors + // they are not in for speed reasons + // bool tmpPassPair = mPairCut->Pass(tThePair); + // mPairCut->FillCutMonitor(tThePair, tmpPassPair); + // if ( tmpPassPair ) { + if (fPairCut->Pass(tThePair)){ + for (tCorrFctnIter=fCorrFctnCollection->begin(); + tCorrFctnIter!=fCorrFctnCollection->end();tCorrFctnIter++){ + AliFemtoLikeSignCorrFctn* tCorrFctn = dynamic_cast(*tCorrFctnIter); + if (tCorrFctn) tCorrFctn->AddLikeSignNegativePair(tThePair); + } + } // if passed pair cut + } // loop over second particle + } // loop over first particle +#ifdef STHBTDEBUG + cout << "AliFemtoLikeSignAnalysis::ProcessEvent() - like sign second collection done" << endl; +#endif + + if (MixingBufferFull()){ +#ifdef STHBTDEBUG + cout << "Mixing Buffer is full - lets rock and roll" << endl; +#endif + } + else { + cout << "Mixing Buffer not full -gotta wait " << MixingBuffer()->size() << endl; + } + if (MixingBufferFull()){ + tStartOuterLoop = picoEvent->FirstParticleCollection()->begin(); + tEndOuterLoop = picoEvent->FirstParticleCollection()->end(); + AliFemtoPicoEvent* storedEvent; + AliFemtoPicoEventIterator picoEventIter; + for (picoEventIter=MixingBuffer()->begin();picoEventIter!=MixingBuffer()->end();picoEventIter++){ + storedEvent = *picoEventIter; + if (AnalyzeIdenticalParticles()){ + tStartInnerLoop = storedEvent->FirstParticleCollection()->begin(); + tEndInnerLoop = storedEvent->FirstParticleCollection()->end(); + } + else{ + tStartInnerLoop = storedEvent->SecondParticleCollection()->begin(); + tEndInnerLoop = storedEvent->SecondParticleCollection()->end(); + } + for (tPartIter1=tStartOuterLoop;tPartIter1!=tEndOuterLoop;tPartIter1++){ + tThePair->SetTrack1(*tPartIter1); + for (tPartIter2=tStartInnerLoop;tPartIter2!=tEndInnerLoop;tPartIter2++){ + tThePair->SetTrack2(*tPartIter2); + // testing... cout << "tThePair defined... going to pair cut... "; + if (fPairCut->Pass(tThePair)){ + // testing... cout << " tThePair passed PairCut... "; + for (tCorrFctnIter=fCorrFctnCollection->begin(); + tCorrFctnIter!=fCorrFctnCollection->end();tCorrFctnIter++){ + AliFemtoLikeSignCorrFctn* tCorrFctn = dynamic_cast(*tCorrFctnIter); + if (tCorrFctn) { + tCorrFctn->AddMixedPair(tThePair); + //cout << " tThePair has been added to MixedPair method " << endl; + } + } + } // if passed pair cut + } // loop over second particle + } // loop over first particle + } // loop over pico-events stored in Mixing buffer + // Now get rid of oldest stored pico-event in buffer. + // This means (1) delete the event from memory, (2) "pop" the pointer to it from the MixingBuffer + delete MixingBuffer()->back(); + MixingBuffer()->pop_back(); + } // if mixing buffer is full + delete tThePair; + MixingBuffer()->push_front(picoEvent); // store the current pico-event in buffer + } // if currentEvent is accepted by currentAnalysis + EventEnd(hbtEvent); // cleanup for EbyE + // cout << "AliFemtoLikeSignAnalysis::ProcessEvent() - return to caller ... " << endl; +} + + + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLikeSignAnalysis.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLikeSignAnalysis.h new file mode 100644 index 00000000000..b1d5c4b69ba --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLikeSignAnalysis.h @@ -0,0 +1,53 @@ +/////////////////////////////////////////////////////////////////////////// +// // +// This is an analysis which calculated the background from like sign // +// pairs in the same event // +// // +/////////////////////////////////////////////////////////////////////////// +#ifndef ALIFEMTOLIKESIGNANALYSIS_H +#define ALIFEMTOLIKESIGNANALYSIS_H +//#ifndef StMaker_H +//#include "StMaker.h" +//#endif + +#include "AliFemtoAnalysis.h" // base analysis class +#include "AliFemtoTypes.h" +//#include "AliFemtoEventCut.h" // base class +//#include "AliFemtoParticleCut.h" // base class +//#include "AliFemtoPairCut.h" // base class +#include "AliFemtoLikeSignCorrFctn.h" // base class +#include "AliFemtoSimpleAnalysis.h" +#include "AliFemtoCorrFctnCollection.h" + +class AliFemtoEventCut; +class AliFemtoParticleCut; +class AliFemtoPairCut; + +class AliFemtoLikeSignAnalysis : public AliFemtoSimpleAnalysis { + +public: + + AliFemtoLikeSignAnalysis(unsigned int bins=20, double min=-100., double max=100.); + AliFemtoLikeSignAnalysis(const AliFemtoLikeSignAnalysis& OriginalAnalysis); // copy constructor + AliFemtoLikeSignAnalysis& operator=(const AliFemtoLikeSignAnalysis& OriginalAnalysis); + virtual ~AliFemtoLikeSignAnalysis(); + + virtual void ProcessEvent(const AliFemtoEvent* TheEventToBeProcessed); + virtual AliFemtoString Report(); + virtual unsigned int Overflow() { return fOverFlow;} + virtual unsigned int Underflow() { return fUnderFlow;} + +protected: + double fVertexZ[2]; /* min/max z-vertex position allowed to be processed */ + unsigned int fVertexBins; /* number of mixing bins in z-vertex in EventMixing Buffer */ + unsigned int fOverFlow; /* number of events encountered which had too large z-vertex */ + unsigned int fUnderFlow; /* number of events encountered which had too small z-vertex */ + +#ifdef __ROOT__ + ClassDef(AliFemtoLikeSignAnalysis, 0) +#endif + +}; + + +#endif diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLikeSignCorrFctn.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLikeSignCorrFctn.h new file mode 100644 index 00000000000..1df5396a565 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLikeSignCorrFctn.h @@ -0,0 +1,35 @@ +//////////////////////////////////////////////////////////////////////////////// +/// AliFemtoLikeSignCorrFctn - the pure virtual base class for the like sign /// +/// correlation function. All like sign correlation functions must inherit /// +/// from this one /// +//////////////////////////////////////////////////////////////////////////////// +#ifndef AliFemtoLikeSignCorrFctn_hh +#define AliFemtoLikeSignCorrFctn_hh + +class AliFemtoPair; +#include "AliFemtoCorrFctn.h" + +class AliFemtoLikeSignCorrFctn : public AliFemtoCorrFctn { + + friend class AliFemtoLikeSignAnalysis; + +public: + AliFemtoLikeSignCorrFctn():AliFemtoCorrFctn() {/* no-op */}; + AliFemtoLikeSignCorrFctn(const AliFemtoLikeSignCorrFctn& aCorrFctn); + virtual ~AliFemtoLikeSignCorrFctn(){/* no-op */}; + AliFemtoLikeSignCorrFctn& operator=(const AliFemtoLikeSignCorrFctn& aCorrFctn); + + virtual void AddLikeSignPositivePair(const AliFemtoPair* aPair) = 0; + virtual void AddLikeSignNegativePair(const AliFemtoPair* aPair) = 0; + + virtual AliFemtoLikeSignCorrFctn* Clone() { return 0;} + virtual TList* GetOutputList() = 0; + + // the following allows "back-pointing" from the CorrFctn to the "parent" Analysis +}; +//________________________________________ +inline AliFemtoLikeSignCorrFctn::AliFemtoLikeSignCorrFctn(const AliFemtoLikeSignCorrFctn& /* c */):AliFemtoCorrFctn() { fyAnalysis =0; } +inline AliFemtoLikeSignCorrFctn& AliFemtoLikeSignCorrFctn::operator=(const AliFemtoLikeSignCorrFctn& aCorrFctn) { if (this != &aCorrFctn) { AliFemtoCorrFctn::operator=(aCorrFctn); } return *this; } + + +#endif diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLorentzVector.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLorentzVector.h new file mode 100644 index 00000000000..17d41225139 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLorentzVector.h @@ -0,0 +1,743 @@ +/*************************************************************************** + * + * $Id$ + * + * Author: Brian Lasiuk, Thomas Ullrich, April 1998 + *************************************************************************** + * + * Description: + * + * Remarks: Since not all compilers support member templates + * we have to specialize the templated member on these + * platforms. If member templates are not supported the + * ST_NO_MEMBER_TEMPLATES flag has to be set. tu. + * + * In the near future when all compilers can handle member + * templates this class should be cleaned up. A lot of + * redundant code can be removed as soon as the compilers + * are up-to-date. tu + * + *************************************************************************** + * + * $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.11 2005/09/22 20:09:20 fisyak + * Make AliFemtoLorentzVector persistent + * + * Revision 1.10 2005/07/06 18:49:56 fisyak + * Replace AliFemtoHelixD, AliFemtoLorentzVectorD,AliFemtoLorentzVectorF,AliFemtoMatrixD,AliFemtoMatrixF,AliFemtoPhysicalHelixD,AliFemtoThreeVectorD,AliFemtoThreeVectorF by templated version + * + * Revision 1.9 2005/03/28 06:02:45 perev + * Defence FPE added + * + * Revision 1.8 2003/09/02 17:59:35 perev + * gcc 3.2 updates + WarnOff + * + * Revision 1.7 2003/05/01 19:24:31 ullrich + * Corrected problem in boost(). + * + * Revision 1.6 1999/10/15 15:56:36 ullrich + * Changed output format in operator<<, added operator>> + * + * Revision 1.5 1999/06/04 18:01:36 ullrich + * New operators operator() and operator[] which can be used + * as lvalues. + * + * Revision 1.4 1999/04/14 23:12:07 fisyak + * Add __CINT__ to handle references + * + * Revision 1.3 1999/02/17 11:38:36 ullrich + * Removed specialization for 'long double'. + * + * Revision 1.2 1999/02/14 23:11:42 fisyak + * Fixes for Rootcint + * + * Revision 1.1 1999/01/30 03:59:02 fisyak + * Root Version of AliFemtoarClassLibrary + * + * Revision 1.1 1999/01/23 00:27:52 ullrich + * Initial Revision + * + **************************************************************************/ +/*// +//// General class for a Lorentz four-vector +///*/ +#ifndef ST_LORENTZ_VECTOR_HH +#define ST_LORENTZ_VECTOR_HH + +#include "AliFemtoThreeVector.h" +template class AliFemtoLorentzVector { +public: + AliFemtoLorentzVector(T = 0, T = 0, T = 0, T = 0); + virtual ~AliFemtoLorentzVector(); + +#ifndef ST_NO_MEMBER_TEMPLATES + template AliFemtoLorentzVector(const AliFemtoThreeVector&, T); + template AliFemtoLorentzVector(T, const AliFemtoThreeVector&); + + template AliFemtoLorentzVector(const AliFemtoLorentzVector&); + template AliFemtoLorentzVector& operator=(const AliFemtoLorentzVector&); + // AliFemtoLorentzVector(const AliFemtoLorentzVector&); use default + // AliFemtoLorentzVector& operator=(const AliFemtoLorentzVector&); use default +#else + AliFemtoLorentzVector(const AliFemtoThreeVector&, T); + AliFemtoLorentzVector(T, const AliFemtoThreeVector&); + AliFemtoLorentzVector(const AliFemtoLorentzVector&); + + AliFemtoLorentzVector(const AliFemtoThreeVector&, T); + AliFemtoLorentzVector(T, const AliFemtoThreeVector&); + AliFemtoLorentzVector(const AliFemtoLorentzVector&); + + AliFemtoLorentzVector& operator=(const AliFemtoLorentzVector&); + AliFemtoLorentzVector& operator=(const AliFemtoLorentzVector&); +#endif + + T x() const; + T y() const; + T z() const; + T t() const; + T px() const; + T py() const; + T pz() const; + T e() const; + T operator() (size_t) const; + T operator[] (size_t) const; + + T& operator() (size_t); + T& operator[] (size_t); + + const AliFemtoThreeVector& vect() const; + + void SetX(T); + void SetY(T); + void SetZ(T); + void SetPx(T); + void SetPy(T); + void SetPz(T); + void SetE(T); + void SetT(T); + +#ifndef ST_NO_MEMBER_TEMPLATES + template void SetVect(const AliFemtoThreeVector&); +#else + void SetVect(const AliFemtoThreeVector&); + void SetVect(const AliFemtoThreeVector&); +#endif + + T Perp() const; + T Perp2() const; + T PseudoRapidity() const; + T Phi() const; + T Theta() const; + T CosTheta() const; + + T Plus() const; + T Minus() const; + + T m() const; + T m2() const; + T mt() const; + T mt2() const; + T Rapidity() const; + +#ifndef ST_NO_MEMBER_TEMPLATES + template AliFemtoLorentzVector boost(const AliFemtoLorentzVector&) const; +#else + AliFemtoLorentzVector boost(const AliFemtoLorentzVector&) const; + AliFemtoLorentzVector boost(const AliFemtoLorentzVector&) const; +#endif + + AliFemtoLorentzVector operator- (); + AliFemtoLorentzVector operator+ (); + AliFemtoLorentzVector& operator*= (double); + AliFemtoLorentzVector& operator/= (double); + +#ifndef ST_NO_MEMBER_TEMPLATES + template bool operator == (const AliFemtoLorentzVector&) const; + template bool operator != (const AliFemtoLorentzVector&) const; + template AliFemtoLorentzVector& operator+= (const AliFemtoLorentzVector&); + template AliFemtoLorentzVector& operator-= (const AliFemtoLorentzVector&); +#else + bool operator == (const AliFemtoLorentzVector&) const; + bool operator != (const AliFemtoLorentzVector&) const; + bool operator == (const AliFemtoLorentzVector&) const; + bool operator != (const AliFemtoLorentzVector&) const; + + AliFemtoLorentzVector& operator+= (const AliFemtoLorentzVector&); + AliFemtoLorentzVector& operator-= (const AliFemtoLorentzVector&); + AliFemtoLorentzVector& operator+= (const AliFemtoLorentzVector&); + AliFemtoLorentzVector& operator-= (const AliFemtoLorentzVector&); +#endif + +protected: + AliFemtoThreeVector fThreeVector; // The three-vector component + T fX4; // The fourth component +#ifdef __ROOT__ + ClassDef(AliFemtoLorentzVector,3) +#endif +}; +#ifndef __CINT__ +// +// Implementation of member functions +// +template +AliFemtoLorentzVector::AliFemtoLorentzVector(T x, T y, T z, T t) + : fThreeVector(x, y, z), fX4(t) { /* nop */ } + +template +AliFemtoLorentzVector::~AliFemtoLorentzVector() { /* nopt */ } + +template +const AliFemtoThreeVector& AliFemtoLorentzVector::vect() const +{ + return fThreeVector; +} + +template +T AliFemtoLorentzVector::m2() const +{ + return (fX4*fX4 - fThreeVector*fThreeVector); +} + +template +T AliFemtoLorentzVector::Plus() const { return (e() + pz()); } + +template +T AliFemtoLorentzVector::Minus() const { return (e() - pz()); } + +template +T AliFemtoLorentzVector::m() const +{ + T mass2 = m2(); + if (mass2 < 0) + return -::sqrt(-mass2); + else + return ::sqrt(mass2); +} + +template +T AliFemtoLorentzVector::mt2() const +{ + return this->Perp2() + m2(); +} + +template +T AliFemtoLorentzVector::mt() const +{ + // + // change to more optimal code ? + // return e()*e() - pz()*pz(); + T massPerp2 = mt2(); + if (massPerp2 < 0) + return -::sqrt(-massPerp2); + else + return ::sqrt(massPerp2); +} + +template +void AliFemtoLorentzVector::SetPx(T x) {fThreeVector.SetX(x);} + +template +void AliFemtoLorentzVector::SetPy(T y) {fThreeVector.SetY(y);} + +template +void AliFemtoLorentzVector::SetPz(T z) {fThreeVector.SetZ(z);} + +template +void AliFemtoLorentzVector::SetX(T x) {fThreeVector.SetX(x);} + +template +void AliFemtoLorentzVector::SetY(T y) {fThreeVector.SetY(y);} + +template +void AliFemtoLorentzVector::SetZ(T z) {fThreeVector.SetZ(z);} + +template +void AliFemtoLorentzVector::SetT(T t) {fX4 = t;} + +template +void AliFemtoLorentzVector::SetE(T e) {fX4 = e;} + +template +T AliFemtoLorentzVector::x() const {return fThreeVector.x();} + +template +T AliFemtoLorentzVector::y() const {return fThreeVector.y();} + +template +T AliFemtoLorentzVector::z() const {return fThreeVector.z();} + +template +T AliFemtoLorentzVector::px() const {return fThreeVector.x();} + +template +T AliFemtoLorentzVector::py() const {return fThreeVector.y();} + +template +T AliFemtoLorentzVector::pz() const {return fThreeVector.z();} + +template +T AliFemtoLorentzVector::e() const {return fX4;} + +template +T AliFemtoLorentzVector::t() const {return fX4;} + +template +T AliFemtoLorentzVector::Perp() const {return fThreeVector.Perp();} + +template +T AliFemtoLorentzVector::Perp2() const {return fThreeVector.Perp2();} + +template +T AliFemtoLorentzVector::PseudoRapidity() const {return fThreeVector.PseudoRapidity();} + +template +T AliFemtoLorentzVector::Phi() const {return fThreeVector.Phi();} + +template +T AliFemtoLorentzVector::Theta() const {return fThreeVector.Theta();} + +template +T AliFemtoLorentzVector::CosTheta() const {return fThreeVector.CosTheta();} + +template +T AliFemtoLorentzVector::operator() (size_t i) const +{ + if (i < 3) + return fThreeVector(i); + else if (i == 3) + return fX4; + else { +#ifndef ST_NO_EXCEPTIONS + throw out_of_range("AliFemtoLorentzVector::operator(): bad index"); +#else + cerr << "AliFemtoLorentzVector::operator(): bad index." << endl; +#endif + return 0; + } +} + +template +T& AliFemtoLorentzVector::operator() (size_t i) +{ + if (i < 3) + return fThreeVector(i); + else if (i == 3) + return fX4; + else { +#ifndef ST_NO_EXCEPTIONS + throw out_of_range("AliFemtoLorentzVector::operator(): bad index"); +#else + cerr << "AliFemtoLorentzVector::operator(): bad index." << endl; +#endif + return fX4; + } +} + +template +T AliFemtoLorentzVector::operator[] (size_t i) const +{ + if (i < 3) + return fThreeVector[i]; + else if (i == 3) + return fX4; + else { +#ifndef ST_NO_EXCEPTIONS + throw out_of_range("AliFemtoLorentzVector::operator[]: bad index"); +#else + cerr << "AliFemtoLorentzVector::operator[]: bad index." << endl; +#endif + return 0; + } +} + +template +T& AliFemtoLorentzVector::operator[] (size_t i) +{ + if (i < 3) + return fThreeVector[i]; + else if (i == 3) + return fX4; + else { +#ifndef ST_NO_EXCEPTIONS + throw out_of_range("AliFemtoLorentzVector::operator[]: bad index"); +#else + cerr << "AliFemtoLorentzVector::operator[]: bad index." << endl; +#endif + return fX4; + } +} + +template +T AliFemtoLorentzVector::Rapidity() const +{ + return 0.5*::log((fX4+fThreeVector.z())/(fX4-fThreeVector.z())+1e-20); +} + +template +AliFemtoLorentzVector AliFemtoLorentzVector::operator- () +{ + return AliFemtoLorentzVector(-fX4,-fThreeVector); +} + +template +AliFemtoLorentzVector AliFemtoLorentzVector::operator+ () +{ + return *this; +} + +template +AliFemtoLorentzVector& AliFemtoLorentzVector::operator*= (double c) +{ + fThreeVector *= c; + fX4 *= c; + return *this; +} + +template +AliFemtoLorentzVector& AliFemtoLorentzVector::operator/= (double c) +{ + fThreeVector /= c; + fX4 /= c; + return *this; +} + +#ifndef ST_NO_MEMBER_TEMPLATES +#ifndef WIN32 + +template +template +AliFemtoLorentzVector::AliFemtoLorentzVector(const AliFemtoThreeVector &vec, T t) + : fThreeVector(vec), fX4(t) { /* nop */ } + +template +template +AliFemtoLorentzVector::AliFemtoLorentzVector(T t, const AliFemtoThreeVector &vec) + : fThreeVector(vec), fX4(t) { /* nop */ } + +template +template +AliFemtoLorentzVector::AliFemtoLorentzVector(const AliFemtoLorentzVector &vec) + : fThreeVector(vec.vect()), fX4(vec.t()) { /* nop */ } + +template +template +AliFemtoLorentzVector +AliFemtoLorentzVector::boost(const AliFemtoLorentzVector& pframe) const +{ + T mass = abs(pframe); + AliFemtoThreeVector eta = (-1./mass)*pframe.vect(); // gamma*beta + T gamma = fabs(pframe.e())/mass; + AliFemtoThreeVector pl = ((this->vect()*eta)/(eta*eta))*eta; // longitudinal momentum + return AliFemtoLorentzVector(gamma*this->e() - this->vect()*eta, + this->vect() + (gamma-1.)*pl - this->e()*eta); +} + +template +template +void AliFemtoLorentzVector::SetVect(const AliFemtoThreeVector& v) +{ + fThreeVector = v; +} + +template +template +AliFemtoLorentzVector& +AliFemtoLorentzVector::operator=(const AliFemtoLorentzVector& vec) +{ + if(this != &vec) { + fThreeVector = vec.vect(); + fX4 = vec.t(); + } + return *this; +} + +template +template +bool +AliFemtoLorentzVector::operator== (const AliFemtoLorentzVector& v) const +{ + return (fThreeVector == v.vect()) && (fX4 == v.t()); +} + +template +template +bool +AliFemtoLorentzVector::operator!= (const AliFemtoLorentzVector& v) const +{ + return !(*this == v); +} + +template +template +AliFemtoLorentzVector& +AliFemtoLorentzVector::operator+= (const AliFemtoLorentzVector& v) +{ + fThreeVector += v.vect(); + fX4 += v.t(); + return *this; +} + +template +template +AliFemtoLorentzVector& +AliFemtoLorentzVector::operator-= (const AliFemtoLorentzVector& v) +{ + fThreeVector -= v.vect(); + fX4 -= v.t(); + return *this; +} + +#endif +#else + +template +AliFemtoLorentzVector::AliFemtoLorentzVector(const AliFemtoThreeVector &vec, T t) + : fThreeVector(vec), fX4(t) { /* nop */ } + +template +AliFemtoLorentzVector::AliFemtoLorentzVector(const AliFemtoThreeVector &vec, T t) + : fThreeVector(vec), fX4(t) { /* nop */ } + +template +AliFemtoLorentzVector::AliFemtoLorentzVector(T t, const AliFemtoThreeVector &vec) + : fThreeVector(vec), fX4(t) { /* nop */ } + +template +AliFemtoLorentzVector::AliFemtoLorentzVector(T t, const AliFemtoThreeVector &vec) + : fThreeVector(vec), fX4(t) { /* nop */ } + +template +AliFemtoLorentzVector::AliFemtoLorentzVector(const AliFemtoLorentzVector &vec) + : fThreeVector(vec.vect()), fX4(vec.t()) { /* nop */ } + +template +AliFemtoLorentzVector::AliFemtoLorentzVector(const AliFemtoLorentzVector &vec) + : fThreeVector(vec.vect()), fX4(vec.t()) { /* nop */ } + +template +AliFemtoLorentzVector +AliFemtoLorentzVector::boost(const AliFemtoLorentzVector& pframe) const +{ + T mass = abs(pframe); + AliFemtoThreeVector eta = (-1./mass)*pframe.vect(); // gamma*beta + T gamma = fabs(pframe.e())/mass; + AliFemtoThreeVector pl = ((this->vect()*eta)/(eta*eta))*eta; // longitudinal momentum + return AliFemtoLorentzVector(gamma*this->e() - this->vect()*eta, + this->vect() + (gamma-1.)*pl - this->e()*eta); +} + +template +AliFemtoLorentzVector +AliFemtoLorentzVector::boost(const AliFemtoLorentzVector& pframe) const +{ + T mass = abs(pframe); + AliFemtoThreeVector eta = (-1./mass)*pframe.vect(); // gamma*beta + T gamma = fabs(pframe.e())/mass; + AliFemtoThreeVector pl = ((this->vect()*eta)/(eta*eta))*eta; // longitudinal momentum + return AliFemtoLorentzVector(gamma*this->e() - this->vect()*eta, + this->vect() + (gamma-1.)*pl - this->e()*eta); +} + +template +void AliFemtoLorentzVector::SetVect(const AliFemtoThreeVector& v) +{ + fThreeVector = v; +} + +template +void AliFemtoLorentzVector::SetVect(const AliFemtoThreeVector& v) +{ + fThreeVector = v; +} + +template +AliFemtoLorentzVector& +AliFemtoLorentzVector::operator=(const AliFemtoLorentzVector& vec) +{ + fThreeVector = vec.vect(); + fX4 = vec.t(); + return *this; +} + +template +AliFemtoLorentzVector& +AliFemtoLorentzVector::operator=(const AliFemtoLorentzVector& vec) +{ + fThreeVector = vec.vect(); + fX4 = vec.t(); + return *this; +} + +template +bool +AliFemtoLorentzVector::operator== (const AliFemtoLorentzVector& v) const +{ + return (this->vect() == v.vect()) && (fX4 == v.t()); +} + +template +bool +AliFemtoLorentzVector::operator== (const AliFemtoLorentzVector& v) const +{ + return (fThreeVector == v.vect()) && (fX4 == v.t()); +} + +template +bool +AliFemtoLorentzVector::operator!= (const AliFemtoLorentzVector& v) const +{ + return !(*this == v); +} + +template +bool +AliFemtoLorentzVector::operator!= (const AliFemtoLorentzVector& v) const +{ + return !(*this == v); +} + +template +AliFemtoLorentzVector& +AliFemtoLorentzVector::operator+= (const AliFemtoLorentzVector& v) +{ + fThreeVector += v.vect(); + fX4 += v.t(); + return *this; +} + +template +AliFemtoLorentzVector& +AliFemtoLorentzVector::operator+= (const AliFemtoLorentzVector& v) +{ + fThreeVector += v.vect(); + fX4 += v.t(); + return *this; +} + +template +AliFemtoLorentzVector& +AliFemtoLorentzVector::operator-= (const AliFemtoLorentzVector& v) +{ + fThreeVector -= v.vect(); + fX4 -= v.t(); + return *this; +} + +template +AliFemtoLorentzVector& +AliFemtoLorentzVector::operator-= (const AliFemtoLorentzVector& v) +{ + fThreeVector -= v.vect(); + fX4 -= v.t(); + return *this; +} + +#endif // ST_NO_MEMBER_TEMPLATES +#endif /* ! __CINT__ */ +#ifdef __CINT__ +template<> AliFemtoLorentzVector operator+ (const AliFemtoLorentzVector& v1, const AliFemtoLorentzVector& v2); +template<> AliFemtoLorentzVector operator+ (const AliFemtoLorentzVector& v1, const AliFemtoLorentzVector& v2); +template<> AliFemtoLorentzVector operator+ (const AliFemtoLorentzVector& v1, const AliFemtoLorentzVector& v2); +template<> AliFemtoLorentzVector operator+ (const AliFemtoLorentzVector& v1, const AliFemtoLorentzVector& v2); +template<> AliFemtoLorentzVector operator- (const AliFemtoLorentzVector& v1, const AliFemtoLorentzVector& v2); +template<> AliFemtoLorentzVector operator- (const AliFemtoLorentzVector& v1, const AliFemtoLorentzVector& v2); +template<> AliFemtoLorentzVector operator- (const AliFemtoLorentzVector& v1, const AliFemtoLorentzVector& v2); +template<> AliFemtoLorentzVector operator- (const AliFemtoLorentzVector& v1, const AliFemtoLorentzVector& v2); +template<> AliFemtoLorentzVector operator* (const AliFemtoLorentzVector& v1, const AliFemtoLorentzVector& v2); +template<> AliFemtoLorentzVector operator* (const AliFemtoLorentzVector& v1, const AliFemtoLorentzVector& v2); +template<> AliFemtoLorentzVector operator* (const AliFemtoLorentzVector& v1, const AliFemtoLorentzVector& v2); +template<> AliFemtoLorentzVector operator* (const AliFemtoLorentzVector& v1, const AliFemtoLorentzVector& v2); +template<> AliFemtoLorentzVector operator* (const double v1, const AliFemtoLorentzVector& v2); +template<> AliFemtoLorentzVector operator* (const double v1, const AliFemtoLorentzVector& v2); +template<> AliFemtoLorentzVector operator* (const AliFemtoLorentzVector& v1, const double v2); +template<> AliFemtoLorentzVector operator* (const AliFemtoLorentzVector& v1, const double v2); +template<> AliFemtoLorentzVector operator/ (const AliFemtoLorentzVector& v1, const AliFemtoLorentzVector& v2); +template<> AliFemtoLorentzVector operator/ (const AliFemtoLorentzVector& v1, const AliFemtoLorentzVector& v2); +template<> AliFemtoLorentzVector operator/ (const AliFemtoLorentzVector& v1, const AliFemtoLorentzVector& v2); +template<> AliFemtoLorentzVector operator/ (const AliFemtoLorentzVector& v1, const AliFemtoLorentzVector& v2); +template<> AliFemtoLorentzVector operator/ (const double v1, const AliFemtoLorentzVector& v2); +template<> AliFemtoLorentzVector operator/ (const double v1, const AliFemtoLorentzVector& v2); +template<> AliFemtoLorentzVector operator/ (const AliFemtoLorentzVector& v1, const double v2); +template<> AliFemtoLorentzVector operator/ (const AliFemtoLorentzVector& v1, const double v2); +template<> istream& operator>> (istream& is, const AliFemtoLorentzVector& v); +template<> ostream& operator<< (ostream& os, const AliFemtoLorentzVector& v); +template<> istream& operator>> (istream& is, const AliFemtoLorentzVector& v); +template<> ostream& operator<< (ostream& os, const AliFemtoLorentzVector& v); +template<> double abs(const AliFemtoLorentzVector& v); +template<> float abs(const AliFemtoLorentzVector& v); +#else +// +// Non-member operators +// +template +AliFemtoLorentzVector +operator+ (const AliFemtoLorentzVector& v1, const AliFemtoLorentzVector& v2) +{ + return AliFemtoLorentzVector(v1) += v2; +} + +template +AliFemtoLorentzVector +operator- (const AliFemtoLorentzVector& v1, const AliFemtoLorentzVector& v2) +{ + return AliFemtoLorentzVector(v1) -= v2; +} + +template +T +operator* (const AliFemtoLorentzVector& v1, const AliFemtoLorentzVector& v2) +{ + return v1.t()*v2.t() - v1.vect()*v2.vect(); +} + +template +AliFemtoLorentzVector +operator* (const AliFemtoLorentzVector& v, double c) +{ + return AliFemtoLorentzVector(v) *= c; +} + +template +AliFemtoLorentzVector operator* (double c, const AliFemtoLorentzVector& v) +{ + return AliFemtoLorentzVector(v) *= c; +} + +template +AliFemtoLorentzVector operator/ (const AliFemtoLorentzVector& v, X c) +{ + return AliFemtoLorentzVector(v) /= c; +} + +template +ostream& operator<< (ostream& os, const AliFemtoLorentzVector& v) +{ + return os << v.vect() << "\t\t" << v.t(); +} + +template +istream& operator>>(istream& is, AliFemtoLorentzVector& v) +{ + T x, y, z, t; + is >> x >> y >> z >> t; + v.SetX(x); + v.SetY(y); + v.SetZ(z); + v.SetT(t); + return is; +} + +// +// Non-member functions +// +template +T abs(const AliFemtoLorentzVector& v) {return v.m();} + +#endif /* __CINT__ */ +#endif diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLorentzVectorD.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLorentzVectorD.h new file mode 100644 index 00000000000..bbfab85567f --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoLorentzVectorD.h @@ -0,0 +1,22 @@ +/*************************************************************************** + * + * $Id$ + * $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.6 2005/07/06 18:49:56 fisyak + * Replace AliFemtoHelixD, AliFemtoLorentzVectorD,AliFemtoLorentzVectorF,AliFemtoMatrixD,AliFemtoMatrixF,AliFemtoPhysicalHelixD,AliFemtoThreeVectorD,AliFemtoThreeVectorF by templated version + * + +****************************************************************************/ +#ifndef ALIFM_LORENTZ_VECTOR_D_HH +#define ALIFM_LORENTZ_VECTOR_D_HH +//#include "AliFemtoThreeVectorF.hh" +#include "AliFmThreeVectorD.h" +#include "AliFmLorentzVector.h" +typedef AliFmLorentzVector AliFmLorentzVectorD; +#endif diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoMCTrackCut.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoMCTrackCut.cxx new file mode 100644 index 00000000000..49139ebde5e --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoMCTrackCut.cxx @@ -0,0 +1,186 @@ +///////////////////////////////////////////////////////////////////////////////////// +// // +// AliFemtoMCTrackCut: A basic track cut that used information from // +// ALICE MC to accept or reject the track. // +// Enables the selection on charge, transverse momentum, rapidity, // +// and PDG of the particle // +// Authors: Malgorzata Janik, Warsaw University of Technology, majanik@cern.ch // +// Lukasz Graczykowski, Warsaw University of Technology, lgraczyk@cern.ch // +// // +///////////////////////////////////////////////////////////////////////////////////// + + + +#include "AliFemtoMCTrackCut.h" +#include + +#ifdef __ROOT__ +ClassImp(AliFemtoMCTrackCut) +#endif + + +AliFemtoMCTrackCut::AliFemtoMCTrackCut() : + fCharge(0), + fLabel(0), + fPDGcode(211), + fNTracksPassed(0), + fNTracksFailed(0) +{ + // Default constructor + fNTracksPassed = fNTracksFailed = 0; + fCharge = 0; // takes both charges 0 + fPt[0]=0.0; fPt[1] = 100.0;//100 + fPDGcode = 0; + fRapidity[0]=-2; fRapidity[1]=2;//-2 2 + fEta[0]=-2; fEta[1]=2;//-2 2 + fLabel=false; +} +//------------------------------ +AliFemtoMCTrackCut::~AliFemtoMCTrackCut(){ + /* noop */ +} +//------------------------------ +bool AliFemtoMCTrackCut::Pass(const AliFemtoTrack* track) +{ + + if (fLabel) + { + if(track->Label()<0) + { + fNTracksFailed++; + return false; + } + } + + if (fCharge!=0) + { + if (fCharge==10) + { + if(track->Charge()==0){ + fNTracksFailed++; + return false; + } + } + else if (track->Charge()!= fCharge) + { + fNTracksFailed++; + return false; + } + } + + if (fPDGcode!=0) + { + + if(fPDGcode==11 || fPDGcode==-11 ) + { if(!fMass) fMass=0.000511; + if (track->PidProbElectron()!=1000) + { + fNTracksFailed++; + return false; + } + } + if(fPDGcode==13 || fPDGcode==-13) + { + if (track->PidProbMuon()!=1000) + {if(!fMass) fMass=0.105658; + fNTracksFailed++; + return false; + } + } + if(fPDGcode==211 || fPDGcode==-211 ) + { + if (track->PidProbPion()!=1000) + {if(!fMass) fMass= 0.1395699; + fNTracksFailed++; + return false; + } + } + if(fPDGcode==2212 || fPDGcode==-2212 ) + { if(!fMass) fMass=0.938272013; + if (track->PidProbProton()!=1000) + { + fNTracksFailed++; + return false; + } + } + if(fPDGcode==321 || fPDGcode==-321 ) + { if(!fMass) fMass=0.493677; + if (track->PidProbKaon()!=1000) + { + fNTracksFailed++; + return false; + } + } + } + + float tEnergy = ::sqrt(track->P().Mag2()+fMass*fMass); + //cout<<"MCTrackCut: tEnergy: "<P().z(): "<P().z()<P().z(): "<P().z()<P().z() == 0 || (tEnergy+track->P().z())/(tEnergy-track->P().z()) == 0) + { + fNTracksFailed++; + return false; + } + else + 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())); + float tEta = track->P().PseudoRapidity(); + + if ((tRapidityfRapidity[1])) + { + fNTracksFailed++; + return false; + } + if ((tEtafEta[1])) + { + fNTracksFailed++; + return false; + } + if ((tPtfPt[1])) + { + fNTracksFailed++; + return false; + } + + fNTracksPassed++ ; + return true; + + +} +//------------------------------ +AliFemtoString AliFemtoMCTrackCut::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,"Particle eta:\t%E - %E\n",fEta[0],fEta[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 *AliFemtoMCTrackCut::ListSettings() +{ + // return a list of settings in a writable form + TList *tListSetttings = new TList(); + char buf[200]; + snprintf(buf, 200, "AliFemtoMCTrackCut.mass=%f", this->Mass()); + tListSetttings->AddLast(new TObjString(buf)); + + snprintf(buf, 200, "AliFemtoMCTrackCut.charge=%i", fCharge); + tListSetttings->AddLast(new TObjString(buf)); + return tListSetttings; +} + + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoMCTrackCut.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoMCTrackCut.h new file mode 100644 index 00000000000..61c54d0ad06 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoMCTrackCut.h @@ -0,0 +1,68 @@ +/////////////////////////////////////////////////////////////////////////// +// // +// AliFemtoMCTrackCut: A basic track cut that used information from // +// ALICE MC to accept or reject the track. // +// Enables the selection on charge, transverse momentum, rapidity, // +// and PDG of the particle // +// Authors: Malgorzata Janik (WUT) majanik@cern.ch // +// Lukasz Graczykowski (WUT) lgraczyk@cern.ch // +// // +/////////////////////////////////////////////////////////////////////////// + +#ifndef ALIFEMTOMCTRACKCUT_H +#define ALIFEMTOMCTRACKCUT_H + + +#include "AliFemtoTrackCut.h" + +class AliFemtoMCTrackCut : public AliFemtoTrackCut +{ + + public: + AliFemtoMCTrackCut(); + virtual ~AliFemtoMCTrackCut(); + + 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 SetEta(const float& lo, const float& hi); + void SetCharge(const int& ch); + void SetPDG(const int& pdg); + void SetLabel(const bool& flag); + + + 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 fEta[2]; // bounds for pseudorapidity + bool fLabel; // if true label<0 will not pass throught + int fPDGcode; // PDG code of the particle + + long fNTracksPassed; // passed tracks count + long fNTracksFailed; // failed tracks count + + + +#ifdef __ROOT__ + ClassDef(AliFemtoMCTrackCut, 1) +#endif + }; + + +inline void AliFemtoMCTrackCut::SetPt(const float& lo, const float& hi){fPt[0]=lo; fPt[1]=hi;} +inline void AliFemtoMCTrackCut::SetRapidity(const float& lo,const float& hi){fRapidity[0]=lo; fRapidity[1]=hi;} +inline void AliFemtoMCTrackCut::SetEta(const float& lo,const float& hi){fEta[0]=lo; fEta[1]=hi;} +inline void AliFemtoMCTrackCut::SetCharge(const int& ch){fCharge = ch;} +inline void AliFemtoMCTrackCut::SetPDG(const int& pdg){fPDGcode = pdg;} +inline void AliFemtoMCTrackCut::SetLabel(const bool& flag){fLabel=flag;} + + +#endif + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoManager.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoManager.cxx new file mode 100644 index 00000000000..76a86c950c4 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoManager.cxx @@ -0,0 +1,254 @@ +/////////////////////////////////////////////////////////////////////////// +// // +// AliFemtoManager: main class managing femtoscopic analysis // +// The Manager is the top-level object that coordinates activities // +// and performs event, particle, and pair loops, and checks the // +// various Cuts of the Analyses in its AnalysisCollection // +// // +/////////////////////////////////////////////////////////////////////////// + +#include "AliFemtoManager.h" +//#include "AliFemtoParticleCollection.h" +//#include "AliFemtoTrackCut.h" +//#include "AliFemtoV0Cut.h" +#include + +#ifdef __ROOT__ +ClassImp(AliFemtoManager) +#endif + + + +//____________________________ +AliFemtoManager::AliFemtoManager(): + fAnalysisCollection(0), + fEventReader(0), + fEventWriterCollection(0) +{ + // default constructor + fAnalysisCollection = new AliFemtoAnalysisCollection; + fEventWriterCollection = new AliFemtoEventWriterCollection; + fEventReader = 0; +} +//____________________________ +AliFemtoManager::AliFemtoManager(const AliFemtoManager& aManager) : + fAnalysisCollection(0), + fEventReader(0), + fEventWriterCollection(0) +{ + // copy constructor + fEventReader = aManager.fEventReader; + AliFemtoSimpleAnalysisIterator tAnalysisIter; + fAnalysisCollection = new AliFemtoAnalysisCollection; + for (tAnalysisIter=aManager.fAnalysisCollection->begin();tAnalysisIter!=aManager.fAnalysisCollection->end();tAnalysisIter++){ + fAnalysisCollection->push_back(*tAnalysisIter); + } + AliFemtoEventWriterIterator tEventWriterIter; + fEventWriterCollection = new AliFemtoEventWriterCollection; + for (tEventWriterIter=aManager.fEventWriterCollection->begin();tEventWriterIter!=aManager.fEventWriterCollection->end();tEventWriterIter++){ + fEventWriterCollection->push_back(*tEventWriterIter); + } +} + +//____________________________ +AliFemtoManager::~AliFemtoManager(){ + // destructor + delete fEventReader; + // now delete each Analysis in the Collection, and then the Collection itself + AliFemtoSimpleAnalysisIterator tAnalysisIter; + for (tAnalysisIter=fAnalysisCollection->begin();tAnalysisIter!=fAnalysisCollection->end();tAnalysisIter++){ + delete *tAnalysisIter; + *tAnalysisIter = 0; + } + delete fAnalysisCollection; + // now delete each EventWriter in the Collection, and then the Collection itself + AliFemtoEventWriterIterator tEventWriterIter; + for (tEventWriterIter=fEventWriterCollection->begin();tEventWriterIter!=fEventWriterCollection->end();tEventWriterIter++){ + delete *tEventWriterIter; + *tEventWriterIter = 0; + } + delete fEventWriterCollection; +} +//____________________________ +AliFemtoManager& AliFemtoManager::operator=(const AliFemtoManager& aManager) +{ + // assignment operator + if (this == &aManager) + return *this; + + fEventReader = aManager.fEventReader; + AliFemtoSimpleAnalysisIterator tAnalysisIter; + if (fAnalysisCollection) { + for (tAnalysisIter=fAnalysisCollection->begin();tAnalysisIter!=fAnalysisCollection->end();tAnalysisIter++){ + delete *tAnalysisIter; + *tAnalysisIter = 0; + } + delete fAnalysisCollection; + } + // now delete each EventWriter in the Collection, and then the Collection itself + AliFemtoEventWriterIterator tEventWriterIter; + if (fEventWriterCollection) { + for (tEventWriterIter=fEventWriterCollection->begin();tEventWriterIter!=fEventWriterCollection->end();tEventWriterIter++){ + delete *tEventWriterIter; + *tEventWriterIter = 0; + } + delete fEventWriterCollection; + } + + fAnalysisCollection = new AliFemtoAnalysisCollection; + for (tAnalysisIter=aManager.fAnalysisCollection->begin();tAnalysisIter!=aManager.fAnalysisCollection->end();tAnalysisIter++){ + fAnalysisCollection->push_back(*tAnalysisIter); + } + + fEventWriterCollection = new AliFemtoEventWriterCollection; + for (tEventWriterIter=aManager.fEventWriterCollection->begin();tEventWriterIter!=aManager.fEventWriterCollection->end();tEventWriterIter++){ + fEventWriterCollection->push_back(*tEventWriterIter); + } + return *this; +} + +//____________________________ +int AliFemtoManager::Init(){ + // Execute initialization procedures + AliFemtoString readerMessage; + readerMessage += "*** *** *** *** *** *** *** *** *** *** *** *** \n"; + // EventReader + if (fEventReader) { + if (fEventReader->Init("r",readerMessage)){ + cout << " AliFemtoManager::Init() - Reader initialization failed " << endl; + return (1); + } + readerMessage += fEventReader->Report(); + } + // EventWriters + AliFemtoEventWriterIterator tEventWriterIter; + for (tEventWriterIter=fEventWriterCollection->begin();tEventWriterIter!=fEventWriterCollection->end();tEventWriterIter++){ + //cout << "*EventWriterIter " << *EventWriterIter << endl; + // The message (AliFemtoString) passed into Init will be at the file header. + // for that reason take the readerReport, add my own report and pass as message + AliFemtoString writerMessage = readerMessage; + writerMessage += "*** *** *** *** *** *** *** *** *** *** *** *** \n"; + writerMessage += (*tEventWriterIter)->Report(); + if (*tEventWriterIter) { + if ( (*tEventWriterIter)->Init("w",writerMessage)){ // yes, the message from the reader is passed into the writer + cout << " AliFemtoManager::Init() - Writer initialization failed " << endl; + return (1); + } + } + } + + + return (0); +} +//____________________________ +void AliFemtoManager::Finish(){ + // Initialize finish procedures + // EventReader + if (fEventReader) fEventReader->Finish(); + // EventWriters + AliFemtoEventWriterIterator tEventWriterIter; + AliFemtoEventWriter* currentEventWriter; + for (tEventWriterIter=fEventWriterCollection->begin();tEventWriterIter!=fEventWriterCollection->end();tEventWriterIter++){ + currentEventWriter = *tEventWriterIter; + currentEventWriter->Finish(); + } + // Analyses + AliFemtoSimpleAnalysisIterator tAnalysisIter; + AliFemtoAnalysis* currentAnalysis; + for (tAnalysisIter=fAnalysisCollection->begin();tAnalysisIter!=fAnalysisCollection->end();tAnalysisIter++){ + currentAnalysis = *tAnalysisIter; + currentAnalysis->Finish(); + } +} +//____________________________ +AliFemtoString AliFemtoManager::Report(){ + // Construct a report from all the classes + string stemp; + char ctemp[100]; + // EventReader + stemp = fEventReader->Report(); + // EventWriters + snprintf(ctemp , 100, "\nAliFemtoManager Reporting %u EventWriters\n",(unsigned int) fEventWriterCollection->size()); + stemp += ctemp; + AliFemtoEventWriterIterator tEventWriterIter; + AliFemtoEventWriter* currentEventWriter; + for (tEventWriterIter=fEventWriterCollection->begin();tEventWriterIter!=fEventWriterCollection->end();tEventWriterIter++){ + // cout << "AliFemtoManager - asking for EventWriter Report" << endl; + currentEventWriter = *tEventWriterIter; + stemp+=currentEventWriter->Report(); + } + // Analyses + snprintf(ctemp , 100, "\nAliFemtoManager Reporting %u Analyses\n",(unsigned int) fAnalysisCollection->size()); + stemp += ctemp; + AliFemtoSimpleAnalysisIterator tAnalysisIter; + AliFemtoAnalysis* currentAnalysis; + for (tAnalysisIter=fAnalysisCollection->begin();tAnalysisIter!=fAnalysisCollection->end();tAnalysisIter++){ + // cout << "AliFemtoManager - asking for Analysis Report" << endl; + currentAnalysis = *tAnalysisIter; + stemp+=currentAnalysis->Report(); + } + + AliFemtoString returnThis = stemp; + return returnThis; +} +//____________________________ +AliFemtoAnalysis* AliFemtoManager::Analysis( int n ){ // return pointer to n-th analysis + // return analysis number n + if ( n<0 || n > (int) fAnalysisCollection->size() ) + return NULL; + AliFemtoSimpleAnalysisIterator iter = fAnalysisCollection->begin(); + for (int i=0; i (int) fEventWriterCollection->size() ) + return NULL; + AliFemtoEventWriterIterator iter = fEventWriterCollection->begin(); + for (int i=0; iReturnHbtEvent(); + // cout << "Event reader has returned control to manager" << endl; + + // if no HbtEvent is returned, then we abort processing. + // the question is now: do we try again next time (i.e. there may be an HbtEvent next time) + // or are we at EOF or something? If Reader says Status=0, then that means try again later. + // so, we just return the Reader's Status. + if (!currentHbtEvent){ + cout << "AliFemtoManager::ProcessEvent() - Reader::ReturnHbtEvent() has returned null pointer\n"; + return fEventReader->Status(); + } + + // loop over all the EventWriters + AliFemtoEventWriterIterator tEventWriterIter; + for (tEventWriterIter=fEventWriterCollection->begin();tEventWriterIter!=fEventWriterCollection->end();tEventWriterIter++){ +#ifdef STHBRDEBUG + cout << " *tEventWriterIter " << *tEventWriterIter << endl; +#endif + (*tEventWriterIter)->WriteHbtEvent(currentHbtEvent); + } + + // loop over all the Analysis + AliFemtoSimpleAnalysisIterator tAnalysisIter; + for (tAnalysisIter=fAnalysisCollection->begin();tAnalysisIter!=fAnalysisCollection->end();tAnalysisIter++){ + (*tAnalysisIter)->ProcessEvent(currentHbtEvent); + } + + if (currentHbtEvent) delete currentHbtEvent; +#ifdef STHBRDEBUG + cout << "AliFemtoManager::ProcessEvent() - return to caller ... " << endl; +#endif + return 0; // 0 = "good return" +} // ProcessEvent diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoManager.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoManager.h new file mode 100644 index 00000000000..df4edcce16a --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoManager.h @@ -0,0 +1,71 @@ +/////////////////////////////////////////////////////////////////////////// +// // +// AliFemtoManager: main class managing femtoscopic analysis // +// The Manager is the top-level object that coordinates activities // +// and performs event, particle, and pair loops, and checks the // +// various Cuts of the Analyses in its AnalysisCollection // +// // +/////////////////////////////////////////////////////////////////////////// + +#ifndef ALIFEMTOMANAGER_H +#define ALIFEMTOMANAGER_H + + +#include "AliFemtoTypes.h" +#include "AliFemtoAnalysisCollection.h" +#include "AliFemtoEventWriterCollection.h" +#include "AliFemtoEvent.h" +#include "AliFemtoAnalysis.h" +#include "AliFemtoEventReader.h" +#include "AliFemtoEventWriter.h" + +class AliFemtoManager{ + +private: + AliFemtoAnalysisCollection* fAnalysisCollection; // Collection of analyzes + AliFemtoEventReader* fEventReader; // Event reader + AliFemtoEventWriterCollection* fEventWriterCollection; // Event writer collection + +public: + AliFemtoManager(); + AliFemtoManager(const AliFemtoManager& aManager); + virtual ~AliFemtoManager(); + + AliFemtoManager& operator=(const AliFemtoManager& aManager); + + // Gets and Sets... + AliFemtoAnalysisCollection* AnalysisCollection(); + AliFemtoAnalysis* Analysis(int n); // Access to Analysis within Collection + void AddAnalysis(AliFemtoAnalysis* a); + + AliFemtoEventWriterCollection* EventWriterCollection(); + AliFemtoEventWriter* EventWriter(int n);// Access to EventWriter within Collection + void SetEventWriter(AliFemtoEventWriter* w); // just for historic reasons + void AddEventWriter(AliFemtoEventWriter* w); + + AliFemtoEventReader* EventReader(); + void SetEventReader(AliFemtoEventReader* r); + + int Init(); + int ProcessEvent(); // a "0" return value means success - otherwise quit + void Finish(); + + AliFemtoString Report(); //! +#ifdef __ROOT__ + ClassDef(AliFemtoManager, 0) +#endif +}; + +inline AliFemtoAnalysisCollection* AliFemtoManager::AnalysisCollection(){return fAnalysisCollection;} +inline void AliFemtoManager::AddAnalysis(AliFemtoAnalysis* anal){fAnalysisCollection->push_back(anal);} + +inline AliFemtoEventWriterCollection* AliFemtoManager::EventWriterCollection(){return fEventWriterCollection;} +inline void AliFemtoManager::AddEventWriter(AliFemtoEventWriter* writer){fEventWriterCollection->push_back(writer);} +inline void AliFemtoManager::SetEventWriter(AliFemtoEventWriter* writer){fEventWriterCollection->push_back(writer);} + +inline AliFemtoEventReader* AliFemtoManager::EventReader(){return fEventReader;} +inline void AliFemtoManager::SetEventReader(AliFemtoEventReader* reader){fEventReader = reader;} + + +#endif + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelCorrFctn.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelCorrFctn.cxx new file mode 100644 index 00000000000..2d3b4aab445 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelCorrFctn.cxx @@ -0,0 +1,174 @@ +//////////////////////////////////////////////////////////////////////////////// +/// /// +/// AliFemtoModelCorrFctn - the base class for correlation function which /// +/// uses the model framework and weight generation /// +/// /// +//////////////////////////////////////////////////////////////////////////////// +#ifdef __ROOT__ + ClassImp(AliFemtoModelCorrFctn, 1) +#endif + +#include "AliFemtoModelGausLCMSFreezeOutGenerator.h" +#include "AliFemtoModelHiddenInfo.h" +#include "AliFemtoModelCorrFctn.h" +#include "AliFemtoPair.h" +#include "AliFemtoModelManager.h" +#include + +//_______________________ +AliFemtoModelCorrFctn::AliFemtoModelCorrFctn(): + AliFemtoCorrFctn(), + fManager(0), + fNumeratorTrue(0), + fNumeratorFake(0), + fDenominator(0) +{ + // Default constructor + fNumeratorTrue = new TH1D("ModelNumTrue","ModelNumTrue",50,0.0,0.5); + fNumeratorFake = new TH1D("ModelNumFake","ModelNumFake",50,0.0,0.5); + fDenominator = new TH1D("ModelDen","ModelDen",50,0.0,0.5); + + fNumeratorTrue->Sumw2(); + fNumeratorFake->Sumw2(); + fDenominator->Sumw2(); +} +//_______________________ +AliFemtoModelCorrFctn::AliFemtoModelCorrFctn(const char *title, Int_t aNbins, Double_t aQinvLo, Double_t aQinvHi): + AliFemtoCorrFctn(), + fManager(0), + fNumeratorTrue(0), + fNumeratorFake(0), + fDenominator(0) +{ + // Normal constructor + char buf[100]; + snprintf(buf , 100, "NumTrue%s", title); + fNumeratorTrue = new TH1D(buf,buf,aNbins,aQinvLo,aQinvHi); + snprintf(buf , 100, "NumFake%s", title); + fNumeratorFake = new TH1D(buf,buf,aNbins,aQinvLo,aQinvHi); + snprintf(buf , 100, "Den%s", title); + fDenominator = new TH1D(buf,buf,aNbins,aQinvLo,aQinvHi); + + fNumeratorTrue->Sumw2(); + fNumeratorFake->Sumw2(); + fDenominator->Sumw2(); +} +//_______________________ +AliFemtoModelCorrFctn::AliFemtoModelCorrFctn(const AliFemtoModelCorrFctn& aCorrFctn) : + AliFemtoCorrFctn(), + fManager(0), + fNumeratorTrue(0), + fNumeratorFake(0), + fDenominator(0) +{ + // Copy constructor + if (aCorrFctn.fNumeratorTrue) + fNumeratorTrue = new TH1D(*(aCorrFctn.fNumeratorTrue)); + if (aCorrFctn.fNumeratorFake) + fNumeratorFake = new TH1D(*(aCorrFctn.fNumeratorFake)); + if (aCorrFctn.fDenominator) + fDenominator = new TH1D(*(aCorrFctn.fDenominator)); + fManager = aCorrFctn.fManager; +} +//_______________________ +AliFemtoModelCorrFctn::~AliFemtoModelCorrFctn() +{ + // Destructor + if (fNumeratorTrue) delete fNumeratorTrue; + if (fNumeratorFake) delete fNumeratorFake; + if (fDenominator) delete fDenominator; +} +//_______________________ +AliFemtoModelCorrFctn& AliFemtoModelCorrFctn::operator=(const AliFemtoModelCorrFctn& aCorrFctn) +{ + // Assignment operator + if (this == &aCorrFctn) + return *this; + + if (aCorrFctn.fNumeratorTrue) + fNumeratorTrue = new TH1D(*(aCorrFctn.fNumeratorTrue)); + else + fNumeratorTrue = 0; + if (aCorrFctn.fNumeratorFake) + fNumeratorFake = new TH1D(*(aCorrFctn.fNumeratorFake)); + else + fNumeratorFake = 0; + if (aCorrFctn.fDenominator) + fDenominator = new TH1D(*(aCorrFctn.fDenominator)); + else + fDenominator = 0; + fManager = aCorrFctn.fManager; + + return *this; +} +//_______________________ +void AliFemtoModelCorrFctn::ConnectToManager(AliFemtoModelManager *aManager) +{ + fManager = aManager; +} + +//_______________________ +AliFemtoString AliFemtoModelCorrFctn::Report() +{ + // Prepare report + AliFemtoString tStr = "AliFemtoModelCorrFctn report"; + + return tStr; +} + +//_______________________ +void AliFemtoModelCorrFctn::AddRealPair(AliFemtoPair* aPair) +{ + Double_t weight = fManager->GetWeight(aPair); + fNumeratorTrue->Fill(aPair->QInv(), weight); +} +//_______________________ +void AliFemtoModelCorrFctn::AddMixedPair(AliFemtoPair* aPair) +{ + Double_t weight = fManager->GetWeight(aPair); + fNumeratorFake->Fill(aPair->QInv(), weight); + fDenominator->Fill(aPair->QInv(), 1.0); +} +//_______________________ +void AliFemtoModelCorrFctn::EventBegin(const AliFemtoEvent* /* aEvent */) +{ + /* Do nothing */ +} +//_______________________ +void AliFemtoModelCorrFctn::EventEnd(const AliFemtoEvent* /* aEvent */) +{ + /* Do nothing */ +} +//_______________________ +void AliFemtoModelCorrFctn::Finish() +{ + /* Do nothing */ +} +//_______________________ +void AliFemtoModelCorrFctn::Write() +{ + // Write out data histos + fNumeratorTrue->Write(); + fNumeratorFake->Write(); + fDenominator->Write(); +} +//_______________________ +AliFemtoModelCorrFctn* AliFemtoModelCorrFctn::Clone() +{ + // Create clone + AliFemtoModelCorrFctn *tCopy = new AliFemtoModelCorrFctn(*this); + + return tCopy; +} +//_________________________ +TList* AliFemtoModelCorrFctn::GetOutputList() +{ + // Prepare the list of objects to be written to the output + TList *tOutputList = new TList(); + + tOutputList->Add(fNumeratorTrue); + tOutputList->Add(fNumeratorFake); + tOutputList->Add(fDenominator); + + return tOutputList; +} diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelCorrFctn.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelCorrFctn.h new file mode 100644 index 00000000000..0e0aa79049c --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelCorrFctn.h @@ -0,0 +1,55 @@ +//////////////////////////////////////////////////////////////////////////////// +/// /// +/// AliFemtoModelCorrFctn - the base class for correlation function which /// +/// uses the model framework and weight generation /// +/// /// +//////////////////////////////////////////////////////////////////////////////// +#ifndef ALIFEMTOMODELCORRFCTN_H +#define ALIFEMTOMODELCORRFCTN_H + +#include "AliFemtoCorrFctn.h" +class AliFemtoPair; +class AliFemtoModelManager; +class TH1D; + +class AliFemtoModelCorrFctn: public AliFemtoCorrFctn { + +public: + AliFemtoModelCorrFctn(); + AliFemtoModelCorrFctn(const char *title, Int_t aNbins, Double_t aQinvLo, Double_t aQinvHi); + AliFemtoModelCorrFctn(const AliFemtoModelCorrFctn& aCorrFctn); + virtual ~AliFemtoModelCorrFctn(); + + AliFemtoModelCorrFctn& operator=(const AliFemtoModelCorrFctn& aCorrFctn); + + virtual void ConnectToManager(AliFemtoModelManager *aManager); + + virtual AliFemtoString Report(); + + 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(); + + virtual TList* GetOutputList(); + virtual void Write(); + + virtual AliFemtoModelCorrFctn* Clone(); + +protected: + AliFemtoModelManager *fManager; // Link back to the manager to get the weights + + TH1D *fNumeratorTrue; // Numerator made with pairs from the same event + TH1D *fNumeratorFake; // Numerator made with pairs from different events (mixed pairs) + TH1D *fDenominator; // Denominator made with mixed pairs + +private: + +#ifdef __ROOT__ + ClassDef(AliFemtoModelCorrFctn, 1) +#endif +}; + +#endif diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelFreezeOutGenerator.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelFreezeOutGenerator.cxx new file mode 100644 index 00000000000..063fa6d9fc8 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelFreezeOutGenerator.cxx @@ -0,0 +1,44 @@ +//////////////////////////////////////////////////////////////////////////////// +/// /// +/// AliFemtoModelFreezeOutGenerator - abstract base class for freeze-out /// +/// coordinates generator /// +/// Authors: Adam Kisiel kisiel@mps.ohio-state.edu /// +/// /// +//////////////////////////////////////////////////////////////////////////////// +#ifdef __ROOT__ + ClassImp(AliFemtoModelFreezeOutGenerator, 1) +#endif + +#include "AliFemtoModelFreezeOutGenerator.h" + +//____________________________ +AliFemtoModelFreezeOutGenerator::AliFemtoModelFreezeOutGenerator(): + fRandom(0) +{ /* no-op */ } +//____________________________ +AliFemtoModelFreezeOutGenerator::AliFemtoModelFreezeOutGenerator(const AliFemtoModelFreezeOutGenerator &/* aModel */): + fRandom(0) +{/* no-op */} +//____________________________ +AliFemtoModelFreezeOutGenerator::~AliFemtoModelFreezeOutGenerator() +{ + if (fRandom) delete fRandom; +} +//____________________________ +AliFemtoModelFreezeOutGenerator& AliFemtoModelFreezeOutGenerator::operator=(const AliFemtoModelFreezeOutGenerator& aGen) +{ + if (this == &aGen) return *this; + if (aGen.fRandom) + fRandom = new TRandom2(*aGen.fRandom); + else + fRandom=0; + return *this; +} +//____________________________ +AliFemtoModelFreezeOutGenerator* AliFemtoModelFreezeOutGenerator::Clone() const +{ + return 0; +} + + + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelFreezeOutGenerator.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelFreezeOutGenerator.h new file mode 100644 index 00000000000..ac8229d1b30 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelFreezeOutGenerator.h @@ -0,0 +1,40 @@ +//////////////////////////////////////////////////////////////////////////////// +/// /// +/// AliFemtoModelFreezeOutGenerator - abstract base class for freeze-out /// +/// coordinates generator /// +/// Authors: Adam Kisiel kisiel@mps.ohio-state.edu /// +/// /// +//////////////////////////////////////////////////////////////////////////////// +#ifndef AliFemtoModelFreezeOutGenerator_hh +#define AliFemtoModelFreezeOutGenerator_hh + +#include "TRandom2.h" +#include "AliFemtoPair.h" + +class AliFemtoModelFreezeOutGenerator +{ + public: + AliFemtoModelFreezeOutGenerator(); + AliFemtoModelFreezeOutGenerator(const AliFemtoModelFreezeOutGenerator &aModel); + + AliFemtoModelFreezeOutGenerator& operator=(const AliFemtoModelFreezeOutGenerator& aGen); + + virtual ~AliFemtoModelFreezeOutGenerator(); + virtual void GenerateFreezeOut(AliFemtoPair *aPair) = 0; + + virtual AliFemtoModelFreezeOutGenerator* Clone() const; + + protected: + TRandom2 *fRandom; + + private: + +#ifdef __ROOT__ + ClassDef(AliFemtoModelFreezeOutGenerator, 1) +#endif + +}; + +#endif + + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelGausLCMSFreezeOutGenerator.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelGausLCMSFreezeOutGenerator.cxx new file mode 100644 index 00000000000..2472a79e6cf --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelGausLCMSFreezeOutGenerator.cxx @@ -0,0 +1,145 @@ +//////////////////////////////////////////////////////////////////////////////// +/// /// +/// AliFemtoModelGausLCMSFreezeOutGenerator - freeze-out /// +/// coordinates generator, generating a 3D gaussian ellipsoid in LCMS /// +/// Authors: Adam Kisiel kisiel@mps.ohio-state.edu /// +/// /// +//////////////////////////////////////////////////////////////////////////////// +#ifdef __ROOT__ + ClassImp(AliFemtoModelGausLCMSFreezeOutGenerator, 1) +#endif + +#include "math.h" +#include "AliFemtoModelGausLCMSFreezeOutGenerator.h" +#include "AliFemtoModelHiddenInfo.h" +#include "AliFemtoLorentzVector.h" +#include + +//_______________________ +AliFemtoModelGausLCMSFreezeOutGenerator::AliFemtoModelGausLCMSFreezeOutGenerator() : + fSizeOut(0), fSizeSide(0), fSizeLong(0) +{ + // Default constructor + fRandom = new TRandom2(); +} + +//_______________________ +AliFemtoModelGausLCMSFreezeOutGenerator::AliFemtoModelGausLCMSFreezeOutGenerator(const AliFemtoModelGausLCMSFreezeOutGenerator &aModel): + AliFemtoModelFreezeOutGenerator(aModel), + fSizeOut(0), fSizeSide(0), fSizeLong(0) +{ + // Copy constructor + fRandom = new TRandom2(); + SetSizeOut(aModel.GetSizeOut()); + SetSizeSide(aModel.GetSizeSide()); + SetSizeLong(aModel.GetSizeLong()); +} +//_______________________ +AliFemtoModelGausLCMSFreezeOutGenerator::~AliFemtoModelGausLCMSFreezeOutGenerator() +{ + if (fRandom) delete fRandom; +} +//_______________________ +AliFemtoModelGausLCMSFreezeOutGenerator& AliFemtoModelGausLCMSFreezeOutGenerator::operator=(const AliFemtoModelGausLCMSFreezeOutGenerator &aModel) +{ + if (this != &aModel) { + fRandom = new TRandom2(); + SetSizeOut(aModel.GetSizeOut()); + SetSizeSide(aModel.GetSizeSide()); + SetSizeLong(aModel.GetSizeLong()); + } + + return *this; +} +//_______________________ +void AliFemtoModelGausLCMSFreezeOutGenerator::GenerateFreezeOut(AliFemtoPair *aPair) +{ + // Generate two particle emission points with respect + // to their pair momentum + // The source is the 3D Gaussian ellipsoid in the LCMS frame + AliFemtoModelHiddenInfo *inf1 = (AliFemtoModelHiddenInfo *) aPair->Track1()->HiddenInfo(); + AliFemtoModelHiddenInfo *inf2 = (AliFemtoModelHiddenInfo *) aPair->Track2()->HiddenInfo(); + + if ((!inf1) || (!inf2)) { cout << "Hidden info not created! " << endl; exit(kFALSE); } + + Double_t tPx = inf1->GetTrueMomentum()->x() + inf2->GetTrueMomentum()->x(); + Double_t tPy = inf1->GetTrueMomentum()->y() + inf2->GetTrueMomentum()->y(); + Double_t tPz = inf1->GetTrueMomentum()->z() + inf2->GetTrueMomentum()->z(); + Double_t tM1 = inf1->GetMass(); + Double_t tM2 = inf2->GetMass(); + Double_t tE1 = sqrt(tM1*tM1 + inf1->GetTrueMomentum()->Mag2()); + Double_t tE2 = sqrt(tM2*tM2 + inf2->GetTrueMomentum()->Mag2()); + Double_t tEs = tE1 + tE2; + + Double_t tPt = sqrt(tPx*tPx + tPy*tPy); + + Double_t tRout = fRandom->Gaus(0.0, fSizeOut); + Double_t tRside = fRandom->Gaus(0.0, fSizeSide); + Double_t tRlong = fRandom->Gaus(0.0, fSizeLong); + + Double_t tXout = (tPx * tRout + tPy * tRside)/tPt; + Double_t tXside = (tPy * tRout - tPx * tRside)/tPt; + + Double_t tBetaz = tPz/tEs; + Double_t tGammaz = 1.0/TMath::Sqrt(1-tBetaz*tBetaz); + + Double_t tXlong = tGammaz * (tRlong + tBetaz * 0); + Double_t tXtime = tGammaz * (0 + tBetaz * tRlong); + + if (!(inf1->GetEmissionPoint())) { + AliFemtoLorentzVector *tPos = new AliFemtoLorentzVector(0,0,0,0); + inf1->SetEmissionPoint(tPos); + delete tPos; + } + else + inf1->SetEmissionPoint(0,0,0,0); + if (!(inf2->GetEmissionPoint())) { + AliFemtoLorentzVector *tPos = new AliFemtoLorentzVector(tXout,tXside,tXlong,tXtime); + inf2->SetEmissionPoint(tPos); + delete tPos; + } + else + inf2->SetEmissionPoint(tXout, tXside, tXlong, tXtime); +} + +//_______________________ +void AliFemtoModelGausLCMSFreezeOutGenerator::SetSizeOut(Double_t aSizeOut) +{ + fSizeOut = aSizeOut; +} +//_______________________ +void AliFemtoModelGausLCMSFreezeOutGenerator::SetSizeSide(Double_t aSizeSide) +{ + fSizeSide = aSizeSide; +} +//_______________________ +void AliFemtoModelGausLCMSFreezeOutGenerator::SetSizeLong(Double_t aSizeLong) +{ + fSizeLong = aSizeLong; +} + +//_______________________ +Double_t AliFemtoModelGausLCMSFreezeOutGenerator::GetSizeOut() const +{ + return fSizeOut; +} +//_______________________ +Double_t AliFemtoModelGausLCMSFreezeOutGenerator::GetSizeSide() const +{ + return fSizeSide; +} +//_______________________ +Double_t AliFemtoModelGausLCMSFreezeOutGenerator::GetSizeLong() const +{ + return fSizeLong; +} +//_______________________ +AliFemtoModelFreezeOutGenerator* AliFemtoModelGausLCMSFreezeOutGenerator::Clone() const +{ + return GetGenerator(); +} +//_______________________ +AliFemtoModelFreezeOutGenerator* AliFemtoModelGausLCMSFreezeOutGenerator::GetGenerator() const +{ + AliFemtoModelFreezeOutGenerator* tModel = new AliFemtoModelGausLCMSFreezeOutGenerator(*this); return tModel; +} diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelGausLCMSFreezeOutGenerator.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelGausLCMSFreezeOutGenerator.h new file mode 100644 index 00000000000..d86c0ae0233 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelGausLCMSFreezeOutGenerator.h @@ -0,0 +1,50 @@ +//////////////////////////////////////////////////////////////////////////////// +/// /// +/// AliFemtoModelGausLCMSFreezeOutGenerator - freeze-out /// +/// coordinates generator, generating a 3D gaussian ellipsoid in LCMS /// +/// Authors: Adam Kisiel kisiel@mps.ohio-state.edu /// +/// /// +//////////////////////////////////////////////////////////////////////////////// +#ifndef ALIFEMTOMODELGAUSLCMSFREEZEOUTGENERATOR_H +#define ALIFEMTOMODELGAUSLCMSFREEZEOUTGENERATOR_H + +#include "AliFemtoModelFreezeOutGenerator.h" + +#include "TRandom.h" + +class AliFemtoModelGausLCMSFreezeOutGenerator : public AliFemtoModelFreezeOutGenerator +{ + public: + AliFemtoModelGausLCMSFreezeOutGenerator(); + AliFemtoModelGausLCMSFreezeOutGenerator(const AliFemtoModelGausLCMSFreezeOutGenerator &aModel); + virtual ~AliFemtoModelGausLCMSFreezeOutGenerator(); + AliFemtoModelGausLCMSFreezeOutGenerator& operator=(const AliFemtoModelGausLCMSFreezeOutGenerator &aModel); + virtual void GenerateFreezeOut(AliFemtoPair *aPair); + + void SetSizeOut(Double_t aSizeOut); + void SetSizeSide(Double_t aSizeSide); + void SetSizeLong(Double_t aSizeLong); + + Double_t GetSizeOut() const; + Double_t GetSizeSide() const; + Double_t GetSizeLong() const; + + virtual AliFemtoModelFreezeOutGenerator* Clone() const; + + protected: + Double_t fSizeOut; // Size of the source in the out direction + Double_t fSizeSide; // Size of the source in the side direction + Double_t fSizeLong; // Size of the source in the long direction + + private: + AliFemtoModelFreezeOutGenerator* GetGenerator() const; + +#ifdef __ROOT__ + ClassDef(AliFemtoModelGausLCMSFreezeOutGenerator, 1) +#endif + + }; + +#endif + + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelGlobalHiddenInfo.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelGlobalHiddenInfo.cxx new file mode 100644 index 00000000000..8934971d6f9 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelGlobalHiddenInfo.cxx @@ -0,0 +1,96 @@ +//////////////////////////////////////////////////////////////////////////////// +/// /// +/// AliFemtoModelGlobalHiddenInfo - the hidden info for model calculations // +/// Stores information needed for the weight generation - the true /// +/// simulated momenta, freeze-out coordinates from model and particle PID /// +/// /// +//////////////////////////////////////////////////////////////////////////////// +#include "AliFemtoModelGlobalHiddenInfo.h" + +//_____________________________________________ +AliFemtoModelGlobalHiddenInfo::AliFemtoModelGlobalHiddenInfo() : + AliFemtoModelHiddenInfo(), + fGlobalEmissionPoint(0) +{ + // Default constructor +} +//_____________________________________________ +AliFemtoModelGlobalHiddenInfo::AliFemtoModelGlobalHiddenInfo(const AliFemtoModelGlobalHiddenInfo &aInfo) : + AliFemtoModelHiddenInfo(aInfo), + fGlobalEmissionPoint(0) +{ + // Copy constructor + if (aInfo.GetGlobalEmissionPoint()) + SetGlobalEmissionPoint((*aInfo.GetGlobalEmissionPoint())); +} +//_____________________________________________ +AliFemtoModelGlobalHiddenInfo::~AliFemtoModelGlobalHiddenInfo() +{ + // Destructor +// if (fTrueMomentum) delete fTrueMomentum; +// if (fEmissionPoint) delete fEmissionPoint; + if (fGlobalEmissionPoint) delete fGlobalEmissionPoint; +} +//_____________________________________________ +AliFemtoModelGlobalHiddenInfo& AliFemtoModelGlobalHiddenInfo::operator=(const AliFemtoModelGlobalHiddenInfo& aInfo) +{ + // assignment operator + if (this == &aInfo) + return *this; + + if (fTrueMomentum) delete fTrueMomentum; + if (aInfo.GetTrueMomentum()) + SetTrueMomentum(aInfo.GetTrueMomentum()); + else SetTrueMomentum(0); + if (fEmissionPoint) delete fEmissionPoint; + if (aInfo.GetEmissionPoint()) + SetEmissionPoint(aInfo.GetEmissionPoint()); + else SetEmissionPoint(0); + if (fGlobalEmissionPoint) delete fGlobalEmissionPoint; + if (aInfo.GetGlobalEmissionPoint()) + SetGlobalEmissionPoint(*aInfo.GetGlobalEmissionPoint()); + else fGlobalEmissionPoint = 0; + fPDGPid = aInfo.GetPDGPid(); + fMass = aInfo.GetMass(); + + return *this; +} +//_____________________________________________ +AliFemtoThreeVector *AliFemtoModelGlobalHiddenInfo::GetGlobalEmissionPoint() const +{ + return fGlobalEmissionPoint; +} +//_____________________________________________ +void AliFemtoModelGlobalHiddenInfo::SetGlobalEmissionPoint(const AliFemtoThreeVector& aPos) +{ + // set position from vector + if (fGlobalEmissionPoint) { + fGlobalEmissionPoint->SetX(aPos.x()); + fGlobalEmissionPoint->SetY(aPos.y()); + fGlobalEmissionPoint->SetZ(aPos.z()); + } + else { + fGlobalEmissionPoint = new AliFemtoThreeVector(); + *fGlobalEmissionPoint = aPos; + } +} +//_____________________________________________ +void AliFemtoModelGlobalHiddenInfo::SetGlobalEmissionPoint(Double_t aRx, Double_t aRy, Double_t aRz) +{ + // Set position from components + if (fGlobalEmissionPoint) { + fGlobalEmissionPoint->SetX(aRx); + fGlobalEmissionPoint->SetY(aRy); + fGlobalEmissionPoint->SetZ(aRz); + } + else { + fGlobalEmissionPoint = new AliFemtoThreeVector(aRx, aRy, aRz); + } +} +//_____________________________________________ + AliFemtoHiddenInfo* AliFemtoModelGlobalHiddenInfo::GetParticleHiddenInfo() const +{ + // return copy of this hidden info + AliFemtoModelGlobalHiddenInfo* tBuf = new AliFemtoModelGlobalHiddenInfo(*this); + return tBuf; +} diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelGlobalHiddenInfo.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelGlobalHiddenInfo.h new file mode 100644 index 00000000000..083a848d278 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelGlobalHiddenInfo.h @@ -0,0 +1,48 @@ +//////////////////////////////////////////////////////////////////////////////// +// // +// AliFemtoModelGlobalHiddenInfo - the hidden info for model calculations // +// Stores information needed for the weight generation - the true // +// simulated momenta, freeze-out coordinates from model and particle PID // +// and global creation point // +// // +//////////////////////////////////////////////////////////////////////////////// + +#ifndef ALIFEMTOMODELGLOBALHIDDENINFO_H +#define ALIFEMTOMODELGLOBALHIDDENINFO_H + +#include +#include "AliFemtoTypes.h" +#include "AliFemtoThreeVector.h" +#include "AliFemtoLorentzVector.h" +#include "AliFemtoHiddenInfo.h" +#include "AliFemtoModelHiddenInfo.h" + +class AliFemtoModelGlobalHiddenInfo : public AliFemtoModelHiddenInfo{ + +public: + AliFemtoModelGlobalHiddenInfo(); + AliFemtoModelGlobalHiddenInfo(const AliFemtoModelGlobalHiddenInfo &aInfo); + virtual ~AliFemtoModelGlobalHiddenInfo(); + + AliFemtoModelGlobalHiddenInfo& operator=(const AliFemtoModelGlobalHiddenInfo& aInfo); + + AliFemtoThreeVector *GetGlobalEmissionPoint() const; + void SetGlobalEmissionPoint(const AliFemtoThreeVector& aPos); + void SetGlobalEmissionPoint(Double_t aRx, Double_t aRy, Double_t aRz); + +// !!! MANDATORY !!! +// --- Copy the hidden info from AliFemtoTrack to AliFemtoParticle + virtual AliFemtoHiddenInfo* Clone() const; + + protected: + virtual AliFemtoHiddenInfo* GetParticleHiddenInfo() const; + + AliFemtoThreeVector *fGlobalEmissionPoint; +}; +//_______________________________________ +inline AliFemtoHiddenInfo* AliFemtoModelGlobalHiddenInfo::Clone() const{ + // return exact copy of this hidden info + return GetParticleHiddenInfo(); +} + +#endif diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelHiddenInfo.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelHiddenInfo.cxx new file mode 100644 index 00000000000..dbf599a918f --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelHiddenInfo.cxx @@ -0,0 +1,177 @@ +//////////////////////////////////////////////////////////////////////////////// +/// /// +/// AliFemtoModelHiddenInfo - the hidden info for model calculations /// +/// Stores information needed for the weight generation - the true /// +/// simulated momenta, freeze-out coordinates from model and particle PID /// +/// /// +//////////////////////////////////////////////////////////////////////////////// +#include "AliFemtoModelHiddenInfo.h" + +//_____________________________________________ +AliFemtoModelHiddenInfo::AliFemtoModelHiddenInfo() : + fTrueMomentum(0), + fEmissionPoint(0), + fPDGPid(0), + fMass(0) +{ + // Default constructor +} +//_____________________________________________ +AliFemtoModelHiddenInfo::AliFemtoModelHiddenInfo(const AliFemtoModelHiddenInfo &aInfo) : + AliFemtoHiddenInfo(aInfo), + fTrueMomentum(0), + fEmissionPoint(0), + fPDGPid(0), + fMass(0) +{ + // Copy constructor + if (aInfo.GetTrueMomentum()) + SetTrueMomentum(aInfo.GetTrueMomentum()); + if (aInfo.GetEmissionPoint()) + SetEmissionPoint(aInfo.GetEmissionPoint()); + fPDGPid = aInfo.GetPDGPid(); + fMass = aInfo.GetMass(); +} +//_____________________________________________ +AliFemtoModelHiddenInfo::~AliFemtoModelHiddenInfo() +{ + // Destructor + if (fTrueMomentum) delete fTrueMomentum; + if (fEmissionPoint) delete fEmissionPoint; +} +//_____________________________________________ +AliFemtoModelHiddenInfo& AliFemtoModelHiddenInfo::operator=(const AliFemtoModelHiddenInfo& aInfo) +{ + // assignment operator + if (this == &aInfo) + return *this; + + if (fTrueMomentum) delete fTrueMomentum; + if (aInfo.GetTrueMomentum()) + SetTrueMomentum(aInfo.GetTrueMomentum()); + else SetTrueMomentum(0); + if (fEmissionPoint) delete fEmissionPoint; + if (aInfo.GetEmissionPoint()) + SetEmissionPoint(aInfo.GetEmissionPoint()); + else SetEmissionPoint(0); + fPDGPid = aInfo.GetPDGPid(); + fMass = aInfo.GetMass(); + + return *this; +} +//_____________________________________________ +AliFemtoThreeVector *AliFemtoModelHiddenInfo::GetTrueMomentum() const +{ + return fTrueMomentum; +} +//_____________________________________________ +AliFemtoLorentzVector *AliFemtoModelHiddenInfo::GetEmissionPoint() const +{ + return fEmissionPoint; +} +//_____________________________________________ +Int_t AliFemtoModelHiddenInfo::GetPDGPid() const +{ + return fPDGPid; +} +//_____________________________________________ +Double_t AliFemtoModelHiddenInfo::GetMass() const +{ + return fMass; +} +//_____________________________________________ +void AliFemtoModelHiddenInfo::SetTrueMomentum(AliFemtoThreeVector *aMom) +{ + // Set momentum from vector + if (fTrueMomentum) { + fTrueMomentum->SetX(aMom->x()); + fTrueMomentum->SetY(aMom->y()); + fTrueMomentum->SetZ(aMom->z()); + } + else { + fTrueMomentum = new AliFemtoThreeVector(*aMom); + } +} +//_____________________________________________ +void AliFemtoModelHiddenInfo::SetTrueMomentum(const AliFemtoThreeVector& aMom) +{ + // Set momentum from vector + if (fTrueMomentum) { + fTrueMomentum->SetX(aMom.x()); + fTrueMomentum->SetY(aMom.y()); + fTrueMomentum->SetZ(aMom.z()); + } + else { + fTrueMomentum = new AliFemtoThreeVector(); + *fTrueMomentum = aMom; + } +} +//_____________________________________________ +void AliFemtoModelHiddenInfo::SetTrueMomentum(Double_t aPx, Double_t aPy, Double_t aPz) +{ + // Set momentum from components + if (!fTrueMomentum) fTrueMomentum = new AliFemtoThreeVector(); + fTrueMomentum->SetX(aPx); + fTrueMomentum->SetY(aPy); + fTrueMomentum->SetZ(aPz); +} +//_____________________________________________ +void AliFemtoModelHiddenInfo::SetEmissionPoint(AliFemtoLorentzVector *aPos) +{ + // Set position from vector + if (fEmissionPoint) { + fEmissionPoint->SetX(aPos->px()); + fEmissionPoint->SetY(aPos->py()); + fEmissionPoint->SetZ(aPos->pz()); + fEmissionPoint->SetT(aPos->e()); + } + else { + fEmissionPoint = new AliFemtoLorentzVector(*aPos); + } +} +//_____________________________________________ +void AliFemtoModelHiddenInfo::SetEmissionPoint(const AliFemtoLorentzVector& aPos) +{ + // Set position from vector + if (fEmissionPoint) { + fEmissionPoint->SetX(aPos.px()); + fEmissionPoint->SetY(aPos.py()); + fEmissionPoint->SetZ(aPos.pz()); + fEmissionPoint->SetT(aPos.e()); + } + else { + fEmissionPoint = new AliFemtoLorentzVector(); + *fEmissionPoint = aPos; + } +} +//_____________________________________________ +void AliFemtoModelHiddenInfo::SetPDGPid(Int_t aPid) +{ + fPDGPid = aPid; +} +//_____________________________________________ +void AliFemtoModelHiddenInfo::SetMass(Double_t aMass) +{ + fMass = aMass; +} +//_____________________________________________ +void AliFemtoModelHiddenInfo::SetEmissionPoint(Double_t aRx, Double_t aRy, Double_t aRz, Double_t aT) +{ + // Set position from components + if (fEmissionPoint) { + fEmissionPoint->SetX(aRx); + fEmissionPoint->SetY(aRy); + fEmissionPoint->SetZ(aRz); + fEmissionPoint->SetT(aT); + } + else { + fEmissionPoint = new AliFemtoLorentzVector(aRx, aRy, aRz, aT); + } +} +//_____________________________________________ + AliFemtoHiddenInfo* AliFemtoModelHiddenInfo::GetParticleHiddenInfo() const +{ + // return copy of this hidden info + AliFemtoModelHiddenInfo* tBuf = new AliFemtoModelHiddenInfo(*this); + return tBuf; +} diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelHiddenInfo.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelHiddenInfo.h new file mode 100644 index 00000000000..2fb03614aa6 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelHiddenInfo.h @@ -0,0 +1,58 @@ +//////////////////////////////////////////////////////////////////////////////// +/// /// +/// AliFemtoModelHiddenInfo - the hidden info for model calculations /// +/// Stores information needed for the weight generation - the true /// +/// simulated momenta, freeze-out coordinates from model and particle PID /// +/// /// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef ALIFEMTOMODELHIDDENINFO_H +#define ALIFEMTOMODELHIDDENINFO_H + +#include +#include "AliFemtoTypes.h" +#include "AliFemtoThreeVector.h" +#include "AliFemtoLorentzVector.h" +#include "AliFemtoHiddenInfo.h" + +class AliFemtoModelHiddenInfo : public AliFemtoHiddenInfo{ + +public: + AliFemtoModelHiddenInfo(); + AliFemtoModelHiddenInfo(const AliFemtoModelHiddenInfo &aInfo); + virtual ~AliFemtoModelHiddenInfo(); + + AliFemtoModelHiddenInfo& operator=(const AliFemtoModelHiddenInfo& aInfo); + AliFemtoThreeVector *GetTrueMomentum() const; + AliFemtoLorentzVector *GetEmissionPoint() const; + Int_t GetPDGPid() const; + Double_t GetMass() const; + + void SetTrueMomentum(AliFemtoThreeVector *aMom); + void SetTrueMomentum(const AliFemtoThreeVector& aMom); + void SetTrueMomentum(Double_t aPx, Double_t aPy, Double_t aPz); + void SetEmissionPoint(AliFemtoLorentzVector *aPos); + void SetEmissionPoint(const AliFemtoLorentzVector& aPos); + void SetEmissionPoint(Double_t aRx, Double_t aRy, Double_t aRz, Double_t aT); + void SetPDGPid(Int_t aPid); + void SetMass(Double_t aMass); + +// !!! MANDATORY !!! +// --- Copy the hidden info from AliFemtoTrack to AliFemtoParticle + virtual AliFemtoHiddenInfo* Clone() const; + + protected: + virtual AliFemtoHiddenInfo* GetParticleHiddenInfo() const; + + AliFemtoThreeVector *fTrueMomentum; // True (simulated) momentum + AliFemtoLorentzVector *fEmissionPoint; // Emission point coordinates + Int_t fPDGPid; // True PID of the particle + Double_t fMass; // True particle mass +}; +//_______________________________________ +inline AliFemtoHiddenInfo* AliFemtoModelHiddenInfo::Clone() const{ + // return exact copy of this hidden info + return GetParticleHiddenInfo(); +} + +#endif diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelManager.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelManager.cxx new file mode 100644 index 00000000000..63aeab97418 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelManager.cxx @@ -0,0 +1,190 @@ +//////////////////////////////////////////////////////////////////////////////// +/// /// +/// AliFemtoModelManager - main helper class for femtoscopy calculations /// +/// Manages weight generation, freeze-out coordinates generation /// +/// Authors: Adam Kisiel kisiel@mps.ohio-state.edu /// +/// /// +//////////////////////////////////////////////////////////////////////////////// +#ifdef __ROOT__ + ClassImp(AliFemtoModelManager, 1) +#endif + +#include "AliFemtoModelManager.h" +#include "AliFemtoModelHiddenInfo.h" + +//_____________________________________________ +AliFemtoModelManager::AliFemtoModelManager(): + fFreezeOutGenerator(0), + fWeightGenerator(0), + fCreateCopyHiddenInfo(kFALSE) +{ +} +//_____________________________________________ +AliFemtoModelManager::AliFemtoModelManager(const AliFemtoModelManager& aManager): + fFreezeOutGenerator(0), + fWeightGenerator(0), + fCreateCopyHiddenInfo(aManager.fCreateCopyHiddenInfo) +{ + if (aManager.fFreezeOutGenerator) { + fFreezeOutGenerator = aManager.fFreezeOutGenerator->Clone(); + } + if (aManager.fWeightGenerator) { + fWeightGenerator = aManager.fWeightGenerator->Clone(); + } +} +//_____________________________________________ +AliFemtoModelManager::~AliFemtoModelManager() +{ + if (fFreezeOutGenerator) delete fFreezeOutGenerator; + if (fWeightGenerator) delete fWeightGenerator; +} +//_____________________________________________ +AliFemtoModelManager& AliFemtoModelManager::operator=(const AliFemtoModelManager& aManager) +{ + if (this == &aManager) + return *this; + if (aManager.fFreezeOutGenerator) { + fFreezeOutGenerator = aManager.fFreezeOutGenerator->Clone(); + } + else fFreezeOutGenerator = 0; + if (aManager.fWeightGenerator) { + fWeightGenerator = aManager.fWeightGenerator->Clone(); + } + else fWeightGenerator = 0; + fCreateCopyHiddenInfo = aManager.fCreateCopyHiddenInfo; + + return *this; +} +//_____________________________________________ +void AliFemtoModelManager::AcceptFreezeOutGenerator(AliFemtoModelFreezeOutGenerator *aFreeze) +{ + fFreezeOutGenerator = aFreeze; +} +//_____________________________________________ +void AliFemtoModelManager::AcceptWeightGenerator(AliFemtoModelWeightGenerator *aWeight) +{ + fWeightGenerator = aWeight; +} +//_____________________________________________ +Double_t AliFemtoModelManager::GetWeight(AliFemtoPair *aPair) +{ + if (!fWeightGenerator) { + cout << "No weight generator set! Cannot calculate weight" << endl; + exit(0); + } + // Return femtoscopic weight for a given pair + if (fCreateCopyHiddenInfo) { + // Try to guess particle masses and pid from the weight generator + Double_t tMass1=0.0001, tMass2=0.0001; + Int_t tPid1=0, tPid2=0; + if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::PionPlusPionPlus()) { + tMass1 = 0.13957; + tMass2 = 0.13957; + tPid1 = 211; + tPid2 = 211; + } + if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::PionPlusPionMinus()) { + tMass1 = 0.13957; + tMass2 = 0.13957; + tPid1 = 211; + tPid2 = -211; + } + if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::KaonPlusKaonPlus()) { + tMass1 = 0.493677; + tMass2 = 0.493677; + tPid1 = 321; + tPid2 = 321; + } + if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::KaonPlusKaonMinus()) { + tMass1 = 0.493677; + tMass2 = 0.493677; + tPid1 = 321; + tPid2 = -321; + } + if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::ProtonProton()) { + tMass1 = 0.938272; + tMass2 = 0.938272; + tPid1 = 2212; + tPid2 = 2212; + } + if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::ProtonAntiproton()) { + tMass1 = 0.938272; + tMass2 = 0.938272; + tPid1 = 2212; + tPid2 = -2212; + } + if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::PionPlusKaonPlus()) { + tMass1 = 0.13957; + tMass2 = 0.493677; + tPid1 = 211; + tPid2 = 321; + } + if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::PionPlusKaonMinus()) { + tMass1 = 0.13957; + tMass2 = 0.493677; + tPid1 = 211; + tPid2 = -321; + } + if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::PionPlusProton()) { + tMass1 = 0.13957; + tMass2 = 0.938272; + tPid1 = 211; + tPid2 = 2212; + } + if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::PionPlusAntiproton()) { + tMass1 = 0.13957; + tMass2 = 0.938272; + tPid1 = 211; + tPid2 = -2212; + } + if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::KaonPlusProton()) { + tMass1 = 0.493677; + tMass2 = 0.938272; + tPid1 = 321; + tPid2 = 2212; + } + if (fWeightGenerator->GetPairType() == AliFemtoModelWeightGenerator::KaonPlusAntiproton()) { + tMass1 = 0.493677; + tMass2 = 0.938272; + tPid1 = 321; + tPid2 = -2212; + } + + if (!(aPair->Track1()->HiddenInfo())) { + AliFemtoModelHiddenInfo *inf1 = new AliFemtoModelHiddenInfo(); + inf1->SetTrueMomentum(aPair->Track1()->Track()->P()); + inf1->SetMass(tMass1); + inf1->SetPDGPid(tPid1); + aPair->Track1()->SetHiddenInfo(inf1); + delete inf1; + } + if (!(aPair->Track2()->HiddenInfo())) { + AliFemtoModelHiddenInfo *inf2 = new AliFemtoModelHiddenInfo(); + inf2->SetTrueMomentum(aPair->Track2()->Track()->P()); + inf2->SetMass(tMass2); + inf2->SetPDGPid(tPid2); + aPair->Track2()->SetHiddenInfo(inf2); + delete inf2; + } + } + + if (fFreezeOutGenerator) { + fFreezeOutGenerator->GenerateFreezeOut(aPair); + } + return fWeightGenerator->GenerateWeight(aPair); +} +//_____________________________________________ +void AliFemtoModelManager::CreateCopyHiddenInfo(Bool_t aCopy) +{ + fCreateCopyHiddenInfo = aCopy; +} +//_____________________________________________ +AliFemtoModelFreezeOutGenerator* AliFemtoModelManager::GetFreezeOutGenerator() +{ + return fFreezeOutGenerator; +} +//_____________________________________________ +AliFemtoModelWeightGenerator* AliFemtoModelManager::GetWeightGenerator() +{ + return fWeightGenerator; +} diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelManager.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelManager.h new file mode 100644 index 00000000000..58b4ee76ce0 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelManager.h @@ -0,0 +1,48 @@ +//////////////////////////////////////////////////////////////////////////////// +/// /// +/// AliFemtoModelManager - main helper class for femtoscopy calculations /// +/// Manages weight generation, freeze-out coordinates generation /// +/// Authors: Adam Kisiel kisiel@mps.ohio-state.edu /// +/// /// +//////////////////////////////////////////////////////////////////////////////// +#ifndef AliFemtoModelManager_hh +#define AliFemtoModelManager_hh + +#include "AliFemtoEnumeration.h" +#include "AliFemtoModelWeightGenerator.h" +#include "AliFemtoModelFreezeOutGenerator.h" + +class AliFemtoModelManager +{ + public: + AliFemtoModelManager(); + AliFemtoModelManager(const AliFemtoModelManager& aManager); + virtual ~AliFemtoModelManager(); + + AliFemtoModelManager& operator=(const AliFemtoModelManager& aManager); + + void AcceptFreezeOutGenerator(AliFemtoModelFreezeOutGenerator *aFreeze); + void AcceptWeightGenerator(AliFemtoModelWeightGenerator *aWeight); + void CreateCopyHiddenInfo(Bool_t aCopy=kTRUE); + + AliFemtoModelFreezeOutGenerator* GetFreezeOutGenerator(); + AliFemtoModelWeightGenerator* GetWeightGenerator(); + + virtual Double_t GetWeight(AliFemtoPair *aPair); + + protected: + AliFemtoModelFreezeOutGenerator *fFreezeOutGenerator; // Freeze-out coordinates generator + AliFemtoModelWeightGenerator *fWeightGenerator; // Femtoscopic weight generator + Bool_t fCreateCopyHiddenInfo; // Switch to turn on hidden-info generation + + private: + +#ifdef __ROOT__ + ClassDef(AliFemtoModelManager, 1) +#endif + + }; + +#endif + + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGenerator.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGenerator.cxx new file mode 100644 index 00000000000..c6a690618be --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGenerator.cxx @@ -0,0 +1,129 @@ +//////////////////////////////////////////////////////////////////////////////// +/// /// +/// AliFemtoModelWeightGenerator - abstract base class for femtoscopic /// +/// weight generator /// +/// Authors: Adam Kisiel kisiel@mps.ohio-state.edu /// +/// /// +//////////////////////////////////////////////////////////////////////////////// +#ifdef __ROOT__ + ClassImp(AliFemtoModelGausLCMSFreezeOutGenerator, 1) +#endif + +#include "AliFemtoPair.h" + +#include "AliFemtoModelWeightGenerator.h" +#include "AliFemtoModelHiddenInfo.h" + +const Int_t AliFemtoModelWeightGenerator::fgkPairTypeNone = 0; +const Int_t AliFemtoModelWeightGenerator::fgkPionPlusPionPlus = 1; +const Int_t AliFemtoModelWeightGenerator::fgkPionPlusPionMinus = 2; +const Int_t AliFemtoModelWeightGenerator::fgkKaonPlusKaonPlus = 3; +const Int_t AliFemtoModelWeightGenerator::fgkKaonPlusKaonMinus = 4; +const Int_t AliFemtoModelWeightGenerator::fgkProtonProton = 5; +const Int_t AliFemtoModelWeightGenerator::fgkProtonAntiproton = 6; +const Int_t AliFemtoModelWeightGenerator::fgkPionPlusKaonPlus = 7; +const Int_t AliFemtoModelWeightGenerator::fgkPionPlusKaonMinus = 8; +const Int_t AliFemtoModelWeightGenerator::fgkPionPlusProton = 9; +const Int_t AliFemtoModelWeightGenerator::fgkPionPlusAntiproton = 10; +const Int_t AliFemtoModelWeightGenerator::fgkKaonPlusProton = 11; +const Int_t AliFemtoModelWeightGenerator::fgkKaonPlusAntiproton = 12; + +//_____________________________________________ +AliFemtoModelWeightGenerator::AliFemtoModelWeightGenerator() : + fPairType(0), + fKStarOut(0), fKStarSide(0), fKStarLong(0), fKStar(0), + fRStarOut(0), fRStarSide(0), fRStarLong(0), fRStar(0) +{} +//_____________________________________________ +AliFemtoModelWeightGenerator::AliFemtoModelWeightGenerator(const AliFemtoModelWeightGenerator &aModel) : + fPairType(0), + fKStarOut(0), fKStarSide(0), fKStarLong(0), fKStar(0), + fRStarOut(0), fRStarSide(0), fRStarLong(0), fRStar(0) +{ + fPairType = aModel.fPairType; +} +//_____________________________________________ +AliFemtoModelWeightGenerator::~AliFemtoModelWeightGenerator(){/* no-op */} +//_____________________________________________ +AliFemtoModelWeightGenerator& AliFemtoModelWeightGenerator::operator=(const AliFemtoModelWeightGenerator &aModel) +{ + if (this != &aModel) { + fPairType = aModel.fPairType; + } + + return *this; +} +//_____________________________________________ +void AliFemtoModelWeightGenerator::SetPairType(Int_t aPairType) +{ + fPairType = aPairType; +} + +//_____________________________________________ +Int_t AliFemtoModelWeightGenerator::GetPairType() const +{ + return fPairType; +} + +//_____________________________________________ +void AliFemtoModelWeightGenerator::SetPairTypeFromPair(AliFemtoPair *aPair) +{ + fPairType = GetPairTypeFromPair(aPair); +} +//_____________________________________________ +Int_t AliFemtoModelWeightGenerator::GetPairTypeFromPair(AliFemtoPair *aPair) +{ + // Get the type of pair from PID of particles in the pair + AliFemtoModelHiddenInfo *inf1 = ( AliFemtoModelHiddenInfo *) aPair->Track1()->HiddenInfo(); + AliFemtoModelHiddenInfo *inf2 = ( AliFemtoModelHiddenInfo *) aPair->Track2()->HiddenInfo(); + + Int_t tPairType = fgkPairTypeNone; + + const Int_t ktPid1 = inf1->GetPDGPid(); + const Int_t ktPid2 = inf2->GetPDGPid(); + + if (((ktPid1 == 211) && (ktPid2 == 211)) || + ((ktPid1 == -211) && (ktPid2 == -211))) + tPairType = fgkPionPlusPionPlus; + else if (((ktPid1 == -211) && (ktPid2 == 211)) || + ((ktPid1 == 211) && (ktPid2 == -211))) + tPairType = fgkPionPlusPionMinus; + else if (((ktPid1 == 321) && (ktPid2 == 321)) || + ((ktPid1 == -321) && (ktPid2 == -321))) + tPairType = fgkKaonPlusKaonPlus; + else if (((ktPid1 == -321) && (ktPid2 == 321)) || + ((ktPid1 == 321) && (ktPid2 == -321))) + tPairType = fgkKaonPlusKaonMinus; + else if (((ktPid1 == 2212) && (ktPid2 == 2212)) || + ((ktPid1 == -2212) && (ktPid2 == -2212))) + tPairType = fgkProtonProton; + else if (((ktPid1 == -2212) && (ktPid2 == 2212)) || + ((ktPid1 == 2212) && (ktPid2 == -2212))) + tPairType = fgkProtonAntiproton; + else if (((ktPid1 == 211) && (ktPid2 == 321)) || + ((ktPid1 == -211) && (ktPid2 == -321))) + tPairType = fgkPionPlusKaonPlus; + else if (((ktPid1 == -211) && (ktPid2 == 321)) || + ((ktPid1 == 211) && (ktPid2 == -321))) + tPairType = fgkPionPlusKaonMinus; + else if (((ktPid1 == 211) && (ktPid2 == 2212)) || + ((ktPid1 == -211) && (ktPid2 == -2212))) + tPairType = fgkPionPlusProton; + else if (((ktPid1 == -211) && (ktPid2 == 2212)) || + ((ktPid1 == 211) && (ktPid2 == -2212))) + tPairType = fgkPionPlusAntiproton; + else if (((ktPid1 == 321) && (ktPid2 == 2212)) || + ((ktPid1 == -321) && (ktPid2 == -2212))) + tPairType = fgkKaonPlusProton; + else if (((ktPid1 == -321) && (ktPid2 == 2212)) || + ((ktPid1 == 321) && (ktPid2 == -2212))) + tPairType = fgkKaonPlusAntiproton; + + return tPairType; +} + +//_____________________________________________ +AliFemtoModelWeightGenerator* AliFemtoModelWeightGenerator::Clone() const +{ + return 0; +} diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGenerator.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGenerator.h new file mode 100644 index 00000000000..ce0df506e16 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGenerator.h @@ -0,0 +1,112 @@ +//////////////////////////////////////////////////////////////////////////////// +/// /// +/// AliFemtoModelWeightGenerator - abstract base class for femtoscopic /// +/// weight generator /// +/// Authors: Adam Kisiel kisiel@mps.ohio-state.edu /// +/// /// +//////////////////////////////////////////////////////////////////////////////// +#ifndef ALIFEMTOMODELWEIGHTGENERATOR_H +#define ALIFEMTOMODELWEIGHTGENERATOR_H + +#include "TRandom2.h" +class AliFemtoPair; + +class AliFemtoModelWeightGenerator +{ + public: + AliFemtoModelWeightGenerator(); + AliFemtoModelWeightGenerator(const AliFemtoModelWeightGenerator &aModel); + virtual ~AliFemtoModelWeightGenerator(); + AliFemtoModelWeightGenerator& operator=(const AliFemtoModelWeightGenerator &aModel); + virtual Double_t GenerateWeight(AliFemtoPair *aPair) = 0; + + virtual void SetPairType(Int_t aPairType); + virtual void SetPairTypeFromPair(AliFemtoPair *aPair); + virtual Int_t GetPairType() const; + virtual Int_t GetPairTypeFromPair(AliFemtoPair *aPair); + + virtual Double_t GetKStar() const; + virtual Double_t GetKStarOut() const; + virtual Double_t GetKStarSide() const; + virtual Double_t GetKStarLong() const; + virtual Double_t GetRStar() const; + virtual Double_t GetRStarOut() const; + virtual Double_t GetRStarSide() const; + virtual Double_t GetRStarLong() const; + + virtual AliFemtoModelWeightGenerator* Clone() const; + + static Int_t PionPlusPionPlus(); + static Int_t PionPlusPionMinus(); + static Int_t KaonPlusKaonPlus(); + static Int_t KaonPlusKaonMinus(); + static Int_t ProtonProton(); + static Int_t ProtonAntiproton(); + static Int_t PionPlusKaonPlus(); + static Int_t PionPlusKaonMinus(); + static Int_t PionPlusProton(); + static Int_t PionPlusAntiproton(); + static Int_t KaonPlusProton(); + static Int_t KaonPlusAntiproton(); + static Int_t PairTypeNone(); + + protected: + static const Int_t fgkPairTypeNone; // no pair type set - read from model + static const Int_t fgkPionPlusPionPlus; // identical pion pair + static const Int_t fgkPionPlusPionMinus; // non-identical pion pair + static const Int_t fgkKaonPlusKaonPlus; // identical kaon pair + static const Int_t fgkKaonPlusKaonMinus; // non-identical kaon pair + static const Int_t fgkProtonProton; // identical proton pair + static const Int_t fgkProtonAntiproton; // non-identical proton pair + static const Int_t fgkPionPlusKaonPlus; // same-charge pion kaon pair + static const Int_t fgkPionPlusKaonMinus; // opposite-charge pion kaon pair + static const Int_t fgkPionPlusProton; // same-charge pion proton pair + static const Int_t fgkPionPlusAntiproton;// opposite-chare pion proton pair + static const Int_t fgkKaonPlusProton; // same-charge kaon proton pair + static const Int_t fgkKaonPlusAntiproton;// opposite-charge kaon proton pair + + Int_t fPairType; // Type of the pair for which the calculation is done + + Double_t fKStarOut; // relative momentum out component in PRF + Double_t fKStarSide; // relative momentum side component in PRF + Double_t fKStarLong; // relative momentum long component in PRF + Double_t fKStar; // relative momentum magnitude + + Double_t fRStarOut; // relative separation out component in PRF + Double_t fRStarSide; // relative separation side component in PRF + Double_t fRStarLong; // relative separation long component in PRF + Double_t fRStar; // relative separation magnitude + private: + +#ifdef __ROOT__ + ClassDef(AliFemtoModelWeightGenerator, 1) +#endif + + }; + +inline Double_t AliFemtoModelWeightGenerator::GetKStar() const { return fKStar; } +inline Double_t AliFemtoModelWeightGenerator::GetKStarOut() const { return fKStarOut; } +inline Double_t AliFemtoModelWeightGenerator::GetKStarSide() const { return fKStarSide; } +inline Double_t AliFemtoModelWeightGenerator::GetKStarLong() const { return fKStarLong; } +inline Double_t AliFemtoModelWeightGenerator::GetRStar() const { return fRStar; } +inline Double_t AliFemtoModelWeightGenerator::GetRStarOut() const { return fRStarOut; } +inline Double_t AliFemtoModelWeightGenerator::GetRStarSide() const { return fRStarSide; } +inline Double_t AliFemtoModelWeightGenerator::GetRStarLong() const { return fRStarLong; } + +inline Int_t AliFemtoModelWeightGenerator::PairTypeNone() { return fgkPairTypeNone; } +inline Int_t AliFemtoModelWeightGenerator::PionPlusPionPlus() { return fgkPionPlusPionPlus; } +inline Int_t AliFemtoModelWeightGenerator::PionPlusPionMinus() { return fgkPionPlusPionMinus; } +inline Int_t AliFemtoModelWeightGenerator::KaonPlusKaonPlus() { return fgkKaonPlusKaonPlus; } +inline Int_t AliFemtoModelWeightGenerator::KaonPlusKaonMinus() { return fgkKaonPlusKaonMinus; } +inline Int_t AliFemtoModelWeightGenerator::ProtonProton() { return fgkProtonProton; } +inline Int_t AliFemtoModelWeightGenerator::ProtonAntiproton() { return fgkProtonAntiproton; } +inline Int_t AliFemtoModelWeightGenerator::PionPlusKaonPlus() { return fgkPionPlusKaonPlus; } +inline Int_t AliFemtoModelWeightGenerator::PionPlusKaonMinus() { return fgkPionPlusKaonMinus; } +inline Int_t AliFemtoModelWeightGenerator::PionPlusProton() { return fgkPionPlusProton; } +inline Int_t AliFemtoModelWeightGenerator::PionPlusAntiproton() { return fgkPionPlusAntiproton; } +inline Int_t AliFemtoModelWeightGenerator::KaonPlusProton() { return fgkKaonPlusProton; } +inline Int_t AliFemtoModelWeightGenerator::KaonPlusAntiproton() { return fgkKaonPlusAntiproton; } + +#endif + + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGeneratorBasic.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGeneratorBasic.cxx new file mode 100644 index 00000000000..5c61f85e1a8 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGeneratorBasic.cxx @@ -0,0 +1,200 @@ +//////////////////////////////////////////////////////////////////////////////// +/// /// +/// AliFemtoModelWeightGeneratorBasic - basic femtoscopic weight generator /// +/// only return a simple /// +/// Authors: Adam Kisiel kisiel@mps.ohio-state.edu /// +/// /// +//////////////////////////////////////////////////////////////////////////////// +#ifdef __ROOT__ + ClassImp(AliFemtoModelWeightGeneratorBasic, 1) +#endif + +#include "AliFemtoModelWeightGeneratorBasic.h" +#include "AliFemtoModelHiddenInfo.h" + +//________________________ +AliFemtoModelWeightGeneratorBasic::AliFemtoModelWeightGeneratorBasic(): + AliFemtoModelWeightGenerator() +{ + /* no-op */ +} +//________________________ +AliFemtoModelWeightGeneratorBasic::AliFemtoModelWeightGeneratorBasic(const AliFemtoModelWeightGeneratorBasic &aModel) : + AliFemtoModelWeightGenerator(aModel) +{ + /* no-op */ +} + +//________________________ +AliFemtoModelWeightGeneratorBasic::~AliFemtoModelWeightGeneratorBasic() +{ + /* no-op */ +} + +AliFemtoModelWeightGeneratorBasic& AliFemtoModelWeightGeneratorBasic::operator=(const AliFemtoModelWeightGeneratorBasic &aModel) +{ + if (this != &aModel) { + AliFemtoModelWeightGenerator::operator=(aModel); + } + + return *this; +} + +//________________________ +Double_t AliFemtoModelWeightGeneratorBasic::GenerateWeight(AliFemtoPair *aPair) +{ + // Generate a simple femtoscopic weight coming only from + // quantum statistics - symmetrization or anti-symmetrization + // of the pair wave function + + // Get hidden information pointers + AliFemtoModelHiddenInfo *inf1 = (AliFemtoModelHiddenInfo *) aPair->Track1()->HiddenInfo(); + AliFemtoModelHiddenInfo *inf2 = (AliFemtoModelHiddenInfo *) aPair->Track2()->HiddenInfo(); + + // Calculate pair variables + Double_t tPx = inf1->GetTrueMomentum()->x()+inf2->GetTrueMomentum()->x(); + Double_t tPy = inf1->GetTrueMomentum()->y()+inf2->GetTrueMomentum()->y(); + Double_t tPz = inf1->GetTrueMomentum()->z()+inf2->GetTrueMomentum()->z(); + // double tE = inf1->GetTrueMomentum()->e +inf2->GetTrueMomentum()->.e; + Double_t tM1 = inf1->GetMass(); + Double_t tM2 = inf2->GetMass(); + Double_t tE1 = sqrt(tM1*tM1 + inf1->GetTrueMomentum()->Mag2()); + Double_t tE2 = sqrt(tM2*tM2 + inf2->GetTrueMomentum()->Mag2()); + Double_t tE = tE1 + tE2; + Double_t tPt = tPx*tPx + tPy*tPy; + Double_t tMt = tE*tE - tPz*tPz;//mCVK; + Double_t tM = sqrt(tMt - tPt); + tMt = sqrt(tMt); + tPt = sqrt(tPt); + Double_t tBetat = tPt/tMt; + + // Boost to LCMS + Double_t tBeta = tPz/tE; + Double_t tGamma = tE/tMt; + fKStarLong = tGamma * (inf1->GetTrueMomentum()->z() - tBeta * tE1); + Double_t tE1L = tGamma * (tE1 - tBeta * inf1->GetTrueMomentum()->z()); + + // Transform positions to LCMS +// Double_t tP1zl = tGamma * (inf1->GetEmissionPoint()->z() - tBeta * inf1->GetEmissionPoint()->t()); +// Double_t tP1tl = tGamma * (inf1->GetEmissionPoint()->t() - tBeta * inf1->GetEmissionPoint()->z()); + +// Double_t tP2zl = tGamma * (inf2->GetEmissionPoint()->z() - tBeta * inf2->GetEmissionPoint()->t()); +// Double_t tP2tl = tGamma * (inf2->GetEmissionPoint()->t() - tBeta * inf2->GetEmissionPoint()->z()); + +// Double_t tP1pzl = tGamma * (inf1->GetTrueMomentum()->z() - tBeta * tE1); +// Double_t tP1el = tGamma * (tE1 - tBeta * inf1->GetTrueMomentum()->z()); + +// Double_t tP2pzl = tGamma * (inf2->GetTrueMomentum()->z() - tBeta * tE2); +// Double_t tP2el = tGamma * (tE2 - tBeta * inf2->GetTrueMomentum()->z()); + + // Rotate in transverse plane + fKStarOut = ( inf1->GetTrueMomentum()->x()*tPx + inf1->GetTrueMomentum()->y()*tPy)/tPt; + fKStarSide = (-inf1->GetTrueMomentum()->x()*tPy + inf1->GetTrueMomentum()->y()*tPx)/tPt; + +// Double_t tP1pxl = fKStarOut; +// Double_t tP1pyl = fKStarSide; + +// Double_t tP2pxl = (inf2->GetTrueMomentum()->x()*tPx + inf2->GetTrueMomentum()->y()*tPy)/tPt; +// Double_t tP2pyl = (inf2->GetTrueMomentum()->y()*tPx - inf2->GetTrueMomentum()->x()*tPy)/tPt;; + +// Double_t tKO = tP1pxl - tP2pxl; +// Double_t tKS = tP1pyl - tP2pyl; +// Double_t tKL = tP1pzl - tP2pzl; +// Double_t tDE = tP1el - tP2el; + + // save the rotated coordinates in LCMS variables +// Double_t tP1xl = ( inf1->GetEmissionPoint()->x()*tPx + inf1->GetEmissionPoint()->y()*tPy)/tPt; +// Double_t tP1yl = (-inf1->GetEmissionPoint()->x()*tPy + inf1->GetEmissionPoint()->y()*tPx)/tPt; + +// Double_t tP2xl = ( inf2->GetEmissionPoint()->x()*tPx + inf2->GetEmissionPoint()->y()*tPy)/tPt; +// Double_t tP2yl = (-inf2->GetEmissionPoint()->x()*tPy + inf2->GetEmissionPoint()->y()*tPx)/tPt; + + // Boost to pair cms + fKStarOut = tMt/tM * (fKStarOut - tPt/tMt * tE1L); + + tBetat = tPt/tMt; +// Double_t tGammat = 1.0/sqrt(1.0-tBetat*tBetat); + +// Double_t tP1xp = tGammat*(tP1xl - tBetat*tP1tl); +// Double_t tP1tp = tGammat*(tP1tl - tBetat*tP1xl); + +// Double_t tP2xp = tGammat*(tP2xl - tBetat*tP2tl); +// Double_t tP2tp = tGammat*(tP2tl - tBetat*tP2xl); + +// Double_t tRO = (tP1xl - tP2xl)/0.197327; +// Double_t tRS = (tP1yl - tP2yl)/0.197327; +// Double_t tRL = (tP1zl - tP2zl)/0.197327; +// Double_t tDT = (tP1tl - tP2tl)/0.197327; + + Double_t tDX = inf1->GetEmissionPoint()->x()-inf2->GetEmissionPoint()->x(); + Double_t tDY = inf1->GetEmissionPoint()->y()-inf2->GetEmissionPoint()->y(); + Double_t tRLong = inf1->GetEmissionPoint()->z()-inf2->GetEmissionPoint()->z(); + Double_t tDTime = inf1->GetEmissionPoint()->t()-inf2->GetEmissionPoint()->t(); + + Double_t tROut = (tDX*tPx + tDY*tPy)/tPt; + Double_t tRSide = (-tDX*tPy + tDY*tPx)/tPt; + + fRStarSide = tRSide; + Double_t tRSS = fRStarSide/0.197327; + + fRStarLong = tGamma*(tRLong - tBeta* tDTime); + Double_t tDTimePairLCMS = tGamma*(tDTime - tBeta* tRLong); + + Double_t tRLS = fRStarLong/0.197327; + tBeta = tPt/tMt; + tGamma = tMt/tM; + + fRStarOut = tGamma*(tROut - tBeta* tDTimePairLCMS); + Double_t tROS = fRStarOut/0.197327; +// Double_t tDTimePairCMS = tGamma*(tDTimePairLCMS - tBeta* tROut); + fRStar = ::sqrt(fRStarOut*fRStarOut + fRStarSide*fRStarSide + + fRStarLong*fRStarLong); + fKStar = ::sqrt(fKStarOut*fKStarOut + fKStarSide*fKStarSide + fKStarLong*fKStarLong); +// Double_t tRSt = fRStar/0.197327; + + if (fPairType != fgkPairTypeNone) { + if ((fPairType == PionPlusPionPlus()) || (fPairType == KaonPlusKaonPlus())) + return 1.0 + cos (2*(fKStarOut * tROS + fKStarSide * tRSS + fKStarLong * tRLS)); + else if (fPairType == ProtonProton()) + return 1.0 - 0.5 * cos (2*(fKStarOut * tROS + fKStarSide * tRSS + fKStarLong * tRLS)); + else + return 1.0; + } + else { + Int_t tPairType = GetPairTypeFromPair(aPair); + if ((tPairType == PionPlusPionPlus()) || (tPairType == KaonPlusKaonPlus())) + return 1.0 + cos (2*(fKStarOut * tROS + fKStarSide * tRSS + fKStarLong * tRLS)); + else if (tPairType == ProtonProton()) + return 1.0 - 0.5 * cos (2*(fKStarOut * tROS + fKStarSide * tRSS + fKStarLong * tRLS)); + else + return 1.0; + + } +} + +//________________________ +void AliFemtoModelWeightGeneratorBasic::SetPairType(Int_t aPairType) +{ + AliFemtoModelWeightGenerator::SetPairType(aPairType); +} +//________________________ +void AliFemtoModelWeightGeneratorBasic::SetPairTypeFromPair(AliFemtoPair *aPair) +{ + AliFemtoModelWeightGenerator::SetPairTypeFromPair(aPair); +} +//________________________ +Int_t AliFemtoModelWeightGeneratorBasic::GetPairType() const +{ + return AliFemtoModelWeightGenerator::GetPairType(); +} +//________________________ +AliFemtoModelWeightGenerator* AliFemtoModelWeightGeneratorBasic::Clone() const +{ + return GetGenerator(); +} +//________________________ +AliFemtoModelWeightGenerator* AliFemtoModelWeightGeneratorBasic::GetGenerator() const +{ + AliFemtoModelWeightGeneratorBasic *tGen = new AliFemtoModelWeightGeneratorBasic(*this); + return tGen; +} diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGeneratorBasic.h b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGeneratorBasic.h new file mode 100644 index 00000000000..e7a63218b77 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGeneratorBasic.h @@ -0,0 +1,42 @@ +//////////////////////////////////////////////////////////////////////////////// +/// /// +/// AliFemtoModelWeightGeneratorBasic - basic femtoscopic weight generator /// +/// only return a simple /// +/// Authors: Adam Kisiel kisiel@mps.ohio-state.edu /// +/// /// +//////////////////////////////////////////////////////////////////////////////// +#ifndef AliFemtoModelWeightGeneratorBasic_hh +#define AliFemtoModelWeightGeneratorBasic_hh + +#include "TRandom2.h" +#include "AliFemtoPair.h" +#include "AliFemtoModelWeightGenerator.h" + +class AliFemtoModelWeightGeneratorBasic : public AliFemtoModelWeightGenerator +{ + public: + AliFemtoModelWeightGeneratorBasic(); + AliFemtoModelWeightGeneratorBasic(const AliFemtoModelWeightGeneratorBasic &aModel); + virtual ~AliFemtoModelWeightGeneratorBasic(); + AliFemtoModelWeightGeneratorBasic& operator=(const AliFemtoModelWeightGeneratorBasic &aModel); + virtual Double_t GenerateWeight(AliFemtoPair *aPair); + + virtual void SetPairType(Int_t aPairType); + virtual void SetPairTypeFromPair(AliFemtoPair *aPair); + virtual Int_t GetPairType() const; + + virtual AliFemtoModelWeightGenerator* Clone() const; + protected: + + private: + AliFemtoModelWeightGenerator* GetGenerator() const; + +#ifdef __ROOT__ + ClassDef(AliFemtoModelWeightGeneratorBasic, 1) +#endif + + }; + +#endif + + diff --git a/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGeneratorLednicky.cxx b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGeneratorLednicky.cxx new file mode 100644 index 00000000000..83504dbdd88 --- /dev/null +++ b/PWGCF/FEMTOSCOPY/AliFemto/AliFemtoModelWeightGeneratorLednicky.cxx @@ -0,0 +1,672 @@ +/////////////////////////////////////////////////////////////////////////// +// // +// AliFemtoModelWeightGeneratorLednicky : the most advanced weight // +// generator available. Supports a large number of different pair types // +// and interaction types. Can calculate pair weights coming from // +// quantum statistics, coulomb interation and strong interaction ot any // +// combination of the three, as applicable. // +// This class is a wrapper for the fortran code provided by Richard // +// Lednicky. // +// // +/////////////////////////////////////////////////////////////////////////// + +//#include "StHbtMaker/ThCorrFctn/AliFemtoModelWeightGeneratorLednicky.h" +#include "AliFemtoModelWeightGeneratorLednicky.h" +#include "AliFemtoModelHiddenInfo.h" +#include "AliFemtoPair.h" +//#include "StarCallf77.h" +//#include +//#include +//#include +//#include +#include + +#ifdef SOLARIS +# ifndef false +typedef int bool; +#define false 0 +#define true 1 +# endif +#endif + +#ifdef WIN32 +# ifdef CERNLIB_MSSTDCALL +# define F77_UCASE +# define type_of_call _stdcall +# ifndef CERNLIB_QXCAPT +# define CERNLIB_QXCAPT +# endif +# else +# define F77_LCASE +# ifndef CERNLIB_QXNO_SC +# define CERNLIB_QXNO_SC +# endif +# endif +# define type_of_call _stdcall +# define DEFCHARD const char* , const int +# define DEFCHARL +# define PASSCHARD(string) string, strlen(string) +# define PASSCHARL(string) +#else +# define DEFCHARD const char* +# define DEFCHARL , const int +# define PASSCHARD(string) string +# define PASSCHARL(string) , strlen(string) +#endif +#ifdef CERNLIB_QXCAPT +# define F77_NAME(name,NAME) NAME +#else +# if defined(CERNLIB_QXNO_SC) +# define F77_NAME(name,NAME) name +# else +# define F77_NAME(name,NAME) name##_ +# endif +#endif +#ifndef type_of_call +# define type_of_call +#endif + +// --- Prototype of the function used in the weight calculator +// (in FsiWeightLedinicky.F) +#define fsiin F77_NAME(fsiin,FSIIN) +extern "C" {void type_of_call F77_NAME(fsiin,FSIIN)(const int &itest,const int &ich, const int &iqs, const int &isi,const int &i3c);} +#define llini F77_NAME(llini,LLINI) +extern "C" {void type_of_call F77_NAME(llini,LLINI)(const int &lll,const int &ns, const int &itest);} + +#define fsinucl F77_NAME(fsinucl,FSINUCL) +extern "C" {void type_of_call F77_NAME(fsinucl,FSINUCL)(const double &mn,const double &cn);} +#define fsimomentum F77_NAME(fsimomentum,FSIMOMENTUM) +extern "C" {void type_of_call F77_NAME(fsimomentum,FSIMOMENTUM)(double &p1,double &p2);} +#define fsiposition F77_NAME(fsiposition,FSIPOSITION) +extern "C" {void type_of_call F77_NAME(fsiposition,FSIPOSITION)(double &x1,double &x2);} +#define fsiw F77_NAME(fsiw,FSIW) +extern "C" {void type_of_call F77_NAME(fsiw,FSIW)(const int &i,double &weif, + double &wei,double &wein);} +#define ltran12 F77_NAME(ltran12,LTRAN12) +extern "C" {void type_of_call ltran12_();} + +// Test function for Lambda potential +//#define printlam F77_NAME(printlam,PRINTLAM) +//extern "C" {void type_of_call printlam_();} +//there is not PRINTLAM in *.F file + +// --- Additional prototyping of some CERN functions (in FsiTool.F) +typedef float REAL; +typedef struct { REAL re; REAL im; } COMPLEX; +#define cgamma F77_NAME(cgamma,CGAMMA) +extern "C" {COMPLEX type_of_call cgamma_(COMPLEX*);} + +#ifdef __ROOT__ +ClassImp(AliFemtoModelWeightGeneratorLednicky) +#endif + +AliFemtoModelWeightGeneratorLednicky::AliFemtoModelWeightGeneratorLednicky() : + AliFemtoModelWeightGenerator(), + fWei(0), fWein(0), fWeif(0), fWeightDen(0), + fItest(0),fIch(1),fIqs(1),fIsi(1),fI3c(0), + fNuclMass(1.),fNuclCharge(0.), + fSphereApp(false),fT0App(false) , + fLL(0), fNuclChargeSign(1), fSwap(0), fLLMax(30), fLLName(0), + fNumProcessPair(0), fNumbNonId(0) +{ + // default constructor + fLLName=new char*[fLLMax+1]; + fNumProcessPair=new int[fLLMax+1]; + int i; + for (i=1;i<=fLLMax;i++) {fLLName[i]=new char[40];fNumProcessPair[i]=0;} + strncpy( fLLName[1],"neutron neutron",40); + strncpy( fLLName[2],"proton proton",40); + strncpy( fLLName[3],"neutron proton",40); + strncpy( fLLName[4],"alpha alpha",40); + strncpy( fLLName[5],"pi+ pi-",40); + strncpy( fLLName[6],"pi0 pi0",40); + strncpy( fLLName[7],"pi+ pi+",40); + strncpy( fLLName[8],"neutron deuteron",40); + strncpy( fLLName[9],"proton deuteron",40); + strncpy( fLLName[10],"pi+ K-",40); + strncpy( fLLName[11],"pi+ K+",40); + strncpy( fLLName[12],"pi+ proton",40); + strncpy( fLLName[13],"pi- proton",40); + strncpy( fLLName[14],"K+ K-",40); + strncpy( fLLName[15],"K+ K+",40); + strncpy( fLLName[16],"K+ proton",40); + strncpy( fLLName[17],"K- proton",40); + strncpy( fLLName[18],"deuteron deuteron",40); + strncpy( fLLName[19],"deuton alpha",40); + strncpy( fLLName[20],"triton triton",40); + strncpy( fLLName[21],"triton alpha",40); + strncpy( fLLName[22],"K0 K0",40); + strncpy( fLLName[23],"K0 K0b",40); + strncpy( fLLName[24],"deuteron triton",40); + strncpy( fLLName[25],"proton triton",40); + strncpy( fLLName[26],"proton alpha",40); + strncpy( fLLName[27],"proton lambda",40); + strncpy( fLLName[28],"neutron lambda",40); + strncpy( fLLName[29],"Lambda lambda",40);// gael 21May02 + strncpy( fLLName[30],"Proton Anti-proton",40);// gael 21May02 + FsiInit(); + FsiNucl(); +} +//______________________ +AliFemtoModelWeightGeneratorLednicky::AliFemtoModelWeightGeneratorLednicky(const AliFemtoModelWeightGeneratorLednicky &aWeight): + AliFemtoModelWeightGenerator(), + fWei(0), fWein(0), fWeif(0), fWeightDen(0), + fItest(0),fIch(1),fIqs(1),fIsi(1),fI3c(0), + fNuclMass(1.),fNuclCharge(0.), + fSphereApp(false),fT0App(false) , + fLL(0), fNuclChargeSign(1), fSwap(0), fLLMax(30), fLLName(0), + fNumProcessPair(0), fNumbNonId(0) +{ + // copy constructor + fWei = aWeight.fWei; + fWein = aWeight. fWein; + fWeif = aWeight. fWeif; + fWeightDen = aWeight.fWeightDen; + + fItest = aWeight.fItest; + fIch = aWeight.fIch; + fIqs = aWeight.fIqs; + fIsi = aWeight.fIsi; + fI3c = aWeight.fI3c; + fNuclMass = aWeight.fNuclMass; + fNuclCharge = aWeight.fNuclCharge; + fSphereApp = aWeight.fSphereApp; + fT0App = aWeight.fT0App; + fLL = aWeight.fLL; + fNuclChargeSign = aWeight.fNuclChargeSign; + fSwap = aWeight.fSwap; + fLLName = aWeight.fLLName; + fNumProcessPair = aWeight.fNumProcessPair; + fNumbNonId = aWeight.fNumbNonId; + fLLName=new char*[fLLMax+1]; + fNumProcessPair=new int[fLLMax+1]; + int i; + for (i=1;i<=fLLMax;i++) {fLLName[i]=new char[40];fNumProcessPair[i]=0;} + strncpy( fLLName[1],"neutron neutron",40); + strncpy( fLLName[2],"proton proton",40); + strncpy( fLLName[3],"neutron proton",40); + strncpy( fLLName[4],"alpha alpha",40); + strncpy( fLLName[5],"pi+ pi-",40); + strncpy( fLLName[6],"pi0 pi0",40); + strncpy( fLLName[7],"pi+ pi+",40); + strncpy( fLLName[8],"neutron deuteron",40); + strncpy( fLLName[9],"proton deuteron",40); + strncpy( fLLName[10],"pi+ K-",40); + strncpy( fLLName[11],"pi+ K+",40); + strncpy( fLLName[12],"pi+ proton",40); + strncpy( fLLName[13],"pi- proton",40); + strncpy( fLLName[14],"K+ K-",40); + strncpy( fLLName[15],"K+ K+",40); + strncpy( fLLName[16],"K+ proton",40); + strncpy( fLLName[17],"K- proton",40); + strncpy( fLLName[18],"deuteron deuteron",40); + strncpy( fLLName[19],"deuton alpha",40); + strncpy( fLLName[20],"triton triton",40); + strncpy( fLLName[21],"triton alpha",40); + strncpy( fLLName[22],"K0 K0",40); + strncpy( fLLName[23],"K0 K0b",40); + strncpy( fLLName[24],"deuteron triton",40); + strncpy( fLLName[25],"proton triton",40); + strncpy( fLLName[26],"proton alpha",40); + strncpy( fLLName[27],"proton lambda",40); + strncpy( fLLName[28],"neutron lambda",40); + strncpy( fLLName[29],"Lambda lambda",40);// gael 21May02 + strncpy( fLLName[30],"Proton Anti-proton",40);// gael 21May02 + FsiInit(); + FsiNucl(); +} + +AliFemtoModelWeightGeneratorLednicky& AliFemtoModelWeightGeneratorLednicky::operator=(const AliFemtoModelWeightGeneratorLednicky& aWeight) +{ + // assignment operator + if (this == &aWeight) + return *this; + + fWei = aWeight.fWei; + fWein = aWeight. fWein; + fWeif = aWeight. fWeif; + fWeightDen = aWeight.fWeightDen; + + fItest = aWeight.fItest; + fIch = aWeight.fIch; + fIqs = aWeight.fIqs; + fIsi = aWeight.fIsi; + fI3c = aWeight.fI3c; + fNuclMass = aWeight.fNuclMass; + fNuclCharge = aWeight.fNuclCharge; + fSphereApp = aWeight.fSphereApp; + fT0App = aWeight.fT0App; + fLL = aWeight.fLL; + fNuclChargeSign = aWeight.fNuclChargeSign; + fSwap = aWeight.fSwap; + // fLLName = aWeight.fLLName; + fNumProcessPair = aWeight.fNumProcessPair; + fNumbNonId = aWeight.fNumbNonId; + if (fLLName) free(fLLName); + fLLName=new char*[fLLMax+1]; + if (fNumProcessPair) free(fNumProcessPair); + fNumProcessPair=new int[fLLMax+1]; + int i; + for (i=1;i<=fLLMax;i++) {fLLName[i]=new char[40];fNumProcessPair[i]=0;} + strncpy( fLLName[1],"neutron neutron",40); + strncpy( fLLName[2],"proton proton",40); + strncpy( fLLName[3],"neutron proton",40); + strncpy( fLLName[4],"alpha alpha",40); + strncpy( fLLName[5],"pi+ pi-",40); + strncpy( fLLName[6],"pi0 pi0",40); + strncpy( fLLName[7],"pi+ pi+",40); + strncpy( fLLName[8],"neutron deuteron",40); + strncpy( fLLName[9],"proton deuteron",40); + strncpy( fLLName[10],"pi+ K-",40); + strncpy( fLLName[11],"pi+ K+",40); + strncpy( fLLName[12],"pi+ proton",40); + strncpy( fLLName[13],"pi- proton",40); + strncpy( fLLName[14],"K+ K-",40); + strncpy( fLLName[15],"K+ K+",40); + strncpy( fLLName[16],"K+ proton",40); + strncpy( fLLName[17],"K- proton",40); + strncpy( fLLName[18],"deuteron deuteron",40); + strncpy( fLLName[19],"deuton alpha",40); + strncpy( fLLName[20],"triton triton",40); + strncpy( fLLName[21],"triton alpha",40); + strncpy( fLLName[22],"K0 K0",40); + strncpy( fLLName[23],"K0 K0b",40); + strncpy( fLLName[24],"deuteron triton",40); + strncpy( fLLName[25],"proton triton",40); + strncpy( fLLName[26],"proton alpha",40); + strncpy( fLLName[27],"proton lambda",40); + strncpy( fLLName[28],"neutron lambda",40); + strncpy( fLLName[29],"Lambda lambda",40);// gael 21May02 + strncpy( fLLName[30],"Proton Anti-proton",40);// gael 21May02 + FsiInit(); + FsiNucl(); + + return *this; +} + + +double AliFemtoModelWeightGeneratorLednicky::GenerateWeight(AliFemtoPair* aPair) +{ + // Get hidden information pointers + AliFemtoModelHiddenInfo *inf1 = (AliFemtoModelHiddenInfo *) aPair->Track1()->HiddenInfo(); + AliFemtoModelHiddenInfo *inf2 = (AliFemtoModelHiddenInfo *) aPair->Track2()->HiddenInfo(); + + // Calculate pair variables + Double_t tPx = inf1->GetTrueMomentum()->x()+inf2->GetTrueMomentum()->x(); + Double_t tPy = inf1->GetTrueMomentum()->y()+inf2->GetTrueMomentum()->y(); + Double_t tPz = inf1->GetTrueMomentum()->z()+inf2->GetTrueMomentum()->z(); + Double_t tM1 = inf1->GetMass(); + Double_t tM2 = inf2->GetMass(); + Double_t tE1 = sqrt(tM1*tM1 + inf1->GetTrueMomentum()->Mag2()); + Double_t tE2 = sqrt(tM2*tM2 + inf2->GetTrueMomentum()->Mag2()); + Double_t tE = tE1 + tE2; + Double_t tPt = tPx*tPx + tPy*tPy; + Double_t tMt = tE*tE - tPz*tPz;//mCVK; + Double_t tM = sqrt(tMt - tPt); + tMt = sqrt(tMt); + tPt = sqrt(tPt); + Double_t tBetat = tPt/tMt; + + // Boost to LCMS + Double_t tBeta = tPz/tE; + Double_t tGamma = tE/tMt; + fKStarLong = tGamma * (inf1->GetTrueMomentum()->z() - tBeta * tE1); + Double_t tE1L = tGamma * (tE1 - tBeta * inf1->GetTrueMomentum()->z()); + + // Rotate in transverse plane + fKStarOut = ( inf1->GetTrueMomentum()->x()*tPx + inf1->GetTrueMomentum()->y()*tPy)/tPt; + fKStarSide = (-inf1->GetTrueMomentum()->x()*tPy + inf1->GetTrueMomentum()->y()*tPx)/tPt; + + // Boost to pair cms + fKStarOut = tMt/tM * (fKStarOut - tPt/tMt * tE1L); + + tBetat = tPt/tMt; + + Double_t tDX = inf1->GetEmissionPoint()->x()-inf2->GetEmissionPoint()->x(); + Double_t tDY = inf1->GetEmissionPoint()->y()-inf2->GetEmissionPoint()->y(); + Double_t tRLong = inf1->GetEmissionPoint()->z()-inf2->GetEmissionPoint()->z(); + Double_t tDTime = inf1->GetEmissionPoint()->t()-inf2->GetEmissionPoint()->t(); + + Double_t tROut = (tDX*tPx + tDY*tPy)/tPt; + Double_t tRSide = (-tDX*tPy + tDY*tPx)/tPt; + +// cout << "Got points 1 " << inf1->GetEmissionPoint()->x() << " " << inf1->GetEmissionPoint()->y() << " " << inf1->GetEmissionPoint()->z() << " " << inf1->GetEmissionPoint()->t() << endl; + +// cout << "Got points 2 " << inf2->GetEmissionPoint()->x() << " " << inf2->GetEmissionPoint()->y() << " " << inf2->GetEmissionPoint()->z() << " " << inf2->GetEmissionPoint()->t() << endl; + + fRStarSide = tRSide; + + fRStarLong = tGamma*(tRLong - tBeta* tDTime); + Double_t tDTimePairLCMS = tGamma*(tDTime - tBeta* tRLong); + + tBeta = tPt/tMt; + tGamma = tMt/tM; + + fRStarOut = tGamma*(tROut - tBeta* tDTimePairLCMS); + fRStar = ::sqrt(fRStarOut*fRStarOut + fRStarSide*fRStarSide + + fRStarLong*fRStarLong); + fKStar = ::sqrt(fKStarOut*fKStarOut + fKStarSide*fKStarSide + fKStarLong*fKStarLong); + +// cout << "Got out side " << fRStarOut << " " << fRStarSide << endl; + + if (!SetPid(inf1->GetPDGPid(),inf2->GetPDGPid())) { + fWeightDen=1.; + return 1; + } + else { // Good Pid + AliFemtoThreeVector* p; + p=(inf1->GetTrueMomentum()); + double p1[]={p->x(),p->y(),p->z()}; + p=(inf2->GetTrueMomentum()); + double p2[]={p->x(),p->y(),p->z()}; + if ((p1[0]==p2[0])&&(p1[1]==p2[1])&&(p1[2]==p2[2])) { + fWeightDen=0.; + return 0; + } + if (fSwap) { + fsimomentum(*p2,*p1); + } else { + fsimomentum(*p1,*p2); + } + AliFemtoLorentzVector* tPoint; + tPoint=(inf1->GetEmissionPoint()); +// cout << "Pid1:dans GetWeight = " << aThPair->GetPid1() << endl; +// cout << "Pid2:dans GetWeight = " << aThPair->GetPid2() << endl; +// cout << "LL:in GetWeight = " << mLL << endl; + + double x1[]={tPoint->x(),tPoint->y(),tPoint->z(),tPoint->t()}; + tPoint=(inf2->GetEmissionPoint()); + double x2[]={tPoint->x(),tPoint->y(),tPoint->z(),tPoint->t()}; + if ((x1[0]==x2[0])&&(x1[1]==x2[1])&&(x1[2]==x2[2])&&(x1[3]==x2[3])) { + fWeightDen=0.; + return 0; + } + if (fSwap) { + fsiposition(*x2,*x1); + } else { + fsiposition(*x1,*x2); + } + FsiSetLL(); + ltran12(); + fsiw(1,fWeif,fWei,fWein); + + if (fI3c==0) return fWein; + fWeightDen=fWeif; + return fWei; + } +} + +AliFemtoString AliFemtoModelWeightGeneratorLednicky::Report() { + // create report + ostringstream tStr; + tStr << "Lednicky afterburner calculation for Correlation - Report" << endl; + tStr << " Setting : Quantum : " << ((fIqs) ? "On" : "Off"); + tStr << " - Coulbomb : " << ((fIch) ? "On" : "Off") ; + tStr << " - Strong : " << ((fIsi) ? "On" : "Off"); + tStr << endl; + tStr << " 3-Body : " << ((fI3c) ? "On" : "Off") ; + if (fI3c) tStr << " Mass=" << fNuclMass << " - Charge= " << fNuclCharge ; + tStr << endl; + tStr << " " << fNumProcessPair[0] << " Pairs have been Processed :" << endl; + int i; + for(i=1;i<=fLLMax;i++) { + if (fNumProcessPair[i]) + tStr << " " << fNumProcessPair[i] << " " << fLLName[i] << endl; + } + if (fNumbNonId) + tStr << " "<< fNumbNonId << " Non Identified" << endl; + AliFemtoString returnThis = tStr.str(); + return returnThis; +} + +void AliFemtoModelWeightGeneratorLednicky::FsiInit(){ + // Initialize weight generation module +// cout << "*******************AliFemtoModelWeightGeneratorLednicky check FsiInit ************" << endl; +// cout <<"mItest dans FsiInit() = " << fItest << endl; +// cout <<"mIch dans FsiInit() = " << fIch << endl; +// cout <<"mIqs dans FsiInit() = " << fIqs << endl; +// cout <<"mIsi dans FsiInit() = " << fIsi << endl; +// cout <<"mI3c dans FsiInit() = " << fI3c << endl; + fsiin(fItest,fIch,fIqs,fIsi,fI3c); +} + +void AliFemtoModelWeightGeneratorLednicky::FsiNucl(){ + // initialize weight generation taking into account the residual charge +// cout << "*******************AliFemtoModelWeightGeneratorLednicky check FsiNucl ************" << endl; +// cout <<"fNuclMass dans FsiNucl() = " << fNuclMass << endl; +// cout <<"fNuclCharge dans FsiNucl() = " << fNuclCharge << endl; +// cout <<"fNuclChargeSign dans FsiNucl() = " << fNuclChargeSign << endl; + fsinucl(fNuclMass,fNuclCharge*fNuclChargeSign); +} + +void AliFemtoModelWeightGeneratorLednicky::FsiSetLL(){ + // set internal pair type for the module + int tNS; + if (fSphereApp||(fLL>5)) { + if (fT0App) { tNS=4;} + else {tNS=2;} + } else { tNS=1;} + //cout <<"fLL dans FsiSetLL() = "<< fLL << endl; + //cout <<"tNS dans FsiSetLL() = "<< tNS << endl; + //cout <<"fItest dans FsiSetLL() = "<< fItest << endl; + llini(fLL,tNS,fItest); + //cout<<" end of FsiSetLL"<