#pragma link C++ class AliAnalysisTaskME+;
#pragma link C++ class AliAnalysisTaskESDfilter+;
#pragma link C++ class AliAnalysisTaskKineFilter+;
+#pragma link C++ class AliAnalysisTaskMCParticleFilter+;
#pragma link C++ class AliAnalysisTaskTagCreator+;
#pragma link C++ class AliKineTrackCuts+;
#pragma link C++ class AliESDtrackCuts+;
#include <TList.h>
#include <TArrayI.h>
#include <TRandom.h>
+#include <TParticle.h>
#include "AliAnalysisTaskESDfilter.h"
#include "AliAnalysisManager.h"
#include "AliESDEvent.h"
+#include "AliStack.h"
#include "AliAODEvent.h"
+#include "AliMCEvent.h"
+#include "AliMCEventHandler.h"
#include "AliESDInputHandler.h"
#include "AliAODHandler.h"
+#include "AliAODMCParticle.h"
#include "AliAnalysisFilter.h"
#include "AliESDMuonTrack.h"
#include "AliESDVertex.h"
if (fDebug > 0) printf("Filter: Analysing event # %5d\n", (Int_t) ientry);
if (fHighPthreshold == 0) AliInfo("detector PID signals are stored in each track");
if (!fPtshape) AliInfo("detector PID signals are not stored below the pt threshold");
+
ConvertESDtoAOD();
}
void AliAnalysisTaskESDfilter::ConvertESDtoAOD() {
// ESD Filter analysis task executed for each event
+
AliESDEvent* esd = dynamic_cast<AliESDEvent*>(InputEvent());
AliESD* old = esd->GetAliESDOld();
-
+
+ // Fetch Stack for debuggging if available
+ AliStack *pStack = 0;
+ AliMCEventHandler *mcH = 0;
+ if(MCEvent()){
+ pStack = MCEvent()->Stack();
+ mcH = (AliMCEventHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetMCtruthEventHandler());
+ }
// set arrays and pointers
Float_t posF[3];
Double_t pos[3];
for (Int_t i = 0; i < 21; i++) covTr [i] = 0.;
- // loop over events and fill them
-
- // Multiplicity information needed by the header (to be revised!)
+ // loop over events and fill them
+
+ // Multiplicity information needed by the header (to be revised!)
Int_t nTracks = esd->GetNumberOfTracks();
// if (fDebug > 0) printf("-------------------Bo: Number of ESD tracks %d \n",nTracks);
selectInfo = fTrackFilter->IsSelected(esdTrack);
}
+ if(mcH)mcH->SelectParticle(esdTrack->GetLabel());
vV0FromCascade->AddDaughter(aodTrack =
new(tracks[jTracks++]) AliAODTrack(esdTrack->GetID(),
esdTrack->GetLabel(),
esdTrack->GetESDpid(pid);
UInt_t selectInfo = 0;
if (fTrackFilter) selectInfo = fTrackFilter->IsSelected(esdTrack);
-
+ if(mcH)mcH->SelectParticle(esdTrack->GetLabel());
vV0FromCascade->AddDaughter(aodTrack =
new(tracks[jTracks++]) AliAODTrack(esdTrack->GetID(),
esdTrack->GetLabel(),
esdTrack->GetESDpid(pid);
UInt_t selectInfo = 0;
if (fTrackFilter) selectInfo = fTrackFilter->IsSelected(esdTrack);
-
+
+ if(mcH)mcH->SelectParticle(esdTrack->GetLabel());
vcascade->AddDaughter(aodTrack =
new(tracks[jTracks++]) AliAODTrack(esdTrack->GetID(),
esdTrack->GetLabel(),
usedTrack[posFromV0] = kTRUE;
UInt_t selectInfo = 0;
if (fTrackFilter) selectInfo = fTrackFilter->IsSelected(esdV0Pos);
+ if(mcH)mcH->SelectParticle(esdV0Pos->GetLabel());
aodTrack = new(tracks[jTracks++]) AliAODTrack(esdV0Pos->GetID(),
esdV0Pos->GetLabel(),
p_pos,
usedTrack[negFromV0] = kTRUE;
UInt_t selectInfo = 0;
if (fTrackFilter) selectInfo = fTrackFilter->IsSelected(esdV0Neg);
+ if(mcH)mcH->SelectParticle(esdV0Neg->GetLabel());
aodTrack = new(tracks[jTracks++]) AliAODTrack(esdV0Neg->GetID(),
esdV0Neg->GetLabel(),
p_neg,
esdTrackM->GetXYZ(pos);
esdTrackM->GetCovarianceXYZPxPyPz(covTr);
esdTrackM->GetESDpid(pid);
-
+ if(mcH)mcH->SelectParticle(esdTrackM->GetLabel());
mother =
new(tracks[jTracks++]) AliAODTrack(esdTrackM->GetID(),
esdTrackM->GetLabel(),
esdTrackD->GetESDpid(pid);
selectInfo = 0;
if (fTrackFilter) selectInfo = fTrackFilter->IsSelected(esdTrackD);
+ if(mcH)mcH->SelectParticle(esdTrackD->GetLabel());
daughter =
new(tracks[jTracks++]) AliAODTrack(esdTrackD->GetID(),
esdTrackD->GetLabel(),
esdTrack->GetXYZ(pos);
esdTrack->GetCovarianceXYZPxPyPz(covTr);
esdTrack->GetESDpid(pid);
-
-
+ if(mcH)mcH->SelectParticle(esdTrack->GetLabel());
primary->AddDaughter(aodTrack =
new(tracks[jTracks++]) AliAODTrack(esdTrack->GetID(),
esdTrack->GetLabel(),
kTRUE, // check if this is right
AliAODTrack::kPrimary,
selectInfo)
- );
+ );
aodRefs->AddAt(aodTrack, nTrack);
if (esdTrack->GetSign() > 0) nPosTracks++;
Int_t nLabel = cluster->GetNLabels();
TArrayI* labels = cluster->GetLabels();
Int_t *label = 0;
- if (labels) label = (cluster->GetLabels())->GetArray();
+ if (labels){
+ label = (cluster->GetLabels())->GetArray();
+ for(int i = 0;i < labels->GetSize();++i){
+ if(mcH)mcH->SelectParticle(label[i]);
+ }
+ }
Float_t energy = cluster->E();
cluster->GetPosition(posF);
SPDTracklets.CreateContainer(mult->GetNumberOfTracklets());
for (Int_t n=0; n<mult->GetNumberOfTracklets(); n++) {
- SPDTracklets.SetTracklet(n, mult->GetTheta(n), mult->GetPhi(n), mult->GetDeltaPhi(n), mult->GetLabel(n, 0), mult->GetLabel(n, 1));
+ if(mcH){
+ mcH->SelectParticle(mult->GetLabel(n, 0));
+ mcH->SelectParticle(mult->GetLabel(n, 1));
+ }
+ SPDTracklets.SetTracklet(n, mult->GetTheta(n), mult->GetPhi(n), mult->GetDeltaPhi(n), mult->GetLabel(n, 0),mult->GetLabel(n, 1));
}
}
} else {
if (fDebug > 1) printf("AnalysisESDfilter: Terminate() \n");
}
+void AliAnalysisTaskESDfilter::PrintMCInfo(AliStack *pStack,Int_t label){
+ if(!pStack)return;
+ label = TMath::Abs(label);
+ TParticle *part = pStack->Particle(label);
+ Printf("########################");
+ Printf("%s:%d %d UniqueID %d PDG %d P %3.3f",(char*)__FILE__,__LINE__,label,part->GetUniqueID(),part->GetPdgCode(),part->P());
+ part->Print();
+ TParticle* mother = part;
+ Int_t imo = part->GetFirstMother();
+ Int_t nprim = pStack->GetNprimary();
+ // while((imo >= nprim) && (mother->GetUniqueID() == 4)) {
+ while((imo >= nprim)) {
+ mother = pStack->Particle(imo);
+ Printf("Mother %s:%d Label %d UniqueID %d PDG %d P %3.3f",(char*)__FILE__,__LINE__,imo,mother->GetUniqueID(),mother->GetPdgCode(),mother->P());
+ mother->Print();
+ imo = mother->GetFirstMother();
+ }
+ Printf("########################");
+}
#include "AliAODTrack.h"
#include "AliAODPid.h"
class AliAnalysisFilter;
+class AliStack;
+
class AliAnalysisTaskESDfilter : public AliAnalysisTaskSE
private:
AliAnalysisTaskESDfilter(const AliAnalysisTaskESDfilter&);
AliAnalysisTaskESDfilter& operator=(const AliAnalysisTaskESDfilter&);
+ void PrintMCInfo(AliStack *pStack,Int_t label); // for debugging
+
// Filtering
AliAnalysisFilter* fTrackFilter; // Track Filter
AliAnalysisFilter* fKinkFilter; // Kink Filter
// PID
Double_t fHighPthreshold; // Pt threshold for detector signal setting
TF1 * fPtshape; // Pt spectrum distribution
- ClassDef(AliAnalysisTaskESDfilter, 1); // Analysis task for standard ESD filtering
+ ClassDef(AliAnalysisTaskESDfilter, 2); // Analysis task for standard ESD filtering
};
#endif
--- /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. *
+ **************************************************************************/
+
+//
+// Analysis task for Kinematic filtering
+// Fill AODtrackMC tracks from Kinematic stack
+//
+
+#include <TChain.h>
+#include <TFile.h>
+#include "TParticle.h"
+#include "TString.h"
+
+#include "AliAnalysisTaskMCParticleFilter.h"
+#include "AliAnalysisManager.h"
+#include "AliAnalysisFilter.h"
+#include "AliHeader.h"
+#include "AliStack.h"
+#include "AliMCEvent.h"
+#include "AliMCEventHandler.h"
+#include "AliAODEvent.h"
+#include "AliAODHeader.h"
+#include "AliAODHandler.h"
+#include "AliAODVertex.h"
+#include "AliAODMCParticle.h"
+
+
+#include "AliLog.h"
+
+ClassImp(AliAnalysisTaskMCParticleFilter)
+
+////////////////////////////////////////////////////////////////////////
+
+//____________________________________________________________________
+AliAnalysisTaskMCParticleFilter::AliAnalysisTaskMCParticleFilter():
+AliAnalysisTaskSE(),
+ fTrackFilterMother(0x0)
+{
+ // Default constructor
+}
+
+//____________________________________________________________________
+AliAnalysisTaskMCParticleFilter::AliAnalysisTaskMCParticleFilter(const char* name):
+ AliAnalysisTaskSE(name),
+ fTrackFilterMother(0x0)
+{
+ // Default constructor
+}
+
+
+//____________________________________________________________________
+AliAnalysisTaskMCParticleFilter::AliAnalysisTaskMCParticleFilter(const AliAnalysisTaskMCParticleFilter& obj):
+ AliAnalysisTaskSE(obj),
+ fTrackFilterMother(obj.fTrackFilterMother)
+{
+ // Copy constructor
+}
+
+//____________________________________________________________________
+AliAnalysisTaskMCParticleFilter::~AliAnalysisTaskMCParticleFilter()
+{
+ // if( fTrackFilterMother ) delete fTrackFilterMother;
+}
+
+
+//____________________________________________________________________
+AliAnalysisTaskMCParticleFilter& AliAnalysisTaskMCParticleFilter::operator=(const AliAnalysisTaskMCParticleFilter& other)
+{
+// Assignment
+ if(this!=&other) {
+ AliAnalysisTaskSE::operator=(other);
+ fTrackFilterMother = other.fTrackFilterMother;
+ }
+ return *this;
+}
+
+//____________________________________________________________________
+void AliAnalysisTaskMCParticleFilter::UserCreateOutputObjects()
+{
+ // Create the output container
+ if (OutputTree()&&fTrackFilterMother)
+ OutputTree()->GetUserInfo()->Add(fTrackFilterMother);
+ // how is this is reset cleared in the UserExec....
+ // Can this be handled by the framework?
+ TClonesArray *tca = new TClonesArray("AliAODMCParticle", 0);
+ tca->SetName(AliAODMCParticle::StdBranchName());
+ AddAODBranch("TClonesArray",&tca);
+ AliMCEventHandler *mcH = (AliMCEventHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetMCtruthEventHandler());
+
+ AliAODHandler *aodH = dynamic_cast<AliAODHandler*> ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
+ if(!aodH){
+ Printf("%s:&d Could not get AODHandler",(char*)__FILE__,__LINE__);
+ return;
+ }
+ aodH->SetMCEventHandler(mcH);
+ // TODO ADD MC VERTEX
+
+}
+
+//____________________________________________________________________
+void AliAnalysisTaskMCParticleFilter::UserExec(Option_t */*option*/)
+{
+// Execute analysis for current event
+//
+
+// Fill AOD tracks from Kinematic stack
+
+ // get AliAOD Event
+ AliAODEvent* aod = AODEvent();
+ if (!aod) {
+ AliWarning("No Output Handler connected, doing nothing !") ;
+ return;
+ }
+
+ AliMCEventHandler *mcH = (AliMCEventHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetMCtruthEventHandler());
+ if(!mcH){
+ AliWarning("No MC handler Found");
+ return;
+ }
+
+
+ // fetch the output
+ // Fill control histos
+
+ // tmp array for holding the mctracks
+ // need to set mother and duagther __before__
+ // filling in the tree
+
+ AliMCEvent *mcE = MCEvent();
+
+ if(!mcE){
+ AliWarning("No MC event Found");
+ return;
+ }
+
+ AliStack* stack = mcE->Stack();
+ Int_t np = mcE->GetNumberOfTracks();
+ Int_t nprim = stack->GetNprimary();
+ // TODO ADD MC VERTEX
+
+ // We take all real primaries
+
+
+
+ Int_t j=0;
+ for (Int_t ip = 0; ip < np; ip++){
+ AliMCParticle* mcpart = mcE->GetTrack(ip);
+ TParticle* part = mcpart->Particle();
+
+ Float_t xv = part->Vx();
+ Float_t yv = part->Vy();
+ Float_t zv = part->Vz();
+ Float_t rv = TMath::Sqrt(xv * xv + yv * yv);
+
+ Bool_t write = kFALSE;
+ Int_t flag = 0;
+
+
+ if (ip < nprim) {
+ // Select the primary event
+ write = kTRUE;
+ } else if (part->GetUniqueID() == 4) {
+ // Particles from decay
+ // Check that the decay chain ends at a primary particle
+ TParticle* mother = part;
+ Int_t imo = part->GetFirstMother();
+ while((imo >= nprim) && (mother->GetUniqueID() == 4)) {
+ mother = mcE->Stack()->Particle(imo);
+ imo = mother->GetFirstMother();
+ }
+ // Select according to pseudorapidity and production point
+ if (imo < nprim && Select(mother, rv, zv))
+ write = kTRUE;
+ } else if (part->GetUniqueID() == 5) {
+ // Now look for pair production
+ continue;
+ Int_t imo = part->GetFirstMother();
+ if (imo < nprim) {
+ // Select, if the gamma is a primary
+ write = kTRUE;
+ } else {
+ // Check if the gamma comes from the decay chain of a primary particle
+ TParticle* mother = mcE->Stack()->Particle(imo);
+ imo = mother->GetFirstMother();
+ while((imo >= nprim) && (mother->GetUniqueID() == 4)) {
+ mother = mcE->Stack()->Particle(imo);
+ imo = mother->GetFirstMother();
+ }
+ // Select according to pseudorapidity and production point
+ if (imo < nprim && Select(mother, rv, zv))
+ write = kTRUE;
+ }
+ }
+ /*
+ else if (part->GetUniqueID() == 13){
+ // Evaporation
+ // Check that we end at a primary particle
+ TParticle* mother = part;
+ Int_t imo = part->GetFirstMother();
+ while((imo >= nprim) && ((mother->GetUniqueID() == 4 ) || ( mother->GetUniqueID() == 13))) {
+ mother = mcE->Stack()->Particle(imo);
+ imo = mother->GetFirstMother();
+ }
+ // Select according to pseudorapidity and production point
+ if (imo < nprim && Select(mother, rv, zv))
+ write = kTRUE;
+ }
+ */
+ if (write) {
+ if(mcH)mcH->SelectParticle(ip);
+ j++;
+ }
+ }
+
+ return;
+}
+
+Bool_t AliAnalysisTaskMCParticleFilter::Select(TParticle* part, Float_t rv, Float_t zv)
+{
+ // Selection accoring to eta of the mother and production point
+ // This has to be refined !!!!!!
+
+ // Esp if we don't have collisison in the central barrel but e.g. beam gas
+ // return kTRUE;
+
+ Float_t eta = part->Eta();
+
+ // central barrel consider everything in the ITS...
+ // large eta window for smeared vertex and SPD acceptance (2 at z = 0)
+ // larger for V0s in the TPC
+ // if (TMath::Abs(eta) < 2.5 && rv < 250. && TMath::Abs(zv)<255)return kTRUE;
+
+ // Andreas' Cuts
+ if (TMath::Abs(eta) < 1. && rv < 170)return kTRUE;
+
+ // Muon arm
+ if(eta > -4.2 && eta < -2.3 && zv > -500.)return kTRUE; // Muon arms
+
+ // PMD acceptance 2.3 <= eta < = 3.5
+ // if(eta>2.0&&eta<3.7)return kTRUE;
+
+ return kFALSE;
+
+}
+
--- /dev/null
+#ifndef ALIANALYSISTASKMCPARTICLEFILTER_H
+#define ALIANALYSISTASKMCPARTICLEFILTER_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+//
+// Analysis task for Kinematic filtering
+// Fill AOD tracks from Kinematic stack
+//
+
+#include <TList.h>
+#include "AliAnalysisTaskSE.h"
+
+class AliAnalysisFilter;
+class TString;
+
+class AliAnalysisTaskMCParticleFilter : public AliAnalysisTaskSE
+{
+ public:
+ AliAnalysisTaskMCParticleFilter();
+ AliAnalysisTaskMCParticleFilter( const char* name );
+ AliAnalysisTaskMCParticleFilter(const AliAnalysisTaskMCParticleFilter& obj);
+ virtual ~AliAnalysisTaskMCParticleFilter();
+ AliAnalysisTaskMCParticleFilter& operator=(const AliAnalysisTaskMCParticleFilter& other);
+
+ // Implementation of interface methods
+ virtual void UserCreateOutputObjects();
+ virtual void UserExec( Option_t *option );
+
+ // Setters
+ virtual void SetTrackFilterMother(AliAnalysisFilter* trackF) { fTrackFilterMother = trackF; }
+
+ private:
+ Bool_t Select(TParticle* part, Float_t rv, Float_t zv);
+
+ AliAnalysisFilter* fTrackFilterMother; // Track Filter
+
+ ClassDef( AliAnalysisTaskMCParticleFilter, 1 ); // Analysis task for Kinematic filtering
+};
+
+#endif
#-*- Mode: Makefile -*-
SRCS = AliAnalysisTaskSE.cxx AliAnalysisTaskME.cxx \
- AliAnalysisTaskESDfilter.cxx AliAnalysisTaskKineFilter.cxx \
+ AliAnalysisTaskESDfilter.cxx AliAnalysisTaskKineFilter.cxx AliAnalysisTaskMCParticleFilter.cxx \
AliKineTrackCuts.cxx AliESDtrackCuts.cxx AliESDv0Cuts.cxx \
AliEventPoolOTF.cxx AliEventPoolLoop.cxx AliEventPoolSparse.cxx \
AliAnalysisTaskTagCreator.cxx
#pragma link C++ class AliAODTagCreator+;
#pragma link C++ class AliAODCaloCells+;
#pragma link C++ class AliAODDiJet+;
-
+#pragma link C++ class AliAODMCParticle+;
#endif
#include <TTree.h>
#include <TFile.h>
#include <TString.h>
+#include <TExMap.h>
+#include "AliLog.h"
#include "AliAODHandler.h"
#include "AliAODEvent.h"
+#include "AliAODTracklets.h"
+#include "AliStack.h"
+#include "AliAODMCParticle.h"
+#include "AliMCEventHandler.h"
+#include "AliMCEvent.h"
ClassImp(AliAODHandler)
AliAODHandler::AliAODHandler() :
AliVEventHandler(),
fIsStandard(kTRUE),
+ fFillAOD(kTRUE),
fNeedsHeaderReplication(kFALSE),
fNeedsTracksBranchReplication(kFALSE),
fNeedsVerticesBranchReplication(kFALSE),
fNeedsCaloClustersBranchReplication(kFALSE),
fAODIsReplicated(kFALSE),
fAODEvent(NULL),
+ fMCEventH(NULL),
fTreeA(NULL),
fFileA(NULL),
fFileName("")
AliAODHandler::AliAODHandler(const char* name, const char* title):
AliVEventHandler(name, title),
fIsStandard(kTRUE),
+ fFillAOD(kTRUE),
fNeedsHeaderReplication(kFALSE),
fNeedsTracksBranchReplication(kFALSE),
fNeedsVerticesBranchReplication(kFALSE),
fNeedsCaloClustersBranchReplication(kFALSE),
fAODIsReplicated(kFALSE),
fAODEvent(NULL),
+ fMCEventH(NULL),
fTreeA(NULL),
fFileA(NULL),
fFileName("")
return kTRUE;
}
+
+void AliAODHandler::StoreMCParticles(){
+
+ //
+ // Remap the labels from ESD stack and store
+ // the AODMCParticles, makes only sense if we have
+ // the mcparticles branch
+ // has to be done here since we cannot know in advance
+ // which particles are needed (e.g. by the tracks etc.)
+ //
+ // Particles have been selected by AliMCEventhanlder->SelectParticle()
+ // To use the MCEventhandler here we need to set it from the outside
+ // can vanish when Handler go to the ANALYSISalice library
+
+ TClonesArray *mcarray = (TClonesArray*)fAODEvent->FindListObject(AliAODMCParticle::StdBranchName());
+ if(!mcarray)return;
+ mcarray->Delete();
+
+ // Get the MC Infos.. Handler needs to be set before
+ // while adding the branch
+ // This needs to be done, not to depend on the AnalysisManager
+
+ if(!fMCEventH)return;
+ if(!fMCEventH->MCEvent())return;
+ AliStack *pStack = fMCEventH->MCEvent()->Stack();
+ if(!pStack)return;
+
+ fMCEventH->CreateLabelMap();
+
+ // First store the AliAODParticlesMC
+
+ Int_t np = pStack->GetNtrack();
+ Int_t nprim = pStack->GetNprimary();
+
+
+ Int_t j = 0;
+ TClonesArray& l = *mcarray;
+
+ for(int i = 0;i < np;++i){
+ if(fMCEventH->IsParticleSelected(i)){
+
+ Int_t flag = 0;
+ TParticle *part = pStack->Particle(i);
+ if(i<nprim)flag |= AliAODMCParticle::kPrimary;
+ if(pStack->IsPhysicalPrimary(i))flag |= AliAODMCParticle::kPhysicalPrim;
+
+ if(fMCEventH->GetNewLabel(i)!=j){
+ AliError(Form("MISMATCH New label %d j: %d",fMCEventH->GetNewLabel(i),j));
+ }
+ AliAODMCParticle mcpart_tmp(part,i,flag);
+
+ //
+ Int_t d0 = mcpart_tmp.GetDaughter(0);
+ Int_t d1 = mcpart_tmp.GetDaughter(1);
+ Int_t m = mcpart_tmp.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
+ mcpart_tmp.SetDaughter(0,d0);
+ mcpart_tmp.SetDaughter(1,d1);
+ }
+ else if(d1 < 0 && d0 >= 0){
+ // Only one daughter
+ // second condition not needed just for sanity check at the end
+ if(fMCEventH->IsParticleSelected(d0)){
+ mcpart_tmp.SetDaughter(0,fMCEventH->GetNewLabel(d0));
+ }
+ else{
+ mcpart_tmp.SetDaughter(0,-1);
+ }
+ mcpart_tmp.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 d0_tmp = -1;
+ Int_t d1_tmp = -1;
+ for(int id = d0; id<=d1;++id){
+ if(fMCEventH->IsParticleSelected(id)){
+ if(d0_tmp==-1){
+ // first time
+ d0_tmp = fMCEventH->GetNewLabel(id);
+ d1_tmp = d0_tmp; // this is to have the same schema as on the stack i.e. with one daugther d0 and d1 are the same
+ }
+ else d1_tmp = fMCEventH->GetNewLabel(id);
+ }
+ }
+ mcpart_tmp.SetDaughter(0,d0_tmp);
+ mcpart_tmp.SetDaughter(1,d1_tmp);
+ }
+ else{
+ AliError(Form("Unxpected indices %d %d",d0,d1));
+ }
+
+ if(m<0){
+ mcpart_tmp.SetMother(m);
+ }
+ else{
+ if(fMCEventH->IsParticleSelected(m))mcpart_tmp.SetMother(fMCEventH->GetNewLabel(m));
+ else AliError("PROBLEM Mother not selected");
+ }
+
+ new (l[j++]) AliAODMCParticle(mcpart_tmp);
+
+ }
+ }
+ AliInfo(Form("AliAODHandler::StoreMCParticles: Selected %d (Primaries %d / total %d) after validation",
+ j,nprim,np));
+
+ // Set the labels in the AOD output...
+ // Remapping
+
+ // AODTracks
+ TClonesArray* tracks = fAODEvent->GetTracks();
+ if(tracks){
+ for(int it = 0; it < fAODEvent->GetNTracks();++it){
+ AliAODTrack *track = fAODEvent->GetTrack(it);
+
+ if(TMath::Abs(track->GetLabel())>np||track->GetLabel()==0){
+ AliWarning(Form("Wrong ESD track label %d",track->GetLabel()));
+ }
+ if(fMCEventH->GetNewLabel(track->GetLabel())==0){
+ AliWarning(Form("New label not found for %d",track->GetLabel()));
+ }
+ track->SetLabel(fMCEventH->GetNewLabel(track->GetLabel()));
+ }
+ }
+
+ // AOD calo cluster
+ TClonesArray *clusters = fAODEvent->GetCaloClusters();
+ if(clusters){
+ for (Int_t iClust = 0;iClust < fAODEvent->GetNCaloClusters(); ++iClust) {
+ AliAODCaloCluster * cluster = fAODEvent->GetCaloCluster(iClust);
+ UInt_t nLabel = cluster->GetNLabel();
+ // Ugly but do not want to fragment memory by creating
+ // new Int_t (nLabel)
+ Int_t* labels = const_cast<Int_t*>(cluster->GetLabels());
+ if (labels){
+ for(UInt_t i = 0;i < nLabel;++i){
+ labels[i] = fMCEventH->GetNewLabel(cluster->GetLabel(i));
+ }
+ }
+ // cluster->SetLabels(labels,nLabel);
+ }// iClust
+ }// clusters
+
+ // AOD tracklets
+ AliAODTracklets *tracklets = fAODEvent->GetTracklets();
+ if(tracklets){
+ for(int it = 0;it < tracklets->GetNumberOfTracklets();++it){
+ int label0 = tracklets->GetLabel(it,0);
+ int label1 = tracklets->GetLabel(it,1);
+ if(label0>=0)label0 = fMCEventH->GetNewLabel(label0);
+ if(label1>=0)label1 = fMCEventH->GetNewLabel(label1);
+ tracklets->SetLabel(it,0,label0);
+ tracklets->SetLabel(it,1,label1);
+ }
+ }
+
+}
+
Bool_t AliAODHandler::FinishEvent()
{
- // Fill data structures
+ // Fill data structures
+ if(fFillAOD){
fAODEvent->MakeEntriesReferencable();
+ StoreMCParticles();
FillTree();
- if (fIsStandard) fAODEvent->ResetStd();
- // Reset AOD replication flag
- fAODIsReplicated = kFALSE;
-
- return kTRUE;
+ }
+
+ if (fIsStandard) fAODEvent->ResetStd();
+ // Reset AOD replication flag
+ fAODIsReplicated = kFALSE;
+ return kTRUE;
}
//______________________________________________________________________________
void AliAODHandler::FillTree()
{
// Fill the AOD Tree
- fTreeA->Fill();
+ fTreeA->Fill();
}
//______________________________________________________________________________
void AliAODHandler::AddAODtoTreeUserInfo()
{
// Add aod event to tree user info
- fTreeA->GetUserInfo()->Add(fAODEvent);
+ fTreeA->GetUserInfo()->Add(fAODEvent);
}
//______________________________________________________________________________
class AliAODEvent;
class TFile;
class TTree;
+class AliMCEventHandler;
virtual const char* GetOutputFileName();
virtual Bool_t Init(Option_t* option);
virtual Bool_t Init(TTree* /*tree*/, Option_t* /*option*/) {return kTRUE;}
- virtual Bool_t BeginEvent(Long64_t /*entry*/) {return kTRUE;}
+ virtual Bool_t BeginEvent(Long64_t /*entry*/){return kTRUE;}
virtual Bool_t Notify() { return AliVEventHandler::Notify(); };
virtual Bool_t Notify(const char * /* path */) {return kTRUE;}
virtual Bool_t FinishEvent();
virtual Bool_t TerminateIO();
//
virtual void SetCreateNonStandardAOD() {fIsStandard = kFALSE;}
+ virtual void SetFillAOD(Bool_t b) {fFillAOD = b;}
virtual void SetNeedsHeaderReplication() {fNeedsHeaderReplication = kTRUE;}
virtual void SetNeedsTracksBranchReplication() {fNeedsTracksBranchReplication = kTRUE;}
virtual void SetNeedsVerticesBranchReplication() {fNeedsVerticesBranchReplication = kTRUE;}
void AddAODtoTreeUserInfo();
void AddBranch(const char* cname, void* addobj);
Bool_t IsStandard() {return fIsStandard;}
+ Bool_t GetFillAOD(){return fFillAOD;}
Bool_t NeedsHeaderReplication() {return fNeedsHeaderReplication;}
Bool_t NeedsTracksBranchReplication() {return fNeedsTracksBranchReplication;}
Bool_t NeedsVerticesBranchReplication() {return fNeedsVerticesBranchReplication;}
Bool_t AODIsReplicated() {return fAODIsReplicated;}
//
void SetInputTree(TTree* /*tree*/) {;}
+ void SetMCEventHandler(AliMCEventHandler* mcH) {fMCEventH = mcH;} // For internal use
private:
+ void StoreMCParticles();
AliAODHandler(const AliAODHandler&); // Not implemented
AliAODHandler& operator=(const AliAODHandler&); // Not implemented
private:
Bool_t fIsStandard; // Flag for standard aod creation
+ Bool_t fFillAOD; // Flag for filling of the AOD tree at the end (all or nothing)
Bool_t fNeedsHeaderReplication; // Flag for header replication
Bool_t fNeedsTracksBranchReplication; // Flag for tracks replication
Bool_t fNeedsVerticesBranchReplication; // Flag for vertices replication
Bool_t fNeedsFMDClustersBranchReplication; // Flag for FMDClusters replication
Bool_t fNeedsCaloClustersBranchReplication; // Flag for CaloClusters replication
Bool_t fAODIsReplicated; // Flag true if replication as been executed
-
AliAODEvent *fAODEvent; //! Pointer to the AOD event
+ AliMCEventHandler *fMCEventH; //! Pointer to mc event handler needed not to depend on the manager
TTree *fTreeA; //! tree for AOD persistency
TFile *fFileA; //! Output file
TString fFileName; // Output file name
- ClassDef(AliAODHandler, 2);
+ ClassDef(AliAODHandler, 3)
};
#endif
--- /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. *
+ **************************************************************************/
+
+
+//-------------------------------------------------------------------------
+// Realisation of AliVParticle for MC Particles
+// Basically a stripped down AliMCParicle / TParticle
+// with minimum information on MC tracks
+// Author: Christian Klein-Bösing, CERN
+//-------------------------------------------------------------------------
+
+
+#include "AliAODMCParticle.h"
+#include "AliAODEvent.h"
+
+#include "TDatabasePDG.h"
+#include "TParticle.h"
+#include "TClonesArray.h"
+
+
+ClassImp(AliAODMCParticle)
+
+TString AliAODMCParticle::fgkStdBranchName("mcparticles");
+
+AliAODMCParticle::AliAODMCParticle():
+AliVParticle(),
+ fPdgCode(0),
+ fFlag(0),
+ fLabel(0),
+ fMother(0),
+ fPx(0),
+ fPy(0),
+ fPz(0),
+ fE(0),
+ fVx(0),
+ fVy(0),
+ fVz(0)
+{
+ // Default Constructor
+ fDaughter[0] = fDaughter[1] = 0;
+}
+
+
+AliAODMCParticle::AliAODMCParticle(TParticle* part, Int_t label,Int_t flag):
+ AliVParticle(),
+ fPdgCode(part->GetPdgCode()),
+ fFlag(flag),
+ fLabel(label),
+ fMother(part->GetMother(0)),
+ fPx(part->Px()),
+ fPy(part->Py()),
+ fPz(part->Pz()),
+ fE(part->Energy()),
+ fVx(part->Vx()),
+ fVy(part->Vy()),
+ fVz(part->Vz())
+{
+ fDaughter[0] = part->GetDaughter(0);
+ fDaughter[1] = part->GetDaughter(1);
+ // Set unique id
+ TObject::SetUniqueID(part->GetUniqueID());
+}
+
+
+AliAODMCParticle::AliAODMCParticle(const AliAODMCParticle& mcPart) :
+ AliVParticle(mcPart),
+ fPdgCode(mcPart.fPdgCode),
+ fFlag(mcPart.fFlag),
+ fLabel(mcPart.fLabel),
+ fMother(mcPart.fMother),
+ fPx(mcPart.fPx),
+ fPy(mcPart.fPy),
+ fPz(mcPart.fPz),
+ fE(mcPart.fE),
+ fVx(mcPart.fVx),
+ fVy(mcPart.fVy),
+ fVz(mcPart.fVz)
+{
+ // Copy constructor
+ fDaughter[0] = mcPart.fDaughter[0];
+ fDaughter[1] = mcPart.fDaughter[1];
+
+}
+
+AliAODMCParticle& AliAODMCParticle::operator=(const AliAODMCParticle& mcPart)
+{
+
+ if (this!=&mcPart) {
+ AliVParticle::operator=(mcPart);
+ fPdgCode = mcPart.fPdgCode;
+ fFlag = mcPart.fFlag;
+ fLabel = mcPart.fLabel;
+ fMother = mcPart.fMother;
+ fPx = mcPart.fPx;
+ fPy = mcPart.fPy;
+ fPz = mcPart.fPz;
+ fE = mcPart.fE;
+ fVx = mcPart.fVx;
+ fVy = mcPart.fVy;
+ fVz = mcPart.fVz;
+ fDaughter[0] = mcPart.fDaughter[0];
+ fDaughter[1] = mcPart.fDaughter[1];
+ }
+
+ return *this;
+
+}
+
+Double_t AliAODMCParticle::M() const
+{
+ TParticlePDG* pdg = TDatabasePDG::Instance()->GetParticle(fPdgCode);
+ if (pdg) {
+ return (pdg->Mass());
+ } else {
+ return GetCalcMass();
+ }
+}
+
+
+Short_t AliAODMCParticle::Charge() const
+{
+ TParticlePDG* pdg = TDatabasePDG::Instance()->GetParticle(fPdgCode);
+ if (pdg) {
+ return (Short_t (pdg->Charge()));
+ } else {
+ return -99;
+ }
+}
+
+void AliAODMCParticle::Print(const Option_t *opt) const {
+ if(TDatabasePDG::Instance()->GetParticle(fPdgCode)){
+ Printf(">>> PDG (%d) : %s",fPdgCode,TDatabasePDG::Instance()->GetParticle(fPdgCode)->GetName());
+ }
+ else{
+ Printf(">>> PDG (%d) : %s",fPdgCode,"Unknown");
+ }
+ Printf(">> P(%3.3f,%3.3f,%3.3f) V((%3.3f,%3.3f,%3.3f)",fPx,fPy,fPz,fVx,fVy,fVz);
+ Printf("> Mother %d, First Daughter %d Last Daughter %d Process %d",fMother,fDaughter[0],fDaughter[1],TObject::GetUniqueID());
+}
--- /dev/null
+#ifndef AliAODMCParticle_H
+#define AliAODMCParticle_H
+/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+
+//-------------------------------------------------------------------------
+// AliVParticle realisation for MC Particles in the AOD
+// Stripped dow AliMCParticle
+// Author: Christian Klein Bösing, CERN
+//-------------------------------------------------------------------------
+
+#include <Rtypes.h>
+#include <TParticlePDG.h>
+#include <TExMap.h>
+#include <TString.h>
+
+
+#include "AliTrackReference.h"
+#include "AliVParticle.h"
+
+class AliAODEvent;
+class TParticle;
+class TClonesArray;
+
+class AliAODMCParticle: public AliVParticle {
+ public:
+ AliAODMCParticle();
+ AliAODMCParticle(TParticle* part, Int_t label=0,Int_t flag = 0);
+ virtual ~AliAODMCParticle(){};
+ AliAODMCParticle(const AliAODMCParticle& mcPart);
+ AliAODMCParticle& operator=(const AliAODMCParticle& mcPart);
+
+ // Kinematics
+ virtual Double_t Px() const;
+ virtual Double_t Py() const;
+ virtual Double_t Pz() const;
+ virtual Double_t Pt() const;
+ virtual Double_t P() const;
+ virtual Bool_t PxPyPz(Double_t p[3]) const;
+
+ virtual Double_t OneOverPt() const;
+ virtual Double_t Phi() const;
+ virtual Double_t Theta() const;
+
+ virtual Double_t Xv() const;
+ virtual Double_t Yv() const;
+ virtual Double_t Zv() const;
+ virtual Bool_t XvYvZv(Double_t x[3]) const;
+
+ virtual Double_t E() const;
+ virtual Double_t M() const;
+
+ virtual Double_t Eta() const;
+ virtual Double_t Y() const;
+
+ virtual Short_t Charge() const;
+
+ virtual Int_t Label() const;
+ virtual Int_t GetLabel() const {return Label();}
+
+ // PID
+ virtual const Double_t *PID() const {return 0;} // return PID object (to be defined, still)
+
+ //
+ virtual Double_t GetCalcMass() const;
+ virtual void SetDaughter(Int_t i,Int_t id){if(i<2)fDaughter[i] = id;}
+ virtual Int_t GetDaughter(Int_t i) const {return fDaughter[i];}
+ virtual void SetMother(Int_t im){fMother = im;}
+ virtual Int_t GetMother() const {return fMother;}
+ virtual void Print(const Option_t *opt = "") const;
+ virtual Int_t GetPdgCode() const { return fPdgCode;}
+
+ enum { kPrimary = 1<<0, kPhysicalPrim = 1<<1 };
+ void SetFlag(Int_t flag){fFlag = flag;}
+ Int_t GetFlag() const {return fFlag;}
+
+ // Bitwise operations
+ void SetPrimary(Bool_t b = kTRUE){
+ if(b)fFlag |= kPrimary;
+ else fFlag &= ~kPrimary;
+ }
+ Bool_t IsPrimary() const {return ((fFlag&kPrimary)==kPrimary);}
+
+ void SetPhysicalPrimary(Bool_t b = kTRUE){
+ if(b)fFlag |= kPhysicalPrim;
+ else fFlag &= ~kPhysicalPrim;
+ }
+ Bool_t IsPhysicalPrimary() const {return ((fFlag&kPhysicalPrim)==kPhysicalPrim);}
+ static const char* StdBranchName(){return fgkStdBranchName.Data();}
+
+ private:
+
+ static TString fgkStdBranchName; // Standard branch name
+
+
+ Int_t fPdgCode; // PDG code of the particle
+ Int_t fFlag; // Flag for indication of primary etc
+ Int_t fLabel; // Label of the original MCParticle
+ Int_t fMother; // Index of the mother particles
+ Int_t fDaughter[2]; // Indices of the daughter particles
+ Double32_t fPx; // [0.,0.,12] x component of momentum
+ Double32_t fPy; // [0.,0.,12] y component of momentum
+ Double32_t fPz; // [0.,0.,12] z component of momentum
+ Double32_t fE; // [0.,0.,12] Energy
+
+ Double32_t fVx; // [0.,0.,12] x of production vertex
+ Double32_t fVy; // [0.,0.,12] y of production vertex
+ Double32_t fVz; // [0.,0.,12] z of production vertex
+
+ // Copy the uniquID to another data member? unique ID is correctly handled
+ // via TOBject Copy construct but not by AliVParticle ctor (no passing of
+ // TParicles
+ // Need a flag for primaries?
+
+ /*
+ const TMCProcess kMCprocesses[kMaxMCProcess] =
+ {
+ kPNoProcess, kPMultipleScattering, kPEnergyLoss, kPMagneticFieldL,
+ kPDecay, kPPair, kPCompton, kPPhotoelectric, kPBrem, kPDeltaRay,
+ kPAnnihilation, kPHadronic, kPNoProcess, kPEvaporation, kPNuclearFission,
+ kPNuclearAbsorption, kPPbarAnnihilation, kPNCapture, kPHElastic,
+ kPHInhelastic, kPMuonNuclear, kPTOFlimit,kPPhotoFission, kPNoProcess,
+ kPRayleigh, kPNoProcess, kPNoProcess, kPNoProcess, kPNull, kPStop
+ };
+ */
+
+
+
+
+ ClassDef(AliAODMCParticle,1) // AliVParticle realisation for AODMCParticles
+
+};
+
+inline Double_t AliAODMCParticle::Px() const {return fPx;}
+inline Double_t AliAODMCParticle::Py() const {return fPy;}
+inline Double_t AliAODMCParticle::Pz() const {return fPz;}
+inline Double_t AliAODMCParticle::Pt() const {return TMath::Sqrt(fPx*fPx+fPy*fPy);}
+inline Double_t AliAODMCParticle::P() const {return TMath::Sqrt(fPx*fPx+fPy*fPy+fPz*fPz); }
+inline Double_t AliAODMCParticle::OneOverPt() const {return 1. / Pt();}
+inline Bool_t AliAODMCParticle::PxPyPz(Double_t p[3]) const { p[0] = fPx; p[1] = fPy; p[2] = fPz; return kTRUE; }
+inline Double_t AliAODMCParticle::Phi() const { return TMath::Pi()+TMath::ATan2(-fPy,-fPx); } // note that Phi() returns an angle between 0 and 2pi
+inline Double_t AliAODMCParticle::Theta() const { return (fPz==0)?TMath::PiOver2():TMath::ACos(fPz/P()); }
+inline Double_t AliAODMCParticle::Xv() const {return fVx;}
+inline Double_t AliAODMCParticle::Yv() const {return fVy;}
+inline Double_t AliAODMCParticle::Zv() const {return fVz;}
+inline Bool_t AliAODMCParticle::XvYvZv(Double_t x[3]) const { x[0] = fVx; x[1] = fVy; x[2] = fVz; return kTRUE; }
+inline Double_t AliAODMCParticle::E() const {return fE;}
+inline Double_t AliAODMCParticle::Eta() const {
+ Double_t pmom = P();
+ if (pmom != TMath::Abs(fPz)) return 0.5*TMath::Log((pmom+fPz)/(pmom-fPz));
+ else return 1.e30;
+}
+
+
+inline Double_t AliAODMCParticle::Y() const
+{
+ Double_t e = E();
+ Double_t pz = Pz();
+
+ if (e != TMath::Abs(pz)) {
+ return 0.5*TMath::Log((e+pz)/(e-pz));
+ } else {
+ return -999.;
+ }
+}
+
+inline Int_t AliAODMCParticle::Label() const {return fLabel;}
+
+inline Double_t AliAODMCParticle::GetCalcMass() const {
+
+ Double_t m2 = E()*E()-Px()*Px()-Py()*Py()-Pz()*Pz();
+ if(m2<0)return 0;
+ return TMath::Sqrt(m2);
+}
+
+
+#endif
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+/************************************************************************* * 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. *
fTreeTR(0),
fDirK(0),
fDirTR(0),
+ fParticleSelected(0),
+ fLabelMap(0),
fNEvent(-1),
fEvent(-1),
fPathName(new TString("./")),
fTreeTR(0),
fDirK(0),
fDirTR(0),
+ fParticleSelected(0),
+ fLabelMap(0),
fNEvent(-1),
fEvent(-1),
fPathName(new TString("./")),
Bool_t AliMCEventHandler::BeginEvent(Long64_t entry)
{
+ fParticleSelected.Delete();
+ fLabelMap.Delete();
// Read the next event
if (entry == -1) {
fEvent++;
return GetEvent(entry);
}
+void AliMCEventHandler::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 AliMCEventHandler::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 AliMCEventHandler::CreateLabelMap(){
+
+ //
+ // this should be called once all selections where done
+ //
+
+ fLabelMap.Delete();
+ if(!fMCEvent){
+ fParticleSelected.Delete();
+ return;
+ }
+
+ VerifySelectedParticles();
+ AliStack *pStack = fMCEvent->Stack();
+
+ Int_t iNew = 0;
+ for(int i = 0;i < pStack->GetNtrack();++i){
+ if(IsParticleSelected(i)){
+ fLabelMap.Add(i,iNew);
+ iNew++;
+ }
+ }
+}
+
+Int_t AliMCEventHandler::GetNewLabel(Int_t i) {
+ // Gets the labe from the new created Map
+ // Call CreatLabelMap before
+ // otherwise only 0 returned
+ return fLabelMap.GetValue(TMath::Abs(i));
+}
+
+void AliMCEventHandler::VerifySelectedParticles(){
+
+ //
+ // Make sure that each particle has at least it's predecessors
+ // selected so that we have the complete ancestry tree
+ // Private, should be only called by CreateLabelMap
+
+ if(!fMCEvent){
+ fParticleSelected.Delete();
+ return;
+ }
+ AliStack *pStack = fMCEvent->Stack();
+
+ Int_t nprim = pStack->GetNprimary();
+
+ for(int i = 0;i < pStack->GetNtrack();++i){
+ if(i<nprim){
+ SelectParticle(i);// take all primaries
+ continue;
+ }
+ if(!IsParticleSelected(i))continue;
+ TParticle *part = pStack->Particle(i);
+ Int_t imo = part->GetFirstMother();
+ while((imo >= nprim)&&!IsParticleSelected(imo)){
+ // Mother not yet selected
+ SelectParticle(imo);
+ TParticle *mother = pStack->Particle(imo);
+ imo = mother->GetFirstMother();
+ }
+ // after last step we may have a unselected primary
+ // mother
+ if(imo>=0){
+ if(!IsParticleSelected(imo))
+ SelectParticle(imo);
+ }
+ }// loop over all tracks
+}
+
Int_t AliMCEventHandler::GetParticleAndTR(Int_t i, TParticle*& particle, TClonesArray*& trefs)
{
// Retrieve entry i
//-------------------------------------------------------------------------
#include "AliVEventHandler.h"
#include "AliHeader.h"
+#include <TExMap.h>
+
class TFile;
class TTree;
class TParticle;
TTree* TreeK() const {return fTreeK;}
Int_t GetParticleAndTR(Int_t i, TParticle*& particle, TClonesArray*& trefs);
void DrawCheck(Int_t i, Int_t search=0);
+
+ // label manipulation
+ void SelectParticle(Int_t i);
+ Bool_t IsParticleSelected(Int_t i);
+ void CreateLabelMap();
+ Int_t GetNewLabel(Int_t i);
+
private:
Bool_t OpenFile(Int_t i);
+ void VerifySelectedParticles();
AliMCEventHandler(const AliMCEventHandler& handler);
AliMCEventHandler& operator=(const AliMCEventHandler& handler);
private:
TTree *fTreeTR; //! TreeTR (track references tree)
TDirectoryFile *fDirK; //! Directory for Kine Tree
TDirectoryFile *fDirTR; //! Directory for TR Tree
+ TExMap fParticleSelected; //! List of selected MC particles for t
+ TExMap fLabelMap; //! Stores the Map of MC (ESDLabel,AODlabel)
Int_t fNEvent; //! Number of events
Int_t fEvent; //! Current event
TString *fPathName; //! Input file path
AliAODCluster.cxx AliAODCaloCluster.cxx AliAODPmdCluster.cxx AliAODFmdCluster.cxx \
AliAODJet.cxx AliAODPhoton.cxx AliAODRedCov.cxx AliAODRecoDecay.cxx \
AliAODHandler.cxx AliAODTracklets.cxx AliAODTagCreator.cxx \
- AliAODv0.cxx AliAODcascade.cxx AliAODCaloCells.cxx AliAODInputHandler.cxx AliMultiAODInputHandler.cxx AliAODDiJet.cxx
+ AliAODv0.cxx AliAODcascade.cxx AliAODCaloCells.cxx AliAODInputHandler.cxx \
+ AliMultiAODInputHandler.cxx AliAODDiJet.cxx AliAODMCParticle.cxx
HDRS:= $(SRCS:.cxx=.h)