AliPhysics  f05a842 (f05a842)
 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 // Author: C.Loizides, S.Aiola
4 
6 
10 
11 // Actually registers the class with the base class
13 
14 //________________________________________________________________________
16  AliEmcalCorrectionComponent("AliEmcalCorrectionClusterExotics"),
17  fEtaPhiDistBefore(0),
18  fEtaPhiDistAfter(0),
19  fEnergyExoticClusters(0)
20 {
21  // Default constructor
22  AliDebug(3, Form("%s", __PRETTY_FUNCTION__));
23 }
24 
25 //________________________________________________________________________
27 {
28  // Destructor
29 }
30 
31 //________________________________________________________________________
33 {
34  // Initialization
35  AliDebug(3, Form("%s", __PRETTY_FUNCTION__));
37  // Do base class initializations and if it fails -> bail out
38  //AliAnalysisTaskEmcal::ExecOnce();
39  //if (!fInitialized) return;
40 
41  GetProperty("createHistos", fCreateHisto);
42 
44  Double_t minE = 0.;
45  GetProperty("clusterEMin", minE);
46  Double_t minPt = 0.;
47  GetProperty("clusterPtMin", minPt);
48 
49  // Settings from sample run macro
50  fClusCont->SetClusECut(minE);
51  fClusCont->SetClusPtCut(minPt);
52 
53  // init reco utils
54  if (!fRecoUtils)
55  fRecoUtils = new AliEMCALRecoUtils;
56  fRecoUtils->SwitchOnRejectExoticCluster();
57  if (fRecoUtils)
58  fRecoUtils->Print("");
59 
60  // Create my user objects.
61  if (fCreateHisto){
62  fEtaPhiDistBefore = new TH2F("hEtaPhiDistBefore","hEtaPhiDistBefore;#eta;#phi",280,-0.7,0.7,800,1.3,3.3);
64  fEtaPhiDistAfter = new TH2F("hEtaPhiDistAfter","hEtaPhiDistAfter;#eta;#phi",280,-0.7,0.7,800,1.3,3.3);
66  fEnergyExoticClusters = new TH1F("fEnergyExoticClusters","fEnergyExoticClusters;E_{ex clus} (GeV)",1500,0,150);
68 
69  // Take ownership of output list
70  fOutput->SetOwner(kTRUE);
71  }
72 
73  return kTRUE;
74 }
75 
76 //________________________________________________________________________
78 {
79  // Run
80  AliDebug(3, Form("%s", __PRETTY_FUNCTION__));
82 
83  if (!fClusCont) return kFALSE;
84 
85  // loop over clusters
86  fClusCont->ResetCurrentID();
87  AliVCluster *clus = 0;
88  while ((clus = fClusCont->GetNextCluster())) {
89  if (!clus->IsEMCAL()) continue;
90 
91  if (fCreateHisto) {
92  Float_t pos[3] = {0.};
93  clus->GetPosition(pos);
94  TVector3 vec(pos);
95  fEtaPhiDistBefore->Fill(vec.Eta(),vec.Phi());
96  }
97 
98  Bool_t exResult = kFALSE;
99 
100  if (fRecoUtils) {
101  if (fRecoUtils->IsRejectExoticCluster()) {
102  Bool_t exRemoval = fRecoUtils->IsRejectExoticCell();
103  fRecoUtils->SwitchOnRejectExoticCell(); //switch on temporarily
104  exResult = fRecoUtils->IsExoticCluster(clus, fCaloCells);
105  if (!exRemoval) fRecoUtils->SwitchOffRejectExoticCell(); //switch back off
106 
107  clus->SetIsExotic(exResult);
108  }
109  }
110 
111  if (fCreateHisto) {
112  if (exResult) {
113  fEnergyExoticClusters->Fill(clus->E());
114  }
115  else {
116  Float_t pos[3] = {0.};
117  clus->GetPosition(pos);
118  TVector3 vec(pos);
119  fEtaPhiDistAfter->Fill(vec.Eta(), vec.Phi());
120  }
121  }
122  }
123 
124  return kTRUE;
125 }
void AddContainer(inputObjectType type)
double Double_t
Definition: External.C:58
Definition: External.C:236
AliVCaloCells * fCaloCells
! pointer to calo cells
TH2F * fEtaPhiDistAfter
!eta/phi distribution after
AliEMCALRecoUtils * fRecoUtils
! pointer to reco utils
AliClusterContainer * fClusCont
! pointer to the cluster container
TH1F * fEnergyExoticClusters
!energy of exotic clusters
float Float_t
Definition: External.C:68
void GetProperty(std::string propertyName, T &property, bool requiredProperty=true, std::string correctionName="")
Retrieve property.
AliVCluster * GetNextCluster()
TList * fOutput
! list of output histograms
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
static RegisterCorrectionComponent< AliEmcalCorrectionClusterExotics > reg
void SetClusPtCut(Double_t cut)
bool Bool_t
Definition: External.C:53
void SetClusECut(Double_t cut)
TH2F * fEtaPhiDistBefore
!eta/phi distribution before