AliPhysics  b43479f (b43479f)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliEmcalJetUtilityGenSubtractor.cxx
Go to the documentation of this file.
2 #include "AliEmcalJet.h"
3 #include "AliRhoParameter.h"
4 #include "AliEmcalJetTask.h"
5 
7 
8 //______________________________________________________________________________
11  fDoGenericSubtractionJetMass(kFALSE),
12  fDoGenericSubtractionGR(kFALSE),
13  fDoGenericSubtractionExtraJetShapes(kFALSE),
14  fUseExternalBkg(kFALSE),
15  fRhoName(""),
16  fRhomName(""),
17  fRho(0),
18  fRhom(0),
19  fRMax(0.4),
20  fDRStep(0.04),
21  fPtMinGR(40.),
22  fRhoParam(0),
23  fRhomParam(0)
24 {
25  // Dummy constructor.
26 
27 }
28 
29 //______________________________________________________________________________
31  AliEmcalJetUtility(name),
32  fDoGenericSubtractionJetMass(kFALSE),
33  fDoGenericSubtractionGR(kFALSE),
34  fDoGenericSubtractionExtraJetShapes(kFALSE),
35  fUseExternalBkg(kFALSE),
36  fRhoName(""),
37  fRhomName(""),
38  fRho(0),
39  fRhom(0),
40  fRMax(0.4),
41  fDRStep(0.04),
42  fPtMinGR(40.),
43  fRhoParam(0),
44  fRhomParam(0)
45 {
46  // Default constructor.
47 }
48 
49 //______________________________________________________________________________
51  AliEmcalJetUtility(other),
52  fDoGenericSubtractionJetMass(other.fDoGenericSubtractionJetMass),
53  fDoGenericSubtractionGR(other.fDoGenericSubtractionGR),
54  fDoGenericSubtractionExtraJetShapes(other.fDoGenericSubtractionExtraJetShapes),
55  fUseExternalBkg(other.fUseExternalBkg),
56  fRhoName(other.fRhoName),
57  fRhomName(other.fRhomName),
58  fRho(other.fRho),
59  fRhom(other.fRhom),
60  fRMax(other.fRMax),
61  fDRStep(other.fDRStep),
62  fPtMinGR(other.fPtMinGR),
63  fRhoParam(other.fRhoParam),
64  fRhomParam(other.fRhomParam)
65 {
66  // Copy constructor.
67 }
68 
69 //______________________________________________________________________________
71 {
72  // Assignment.
73 
74  if (&other == this) return *this;
80  fRhoName = other.fRhoName;
81  fRhomName = other.fRhomName;
82  fRho = other.fRho;
83  fRhom = other.fRhom;
84  fRMax = other.fRMax;
85  fDRStep = other.fDRStep;
86  fPtMinGR = other.fPtMinGR;
87  fRhoParam = other.fRhoParam;
88  fRhomParam = other.fRhomParam;
89  return *this;
90 }
91 
92 //______________________________________________________________________________
94 {
95  // Initialize the utility.
96 
97  if (!fRhoName.IsNull() && !fRhoParam) { // get rho from the event
98  if(!fJetTask) return;
99  fRhoParam = dynamic_cast<AliRhoParameter*>(fJetTask->InputEvent()->FindListObject(fRhoName));
100  if (!fRhoParam) {
101  AliError(Form("%s: Could not retrieve rho %s!", GetName(), fRhoName.Data()));
102  return;
103  }
104  }
105 
106  if (!fRhomName.IsNull() && !fRhomParam) { // get rhom from the event
107  fRhomParam = dynamic_cast<AliRhoParameter*>(fJetTask->InputEvent()->FindListObject(fRhomName));
108  if (!fRhomParam) {
109  AliError(Form("%s: Could not retrieve rho_m %s!", GetName(), fRhomName.Data()));
110  return;
111  }
112  }
113 
114  fInit = kTRUE;
115 }
116 
117 //______________________________________________________________________________
119 {
120  // Prepare the utility.
121 
122  if (!fInit) return;
123 
124  if (fRhoParam) fRho = fRhoParam->GetVal();
125  if (fRhomParam) fRhom = fRhomParam->GetVal();
126 
127  //run generic subtractor
131  }
132 
141  }
142 }
143 
144 //______________________________________________________________________________
146 {
147  // Proceess each jet.
148 
149  if (!fInit) return;
150 
151 #ifdef FASTJET_VERSION
152 
154  std::vector<fastjet::contrib::GenericSubtractorInfo> jetMassInfo = fjw.GetGenSubtractorInfoJetMass();
155  Int_t n = (Int_t)jetMassInfo.size();
156  if(n > ij && n > 0) {
157  jet->SetFirstDerivative(jetMassInfo[ij].first_derivative());
158  jet->SetSecondDerivative(jetMassInfo[ij].second_derivative());
159  jet->SetFirstOrderSubtracted(jetMassInfo[ij].first_order_subtracted());
160  jet->SetSecondOrderSubtracted(jetMassInfo[ij].second_order_subtracted());
161  }
162  }
163 
164  //here do generic subtraction for angular structure function
165  Double_t ptcorr = jet->Pt()-fjw.GetJetArea(ij)*fRho;
166  if (fDoGenericSubtractionGR && ptcorr>fPtMinGR) {
168  fRMax = fJetTask->GetRadius()+0.2;
170  fjw.DoGenericSubtractionGR(ij);
171  std::vector<double> num = fjw.GetGRNumerator();
172  std::vector<double> den = fjw.GetGRDenominator();
173  std::vector<double> nums = fjw.GetGRNumeratorSub();
174  std::vector<double> dens = fjw.GetGRDenominatorSub();
175  //pass this to AliEmcalJet
176  jet->SetGRNumSize(num.size());
177  jet->SetGRDenSize(den.size());
178  jet->SetGRNumSubSize(nums.size());
179  jet->SetGRDenSubSize(dens.size());
180  Int_t nsize = (Int_t)num.size();
181  for (Int_t g = 0; g < nsize; ++g) {
182  jet->AddGRNumAt(num[g],g);
183  jet->AddGRNumSubAt(nums[g],g);
184  }
185  Int_t dsize = (Int_t)den.size();
186  for (Int_t g = 0; g < dsize; ++g) {
187  jet->AddGRDenAt(den[g], g);
188  jet->AddGRDenSubAt(dens[g], g);
189  }
190  }
191 
193  std::vector<fastjet::contrib::GenericSubtractorInfo> jetAngularityInfo = fjw.GetGenSubtractorInfoJetAngularity();
194  Int_t na = (Int_t)jetAngularityInfo.size();
195  if(na > ij && na > 0) {
196  jet->SetFirstDerivativeAngularity(jetAngularityInfo[ij].first_derivative());
197  jet->SetSecondDerivativeAngularity(jetAngularityInfo[ij].second_derivative());
198  jet->SetFirstOrderSubtractedAngularity(jetAngularityInfo[ij].first_order_subtracted());
199  jet->SetSecondOrderSubtractedAngularity(jetAngularityInfo[ij].second_order_subtracted());
200  }
201 
202  std::vector<fastjet::contrib::GenericSubtractorInfo> jetpTDInfo = fjw.GetGenSubtractorInfoJetpTD();
203  Int_t np = (Int_t)jetpTDInfo.size();
204  if(np > ij && np > 0) {
205  jet->SetFirstDerivativepTD(jetpTDInfo[ij].first_derivative());
206  jet->SetSecondDerivativepTD(jetpTDInfo[ij].second_derivative());
207  jet->SetFirstOrderSubtractedpTD(jetpTDInfo[ij].first_order_subtracted());
208  jet->SetSecondOrderSubtractedpTD(jetpTDInfo[ij].second_order_subtracted());
209  }
210 
211  std::vector<fastjet::contrib::GenericSubtractorInfo> jetCircularityInfo = fjw.GetGenSubtractorInfoJetCircularity();
212  Int_t nc = (Int_t)jetCircularityInfo.size();
213  if(nc > ij && nc > 0) {
214  jet->SetFirstDerivativeCircularity(jetCircularityInfo[ij].first_derivative());
215  jet->SetSecondDerivativeCircularity(jetCircularityInfo[ij].second_derivative());
216  jet->SetFirstOrderSubtractedCircularity(jetCircularityInfo[ij].first_order_subtracted());
217  jet->SetSecondOrderSubtractedCircularity(jetCircularityInfo[ij].second_order_subtracted());
218  }
219 
220  std::vector<fastjet::contrib::GenericSubtractorInfo> jetSigma2Info = fjw.GetGenSubtractorInfoJetSigma2();
221  Int_t ns = (Int_t)jetSigma2Info.size();
222  if (ns > ij && ns > 0) {
223  jet->SetFirstDerivativeSigma2(jetSigma2Info[ij].first_derivative());
224  jet->SetSecondDerivativeSigma2(jetSigma2Info[ij].second_derivative());
225  jet->SetFirstOrderSubtractedSigma2(jetSigma2Info[ij].first_order_subtracted());
226  jet->SetSecondOrderSubtractedSigma2(jetSigma2Info[ij].second_order_subtracted());
227  }
228 
229 
230  std::vector<fastjet::contrib::GenericSubtractorInfo> jetConstituentInfo = fjw.GetGenSubtractorInfoJetConstituent();
231  Int_t nco = (Int_t)jetConstituentInfo.size();
232  if(nco > ij && nco > 0) {
233  jet->SetFirstDerivativeConstituent(jetConstituentInfo[ij].first_derivative());
234  jet->SetSecondDerivativeConstituent(jetConstituentInfo[ij].second_derivative());
235  jet->SetFirstOrderSubtractedConstituent(jetConstituentInfo[ij].first_order_subtracted());
236  jet->SetSecondOrderSubtractedConstituent(jetConstituentInfo[ij].second_order_subtracted());
237  }
238 
239  std::vector<fastjet::contrib::GenericSubtractorInfo> jetLeSubInfo = fjw.GetGenSubtractorInfoJetLeSub();
240  Int_t nlsub = (Int_t)jetLeSubInfo.size();
241  if(nlsub > ij && nlsub > 0) {
242  jet->SetFirstDerivativeLeSub(jetLeSubInfo[ij].first_derivative());
243  jet->SetSecondDerivativeLeSub(jetLeSubInfo[ij].second_derivative());
244  jet->SetFirstOrderSubtractedLeSub(jetLeSubInfo[ij].first_order_subtracted());
245  jet->SetSecondOrderSubtractedLeSub(jetLeSubInfo[ij].second_order_subtracted());
246  }
247  }
248 
249 #endif
250 }
251 
252 //______________________________________________________________________________
254 {
255  // Run termination of the utility (after each event).
256 }
void SetSecondDerivativeConstituent(Double_t d)
Definition: AliEmcalJet.h:240
void SetSecondDerivativepTD(Double_t d)
Definition: AliEmcalJet.h:209
void SetRMaxAndStep(Double_t rmax, Double_t dr)
Definition: AliFJWrapper.h:100
void SetUseExternalBkg(Bool_t b, Double_t rho, Double_t rhom)
Definition: AliFJWrapper.h:99
void SetGRDenSubSize(UInt_t s)
Definition: AliEmcalJet.h:194
void SetSecondDerivativeCircularity(Double_t d)
Definition: AliEmcalJet.h:219
AliEmcalJetUtility & operator=(const AliEmcalJetUtility &jet)
virtual Int_t DoGenericSubtractionJetpTD()
void SetSecondOrderSubtractedSigma2(Double_t d)
Definition: AliEmcalJet.h:231
void SetFirstOrderSubtractedAngularity(Double_t d)
Definition: AliEmcalJet.h:200
void SetFirstOrderSubtractedSigma2(Double_t d)
Definition: AliEmcalJet.h:230
void SetFirstOrderSubtractedLeSub(Double_t d)
Definition: AliEmcalJet.h:251
void SetGRDenSize(UInt_t s)
Definition: AliEmcalJet.h:189
virtual Int_t DoGenericSubtractionJetAngularity()
virtual Int_t DoGenericSubtractionGR(Int_t ijet)
virtual Int_t DoGenericSubtractionJetMass()
Double_t GetRadius()
void SetFirstDerivativeAngularity(Double_t d)
Definition: AliEmcalJet.h:198
void SetSecondDerivativeLeSub(Double_t d)
Definition: AliEmcalJet.h:250
void SetGRNumSize(UInt_t s)
Definition: AliEmcalJet.h:188
void SetSecondOrderSubtractedLeSub(Double_t d)
Definition: AliEmcalJet.h:252
void SetFirstOrderSubtractedConstituent(Double_t d)
Definition: AliEmcalJet.h:241
void SetFirstOrderSubtracted(Double_t d)
Definition: AliEmcalJet.h:174
void ProcessJet(AliEmcalJet *jet, Int_t ij, AliFJWrapper &fjw)
Double_t GetJetArea(UInt_t idx) const
void AddGRDenAt(Float_t den, Int_t idx)
Definition: AliEmcalJet.h:187
void SetFirstDerivativeSigma2(Double_t d)
Definition: AliEmcalJet.h:228
void AddGRNumAt(Float_t num, Int_t idx)
Definition: AliEmcalJet.h:186
void SetSecondOrderSubtractedAngularity(Double_t d)
Definition: AliEmcalJet.h:201
virtual Int_t DoGenericSubtractionJetCircularity()
void SetSecondOrderSubtracted(Double_t d)
Definition: AliEmcalJet.h:175
void SetFirstDerivativepTD(Double_t d)
Definition: AliEmcalJet.h:208
void SetFirstDerivativeCircularity(Double_t d)
Definition: AliEmcalJet.h:218
void SetSecondOrderSubtractedConstituent(Double_t d)
Definition: AliEmcalJet.h:242
AliEmcalJetUtilityGenSubtractor & operator=(const AliEmcalJetUtilityGenSubtractor &jet)
ClassImp(AliEmcalJetUtilityGenSubtractor) AliEmcalJetUtilityGenSubtractor
void SetFirstDerivativeLeSub(Double_t d)
Definition: AliEmcalJet.h:249
virtual std::vector< double > GetGRNumeratorSub() const
Definition: AliFJWrapper.h:61
Double_t Pt() const
Definition: AliEmcalJet.h:47
void SetSecondDerivativeAngularity(Double_t d)
Definition: AliEmcalJet.h:199
AliEmcalJetTask * fJetTask
void SetGRNumSubSize(UInt_t s)
Definition: AliEmcalJet.h:193
virtual Int_t DoGenericSubtractionJetSigma2()
void AddGRNumSubAt(Float_t num, Int_t idx)
Definition: AliEmcalJet.h:191
void SetSecondOrderSubtractedpTD(Double_t d)
Definition: AliEmcalJet.h:211
void AddGRDenSubAt(Float_t den, Int_t idx)
Definition: AliEmcalJet.h:192
void SetFirstOrderSubtractedpTD(Double_t d)
Definition: AliEmcalJet.h:210
virtual std::vector< double > GetGRDenominatorSub() const
Definition: AliFJWrapper.h:62
void SetFirstDerivative(Double_t d)
Definition: AliEmcalJet.h:172
void SetSecondOrderSubtractedCircularity(Double_t d)
Definition: AliEmcalJet.h:221
virtual std::vector< double > GetGRDenominator() const
Definition: AliFJWrapper.h:60
void SetSecondDerivativeSigma2(Double_t d)
Definition: AliEmcalJet.h:229
void SetFirstOrderSubtractedCircularity(Double_t d)
Definition: AliEmcalJet.h:220
virtual std::vector< double > GetGRNumerator() const
Definition: AliFJWrapper.h:59
void SetSecondDerivative(Double_t d)
Definition: AliEmcalJet.h:173
void SetFirstDerivativeConstituent(Double_t d)
Definition: AliEmcalJet.h:239
virtual Int_t DoGenericSubtractionJetLeSub()
virtual Int_t DoGenericSubtractionJetConstituent()