AliPhysics  68dfc25 (68dfc25)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskEmcalJetCDF.h
Go to the documentation of this file.
1 #ifndef ALIANALYSISTASKEMCALJETCDF_H
2 #define ALIANALYSISTASKEMCALJETCDF_H
3 
9 /* Copyright(c) 1998-2016, ALICE Experiment at CERN, All rights reserved. *
10  * See cxx source for full Copyright notice */
11 
12 #include <TH1D.h>
13 #include <TH2D.h>
14 #include <TArrayD.h>
15 #include <TVector2.h>
17 #include <THistManager.h>
18 
25 public:
26 
28  AliAnalysisTaskEmcalJetCDF ( const char *name );
30 
32  void Terminate ( Option_t *option );
33 
35 
36 protected:
37  void ExecOnce();
38  Bool_t Run() ;
39 
43 
47  TObject* GetHistogram ( const char* histName );
48 
49 private:
50  AliAnalysisTaskEmcalJetCDF ( const AliAnalysisTaskEmcalJetCDF& ); // not implemented
52 
54  ClassDef ( AliAnalysisTaskEmcalJetCDF, 8 );
56 
57 };
58 
59 namespace NS_AliAnalysisTaskEmcalJetCDF {
61  typedef std::pair<Double_t, Int_t> ptidx_pair;
62 
64  struct sort_descend
65  {
66  bool operator () ( const ptidx_pair &p1, const ptidx_pair &p2 ) { return p1.first > p2.first ; }
67  };
68 
72  inline Double_t Mag2 (const AliVParticle& trk)
73  { return trk.Px()*trk.Px() + trk.Py()*trk.Py() + trk.Pz()*trk.Pz(); }
74 
78  inline Double_t Mag(const AliVParticle& trk) { return TMath::Sqrt(Mag2(trk)); }
79 
84  inline Double_t Dot (const AliVParticle& trk1, const AliVParticle& trk2 )
85  { return trk1.Px()*trk2.Px() + trk1.Py()*trk2.Py() + trk1.Pz()*trk2.Pz(); }
86 
91  inline Double_t Perp2( const AliVParticle& trk1, const AliVParticle& trk2) {
92  Double_t mag1 = Mag2(trk1);
93  Double_t mag2 = Mag2(trk2);
94  Double_t dotp = Dot(trk1,trk2);
95  if (mag2 > 0.0) { mag1 -= dotp*dotp/mag2; }
96  if (mag1 <= 0) { mag1 = 0; }
97  return mag1;
98  }
99 
104  inline Double_t Perp (const AliVParticle& trk1, const AliVParticle& trk2 ) { return TMath::Sqrt(Perp2(trk1,trk2)); }
105 
109  std::vector<Int_t> SortTracksPt ( AliVEvent* event );
110 
114  std::vector<Int_t> SortTracksPt ( AliParticleContainer* track_container );
115 
120  inline Double_t Z_ptot ( const AliEmcalJet* jet, const AliVParticle* trk ) // Get Z of constituent trk ; p total
121  {
122  if (trk->P() < 1e-6) return 0.;
123  return (trk != 0) ? trk->P()/ jet->P() : 0.;
124  }
125 
130  inline Double_t Z_pt ( const AliEmcalJet* jet, const AliVParticle* trk ) // Get Z of constituent trk ; pt
131  {
132  if (trk->P() < 1e-6) return 0.;
133  return (trk != 0) ? trk->Pt() / jet->Pt() : 0.;
134  }
135 
138  inline Double_t Xi ( Double_t z ) { return TMath::Log ( 1/z ); } // Get Xi of value z
139 
144  inline Double_t DeltaR ( const AliVParticle* part1, const AliVParticle* part2 )
145  {
146  Double_t dPhi = part1->Phi() - part2->Phi();
147  Double_t dEta = part1->Eta() - part2->Eta();
148  dPhi = TVector2::Phi_mpi_pi ( dPhi );
149  return TMath::Sqrt ( dPhi * dPhi + dEta * dEta );
150  }
151 
156  inline Int_t IdxInArray ( Int_t index, TArrayI &array )
157  {
158  for ( Int_t i = 0; i < array.GetSize(); i++ ) { if ( index == array[i] ) { return i; } }
159  return -1;
160  }
161 
169  const char* ntracks = "usedefault",
170  const char* nclusters = "usedefault",
171  const char* ncells = "usedefault",
172  const char* tag = "CDF"
173  );
174 
185  void jetContSetParams (
186  AliJetContainer* jetCont,
187  Float_t jetptmin = 1.,
188  Float_t jetptmax = 500.,
189  Float_t jetareacutperc = 0.,
190  Int_t leadhadtype = 2,
191  Int_t nLeadJets = 1,
192  Float_t mintrackpt = 0.15,
193  Float_t maxtrackpt = 1000.
194  );
195 
196 } // end of NS_AliAnalysisTaskEmcalJetCDF
197 
198 #endif // end of #ifndef ALIANALYSISTASKEMCALJETCDF_H
199 
200 // kate: indent-mode none; indent-width 2; replace-tabs on;
THistManager fHistManager
Histogram manager.
std::pair< Double_t, Int_t > ptidx_pair
(pt,index) pair
double Double_t
Definition: External.C:58
std::vector< Int_t > SortTracksPt(AliVEvent *event)
void jetContSetParams(AliJetContainer *jetCont, Float_t jetptmin=1., Float_t jetptmax=500., Float_t jetareacutperc=0., Int_t leadhadtype=2, Int_t nLeadJets=1, Float_t mintrackpt=0.15, Float_t maxtrackpt=1000.)
Container for particles within the EMCAL framework.
Double_t Dot(const AliVParticle &trk1, const AliVParticle &trk2)
int Int_t
Definition: External.C:63
float Float_t
Definition: External.C:68
TObject * GetHistogram(const char *histName)
Double_t Z_pt(const AliEmcalJet *jet, const AliVParticle *trk)
AliAnalysisTaskEmcalJetCDF * AddTaskEmcalJetCDF(const char *ntracks="usedefault", const char *nclusters="usedefault", const char *ncells="usedefault", const char *tag="CDF")
Double_t Mag(const AliVParticle &trk)
Double_t Perp(const AliVParticle &trk1, const AliVParticle &trk2)
Double_t Pt() const
Definition: AliEmcalJet.h:102
virtual ~AliAnalysisTaskEmcalJetCDF()
Destructor.
Double_t P() const
Definition: AliEmcalJet.h:103
Double_t DeltaR(const AliVParticle *part1, const AliVParticle *part2)
Int_t IdxInArray(Int_t index, TArrayI &array)
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:44
Container class for histograms.
Definition: THistManager.h:99
functional for sorting pair by first element - descending
Double_t Perp2(const AliVParticle &trk1, const AliVParticle &trk2)
const char Option_t
Definition: External.C:48
bool Bool_t
Definition: External.C:53
AliAnalysisTaskEmcalJetCDF & operator=(const AliAnalysisTaskEmcalJetCDF &)
Double_t Z_ptot(const AliEmcalJet *jet, const AliVParticle *trk)
Container for jet within the EMCAL jet framework.
bool operator()(const ptidx_pair &p1, const ptidx_pair &p2)
Analysis of jet shapes and FF of all jets and leading jets.
Double_t Mag2(const AliVParticle &trk)