AliPhysics  cdeda5a (cdeda5a)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliEmcalCorrectionClusterExotics.cxx
Go to the documentation of this file.
1 // AliEmcalCorrectionClusterExotics
2 //
3 
5 
6 #include <TH2F.h>
7 #include <TList.h>
8 
9 #include "AliClusterContainer.h"
10 #include "AliEMCALRecoUtils.h"
11 
15 
16 // Actually registers the class with the base class
18 
19 //________________________________________________________________________
21  AliEmcalCorrectionComponent("AliEmcalCorrectionClusterExotics"),
22  fEtaPhiDistBefore(0),
23  fEtaPhiDistAfter(0),
24  fEnergyExoticClusters(0)
25 {
26  // Default constructor
27  AliDebug(3, Form("%s", __PRETTY_FUNCTION__));
28 }
29 
30 //________________________________________________________________________
32 {
33  // Destructor
34 }
35 
36 //________________________________________________________________________
38 {
39  // Initialization
40  AliDebug(3, Form("%s", __PRETTY_FUNCTION__));
42  // Do base class initializations and if it fails -> bail out
43  //AliAnalysisTaskEmcal::ExecOnce();
44  //if (!fInitialized) return;
45 
46  GetProperty("createHistos", fCreateHisto);
47 
48  // init reco utils
49  if (!fRecoUtils)
50  fRecoUtils = new AliEMCALRecoUtils;
51  fRecoUtils->SwitchOnRejectExoticCluster();
52  if (fRecoUtils)
53  fRecoUtils->Print("");
54 
55  return kTRUE;
56 }
57 
58 //________________________________________________________________________
60 {
61  AliDebug(3, Form("%s", __PRETTY_FUNCTION__));
63 
64  // Create my user objects.
65  if (fCreateHisto){
66  fEtaPhiDistBefore = new TH2F("hEtaPhiDistBefore","hEtaPhiDistBefore;#eta;#phi",280,-0.7,0.7,800,1.3,3.3);
68  fEtaPhiDistAfter = new TH2F("hEtaPhiDistAfter","hEtaPhiDistAfter;#eta;#phi",280,-0.7,0.7,800,1.3,3.3);
70  fEnergyExoticClusters = new TH1F("fEnergyExoticClusters","fEnergyExoticClusters;E_{ex clus} (GeV)",1500,0,150);
72 
73  // Take ownership of output list
74  fOutput->SetOwner(kTRUE);
75  }
76 }
77 
78 //________________________________________________________________________
80 {
81  // Run
82  AliDebug(3, Form("%s", __PRETTY_FUNCTION__));
84 
85  // loop over clusters
86  AliVCluster *clus = 0;
87  AliClusterContainer * clusCont = 0;
88  TIter nextClusCont(&fClusterCollArray);
89  while ((clusCont = static_cast<AliClusterContainer*>(nextClusCont()))) {
90 
91  if (!clusCont) continue;
92  auto clusItCont = clusCont->all_momentum();
93 
94  for (AliClusterIterableMomentumContainer::iterator clusIterator = clusItCont.begin(); clusIterator != clusItCont.end(); ++clusIterator) {
95  clus = static_cast<AliVCluster *>(clusIterator->second);
96 
97  if (!clus->IsEMCAL()) continue;
98 
99  if (fCreateHisto) {
100  Float_t pos[3] = {0.};
101  clus->GetPosition(pos);
102  TVector3 vec(pos);
103  fEtaPhiDistBefore->Fill(vec.Eta(),vec.Phi());
104  }
105 
106  Bool_t exResult = kFALSE;
107 
108  if (fRecoUtils) {
109  if (fRecoUtils->IsRejectExoticCluster()) {
110  Bool_t exRemoval = fRecoUtils->IsRejectExoticCell();
111  fRecoUtils->SwitchOnRejectExoticCell(); //switch on temporarily
112  exResult = fRecoUtils->IsExoticCluster(clus, fCaloCells);
113  if (!exRemoval) fRecoUtils->SwitchOffRejectExoticCell(); //switch back off
114 
115  clus->SetIsExotic(exResult);
116  }
117  }
118 
119  if (fCreateHisto) {
120  if (exResult) {
121  fEnergyExoticClusters->Fill(clus->E());
122  }
123  else {
124  Float_t pos[3] = {0.};
125  clus->GetPosition(pos);
126  TVector3 vec(pos);
127  fEtaPhiDistAfter->Fill(vec.Eta(), vec.Phi());
128  }
129  }
130  }
131  }
132 
133  return kTRUE;
134 }
Exotic cluster removal in the EMCal correction framework.
Definition: External.C:236
bidirectional stl iterator over the EMCAL iterable container
AliVCaloCells * fCaloCells
! Pointer to CaloCells
TH2F * fEtaPhiDistAfter
!eta/phi distribution after
AliEMCALRecoUtils * fRecoUtils
Pointer to RecoUtils.
TObjArray fClusterCollArray
Cluster collection array.
TH1F * fEnergyExoticClusters
!energy of exotic clusters
float Float_t
Definition: External.C:68
Base class for correction components in the EMCal correction framework.
TList * fOutput
! List of output histograms
Bool_t fCreateHisto
Flag to make some basic histograms.
const AliClusterIterableMomentumContainer all_momentum() const
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
static RegisterCorrectionComponent< AliEmcalCorrectionClusterExotics > reg
bool Bool_t
Definition: External.C:53
TH2F * fEtaPhiDistBefore
!eta/phi distribution before
Container structure for EMCAL clusters.
bool GetProperty(std::string propertyName, T &property, bool requiredProperty=true, std::string correctionName="")
Retrieve property.