--- /dev/null
+# -*- mode: CMake -*-
+#--------------------------------------------------------------------------------#
+# Package File for PWG4Correlations #
+# Author : Johny Jose (johny.jose@cern.ch) #
+# Variables Defined : #
+# #
+# SRCS - C++ source files #
+# HDRS - C++ header files #
+# DHDR - ROOT Dictionary Linkdef header file #
+# CSRCS - C source files #
+# CHDRS - C header files #
+# EINCLUDE - Include directories #
+# EDEFINE - Compiler definitions #
+# ELIBS - Extra libraries to link #
+# ELIBSDIR - Extra library directories #
+# PACKFFLAGS - Fortran compiler flags for package #
+# PACKCXXFLAGS - C++ compiler flags for package #
+# PACKCFLAGS - C compiler flags for package #
+# PACKSOFLAGS - Shared library linking flags #
+# PACKLDFLAGS - Module linker flags #
+# PACKBLIBS - Libraries to link (Executables only) #
+# EXPORT - Header files to be exported #
+# CINTHDRS - Dictionary header files #
+# CINTAUTOLINK - Set automatic dictionary generation #
+# ARLIBS - Archive Libraries and objects for linking (Executables only) #
+# SHLIBS - Shared Libraries and objects for linking (Executables only) #
+#--------------------------------------------------------------------------------#
+
+set ( SRCS
+ DevNanoAOD/AliAnalysisNanoAODCuts.cxx
+ DevNanoAOD/AliAnalysisTaskNanoAODFilter.cxx
+ DevNanoAOD/AliESEHelpers.cxx
+ DevNanoAOD/AliNanoAODCustomSetter.cxx
+ DevNanoAOD/AliNanoAODHeader.cxx
+ DevNanoAOD/AliNanoAODReplicator.cxx
+ DevNanoAOD/AliNanoAODStorage.cxx
+ DevNanoAOD/AliNanoAODTrack.cxx
+ DevNanoAOD/AliNanoAODTrackMapping.cxx
+ )
+
+string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
+
+set ( DHDR PWGDevNanoAODLinkDef.h)
+
+string ( REPLACE ".cxx" ".h" EXPORT "${SRCS}" )
+
+set ( EINCLUDE PWG/DevNanoAOD PWGLF/SPECTRA/PiKaPr/TestAOD ANALYSIS CORRFW STEER/AOD STEER/ESD STEER/STEERBase)
+
+if( ALICE_TARGET STREQUAL "win32gcc")
+ set ( PACKSOFLAGS ${SOFLAGS} )
+ set ( ELIBS --verbose -L${ALICE_ROOT}/lib/tgt_${ALICE_TARGET} -lANALYSISalice -lANALYSIS -lCORRFW -lAOD -lESD -lSTEER -lSTEERBase ${ROOTCLIBS} -lEG -lGraf -lGraf3d -lASImage )
+endif( ALICE_TARGET STREQUAL "win32gcc")
+
+
--- /dev/null
+#if !defined (__CINT__) || (defined(__MAKECINT__))
+#include <iostream>
+#include "TString.h"
+#include "AliAnalysisManager.h"
+#include "AliAnalysisTaskSE.h"
+#include "AliAnalysisTaskNanoAODESEFilter.h"
+#include "AliAnalysisDataContainer.h"
+#include "AliVEventHandler.h"
+#include "AliESEHelpers.h"
+
+#endif
+
+
+AliAnalysisTaskSE * AddTaskNanoAODFilter(Int_t iMC, Bool_t savecuts = 0) {
+ // Adds my task
+ AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+ if (!mgr) {
+ ::Error("AddTaskNanoAODESEFilter", "No analysis manager to connect to.");
+ return NULL;
+ }
+ // Check the analysis type using the event handlers connected to the analysis manager.
+ //==============================================================================
+ if (!mgr->GetInputEventHandler()) {
+ ::Error("AddTaskNanoAODESEFilter", "This task requires an input event handler");
+ return NULL;
+ }
+ TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
+
+ // Configure analysis
+ //===========================================================================
+
+ // gROOT->LoadMacro("AliAnalysisTaskNanoAODESEFilter.cxx+");
+
+ AliAnalysisTaskNanoAODFilter * task = new AliAnalysisTaskNanoAODFilter("TaskEseFilter", savecuts);
+
+ mgr->AddTask(task);
+ task->SetMCMode(iMC);
+
+ mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
+ // mgr->ConnectOutput(task, 1, mgr->GetCommonOutputContainer());
+
+ if(savecuts) {
+ AliAnalysisDataContainer *coutputpt1 = mgr->CreateContainer("evtcuts", AliAnalysisCuts::Class(), AliAnalysisManager::kOutputContainer,"cuts.root");
+ AliAnalysisDataContainer *coutputpt2 = mgr->CreateContainer("trkcuts", AliAnalysisCuts::Class(), AliAnalysisManager::kOutputContainer,"cuts.root");
+ mgr->ConnectOutput(task, 1, coutputpt1);
+ mgr->ConnectOutput(task, 2, coutputpt2);
+ }
+
+
+
+
+ return task;
+
+}
+
+
+
--- /dev/null
+#include "AliAnalysisNanoAODCuts.h"
+#include "AliAODTrack.h"
+#include "AliAODEvent.h"
+#include "AliNanoAODHeader.h"
+#include "AliNanoAODTrack.h"
+
+ClassImp(AliAnalysisNanoAODTrackCuts)
+
+
+
+AliAnalysisNanoAODTrackCuts::AliAnalysisNanoAODTrackCuts():
+ AliAnalysisCuts(), fBitMask(1)
+{
+ // default ctor
+}
+
+Bool_t AliAnalysisNanoAODTrackCuts::IsSelected(TObject* obj)
+{
+ // Returns true if the track is good!
+ AliAODTrack* track = dynamic_cast<AliAODTrack*>(obj);
+
+ if (track->TestFilterBit(fBitMask)) return kTRUE;
+ return kFALSE;
+
+}
+
+AliAnalysisNanoAODEventCuts::AliAnalysisNanoAODEventCuts():
+ AliAnalysisCuts(), fVertexRange(10)
+{
+ // default ctor
+}
+
+Bool_t AliAnalysisNanoAODEventCuts::IsSelected(TObject* obj)
+{
+ // Returns true if the object is a primary vertex
+ AliAODEvent * evt = dynamic_cast<AliAODEvent*>(obj);
+
+ AliAODVertex * vertex = evt->GetPrimaryVertex();
+ if (!vertex) return kFALSE;
+ if (TMath::Abs(vertex->GetZ()) > fVertexRange) return kFALSE;
+ return kTRUE;
+
+}
--- /dev/null
+#ifndef _ALIANALYSISNANOAODCUTSANDSETTERS_H_
+#define _ALIANALYSISNANOAODCUTSANDSETTERS_H_
+
+#include "AliAnalysisCuts.h"
+#include "AliNanoAODCustomSetter.h"
+
+class AliAnalysisNanoAODTrackCuts : public AliAnalysisCuts
+{
+public:
+ AliAnalysisNanoAODTrackCuts();
+ virtual ~AliAnalysisNanoAODTrackCuts() {}
+ virtual Bool_t IsSelected(TObject* obj); // TObject should be an AliAODTrack
+ virtual Bool_t IsSelected(TList* /* list */ ) { return kTRUE; }
+ UInt_t GetBitMask() { return fBitMask; }
+ void SetBitMask (UInt_t var) { fBitMask = var;}
+
+private:
+ UInt_t fBitMask; // Only AOD tracks matching this bit mask are accepted
+
+ ClassDef(AliAnalysisNanoAODTrackCuts,1); // Select muon spectrometer tracks
+};
+
+class AliAnalysisNanoAODEventCuts : public AliAnalysisCuts
+{
+public:
+ AliAnalysisNanoAODEventCuts();
+ virtual ~AliAnalysisNanoAODEventCuts() {}
+ virtual Bool_t IsSelected(TObject* obj); // TObject should be an AliAODEvent
+ virtual Bool_t IsSelected(TList* /* list */ ) { return kTRUE; }
+ Float_t GetVertexRange() { return fVertexRange; }
+ void SetVertexRange (Float_t var) { fVertexRange = var;}
+public:
+ Float_t fVertexRange; // Only events with primary vertex within this range are accepted (whathever the vertex)
+
+
+ ClassDef(AliAnalysisNanoAODEventCuts,1); // Select primary vertices
+};
+
+
+
+
+
+#endif /* _ALIANALYSISNANOAODCUTSANDSETTERS_H_ */
--- /dev/null
+/**************************************************************************
+ * 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$ */
+
+// Generic task to produce nanoAOD
+// Author: Michele Floris, michele.floris@cern.ch
+
+#include "AliAnalysisTaskNanoAODFilter.h"
+
+#include "Riostream.h"
+#include "TChain.h"
+#include "TTree.h"
+#include "TH1F.h"
+#include "TH2F.h"
+#include "TCanvas.h"
+#include "TList.h"
+
+#include "AliAnalysisTaskSE.h"
+#include "AliAnalysisManager.h"
+#include "AliStack.h"
+#include "AliESDtrackCuts.h"
+#include "AliESDEvent.h"
+#include "AliESDInputHandler.h"
+#include "AliAODEvent.h"
+#include "AliAODTrack.h"
+#include "AliMCEvent.h"
+#include "AliESDtrack.h"
+#include "AliAODHandler.h"
+#include "AliNanoAODReplicator.h"
+#include "AliNanoAODTrackMapping.h"
+
+ClassImp(AliAnalysisTaskNanoAODFilter)
+
+
+//________________________________________________________________________
+AliAnalysisTaskNanoAODFilter::AliAnalysisTaskNanoAODFilter() // All data members should be initialised here
+:AliAnalysisTaskSE(),
+ fTrkrep(0),
+ fVarList(""),
+ fVarListHead(""),
+ fEvtCuts(0),
+ fTrkCuts(0),
+ fSetter(0),
+ fSaveCutsFlag(0)
+{
+ // Dummy constructor ALWAYS needed for I/O.
+}
+
+//________________________________________________________________________
+AliAnalysisTaskNanoAODFilter::AliAnalysisTaskNanoAODFilter(const char *name, Bool_t saveCutsFlag) // All data members should be initialised here
+ :AliAnalysisTaskSE(name),
+ fTrkrep(0),
+ fVarList(""),
+ fVarListHead(""),
+ fEvtCuts(0),
+ fTrkCuts(0),
+ fSetter(0),
+ fSaveCutsFlag(saveCutsFlag)
+
+{
+ // Constructor
+ if(fSaveCutsFlag) {
+ DefineOutput(1, AliAnalysisCuts::Class());
+ DefineOutput(2, AliAnalysisCuts::Class());
+ }
+
+
+}
+
+//________________________________________________________________________
+AliAnalysisTaskNanoAODFilter::~AliAnalysisTaskNanoAODFilter()
+{
+ // Destructor. Clean-up the output list, but not the histograms that are put inside
+ // (the list is owner and will clean-up these histograms). Protect in PROOF case.
+}
+
+//________________________________________________________________________
+void AliAnalysisTaskNanoAODFilter::UserCreateOutputObjects()
+{
+ // Create histograms
+ // Called once (on the worker node)
+
+ if(fSaveCutsFlag) {
+ PostData(1, fEvtCuts);
+ PostData(2, fTrkCuts);
+ }
+}
+
+void AliAnalysisTaskNanoAODFilter::AddFilteredAOD(const char* aodfilename, const char* title)
+{
+ // The replicator is added to the extension
+
+ AliAODHandler *aodH = (AliAODHandler*)((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
+ if (!aodH) AliFatal("No AOD handler");
+ AliAODExtension* ext = aodH->AddFilteredAOD(aodfilename,title);
+
+ if (!ext){
+ AliFatal("Cannot get extension");
+ }
+
+
+ AliNanoAODReplicator * rep = new AliNanoAODReplicator("NanoAODReplicator",
+ "remove non interesting tracks, "
+ "writes special tracks array tracks",
+ fVarList,
+ fTrkCuts,
+ fMCMode);
+
+
+ cout<<"rep: "<<rep<<endl;
+ rep->SetCustomSetter(fSetter);
+ std::cout << "SETTER: " << fSetter << " " << rep->GetCustomSetter() << std::endl;
+
+ ext->DropUnspecifiedBranches(); // all branches not part of a FilterBranch call (below) will be dropped
+
+ ext->FilterBranch("tracks",rep);
+ ext->FilterBranch("vertices",rep);
+ ext->FilterBranch("header",rep);
+
+ if ( fMCMode > 0 )
+ {
+ // MC branches will be copied (if present), as they are, but only
+ // for events with at least one muon.
+ // For events w/o muon, mcparticles array will be empty and mcheader will be dummy
+ // (e.g. strlen(GetGeneratorName())==0)
+
+ ext->FilterBranch("mcparticles",rep);
+ ext->FilterBranch("mcHeader",rep);
+ }
+}
+
+void AliAnalysisTaskNanoAODFilter::Init()
+{
+
+ // Initialization
+ AddFilteredAOD("AliAOD.NanoAOD.root", "NanoAODTracksEvents");
+
+}
+
+
+
+//________________________________________________________________________
+void AliAnalysisTaskNanoAODFilter::UserExec(Option_t *)
+{
+ // Main loop
+ Long64_t ientry = Entry();
+ if(fDebug)printf("Nano AOD Filter: Analysing event # %5d\n", (Int_t) ientry);
+
+ AliAODEvent *lAODevent=(AliAODEvent*)InputEvent();
+
+
+ AliAODHandler* handler = dynamic_cast<AliAODHandler*>(AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler());
+
+ if(fEvtCuts && !fEvtCuts->IsSelected(lAODevent)) return;// FIXME: should event cuts be called here or in the branch replicator? Do we get duplicated events if we skip here (arrays not reset in the branch replicator?)
+
+ if ( handler ){
+ AliAODExtension *extNanoAOD = handler->GetFilteredAOD("AliAOD.NanoAOD.root");
+ if ( extNanoAOD ) {
+ extNanoAOD->SetEvent(lAODevent);
+ extNanoAOD->SelectEvent();
+ extNanoAOD->FinishEvent();
+ }
+ }
+
+
+ if(fSaveCutsFlag) {
+ PostData(1, fEvtCuts);
+ PostData(2, fTrkCuts);
+ }
+}
+
+
+//________________________________________________________________________
+void AliAnalysisTaskNanoAODFilter::Terminate(Option_t *)
+{
+ // print some debug info
+
+}
+
+void AliAnalysisTaskNanoAODFilter::FinishTaskOutput() {
+
+ // We save here the user info //
+
+ AliAODHandler* handler = dynamic_cast<AliAODHandler*>(AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler());
+ AliAODExtension *extNanoAOD = handler->GetFilteredAOD("AliAOD.NanoAOD.root");
+ extNanoAOD->GetTree()->GetUserInfo()->Add(AliNanoAODTrackMapping::GetInstance());
+
+}
--- /dev/null
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+/* AliAnalysisTaskNanoAODFilter.h
+ *
+ * Template task producing a P_t spectrum and pseudorapidity distribution.
+ * Includes explanations of physics and primary track selections
+ *
+ * Based on tutorial example from offline pages
+ * Edited by Arvinder Palaha
+ */
+#ifndef ALIANALYSISTASKNANOAODESEFILTER_H
+#define ALIANALYSISTASKNANOAODESEFILTER_H
+
+class TH1F;
+class TList;
+class AliESDtrackCuts;
+class AliAnalysisCuts;
+class AliNanoAODReplicator;
+class AliNanoAODCustomSetter;
+
+#ifndef ALIANALYSISTASKSE_H
+#include "AliAnalysisTaskSE.h"
+#endif
+
+class AliAnalysisTaskNanoAODFilter : public AliAnalysisTaskSE {
+public:
+ AliAnalysisTaskNanoAODFilter();
+ AliAnalysisTaskNanoAODFilter(const char *name, Bool_t saveCutsFlag);
+ virtual ~AliAnalysisTaskNanoAODFilter();
+
+ virtual void UserCreateOutputObjects();
+ virtual void UserExec(Option_t *option);
+ virtual void Init();
+ virtual void LocalInit() {Init();}
+ virtual void Terminate(Option_t *);
+ virtual void FinishTaskOutput() ;
+
+ Int_t GetMCMode() { return fMCMode; }
+ void SetMCMode (Int_t var) { fMCMode = var;}
+ void AddFilteredAOD(const char* aodfilename, const char* title);
+
+ AliAnalysisCuts * GetEvtCuts() { return fEvtCuts; }
+ AliAnalysisCuts * GetTrkCuts() { return fTrkCuts; }
+ AliNanoAODCustomSetter * GetSetter() { return fSetter; }
+ TString GetVarList() { return fVarList; }
+ TString GetVarListHead() { return fVarListHead; }
+ Bool_t GetSaveCutsFlag() { return fSaveCutsFlag; }
+
+ void SetEvtCuts (AliAnalysisCuts * var ) { fEvtCuts = var;}
+ void SetTrkCuts (AliAnalysisCuts * var ) { fTrkCuts = var;}
+ void SetSetter (AliNanoAODCustomSetter * var ) { fSetter = var;}
+ void SetVarList (TString var ) { fVarList = var;}
+ void SetVarListHead (TString var ) { fVarListHead = var;}
+
+private:
+ Int_t fMCMode; // true if processing monte carlo. if > 1 not all MC particles are filtered
+ AliNanoAODReplicator* fTrkrep ; // ! replicator
+ TString fVarList ; // List of variables to be added to the special track
+ TString fVarListHead; // List of variables to be added to the special header
+ AliAnalysisCuts * fEvtCuts; // Event cuts
+ AliAnalysisCuts * fTrkCuts; // Track cuts
+
+ AliNanoAODCustomSetter * fSetter; // setter for custom variables
+
+ Bool_t fSaveCutsFlag; // If true, the event and track cuts are saved to disk. Can only be set in the constructor.
+
+
+ AliAnalysisTaskNanoAODFilter(const AliAnalysisTaskNanoAODFilter&); // not implemented
+ AliAnalysisTaskNanoAODFilter& operator=(const AliAnalysisTaskNanoAODFilter&); // not implemented
+
+ ClassDef(AliAnalysisTaskNanoAODFilter, 1); // example of analysis
+};
+
+#endif
+
--- /dev/null
+#include "AliESEHelpers.h"
+#include "AliAODEvent.h"
+#include "AliNanoAODTrackMapping.h"
+#include "AliAnalysisManager.h"
+#include "AliInputEventHandler.h"
+#include "AliVParticle.h"
+#include "AliPIDResponse.h"
+#include "AliNanoAODTrack.h"
+#include "AliNanoAODHeader.h"
+
+ClassImp(AliESEEvtCut)
+ClassImp(AliESETrkCut)
+ClassImp(AliAnalysisESESetter)
+
+
+void AliAnalysisESESetter::SetNanoAODHeader(const AliAODEvent */* event*/ , AliNanoAODHeader * head ) {
+
+ // if(fHelperPID->GetPIDType()==kBayes)fHelperPID->GetPIDCombined()->SetDefaultTPCPriors();//FIXME maybe this can go in the UserCreateOutputObject?
+
+ // if(!isMC){
+ Double_t QvecA=fEventCuts->GetqV0A();
+ Double_t QvecC=fEventCuts->GetqV0C();
+ // }
+
+ Double_t Cent = fEventCuts->GetCent();
+ // TODO: MAPPING FOR HEADERS!
+ head->SetVar(0, QvecA);
+ head->SetVar(1, QvecC);
+ head->SetVar(2, Cent);
+
+
+}
+
+void AliAnalysisESESetter::SetNanoAODTrack (const AliAODTrack * aodTrack, AliNanoAODTrack * spTrack) {
+ // Set custom variables in the special track
+ // 1. Cache the indexes
+ static const Int_t kcstNSigmaTPCPi = AliNanoAODTrackMapping::GetInstance()->GetVarIndex("cstNSigmaTPCPi");
+ static const Int_t kcstNSigmaTPCKa = AliNanoAODTrackMapping::GetInstance()->GetVarIndex("cstNSigmaTPCKa");
+ static const Int_t kcstNSigmaTPCPr = AliNanoAODTrackMapping::GetInstance()->GetVarIndex("cstNSigmaTPCPr");
+
+ static const Int_t kcstNSigmaTOFPi = AliNanoAODTrackMapping::GetInstance()->GetVarIndex("cstNSigmaTOFPi");
+ static const Int_t kcstNSigmaTOFKa = AliNanoAODTrackMapping::GetInstance()->GetVarIndex("cstNSigmaTOFKa");
+ static const Int_t kcstNSigmaTOFPr = AliNanoAODTrackMapping::GetInstance()->GetVarIndex("cstNSigmaTOFPr");
+
+ // TODO: set Bayes vars in special track
+
+ // static const Int_t kcstBayesTPCPi = AliNanoAODTrackMapping::GetInstance()->GetVarIndex("kcstBayesTPCPi");
+ // static const Int_t kcstBayesTPCKa = AliNanoAODTrackMapping::GetInstance()->GetVarIndex("kcstBayesTPCKa");
+ // static const Int_t kcstBayesTPCPr = AliNanoAODTrackMapping::GetInstance()->GetVarIndex("kcstBayesTPCPr");
+
+ // static const Int_t kcstBayesTOFPi = AliNanoAODTrackMapping::GetInstance()->GetVarIndex("cstBayesTOFPi");
+ // static const Int_t kcstBayesTOFKa = AliNanoAODTrackMapping::GetInstance()->GetVarIndex("cstBayesTOFKa");
+ // static const Int_t kcstBayesTOFPr = AliNanoAODTrackMapping::GetInstance()->GetVarIndex("cstBayesTOFPr");
+
+ // Get the PID info
+ static AliPIDResponse * pidResponse = 0;
+ if(!pidResponse) {
+ AliAnalysisManager *man = AliAnalysisManager::GetAnalysisManager();
+ AliInputEventHandler* inputHandler = (AliInputEventHandler*)(man->GetInputEventHandler());
+ pidResponse = inputHandler->GetPIDResponse();
+ }
+
+ const AliVParticle *inEvHMain = dynamic_cast<const AliVParticle *>(aodTrack);
+
+ Double_t nsigmaTPCkProton = pidResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kProton);
+ Double_t nsigmaTPCkKaon = pidResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kKaon);
+ Double_t nsigmaTPCkPion = pidResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kPion);
+
+ Double_t nsigmaTOFkProton = pidResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kProton);
+ Double_t nsigmaTOFkKaon = pidResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kKaon);
+ Double_t nsigmaTOFkPion = pidResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kPion);
+
+
+
+ spTrack->SetVar(kcstNSigmaTPCPi, nsigmaTPCkPion);
+ spTrack->SetVar(kcstNSigmaTPCKa, nsigmaTPCkKaon);
+ spTrack->SetVar(kcstNSigmaTPCPr, nsigmaTPCkProton);
+
+ spTrack->SetVar(kcstNSigmaTOFPi, nsigmaTOFkPion);
+ spTrack->SetVar(kcstNSigmaTOFKa, nsigmaTOFkKaon);
+ spTrack->SetVar(kcstNSigmaTOFPr, nsigmaTOFkProton);
+ //TODO: set the bayes vars
+
+
+}
--- /dev/null
+#ifndef _ALIESEHELPERS_H_
+#define _ALIESEHELPERS_H_
+
+#include "AliAnalysisCuts.h"
+#include "AliSpectraAODTrackCuts.h"
+#include "AliSpectraAODEventCuts.h"
+#include "AliNanoAODCustomSetter.h"
+#include "AliAODTrack.h"
+#include "AliAODEvent.h"
+
+
+// Wrappers for the spectra classes which inherit from TNamed and not from AliAnalysisCuts
+
+
+class AliESETrkCut : public AliAnalysisCuts
+{
+public:
+ AliESETrkCut () : AliAnalysisCuts("trkcuts", "Track cuts"), fTrackCuts(0) {;}
+ virtual ~AliESETrkCut(){;}
+ AliSpectraAODTrackCuts * GetTrackCuts() { return fTrackCuts; }
+ void SetTrackCuts (AliSpectraAODTrackCuts * var) { fTrackCuts = var; }
+ virtual Bool_t IsSelected(TObject* obj) {return fTrackCuts->IsSelected(dynamic_cast<AliAODTrack*>(obj), 1);};
+ virtual Bool_t IsSelected(TList* /* list */ ) { return kTRUE; }
+
+private:
+ AliSpectraAODTrackCuts * fTrackCuts; // TrackCuts
+
+ ClassDef(AliESETrkCut, 1)
+};
+
+class AliESEEvtCut : public AliAnalysisCuts
+{
+public:
+ AliESEEvtCut() : AliAnalysisCuts("evtcuts", "Event cuts"), fEventCuts(0), fTrackCuts(0) {;}
+ virtual ~AliESEEvtCut(){;}
+ AliSpectraAODEventCuts * GetEventCuts() { return fEventCuts; }
+ void SetEventCuts (AliSpectraAODEventCuts * var) { fEventCuts = var;}
+ virtual Bool_t IsSelected(TObject* obj) { return fEventCuts->IsSelected(dynamic_cast<AliAODEvent*>(obj), fTrackCuts);};
+ virtual Bool_t IsSelected(TList* /* list */ ) { return kTRUE; }
+ virtual void Print(Option_t *) const { fEventCuts->PrintCuts(); }
+ AliSpectraAODTrackCuts * GetTrackCuts() { return fTrackCuts; }
+ void SetTrackCuts (AliSpectraAODTrackCuts * var) { fTrackCuts = var;}
+
+private:
+ AliSpectraAODEventCuts * fEventCuts; // EventCuts, static memeber for copying
+ AliSpectraAODTrackCuts * fTrackCuts; // pointer to track cuts, needed
+
+ ClassDef(AliESEEvtCut,1)
+};
+
+
+class AliAnalysisESESetter : public AliNanoAODCustomSetter
+{
+public:
+ AliAnalysisESESetter(const char * name = "AliAnalysisNanoAODFilters") : AliNanoAODCustomSetter(name), fEventCuts(0) {;}
+ virtual ~AliAnalysisESESetter() {;}
+
+ virtual void SetNanoAODHeader(const AliAODEvent * event , AliNanoAODHeader * head );
+ virtual void SetNanoAODTrack (const AliAODTrack * aodTrack, AliNanoAODTrack * spTrack);
+ AliSpectraAODEventCuts* GetEventCuts() { return fEventCuts; }
+ void SetEventCuts (AliSpectraAODEventCuts* var) { fEventCuts = var;}
+
+private:
+ AliSpectraAODEventCuts* fEventCuts; // EventCuts
+
+
+ ClassDef(AliAnalysisESESetter, 1)
+};
+
+
+#endif /* _ALIESEHELPERS_H_ */
--- /dev/null
+#include "AliNanoAODCustomSetter.h"
+
+ClassImp(AliNanoAODCustomSetter)
--- /dev/null
+#ifndef _ALINANOAODCUSTOMSETTER_H_
+#define _ALINANOAODCUSTOMSETTER_H_
+
+// AliNanoAODCustomSetter
+
+// Virtual class which implements the basic interface for setting
+// custom variables in special tracks and headers
+
+// Author: Michele Floris, michele.floris@cern.ch
+
+#include "TNamed.h"
+
+class AliAODEvent;
+class AliAODTrack;
+class AliNanoAODHeader;
+class AliNanoAODTrack;
+
+
+class AliNanoAODCustomSetter : public TNamed
+{
+public:
+ AliNanoAODCustomSetter(const char * name = "AliNanoAODCustomSetter") : TNamed(name,name) {;}
+ virtual ~AliNanoAODCustomSetter() {;}
+ virtual void SetNanoAODHeader(const AliAODEvent * event , AliNanoAODHeader * head ) =0;
+ virtual void SetNanoAODTrack (const AliAODTrack * aodTrack, AliNanoAODTrack * spTrack) =0;
+
+ ClassDef(AliNanoAODCustomSetter, 1)
+};
+
+
+
+#endif /* _ALINANOAODCUSTOMSETTER_H_ */
--- /dev/null
+#include "AliNanoAODHeader.h"
+
+
+ClassImp(AliNanoAODHeader)
+
+AliNanoAODHeader& AliNanoAODHeader::operator=(const AliNanoAODHeader& evt) {
+
+ AliVHeader::operator=(evt); // FIXME: ok?
+ AliNanoAODStorage::operator=(evt);
+
+ return *this;
+}
+
+
--- /dev/null
+#ifndef _ALINANOAODHEADER_H_
+#define _ALINANOAODHEADER_H_
+
+#include "AliVHeader.h"
+#include "AliNanoAODStorage.h"
+
+
+
+class AliNanoAODHeader : public AliVHeader, public AliNanoAODStorage
+{
+public:
+ using AliVHeader::ClassName;
+ AliNanoAODHeader(){;}
+ AliNanoAODHeader(Int_t size){ AllocateInternalStorage(size);}
+ virtual ~AliNanoAODHeader(){;}
+
+
+ // Interface methods
+ // AliNanoAODHeader(const AliVHeader& evt);
+ AliNanoAODHeader& operator=(const AliNanoAODHeader& evt);
+
+ virtual UShort_t GetBunchCrossNumber() const { AliError("Not implemented");return 0;}
+ virtual UInt_t GetOrbitNumber() const { AliError("Not implemented");return 0;}
+ virtual UInt_t GetPeriodNumber() const { AliError("Not implemented");return 0;}
+ virtual ULong64_t GetTriggerMask() const { AliError("Not implemented");return 0;}
+ virtual UChar_t GetTriggerCluster() const { AliError("Not implemented");return 0;}
+ virtual UInt_t GetEventType() const { AliError("Not implemented");return 0;}
+ virtual void Print(Option_t* /*option = ""*/) const {Printf("I'm a special header!");}
+
+ ClassDef(AliNanoAODHeader, 1)
+
+};
+
+#endif /* _ALINANOAODHEADER_H_ */
--- /dev/null
+/**************************************************************************
+* 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: AliNanoAODReplicator.cxx 56492 2012-05-15 18:42:47Z pcrochet $
+
+// Implementation of a branch replicator
+// to produce nanoAODs.
+//
+//
+// This replicator is in charge of replicating the tracks,vertices,headers
+// branches of a standard AOD or ESD file into a nanoAODs
+// (AliAOD.Special.root)
+//
+// The class was inspired by AliAODMuonReplicator
+//
+// Author: Michele Floris, michele.floris@cern.ch
+
+
+class AliESDv0;
+class AliESDVertex;
+class AliAODVertex;
+class AliAODRecoDecay;
+
+#include "AliAODDimuon.h"
+#include "AliAODEvent.h"
+#include "AliAODMCHeader.h"
+#include "AliAODMCParticle.h"
+#include "AliAODTZERO.h"
+#include "AliAODTrack.h"
+#include "AliAODVZERO.h"
+#include "AliAnalysisCuts.h"
+#include "TF1.h"
+#include "AliExternalTrackParam.h"
+#include "AliESDv0.h"
+#include "AliAODv0.h"
+#include "AliPIDResponse.h"
+#include <iostream>
+#include <cassert>
+#include "AliESDtrack.h"
+#include "TObjArray.h"
+#include "AliAnalysisFilter.h"
+#include "AliNanoAODTrack.h"
+
+#include <TFile.h>
+#include <TDatabasePDG.h>
+#include <TString.h>
+#include <TList.h>
+#include "AliLog.h"
+#include "AliVEvent.h"
+#include "AliVVertex.h"
+#include "AliVTrack.h"
+#include "AliVertexerTracks.h"
+#include "AliKFVertex.h"
+#include "AliESDEvent.h"
+#include "AliESDVertex.h"
+#include "AliESDtrackCuts.h"
+#include "AliAODEvent.h"
+#include "AliAnalysisFilter.h"
+
+#include "AliNanoAODReplicator.h"
+#include "TH1.h"
+#include "TCanvas.h"
+#include "AliNanoAODHeader.h"
+#include "AliNanoAODCustomSetter.h"
+
+using std::cout;
+using std::endl;
+
+ClassImp(AliNanoAODReplicator)
+
+//_____________________________________________________________________________
+AliNanoAODReplicator::AliNanoAODReplicator(const char* name, const char* title,
+ const char * varlist,
+ AliAnalysisCuts* trackCut,
+ Int_t mcMode
+ ) :
+ AliAODBranchReplicator(name,title),
+
+ fTrackCut(trackCut), fTracks(0x0), fHeader(0x0), fNTracksVariables(0), // FIXME: Start using cuts, and check if fNTracksVariables is needed
+ fVertices(0x0),
+ fList(0x0),
+ fMCParticles(0x0),
+ fMCHeader(0x0),
+ fMCMode(mcMode),
+ fLabelMap(),
+ fParticleSelected(),
+ fVarList(varlist),
+ fCustomSetter(0)
+{
+ // default ctor
+ AliNanoAODTrackMapping * tm =new AliNanoAODTrackMapping(fVarList);
+ fNTracksVariables = tm->GetSize();
+ // tm->Print();
+}
+
+//_____________________________________________________________________________
+AliNanoAODReplicator::~AliNanoAODReplicator()
+{
+ // dtor
+ delete fTrackCut;
+ delete fList;
+}
+
+//_____________________________________________________________________________
+void AliNanoAODReplicator::SelectParticle(Int_t i)
+{
+ // taking the absolute values here, need to take care
+ // of negative daughter and mother
+ // IDs when setting!
+
+ if (!IsParticleSelected(TMath::Abs(i)))
+ {
+ fParticleSelected.Add(TMath::Abs(i),1);
+ }
+}
+
+//_____________________________________________________________________________
+Bool_t AliNanoAODReplicator::IsParticleSelected(Int_t i)
+{
+ // taking the absolute values here, need to take
+ // care with negative daughter and mother
+ // IDs when setting!
+ return (fParticleSelected.GetValue(TMath::Abs(i))==1);
+}
+
+
+//_____________________________________________________________________________
+void AliNanoAODReplicator::CreateLabelMap(const AliAODEvent& source)
+{
+ //
+ // this should be called once all selections are done
+ // This method associates to the original index of the mc particle
+ // (i) the new one (j). J runs only over particles which are
+ // actually kept.
+ //
+
+ fLabelMap.Delete();
+
+ TClonesArray* mcParticles = static_cast<TClonesArray*>(source.FindListObject(AliAODMCParticle::StdBranchName()));
+
+ Int_t j(0);
+ Int_t i(0); // We need i, we cannot rely on part->GetLabel, because some of the original mc particles are not kept in the stack, apparently
+
+ TIter next(mcParticles);
+
+ while ( next() )
+ {
+ if (IsParticleSelected(i))
+ {
+ fLabelMap.Add(i,j++);
+ // std::cout << i << "->" << j-1 << std::endl;
+ }
+ ++i;
+ }
+
+
+}
+
+//_____________________________________________________________________________
+Int_t AliNanoAODReplicator::GetNewLabel(Int_t i)
+{
+ // Gets the label from the new created Map
+ // Call CreatLabelMap before
+ // otherwise only 0 returned
+ return fLabelMap.GetValue(TMath::Abs(i));
+}
+
+//_____________________________________________________________________________
+void AliNanoAODReplicator::FilterMC(const AliAODEvent& source)
+{
+ // Filter MC information
+
+
+ AliAODMCHeader* mcHeader(0x0);
+ TClonesArray* mcParticles(0x0);
+
+ fParticleSelected.Delete();
+
+ // std::cout << "MC Mode: " << fMCMode << ", Tracks " << fTracks->GetEntries() << std::endl;
+
+ if ( fMCMode>=2 && !fTracks->GetEntries() ) {
+ return;
+ }
+ // for fMCMode==1 we only copy MC information for events where there's at least one muon track
+
+ mcHeader = static_cast<AliAODMCHeader*>(source.FindListObject(AliAODMCHeader::StdBranchName()));
+
+ if ( mcHeader )
+ {
+ *fMCHeader = *mcHeader;
+ }
+
+
+ mcParticles = static_cast<TClonesArray*>(source.FindListObject(AliAODMCParticle::StdBranchName()));
+
+ if ( mcParticles && fMCMode>=2 )
+ {
+ // keep all primaries
+ TIter nextPart(mcParticles);
+ static Int_t iev = -1; // FIXME: remove this (debug)
+ iev ++;
+ AliAODMCParticle * prim = 0;
+ Int_t iprim = 0; // We need iprim, we cannot rely on part->GetLabel, because some of the original mc particles are not kept in the stack, apparently
+ // also select all charged primaries
+ while ((prim = (AliAODMCParticle*) nextPart())) {
+ if(prim->IsPhysicalPrimary() && prim->Charge()) SelectParticle(iprim);
+ // FIXME DEBUG
+ if(iev == 2009) {
+ // std::cout << "IEV " << iev << std::endl;
+ // std::cout << " PART " << iprim << " " << prim->IsPhysicalPrimary() <<","<<prim->Charge() << "=" << IsParticleSelected(iprim) << std::endl;
+ if(iprim == 15) {
+ prim->Print();
+ }
+
+ }
+ iprim++;
+ }
+
+ // loop on (kept) tracks to find their ancestors
+ TIter nextTRACK(fTracks);
+ AliNanoAODTrack* track;
+
+ while ( ( track = static_cast<AliNanoAODTrack*>(nextTRACK()) ) )
+ {
+ Int_t label = TMath::Abs(track->GetLabel());
+
+ while ( label >= 0 )
+ {
+ SelectParticle(label);
+ AliAODMCParticle* mother = static_cast<AliAODMCParticle*>(mcParticles->UncheckedAt(label));
+ if (!mother)
+ {
+ AliError(Form("Got a null mother ! Check that ! (label %d",label)); // FIXME: I think this error is not needed
+ label = -1;
+ }
+ else
+ {
+ label = mother->GetMother();// do not only keep particles which created a track, but all their mothers
+ }
+ }
+ }
+
+ CreateLabelMap(source);
+
+ // Actual filtering and label remapping (shamelessly taken for the implementation of AliAODHandler::StoreMCParticles)
+ TIter nextMC(mcParticles);
+ AliAODMCParticle* p;
+ Int_t nmc(0); // We need nmc, we cannot rely on part->GetLabel, because some of the original mc particles are not kept in the stack, apparently
+ Int_t nmcout(0);
+
+ while ( ( p = static_cast<AliAODMCParticle*>(nextMC()) ) )
+ {
+ AliAODMCParticle c(*p);
+
+ if ( IsParticleSelected(nmc) )
+ {
+ //
+ Int_t d0 = p->GetDaughter(0);
+ Int_t d1 = p->GetDaughter(1);
+ Int_t m = p->GetMother();
+
+ // other than for the track labels, negative values mean
+ // no daughter/mother so preserve it
+
+ if(d0<0 && d1<0)
+ {
+ // no first daughter -> no second daughter
+ // nothing to be done
+ // second condition not needed just for sanity check at the end
+ c.SetDaughter(0,d0);
+ c.SetDaughter(1,d1);
+ } else if(d1 < 0 && d0 >= 0)
+ {
+ // Only one daughter
+ // second condition not needed just for sanity check at the end
+ if(IsParticleSelected(d0))
+ {
+ c.SetDaughter(0,GetNewLabel(d0));
+ } else
+ {
+ c.SetDaughter(0,-1);
+ }
+ c.SetDaughter(1,d1);
+ }
+ else if (d0 > 0 && d1 > 0 )
+ {
+ // we have two or more daughters loop on the stack to see if they are
+ // selected
+ Int_t d0tmp = -1;
+ Int_t d1tmp = -1;
+ for (int id = d0; id<=d1;++id)
+ {
+ if (IsParticleSelected(id))
+ {
+ if(d0tmp==-1)
+ {
+ // first time
+ d0tmp = GetNewLabel(id);
+ d1tmp = d0tmp; // this is to have the same schema as on the stack i.e. with one daugther d0 and d1 are the same
+ }
+ else d1tmp = GetNewLabel(id);
+ }
+ }
+ c.SetDaughter(0,d0tmp);
+ c.SetDaughter(1,d1tmp);
+ } else
+ {
+ AliFatal(Form("Unxpected indices %d %d",d0,d1));
+ }
+
+ if ( m < 0 )
+ {
+ c.SetMother(m);
+ } else
+ {
+ if (IsParticleSelected(m))
+ {
+ c.SetMother(GetNewLabel(m));
+ }
+ // else // FIXME: re-enable this checj. Sometimes it gets here. Still to be understood why
+ // {
+ // // AliError(Form("PROBLEM Mother not selected %d", m));
+ // }
+ }
+
+ new ((*fMCParticles)[nmcout++]) AliAODMCParticle(c);
+ }
+
+ ++nmc;
+ } //closes loop over MC particles
+
+ // now remap the tracks...
+
+ TIter nextTrack(fTracks);
+ AliNanoAODTrack* t;
+ // std::cout << "Remapping tracks" << std::endl;
+
+ while ( ( t = dynamic_cast<AliNanoAODTrack*>(nextTrack()) ) )
+ {
+
+ t->SetLabel(GetNewLabel(t->GetLabel()));
+ }
+
+ } // closes fMCMode == 1
+ else if ( mcParticles )
+ {
+ // simple copy of input MC particles to ouput MC particles
+ TIter nextMC(mcParticles);
+ AliAODMCParticle* p;
+ Int_t nmcout(0);
+
+ while ( ( p = static_cast<AliAODMCParticle*>(nextMC()) ) )
+ {
+ new ((*fMCParticles)[nmcout++]) AliAODMCParticle(*p);
+ }
+ }
+
+ AliDebug(1,Form("input mc %d output mc %d",
+ mcParticles ? mcParticles->GetEntries() : 0,
+ fMCParticles ? fMCParticles->GetEntries() : 0));
+
+ Printf("input mc %d output mc %d",
+ mcParticles ? mcParticles->GetEntries() : 0,
+ fMCParticles ? fMCParticles->GetEntries() : 0);
+
+
+}
+
+// //_____________________________________________________________________________
+TList* AliNanoAODReplicator::GetList() const
+{
+ // return (and build if not already done) our internal list of managed objects
+
+ if (!fList)
+ {
+ fList = new TList;
+ fList->SetOwner(kTRUE);
+
+ fTracks = new TClonesArray("AliNanoAODTrack");
+ fTracks->SetName("tracks"); // TODO: consider the possibility to use a different name to distinguish in AliAODEvent
+ fList->Add(fTracks);
+
+ fHeader = new AliNanoAODHeader(3);// TODO: to be customized
+ fHeader->SetName("header"); // TODO: consider the possibility to use a different name to distinguish in AliAODEvent
+ fList->Add(fHeader);
+
+
+ fVertices = new TClonesArray("AliAODVertex",2);
+ fVertices->SetName("vertices");
+
+
+ fList->Add(fVertices);
+
+ if ( fMCMode > 0 )
+ {
+ fMCHeader = new AliAODMCHeader;
+ fMCParticles = new TClonesArray("AliAODMCParticle",1000);
+ fMCParticles->SetName(AliAODMCParticle::StdBranchName());
+ fList->Add(fMCHeader);
+ fList->Add(fMCParticles);
+ }
+ }
+ return fList;
+}
+
+//_____________________________________________________________________________
+void AliNanoAODReplicator::ReplicateAndFilter(const AliAODEvent& source)
+//void AliNanoAODReplicator::ReplicateAndFilter(AliAODEvent *source)
+{
+ // Replicate (and filter if filters are there) the relevant parts we're interested in AODEvent
+
+
+ // assert(fTracks!=0x0);
+
+ //*fTZERO = *(source.GetTZEROData());
+
+
+
+ fTracks->Clear("C");
+ assert(fVertices!=0x0);
+ fVertices->Clear("C");
+ fMCHeader->Reset();
+ fMCParticles->Clear("C");
+
+ Int_t ntracks(0);
+ Int_t input(0);
+
+ AliAODVertex *vtx = source.GetPrimaryVertex();
+
+ // TODO: implement header!
+ // *fHeader = *source.GetHeader();
+ if(fCustomSetter){
+ // Set custom variables in the header if the callback is set
+ fCustomSetter->SetNanoAODHeader(&source, fHeader);
+ }
+
+
+ // Int_t nindices=0;
+ const Int_t entries = source.GetNumberOfTracks();
+
+ Double_t pos[3],cov[6];
+ vtx->GetXYZ(pos);
+ vtx->GetCovarianceMatrix(cov);
+
+ if(entries<=0) return;
+
+ if(vtx->GetNContributors()<1) {
+ // SPD vertex cut
+ vtx =source.GetPrimaryVertexSPD();
+ if(vtx->GetNContributors()<1) { // FIXME: Keep this cut?
+ Info("AliNanoAODReplicator","No good vertex, skip event");
+ return; // NO GOOD VERTEX, SKIP EVENT
+ }
+ }
+
+ Double_t xPrimaryVertex=0.,yPrimaryVertex=0.,zPrimaryVertex=0.;
+ xPrimaryVertex=vtx->GetX();
+ yPrimaryVertex=vtx->GetY();
+ zPrimaryVertex=vtx->GetZ();
+
+
+
+ for(Int_t j=0; j<entries; j++){
+
+ AliVTrack *track = (AliVTrack*)source.GetTrack(j);
+
+ AliAODTrack *aodtrack =(AliAODTrack*)track;// FIXME DYNAMIC CAST?
+ if(!fTrackCut->IsSelected(aodtrack)) continue;
+
+ AliNanoAODTrack * special = new AliNanoAODTrack (aodtrack, fVarList);
+
+ if(fCustomSetter) fCustomSetter->SetNanoAODTrack(aodtrack, special);
+ (*fTracks)[ntracks++] = special;
+ //new((*fTracks)[ntrac\ks++])
+ }
+ //----------------------------------------------------------
+
+ TIter nextV(source.GetVertices());
+ AliAODVertex* v;
+ Int_t nvertices(0);
+
+ while ( ( v = static_cast<AliAODVertex*>(nextV()) ) )
+ {
+ AliAODVertex* tmp = v->CloneWithoutRefs();
+ AliAODVertex* copiedVertex = new((*fVertices)[nvertices++]) AliAODVertex(*tmp);
+
+ // to insure the main vertex retains the ncontributors information
+ // (which is otherwise computed dynamically from
+ // references to tracks, which we do not keep in muon aods...)
+ // we set it here
+
+ copiedVertex->SetNContributors(v->GetNContributors());
+
+ // fVertices->Delete();
+ // delete copiedVertex;
+ delete tmp;
+ }
+
+
+ AliDebug(1,Form("input mu tracks=%d tracks=%d vertices=%d",
+ input,fTracks->GetEntries(),fVertices->GetEntries()));
+
+
+ // Finally, deal with MC information, if needed
+
+ if ( fMCMode > 0 ) {
+ FilterMC(source);
+ }
+
+
+}
+
+
+
+//-----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+
+
+//-----------------------------------------------------------------------------
+
+// AliAODVertex* AliNanoAODReplicator::PrimaryVertex(const TObjArray *trkArray,
+// AliAODEvent &event) const
+// {
+// // Returns primary vertex to be used for this candidate
+// //AliCodeTimerAuto("",0);
+
+// AliESDVertex *vertexESD = 0;
+// AliAODVertex *vertexAOD = 0;
+
+
+// if(!fRecoPrimVtxSkippingTrks && !fRmTrksFromPrimVtx) {
+// // primary vertex from the input event
+
+// vertexESD = new AliESDVertex(*fV1);
+
+// } else {
+// // primary vertex specific to this candidate
+
+// Int_t nTrks = trkArray->GetEntriesFast();
+// AliVertexerTracks *vertexer = new AliVertexerTracks(event.GetMagneticField());
+
+// if(fRecoPrimVtxSkippingTrks) {
+// // recalculating the vertex
+
+// if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraint")) {
+// Float_t diamondcovxy[3];
+// event.GetDiamondCovXY(diamondcovxy);
+// Double_t pos[3]={event.GetDiamondX(),event.GetDiamondY(),0.};
+// Double_t cov[6]={diamondcovxy[0],diamondcovxy[1],diamondcovxy[2],0.,0.,10.*10.};
+// AliESDVertex *diamond = new AliESDVertex(pos,cov,1.,1);
+// vertexer->SetVtxStart(diamond);
+// delete diamond; diamond=NULL;
+// if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraintOnlyFitter"))
+// vertexer->SetOnlyFitter();
+// }
+// Int_t skipped[1000];
+// Int_t nTrksToSkip=0,id;
+// AliExternalTrackParam *t = 0;
+// for(Int_t i=0; i<nTrks; i++) {
+// t = (AliExternalTrackParam*)trkArray->UncheckedAt(i);
+// id = (Int_t)t->GetID();
+// if(id<0) continue;
+// skipped[nTrksToSkip++] = id;
+// }
+// // TEMPORARY FIX
+// // For AOD, skip also tracks without covariance matrix
+// if(fInputAOD) {
+// Double_t covtest[21];
+// for(Int_t j=0; j<event.GetNumberOfTracks(); j++) {
+// AliVTrack *vtrack = (AliVTrack*)event.GetTrack(j);
+// if(!vtrack->GetCovarianceXYZPxPyPz(covtest)) {
+// id = (Int_t)vtrack->GetID();
+// if(id<0) continue;
+// skipped[nTrksToSkip++] = id;
+// }
+// }
+// }
+// for(Int_t ijk=nTrksToSkip; ijk<1000; ijk++) skipped[ijk]=-1;
+// //
+// vertexer->SetSkipTracks(nTrksToSkip,skipped);
+// vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(event);
+
+// } else if(fRmTrksFromPrimVtx && nTrks>0) {
+// // removing the prongs tracks
+
+// TObjArray rmArray(nTrks);
+// UShort_t *rmId = new UShort_t[nTrks];
+// AliESDtrack *esdTrack = 0;
+// AliESDtrack *t = 0;
+// for(Int_t i=0; i<nTrks; i++) {
+// t = (AliESDtrack*)trkArray->UncheckedAt(i);
+// esdTrack = new AliESDtrack(*t);
+// rmArray.AddLast(esdTrack);
+// if(esdTrack->GetID()>=0) {
+// rmId[i]=(UShort_t)esdTrack->GetID();
+// } else {
+// rmId[i]=9999;
+// }
+// }
+// Float_t diamondxy[2]={event.GetDiamondX(),event.GetDiamondY()};
+// vertexESD = vertexer->RemoveTracksFromVertex(fV1,&rmArray,rmId,diamondxy);
+// delete [] rmId; rmId=NULL;
+// rmArray.Delete();
+
+// }
+
+// if(!vertexESD) return vertexAOD;
+// if(vertexESD->GetNContributors()<=0) {
+// //AliDebug(2,"vertexing failed");
+// delete vertexESD; vertexESD=NULL;
+// return vertexAOD;
+// }
+
+// delete vertexer; vertexer=NULL;
+
+// }
+
+// // convert to AliAODVertex
+// Double_t pos[3],cov[6],chi2perNDF;
+// vertexESD->GetXYZ(pos); // position
+// vertexESD->GetCovMatrix(cov); //covariance matrix
+// chi2perNDF = vertexESD->GetChi2toNDF();
+// delete vertexESD; vertexESD=NULL;
+
+// vertexAOD = new AliAODVertex(pos,cov,chi2perNDF);
+
+// return vertexAOD;
+// }
+
+//_____________________________________________________________________________
+
+
+
+// //---------------------------------------------------------------------------
+
+void AliNanoAODReplicator::Terminate(){
+
+}
--- /dev/null
+#ifndef ALINANOAODREPLICATO_H
+#define ALINANOAODREPLICATO_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+* See cxx source for full Copyright notice */
+
+// $Id: AliAODMuonReplicator.h 56492 2012-05-15 18:42:47Z pcrochet $
+
+
+#ifndef ALIDAODBRANCHREPLICATOR_H
+# include "AliAODBranchReplicator.h"
+#endif
+#ifndef ROOT_TExMap
+# include "TExMap.h"
+#endif
+
+#include <iostream>
+
+/* #ifndef AliAOD3LH_H */
+/* #include "AliAOD3LH.h" */
+/* #endif */
+
+//#include "AliAOD3LH.h"
+
+//
+// Implementation of a branch replicator
+// to produce nano AOD.
+//
+// Author: Michele Floris, michele.floris@cern.ch
+
+class AliAnalysisCuts;
+class TClonesArray;
+class AliAODMCHeader;
+class AliAODVZERO;
+class AliAODTZERO;
+class AliPIDResponse;
+class AliESDv0;
+class TArrayI;
+class AliAODv0;
+class TRefArray;
+class AliAODRecoDecay;
+class AliAODRecoDecayHF;
+class AliAODRecoDecayHF2Prong;
+class AliVertexerTracks;
+
+class AliESDVertex;
+class AliESDtrack;
+class AliVEvent;
+class AliAODVertex;
+class AliVertexerTracks;
+class AliESDv0;
+class AliAODv0;
+class AliAODHeader;
+class AliNanoAODHeader;
+class AliAnalysisTaskSE;
+class AliNanoAODTrack;
+class AliAODTrack;
+class AliNanoAODCustomSetter;
+
+class TH1F;
+
+class AliNanoAODReplicator : public AliAODBranchReplicator
+{
+ public:
+
+ AliNanoAODReplicator(const char* name="AliNanoAODReplicator",
+ const char* title="Branch Replicator for special tracks related branches",
+ const char * varlist="pt,eta",
+ AliAnalysisCuts* trackCut=0x0,
+ Int_t mcMode=0
+ );
+
+ virtual ~AliNanoAODReplicator();
+
+ virtual TList* GetList() const ; // FIXME: This is declared const in the interface
+
+ virtual void ReplicateAndFilter(const AliAODEvent& source);
+
+ virtual void Terminate();
+
+ const char * GetVarList() { return fVarList; }
+ void SetVarList (const char * var) { fVarList = var;}
+ const char * GetVarListHeader() { return fVarListHeader; }
+ void SetVarListHeader (const char * var) { fVarListHeader = var;}
+
+ // Call backs for custom variables
+ AliNanoAODCustomSetter * GetCustomSetter() { return fCustomSetter; }
+ void SetCustomSetter (AliNanoAODCustomSetter * var) { fCustomSetter = var; }
+
+
+ private:
+
+ void SelectParticle(Int_t i);
+ Bool_t IsParticleSelected(Int_t i);
+ void CreateLabelMap(const AliAODEvent& source);
+ Int_t GetNewLabel(Int_t i);
+ void FilterMC(const AliAODEvent& source);
+
+
+ Double_t fBzkG; // z componenent of field in kG
+
+ private:
+
+ AliAnalysisCuts* fTrackCut; // decides which tracks to keep
+ mutable TClonesArray* fTracks; //! internal array of arrays of NanoAOD tracks
+ mutable AliNanoAODHeader* fHeader; //! internal array of headers
+ Int_t fNTracksVariables; //! Number of variables in the array
+
+ mutable TClonesArray* fVertices; //! internal array of vertices
+
+ mutable TList* fList; //! internal list of managed objects (fVertices and fTracks)
+
+ mutable TClonesArray* fMCParticles; //! internal array of MC particles
+ mutable AliAODMCHeader* fMCHeader; //! internal array of MC header
+ Int_t fMCMode; // MC filtering switch (0=none=no mc information,1=normal=simple copy,>=2=aggressive=filter out : keep only particles leading to tracks and trheir relatives + all charged primaries)
+
+ TExMap fLabelMap; //! for MC label remapping (in case of aggressive filtering)
+ TExMap fParticleSelected; //! List of selected MC particles
+
+ const char * fVarList; // list of variables to be filterered
+ const char * fVarListHeader; // list of variables to be filtered (header)
+
+ AliNanoAODCustomSetter * fCustomSetter; // Setter class for custom variables
+
+ private:
+
+
+ AliNanoAODReplicator(const AliNanoAODReplicator&);
+ AliNanoAODReplicator& operator=(const AliNanoAODReplicator&);
+
+ ClassDef(AliNanoAODReplicator,1) // Branch replicator for ESD to muon AOD.
+};
+
+#endif
--- /dev/null
+#include "AliNanoAODStorage.h"
+#include "AliNanoAODTrackMapping.h"
+
+ClassImp(AliNanoAODStorage)
+
+void AliNanoAODStorage::AllocateInternalStorage(Int_t size) {
+ // Creates the internal array
+ if(size == 0){
+ AliError("Zero size");
+ return;
+ }
+ fNVars = size;
+ fVars.clear();
+ fVars.resize(size, 0);
+ // if(fVars) {
+ // delete[] fVars;
+ // }
+ // fVars = new Double_t[fNVars];
+ // for (Int_t ivar = 0; ivar<fNVars; ivar++) {
+ // fVars[ivar]=0;
+ // }
+}
+
+AliNanoAODStorage& AliNanoAODStorage::operator=(const AliNanoAODStorage& sto)
+{
+ // Assignment operator
+ AllocateInternalStorage(sto.fNVars);
+ if(this!=&sto) {
+ for (Int_t isize = 0; isize<sto.fNVars; isize++) {
+ SetVar(isize, sto.GetVar(isize));
+ }
+
+ }
+
+ return *this;
+}
--- /dev/null
+#ifndef _ALINANOAODSTORAGE_H_
+#define _ALINANOAODSTORAGE_H_
+
+
+//-------------------------------------------------------------------------
+// AliNanoAODStorage
+//
+// Implements the storage for special AOD classes
+//
+//-------------------------------------------------------------------------
+#include <iostream>
+#include "TObject.h"
+#include "AliLog.h"
+
+
+class AliNanoAODStorage {
+
+public:
+ AliNanoAODStorage():fNVars(0), fVars(0) {;}
+ ~AliNanoAODStorage() {;};
+
+ AliNanoAODStorage& operator=(const AliNanoAODStorage& sto);
+
+ void AllocateInternalStorage(Int_t size);
+ void SetVar(Int_t index, Double_t var) {
+ if(index>=0 && index < fNVars) fVars[index] = var;
+ else AliFatal(Form("Variable %d not included in this special aod", index));
+ }
+ Double_t GetVar(Int_t index) const {
+ if(index>=0 && index < fNVars) return fVars[index];
+ AliFatal(Form("Variable %d not included in this special aod", index));
+ return 0;}
+ virtual const char *ClassName() const {return "AliNanoAODStorage";} // Needed for alifatal. The class cannot inherit from TObject, otherwise we mix (and mess up) inheritance in the track, as it also inherits from AliVTrack which inherits from TObject.
+
+protected:
+
+ Int_t fNVars; // Number of kimematic variables, set by constructor
+ std::vector<Double32_t> fVars; // Array of kinematic vars. Here we use an STL vector because it produces ~5% smaller files. It may be aslo splittable
+
+ ClassDef(AliNanoAODStorage, 1)
+};
+
+
+
+#endif /* _ALINANOAODSTORAGE_H_ */
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-2007, 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. *
+ **************************************************************************/
+
+
+//-------------------------------------------------------------------------
+// AOD special track implementation of AliVTrack
+// Author: Michele Floris, CERN
+// michele.floris@cern.ch
+//-------------------------------------------------------------------------
+
+#include <TVector3.h>
+#include "AliLog.h"
+#include "AliExternalTrackParam.h"
+#include "AliVVertex.h"
+#include "AliDetectorPID.h"
+#include "AliAODEvent.h"
+#include "AliAODHMPIDrings.h"
+
+#include "AliNanoAODTrack.h"
+#include "AliNanoAODTrackMapping.h"
+
+ClassImp(AliNanoAODTrack)
+
+
+//______________________________________________________________________________
+AliNanoAODTrack::AliNanoAODTrack() :
+ AliVTrack(),
+ AliNanoAODStorage(),
+ fLabel(0),
+ fProdVertex(0),
+ fCharge(0),
+ fAODEvent(NULL)
+{
+ // default constructor
+ // The default constructor should not allocate memory! You risk an infinite loop here.
+ // AllocateInternalStorage(AliNanoAODTrackMapping::GetInstance()->GetSize());
+
+ // AllocateInternalStorage("pt,theta,phi");
+ // FIXME: TO BE REIMPLEMENTED
+ // SetPosition((Float_t*)NULL);
+ // SetXYAtDCA(-999., -999.);
+ // SetPxPyPzAtDCA(-999., -999., -999.);
+ // SetPID((Float_t*)NULL);
+ // for (Int_t i = 0; i < 3; i++) {fTOFLabel[i] = -1;}
+}
+
+//______________________________________________________________________________
+AliNanoAODTrack::AliNanoAODTrack(AliAODTrack * aodTrack, const char * vars) :
+ AliVTrack(),
+ AliNanoAODStorage(),
+ fLabel(0),
+ fProdVertex(0),
+ fCharge(0),
+ fAODEvent(NULL)
+{
+ // constructor
+
+ Double_t position[3];
+ Bool_t isPosAvailable = aodTrack->GetPosition(position);
+ new AliNanoAODTrackMapping(vars);
+
+ // Create internal structure
+ AllocateInternalStorage(AliNanoAODTrackMapping::GetInstance()->GetSize());
+
+ for (Int_t index = 0; index<AliNanoAODTrackMapping::GetInstance()->GetSize(); index++) {
+ TString varString = AliNanoAODTrackMapping::GetInstance()->GetVarName(index);
+
+ if (varString == "pt" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetPt() , aodTrack->Pt() );
+ else if(varString == "phi" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetPhi() , aodTrack->Phi() );
+ else if(varString == "theta" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetTheta() , aodTrack->Theta() );
+ else if(varString == "chi2perNDF" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetChi2PerNDF() , aodTrack->Chi2perNDF() );
+ else if(varString == "posx" && isPosAvailable ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetPosX() , position[0] );
+ else if(varString == "posy" && isPosAvailable ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetPosY() , position[1] );
+ else if(varString == "posz" && isPosAvailable ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetPosZ() , position[2] );
+ else if(varString == "posDCAx" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetPosDCAx() , aodTrack->XAtDCA() );
+ else if(varString == "posDCAy" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetPosDCAy() , aodTrack->YAtDCA() );
+ else if(varString == "pDCAx" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetPDCAX() , aodTrack->PxAtDCA() );
+ else if(varString == "pDCAy" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetPDCAY() , aodTrack->PyAtDCA() );
+ else if(varString == "pDCAz" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetPDCAZ() , aodTrack->PzAtDCA() );
+ else if(varString == "RAtAbsorberEnd" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetRAtAbsorberEnd() , aodTrack->GetRAtAbsorberEnd() );
+ else if(varString == "TPCncls" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCncls() , aodTrack->GetTPCNcls() );
+ else if(varString == "id" ) SetVar(AliNanoAODTrackMapping::GetInstance()->Getid() , aodTrack->GetID() );
+ else if(varString == "TPCnclsF" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCnclsF() , aodTrack->GetTPCNclsF() );
+ else if(varString == "TPCNCrossedRows" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCNCrossedRows() , aodTrack->GetTPCNCrossedRows() );
+ else if(varString == "TrackPhiOnEMCal" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetTrackPhiOnEMCal() , aodTrack->GetTrackPhiOnEMCal() );
+ else if(varString == "TrackEtaOnEMCal" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetTrackEtaOnEMCal() , aodTrack->GetTrackEtaOnEMCal() );
+ else if(varString == "TrackPtOnEMCal" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetTrackPtOnEMCal() , aodTrack->GetTrackPtOnEMCal() );
+ else if(varString == "ITSsignal" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetITSsignal() , aodTrack->GetITSsignal() );
+ else if(varString == "TPCsignal" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCsignal() , aodTrack->GetTPCsignal() );
+ else if(varString == "TPCsignalTuned" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCsignalTuned() , aodTrack->GetTPCsignalTunedOnData() );
+ else if(varString == "TPCsignalN" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCsignalN() , aodTrack->GetTPCsignalN() );
+ else if(varString == "TPCmomentum" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCmomentum() , aodTrack->GetTPCmomentum() );
+ else if(varString == "TPCTgl" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCTgl() , aodTrack->GetTPCTgl() );
+ else if(varString == "TOFsignal" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetTOFsignal() , aodTrack->GetTOFsignal() );
+ else if(varString == "integratedLenght" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetintegratedLenght() , aodTrack->GetIntegratedLength() );
+ else if(varString == "TOFsignalTuned" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetTOFsignalTuned() , aodTrack->GetTOFsignalTunedOnData() );
+ else if(varString == "HMPIDsignal" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetHMPIDsignal() , aodTrack->GetHMPIDsignal() );
+ else if(varString == "HMPIDoccupancy" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetHMPIDoccupancy() , aodTrack->GetHMPIDoccupancy() );
+ else if(varString == "TRDsignal" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetTRDsignal() , aodTrack->GetTRDsignal() );
+ else if(varString == "TRDChi2" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetTRDChi2() , aodTrack->GetTRDchi2() );
+ else if(varString == "TRDnSlices" ) SetVar(AliNanoAODTrackMapping::GetInstance()->GetTRDnSlices() , aodTrack->GetNumberOfTRDslices() );
+ else if(varString == "covmat" ) AliFatal("cov matrix To be implemented" );
+ }
+
+
+ fLabel = aodTrack->GetLabel();
+ fCharge = aodTrack->Charge();
+ fProdVertex = aodTrack->GetProdVertex();
+ // SetUsedForVtxFit(usedForVtxFit);// FIXME: what is this
+ // SetUsedForPrimVtxFit(usedForPrimVtxFit);// FIXME: what is this
+ // // if(covMatrix) SetCovMatrix(covMatrix);// FIXME:
+ // for (Int_t i=0;i<3;i++) {fTOFLabel[i]=-1;}
+
+}
+
+//______________________________________________________________________________
+AliNanoAODTrack::AliNanoAODTrack(AliESDTrack * /*esdTrack*/, const char * /*vars*/) :
+ AliVTrack(),
+ AliNanoAODStorage(),
+ fLabel(0),
+ fProdVertex(0),
+ fCharge(0),
+ fAODEvent(NULL)
+{
+ // ctor: Creates a special track by copying the requested variables from an ESD track
+ AliFatal("To be Implemented");
+}
+
+
+AliNanoAODTrack::AliNanoAODTrack(const char * vars) :
+ AliVTrack(),
+ AliNanoAODStorage(),
+ fLabel(0),
+ fProdVertex(0),
+ fCharge(0),
+ fAODEvent(NULL)
+{
+ // ctor: Creates a special track simply allocating the required variables
+ new AliNanoAODTrackMapping(vars);
+
+ // Create internal structure
+ AllocateInternalStorage(AliNanoAODTrackMapping::GetInstance()->GetSize());
+
+
+}
+
+//______________________________________________________________________________
+AliNanoAODTrack::~AliNanoAODTrack()
+{
+ // std::cout << "1 " << this << " " << fKinVars << " " << fNKinVars << std::endl;
+ // this->Print();
+ // destructor
+ // if(fKinVars) {
+ // std::cout << "2" << std::endl;
+ // delete [] fKinVars;
+ // std::cout << "3" << std::endl;
+ // fKinVars = 0;
+ // std::cout << "4" << std::endl;
+ // }
+
+ // if(fCovMatrix) {
+ // delete fCovMatrix;
+ // fCovMatrix = 0;
+ // }
+}
+
+
+//______________________________________________________________________________
+AliNanoAODTrack::AliNanoAODTrack(const AliNanoAODTrack& trk) :
+ AliVTrack(),
+ AliNanoAODStorage(),
+ fLabel(trk.fLabel),
+ fProdVertex(trk.fProdVertex),
+ fCharge(trk.fCharge),
+ fAODEvent(trk.fAODEvent)
+{
+ // Copy constructor
+ // std::cout << "Copy Ctor" << std::endl;
+
+ AllocateInternalStorage(AliNanoAODTrackMapping::GetInstance()->GetSize());
+ for (Int_t isize = 0; isize<AliNanoAODTrackMapping::GetInstance()->GetSize(); isize++) {
+ SetVar(isize, trk.GetVar(isize));
+ }
+
+
+}
+
+//______________________________________________________________________________
+AliNanoAODTrack& AliNanoAODTrack::operator=(const AliNanoAODTrack& trk)
+{
+ // Assignment operator
+ if(this!=&trk) {
+
+ AliVTrack::operator=(trk); // FIXME: I think I should overload this...
+ AliNanoAODStorage::operator=(trk);
+
+ fLabel = trk.fLabel;
+ fProdVertex = trk.fProdVertex;
+ fCharge = trk.fCharge;
+ fAODEvent = trk.fAODEvent;
+
+ }
+
+ return *this;
+}
+
+
+
+//______________________________________________________________________________
+Double_t AliNanoAODTrack::M(AliAODTrack::AODTrkPID_t pid) const
+{
+ // Returns the mass.
+ // Masses for nuclei don't exist in the PDG tables, therefore they were put by hand.
+
+ switch (pid) {
+
+ case AliAODTrack::kElectron :
+ return 0.000510999; //TDatabasePDG::Instance()->GetParticle(11/*::kElectron*/)->Mass();
+ break;
+
+ case AliAODTrack::kMuon :
+ return 0.1056584; //TDatabasePDG::Instance()->GetParticle(13/*::kMuonMinus*/)->Mass();
+ break;
+
+ case AliAODTrack::kPion :
+ return 0.13957; //TDatabasePDG::Instance()->GetParticle(211/*::kPiPlus*/)->Mass();
+ break;
+
+ case AliAODTrack::kKaon :
+ return 0.4937; //TDatabasePDG::Instance()->GetParticle(321/*::kKPlus*/)->Mass();
+ break;
+
+ case AliAODTrack::kProton :
+ return 0.9382720; //TDatabasePDG::Instance()->GetParticle(2212/*::kProton*/)->Mass();
+ break;
+
+ case AliAODTrack::kDeuteron :
+ return 1.8756; //TDatabasePDG::Instance()->GetParticle(1000010020)->Mass();
+ break;
+
+ case AliAODTrack::kTriton :
+ return 2.8089; //TDatabasePDG::Instance()->GetParticle(1000010030)->Mass();
+ break;
+
+ case AliAODTrack::kHelium3 :
+ return 2.8084; //TDatabasePDG::Instance()->GetParticle(1000020030)->Mass();
+ break;
+
+ case AliAODTrack::kAlpha :
+ return 3.7274; //TDatabasePDG::Instance()->GetParticle(1000020040)->Mass();
+ break;
+
+ case AliAODTrack::kUnknown :
+ return -999.;
+ break;
+
+ default :
+ return -999.;
+ }
+}
+
+//______________________________________________________________________________
+Double_t AliNanoAODTrack::E(AliAODTrack::AODTrkPID_t pid) const
+{
+ // Returns the energy of the particle of a given pid.
+
+ if (pid != AliAODTrack::kUnknown) { // particle was identified
+ Double_t m = M(pid);
+ return TMath::Sqrt(P()*P() + m*m);
+ } else { // pid unknown
+ return -999.;
+ }
+}
+
+//______________________________________________________________________________
+Double_t AliNanoAODTrack::Y(AliAODTrack::AODTrkPID_t pid) const
+{
+ // Returns the rapidity of a particle of a given pid.
+
+ if (pid != AliAODTrack::kUnknown) { // particle was identified
+ Double_t e = E(pid);
+ Double_t pz = Pz();
+ if (e>=0 && e!=pz) { // energy was positive (e.g. not -999.) and not equal to pz
+ return 0.5*TMath::Log((e+pz)/(e-pz));
+ } else { // energy not known or equal to pz
+ return -999.;
+ }
+ } else { // pid unknown
+ return -999.;
+ }
+}
+
+//______________________________________________________________________________
+Double_t AliNanoAODTrack::Y(Double_t m) const
+{
+ // Returns the rapidity of a particle of a given mass.
+
+ if (m >= 0.) { // mass makes sense
+ Double_t e = E(m);
+ Double_t pz = Pz();
+ if (e>=0 && e!=pz) { // energy was positive (e.g. not -999.) and not equal to pz
+ return 0.5*TMath::Log((e+pz)/(e-pz));
+ } else { // energy not known or equal to pz
+ return -999.;
+ }
+ } else { // pid unknown
+ return -999.;
+ }
+}
+
+
+
+//______________________________________________________________________________
+template <typename T> void AliNanoAODTrack::SetP(const T *p, const Bool_t cartesian)
+{
+ // Set the momentum
+
+ if (p) {
+ if (cartesian) {
+ // This is inherited from AliAODtrack... I don't think we want/need this in the special track
+ AliFatal("Not implemented");
+ } else {
+ SetVar(AliNanoAODTrackMapping::GetInstance()->GetPt() , p[0]);
+ SetVar(AliNanoAODTrackMapping::GetInstance()->GetPhi() , p[1]);
+ SetVar(AliNanoAODTrackMapping::GetInstance()->GetTheta() , p[2]);
+ }
+ } else {
+ SetVar(AliNanoAODTrackMapping::GetInstance()->GetPt() , p[0]);
+ SetVar(AliNanoAODTrackMapping::GetInstance()->GetPhi() , p[1]);
+ SetVar(AliNanoAODTrackMapping::GetInstance()->GetTheta() , p[2]);
+ }
+}
+
+/*
+//______________________________________________________________________________
+template <typename T> void AliNanoAODTrack::SetPosition(const T *x, const Bool_t dca)
+{
+ // set the position
+
+ if (x) {
+ if (!dca) {
+ ResetBit(kIsDCA);
+
+ fPosition[0] = x[0];
+ fPosition[1] = x[1];
+ fPosition[2] = x[2];
+ } else {
+ SetBit(kIsDCA);
+ // don't know any better yet
+ fPosition[0] = -999.;
+ fPosition[1] = -999.;
+ fPosition[2] = -999.;
+ }
+ } else {
+ ResetBit(kIsDCA);
+
+ fPosition[0] = -999.;
+ fPosition[1] = -999.;
+ fPosition[2] = -999.;
+ }
+}
+*/
+//______________________________________________________________________________
+void AliNanoAODTrack::SetDCA(Double_t d, Double_t z)
+{
+ // set the dca
+
+ // FIXME: this is a hack which was taken over from the AliAODtrack,
+ // where the same variable is used to store DCA or position,
+ // according to the value of the bit kIsDCA. We can probably get rid
+ // of this in the special track.
+ SetVar(AliNanoAODTrackMapping::GetInstance()->GetPosX(), d);
+ SetVar(AliNanoAODTrackMapping::GetInstance()->GetPosY(), z);
+ SetVar(AliNanoAODTrackMapping::GetInstance()->GetPosZ(), 0);
+ SetBit(AliAODTrack::kIsDCA);
+}
+
+//______________________________________________________________________________
+void AliNanoAODTrack::Print(Option_t* /* option */) const
+{
+ // prints information about AliNanoAODTrack
+ // std::cout << "Size: " << AliNanoAODTrackMapping::GetInstance()->GetSize() << std::endl;
+ AliNanoAODTrackMapping::GetInstance()->Print();
+
+ for (Int_t index = 0; index<AliNanoAODTrackMapping::GetInstance()->GetSize(); index++) {
+ printf(" - [%2.2d] %-10s : %f\n", index, AliNanoAODTrackMapping::GetInstance()->GetVarName(index), GetVar(index));
+ }
+ std::cout << "" << std::endl;
+
+}
+
+
+
+//______________________________________________________________________________
+Bool_t AliNanoAODTrack::PropagateToDCA(const AliVVertex *vtx,
+ Double_t b, Double_t maxd, Double_t dz[2], Double_t covar[3])
+{
+ // compute impact parameters to the vertex vtx and their covariance matrix
+ // b is the Bz, needed to propagate correctly the track to vertex
+ // only the track parameters are update after the propagation (pos and mom),
+ // not the covariance matrix. This is OK for propagation over short distance
+ // inside the beam pipe.
+ // return kFALSE is something went wrong
+
+ // allowed only for tracks inside the beam pipe
+ Float_t xstart2 = GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosX())*GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosX())+GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosY())*GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosY());
+
+ if(xstart2 > 3.*3.) { // outside beampipe radius
+ AliError("This method can be used only for propagation inside the beam pipe");
+ return kFALSE;
+ }
+
+ // convert to AliExternalTrackParam
+ AliExternalTrackParam etp; etp.CopyFromVTrack(this);
+
+ // propagate
+ if(!etp.PropagateToDCA(vtx,b,maxd,dz,covar)) return kFALSE;
+
+ // update track position and momentum
+ Double_t mom[3];
+ etp.GetPxPyPz(mom);
+ SetP(mom,kTRUE);
+ etp.GetXYZ(mom);
+ SetPosition(mom,kFALSE);
+
+
+ return kTRUE;
+}
+
+//______________________________________________________________________________
+Bool_t AliNanoAODTrack::GetPxPyPz(Double_t p[3]) const
+{
+ //---------------------------------------------------------------------
+ // This function returns the global track momentum components
+ //---------------------------------------------------------------------
+ p[0]=Px(); p[1]=Py(); p[2]=Pz();
+ return kTRUE;
+}
+
+
+
+//_____________________________________________________________________________
+//_____________________________________________________________________________
+
+Bool_t AliNanoAODTrack::GetXYZAt(Double_t x, Double_t b, Double_t *r) const
+{
+ //---------------------------------------------------------------------
+ // This function returns the global track position extrapolated to
+ // the radial position "x" (cm) in the magnetic field "b" (kG)
+ //---------------------------------------------------------------------
+
+ //conversion of track parameter representation is
+ //based on the implementation of AliExternalTrackParam::Set(...)
+ //maybe some of this code can be moved to AliVTrack to avoid code duplication
+ const double kSafe = 1e-5;
+ Double_t alpha=0.0;
+ Double_t radPos2 = GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosX())*GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosX())+GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosY())*GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosY());
+ Double_t radMax = 45.; // approximately ITS outer radius
+ if (radPos2 < radMax*radMax) { // inside the ITS
+ alpha = TMath::ATan2(Py(),Px());
+ } else { // outside the ITS
+ Float_t phiPos = TMath::Pi()+TMath::ATan2(-GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosY()), -GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosX()));
+ alpha =
+ TMath::DegToRad()*(20*((((Int_t)(phiPos*TMath::RadToDeg()))/20))+10);
+ }
+ //
+ Double_t cs=TMath::Cos(alpha), sn=TMath::Sin(alpha);
+ // protection: avoid alpha being too close to 0 or +-pi/2
+ if (TMath::Abs(sn)<kSafe) {
+ alpha = kSafe;
+ cs=TMath::Cos(alpha);
+ sn=TMath::Sin(alpha);
+ }
+ else if (cs<kSafe) {
+ alpha -= TMath::Sign(kSafe, alpha);
+ cs=TMath::Cos(alpha);
+ sn=TMath::Sin(alpha);
+ }
+
+ // Get the vertex of origin and the momentum
+ TVector3 ver(GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosX()), GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosY()), GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosZ()));
+ TVector3 mom(Px(),Py(),Pz());
+ //
+ // avoid momenta along axis
+ if (TMath::Abs(mom[0])<kSafe) mom[0] = TMath::Sign(kSafe*TMath::Abs(mom[1]), mom[0]);
+ if (TMath::Abs(mom[1])<kSafe) mom[1] = TMath::Sign(kSafe*TMath::Abs(mom[0]), mom[1]);
+
+ // Rotate to the local coordinate system
+ ver.RotateZ(-alpha);
+ mom.RotateZ(-alpha);
+
+ Double_t param0 = ver.Y();
+ Double_t param1 = ver.Z();
+ Double_t param2 = TMath::Sin(mom.Phi());
+ Double_t param3 = mom.Pz()/mom.Pt();
+ Double_t param4 = TMath::Sign(1/mom.Pt(),(Double_t)fCharge);
+
+ //calculate the propagated coordinates
+ //this is based on AliExternalTrackParam::GetXYZAt(Double_t x, Double_t b, Double_t *r)
+ Double_t dx=x-ver.X();
+ if(TMath::Abs(dx)<=kAlmost0) return GetXYZ(r);
+
+ Double_t f1=param2;
+ Double_t f2=f1 + dx*param4*b*kB2C;
+
+ if (TMath::Abs(f1) >= kAlmost1) return kFALSE;
+ if (TMath::Abs(f2) >= kAlmost1) return kFALSE;
+
+ Double_t r1=TMath::Sqrt((1.-f1)*(1.+f1)), r2=TMath::Sqrt((1.-f2)*(1.+f2));
+ r[0] = x;
+ r[1] = param0 + dx*(f1+f2)/(r1+r2);
+ r[2] = param1 + dx*(r2 + f2*(f1+f2)/(r1+r2))*param3;//Thanks to Andrea & Peter
+
+ return Local2GlobalPosition(r,alpha);
+}
+
+
+//_______________________________________________________
--- /dev/null
+#ifndef AliNanoAODTrack_H
+#define AliNanoAODTrack_H
+/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+
+//-------------------------------------------------------------------------
+// AOD NanoAOD track implementation
+// NanoAOD tracks are lightweight tracks which only contain a subset
+// of and ESD/AOD tracks. They are meant to be stored in specialized
+// nanoAOD for specific analysis.
+// The standard constructor takes either a AOD or an ESD track and a
+// list of comma separated variables.
+// Only those variables are actually allocated and saved with the track.
+// Attempts to use any other variable produces an AliFatal
+//
+// Allowed kin var:
+// pt, theta, phi, chi2perNDF, posx, posy, posz, covmat, posDCAx,
+// posDCAy, pDCAx, pDCAy, pDCAz, RAtAbsorberEnd, TPCncls, TPCnclsF,
+// TPCNCrossedRows, TrackPhiOnEMCal, TrackEtaOnEMCal,
+// TrackPtOnEMCal, ITSsignal, TPCsignal, TPCsignalTuned,
+// TPCsignalN, TPCmomentum, TPCTgl, TOFsignal, integratedLenght,
+// TOFsignalTuned, HMPIDsignal, HMPIDoccupancy, TRDsignal,
+// TRDChi2, TRDnSlices
+
+// Custom vars
+// if the var name begins by "cst", it allows to add a track
+// property not initially foreseen in the Vtrack or in the
+// original AOD. For instance, you can add the value of the
+// bayesian probability to be a kaon by using cstKBayes. Custom
+// variables can be set at once using
+// AliNanoAODTrack::SetCustomVariables(Double_t *vars), by
+// providing them in the same order as they are defined. // FIXME: to be implemented
+//
+//
+// TODO
+// - Go through class again after implementation
+// - Decide if you want to create a short or int array
+// - in the constructor, set the covariant matrix only if requested
+//
+// INFO/TO BE DECIDED
+// - I think this should not support muons, since muons have already their specialized AOD class
+// Author: Michele Floris, CERN
+//-------------------------------------------------------------------------
+
+#include <TRef.h>
+#include <TBits.h>
+#include <iostream>
+#include "AliVTrack.h"
+#include "AliAODVertex.h"
+#include "AliAODRedCov.h"
+#include "AliAODPid.h"
+#include "AliAODTrack.h"
+#include "TObjString.h"
+#include "TMap.h"
+#include "AliNanoAODTrackMapping.h"
+#include "AliNanoAODStorage.h"
+
+
+#include <vector>
+
+class AliVVertex;
+class AliDetectorPID;
+class AliTPCdEdxInfo;
+class AliAODEvent;
+class AliAODTrack;
+class AliESDTrack;
+
+class AliNanoAODTrack : public AliVTrack, public AliNanoAODStorage {
+
+public:
+
+ using TObject::ClassName;
+
+ AliNanoAODTrack();
+ AliNanoAODTrack(AliAODTrack * aodTrack, const char * vars);
+ AliNanoAODTrack(AliESDTrack * esdTrack, const char * vars);
+ AliNanoAODTrack(const char * vars);
+
+ virtual ~AliNanoAODTrack();
+ AliNanoAODTrack(const AliNanoAODTrack& trk);
+ AliNanoAODTrack& operator=(const AliNanoAODTrack& trk);
+
+ // Storage helper methods
+
+ // kinematics
+ virtual Double_t OneOverPt() const { return (Pt() != 0.) ? 1./Pt() : -999.; }
+ virtual Double_t Phi() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPhi()); }
+ virtual Double_t Theta() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTheta()); }
+
+ virtual Double_t Px() const { return Pt() * TMath::Cos(Phi()); }
+ virtual Double_t Py() const { return Pt() * TMath::Sin(Phi()); }
+ virtual Double_t Pz() const { return Pt() / TMath::Tan(Theta()); }
+ virtual Double_t Pt() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPt()); }
+ virtual Double_t P() const { return TMath::Sqrt(Pt()*Pt()+Pz()*Pz()); }
+ virtual Bool_t PxPyPz(Double_t p[3]) const { p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE; }
+
+ virtual Double_t Xv() const { return GetProdVertex() ? GetProdVertex()->GetX() : -999.; }
+ virtual Double_t Yv() const { return GetProdVertex() ? GetProdVertex()->GetY() : -999.; }
+ virtual Double_t Zv() const { return GetProdVertex() ? GetProdVertex()->GetZ() : -999.; }
+ virtual Bool_t XvYvZv(Double_t x[3]) const { x[0] = Xv(); x[1] = Yv(); x[2] = Zv(); return kTRUE; }
+
+ Double_t Chi2perNDF() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetChi2PerNDF()); }
+ UShort_t GetTPCNcls() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCncls()); } // FIXME: should this be short?
+
+ virtual Double_t M() const { AliFatal("Not Implemented"); return -1; }
+ Double_t M(AliAODTrack::AODTrkPID_t pid) const;
+ virtual Double_t E() const { AliFatal("Not Implemented"); return -1; }
+ Double_t E(AliAODTrack::AODTrkPID_t pid) const;
+ Double_t E(Double_t m) const { return TMath::Sqrt(P()*P() + m*m); }
+ virtual Double_t Y() const { AliFatal("Not Implemented"); return -1; }
+ Double_t Y(AliAODTrack::AODTrkPID_t pid) const;
+ Double_t Y(Double_t m) const;
+
+ virtual Double_t Eta() const { return -TMath::Log(TMath::Tan(0.5 * Theta())); }
+ virtual Short_t Charge() const {return fCharge; } // FIXME: leave like this? Create shorts array?
+ virtual Bool_t PropagateToDCA(const AliVVertex *vtx,
+ Double_t b, Double_t maxd, Double_t dz[2], Double_t covar[3]);
+
+
+ // Bool_t IsOn(Int_t mask) const {return (fFlags&mask)>0;}
+ ULong_t GetStatus() const { AliFatal("Not implemented"); return 0; }
+ // ULong_t GetFlags() const { return fFlags; }
+
+ // Int_t GetID() const { return (Int_t)fID; } // FIXME another int (short)
+ Int_t GetID() const { AliFatal("Not Implemented"); return 0; } // FIXME another int (short)
+ Int_t GetLabel() const { return fLabel; } //
+ // void GetTOFLabel(Int_t *p) const;
+
+
+ // Bool_t IsPrimaryCandidate() const;
+ // FIXME: do we need any of the following (note that I already removed the bit enums)
+ // Bool_t GetUsedForVtxFit() const { return TestBit(kUsedForVtxFit); }
+ // Bool_t GetUsedForPrimVtxFit() const { return TestBit(kUsedForPrimVtxFit); }
+
+ // Bool_t IsHybridGlobalConstrainedGlobal() const { return TestBit(kIsHybridGCG); }
+ // Bool_t IsHybridTPCConstrainedGlobal() const { return TestBit(kIsHybridTPCCG); }
+ // Bool_t IsTPCOnly() const { return IsTPCConstrained(); } // obsolete bad naming
+ // Bool_t IsTPCConstrained() const { return TestBit(kIsTPCConstrained); }
+ // Bool_t IsGlobalConstrained() const { return TestBit(kIsGlobalConstrained); }
+ //
+ //
+ template <typename T> void GetP(T *p) const {
+ p[0]=Pt(); p[1]=Phi(); p[2]=Theta();}
+
+ // template <typename T> void GetPxPyPz(T *p) const {
+ // p[0] = Px(); p[1] = Py(); p[2] = Pz();}
+ Bool_t GetPxPyPz(Double_t *p) const;
+
+
+ template <typename T> Bool_t GetPosition(T *x) const {
+ x[0]=GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosX()); x[1]=GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosY()); x[2]=GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosZ());
+ return TestBit(AliAODTrack::kIsDCA);}
+
+ // FIXME: only allocate if listed?
+ // template <typename T> void SetCovMatrix(const T *covMatrix) {
+ // if(!fCovMatrix) fCovMatrix=new AliAODRedCov<6>();
+ // fCovMatrix->SetCovMatrix(covMatrix);}
+
+ // template <typename T> Bool_t GetCovMatrix(T *covMatrix) const {
+ // if(!fCovMatrix) return kFALSE;
+ // fCovMatrix->GetCovMatrix(covMatrix); return kTRUE;}
+
+ Bool_t GetXYZ(Double_t *p) const {
+ return GetPosition(p); }
+
+ Bool_t GetXYZAt(Double_t x, Double_t b, Double_t *r) const;
+
+ Bool_t GetCovarianceXYZPxPyPz(Double_t /*cv*/[21]) const {AliFatal("Not implemented"); return 0;}
+ // return GetCovMatrix(cv);}
+
+ // void RemoveCovMatrix() {delete fCovMatrix; fCovMatrix=NULL;}
+
+ Double_t XAtDCA() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosDCAx()); }
+ Double_t YAtDCA() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosDCAy()); }
+ Double_t ZAtDCA() const { // FIXME: not sure about this one
+ if (TestBit(AliAODTrack::kIsDCA)) return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosY());
+ else return -999.; }
+ Bool_t XYZAtDCA(Double_t x[3]) const { x[0] = XAtDCA(); x[1] = YAtDCA(); x[2] = ZAtDCA(); return kTRUE; }
+
+ Double_t DCA() const { // FIXME: not sure about this one
+ if (TestBit(AliAODTrack::kIsDCA)) return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPosX()); // FIXME: Why does this return posX?
+ else return -999.; }
+
+ Double_t PxAtDCA() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPDCAX()); }
+ Double_t PyAtDCA() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPDCAY()); }
+ Double_t PzAtDCA() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetPDCAZ()); }
+ Double_t PAtDCA() const { return TMath::Sqrt(PxAtDCA()*PxAtDCA() + PyAtDCA()*PyAtDCA() + PzAtDCA()*PzAtDCA()); }
+ Bool_t PxPyPzAtDCA(Double_t p[3]) const { p[0] = PxAtDCA(); p[1] = PyAtDCA(); p[2] = PzAtDCA(); return kTRUE; }
+
+ Double_t GetRAtAbsorberEnd() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetRAtAbsorberEnd()); }
+
+ // For this whole block of cluster maps I could simply define a cluster map in the int array. For the moment comment all maps. Maybe not neede
+ UChar_t GetITSClusterMap() const { AliFatal("Not Implemented"); return 0;};
+ // Int_t GetITSNcls() const;
+ // Bool_t HasPointOnITSLayer(Int_t i) const { return TESTBIT(GetITSClusterMap(),i); }
+ // UShort_t GetHitsPatternInTrigCh() const { return (UShort_t)((fITSMuonClusterMap&0xff00)>>8); }// Fixme: array of uchars or of int?
+ // UInt_t GetMUONClusterMap() const { return (fITSMuonClusterMap&0x3ff0000)>>16; } //
+ // UInt_t GetITSMUONClusterMap() const { return fITSMuonClusterMap; }
+
+ // Bool_t TestFilterBit(UInt_t filterBit) const {return (Bool_t) ((filterBit & fFilterMap) != 0);}
+ // Bool_t TestFilterMask(UInt_t filterMask) const {return (Bool_t) ((filterMask & fFilterMap) == filterMask);}
+ // void SetFilterMap(UInt_t i){fFilterMap = i;}
+ // UInt_t GetFilterMap() const {return fFilterMap;}
+
+ // const TBits& GetTPCClusterMap() const {return fTPCClusterMap;}
+ // const TBits* GetTPCClusterMapPtr() const {return &fTPCClusterMap;}
+ // const TBits& GetTPCFitMap() const {return fTPCFitMap;}
+ // const TBits* GetTPCFitMapPtr() const {return &fTPCFitMap;}
+
+ Float_t GetTPCClusterInfo(Int_t /*nNeighbours=3*/, Int_t /*type=0*/, Int_t /*row0=0*/, Int_t /*row1=159*/, Int_t /*type*/=0) const { AliFatal("Not Implemented"); return 0;}; // FIXME What is this?
+
+ // const TBits& GetTPCSharedMap() const {return fTPCSharedMap;}
+ // const TBits* GetTPCSharedMapPtr() const {return &fTPCSharedMap;}
+ // void SetTPCClusterMap(const TBits amap) {fTPCClusterMap = amap;}
+ // void SetTPCSharedMap(const TBits amap) {fTPCSharedMap = amap;}
+ // void SetTPCFitMap(const TBits amap) {fTPCFitMap = amap;}
+ //
+ void SetTPCPointsF(UShort_t findable){fVars[AliNanoAODTrackMapping::GetInstance()->GetTPCnclsF()] = findable;}
+ void SetTPCNCrossedRows(UInt_t n) {fVars[AliNanoAODTrackMapping::GetInstance()->GetTPCNCrossedRows()] = n;}
+
+ UShort_t GetTPCNclsF() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCnclsF());}
+ UShort_t GetTPCNCrossedRows() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCNCrossedRows());}
+ Float_t GetTPCFoundFraction() const { return GetTPCNCrossedRows()>0 ? float(GetTPCNcls())/GetTPCNCrossedRows() : 0;}
+
+ // Calorimeter Cluster
+ // FIXME: to be implemented
+ // Int_t GetEMCALcluster() const {return fCaloIndex;}
+ // void SetEMCALcluster(Int_t index) {fCaloIndex=index;}
+ // Bool_t IsEMCAL() const {return fFlags&kEMCALmatch;}
+
+ Double_t GetTrackPhiOnEMCal() const {return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTrackPhiOnEMCal());}
+ Double_t GetTrackEtaOnEMCal() const {return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTrackEtaOnEMCal());}
+ Double_t GetTrackPtOnEMCal() const {return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTrackPtOnEMCal());}
+ Double_t GetTrackPOnEMCal() const {return TMath::Abs(GetTrackEtaOnEMCal()) < 1 ? GetTrackPtOnEMCal()*TMath::CosH(GetTrackEtaOnEMCal()) : -999;}
+ void SetTrackPhiEtaPtOnEMCal(Double_t phi,Double_t eta,Double_t pt) {fVars[AliNanoAODTrackMapping::GetInstance()->GetTrackPhiOnEMCal()]=phi;fVars[AliNanoAODTrackMapping::GetInstance()->GetTrackEtaOnEMCal()]=eta;fVars[AliNanoAODTrackMapping::GetInstance()->GetTrackPtOnEMCal()]=pt;}
+
+ // Int_t GetPHOScluster() const {return fCaloIndex;} // TODO: int array
+ // void SetPHOScluster(Int_t index) {fCaloIndex=index;}
+ // Bool_t IsPHOS() const {return fFlags&kPHOSmatch;}//TODO: fFlags?
+
+ //pid signal interface
+ //TODO you can remove the PID object
+ Double_t GetITSsignal() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetITSsignal());}
+ Double_t GetTPCsignal() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCsignal());}
+ Double_t GetTPCsignalTunedOnData() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCsignalTuned());}
+ void SetTPCsignalTunedOnData(Double_t signal) {fVars[AliNanoAODTrackMapping::GetInstance()->GetTPCsignalTuned()] = signal;}
+ UShort_t GetTPCsignalN() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCsignalN());}// FIXME: what is this?
+ // virtual AliTPCdEdxInfo* GetTPCdEdxInfo() const {return fDetPid?fDetPid->GetTPCdEdxInfo():0;} // FIXME: is this needed?
+ Double_t GetTPCmomentum() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCmomentum()); }
+ Double_t GetTPCTgl() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTPCTgl()); } // FIXME: what is this?
+ Double_t GetTOFsignal() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTOFsignal()); }
+ Double_t GetIntegratedLength() const { AliFatal("Not implemented"); return 0;} // TODO: implement track lenght
+ void SetIntegratedLength(Double_t l) {AliFatal("Not implemented"); l=0;}
+ Double_t GetTOFsignalTunedOnData() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTOFsignalTuned());}
+ void SetTOFsignalTunedOnData(Double_t signal) {fVars[AliNanoAODTrackMapping::GetInstance()->GetTOFsignalTuned()] = signal;}
+ Double_t GetHMPIDsignal() const {return GetVar(AliNanoAODTrackMapping::GetInstance()->GetHMPIDsignal());};
+ Double_t GetHMPIDoccupancy() const {return GetVar(AliNanoAODTrackMapping::GetInstance()->GetHMPIDoccupancy());};
+
+
+
+ virtual void GetIntegratedTimes(Double_t */*times*/, Int_t) const { AliFatal("Not implemented"); return;} // FIXME check implementation
+
+ // ________________________________________________________________________________________________________________
+ // *** FIXME Those methods used fPID in the AOD track. Reimplement as an array of kin vars? ***
+ // It's also a bit ugly that I used a mixed approach here: some methods are commented, some other alifatal
+ // void GetHMPIDtrk(Float_t &x, Float_t &y, Float_t &th, Float_t &ph) const;
+ // void GetHMPIDmip(Float_t &x,Float_t &y,Int_t &q,Int_t &nph) const;
+ // Bool_t GetOuterHmpPxPyPz(Double_t *p) const;
+ // Int_t GetHMPIDcluIdx() const;// FIXME: array of ints?
+ // void GetITSdEdxSamples(Double_t s[4]) const; // FIXME: To be reimplemented. Use one kin var for each sample
+ Int_t GetTOFBunchCrossing(Double_t /*b=0*/, Bool_t /*tpcPIDonly=kFALSE*/) const {AliFatal("Not Implemented"); return 0;};
+ UChar_t GetTRDncls(Int_t /*layer*/) const {AliFatal("Not Implemented"); return 0;};
+ Double_t GetTRDslice(Int_t /*plane*/, Int_t /*slice*/) const {AliFatal("Not Implemented"); return 0;};
+ Double_t GetTRDmomentum(Int_t /*plane*/, Double_t */*sp*/=0x0) const {AliFatal("Not Implemented"); return 0;};
+ // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+ Double_t GetTRDsignal() const {return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTRDsignal());}
+ Double_t GetTRDchi2() const {return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTRDChi2());}
+ UChar_t GetTRDncls() const {return GetTRDncls(-1);}
+ Int_t GetNumberOfTRDslices() const { return GetVar(AliNanoAODTrackMapping::GetInstance()->GetTRDnSlices()); }
+
+ const AliAODEvent* GetAODEvent() const {return fAODEvent;}// FIXME: change to special event type
+ void SetAODEvent(const AliAODEvent* ptr){fAODEvent = ptr;}
+
+ AliAODVertex *GetProdVertex() const { return (AliAODVertex*)fProdVertex.GetObject(); } // FIXME: change to special vertex type
+
+ // print
+ void Print(const Option_t *opt = "") const;
+
+ // setters
+ // void SetFlags(ULong_t flags) { fFlags = flags; }
+ // void SetStatus(ULong_t flags) { fFlags|=flags; }
+ // void ResetStatus(ULong_t flags) { fFlags&=~flags; }
+
+ // void SetID(Short_t id) { fID = id; }
+ void SetLabel(Int_t label) { fLabel = label; }
+ // void SetTOFLabel(const Int_t* p);
+ template <typename T> void SetPosition(const T *x, Bool_t isDCA = kFALSE);
+ void SetDCA(Double_t d, Double_t z);
+ void SetUsedForVtxFit(Bool_t used = kTRUE) { used ? SetBit(AliAODTrack::kUsedForVtxFit) : ResetBit(AliAODTrack::kUsedForVtxFit); }
+ void SetUsedForPrimVtxFit(Bool_t used = kTRUE) { used ? SetBit(AliAODTrack::kUsedForPrimVtxFit) : ResetBit(AliAODTrack::kUsedForPrimVtxFit); }
+
+ void SetIsTPCOnly(Bool_t b = kTRUE) { SetIsTPCConstrained(b); }// obsolete bad naming
+
+ void SetIsTPCConstrained(Bool_t b = kTRUE) { b ? SetBit(AliAODTrack::kIsTPCConstrained) : ResetBit(AliAODTrack::kIsTPCConstrained); }
+ void SetIsHybridTPCConstrainedGlobal(Bool_t hybrid = kTRUE) { hybrid ? SetBit(AliAODTrack::kIsHybridTPCCG) : ResetBit(AliAODTrack::kIsHybridTPCCG); }
+
+ void SetIsGlobalConstrained(Bool_t b = kTRUE) { b ? SetBit(AliAODTrack::kIsGlobalConstrained) : ResetBit(AliAODTrack::kIsGlobalConstrained); }
+ void SetIsHybridGlobalConstrainedGlobal(Bool_t hybrid = kTRUE) { hybrid ? SetBit(AliAODTrack::kIsHybridGCG) : ResetBit(AliAODTrack::kIsHybridGCG); }
+
+
+
+ void SetOneOverPt(Double_t oneOverPt) { fVars[AliNanoAODTrackMapping::GetInstance()->GetPt()] = 1. / oneOverPt; }
+ void SetPt(Double_t pt) { fVars[AliNanoAODTrackMapping::GetInstance()->GetPt()] = pt; };
+ void SetPhi(Double_t phi) { fVars[AliNanoAODTrackMapping::GetInstance()->GetPhi()] = phi; }
+ void SetTheta(Double_t theta) { fVars[AliNanoAODTrackMapping::GetInstance()->GetTheta()] = theta; }
+ template <typename T> void SetP(const T *p, Bool_t cartesian = kTRUE);// TODO: WHAT IS THIS FOR?
+ void SetP() {AliFatal("Not Implemented");}
+
+ void SetXYAtDCA(Double_t x, Double_t y) {fVars[AliNanoAODTrackMapping::GetInstance()->GetPosDCAx()] = x; fVars[AliNanoAODTrackMapping::GetInstance()->GetPosDCAy()]= y;}
+ void SetPxPyPzAtDCA(Double_t pX, Double_t pY, Double_t pZ) {fVars[AliNanoAODTrackMapping::GetInstance()->GetPDCAX()] = pX; fVars[AliNanoAODTrackMapping::GetInstance()->GetPDCAY()] = pY; fVars[AliNanoAODTrackMapping::GetInstance()->GetPDCAZ()] = pZ;}
+
+void SetRAtAbsorberEnd(Double_t r) { fVars[AliNanoAODTrackMapping::GetInstance()->GetRAtAbsorberEnd()] = r; }
+
+ void SetCharge(Short_t q) { fCharge = q; }
+void SetChi2perNDF(Double_t chi2perNDF) { fVars[AliNanoAODTrackMapping::GetInstance()->GetChi2PerNDF()] = chi2perNDF; }
+
+ // void SetITSClusterMap(UChar_t itsClusMap) { fITSMuonClusterMap = (fITSMuonClusterMap&0xffffff00)|(((UInt_t)itsClusMap)&0xff); }
+ // void SetHitsPatternInTrigCh(UShort_t hitsPatternInTrigCh) { fITSMuonClusterMap = (fITSMuonClusterMap&0xffff00ff)|((((UInt_t)hitsPatternInTrigCh)&0xff)<<8); }
+ // void SetMuonClusterMap(UInt_t muonClusMap) { fITSMuonClusterMap = (fITSMuonClusterMap&0xfc00ffff)|((muonClusMap&0x3ff)<<16); }
+ // void SetITSMuonClusterMap(UInt_t itsMuonClusMap) { fITSMuonClusterMap = itsMuonClusMap; }
+ // void SetMUONtrigHitsMapTrg(UInt_t muonTrigHitsMap) { fMUONtrigHitsMapTrg = muonTrigHitsMap; }
+ // UInt_t GetMUONTrigHitsMapTrg() { return fMUONtrigHitsMapTrg; }
+ // void SetMUONtrigHitsMapTrk(UInt_t muonTrigHitsMap) { fMUONtrigHitsMapTrk = muonTrigHitsMap; }
+ // UInt_t GetMUONTrigHitsMapTrk() { return fMUONtrigHitsMapTrk; }
+
+ void SetProdVertex(TObject *vertex) { fProdVertex = vertex; }
+ // void SetType(AliAODTrack::AODTrk_t ttype) { fType=ttype; }// FIXME: what is this?
+
+ //
+
+
+ // Dummy: FIXME why is this dummy?
+ Int_t PdgCode() const {return 0;}
+
+ // needed to inherit from VTrack, but not implemented
+ virtual void SetDetectorPID(const AliDetectorPID */*pid*/) {AliFatal("Not Implemented"); return ;};
+ virtual const AliDetectorPID* GetDetectorPID() const {AliFatal("Not Implemented"); return 0;};
+ virtual UChar_t GetTRDntrackletsPID() const {AliFatal("Not Implemented"); return 0;};
+ virtual void GetHMPIDpid(Double_t */*p*/) const {AliFatal("Not Implemented"); return;};
+ virtual Double_t GetBz() const {AliFatal("Not Implemented"); return 0;};
+ virtual void GetBxByBz(Double_t [3]/*b[3]*/) const {AliFatal("Not Implemented"); return;};
+ virtual const AliExternalTrackParam * GetOuterParam() const {AliFatal("Not Implemented"); return 0;};
+ virtual const AliExternalTrackParam * GetInnerParam() const {AliFatal("Not Implemented"); return 0;};
+ virtual Int_t GetNcls(Int_t /*idet*/) const {AliFatal("Not Implemented"); return 0;};
+ virtual const Double_t *PID() const {AliFatal("Not Implemented"); return 0;};
+
+
+
+private :
+
+
+ // Remove everything from here on?
+
+ // Momentum & position
+ // FIXME: the following was replaced by posx, posy, posz. Check if the names make sense
+ // Double32_t fPosition[3]; // position of first point on track or dca
+ Int_t fLabel; // track label, points back to MC track
+ TRef fProdVertex; // vertex of origin
+ Short_t fCharge; // track charge
+ const AliAODEvent* fAODEvent; //!
+
+ ClassDef(AliNanoAODTrack, 1);
+};
+
+// inline Bool_t AliNanoAODTrack::IsPrimaryCandidate() const
+// {
+// // FIXME: reimplement
+// // True of track passes primary particle selection (independent of type)
+// //
+// if (fFilterMap) {
+// return kTRUE;
+// } else {
+// return kFALSE;
+// }
+// }
+
+// FIXME: is this needed?
+// inline Int_t AliNanoAODTrack::GetITSNcls() const
+// {
+// // Number of points in ITS
+// Int_t n=0;
+// for(Int_t i=0;i<6;i++) if(HasPointOnITSLayer(i)) n++;
+// return n;
+// }
+
+//______________________________________________________________________________
+template <typename T>
+void AliNanoAODTrack::SetPosition(const T *x, const Bool_t dca)
+{
+ // set the position
+
+ if (x) {
+ if (!dca) {
+ ResetBit(AliAODTrack::kIsDCA);
+
+ fVars[AliNanoAODTrackMapping::GetInstance()->GetPosX()] = x[0];
+ fVars[AliNanoAODTrackMapping::GetInstance()->GetPosY()] = x[1];
+ fVars[AliNanoAODTrackMapping::GetInstance()->GetPosZ()] = x[2];
+ } else {
+ SetBit(AliAODTrack::kIsDCA);
+ // don't know any better yet
+ fVars[AliNanoAODTrackMapping::GetInstance()->GetPosX()] = -999.;
+ fVars[AliNanoAODTrackMapping::GetInstance()->GetPosY()] = -999.;
+ fVars[AliNanoAODTrackMapping::GetInstance()->GetPosZ()] = -999.;
+ }
+ } else {
+ ResetBit(AliAODTrack::kIsDCA);
+
+ fVars[AliNanoAODTrackMapping::GetInstance()->GetPosX()] = -999.;
+ fVars[AliNanoAODTrackMapping::GetInstance()->GetPosY()] = -999.;
+ fVars[AliNanoAODTrackMapping::GetInstance()->GetPosZ()] = -999.;
+ }
+}
+
+//template<> void AliNanoAODTrack::SetPosition(const double *, Bool_t);
+
+
+
+
+#endif
--- /dev/null
+#include "AliNanoAODTrackMapping.h"
+#include "TString.h"
+#include "TObjArray.h"
+#include "TObjString.h"
+#include "AliLog.h"
+#include <iostream>
+
+
+ClassImp(AliNanoAODTrackMapping)
+
+AliNanoAODTrackMapping * AliNanoAODTrackMapping::fInstance = 0;
+TString AliNanoAODTrackMapping::fMappingString = "";
+
+AliNanoAODTrackMapping::AliNanoAODTrackMapping() :
+ TObject(),
+ fPt(-1),
+ fPhi(-1),
+ fTheta(-1),
+ fChi2PerNDF(-1),
+ fPosX(-1),
+ fPosY(-1),
+ fPosZ(-1),
+ fPDCAX(-1),
+ fPDCAY(-1),
+ fPDCAZ(-1),
+ fPosDCAx(-1),
+ fPosDCAy(-1),
+ fRAtAbsorberEnd(-1),
+ fTPCncls(-1),
+ fid(-1),
+ fTPCnclsF(-1),
+ fTPCNCrossedRows(-1),
+ fTrackPhiOnEMCal(-1),
+ fTrackEtaOnEMCal(-1),
+ fITSsignal(-1),
+ fTPCsignal(-1),
+ fTPCsignalTuned(-1),
+ fTPCsignalN(-1),
+ fTPCmomentum(-1),
+ fTPCTgl(-1),
+ fTOFsignal(-1),
+ fintegratedLenght(-1),
+ fTOFsignalTuned(-1),
+ fHMPIDsignal(-1),
+ fHMPIDoccupancy(-1),
+ fTRDsignal(-1),
+ fTRDChi2(-1),
+ fTRDnSlices(-1),
+ fcovmat(-1)
+
+{
+ // default ctor
+ std::cout << "Default constructor" << std::endl;
+}
+
+AliNanoAODTrackMapping::AliNanoAODTrackMapping(const char * mappingString) :
+ TObject(),
+ fPt(-1),
+ fPhi(-1),
+ fTheta(-1),
+ fChi2PerNDF(-1),
+ fPosX(-1),
+ fPosY(-1),
+ fPosZ(-1),
+ fPDCAX(-1),
+ fPDCAY(-1),
+ fPDCAZ(-1),
+ fPosDCAx(-1),
+ fPosDCAy(-1),
+ fRAtAbsorberEnd(-1),
+ fTPCncls(-1),
+ fid(-1),
+ fTPCnclsF(-1),
+ fTPCNCrossedRows(-1),
+ fTrackPhiOnEMCal(-1),
+ fTrackEtaOnEMCal(-1),
+ fITSsignal(-1),
+ fTPCsignal(-1),
+ fTPCsignalTuned(-1),
+ fTPCsignalN(-1),
+ fTPCmomentum(-1),
+ fTPCTgl(-1),
+ fTOFsignal(-1),
+ fintegratedLenght(-1),
+ fTOFsignalTuned(-1),
+ fHMPIDsignal(-1),
+ fHMPIDoccupancy(-1),
+ fTRDsignal(-1),
+ fTRDChi2(-1),
+ fTRDnSlices(-1),
+ fcovmat(-1)
+
+{
+ // ctor
+ //std::cout << "Standard construct " << mappingString << std::endl;
+
+ if (fInstance) {
+ AliWarning("Cannot instantiate this class twice");
+ if (fMappingString != mappingString) AliFatal ("Attempt to initialize with a differnt mapping string");
+ return ;
+ }
+ fMappingString = mappingString;
+
+ static const char * validatorString[] = {"pt", "theta", "phi", "chi2perNDF", "posx", "posy", "posz", "covmat", "posDCAx","posDCAy", "pDCAx", "pDCAy", "pDCAz", "RAtAbsorberEnd", "TPCnclsF", "TPCNCrossedRows", "TrackPhiOnEMCal", "TrackEtaOnEMCal", "TrackPtOnEMCal", "ITSsignal", "TPCsignal", "TPCsignalTuned", "TPCsignalN", "TPCmomentum", "TPCTgl", "TOFsignal", "integratedLenght", "TOFsignalTuned", "HMPIDsignal", "HMPIDoccupancy", "TRDsignal", "TRDChi2", "TRDnSlices", 0};
+
+ // Tokenize list of variables
+ TString varString(mappingString);
+ TObjArray * vars = varString.Tokenize(",");
+ // Allocate the internal array, based on size of the tokens array
+ fSize = vars->GetSize();
+ // Loop over all tokens, check sanity of the vars,
+ TIter it(vars);
+ TObjString *token = 0;
+ Int_t index=0;
+ while ((token = (TObjString*) it.Next())) {
+ TString var = token->GetString().Strip(TString::kBoth, ' '); // remove trailing and leading spaces
+ // Check if string ...
+ // ... is in the allowed list
+ Bool_t isValid = kFALSE;
+ Int_t ivalidator = 0;
+ while (validatorString[ivalidator]) {
+ if(var == validatorString[ivalidator++]) isValid = kTRUE;
+ }
+ //... it is custom
+ if (!( isValid || var.BeginsWith("cst")) ) AliFatal(Form("Invalid var [%s]", var.Data()));
+ // If the variable is valid, add it to the list. We have to create a new TObjstring because otherwise it is deleted with the tokens
+ if (var == "pt" ) fPt = index;
+ else if(var == "phi" ) fPhi = index;
+ else if(var == "theta" ) fTheta = index; // FIXME: consider adding a "eta" variable explicitly (possibly with a check for theta aldready there), so that you don't have to carry over also "theta" in case you only need eta.
+ else if(var == "chi2perNDF" ) fChi2PerNDF = index;
+ else if(var == "posx" ) fPosX = index;
+ else if(var == "posy" ) fPosY = index;
+ else if(var == "posz" ) fPosZ = index;
+ else if(var == "pDCAx" ) fPDCAX = index;
+ else if(var == "pDCAy" ) fPDCAY = index;
+ else if(var == "pDCAz" ) fPDCAZ = index;
+ else if(var == "posDCAx" ) fPosDCAx = index;
+ else if(var == "posDCAy" ) fPosDCAy = index;
+ else if(var == "RAtAbsorberEnd" ) fRAtAbsorberEnd = index;
+ else if(var == "TPCncls" ) fTPCncls = index;
+ else if(var == "id" ) fid = index;
+ else if(var == "TPCnclsF" ) fTPCnclsF = index;
+ else if(var == "TPCNCrossedRows" ) fTPCNCrossedRows = index;
+ else if(var == "TrackPhiOnEMCal" ) fTrackPhiOnEMCal = index;
+ else if(var == "TrackEtaOnEMCal" ) fTrackEtaOnEMCal = index;
+ else if(var == "TrackPtOnEMCal" ) fTrackPtOnEMCal = index;
+ else if(var == "ITSsignal" ) fITSsignal = index;
+ else if(var == "TPCsignal" ) fTPCsignal = index;
+ else if(var == "TPCsignalTuned" ) fTPCsignalTuned = index;
+ else if(var == "TPCsignalN" ) fTPCsignalN = index;
+ else if(var == "TPCmomentum" ) fTPCmomentum = index;
+ else if(var == "TPCTgl" ) fTPCTgl = index;
+ else if(var == "TOFsignal" ) fTOFsignal = index;
+ else if(var == "integratedLenght" ) fintegratedLenght = index;
+ else if(var == "TOFsignalTuned" ) fTOFsignalTuned = index;
+ else if(var == "HMPIDsignal" ) fHMPIDsignal = index;
+ else if(var == "HMPIDoccupancy" ) fHMPIDoccupancy = index;
+ else if(var == "TRDsignal" ) fTRDsignal = index;
+ else if(var == "TRDChi2" ) fTRDChi2 = index;
+ else if(var == "TRDnSlices" ) fTRDnSlices = index;
+ else if(var == "covmat" ) AliFatal("cov matrix To be implemented");
+ else {
+ fMapCstVar[var] = index;
+ std::cout << "ADDING " << index << " " << fMapCstVar[var] << " " << var.Data() << std::endl;
+
+ }
+
+ // init kin vars to 0
+ index++;
+ }
+ fSize = index;
+ if(vars) vars->Delete();
+
+ fInstance = this;
+
+}
+
+Int_t AliNanoAODTrackMapping::GetVarIndex(TString varName){
+
+ if (varName == "pt" ) return fPt ;
+ else if(varName == "phi" ) return fPhi ;
+ else if(varName == "theta" ) return fTheta ;
+ else if(varName == "chi2perNDF" ) return fChi2PerNDF ;
+ else if(varName == "posx" ) return fPosX ;
+ else if(varName == "posy" ) return fPosY ;
+ else if(varName == "posz" ) return fPosZ ;
+ else if(varName == "pDCAx" ) return fPDCAX ;
+ else if(varName == "pDCAy" ) return fPDCAY ;
+ else if(varName == "pDCAz" ) return fPDCAZ ;
+ else if(varName == "posDCAx" ) return fPosDCAx ;
+ else if(varName == "posDCAy" ) return fPosDCAy ;
+ else if(varName == "RAtAbsorberEnd" ) return fRAtAbsorberEnd ;
+ else if(varName == "TPCncls" ) return fTPCncls ;
+ else if(varName == "id" ) return fid ;
+ else if(varName == "TPCnclsF" ) return fTPCnclsF ;
+ else if(varName == "TPCNCrossedRows" ) return fTPCNCrossedRows ;
+ else if(varName == "TrackPhiOnEMCal" ) return fTrackPhiOnEMCal ;
+ else if(varName == "TrackEtaOnEMCal" ) return fTrackEtaOnEMCal ;
+ else if(varName == "TrackPtOnEMCal" ) return fTrackPtOnEMCal ;
+ else if(varName == "ITSsignal" ) return fITSsignal ;
+ else if(varName == "TPCsignal" ) return fTPCsignal ;
+ else if(varName == "TPCsignalTuned" ) return fTPCsignalTuned ;
+ else if(varName == "TPCsignalN" ) return fTPCsignalN ;
+ else if(varName == "TPCmomentum" ) return fTPCmomentum ;
+ else if(varName == "TPCTgl" ) return fTPCTgl ;
+ else if(varName == "TOFsignal" ) return fTOFsignal ;
+ else if(varName == "integratedLenght" ) return fintegratedLenght ;
+ else if(varName == "TOFsignalTuned" ) return fTOFsignalTuned ;
+ else if(varName == "HMPIDsignal" ) return fHMPIDsignal ;
+ else if(varName == "HMPIDoccupancy" ) return fHMPIDoccupancy ;
+ else if(varName == "TRDsignal" ) return fTRDsignal ;
+ else if(varName == "TRDChi2" ) return fTRDChi2 ;
+ else if(varName == "TRDnSlices" ) return fTRDnSlices ;
+
+ std::map<TString,Int_t>::iterator it = fMapCstVar.find(varName);
+ if(it != fMapCstVar.end()) {
+ //element found;
+ return it->second;
+ }
+
+ return -1;
+
+}
+
+const char * AliNanoAODTrackMapping::GetVarName(Int_t index) const {
+ // Get Variable name from index
+ if (index == fPt ) return "pt" ;
+ else if(index == fPhi ) return "phi" ;
+ else if(index == fTheta ) return "theta" ;
+ else if(index == fChi2PerNDF ) return "chi2perNDF" ;
+ else if(index == fPosX ) return "posx" ;
+ else if(index == fPosY ) return "posy" ;
+ else if(index == fPosZ ) return "posz" ;
+ else if(index == fPDCAX ) return "pDCAx" ;
+ else if(index == fPDCAY ) return "pDCAy" ;
+ else if(index == fPDCAZ ) return "pDCAz" ;
+ else if(index == fPosDCAx ) return "posDCAx" ;
+ else if(index == fPosDCAy ) return "posDCAy" ;
+ else if(index == fRAtAbsorberEnd ) return "RAtAbsorberEnd" ;
+ else if(index == fTPCncls ) return "TPCncls" ;
+ else if(index == fid ) return "id" ;
+ else if(index == fTPCnclsF ) return "TPCnclsF" ;
+ else if(index == fTPCNCrossedRows ) return "TPCNCrossedRows" ;
+ else if(index == fTrackPhiOnEMCal ) return "TrackPhiOnEMCal" ;
+ else if(index == fTrackEtaOnEMCal ) return "TrackEtaOnEMCal" ;
+ else if(index == fTrackPtOnEMCal ) return "TrackPtOnEMCal" ;
+ else if(index == fITSsignal ) return "ITSsignal" ;
+ else if(index == fTPCsignal ) return "TPCsignal" ;
+ else if(index == fTPCsignalTuned ) return "TPCsignalTuned" ;
+ else if(index == fTPCsignalN ) return "TPCsignalN" ;
+ else if(index == fTPCmomentum ) return "TPCmomentum" ;
+ else if(index == fTPCTgl ) return "TPCTgl" ;
+ else if(index == fTOFsignal ) return "TOFsignal" ;
+ else if(index == fintegratedLenght ) return "integratedLenght" ;
+ else if(index == fTOFsignalTuned ) return "TOFsignalTuned" ;
+ else if(index == fHMPIDsignal ) return "HMPIDsignal" ;
+ else if(index == fHMPIDoccupancy ) return "HMPIDoccupancy" ;
+ else if(index == fTRDsignal ) return "TRDsignal" ;
+ else if(index == fTRDChi2 ) return "TRDChi2" ;
+ else if(index == fTRDnSlices ) return "TRDnSlices" ;
+ if (index >= fSize) {
+ AliWarning(Form("Invalid index %d", index));
+ return "<Invalid index>";
+ }
+ else {
+ std::map<TString,Int_t>::const_iterator it ;
+ for (it = fMapCstVar.begin(); it != fMapCstVar.end(); ++it) {
+ if(it->second == index) return it->first.Data();
+ }
+ }
+ return "<YOU SHOULD NEVER GET THIS>";// Should never happen
+}
+
+void AliNanoAODTrackMapping::Print(const Option_t* /*opt*/) const {
+ std::cout << "Printing AliNanoAODTrackMapping" << std::endl;
+
+ for (Int_t ivar = 0; ivar<fSize; ivar++) {
+ std::cout << " " << ivar << " " << GetVarName(ivar) << std::endl;
+ }
+
+}
+
+
+void AliNanoAODTrackMapping::LoadInstance() {
+
+ if(!fInstance) { // try to get it from the current file
+ Printf("AliNanoAODTrackMapping::LoadInstance() instance from file");
+ // Try to get it from the UserInfo of the AOD tree; FIXME: shall we try to probe the Analysis manager?
+ // FIXME: to be implmented Otherwise, try to get it from the esdTree
+ TTree * tree = (TTree*)gDirectory->Get("aodTree") ? (TTree*)gDirectory->Get("aodTree"): (TTree*)gFile->Get("aodTree");
+ if(!tree) {
+ std::cout << "NO TREE?" << std::endl;
+ gDirectory->ls();
+ gFile->ls();
+ }
+
+
+ if(tree) {
+ tree->GetUserInfo()->Print();
+ fInstance = (AliNanoAODTrackMapping*) tree->GetUserInfo()->FindObject("AliNanoAODTrackMapping");
+ // Otherwise try to get it from the current directory
+ std::cout << " from tree: " << fInstance << std::endl;
+
+ }
+ if(!fInstance) fInstance = (AliNanoAODTrackMapping *) gDirectory->Get("AliNanoAODTrackMapping");
+ if(!fInstance) {
+ Printf("AliNanoAODTrackMapping::LoadInstance(): Not initialized and cannot find in current file");
+ gSystem->Exit(1);
+ }
+ }
+
+
+ }
--- /dev/null
+#ifndef _ALINANOAODTRACKMAPPING_H_
+#define _ALINANOAODTRACKMAPPING_H_
+
+#include "TObject.h"
+#include "TFile.h"
+#include "AliLog.h"
+#include "TSystem.h"
+#include "TTree.h"
+#include "TDirectory.h"
+
+class AliNanoAODTrackMapping : public TObject
+{
+public:
+ AliNanoAODTrackMapping();
+ AliNanoAODTrackMapping(const char * mappingString);
+ virtual ~AliNanoAODTrackMapping(){;}
+
+ void Print(const Option_t * opt = "") const;
+
+ static AliNanoAODTrackMapping * GetInstance() {
+ if(!fInstance) LoadInstance() ;
+ return fInstance;
+ }
+
+
+ const char * GetVarName(Int_t index) const;
+ Int_t GetVarIndex(TString varName); // cannot be const (uses stl map)
+
+ //TODO: implement custom variables
+
+ // Getters
+ // Internal
+ Int_t GetSize() const { return fSize; }
+ // Kin vars
+ Int_t GetPt() const { return fPt; }
+ Int_t GetPhi() const { return fPhi; }
+ Int_t GetTheta() const { return fTheta; }
+ Int_t GetChi2PerNDF() const { return fChi2PerNDF; }
+ Int_t GetPosX() const { return fPosX; }
+ Int_t GetPosY() const { return fPosY; }
+ Int_t GetPosZ() const { return fPosZ; }
+ Int_t GetPDCAX() const { return fPDCAX; }
+ Int_t GetPDCAY() const { return fPDCAY; }
+ Int_t GetPDCAZ() const { return fPDCAZ; }
+ Int_t GetPosDCAx() const { return fPosDCAx; }
+ Int_t GetPosDCAy() const { return fPosDCAy; }
+ Int_t GetRAtAbsorberEnd() const { return fRAtAbsorberEnd; }
+ Int_t GetTPCncls() const { return fTPCncls; }
+ Int_t Getid() const { return fid; }
+ Int_t GetTPCnclsF() const { return fTPCnclsF; }
+ Int_t GetTPCNCrossedRows() const { return fTPCNCrossedRows; }
+ Int_t GetTrackPhiOnEMCal() const { return fTrackPhiOnEMCal; }
+ Int_t GetTrackEtaOnEMCal() const { return fTrackEtaOnEMCal; }
+ Int_t GetTrackPtOnEMCal() const { return fTrackPtOnEMCal; }
+ Int_t GetITSsignal() const { return fITSsignal; }
+ Int_t GetTPCsignal() const { return fTPCsignal; }
+ Int_t GetTPCsignalTuned() const { return fTPCsignalTuned; }
+ Int_t GetTPCsignalN() const { return fTPCsignalN; }
+ Int_t GetTPCmomentum() const { return fTPCmomentum; }
+ Int_t GetTPCTgl() const { return fTPCTgl; }
+ Int_t GetTOFsignal() const { return fTOFsignal; }
+ Int_t GetintegratedLenght() const { return fintegratedLenght; }
+ Int_t GetTOFsignalTuned() const { return fTOFsignalTuned; }
+ Int_t GetHMPIDsignal() const { return fHMPIDsignal; }
+ Int_t GetHMPIDoccupancy() const { return fHMPIDoccupancy; }
+ Int_t GetTRDsignal() const { return fTRDsignal; }
+ Int_t GetTRDChi2() const { return fTRDChi2; }
+ Int_t GetTRDnSlices() const { return fTRDnSlices; }
+ Int_t Getcovmat() const { return fcovmat; }
+
+ // TODO: implement custom variables
+
+
+private:
+
+ static void LoadInstance() ;
+
+ Int_t fSize; // Number of variables actually allocated
+ void SetSize (Int_t var) { fSize = var;}
+ // FIXME: should this be static?
+ Int_t fPt; // Mapping variable
+ Int_t fPhi; // Mapping variable
+ Int_t fTheta; // Mapping variable
+ Int_t fChi2PerNDF; // Mapping variable
+ Int_t fPosX; // Mapping variable
+ Int_t fPosY; // Mapping variable
+ Int_t fPosZ; // Mapping variable
+ Int_t fPDCAX; // Mapping variable
+ Int_t fPDCAY; // Mapping variable
+ Int_t fPDCAZ; // Mapping variable
+ Int_t fPosDCAx; // Mapping variable
+ Int_t fPosDCAy; // Mapping variable
+ Int_t fRAtAbsorberEnd; // Mapping variable
+ Int_t fTPCncls; // Mapping variable
+ Int_t fid; // Mapping variable
+ Int_t fTPCnclsF; // Mapping variable
+ Int_t fTPCNCrossedRows; // Mapping variable
+ Int_t fTrackPhiOnEMCal; // Mapping variable
+ Int_t fTrackEtaOnEMCal; // Mapping variable
+ Int_t fTrackPtOnEMCal; // Mapping variable
+ Int_t fITSsignal; // Mapping variable
+ Int_t fTPCsignal; // Mapping variable
+ Int_t fTPCsignalTuned; // Mapping variable
+ Int_t fTPCsignalN; // Mapping variable
+ Int_t fTPCmomentum; // Mapping variable
+ Int_t fTPCTgl; // Mapping variable
+ Int_t fTOFsignal; // Mapping variable
+ Int_t fintegratedLenght;// Mapping variable
+ Int_t fTOFsignalTuned; // Mapping variable
+ Int_t fHMPIDsignal; // Mapping variable
+ Int_t fHMPIDoccupancy; // Mapping variable
+ Int_t fTRDsignal; // Mapping variable
+ Int_t fTRDChi2; // Mapping variable
+ Int_t fTRDnSlices; // Mapping variable
+ Int_t fcovmat; // Mapping variable
+
+ // Setters are private because we don't want the mapping to change once the class has been instantiated
+ void SetPt (Int_t var) { fPt = var; }
+ void SetPhi (Int_t var) { fPhi = var; }
+ void SetTheta (Int_t var) { fTheta = var; }
+ void SetChi2PerNDF (Int_t var) { fChi2PerNDF = var; }
+ void SetPosX (Int_t var) { fPosX = var; }
+ void SetPosY (Int_t var) { fPosY = var; }
+ void SetPosZ (Int_t var) { fPosZ = var; }
+ void SetPDCAX (Int_t var) { fPDCAX = var; }
+ void SetPDCAY (Int_t var) { fPDCAY = var; }
+ void SetPDCAZ (Int_t var) { fPDCAZ = var; }
+ void SetPosDCAx (Int_t var) { fPosDCAx = var; }
+ void SetPosDCAy (Int_t var) { fPosDCAy = var; }
+ void SetRAtAbsorberEnd (Int_t var) { fRAtAbsorberEnd = var; }
+ void SetTPCncls (Int_t var) { fTPCncls = var; }
+ void Setid (Int_t var) { fid = var; }
+ void SetTPCnclsF (Int_t var) { fTPCnclsF = var; }
+ void SetTPCNCrossedRows (Int_t var) { fTPCNCrossedRows = var; }
+ void SetTrackPhiOnEMCal (Int_t var) { fTrackPhiOnEMCal = var; }
+ void SetTrackEtaOnEMCal (Int_t var) { fTrackEtaOnEMCal = var; }
+ void SetTrackPtOnEMCal (Int_t var) { fTrackPtOnEMCal = var; }
+ void SetITSsignal (Int_t var) { fITSsignal = var; }
+ void SetTPCsignal (Int_t var) { fTPCsignal = var; }
+ void SetTPCsignalTuned (Int_t var) { fTPCsignalTuned = var; }
+ void SetTPCsignalN (Int_t var) { fTPCsignalN = var; }
+ void SetTPCmomentum (Int_t var) { fTPCmomentum = var; }
+ void SetTPCTgl (Int_t var) { fTPCTgl = var; }
+ void SetTOFsignal (Int_t var) { fTOFsignal = var; }
+ void SetintegratedLenght (Int_t var) { fintegratedLenght = var; }
+ void SetTOFsignalTuned (Int_t var) { fTOFsignalTuned = var; }
+ void SetHMPIDsignal (Int_t var) { fHMPIDsignal = var; }
+ void SetHMPIDoccupancy (Int_t var) { fHMPIDoccupancy = var; }
+ void SetTRDsignal (Int_t var) { fTRDsignal = var; }
+ void SetTRDChi2 (Int_t var) { fTRDChi2 = var; }
+ void SetTRDnSlices (Int_t var) { fTRDnSlices = var; }
+ void Setcovmat (Int_t var) { fcovmat = var; }
+
+ static AliNanoAODTrackMapping * fInstance; //instance, needed for the singleton implementation
+ static TString fMappingString; // the string which this class was initialized with
+ std::map<TString,int> fMapCstVar;// Map of indexes of custom variables: CASH THIS TO CONST INTs IN YOUR TASK TO AVOID CONTINUOUS STRING COMPARISONS
+ ClassDef(AliNanoAODTrackMapping, 1)
+
+};
+
+#endif /* _ALINANOAODTRACKMAPPING_H_ */
--- /dev/null
+This folder and library is supposed to be used only for a large scale testing of a prototype nanoAOD implementation.
+Please do not use it for any real work until is in "devel" stage.
+
+Michele Floris, March 6, 2014
--- /dev/null
+#if !defined (__CINT__) || (defined(__MAKECINT__))
+#include <iostream>
+#include "AliAnalysisGrid.h"
+#include "TSystem.h"
+#include "TROOT.h"
+#include "AliAnalysisManager.h"
+#include "AliAnalysisGrid.h"
+#include "AliVEventHandler.h"
+#include "AliAODInputHandler.h"
+#include "AliAnalysisAlien.h"
+#include "AliMCEventHandler.h"
+#include "AliPhysicsSelectionTask.h"
+#include "TRegexp.h"
+#include "AliTriggerAnalysis.h"
+#include "TChain.h"
+#include "AliAnalysisTaskPIDResponse.h"
+#include "AliAODHandler.h"
+#include "AliAnalysisTaskNanoAODFilter.h"
+#include "AliESEHelpers.h"
+
+#endif
+void LoadLibs();
+
+class AliAnalysisGrid;
+class AliESETrkCut;
+class AliESEEvtCut;
+
+AliESETrkCut * TrkCuts() {
+
+ AliESETrkCut * trk = new AliESETrkCut;
+
+ AliSpectraAODTrackCuts * trcuts = new AliSpectraAODTrackCuts("TrackCuts");
+ trcuts->SetDCA(100000);
+ trcuts->SetTrackBits(1);
+ trcuts->SetPt(50);
+ trcuts->SetPtTOFMatching(0.6);
+ trcuts->SetEta(-0.8,0.8);
+ trcuts->SetMinTPCcls(70);
+ trcuts->PrintCuts();
+
+ trk->SetTrackCuts(trcuts);
+ trk->Init();
+
+ return trk;
+
+}
+
+AliESEEvtCut * EvtCuts(Int_t mc) {
+
+ AliESEEvtCut * evt = new AliESEEvtCut;
+
+ AliSpectraAODEventCuts * evcuts = new AliSpectraAODEventCuts("EventCuts");
+ evcuts->SetQVectorCut(0,100);
+ evcuts->SetCentralityCutMax(100);
+ evcuts->SetCentralityCutMin(0);
+ if(mc>0)evcuts->SetIsMC(kTRUE);
+ TFile * fCalib = new TFile("./calibV0New.root");
+ evcuts->SetCalibFile(fCalib);
+ evcuts->SetIsLHC10h(kTRUE);
+ evcuts->PrintCuts();
+ // evcuts->SetEventSelectionBit(AliVEvent::kAny);
+
+ evt->SetEventCuts(evcuts);
+ evt->Init();
+
+ return evt;
+
+}
+
+//______________________________________________________________________________
+void runLocalESE(
+ const int iMCtruth = 2,
+ const char * addTaskString = ".x AddTaskNanoAODFilter.C(%d,1)" //
+ )
+{
+ LoadLibs();
+ // analysis manager
+ AliAnalysisManager* mgr = new AliAnalysisManager("NanoAOD Filter", "NanoAOD filter for nanoAOD production");
+
+ AliAODInputHandler* iH = new AliAODInputHandler();
+ mgr->SetInputEventHandler(iH);
+
+ // Define aod output handler
+ AliAODHandler* aodOutputHandler = new AliAODHandler();
+ aodOutputHandler->SetOutputFileName("AliAOD.NanoAOD.root");
+ mgr->SetOutputEventHandler(aodOutputHandler);
+
+ gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
+ AliAnalysisTaskPIDResponse *taskPID=AddTaskPIDResponse(iMCtruth);
+ taskPID->SetUseTPCEtaCorrection(kTRUE);
+
+ // create task
+ cout << "Macro: "<< addTaskString << " " << Form(addTaskString, iMCtruth) << endl;
+
+ AliAnalysisTaskNanoAODFilter * task = (AliAnalysisTaskNanoAODFilter*) gROOT->ProcessLine(Form(addTaskString, iMCtruth));
+
+ // Set Track event and vertex cuts here!
+ task->SetVarList("pt,theta,phi,cstNSigmaTPCPi,cstNSigmaTPCKa,cstNSigmaTPCPr,cstNSigmaTOFPi,cstNSigmaTOFKa,cstNSigmaTOFPr,cstBayesTPCPi,cstBayesTPCKa,cstBayesTPCPr,cstBayesTOFPi,cstBayesTOFKa,cstBayesTOFPr");
+ task->SetVarListHead("cstCentr,cstQVec");
+ AliESETrkCut * trkCuts = TrkCuts();
+ AliESEEvtCut * evtCuts = EvtCuts(iMCtruth);
+ evtCuts->SetTrackCuts(trkCuts->GetTrackCuts());
+ AliAnalysisESESetter * setter = new AliAnalysisESESetter;
+ setter->SetEventCuts(evtCuts->GetEventCuts());
+
+ task->SetTrkCuts(trkCuts);
+ task->SetEvtCuts(evtCuts);
+ task->SetSetter(setter);
+
+ //task->SelectCollisionCandidates(AliVEvent::kMB);// FIXME
+ // enable debug printouts
+ mgr->SetDebugLevel(10);
+ // mgr->SetNSysInfo(100);
+ if (!mgr->InitAnalysis()) return;
+ mgr->PrintStatus();
+
+ // start analysis
+ // Always read the same file:
+ TChain * chain = new TChain("aodTree");
+ chain->Add("./AliAOD.root");
+
+ Printf("Starting Analysis....");
+ mgr->StartAnalysis("local", chain,123456789);
+
+}
+
+//______________________________________________________________________________
+
+void LoadLibs() {
+ gSystem->Load("libCore.so");
+ gSystem->Load("libGeom.so");
+ gSystem->Load("libPhysics.so");
+ gSystem->Load("libVMC");
+ gSystem->Load("libTree");
+ gSystem->Load("libProof");
+ gSystem->Load("libMatrix");
+ gSystem->Load("libMinuit");
+ gSystem->Load("libSTEERBase");
+ gSystem->Load("libESD");
+ gSystem->Load("libAOD");
+ gSystem->Load("libANALYSIS");
+ // return;
+ gSystem->Load("libOADB");
+ gSystem->Load("libANALYSISalice");
+ gSystem->Load("libTENDER");
+ gSystem->Load("libCORRFW");
+
+ // gSystem->Load("libNanoAOD.so");
+ gSystem->Load("libPWGLFspectra");
+ gSystem->Load("libPWGDevNanoAOD");
+
+}
--- /dev/null
+#ifdef __CINT__
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class AliNanoAODReplicator+;
+#pragma link C++ class AliNanoAODTrackMapping+;
+#pragma link C++ class AliNanoAODTrack+;
+#pragma link C++ class AliAnalysisTaskNanoAODFilter+;
+#pragma link C++ class AliNanoAODStorage+;
+#pragma link C++ class AliNanoAODHeader+;
+#pragma link C++ class AliNanoAODCustomSetter+;
+#pragma link C++ class AliAnalysisNanoAODTrackCuts+;
+#pragma link C++ class AliAnalysisNanoAODEventCuts+;
+// Custom ESE classes: to be removed once the library is not in dev mode any more
+#pragma link C++ class AliESEEvtCut+;
+#pragma link C++ class AliESETrkCut+;
+#pragma link C++ class AliAnalysisESESetter+;
+
+
+
+#endif