AliPhysics  608b256 (608b256)
AliEmcalMCTrackSelector.h
Go to the documentation of this file.
1 /**************************************************************************************
2  * Copyright (C) 2012, Copyright Holders of the ALICE Collaboration *
3  * All rights reserved. *
4  * *
5  * Redistribution and use in source and binary forms, with or without *
6  * modification, are permitted provided that the following conditions are met: *
7  * * Redistributions of source code must retain the above copyright *
8  * notice, this list of conditions and the following disclaimer. *
9  * * Redistributions in binary form must reproduce the above copyright *
10  * notice, this list of conditions and the following disclaimer in the *
11  * documentation and/or other materials provided with the distribution. *
12  * * Neither the name of the <organization> nor the *
13  * names of its contributors may be used to endorse or promote products *
14  * derived from this software without specific prior written permission. *
15  * *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
19  * DISCLAIMED. IN NO EVENT SHALL ALICE COLLABORATION BE LIABLE FOR ANY *
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
26  **************************************************************************************/
27 #ifndef ALIEMCALMCTRAKCSELECTOR_H
28 #define ALIEMCALMCTRAKCSELECTOR_H
29 
30 class TClonesArray;
31 class TString;
32 class AliVEvent;
33 class AliMCEvent;
34 class AliNamedArrayI;
35 class AliAODMCParticle;
36 
37 #include "AliAnalysisTaskSE.h"
38 
47  public:
48 
53 
59  AliEmcalMCTrackSelector(const char *name);
60 
65 
71 
76  void SetChargedMC(Bool_t c = kTRUE) { fChargedMC = c ; }
77 
82  void SetEtaMax(Double_t e) { fEtaMax = e ; }
83 
88  void SetRejectNK(Bool_t r = kTRUE) { fRejectNK = r ; }
89 
100  void SetRejectPhotonMother(bool doReject) { fRejectPhotonMothers = doReject; }
101 
102  void SetOnlyHIJING(Bool_t s) { fOnlyHIJING = s ; }
103 
113  void SetParticlesOutName(const char *name) { fParticlesOutName = name ; }
114 
115 
126  static AliEmcalMCTrackSelector* AddTaskMCTrackSelector(TString outname = "mcparticles", Bool_t nk = kFALSE, Bool_t ch = kFALSE, Double_t etamax = 1, Bool_t physPrim = kTRUE);
127 
128  protected:
129 
136 
146  void UserExec(Option_t *option);
147 
161  virtual Bool_t AcceptParticle(AliAODMCParticle* part) const;
162 
169  void ConvertMCParticles(AliMCEvent* mcEvent, TClonesArray* partOut, AliNamedArrayI* partMap=0);
170 
177  void CopyMCParticles(TClonesArray* partIn, TClonesArray* partOut, AliNamedArrayI* partMap=0);
178 
179 
189  TClonesArray *fParticlesIn;
190  TClonesArray *fParticlesOut;
192  AliVEvent *fEvent;
193  AliMCEvent *fMC;
196 
197  private:
198  AliEmcalMCTrackSelector(const AliEmcalMCTrackSelector&); // not implemented
199  AliEmcalMCTrackSelector &operator=(const AliEmcalMCTrackSelector&); // not implemented
200 
201  ClassDef(AliEmcalMCTrackSelector, 5);
202 };
203 #endif
void ConvertMCParticles(AliMCEvent *mcEvent, TClonesArray *partOut, AliNamedArrayI *partMap=0)
Convert MC particles in MC AOD articles (for ESD analysis).
Bool_t fOnlyHIJING
true = only HIJING particles
double Double_t
Definition: External.C:58
Bool_t fChargedMC
true = only charged particles
Double_t fEtaMax
maximum eta to accept particles
TClonesArray * fParticlesOut
! particle array out
Bool_t fIsESD
! ESD or AOD analysis
Bool_t fOnlyPhysPrim
true = only physical primary particles
void UserExec(Option_t *option)
Main event loop.
Bool_t fDisabled
! Disable task if a problem occurs at initialization
Bool_t fRejectPhotonMothers
Reject photons that are mothers of other photons.
TCanvas * c
Definition: TestFitELoss.C:172
TString fParticlesMapName
! name of the particle map
Bool_t fRejectNK
true = reject K_0^L and neutrons
void SetParticlesOutName(const char *name)
Set the name of the output container.
AliEmcalMCTrackSelector & operator=(const AliEmcalMCTrackSelector &)
void SetRejectPhotonMother(bool doReject)
Reject photon in case it is the mother of another photon.
AliMCEvent * fMC
! MC event (ESD)
AliNamedArrayI * fParticlesMap
! particle index/label
AliEmcalMCTrackSelector()
Dummy constructor.
void CopyMCParticles(TClonesArray *partIn, TClonesArray *partOut, AliNamedArrayI *partMap=0)
Convert standard MC AOD particles in a new array, and filter if requested (for AOD analysis)...
void UserCreateOutputObjects()
Creating user output.
Class to select particles in MC events. Salvatore Aiola, Yale Univeristy.
void SetOnlyPhysPrim(Bool_t s)
Select only physical primary particles.
const Double_t etamax
void SetEtaMax(Double_t e)
Set the eta acceptance.
virtual ~AliEmcalMCTrackSelector()
Destructor.
void SetRejectNK(Bool_t r=kTRUE)
Reject neutrons and K0long particles.
TString fParticlesOutName
name of output particle array
const char Option_t
Definition: External.C:48
void SetChargedMC(Bool_t c=kTRUE)
Select only charged particles.
static AliEmcalMCTrackSelector * AddTaskMCTrackSelector(TString outname="mcparticles", Bool_t nk=kFALSE, Bool_t ch=kFALSE, Double_t etamax=1, Bool_t physPrim=kTRUE)
Create new AliEmcalMCTrackSelector task and add it to the analysis manager.
Bool_t fInit
! true = task initialized
bool Bool_t
Definition: External.C:53
TClonesArray * fParticlesIn
! particle array in (AOD)
virtual Bool_t AcceptParticle(AliAODMCParticle *part) const
Check whether paricle is selected.