AliPhysics  1811c8f (1811c8f)
AliAnalysisTaskTriggerRejection.cxx
Go to the documentation of this file.
1 //
2 // Jet trigger rejection analysis task.
3 //
4 // Author: M.Verweij
5 
6 #include <TClonesArray.h>
7 #include <TH1F.h>
8 #include <TH2F.h>
9 #include <TH3F.h>
10 #include <TProfile.h>
11 #include <THnSparse.h>
12 #include <TList.h>
13 #include <TLorentzVector.h>
14 
15 #include "AliVVZERO.h"
16 #include "AliEmcalJet.h"
17 #include "AliRhoParameter.h"
18 #include "AliLog.h"
19 #include "AliJetContainer.h"
20 #include "AliEMCALTriggerPatchInfo.h"
21 #include "AliPicoTrack.h"
22 
24 
26 
28  //________________________________________________________________________
29  AliAnalysisTaskTriggerRejection::AliAnalysisTaskTriggerRejection() :
30  AliAnalysisTaskEmcalJet("AliAnalysisTaskTriggerRejection", kTRUE),
31  fContainerFull(0),
32  fContainerCharged(1),
33  fMaxPatch(0),
34  fhnTriggerInfo(0),
35  fMainPatchType(kManual),
36  fMainTrigCat(kTriggerLevel1Jet),
37  fMainTrigSimple(kFALSE)
38  {
39  // Default constructor.
41  }
42 
43  //________________________________________________________________________
45  AliAnalysisTaskEmcalJet(name, kTRUE),
46  fContainerFull(0),
48  fMaxPatch(0),
49  fhnTriggerInfo(0),
52  fMainTrigSimple(kFALSE)
53  {
54  // Standard constructor.
56  }
57 
58  //________________________________________________________________________
60  {
61  // Destructor.
62  }
63 
64  //________________________________________________________________________
66  {
67  // Create user output.
68 
70 
71  Bool_t oldStatus = TH1::AddDirectoryStatus();
72  TH1::AddDirectory(kFALSE);
73 
74  Int_t fgkNCentBins = 21;
75  Float_t kMinCent = 0.;
76  Float_t kMaxCent = 105.;
77 
78  Int_t fgkNPtBins = 170;
79  Float_t kMinPt = -50.;
80  Float_t kMaxPt = 120.;
81 
82  Int_t fgkNVZEROBins = 100;
83  Float_t kMinVZERO = 0.;
84  Float_t kMaxVZERO = 25000;
85 
86  const Int_t fgkNEPatch = 100;
87  Float_t kMinEPatch = 0.;
88  Float_t kMaxEPatch = 200.;
89 
90  const Int_t fgkNADC = 100;
91  Float_t kMinADC = 0.;
92  Float_t kMaxADC = 1500.;
93 
94  const Int_t fgkNEta = 10;
95  const Int_t fgkNPhi = 10;
96 
97  const Int_t nDim = 8;//cent;V0mult;ptjet1;ptjet2;Epatch;ADCpatch;EtaPatch;PhiPatch
98  const Int_t nBins[nDim] = {fgkNCentBins,fgkNVZEROBins,fgkNPtBins,fgkNPtBins,fgkNEPatch,fgkNADC,fgkNEta,fgkNPhi};
99  const Double_t xmin0[nDim] = {kMinCent,kMinVZERO,kMinPt,kMinPt,kMinEPatch,kMinADC,-0.7,1.4};
100  const Double_t xmax0[nDim] = {kMaxCent,kMaxVZERO,kMaxPt,kMaxPt,kMaxEPatch,kMaxADC, 0.7,3.14};
101  fhnTriggerInfo = new THnSparseF("fhnTriggerInfo",
102  "hnTriggerInfo;cent;V0mult;ptjet1;ptjet2;Epatch;ADCpatch;EtaPatch;PhiPatch",nDim,nBins,xmin0,xmax0);
103  fOutput->Add(fhnTriggerInfo);
104 
105  // =========== Switch on Sumw2 for all histos ===========
106  for (Int_t i=0; i<fOutput->GetEntries(); ++i) {
107  TH1 *h1 = dynamic_cast<TH1*>(fOutput->At(i));
108  if (h1){
109  h1->Sumw2();
110  continue;
111  }
112  TH2 *h2 = dynamic_cast<TH2*>(fOutput->At(i));
113  if (h2){
114  h2->Sumw2();
115  continue;
116  }
117  TH3 *h3 = dynamic_cast<TH3*>(fOutput->At(i));
118  if (h3){
119  h3->Sumw2();
120  continue;
121  }
122  THnSparse *hn = dynamic_cast<THnSparse*>(fOutput->At(i));
123  if(hn)hn->Sumw2();
124  }
125 
126  TH1::AddDirectory(oldStatus);
127 
128  PostData(1, fOutput); // Post data for ALL output slots > 0 here.
129  }
130 
131  //________________________________________________________________________
133 
134  //Find main trigger
135  if(!fTriggerPatchInfo)
136  return;
137 
138  //number of patches in event
139  Int_t nPatch = fTriggerPatchInfo->GetEntriesFast();
140 
141  //extract main trigger patch
142  Double_t emax = -1.;
143  for (Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
144  AliEMCALTriggerPatchInfo *patch = (AliEMCALTriggerPatchInfo*)fTriggerPatchInfo->At( iPatch );
145  if(patch->GetPatchE()>emax) {
146  fMaxPatch = patch;
147  emax = patch->GetPatchE();
148  }
149  }
150  }
151  //________________________________________________________________________
153  {
154  // Fill histograms.
155 
157  return kFALSE;
158 
159  //Get leading jets
162 
163  Double_t ptLeadJet1 = -999;
164  Double_t ptLeadJet2 = -999;
165 
166  if(leadJet1) ptLeadJet1 = leadJet1->Pt() - GetRhoVal(fContainerFull)*leadJet1->Area();
167  if(leadJet2) ptLeadJet2 = leadJet2->Pt() - GetRhoVal(fContainerCharged)*leadJet2->Area();
168 
169  Double_t VZEROAmp = (Double_t)(InputEvent()->GetVZEROData()->GetTriggerChargeA() + InputEvent()->GetVZEROData()->GetTriggerChargeC());
170 
171  //cent;V0mult;ptjet1;ptjet2;Epatch;ADCpatch;EtaPatch;PhiPatch
172  Double_t var[8] = {
173  fCent,
174  VZEROAmp,
175  ptLeadJet1,
176  ptLeadJet2,
177  fMaxPatch->GetPatchE(),
178  (Double_t)fMaxPatch->GetADCAmp(),
179  fMaxPatch->GetEtaGeo(),
180  fMaxPatch->GetPhiGeo()
181  };
182  fhnTriggerInfo->Fill(var);
183 
184  return kTRUE;
185  }
186 
187  //________________________________________________________________________
189  {
190  // Run analysis code here, if needed. It will be executed before FillHistograms().
191 
192  if(fTriggerPatchInfo) {
194  else if(fMainPatchType==kEmcalJet)
196  }
197 
198  return kTRUE; // If return kFALSE FillHistogram() will NOT be executed.
199  }
200 
201  //_______________________________________________________________________
203  {
204  // Called once at the end of the analysis.
205  }
206 }
Double_t Area() const
Definition: AliEmcalJet.h:130
double Double_t
Definition: External.C:58
AliJetContainer * GetJetContainer(Int_t i=0) const
Definition: External.C:244
AliEmcalJet * GetLeadingJet(const char *opt="")
Bool_t Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.
int Int_t
Definition: External.C:63
MainPatchType fMainPatchType
correlation between jets, patch energy and event observables
float Float_t
Definition: External.C:68
Double_t fCent
!event centrality
AliEMCALTriggerPatchInfo * GetMainTriggerPatch(TriggerCategory triggersel=kTriggerLevel1Jet, Bool_t doSimpleOffline=kFALSE)
Get main trigger match.
Double_t Pt() const
Definition: AliEmcalJet.h:109
Double_t GetRhoVal(Int_t i=0) const
AliEmcalList * fOutput
!output list
Definition: External.C:220
void SetMakeGeneralHistograms(Bool_t g)
TClonesArray * fTriggerPatchInfo
!trigger patch info array
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:51
const char Option_t
Definition: External.C:48
void UserCreateOutputObjects()
Main initialization function on the worker.
bool Bool_t
Definition: External.C:53
Definition: External.C:196