AliPhysics  421aab4 (421aab4)
 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  fDoGenericSubtractionNsubjettiness(kFALSE),
15  fUseExternalBkg(kFALSE),
16  fRhoName(""),
17  fRhomName(""),
18  fRho(0),
19  fRhom(0),
20  fRMax(0.4),
21  fDRStep(0.04),
22  fPtMinGR(40.),
23  fRhoParam(0),
24  fRhomParam(0)
25 {
26  // Dummy constructor.
27 
28 }
29 
30 //______________________________________________________________________________
32  AliEmcalJetUtility(name),
33  fDoGenericSubtractionJetMass(kFALSE),
34  fDoGenericSubtractionGR(kFALSE),
35  fDoGenericSubtractionExtraJetShapes(kFALSE),
36  fDoGenericSubtractionNsubjettiness(kFALSE),
37  fUseExternalBkg(kFALSE),
38  fRhoName(""),
39  fRhomName(""),
40  fRho(0),
41  fRhom(0),
42  fRMax(0.4),
43  fDRStep(0.04),
44  fPtMinGR(40.),
45  fRhoParam(0),
46  fRhomParam(0)
47 {
48  // Default constructor.
49 }
50 
51 //______________________________________________________________________________
53  AliEmcalJetUtility(other),
54  fDoGenericSubtractionJetMass(other.fDoGenericSubtractionJetMass),
55  fDoGenericSubtractionGR(other.fDoGenericSubtractionGR),
56  fDoGenericSubtractionExtraJetShapes(other.fDoGenericSubtractionExtraJetShapes),
57  fDoGenericSubtractionNsubjettiness(other.fDoGenericSubtractionNsubjettiness),
58  fUseExternalBkg(other.fUseExternalBkg),
59  fRhoName(other.fRhoName),
60  fRhomName(other.fRhomName),
61  fRho(other.fRho),
62  fRhom(other.fRhom),
63  fRMax(other.fRMax),
64  fDRStep(other.fDRStep),
65  fPtMinGR(other.fPtMinGR),
66  fRhoParam(other.fRhoParam),
67  fRhomParam(other.fRhomParam)
68 {
69  // Copy constructor.
70 }
71 
72 //______________________________________________________________________________
74 {
75  // Assignment.
76 
77  if (&other == this) return *this;
84  fRhoName = other.fRhoName;
85  fRhomName = other.fRhomName;
86  fRho = other.fRho;
87  fRhom = other.fRhom;
88  fRMax = other.fRMax;
89  fDRStep = other.fDRStep;
90  fPtMinGR = other.fPtMinGR;
91  fRhoParam = other.fRhoParam;
92  fRhomParam = other.fRhomParam;
93  return *this;
94 }
95 
96 //______________________________________________________________________________
98 {
99  // Initialize the utility.
100 
101  if (!fRhoName.IsNull() && !fRhoParam) { // get rho from the event
102  if(!fJetTask) return;
103  fRhoParam = dynamic_cast<AliRhoParameter*>(fJetTask->InputEvent()->FindListObject(fRhoName));
104  if (!fRhoParam) {
105  AliError(Form("%s: Could not retrieve rho %s!", GetName(), fRhoName.Data()));
106  return;
107  }
108  }
109 
110  if (!fRhomName.IsNull() && !fRhomParam) { // get rhom from the event
111  fRhomParam = dynamic_cast<AliRhoParameter*>(fJetTask->InputEvent()->FindListObject(fRhomName));
112  if (!fRhomParam) {
113  AliError(Form("%s: Could not retrieve rho_m %s!", GetName(), fRhomName.Data()));
114  return;
115  }
116  }
117 
118  fInit = kTRUE;
119 }
120 
121 
122 //______________________________________________________________________________
124 {
125  // Prepare the utility.
126 
127 }
128 
129 //______________________________________________________________________________
131 {
132  // Prepare the utility.
133 
134  if (!fInit) return;
135 
136  if (fRhoParam) fRho = fRhoParam->GetVal();
137  if (fRhomParam) fRhom = fRhomParam->GetVal();
138 
139  //run generic subtractor
143  }
144 
153  }
154 
161  }
162 }
163 
164 //______________________________________________________________________________
166 {
167  // Proceess each jet.
168 
169  if (!fInit) return;
170 
171 #ifdef FASTJET_VERSION
172 
174  std::vector<fastjet::contrib::GenericSubtractorInfo> jetMassInfo = fjw.GetGenSubtractorInfoJetMass();
175  Int_t n = (Int_t)jetMassInfo.size();
176  if(n > ij && n > 0) {
177  jet->GetShapeProperties()->SetFirstDerivative(jetMassInfo[ij].first_derivative());
178  jet->GetShapeProperties()->SetSecondDerivative(jetMassInfo[ij].second_derivative());
179  jet->GetShapeProperties()->SetFirstOrderSubtracted(jetMassInfo[ij].first_order_subtracted());
180  jet->GetShapeProperties()->SetSecondOrderSubtracted(jetMassInfo[ij].second_order_subtracted());
181  }
182  }
183 
184  //here do generic subtraction for angular structure function
185  Double_t ptcorr = jet->Pt()-fjw.GetJetArea(ij)*fRho;
186  if (fDoGenericSubtractionGR && ptcorr>fPtMinGR) {
188  fRMax = fJetTask->GetRadius()+0.2;
190  fjw.DoGenericSubtractionGR(ij);
191  std::vector<double> num = fjw.GetGRNumerator();
192  std::vector<double> den = fjw.GetGRDenominator();
193  std::vector<double> nums = fjw.GetGRNumeratorSub();
194  std::vector<double> dens = fjw.GetGRDenominatorSub();
195  //pass this to AliEmcalJet
196  jet->GetShapeProperties()->SetGRNumSize(num.size());
197  jet->GetShapeProperties()->SetGRDenSize(den.size());
198  jet->GetShapeProperties()->SetGRNumSubSize(nums.size());
199  jet->GetShapeProperties()->SetGRDenSubSize(dens.size());
200  Int_t nsize = (Int_t)num.size();
201  for (Int_t g = 0; g < nsize; ++g) {
202  jet->GetShapeProperties()->AddGRNumAt(num[g],g);
203  jet->GetShapeProperties()->AddGRNumSubAt(nums[g],g);
204  }
205  Int_t dsize = (Int_t)den.size();
206  for (Int_t g = 0; g < dsize; ++g) {
207  jet->GetShapeProperties()->AddGRDenAt(den[g], g);
208  jet->GetShapeProperties()->AddGRDenSubAt(dens[g], g);
209  }
210  }
211 
213  std::vector<fastjet::contrib::GenericSubtractorInfo> jetAngularityInfo = fjw.GetGenSubtractorInfoJetAngularity();
214  Int_t na = (Int_t)jetAngularityInfo.size();
215  if(na > ij && na > 0) {
216  jet->GetShapeProperties()->SetFirstDerivativeAngularity(jetAngularityInfo[ij].first_derivative());
217  jet->GetShapeProperties()->SetSecondDerivativeAngularity(jetAngularityInfo[ij].second_derivative());
218  jet->GetShapeProperties()->SetFirstOrderSubtractedAngularity(jetAngularityInfo[ij].first_order_subtracted());
219  jet->GetShapeProperties()->SetSecondOrderSubtractedAngularity(jetAngularityInfo[ij].second_order_subtracted());
220  }
221 
222  std::vector<fastjet::contrib::GenericSubtractorInfo> jetpTDInfo = fjw.GetGenSubtractorInfoJetpTD();
223  Int_t np = (Int_t)jetpTDInfo.size();
224  if(np > ij && np > 0) {
225  jet->GetShapeProperties()->SetFirstDerivativepTD(jetpTDInfo[ij].first_derivative());
226  jet->GetShapeProperties()->SetSecondDerivativepTD(jetpTDInfo[ij].second_derivative());
227  jet->GetShapeProperties()->SetFirstOrderSubtractedpTD(jetpTDInfo[ij].first_order_subtracted());
228  jet->GetShapeProperties()->SetSecondOrderSubtractedpTD(jetpTDInfo[ij].second_order_subtracted());
229  }
230 
231  std::vector<fastjet::contrib::GenericSubtractorInfo> jetCircularityInfo = fjw.GetGenSubtractorInfoJetCircularity();
232  Int_t nc = (Int_t)jetCircularityInfo.size();
233  if(nc > ij && nc > 0) {
234  jet->GetShapeProperties()->SetFirstDerivativeCircularity(jetCircularityInfo[ij].first_derivative());
235  jet->GetShapeProperties()->SetSecondDerivativeCircularity(jetCircularityInfo[ij].second_derivative());
236  jet->GetShapeProperties()->SetFirstOrderSubtractedCircularity(jetCircularityInfo[ij].first_order_subtracted());
237  jet->GetShapeProperties()->SetSecondOrderSubtractedCircularity(jetCircularityInfo[ij].second_order_subtracted());
238  }
239 
240  std::vector<fastjet::contrib::GenericSubtractorInfo> jetSigma2Info = fjw.GetGenSubtractorInfoJetSigma2();
241  Int_t ns = (Int_t)jetSigma2Info.size();
242  if (ns > ij && ns > 0) {
243  jet->GetShapeProperties()->SetFirstDerivativeSigma2(jetSigma2Info[ij].first_derivative());
244  jet->GetShapeProperties()->SetSecondDerivativeSigma2(jetSigma2Info[ij].second_derivative());
245  jet->GetShapeProperties()->SetFirstOrderSubtractedSigma2(jetSigma2Info[ij].first_order_subtracted());
246  jet->GetShapeProperties()->SetSecondOrderSubtractedSigma2(jetSigma2Info[ij].second_order_subtracted());
247  }
248 
249 
250  std::vector<fastjet::contrib::GenericSubtractorInfo> jetConstituentInfo = fjw.GetGenSubtractorInfoJetConstituent();
251  Int_t nco = (Int_t)jetConstituentInfo.size();
252  if(nco > ij && nco > 0) {
253  jet->GetShapeProperties()->SetFirstDerivativeConstituent(jetConstituentInfo[ij].first_derivative());
254  jet->GetShapeProperties()->SetSecondDerivativeConstituent(jetConstituentInfo[ij].second_derivative());
255  jet->GetShapeProperties()->SetFirstOrderSubtractedConstituent(jetConstituentInfo[ij].first_order_subtracted());
256  jet->GetShapeProperties()->SetSecondOrderSubtractedConstituent(jetConstituentInfo[ij].second_order_subtracted());
257  }
258 
259  std::vector<fastjet::contrib::GenericSubtractorInfo> jetLeSubInfo = fjw.GetGenSubtractorInfoJetLeSub();
260  Int_t nlsub = (Int_t)jetLeSubInfo.size();
261  if(nlsub > ij && nlsub > 0) {
262  jet->GetShapeProperties()->SetFirstDerivativeLeSub(jetLeSubInfo[ij].first_derivative());
263  jet->GetShapeProperties()->SetSecondDerivativeLeSub(jetLeSubInfo[ij].second_derivative());
264  jet->GetShapeProperties()->SetFirstOrderSubtractedLeSub(jetLeSubInfo[ij].first_order_subtracted());
265  jet->GetShapeProperties()->SetSecondOrderSubtractedLeSub(jetLeSubInfo[ij].second_order_subtracted());
266  }
267  }
268 
270  std::vector<fastjet::contrib::GenericSubtractorInfo> jet1subjettinessktInfo = fjw.GetGenSubtractorInfoJet1subjettiness_kt();
271  Int_t n1subjettiness_kt = (Int_t)jet1subjettinessktInfo.size();
272  if(n1subjettiness_kt > ij && n1subjettiness_kt > 0) {
273  jet->GetShapeProperties()->SetFirstDerivative1subjettiness_kt(jet1subjettinessktInfo[ij].first_derivative());
274  jet->GetShapeProperties()->SetSecondDerivative1subjettiness_kt(jet1subjettinessktInfo[ij].second_derivative());
275  jet->GetShapeProperties()->SetFirstOrderSubtracted1subjettiness_kt(jet1subjettinessktInfo[ij].first_order_subtracted());
276  jet->GetShapeProperties()->SetSecondOrderSubtracted1subjettiness_kt(jet1subjettinessktInfo[ij].second_order_subtracted());
277  }
278 
279  std::vector<fastjet::contrib::GenericSubtractorInfo> jet2subjettinessktInfo = fjw.GetGenSubtractorInfoJet2subjettiness_kt();
280  Int_t n2subjettiness_kt = (Int_t)jet2subjettinessktInfo.size();
281  if(n2subjettiness_kt > ij && n2subjettiness_kt > 0) {
282  jet->GetShapeProperties()->SetFirstDerivative2subjettiness_kt(jet2subjettinessktInfo[ij].first_derivative());
283  jet->GetShapeProperties()->SetSecondDerivative2subjettiness_kt(jet2subjettinessktInfo[ij].second_derivative());
284  jet->GetShapeProperties()->SetFirstOrderSubtracted2subjettiness_kt(jet2subjettinessktInfo[ij].first_order_subtracted());
285  jet->GetShapeProperties()->SetSecondOrderSubtracted2subjettiness_kt(jet2subjettinessktInfo[ij].second_order_subtracted());
286  }
287 
288  std::vector<fastjet::contrib::GenericSubtractorInfo> jet3subjettinessktInfo = fjw.GetGenSubtractorInfoJet3subjettiness_kt();
289  Int_t n3subjettiness_kt = (Int_t)jet3subjettinessktInfo.size();
290  if(n3subjettiness_kt > ij && n3subjettiness_kt > 0) {
291  jet->GetShapeProperties()->SetFirstDerivative3subjettiness_kt(jet3subjettinessktInfo[ij].first_derivative());
292  jet->GetShapeProperties()->SetSecondDerivative3subjettiness_kt(jet3subjettinessktInfo[ij].second_derivative());
293  jet->GetShapeProperties()->SetFirstOrderSubtracted3subjettiness_kt(jet3subjettinessktInfo[ij].first_order_subtracted());
294  jet->GetShapeProperties()->SetSecondOrderSubtracted3subjettiness_kt(jet3subjettinessktInfo[ij].second_order_subtracted());
295  }
296 
297  std::vector<fastjet::contrib::GenericSubtractorInfo> jetOpeningAnglektInfo = fjw.GetGenSubtractorInfoJetOpeningAngle_kt();
298  Int_t nOpeningAngle_kt = (Int_t)jetOpeningAnglektInfo.size();
299  if(nOpeningAngle_kt > ij && nOpeningAngle_kt > 0) {
300  jet->GetShapeProperties()->SetFirstDerivativeOpeningAngle_kt(jetOpeningAnglektInfo[ij].first_derivative());
301  jet->GetShapeProperties()->SetSecondDerivativeOpeningAngle_kt(jetOpeningAnglektInfo[ij].second_derivative());
302  jet->GetShapeProperties()->SetFirstOrderSubtractedOpeningAngle_kt(jetOpeningAnglektInfo[ij].first_order_subtracted());
303  jet->GetShapeProperties()->SetSecondOrderSubtractedOpeningAngle_kt(jetOpeningAnglektInfo[ij].second_order_subtracted());
304  }
305  }
306 
307 #endif
308 }
309 
310 //______________________________________________________________________________
312 {
313  // Run termination of the utility (after each event).
314 }
void SetRMaxAndStep(Double_t rmax, Double_t dr)
Definition: AliFJWrapper.h:121
void SetUseExternalBkg(Bool_t b, Double_t rho, Double_t rhom)
Definition: AliFJWrapper.h:120
void AddGRNumAt(Float_t num, Int_t idx)
double Double_t
Definition: External.C:58
void SetFirstDerivative1subjettiness_kt(Double_t d)
AliEmcalJetUtility & operator=(const AliEmcalJetUtility &jet)
void SetFirstOrderSubtractedAngularity(Double_t d)
virtual Int_t DoGenericSubtractionJetOpeningAngle_kt()
virtual Int_t DoGenericSubtractionJetpTD()
void SetFirstOrderSubtracted1subjettiness_kt(Double_t d)
void SetSecondOrderSubtractedOpeningAngle_kt(Double_t d)
void SetSecondDerivativeOpeningAngle_kt(Double_t d)
void SetSecondOrderSubtracted3subjettiness_kt(Double_t d)
virtual Int_t DoGenericSubtractionJetAngularity()
virtual Int_t DoGenericSubtractionGR(Int_t ijet)
virtual Int_t DoGenericSubtractionJetMass()
Double_t GetRadius()
void SetSecondOrderSubtractedCircularity(Double_t d)
void AddGRDenSubAt(Float_t den, Int_t idx)
void AddGRDenAt(Float_t den, Int_t idx)
int Int_t
Definition: External.C:63
void SetFirstDerivativeOpeningAngle_kt(Double_t d)
void ProcessJet(AliEmcalJet *jet, Int_t ij, AliFJWrapper &fjw)
void SetFirstOrderSubtracted3subjettiness_kt(Double_t d)
Double_t GetJetArea(UInt_t idx) const
void SetSecondOrderSubtracted2subjettiness_kt(Double_t d)
void AddGRNumSubAt(Float_t num, Int_t idx)
virtual Int_t DoGenericSubtractionJetCircularity()
void SetSecondDerivative1subjettiness_kt(Double_t d)
AliEmcalJetUtilityGenSubtractor & operator=(const AliEmcalJetUtilityGenSubtractor &jet)
ClassImp(AliEmcalJetUtilityGenSubtractor) AliEmcalJetUtilityGenSubtractor
void SetFirstOrderSubtracted2subjettiness_kt(Double_t d)
virtual std::vector< double > GetGRNumeratorSub() const
Definition: AliFJWrapper.h:76
virtual Int_t DoGenericSubtractionJet1subjettiness_kt()
Double_t Pt() const
Definition: AliEmcalJet.h:102
void SetSecondDerivative2subjettiness_kt(Double_t d)
AliEmcalJetTask * fJetTask
void SetFirstOrderSubtractedCircularity(Double_t d)
virtual Int_t DoGenericSubtractionJetSigma2()
virtual std::vector< double > GetGRDenominatorSub() const
Definition: AliFJWrapper.h:77
void SetSecondOrderSubtractedConstituent(Double_t d)
virtual std::vector< double > GetGRDenominator() const
Definition: AliFJWrapper.h:75
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:44
void SetFirstOrderSubtractedOpeningAngle_kt(Double_t d)
virtual Int_t DoGenericSubtractionJet3subjettiness_kt()
void SetFirstDerivative3subjettiness_kt(Double_t d)
AliEmcalJetShapeProperties * GetShapeProperties() const
Definition: AliEmcalJet.h:256
virtual std::vector< double > GetGRNumerator() const
Definition: AliFJWrapper.h:74
virtual Int_t DoGenericSubtractionJetLeSub()
void SetFirstDerivative2subjettiness_kt(Double_t d)
virtual Int_t DoGenericSubtractionJetConstituent()
void SetFirstOrderSubtractedConstituent(Double_t d)
void SetSecondDerivative3subjettiness_kt(Double_t d)
virtual Int_t DoGenericSubtractionJet2subjettiness_kt()
void SetSecondOrderSubtracted1subjettiness_kt(Double_t d)
void SetSecondOrderSubtractedAngularity(Double_t d)