AliPhysics  97344c9 (97344c9)
 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  if (!fClusCont) return kFALSE;
86 
87  // loop over clusters
88  fClusCont->ResetCurrentID();
89  AliVCluster *clus = 0;
90  while ((clus = fClusCont->GetNextCluster())) {
91  if (!clus->IsEMCAL()) continue;
92 
93  if (fCreateHisto) {
94  Float_t pos[3] = {0.};
95  clus->GetPosition(pos);
96  TVector3 vec(pos);
97  fEtaPhiDistBefore->Fill(vec.Eta(),vec.Phi());
98  }
99 
100  Bool_t exResult = kFALSE;
101 
102  if (fRecoUtils) {
103  if (fRecoUtils->IsRejectExoticCluster()) {
104  Bool_t exRemoval = fRecoUtils->IsRejectExoticCell();
105  fRecoUtils->SwitchOnRejectExoticCell(); //switch on temporarily
106  exResult = fRecoUtils->IsExoticCluster(clus, fCaloCells);
107  if (!exRemoval) fRecoUtils->SwitchOffRejectExoticCell(); //switch back off
108 
109  clus->SetIsExotic(exResult);
110  }
111  }
112 
113  if (fCreateHisto) {
114  if (exResult) {
115  fEnergyExoticClusters->Fill(clus->E());
116  }
117  else {
118  Float_t pos[3] = {0.};
119  clus->GetPosition(pos);
120  TVector3 vec(pos);
121  fEtaPhiDistAfter->Fill(vec.Eta(), vec.Phi());
122  }
123  }
124  }
125 
126  return kTRUE;
127 }
Exotic cluster removal in the EMCal correction framework.
Definition: External.C:236
AliVCaloCells * fCaloCells
! Pointer to CaloCells
TH2F * fEtaPhiDistAfter
!eta/phi distribution after
AliEMCALRecoUtils * fRecoUtils
Pointer to RecoUtils.
AliClusterContainer * fClusCont
Pointer to the cluster container.
TH1F * fEnergyExoticClusters
!energy of exotic clusters
float Float_t
Definition: External.C:68
Base class for correction components in the EMCal correction framework.
AliVCluster * GetNextCluster()
TList * fOutput
! List of output histograms
Bool_t fCreateHisto
Flag to make some basic histograms.
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
static RegisterCorrectionComponent< AliEmcalCorrectionClusterExotics > reg
bool Bool_t
Definition: External.C:53
TH2F * fEtaPhiDistBefore
!eta/phi distribution before
bool GetProperty(std::string propertyName, T &property, bool requiredProperty=true, std::string correctionName="")
Retrieve property.