AliPhysics  d497547 (d497547)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskEmcalJetLight.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2016, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
16 
17 #include <TClonesArray.h>
18 #include <TList.h>
19 
20 #include "AliAnalysisManager.h"
21 #include "AliCentrality.h"
22 #include "AliEMCALGeometry.h"
23 #include "AliESDEvent.h"
24 #include "AliEmcalJet.h"
25 #include "AliLog.h"
26 #include "AliRhoParameter.h"
27 #include "AliLocalRhoParameter.h"
28 #include "AliVCluster.h"
29 #include "AliVEventHandler.h"
30 #include "AliVParticle.h"
31 
35 
41  fJetCollArray()
42 {
43 }
44 
56  AliAnalysisTaskEmcalLight(name, histo),
57  fJetCollArray()
58 {
59 }
60 
65 {
66  for (auto cont_it : fJetCollArray) delete cont_it.second;
67 }
68 
80 {
82 
83  //Load all requested jet branches - each container knows name already
84  if (fJetCollArray.size() == 0) {
85  AliWarning("There are no jet collections");
86  return;
87  }
88 
89  for (auto cont_it : fJetCollArray) {
90  AliJetContainer *cont = cont_it.second;
91  cont->SetRunNumber(InputEvent()->GetRunNumber());
92  cont->SetArray(InputEvent());
93  cont->LoadRho(InputEvent());
94  }
95 }
96 
103 {
105 
106  for (auto cont_it : fJetCollArray) cont_it.second->NextEvent();
107 
108  return kTRUE;
109 }
110 
124  UInt_t accType, std::string partContName, std::string clusContName, TString tag)
125 {
126  AliParticleContainer* partCont = nullptr;
127  AliClusterContainer* clusCont = nullptr;
128  auto partContSearch = fParticleCollArray.find(partContName);
129  if (partContSearch != fParticleCollArray.end()) partCont = partContSearch->second;
130  auto clusContSearch = fClusterCollArray.find(clusContName);
131  if (clusContSearch != fClusterCollArray.end()) clusCont = clusContSearch->second;
132  if (!partCont && !clusCont) {
133  AliError(Form("Could not find neither particle nor cluster container with names '%s' and '%s'", partContName.c_str(), clusContName.c_str()));
134  return nullptr;
135  }
136 
137  return AddJetContainer(jetType, jetAlgo, recoScheme, radius, accType, partCont, clusCont, tag);
138 }
139 
153  AliParticleContainer* partCont, AliClusterContainer* clusCont, TString tag)
154 {
155  AliJetContainer *cont = new AliJetContainer(jetType, jetAlgo, recoScheme, radius, partCont, clusCont, tag);
156  cont->SetJetAcceptanceType(accType);
157  AdoptJetContainer(cont);
158 
159  return cont;
160 }
161 
168 {
169  std::map<std::string, AliJetContainer*>::const_iterator cont_it = fJetCollArray.find(name);
170  if (cont_it != fJetCollArray.end()) return cont_it->second;
171  else return nullptr;
172 }
AliJetContainer * AddJetContainer(EJetType_t jetType, EJetAlgo_t jetAlgo, ERecoScheme_t recoScheme, Double_t radius, UInt_t accType, AliParticleContainer *partCont, AliClusterContainer *clusCont, TString tag="Jet")
double Double_t
Definition: External.C:58
void LoadRho(const AliVEvent *event)
AliJetContainer * GetJetContainer(std::string name) const
Container for particles within the EMCAL framework.
unsigned int UInt_t
Definition: External.C:33
Base task in the EMCAL framework (lighter version of AliAnalysisTaskEmcal)
Base task in the EMCAL jet framework (lighter version of AliAnalysisTaskEmcalJet) ...
void SetArray(const AliVEvent *event)
std::map< std::string, AliParticleContainer * > fParticleCollArray
particle/track collection array
void SetRunNumber(Int_t r)
Int_t GetRunNumber(TString)
Definition: PlotMuonQA.C:2235
void AdoptJetContainer(AliJetContainer *cont)
std::map< std::string, AliJetContainer * > fJetCollArray
jet collection array
void SetJetAcceptanceType(UInt_t type)
bool Bool_t
Definition: External.C:53
std::map< std::string, AliClusterContainer * > fClusterCollArray
cluster collection array
Container structure for EMCAL clusters.
Container for jet within the EMCAL jet framework.