end-of-line normalization
authoragrigora <alina.gabriela.grigoras@cern.ch>
Fri, 17 Jan 2014 10:33:49 +0000 (11:33 +0100)
committeragrigora <alina.gabriela.grigoras@cern.ch>
Fri, 17 Jan 2014 10:33:49 +0000 (11:33 +0100)
275 files changed:
ACORDE/AliACORDEQADataMakerRec.cxx
ACORDE/AliACORDERawReader.cxx
ACORDE/AliACORDERawStream.cxx
ACORDE/AliACORDERawStream.h
ACORDE/AliACORDEReconstructor.cxx
ACORDE/MakeACORDEFullMisAlignment.C
ACORDE/MakeACORDEResMisAlignment.C
ACORDE/MakeACORDEZeroMisAlignment.C
ACORDE/Survey_1014872_ACORDE.txt
ACORDE/macros/AnalysisMacros/Local/AliAnalysisTaskAcorde.h
ANALYSIS/AliAnalysisTaskPIDCombined.cxx
ANALYSIS/AliAnalysisTaskPIDCombined.h
ANALYSIS/AliAnalysisTaskPIDqa.h
ANALYSIS/AliAnalysisTaskPhiCorr.h
ANALYSIS/AliESDpidCuts.cxx
ANALYSIS/AliESDpidCuts.h
ANALYSIS/AliESDv0KineCuts.cxx
ANALYSIS/AliESDv0KineCuts.h
ANALYSIS/BadChunkFilter/ProcessBadChunks02.C
ANALYSIS/EventMixing/AliAnalysisTaskMixInfo.h
ANALYSIS/TenderSupplies/AliHMPIDTenderSupply.cxx
ANALYSIS/TenderSupplies/AliHMPIDTenderSupply.h
ANALYSIS/TenderSupplies/AliT0TenderSupply.cxx
ANALYSIS/TenderSupplies/AliT0TenderSupply.h
ANALYSIS/TenderSupplies/AliTRDTenderSupply.h
ANALYSIS/macros/PhysSelQA/AliPSQAVisualization.cxx
ANALYSIS/macros/PhysSelQA/AliPSQAVisualization.h
ANALYSIS/macros/PhysSelQA/PSQA.C
ANALYSIS/macros/PhysSelQA/PSQAV.C
ANALYSIS/macros/PhysSelQA/RunFillEvent_list.list
ANALYSIS/macros/recPass0.C
EVE/hlt-macros/od.C
EVE/hlt-macros/off.C
EVGEN/AliGenITSULib.cxx
EVGEN/AliGenITSULib.h
GRP/ShuttleInput/testShuttle_GRP_run_number_testShuttle_data.txt
HLT/CALO/AliHLTCaloClusterizer.cxx
HLT/CALO/AliHLTCaloClusterizer.h
HLT/CALO/AliHLTCaloDigitMaker.h
HLT/EVE/AliHLTEveMuon.cxx
HLT/EVE/AliHLTEveMuon.h
HLT/QA/tasks/AliAnalysisTaskHLTCalo.cxx
HLT/QA/tasks/AliAnalysisTaskHLTCalo.h
HLT/QA/tasks/AliAnalysisTaskHLTEMCAL.cxx
HLT/QA/tasks/AliAnalysisTaskHLTEMCAL.h
HLT/QA/tasks/AliAnalysisTaskHLTPHOS.cxx
HLT/QA/tasks/AliAnalysisTaskHLTPHOS.h
HLT/QA/tasks/AliAnalysisTaskHLTTPC.cxx
HLT/QA/tasks/AliAnalysisTaskHLTTPC.h
HLT/TPCLib/tracking-ca/cagpu/gpu_tracker_install.txt
HLT/trigger/tasks/AliAnalysisTasktrigger.h
ITS/AliITSAlignMille2Module.cxx
ITS/AliITSAlignMille2Module.h
ITS/AliITSAlignMilleFull.conf
ITS/AliITSCorrMap2DSDD.cxx
ITS/AliITSQASDDDataMakerSim.cxx
ITS/AliITSQASDDDataMakerSim.h
ITS/AliITSQASSDDataMakerRec.cxx
ITS/AliITSV0Finder.cxx
ITS/GetGainModuleLevel.C
ITS/UPGRADE/KMCDetector.cxx
ITS/UPGRADE/KMCDetector.h
ITS/doc/doc_itsgeo.html
ITS/patchSSDBadChannelsMap.C
LHAPDF/PDFsets/MRST2004qed.LHgrid
LHAPDF/PDFsets/MRST2007lomod.LHgrid
LHAPDF/PDFsets/MRSTMCal.LHgrid
LHAPDF/PDFsets/PDFsets.index
LHAPDF/lhapdf5.5.1/src/eps09.f
MFT/runReconstruction.C
MFT/runSimulation.C
OADB/AliOADBCentrality.cxx
PHOS/PHOSPEDda.cxx
PHOS/data/Survey_1053236_PHOS.txt
PHOS/data/Survey_922320_PHOS.txt
PHOS/macros/AlignmentDB/MakePHOSAlignmentModule2.C
PMD/AliPMDOfflineCalibTask.h
PWG/muondep/AccEffTemplates/CheckESD.C
PWG/muondep/AccEffTemplates/simrun.C
PWGCF/Correlations/DPhi/AliAnalysisTaskContMC.cxx
PWGCF/Correlations/DPhi/AliAnalysisTaskContMC.h
PWGCF/Correlations/JCORRAN/AliJBaseTrack.cxx
PWGCF/Correlations/macros/3particlecorrelations/AddTask_DiHadron.C
PWGCF/Correlations/macros/dphicorrelations/AddTaskPhiCorrelations.C
PWGCF/Correlations/macros/dphicorrelations/AddTaskPhiCorrelationsQA.C
PWGCF/Correlations/macros/underlyingevent/AddTaskLeadingTrackUE.C
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskEventMixingBF.h
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskToyModel.cxx
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskToyModel.h
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskTriggeredBF.cxx
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskTriggeredBF.h
PWGCF/EBYE/Fluctuations/AliAnalysisTaskChargeFluctuations.h
PWGCF/EBYE/Fluctuations/AliEbyEFluctuationAnalysisTask.h
PWGCF/EBYE/Fluctuations/AliEbyEFluctuationAnalysisTaskTrain.cxx
PWGCF/EBYE/Fluctuations/AliEbyEFluctuationAnalysisTaskTrain.h
PWGCF/EBYE/LRC/AliLRCBase.h
PWGCF/EBYE/LRC/Test/TestNN.C
PWGCF/EBYE/LRC/Test/TestPtN.C
PWGCF/EBYE/LRC/Test/TestPtPt.C
PWGCF/EBYE/MeanPtFluctuations/AliAnalysisTaskPtFluc.h
PWGCF/EBYE/MeanPtFluctuations/AliAnalysisTaskPtFlucPbPb.h
PWGCF/EBYE/PIDFluctuation/macros/AddAliEbyEParticleRatioFluctuationTask.C
PWGCF/EBYE/PIDFluctuation/task/AliAnalysisTaskPIDFluctuation.h
PWGCF/EBYE/PIDFluctuation/task/AliEbyEParticleRatioFluctuationTask.h
PWGCF/EBYE/macros/AddTaskBalanceCentralityTrain.C
PWGCF/EBYE/macros/AddTaskBalanceEventMixing.C
PWGCF/EBYE/macros/AddTaskBalanceFunctionInpp.C
PWGCF/EBYE/macros/AddTaskBalanceFunctionInppMultiplicityTrain.C
PWGCF/EBYE/macros/AddTaskBalanceMCCentralityTrain.C
PWGCF/EBYE/macros/AddTaskBalanceTriggered.C
PWGCF/EBYE/macros/configBalanceFunctionAnalysis.C
PWGCF/EBYE/macros/configBalanceFunctionAnalysisEventMixing.C
PWGCF/EBYE/macros/runBalanceFunction.C
PWGCF/EBYE/macros/runBalanceFunctionInpp.C
PWGCF/EBYE/macros/runBalanceFunctionMC.C
PWGCF/EBYE/macros/runBalanceFunctionToyModel.C
PWGDQ/dielectron/macrosLMEE/AddTask_Asako_LMEEPbPb2011AOD.C
PWGGA/EMCALTasks/AliAnalysisTaskEMCALCaloTrackCorr.h
PWGGA/GammaConv/AliAnaConvCorrPhoton.h
PWGGA/GammaConv/AliAnaConvIsolation.h
PWGGA/GammaConv/AliAnalysisTaskGCPartToPWG4Part.h
PWGGA/PHOSTasks/CaloCellQA/AliAnalysisTaskCaloCellsQA.h
PWGGA/PHOSTasks/PHOSCalib/AliAnalysisTaskPi0Calib.h
PWGGA/PHOSTasks/PHOS_PbPb_MC/AliPHOSHijingEfficiency.h
PWGGA/PHOSTasks/PHOS_embedding/AliAnalysisTaskPi0DiffEfficiency.h
PWGGA/PHOSTasks/PHOS_embedding/AliPHOSEmbedding.h
PWGGA/PHOSTasks/PHOS_embedding/simrun.C
PWGHF/hfe/macros/CorrectForEfficiencypptrd.C
PWGHF/hfe/macros/configs/PbPb/ConfigHFECalSys.C
PWGHF/hfe/macros/configs/PbPb/ConfigHFEElecHadronCorl.C
PWGHF/hfe/macros/configs/PbPb/ConfigHFEElecHadronCorrelPbPb.C
PWGHF/hfe/macros/configs/PbPb/ConfigHFEElecV2.C
PWGHF/hfe/macros/configs/PbPb/ConfigHFE_FLOW_TPCEMCal_EP.C
PWGHF/vertexingHF/AliAnalysisTaskMEVertexingHFTest.C
PWGHF/vertexingHF/AliAnalysisTaskSEImproveITS.cxx
PWGHF/vertexingHF/AliAnalysisTaskSESelectHF4Prong.h
PWGHF/vertexingHF/AliAnalysisTaskSEVertexingHFTest.C
PWGHF/vertexingHF/AliCFVertexingHF3Prong.h
PWGHF/vertexingHF/AliRDHFCutsD0toKpipipi.h
PWGHF/vertexingHF/macros/AddTaskCompareHF.C
PWGHF/vertexingHF/macros/AddTaskSelectHF.C
PWGHF/vertexingHF/upgrade/ConfigVertexingHF_ITSUpgrade_wPID.C
PWGJE/AliAnalysisTaskPartonDisc.h
PWGJE/AliPWG4CosmicCandidates.h
PWGJE/UserTasks/AliAnalysisTaskCheckSingleTrackJetRejection.h
PWGJE/UserTasks/AliAnalysisTaskJetHadronCorrelation.cxx
PWGJE/UserTasks/AliAnalysisTaskJetHadronCorrelation.h
PWGJE/macros/AddTaskCheckSingleTrackJetRejection.C
PWGJE/macros/AddTaskDiJets.C
PWGJE/macros/AddTaskJetHadronCorrelation.C
PWGJE/macros/AddTaskJetServices.C
PWGJE/macros/AddTaskJetSpectrum2.C
PWGJE/macros/AddTaskKMeans.C
PWGJE/macros/AnalysisTrainCAF.C
PWGLF/FORWARD/photons/AliAnalysisTaskPMD.h
PWGLF/FORWARD/photons/AliAnalysisTaskPMDSim.h
PWGLF/SPECTRA/AntiprotonToProton/AliProtonAbsorptionCorrection.h
PWGLF/SPECTRA/AntiprotonToProton/AliProtonCorrectionAnalysisTask.cxx
PWGLF/SPECTRA/AntiprotonToProton/AliProtonCorrectionAnalysisTask.h
PWGLF/SPECTRA/AntiprotonToProton/AliProtonFeedDownAnalysis.h
PWGLF/SPECTRA/AntiprotonToProton/AliProtonFeedDownAnalysisTask.cxx
PWGLF/SPECTRA/AntiprotonToProton/AliProtonFeedDownAnalysisTask.h
PWGLF/SPECTRA/AntiprotonToProton/AliProtonSpectraCorrection.h
PWGLF/SPECTRA/AntiprotonToProton/configProtonAnalysisBaseObject.C
PWGLF/SPECTRA/ChargedHadrons/dNdPt/AliPtResolAnalysis.cxx
PWGLF/SPECTRA/ChargedHadrons/dNdPt/AliPtResolAnalysisPbPb.cxx
PWGLF/SPECTRA/ChargedHadrons/dNdPt/AlidNdPt.cxx
PWGLF/SPECTRA/ChargedHadrons/dNdPt/AlidNdPtAcceptanceCuts.h
PWGLF/SPECTRA/ChargedHadrons/dNdPt/AlidNdPtAnalysis.cxx
PWGLF/SPECTRA/ChargedHadrons/dNdPt/AlidNdPtAnalysispPb.cxx
PWGLF/SPECTRA/ChargedHadrons/dNdPt/AlidNdPtBackgroundCuts.h
PWGLF/SPECTRA/ChargedHadrons/dNdPt/AlidNdPtCorrection.cxx
PWGLF/SPECTRA/ChargedHadrons/dNdPt/AlidNdPtCutAnalysis.cxx
PWGLF/SPECTRA/ChargedHadrons/dNdPt/AlidNdPtCutAnalysisPbPb.cxx
PWGLF/SPECTRA/ChargedHadrons/dNdPt/AlidNdPtEfficiency.cxx
PWGLF/SPECTRA/ChargedHadrons/dNdPt/AlidNdPtEventCuts.h
PWGLF/SPECTRA/ChargedHadrons/dNdPt/AlidNdPtTask.cxx
PWGLF/SPECTRA/ChargedHadrons/dNdPt/AlidNdPtTrackDumpTask.cxx
PWGLF/SPECTRA/IdentifiedHighPt/grid/ListDirectories.h
PWGLF/SPECTRA/Kinks/macros/AddTaskKink.C
PWGLF/SPECTRA/Kinks/macros/AddTaskKinkMC.C
PWGLF/SPECTRA/PiKaPr/HMPID/AliHMPIDAnalysisTask.cxx
PWGLF/SPECTRA/PiKaPr/HMPID/AliHMPIDAnalysisTask.h
PWGLF/SPECTRA/PiKaPr/HMPID/AnalysisTrainHMPID.C
PWGLF/SPECTRA/PiKaPr/TPCTOF/AddTaskCombinedHadronSpectra.C
PWGLF/SPECTRA/PiKaPr/TestAOD/AliAnalysisTaskSpectraAOD.h
PWGLF/SPECTRA/PiKaPr/TestAOD/AliAnalysisTaskSpectraBoth.h
PWGLF/SPECTRA/PiKaPr/TestAOD/runGridBoth.C
PWGLF/STRANGENESS/Correlations/macros/runProofLambdaOverK0sJets.C
PWGLF/STRANGENESS/LambdaK0PbPb/MainStreamAnalysis/Makefile
PWGPP/AliAnalysisTaskVtXY.h
PWGPP/AliFilteredTreeAcceptanceCuts.h
PWGPP/AliFilteredTreeEventCuts.h
PWGPP/HMPID/AddTaskHmpidQA.C
PWGPP/PilotTrain/AddTaskVZEROQA.C
PWGPP/PilotTrain/AddTaskVZEROQATrig.C
PWGPP/TPC/AliComparisonObject.h
PWGPP/TPC/AliMCInfoCuts.h
PWGPP/TPC/AliPerformanceObject.h
PWGPP/TPC/AliPerformanceTask.cxx
PWGPP/TRD/AliTRDinfoGen.cxx
PWGPP/TRD/AliTRDinfoGen.h
PWGPP/TRD/AliTRDrecoTask.cxx
PWGPP/TRD/AliTRDrecoTask.h
PWGPP/cosmic/AliAnalysisTaskCosmic.h
PWGPP/macros/AddTrainPerformanceTRD.C
PWGPP/macros/PhysSel/QALHC11c_QA69.h
PWGPP/macros/PlotImpParResVsPt.C
PWGPP/macros/rawmerge.C
PYTHIA6/QPYTHIA/qgrid
PYTHIA8/pythia8170/examples/softsusy.spc
PYTHIA8/pythia8170/htmldoc/pythia.css
PYTHIA8/pythia8170/phpdoc/pythia.css
PYTHIA8/pythia8175/examples/softsusy.spc
PYTHIA8/pythia8175/htmldoc/pythia.css
PYTHIA8/pythia8175/include/History.h
PYTHIA8/pythia8175/phpdoc/pythia.css
RAW/AliCaloFastAltroFitv0.h
STEER/AOD/AliAODPWG4Particle.cxx
STEER/CDB/AliCDBHandler.cxx
STEER/ESD/AliESDACORDE.cxx
STEER/ESD/AliESDACORDE.h
STEER/ESD/AliTriggerScalersESD.cxx
STEER/ESD/AliTriggerScalersESD.h
STEER/ESD/AliTriggerScalersRecordESD.cxx
STEER/ESD/AliTriggerScalersRecordESD.h
STEER/STEER/AliGRPObject.h
STEER/STEER/AliLHCData.cxx
STEER/STEER/AliLHCData.h
T0/AliT0CalibAnalysisTask.h
T0/AliT0CalibOffsetChannelsTask.cxx
T0/AliT0CalibOffsetChannelsTask.h
T0/AliT0HIanalysisTask.h
TEvtGen/EvtGen/DecayTable/BTOD.DEC
TOF/AliTOFCableLengthMap.h
TOF/AliTOFChannelOnlineStatus.h
TOF/AliTOFDaConfigHandler.old.cxx
TOF/AliTOFNoiseConfigHandler.cxx
TPC/Calib/AliTPCCalibKr.cxx
TPC/Calib/AliTPCCalibKr.h
TPC/FindKrClusters.C
TPC/FindKrClustersRaw.C
TPC/Rec/AliTPCclustererKr.cxx
TPC/Rec/AliTPCclustererKr.h
TPC/doc/Definitions/naming_convention.tex
TPC/doc/calib/clusterParam/clusterParam.tex
TPC/scripts/calibPassX/recPass0GSI.C
TRD/AliTRDSaxHandler.cxx
TRD/AliTRDarrayDictionary.h
TRD/AliTRDtrackingSector.cxx
TRD/AliTRDtrackletBase.h
TRD/Cal/AliTRDCalDCSFEE.cxx
TRD/Cal/AliTRDCalDCSFEE.h
TRD/Cal/AliTRDCalDCSFEEv2.cxx
TRD/Cal/AliTRDCalDCSFEEv2.h
TRD/Cal/AliTRDmakeRecoParamFirstPhysics.C
TRD/Cal/AliTRDmakeTrkDB.C
TRD/Cal/AliTRDplotNoiseBaseline.C
TRD/Macros/AliTRDcheckConfig.C
TRD/doc/alicedefs.tex
TRD/doc/plots/trgsim_ov.eps
TUHKMgen/UHKM/EquationSolver.icc
VZERO/AliVZERODataFEE.cxx
VZERO/AliVZERODataFEE.h
VZERO/AliVZEROLogicalSignal.cxx
VZERO/AliVZEROLogicalSignal.h
VZERO/AliVZEROTrending.cxx
VZERO/AliVZEROTrending.h
VZERO/AliVZEROTriggerData.cxx
VZERO/AliVZEROTriggerData.h
VZERO/AliVZEROTriggerSimulator.cxx
VZERO/AliVZEROTriggerSimulator.h
ZDC/AliZDCQADataMakerSim.cxx
ZDC/AliZDCQADataMakerSim.h
ZDC/ZDCMAPPINGda.cxx

index 3fdd212..ecf9f07 100755 (executable)
-/**************************************************************************\r
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
- *                                                                        *\r
- * Author: The ALICE Off-line Project.                                    *\r
- * Contributors are mentioned in the code where appropriate.              *\r
- *                                                                        *\r
- * Permission to use, copy, modify and distribute this software and its   *\r
- * documentation strictly for non-commercial purposes is hereby granted   *\r
- * without fee, provided that the above copyright notice appears in all   *\r
- * copies and that both the copyright notice and this permission notice   *\r
- * appear in the supporting documentation. The authors make no claims     *\r
- * about the suitability of this software for any purpose. It is          *\r
- * provided "as is" without express or implied warranty.                  *\r
- **************************************************************************/\r
-//---\r
-//  Produces the data needed to calculate the quality assurance. \r
-//  All data must be mergeable objects.\r
-\r
-\r
-//  Authors:\r
-//\r
-//  Luciano Diaz Gonzalez <luciano.diaz@nucleares.unam.mx> (ICN-UNAM)\r
-//  Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch> (FCFM-BUAP)\r
-//  Arturo Fernandez Tellez <afernan@mail.cern.ch (FCFM-BUAP)\r
-//\r
-//  Created: June 13th 2008\r
-//---\r
-// Last update: Sept. 29th. 2011 (by Mario RC: mrodrigu@mail.cern.ch) \r
-//     --> ACOMultiSL0_DQM_Shifter filling histogram fixed\r
-//     --> Expert histogram updated: 2 histograms (Checks the hits for SL0 and AMU mode)\r
-//     --> To be include in the next update: threshold settings from AliACORDEQAThreshold class (not yet)\r
-// Last update: May 5th. 2011 (by Mario RC: mrodrigu@mail.cern.ch) -->Creates QA expert histograms \r
-// and QA-shifter histograms also with threshold lines and visual alarm\r
-// Last Update: Aug. 27th 2008 --> Implementation to declare QA expert histogram\r
-// Last update: Nov. 14t 2009 --> MRC <mrodrigu@mail.cern.ch> (FCFM-BUAP) \r
-//                     |--> Change in Multiplicity histogram for AMORE (to detect empty triggers events of ACORDE)\r
-\r
-\r
-\r
-// --- ROOT system ---\r
-#include <TClonesArray.h>\r
-#include <TFile.h> \r
-#include <TH1F.h> \r
-#include <TDirectory.h>\r
-#include <TPaveText.h>\r
-// --- Standard library ---\r
-\r
-// --- AliRoot header files ---\r
-#include "AliESDEvent.h"\r
-#include "AliLog.h"\r
-#include "AliACORDEdigit.h" \r
-#include "AliACORDEhit.h"\r
-#include "AliACORDEQADataMakerRec.h"\r
-#include "AliQAChecker.h"\r
-#include "AliACORDERawReader.h"\r
-#include "AliACORDERawStream.h"\r
-ClassImp(AliACORDEQADataMakerRec)\r
-           \r
-//____________________________________________________________________________ \r
- AliACORDEQADataMakerRec::AliACORDEQADataMakerRec():AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kACORDE), "ACORDE Quality Assurance Data Maker")\r
-{\r
-\r
-}\r
-//____________________________________________________________________________ \r
-AliACORDEQADataMakerRec::AliACORDEQADataMakerRec(const AliACORDEQADataMakerRec& qadm):\r
-  AliQADataMakerRec()\r
-{\r
-  SetName((const char*)qadm.GetName()) ; \r
-  SetTitle((const char*)qadm.GetTitle()); \r
-}\r
-\r
-//__________________________________________________________________\r
-AliACORDEQADataMakerRec::~AliACORDEQADataMakerRec()\r
-{\r
-}\r
-\r
-//__________________________________________________________________\r
-AliACORDEQADataMakerRec& AliACORDEQADataMakerRec::operator = (const AliACORDEQADataMakerRec& qadm )\r
-{\r
-  // Equal operator.\r
-  this->~AliACORDEQADataMakerRec();\r
-  new(this) AliACORDEQADataMakerRec(qadm);\r
-  return *this;\r
-}\r
-//____________________________________________________________________________\r
-void AliACORDEQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)\r
-{\r
-  //Detector specific actions at end of cycle\r
-  // do the QA checking\r
-  ResetEventTrigClasses(); // reset triggers list to select all histos\r
-  // Update for DQM GUI\r
-  //\r
-\r
-  for (Int_t specie = 0; specie < AliRecoParam::kNSpecies ; specie++) {\r
-    if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) ) continue ;\r
-    // \r
-    // RS Set event specie\r
-    SetEventSpecie(AliRecoParam::ConvertIndex(specie));\r
-    //\r
-    for (int itc=-1;itc<GetNTrigClasses();itc++) { // RS Loop over the trigger classes\r
-      //\r
-       TObjArray * parr = GetRawsDataOfTrigClass(itc);\r
-       if (!parr) continue;\r
-       TObjArray &harr = *parr;\r
-       TH1* h0 = (TH1*)harr[0];\r
-       TH1* h2 = (TH1*)harr[2];\r
-       if (!h0 || !h2) continue;\r
-\r
-       Double_t integralSL0 = 0;\r
-       Double_t integralAMU = 0;\r
-\r
-       if ((itc==-1) && ( (integralAMU=h2->Integral()==0) || (integralSL0=h0->Integral()==0) ) ) continue;\r
-\r
-       Float_t maxSL0 = 1*h0->GetMaximum();\r
-       Float_t scaleSL0 = 0.;\r
-       if (maxSL0!=0) scaleSL0 = 1/maxSL0;\r
-       else scaleSL0 = 1.;\r
-       h0->Scale(scaleSL0);\r
-\r
-\r
-       Float_t maxAMU = 1*h2->GetMaximum();\r
-       Float_t scaleAMU = 0.;\r
-       if (maxAMU!=0) scaleAMU = 1/maxAMU;\r
-       else scaleAMU = 1.;\r
-       h2->Scale(scaleAMU);\r
-      \r
-       Int_t indexActiveModuleSL0 = 0;\r
-       Int_t indexActiveModuleAMU = 0;\r
-\r
-       for(Int_t iModule = 0; iModule < 60; iModule++){\r
-               if (h0->GetBinContent(iModule) > 0) indexActiveModuleSL0++;\r
-               if (h2->GetBinContent(iModule) > 0) indexActiveModuleAMU++;\r
-       }\r
-       \r
-       Float_t meanHitsSL0 = 0.;\r
-       Float_t meanHitsAMU = 0.;\r
-       //if ((indexActiveModuleSL0==0) || (indexActiveModuleAMU == 0)) continue;\r
-       if (indexActiveModuleAMU == 0) continue;\r
-\r
-       meanHitsSL0 = h0->Integral()/indexActiveModuleSL0;\r
-       meanHitsAMU = h2->Integral()/indexActiveModuleAMU;\r
-\r
-       TH1* h6 = (TH1*)harr[6];\r
-       //TH1* h7 = (TH1*)harr[7];\r
-\r
-       //Int_t goodModulesSL0 = 0;\r
-       //Int_t badModulesSL0 = 0;\r
-       Int_t goodModulesAMU = 0;\r
-       Int_t badModulesAMU = 0;\r
-\r
-       for (Int_t imod = 0; imod < 60; imod++)\r
-       {\r
-               //if (TMath::Abs(h0->GetBinContent(imod)/meanHitsSL0-1) < 0.65) goodModulesSL0++;\r
-               //else badModulesSL0++;\r
-               if (meanHitsAMU!=0)\r
-               {\r
-                       if (TMath::Abs(h2->GetBinContent(imod)/meanHitsAMU-1) <= 0.90) goodModulesAMU++;\r
-                       else badModulesAMU++;\r
-               }\r
-\r
-       }\r
-       h6->Fill(1,goodModulesAMU);\r
-       h6->Fill(2,badModulesAMU);\r
-\r
-       Float_t maxMod = 1*h6->GetMaximum();\r
-       Float_t scaleMaxMod = 0;\r
-       if (maxMod!=0) scaleMaxMod = 1./maxMod;\r
-       else scaleMaxMod = 0;\r
-       h6->Scale(scaleMaxMod);\r
-\r
-        TH1* h4 = (TH1*)harr[4];\r
-        TH1* h5 = (TH1*)harr[5];\r
-\r
-       if (h4 && h5 && meanHitsAMU!=0 && meanHitsSL0!=0){\r
-               for (Int_t iModule = 0; iModule < 60; iModule++){\r
-                       h4->Fill(h0->GetBinContent(iModule)/meanHitsSL0-1);\r
-                       h5->Fill(h2->GetBinContent(iModule)/meanHitsAMU-1);\r
-               }\r
-       }\r
-\r
-    } // end of trigger classes loop\r
-  } // end specie loop\r
-  // QA Checker standar (to be updated)\r
-  //\r
-  AliQAChecker::Instance()->Run(AliQAv1::kACORDE, task, list) ;\r
-}\r
-\r
-//____________________________________________________________________________\r
-void AliACORDEQADataMakerRec::StartOfDetectorCycle()\r
-{\r
-  //Detector specific actions at start of cycle\r
-\r
-}\r
\r
-//____________________________________________________________________________ \r
-void AliACORDEQADataMakerRec::InitRaws()\r
-{\r
-  // create Raw histograms in Raw subdir\r
-\r
-       const Bool_t expert   = kTRUE ; \r
-       const Bool_t saveCorr = kTRUE ; \r
-       const Bool_t image    = kTRUE ; \r
-       TH1F * fhACORDEBitPatternDQM = new TH1F("ACOHitsSL0_DQM_Shifter","Distribution of ACORDE fired modules for DQM shifter; No. of module; Counts",60,-0.5,59.5);// Hits histogram for QA-shifter ACO-SL0 trigger mode\r
-        TH1F * fhACORDEMultiplicitySL0DQM = new TH1F("ACOMultiSL0_DQM_Shifter","Multiplicity of ACORDE fired modules for DQM shifter; No. of fired modules; No. of events",62,-1,60); // Multiplicity histo. for QA-shifter ACO-SL0 trigger mode\r
-        TH1F * fhACORDEBitPatternAMUDQM = new TH1F("ACOHitsAMU_DQM_Shifter","Distribution of ACORDE fired modules for DQM shifter; No. of module; Counts",60,-0.5,59.5);// Hits histogram for QA-shifter ACO-SL0 trigger mode\r
-        TH1F * fhACORDEMultiplicityAMUDQM = new TH1F("ACOMultiAMU_DQM_Shifter","Multiplicity of ACORDE fired modules for DQM shifter; No. of fired modules; No. of events",62,-1,60); // Multiplicity histo. for QA-shifter ACO-SL0 trigger mode\r
-        TH1F * fhACORDEBitPatternCheckDQMSL0 = new TH1F("ACOHitsTriggerCheck_DQMExpertSL0","Check the activity of ACORDE's modules; Hits per module/mean of Hits; Counts",100,-3,5); // Check the trigger status of ACORDE (SL0 vs AMU)\r
-        TH1F * fhACORDEBitPatternCheckDQMAMU = new TH1F("ACOHitsTriggerCheck_DQMExpertAMU","Check the activity of ACORDE's modules; Hits per module/mean of Hits; Counts",100,-3,5); // Check the trigger status of ACORDE (SL0 vs AMU)\r
-\r
-  //const char *acoStatus[4]={"O.K.","High","Low","Not O.K."};\r
-  const char *acoStatus[2]={"STABLE RATE","FLUCTUATING RATE"};\r
-\r
-\r
-\r
-       TH1F * fhACORDEStatusAMU_DQM = new TH1F("fhACORDEStatusAMU_DQM","Status of rate for ACORDE's modules (AMU mode)",2,1,3);\r
-       for (Int_t i=0;i<2;i++) \r
-       {\r
-               fhACORDEStatusAMU_DQM->GetXaxis()->SetBinLabel(i+1,acoStatus[i]); \r
-       }\r
-       fhACORDEStatusAMU_DQM->SetYTitle("No. of modules (Norm.)");\r
-\r
-       Add2RawsList(fhACORDEStatusAMU_DQM,6,!expert,image,!saveCorr);\r
-\r
-       fhACORDEStatusAMU_DQM->SetFillColor(kAzure-7);\r
-\r
-\r
-         // Expert histograms\r
-         // Check the hits multiplicity from trigger configuration\r
-         Add2RawsList(fhACORDEBitPatternCheckDQMSL0,4,expert,image,!saveCorr);\r
-         fhACORDEBitPatternCheckDQMSL0->SetFillColor(kOrange);\r
-        Add2RawsList(fhACORDEBitPatternCheckDQMAMU,5,expert,image,!saveCorr);\r
-         fhACORDEBitPatternCheckDQMAMU->SetFillColor(kRed+2);\r
-\r
-       \r
-       // AMORE diplay settings for shifter on GUI\r
\r
-        // For SL0 ACO trigger mode\r
\r
-         Add2RawsList(fhACORDEBitPatternDQM,0,expert,image,!saveCorr);\r
-        ForbidCloning(fhACORDEBitPatternDQM);\r
-         Add2RawsList(fhACORDEMultiplicitySL0DQM,1,expert,image,!saveCorr);\r
-        ForbidCloning(fhACORDEMultiplicitySL0DQM);\r
-\r
-         // For Hits distribution on ACORDE\r
\r
-         fhACORDEBitPatternDQM->SetFillColor(kMagenta+2);\r
\r
-         // For ACORDE Multiplicity distribution of fired modules\r
\r
-         fhACORDEMultiplicitySL0DQM->SetFillColor(kMagenta);\r
\r
-         // For AMU ACO trigger mode\r
\r
-         Add2RawsList(fhACORDEBitPatternAMUDQM,2,expert,image,!saveCorr);\r
-         Add2RawsList(fhACORDEMultiplicityAMUDQM,3,expert,image,!saveCorr);\r
\r
-         // For Hits distribution on ACORDE\r
\r
-         fhACORDEBitPatternAMUDQM->SetFillColor(kViolet+7);\r
\r
-         // For ACORDE Multiplicity distribution of fired modules\r
\r
-         fhACORDEMultiplicityAMUDQM->SetFillColor(kViolet+6);\r
\r
-  //\r
-  ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line\r
-}\r
-\r
-//____________________________________________________________________________ \r
-void AliACORDEQADataMakerRec::InitDigits()\r
-{\r
-  // create Digits histograms in Digits subdir\r
-  \r
-  const Bool_t expert   = kTRUE ; \r
-  const Bool_t image    = kTRUE ; \r
-  TH1F *    fhDigitsModule;\r
-  const char *acoModule[60]={"0_0","0_1","0_2","0_3","0_4","0_5","0_6","0_7","0_8","0_9",\r
-                        "1_0","1_1","1_2","1_3","1_4","1_5","1_6","1_7","1_8","1_9",\r
-                        "2_0","2_1","2_2","2_3","2_4","2_5","2_6","2_7","2_8","2_9",\r
-                        "3_0","3_1","3_2","3_3","3_4","3_5","3_6","3_7","3_8","3_9",\r
-                        "4_0","4_1","4_2","4_3","4_4","4_5","4_6","4_7","4_8","4_9",\r
-                        "5_0","5_1","5_2","5_3","5_4","5_5","5_6","5_7","5_8","5_9"};\r
-\r
-\r
-  fhDigitsModule = new TH1F("ACORDEBitPatternfromDigits","Distribution of ACORDE from DIGITS;Modules;Counts",60,1,60);\r
-  Add2DigitsList(fhDigitsModule,0,!expert,image);\r
-  for (Int_t i=0;i<60;i++) fhDigitsModule->GetXaxis()->SetBinLabel(i+1,acoModule[i]); \r
-  //\r
-  ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line\r
-}\r
-\r
-//____________________________________________________________________________ \r
-\r
-void AliACORDEQADataMakerRec::InitRecPoints()\r
-{\r
-  // create cluster histograms in RecPoint subdir\r
-  // Not needed for ACORDE by now !!!\r
-  //\r
-  ClonePerTrigClass(AliQAv1::kRECPOINTS); // this should be the last line\r
-}\r
-\r
-//____________________________________________________________________________\r
-void AliACORDEQADataMakerRec::InitESDs()\r
-{\r
-  //create ESDs histograms in ESDs subdir\r
-\r
-  const Bool_t expert   = kTRUE ; \r
-  const Bool_t image    = kTRUE ; \r
-  \r
-  TH1F *    fhESDsSingle;\r
-  TH1F *    fhESDsMulti;\r
-  TH1F *       fhESDsMultiplicity;\r
-  const char *acoModule[60]={"0_0","0_1","0_2","0_3","0_4","0_5","0_6","0_7","0_8","0_9",\r
-                        "1_0","1_1","1_2","1_3","1_4","1_5","1_6","1_7","1_8","1_9",\r
-                        "2_0","2_1","2_2","2_3","2_4","2_5","2_6","2_7","2_8","2_9",\r
-                        "3_0","3_1","3_2","3_3","3_4","3_5","3_6","3_7","3_8","3_9",\r
-                        "4_0","4_1","4_2","4_3","4_4","4_5","4_6","4_7","4_8","4_9",\r
-                        "5_0","5_1","5_2","5_3","5_4","5_5","5_6","5_7","5_8","5_9"};\r
-\r
-\r
-   fhESDsSingle = new TH1F("ACORDEBitPatternfromESDsSingle","Distribution of ACORDE fired modules from ESDs-Single;Modules;Counts",60,1,60);\r
-   Add2ESDsList(fhESDsSingle,0,!expert,image);\r
-\r
-   fhESDsMulti = new TH1F("ACORDEBitPatternfromESDsMulti","Distribution of ACORDE fired modules from ESDs-Multi;Modules;Counts",60,1,60);\r
-   Add2ESDsList(fhESDsMulti,1,!expert,image);\r
-   \r
-   fhESDsMultiplicity = new TH1F("ACORDEMultiplicityfromESD","Number of fired ACORDE modules; No. of fired ACORDE modules;No. of events in ACORDE",60,-0.5,60);\r
-   Add2ESDsList(fhESDsMultiplicity,2,!expert,image);   \r
-   for (Int_t i=0;i<60;i++)\r
-   {\r
-       fhESDsSingle->GetXaxis()->SetBinLabel(i+1,acoModule[i]);\r
-       fhESDsMulti->GetXaxis()->SetBinLabel(i+1,acoModule[i]);\r
-   }\r
-   //\r
-   ClonePerTrigClass(AliQAv1::kESDS); // this should be the last line\r
-}\r
-//____________________________________________________________________________\r
-void AliACORDEQADataMakerRec::MakeRaws(AliRawReader* rawReader)\r
-{\r
-  //fills QA histos for RAW\r
-  IncEvCountCycleRaws();\r
-  IncEvCountTotalRaws();\r
-  rawReader->Reset();\r
-  AliACORDERawStream rawStream(rawReader);\r
-  size_t contSingle=0;\r
-  size_t contMulti=0;\r
-  UInt_t dy[4];\r
-\r
-  bool kroSingle[60],kroMulti[60];\r
-  UInt_t tmpDy;\r
-\r
-  for(Int_t m=0;m<60;m++) {kroSingle[m]=0;kroMulti[m]=0;}\r
-\r
-if(rawStream.Next())\r
-{\r
-        dy[0]=rawStream.GetWord(0);\r
-        dy[1]=rawStream.GetWord(1);\r
-        dy[2]=rawStream.GetWord(2);\r
-        dy[3]=rawStream.GetWord(3);\r
-        tmpDy=dy[0];\r
-        for(Int_t r=0;r<30;r++)\r
-        {\r
-                kroSingle[r] = tmpDy & 1;\r
-                tmpDy>>=1;\r
-        }\r
-        tmpDy=dy[1];\r
-        for(Int_t r=30;r<60;r++)\r
-        {\r
-                kroSingle[r] = tmpDy & 1;\r
-                tmpDy>>=1;\r
-        }\r
-        tmpDy=dy[2];\r
-        for(Int_t r=0;r<30;r++)\r
-        {\r
-                kroMulti[r] = tmpDy & 1;\r
-                tmpDy>>=1;\r
-        }\r
-        tmpDy=dy[3];\r
-        for(Int_t r=30;r<60;r++)\r
-        {\r
-                kroMulti[r] = tmpDy & 1;\r
-                tmpDy>>=1;\r
-        }\r
-        contSingle=0;\r
-       contMulti=0;\r
-        for(Int_t r=0;r<60;r++)\r
-        {\r
-                       if(kroSingle[r]==1)\r
-                       {\r
-                         FillRawsData(0,r);\r
-                         //FillRawsData(4,r);\r
-                         contSingle++;\r
-                       }\r
-                       if(kroMulti[r]==1)\r
-                       {\r
-                         FillRawsData(2,r);\r
-                         //FillRawsData(6,r);\r
-                         contMulti++;\r
-                       }\r
-                       \r
-        } \r
-       FillRawsData(1,contSingle); \r
-       FillRawsData(3,contMulti); \r
-       //      FillRawsData(7,contMulti);\r
-}\r
-}\r
-//____________________________________________________________________________\r
-void AliACORDEQADataMakerRec::MakeDigits( TTree *digitsTree)\r
-{\r
-  //fills QA histos for Digits\r
-  IncEvCountCycleDigits();\r
-  IncEvCountTotalDigits();\r
-\r
-  if (fDigitsArray) \r
-    fDigitsArray->Clear() ; \r
-  else \r
-    fDigitsArray = new TClonesArray("AliACORDEdigit",1000);\r
-  TBranch * branch = digitsTree->GetBranch("ACORDEdigit");\r
-  if (!branch) {\r
-    AliWarning("ACORDE branch in Digits Tree not found");\r
-  } else {\r
-    branch->SetAddress(&fDigitsArray);\r
-    for(Int_t track = 0 ; track < branch->GetEntries() ; track++) {\r
-      branch->GetEntry(track);\r
-      for(Int_t idigit = 0 ; idigit < fDigitsArray->GetEntriesFast() ; idigit++) {\r
-        AliACORDEdigit *AcoDigit = (AliACORDEdigit*) fDigitsArray->UncheckedAt(idigit);\r
-        if (!AcoDigit) {\r
-          AliError("The unchecked digit doesn't exist");\r
-          continue ;\r
-        }\r
-        FillDigitsData(0,AcoDigit->GetModule()-1);\r
-      }\r
-    }\r
-  }\r
-}\r
-\r
-//____________________________________________________________________________\r
-void AliACORDEQADataMakerRec::MakeESDs(AliESDEvent * esd)\r
-{\r
-  //fills QA histos for ESD\r
-  IncEvCountCycleESDs();\r
-  IncEvCountTotalESDs();\r
-  //\r
-  AliESDACORDE * fESDACORDE= esd->GetACORDEData();\r
-  Int_t acoMulti=0;\r
-  for(int i=0;i<60;i++)\r
-  {\r
-    if(fESDACORDE->GetHitChannel(i)) \r
-         {\r
-         FillESDsData(0,i+1);\r
-         FillESDsData(1,i+1);\r
-         acoMulti++;\r
-       }\r
-  } FillESDsData(2,acoMulti);\r
-\r
-}\r
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+//---
+//  Produces the data needed to calculate the quality assurance. 
+//  All data must be mergeable objects.
+
+
+//  Authors:
+//
+//  Luciano Diaz Gonzalez <luciano.diaz@nucleares.unam.mx> (ICN-UNAM)
+//  Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch> (FCFM-BUAP)
+//  Arturo Fernandez Tellez <afernan@mail.cern.ch (FCFM-BUAP)
+//
+//  Created: June 13th 2008
+//---
+// Last update: Sept. 29th. 2011 (by Mario RC: mrodrigu@mail.cern.ch) 
+//     --> ACOMultiSL0_DQM_Shifter filling histogram fixed
+//     --> Expert histogram updated: 2 histograms (Checks the hits for SL0 and AMU mode)
+//     --> To be include in the next update: threshold settings from AliACORDEQAThreshold class (not yet)
+// Last update: May 5th. 2011 (by Mario RC: mrodrigu@mail.cern.ch) -->Creates QA expert histograms 
+// and QA-shifter histograms also with threshold lines and visual alarm
+// Last Update: Aug. 27th 2008 --> Implementation to declare QA expert histogram
+// Last update: Nov. 14t 2009 --> MRC <mrodrigu@mail.cern.ch> (FCFM-BUAP) 
+//                     |--> Change in Multiplicity histogram for AMORE (to detect empty triggers events of ACORDE)
+
+
+
+// --- ROOT system ---
+#include <TClonesArray.h>
+#include <TFile.h> 
+#include <TH1F.h> 
+#include <TDirectory.h>
+#include <TPaveText.h>
+// --- Standard library ---
+
+// --- AliRoot header files ---
+#include "AliESDEvent.h"
+#include "AliLog.h"
+#include "AliACORDEdigit.h" 
+#include "AliACORDEhit.h"
+#include "AliACORDEQADataMakerRec.h"
+#include "AliQAChecker.h"
+#include "AliACORDERawReader.h"
+#include "AliACORDERawStream.h"
+ClassImp(AliACORDEQADataMakerRec)
+           
+//____________________________________________________________________________ 
+ AliACORDEQADataMakerRec::AliACORDEQADataMakerRec():AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kACORDE), "ACORDE Quality Assurance Data Maker")
+{
+
+}
+//____________________________________________________________________________ 
+AliACORDEQADataMakerRec::AliACORDEQADataMakerRec(const AliACORDEQADataMakerRec& qadm):
+  AliQADataMakerRec()
+{
+  SetName((const char*)qadm.GetName()) ; 
+  SetTitle((const char*)qadm.GetTitle()); 
+}
+
+//__________________________________________________________________
+AliACORDEQADataMakerRec::~AliACORDEQADataMakerRec()
+{
+}
+
+//__________________________________________________________________
+AliACORDEQADataMakerRec& AliACORDEQADataMakerRec::operator = (const AliACORDEQADataMakerRec& qadm )
+{
+  // Equal operator.
+  this->~AliACORDEQADataMakerRec();
+  new(this) AliACORDEQADataMakerRec(qadm);
+  return *this;
+}
+//____________________________________________________________________________
+void AliACORDEQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
+{
+  //Detector specific actions at end of cycle
+  // do the QA checking
+  ResetEventTrigClasses(); // reset triggers list to select all histos
+  // Update for DQM GUI
+  //
+
+  for (Int_t specie = 0; specie < AliRecoParam::kNSpecies ; specie++) {
+    if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) ) continue ;
+    // 
+    // RS Set event specie
+    SetEventSpecie(AliRecoParam::ConvertIndex(specie));
+    //
+    for (int itc=-1;itc<GetNTrigClasses();itc++) { // RS Loop over the trigger classes
+      //
+       TObjArray * parr = GetRawsDataOfTrigClass(itc);
+       if (!parr) continue;
+       TObjArray &harr = *parr;
+       TH1* h0 = (TH1*)harr[0];
+       TH1* h2 = (TH1*)harr[2];
+       if (!h0 || !h2) continue;
+
+       Double_t integralSL0 = 0;
+       Double_t integralAMU = 0;
+
+       if ((itc==-1) && ( (integralAMU=h2->Integral()==0) || (integralSL0=h0->Integral()==0) ) ) continue;
+
+       Float_t maxSL0 = 1*h0->GetMaximum();
+       Float_t scaleSL0 = 0.;
+       if (maxSL0!=0) scaleSL0 = 1/maxSL0;
+       else scaleSL0 = 1.;
+       h0->Scale(scaleSL0);
+
+
+       Float_t maxAMU = 1*h2->GetMaximum();
+       Float_t scaleAMU = 0.;
+       if (maxAMU!=0) scaleAMU = 1/maxAMU;
+       else scaleAMU = 1.;
+       h2->Scale(scaleAMU);
+      
+       Int_t indexActiveModuleSL0 = 0;
+       Int_t indexActiveModuleAMU = 0;
+
+       for(Int_t iModule = 0; iModule < 60; iModule++){
+               if (h0->GetBinContent(iModule) > 0) indexActiveModuleSL0++;
+               if (h2->GetBinContent(iModule) > 0) indexActiveModuleAMU++;
+       }
+       
+       Float_t meanHitsSL0 = 0.;
+       Float_t meanHitsAMU = 0.;
+       //if ((indexActiveModuleSL0==0) || (indexActiveModuleAMU == 0)) continue;
+       if (indexActiveModuleAMU == 0) continue;
+
+       meanHitsSL0 = h0->Integral()/indexActiveModuleSL0;
+       meanHitsAMU = h2->Integral()/indexActiveModuleAMU;
+
+       TH1* h6 = (TH1*)harr[6];
+       //TH1* h7 = (TH1*)harr[7];
+
+       //Int_t goodModulesSL0 = 0;
+       //Int_t badModulesSL0 = 0;
+       Int_t goodModulesAMU = 0;
+       Int_t badModulesAMU = 0;
+
+       for (Int_t imod = 0; imod < 60; imod++)
+       {
+               //if (TMath::Abs(h0->GetBinContent(imod)/meanHitsSL0-1) < 0.65) goodModulesSL0++;
+               //else badModulesSL0++;
+               if (meanHitsAMU!=0)
+               {
+                       if (TMath::Abs(h2->GetBinContent(imod)/meanHitsAMU-1) <= 0.90) goodModulesAMU++;
+                       else badModulesAMU++;
+               }
+
+       }
+       h6->Fill(1,goodModulesAMU);
+       h6->Fill(2,badModulesAMU);
+
+       Float_t maxMod = 1*h6->GetMaximum();
+       Float_t scaleMaxMod = 0;
+       if (maxMod!=0) scaleMaxMod = 1./maxMod;
+       else scaleMaxMod = 0;
+       h6->Scale(scaleMaxMod);
+
+        TH1* h4 = (TH1*)harr[4];
+        TH1* h5 = (TH1*)harr[5];
+
+       if (h4 && h5 && meanHitsAMU!=0 && meanHitsSL0!=0){
+               for (Int_t iModule = 0; iModule < 60; iModule++){
+                       h4->Fill(h0->GetBinContent(iModule)/meanHitsSL0-1);
+                       h5->Fill(h2->GetBinContent(iModule)/meanHitsAMU-1);
+               }
+       }
+
+    } // end of trigger classes loop
+  } // end specie loop
+  // QA Checker standar (to be updated)
+  //
+  AliQAChecker::Instance()->Run(AliQAv1::kACORDE, task, list) ;
+}
+
+//____________________________________________________________________________
+void AliACORDEQADataMakerRec::StartOfDetectorCycle()
+{
+  //Detector specific actions at start of cycle
+
+}
+//____________________________________________________________________________ 
+void AliACORDEQADataMakerRec::InitRaws()
+{
+  // create Raw histograms in Raw subdir
+
+       const Bool_t expert   = kTRUE ; 
+       const Bool_t saveCorr = kTRUE ; 
+       const Bool_t image    = kTRUE ; 
+       TH1F * fhACORDEBitPatternDQM = new TH1F("ACOHitsSL0_DQM_Shifter","Distribution of ACORDE fired modules for DQM shifter; No. of module; Counts",60,-0.5,59.5);// Hits histogram for QA-shifter ACO-SL0 trigger mode
+        TH1F * fhACORDEMultiplicitySL0DQM = new TH1F("ACOMultiSL0_DQM_Shifter","Multiplicity of ACORDE fired modules for DQM shifter; No. of fired modules; No. of events",62,-1,60); // Multiplicity histo. for QA-shifter ACO-SL0 trigger mode
+        TH1F * fhACORDEBitPatternAMUDQM = new TH1F("ACOHitsAMU_DQM_Shifter","Distribution of ACORDE fired modules for DQM shifter; No. of module; Counts",60,-0.5,59.5);// Hits histogram for QA-shifter ACO-SL0 trigger mode
+        TH1F * fhACORDEMultiplicityAMUDQM = new TH1F("ACOMultiAMU_DQM_Shifter","Multiplicity of ACORDE fired modules for DQM shifter; No. of fired modules; No. of events",62,-1,60); // Multiplicity histo. for QA-shifter ACO-SL0 trigger mode
+        TH1F * fhACORDEBitPatternCheckDQMSL0 = new TH1F("ACOHitsTriggerCheck_DQMExpertSL0","Check the activity of ACORDE's modules; Hits per module/mean of Hits; Counts",100,-3,5); // Check the trigger status of ACORDE (SL0 vs AMU)
+        TH1F * fhACORDEBitPatternCheckDQMAMU = new TH1F("ACOHitsTriggerCheck_DQMExpertAMU","Check the activity of ACORDE's modules; Hits per module/mean of Hits; Counts",100,-3,5); // Check the trigger status of ACORDE (SL0 vs AMU)
+
+  //const char *acoStatus[4]={"O.K.","High","Low","Not O.K."};
+  const char *acoStatus[2]={"STABLE RATE","FLUCTUATING RATE"};
+
+
+
+       TH1F * fhACORDEStatusAMU_DQM = new TH1F("fhACORDEStatusAMU_DQM","Status of rate for ACORDE's modules (AMU mode)",2,1,3);
+       for (Int_t i=0;i<2;i++) 
+       {
+               fhACORDEStatusAMU_DQM->GetXaxis()->SetBinLabel(i+1,acoStatus[i]); 
+       }
+       fhACORDEStatusAMU_DQM->SetYTitle("No. of modules (Norm.)");
+
+       Add2RawsList(fhACORDEStatusAMU_DQM,6,!expert,image,!saveCorr);
+
+       fhACORDEStatusAMU_DQM->SetFillColor(kAzure-7);
+
+
+         // Expert histograms
+         // Check the hits multiplicity from trigger configuration
+         Add2RawsList(fhACORDEBitPatternCheckDQMSL0,4,expert,image,!saveCorr);
+         fhACORDEBitPatternCheckDQMSL0->SetFillColor(kOrange);
+        Add2RawsList(fhACORDEBitPatternCheckDQMAMU,5,expert,image,!saveCorr);
+         fhACORDEBitPatternCheckDQMAMU->SetFillColor(kRed+2);
+
+       
+       // AMORE diplay settings for shifter on GUI
+        // For SL0 ACO trigger mode
+         Add2RawsList(fhACORDEBitPatternDQM,0,expert,image,!saveCorr);
+        ForbidCloning(fhACORDEBitPatternDQM);
+         Add2RawsList(fhACORDEMultiplicitySL0DQM,1,expert,image,!saveCorr);
+        ForbidCloning(fhACORDEMultiplicitySL0DQM);
+
+         // For Hits distribution on ACORDE
+         fhACORDEBitPatternDQM->SetFillColor(kMagenta+2);
+         // For ACORDE Multiplicity distribution of fired modules
+         fhACORDEMultiplicitySL0DQM->SetFillColor(kMagenta);
+         // For AMU ACO trigger mode
+         Add2RawsList(fhACORDEBitPatternAMUDQM,2,expert,image,!saveCorr);
+         Add2RawsList(fhACORDEMultiplicityAMUDQM,3,expert,image,!saveCorr);
+         // For Hits distribution on ACORDE
+         fhACORDEBitPatternAMUDQM->SetFillColor(kViolet+7);
+         // For ACORDE Multiplicity distribution of fired modules
+         fhACORDEMultiplicityAMUDQM->SetFillColor(kViolet+6);
+  //
+  ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line
+}
+
+//____________________________________________________________________________ 
+void AliACORDEQADataMakerRec::InitDigits()
+{
+  // create Digits histograms in Digits subdir
+  
+  const Bool_t expert   = kTRUE ; 
+  const Bool_t image    = kTRUE ; 
+  TH1F *    fhDigitsModule;
+  const char *acoModule[60]={"0_0","0_1","0_2","0_3","0_4","0_5","0_6","0_7","0_8","0_9",
+                        "1_0","1_1","1_2","1_3","1_4","1_5","1_6","1_7","1_8","1_9",
+                        "2_0","2_1","2_2","2_3","2_4","2_5","2_6","2_7","2_8","2_9",
+                        "3_0","3_1","3_2","3_3","3_4","3_5","3_6","3_7","3_8","3_9",
+                        "4_0","4_1","4_2","4_3","4_4","4_5","4_6","4_7","4_8","4_9",
+                        "5_0","5_1","5_2","5_3","5_4","5_5","5_6","5_7","5_8","5_9"};
+
+
+  fhDigitsModule = new TH1F("ACORDEBitPatternfromDigits","Distribution of ACORDE from DIGITS;Modules;Counts",60,1,60);
+  Add2DigitsList(fhDigitsModule,0,!expert,image);
+  for (Int_t i=0;i<60;i++) fhDigitsModule->GetXaxis()->SetBinLabel(i+1,acoModule[i]); 
+  //
+  ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line
+}
+
+//____________________________________________________________________________ 
+
+void AliACORDEQADataMakerRec::InitRecPoints()
+{
+  // create cluster histograms in RecPoint subdir
+  // Not needed for ACORDE by now !!!
+  //
+  ClonePerTrigClass(AliQAv1::kRECPOINTS); // this should be the last line
+}
+
+//____________________________________________________________________________
+void AliACORDEQADataMakerRec::InitESDs()
+{
+  //create ESDs histograms in ESDs subdir
+
+  const Bool_t expert   = kTRUE ; 
+  const Bool_t image    = kTRUE ; 
+  
+  TH1F *    fhESDsSingle;
+  TH1F *    fhESDsMulti;
+  TH1F *       fhESDsMultiplicity;
+  const char *acoModule[60]={"0_0","0_1","0_2","0_3","0_4","0_5","0_6","0_7","0_8","0_9",
+                        "1_0","1_1","1_2","1_3","1_4","1_5","1_6","1_7","1_8","1_9",
+                        "2_0","2_1","2_2","2_3","2_4","2_5","2_6","2_7","2_8","2_9",
+                        "3_0","3_1","3_2","3_3","3_4","3_5","3_6","3_7","3_8","3_9",
+                        "4_0","4_1","4_2","4_3","4_4","4_5","4_6","4_7","4_8","4_9",
+                        "5_0","5_1","5_2","5_3","5_4","5_5","5_6","5_7","5_8","5_9"};
+
+
+   fhESDsSingle = new TH1F("ACORDEBitPatternfromESDsSingle","Distribution of ACORDE fired modules from ESDs-Single;Modules;Counts",60,1,60);
+   Add2ESDsList(fhESDsSingle,0,!expert,image);
+
+   fhESDsMulti = new TH1F("ACORDEBitPatternfromESDsMulti","Distribution of ACORDE fired modules from ESDs-Multi;Modules;Counts",60,1,60);
+   Add2ESDsList(fhESDsMulti,1,!expert,image);
+   
+   fhESDsMultiplicity = new TH1F("ACORDEMultiplicityfromESD","Number of fired ACORDE modules; No. of fired ACORDE modules;No. of events in ACORDE",60,-0.5,60);
+   Add2ESDsList(fhESDsMultiplicity,2,!expert,image);   
+   for (Int_t i=0;i<60;i++)
+   {
+       fhESDsSingle->GetXaxis()->SetBinLabel(i+1,acoModule[i]);
+       fhESDsMulti->GetXaxis()->SetBinLabel(i+1,acoModule[i]);
+   }
+   //
+   ClonePerTrigClass(AliQAv1::kESDS); // this should be the last line
+}
+//____________________________________________________________________________
+void AliACORDEQADataMakerRec::MakeRaws(AliRawReader* rawReader)
+{
+  //fills QA histos for RAW
+  IncEvCountCycleRaws();
+  IncEvCountTotalRaws();
+  rawReader->Reset();
+  AliACORDERawStream rawStream(rawReader);
+  size_t contSingle=0;
+  size_t contMulti=0;
+  UInt_t dy[4];
+
+  bool kroSingle[60],kroMulti[60];
+  UInt_t tmpDy;
+
+  for(Int_t m=0;m<60;m++) {kroSingle[m]=0;kroMulti[m]=0;}
+
+if(rawStream.Next())
+{
+        dy[0]=rawStream.GetWord(0);
+        dy[1]=rawStream.GetWord(1);
+        dy[2]=rawStream.GetWord(2);
+        dy[3]=rawStream.GetWord(3);
+        tmpDy=dy[0];
+        for(Int_t r=0;r<30;r++)
+        {
+                kroSingle[r] = tmpDy & 1;
+                tmpDy>>=1;
+        }
+        tmpDy=dy[1];
+        for(Int_t r=30;r<60;r++)
+        {
+                kroSingle[r] = tmpDy & 1;
+                tmpDy>>=1;
+        }
+        tmpDy=dy[2];
+        for(Int_t r=0;r<30;r++)
+        {
+                kroMulti[r] = tmpDy & 1;
+                tmpDy>>=1;
+        }
+        tmpDy=dy[3];
+        for(Int_t r=30;r<60;r++)
+        {
+                kroMulti[r] = tmpDy & 1;
+                tmpDy>>=1;
+        }
+        contSingle=0;
+       contMulti=0;
+        for(Int_t r=0;r<60;r++)
+        {
+                       if(kroSingle[r]==1)
+                       {
+                         FillRawsData(0,r);
+                         //FillRawsData(4,r);
+                         contSingle++;
+                       }
+                       if(kroMulti[r]==1)
+                       {
+                         FillRawsData(2,r);
+                         //FillRawsData(6,r);
+                         contMulti++;
+                       }
+                       
+        } 
+       FillRawsData(1,contSingle); 
+       FillRawsData(3,contMulti); 
+       //      FillRawsData(7,contMulti);
+}
+}
+//____________________________________________________________________________
+void AliACORDEQADataMakerRec::MakeDigits( TTree *digitsTree)
+{
+  //fills QA histos for Digits
+  IncEvCountCycleDigits();
+  IncEvCountTotalDigits();
+
+  if (fDigitsArray) 
+    fDigitsArray->Clear() ; 
+  else 
+    fDigitsArray = new TClonesArray("AliACORDEdigit",1000);
+  TBranch * branch = digitsTree->GetBranch("ACORDEdigit");
+  if (!branch) {
+    AliWarning("ACORDE branch in Digits Tree not found");
+  } else {
+    branch->SetAddress(&fDigitsArray);
+    for(Int_t track = 0 ; track < branch->GetEntries() ; track++) {
+      branch->GetEntry(track);
+      for(Int_t idigit = 0 ; idigit < fDigitsArray->GetEntriesFast() ; idigit++) {
+        AliACORDEdigit *AcoDigit = (AliACORDEdigit*) fDigitsArray->UncheckedAt(idigit);
+        if (!AcoDigit) {
+          AliError("The unchecked digit doesn't exist");
+          continue ;
+        }
+        FillDigitsData(0,AcoDigit->GetModule()-1);
+      }
+    }
+  }
+}
+
+//____________________________________________________________________________
+void AliACORDEQADataMakerRec::MakeESDs(AliESDEvent * esd)
+{
+  //fills QA histos for ESD
+  IncEvCountCycleESDs();
+  IncEvCountTotalESDs();
+  //
+  AliESDACORDE * fESDACORDE= esd->GetACORDEData();
+  Int_t acoMulti=0;
+  for(int i=0;i<60;i++)
+  {
+    if(fESDACORDE->GetHitChannel(i)) 
+         {
+         FillESDsData(0,i+1);
+         FillESDsData(1,i+1);
+         acoMulti++;
+       }
+  } FillESDsData(2,acoMulti);
+
+}
index c6900f3..d62b19c 100755 (executable)
@@ -90,7 +90,7 @@ Int_t AliACORDERawReader::GetPosition()
 UInt_t AliACORDERawReader::GetNextWord()
 {
 
-  // Returns the next 32 bit word inside the raw data payload.\r
+  // Returns the next 32 bit word inside the raw data payload.
   // The method is supposed to be endian (platform) independent.
 
 
index 92ffc36..80de666 100644 (file)
-/**************************************************************************\r
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
- *                                                                        *\r
- * Author: The ALICE Off-line Project.                                    *\r
- * Contributors are mentioned in the code where appropriate.              *\r
- *                                                                        *\r
- * Permission to use, copy, modify and distribute this software and its   *\r
- * documentation strictly for non-commercial purposes is hereby granted   *\r
- * without fee, provided that the above copyright notice appears in all   *\r
- * copies and that both the copyright notice and this permission notice   *\r
- * appear in the supporting documentation. The authors make no claims     *\r
- * about the suitability of this software for any purpose. It is          *\r
- * provided "as is" without express or implied warranty.                  *\r
- **************************************************************************/\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-//                                                                           //\r
-//  Reads ACORDE DDL raw data from raw data stream                           //\r
-//                                                                           //\r
-///////////////////////////////////////////////////////////////////////////////\r
-\r
-#include "AliACORDERawStream.h"\r
-#include "AliRawReader.h"\r
-#include "AliLog.h"\r
-#include "AliDAQ.h"\r
-#include "AliRawReaderRoot.h"\r
-\r
-ClassImp(AliACORDERawStream)\r
-\r
-//_____________________________________________________________________________\r
-AliACORDERawStream::AliACORDERawStream(AliRawReader* rawReader) :\r
-  fRawReader(rawReader),\r
-  fPosition(-1),\r
-  fData(NULL),\r
-  fDataSize(0)\r
-{\r
-  //\r
-  // Create an object to read ACORDE raw data\r
-  //\r
-  // Created:      04 Feb 2008  Mario Sitta\r
-  //\r
-\r
-  fWord[0] = fWord[1] = fWord[2] = fWord[3] = 0;\r
-\r
-  // Select the raw data corresponding to the ACORDE detector id\r
-//  fRawReader->Reset();\r
-  AliDebug(1,Form("Selecting raw data for detector %d",AliDAQ::DetectorID("ACORDE")));\r
-  fRawReader->Select("ACORDE");\r
-\r
-}\r
-\r
-//_____________________________________________________________________________\r
-AliACORDERawStream::AliACORDERawStream(const AliACORDERawStream &r) :\r
-  TObject(),\r
-  fRawReader(r.fRawReader),\r
-  fPosition(-1),\r
-  fData(NULL),\r
-  fDataSize(0)\r
-{\r
-  // Simple copy constructor\r
-  ((AliACORDERawStream &) r).Copy(*this);\r
-}\r
-\r
-//_____________________________________________________________________________\r
-AliACORDERawStream::~AliACORDERawStream()\r
-{\r
-  // Default destructor\r
-}\r
-\r
-//_____________________________________________________________________________\r
-AliACORDERawStream &AliACORDERawStream::operator=(const AliACORDERawStream &r)\r
-{\r
-  // Simple operator=\r
-  if (this != &r)  ((AliACORDERawStream &) r).Copy(*this);\r
-  return *this;\r
-}\r
-\r
-//_____________________________________________________________________________\r
-void AliACORDERawStream::Reset()\r
-{\r
-  //\r
-  // Reset the raw stream parameters\r
-  //\r
-  // Input:\r
-  //\r
-  // Output:\r
-  //\r
-  // Created:      04 Feb 2008  Mario Sitta\r
-  //\r
-\r
-  fPosition = -1;\r
-  fData = NULL;\r
-\r
-  if (fRawReader) fRawReader->Reset();\r
-}\r
-\r
-//_____________________________________________________________________________\r
-Bool_t AliACORDERawStream::Next()\r
-{\r
-  //\r
-  // Read next digit from the ACORDE raw data stream;\r
-  // return kFALSE in case of error or no digits left\r
-  //\r
-  // Input:\r
-  //\r
-  // Output:\r
-  //\r
-  // Created:      04 Feb 2008  Mario Sitta\r
-  //\r
-\r
-  if (fPosition >= 0) return kFALSE;\r
-\r
-  if (!fRawReader->ReadNextData(fData)) return kFALSE;\r
-  if (fRawReader->GetDataSize() == 0) return kFALSE;\r
-\r
-  fDataSize = fRawReader->GetDataSize();\r
-  if (fDataSize != 16) {\r
-    fRawReader->AddFatalErrorLog(kRawDataSizeErr,Form("size %d != 16",fDataSize));\r
-    AliWarning(Form("Wrong ACORDE raw data size: %d, expected 16 bytes!",fDataSize));\r
-    return kFALSE;\r
-  }\r
-\r
-  fPosition = 0;\r
-\r
-  for (Int_t i=0; i<4; i++)\r
-    fWord[i] = GetNextWord();\r
-\r
-  return kTRUE;\r
-}\r
-\r
-//_____________________________________________________________________________\r
-UInt_t AliACORDERawStream::GetWord(Int_t index) const\r
-{\r
-  //\r
-  // Returns the ``index'' word from ACORDE raw data.\r
-  //\r
-  // Input:\r
-  //         index : the index of the requested word\r
-  // Output:\r
-  //         word  : the 32 bit ``index'' word\r
-  //\r
-  // Created:      12 Feb 2008  Mario Sitta\r
-  //\r
-\r
-  if (index < 0 || index > 3) {\r
-    AliWarning(Form("Wrong word index %d, returning 0",index));\r
-    return 0;\r
-  } else {\r
-    return fWord[index];\r
-  }\r
-  \r
-}\r
-\r
-//_____________________________________________________________________________\r
-UInt_t AliACORDERawStream::GetNextWord()\r
-{\r
-  //\r
-  // Returns the next 32 bit word inside the raw data payload.\r
-  // The method is supposed to be endian (platform) independent.\r
-  //\r
-  // Input:\r
-  //\r
-  // Output:\r
-  //         word : a 32 bit word containing the data\r
-  //\r
-  // Created:      04 Feb 2008  Mario Sitta\r
-  //\r
-\r
-  if (!fData || fPosition < 0)\r
-    AliFatal("Raw data payload buffer is not yet initialized !");\r
-\r
-  UInt_t word = 0;\r
-  word |= fData[fPosition++];\r
-  word |= fData[fPosition++] << 8;\r
-  word |= fData[fPosition++] << 16;\r
-  word |= fData[fPosition++] << 24;\r
-\r
-  return word;\r
-}\r
-\r
-//_____________________________________________________________________________\r
-\r
-Int_t AliACORDERawStream::GetNEvents(char* fileName) \r
-{\r
-       // Returns the Total Number of Events recorded by ACORDE \r
-       // Note: it may be a better way to do it !!\r
-       // Input: fileName to Analyze\r
-       // Output: Number of Total Events (fNEvents) in fileName\r
-       // Created: 25 March 2008\r
-       // Author: Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch>\r
-       \r
-       AliRawReader* rCount = new AliRawReaderRoot(fileName);\r
-       Int_t DyM=0;\r
-       Int_t fNEvents=0;\r
-       while(DyM==0)\r
-       {\r
-       if (!rCount->NextEvent()) DyM=1;\r
-       else fNEvents++;\r
-       }\r
-       delete rCount;\r
-       return fNEvents;\r
-}\r
-\r
-//____________________________________________________________________________\r
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  Reads ACORDE DDL raw data from raw data stream                           //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "AliACORDERawStream.h"
+#include "AliRawReader.h"
+#include "AliLog.h"
+#include "AliDAQ.h"
+#include "AliRawReaderRoot.h"
+
+ClassImp(AliACORDERawStream)
+
+//_____________________________________________________________________________
+AliACORDERawStream::AliACORDERawStream(AliRawReader* rawReader) :
+  fRawReader(rawReader),
+  fPosition(-1),
+  fData(NULL),
+  fDataSize(0)
+{
+  //
+  // Create an object to read ACORDE raw data
+  //
+  // Created:      04 Feb 2008  Mario Sitta
+  //
+
+  fWord[0] = fWord[1] = fWord[2] = fWord[3] = 0;
+
+  // Select the raw data corresponding to the ACORDE detector id
+//  fRawReader->Reset();
+  AliDebug(1,Form("Selecting raw data for detector %d",AliDAQ::DetectorID("ACORDE")));
+  fRawReader->Select("ACORDE");
+
+}
+
+//_____________________________________________________________________________
+AliACORDERawStream::AliACORDERawStream(const AliACORDERawStream &r) :
+  TObject(),
+  fRawReader(r.fRawReader),
+  fPosition(-1),
+  fData(NULL),
+  fDataSize(0)
+{
+  // Simple copy constructor
+  ((AliACORDERawStream &) r).Copy(*this);
+}
+
+//_____________________________________________________________________________
+AliACORDERawStream::~AliACORDERawStream()
+{
+  // Default destructor
+}
+
+//_____________________________________________________________________________
+AliACORDERawStream &AliACORDERawStream::operator=(const AliACORDERawStream &r)
+{
+  // Simple operator=
+  if (this != &r)  ((AliACORDERawStream &) r).Copy(*this);
+  return *this;
+}
+
+//_____________________________________________________________________________
+void AliACORDERawStream::Reset()
+{
+  //
+  // Reset the raw stream parameters
+  //
+  // Input:
+  //
+  // Output:
+  //
+  // Created:      04 Feb 2008  Mario Sitta
+  //
+
+  fPosition = -1;
+  fData = NULL;
+
+  if (fRawReader) fRawReader->Reset();
+}
+
+//_____________________________________________________________________________
+Bool_t AliACORDERawStream::Next()
+{
+  //
+  // Read next digit from the ACORDE raw data stream;
+  // return kFALSE in case of error or no digits left
+  //
+  // Input:
+  //
+  // Output:
+  //
+  // Created:      04 Feb 2008  Mario Sitta
+  //
+
+  if (fPosition >= 0) return kFALSE;
+
+  if (!fRawReader->ReadNextData(fData)) return kFALSE;
+  if (fRawReader->GetDataSize() == 0) return kFALSE;
+
+  fDataSize = fRawReader->GetDataSize();
+  if (fDataSize != 16) {
+    fRawReader->AddFatalErrorLog(kRawDataSizeErr,Form("size %d != 16",fDataSize));
+    AliWarning(Form("Wrong ACORDE raw data size: %d, expected 16 bytes!",fDataSize));
+    return kFALSE;
+  }
+
+  fPosition = 0;
+
+  for (Int_t i=0; i<4; i++)
+    fWord[i] = GetNextWord();
+
+  return kTRUE;
+}
+
+//_____________________________________________________________________________
+UInt_t AliACORDERawStream::GetWord(Int_t index) const
+{
+  //
+  // Returns the ``index'' word from ACORDE raw data.
+  //
+  // Input:
+  //         index : the index of the requested word
+  // Output:
+  //         word  : the 32 bit ``index'' word
+  //
+  // Created:      12 Feb 2008  Mario Sitta
+  //
+
+  if (index < 0 || index > 3) {
+    AliWarning(Form("Wrong word index %d, returning 0",index));
+    return 0;
+  } else {
+    return fWord[index];
+  }
+  
+}
+
+//_____________________________________________________________________________
+UInt_t AliACORDERawStream::GetNextWord()
+{
+  //
+  // Returns the next 32 bit word inside the raw data payload.
+  // The method is supposed to be endian (platform) independent.
+  //
+  // Input:
+  //
+  // Output:
+  //         word : a 32 bit word containing the data
+  //
+  // Created:      04 Feb 2008  Mario Sitta
+  //
+
+  if (!fData || fPosition < 0)
+    AliFatal("Raw data payload buffer is not yet initialized !");
+
+  UInt_t word = 0;
+  word |= fData[fPosition++];
+  word |= fData[fPosition++] << 8;
+  word |= fData[fPosition++] << 16;
+  word |= fData[fPosition++] << 24;
+
+  return word;
+}
+
+//_____________________________________________________________________________
+
+Int_t AliACORDERawStream::GetNEvents(char* fileName) 
+{
+       // Returns the Total Number of Events recorded by ACORDE 
+       // Note: it may be a better way to do it !!
+       // Input: fileName to Analyze
+       // Output: Number of Total Events (fNEvents) in fileName
+       // Created: 25 March 2008
+       // Author: Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch>
+       
+       AliRawReader* rCount = new AliRawReaderRoot(fileName);
+       Int_t DyM=0;
+       Int_t fNEvents=0;
+       while(DyM==0)
+       {
+       if (!rCount->NextEvent()) DyM=1;
+       else fNEvents++;
+       }
+       delete rCount;
+       return fNEvents;
+}
+
+//____________________________________________________________________________
index e417b2b..2c6afb9 100644 (file)
@@ -1,57 +1,57 @@
-#ifndef ALIACORDERAWSTREAM_H\r
-#define ALIACORDERAWSTREAM_H\r
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
- * See cxx source for full Copyright notice                               */\r
-\r
-/* $Id: AliACORDERawStream.h 20210 2007-08-18 08:41:30Z hristov $ */\r
-\r
-///////////////////////////////////////////////////////////////////////////////\r
-//                                                                           //\r
-//  Reads ACORDE DDL raw data from raw data stream                           //\r
-//                                                                           //\r
-///////////////////////////////////////////////////////////////////////////////\r
-\r
-#include "TObject.h"\r
-\r
-class AliRawReader;\r
-\r
-class AliACORDERawStream : public TObject {\r
-\r
- public:\r
-\r
-  AliACORDERawStream(AliRawReader*);\r
-  AliACORDERawStream(const AliACORDERawStream &r); \r
-  virtual ~AliACORDERawStream();\r
-  AliACORDERawStream &operator=(const AliACORDERawStream &r);\r
-  //MRC's part \r
-  Int_t GetNEvents(char* fileName);\r
-  //\r
-  virtual void    Reset();\r
-  virtual Bool_t  Next();\r
-\r
-  Int_t           DataSize() const { return fDataSize; }\r
-  UInt_t          GetWord(Int_t index) const;\r
-\r
-  enum EACORDERawStreamError {\r
-      kRawDataSizeErr = 1\r
-  };\r
-\r
- private:\r
-\r
-  UInt_t          GetNextWord();\r
-\r
-  AliRawReader*   fRawReader;    // object for reading the raw data\r
-  Int_t           fPosition;     // current position in the raw-data payload\r
-  UChar_t*        fData;         // pointer to raw data payload\r
-\r
-  Int_t           fDataSize;     // data size\r
-\r
-  UInt_t          fWord[4];      // data vector\r
-\r
-  ClassDef(AliACORDERawStream,0) // class for reading ACORDE DDL raw data\r
-\r
-};\r
-\r
-typedef AliACORDERawStream AliCRTRawStream; // for backward compatibility\r
-\r
-#endif\r
+#ifndef ALIACORDERAWSTREAM_H
+#define ALIACORDERAWSTREAM_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id: AliACORDERawStream.h 20210 2007-08-18 08:41:30Z hristov $ */
+
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  Reads ACORDE DDL raw data from raw data stream                           //
+//                                                                           //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "TObject.h"
+
+class AliRawReader;
+
+class AliACORDERawStream : public TObject {
+
+ public:
+
+  AliACORDERawStream(AliRawReader*);
+  AliACORDERawStream(const AliACORDERawStream &r); 
+  virtual ~AliACORDERawStream();
+  AliACORDERawStream &operator=(const AliACORDERawStream &r);
+  //MRC's part 
+  Int_t GetNEvents(char* fileName);
+  //
+  virtual void    Reset();
+  virtual Bool_t  Next();
+
+  Int_t           DataSize() const { return fDataSize; }
+  UInt_t          GetWord(Int_t index) const;
+
+  enum EACORDERawStreamError {
+      kRawDataSizeErr = 1
+  };
+
+ private:
+
+  UInt_t          GetNextWord();
+
+  AliRawReader*   fRawReader;    // object for reading the raw data
+  Int_t           fPosition;     // current position in the raw-data payload
+  UChar_t*        fData;         // pointer to raw data payload
+
+  Int_t           fDataSize;     // data size
+
+  UInt_t          fWord[4];      // data vector
+
+  ClassDef(AliACORDERawStream,0) // class for reading ACORDE DDL raw data
+
+};
+
+typedef AliACORDERawStream AliCRTRawStream; // for backward compatibility
+
+#endif
index 5afe80f..c7a3364 100644 (file)
-/**************************************************************************\r
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
- *                                                                        *\r
- * Author: The ALICE Off-line Project.                                    *\r
- * Contributors are mentioned in the code where appropriate.              *\r
- *                                                                        *\r
- * Permission to use, copy, modify and distribute this software and its   *\r
- * documentation strictly for non-commercial purposes is hereby granted   *\r
- * without fee, provided that the above copyright notice appears in all   *\r
- * copies and that both the copyright notice and this permission notice   *\r
- * appear in the supporting documentation. The authors make no claims     *\r
- * about the suitability of this software for any purpose. It is          *\r
- * provided "as is" without express or implied warranty.                  *\r
- **************************************************************************/\r
-\r
-/* $Id: AliACORDEReconstructor.cxx 20956 2007-09-26 14:22:18Z mrodrigu $ */\r
-//////////////////////////////////////////////////////////////////////////////\r
-//                                                                          //\r
-//  Class for ACORDE reconstruction                                         //\r
-//////////////////////////////////////////////////////////////////////////////\r
-\r
-#include "AliRawReader.h"\r
-\r
-#include "AliACORDEReconstructor.h"\r
-#include "AliACORDERawStream.h"\r
-#include "AliESDEvent.h"\r
-#include "AliACORDEdigit.h"\r
-#include "AliACORDERecoParam.h"\r
-\r
-ClassImp(AliACORDEReconstructor)\r
-\r
-AliACORDEReconstructor:: AliACORDEReconstructor():\r
-  AliReconstructor(),\r
-  fESDACORDE(0x0),\r
-  fAcordeRecoParam(0x0),\r
-  fCalibData(0x0),\r
-  fDigitsArray(0)\r
-{\r
-  // Default constructor  \r
-  // Get calibration data\r
-\r
-  fCalibData = GetCalibData();\r
-  fAcordeRecoParam = GetRecoParam();\r
-}\r
-\r
-//_______________________________________________________________________\r
-AliACORDECalibData *AliACORDEReconstructor::GetCalibData() const\r
-{\r
-  return 0x0;\r
-}\r
-//____________________________________________________________________________\r
-AliACORDERecoParam *AliACORDEReconstructor::GetRecoParam() const\r
-{\r
-  return 0x0;\r
-}\r
-//_____________________________________________________________________________\r
-AliACORDEReconstructor& AliACORDEReconstructor::operator = \r
-  (const AliACORDEReconstructor& /*reconstructor*/)\r
-{\r
-// assignment operator\r
-\r
-  Fatal("operator =", "assignment operator not implemented");\r
-  return *this;\r
-}\r
-\r
-//_____________________________________________________________________________\r
-AliACORDEReconstructor::~AliACORDEReconstructor()\r
-{\r
-// destructor\r
-  delete fESDACORDE;\r
-  delete fDigitsArray;\r
-}\r
-\r
-//_____________________________________________________________________________\r
-void AliACORDEReconstructor::Init()\r
-{\r
-// initializer\r
-    fESDACORDE  = new AliESDACORDE;\r
-}\r
-\r
-void AliACORDEReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digitsTree) const\r
-{\r
-\r
-  if (!digitsTree) {\r
-    AliError("No digits tree!");\r
-    return;\r
-  }\r
-\r
-  if (!fDigitsArray)\r
-    fDigitsArray = new TClonesArray("AliACORDEdigit", 60);\r
-\r
-  digitsTree->Branch("ACORDEdigit", &fDigitsArray);\r
-\r
-  rawReader->Reset();\r
-  AliACORDERawStream rawStream(rawReader);\r
-  if (rawStream.Next()) {\r
-    for(Int_t iChannel = 0; iChannel < 60; iChannel++) {\r
-      Int_t  index = iChannel / 30;\r
-      Int_t  bit   = iChannel % 30;\r
-      if (rawStream.GetWord(index) & (1 << bit))\r
-        new ((*fDigitsArray)[fDigitsArray->GetEntriesFast()]) AliACORDEdigit(iChannel,0);\r
-    }\r
-  }\r
-\r
-  digitsTree->Fill();\r
-\r
-  fDigitsArray->Clear();\r
-}\r
-\r
-void AliACORDEReconstructor::FillESD(TTree* digitsTree, TTree* /*clustersTree*/,AliESDEvent* esd) const\r
-{\r
-\r
-  // fills ESD with ACORDE Digits\r
-\r
-  if (!digitsTree)\r
-    {\r
-      AliError("No digits tree!");\r
-      return;\r
-    }\r
-\r
-  TBranch* digitBranch = digitsTree->GetBranch("ACORDEdigit");\r
-  if (!digitBranch) {\r
-    AliError("No ACORDE digits branch found!");\r
-    return;\r
-  }\r
-  digitBranch->SetAddress(&fDigitsArray);\r
-\r
-  digitsTree->GetEvent(0);\r
-\r
-  Bool_t AcoHitSingle[60],AcoHitMulti[60];\r
-  for(Int_t i = 0; i < 60; i++) { AcoHitSingle[i] = AcoHitMulti[i] = kFALSE; }\r
-\r
-  Int_t nDigits = fDigitsArray->GetEntriesFast();\r
-    \r
-  for (Int_t d=0; d<nDigits; d++) {    \r
-    AliACORDEdigit* digit = (AliACORDEdigit*) fDigitsArray->At(d);\r
-    Int_t module = digit->GetModule();\r
-\r
-    AcoHitSingle[module] = kTRUE;\r
-    AcoHitMulti[module] = kTRUE;\r
-  }  \r
-  if (!esd) {\r
-       AliError("NO ACORDE ESD branch found!");\r
-       return;\r
-}\r
-  TString ActiveTriggerDetector = esd->GetFiredTriggerClasses();\r
-  if (ActiveTriggerDetector.Contains("ASL")) fESDACORDE->SetACORDEBitPattern(AcoHitSingle);\r
-  else if (ActiveTriggerDetector.Contains("AMU")) fESDACORDE->SetACORDEBitPattern(AcoHitMulti);\r
-       else fESDACORDE->SetACORDEBitPattern(AcoHitSingle);\r
-\r
-  if (esd)\r
-    {\r
-      AliDebug(1, Form("Writing ACORDE data to ESD Tree"));\r
-      esd->SetACORDEData(fESDACORDE);\r
-    }\r
-\r
-  fDigitsArray->Clear();\r
-}\r
-\r
-\r
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id: AliACORDEReconstructor.cxx 20956 2007-09-26 14:22:18Z mrodrigu $ */
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+//  Class for ACORDE reconstruction                                         //
+//////////////////////////////////////////////////////////////////////////////
+
+#include "AliRawReader.h"
+
+#include "AliACORDEReconstructor.h"
+#include "AliACORDERawStream.h"
+#include "AliESDEvent.h"
+#include "AliACORDEdigit.h"
+#include "AliACORDERecoParam.h"
+
+ClassImp(AliACORDEReconstructor)
+
+AliACORDEReconstructor:: AliACORDEReconstructor():
+  AliReconstructor(),
+  fESDACORDE(0x0),
+  fAcordeRecoParam(0x0),
+  fCalibData(0x0),
+  fDigitsArray(0)
+{
+  // Default constructor  
+  // Get calibration data
+
+  fCalibData = GetCalibData();
+  fAcordeRecoParam = GetRecoParam();
+}
+
+//_______________________________________________________________________
+AliACORDECalibData *AliACORDEReconstructor::GetCalibData() const
+{
+  return 0x0;
+}
+//____________________________________________________________________________
+AliACORDERecoParam *AliACORDEReconstructor::GetRecoParam() const
+{
+  return 0x0;
+}
+//_____________________________________________________________________________
+AliACORDEReconstructor& AliACORDEReconstructor::operator = 
+  (const AliACORDEReconstructor& /*reconstructor*/)
+{
+// assignment operator
+
+  Fatal("operator =", "assignment operator not implemented");
+  return *this;
+}
+
+//_____________________________________________________________________________
+AliACORDEReconstructor::~AliACORDEReconstructor()
+{
+// destructor
+  delete fESDACORDE;
+  delete fDigitsArray;
+}
+
+//_____________________________________________________________________________
+void AliACORDEReconstructor::Init()
+{
+// initializer
+    fESDACORDE  = new AliESDACORDE;
+}
+
+void AliACORDEReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digitsTree) const
+{
+
+  if (!digitsTree) {
+    AliError("No digits tree!");
+    return;
+  }
+
+  if (!fDigitsArray)
+    fDigitsArray = new TClonesArray("AliACORDEdigit", 60);
+
+  digitsTree->Branch("ACORDEdigit", &fDigitsArray);
+
+  rawReader->Reset();
+  AliACORDERawStream rawStream(rawReader);
+  if (rawStream.Next()) {
+    for(Int_t iChannel = 0; iChannel < 60; iChannel++) {
+      Int_t  index = iChannel / 30;
+      Int_t  bit   = iChannel % 30;
+      if (rawStream.GetWord(index) & (1 << bit))
+        new ((*fDigitsArray)[fDigitsArray->GetEntriesFast()]) AliACORDEdigit(iChannel,0);
+    }
+  }
+
+  digitsTree->Fill();
+
+  fDigitsArray->Clear();
+}
+
+void AliACORDEReconstructor::FillESD(TTree* digitsTree, TTree* /*clustersTree*/,AliESDEvent* esd) const
+{
+
+  // fills ESD with ACORDE Digits
+
+  if (!digitsTree)
+    {
+      AliError("No digits tree!");
+      return;
+    }
+
+  TBranch* digitBranch = digitsTree->GetBranch("ACORDEdigit");
+  if (!digitBranch) {
+    AliError("No ACORDE digits branch found!");
+    return;
+  }
+  digitBranch->SetAddress(&fDigitsArray);
+
+  digitsTree->GetEvent(0);
+
+  Bool_t AcoHitSingle[60],AcoHitMulti[60];
+  for(Int_t i = 0; i < 60; i++) { AcoHitSingle[i] = AcoHitMulti[i] = kFALSE; }
+
+  Int_t nDigits = fDigitsArray->GetEntriesFast();
+    
+  for (Int_t d=0; d<nDigits; d++) {    
+    AliACORDEdigit* digit = (AliACORDEdigit*) fDigitsArray->At(d);
+    Int_t module = digit->GetModule();
+
+    AcoHitSingle[module] = kTRUE;
+    AcoHitMulti[module] = kTRUE;
+  }  
+  if (!esd) {
+       AliError("NO ACORDE ESD branch found!");
+       return;
+}
+  TString ActiveTriggerDetector = esd->GetFiredTriggerClasses();
+  if (ActiveTriggerDetector.Contains("ASL")) fESDACORDE->SetACORDEBitPattern(AcoHitSingle);
+  else if (ActiveTriggerDetector.Contains("AMU")) fESDACORDE->SetACORDEBitPattern(AcoHitMulti);
+       else fESDACORDE->SetACORDEBitPattern(AcoHitSingle);
+
+  if (esd)
+    {
+      AliDebug(1, Form("Writing ACORDE data to ESD Tree"));
+      esd->SetACORDEData(fESDACORDE);
+    }
+
+  fDigitsArray->Clear();
+}
+
+
index b8af83b..2d02d01 100644 (file)
@@ -1,93 +1,93 @@
-void MakeACORDEFullMisAlignment(){\r
-  // Create TClonesArray of full misalignment objects for ACORDE\r
-  //\r
-  const char* macroname = "MakeACORDEFullMisAlignment.C";\r
-  // Activate CDB storage and load geometry from CDB\r
-  AliCDBManager* cdb = AliCDBManager::Instance();\r
-  if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");\r
-  cdb->SetRun(0);\r
-  \r
-  AliCDBStorage* storage;\r
-  \r
-  //load geom from local file till ACORDE is not switched on by default in standard config-files\r
-  if( TString(gSystem->Getenv("TOCDB")) == TString("kTRUE") ){\r
-    TString Storage = gSystem->Getenv("STORAGE");\r
-    if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {\r
-      Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());\r
-      return;\r
-    }\r
-    storage = cdb->GetStorage(Storage.Data());\r
-    if(!storage){\r
-      Error(macroname,"Unable to open storage %s\n",Storage.Data());\r
-      return;\r
-    }\r
-    \r
-    AliCDBPath path("GRP","Geometry","Data");\r
-    AliCDBEntry *entry = storage->Get(path.GetPath(),cdb->GetRun());\r
-    if(!entry) Fatal(macroname,"Could not get the specified CDB entry!");\r
-    entry->SetOwner(0);\r
-    TGeoManager* geom = (TGeoManager*) entry->GetObject();\r
-    AliGeomManager::SetGeometry(geom);\r
-  }else{\r
-    AliGeomManager::LoadGeometry(); //load geom from default CDB storage\r
-    \r
-  }\r
-  //  AliGeomManager::LoadGeometry("geometry.root");  \r
-\r
-  TClonesArray *array = new TClonesArray("AliAlignObjParams",60);\r
-  TClonesArray &alobj = *array;\r
-  \r
-  TRandom *rnd = new TRandom(4321);\r
-  Int_t j = 0;\r
-  Double_t dx, dy, dz, dpsi, dtheta, dphi;\r
-\r
-  // RS = local\r
-  // sigma translation = 1 mm\r
-  // sigma rotation = 0.5 degrees\r
-  Double_t sigmatr = 2;\r
-  Double_t sigmarot = 1;\r
-  \r
-  TString symname;\r
-  TString basename = "ACORDE/Array";\r
-  Int_t iIndex=0;\r
-  AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;\r
-  UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);\r
-\r
-  for (Int_t imod=0; imod<60; imod++){\r
-    dx = rnd->Gaus(0.,sigmatr);\r
-    dy = rnd->Gaus(0.,sigmatr);\r
-    dz = rnd->Gaus(0.,sigmatr);\r
-    dpsi = rnd->Gaus(0.,sigmarot);\r
-    dtheta = rnd->Gaus(0.,sigmarot);\r
-    dphi = rnd->Gaus(0.,sigmarot);    \r
-    symname = basename;\r
-    symname += imod;    \r
-    new(alobj[j++]) AliAlignObjParams(symname, volid, dx, dy, dz,dpsi, dtheta, dphi, kFALSE);\r
-  }\r
-\r
-  if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){\r
-    // save on file\r
-    const char* filename = "ACORDEfullMisalignment.root";\r
-    TFile f(filename,"RECREATE");\r
-    if(!f){\r
-      Error(macroname,"cannot open file for output\n");\r
-      return;\r
-    }\r
-    Info(macroname,"Saving alignment objects to the file %s", filename);\r
-    f.cd();\r
-    f.WriteObject(array,"ACORDEAlignObjs","kSingleKey");\r
-    f.Close();\r
-  }else{\r
-    // save in CDB storage\r
-    AliCDBMetaData* md = new AliCDBMetaData();\r
-    md->SetResponsible("E. Cuautle & M. Rodriguez");\r
-    md->SetComment("Full misalignment for ACORDE");\r
-    md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));\r
-    AliCDBId id("ACORDE/Align/Data",0,AliCDBRunRange::Infinity());\r
-    storage->Put(array,id,md);\r
-  }\r
-\r
-  array->Delete();\r
-\r
-}\r
-\r
+void MakeACORDEFullMisAlignment(){
+  // Create TClonesArray of full misalignment objects for ACORDE
+  //
+  const char* macroname = "MakeACORDEFullMisAlignment.C";
+  // Activate CDB storage and load geometry from CDB
+  AliCDBManager* cdb = AliCDBManager::Instance();
+  if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+  cdb->SetRun(0);
+  
+  AliCDBStorage* storage;
+  
+  //load geom from local file till ACORDE is not switched on by default in standard config-files
+  if( TString(gSystem->Getenv("TOCDB")) == TString("kTRUE") ){
+    TString Storage = gSystem->Getenv("STORAGE");
+    if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
+      Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
+      return;
+    }
+    storage = cdb->GetStorage(Storage.Data());
+    if(!storage){
+      Error(macroname,"Unable to open storage %s\n",Storage.Data());
+      return;
+    }
+    
+    AliCDBPath path("GRP","Geometry","Data");
+    AliCDBEntry *entry = storage->Get(path.GetPath(),cdb->GetRun());
+    if(!entry) Fatal(macroname,"Could not get the specified CDB entry!");
+    entry->SetOwner(0);
+    TGeoManager* geom = (TGeoManager*) entry->GetObject();
+    AliGeomManager::SetGeometry(geom);
+  }else{
+    AliGeomManager::LoadGeometry(); //load geom from default CDB storage
+    
+  }
+  //  AliGeomManager::LoadGeometry("geometry.root");  
+
+  TClonesArray *array = new TClonesArray("AliAlignObjParams",60);
+  TClonesArray &alobj = *array;
+  
+  TRandom *rnd = new TRandom(4321);
+  Int_t j = 0;
+  Double_t dx, dy, dz, dpsi, dtheta, dphi;
+
+  // RS = local
+  // sigma translation = 1 mm
+  // sigma rotation = 0.5 degrees
+  Double_t sigmatr = 2;
+  Double_t sigmarot = 1;
+  
+  TString symname;
+  TString basename = "ACORDE/Array";
+  Int_t iIndex=0;
+  AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
+  UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
+
+  for (Int_t imod=0; imod<60; imod++){
+    dx = rnd->Gaus(0.,sigmatr);
+    dy = rnd->Gaus(0.,sigmatr);
+    dz = rnd->Gaus(0.,sigmatr);
+    dpsi = rnd->Gaus(0.,sigmarot);
+    dtheta = rnd->Gaus(0.,sigmarot);
+    dphi = rnd->Gaus(0.,sigmarot);    
+    symname = basename;
+    symname += imod;    
+    new(alobj[j++]) AliAlignObjParams(symname, volid, dx, dy, dz,dpsi, dtheta, dphi, kFALSE);
+  }
+
+  if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
+    // save on file
+    const char* filename = "ACORDEfullMisalignment.root";
+    TFile f(filename,"RECREATE");
+    if(!f){
+      Error(macroname,"cannot open file for output\n");
+      return;
+    }
+    Info(macroname,"Saving alignment objects to the file %s", filename);
+    f.cd();
+    f.WriteObject(array,"ACORDEAlignObjs","kSingleKey");
+    f.Close();
+  }else{
+    // save in CDB storage
+    AliCDBMetaData* md = new AliCDBMetaData();
+    md->SetResponsible("E. Cuautle & M. Rodriguez");
+    md->SetComment("Full misalignment for ACORDE");
+    md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
+    AliCDBId id("ACORDE/Align/Data",0,AliCDBRunRange::Infinity());
+    storage->Put(array,id,md);
+  }
+
+  array->Delete();
+
+}
+
index c8413c9..26bbc45 100644 (file)
@@ -1,94 +1,94 @@
-void MakeACORDEResMisAlignment(){\r
-  // Create TClonesArray of Residual misalignment objects for ACORDE\r
-  //\r
-  const char* macroname = "MakeACORDEResMisAlignment.C";\r
-  // Activate CDB storage and load geometry from CDB\r
-  AliCDBManager* cdb = AliCDBManager::Instance();\r
-  if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");\r
-  cdb->SetRun(0);\r
-  \r
-  AliCDBStorage* storage;\r
-  \r
-  //load geom from local file till ACORDE is not switched on by default in standard config-files\r
-  if( TString(gSystem->Getenv("TOCDB")) == TString("kTRUE") ){\r
-    TString Storage = gSystem->Getenv("STORAGE");\r
-    if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {\r
-      Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());\r
-      return;\r
-    }\r
-    storage = cdb->GetStorage(Storage.Data());\r
-    if(!storage){\r
-      Error(macroname,"Unable to open storage %s\n",Storage.Data());\r
-      return;\r
-    }\r
-    \r
-    AliCDBPath path("GRP","Geometry","Data");\r
-    AliCDBEntry *entry = storage->Get(path.GetPath(),cdb->GetRun());\r
-    if(!entry) Fatal(macroname,"Could not get the specified CDB entry!");\r
-    entry->SetOwner(0);\r
-    TGeoManager* geom = (TGeoManager*) entry->GetObject();\r
-    AliGeomManager::SetGeometry(geom);\r
-  }else{\r
-    AliGeomManager::LoadGeometry(); //load geom from default CDB storage\r
-    \r
-\r
-  }\r
-  //  AliGeomManager::LoadGeometry("geometry.root");  \r
-\r
-  TClonesArray *array = new TClonesArray("AliAlignObjParams",64);\r
-  TClonesArray &alobj = *array;\r
-  \r
-  TRandom *rnd = new TRandom(4321);\r
-  Int_t j = 0;\r
-  Double_t dx, dy, dz, dpsi, dtheta, dphi;\r
-\r
-  // RS = local\r
-  // sigma translation\r
-  // sigma rotation \r
-  Double_t sigmatr = 2;  // max shift in cm\r
-  Double_t sigmarot = 1;  // max rot in degrees\r
-  \r
-  TString symname;\r
-  TString basename = "ACORDE/Array";\r
-  Int_t iIndex=0;\r
-  AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;\r
-  UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);\r
-\r
-  for (Int_t imod=0; imod<60; imod++){\r
-    dx = rnd->Gaus(0.,sigmatr);\r
-    dy = rnd->Gaus(0.,sigmatr);\r
-    dz = rnd->Gaus(0.,sigmatr);\r
-    dpsi = rnd->Gaus(0.,sigmarot);\r
-    dtheta = rnd->Gaus(0.,sigmarot);\r
-    dphi = rnd->Gaus(0.,sigmarot);    \r
-    symname = basename;\r
-    symname += imod;    \r
-    new(alobj[j++]) AliAlignObjParams(symname, volid, dx, dy, dz,dpsi, dtheta, dphi, kFALSE);\r
-  }\r
-\r
-  if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){\r
-    // save on file\r
-    const char* filename = "ACORDEResMisalignment.root";\r
-    TFile f(filename,"RECREATE");\r
-    if(!f){\r
-      Error(macroname,"cannot open file for output\n");\r
-      return;\r
-    }\r
-    Info(macroname,"Saving residual misalignment objects to the file %s", filename);\r
-    f.cd();\r
-    f.WriteObject(array,"ACORDEAlignObjs","kSingleKey");\r
-    f.Close();\r
-  }else{\r
-    // save in CDB storage\r
-    AliCDBMetaData* md = new AliCDBMetaData();\r
-    md->SetResponsible("E. Cuautle & M. Rodriguez ");\r
-    md->SetComment("Residual misalignment for ACORDE");\r
-    md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));\r
-    AliCDBId id("ACORDE/Align/Data",0,AliCDBRunRange::Infinity());\r
-    storage->Put(array,id,md);\r
-  }\r
-\r
-  array->Delete();\r
-\r
-}\r
-\r
+void MakeACORDEResMisAlignment(){
+  // Create TClonesArray of Residual misalignment objects for ACORDE
+  //
+  const char* macroname = "MakeACORDEResMisAlignment.C";
+  // Activate CDB storage and load geometry from CDB
+  AliCDBManager* cdb = AliCDBManager::Instance();
+  if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+  cdb->SetRun(0);
+  
+  AliCDBStorage* storage;
+  
+  //load geom from local file till ACORDE is not switched on by default in standard config-files
+  if( TString(gSystem->Getenv("TOCDB")) == TString("kTRUE") ){
+    TString Storage = gSystem->Getenv("STORAGE");
+    if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
+      Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
+      return;
+    }
+    storage = cdb->GetStorage(Storage.Data());
+    if(!storage){
+      Error(macroname,"Unable to open storage %s\n",Storage.Data());
+      return;
+    }
+    
+    AliCDBPath path("GRP","Geometry","Data");
+    AliCDBEntry *entry = storage->Get(path.GetPath(),cdb->GetRun());
+    if(!entry) Fatal(macroname,"Could not get the specified CDB entry!");
+    entry->SetOwner(0);
+    TGeoManager* geom = (TGeoManager*) entry->GetObject();
+    AliGeomManager::SetGeometry(geom);
+  }else{
+    AliGeomManager::LoadGeometry(); //load geom from default CDB storage
+    
+
+  }
+  //  AliGeomManager::LoadGeometry("geometry.root");  
+
+  TClonesArray *array = new TClonesArray("AliAlignObjParams",64);
+  TClonesArray &alobj = *array;
+  
+  TRandom *rnd = new TRandom(4321);
+  Int_t j = 0;
+  Double_t dx, dy, dz, dpsi, dtheta, dphi;
+
+  // RS = local
+  // sigma translation
+  // sigma rotation 
+  Double_t sigmatr = 2;  // max shift in cm
+  Double_t sigmarot = 1;  // max rot in degrees
+  
+  TString symname;
+  TString basename = "ACORDE/Array";
+  Int_t iIndex=0;
+  AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
+  UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
+
+  for (Int_t imod=0; imod<60; imod++){
+    dx = rnd->Gaus(0.,sigmatr);
+    dy = rnd->Gaus(0.,sigmatr);
+    dz = rnd->Gaus(0.,sigmatr);
+    dpsi = rnd->Gaus(0.,sigmarot);
+    dtheta = rnd->Gaus(0.,sigmarot);
+    dphi = rnd->Gaus(0.,sigmarot);    
+    symname = basename;
+    symname += imod;    
+    new(alobj[j++]) AliAlignObjParams(symname, volid, dx, dy, dz,dpsi, dtheta, dphi, kFALSE);
+  }
+
+  if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
+    // save on file
+    const char* filename = "ACORDEResMisalignment.root";
+    TFile f(filename,"RECREATE");
+    if(!f){
+      Error(macroname,"cannot open file for output\n");
+      return;
+    }
+    Info(macroname,"Saving residual misalignment objects to the file %s", filename);
+    f.cd();
+    f.WriteObject(array,"ACORDEAlignObjs","kSingleKey");
+    f.Close();
+  }else{
+    // save in CDB storage
+    AliCDBMetaData* md = new AliCDBMetaData();
+    md->SetResponsible("E. Cuautle & M. Rodriguez ");
+    md->SetComment("Residual misalignment for ACORDE");
+    md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
+    AliCDBId id("ACORDE/Align/Data",0,AliCDBRunRange::Infinity());
+    storage->Put(array,id,md);
+  }
+
+  array->Delete();
+
+}
+
index 04b7feb..7154a82 100644 (file)
@@ -1,85 +1,85 @@
-void MakeACORDEZeroMisAlignment(){\r
-  // Create TClonesArray of zero misalignment objects for ACORDE\r
-  //\r
-  const char* macroname = "MakeACORDEZeroMisAlignment.C";\r
-  // Activate CDB storage and load geometry from CDB\r
-  AliCDBManager* cdb = AliCDBManager::Instance();\r
-  if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");\r
-  cdb->SetRun(0);\r
-  \r
-  AliCDBStorage* storage;\r
-  \r
-  //load geom from local file till ACORDE is not switched on by default in standard config-files\r
-  if( TString(gSystem->Getenv("TOCDB")) == TString("kTRUE") ){\r
-    TString Storage = gSystem->Getenv("STORAGE");\r
-    if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {\r
-      Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());\r
-      return;\r
-    }\r
-    storage = cdb->GetStorage(Storage.Data());\r
-    if(!storage){\r
-      Error(macroname,"Unable to open storage %s\n",Storage.Data());\r
-      return;\r
-    }\r
-    \r
-    AliCDBPath path("GRP","Geometry","Data");\r
-    AliCDBEntry *entry = storage->Get(path.GetPath(),cdb->GetRun());\r
-    if(!entry) Fatal(macroname,"Could not get the specified CDB entry!");\r
-    entry->SetOwner(0);\r
-    TGeoManager* geom = (TGeoManager*) entry->GetObject();\r
-    AliGeomManager::SetGeometry(geom);\r
-  }else{\r
-    AliGeomManager::LoadGeometry(); //load geom from default CDB storage\r
-    \r
-  }\r
-  //  AliGeomManager::LoadGeometry("geometry.root");  \r
-\r
-  TClonesArray *array = new TClonesArray("AliAlignObjParams",64);\r
-  TClonesArray &alobj = *array;\r
-  \r
-  TRandom *rnd = new TRandom(4321);\r
-  Int_t j = 0;\r
-  Double_t dx=0, dy=0, dz=0, dpsi=0, dtheta=0, dphi=0;\r
-\r
-  // RS = local\r
-  // sigma translation \r
-  // sigma rotation \r
-  \r
-  TString symname;\r
-  TString basename = "ACORDE/Array";\r
-  Int_t iIndex=0;\r
-  AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;\r
-  UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);\r
-\r
-  for (Int_t imod=0; imod<60; imod++){\r
-    symname = basename;\r
-    symname += imod;    \r
-    new(alobj[j++]) AliAlignObjParams(symname, volid, dx, dy, dz,dpsi, dtheta, dphi, kFALSE);\r
-  }\r
-\r
-  if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){\r
-    // save on file\r
-    const char* filename = "ACORDEZeroMisalignment.root";\r
-    TFile f(filename,"RECREATE");\r
-    if(!f){\r
-      Error(macroname,"cannot open file for output\n");\r
-      return;\r
-    }\r
-    Info(macroname,"Saving alignment objects to the file %s", filename);\r
-    f.cd();\r
-    f.WriteObject(array,"ACORDEAlignObjs","kSingleKey");\r
-    f.Close();\r
-  }else{\r
-    // save in CDB storage\r
-    AliCDBMetaData* md = new AliCDBMetaData();\r
-    md->SetResponsible("E. Cuautle & M. Rodriguez");\r
-    md->SetComment("Zero misalignment for ACORDE");\r
-    md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));\r
-    AliCDBId id("ACORDE/Align/Data",0,AliCDBRunRange::Infinity());\r
-    storage->Put(array,id,md);\r
-  }\r
-\r
-  array->Delete();\r
-\r
-}\r
-\r
+void MakeACORDEZeroMisAlignment(){
+  // Create TClonesArray of zero misalignment objects for ACORDE
+  //
+  const char* macroname = "MakeACORDEZeroMisAlignment.C";
+  // Activate CDB storage and load geometry from CDB
+  AliCDBManager* cdb = AliCDBManager::Instance();
+  if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+  cdb->SetRun(0);
+  
+  AliCDBStorage* storage;
+  
+  //load geom from local file till ACORDE is not switched on by default in standard config-files
+  if( TString(gSystem->Getenv("TOCDB")) == TString("kTRUE") ){
+    TString Storage = gSystem->Getenv("STORAGE");
+    if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
+      Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
+      return;
+    }
+    storage = cdb->GetStorage(Storage.Data());
+    if(!storage){
+      Error(macroname,"Unable to open storage %s\n",Storage.Data());
+      return;
+    }
+    
+    AliCDBPath path("GRP","Geometry","Data");
+    AliCDBEntry *entry = storage->Get(path.GetPath(),cdb->GetRun());
+    if(!entry) Fatal(macroname,"Could not get the specified CDB entry!");
+    entry->SetOwner(0);
+    TGeoManager* geom = (TGeoManager*) entry->GetObject();
+    AliGeomManager::SetGeometry(geom);
+  }else{
+    AliGeomManager::LoadGeometry(); //load geom from default CDB storage
+    
+  }
+  //  AliGeomManager::LoadGeometry("geometry.root");  
+
+  TClonesArray *array = new TClonesArray("AliAlignObjParams",64);
+  TClonesArray &alobj = *array;
+  
+  TRandom *rnd = new TRandom(4321);
+  Int_t j = 0;
+  Double_t dx=0, dy=0, dz=0, dpsi=0, dtheta=0, dphi=0;
+
+  // RS = local
+  // sigma translation 
+  // sigma rotation 
+  
+  TString symname;
+  TString basename = "ACORDE/Array";
+  Int_t iIndex=0;
+  AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
+  UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
+
+  for (Int_t imod=0; imod<60; imod++){
+    symname = basename;
+    symname += imod;    
+    new(alobj[j++]) AliAlignObjParams(symname, volid, dx, dy, dz,dpsi, dtheta, dphi, kFALSE);
+  }
+
+  if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
+    // save on file
+    const char* filename = "ACORDEZeroMisalignment.root";
+    TFile f(filename,"RECREATE");
+    if(!f){
+      Error(macroname,"cannot open file for output\n");
+      return;
+    }
+    Info(macroname,"Saving alignment objects to the file %s", filename);
+    f.cd();
+    f.WriteObject(array,"ACORDEAlignObjs","kSingleKey");
+    f.Close();
+  }else{
+    // save in CDB storage
+    AliCDBMetaData* md = new AliCDBMetaData();
+    md->SetResponsible("E. Cuautle & M. Rodriguez");
+    md->SetComment("Zero misalignment for ACORDE");
+    md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
+    AliCDBId id("ACORDE/Align/Data",0,AliCDBRunRange::Infinity());
+    storage->Put(array,id,md);
+  }
+
+  array->Delete();
+
+}
+
index c686f94..ccedd02 100644 (file)
-> Title:\r
-Measurement of the module array\r
-> Date:\r
-24/06/2009\r
-> Subdetector:\r
-ACORDE\r
-> Report URL:\r
-https://edms.cern.ch/document/1014872\r
-> Version:\r
-1\r
-> General Observations:\r
-Point Types: M(easured),T(ransformed), R(eference)\r
-Mean planes for modules on both sides and on top of the L3 magnet are given in the report \r
-> Coordinate System:\r
-ALICEPH\r
-> Units:\r
-m\r
-> Nr Columns:\r
-7\r
-> Column Names:\r
-Point Name,XPH,YPH,ZPH,Point Type,Target Used,Precision(mm)\r
-> Data:\r
-M0_0_I 1.4983 8.6429 0.8837 M Y 1\r
-M0_0_O -1.4987 8.6461 0.8554 M Y 1\r
-M0_0_P -0.0173 8.6372 0.8719 M Y 1\r
-M0_1_I 7.4369 4.9077 3.4868 M Y 1\r
-M0_1_O 5.3151 7.0277 3.4768 M Y 1\r
-M0_2_I 7.4437 4.9076 2.4652 M Y 1\r
-M0_2_O 5.3185 7.0209 2.4818 M Y 1\r
-M0_3_I 7.4440 4.9126 1.4704 M Y 1\r
-M0_3_O 5.3138 7.0251 1.4708 M Y 1\r
-M0_4_I 7.4454 4.9102 0.4875 M Y 1\r
-M0_4_O 5.3109 7.0234 0.4807 M Y 1\r
-M0_5_I 7.4599 4.8964 -0.5164 M Y 1\r
-M0_5_O 5.3317 7.0100 -0.4827 M Y 1\r
-M0_6_I 7.4541 4.9039 -1.2034 M Y 1\r
-M0_6_O 5.3185 7.0164 -1.2166 M Y 1\r
-M0_7_O 5.3159 7.0185 -2.8183 M Y 1\r
-M0_7_P 6.3933 5.9405 -2.8109 M Y 1\r
-M0_8_O 5.3188 7.0197 -3.4706 M Y 1\r
-M0_8_P 6.3928 5.9408 -3.4901 M Y 1\r
-M0_9_I 1.5120 8.6387 0.1553 M Y 1\r
-M0_9_O -1.4890 8.6449 0.1681 M Y 1\r
-M0_9_P -0.0087 8.6352 0.1616 M Y 1\r
-M1_0_I 5.2945 7.0420 4.4703 M Y 1\r
-M1_0_O 3.1771 9.1684 4.4805 M Y 1\r
-M1_1_I 5.2976 7.0411 3.4819 M Y 1\r
-M1_1_O 3.1763 9.1652 3.4916 M Y 1\r
-M1_2_I 5.2991 7.0435 2.4910 M Y 1\r
-M1_2_O 3.1768 9.1628 2.5235 M Y 1\r
-M1_3_I 5.2991 7.0475 1.4758 M Y 1\r
-M1_3_O 3.1699 9.1623 1.4632 M Y 1\r
-M1_4_I 5.3017 7.0548 0.4741 M Y 1\r
-M1_4_O 3.1638 9.1586 0.4719 M Y 1\r
-M1_5_I 5.2971 7.0566 -0.5056 M Y 1\r
-M1_5_O 3.1627 9.1643 -0.5051 M Y 1\r
-M1_6_I 5.2969 7.0593 -1.5033 M Y 1\r
-M1_6_O 3.1611 9.1675 -1.5102 M Y 1\r
-M1_7_I 5.2960 7.0551 -2.5199 M Y 1\r
-M1_7_O 3.1674 9.1686 -2.4726 M Y 1\r
-M1_8_I 5.2886 7.0564 -3.4811 M Y 1\r
-M1_8_O 3.1659 9.1759 -3.4836 M Y 1\r
-M1_9_I 5.2813 7.0610 -4.4995 M Y 1\r
-M1_9_O 3.1619 9.1818 -4.4973 M Y 1\r
-M2_0_I 3.0495 8.6394 4.4873 M Y 1\r
-M2_0_O 0.0509 8.6442 4.4924 M Y 1\r
-M2_0_P 1.5312 8.6349 4.4902 M Y 1\r
-M2_1_I 3.0447 8.6371 3.4856 M Y 1\r
-M2_1_O 0.0427 8.6407 3.4944 M Y 1\r
-M2_1_P 1.5236 8.6304 3.4916 M Y 1\r
-M2_2_I 3.0409 8.6374 2.4854 M Y 1\r
-M2_2_O 0.0423 8.6428 2.4961 M Y 1\r
-M2_2_P 1.5207 8.6329 2.4941 M Y 1\r
-M2_3_I 3.0373 8.6379 1.4855 M Y 1\r
-M2_3_O 0.0388 8.6452 1.4988 M Y 1\r
-M2_3_P 1.5198 8.6342 1.4905 M Y 1\r
-M2_4_I 3.0317 8.6393 0.4872 M Y 1\r
-M2_4_O 0.0338 8.6429 0.4941 M Y 1\r
-M2_4_P 1.5152 8.6340 0.4920 M Y 1\r
-M2_5_I 3.0330 8.6428 -0.5163 M Y 1\r
-M2_5_O 0.0343 8.6428 -0.4985 M Y 1\r
-M2_5_P 1.5532 8.6360 -0.5094 M Y 1\r
-M2_6_I 3.0320 8.6416 -1.5125 M Y 1\r
-M2_6_O 0.0340 8.6447 -1.4993 M Y 1\r
-M2_6_P 1.5143 8.6362 -1.5074 M Y 1\r
-M2_7_I 3.0342 8.6413 -2.5163 M Y 1\r
-M2_7_O 0.0353 8.6436 -2.5046 M Y 1\r
-M2_7_P 1.5164 8.6368 -2.5066 M Y 1\r
-M2_8_I 3.0393 8.6414 -3.5122 M Y 1\r
-M2_8_O 0.0424 8.6432 -3.5031 M Y 1\r
-M2_8_P 1.5247 8.6348 -3.5099 M Y 1\r
-M2_9_I 3.0409 8.6373 -4.5143 M Y 1\r
-M2_9_O 0.0420 8.6432 -4.5019 M Y 1\r
-M2_9_P 1.5191 8.6342 -4.5083 M Y 1\r
-M3_0_I -0.0397 8.6420 4.5320 M Y 1\r
-M3_0_O -3.0389 8.6461 4.5187 M Y 1\r
-M3_0_P -1.5617 8.6367 4.5243 M Y 1\r
-M3_1_I -0.0381 8.6404 3.4990 M Y 1\r
-M3_1_O -3.0387 8.6425 3.4866 M Y 1\r
-M3_1_P -1.5208 8.6349 3.4919 M Y 1\r
-M3_2_I -0.0298 8.6442 2.4996 M Y 1\r
-M3_2_O -3.0316 8.6399 2.4845 M Y 1\r
-M3_2_P -1.5510 8.6353 2.4940 M Y 1\r
-M3_3_I -0.0286 8.6445 1.5016 M Y 1\r
-M3_3_O -3.0297 8.6440 1.4869 M Y 1\r
-M3_3_P -1.5514 8.6377 1.4929 M Y 1\r
-M3_4_I -0.0304 8.6466 0.5060 M Y 1\r
-M3_4_O -3.0299 8.6406 0.4884 M Y 1\r
-M3_4_P -1.5492 8.6349 0.4949 M Y 1\r
-M3_5_I -0.0312 8.6445 -0.4956 M Y 1\r
-M3_5_O -3.0326 8.6406 -0.5262 M Y 1\r
-M3_5_P -1.5512 8.6350 -0.5139 M Y 1\r
-M3_6_I -0.0340 8.6460 -1.4978 M Y 1\r
-M3_6_O -3.0336 8.6379 -1.5219 M Y 1\r
-M3_6_P -1.5563 8.6349 -1.5096 M Y 1\r
-M3_7_I -0.0277 8.6428 -2.5007 M Y 1\r
-M3_7_O -3.0287 8.6407 -2.5188 M Y 1\r
-M3_7_P -1.5471 8.6351 -2.5148 M Y 1\r
-M3_8_I -0.0307 8.6462 -3.4975 M Y 1\r
-M3_8_O -3.0325 8.6446 -3.5254 M Y 1\r
-M3_8_P -1.5522 8.6382 -3.5102 M Y 1\r
-M3_9_I -0.0290 8.6467 -4.5031 M Y 1\r
-M3_9_O -3.0284 8.6434 -4.4444 M Y 1\r
-M3_9_P -1.5484 8.6375 -4.5149 M Y 1\r
-M4_0_I -3.1938 9.2020 4.4987 M Y 1\r
-M4_0_O -5.2669 7.0334 4.4407 M Y 1\r
-M4_1_I -3.1893 9.2001 3.5146 M Y 1\r
-M4_1_O -5.2662 7.0334 3.4897 M Y 1\r
-M4_2_O -5.2657 7.0283 2.4781 M Y 1\r
-M4_3_I -3.1813 9.1973 1.4442 M Y 1\r
-M4_3_O -5.2633 7.0342 1.4857 M Y 1\r
-M4_4_I -3.1740 9.1977 0.4817 M Y 1\r
-M4_4_O -5.2611 7.0413 0.4015 M Y 1\r
-M4_5_I -3.1737 9.1893 -0.5238 M Y 1\r
-M4_5_O -5.2674 7.0365 -0.4926 M Y 1\r
-M4_6_I -3.1697 9.1871 -1.5335 M Y 1\r
-M4_6_O -5.2734 7.0493 -1.4163 M Y 1\r
-M4_7_I -3.1722 9.1879 -2.5239 M Y 1\r
-M4_7_O -5.2685 7.0410 -2.5759 M Y 1\r
-M4_8_I -3.1756 9.1902 -3.5317 M Y 1\r
-M4_8_O -5.2671 7.0371 -3.5188 M Y 1\r
-M4_9_I -3.1791 9.1908 -4.5427 M Y 1\r
-M4_9_O -5.2671 7.0358 -4.4294 M Y 1\r
-M5_0_I 1.4989 8.6429 -0.1383 M Y 1\r
-M5_0_O -1.5025 8.6426 -0.1414 M Y 1\r
-M5_0_P 0.0164 8.6353 -0.1415 M Y 1\r
-M5_1_I -5.3746 6.9638 3.5044 M Y 1\r
-M5_1_O -7.4858 4.8354 3.4907 M Y 1\r
-M5_2_I -5.3775 6.9639 2.4814 M Y 1\r
-M5_2_O -7.4861 4.8294 2.4999 M Y 1\r
-M5_3_I -5.3733 6.9707 1.0776 M Y 1\r
-M5_3_O -7.4793 4.8319 1.0324 M Y 1\r
-M5_4_I -5.3688 6.9686 0.4609 M Y 1\r
-M5_4_O -7.4826 4.8358 0.4306 M Y 1\r
-M5_5_I -5.0283 7.2995 -0.8510 M Y 1\r
-M5_5_P -6.1036 6.2211 -0.8168 M Y 1\r
-M5_6_I -5.0698 7.2608 -1.8491 M Y 1\r
-M5_6_P -6.1418 6.1802 -1.8126 M Y 1\r
-M5_7_I -5.3140 7.0229 -2.5830 M Y 1\r
-M5_7_O -7.4311 4.8954 -2.5870 M Y 1\r
-M5_8_I -5.3059 7.0288 -3.4932 M Y 1\r
-M5_8_O -7.4257 4.9029 -3.4954 M Y 1\r
-M5_9_I 1.4954 8.6442 -1.1394 M Y 1\r
-M5_9_O -1.5026 8.6442 -1.1416 M Y 1\r
+> Title:
+Measurement of the module array
+> Date:
+24/06/2009
+> Subdetector:
+ACORDE
+> Report URL:
+https://edms.cern.ch/document/1014872
+> Version:
+1
+> General Observations:
+Point Types: M(easured),T(ransformed), R(eference)
+Mean planes for modules on both sides and on top of the L3 magnet are given in the report 
+> Coordinate System:
+ALICEPH
+> Units:
+m
+> Nr Columns:
+7
+> Column Names:
+Point Name,XPH,YPH,ZPH,Point Type,Target Used,Precision(mm)
+> Data:
+M0_0_I 1.4983 8.6429 0.8837 M Y 1
+M0_0_O -1.4987 8.6461 0.8554 M Y 1
+M0_0_P -0.0173 8.6372 0.8719 M Y 1
+M0_1_I 7.4369 4.9077 3.4868 M Y 1
+M0_1_O 5.3151 7.0277 3.4768 M Y 1
+M0_2_I 7.4437 4.9076 2.4652 M Y 1
+M0_2_O 5.3185 7.0209 2.4818 M Y 1
+M0_3_I 7.4440 4.9126 1.4704 M Y 1
+M0_3_O 5.3138 7.0251 1.4708 M Y 1
+M0_4_I 7.4454 4.9102 0.4875 M Y 1
+M0_4_O 5.3109 7.0234 0.4807 M Y 1
+M0_5_I 7.4599 4.8964 -0.5164 M Y 1
+M0_5_O 5.3317 7.0100 -0.4827 M Y 1
+M0_6_I 7.4541 4.9039 -1.2034 M Y 1
+M0_6_O 5.3185 7.0164 -1.2166 M Y 1
+M0_7_O 5.3159 7.0185 -2.8183 M Y 1
+M0_7_P 6.3933 5.9405 -2.8109 M Y 1
+M0_8_O 5.3188 7.0197 -3.4706 M Y 1
+M0_8_P 6.3928 5.9408 -3.4901 M Y 1
+M0_9_I 1.5120 8.6387 0.1553 M Y 1
+M0_9_O -1.4890 8.6449 0.1681 M Y 1
+M0_9_P -0.0087 8.6352 0.1616 M Y 1
+M1_0_I 5.2945 7.0420 4.4703 M Y 1
+M1_0_O 3.1771 9.1684 4.4805 M Y 1
+M1_1_I 5.2976 7.0411 3.4819 M Y 1
+M1_1_O 3.1763 9.1652 3.4916 M Y 1
+M1_2_I 5.2991 7.0435 2.4910 M Y 1
+M1_2_O 3.1768 9.1628 2.5235 M Y 1
+M1_3_I 5.2991 7.0475 1.4758 M Y 1
+M1_3_O 3.1699 9.1623 1.4632 M Y 1
+M1_4_I 5.3017 7.0548 0.4741 M Y 1
+M1_4_O 3.1638 9.1586 0.4719 M Y 1
+M1_5_I 5.2971 7.0566 -0.5056 M Y 1
+M1_5_O 3.1627 9.1643 -0.5051 M Y 1
+M1_6_I 5.2969 7.0593 -1.5033 M Y 1
+M1_6_O 3.1611 9.1675 -1.5102 M Y 1
+M1_7_I 5.2960 7.0551 -2.5199 M Y 1
+M1_7_O 3.1674 9.1686 -2.4726 M Y 1
+M1_8_I 5.2886 7.0564 -3.4811 M Y 1
+M1_8_O 3.1659 9.1759 -3.4836 M Y 1
+M1_9_I 5.2813 7.0610 -4.4995 M Y 1
+M1_9_O 3.1619 9.1818 -4.4973 M Y 1
+M2_0_I 3.0495 8.6394 4.4873 M Y 1
+M2_0_O 0.0509 8.6442 4.4924 M Y 1
+M2_0_P 1.5312 8.6349 4.4902 M Y 1
+M2_1_I 3.0447 8.6371 3.4856 M Y 1
+M2_1_O 0.0427 8.6407 3.4944 M Y 1
+M2_1_P 1.5236 8.6304 3.4916 M Y 1
+M2_2_I 3.0409 8.6374 2.4854 M Y 1
+M2_2_O 0.0423 8.6428 2.4961 M Y 1
+M2_2_P 1.5207 8.6329 2.4941 M Y 1
+M2_3_I 3.0373 8.6379 1.4855 M Y 1
+M2_3_O 0.0388 8.6452 1.4988 M Y 1
+M2_3_P 1.5198 8.6342 1.4905 M Y 1
+M2_4_I 3.0317 8.6393 0.4872 M Y 1
+M2_4_O 0.0338 8.6429 0.4941 M Y 1
+M2_4_P 1.5152 8.6340 0.4920 M Y 1
+M2_5_I 3.0330 8.6428 -0.5163 M Y 1
+M2_5_O 0.0343 8.6428 -0.4985 M Y 1
+M2_5_P 1.5532 8.6360 -0.5094 M Y 1
+M2_6_I 3.0320 8.6416 -1.5125 M Y 1
+M2_6_O 0.0340 8.6447 -1.4993 M Y 1
+M2_6_P 1.5143 8.6362 -1.5074 M Y 1
+M2_7_I 3.0342 8.6413 -2.5163 M Y 1
+M2_7_O 0.0353 8.6436 -2.5046 M Y 1
+M2_7_P 1.5164 8.6368 -2.5066 M Y 1
+M2_8_I 3.0393 8.6414 -3.5122 M Y 1
+M2_8_O 0.0424 8.6432 -3.5031 M Y 1
+M2_8_P 1.5247 8.6348 -3.5099 M Y 1
+M2_9_I 3.0409 8.6373 -4.5143 M Y 1
+M2_9_O 0.0420 8.6432 -4.5019 M Y 1
+M2_9_P 1.5191 8.6342 -4.5083 M Y 1
+M3_0_I -0.0397 8.6420 4.5320 M Y 1
+M3_0_O -3.0389 8.6461 4.5187 M Y 1
+M3_0_P -1.5617 8.6367 4.5243 M Y 1
+M3_1_I -0.0381 8.6404 3.4990 M Y 1
+M3_1_O -3.0387 8.6425 3.4866 M Y 1
+M3_1_P -1.5208 8.6349 3.4919 M Y 1
+M3_2_I -0.0298 8.6442 2.4996 M Y 1
+M3_2_O -3.0316 8.6399 2.4845 M Y 1
+M3_2_P -1.5510 8.6353 2.4940 M Y 1
+M3_3_I -0.0286 8.6445 1.5016 M Y 1
+M3_3_O -3.0297 8.6440 1.4869 M Y 1
+M3_3_P -1.5514 8.6377 1.4929 M Y 1
+M3_4_I -0.0304 8.6466 0.5060 M Y 1
+M3_4_O -3.0299 8.6406 0.4884 M Y 1
+M3_4_P -1.5492 8.6349 0.4949 M Y 1
+M3_5_I -0.0312 8.6445 -0.4956 M Y 1
+M3_5_O -3.0326 8.6406 -0.5262 M Y 1
+M3_5_P -1.5512 8.6350 -0.5139 M Y 1
+M3_6_I -0.0340 8.6460 -1.4978 M Y 1
+M3_6_O -3.0336 8.6379 -1.5219 M Y 1
+M3_6_P -1.5563 8.6349 -1.5096 M Y 1
+M3_7_I -0.0277 8.6428 -2.5007 M Y 1
+M3_7_O -3.0287 8.6407 -2.5188 M Y 1
+M3_7_P -1.5471 8.6351 -2.5148 M Y 1
+M3_8_I -0.0307 8.6462 -3.4975 M Y 1
+M3_8_O -3.0325 8.6446 -3.5254 M Y 1
+M3_8_P -1.5522 8.6382 -3.5102 M Y 1
+M3_9_I -0.0290 8.6467 -4.5031 M Y 1
+M3_9_O -3.0284 8.6434 -4.4444 M Y 1
+M3_9_P -1.5484 8.6375 -4.5149 M Y 1
+M4_0_I -3.1938 9.2020 4.4987 M Y 1
+M4_0_O -5.2669 7.0334 4.4407 M Y 1
+M4_1_I -3.1893 9.2001 3.5146 M Y 1
+M4_1_O -5.2662 7.0334 3.4897 M Y 1
+M4_2_O -5.2657 7.0283 2.4781 M Y 1
+M4_3_I -3.1813 9.1973 1.4442 M Y 1
+M4_3_O -5.2633 7.0342 1.4857 M Y 1
+M4_4_I -3.1740 9.1977 0.4817 M Y 1
+M4_4_O -5.2611 7.0413 0.4015 M Y 1
+M4_5_I -3.1737 9.1893 -0.5238 M Y 1
+M4_5_O -5.2674 7.0365 -0.4926 M Y 1
+M4_6_I -3.1697 9.1871 -1.5335 M Y 1
+M4_6_O -5.2734 7.0493 -1.4163 M Y 1
+M4_7_I -3.1722 9.1879 -2.5239 M Y 1
+M4_7_O -5.2685 7.0410 -2.5759 M Y 1
+M4_8_I -3.1756 9.1902 -3.5317 M Y 1
+M4_8_O -5.2671 7.0371 -3.5188 M Y 1
+M4_9_I -3.1791 9.1908 -4.5427 M Y 1
+M4_9_O -5.2671 7.0358 -4.4294 M Y 1
+M5_0_I 1.4989 8.6429 -0.1383 M Y 1
+M5_0_O -1.5025 8.6426 -0.1414 M Y 1
+M5_0_P 0.0164 8.6353 -0.1415 M Y 1
+M5_1_I -5.3746 6.9638 3.5044 M Y 1
+M5_1_O -7.4858 4.8354 3.4907 M Y 1
+M5_2_I -5.3775 6.9639 2.4814 M Y 1
+M5_2_O -7.4861 4.8294 2.4999 M Y 1
+M5_3_I -5.3733 6.9707 1.0776 M Y 1
+M5_3_O -7.4793 4.8319 1.0324 M Y 1
+M5_4_I -5.3688 6.9686 0.4609 M Y 1
+M5_4_O -7.4826 4.8358 0.4306 M Y 1
+M5_5_I -5.0283 7.2995 -0.8510 M Y 1
+M5_5_P -6.1036 6.2211 -0.8168 M Y 1
+M5_6_I -5.0698 7.2608 -1.8491 M Y 1
+M5_6_P -6.1418 6.1802 -1.8126 M Y 1
+M5_7_I -5.3140 7.0229 -2.5830 M Y 1
+M5_7_O -7.4311 4.8954 -2.5870 M Y 1
+M5_8_I -5.3059 7.0288 -3.4932 M Y 1
+M5_8_O -7.4257 4.9029 -3.4954 M Y 1
+M5_9_I 1.4954 8.6442 -1.1394 M Y 1
+M5_9_O -1.5026 8.6442 -1.1416 M Y 1
 M5_9_P -0.0216 8.6374 -1.1395 M Y 1
\ No newline at end of file
index fe12137..c0340c7 100644 (file)
@@ -1,84 +1,84 @@
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// AliAnalysisTaskAcorde class\r
-//\r
-// Description:\r
-//\r
-//     Reads the information of ACORDE-ESD\r
-//     Also it is implemented a simple matching between tracks\r
-//     to look for the extrapolation of them to ACORDE modules\r
-//\r
-//     Create some fHistograms and one tree with the information\r
-//     of the matching tracks\r
-//\r
-//  Author: Mario Rodríguez Cahuantzi\r
-//             <mario.rocah@gmail.com>\r
-//             <mrodrigu@mail.cern.ch>\r
-//\r
-//  Created: June 30th. 2010 @ FCFM - BUAP, Puebla, MX\r
-//  Last update: created\r
-//\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-#ifndef ALIANALYSISTASKACORDE_H\r
-#define ALIANALYSISTASKACORDE_H\r
-\r
-class TH2F;\r
-class TH1F;\r
-class AliESDEvent;\r
-class TArrayI;\r
-class TList;\r
-#include "AliAnalysisTask.h"\r
-\r
-class AliAnalysisTaskAcorde : public AliAnalysisTask {\r
- public:\r
-  AliAnalysisTaskAcorde(const char *name = "AliAnalysisTaskAcorde");\r
-  virtual ~AliAnalysisTaskAcorde();            //! Destructor fo task\r
-  \r
-  virtual void   ConnectInputData(Option_t *);         //! Connects input data to class analysis\r
-  virtual void   CreateOutputObjects();        //! Creates output object (fCosmicTree)\r
-  virtual void   Exec(Option_t *option);       //! Execution class\r
-  virtual void   Terminate(Option_t *);        //! Terminate class \r
-\r
- private:\r
-\r
-\r
-  AliESDEvent *fESD;                   //! ESD object\r
-  TArrayI      *fPair;                 //! Pair track connected (up & down)\r
-  TTree *fCosmicTree;                  //! TTree with some information of matched tracks\r
-  Int_t fnTracks;                      //! # of recontructed tracks\r
-  Int_t fNMatchTracks;                 //! # of matched tracks\r
-\r
-\r
-  // Cut definitions\r
-\r
-  const Int_t fkMinTPCclusters;                //! cut in clusters\r
-  const Float_t fkMinTrackDist;                //! cut in distance\r
-  const Float_t fkMinCutDir;           //! minimum cut\r
-\r
-  Float_t fXAco;                               //! x-coordinate of extrapolated track to ACORDE\r
-  Float_t fYAco;                               //! y-coordinate of extrapolated track to ACORDE\r
-  Float_t fZAco;                               //! z-coordinate of extrapolated track to ACORDE\r
-  Int_t fTrigger;                      //! fTrigger label\r
-  TString fActiveTriggerDetector;      //! detector string     \r
-\r
-  Int_t fNSingleTracks;                        //! no. of single track\r
-  Int_t fNMatchedTracks;                       //! no. of matched track\r
-  \r
-\r
-  TList *fHisto;                               //! list of fHistograms\r
-  TH1F *fAcordeHitsAll;                        //! hits of acorde\r
-  TH1F *fAcordeMultiAll;                       //! multi. of acorde modules\r
-  TH1F *fAcordeHitsTPC;                        //! hits of acorde (if track)\r
-  TH1F *fAcordeMultiTPC;                       //! multi. of acorde modules (if track)\r
-  TH1F *fNTracksMatched;                       //! matched tracks\r
-  TH1F *fNTracks;                      //! no. of tracks\r
-  TH2F *fTracksToAcorde;               //! tracks extrapolated to acorde.\r
-\r
-  AliAnalysisTaskAcorde(const AliAnalysisTaskAcorde&); // not implemented\r
-  AliAnalysisTaskAcorde& operator=(const AliAnalysisTaskAcorde&); // not implemented\r
-  \r
-  ClassDef(AliAnalysisTaskAcorde, 1); // example of analysis\r
-};\r
-\r
-#endif\r
+/////////////////////////////////////////////////////////////////////////////
+//
+// AliAnalysisTaskAcorde class
+//
+// Description:
+//
+//     Reads the information of ACORDE-ESD
+//     Also it is implemented a simple matching between tracks
+//     to look for the extrapolation of them to ACORDE modules
+//
+//     Create some fHistograms and one tree with the information
+//     of the matching tracks
+//
+//  Author: Mario Rodríguez Cahuantzi
+//             <mario.rocah@gmail.com>
+//             <mrodrigu@mail.cern.ch>
+//
+//  Created: June 30th. 2010 @ FCFM - BUAP, Puebla, MX
+//  Last update: created
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef ALIANALYSISTASKACORDE_H
+#define ALIANALYSISTASKACORDE_H
+
+class TH2F;
+class TH1F;
+class AliESDEvent;
+class TArrayI;
+class TList;
+#include "AliAnalysisTask.h"
+
+class AliAnalysisTaskAcorde : public AliAnalysisTask {
+ public:
+  AliAnalysisTaskAcorde(const char *name = "AliAnalysisTaskAcorde");
+  virtual ~AliAnalysisTaskAcorde();            //! Destructor fo task
+  
+  virtual void   ConnectInputData(Option_t *);         //! Connects input data to class analysis
+  virtual void   CreateOutputObjects();        //! Creates output object (fCosmicTree)
+  virtual void   Exec(Option_t *option);       //! Execution class
+  virtual void   Terminate(Option_t *);        //! Terminate class 
+
+ private:
+
+
+  AliESDEvent *fESD;                   //! ESD object
+  TArrayI      *fPair;                 //! Pair track connected (up & down)
+  TTree *fCosmicTree;                  //! TTree with some information of matched tracks
+  Int_t fnTracks;                      //! # of recontructed tracks
+  Int_t fNMatchTracks;                 //! # of matched tracks
+
+
+  // Cut definitions
+
+  const Int_t fkMinTPCclusters;                //! cut in clusters
+  const Float_t fkMinTrackDist;                //! cut in distance
+  const Float_t fkMinCutDir;           //! minimum cut
+
+  Float_t fXAco;                               //! x-coordinate of extrapolated track to ACORDE
+  Float_t fYAco;                               //! y-coordinate of extrapolated track to ACORDE
+  Float_t fZAco;                               //! z-coordinate of extrapolated track to ACORDE
+  Int_t fTrigger;                      //! fTrigger label
+  TString fActiveTriggerDetector;      //! detector string     
+
+  Int_t fNSingleTracks;                        //! no. of single track
+  Int_t fNMatchedTracks;                       //! no. of matched track
+  
+
+  TList *fHisto;                               //! list of fHistograms
+  TH1F *fAcordeHitsAll;                        //! hits of acorde
+  TH1F *fAcordeMultiAll;                       //! multi. of acorde modules
+  TH1F *fAcordeHitsTPC;                        //! hits of acorde (if track)
+  TH1F *fAcordeMultiTPC;                       //! multi. of acorde modules (if track)
+  TH1F *fNTracksMatched;                       //! matched tracks
+  TH1F *fNTracks;                      //! no. of tracks
+  TH2F *fTracksToAcorde;               //! tracks extrapolated to acorde.
+
+  AliAnalysisTaskAcorde(const AliAnalysisTaskAcorde&); // not implemented
+  AliAnalysisTaskAcorde& operator=(const AliAnalysisTaskAcorde&); // not implemented
+  
+  ClassDef(AliAnalysisTaskAcorde, 1); // example of analysis
+};
+
+#endif
index 465b1ce..6c98be6 100644 (file)
-/*************************************************************************\r
-* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *\r
-*                                                                        *\r
-* Author: The ALICE Off-line Project.                                    *\r
-* Contributors are mentioned in the code where appropriate.              *\r
-*                                                                        *\r
-* Permission to use, copy, modify and distribute this software and its   *\r
-* documentation strictly for non-commercial purposes is hereby granted   *\r
-* without fee, provided that the above copyright notice appears in all   *\r
-* copies and that both the copyright notice and this permission notice   *\r
-* appear in the supporting documentation. The authors make no claims     *\r
-* about the suitability of this software for any purpose. It is          *\r
-* provided "as is" without express or implied warranty.                  *\r
-**************************************************************************/\r
-\r
-///////////////////////////////////////////////////////////////////////////\r
-//                                                                       //\r
-//                        Basic Analysis Task                            //\r
-//                      for PID        Analysis                          //\r
-//                                                                       //\r
-///////////////////////////////////////////////////////////////////////////\r
-\r
-#include <TChain.h>\r
-#include <TH1D.h>\r
-#include <TH2D.h>\r
-\r
-#include <AliVEvent.h>\r
-#include <AliInputEventHandler.h>\r
-#include <AliAnalysisManager.h>\r
-\r
-#include <AliLog.h>\r
-#include <AliPID.h>\r
-#include <AliPIDCombined.h>\r
-#include <AliPIDResponse.h>\r
-\r
-#include "AliAnalysisTaskPIDCombined.h"\r
-\r
-const char *AliAnalysisTaskPIDCombined::fgkBinMomDesc[AliAnalysisTaskPIDCombined::kPtBins] = {\r
-  " 0 <= p < 0.5 GeV/c",\r
-  " 0.5 <= p < 0.7 GeV/c",\r
-  " 0.7 <= p < 1.0 GeV/c",\r
-  " 1.0 <= p < 1.5 GeV/c",\r
-  " 1.5 <= p < 2.0 GeV/c",\r
-  " p >= 2.0 GeV/c"\r
-};\r
-\r
-ClassImp(AliAnalysisTaskPIDCombined)\r
-\r
-//_________________________________________________________________________________\r
-AliAnalysisTaskPIDCombined::AliAnalysisTaskPIDCombined() :\r
-  AliAnalysisTaskSE(),\r
-  fHistList(),\r
-  fProbTPCnSigma(),\r
-  fProbTOFnSigma(),\r
-  fProbTPCTOFnSigmaTPC(),\r
-  fProbTPC(),\r
-  fProbTOF(),\r
-  fProbTPCTOF(),\r
-  fPriors(),\r
-  fProbTPCTOFnSigTPCMom(),\r
-  fProbTPCnSigTPCMom(),\r
-  fProbTOFnSigTOFMom(),\r
-  fPriorsUsed(),\r
-  fPIDResponse(0x0),\r
-  fPIDCombined(0x0),\r
-  fTrackCuts(0x0),\r
-  fTrackFilter(0x0),\r
+/*************************************************************************
+* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
+*                                                                        *
+* Author: The ALICE Off-line Project.                                    *
+* Contributors are mentioned in the code where appropriate.              *
+*                                                                        *
+* Permission to use, copy, modify and distribute this software and its   *
+* documentation strictly for non-commercial purposes is hereby granted   *
+* without fee, provided that the above copyright notice appears in all   *
+* copies and that both the copyright notice and this permission notice   *
+* appear in the supporting documentation. The authors make no claims     *
+* about the suitability of this software for any purpose. It is          *
+* provided "as is" without express or implied warranty.                  *
+**************************************************************************/
+
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+//                        Basic Analysis Task                            //
+//                      for PID        Analysis                          //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+
+#include <TChain.h>
+#include <TH1D.h>
+#include <TH2D.h>
+
+#include <AliVEvent.h>
+#include <AliInputEventHandler.h>
+#include <AliAnalysisManager.h>
+
+#include <AliLog.h>
+#include <AliPID.h>
+#include <AliPIDCombined.h>
+#include <AliPIDResponse.h>
+
+#include "AliAnalysisTaskPIDCombined.h"
+
+const char *AliAnalysisTaskPIDCombined::fgkBinMomDesc[AliAnalysisTaskPIDCombined::kPtBins] = {
+  " 0 <= p < 0.5 GeV/c",
+  " 0.5 <= p < 0.7 GeV/c",
+  " 0.7 <= p < 1.0 GeV/c",
+  " 1.0 <= p < 1.5 GeV/c",
+  " 1.5 <= p < 2.0 GeV/c",
+  " p >= 2.0 GeV/c"
+};
+
+ClassImp(AliAnalysisTaskPIDCombined)
+
+//_________________________________________________________________________________
+AliAnalysisTaskPIDCombined::AliAnalysisTaskPIDCombined() :
+  AliAnalysisTaskSE(),
+  fHistList(),
+  fProbTPCnSigma(),
+  fProbTOFnSigma(),
+  fProbTPCTOFnSigmaTPC(),
+  fProbTPC(),
+  fProbTOF(),
+  fProbTPCTOF(),
+  fPriors(),
+  fProbTPCTOFnSigTPCMom(),
+  fProbTPCnSigTPCMom(),
+  fProbTOFnSigTOFMom(),
+  fPriorsUsed(),
+  fPIDResponse(0x0),
+  fPIDCombined(0x0),
+  fTrackCuts(0x0),
+  fTrackFilter(0x0),
   fDeDx(NULL),
   fDeDxTuned(NULL)
-{\r
-  //\r
-  // Constructor\r
-  //\r
-}\r
-\r
-//_________________________________________________________________________________\r
-AliAnalysisTaskPIDCombined::AliAnalysisTaskPIDCombined(const char *name) :\r
-  AliAnalysisTaskSE(name),\r
-  fHistList(),\r
-  fProbTPCnSigma(),\r
-  fProbTOFnSigma(),\r
-  fProbTPCTOFnSigmaTPC(),\r
-  fProbTPC(),\r
-  fProbTOF(),\r
-  fProbTPCTOF(),\r
-  fPriors(),\r
-  fProbTPCTOFnSigTPCMom(),\r
-  fProbTPCnSigTPCMom(),\r
-  fProbTOFnSigTOFMom(),\r
-  fPriorsUsed(),\r
-  fPIDResponse(0x0),\r
-  fPIDCombined(0x0),\r
-  fTrackCuts(0x0),\r
-  fTrackFilter(0x0),\r
+{
+  //
+  // Constructor
+  //
+}
+
+//_________________________________________________________________________________
+AliAnalysisTaskPIDCombined::AliAnalysisTaskPIDCombined(const char *name) :
+  AliAnalysisTaskSE(name),
+  fHistList(),
+  fProbTPCnSigma(),
+  fProbTOFnSigma(),
+  fProbTPCTOFnSigmaTPC(),
+  fProbTPC(),
+  fProbTOF(),
+  fProbTPCTOF(),
+  fPriors(),
+  fProbTPCTOFnSigTPCMom(),
+  fProbTPCnSigTPCMom(),
+  fProbTOFnSigTOFMom(),
+  fPriorsUsed(),
+  fPIDResponse(0x0),
+  fPIDCombined(0x0),
+  fTrackCuts(0x0),
+  fTrackFilter(0x0),
   fDeDx(NULL),
   fDeDxTuned(NULL)
-{\r
-  //\r
-  // Constructor\r
-  //\r
-  DefineInput(0,TChain::Class());\r
-  DefineOutput(1, TList::Class());\r
-}\r
-\r
-//_________________________________________________________________________________\r
-void AliAnalysisTaskPIDCombined::UserCreateOutputObjects()\r
-{\r
-  //\r
-  // Initialise the framework objects\r
-  //\r
-\r
-\r
-  // ------- track cuts\r
-  fTrackCuts = new AliESDtrackCuts("fTrackCuts", "Standard");\r
-  fTrackCuts->SetAcceptKinkDaughters(kFALSE);\r
-  fTrackCuts->SetMinNClustersTPC(80);\r
-  fTrackCuts->SetMaxChi2PerClusterTPC(4);\r
-  fTrackCuts->SetMaxDCAToVertexXY(3);\r
-  fTrackCuts->SetMaxDCAToVertexZ(3);\r
-  fTrackCuts->SetRequireTPCRefit(kTRUE);\r
-  fTrackCuts->SetRequireITSRefit(kTRUE);\r
-  fTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kAny);\r
-  fTrackFilter = new AliAnalysisFilter("trackFilter");\r
-  fTrackFilter->AddCuts(fTrackCuts);\r
-\r
-\r
-\r
-  // ------- setup PIDCombined\r
-  fPIDCombined=new AliPIDCombined;\r
-  fPIDCombined->SetDefaultTPCPriors();\r
-  fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTPC+AliPIDResponse::kDetTOF);\r
-\r
-  // no light nuclei - no need to call it, this is default\r
-  //  fPIDCombined->SetSelectedSpecies(AliPID::kSPECIES);\r
-\r
-\r
-  fHistList.Add(new TH1D("nEvents","Number of Evnets;Selection",2,0,2));\r
-\r
-  for (Int_t ispec=0; ispec<5; ++ispec){\r
-\r
\r
-    fProbTPC[ispec]=new TH2D(Form("prob%s_mom_TPC",AliPID::ParticleName(ispec)),\r
-                                   Form("%s probability vs. momentum;momentum;probability",AliPID::ParticleName(ispec)),\r
-                                   100,0.,20.,50,0.,1.);\r
-    fHistList.Add(fProbTPC[ispec]);\r
-    fProbTPCnSigma[ispec]=new TH2D(Form("prob%s_nSigma_TPC",AliPID::ParticleName(ispec)),\r
-                                   Form("%s probability vs. n#sigma;n#sigma;probability",AliPID::ParticleName(ispec)),\r
-                                   20,-5.,5.,50,0.,1.);\r
-    fHistList.Add(fProbTPCnSigma[ispec]);\r
-\r
-    for (Int_t ibin=0;ibin<kPtBins;ibin++) {\r
-      fProbTPCnSigTPCMom[ibin][ispec]=new TH2D(Form("prob%s_nSigma_TPC (%s)",AliPID::ParticleName(ispec),fgkBinMomDesc[ibin]),\r
-                                              Form("%s probability vs. n#sigma;n#sigma;probability",AliPID::ParticleName(ispec)),\r
-                                              20,-5.,5.,50,0.,1.);\r
-      fHistList.Add(fProbTPCnSigTPCMom[ibin][ispec]);\r
-    }\r
-\r
-\r
-\r
-    fProbTOF[ispec]=new TH2D(Form("prob%s_mom_TOF",AliPID::ParticleName(ispec)),\r
-                                   Form("%s probability vs. momentum;momentum;probability",AliPID::ParticleName(ispec)),\r
-                                   100,0.,20.,50,0.,1.);\r
-    fHistList.Add(fProbTOF[ispec]);\r
-    fProbTOFnSigma[ispec]=new TH2D(Form("prob%s_nSigma_TOF",AliPID::ParticleName(ispec)),\r
-                                   Form("%s probability vs. n#sigma;n#sigma;probability",AliPID::ParticleName(ispec)),\r
-                                   20,-5.,5.,50,0.,1.);\r
-    fHistList.Add(fProbTOFnSigma[ispec]);\r
-    for (Int_t ibin=0;ibin<kPtBins;ibin++) {\r
-      fProbTOFnSigTOFMom[ibin][ispec]=new TH2D(Form("prob%s_nSigma_TOF (%s)",AliPID::ParticleName(ispec),fgkBinMomDesc[ibin]),\r
-                                              Form("%s probability vs. n#sigma;n#sigma;probability",AliPID::ParticleName(ispec)),\r
-                                              20,-5.,5.,50,0.,1.);\r
-      fHistList.Add(fProbTOFnSigTOFMom[ibin][ispec]);\r
-    }\r
-\r
-\r
-\r
-    fProbTPCTOF[ispec]=new TH2D(Form("prob%s_mom_TPCTOF",AliPID::ParticleName(ispec)),\r
-                                   Form("%s probability vs. momentum;momentum;probability",AliPID::ParticleName(ispec)),\r
-                                   100,0.,20.,50,0.,1.);\r
-    fHistList.Add(fProbTPCTOF[ispec]);\r
-    fProbTPCTOFnSigmaTPC[ispec]=new TH2D(Form("probTPCTOF%s_nSigma_TPC",AliPID::ParticleName(ispec)),\r
-                                   Form("%s TPCTOF probability vs. n#sigmaTPC;n#sigma;probability",AliPID::ParticleName(ispec)),\r
-                                   20,-5.,5.,50,0.,1.);\r
-    fHistList.Add(fProbTPCTOFnSigmaTPC[ispec]);\r
-    for (Int_t ibin=0;ibin<kPtBins;ibin++) {\r
-      fProbTPCTOFnSigTPCMom[ibin][ispec]=new TH2D(Form("probTPCTOF%s_nSigma_TPC (%s)",AliPID::ParticleName(ispec),fgkBinMomDesc[ibin]),\r
-                                              Form("%s probability vs. n#sigma;n#sigma;probability",AliPID::ParticleName(ispec)),\r
-                                              20,-5.,5.,50,0.,1.);\r
-      fHistList.Add(fProbTPCTOFnSigTPCMom[ibin][ispec]);\r
-    }\r
-\r
-\r
-\r
-    // basic priors\r
-    fPriors[ispec]=new TH1F(Form("%s_priors",AliPID::ParticleName(ispec)),\r
-                           Form("%s priors vs momentum",AliPID::ParticleName(ispec)),\r
-                           100,0.,20.);\r
-    fHistList.Add(fPriors[ispec]);\r
-    switch (ispec) {\r
-    case AliPID::kElectron:\r
-      for (Int_t ich=1;ich<=100;ich++) fPriors[ispec]->SetBinContent(ich,0.02);\r
-      break;\r
-    case AliPID::kMuon:\r
-      for (Int_t ich=1;ich<=100;ich++) fPriors[ispec]->SetBinContent(ich,0.02);\r
-      break;\r
-    case AliPID::kPion:\r
-      for (Int_t ich=1;ich<=100;ich++) fPriors[ispec]->SetBinContent(ich,0.56);\r
-      break;\r
-    case AliPID::kKaon:\r
-      for (Int_t ich=1;ich<=100;ich++) fPriors[ispec]->SetBinContent(ich,0.20);\r
-      break;\r
-    case AliPID::kProton:\r
-      for (Int_t ich=1;ich<=100;ich++) fPriors[ispec]->SetBinContent(ich,0.20);\r
-      break;\r
-    default:\r
-      break;\r
-    }\r
-    fPIDCombined->SetPriorDistribution((AliPID::EParticleType)ispec,fPriors[ispec]);\r
-\r
-    // priors used\r
-    fPriorsUsed[ispec] = new TH2D(Form("%s_priorsUsed",AliPID::ParticleName(ispec)),\r
-                           Form("%s priors vs transverse momentum;p_{t} (GeV/c);priors",AliPID::ParticleName(ispec)),\r
-                                 100,0.,20.,101,0,1.01);      \r
-    fHistList.Add(fPriorsUsed[ispec]);\r
-  }\r
-\r
-\r
+{
+  //
+  // Constructor
+  //
+  DefineInput(0,TChain::Class());
+  DefineOutput(1, TList::Class());
+}
+
+//_________________________________________________________________________________
+void AliAnalysisTaskPIDCombined::UserCreateOutputObjects()
+{
+  //
+  // Initialise the framework objects
+  //
+
+
+  // ------- track cuts
+  fTrackCuts = new AliESDtrackCuts("fTrackCuts", "Standard");
+  fTrackCuts->SetAcceptKinkDaughters(kFALSE);
+  fTrackCuts->SetMinNClustersTPC(80);
+  fTrackCuts->SetMaxChi2PerClusterTPC(4);
+  fTrackCuts->SetMaxDCAToVertexXY(3);
+  fTrackCuts->SetMaxDCAToVertexZ(3);
+  fTrackCuts->SetRequireTPCRefit(kTRUE);
+  fTrackCuts->SetRequireITSRefit(kTRUE);
+  fTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kAny);
+  fTrackFilter = new AliAnalysisFilter("trackFilter");
+  fTrackFilter->AddCuts(fTrackCuts);
+
+
+
+  // ------- setup PIDCombined
+  fPIDCombined=new AliPIDCombined;
+  fPIDCombined->SetDefaultTPCPriors();
+  fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTPC+AliPIDResponse::kDetTOF);
+
+  // no light nuclei - no need to call it, this is default
+  //  fPIDCombined->SetSelectedSpecies(AliPID::kSPECIES);
+
+
+  fHistList.Add(new TH1D("nEvents","Number of Evnets;Selection",2,0,2));
+
+  for (Int_t ispec=0; ispec<5; ++ispec){
+
+    fProbTPC[ispec]=new TH2D(Form("prob%s_mom_TPC",AliPID::ParticleName(ispec)),
+                                   Form("%s probability vs. momentum;momentum;probability",AliPID::ParticleName(ispec)),
+                                   100,0.,20.,50,0.,1.);
+    fHistList.Add(fProbTPC[ispec]);
+    fProbTPCnSigma[ispec]=new TH2D(Form("prob%s_nSigma_TPC",AliPID::ParticleName(ispec)),
+                                   Form("%s probability vs. n#sigma;n#sigma;probability",AliPID::ParticleName(ispec)),
+                                   20,-5.,5.,50,0.,1.);
+    fHistList.Add(fProbTPCnSigma[ispec]);
+
+    for (Int_t ibin=0;ibin<kPtBins;ibin++) {
+      fProbTPCnSigTPCMom[ibin][ispec]=new TH2D(Form("prob%s_nSigma_TPC (%s)",AliPID::ParticleName(ispec),fgkBinMomDesc[ibin]),
+                                              Form("%s probability vs. n#sigma;n#sigma;probability",AliPID::ParticleName(ispec)),
+                                              20,-5.,5.,50,0.,1.);
+      fHistList.Add(fProbTPCnSigTPCMom[ibin][ispec]);
+    }
+
+
+
+    fProbTOF[ispec]=new TH2D(Form("prob%s_mom_TOF",AliPID::ParticleName(ispec)),
+                                   Form("%s probability vs. momentum;momentum;probability",AliPID::ParticleName(ispec)),
+                                   100,0.,20.,50,0.,1.);
+    fHistList.Add(fProbTOF[ispec]);
+    fProbTOFnSigma[ispec]=new TH2D(Form("prob%s_nSigma_TOF",AliPID::ParticleName(ispec)),
+                                   Form("%s probability vs. n#sigma;n#sigma;probability",AliPID::ParticleName(ispec)),
+                                   20,-5.,5.,50,0.,1.);
+    fHistList.Add(fProbTOFnSigma[ispec]);
+    for (Int_t ibin=0;ibin<kPtBins;ibin++) {
+      fProbTOFnSigTOFMom[ibin][ispec]=new TH2D(Form("prob%s_nSigma_TOF (%s)",AliPID::ParticleName(ispec),fgkBinMomDesc[ibin]),
+                                              Form("%s probability vs. n#sigma;n#sigma;probability",AliPID::ParticleName(ispec)),
+                                              20,-5.,5.,50,0.,1.);
+      fHistList.Add(fProbTOFnSigTOFMom[ibin][ispec]);
+    }
+
+
+
+    fProbTPCTOF[ispec]=new TH2D(Form("prob%s_mom_TPCTOF",AliPID::ParticleName(ispec)),
+                                   Form("%s probability vs. momentum;momentum;probability",AliPID::ParticleName(ispec)),
+                                   100,0.,20.,50,0.,1.);
+    fHistList.Add(fProbTPCTOF[ispec]);
+    fProbTPCTOFnSigmaTPC[ispec]=new TH2D(Form("probTPCTOF%s_nSigma_TPC",AliPID::ParticleName(ispec)),
+                                   Form("%s TPCTOF probability vs. n#sigmaTPC;n#sigma;probability",AliPID::ParticleName(ispec)),
+                                   20,-5.,5.,50,0.,1.);
+    fHistList.Add(fProbTPCTOFnSigmaTPC[ispec]);
+    for (Int_t ibin=0;ibin<kPtBins;ibin++) {
+      fProbTPCTOFnSigTPCMom[ibin][ispec]=new TH2D(Form("probTPCTOF%s_nSigma_TPC (%s)",AliPID::ParticleName(ispec),fgkBinMomDesc[ibin]),
+                                              Form("%s probability vs. n#sigma;n#sigma;probability",AliPID::ParticleName(ispec)),
+                                              20,-5.,5.,50,0.,1.);
+      fHistList.Add(fProbTPCTOFnSigTPCMom[ibin][ispec]);
+    }
+
+
+
+    // basic priors
+    fPriors[ispec]=new TH1F(Form("%s_priors",AliPID::ParticleName(ispec)),
+                           Form("%s priors vs momentum",AliPID::ParticleName(ispec)),
+                           100,0.,20.);
+    fHistList.Add(fPriors[ispec]);
+    switch (ispec) {
+    case AliPID::kElectron:
+      for (Int_t ich=1;ich<=100;ich++) fPriors[ispec]->SetBinContent(ich,0.02);
+      break;
+    case AliPID::kMuon:
+      for (Int_t ich=1;ich<=100;ich++) fPriors[ispec]->SetBinContent(ich,0.02);
+      break;
+    case AliPID::kPion:
+      for (Int_t ich=1;ich<=100;ich++) fPriors[ispec]->SetBinContent(ich,0.56);
+      break;
+    case AliPID::kKaon:
+      for (Int_t ich=1;ich<=100;ich++) fPriors[ispec]->SetBinContent(ich,0.20);
+      break;
+    case AliPID::kProton:
+      for (Int_t ich=1;ich<=100;ich++) fPriors[ispec]->SetBinContent(ich,0.20);
+      break;
+    default:
+      break;
+    }
+    fPIDCombined->SetPriorDistribution((AliPID::EParticleType)ispec,fPriors[ispec]);
+
+    // priors used
+    fPriorsUsed[ispec] = new TH2D(Form("%s_priorsUsed",AliPID::ParticleName(ispec)),
+                           Form("%s priors vs transverse momentum;p_{t} (GeV/c);priors",AliPID::ParticleName(ispec)),
+                                 100,0.,20.,101,0,1.01);      
+    fHistList.Add(fPriorsUsed[ispec]);
+  }
+
+
   fDeDx = new TH2D("hDeDx",";p_{TPC};dE/dx (a.u.)",500,0,5,500,0,500);
   fHistList.Add(fDeDx);
   fDeDxTuned = new TH2D("hDeDxTuned",";p_{TPC};dE/dx (a.u.)",500,0,5,500,0,500);
   fHistList.Add(fDeDxTuned);
 
-  fHistList.SetOwner();\r
-  PostData(1,&fHistList);\r
-\r
-\r
-}\r
-\r
-//_________________________________________________________________________________\r
-void AliAnalysisTaskPIDCombined::UserExec(Option_t *)\r
-{\r
-  //\r
-  // Main loop. Called for every event\r
-  //\r
-  AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();\r
-  AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());\r
-  fPIDResponse=inputHandler->GetPIDResponse();\r
-  if (!fPIDResponse) AliFatal("This Task needs the PID response attached to the inputHandler");\r
-\r
-  //  Printf(" ---------------------- UserExec PID task ---------------------");\r
-  \r
-  FillHistogram("nEvents",0.);\r
-\r
-  AliVEvent *event=InputEvent();\r
-  AliVTrack *track=0x0;\r
-  Int_t ntracks=event->GetNumberOfTracks();\r
-\r
-  Double_t probTPC[AliPID::kSPECIES]={0.};\r
-  Double_t probTOF[AliPID::kSPECIES]={0.};\r
-  Double_t probTPCTOF[AliPID::kSPECIES]={0.};\r
-  \r
-  //loop over all tracks\r
-  for (Int_t itrack=0; itrack<ntracks; ++itrack){\r
-\r
-    track=(AliVTrack*)event->GetTrack(itrack);\r
-\r
-    if ( fTrackFilter->IsSelected(track) ) {\r
-\r
-      Double_t mom=track->GetTPCmomentum();\r
-      Int_t ibin=GetMomBin(mom);\r
-\r
-      fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTPC);\r
-      UInt_t detUsed = fPIDCombined->ComputeProbabilities(track, fPIDResponse, probTPC);\r
-     \r
-      if (detUsed != 0) {  // TPC is available\r
-       for (Int_t ispec=0; ispec<AliPID::kSPECIES; ++ispec) {\r
-         Double_t nSigmaTPC = fPIDResponse->NumberOfSigmasTPC(track,(AliPID::EParticleType)ispec);\r
-         fProbTPC[ispec]->Fill(mom,probTPC[ispec]);\r
-         fProbTPCnSigma[ispec]->Fill(nSigmaTPC,probTPC[ispec]);\r
-         fProbTPCnSigTPCMom[ibin][ispec]->Fill(nSigmaTPC,probTPC[ispec]);\r
-       }\r
-\r
-       // compute priors for TPC+TOF, even if we ask just TOF for PID\r
-       fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTOF);\r
-       detUsed = fPIDCombined->ComputeProbabilities(track, fPIDResponse, probTOF);\r
-       Double_t priors[5];     // check priors used for TOF\r
-       fPIDCombined->GetPriors(track,priors,fPIDResponse,detUsed);\r
-       for(Int_t ispec=0;ispec<5;ispec++) fPriorsUsed[ispec]->Fill(TMath::Abs(track->Pt()),priors[ispec]);\r
-\r
-       if (detUsed != 0) {  // TOF is available\r
-         for (Int_t ispec=0; ispec<AliPID::kSPECIES; ++ispec) {\r
-           Double_t nSigmaTOF = fPIDResponse->NumberOfSigmasTOF(track,(AliPID::EParticleType)ispec);\r
-           fProbTOF[ispec]->Fill(mom,probTOF[ispec]);\r
-           fProbTOFnSigma[ispec]->Fill(nSigmaTOF,probTOF[ispec]);\r
-           fProbTOFnSigTOFMom[ibin][ispec]->Fill(nSigmaTOF,probTOF[ispec]);\r
-         }\r
-       }\r
-\r
-       fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTOF|AliPIDResponse::kDetTPC);\r
-       detUsed = fPIDCombined->ComputeProbabilities(track, fPIDResponse, probTPCTOF);\r
-       if (detUsed == (UInt_t)fPIDCombined->GetDetectorMask() ) {\r
-         for (Int_t ispec=0; ispec<AliPID::kSPECIES; ++ispec) {\r
-           Double_t nSigmaTPC = fPIDResponse->NumberOfSigmasTPC(track,(AliPID::EParticleType)ispec);\r
-           fProbTPCTOF[ispec]->Fill(mom,probTPCTOF[ispec]);\r
-           fProbTPCTOFnSigmaTPC[ispec]->Fill(nSigmaTPC,probTPCTOF[ispec]);\r
-           fProbTPCTOFnSigTPCMom[ibin][ispec]->Fill(nSigmaTPC,probTPCTOF[ispec]);\r
-         }\r
-       }\r
-\r
-      }\r
-\r
+  fHistList.SetOwner();
+  PostData(1,&fHistList);
+
+
+}
+
+//_________________________________________________________________________________
+void AliAnalysisTaskPIDCombined::UserExec(Option_t *)
+{
+  //
+  // Main loop. Called for every event
+  //
+  AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
+  AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
+  fPIDResponse=inputHandler->GetPIDResponse();
+  if (!fPIDResponse) AliFatal("This Task needs the PID response attached to the inputHandler");
+
+  //  Printf(" ---------------------- UserExec PID task ---------------------");
+  
+  FillHistogram("nEvents",0.);
+
+  AliVEvent *event=InputEvent();
+  AliVTrack *track=0x0;
+  Int_t ntracks=event->GetNumberOfTracks();
+
+  Double_t probTPC[AliPID::kSPECIES]={0.};
+  Double_t probTOF[AliPID::kSPECIES]={0.};
+  Double_t probTPCTOF[AliPID::kSPECIES]={0.};
+  
+  //loop over all tracks
+  for (Int_t itrack=0; itrack<ntracks; ++itrack){
+
+    track=(AliVTrack*)event->GetTrack(itrack);
+
+    if ( fTrackFilter->IsSelected(track) ) {
+
+      Double_t mom=track->GetTPCmomentum();
+      Int_t ibin=GetMomBin(mom);
+
+      fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTPC);
+      UInt_t detUsed = fPIDCombined->ComputeProbabilities(track, fPIDResponse, probTPC);
+     
+      if (detUsed != 0) {  // TPC is available
+       for (Int_t ispec=0; ispec<AliPID::kSPECIES; ++ispec) {
+         Double_t nSigmaTPC = fPIDResponse->NumberOfSigmasTPC(track,(AliPID::EParticleType)ispec);
+         fProbTPC[ispec]->Fill(mom,probTPC[ispec]);
+         fProbTPCnSigma[ispec]->Fill(nSigmaTPC,probTPC[ispec]);
+         fProbTPCnSigTPCMom[ibin][ispec]->Fill(nSigmaTPC,probTPC[ispec]);
+       }
+
+       // compute priors for TPC+TOF, even if we ask just TOF for PID
+       fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTOF);
+       detUsed = fPIDCombined->ComputeProbabilities(track, fPIDResponse, probTOF);
+       Double_t priors[5];     // check priors used for TOF
+       fPIDCombined->GetPriors(track,priors,fPIDResponse,detUsed);
+       for(Int_t ispec=0;ispec<5;ispec++) fPriorsUsed[ispec]->Fill(TMath::Abs(track->Pt()),priors[ispec]);
+
+       if (detUsed != 0) {  // TOF is available
+         for (Int_t ispec=0; ispec<AliPID::kSPECIES; ++ispec) {
+           Double_t nSigmaTOF = fPIDResponse->NumberOfSigmasTOF(track,(AliPID::EParticleType)ispec);
+           fProbTOF[ispec]->Fill(mom,probTOF[ispec]);
+           fProbTOFnSigma[ispec]->Fill(nSigmaTOF,probTOF[ispec]);
+           fProbTOFnSigTOFMom[ibin][ispec]->Fill(nSigmaTOF,probTOF[ispec]);
+         }
+       }
+
+       fPIDCombined->SetDetectorMask(AliPIDResponse::kDetTOF|AliPIDResponse::kDetTPC);
+       detUsed = fPIDCombined->ComputeProbabilities(track, fPIDResponse, probTPCTOF);
+       if (detUsed == (UInt_t)fPIDCombined->GetDetectorMask() ) {
+         for (Int_t ispec=0; ispec<AliPID::kSPECIES; ++ispec) {
+           Double_t nSigmaTPC = fPIDResponse->NumberOfSigmasTPC(track,(AliPID::EParticleType)ispec);
+           fProbTPCTOF[ispec]->Fill(mom,probTPCTOF[ispec]);
+           fProbTPCTOFnSigmaTPC[ispec]->Fill(nSigmaTPC,probTPCTOF[ispec]);
+           fProbTPCTOFnSigTPCMom[ibin][ispec]->Fill(nSigmaTPC,probTPCTOF[ispec]);
+         }
+       }
+
+      }
+
       fPIDResponse->GetTPCsignalTunedOnData(track);
 
       fDeDx->Fill(mom,track->GetTPCsignal());
       fDeDxTuned->Fill(mom,track->GetTPCsignalTunedOnData());
-\r
-    }\r
-  }\r
-\r
-  PostData(1, &fHistList);\r
-}\r
-\r
-//_________________________________________________________________________________\r
-void AliAnalysisTaskPIDCombined::FillHistogram(const char* name, Double_t x, Double_t weight)\r
-{\r
-  //\r
-  // Fill 1D histogram by name\r
-  //\r
-  ((TH1*)fHistList.FindObject(name))->Fill(x,weight);\r
-}\r
-\r
-//_________________________________________________________________________________\r
-void AliAnalysisTaskPIDCombined::FillHistogram(const char* name, Double_t x, Double_t y, Double_t weight)\r
-{\r
-  //\r
-  // Fill 2D histogram by name\r
-  //\r
-  ((TH2*)fHistList.FindObject(name))->Fill(x,y,weight);\r
-}\r
-\r
-\r
-//_________________________________________________________________________________\r
-Int_t AliAnalysisTaskPIDCombined::GetMomBin(Float_t mom)\r
-{\r
-  //\r
-  // Given momentum return histogram to be filled\r
-  //\r
-  if (mom>0. && mom < 0.5) return 0;\r
-  if (mom>=0.5 && mom < 0.7) return 1;\r
-  if (mom>=0.7 && mom < 1.0) return 2;\r
-  if (mom>=1.0 && mom < 1.5) return 3;\r
-  if (mom>=1.5 && mom < 2.0) return 4;\r
-  return kPtBins-1;\r
-}\r
-\r
+
+    }
+  }
+
+  PostData(1, &fHistList);
+}
+
+//_________________________________________________________________________________
+void AliAnalysisTaskPIDCombined::FillHistogram(const char* name, Double_t x, Double_t weight)
+{
+  //
+  // Fill 1D histogram by name
+  //
+  ((TH1*)fHistList.FindObject(name))->Fill(x,weight);
+}
+
+//_________________________________________________________________________________
+void AliAnalysisTaskPIDCombined::FillHistogram(const char* name, Double_t x, Double_t y, Double_t weight)
+{
+  //
+  // Fill 2D histogram by name
+  //
+  ((TH2*)fHistList.FindObject(name))->Fill(x,y,weight);
+}
+
+
+//_________________________________________________________________________________
+Int_t AliAnalysisTaskPIDCombined::GetMomBin(Float_t mom)
+{
+  //
+  // Given momentum return histogram to be filled
+  //
+  if (mom>0. && mom < 0.5) return 0;
+  if (mom>=0.5 && mom < 0.7) return 1;
+  if (mom>=0.7 && mom < 1.0) return 2;
+  if (mom>=1.0 && mom < 1.5) return 3;
+  if (mom>=1.5 && mom < 2.0) return 4;
+  return kPtBins-1;
+}
+
index 8b93035..5bffb07 100644 (file)
@@ -1,79 +1,79 @@
-#ifndef ALIPIDCOMBINEDTASK_H\r
-#define ALIPIDCOMBINEDTASK_H\r
-/* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *\r
- * See cxx source for full Copyright notice                               */\r
-\r
-//#########################################################\r
-//#                                                       # \r
-//#        Task for testing the combined PID              #\r
-//#                                                       #\r
-//#  Pietro Antonioli, INFN / Pietro.Antonioli@bo.infn.it #\r
-//#  Jens Wiechula, Uni Tübingen / Jens.Wiechula@cern.ch  #\r
-//#                                                       #\r
-//#########################################################\r
-\r
-#include <AliPID.h>\r
-#include <AliPIDResponse.h>\r
-#include <AliPIDCombined.h>\r
-\r
-#include <AliESDtrackCuts.h>\r
-#include <AliAnalysisFilter.h>\r
-\r
-#include "AliAnalysisTaskSE.h"\r
-\r
-class TH1F;\r
-class TH2D;\r
-class fPIDResponse;\r
-class fPIDCombined;\r
-\r
-class AliAnalysisTaskPIDCombined : public AliAnalysisTaskSE {\r
-  \r
-public:\r
-  static const Int_t kPtBins = 6;\r
-\r
-\r
-  AliAnalysisTaskPIDCombined();\r
-  AliAnalysisTaskPIDCombined(const char *name);\r
-  virtual ~AliAnalysisTaskPIDCombined(){;}\r
-  \r
-  virtual void  UserExec(Option_t *option);\r
-  virtual void  UserCreateOutputObjects();\r
-    \r
-\r
-private:\r
-\r
-  TList fHistList;                   //! list of histograms\r
-  TH2D *fProbTPCnSigma[AliPID::kSPECIES];    //! probabilities vs nSigma in the TPC\r
-  TH2D *fProbTOFnSigma[AliPID::kSPECIES];    //! probabilities vs nSigma  the TOF\r
-  TH2D *fProbTPCTOFnSigmaTPC[AliPID::kSPECIES];    //! comb. probabilities vs nSigma TPC\r
-  TH2D *fProbTPC[AliPID::kSPECIES];          //! probabilities vs mom in the TPC\r
-  TH2D *fProbTOF[AliPID::kSPECIES];          //! probabilities vs mom in the TOF\r
-  TH2D *fProbTPCTOF[AliPID::kSPECIES];       //! combined probabilities vs mom TPC-TOF\r
-  TH1F *fPriors[AliPID::kSPECIES];           //! priors\r
-\r
-  TH2D *fProbTPCTOFnSigTPCMom[kPtBins][AliPID::kSPECIES];  // prob. x mom. bins\r
-  TH2D *fProbTPCnSigTPCMom[kPtBins][AliPID::kSPECIES];     // prob. x mom. bins\r
-  TH2D *fProbTOFnSigTOFMom[kPtBins][AliPID::kSPECIES];     // prob. x mom. bins\r
-\r
-  TH2D *fPriorsUsed[AliPID::kSPECIES];       //! priors used\r
-\r
-  const AliPIDResponse *fPIDResponse;     //! PID response object\r
-  AliPIDCombined       *fPIDCombined;     //! combined PID object\r
-  AliESDtrackCuts      *fTrackCuts;            //! track selection\r
-  AliAnalysisFilter    *fTrackFilter;         //! track filter\r
+#ifndef ALIPIDCOMBINEDTASK_H
+#define ALIPIDCOMBINEDTASK_H
+/* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+//#########################################################
+//#                                                       # 
+//#        Task for testing the combined PID              #
+//#                                                       #
+//#  Pietro Antonioli, INFN / Pietro.Antonioli@bo.infn.it #
+//#  Jens Wiechula, Uni Tübingen / Jens.Wiechula@cern.ch  #
+//#                                                       #
+//#########################################################
+
+#include <AliPID.h>
+#include <AliPIDResponse.h>
+#include <AliPIDCombined.h>
+
+#include <AliESDtrackCuts.h>
+#include <AliAnalysisFilter.h>
+
+#include "AliAnalysisTaskSE.h"
+
+class TH1F;
+class TH2D;
+class fPIDResponse;
+class fPIDCombined;
+
+class AliAnalysisTaskPIDCombined : public AliAnalysisTaskSE {
+  
+public:
+  static const Int_t kPtBins = 6;
+
+
+  AliAnalysisTaskPIDCombined();
+  AliAnalysisTaskPIDCombined(const char *name);
+  virtual ~AliAnalysisTaskPIDCombined(){;}
+  
+  virtual void  UserExec(Option_t *option);
+  virtual void  UserCreateOutputObjects();
+    
+
+private:
+
+  TList fHistList;                   //! list of histograms
+  TH2D *fProbTPCnSigma[AliPID::kSPECIES];    //! probabilities vs nSigma in the TPC
+  TH2D *fProbTOFnSigma[AliPID::kSPECIES];    //! probabilities vs nSigma  the TOF
+  TH2D *fProbTPCTOFnSigmaTPC[AliPID::kSPECIES];    //! comb. probabilities vs nSigma TPC
+  TH2D *fProbTPC[AliPID::kSPECIES];          //! probabilities vs mom in the TPC
+  TH2D *fProbTOF[AliPID::kSPECIES];          //! probabilities vs mom in the TOF
+  TH2D *fProbTPCTOF[AliPID::kSPECIES];       //! combined probabilities vs mom TPC-TOF
+  TH1F *fPriors[AliPID::kSPECIES];           //! priors
+
+  TH2D *fProbTPCTOFnSigTPCMom[kPtBins][AliPID::kSPECIES];  // prob. x mom. bins
+  TH2D *fProbTPCnSigTPCMom[kPtBins][AliPID::kSPECIES];     // prob. x mom. bins
+  TH2D *fProbTOFnSigTOFMom[kPtBins][AliPID::kSPECIES];     // prob. x mom. bins
+
+  TH2D *fPriorsUsed[AliPID::kSPECIES];       //! priors used
+
+  const AliPIDResponse *fPIDResponse;     //! PID response object
+  AliPIDCombined       *fPIDCombined;     //! combined PID object
+  AliESDtrackCuts      *fTrackCuts;            //! track selection
+  AliAnalysisFilter    *fTrackFilter;         //! track filter
 
   TH2D *fDeDx;                              //! histo with the dedx
   TH2D *fDeDxTuned;                         //! histo to check the dedx tuning in MC
 
-\r
-  AliAnalysisTaskPIDCombined(const AliAnalysisTaskPIDCombined &c);\r
-  AliAnalysisTaskPIDCombined& operator= (const AliAnalysisTaskPIDCombined &c);\r
-\r
-  void FillHistogram(const char* name, Double_t x, Double_t weight=1.);\r
-  void FillHistogram(const char* name, Double_t x, Double_t y, Double_t weight=1.);\r
-  Int_t GetMomBin(Float_t mom);\r
-  static const char* fgkBinMomDesc[kPtBins];\r
-  \r
-  ClassDef(AliAnalysisTaskPIDCombined, 2);\r
-};\r
-#endif\r
+
+  AliAnalysisTaskPIDCombined(const AliAnalysisTaskPIDCombined &c);
+  AliAnalysisTaskPIDCombined& operator= (const AliAnalysisTaskPIDCombined &c);
+
+  void FillHistogram(const char* name, Double_t x, Double_t weight=1.);
+  void FillHistogram(const char* name, Double_t x, Double_t y, Double_t weight=1.);
+  Int_t GetMomBin(Float_t mom);
+  static const char* fgkBinMomDesc[kPtBins];
+  
+  ClassDef(AliAnalysisTaskPIDCombined, 2);
+};
+#endif
index aba1d01..53ca7ca 100644 (file)
-#ifndef ALIANALYSISTASKPIDQA_H\r
-#define ALIANALYSISTASKPIDQA_H\r
-\r
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
- * See cxx source for full Copyright notice                               */\r
-\r
-/* $Id: AliAnalysisTaskPIDqa.h 43642 2010-09-17 15:50:04Z wiechula $ */\r
-// Author: Jens Wiechula, 24/02/2011\r
-\r
-//==============================================================================\r
-//\r
-//\r
-//\r
-//\r
-//==============================================================================\r
-\r
-#include <TVectorDfwd.h>\r
-\r
-#ifndef ALIANALYSISTASKSE_H\r
-#include "AliAnalysisTaskSE.h"\r
-#endif\r
-\r
-class AliPIDResponse;\r
-class TList;\r
-class AliVEvent;\r
-class AliESDv0KineCuts;\r
-\r
-class AliAnalysisTaskPIDqa : public AliAnalysisTaskSE {\r
-  \r
-  \r
-public:\r
-  AliAnalysisTaskPIDqa();\r
-  AliAnalysisTaskPIDqa(const char *name);\r
-  virtual ~AliAnalysisTaskPIDqa();\r
-\r
-  virtual void UserCreateOutputObjects();\r
-  \r
-  virtual void UserExec(Option_t */*option*/);\r
-\r
-  \r
-private: \r
-  AliPIDResponse *fPIDResponse;             //! PID response Handler\r
-  AliESDv0KineCuts *fV0cuts;                //! ESD V0 cuts\r
-\r
-  TObjArray *fV0electrons;                  //! array with pointer to identified particles from V0 decays (electrons)\r
-  TObjArray *fV0pions;                      //! array with pointer to identified particles from V0 decays (pions)\r
-  TObjArray *fV0kaons;                      //! array with pointer to identified particles from V0 decays (kaons)\r
-  TObjArray *fV0protons;                    //! array with pointer to identified particles from V0 decays (ptotons)\r
-\r
-  TList                 *fListQA;           //! list with all QA histograms\r
-  TList                 *fListQAits;        //! List with ITS QA histograms\r
-  TList                 *fListQAitsSA;      //! List with ITS SA QA histograms\r
-  TList                 *fListQAitsPureSA;  //! List with ITS pure SA QA histograms\r
-  TList                 *fListQAtpc;        //! List with TPC QA histograms\r
-  TList                 *fListQAtrd;        //! List with TRD QA histograms\r
-  TList                 *fListQAtof;        //! List with TOF QA histograms\r
-  TList                 *fListQAt0;         //! List with T0 QA histograms\r
-  TList                 *fListQAemcal;      //! List with EMCAL QA histograms\r
-  TList                 *fListQAhmpid;      //! List with EMCAL QA histograms\r
-  TList                 *fListQAtofhmpid;   //! List with EMCAL QA histograms\r
-  TList                 *fListQAtpctof;     //! List with combined PID from TPC + TOF\r
-  TList                 *fListQAV0;         //! List with V0 kine cuts QA histograms\r
-  TList                 *fListQAinfo;       //! List with information about loaded splines etc.\r
-\r
-  \r
-  void ExecNewRun();\r
-\r
-  //qa object initialisation\r
-  void SetupITSqa();\r
-  void SetupTPCqa();\r
-  void SetupTRDqa();\r
-  void SetupTOFqa();\r
-  void SetupT0qa();\r
-  void SetupEMCALqa();\r
-  void SetupHMPIDqa();\r
-  void SetupTOFHMPIDqa();\r
-  void SetupTPCTOFqa();\r
-  void SetupV0qa();\r
-  void SetupQAinfo();\r
-\r
-  //\r
-  void FillV0PIDlist();\r
-  void ClearV0PIDlist();\r
-  //\r
-  void FillITSqa();\r
-  void FillTPCqa();\r
-  void FillTRDqa();\r
-  void FillTOFqa();\r
-  void FillT0qa();\r
-  void FillEMCALqa();\r
-  void FillHMPIDqa();\r
-  void FillTOFHMPIDqa();\r
-  void FillTPCTOFqa();\r
-  void FillQAinfo();\r
-  \r
-  //\r
-  void SetRecoInfo();\r
-  \r
-  //helper functions\r
-  TVectorD* MakeLogBinning(Int_t nbinsX, Double_t xmin, Double_t xmax);\r
-  TVectorD* MakeLinBinning(Int_t nbinsX, Double_t xmin, Double_t xmax);\r
-  TVectorD* MakeArbitraryBinning(const char* bins);\r
-  \r
-  \r
-  AliAnalysisTaskPIDqa(const AliAnalysisTaskPIDqa &other);\r
-  AliAnalysisTaskPIDqa& operator=(const AliAnalysisTaskPIDqa &other);\r
-  \r
-  ClassDef(AliAnalysisTaskPIDqa,2)  // Task to properly set the PID response functions of all detectors\r
-};\r
-#endif\r
+#ifndef ALIANALYSISTASKPIDQA_H
+#define ALIANALYSISTASKPIDQA_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id: AliAnalysisTaskPIDqa.h 43642 2010-09-17 15:50:04Z wiechula $ */
+// Author: Jens Wiechula, 24/02/2011
+
+//==============================================================================
+//
+//
+//
+//
+//==============================================================================
+
+#include <TVectorDfwd.h>
+
+#ifndef ALIANALYSISTASKSE_H
+#include "AliAnalysisTaskSE.h"
+#endif
+
+class AliPIDResponse;
+class TList;
+class AliVEvent;
+class AliESDv0KineCuts;
+
+class AliAnalysisTaskPIDqa : public AliAnalysisTaskSE {
+  
+  
+public:
+  AliAnalysisTaskPIDqa();
+  AliAnalysisTaskPIDqa(const char *name);
+  virtual ~AliAnalysisTaskPIDqa();
+
+  virtual void UserCreateOutputObjects();
+  
+  virtual void UserExec(Option_t */*option*/);
+
+  
+private: 
+  AliPIDResponse *fPIDResponse;             //! PID response Handler
+  AliESDv0KineCuts *fV0cuts;                //! ESD V0 cuts
+
+  TObjArray *fV0electrons;                  //! array with pointer to identified particles from V0 decays (electrons)
+  TObjArray *fV0pions;                      //! array with pointer to identified particles from V0 decays (pions)
+  TObjArray *fV0kaons;                      //! array with pointer to identified particles from V0 decays (kaons)
+  TObjArray *fV0protons;                    //! array with pointer to identified particles from V0 decays (ptotons)
+
+  TList                 *fListQA;           //! list with all QA histograms
+  TList                 *fListQAits;        //! List with ITS QA histograms
+  TList                 *fListQAitsSA;      //! List with ITS SA QA histograms
+  TList                 *fListQAitsPureSA;  //! List with ITS pure SA QA histograms
+  TList                 *fListQAtpc;        //! List with TPC QA histograms
+  TList                 *fListQAtrd;        //! List with TRD QA histograms
+  TList                 *fListQAtof;        //! List with TOF QA histograms
+  TList                 *fListQAt0;         //! List with T0 QA histograms
+  TList                 *fListQAemcal;      //! List with EMCAL QA histograms
+  TList                 *fListQAhmpid;      //! List with EMCAL QA histograms
+  TList                 *fListQAtofhmpid;   //! List with EMCAL QA histograms
+  TList                 *fListQAtpctof;     //! List with combined PID from TPC + TOF
+  TList                 *fListQAV0;         //! List with V0 kine cuts QA histograms
+  TList                 *fListQAinfo;       //! List with information about loaded splines etc.
+
+  
+  void ExecNewRun();
+
+  //qa object initialisation
+  void SetupITSqa();
+  void SetupTPCqa();
+  void SetupTRDqa();
+  void SetupTOFqa();
+  void SetupT0qa();
+  void SetupEMCALqa();
+  void SetupHMPIDqa();
+  void SetupTOFHMPIDqa();
+  void SetupTPCTOFqa();
+  void SetupV0qa();
+  void SetupQAinfo();
+
+  //
+  void FillV0PIDlist();
+  void ClearV0PIDlist();
+  //
+  void FillITSqa();
+  void FillTPCqa();
+  void FillTRDqa();
+  void FillTOFqa();
+  void FillT0qa();
+  void FillEMCALqa();
+  void FillHMPIDqa();
+  void FillTOFHMPIDqa();
+  void FillTPCTOFqa();
+  void FillQAinfo();
+  
+  //
+  void SetRecoInfo();
+  
+  //helper functions
+  TVectorD* MakeLogBinning(Int_t nbinsX, Double_t xmin, Double_t xmax);
+  TVectorD* MakeLinBinning(Int_t nbinsX, Double_t xmin, Double_t xmax);
+  TVectorD* MakeArbitraryBinning(const char* bins);
+  
+  
+  AliAnalysisTaskPIDqa(const AliAnalysisTaskPIDqa &other);
+  AliAnalysisTaskPIDqa& operator=(const AliAnalysisTaskPIDqa &other);
+  
+  ClassDef(AliAnalysisTaskPIDqa,2)  // Task to properly set the PID response functions of all detectors
+};
+#endif
index 6e200d4..033caf8 100644 (file)
@@ -1,40 +1,40 @@
-#ifndef ALIANALYSISTASKPHICORR_cxx\r
-#define ALIANALYSISTASKPHICORR_cxx\r
-/*\r
- Simple use case for mixed event analysis\r
- based on ESD or AOD\r
- Delta_phi correlation analysis is performed on charged tracks \r
- for same and mixed events\r
- Author: andreas.morsch@cern.ch \r
-*/\r
-\r
-\r
-class TH1F;\r
-class TList;\r
-class AliESDEvent;\r
-\r
-#include "AliAnalysisTaskME.h"\r
-#include "AliMixedEvent.h"\r
-\r
-class AliAnalysisTaskPhiCorr : public AliAnalysisTaskME {\r
- public:\r
-  AliAnalysisTaskPhiCorr(const char *name = "AliAnalysisTaskPt");\r
-  virtual ~AliAnalysisTaskPhiCorr() {}\r
-  \r
-  virtual void   UserCreateOutputObjects();\r
-  virtual void   UserExec(Option_t *option);\r
-  virtual void   Terminate(Option_t *);\r
-  \r
- private:\r
-  TList       *fHists;        // List with histos\r
-  TH1F        *fHistDphiCO;   // Pt spectrum\r
-  TH1F        *fHistDphiUC;   // Pt spectrum\r
-  AliMixedEvent fMixedEvent;  // Mixed event\r
-  \r
-  AliAnalysisTaskPhiCorr(const AliAnalysisTaskPhiCorr&); // not implemented\r
-  AliAnalysisTaskPhiCorr& operator=(const AliAnalysisTaskPhiCorr&); // not implemented\r
-  \r
-  ClassDef(AliAnalysisTaskPhiCorr, 1); // example of analysis\r
-};\r
-\r
-#endif\r
+#ifndef ALIANALYSISTASKPHICORR_cxx
+#define ALIANALYSISTASKPHICORR_cxx
+/*
+ Simple use case for mixed event analysis
+ based on ESD or AOD
+ Delta_phi correlation analysis is performed on charged tracks 
+ for same and mixed events
+ Author: andreas.morsch@cern.ch 
+*/
+
+
+class TH1F;
+class TList;
+class AliESDEvent;
+
+#include "AliAnalysisTaskME.h"
+#include "AliMixedEvent.h"
+
+class AliAnalysisTaskPhiCorr : public AliAnalysisTaskME {
+ public:
+  AliAnalysisTaskPhiCorr(const char *name = "AliAnalysisTaskPt");
+  virtual ~AliAnalysisTaskPhiCorr() {}
+  
+  virtual void   UserCreateOutputObjects();
+  virtual void   UserExec(Option_t *option);
+  virtual void   Terminate(Option_t *);
+  
+ private:
+  TList       *fHists;        // List with histos
+  TH1F        *fHistDphiCO;   // Pt spectrum
+  TH1F        *fHistDphiUC;   // Pt spectrum
+  AliMixedEvent fMixedEvent;  // Mixed event
+  
+  AliAnalysisTaskPhiCorr(const AliAnalysisTaskPhiCorr&); // not implemented
+  AliAnalysisTaskPhiCorr& operator=(const AliAnalysisTaskPhiCorr&); // not implemented
+  
+  ClassDef(AliAnalysisTaskPhiCorr, 1); // example of analysis
+};
+
+#endif
index 7290b9b..9f7bef1 100644 (file)
-/**************************************************************************\r
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
- *                                                                        *\r
- * Author: The ALICE Off-line Project.                                    *\r
- * Contributors are mentioned in the code where appropriate.              *\r
- *                                                                        *\r
- * Permission to use, copy, modify and distribute this software and its   *\r
- * documentation strictly for non-commercial purposes is hereby granted   *\r
- * without fee, provided that the above copyright notice appears in all   *\r
- * copies and that both the copyright notice and this permission notice   *\r
- * appear in the supporting documentation. The authors make no claims     *\r
- * about the suitability of this software for any purpose. It is          *\r
- * provided "as is" without express or implied warranty.                  *\r
- **************************************************************************/\r
-#include <TCanvas.h>\r
-#include <TClass.h>\r
-#include <TCollection.h>\r
-#include <TDirectory.h>\r
-#include <TH1F.h>\r
-#include <TH1I.h>\r
-#include <TH2I.h>\r
-#include <TMath.h>\r
-#include <TIterator.h>\r
-#include <TString.h>\r
-#include <TList.h>\r
-\r
-#include "AliAnalysisManager.h"\r
-#include "AliInputEventHandler.h"\r
-#include "AliESDtrack.h"\r
-#include "AliESDEvent.h"\r
-#include "AliLog.h"\r
-#include "AliPIDResponse.h"\r
-\r
-#include "AliESDpidCuts.h"\r
-\r
-ClassImp(AliESDpidCuts)\r
-\r
-const Int_t AliESDpidCuts::kNcuts = 3;\r
-\r
-//_____________________________________________________________________\r
-AliESDpidCuts::AliESDpidCuts(const Char_t *name, const Char_t *title):\r
-    AliAnalysisCuts(name, title)\r
-  , fPIDresponse(NULL)\r
-  , fTPCsigmaCutRequired(0)\r
-  , fTOFsigmaCutRequired(0)\r
-  , fCutTPCclusterRatio(0.)\r
-  , fMinMomentumTOF(0.5)\r
-  , fHcutStatistics(NULL)\r
-  , fHcutCorrelation(NULL)\r
-{\r
-  //\r
-  // Default constructor\r
-  //\r
-  \r
-  memset(fCutTPCnSigma, 0, sizeof(Float_t)* AliPID::kSPECIES * 2);\r
-  memset(fCutTOFnSigma, 0, sizeof(Float_t)* AliPID::kSPECIES * 2);\r
-\r
-  memset(fHclusterRatio, 0, sizeof(TH1F *) * 2);\r
-  memset(fHnSigmaTPC, 0, sizeof(TH1F *) * AliPID::kSPECIES * 2);\r
-  memset(fHnSigmaTOF, 0, sizeof(TH1F *) * AliPID::kSPECIES * 2);\r
-}\r
-\r
-//_____________________________________________________________________\r
-AliESDpidCuts::AliESDpidCuts(const AliESDpidCuts &ref):\r
-    AliAnalysisCuts(ref)\r
-  , fPIDresponse(NULL)\r
-  , fTPCsigmaCutRequired(ref.fTPCsigmaCutRequired)\r
-  , fTOFsigmaCutRequired(ref.fTOFsigmaCutRequired)\r
-  , fCutTPCclusterRatio(ref.fCutTPCclusterRatio)\r
-  , fMinMomentumTOF(ref.fMinMomentumTOF)\r
-  , fHcutStatistics(NULL)\r
-  , fHcutCorrelation(NULL)\r
-{\r
-  //\r
-  // Copy constructor\r
-  //\r
-  fPIDresponse = ref.fPIDresponse;\r
-  memcpy(fCutTPCnSigma, ref.fCutTPCnSigma, sizeof(Float_t) * AliPID::kSPECIES * 2);\r
-  memcpy(fCutTOFnSigma, ref.fCutTOFnSigma, sizeof(Float_t) * AliPID::kSPECIES * 2);\r
-  \r
-  if(ref.fHcutStatistics) fHcutStatistics = dynamic_cast<TH1I *>(ref.fHcutStatistics->Clone());\r
-  if(ref.fHcutCorrelation) fHcutCorrelation = dynamic_cast<TH2I *>(ref.fHcutCorrelation->Clone());\r
-  for(Int_t imode = 0; imode < 2; imode++){\r
-    if(ref.fHclusterRatio[imode]) fHclusterRatio[imode] = dynamic_cast<TH1F *>(ref.fHclusterRatio[imode]->Clone());\r
-    for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){\r
-      if(fHnSigmaTPC[ispec][imode]) fHnSigmaTPC[ispec][imode] = dynamic_cast<TH1F *>(fHnSigmaTPC[ispec][imode]->Clone());\r
-      if(fHnSigmaTOF[ispec][imode]) fHnSigmaTOF[ispec][imode] = dynamic_cast<TH1F *>(fHnSigmaTPC[ispec][imode]->Clone());\r
-    }\r
-  }\r
-}\r
-\r
-//_____________________________________________________________________\r
-AliESDpidCuts &AliESDpidCuts::operator=(const AliESDpidCuts &ref){\r
-  //\r
-  // Assignment operator\r
-  //\r
-  if(this != &ref)\r
-    ref.Copy(*this);\r
-  return *this;\r
-}\r
-\r
-//_____________________________________________________________________\r
-AliESDpidCuts::~AliESDpidCuts(){\r
-  //\r
-  // Destructor\r
-  //\r
-\r
-  delete fHcutCorrelation;\r
-  for(Int_t imode = 0; imode < 2; imode++){\r
-    delete fHclusterRatio[imode];\r
-    for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){\r
-      delete fHnSigmaTPC[ispec][imode];\r
-      delete fHnSigmaTOF[ispec][imode];\r
-    }\r
-  }\r
-}\r
-\r
-//_____________________________________________________________________\r
-void AliESDpidCuts::Init(){\r
-  //\r
-  // Init function, get PID response from the Analysis Manager\r
-  //\r
-  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
-  if(mgr){\r
-    AliInputEventHandler *handler = dynamic_cast<AliInputEventHandler*>(mgr->GetInputEventHandler());\r
-    if(handler){\r
-      fPIDresponse = handler->GetPIDResponse();\r
-    }\r
-  }\r
-}\r
-\r
-//_____________________________________________________________________\r
-Bool_t AliESDpidCuts::IsSelected(TObject *obj){\r
-  //\r
-  // Select Track\r
-  // \r
-  AliESDtrack * trk = dynamic_cast<AliESDtrack*>(obj);\r
-  if(!trk){\r
-    AliError("Provided object is not AliESDtrack!");\r
-    return kFALSE;\r
-  }\r
-  const AliESDEvent* evt = trk->GetESDEvent();\r
-  if(!evt){\r
-    AliError("No AliESDEvent!");\r
-    return kFALSE;\r
-  }\r
-  return AcceptTrack(trk, evt);\r
-}\r
-\r
-//_____________________________________________________________________\r
-void AliESDpidCuts::Copy(TObject &c) const {\r
-  //\r
-  // Copy function\r
-  //\r
-  AliESDpidCuts &target = dynamic_cast<AliESDpidCuts &>(c);\r
-\r
-  target.fPIDresponse = fPIDresponse;\r
-\r
-  target.fCutTPCclusterRatio = fCutTPCclusterRatio;\r
-  target.fMinMomentumTOF = fMinMomentumTOF;\r
-\r
-  target.fTPCsigmaCutRequired = fTPCsigmaCutRequired;\r
-  target.fTOFsigmaCutRequired = fTOFsigmaCutRequired;\r
-  \r
-  if(fHcutStatistics) target.fHcutStatistics = dynamic_cast<TH1I *>(fHcutStatistics->Clone());\r
-  if(fHcutCorrelation) target.fHcutCorrelation = dynamic_cast<TH2I *>(fHcutCorrelation->Clone());\r
-  for(Int_t imode = 0; imode < 2; imode++){\r
-    if(fHclusterRatio[imode]) target.fHclusterRatio[imode] = dynamic_cast<TH1F *>(fHclusterRatio[imode]->Clone());\r
-    for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){\r
-      if(fHnSigmaTPC[ispec][imode]) target.fHnSigmaTPC[ispec][imode] = dynamic_cast<TH1F *>(fHnSigmaTPC[ispec][imode]->Clone());\r
-      if(fHnSigmaTOF[ispec][imode]) target.fHnSigmaTOF[ispec][imode] = dynamic_cast<TH1F *>(fHnSigmaTOF[ispec][imode]->Clone());\r
-    }\r
-  }\r
\r
-  memcpy(target.fCutTPCnSigma, fCutTPCnSigma, sizeof(Float_t) * AliPID::kSPECIES * 2);\r
-  memcpy(target.fCutTOFnSigma, fCutTOFnSigma, sizeof(Float_t) * AliPID::kSPECIES * 2);\r
\r
-  AliESDpidCuts::Copy(c);\r
-}\r
-\r
-//_____________________________________________________________________\r
-Long64_t AliESDpidCuts::Merge(TCollection *coll){\r
-  //\r
-  // Merge Cut objects\r
-  //\r
-  if(!coll) return 0;\r
-  if(coll->IsEmpty())   return 1;\r
-  if(!HasHistograms())  return 0;\r
-  \r
-  TIterator *iter = coll->MakeIterator();\r
-  TObject *o = NULL; \r
-  AliESDpidCuts *ref = NULL;\r
-  Int_t counter = 0;\r
-  while((o = iter->Next())){\r
-    ref = dynamic_cast<AliESDpidCuts *>(o);\r
-    if(!ref) continue;\r
-    if(!ref->HasHistograms()) continue;\r
-\r
-    fHcutStatistics->Add(ref->fHcutStatistics);\r
-    fHcutCorrelation->Add(ref->fHcutCorrelation);\r
-    for(Int_t imode = 0; imode < 2; imode++){\r
-      fHclusterRatio[imode]->Add(ref->fHclusterRatio[imode]);\r
-      for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){\r
-        fHnSigmaTPC[ispec][imode]->Add(ref->fHnSigmaTPC[ispec][imode]);\r
-        fHnSigmaTOF[ispec][imode]->Add(ref->fHnSigmaTOF[ispec][imode]);\r
-      }\r
-    }\r
-    ++counter;\r
-  }\r
-  return ++counter;\r
-}\r
-\r
-//_____________________________________________________________________\r
-void AliESDpidCuts::DefineHistograms(Color_t color){\r
-  //\r
-  // Swich on QA and create the histograms\r
-  //\r
-  SetBit(kHasHistograms, kTRUE);\r
-  fHcutStatistics = new TH1I("fHcutStatistics", "Cut Statistics", kNcuts, 0, kNcuts);\r
-  fHcutStatistics->SetLineColor(color);\r
-  fHcutCorrelation = new TH2I("fHcutCorrelation", "Cut Correlation", kNcuts, 0, kNcuts, kNcuts, 0, kNcuts);\r
-  TString cutname[kNcuts] = {"TPCclusterRatio", "TPC sigma", "TOF sigma"};\r
-  for(Int_t icut = 0; icut < kNcuts; icut++){\r
-    fHcutStatistics->GetXaxis()->SetBinLabel(fHcutStatistics->GetXaxis()->GetFirst() + icut, cutname[icut].Data());\r
-    fHcutCorrelation->GetXaxis()->SetBinLabel(fHcutCorrelation->GetXaxis()->GetFirst() + icut, cutname[icut].Data());\r
-    fHcutCorrelation->GetYaxis()->SetBinLabel(fHcutCorrelation->GetYaxis()->GetFirst() + icut, cutname[icut].Data());\r
-  }\r
-  Char_t hname[256], htitle[256];\r
-  for(Int_t imode = 0; imode < 2; imode++){\r
-    snprintf(hname, 256, "fHclusterRatio%s", imode ? "After" : "Before");\r
-    snprintf(htitle, 256, "TPC cluster Ratio %s cuts;Ratio;Entries", imode ? "after" : "before");\r
-    fHclusterRatio[imode] = new TH1F(hname, htitle, 20, 0., 1.);\r
-    for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){\r
-      snprintf(hname, 256, "fHnSigma%sTPC%s", AliPID::ParticleName(ispec), imode ? "after" : "before");\r
-      snprintf(htitle, 256, "TPC sigma for %s %s cuts;sigma;Entries", AliPID::ParticleName(ispec), imode ? "after" : "before");\r
-      fHnSigmaTPC[ispec][imode] = new TH1F(hname, htitle, 200, -10., 10.);\r
-      snprintf(hname, 256, "fHnSigma%sTOF%s", AliPID::ParticleName(ispec), imode ? "after" : "before");\r
-      snprintf(htitle, 256, "TOF sigma for %s %s cuts;sigma;Entries", AliPID::ParticleName(ispec), imode ? "after" : "before");\r
-      fHnSigmaTOF[ispec][imode] = new TH1F(hname, htitle, 200, -10., 10.);\r
-    }\r
-  }\r
-}\r
-\r
-//_____________________________________________________________________\r
-Bool_t AliESDpidCuts::AcceptTrack(const AliESDtrack *track, const AliESDEvent *event){\r
-  //\r
-  // Check whether the tracks survived the cuts\r
-  //\r
-  if(!fPIDresponse){\r
-    Init();\r
-    if (!fPIDresponse)\r
-      AliError("PID Response not available");\r
-    return 0;\r
-  }\r
-  enum{\r
-    kCutClusterRatioTPC,\r
-    kCutNsigmaTPC,\r
-    kCutNsigmaTOF\r
-  };\r
-  Long64_t cutRequired=0, cutFullfiled = 0;\r
-  if(fTOFsigmaCutRequired && event == 0)  {\r
-    AliError("No event pointer. Need event pointer for T0 for TOF cut");\r
-    return (0);\r
-  }\r
-  Double_t clusterRatio = track->GetTPCNclsF() ? static_cast<Float_t>(track->GetTPCNcls())/static_cast<Float_t>(track->GetTPCNclsF()) : 1.;\r
-  if(fCutTPCclusterRatio > 0.){\r
-    SETBIT(cutRequired, kCutClusterRatioTPC);\r
-    if(clusterRatio >= fCutTPCclusterRatio) \r
-      SETBIT(cutFullfiled, kCutClusterRatioTPC);\r
-  }\r
-  // check TPC nSigma cut\r
-  Float_t nsigmaTPC[AliPID::kSPECIES], nsigma;   // need all sigmas for QA plotting\r
-  for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){\r
-    nsigmaTPC[ispec] = nsigma = fPIDresponse->NumberOfSigmasTPC(track,(AliPID::EParticleType)ispec);\r
-    if(!(fTPCsigmaCutRequired & 1 << ispec)) continue;\r
-    SETBIT(cutRequired, kCutNsigmaTPC); // We found at least one species where the n-Sigma Cut is required\r
-    if(nsigma >= fCutTPCnSigma[2*ispec] && nsigma <= fCutTPCnSigma[2*ispec+1]) SETBIT(cutFullfiled, kCutNsigmaTPC);    // Fullfiled for at least one species\r
-  }\r
-  // check TOF nSigma cut\r
-  Float_t nsigmaTOF[AliPID::kSPECIES];    // see above\r
-  Bool_t hasTOFpid = track->GetStatus() & AliESDtrack::kTOFpid; // only apply TOF n-sigma cut when PID Status Bit is set\r
-  Double_t times[AliPID::kSPECIES];\r
-  track->GetIntegratedTimes(times);\r
-  for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){\r
-    \r
-    if(hasTOFpid && event) nsigmaTOF[ispec] = nsigma = fPIDresponse->NumberOfSigmasTOF(track,(AliPID::EParticleType)ispec);\r
-    if(!(fTOFsigmaCutRequired && 1 << ispec)) continue;\r
-    SETBIT(cutRequired, kCutNsigmaTOF);\r
-    if(track->GetOuterParam()->P() >= fMinMomentumTOF){\r
-      if(hasTOFpid && nsigma <= fCutTOFnSigma[2*ispec] && nsigma >= fCutTOFnSigma[2*ispec+1]) SETBIT(cutFullfiled, kCutNsigmaTOF);\r
-    }\r
-  }\r
-\r
-  // Fill Histograms before cuts\r
-  if(HasHistograms()){\r
-    fHclusterRatio[0]->Fill(clusterRatio);\r
-    for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){\r
-      fHnSigmaTPC[ispec][0]->Fill(nsigmaTPC[ispec]);\r
-      if(hasTOFpid) fHnSigmaTOF[ispec][0]->Fill(nsigmaTOF[ispec]);\r
-    }\r
-  }\r
-  if(cutRequired != cutFullfiled){\r
-    // Fill cut statistics\r
-    if(HasHistograms()){\r
-      for(Int_t icut = 0; icut < kNcuts; icut++){\r
-       if(TESTBIT(cutRequired, icut) && !TESTBIT(cutFullfiled, icut)){\r
-         // cut not fullfiled\r
-         fHcutStatistics->Fill(icut);\r
-         for(Int_t jcut = 0; jcut <= icut; jcut++)\r
-           if(TESTBIT(cutRequired, jcut) && !TESTBIT(cutFullfiled, jcut)) fHcutCorrelation->Fill(jcut, icut);\r
-       }\r
-      }\r
-    }\r
-    return kFALSE;    // At least one cut is not fullfiled\r
-  }\r
-\r
-  // Fill Histograms after cuts\r
-  if(HasHistograms()){\r
-    fHclusterRatio[1]->Fill(clusterRatio);\r
-    for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){\r
-      fHnSigmaTPC[ispec][1]->Fill(nsigmaTPC[ispec]);\r
-      if(hasTOFpid) fHnSigmaTOF[ispec][1]->Fill(nsigmaTOF[ispec]);\r
-    }\r
-  }\r
-\r
-  return kTRUE;\r
-}\r
-\r
-//_____________________________________________________________________\r
-void AliESDpidCuts::SaveHistograms(const Char_t * location){\r
-  //\r
-  // Save the histograms to a file\r
-  //\r
-  if(!HasHistograms()){\r
-    AliError("Histograms not on - Exiting");\r
-    return;\r
-  }\r
-  if(!location) location = GetName();\r
-  gDirectory->mkdir(location);\r
-  gDirectory->cd(location);\r
-  fHcutStatistics->Write();\r
-  fHcutCorrelation->Write();\r
-\r
-  gDirectory->mkdir("before_cuts");\r
-  gDirectory->mkdir("after_cuts");\r
-\r
-  gDirectory->cd("before_cuts");\r
-  fHclusterRatio[0]->Write();\r
-  for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){\r
-    fHnSigmaTPC[ispec][0]->Write();\r
-    fHnSigmaTOF[ispec][0]->Write();\r
-  }\r
-\r
-  gDirectory->cd("../after_cuts");\r
-  fHclusterRatio[1]->Write();\r
-  for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){\r
-    fHnSigmaTPC[ispec][1]->Write();\r
-    fHnSigmaTOF[ispec][1]->Write();\r
-  }\r
-\r
-  gDirectory->cd("..");\r
-}\r
-\r
-//_____________________________________________________________________\r
-void AliESDpidCuts::DrawHistograms(){\r
-  //\r
-  // Draw the Histograms\r
-  //\r
-  TCanvas *stat = new TCanvas("cutStat", "Cut Statistics", 640, 480);\r
-  stat->cd();\r
-  fHcutStatistics->SetStats(kFALSE);\r
-  fHcutStatistics->Draw();\r
-  stat->SaveAs(Form("%s_%s.gif", GetName(), stat->GetName()));\r
-\r
-  TCanvas *correl = new TCanvas("cutCorrelation", "Cut Correlation", 640, 480);\r
-  correl->cd();\r
-  fHcutCorrelation->SetStats(kFALSE);\r
-  fHcutCorrelation->Draw("colz");\r
-  correl->SaveAs(Form("%s_%s.gif", GetName(), correl->GetName()));\r
-\r
-  TCanvas *cRatio = new TCanvas("ClusterRatioTPC", "TPC cluster Ratio", 640, 480);\r
-  cRatio->cd();\r
-  fHclusterRatio[0]->SetLineColor(kRed);\r
-  fHclusterRatio[0]->SetStats(kFALSE);\r
-  fHclusterRatio[0]->Draw();\r
-  fHclusterRatio[1]->SetLineColor(kBlue);\r
-  fHclusterRatio[1]->SetStats(kFALSE);\r
-  fHclusterRatio[1]->Draw("same");\r
-  cRatio->SaveAs(Form("%s_%s.gif",  GetName(), cRatio->GetName()));\r
-\r
-  TCanvas *cNsigTPC = new TCanvas("NsigmaTPC", "TPC n-sigma", 640, 480);\r
-  cNsigTPC->Divide(3,2);\r
-  for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){\r
-    cNsigTPC->cd(ispec + 1);\r
-    fHnSigmaTPC[ispec][0]->SetLineColor(kRed);\r
-    fHnSigmaTPC[ispec][0]->SetStats(kFALSE);\r
-    fHnSigmaTPC[ispec][0]->Draw();\r
-    fHnSigmaTPC[ispec][1]->SetLineColor(kBlue);\r
-    fHnSigmaTPC[ispec][1]->SetStats(kFALSE);\r
-    fHnSigmaTPC[ispec][1]->Draw("same");\r
-  }\r
-  cNsigTPC->SaveAs(Form("%s_%s.gif", GetName(), cNsigTPC->GetName()));\r
-\r
-  TCanvas *cNsigTOF = new TCanvas("NsigmaTOF", "TOF n-sigma", 640, 480);\r
-  cNsigTOF->Divide(3,2);\r
-  for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){\r
-    cNsigTOF->cd(ispec + 1);\r
-    fHnSigmaTOF[ispec][0]->SetLineColor(kRed);\r
-    fHnSigmaTOF[ispec][0]->SetStats(kFALSE);\r
-    fHnSigmaTOF[ispec][0]->Draw();\r
-    fHnSigmaTOF[ispec][1]->SetLineColor(kBlue);\r
-    fHnSigmaTOF[ispec][1]->SetStats(kFALSE);\r
-    fHnSigmaTOF[ispec][1]->Draw("same");\r
-  }\r
-  cNsigTOF->SaveAs(Form("%s_%s.gif", GetName(), cNsigTOF->GetName()));\r
-}\r
-\r
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+#include <TCanvas.h>
+#include <TClass.h>
+#include <TCollection.h>
+#include <TDirectory.h>
+#include <TH1F.h>
+#include <TH1I.h>
+#include <TH2I.h>
+#include <TMath.h>
+#include <TIterator.h>
+#include <TString.h>
+#include <TList.h>
+
+#include "AliAnalysisManager.h"
+#include "AliInputEventHandler.h"
+#include "AliESDtrack.h"
+#include "AliESDEvent.h"
+#include "AliLog.h"
+#include "AliPIDResponse.h"
+
+#include "AliESDpidCuts.h"
+
+ClassImp(AliESDpidCuts)
+
+const Int_t AliESDpidCuts::kNcuts = 3;
+
+//_____________________________________________________________________
+AliESDpidCuts::AliESDpidCuts(const Char_t *name, const Char_t *title):
+    AliAnalysisCuts(name, title)
+  , fPIDresponse(NULL)
+  , fTPCsigmaCutRequired(0)
+  , fTOFsigmaCutRequired(0)
+  , fCutTPCclusterRatio(0.)
+  , fMinMomentumTOF(0.5)
+  , fHcutStatistics(NULL)
+  , fHcutCorrelation(NULL)
+{
+  //
+  // Default constructor
+  //
+  
+  memset(fCutTPCnSigma, 0, sizeof(Float_t)* AliPID::kSPECIES * 2);
+  memset(fCutTOFnSigma, 0, sizeof(Float_t)* AliPID::kSPECIES * 2);
+
+  memset(fHclusterRatio, 0, sizeof(TH1F *) * 2);
+  memset(fHnSigmaTPC, 0, sizeof(TH1F *) * AliPID::kSPECIES * 2);
+  memset(fHnSigmaTOF, 0, sizeof(TH1F *) * AliPID::kSPECIES * 2);
+}
+
+//_____________________________________________________________________
+AliESDpidCuts::AliESDpidCuts(const AliESDpidCuts &ref):
+    AliAnalysisCuts(ref)
+  , fPIDresponse(NULL)
+  , fTPCsigmaCutRequired(ref.fTPCsigmaCutRequired)
+  , fTOFsigmaCutRequired(ref.fTOFsigmaCutRequired)
+  , fCutTPCclusterRatio(ref.fCutTPCclusterRatio)
+  , fMinMomentumTOF(ref.fMinMomentumTOF)
+  , fHcutStatistics(NULL)
+  , fHcutCorrelation(NULL)
+{
+  //
+  // Copy constructor
+  //
+  fPIDresponse = ref.fPIDresponse;
+  memcpy(fCutTPCnSigma, ref.fCutTPCnSigma, sizeof(Float_t) * AliPID::kSPECIES * 2);
+  memcpy(fCutTOFnSigma, ref.fCutTOFnSigma, sizeof(Float_t) * AliPID::kSPECIES * 2);
+  
+  if(ref.fHcutStatistics) fHcutStatistics = dynamic_cast<TH1I *>(ref.fHcutStatistics->Clone());
+  if(ref.fHcutCorrelation) fHcutCorrelation = dynamic_cast<TH2I *>(ref.fHcutCorrelation->Clone());
+  for(Int_t imode = 0; imode < 2; imode++){
+    if(ref.fHclusterRatio[imode]) fHclusterRatio[imode] = dynamic_cast<TH1F *>(ref.fHclusterRatio[imode]->Clone());
+    for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){
+      if(fHnSigmaTPC[ispec][imode]) fHnSigmaTPC[ispec][imode] = dynamic_cast<TH1F *>(fHnSigmaTPC[ispec][imode]->Clone());
+      if(fHnSigmaTOF[ispec][imode]) fHnSigmaTOF[ispec][imode] = dynamic_cast<TH1F *>(fHnSigmaTPC[ispec][imode]->Clone());
+    }
+  }
+}
+
+//_____________________________________________________________________
+AliESDpidCuts &AliESDpidCuts::operator=(const AliESDpidCuts &ref){
+  //
+  // Assignment operator
+  //
+  if(this != &ref)
+    ref.Copy(*this);
+  return *this;
+}
+
+//_____________________________________________________________________
+AliESDpidCuts::~AliESDpidCuts(){
+  //
+  // Destructor
+  //
+
+  delete fHcutCorrelation;
+  for(Int_t imode = 0; imode < 2; imode++){
+    delete fHclusterRatio[imode];
+    for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){
+      delete fHnSigmaTPC[ispec][imode];
+      delete fHnSigmaTOF[ispec][imode];
+    }
+  }
+}
+
+//_____________________________________________________________________
+void AliESDpidCuts::Init(){
+  //
+  // Init function, get PID response from the Analysis Manager
+  //
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if(mgr){
+    AliInputEventHandler *handler = dynamic_cast<AliInputEventHandler*>(mgr->GetInputEventHandler());
+    if(handler){
+      fPIDresponse = handler->GetPIDResponse();
+    }
+  }
+}
+
+//_____________________________________________________________________
+Bool_t AliESDpidCuts::IsSelected(TObject *obj){
+  //
+  // Select Track
+  // 
+  AliESDtrack * trk = dynamic_cast<AliESDtrack*>(obj);
+  if(!trk){
+    AliError("Provided object is not AliESDtrack!");
+    return kFALSE;
+  }
+  const AliESDEvent* evt = trk->GetESDEvent();
+  if(!evt){
+    AliError("No AliESDEvent!");
+    return kFALSE;
+  }
+  return AcceptTrack(trk, evt);
+}
+
+//_____________________________________________________________________
+void AliESDpidCuts::Copy(TObject &c) const {
+  //
+  // Copy function
+  //
+  AliESDpidCuts &target = dynamic_cast<AliESDpidCuts &>(c);
+
+  target.fPIDresponse = fPIDresponse;
+
+  target.fCutTPCclusterRatio = fCutTPCclusterRatio;
+  target.fMinMomentumTOF = fMinMomentumTOF;
+
+  target.fTPCsigmaCutRequired = fTPCsigmaCutRequired;
+  target.fTOFsigmaCutRequired = fTOFsigmaCutRequired;
+  
+  if(fHcutStatistics) target.fHcutStatistics = dynamic_cast<TH1I *>(fHcutStatistics->Clone());
+  if(fHcutCorrelation) target.fHcutCorrelation = dynamic_cast<TH2I *>(fHcutCorrelation->Clone());
+  for(Int_t imode = 0; imode < 2; imode++){
+    if(fHclusterRatio[imode]) target.fHclusterRatio[imode] = dynamic_cast<TH1F *>(fHclusterRatio[imode]->Clone());
+    for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){
+      if(fHnSigmaTPC[ispec][imode]) target.fHnSigmaTPC[ispec][imode] = dynamic_cast<TH1F *>(fHnSigmaTPC[ispec][imode]->Clone());
+      if(fHnSigmaTOF[ispec][imode]) target.fHnSigmaTOF[ispec][imode] = dynamic_cast<TH1F *>(fHnSigmaTOF[ispec][imode]->Clone());
+    }
+  }
+  memcpy(target.fCutTPCnSigma, fCutTPCnSigma, sizeof(Float_t) * AliPID::kSPECIES * 2);
+  memcpy(target.fCutTOFnSigma, fCutTOFnSigma, sizeof(Float_t) * AliPID::kSPECIES * 2);
+  AliESDpidCuts::Copy(c);
+}
+
+//_____________________________________________________________________
+Long64_t AliESDpidCuts::Merge(TCollection *coll){
+  //
+  // Merge Cut objects
+  //
+  if(!coll) return 0;
+  if(coll->IsEmpty())   return 1;
+  if(!HasHistograms())  return 0;
+  
+  TIterator *iter = coll->MakeIterator();
+  TObject *o = NULL; 
+  AliESDpidCuts *ref = NULL;
+  Int_t counter = 0;
+  while((o = iter->Next())){
+    ref = dynamic_cast<AliESDpidCuts *>(o);
+    if(!ref) continue;
+    if(!ref->HasHistograms()) continue;
+
+    fHcutStatistics->Add(ref->fHcutStatistics);
+    fHcutCorrelation->Add(ref->fHcutCorrelation);
+    for(Int_t imode = 0; imode < 2; imode++){
+      fHclusterRatio[imode]->Add(ref->fHclusterRatio[imode]);
+      for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){
+        fHnSigmaTPC[ispec][imode]->Add(ref->fHnSigmaTPC[ispec][imode]);
+        fHnSigmaTOF[ispec][imode]->Add(ref->fHnSigmaTOF[ispec][imode]);
+      }
+    }
+    ++counter;
+  }
+  return ++counter;
+}
+
+//_____________________________________________________________________
+void AliESDpidCuts::DefineHistograms(Color_t color){
+  //
+  // Swich on QA and create the histograms
+  //
+  SetBit(kHasHistograms, kTRUE);
+  fHcutStatistics = new TH1I("fHcutStatistics", "Cut Statistics", kNcuts, 0, kNcuts);
+  fHcutStatistics->SetLineColor(color);
+  fHcutCorrelation = new TH2I("fHcutCorrelation", "Cut Correlation", kNcuts, 0, kNcuts, kNcuts, 0, kNcuts);
+  TString cutname[kNcuts] = {"TPCclusterRatio", "TPC sigma", "TOF sigma"};
+  for(Int_t icut = 0; icut < kNcuts; icut++){
+    fHcutStatistics->GetXaxis()->SetBinLabel(fHcutStatistics->GetXaxis()->GetFirst() + icut, cutname[icut].Data());
+    fHcutCorrelation->GetXaxis()->SetBinLabel(fHcutCorrelation->GetXaxis()->GetFirst() + icut, cutname[icut].Data());
+    fHcutCorrelation->GetYaxis()->SetBinLabel(fHcutCorrelation->GetYaxis()->GetFirst() + icut, cutname[icut].Data());
+  }
+  Char_t hname[256], htitle[256];
+  for(Int_t imode = 0; imode < 2; imode++){
+    snprintf(hname, 256, "fHclusterRatio%s", imode ? "After" : "Before");
+    snprintf(htitle, 256, "TPC cluster Ratio %s cuts;Ratio;Entries", imode ? "after" : "before");
+    fHclusterRatio[imode] = new TH1F(hname, htitle, 20, 0., 1.);
+    for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){
+      snprintf(hname, 256, "fHnSigma%sTPC%s", AliPID::ParticleName(ispec), imode ? "after" : "before");
+      snprintf(htitle, 256, "TPC sigma for %s %s cuts;sigma;Entries", AliPID::ParticleName(ispec), imode ? "after" : "before");
+      fHnSigmaTPC[ispec][imode] = new TH1F(hname, htitle, 200, -10., 10.);
+      snprintf(hname, 256, "fHnSigma%sTOF%s", AliPID::ParticleName(ispec), imode ? "after" : "before");
+      snprintf(htitle, 256, "TOF sigma for %s %s cuts;sigma;Entries", AliPID::ParticleName(ispec), imode ? "after" : "before");
+      fHnSigmaTOF[ispec][imode] = new TH1F(hname, htitle, 200, -10., 10.);
+    }
+  }
+}
+
+//_____________________________________________________________________
+Bool_t AliESDpidCuts::AcceptTrack(const AliESDtrack *track, const AliESDEvent *event){
+  //
+  // Check whether the tracks survived the cuts
+  //
+  if(!fPIDresponse){
+    Init();
+    if (!fPIDresponse)
+      AliError("PID Response not available");
+    return 0;
+  }
+  enum{
+    kCutClusterRatioTPC,
+    kCutNsigmaTPC,
+    kCutNsigmaTOF
+  };
+  Long64_t cutRequired=0, cutFullfiled = 0;
+  if(fTOFsigmaCutRequired && event == 0)  {
+    AliError("No event pointer. Need event pointer for T0 for TOF cut");
+    return (0);
+  }
+  Double_t clusterRatio = track->GetTPCNclsF() ? static_cast<Float_t>(track->GetTPCNcls())/static_cast<Float_t>(track->GetTPCNclsF()) : 1.;
+  if(fCutTPCclusterRatio > 0.){
+    SETBIT(cutRequired, kCutClusterRatioTPC);
+    if(clusterRatio >= fCutTPCclusterRatio) 
+      SETBIT(cutFullfiled, kCutClusterRatioTPC);
+  }
+  // check TPC nSigma cut
+  Float_t nsigmaTPC[AliPID::kSPECIES], nsigma;   // need all sigmas for QA plotting
+  for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){
+    nsigmaTPC[ispec] = nsigma = fPIDresponse->NumberOfSigmasTPC(track,(AliPID::EParticleType)ispec);
+    if(!(fTPCsigmaCutRequired & 1 << ispec)) continue;
+    SETBIT(cutRequired, kCutNsigmaTPC); // We found at least one species where the n-Sigma Cut is required
+    if(nsigma >= fCutTPCnSigma[2*ispec] && nsigma <= fCutTPCnSigma[2*ispec+1]) SETBIT(cutFullfiled, kCutNsigmaTPC);    // Fullfiled for at least one species
+  }
+  // check TOF nSigma cut
+  Float_t nsigmaTOF[AliPID::kSPECIES];    // see above
+  Bool_t hasTOFpid = track->GetStatus() & AliESDtrack::kTOFpid; // only apply TOF n-sigma cut when PID Status Bit is set
+  Double_t times[AliPID::kSPECIES];
+  track->GetIntegratedTimes(times);
+  for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){
+    
+    if(hasTOFpid && event) nsigmaTOF[ispec] = nsigma = fPIDresponse->NumberOfSigmasTOF(track,(AliPID::EParticleType)ispec);
+    if(!(fTOFsigmaCutRequired && 1 << ispec)) continue;
+    SETBIT(cutRequired, kCutNsigmaTOF);
+    if(track->GetOuterParam()->P() >= fMinMomentumTOF){
+      if(hasTOFpid && nsigma <= fCutTOFnSigma[2*ispec] && nsigma >= fCutTOFnSigma[2*ispec+1]) SETBIT(cutFullfiled, kCutNsigmaTOF);
+    }
+  }
+
+  // Fill Histograms before cuts
+  if(HasHistograms()){
+    fHclusterRatio[0]->Fill(clusterRatio);
+    for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){
+      fHnSigmaTPC[ispec][0]->Fill(nsigmaTPC[ispec]);
+      if(hasTOFpid) fHnSigmaTOF[ispec][0]->Fill(nsigmaTOF[ispec]);
+    }
+  }
+  if(cutRequired != cutFullfiled){
+    // Fill cut statistics
+    if(HasHistograms()){
+      for(Int_t icut = 0; icut < kNcuts; icut++){
+       if(TESTBIT(cutRequired, icut) && !TESTBIT(cutFullfiled, icut)){
+         // cut not fullfiled
+         fHcutStatistics->Fill(icut);
+         for(Int_t jcut = 0; jcut <= icut; jcut++)
+           if(TESTBIT(cutRequired, jcut) && !TESTBIT(cutFullfiled, jcut)) fHcutCorrelation->Fill(jcut, icut);
+       }
+      }
+    }
+    return kFALSE;    // At least one cut is not fullfiled
+  }
+
+  // Fill Histograms after cuts
+  if(HasHistograms()){
+    fHclusterRatio[1]->Fill(clusterRatio);
+    for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){
+      fHnSigmaTPC[ispec][1]->Fill(nsigmaTPC[ispec]);
+      if(hasTOFpid) fHnSigmaTOF[ispec][1]->Fill(nsigmaTOF[ispec]);
+    }
+  }
+
+  return kTRUE;
+}
+
+//_____________________________________________________________________
+void AliESDpidCuts::SaveHistograms(const Char_t * location){
+  //
+  // Save the histograms to a file
+  //
+  if(!HasHistograms()){
+    AliError("Histograms not on - Exiting");
+    return;
+  }
+  if(!location) location = GetName();
+  gDirectory->mkdir(location);
+  gDirectory->cd(location);
+  fHcutStatistics->Write();
+  fHcutCorrelation->Write();
+
+  gDirectory->mkdir("before_cuts");
+  gDirectory->mkdir("after_cuts");
+
+  gDirectory->cd("before_cuts");
+  fHclusterRatio[0]->Write();
+  for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){
+    fHnSigmaTPC[ispec][0]->Write();
+    fHnSigmaTOF[ispec][0]->Write();
+  }
+
+  gDirectory->cd("../after_cuts");
+  fHclusterRatio[1]->Write();
+  for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){
+    fHnSigmaTPC[ispec][1]->Write();
+    fHnSigmaTOF[ispec][1]->Write();
+  }
+
+  gDirectory->cd("..");
+}
+
+//_____________________________________________________________________
+void AliESDpidCuts::DrawHistograms(){
+  //
+  // Draw the Histograms
+  //
+  TCanvas *stat = new TCanvas("cutStat", "Cut Statistics", 640, 480);
+  stat->cd();
+  fHcutStatistics->SetStats(kFALSE);
+  fHcutStatistics->Draw();
+  stat->SaveAs(Form("%s_%s.gif", GetName(), stat->GetName()));
+
+  TCanvas *correl = new TCanvas("cutCorrelation", "Cut Correlation", 640, 480);
+  correl->cd();
+  fHcutCorrelation->SetStats(kFALSE);
+  fHcutCorrelation->Draw("colz");
+  correl->SaveAs(Form("%s_%s.gif", GetName(), correl->GetName()));
+
+  TCanvas *cRatio = new TCanvas("ClusterRatioTPC", "TPC cluster Ratio", 640, 480);
+  cRatio->cd();
+  fHclusterRatio[0]->SetLineColor(kRed);
+  fHclusterRatio[0]->SetStats(kFALSE);
+  fHclusterRatio[0]->Draw();
+  fHclusterRatio[1]->SetLineColor(kBlue);
+  fHclusterRatio[1]->SetStats(kFALSE);
+  fHclusterRatio[1]->Draw("same");
+  cRatio->SaveAs(Form("%s_%s.gif",  GetName(), cRatio->GetName()));
+
+  TCanvas *cNsigTPC = new TCanvas("NsigmaTPC", "TPC n-sigma", 640, 480);
+  cNsigTPC->Divide(3,2);
+  for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){
+    cNsigTPC->cd(ispec + 1);
+    fHnSigmaTPC[ispec][0]->SetLineColor(kRed);
+    fHnSigmaTPC[ispec][0]->SetStats(kFALSE);
+    fHnSigmaTPC[ispec][0]->Draw();
+    fHnSigmaTPC[ispec][1]->SetLineColor(kBlue);
+    fHnSigmaTPC[ispec][1]->SetStats(kFALSE);
+    fHnSigmaTPC[ispec][1]->Draw("same");
+  }
+  cNsigTPC->SaveAs(Form("%s_%s.gif", GetName(), cNsigTPC->GetName()));
+
+  TCanvas *cNsigTOF = new TCanvas("NsigmaTOF", "TOF n-sigma", 640, 480);
+  cNsigTOF->Divide(3,2);
+  for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){
+    cNsigTOF->cd(ispec + 1);
+    fHnSigmaTOF[ispec][0]->SetLineColor(kRed);
+    fHnSigmaTOF[ispec][0]->SetStats(kFALSE);
+    fHnSigmaTOF[ispec][0]->Draw();
+    fHnSigmaTOF[ispec][1]->SetLineColor(kBlue);
+    fHnSigmaTOF[ispec][1]->SetStats(kFALSE);
+    fHnSigmaTOF[ispec][1]->Draw("same");
+  }
+  cNsigTOF->SaveAs(Form("%s_%s.gif", GetName(), cNsigTOF->GetName()));
+}
+
index 667ca19..6838963 100644 (file)
-#ifndef ALIESDPIDCUTS_H\r
-#define ALIESDPIDCUTS_H\r
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
- * See cxx source for full Copyright notice                               */\r
-//\r
-// Class for PID cuts\r
-// Cuts the track based on numbers of sigmas in the detectors TPC and TOF\r
-// The sigma cuts can be applied symmetrically or assymetrically\r
-//\r
-\r
-#ifndef ALIANALYSISCUTS_H\r
-#include "AliAnalysisCuts.h"\r
-#endif\r
-\r
-#ifndef ALIPID_H\r
-#include "AliPID.h"\r
-#endif\r
-\r
-class TCollection;\r
-class TH1F;\r
-class TH1I;\r
-class TH2I;\r
-class TList;\r
-class AliESDtrack;\r
-class AliESDEvent;\r
-class AliESDpid;\r
-\r
-class AliESDpidCuts : public AliAnalysisCuts{\r
-  enum{\r
-    kHasHistograms = BIT(17)\r
-  };\r
-  public: \r
-    AliESDpidCuts(const Char_t *name = "AliESDpidCuts", const Char_t *title = "");\r
-    AliESDpidCuts(const AliESDpidCuts &ref);  // Copy constructor\r
-    AliESDpidCuts &operator=(const AliESDpidCuts &ref);\r
-    virtual ~AliESDpidCuts();\r
-\r
-    virtual void Init();\r
-    virtual void Copy(TObject &c) const;\r
-    virtual Long64_t Merge(TCollection *coll);\r
-\r
-    Bool_t HasHistograms() const { return TestBit(kHasHistograms); }\r
-    void DefineHistograms(Color_t color = kRed);\r
-    void DrawHistograms();\r
-    void SaveHistograms(const Char_t *location = NULL);\r
-    virtual Bool_t IsSelected(TObject *);\r
-    virtual Bool_t IsSelected(TList * /*lst*/) {return kTRUE; }\r
-    virtual Bool_t AcceptTrack(const AliESDtrack *track, const AliESDEvent *event);\r
-\r
-    void SetPIDResponse(AliPIDResponse * pidresponse) { fPIDresponse = pidresponse; }\r
-    AliPIDResponse *GetPIDresponse() { return fPIDresponse; };\r
-    \r
-    void SetTPCclusterRatioCut(Float_t clr) { fCutTPCclusterRatio = clr; }\r
-    inline void SetTPCnSigmaCut(AliPID::EParticleType itype, Float_t nSigma);\r
-    inline void SetTPCnSigmaCut(AliPID::EParticleType itype, Float_t negSigma, Float_t posSigma);\r
-    inline void SetTOFnSigmaCut(AliPID::EParticleType itype, Float_t nSigma);\r
-    inline void SetTOFnSigmaCut(AliPID::EParticleType itype, Float_t negSigma, Float_t posSigma);\r
-    void SetMinMomentumTOF(Float_t mom) { fMinMomentumTOF = mom; }\r
-  \r
-  protected:\r
-    static const Int_t kNcuts;                      // Number of Cuts\r
-    AliPIDResponse *fPIDresponse;                   //! PID helper (n-sigma-cut)\r
-    Char_t  fTPCsigmaCutRequired;                   // Sigma cut Requirement for TPC and Particle Species\r
-    Char_t  fTOFsigmaCutRequired;                   // Sigma cut Requirement for TOF and Particle Species\r
-    Float_t fCutTPCnSigma[AliPID::kSPECIES * 2];    // Species dependent cut on the distance to the TPC dE/dx line\r
-    Float_t fCutTOFnSigma[AliPID::kSPECIES * 2];    // Species dependent cut on the distance to the TOF calculated time of flight line\r
-    Float_t fCutTPCclusterRatio;                    // Cut on Ratio of found clusters with repect to findable clusters in the TPC\r
-    Float_t fMinMomentumTOF;                        // Apply TOF PID only above a certain momentum\r
-\r
-    //------------------------------------------\r
-    // QA histograms\r
-    TH1I *fHcutStatistics;                       // Cut Statistics\r
-    TH2I *fHcutCorrelation;                      // Cut Correlation\r
-    TH1F *fHclusterRatio[2];                     // TPC cluster Ratio\r
-    TH1F *fHnSigmaTPC[AliPID::kSPECIES][2];      // TPC n-sigma cut\r
-    TH1F *fHnSigmaTOF[AliPID::kSPECIES][2];      // TOF n-sigma cut\r
-    //------------------------------------------\r
-    \r
-    ClassDef(AliESDpidCuts, 3)\r
-};\r
-\r
-//_____________________________________________________________________\r
-void AliESDpidCuts::SetTPCnSigmaCut(AliPID::EParticleType itype, Float_t nSigma){ \r
-  //\r
-  // symmetric sigma cut for TPC PID\r
-  //\r
-  fCutTPCnSigma[itype * 2]      = -nSigma;\r
-  fCutTPCnSigma[itype * 2 + 1]  = nSigma; \r
-  fTPCsigmaCutRequired |= 1 << static_cast<Int_t >(itype);\r
-}    \r
-\r
-//_____________________________________________________________________\r
-void AliESDpidCuts::SetTPCnSigmaCut(AliPID::EParticleType itype, Float_t negSigma, Float_t posSigma){\r
-  //\r
-  // assymetric sigma cut for TPC PID\r
-  //\r
-  fCutTPCnSigma[itype * 2]      = negSigma;\r
-  fCutTPCnSigma[itype * 2 + 1]  = posSigma;\r
-  fTPCsigmaCutRequired |= 1 << static_cast<Int_t >(itype);\r
-} \r
-\r
-//_____________________________________________________________________\r
-void AliESDpidCuts::SetTOFnSigmaCut(AliPID::EParticleType itype, Float_t nSigma){ \r
-  //\r
-  // symmetric sigma cut for TOF PID\r
-  //\r
-  fCutTOFnSigma[itype * 2]      = -nSigma;\r
-  fCutTOFnSigma[itype * 2 + 1]  = nSigma; \r
-  fTOFsigmaCutRequired |= 1 << static_cast<Int_t >(itype);\r
-}    \r
-\r
-//_____________________________________________________________________\r
-void AliESDpidCuts::SetTOFnSigmaCut(AliPID::EParticleType itype, Float_t negSigma, Float_t posSigma){\r
-  //\r
-  // assymetric sigma cut for TOF PID\r
-  //\r
-  fCutTOFnSigma[itype * 2]      = negSigma;\r
-  fCutTOFnSigma[itype * 2 + 1]  = posSigma;\r
-  fTOFsigmaCutRequired |= 1 << static_cast<Int_t >(itype);\r
-}\r
-#endif\r
+#ifndef ALIESDPIDCUTS_H
+#define ALIESDPIDCUTS_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+//
+// Class for PID cuts
+// Cuts the track based on numbers of sigmas in the detectors TPC and TOF
+// The sigma cuts can be applied symmetrically or assymetrically
+//
+
+#ifndef ALIANALYSISCUTS_H
+#include "AliAnalysisCuts.h"
+#endif
+
+#ifndef ALIPID_H
+#include "AliPID.h"
+#endif
+
+class TCollection;
+class TH1F;
+class TH1I;
+class TH2I;
+class TList;
+class AliESDtrack;
+class AliESDEvent;
+class AliESDpid;
+
+class AliESDpidCuts : public AliAnalysisCuts{
+  enum{
+    kHasHistograms = BIT(17)
+  };
+  public: 
+    AliESDpidCuts(const Char_t *name = "AliESDpidCuts", const Char_t *title = "");
+    AliESDpidCuts(const AliESDpidCuts &ref);  // Copy constructor
+    AliESDpidCuts &operator=(const AliESDpidCuts &ref);
+    virtual ~AliESDpidCuts();
+
+    virtual void Init();
+    virtual void Copy(TObject &c) const;
+    virtual Long64_t Merge(TCollection *coll);
+
+    Bool_t HasHistograms() const { return TestBit(kHasHistograms); }
+    void DefineHistograms(Color_t color = kRed);
+    void DrawHistograms();
+    void SaveHistograms(const Char_t *location = NULL);
+    virtual Bool_t IsSelected(TObject *);
+    virtual Bool_t IsSelected(TList * /*lst*/) {return kTRUE; }
+    virtual Bool_t AcceptTrack(const AliESDtrack *track, const AliESDEvent *event);
+
+    void SetPIDResponse(AliPIDResponse * pidresponse) { fPIDresponse = pidresponse; }
+    AliPIDResponse *GetPIDresponse() { return fPIDresponse; };
+    
+    void SetTPCclusterRatioCut(Float_t clr) { fCutTPCclusterRatio = clr; }
+    inline void SetTPCnSigmaCut(AliPID::EParticleType itype, Float_t nSigma);
+    inline void SetTPCnSigmaCut(AliPID::EParticleType itype, Float_t negSigma, Float_t posSigma);
+    inline void SetTOFnSigmaCut(AliPID::EParticleType itype, Float_t nSigma);
+    inline void SetTOFnSigmaCut(AliPID::EParticleType itype, Float_t negSigma, Float_t posSigma);
+    void SetMinMomentumTOF(Float_t mom) { fMinMomentumTOF = mom; }
+  
+  protected:
+    static const Int_t kNcuts;                      // Number of Cuts
+    AliPIDResponse *fPIDresponse;                   //! PID helper (n-sigma-cut)
+    Char_t  fTPCsigmaCutRequired;                   // Sigma cut Requirement for TPC and Particle Species
+    Char_t  fTOFsigmaCutRequired;                   // Sigma cut Requirement for TOF and Particle Species
+    Float_t fCutTPCnSigma[AliPID::kSPECIES * 2];    // Species dependent cut on the distance to the TPC dE/dx line
+    Float_t fCutTOFnSigma[AliPID::kSPECIES * 2];    // Species dependent cut on the distance to the TOF calculated time of flight line
+    Float_t fCutTPCclusterRatio;                    // Cut on Ratio of found clusters with repect to findable clusters in the TPC
+    Float_t fMinMomentumTOF;                        // Apply TOF PID only above a certain momentum
+
+    //------------------------------------------
+    // QA histograms
+    TH1I *fHcutStatistics;                       // Cut Statistics
+    TH2I *fHcutCorrelation;                      // Cut Correlation
+    TH1F *fHclusterRatio[2];                     // TPC cluster Ratio
+    TH1F *fHnSigmaTPC[AliPID::kSPECIES][2];      // TPC n-sigma cut
+    TH1F *fHnSigmaTOF[AliPID::kSPECIES][2];      // TOF n-sigma cut
+    //------------------------------------------
+    
+    ClassDef(AliESDpidCuts, 3)
+};
+
+//_____________________________________________________________________
+void AliESDpidCuts::SetTPCnSigmaCut(AliPID::EParticleType itype, Float_t nSigma){ 
+  //
+  // symmetric sigma cut for TPC PID
+  //
+  fCutTPCnSigma[itype * 2]      = -nSigma;
+  fCutTPCnSigma[itype * 2 + 1]  = nSigma; 
+  fTPCsigmaCutRequired |= 1 << static_cast<Int_t >(itype);
+}    
+
+//_____________________________________________________________________
+void AliESDpidCuts::SetTPCnSigmaCut(AliPID::EParticleType itype, Float_t negSigma, Float_t posSigma){
+  //
+  // assymetric sigma cut for TPC PID
+  //
+  fCutTPCnSigma[itype * 2]      = negSigma;
+  fCutTPCnSigma[itype * 2 + 1]  = posSigma;
+  fTPCsigmaCutRequired |= 1 << static_cast<Int_t >(itype);
+} 
+
+//_____________________________________________________________________
+void AliESDpidCuts::SetTOFnSigmaCut(AliPID::EParticleType itype, Float_t nSigma){ 
+  //
+  // symmetric sigma cut for TOF PID
+  //
+  fCutTOFnSigma[itype * 2]      = -nSigma;
+  fCutTOFnSigma[itype * 2 + 1]  = nSigma; 
+  fTOFsigmaCutRequired |= 1 << static_cast<Int_t >(itype);
+}    
+
+//_____________________________________________________________________
+void AliESDpidCuts::SetTOFnSigmaCut(AliPID::EParticleType itype, Float_t negSigma, Float_t posSigma){
+  //
+  // assymetric sigma cut for TOF PID
+  //
+  fCutTOFnSigma[itype * 2]      = negSigma;
+  fCutTOFnSigma[itype * 2 + 1]  = posSigma;
+  fTOFsigmaCutRequired |= 1 << static_cast<Int_t >(itype);
+}
+#endif
index a59e640..2a34852 100644 (file)
-/**************************************************************************\r
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
- *                                                                        *\r
- * Author: The ALICE Off-line Project.                                    *\r
- * Contributors are mentioned in the code where appropriate.              *\r
- *                                                                        *\r
- * Permission to use, copy, modify and distribute this software and its   *\r
- * documentation strictly for non-commercial purposes is hereby granted   *\r
- * without fee, provided that the above copyright notice appears in all   *\r
- * copies and that both the copyright notice and this permission notice   *\r
- * appear in the supporting documentation. The authors make no claims     *\r
- * about the suitability of this software for any purpose. It is          *\r
- * provided "as is" without express or implied warranty.                  *\r
- **************************************************************************/\r
-\r
-/*\r
- * author: M.Kalisky@gsi.de\r
- * 08/Dec/2010\r
- *\r
- * Description: This class allows with purely kinematical cuts\r
- * to select clean samples of electrons, pions and protons from the\r
- * V0 online finder ESD V0 candidates for PID and dectector resonse\r
- * studies.\r
- */\r
-\r
-#include <TVector3.h>\r
-#include <TDatabasePDG.h>\r
-\r
-#include "AliESDv0.h"\r
-#include "AliESDtrack.h"\r
-#include "AliESDEvent.h"\r
-#include "AliVEvent.h"\r
-#include "AliLog.h"\r
-#include "AliKFParticle.h"\r
-#include "AliVTrack.h"\r
-#include "AliKFVertex.h"\r
-\r
-#include "AliESDv0KineCuts.h"\r
-\r
-ClassImp(AliESDv0KineCuts)\r
-\r
-//____________________________________________________________________\r
-AliESDv0KineCuts::AliESDv0KineCuts() :\r
-  fEvent(0x0)\r
-  , fPrimaryVertex(0x0)\r
-  , fType(0)\r
-  , fMode(0)\r
-  , fTPCNcls(1)\r
-  , fTPCrefit(kTRUE)\r
-  , fTPCchi2perCls(4.0)\r
-  , fTPCclsRatio(0.6)\r
-  , fNoKinks(kTRUE)\r
-  , fGcutChi2NDF(10)\r
-  , fGcutInvMass(0.05)\r
-  , fK0cutChi2NDF(10)\r
-  , fLcutChi2NDF(10)\r
-  , fUseExternalVertex(kFALSE)\r
-  , fDeleteVertex(kFALSE)\r
-{\r
-  //\r
-  // Default constructor\r
-  //\r
-\r
-  // default single track cuts\r
-  fTPCNcls = 1;                // minimal number of the TPC clusters\r
-  fTPCrefit = kTRUE;           // TPC refit\r
-  fTPCchi2perCls = 4.0;        // chi2 per TPC cluster\r
-  fTPCclsRatio = 0.6;          // minimal foun/findable TPC cluster ratio\r
-  fNoKinks = kTRUE;            // kinks - no [kTRUE] or do not care [kFalse]\r
-\r
-\r
-  // default gamma cuts values\r
-  fGcutChi2NDF = 10;           // Chi2NF cut value for the AliKFparticle gamma\r
-  fGcutCosPoint[0] = 0;        // cos of the pointing angle [min, max]\r
-  fGcutCosPoint[1] = 0.02;     // cos of the pointing angle [min, max]\r
-  fGcutDCA[0] = 0.;            // DCA between the daughter tracks [min, max]\r
-  fGcutDCA[1] = 0.25;          // DCA between the daughter tracks [min, max]\r
-  fGcutVertexR[0] = 3.;        // radius of the conversion point [min, max]\r
-  fGcutVertexR[1] = 90.;       // radius of the conversion point [min, max]\r
-  fGcutPsiPair[0] = 0.;        // value of the psi pair cut [min, max]\r
-  fGcutPsiPair[1] = 0.05;      // value of the psi pair cut [min, max]\r
-  fGcutInvMass = 0.05;         // upper value on the gamma invariant mass\r
-  // default K0 cuts\r
-  fK0cutChi2NDF = 10;          // Chi2NF cut value for the AliKFparticle K0\r
-  fK0cutCosPoint[0] = 0.;      // cos of the pointing angle [min, max]\r
-  fK0cutCosPoint[1] = 0.02;    // cos of the pointing angle [min, max]\r
-  fK0cutDCA[0] = 0.;           // DCA between the daughter tracks [min, max]\r
-  fK0cutDCA[1] = 0.2;          // DCA between the daughter tracks [min, max]\r
-  fK0cutVertexR[0] = 2.0;      // radius of the decay point [min, max]\r
-  fK0cutVertexR[1] = 30.0;     // radius of the decay point [min, max]\r
-  fK0cutInvMass[0] = 0.486;    // invariant mass window\r
-  fK0cutInvMass[1] = 0.508;    // invariant mass window\r
-  // Lambda & anti-Lambda cut values\r
-  fLcutChi2NDF = 10;           // Chi2NF cut value for the AliKFparticle K0\r
-  fLcutCosPoint[0] = 0.;       // cos of the pointing angle [min, max]\r
-  fLcutCosPoint[1] = 0.02;     // cos of the pointing angle [min, max]\r
-  fLcutDCA[0] = 0.;            // DCA between the daughter tracks [min, max]\r
-  fLcutDCA[1] = 0.2;           // DCA between the daughter tracks [min, max]\r
-  fLcutVertexR[0] = 2.0;       // radius of the decay point [min, max]\r
-  fLcutVertexR[1] = 40.0;      // radius of the decay point [min, max]\r
-  fLcutInvMass[0] = 1.11;      // invariant mass window\r
-  fLcutInvMass[1] = 1.12;      // invariant mass window\r
-    \r
-}\r
-//____________________________________________________________________\r
-AliESDv0KineCuts::~AliESDv0KineCuts(){\r
-  //\r
-  // Destructor\r
-  //\r
-\r
-\r
-}\r
-//____________________________________________________________________\r
-AliESDv0KineCuts::AliESDv0KineCuts(const AliESDv0KineCuts &ref):\r
-  TObject(ref)\r
-  , fEvent(0x0)\r
-  , fPrimaryVertex(0x0)\r
-  , fType(0)\r
-  , fMode(0)\r
-  , fTPCNcls(1)\r
-  , fTPCrefit(kTRUE)\r
-  , fTPCchi2perCls(4.0)\r
-  , fTPCclsRatio(0.6)\r
-  , fNoKinks(kTRUE)\r
-  , fGcutChi2NDF(10)\r
-  , fGcutInvMass(0.05)\r
-  , fK0cutChi2NDF(10)\r
-  , fLcutChi2NDF(10)\r
-  , fUseExternalVertex(kFALSE)\r
-  , fDeleteVertex(kFALSE)\r
-{\r
-  //\r
-  // Copy operator\r
-  //\r
-\r
-  ref.Copy(*this);\r
-}\r
-//____________________________________________________________________\r
-AliESDv0KineCuts &AliESDv0KineCuts::operator=(const AliESDv0KineCuts &ref){\r
-  //\r
-  // assignment operator\r
-  //\r
-  if(this != &ref)\r
-    ref.Copy(*this);\r
-  return *this; \r
-}\r
-//____________________________________________________________________\r
-void AliESDv0KineCuts::Copy(TObject &ref) const {\r
-  //\r
-  // Performs the copying of the object\r
-  //\r
-\r
-  TObject::Copy(ref);\r
-\r
-  AliESDv0KineCuts &target = dynamic_cast<AliESDv0KineCuts &>(ref);\r
-\r
-  // default single track cuts\r
-  target.fTPCNcls = fTPCNcls;\r
-  target.fTPCrefit = fTPCrefit;\r
-  target.fTPCchi2perCls = fTPCchi2perCls;\r
-  target.fTPCclsRatio = fTPCclsRatio;\r
-  target.fNoKinks = fNoKinks;\r
-  target.fUseExternalVertex = fUseExternalVertex;  //added december 2nd 2011\r
-  target.fDeleteVertex = fDeleteVertex;  //added december 2nd 2011\r
-\r
-  // default gamma cuts values\r
-  target.fGcutChi2NDF = fGcutChi2NDF;\r
-  memcpy(target.fGcutCosPoint, fGcutCosPoint, sizeof(Float_t) * 2);\r
-  memcpy(target.fGcutDCA, fGcutDCA, sizeof(Float_t) * 2); \r
-  memcpy(target.fGcutVertexR, fGcutVertexR, sizeof(Float_t) * 2);\r
-  memcpy(target.fGcutPsiPair, fGcutPsiPair, sizeof(Float_t) * 2);\r
-  target.fGcutInvMass = fGcutInvMass;\r
-  // default K0 cuts\r
-  target.fK0cutChi2NDF = fK0cutChi2NDF;\r
-  memcpy(target.fK0cutCosPoint, fK0cutCosPoint, sizeof(Float_t) * 2);\r
-  memcpy(target.fK0cutDCA, fK0cutDCA, sizeof(Float_t) * 2);\r
-  memcpy(target.fK0cutVertexR, fK0cutVertexR, sizeof(Float_t) * 2);\r
-  memcpy(target.fK0cutInvMass, fK0cutInvMass, sizeof(Float_t) * 2);\r
-  // Lambda & anti-Lambda cut values\r
-  target.fLcutChi2NDF = fLcutChi2NDF;\r
-  memcpy(target.fLcutCosPoint, fLcutCosPoint, sizeof(Float_t) * 2);\r
-  memcpy(target.fLcutDCA, fLcutDCA, sizeof(Float_t) * 2);\r
-  memcpy(target.fLcutVertexR, fLcutVertexR, sizeof(Float_t) * 2);\r
-  memcpy(target.fLcutInvMass, fLcutInvMass, sizeof(Float_t) * 2);\r
-  \r
-}\r
-//____________________________________________________________________\r
-Bool_t  AliESDv0KineCuts::ProcessV0(AliESDv0* const v0, Int_t &pdgV0, Int_t &pdgP, Int_t &pdgN) const \r
-{\r
-  //\r
-  // main user function\r
-  //\r
-\r
-  if(!v0) return kFALSE;\r
-  if(!fEvent){\r
-    AliErrorClass("No valid Event pointer available, provide it first");\r
-    return kFALSE;\r
-  }\r
-\r
-  if(!V0CutsCommon(v0)) return kFALSE;\r
-\r
-  const Int_t id = PreselectV0(v0);\r
-\r
-  if(!SingleTrackCuts(v0)) return kFALSE;\r
-\r
-  switch(id){\r
-  case kUndef:\r
-    return kFALSE;\r
-  case kGamma:\r
-    return CaseGamma(v0, pdgV0, pdgP, pdgN);\r
-  case kK0:\r
-    return CaseK0(v0, pdgV0, pdgP, pdgN);\r
-  case kLambda:\r
-    return CaseLambda(v0, pdgV0, pdgP, pdgN, 0);\r
-  case kALambda:\r
-    return CaseLambda(v0, pdgV0, pdgP, pdgN, 1);\r
-  default:\r
-    return kFALSE; \r
-  }\r
-\r
-  return kFALSE;\r
-}\r
-//____________________________________________________________________\r
-Bool_t  AliESDv0KineCuts::ProcessV0(AliESDv0* const v0, Int_t &pdgP, Int_t &pdgN) const \r
-{\r
-  //\r
-  // main user function, simplified if the V0 identity is not necessary\r
-  //\r
-\r
-  if(!v0) return kFALSE;\r
-  if(!fEvent){\r
-    AliErrorClass("No valid Event pointer available, provide it first");\r
-    return kFALSE;\r
-  }\r
-\r
-  Int_t idV0 = -1;\r
-  return ProcessV0(v0, idV0, pdgP, pdgN);\r
-\r
-}\r
-//____________________________________________________________________\r
-Int_t AliESDv0KineCuts::PreselectV0(AliESDv0* const v0) const \r
-{\r
-  //\r
-  // Make a preselection (exclusive) of the V0 cadidates based on\r
-  // Armenteros plot\r
-  // the armenteros cut values are currently fixed and user is not able to set them via\r
-  // set funcions. The reason is that these cuts are optimized and furneter changes should \r
-  // not be necessary. To prove otherwise please study in detail before changing the values\r
-  //\r
\r
-  Float_t ap[2] = {-1., -1.};\r
-  Armenteros(v0, ap);\r
-  // for clarity\r
-  const Float_t alpha = ap[0];\r
-  const Float_t qt = ap[1];\r
-\r
-  // selection cuts \r
-  // - the reagions for different candidates must not overlap \r
-\r
-  // Gamma cuts\r
-  const Double_t cutAlphaG = 0.35; \r
-  const Double_t cutQTG = 0.05;\r
-  const Double_t cutAlphaG2[2] = {0.6, 0.8};\r
-  const Double_t cutQTG2 = 0.04;\r
-\r
-  // K0 cuts\r
-  const Float_t cutQTK0[2] = {0.1075, 0.215};\r
-  const Float_t cutAPK0[2] = {0.199, 0.8};   // parameters for curved QT cut\r
-  \r
-  // Lambda & A-Lambda cuts\r
-  const Float_t cutQTL = 0.03;\r
-  const Float_t cutAlphaL[2] = {0.35, 0.7};\r
-  const Float_t cutAlphaAL[2] = {-0.7,  -0.35};\r
-  const Float_t cutAPL[3] = {0.107, -0.69, 0.5};  // parameters fir curved QT cut\r
-\r
-\r
-  if(kPurity == fMode){\r
-  // Check for Gamma candidates\r
-    if(qt < cutQTG){\r
-      if( (TMath::Abs(alpha) < cutAlphaG) ) return kGamma;\r
-    }\r
-    // additional region - should help high pT gammas\r
-    if(qt < cutQTG2){\r
-      if( (TMath::Abs(alpha) > cutAlphaG2[0]) &&  (TMath::Abs(alpha) < cutAlphaG2[1]) ) return kGamma;\r
-    }\r
-  }\r
-  if(kEffGamma == fMode){\r
-    if(qt < cutQTG) return kGamma;\r
-  }\r
-\r
-  \r
-  // Check for K0 candidates\r
-  Float_t q = cutAPK0[0] * TMath::Sqrt(TMath::Abs(1 - alpha*alpha/(cutAPK0[1]*cutAPK0[1])));\r
-  if( (qt > cutQTK0[0]) && (qt < cutQTK0[1]) && (qt > q) ){\r
-    return kK0;\r
-  }\r
-\r
-  // Check for Lambda candidates\r
-  q = cutAPL[0] * TMath::Sqrt(TMath::Abs(1 - ( (alpha + cutAPL[1]) * (alpha + cutAPL[1]) ) / (cutAPL[2]*cutAPL[2]) ));\r
-  if( (alpha > cutAlphaL[0]) && (alpha < cutAlphaL[1]) && (qt > cutQTL) && (qt < q)  ){\r
-    return kLambda;\r
-  }\r
-\r
-  // Check for A-Lambda candidates\r
-  q = cutAPL[0] * TMath::Sqrt(TMath::Abs(1 - ( (alpha - cutAPL[1]) * (alpha - cutAPL[1]) ) / (cutAPL[2]*cutAPL[2]) ));\r
-  if( (alpha > cutAlphaAL[0]) && (alpha < cutAlphaAL[1]) && (qt > cutQTL) && (qt < q)  ){\r
-    return kALambda;\r
-  }\r
-  \r
-  return kUndef;\r
-}\r
-//____________________________________________________________________\r
-Bool_t  AliESDv0KineCuts::SingleTrackCuts(AliESDv0 * const v0) const \r
-{\r
-  //\r
-  // apply single track cuts\r
-  // correct sign not relevat here\r
-  //\r
-\r
-  if(!v0) return kFALSE;\r
-  \r
-  Int_t pIndex = 0, nIndex = 0;\r
-  pIndex = v0->GetPindex();\r
-  nIndex = v0->GetNindex();\r
-  AliESDtrack* d[2];\r
-  d[0] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(pIndex));\r
-  d[1] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(nIndex));\r
-  \r
-  for(Int_t i=0; i<2; ++i){\r
-    if(!d[i]) return kFALSE;\r
-    \r
-    // status word\r
-    ULong_t status = d[i]->GetStatus();\r
-\r
-    // No. of TPC clusters leave to the users\r
-    if(d[i]->GetTPCNcls() < 1) return kFALSE;\r
-\r
-    // TPC refit\r
-    if(!(status & AliESDtrack::kTPCrefit)) return kFALSE;\r
-  \r
-    // Chi2 per TPC cluster\r
-    Int_t nTPCclusters = d[i]->GetTPCNcls();\r
-    Float_t chi2perTPCcluster = d[i]->GetTPCchi2()/Float_t(nTPCclusters);\r
-    if(chi2perTPCcluster > 4) return kFALSE;\r
-\r
-    // TPC cluster ratio\r
-    Float_t cRatioTPC = d[i]->GetTPCNclsF() > 0. ? static_cast<Float_t>(d[i]->GetTPCNcls())/static_cast<Float_t> (d[i]->GetTPCNclsF()) : 1.;\r
-    if(cRatioTPC < 0.6) return kFALSE;\r
-    \r
-    // kinks\r
-    if(d[i]->GetKinkIndex(0) != 0) return kFALSE;\r
-    \r
-  }\r
-\r
-  return kTRUE;\r
-}\r
-//____________________________________________________________________\r
-Bool_t AliESDv0KineCuts::CaseGamma(AliESDv0* const v0, Int_t &pdgV0, Int_t &pdgP, Int_t &pdgN) const \r
-{\r
-  //\r
-  // process the gamma conversion candidate\r
-  //\r
-\r
-  if(!v0) return kFALSE;\r
-\r
-  AliVTrack* daughter[2];\r
-  Int_t pIndex = 0, nIndex = 0;\r
-\r
-  Bool_t sign = CheckSigns(v0);\r
-  if(sign){\r
-    pIndex = v0->GetPindex();\r
-    nIndex = v0->GetNindex();\r
-  }\r
-  else{\r
-    pIndex = v0->GetNindex();\r
-    nIndex = v0->GetPindex();    \r
-  }\r
-  daughter[0] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(pIndex));\r
-  daughter[1] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(nIndex));\r
-  if(!daughter[0] || !daughter[1]) return kFALSE;\r
-\r
-  AliKFParticle *kfMother = CreateMotherParticle(daughter[0], daughter[1], TMath::Abs(kElectron), TMath::Abs(kElectron));\r
-  if(!kfMother) return kFALSE;\r
-\r
-  AliESDtrack* d[2];\r
-  d[0] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(pIndex));\r
-  d[1] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(nIndex));\r
-\r
-  Float_t iMass = v0->GetEffMass(0, 0);\r
-\r
-  // cos pointing angle\r
-  Double_t cosPoint = v0->GetV0CosineOfPointingAngle();\r
-  cosPoint = TMath::ACos(cosPoint);\r
-\r
-  // DCA between daughters\r
-  Double_t dca = v0->GetDcaV0Daughters();\r
-\r
-  // Production vertex\r
-  Double_t x, y, z; \r
-  v0->GetXYZ(x,y,z);\r
-  Double_t r = TMath::Sqrt(x*x + y*y);\r
-\r
-  Double_t xy[2];\r
-  Double_t r2 = -1.;\r
-  if ( GetConvPosXY(d[0], d[1], xy) ){\r
-    r2 = TMath::Sqrt(xy[0]*xy[0] + xy[1]*xy[1]);\r
-  }\r
-\r
-  // psi pair \r
-  Double_t psiPair = PsiPair(v0);\r
-  \r
-  // V0 chi2/ndf\r
-  Double_t chi2ndf = kfMother->GetChi2()/kfMother->GetNDF();\r
-\r
-  if(kfMother) delete kfMother; \r
-  \r
-  // apply the cuts\r
-\r
-  if(iMass > fGcutInvMass) return kFALSE;\r
-\r
-  if(chi2ndf > fGcutChi2NDF) return kFALSE;\r
-\r
-  if(cosPoint < fGcutCosPoint[0] || cosPoint > fGcutCosPoint[1]) return kFALSE;\r
-\r
-  if(dca < fGcutDCA[0] || dca > fGcutDCA[1]) return kFALSE;\r
-\r
-  if(r < fGcutVertexR[0] || r > fGcutVertexR[1]) return kFALSE;\r
-\r
-  if(psiPair < fGcutPsiPair[0] || psiPair > fGcutPsiPair[1]) return kFALSE;\r
-  \r
-  // all cuts passed\r
-\r
-  pdgV0 = 22;\r
-  if(sign){\r
-    pdgP = -11;\r
-    pdgN = 11;\r
-  }\r
-  else{\r
-    pdgP = 11;\r
-    pdgN = -11;\r
-  }\r
-\r
-  return kTRUE;\r
-}\r
-//____________________________________________________________________\r
-Bool_t  AliESDv0KineCuts::CaseK0(AliESDv0* const v0, Int_t &pdgV0, Int_t &pdgP, Int_t &pdgN) const {\r
-  //\r
-  // process the K0 candidate\r
-  //\r
-\r
-  if(!v0) return kFALSE;\r
-  \r
-  AliVTrack* daughter[2];\r
-  Int_t pIndex = 0, nIndex = 0;\r
-  Bool_t sign = CheckSigns(v0);\r
-  if(sign){\r
-    pIndex = v0->GetPindex();\r
-    nIndex = v0->GetNindex();\r
-  }\r
-  else{\r
-    pIndex = v0->GetNindex();\r
-    nIndex = v0->GetPindex();    \r
-  }\r
\r
-  daughter[0] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(pIndex));\r
-  daughter[1] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(nIndex));\r
-  if(!daughter[0] || !daughter[1]) return kFALSE;\r
-\r
-  AliKFParticle *kfMother = CreateMotherParticle(daughter[0], daughter[1], TMath::Abs(kPiPlus), TMath::Abs(kPiPlus));\r
-  if(!kfMother) return kFALSE;\r
-\r
-  AliESDtrack* d[2];\r
-  d[0] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(pIndex));\r
-  d[1] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(nIndex));\r
-\r
-  Float_t iMass = v0->GetEffMass(2, 2);\r
-\r
-  // cos pointing angle\r
-  Double_t cosPoint = v0->GetV0CosineOfPointingAngle();\r
-  cosPoint = TMath::ACos(cosPoint);\r
-\r
-  // DCA between daughters\r
-  Double_t dca = v0->GetDcaV0Daughters();\r
-\r
-  // Production vertex\r
-  Double_t x, y, z; \r
-  v0->GetXYZ(x,y,z);\r
-\r
-  Double_t r = TMath::Sqrt(x*x + y*y);  \r
-\r
-  // V0 chi2/ndf\r
-  Double_t chi2ndf = kfMother->GetChi2()/kfMother->GetNDF();\r
-  \r
-  if(kfMother) delete kfMother; \r
-\r
-  //\r
-  // apply the cuts\r
-  //\r
-  if(iMass < fK0cutInvMass[0] || iMass > fK0cutInvMass[1]) return kFALSE;\r
-\r
-  if(chi2ndf > fK0cutChi2NDF) return kFALSE;\r
-\r
-  if(cosPoint < fK0cutCosPoint[0] || cosPoint > fK0cutCosPoint[1]) return kFALSE;\r
-\r
-  if(dca < fK0cutDCA[0] || dca > fK0cutDCA[1]) return kFALSE;\r
-\r
-  if(r < fK0cutVertexR[0] || r > fK0cutVertexR[1]) return kFALSE;\r
-\r
-  // all cuts passed\r
-  pdgV0 = 310;\r
-  if(sign){\r
-    pdgP = 211;\r
-    pdgN = -211;\r
-  }\r
-  else{\r
-    pdgP = -211;\r
-    pdgN = 211;\r
-  }\r
-\r
-  return kTRUE;\r
-}\r
-//____________________________________________________________________\r
-Bool_t  AliESDv0KineCuts::CaseLambda(AliESDv0* const v0, Int_t &pdgV0, Int_t &pdgP, Int_t &pdgN, Int_t id) const {\r
-  //\r
-  // process teh Lambda and Anti-Lambda candidate\r
-  //\r
-  \r
-  if(!v0) return kFALSE;\r
-\r
-    const Double_t cL0mass=TDatabasePDG::Instance()->GetParticle(kLambda0)->Mass();  // PDG lambda mass\r
-\r
-  AliVTrack* daughter[2];\r
-  Int_t pIndex = 0, nIndex = 0;\r
-  Float_t mMass[2] = {-1., -1.};\r
-  Bool_t sign = CheckSigns(v0);\r
-  if(sign){\r
-    pIndex = v0->GetPindex();\r
-    nIndex = v0->GetNindex();\r
-    mMass[0] = v0->GetEffMass(4, 2);\r
-    mMass[1] = v0->GetEffMass(2, 4);\r
-  }\r
-  else{\r
-    pIndex = v0->GetNindex();\r
-    nIndex = v0->GetPindex();    \r
-    mMass[0] = v0->GetEffMass(2, 4);\r
-    mMass[1] = v0->GetEffMass(4, 2);\r
-  }\r
\r
-  daughter[0] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(pIndex));\r
-  daughter[1] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(nIndex));\r
-  if(!daughter[0] || !daughter[1]) return kFALSE;\r
-\r
-  AliKFParticle *kfMother[2] = {0x0, 0x0};\r
-  // Lambda\r
-  kfMother[0] = CreateMotherParticle(daughter[0], daughter[1], TMath::Abs(kProton), TMath::Abs(kPiPlus));\r
-  if(!kfMother[0]) return kFALSE;\r
-  \r
-  // Anti-Lambda\r
-  kfMother[1] = CreateMotherParticle(daughter[0], daughter[1], TMath::Abs(kPiPlus), TMath::Abs(kProton));\r
-  if(!kfMother[1]) return kFALSE;\r
-\r
-  Float_t dMass[2] = {TMath::Abs(mMass[0] - cL0mass), TMath::Abs(mMass[1] - cL0mass)};\r
-  \r
-  AliESDtrack* d[2];\r
-  d[0] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(pIndex));\r
-  d[1] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(nIndex));\r
-  if(!d[0] || !d[1])    return kFALSE;\r
-  \r
-  Float_t p[2] = {d[0]->GetP(), d[1]->GetP()}; \r
-\r
-  // check the 3 lambda - antilambda variables\r
-  Int_t check[2] = {-1, -1};   // 0 : lambda, 1 : antilambda\r
-  // 1) momentum of the daughter particles - proton is expected to have higher momentum than pion\r
-  check[0] = (p[0] > p[1]) ? 0 : 1;\r
-  // 2) mass of the mother particle\r
-  check[1] = (dMass[0] < dMass[1]) ? 0 : 1;\r
\r
-  // require positive correlation of (1) and (2)\r
-  if(check[0] != check[1]){\r
-    if(kfMother[0]) delete kfMother[0]; \r
-    if(kfMother[1]) delete kfMother[1]; \r
-    return kFALSE;\r
-  }\r
-\r
-  // now that the check[0] == check[1]\r
-  const Int_t type = check[0];\r
-\r
-  // require that the input armenteros preselection agree:\r
-  if(type != id) return kFALSE;\r
-\r
-  Float_t iMass =0.;\r
-  if(sign){\r
-    iMass = (type == 0) ? v0->GetEffMass(4, 2) : v0->GetEffMass(2, 4);\r
-  }\r
-  else{\r
-    iMass = (type == 0) ? v0->GetEffMass(2, 4) : v0->GetEffMass(4, 2);\r
-  }\r
-\r
-  // cos pointing angle\r
-  Double_t cosPoint = v0->GetV0CosineOfPointingAngle();\r
-  cosPoint = TMath::ACos(cosPoint);\r
-\r
-  // DCA between daughters\r
-  Double_t dca = v0->GetDcaV0Daughters();\r
-  \r
-  // Production vertex\r
-  Double_t x, y, z; \r
-  v0->GetXYZ(x,y,z);\r
-  Double_t r = TMath::Sqrt(x*x + y*y);\r
-\r
-  // proton - pion indices\r
-  Int_t ix[2] = {0, 1};\r
-  if(1 == type){\r
-    ix[0] = 1;\r
-    ix[1] = 0;\r
-  }\r
-\r
-  // V0 chi2/ndf\r
-  Double_t chi2ndf = kfMother[type]->GetChi2()/kfMother[type]->GetNDF();\r
-\r
-  if(kfMother[0]) delete kfMother[0]; \r
-  if(kfMother[1]) delete kfMother[1]; \r
-\r
-  //\r
-  // apply the cuts\r
-  //\r
-\r
-  if(iMass < fLcutInvMass[0] || iMass > fLcutInvMass[1]) return kFALSE;\r
-\r
-  if(chi2ndf > fLcutChi2NDF) return kFALSE;\r
-\r
-  if(cosPoint < fLcutCosPoint[0] || cosPoint > fLcutCosPoint[1]) return kFALSE;\r
-\r
-  if(dca < fLcutDCA[0] || dca > fLcutDCA[1]) return kFALSE;\r
-\r
-  if(r < fLcutVertexR[0] || r > fLcutVertexR[1]) return kFALSE;\r
-\r
-  // all cuts passed\r
-\r
-  if(0 == type){\r
-    pdgV0 = 3122;\r
-    if(sign){\r
-      pdgP = 2212;\r
-      pdgN = -211;\r
-    }\r
-    else{\r
-      pdgP = -211;\r
-      pdgN = 2212;\r
-    }\r
-  }\r
-  else{\r
-    pdgV0 = -3122;\r
-    if(sign){\r
-      pdgP = 211;\r
-      pdgN = -2212;\r
-    }\r
-    else{\r
-      pdgP = -2212;\r
-      pdgN = 211;\r
-    }\r
-  }\r
-\r
-  return kTRUE;\r
-}\r
-//____________________________________________________________________\r
-Bool_t  AliESDv0KineCuts::V0CutsCommon(const AliESDv0 * const v0) const \r
-{\r
-  //\r
-  // V0 cuts common to all V0s\r
-  //\r
-\r
-  AliESDtrack* dN, *dP; \r
\r
-  dP = dynamic_cast<AliESDtrack *>(fEvent->GetTrack(v0->GetPindex()));\r
-  dN = dynamic_cast<AliESDtrack *>(fEvent->GetTrack(v0->GetNindex())); \r
-  \r
-  if(!dN || !dP) return kFALSE;\r
-\r
-  Int_t qP = dP->Charge();\r
-  Int_t qN = dN->Charge();\r
-\r
-  if((qP*qN) != -1) return kFALSE;\r
-\r
-  return kTRUE;\r
-}\r
-//____________________________________________________________________\r
-void AliESDv0KineCuts::Armenteros(AliESDv0* const v0, Float_t val[2]) const \r
-{\r
-  //\r
-  // computes the Armenteros variables for given V0\r
-  // fills the histogram\r
-  // returns the values via "val"\r
-  //\r
-  \r
-  Double_t mn[3] = {0,0,0};\r
-  Double_t mp[3] = {0,0,0};  \r
-  Double_t mm[3] = {0,0,0};  \r
-\r
-  if(CheckSigns(v0)){\r
-    v0->GetNPxPyPz(mn[0],mn[1],mn[2]); //reconstructed cartesian momentum components of negative daughter\r
-    v0->GetPPxPyPz(mp[0],mp[1],mp[2]); //reconstructed cartesian momentum components of positive daughter\r
-  }\r
-  else{\r
-    v0->GetPPxPyPz(mn[0],mn[1],mn[2]); //reconstructed cartesian momentum components of negative daughter\r
-    v0->GetNPxPyPz(mp[0],mp[1],mp[2]); //reconstructed cartesian momentum components of positive daughter\r
-  }\r
-  v0->GetPxPyPz(mm[0],mm[1],mm[2]); //reconstructed cartesian momentum components of mother\r
-\r
-  TVector3 vecN(mn[0],mn[1],mn[2]);\r
-  TVector3 vecP(mp[0],mp[1],mp[2]);\r
-  TVector3 vecM(mm[0],mm[1],mm[2]);\r
-  \r
-  Double_t thetaP = acos((vecP * vecM)/(vecP.Mag() * vecM.Mag()));\r
-  Double_t thetaN = acos((vecN * vecM)/(vecN.Mag() * vecM.Mag()));\r
-  \r
-  Double_t alfa = ((vecP.Mag())*cos(thetaP)-(vecN.Mag())*cos(thetaN))/\r
-    ((vecP.Mag())*cos(thetaP)+(vecN.Mag())*cos(thetaN)) ;\r
-  Double_t qt = vecP.Mag()*sin(thetaP);\r
-\r
-  val[0] = alfa;\r
-  val[1] = qt;\r
-}\r
-//____________________________________________________________________\r
-Bool_t AliESDv0KineCuts::CheckSigns(AliESDv0* const v0) const \r
-{\r
-  //\r
-  // check wheter the sign was correctly applied to \r
-  // V0 daughter tracks\r
-  //\r
-  \r
-  Bool_t correct = kFALSE;\r
-\r
-  Int_t pIndex = 0, nIndex = 0;\r
-  pIndex = v0->GetPindex();\r
-  nIndex = v0->GetNindex();\r
-  \r
-  AliESDtrack* d[2];\r
-  d[0] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(pIndex));\r
-  d[1] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(nIndex));\r
-\r
-  Int_t sign[2];\r
-  sign[0] = (int)d[0]->GetSign();\r
-  sign[1] = (int)d[1]->GetSign();\r
-  \r
-  if(-1 == sign[0] && 1 == sign[1]){\r
-    correct = kFALSE;\r
-  }\r
-  else{\r
-    correct = kTRUE;\r
-  }\r
-  \r
-  return correct;\r
-}\r
-//________________________________________________________________\r
-Double_t AliESDv0KineCuts::PsiPair(AliESDv0* const v0) const \r
-{\r
-  //\r
-  // Angle between daughter momentum plane and plane \r
-  // \r
-\r
-  if(!fEvent) return -1.;\r
-\r
-  Float_t magField = fEvent->GetMagneticField();\r
-\r
-  Int_t pIndex = -1;\r
-  Int_t nIndex = -1;\r
-  if(CheckSigns(v0)){\r
-    pIndex = v0->GetPindex();\r
-    nIndex = v0->GetNindex();\r
-  }\r
-  else{\r
-    pIndex = v0->GetNindex();\r
-    nIndex = v0->GetPindex();    \r
-  }\r
\r
-\r
-  AliESDtrack* daughter[2];\r
-\r
-  daughter[0] = dynamic_cast<AliESDtrack *>(fEvent->GetTrack(pIndex));\r
-  daughter[1] = dynamic_cast<AliESDtrack *>(fEvent->GetTrack(nIndex));\r
-\r
-  Double_t x, y, z;\r
-  v0->GetXYZ(x,y,z);//Reconstructed coordinates of V0; to be replaced by Markus Rammler's method in case of conversions!\r
-  \r
-  Double_t mn[3] = {0,0,0};\r
-  Double_t mp[3] = {0,0,0};\r
-  \r
-\r
-  v0->GetNPxPyPz(mn[0],mn[1],mn[2]);//reconstructed cartesian momentum components of negative daughter;\r
-  v0->GetPPxPyPz(mp[0],mp[1],mp[2]);//reconstructed cartesian momentum components of positive daughter; \r
-\r
-\r
-  Double_t deltat = 1.;\r
-  deltat = TMath::ATan(mp[2]/(TMath::Sqrt(mp[0]*mp[0] + mp[1]*mp[1])+1.e-13)) -  TMath::ATan(mn[2]/(TMath::Sqrt(mn[0]*mn[0] + mn[1]*mn[1])+1.e-13));//difference of angles of the two daughter tracks with z-axis\r
-\r
-  Double_t radiussum = TMath::Sqrt(x*x + y*y) + 50;//radius to which tracks shall be propagated\r
-\r
-  Double_t momPosProp[3];\r
-  Double_t momNegProp[3];\r
-    \r
-  AliExternalTrackParam pt(*daughter[0]), nt(*daughter[1]);\r
-    \r
-  Double_t psiPair = 4.;\r
-\r
-  if(nt.PropagateTo(radiussum,magField) == 0)//propagate tracks to the outside\r
-    psiPair =  -5.;\r
-  if(pt.PropagateTo(radiussum,magField) == 0)\r
-    psiPair = -5.;\r
-  pt.GetPxPyPz(momPosProp);//Get momentum vectors of tracks after propagation\r
-  nt.GetPxPyPz(momNegProp);\r
-  \r
-  Double_t pEle =\r
-    TMath::Sqrt(momNegProp[0]*momNegProp[0]+momNegProp[1]*momNegProp[1]+momNegProp[2]*momNegProp[2]);//absolute momentum value of negative daughter\r
-  Double_t pPos =\r
-    TMath::Sqrt(momPosProp[0]*momPosProp[0]+momPosProp[1]*momPosProp[1]+momPosProp[2]*momPosProp[2]);//absolute momentum value of positive daughter\r
-    \r
-  Double_t scalarproduct =\r
-    momPosProp[0]*momNegProp[0]+momPosProp[1]*momNegProp[1]+momPosProp[2]*momNegProp[2];//scalar product of propagated positive and negative daughters' momenta\r
-    \r
-  Double_t chipair = TMath::ACos(scalarproduct/(pEle*pPos));//Angle between propagated daughter tracks\r
-\r
-  psiPair =  TMath::Abs(TMath::ASin(deltat/chipair));  \r
-\r
-  return psiPair; \r
-}\r
-//___________________________________________________________________\r
-Bool_t  AliESDv0KineCuts::GetConvPosXY(AliESDtrack * const ptrack, AliESDtrack * const ntrack, Double_t convpos[2]) const\r
-{\r
-  //\r
-  // recalculate the gamma conversion XY postition\r
-  //\r
-\r
-  const Double_t b = fEvent->GetMagneticField();\r
-\r
-  Double_t helixcenterpos[2];\r
-  GetHelixCenter(ptrack,b,ptrack->Charge(),helixcenterpos);\r
-\r
-  Double_t helixcenterneg[2];\r
-  GetHelixCenter(ntrack,b,ntrack->Charge(),helixcenterneg);\r
-\r
-  Double_t  poshelix[6];\r
-  ptrack->GetHelixParameters(poshelix,b);\r
-  Double_t posradius = TMath::Abs(1./poshelix[4]);\r
-\r
-  Double_t  neghelix[6];\r
-  ntrack->GetHelixParameters(neghelix,b);\r
-  Double_t negradius = TMath::Abs(1./neghelix[4]);\r
-\r
-  Double_t xpos = helixcenterpos[0];\r
-  Double_t ypos = helixcenterpos[1];\r
-  Double_t xneg = helixcenterneg[0];\r
-  Double_t yneg = helixcenterneg[1];\r
-\r
-  convpos[0] = (xpos*negradius + xneg*posradius)/(negradius+posradius);\r
-  convpos[1] = (ypos*negradius+  yneg*posradius)/(negradius+posradius);\r
-\r
-  return 1;\r
-}\r
-//___________________________________________________________________\r
-Bool_t  AliESDv0KineCuts::GetHelixCenter(AliESDtrack * const track, Double_t b,Int_t charge, Double_t center[2]) const\r
-{\r
-  //\r
-  // computes the center of the track helix\r
-  //\r
-  \r
-  Double_t pi = TMath::Pi();\r
-  \r
-  Double_t  helix[6];\r
-  track->GetHelixParameters(helix,b);\r
-  \r
-  Double_t xpos =  helix[5];\r
-  Double_t ypos =  helix[0];\r
-  Double_t radius = TMath::Abs(1./helix[4]);\r
-  Double_t phi = helix[2];\r
-\r
-  if(phi < 0){\r
-    phi = phi + 2*pi;\r
-  }\r
-\r
-  phi -= pi/2.;\r
-  Double_t xpoint =  radius * TMath::Cos(phi);\r
-  Double_t ypoint =  radius * TMath::Sin(phi);\r
-\r
-  if(b<0){\r
-    if(charge > 0){\r
-      xpoint = - xpoint;\r
-      ypoint = - ypoint;\r
-    }\r
-    /* avoid self assignment\r
-    if(charge < 0){\r
-      xpoint =  xpoint;\r
-      ypoint =  ypoint;\r
-    }\r
-    */\r
-  }\r
-  if(b>0){\r
-    /* avoid self assignment\r
-    if(charge > 0){\r
-      xpoint =  xpoint;\r
-      ypoint =  ypoint;\r
-    }\r
-    */\r
-    if(charge < 0){\r
-      xpoint = - xpoint;\r
-      ypoint = - ypoint;\r
-    }\r
-  }\r
-  center[0] =  xpos + xpoint;\r
-  center[1] =  ypos + ypoint;\r
-\r
-  return 1;\r
-}\r
-//___________________________________________________________________\r
-AliKFParticle *AliESDv0KineCuts::CreateMotherParticle(const AliVTrack* const pdaughter, const AliVTrack* const ndaughter, Int_t pspec, Int_t nspec) const\r
-{\r
-  //\r
-  // Creates a mother particle\r
-  //\r
-  AliKFParticle pkfdaughter(*pdaughter, pspec);\r
-  AliKFParticle nkfdaughter(*ndaughter, nspec);\r
-  \r
-  \r
-  // Create the mother particle \r
-  AliKFParticle *m = new AliKFParticle(pkfdaughter, nkfdaughter);\r
-  m->SetField(fEvent->GetMagneticField());\r
-  if(TMath::Abs(kElectron) == pspec && TMath::Abs(kElectron) == nspec) m->SetMassConstraint(0, 0.001);\r
-  else if(TMath::Abs(kPiPlus) == pspec && TMath::Abs(kPiPlus) == nspec) m->SetMassConstraint(TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass(), 0.);\r
-  else if(TMath::Abs(kProton) == pspec && TMath::Abs(kPiPlus) == nspec) m->SetMassConstraint(TDatabasePDG::Instance()->GetParticle(kLambda0)->Mass(), 0.);\r
-  else if(TMath::Abs(kPiPlus) == pspec && TMath::Abs(kProton) == nspec) m->SetMassConstraint(TDatabasePDG::Instance()->GetParticle(kLambda0)->Mass(), 0.);\r
-  else{\r
-    AliErrorClass("Wrong daughter ID - mass constraint can not be set");\r
-  }\r
-\r
-  AliKFVertex improvedVertex = *fPrimaryVertex;\r
-  improvedVertex += *m;\r
-  m->SetProductionVertex(improvedVertex);\r
-  \r
-  // update 15/06/2010\r
-  // mother particle will not be added to primary vertex but only to its copy \r
-  // as this confilcts with calling\r
-  // m->SetPrimaryVertex() function and\r
-  // subsequently removing the mother particle afterwards\r
-  // Source: Sergey Gorbunov\r
-\r
-  return m;\r
-}\r
-//____________________________________________________________________\r
-void  AliESDv0KineCuts::SetEvent(AliESDEvent* const event){\r
-  //\r
-  // direct setter of ESD event\r
-  //\r
-  fEvent = event;\r
-  if(!fEvent){\r
-    AliErrorClass("Invalid input event pointer");\r
-    return;\r
-  }\r
-if (fUseExternalVertex) return;\r
-else{\r
-       if(fPrimaryVertex && fDeleteVertex){\r
-               delete  fPrimaryVertex;\r
-               fPrimaryVertex=0x0;\r
-               }\r
-       fPrimaryVertex = new AliKFVertex(*(fEvent->GetPrimaryVertex()));\r
-       fDeleteVertex=kTRUE;\r
-       }\r
-\r
-\r
-\r
-}\r
-//____________________________________________________________________\r
-void  AliESDv0KineCuts::SetEvent(AliVEvent* const event){\r
-  //\r
-  // direct setter of ESD event\r
-  //\r
-\r
-  fEvent = dynamic_cast<AliESDEvent*>(event);\r
-  if(!fEvent){\r
-    AliErrorClass("Invalid input event pointer");\r
-    return;\r
-  }\r
-  \r
-  if (fUseExternalVertex) return;\r
-  else{\r
-    if(fPrimaryVertex && fDeleteVertex){\r
-      delete   fPrimaryVertex;\r
-      fPrimaryVertex=0x0;\r
-      }\r
-    fPrimaryVertex = new AliKFVertex(*(fEvent->GetPrimaryVertex()));\r
-    fDeleteVertex=kTRUE;\r
-  }\r
-}\r
-\r
-\r
-//________________________________________________________________\r
-void    AliESDv0KineCuts::UseExternalVertex(Bool_t use_external){\r
-       //\r
-       // Reenable primary Vertex from ESD event\r
-       //\r
-       if (use_external) fUseExternalVertex =kTRUE;\r
-       else fUseExternalVertex =kFALSE;\r
-}\r
-\r
-\r
-\r
-\r
-//________________________________________________________________\r
-void AliESDv0KineCuts::SetPrimaryVertex(AliKFVertex* const v){\r
-  //\r
-  // set the primary vertex of the event\r
-  //\r
-       if(fPrimaryVertex && fDeleteVertex){   \r
-               delete  fPrimaryVertex;\r
-               fPrimaryVertex =0x0;\r
-               fDeleteVertex = kFALSE;\r
-               }  \r
-  fUseExternalVertex=kTRUE; \r
-  fPrimaryVertex = v; // set primary Vertex\r
-  if(!fPrimaryVertex){\r
-    AliErrorClass("Failed to initialize the primary vertex");\r
-    return;\r
-  }\r
-}\r
-//___________________________________________________________________\r
-void AliESDv0KineCuts::SetMode(Int_t mode, Int_t type){\r
-  //\r
-  // this function allows the user to select (prior running the 'ProcessV0' function)\r
-  // to select different approaches to V0 selection - the 'mode'\r
-  // - and -\r
-  // different systems (pp, PbPb) - 'type' \r
-  //\r
-  // To see the cut values for different modes please refer to the\r
-  // function SetCuts()\r
-  //\r
-  // Important notice: based on the parameters particular sets of cuts will\r
-  // be activated for teh V0 selection. If some additional changes to single\r
-  // cuts are needed please us the SetXXXcut function (see the header file)\r
-  // \r
-\r
-  switch(mode){\r
-  case kPurity:\r
-    fMode = kPurity;  // used to obtain highest purity possible - the efficiency may be low\r
-    break;\r
-  case kEffGamma:\r
-    fMode = kEffGamma; // used to obtain highes efficiency possible - the purity may be worse\r
-    break;\r
-  default:\r
-    AliError("V0 selection mode not recognozed, setting 'kPurity'");\r
-    fMode = kPurity;\r
-  }\r
-\r
-  switch(type){\r
-  case kPP:\r
-    fType = kPP;  // cuts optimized for low multiplicity \r
-    break;\r
-  case kPbPb:\r
-    fType = kPbPb;  // cuts optimized for high multiplicity\r
-    break;\r
-  }\r
-  \r
-  // setup the cut values for selected mode & type\r
-  SetCuts();\r
-\r
-}\r
-//___________________________________________________________________\r
-void AliESDv0KineCuts::SetMode(Int_t mode, const char* type){\r
-  //\r
-  // overloaded function - please see above\r
-  // \r
-  \r
-  Int_t t = -1;\r
-\r
-  if(!strcmp("pp", type)) t = kPP;\r
-  else if(!(strcmp("PbPb", type))) t = kPbPb;\r
-  else{\r
-    AliError("data type not recognized, setting 'pp'");\r
-    t = kPP;    \r
-  }\r
-\r
-  SetMode(mode, t);\r
-\r
-}\r
-//___________________________________________________________________\r
-void AliESDv0KineCuts::SetCuts(){\r
-  //\r
-  // this funciton sets the default cut values based on the selected\r
-  // fMode and fType.\r
-  // please note that only the cuts that have different values than the default\r
-  // cuts are updated here\r
-  //\r
-  \r
-  // last update: 14/02/2011\r
-  // as a very preliminary  - the only change to default cuts is to apply\r
-  // less restricting gamma conversion selection in PreselectV0() function\r
-  \r
-\r
-  \r
-}\r
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/*
+ * author: M.Kalisky@gsi.de
+ * 08/Dec/2010
+ *
+ * Description: This class allows with purely kinematical cuts
+ * to select clean samples of electrons, pions and protons from the
+ * V0 online finder ESD V0 candidates for PID and dectector resonse
+ * studies.
+ */
+
+#include <TVector3.h>
+#include <TDatabasePDG.h>
+
+#include "AliESDv0.h"
+#include "AliESDtrack.h"
+#include "AliESDEvent.h"
+#include "AliVEvent.h"
+#include "AliLog.h"
+#include "AliKFParticle.h"
+#include "AliVTrack.h"
+#include "AliKFVertex.h"
+
+#include "AliESDv0KineCuts.h"
+
+ClassImp(AliESDv0KineCuts)
+
+//____________________________________________________________________
+AliESDv0KineCuts::AliESDv0KineCuts() :
+  fEvent(0x0)
+  , fPrimaryVertex(0x0)
+  , fType(0)
+  , fMode(0)
+  , fTPCNcls(1)
+  , fTPCrefit(kTRUE)
+  , fTPCchi2perCls(4.0)
+  , fTPCclsRatio(0.6)
+  , fNoKinks(kTRUE)
+  , fGcutChi2NDF(10)
+  , fGcutInvMass(0.05)
+  , fK0cutChi2NDF(10)
+  , fLcutChi2NDF(10)
+  , fUseExternalVertex(kFALSE)
+  , fDeleteVertex(kFALSE)
+{
+  //
+  // Default constructor
+  //
+
+  // default single track cuts
+  fTPCNcls = 1;                // minimal number of the TPC clusters
+  fTPCrefit = kTRUE;           // TPC refit
+  fTPCchi2perCls = 4.0;        // chi2 per TPC cluster
+  fTPCclsRatio = 0.6;          // minimal foun/findable TPC cluster ratio
+  fNoKinks = kTRUE;            // kinks - no [kTRUE] or do not care [kFalse]
+
+
+  // default gamma cuts values
+  fGcutChi2NDF = 10;           // Chi2NF cut value for the AliKFparticle gamma
+  fGcutCosPoint[0] = 0;        // cos of the pointing angle [min, max]
+  fGcutCosPoint[1] = 0.02;     // cos of the pointing angle [min, max]
+  fGcutDCA[0] = 0.;            // DCA between the daughter tracks [min, max]
+  fGcutDCA[1] = 0.25;          // DCA between the daughter tracks [min, max]
+  fGcutVertexR[0] = 3.;        // radius of the conversion point [min, max]
+  fGcutVertexR[1] = 90.;       // radius of the conversion point [min, max]
+  fGcutPsiPair[0] = 0.;        // value of the psi pair cut [min, max]
+  fGcutPsiPair[1] = 0.05;      // value of the psi pair cut [min, max]
+  fGcutInvMass = 0.05;         // upper value on the gamma invariant mass
+  // default K0 cuts
+  fK0cutChi2NDF = 10;          // Chi2NF cut value for the AliKFparticle K0
+  fK0cutCosPoint[0] = 0.;      // cos of the pointing angle [min, max]
+  fK0cutCosPoint[1] = 0.02;    // cos of the pointing angle [min, max]
+  fK0cutDCA[0] = 0.;           // DCA between the daughter tracks [min, max]
+  fK0cutDCA[1] = 0.2;          // DCA between the daughter tracks [min, max]
+  fK0cutVertexR[0] = 2.0;      // radius of the decay point [min, max]
+  fK0cutVertexR[1] = 30.0;     // radius of the decay point [min, max]
+  fK0cutInvMass[0] = 0.486;    // invariant mass window
+  fK0cutInvMass[1] = 0.508;    // invariant mass window
+  // Lambda & anti-Lambda cut values
+  fLcutChi2NDF = 10;           // Chi2NF cut value for the AliKFparticle K0
+  fLcutCosPoint[0] = 0.;       // cos of the pointing angle [min, max]
+  fLcutCosPoint[1] = 0.02;     // cos of the pointing angle [min, max]
+  fLcutDCA[0] = 0.;            // DCA between the daughter tracks [min, max]
+  fLcutDCA[1] = 0.2;           // DCA between the daughter tracks [min, max]
+  fLcutVertexR[0] = 2.0;       // radius of the decay point [min, max]
+  fLcutVertexR[1] = 40.0;      // radius of the decay point [min, max]
+  fLcutInvMass[0] = 1.11;      // invariant mass window
+  fLcutInvMass[1] = 1.12;      // invariant mass window
+    
+}
+//____________________________________________________________________
+AliESDv0KineCuts::~AliESDv0KineCuts(){
+  //
+  // Destructor
+  //
+
+
+}
+//____________________________________________________________________
+AliESDv0KineCuts::AliESDv0KineCuts(const AliESDv0KineCuts &ref):
+  TObject(ref)
+  , fEvent(0x0)
+  , fPrimaryVertex(0x0)
+  , fType(0)
+  , fMode(0)
+  , fTPCNcls(1)
+  , fTPCrefit(kTRUE)
+  , fTPCchi2perCls(4.0)
+  , fTPCclsRatio(0.6)
+  , fNoKinks(kTRUE)
+  , fGcutChi2NDF(10)
+  , fGcutInvMass(0.05)
+  , fK0cutChi2NDF(10)
+  , fLcutChi2NDF(10)
+  , fUseExternalVertex(kFALSE)
+  , fDeleteVertex(kFALSE)
+{
+  //
+  // Copy operator
+  //
+
+  ref.Copy(*this);
+}
+//____________________________________________________________________
+AliESDv0KineCuts &AliESDv0KineCuts::operator=(const AliESDv0KineCuts &ref){
+  //
+  // assignment operator
+  //
+  if(this != &ref)
+    ref.Copy(*this);
+  return *this; 
+}
+//____________________________________________________________________
+void AliESDv0KineCuts::Copy(TObject &ref) const {
+  //
+  // Performs the copying of the object
+  //
+
+  TObject::Copy(ref);
+
+  AliESDv0KineCuts &target = dynamic_cast<AliESDv0KineCuts &>(ref);
+
+  // default single track cuts
+  target.fTPCNcls = fTPCNcls;
+  target.fTPCrefit = fTPCrefit;
+  target.fTPCchi2perCls = fTPCchi2perCls;
+  target.fTPCclsRatio = fTPCclsRatio;
+  target.fNoKinks = fNoKinks;
+  target.fUseExternalVertex = fUseExternalVertex;  //added december 2nd 2011
+  target.fDeleteVertex = fDeleteVertex;  //added december 2nd 2011
+
+  // default gamma cuts values
+  target.fGcutChi2NDF = fGcutChi2NDF;
+  memcpy(target.fGcutCosPoint, fGcutCosPoint, sizeof(Float_t) * 2);
+  memcpy(target.fGcutDCA, fGcutDCA, sizeof(Float_t) * 2); 
+  memcpy(target.fGcutVertexR, fGcutVertexR, sizeof(Float_t) * 2);
+  memcpy(target.fGcutPsiPair, fGcutPsiPair, sizeof(Float_t) * 2);
+  target.fGcutInvMass = fGcutInvMass;
+  // default K0 cuts
+  target.fK0cutChi2NDF = fK0cutChi2NDF;
+  memcpy(target.fK0cutCosPoint, fK0cutCosPoint, sizeof(Float_t) * 2);
+  memcpy(target.fK0cutDCA, fK0cutDCA, sizeof(Float_t) * 2);
+  memcpy(target.fK0cutVertexR, fK0cutVertexR, sizeof(Float_t) * 2);
+  memcpy(target.fK0cutInvMass, fK0cutInvMass, sizeof(Float_t) * 2);
+  // Lambda & anti-Lambda cut values
+  target.fLcutChi2NDF = fLcutChi2NDF;
+  memcpy(target.fLcutCosPoint, fLcutCosPoint, sizeof(Float_t) * 2);
+  memcpy(target.fLcutDCA, fLcutDCA, sizeof(Float_t) * 2);
+  memcpy(target.fLcutVertexR, fLcutVertexR, sizeof(Float_t) * 2);
+  memcpy(target.fLcutInvMass, fLcutInvMass, sizeof(Float_t) * 2);
+  
+}
+//____________________________________________________________________
+Bool_t  AliESDv0KineCuts::ProcessV0(AliESDv0* const v0, Int_t &pdgV0, Int_t &pdgP, Int_t &pdgN) const 
+{
+  //
+  // main user function
+  //
+
+  if(!v0) return kFALSE;
+  if(!fEvent){
+    AliErrorClass("No valid Event pointer available, provide it first");
+    return kFALSE;
+  }
+
+  if(!V0CutsCommon(v0)) return kFALSE;
+
+  const Int_t id = PreselectV0(v0);
+
+  if(!SingleTrackCuts(v0)) return kFALSE;
+
+  switch(id){
+  case kUndef:
+    return kFALSE;
+  case kGamma:
+    return CaseGamma(v0, pdgV0, pdgP, pdgN);
+  case kK0:
+    return CaseK0(v0, pdgV0, pdgP, pdgN);
+  case kLambda:
+    return CaseLambda(v0, pdgV0, pdgP, pdgN, 0);
+  case kALambda:
+    return CaseLambda(v0, pdgV0, pdgP, pdgN, 1);
+  default:
+    return kFALSE; 
+  }
+
+  return kFALSE;
+}
+//____________________________________________________________________
+Bool_t  AliESDv0KineCuts::ProcessV0(AliESDv0* const v0, Int_t &pdgP, Int_t &pdgN) const 
+{
+  //
+  // main user function, simplified if the V0 identity is not necessary
+  //
+
+  if(!v0) return kFALSE;
+  if(!fEvent){
+    AliErrorClass("No valid Event pointer available, provide it first");
+    return kFALSE;
+  }
+
+  Int_t idV0 = -1;
+  return ProcessV0(v0, idV0, pdgP, pdgN);
+
+}
+//____________________________________________________________________
+Int_t AliESDv0KineCuts::PreselectV0(AliESDv0* const v0) const 
+{
+  //
+  // Make a preselection (exclusive) of the V0 cadidates based on
+  // Armenteros plot
+  // the armenteros cut values are currently fixed and user is not able to set them via
+  // set funcions. The reason is that these cuts are optimized and furneter changes should 
+  // not be necessary. To prove otherwise please study in detail before changing the values
+  //
+  Float_t ap[2] = {-1., -1.};
+  Armenteros(v0, ap);
+  // for clarity
+  const Float_t alpha = ap[0];
+  const Float_t qt = ap[1];
+
+  // selection cuts 
+  // - the reagions for different candidates must not overlap 
+
+  // Gamma cuts
+  const Double_t cutAlphaG = 0.35; 
+  const Double_t cutQTG = 0.05;
+  const Double_t cutAlphaG2[2] = {0.6, 0.8};
+  const Double_t cutQTG2 = 0.04;
+
+  // K0 cuts
+  const Float_t cutQTK0[2] = {0.1075, 0.215};
+  const Float_t cutAPK0[2] = {0.199, 0.8};   // parameters for curved QT cut
+  
+  // Lambda & A-Lambda cuts
+  const Float_t cutQTL = 0.03;
+  const Float_t cutAlphaL[2] = {0.35, 0.7};
+  const Float_t cutAlphaAL[2] = {-0.7,  -0.35};
+  const Float_t cutAPL[3] = {0.107, -0.69, 0.5};  // parameters fir curved QT cut
+
+
+  if(kPurity == fMode){
+  // Check for Gamma candidates
+    if(qt < cutQTG){
+      if( (TMath::Abs(alpha) < cutAlphaG) ) return kGamma;
+    }
+    // additional region - should help high pT gammas
+    if(qt < cutQTG2){
+      if( (TMath::Abs(alpha) > cutAlphaG2[0]) &&  (TMath::Abs(alpha) < cutAlphaG2[1]) ) return kGamma;
+    }
+  }
+  if(kEffGamma == fMode){
+    if(qt < cutQTG) return kGamma;
+  }
+
+  
+  // Check for K0 candidates
+  Float_t q = cutAPK0[0] * TMath::Sqrt(TMath::Abs(1 - alpha*alpha/(cutAPK0[1]*cutAPK0[1])));
+  if( (qt > cutQTK0[0]) && (qt < cutQTK0[1]) && (qt > q) ){
+    return kK0;
+  }
+
+  // Check for Lambda candidates
+  q = cutAPL[0] * TMath::Sqrt(TMath::Abs(1 - ( (alpha + cutAPL[1]) * (alpha + cutAPL[1]) ) / (cutAPL[2]*cutAPL[2]) ));
+  if( (alpha > cutAlphaL[0]) && (alpha < cutAlphaL[1]) && (qt > cutQTL) && (qt < q)  ){
+    return kLambda;
+  }
+
+  // Check for A-Lambda candidates
+  q = cutAPL[0] * TMath::Sqrt(TMath::Abs(1 - ( (alpha - cutAPL[1]) * (alpha - cutAPL[1]) ) / (cutAPL[2]*cutAPL[2]) ));
+  if( (alpha > cutAlphaAL[0]) && (alpha < cutAlphaAL[1]) && (qt > cutQTL) && (qt < q)  ){
+    return kALambda;
+  }
+  
+  return kUndef;
+}
+//____________________________________________________________________
+Bool_t  AliESDv0KineCuts::SingleTrackCuts(AliESDv0 * const v0) const 
+{
+  //
+  // apply single track cuts
+  // correct sign not relevat here
+  //
+
+  if(!v0) return kFALSE;
+  
+  Int_t pIndex = 0, nIndex = 0;
+  pIndex = v0->GetPindex();
+  nIndex = v0->GetNindex();
+  AliESDtrack* d[2];
+  d[0] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(pIndex));
+  d[1] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(nIndex));
+  
+  for(Int_t i=0; i<2; ++i){
+    if(!d[i]) return kFALSE;
+    
+    // status word
+    ULong_t status = d[i]->GetStatus();
+
+    // No. of TPC clusters leave to the users
+    if(d[i]->GetTPCNcls() < 1) return kFALSE;
+
+    // TPC refit
+    if(!(status & AliESDtrack::kTPCrefit)) return kFALSE;
+  
+    // Chi2 per TPC cluster
+    Int_t nTPCclusters = d[i]->GetTPCNcls();
+    Float_t chi2perTPCcluster = d[i]->GetTPCchi2()/Float_t(nTPCclusters);
+    if(chi2perTPCcluster > 4) return kFALSE;
+
+    // TPC cluster ratio
+    Float_t cRatioTPC = d[i]->GetTPCNclsF() > 0. ? static_cast<Float_t>(d[i]->GetTPCNcls())/static_cast<Float_t> (d[i]->GetTPCNclsF()) : 1.;
+    if(cRatioTPC < 0.6) return kFALSE;
+    
+    // kinks
+    if(d[i]->GetKinkIndex(0) != 0) return kFALSE;
+    
+  }
+
+  return kTRUE;
+}
+//____________________________________________________________________
+Bool_t AliESDv0KineCuts::CaseGamma(AliESDv0* const v0, Int_t &pdgV0, Int_t &pdgP, Int_t &pdgN) const 
+{
+  //
+  // process the gamma conversion candidate
+  //
+
+  if(!v0) return kFALSE;
+
+  AliVTrack* daughter[2];
+  Int_t pIndex = 0, nIndex = 0;
+
+  Bool_t sign = CheckSigns(v0);
+  if(sign){
+    pIndex = v0->GetPindex();
+    nIndex = v0->GetNindex();
+  }
+  else{
+    pIndex = v0->GetNindex();
+    nIndex = v0->GetPindex();    
+  }
+  daughter[0] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(pIndex));
+  daughter[1] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(nIndex));
+  if(!daughter[0] || !daughter[1]) return kFALSE;
+
+  AliKFParticle *kfMother = CreateMotherParticle(daughter[0], daughter[1], TMath::Abs(kElectron), TMath::Abs(kElectron));
+  if(!kfMother) return kFALSE;
+
+  AliESDtrack* d[2];
+  d[0] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(pIndex));
+  d[1] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(nIndex));
+
+  Float_t iMass = v0->GetEffMass(0, 0);
+
+  // cos pointing angle
+  Double_t cosPoint = v0->GetV0CosineOfPointingAngle();
+  cosPoint = TMath::ACos(cosPoint);
+
+  // DCA between daughters
+  Double_t dca = v0->GetDcaV0Daughters();
+
+  // Production vertex
+  Double_t x, y, z; 
+  v0->GetXYZ(x,y,z);
+  Double_t r = TMath::Sqrt(x*x + y*y);
+
+  Double_t xy[2];
+  Double_t r2 = -1.;
+  if ( GetConvPosXY(d[0], d[1], xy) ){
+    r2 = TMath::Sqrt(xy[0]*xy[0] + xy[1]*xy[1]);
+  }
+
+  // psi pair 
+  Double_t psiPair = PsiPair(v0);
+  
+  // V0 chi2/ndf
+  Double_t chi2ndf = kfMother->GetChi2()/kfMother->GetNDF();
+
+  if(kfMother) delete kfMother; 
+  
+  // apply the cuts
+
+  if(iMass > fGcutInvMass) return kFALSE;
+
+  if(chi2ndf > fGcutChi2NDF) return kFALSE;
+
+  if(cosPoint < fGcutCosPoint[0] || cosPoint > fGcutCosPoint[1]) return kFALSE;
+
+  if(dca < fGcutDCA[0] || dca > fGcutDCA[1]) return kFALSE;
+
+  if(r < fGcutVertexR[0] || r > fGcutVertexR[1]) return kFALSE;
+
+  if(psiPair < fGcutPsiPair[0] || psiPair > fGcutPsiPair[1]) return kFALSE;
+  
+  // all cuts passed
+
+  pdgV0 = 22;
+  if(sign){
+    pdgP = -11;
+    pdgN = 11;
+  }
+  else{
+    pdgP = 11;
+    pdgN = -11;
+  }
+
+  return kTRUE;
+}
+//____________________________________________________________________
+Bool_t  AliESDv0KineCuts::CaseK0(AliESDv0* const v0, Int_t &pdgV0, Int_t &pdgP, Int_t &pdgN) const {
+  //
+  // process the K0 candidate
+  //
+
+  if(!v0) return kFALSE;
+  
+  AliVTrack* daughter[2];
+  Int_t pIndex = 0, nIndex = 0;
+  Bool_t sign = CheckSigns(v0);
+  if(sign){
+    pIndex = v0->GetPindex();
+    nIndex = v0->GetNindex();
+  }
+  else{
+    pIndex = v0->GetNindex();
+    nIndex = v0->GetPindex();    
+  }
+  daughter[0] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(pIndex));
+  daughter[1] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(nIndex));
+  if(!daughter[0] || !daughter[1]) return kFALSE;
+
+  AliKFParticle *kfMother = CreateMotherParticle(daughter[0], daughter[1], TMath::Abs(kPiPlus), TMath::Abs(kPiPlus));
+  if(!kfMother) return kFALSE;
+
+  AliESDtrack* d[2];
+  d[0] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(pIndex));
+  d[1] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(nIndex));
+
+  Float_t iMass = v0->GetEffMass(2, 2);
+
+  // cos pointing angle
+  Double_t cosPoint = v0->GetV0CosineOfPointingAngle();
+  cosPoint = TMath::ACos(cosPoint);
+
+  // DCA between daughters
+  Double_t dca = v0->GetDcaV0Daughters();
+
+  // Production vertex
+  Double_t x, y, z; 
+  v0->GetXYZ(x,y,z);
+
+  Double_t r = TMath::Sqrt(x*x + y*y);  
+
+  // V0 chi2/ndf
+  Double_t chi2ndf = kfMother->GetChi2()/kfMother->GetNDF();
+  
+  if(kfMother) delete kfMother; 
+
+  //
+  // apply the cuts
+  //
+  if(iMass < fK0cutInvMass[0] || iMass > fK0cutInvMass[1]) return kFALSE;
+
+  if(chi2ndf > fK0cutChi2NDF) return kFALSE;
+
+  if(cosPoint < fK0cutCosPoint[0] || cosPoint > fK0cutCosPoint[1]) return kFALSE;
+
+  if(dca < fK0cutDCA[0] || dca > fK0cutDCA[1]) return kFALSE;
+
+  if(r < fK0cutVertexR[0] || r > fK0cutVertexR[1]) return kFALSE;
+
+  // all cuts passed
+  pdgV0 = 310;
+  if(sign){
+    pdgP = 211;
+    pdgN = -211;
+  }
+  else{
+    pdgP = -211;
+    pdgN = 211;
+  }
+
+  return kTRUE;
+}
+//____________________________________________________________________
+Bool_t  AliESDv0KineCuts::CaseLambda(AliESDv0* const v0, Int_t &pdgV0, Int_t &pdgP, Int_t &pdgN, Int_t id) const {
+  //
+  // process teh Lambda and Anti-Lambda candidate
+  //
+  
+  if(!v0) return kFALSE;
+
+    const Double_t cL0mass=TDatabasePDG::Instance()->GetParticle(kLambda0)->Mass();  // PDG lambda mass
+
+  AliVTrack* daughter[2];
+  Int_t pIndex = 0, nIndex = 0;
+  Float_t mMass[2] = {-1., -1.};
+  Bool_t sign = CheckSigns(v0);
+  if(sign){
+    pIndex = v0->GetPindex();
+    nIndex = v0->GetNindex();
+    mMass[0] = v0->GetEffMass(4, 2);
+    mMass[1] = v0->GetEffMass(2, 4);
+  }
+  else{
+    pIndex = v0->GetNindex();
+    nIndex = v0->GetPindex();    
+    mMass[0] = v0->GetEffMass(2, 4);
+    mMass[1] = v0->GetEffMass(4, 2);
+  }
+  daughter[0] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(pIndex));
+  daughter[1] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(nIndex));
+  if(!daughter[0] || !daughter[1]) return kFALSE;
+
+  AliKFParticle *kfMother[2] = {0x0, 0x0};
+  // Lambda
+  kfMother[0] = CreateMotherParticle(daughter[0], daughter[1], TMath::Abs(kProton), TMath::Abs(kPiPlus));
+  if(!kfMother[0]) return kFALSE;
+  
+  // Anti-Lambda
+  kfMother[1] = CreateMotherParticle(daughter[0], daughter[1], TMath::Abs(kPiPlus), TMath::Abs(kProton));
+  if(!kfMother[1]) return kFALSE;
+
+  Float_t dMass[2] = {TMath::Abs(mMass[0] - cL0mass), TMath::Abs(mMass[1] - cL0mass)};
+  
+  AliESDtrack* d[2];
+  d[0] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(pIndex));
+  d[1] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(nIndex));
+  if(!d[0] || !d[1])    return kFALSE;
+  
+  Float_t p[2] = {d[0]->GetP(), d[1]->GetP()}; 
+
+  // check the 3 lambda - antilambda variables
+  Int_t check[2] = {-1, -1};   // 0 : lambda, 1 : antilambda
+  // 1) momentum of the daughter particles - proton is expected to have higher momentum than pion
+  check[0] = (p[0] > p[1]) ? 0 : 1;
+  // 2) mass of the mother particle
+  check[1] = (dMass[0] < dMass[1]) ? 0 : 1;
+  // require positive correlation of (1) and (2)
+  if(check[0] != check[1]){
+    if(kfMother[0]) delete kfMother[0]; 
+    if(kfMother[1]) delete kfMother[1]; 
+    return kFALSE;
+  }
+
+  // now that the check[0] == check[1]
+  const Int_t type = check[0];
+
+  // require that the input armenteros preselection agree:
+  if(type != id) return kFALSE;
+
+  Float_t iMass =0.;
+  if(sign){
+    iMass = (type == 0) ? v0->GetEffMass(4, 2) : v0->GetEffMass(2, 4);
+  }
+  else{
+    iMass = (type == 0) ? v0->GetEffMass(2, 4) : v0->GetEffMass(4, 2);
+  }
+
+  // cos pointing angle
+  Double_t cosPoint = v0->GetV0CosineOfPointingAngle();
+  cosPoint = TMath::ACos(cosPoint);
+
+  // DCA between daughters
+  Double_t dca = v0->GetDcaV0Daughters();
+  
+  // Production vertex
+  Double_t x, y, z; 
+  v0->GetXYZ(x,y,z);
+  Double_t r = TMath::Sqrt(x*x + y*y);
+
+  // proton - pion indices
+  Int_t ix[2] = {0, 1};
+  if(1 == type){
+    ix[0] = 1;
+    ix[1] = 0;
+  }
+
+  // V0 chi2/ndf
+  Double_t chi2ndf = kfMother[type]->GetChi2()/kfMother[type]->GetNDF();
+
+  if(kfMother[0]) delete kfMother[0]; 
+  if(kfMother[1]) delete kfMother[1]; 
+
+  //
+  // apply the cuts
+  //
+
+  if(iMass < fLcutInvMass[0] || iMass > fLcutInvMass[1]) return kFALSE;
+
+  if(chi2ndf > fLcutChi2NDF) return kFALSE;
+
+  if(cosPoint < fLcutCosPoint[0] || cosPoint > fLcutCosPoint[1]) return kFALSE;
+
+  if(dca < fLcutDCA[0] || dca > fLcutDCA[1]) return kFALSE;
+
+  if(r < fLcutVertexR[0] || r > fLcutVertexR[1]) return kFALSE;
+
+  // all cuts passed
+
+  if(0 == type){
+    pdgV0 = 3122;
+    if(sign){
+      pdgP = 2212;
+      pdgN = -211;
+    }
+    else{
+      pdgP = -211;
+      pdgN = 2212;
+    }
+  }
+  else{
+    pdgV0 = -3122;
+    if(sign){
+      pdgP = 211;
+      pdgN = -2212;
+    }
+    else{
+      pdgP = -2212;
+      pdgN = 211;
+    }
+  }
+
+  return kTRUE;
+}
+//____________________________________________________________________
+Bool_t  AliESDv0KineCuts::V0CutsCommon(const AliESDv0 * const v0) const 
+{
+  //
+  // V0 cuts common to all V0s
+  //
+
+  AliESDtrack* dN, *dP; 
+  dP = dynamic_cast<AliESDtrack *>(fEvent->GetTrack(v0->GetPindex()));
+  dN = dynamic_cast<AliESDtrack *>(fEvent->GetTrack(v0->GetNindex())); 
+  
+  if(!dN || !dP) return kFALSE;
+
+  Int_t qP = dP->Charge();
+  Int_t qN = dN->Charge();
+
+  if((qP*qN) != -1) return kFALSE;
+
+  return kTRUE;
+}
+//____________________________________________________________________
+void AliESDv0KineCuts::Armenteros(AliESDv0* const v0, Float_t val[2]) const 
+{
+  //
+  // computes the Armenteros variables for given V0
+  // fills the histogram
+  // returns the values via "val"
+  //
+  
+  Double_t mn[3] = {0,0,0};
+  Double_t mp[3] = {0,0,0};  
+  Double_t mm[3] = {0,0,0};  
+
+  if(CheckSigns(v0)){
+    v0->GetNPxPyPz(mn[0],mn[1],mn[2]); //reconstructed cartesian momentum components of negative daughter
+    v0->GetPPxPyPz(mp[0],mp[1],mp[2]); //reconstructed cartesian momentum components of positive daughter
+  }
+  else{
+    v0->GetPPxPyPz(mn[0],mn[1],mn[2]); //reconstructed cartesian momentum components of negative daughter
+    v0->GetNPxPyPz(mp[0],mp[1],mp[2]); //reconstructed cartesian momentum components of positive daughter
+  }
+  v0->GetPxPyPz(mm[0],mm[1],mm[2]); //reconstructed cartesian momentum components of mother
+
+  TVector3 vecN(mn[0],mn[1],mn[2]);
+  TVector3 vecP(mp[0],mp[1],mp[2]);
+  TVector3 vecM(mm[0],mm[1],mm[2]);
+  
+  Double_t thetaP = acos((vecP * vecM)/(vecP.Mag() * vecM.Mag()));
+  Double_t thetaN = acos((vecN * vecM)/(vecN.Mag() * vecM.Mag()));
+  
+  Double_t alfa = ((vecP.Mag())*cos(thetaP)-(vecN.Mag())*cos(thetaN))/
+    ((vecP.Mag())*cos(thetaP)+(vecN.Mag())*cos(thetaN)) ;
+  Double_t qt = vecP.Mag()*sin(thetaP);
+
+  val[0] = alfa;
+  val[1] = qt;
+}
+//____________________________________________________________________
+Bool_t AliESDv0KineCuts::CheckSigns(AliESDv0* const v0) const 
+{
+  //
+  // check wheter the sign was correctly applied to 
+  // V0 daughter tracks
+  //
+  
+  Bool_t correct = kFALSE;
+
+  Int_t pIndex = 0, nIndex = 0;
+  pIndex = v0->GetPindex();
+  nIndex = v0->GetNindex();
+  
+  AliESDtrack* d[2];
+  d[0] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(pIndex));
+  d[1] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(nIndex));
+
+  Int_t sign[2];
+  sign[0] = (int)d[0]->GetSign();
+  sign[1] = (int)d[1]->GetSign();
+  
+  if(-1 == sign[0] && 1 == sign[1]){
+    correct = kFALSE;
+  }
+  else{
+    correct = kTRUE;
+  }
+  
+  return correct;
+}
+//________________________________________________________________
+Double_t AliESDv0KineCuts::PsiPair(AliESDv0* const v0) const 
+{
+  //
+  // Angle between daughter momentum plane and plane 
+  // 
+
+  if(!fEvent) return -1.;
+
+  Float_t magField = fEvent->GetMagneticField();
+
+  Int_t pIndex = -1;
+  Int_t nIndex = -1;
+  if(CheckSigns(v0)){
+    pIndex = v0->GetPindex();
+    nIndex = v0->GetNindex();
+  }
+  else{
+    pIndex = v0->GetNindex();
+    nIndex = v0->GetPindex();    
+  }
+
+  AliESDtrack* daughter[2];
+
+  daughter[0] = dynamic_cast<AliESDtrack *>(fEvent->GetTrack(pIndex));
+  daughter[1] = dynamic_cast<AliESDtrack *>(fEvent->GetTrack(nIndex));
+
+  Double_t x, y, z;
+  v0->GetXYZ(x,y,z);//Reconstructed coordinates of V0; to be replaced by Markus Rammler's method in case of conversions!
+  
+  Double_t mn[3] = {0,0,0};
+  Double_t mp[3] = {0,0,0};
+  
+
+  v0->GetNPxPyPz(mn[0],mn[1],mn[2]);//reconstructed cartesian momentum components of negative daughter;
+  v0->GetPPxPyPz(mp[0],mp[1],mp[2]);//reconstructed cartesian momentum components of positive daughter; 
+
+
+  Double_t deltat = 1.;
+  deltat = TMath::ATan(mp[2]/(TMath::Sqrt(mp[0]*mp[0] + mp[1]*mp[1])+1.e-13)) -  TMath::ATan(mn[2]/(TMath::Sqrt(mn[0]*mn[0] + mn[1]*mn[1])+1.e-13));//difference of angles of the two daughter tracks with z-axis
+
+  Double_t radiussum = TMath::Sqrt(x*x + y*y) + 50;//radius to which tracks shall be propagated
+
+  Double_t momPosProp[3];
+  Double_t momNegProp[3];
+    
+  AliExternalTrackParam pt(*daughter[0]), nt(*daughter[1]);
+    
+  Double_t psiPair = 4.;
+
+  if(nt.PropagateTo(radiussum,magField) == 0)//propagate tracks to the outside
+    psiPair =  -5.;
+  if(pt.PropagateTo(radiussum,magField) == 0)
+    psiPair = -5.;
+  pt.GetPxPyPz(momPosProp);//Get momentum vectors of tracks after propagation
+  nt.GetPxPyPz(momNegProp);
+  
+  Double_t pEle =
+    TMath::Sqrt(momNegProp[0]*momNegProp[0]+momNegProp[1]*momNegProp[1]+momNegProp[2]*momNegProp[2]);//absolute momentum value of negative daughter
+  Double_t pPos =
+    TMath::Sqrt(momPosProp[0]*momPosProp[0]+momPosProp[1]*momPosProp[1]+momPosProp[2]*momPosProp[2]);//absolute momentum value of positive daughter
+    
+  Double_t scalarproduct =
+    momPosProp[0]*momNegProp[0]+momPosProp[1]*momNegProp[1]+momPosProp[2]*momNegProp[2];//scalar product of propagated positive and negative daughters' momenta
+    
+  Double_t chipair = TMath::ACos(scalarproduct/(pEle*pPos));//Angle between propagated daughter tracks
+
+  psiPair =  TMath::Abs(TMath::ASin(deltat/chipair));  
+
+  return psiPair; 
+}
+//___________________________________________________________________
+Bool_t  AliESDv0KineCuts::GetConvPosXY(AliESDtrack * const ptrack, AliESDtrack * const ntrack, Double_t convpos[2]) const
+{
+  //
+  // recalculate the gamma conversion XY postition
+  //
+
+  const Double_t b = fEvent->GetMagneticField();
+
+  Double_t helixcenterpos[2];
+  GetHelixCenter(ptrack,b,ptrack->Charge(),helixcenterpos);
+
+  Double_t helixcenterneg[2];
+  GetHelixCenter(ntrack,b,ntrack->Charge(),helixcenterneg);
+
+  Double_t  poshelix[6];
+  ptrack->GetHelixParameters(poshelix,b);
+  Double_t posradius = TMath::Abs(1./poshelix[4]);
+
+  Double_t  neghelix[6];
+  ntrack->GetHelixParameters(neghelix,b);
+  Double_t negradius = TMath::Abs(1./neghelix[4]);
+
+  Double_t xpos = helixcenterpos[0];
+  Double_t ypos = helixcenterpos[1];
+  Double_t xneg = helixcenterneg[0];
+  Double_t yneg = helixcenterneg[1];
+
+  convpos[0] = (xpos*negradius + xneg*posradius)/(negradius+posradius);
+  convpos[1] = (ypos*negradius+  yneg*posradius)/(negradius+posradius);
+
+  return 1;
+}
+//___________________________________________________________________
+Bool_t  AliESDv0KineCuts::GetHelixCenter(AliESDtrack * const track, Double_t b,Int_t charge, Double_t center[2]) const
+{
+  //
+  // computes the center of the track helix
+  //
+  
+  Double_t pi = TMath::Pi();
+  
+  Double_t  helix[6];
+  track->GetHelixParameters(helix,b);
+  
+  Double_t xpos =  helix[5];
+  Double_t ypos =  helix[0];
+  Double_t radius = TMath::Abs(1./helix[4]);
+  Double_t phi = helix[2];
+
+  if(phi < 0){
+    phi = phi + 2*pi;
+  }
+
+  phi -= pi/2.;
+  Double_t xpoint =  radius * TMath::Cos(phi);
+  Double_t ypoint =  radius * TMath::Sin(phi);
+
+  if(b<0){
+    if(charge > 0){
+      xpoint = - xpoint;
+      ypoint = - ypoint;
+    }
+    /* avoid self assignment
+    if(charge < 0){
+      xpoint =  xpoint;
+      ypoint =  ypoint;
+    }
+    */
+  }
+  if(b>0){
+    /* avoid self assignment
+    if(charge > 0){
+      xpoint =  xpoint;
+      ypoint =  ypoint;
+    }
+    */
+    if(charge < 0){
+      xpoint = - xpoint;
+      ypoint = - ypoint;
+    }
+  }
+  center[0] =  xpos + xpoint;
+  center[1] =  ypos + ypoint;
+
+  return 1;
+}
+//___________________________________________________________________
+AliKFParticle *AliESDv0KineCuts::CreateMotherParticle(const AliVTrack* const pdaughter, const AliVTrack* const ndaughter, Int_t pspec, Int_t nspec) const
+{
+  //
+  // Creates a mother particle
+  //
+  AliKFParticle pkfdaughter(*pdaughter, pspec);
+  AliKFParticle nkfdaughter(*ndaughter, nspec);
+  
+  
+  // Create the mother particle 
+  AliKFParticle *m = new AliKFParticle(pkfdaughter, nkfdaughter);
+  m->SetField(fEvent->GetMagneticField());
+  if(TMath::Abs(kElectron) == pspec && TMath::Abs(kElectron) == nspec) m->SetMassConstraint(0, 0.001);
+  else if(TMath::Abs(kPiPlus) == pspec && TMath::Abs(kPiPlus) == nspec) m->SetMassConstraint(TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass(), 0.);
+  else if(TMath::Abs(kProton) == pspec && TMath::Abs(kPiPlus) == nspec) m->SetMassConstraint(TDatabasePDG::Instance()->GetParticle(kLambda0)->Mass(), 0.);
+  else if(TMath::Abs(kPiPlus) == pspec && TMath::Abs(kProton) == nspec) m->SetMassConstraint(TDatabasePDG::Instance()->GetParticle(kLambda0)->Mass(), 0.);
+  else{
+    AliErrorClass("Wrong daughter ID - mass constraint can not be set");
+  }
+
+  AliKFVertex improvedVertex = *fPrimaryVertex;
+  improvedVertex += *m;
+  m->SetProductionVertex(improvedVertex);
+  
+  // update 15/06/2010
+  // mother particle will not be added to primary vertex but only to its copy 
+  // as this confilcts with calling
+  // m->SetPrimaryVertex() function and
+  // subsequently removing the mother particle afterwards
+  // Source: Sergey Gorbunov
+
+  return m;
+}
+//____________________________________________________________________
+void  AliESDv0KineCuts::SetEvent(AliESDEvent* const event){
+  //
+  // direct setter of ESD event
+  //
+  fEvent = event;
+  if(!fEvent){
+    AliErrorClass("Invalid input event pointer");
+    return;
+  }
+if (fUseExternalVertex) return;
+else{
+       if(fPrimaryVertex && fDeleteVertex){
+               delete  fPrimaryVertex;
+               fPrimaryVertex=0x0;
+               }
+       fPrimaryVertex = new AliKFVertex(*(fEvent->GetPrimaryVertex()));
+       fDeleteVertex=kTRUE;
+       }
+
+
+
+}
+//____________________________________________________________________
+void  AliESDv0KineCuts::SetEvent(AliVEvent* const event){
+  //
+  // direct setter of ESD event
+  //
+
+  fEvent = dynamic_cast<AliESDEvent*>(event);
+  if(!fEvent){
+    AliErrorClass("Invalid input event pointer");
+    return;
+  }
+  
+  if (fUseExternalVertex) return;
+  else{
+    if(fPrimaryVertex && fDeleteVertex){
+      delete   fPrimaryVertex;
+      fPrimaryVertex=0x0;
+      }
+    fPrimaryVertex = new AliKFVertex(*(fEvent->GetPrimaryVertex()));
+    fDeleteVertex=kTRUE;
+  }
+}
+
+
+//________________________________________________________________
+void    AliESDv0KineCuts::UseExternalVertex(Bool_t use_external){
+       //
+       // Reenable primary Vertex from ESD event
+       //
+       if (use_external) fUseExternalVertex =kTRUE;
+       else fUse