AliPhysics  cdeda5a (cdeda5a)
 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 //______________________________________________________________________________
123 {
124  // Prepare the utility.
125 
126  if (!fInit) return;
127 
128  if (fRhoParam) fRho = fRhoParam->GetVal();
129  if (fRhomParam) fRhom = fRhomParam->GetVal();
130 
131  //run generic subtractor
135  }
136 
145  }
146 
153  }
154 }
155 
156 //______________________________________________________________________________
158 {
159  // Proceess each jet.
160 
161  if (!fInit) return;
162 
163 #ifdef FASTJET_VERSION
164 
166  std::vector<fastjet::contrib::GenericSubtractorInfo> jetMassInfo = fjw.GetGenSubtractorInfoJetMass();
167  Int_t n = (Int_t)jetMassInfo.size();
168  if(n > ij && n > 0) {
169  jet->GetShapeProperties()->SetFirstDerivative(jetMassInfo[ij].first_derivative());
170  jet->GetShapeProperties()->SetSecondDerivative(jetMassInfo[ij].second_derivative());
171  jet->GetShapeProperties()->SetFirstOrderSubtracted(jetMassInfo[ij].first_order_subtracted());
172  jet->GetShapeProperties()->SetSecondOrderSubtracted(jetMassInfo[ij].second_order_subtracted());
173  }
174  }
175 
176  //here do generic subtraction for angular structure function
177  Double_t ptcorr = jet->Pt()-fjw.GetJetArea(ij)*fRho;
178  if (fDoGenericSubtractionGR && ptcorr>fPtMinGR) {
180  fRMax = fJetTask->GetRadius()+0.2;
182  fjw.DoGenericSubtractionGR(ij);
183  std::vector<double> num = fjw.GetGRNumerator();
184  std::vector<double> den = fjw.GetGRDenominator();
185  std::vector<double> nums = fjw.GetGRNumeratorSub();
186  std::vector<double> dens = fjw.GetGRDenominatorSub();
187  //pass this to AliEmcalJet
188  jet->GetShapeProperties()->SetGRNumSize(num.size());
189  jet->GetShapeProperties()->SetGRDenSize(den.size());
190  jet->GetShapeProperties()->SetGRNumSubSize(nums.size());
191  jet->GetShapeProperties()->SetGRDenSubSize(dens.size());
192  Int_t nsize = (Int_t)num.size();
193  for (Int_t g = 0; g < nsize; ++g) {
194  jet->GetShapeProperties()->AddGRNumAt(num[g],g);
195  jet->GetShapeProperties()->AddGRNumSubAt(nums[g],g);
196  }
197  Int_t dsize = (Int_t)den.size();
198  for (Int_t g = 0; g < dsize; ++g) {
199  jet->GetShapeProperties()->AddGRDenAt(den[g], g);
200  jet->GetShapeProperties()->AddGRDenSubAt(dens[g], g);
201  }
202  }
203 
205  std::vector<fastjet::contrib::GenericSubtractorInfo> jetAngularityInfo = fjw.GetGenSubtractorInfoJetAngularity();
206  Int_t na = (Int_t)jetAngularityInfo.size();
207  if(na > ij && na > 0) {
208  jet->GetShapeProperties()->SetFirstDerivativeAngularity(jetAngularityInfo[ij].first_derivative());
209  jet->GetShapeProperties()->SetSecondDerivativeAngularity(jetAngularityInfo[ij].second_derivative());
210  jet->GetShapeProperties()->SetFirstOrderSubtractedAngularity(jetAngularityInfo[ij].first_order_subtracted());
211  jet->GetShapeProperties()->SetSecondOrderSubtractedAngularity(jetAngularityInfo[ij].second_order_subtracted());
212  }
213 
214  std::vector<fastjet::contrib::GenericSubtractorInfo> jetpTDInfo = fjw.GetGenSubtractorInfoJetpTD();
215  Int_t np = (Int_t)jetpTDInfo.size();
216  if(np > ij && np > 0) {
217  jet->GetShapeProperties()->SetFirstDerivativepTD(jetpTDInfo[ij].first_derivative());
218  jet->GetShapeProperties()->SetSecondDerivativepTD(jetpTDInfo[ij].second_derivative());
219  jet->GetShapeProperties()->SetFirstOrderSubtractedpTD(jetpTDInfo[ij].first_order_subtracted());
220  jet->GetShapeProperties()->SetSecondOrderSubtractedpTD(jetpTDInfo[ij].second_order_subtracted());
221  }
222 
223  std::vector<fastjet::contrib::GenericSubtractorInfo> jetCircularityInfo = fjw.GetGenSubtractorInfoJetCircularity();
224  Int_t nc = (Int_t)jetCircularityInfo.size();
225  if(nc > ij && nc > 0) {
226  jet->GetShapeProperties()->SetFirstDerivativeCircularity(jetCircularityInfo[ij].first_derivative());
227  jet->GetShapeProperties()->SetSecondDerivativeCircularity(jetCircularityInfo[ij].second_derivative());
228  jet->GetShapeProperties()->SetFirstOrderSubtractedCircularity(jetCircularityInfo[ij].first_order_subtracted());
229  jet->GetShapeProperties()->SetSecondOrderSubtractedCircularity(jetCircularityInfo[ij].second_order_subtracted());
230  }
231 
232  std::vector<fastjet::contrib::GenericSubtractorInfo> jetSigma2Info = fjw.GetGenSubtractorInfoJetSigma2();
233  Int_t ns = (Int_t)jetSigma2Info.size();
234  if (ns > ij && ns > 0) {
235  jet->GetShapeProperties()->SetFirstDerivativeSigma2(jetSigma2Info[ij].first_derivative());
236  jet->GetShapeProperties()->SetSecondDerivativeSigma2(jetSigma2Info[ij].second_derivative());
237  jet->GetShapeProperties()->SetFirstOrderSubtractedSigma2(jetSigma2Info[ij].first_order_subtracted());
238  jet->GetShapeProperties()->SetSecondOrderSubtractedSigma2(jetSigma2Info[ij].second_order_subtracted());
239  }
240 
241 
242  std::vector<fastjet::contrib::GenericSubtractorInfo> jetConstituentInfo = fjw.GetGenSubtractorInfoJetConstituent();
243  Int_t nco = (Int_t)jetConstituentInfo.size();
244  if(nco > ij && nco > 0) {
245  jet->GetShapeProperties()->SetFirstDerivativeConstituent(jetConstituentInfo[ij].first_derivative());
246  jet->GetShapeProperties()->SetSecondDerivativeConstituent(jetConstituentInfo[ij].second_derivative());
247  jet->GetShapeProperties()->SetFirstOrderSubtractedConstituent(jetConstituentInfo[ij].first_order_subtracted());
248  jet->GetShapeProperties()->SetSecondOrderSubtractedConstituent(jetConstituentInfo[ij].second_order_subtracted());
249  }
250 
251  std::vector<fastjet::contrib::GenericSubtractorInfo> jetLeSubInfo = fjw.GetGenSubtractorInfoJetLeSub();
252  Int_t nlsub = (Int_t)jetLeSubInfo.size();
253  if(nlsub > ij && nlsub > 0) {
254  jet->GetShapeProperties()->SetFirstDerivativeLeSub(jetLeSubInfo[ij].first_derivative());
255  jet->GetShapeProperties()->SetSecondDerivativeLeSub(jetLeSubInfo[ij].second_derivative());
256  jet->GetShapeProperties()->SetFirstOrderSubtractedLeSub(jetLeSubInfo[ij].first_order_subtracted());
257  jet->GetShapeProperties()->SetSecondOrderSubtractedLeSub(jetLeSubInfo[ij].second_order_subtracted());
258  }
259  }
260 
262  std::vector<fastjet::contrib::GenericSubtractorInfo> jet1subjettinessktInfo = fjw.GetGenSubtractorInfoJet1subjettiness_kt();
263  Int_t n1subjettiness_kt = (Int_t)jet1subjettinessktInfo.size();
264  if(n1subjettiness_kt > ij && n1subjettiness_kt > 0) {
265  jet->GetShapeProperties()->SetFirstDerivative1subjettiness_kt(jet1subjettinessktInfo[ij].first_derivative());
266  jet->GetShapeProperties()->SetSecondDerivative1subjettiness_kt(jet1subjettinessktInfo[ij].second_derivative());
267  jet->GetShapeProperties()->SetFirstOrderSubtracted1subjettiness_kt(jet1subjettinessktInfo[ij].first_order_subtracted());
268  jet->GetShapeProperties()->SetSecondOrderSubtracted1subjettiness_kt(jet1subjettinessktInfo[ij].second_order_subtracted());
269  }
270 
271  std::vector<fastjet::contrib::GenericSubtractorInfo> jet2subjettinessktInfo = fjw.GetGenSubtractorInfoJet2subjettiness_kt();
272  Int_t n2subjettiness_kt = (Int_t)jet2subjettinessktInfo.size();
273  if(n2subjettiness_kt > ij && n2subjettiness_kt > 0) {
274  jet->GetShapeProperties()->SetFirstDerivative2subjettiness_kt(jet2subjettinessktInfo[ij].first_derivative());
275  jet->GetShapeProperties()->SetSecondDerivative2subjettiness_kt(jet2subjettinessktInfo[ij].second_derivative());
276  jet->GetShapeProperties()->SetFirstOrderSubtracted2subjettiness_kt(jet2subjettinessktInfo[ij].first_order_subtracted());
277  jet->GetShapeProperties()->SetSecondOrderSubtracted2subjettiness_kt(jet2subjettinessktInfo[ij].second_order_subtracted());
278  }
279 
280  std::vector<fastjet::contrib::GenericSubtractorInfo> jet3subjettinessktInfo = fjw.GetGenSubtractorInfoJet3subjettiness_kt();
281  Int_t n3subjettiness_kt = (Int_t)jet3subjettinessktInfo.size();
282  if(n3subjettiness_kt > ij && n3subjettiness_kt > 0) {
283  jet->GetShapeProperties()->SetFirstDerivative3subjettiness_kt(jet3subjettinessktInfo[ij].first_derivative());
284  jet->GetShapeProperties()->SetSecondDerivative3subjettiness_kt(jet3subjettinessktInfo[ij].second_derivative());
285  jet->GetShapeProperties()->SetFirstOrderSubtracted3subjettiness_kt(jet3subjettinessktInfo[ij].first_order_subtracted());
286  jet->GetShapeProperties()->SetSecondOrderSubtracted3subjettiness_kt(jet3subjettinessktInfo[ij].second_order_subtracted());
287  }
288 
289  std::vector<fastjet::contrib::GenericSubtractorInfo> jetOpeningAnglektInfo = fjw.GetGenSubtractorInfoJetOpeningAngle_kt();
290  Int_t nOpeningAngle_kt = (Int_t)jetOpeningAnglektInfo.size();
291  if(nOpeningAngle_kt > ij && nOpeningAngle_kt > 0) {
292  jet->GetShapeProperties()->SetFirstDerivativeOpeningAngle_kt(jetOpeningAnglektInfo[ij].first_derivative());
293  jet->GetShapeProperties()->SetSecondDerivativeOpeningAngle_kt(jetOpeningAnglektInfo[ij].second_derivative());
294  jet->GetShapeProperties()->SetFirstOrderSubtractedOpeningAngle_kt(jetOpeningAnglektInfo[ij].first_order_subtracted());
295  jet->GetShapeProperties()->SetSecondOrderSubtractedOpeningAngle_kt(jetOpeningAnglektInfo[ij].second_order_subtracted());
296  }
297  }
298 
299 #endif
300 }
301 
302 //______________________________________________________________________________
304 {
305  // Run termination of the utility (after each event).
306 }
void SetRMaxAndStep(Double_t rmax, Double_t dr)
Definition: AliFJWrapper.h:114
void SetUseExternalBkg(Bool_t b, Double_t rho, Double_t rhom)
Definition: AliFJWrapper.h:113
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:70
virtual Int_t DoGenericSubtractionJet1subjettiness_kt()
Double_t Pt() const
Definition: AliEmcalJet.h:96
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:71
void SetSecondOrderSubtractedConstituent(Double_t d)
virtual std::vector< double > GetGRDenominator() const
Definition: AliFJWrapper.h:69
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:249
virtual std::vector< double > GetGRNumerator() const
Definition: AliFJWrapper.h:68
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)