AliPhysics  a17849b (a17849b)
AliAnalysisTaskEmcalJetSubstructureTree.cxx
Go to the documentation of this file.
1 /************************************************************************************
2  * Copyright (C) 2017, Copyright Holders of the ALICE Collaboration *
3  * All rights reserved. *
4  * *
5  * Redistribution and use in source and binary forms, with or without *
6  * modification, are permitted provided that the following conditions are met: *
7  * * Redistributions of source code must retain the above copyright *
8  * notice, this list of conditions and the following disclaimer. *
9  * * Redistributions in binary form must reproduce the above copyright *
10  * notice, this list of conditions and the following disclaimer in the *
11  * documentation and/or other materials provided with the distribution. *
12  * * Neither the name of the <organization> nor the *
13  * names of its contributors may be used to endorse or promote products *
14  * derived from this software without specific prior written permission. *
15  * *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
19  * DISCLAIMED. IN NO EVENT SHALL ALICE COLLABORATION BE LIABLE FOR ANY *
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
26  ************************************************************************************/
27 #include <array>
28 #include <iostream>
29 #include <string>
30 #include <set>
31 #include <sstream>
32 #include <vector>
33 
34 #include <fastjet/ClusterSequence.hh>
35 #include <fastjet/contrib/Nsubjettiness.hh>
36 #include <fastjet/contrib/SoftDrop.hh>
37 
38 #include <THistManager.h>
39 #include <TLinearBinning.h>
40 #include <TLorentzVector.h>
41 #include <TMath.h>
42 #include <TObjString.h>
43 #include <TString.h>
44 #include <TVector3.h>
45 
46 #include "AliAODEvent.h"
47 #include "AliAODInputHandler.h"
48 #include "AliAnalysisManager.h"
49 #include "AliAnalysisDataSlot.h"
50 #include "AliAnalysisDataContainer.h"
52 #include "AliCDBEntry.h"
53 #include "AliCDBManager.h"
54 #include "AliClusterContainer.h"
55 #include "AliJetContainer.h"
58 #include "AliEmcalJet.h"
59 #include "AliEmcalList.h"
61 #include "AliLog.h"
62 #include "AliParticleContainer.h"
63 #include "AliRhoParameter.h"
64 #include "AliTrackContainer.h"
65 #include "AliTriggerCluster.h"
66 #include "AliTriggerConfiguration.h"
67 #include "AliVCluster.h"
68 #include "AliVParticle.h"
69 
70 #ifdef EXPERIMENTAL_JETCONSTITUENTS
73 #endif
74 
75 
79 
80 namespace EmcalTriggerJets {
81 
84  fJetSubstructureTree(nullptr),
85  fQAHistos(nullptr),
86  fLumiMonitor(nullptr),
87  fSDZCut(0.1),
88  fSDBetaCut(0),
89  fReclusterizer(kCAAlgo),
90  fTriggerSelectionBits(AliVEvent::kAny),
91  fTriggerSelectionString(""),
92  fNameTriggerDecisionContainer("EmcalTriggerDecision"),
93  fUseDownscaleWeight(false),
94  fUseChargedConstituents(true),
95  fUseNeutralConstituents(true),
96  fFillPart(true),
97  fFillAcceptance(true),
98  fFillRho(true),
99  fFillMass(true),
100  fFillSoftDrop(true),
101  fFillNSub(true),
102  fFillStructGlob(true)
103 {
104  memset(fJetTreeData, 0, sizeof(Double_t) * kTNVar);
105 }
106 
108  AliAnalysisTaskEmcalJet(name, kTRUE),
112  fSDZCut(0.1),
113  fSDBetaCut(0),
115  fTriggerSelectionBits(AliVEvent::kAny),
117  fNameTriggerDecisionContainer("EmcalTriggerDecision"),
118  fUseDownscaleWeight(false),
121  fFillPart(true),
122  fFillAcceptance(true),
123  fFillRho(true),
124  fFillMass(true),
125  fFillSoftDrop(true),
126  fFillNSub(true),
127  fFillStructGlob(true)
128 {
129  memset(fJetTreeData, 0, sizeof(Double_t) * kTNVar);
130  DefineOutput(2, TTree::Class());
131 }
132 
134 
135 }
136 
139 
140  // Make QA for constituent clusters
141  TLinearBinning jetptbinning(9, 20, 200),
142  clusterenergybinning(200, 0., 200),
143  timebinning(1000, -500., 500.),
144  m02binning(100, 0., 1.),
145  ncellbinning(101, -0.5, 100.5);
146  fQAHistos = new THistManager("QAhistos");
147  fQAHistos->CreateTH1("hEventCounter", "Event counter", 1, 0.5, 1.5);
148  fQAHistos->CreateTH2("hClusterConstE", "EMCAL cluster energy vs jet pt; p_{t, jet} (GeV/c); E_{cl} (GeV)", jetptbinning, clusterenergybinning);
149  fQAHistos->CreateTH2("hClusterConstTime", "EMCAL cluster time vs. jet pt; p_{t, jet} (GeV/c); t_{cl} (ns)", jetptbinning, timebinning);
150  fQAHistos->CreateTH2("hClusterConstM02", "EMCAL cluster M02 vs. jet pt; p{t, jet} (GeV/c); M02", jetptbinning, m02binning);
151  fQAHistos->CreateTH2("hClusterConstNcell", "EMCAL cluster ncell vs. jet pt; p{t, jet} (GeV/c); Number of cells", jetptbinning, ncellbinning);
152 
153  // Test of constituent QA
154 #ifdef EXPERIMENTAL_JETCONSTITUENTS
155  fQAHistos->CreateTH2("hChargedConstituentPt", "charged constituent pt vs jet pt (via constituent map); p_{t,jet} (GeV/c); p_{t,ch} (GeV/c)", jetptbinning, clusterenergybinning);
156  fQAHistos->CreateTH2("hChargedIndexPt", "charged constituent pt vs jet pt (via index map); p_{t, jet} (GeV/c); p_{t, ch} (GeV/c)", jetptbinning, clusterenergybinning);
157 
158  fQAHistos->CreateTH2("hClusterConstituentEDefault", "cluster constituent default energy vs. jet pt (va constituent map); p_{t, jet} (GeV/c); E_{cl} (GeV)", jetptbinning, clusterenergybinning);
159  fQAHistos->CreateTH2("hClusterConstituentENLC", "cluster constituent non-linearity-corrected energy vs. jet pt (va constituent map); p_{t, jet} (GeV/c); E_{cl} (GeV)", jetptbinning, clusterenergybinning);
160  fQAHistos->CreateTH2("hClusterConstituentEHC", "cluster constituent hadronic-corrected energy vs. jet pt (va constituent map); p_{t, jet} (GeV/c); E_{cl} (GeV)", jetptbinning, clusterenergybinning);
161  fQAHistos->CreateTH2("hClusterIndexENLC", "cluster constituent non-linearity-corrected energy vs. jet pt (via index map); p_{t, jet} (GeV/c); E_{cl} (GeV)", jetptbinning, clusterenergybinning);
162  fQAHistos->CreateTH2("hClusterIndexEHC", "cluster constituent hadronic-corrected energy vs. jet pt (via index map); p_{t, jet} (GeV/c); E_{cl} (GeV)", jetptbinning, clusterenergybinning);
163 #endif
164  for(auto h : *(fQAHistos->GetListOfHistograms())) fOutput->Add(h);
165 
166  OpenFile(2);
167  std::string treename = this->GetOutputSlot(2)->GetContainer()->GetName();
168  fJetSubstructureTree = new TTree(treename.data(), "Tree with jet substructure information");
169  std::vector<std::string> varnames = {
170  "Radius", "EventWeight", "PtJetRec", "PtJetSim", "EJetRec",
171  "EJetSim", "EtaRec", "EtaSim", "PhiRec", "PhiSim",
172  "RhoPtRec", "RhoPtSim", "RhoMassRec", "RhoMassSim", "AreaRec",
173  "AreaSim", "NEFRec", "NEFSim", "MassRec", "MassSim",
174  "ZgMeasured", "ZgTrue", "RgMeasured", "RgTrue", "MgMeasured",
175  "MgTrue", "PtgMeasured", "PtgTrue", "MugMeasured", "MugTrue",
176  "OneSubjettinessMeasured", "OneSubjettinessTrue", "TwoSubjettinessMeasured", "TwoSubjettinessTrue", "AngularityMeasured",
177  "AngularityTrue", "PtDMeasured", "PtDTrue", "NCharged", "NNeutral",
178  "NConstTrue", "NDroppedMeasured", "NDroppedTrue" };
179 
180  for(int ib = 0; ib < kTNVar; ib++){
181  LinkOutputBranch(varnames[ib], fJetTreeData + ib);
182  }
183  PostData(1, fOutput);
184  PostData(2, fJetSubstructureTree);
185 }
186 
187 void AliAnalysisTaskEmcalJetSubstructureTree::LinkOutputBranch(const std::string &branchname, Double_t *datalocation) {
188  // Check whether branch is rejected
189  if(!fFillPart && IsPartBranch(branchname)) return;
190  if(!fFillAcceptance && IsAcceptanceBranch(branchname)) return;
191  if(!fFillRho && IsRhoBranch(branchname)) return;
192  if(!fFillMass && IsMassBranch(branchname)) return;
193  if(!fFillSoftDrop && IsSoftdropBranch(branchname)) return;
194  if(!fFillNSub && IsNSubjettinessBranch(branchname)) return;
195  if(!fFillStructGlob && IsStructbranch(branchname)) return;
196 
197  std::cout << "Adding branch " << branchname << std::endl;
198  fJetSubstructureTree->Branch(branchname.data(), datalocation, Form("%s/D", branchname.data()));
199 }
200 
204  }
205 }
206 
210  AliParticleContainer *particles = GetParticleContainer("mcparticles");
211 
212  AliJetContainer *mcjets = GetJetContainer("mcjets");
213  AliJetContainer *datajets = GetJetContainer("datajets");
214 
215  FillLuminosity(); // Makes only sense in data
216 
217  // for(auto e : *(fInputEvent->GetList())) std::cout << e->GetName() << std::endl;
218 
219  std::stringstream rhoTagData, rhoTagMC;
220  if(datajets) rhoTagData << "R" << std::setw(2) << std::setfill('0') << static_cast<Int_t>(datajets->GetJetRadius() * 10.);
221  if(mcjets) rhoTagMC << "R" << std::setw(2) << std::setfill('0') << static_cast<Int_t>(mcjets->GetJetRadius() * 10.);
222 
223  std::string rhoSparseData = "RhoSparse_Full_" + rhoTagData.str(), rhoSparseMC = "RhoSparse_Full_" + rhoTagMC.str(),
224  rhoMassData = "RhoMassSparse_Full_" + rhoTagData.str(), rhoMassMC = "RhoMassSparse_Full_" + rhoTagMC.str();
225  AliRhoParameter *rhoPtRec = GetRhoFromEvent(rhoSparseData.data()),
226  *rhoMassRec = GetRhoFromEvent(rhoMassData.data()),
227  *rhoPtSim = GetRhoFromEvent(rhoSparseMC.data()),
228  *rhoMassSim = GetRhoFromEvent(rhoMassMC.data());
229  AliDebugStream(2) << "Found rho parameter for reconstructed pt: " << (rhoPtRec ? "yes" : "no") << ", value: " << (rhoPtRec ? rhoPtRec->GetVal() : 0.) << std::endl;
230  AliDebugStream(2) << "Found rho parameter for sim pt: " << (rhoPtSim ? "yes" : "no") << ", value: " << (rhoPtSim ? rhoPtSim->GetVal() : 0.) << std::endl;
231  AliDebugStream(2) << "Found rho parameter for reconstructed Mass: " << (rhoMassRec ? "yes" : "no") << ", value: " << (rhoMassRec ? rhoMassRec->GetVal() : 0.) << std::endl;
232  AliDebugStream(2) << "Found rho parameter for sim Mass: " << (rhoMassSim ? "yes" : "no") << ", value: " << (rhoMassSim ? rhoMassSim->GetVal() : 0.) << std::endl;
233 
234  AliDebugStream(1) << "Inspecting jet radius " << (datajets ? datajets->GetJetRadius() : mcjets->GetJetRadius()) << std::endl;
235 
236  double weight = 1.;
239  }
240 
241  // Run trigger selection (not on pure MCgen train)
242  if(datajets){
243  if(!(fInputHandler->IsEventSelected() & fTriggerSelectionBits)) return false;
244  if(!mcjets){
245  // Pure data - do EMCAL trigger selection from selection string
246  if(fTriggerSelectionString.Length()) {
247  if(!fInputEvent->GetFiredTriggerClasses().Contains(fTriggerSelectionString)) return false;
248  }
249  } else {
251  // Simulation - do EMCAL trigger selection from trigger selection object
253  AliDebugStream(1) << "Found trigger decision object: " << (mctrigger ? "yes" : "no") << std::endl;
254  if(!mctrigger){
255  AliErrorStream() << "Trigger decision container with name " << fNameTriggerDecisionContainer << " not found in event - not possible to select EMCAL triggers" << std::endl;
256  return false;
257  }
258  if(!mctrigger->IsEventSelected(fTriggerSelectionString)) return false;
259  }
260  }
261  }
262 
263  // Count events (for spectrum analysis)
264  fQAHistos->FillTH1("hEventCounter", 1);
265 
266  Double_t rhoparameters[4]; memset(rhoparameters, 0, sizeof(Double_t) * 4);
267  if(rhoPtRec) rhoparameters[0] = rhoPtRec->GetVal();
268  if(rhoPtSim) rhoparameters[1] = rhoPtSim->GetVal();
269  if(rhoMassRec) rhoparameters[2] = rhoMassRec->GetVal();
270  if(rhoMassSim) rhoparameters[3] = rhoMassSim->GetVal();
271 
272  AliSoftdropDefinition softdropSettings;
273  softdropSettings.fBeta = fSDBetaCut;
274  softdropSettings.fZ = fSDZCut;
275  switch(fReclusterizer) {
276  case kCAAlgo: softdropSettings.fRecluserAlgo = fastjet::cambridge_aachen_algorithm; break;
277  case kKTAlgo: softdropSettings.fRecluserAlgo = fastjet::kt_algorithm; break;
278  case kAKTAlgo: softdropSettings.fRecluserAlgo = fastjet::antikt_algorithm; break;
279  };
280 
281  AliNSubjettinessDefinition nsubjettinessSettings;
282  nsubjettinessSettings.fBeta = 1.;
283  nsubjettinessSettings.fRadius = 0.4;
284 
285  if(datajets) {
286  AliDebugStream(1) << "In data jets branch: found " << datajets->GetNJets() << " jets, " << datajets->GetNAcceptedJets() << " were accepted\n";
287  AliDebugStream(1) << "Having MC information: " << (mcjets ? TString::Format("yes, with %d jets", mcjets->GetNJets()) : "no") << std::endl;
288  if(mcjets) {
289  AliDebugStream(1) << "In MC jets branch: found " << mcjets->GetNJets() << " jets, " << mcjets->GetNAcceptedJets() << " were accepted\n";
290  }
291  for(auto jet : datajets->accepted()) {
292  double pt = jet->Pt(), pz = jet->Pz(), E = jet->E(), M = TMath::Sqrt(E*E - pt*pt - pz*pz);
293  AliDebugStream(2) << "Next jet: pt:" << jet->Pt() << ", E: " << E << ", pz: " << pz << ", M(self): " << M << "M(fj)" << jet->M() << std::endl;
294  AliEmcalJet *associatedJet = jet->ClosestJet();
295 
296  if(mcjets) {
297  if(!associatedJet) {
298  AliDebugStream(2) << "Not found associated jet" << std::endl;
299  continue;
300  }
301  try {
302  DoConstituentQA(jet, tracks, clusters);
303  AliJetSubstructureData structureData = MakeJetSubstructure(*jet, datajets->GetJetRadius() * 2., tracks, clusters, {softdropSettings, nsubjettinessSettings}),
304  structureMC = fFillPart ? MakeJetSubstructure(*associatedJet, mcjets->GetJetRadius() * 2, particles, nullptr, {softdropSettings, nsubjettinessSettings}) : AliJetSubstructureData();
305  Double_t angularity[2] = {fFillStructGlob ? MakeAngularity(*jet, tracks, clusters) : 0., (fFillStructGlob && fFillPart) ? MakeAngularity(*associatedJet, particles, nullptr) : 0.},
306  ptd[2] = {fFillStructGlob ? MakePtD(*jet, tracks, clusters) : 0., (fFillStructGlob && fFillPart) ? MakePtD(*associatedJet, particles, nullptr) : 0};
307  FillTree(datajets->GetJetRadius(), weight, jet, associatedJet, &(structureData.fSoftDrop), &(structureMC.fSoftDrop), &(structureData.fNsubjettiness), &(structureMC.fNsubjettiness), angularity, ptd, rhoparameters);
308  } catch(ReclusterizerException &e) {
309  AliErrorStream() << "Error in reclusterization - skipping jet" << std::endl;
310  } catch(SubstructureException &e) {
311  AliErrorStream() << "Error in substructure observable - skipping jet" << std::endl;
312  }
313  } else {
314  try {
315  DoConstituentQA(jet, tracks, clusters);
316  AliJetSubstructureData structure = MakeJetSubstructure(*jet, 0.4, tracks, clusters, {softdropSettings, nsubjettinessSettings});
317  Double_t angularity[2] = {fFillStructGlob ? MakeAngularity(*jet, tracks, clusters): 0., 0.},
318  ptd[2] = {fFillStructGlob ? MakePtD(*jet, tracks, clusters) : 0., 0.};
319  FillTree(datajets->GetJetRadius(), weight, jet, nullptr, &(structure.fSoftDrop), nullptr, &(structure.fNsubjettiness), nullptr, angularity, ptd, rhoparameters);
320  } catch(ReclusterizerException &e) {
321  AliErrorStream() << "Error in reclusterization - skipping jet" << std::endl;
322  } catch(SubstructureException &e) {
323  AliErrorStream() << "Error in substructure observable - skipping jet" << std::endl;
324  }
325  }
326  }
327  } else {
328  if(mcjets) {
329  // for MCgen train
330  AliDebugStream(1) << "In MC pure jet branch: found " << mcjets->GetNJets() << " jets, " << mcjets->GetNAcceptedJets() << " were accepted\n";
331  for(auto j : mcjets->accepted()){
332  AliEmcalJet *mcjet = static_cast<AliEmcalJet *>(j);
333  try {
334  AliJetSubstructureData structure = MakeJetSubstructure(*mcjet, mcjets->GetJetRadius() * 2., particles, nullptr,{softdropSettings, nsubjettinessSettings});
335  Double_t angularity[2] = {0., MakeAngularity(*mcjet, particles, nullptr)},
336  ptd[2] = {0., MakePtD(*mcjet, particles, nullptr)};
337  FillTree(mcjets->GetJetRadius(), weight, nullptr, mcjet, nullptr, &(structure.fSoftDrop), nullptr, &(structure.fNsubjettiness), angularity, ptd, rhoparameters);
338  } catch (ReclusterizerException &e) {
339  AliErrorStream() << "Error in reclusterization - skipping jet" << std::endl;
340  } catch (SubstructureException &e) {
341  AliErrorStream() << "Error in substructure observable - skipping jet" << std::endl;
342  }
343  }
344  }
345  }
346 
347  return true;
348 }
349 
351  AliCDBManager * cdb = AliCDBManager::Instance();
352  if(!fMCEvent && cdb){
353  // Get List of trigger clusters
354  AliCDBEntry *en = cdb->Get("GRP/CTP/Config");
355  AliTriggerConfiguration *trg = static_cast<AliTriggerConfiguration *>(en->GetObject());
356  std::vector<std::string> clusternames;
357  for(auto c : trg->GetClusters()) {
358  AliTriggerCluster *clust = static_cast<AliTriggerCluster *>(c);
359  std::string clustname = clust->GetName();
360  auto iscent = clustname.find("CENT") != std::string::npos, iscalo = clustname.find("CALO") != std::string::npos;
361  if(!(iscalo || iscent)) continue;
362  clusternames.emplace_back(clustname);
363  }
364 
365  // Set the x-axis of the luminosity monitor histogram
366  fLumiMonitor = new TH1F("hLumiMonitor", "Luminosity monitor", clusternames.size(), 0, clusternames.size());
367  int currentbin(1);
368  for(auto c : clusternames) {
369  fLumiMonitor->GetXaxis()->SetBinLabel(currentbin++, c.data());
370  }
371  fOutput->Add(fLumiMonitor);
372  }
373 }
374 
376  const AliEmcalJet *datajet, const AliEmcalJet *mcjet,
377  AliSoftDropParameters *dataSoftdrop, AliSoftDropParameters *mcSoftdrop,
378  AliNSubjettinessParameters *dataSubjettiness, AliNSubjettinessParameters *mcSubjettiness,
379  Double_t *angularity, Double_t *ptd, Double_t *rhoparameters){
380 
381  memset(fJetTreeData,0, sizeof(Double_t) * kTNVar);
382  fJetTreeData[kTRadius] = r;
383  fJetTreeData[kTWeight] = weight;
384  if(fFillRho){
385  fJetTreeData[kTRhoPtRec] = rhoparameters[0];
386  if(fFillMass) fJetTreeData[kTRhoMassRec] = rhoparameters[2];
387  if(fFillPart){
388  fJetTreeData[kTRhoPtSim] = rhoparameters[1];
389  if(fFillMass) fJetTreeData[kTRhoMassSim] = rhoparameters[3];
390  }
391  }
392  if(datajet) {
393  fJetTreeData[kTPtJetRec] = TMath::Abs(datajet->Pt());
395  fJetTreeData[kTNNeutral] = fUseNeutralConstituents ? datajet->GetNumberOfClusters() : 0.;
396  fJetTreeData[kTAreaRec] = datajet->Area();
397  fJetTreeData[kTNEFRec] = datajet->NEF();
398  if(fFillMass) fJetTreeData[kTMassRec] = datajet->M();
399  fJetTreeData[kTEJetRec] = datajet->E();
400  if(fFillAcceptance) {
401  fJetTreeData[kTEtaRec] = datajet->Eta();
402  fJetTreeData[kTPhiRec] = datajet->Phi();
403  }
404  }
405 
406  if(fFillPart && mcjet){
407  fJetTreeData[kTPtJetSim] = TMath::Abs(mcjet->Pt());
409  fJetTreeData[kTAreaSim] = mcjet->Area();
410  fJetTreeData[kTNEFSim] = mcjet->NEF();
411  if(fFillMass) fJetTreeData[kTMassSim] = mcjet->M();
412  fJetTreeData[kTEJetSim] = mcjet->E();
413  if(fFillAcceptance){
414  fJetTreeData[kTEtaSim] = mcjet->Eta();
415  fJetTreeData[kTPhiSim] = mcjet->Phi();
416  }
417  }
418 
419  if(fFillSoftDrop){
420  if(dataSoftdrop) {
421  fJetTreeData[kTZgMeasured] = dataSoftdrop->fZg;
422  fJetTreeData[kTRgMeasured] = dataSoftdrop->fRg;
423  fJetTreeData[kTMgMeasured] = dataSoftdrop->fMg;
424  fJetTreeData[kTPtgMeasured] = dataSoftdrop->fPtg;
425  fJetTreeData[kTMugMeasured] = dataSoftdrop->fMug;
426  fJetTreeData[kTNDroppedMeasured] = dataSoftdrop->fNDropped;
427  }
428 
429  if(fFillPart && mcSoftdrop) {
430  fJetTreeData[kTZgTrue] = mcSoftdrop->fZg;
431  fJetTreeData[kTRgTrue] = mcSoftdrop->fRg;
432  fJetTreeData[kTMgTrue] = mcSoftdrop->fMg;
433  fJetTreeData[kTPtgTrue] = mcSoftdrop->fPtg;
434  fJetTreeData[kTMugTrue] = mcSoftdrop->fMug;
435  fJetTreeData[kTNDroppedTrue] = mcSoftdrop->fNDropped;
436  }
437  }
438 
439  if(fFillNSub){
440  if(dataSubjettiness) {
443  }
444 
445  if(fFillPart && mcSubjettiness) {
448  }
449  }
450 
451  if(fFillStructGlob){
452  fJetTreeData[kTAngularityMeasured] = angularity[0];
453  fJetTreeData[kTPtDMeasured] = ptd[0];
454 
455  if(fFillPart){
456  fJetTreeData[kTAngularityTrue] = angularity[1];
457  fJetTreeData[kTPtDTrue] = ptd[1];
458  }
459  }
460 
461  fJetSubstructureTree->Fill();
462 }
463 
467  if(fInputEvent->GetFiredTriggerClasses().Contains("INT7")) {
468  for(auto trigger : DecodeTriggerString(fInputEvent->GetFiredTriggerClasses().Data())){
469  auto int7trigger = trigger.IsTriggerClass("INT7");
470  auto bunchcrossing = trigger.fBunchCrossing == "B";
471  auto nopf = trigger.fPastFutureProtection == "NOPF";
472  AliDebugStream(4) << "Full name: " << trigger.ExpandClassName() << ", INT7 trigger: " << (int7trigger ? "Yes" : "No") << ", bunch crossing: " << (bunchcrossing ? "Yes" : "No") << ", no past-future protection: " << (nopf ? "Yes" : "No") << ", Cluster: " << trigger.fTriggerCluster << std::endl;
473  if(int7trigger && bunchcrossing && nopf) {
474  double downscale = downscalefactors->GetDownscaleFactorForTriggerClass(trigger.ExpandClassName());
475  AliDebugStream(5) << "Using downscale " << downscale << std::endl;
476  fLumiMonitor->Fill(trigger.fTriggerCluster.data(), 1./downscale);
477  }
478  }
479  }
480  }
481 }
482 
484  const int kClusterOffset = 30000; // In order to handle tracks and clusters in the same index space the cluster index needs and offset, large enough so that there is no overlap with track indices
485  std::vector<fastjet::PseudoJet> constituents;
486  bool isMC = dynamic_cast<const AliTrackContainer *>(tracks);
487  AliDebugStream(2) << "Make new jet substrucutre for " << (isMC ? "MC" : "data") << " jet: Number of tracks " << jet.GetNumberOfTracks() << ", clusters " << jet.GetNumberOfClusters() << std::endl;
488  if(tracks && fUseChargedConstituents){
489  for(int itrk = 0; itrk < jet.GetNumberOfTracks(); itrk++){
490  auto track = jet.TrackAt(itrk, tracks->GetArray());
491  fastjet::PseudoJet constituentTrack(track->Px(), track->Py(), track->Pz(), track->E());
492  constituentTrack.set_user_index(jet.TrackAt(itrk));
493  constituents.push_back(constituentTrack);
494  }
495  }
496 
497  if(clusters && fUseNeutralConstituents){
498  for(int icl = 0; icl < jet.GetNumberOfClusters(); icl++) {
499  auto cluster = jet.ClusterAt(icl, clusters->GetArray());
500  TLorentzVector clustervec;
501  cluster->GetMomentum(clustervec, fVertex, (AliVCluster::VCluUserDefEnergy_t)clusters->GetDefaultClusterEnergy());
502  fastjet::PseudoJet constituentCluster(clustervec.Px(), clustervec.Py(), clustervec.Pz(), cluster->GetHadCorrEnergy());
503  constituentCluster.set_user_index(jet.ClusterAt(icl) + kClusterOffset);
504  constituents.push_back(constituentCluster);
505  }
506  }
507 
508  AliDebugStream(3) << "Found " << constituents.size() << " constituents for jet with pt=" << jet.Pt() << " GeV/c" << std::endl;
509  if(!constituents.size())
510  throw ReclusterizerException();
511  // Redo jet finding on constituents with a
512  fastjet::JetDefinition jetdef(fastjet::antikt_algorithm, jetradius*2, static_cast<fastjet::RecombinationScheme>(0), fastjet::BestFJ30 );
513  std::vector<fastjet::PseudoJet> outputjets;
514  try {
515  fastjet::ClusterSequence jetfinder(constituents, jetdef);
516  outputjets = jetfinder.inclusive_jets(0);
518  return result;
519  } catch (fastjet::Error &e) {
520  AliErrorStream() << " FJ Exception caught: " << e.message() << std::endl;
521  throw ReclusterizerException();
522  } catch (SoftDropException &e) {
523  AliErrorStream() << "Softdrop exception caught: " << e.what() << std::endl;
524  throw ReclusterizerException();
525  }
526 }
527 
529  fastjet::contrib::SoftDrop softdropAlgorithm(cutparameters.fBeta, cutparameters.fZ);
530  softdropAlgorithm.set_verbose_structure(kTRUE);
531  std::unique_ptr<fastjet::contrib::Recluster> reclusterizer(new fastjet::contrib::Recluster(cutparameters.fRecluserAlgo, 1, true));
532  softdropAlgorithm.set_reclustering(kTRUE, reclusterizer.get());
533  AliDebugStream(4) << "Jet has " << jet.constituents().size() << " constituents" << std::endl;
534  auto groomed = softdropAlgorithm(jet);
535  try {
536  auto softdropstruct = groomed.structure_of<fastjet::contrib::SoftDrop>();
537 
538  AliSoftDropParameters result({softdropstruct.symmetry(),
539  groomed.m(),
540  softdropstruct.delta_R(),
541  groomed.perp(),
542  softdropstruct.mu(),
543  softdropstruct.dropped_count()});
544  return result;
545  } catch(std::bad_cast &e) {
546  throw SoftDropException();
547  }
548 }
549 
552  fastjet::contrib::Nsubjettiness (1,fastjet::contrib::KT_Axes(),fastjet::contrib::NormalizedCutoffMeasure(cut.fBeta, cut.fRadius, 1e100)).result(jet),
553  fastjet::contrib::Nsubjettiness (2,fastjet::contrib::KT_Axes(),fastjet::contrib::NormalizedCutoffMeasure(cut.fBeta, cut.fRadius, 1e100)).result(jet)
554  });
555  return result;
556 }
557 
559  if(!(jet.GetNumberOfTracks() || jet.GetNumberOfClusters()))
560  throw SubstructureException();
561  TVector3 jetvec(jet.Px(), jet.Py(), jet.Pz());
562  Double_t den(0.), num(0.);
563  if(tracks && fUseChargedConstituents){
564  for(UInt_t itrk = 0; itrk < jet.GetNumberOfTracks(); itrk++) {
565  auto track = jet.TrackAt(itrk, tracks->GetArray());
566  if(!track){
567  AliErrorStream() << "Associated constituent particle / track not found\n";
568  continue;
569  }
570  TVector3 trackvec(track->Px(), track->Py(), track->Pz());
571 
572  num += track->Pt() * trackvec.DrEtaPhi(jetvec);
573  den += +track->Pt();
574  }
575  }
576  if(clusters && fUseNeutralConstituents) {
577  for(UInt_t icl = 0; icl < jet.GetNumberOfClusters(); icl++){
578  auto clust = jet.ClusterAt(icl, clusters->GetArray());
579  if(!clust) {
580  AliErrorStream() << "Associated constituent cluster not found\n";
581  continue;
582  }
583  TLorentzVector clusterp;
584  clust->GetMomentum(clusterp, fVertex, (AliVCluster::VCluUserDefEnergy_t)clusters->GetDefaultClusterEnergy());
585 
586  num += clusterp.Pt() * clusterp.Vect().DrEtaPhi(jetvec);
587  den += clusterp.Pt();
588  }
589  }
590  return num/den;
591 }
592 
594  if (!(jet.GetNumberOfTracks() || jet.GetNumberOfClusters()))
595  throw SubstructureException();
596  Double_t den(0.), num(0.);
597  if(particles && fUseChargedConstituents){
598  for(UInt_t itrk = 0; itrk < jet.GetNumberOfTracks(); itrk++) {
599  auto trk = jet.TrackAt(itrk, particles->GetArray());
600  if(!trk){
601  AliErrorStream() << "Associated constituent particle / track not found\n";
602  continue;
603  }
604  num += trk->Pt() * trk->Pt();
605  den += trk->Pt();
606  }
607  }
608  if(clusters && fUseNeutralConstituents){
609  for(UInt_t icl = 0; icl < jet.GetNumberOfClusters(); icl++){
610  auto clust = jet.ClusterAt(icl, clusters->GetArray());
611  if(!clust) {
612  AliErrorStream() << "Associated constituent cluster not found\n";
613  continue;
614  }
615  TLorentzVector clusterp;
616  clust->GetMomentum(clusterp, fVertex, (AliVCluster::VCluUserDefEnergy_t)clusters->GetDefaultClusterEnergy());
617  num += clusterp.Pt() * clusterp.Pt();
618  den += clusterp.Pt();
619  }
620  }
621  return TMath::Sqrt(num)/den;
622 }
623 
625  for(int icl = 0; icl < jet->GetNumberOfClusters(); icl++){
626  auto clust = jet->ClusterAt(icl, clusters->GetArray());
627  AliDebugStream(3) << "cluster time " << clust->GetTOF() << std::endl;
628  fQAHistos->FillTH2("hClusterConstE", jet->Pt(),clust->GetUserDefEnergy(clusters->GetDefaultClusterEnergy()));
629  fQAHistos->FillTH2("hClusterConstTime", jet->Pt(), clust->GetTOF());
630  fQAHistos->FillTH2("hClusterConstM02", jet->Pt(), clust->GetM02());
631  fQAHistos->FillTH2("hClusterConstNcell", jet->Pt(), clust->GetNCells());
632 
633 #ifdef EXPERIMENTAL_JETCONSTITUENTS
634  fQAHistos->FillTH2("hClusterIndexENLC", jet->Pt(), clust->GetNonLinCorrEnergy());
635  fQAHistos->FillTH2("hClusterIndexEHC", jet->Pt(), clust->GetHadCorrEnergy());
636 #endif
637  }
638 
639 #ifdef EXPERIMENTAL_JETCONSTITUENTS
640  // Loop over charged particles - fill test histogram
641  for(int itrk = 0; itrk < jet->GetNumberOfTracks(); itrk++){
642  auto part = jet->TrackAt(itrk, cont->GetArray());
643  fQAHistos->FillTH2("hChargedIndexPt", jet->Pt(), part->Pt());
644  }
645 
646  // Look over charged constituents
647  AliDebugStream(2) << "Jet: Number of particle constituents: " << jet->GetParticleConstituents().GetEntriesFast() << std::endl;
648  for(auto pconst : jet->GetParticleConstituents()) {
649  auto part = static_cast<PWG::JETFW::AliEmcalParticleJetConstituent *>(pconst);
650  AliDebugStream(3) << "Found particle constituent with pt " << part->Pt() << ", from VParticle " << part->GetParticle()->Pt() << std::endl;
651  fQAHistos->FillTH2("hChargedConstituentPt", jet->Pt(), part->Pt());
652  }
653 
654  // Loop over neutral constituents
655  AliDebugStream(2) << "Jet: Number of cluster constituents: " << jet->GetClusterConstituents().GetEntriesFast() << std::endl;
656  for(auto cconst : jet->GetClusterConstituents()){
657  auto clust = static_cast<PWG::JETFW::AliEmcalClusterJetConstituent *>(cconst);
658  AliDebugStream(3) << "Found cluster constituent with energy " << clust->E() << " using energy definition " << static_cast<int>(clust->GetDefaultEnergyType()) << std::endl;
659  fQAHistos->FillTH2("hClusterConstituentEDefault", jet->Pt(), clust->E());
660  fQAHistos->FillTH2("hClusterConstituentENLC", jet->Pt(), clust->GetCluster()->GetNonLinCorrEnergy());
661  fQAHistos->FillTH2("hClusterConstituentEHC", jet->Pt(), clust->GetCluster()->GetHadCorrEnergy());
662  }
663 #endif
664 }
665 
666 std::vector<Triggerinfo> AliAnalysisTaskEmcalJetSubstructureTree::DecodeTriggerString(const std::string &triggerstring) const {
667  std::vector<Triggerinfo> result;
668  std::stringstream triggerparser(triggerstring);
669  std::string currenttrigger;
670  while(std::getline(triggerparser, currenttrigger, ' ')){
671  if(!currenttrigger.length()) continue;
672  std::vector<std::string> tokens;
673  std::stringstream triggerdecoder(currenttrigger);
674  std::string token;
675  while(std::getline(triggerdecoder, token, '-')) tokens.emplace_back(token);
676  result.emplace_back(Triggerinfo({tokens[0], tokens[1], tokens[2], tokens[3]}));
677  }
678  return result;
679 }
680 
681 std::string AliAnalysisTaskEmcalJetSubstructureTree::MatchTrigger(const std::string &triggertoken) const {
682  std::vector<std::string> tokens;
683  std::string result;
684  std::stringstream decoder(fInputEvent->GetFiredTriggerClasses().Data());
685  while(std::getline(decoder, result, ',')) tokens.emplace_back(result);
686  result.clear();
687  for(auto t : tokens) {
688  if(t.find(triggertoken) != std::string::npos) {
689  // take first occurrence - downscale factor should normally be the same
690  result = t;
691  break;
692  }
693  }
694  return result;
695 }
696 
697 bool AliAnalysisTaskEmcalJetSubstructureTree::IsSelectEmcalTriggers(const std::string &triggerstring) const {
698  const std::array<std::string, 8> kEMCALTriggers = {
699  "EJ1", "EJ2", "DJ1", "DJ2", "EG1", "EG2", "DG1", "DG2"
700  };
701  bool isEMCAL = false;
702  for(auto emcaltrg : kEMCALTriggers) {
703  if(triggerstring.find(emcaltrg) != std::string::npos) {
704  isEMCAL = true;
705  break;
706  }
707  }
708  return isEMCAL;
709 }
710 
711 bool AliAnalysisTaskEmcalJetSubstructureTree::IsPartBranch(const std::string &branchname) const{
712  return (branchname.find("Sim") != std::string::npos) || (branchname.find("True") != std::string::npos);
713 }
714 
715 bool AliAnalysisTaskEmcalJetSubstructureTree::IsAcceptanceBranch(const std::string &branchname) const {
716  return (branchname.find("Eta") != std::string::npos) || (branchname.find("Phi") != std::string::npos);
717 }
718 
719 bool AliAnalysisTaskEmcalJetSubstructureTree::IsRhoBranch(const std::string &branchname) const{
720  return (branchname.find("Rho") != std::string::npos);
721 }
722 
723 bool AliAnalysisTaskEmcalJetSubstructureTree::IsMassBranch(const std::string &branchname) const{
724  return (branchname.find("Mass") != std::string::npos); // also disable rho mass branch
725 }
726 
727 bool AliAnalysisTaskEmcalJetSubstructureTree::IsSoftdropBranch(const std::string &branchname) const{
728  return (branchname.find("gMeasured") != std::string::npos) || (branchname.find("gTrue") != std::string::npos) || (branchname.find("NDropped") != std::string::npos);
729 }
730 
731 bool AliAnalysisTaskEmcalJetSubstructureTree::IsNSubjettinessBranch(const std::string &branchname) const{
732  return (branchname.find("Subjettiness") != std::string::npos);
733 }
734 
735 bool AliAnalysisTaskEmcalJetSubstructureTree::IsStructbranch(const std::string &branchname) const{
736  return (branchname.find("Angularity") != std::string::npos) || (branchname.find("PtD") != std::string::npos);
737 }
738 
740  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
741 
742  Bool_t isAOD(kFALSE);
743  AliInputEventHandler *inputhandler = static_cast<AliInputEventHandler *>(mgr->GetInputEventHandler());
744  if(inputhandler) {
745  if(inputhandler->IsA() == AliAODInputHandler::Class()){
746  std::cout << "Analysing AOD events\n";
747  isAOD = kTRUE;
748  } else {
749  std::cout << "Analysing ESD events\n";
750  }
751  }
752 
753  std::stringstream taskname;
754  taskname << "JetSubstructureTreemaker_R" << std::setw(2) << std::setfill('0') << int(jetradius*10) << trigger;
756  mgr->AddTask(treemaker);
757  treemaker->SetMakeGeneralHistograms(kTRUE);
758 
759  // Adding containers
760  if(isMC) {
761  AliParticleContainer *particles = treemaker->AddMCParticleContainer("mcparticles");
762  particles->SetMinPt(0.);
763 
764  AliJetContainer *mcjets = treemaker->AddJetContainer(
765  jettype,
767  recombinationScheme,
768  jetradius,
770  particles, nullptr);
771  mcjets->SetName("mcjets");
772  mcjets->SetJetPtCut(20.);
773  }
774 
775  if(isData) {
776  AliTrackContainer *tracks(nullptr);
777  if((jettype == AliJetContainer::kChargedJet) || (jettype == AliJetContainer::kFullJet)){
779  std::cout << "Track container name: " << tracks->GetName() << std::endl;
780  tracks->SetMinPt(0.15);
781  }
782  AliClusterContainer *clusters(nullptr);
784  std::cout << "Using full or neutral jets ..." << std::endl;
786  std::cout << "Cluster container name: " << clusters->GetName() << std::endl;
787  clusters->SetClusHadCorrEnergyCut(0.3); // 300 MeV E-cut
788  clusters->SetDefaultClusterEnergy(AliVCluster::kHadCorr);
789  } else {
790  std::cout << "Using charged jets ... " << std::endl;
791  }
792 
793  AliJetContainer *datajets = treemaker->AddJetContainer(
794  jettype,
796  recombinationScheme,
797  jetradius,
799  tracks, clusters);
800  datajets->SetName("datajets");
801  datajets->SetJetPtCut(20.);
802 
803  treemaker->SetUseAliAnaUtils(true, true);
804  treemaker->SetVzRange(-10., 10);
805 
806  // configure trigger selection
807  std::string triggerstring(trigger);
808  if(triggerstring.find("INT7") != std::string::npos) {
809  treemaker->SetTriggerBits(AliVEvent::kINT7);
810  } else if(triggerstring.find("EJ1") != std::string::npos) {
811  treemaker->SetTriggerBits(AliVEvent::kEMCEJE);
812  treemaker->SetTriggerString("EJ1");
813  } else if(triggerstring.find("EJ2") != std::string::npos) {
814  treemaker->SetTriggerBits(AliVEvent::kEMCEJE);
815  treemaker->SetTriggerString("EJ2");
816  }
817  }
818 
819  // Connecting containers
820  std::stringstream outputfile, histname, treename;
821  outputfile << mgr->GetCommonFileName() << ":JetSubstructure_R" << std::setw(2) << std::setfill('0') << int(jetradius * 10.) << "_" << trigger;
822  histname << "JetSubstructureHistos_R" << std::setw(2) << std::setfill('0') << int(jetradius * 10.) << "_" << trigger;
823  treename << "JetSubstructureTree_R" << std::setw(2) << std::setfill('0') << int(jetradius * 10.) << "_" << trigger;
824  mgr->ConnectInput(treemaker, 0, mgr->GetCommonInputContainer());
825  mgr->ConnectOutput(treemaker, 1, mgr->CreateContainer(histname.str().data(), AliEmcalList::Class(), AliAnalysisManager::kOutputContainer, outputfile.str().data()));
826  mgr->ConnectOutput(treemaker, 2, mgr->CreateContainer(treename.str().data(), TTree::Class(), AliAnalysisManager::kOutputContainer, mgr->GetCommonFileName()));
827 
828  return treemaker;
829 }
830 
831 std::string Triggerinfo::ExpandClassName() const {
832  std::string result = fTriggerClass + "-" + fBunchCrossing + "-" + fPastFutureProtection + "-" + fTriggerCluster;
833  return result;
834 }
835 
836 bool Triggerinfo::IsTriggerClass(const std::string &triggerclass) const {
837  return fTriggerClass.substr(1) == triggerclass; // remove C from trigger class part
838 }
839 
840 } /* namespace EmcalTriggerJets */
Double_t Area() const
Definition: AliEmcalJet.h:130
bool IsEventSelected(const char *name) const
Checks whether the events is selected for a given trigger type.
double Double_t
Definition: External.C:58
static AliAnalysisTaskEmcalJetSubstructureTree * AddEmcalJetSubstructureTreeMaker(Bool_t isMC, Bool_t isData, Double_t jetradius, AliJetContainer::EJetType_t jettype, AliJetContainer::ERecoScheme_t recombinationScheme, const char *name)
Class creating a linear binning, used in the histogram manager.
Double_t MakePtD(const AliEmcalJet &jet, const AliParticleContainer *const particles, const AliClusterContainer *const clusters) const
AliEmcalJet * ClosestJet() const
Definition: AliEmcalJet.h:327
AliJetContainer * GetJetContainer(Int_t i=0) const
virtual double E() const
Access to constituent energy.
Double_t Eta() const
Definition: AliEmcalJet.h:121
static AliEmcalDownscaleFactorsOCDB * Instance()
Double_t Py() const
Definition: AliEmcalJet.h:107
Double_t Phi() const
Definition: AliEmcalJet.h:117
Container with name, TClonesArray and cuts for particles.
void SetUseAliAnaUtils(Bool_t b, Bool_t bRejPilup=kTRUE)
AliJetSubstructureData MakeJetSubstructure(const AliEmcalJet &jet, double jetradius, const AliParticleContainer *tracks, const AliClusterContainer *clusters, const AliJetSubstructureSettings &settings) const
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Fill a 2D histogram within the container.
Int_t ClusterAt(Int_t idx) const
Definition: AliEmcalJet.h:137
std::vector< Triggerinfo > DecodeTriggerString(const std::string &triggerstring) const
TCanvas * c
Definition: TestFitELoss.C:172
AliJetContainer * AddJetContainer(const char *n, TString defaultCutType, Float_t jetRadius=0.4)
const std::vector< PWG::JETFW::AliEmcalParticleJetConstituent > & GetParticleConstituents() const
Get container with particle (track / MC particle) constituents.
Definition: AliEmcalJet.h:184
Structure for results from the soft drop algorithm.
virtual void UserExecOnce()
Task initializations handled in user tasks.
Double_t E() const
Definition: AliEmcalJet.h:119
virtual bool Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.
Double_t GetDownscaleFactorForTriggerClass(const TString &trigger) const
void SetVzRange(Double_t min, Double_t max)
AliClusterContainer * AddClusterContainer(const char *n)
Create new cluster container and attach it to the task.
fastjet::JetAlgorithm fRecluserAlgo
Reclusterization algorithm.
UShort_t GetNumberOfConstituents() const
Definition: AliEmcalJet.h:140
Container for particles within the EMCAL framework.
Int_t GetDefaultClusterEnergy() const
Int_t TrackAt(Int_t idx) const
Definition: AliEmcalJet.h:160
UShort_t GetNumberOfTracks() const
Definition: AliEmcalJet.h:139
Double_t Px() const
Definition: AliEmcalJet.h:106
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
TPC fiducial acceptance (each eta edge narrowed by jet R)
Definition: AliEmcalJet.h:68
AliRhoParameter * GetRhoFromEvent(const char *name)
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
Create a new TH2 within the container.
int Int_t
Definition: External.C:63
UShort_t GetNumberOfClusters() const
Definition: AliEmcalJet.h:138
void SetJetPtCut(Float_t cut)
TPC acceptance.
Definition: AliEmcalJet.h:67
unsigned int UInt_t
Definition: External.C:33
THashList * GetListOfHistograms() const
Get the list of histograms.
Definition: THistManager.h:671
Int_t GetNJets() const
AliNSubjettinessParameters MakeNsubjettinessParameters(const fastjet::PseudoJet &jet, const AliNSubjettinessDefinition &cut) const
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Create a new TH1 within the container.
Definition for the algorithm obtaining the softdrop parameters.
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Get cluster container attached to this task.
virtual void RunChanged(Int_t newrun)
Process tasks relevant when a file with a different run number is processed.
AliMCParticleContainer * AddMCParticleContainer(const char *n)
Create new container for MC particles and attach it to the task.
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Fill a 1D histogram within the container.
Double_t MakeAngularity(const AliEmcalJet &jet, const AliParticleContainer *tracks, const AliClusterContainer *clusters) const
Implementation of a jet constituent for constituent clusters.
bool IsTriggerClass(const std::string &triggerclass) const
Double_t Pt() const
Definition: AliEmcalJet.h:109
Bool_t isMC
void DoConstituentQA(const AliEmcalJet *jet, const AliParticleContainer *tracks, const AliClusterContainer *clusters)
Float_t GetJetRadius() const
const std::vector< PWG::JETFW::AliEmcalClusterJetConstituent > & GetClusterConstituents() const
Get container with cluster constituents.
Definition: AliEmcalJet.h:190
virtual double Pt() const
Access to transverse momentum.
AliEmcalList * fOutput
!output list
Double_t fVertex[3]
!event vertex
AliTrackContainer * AddTrackContainer(const char *n)
Create new track container and attach it to the task.
Handler for downscale factors for various triggers obtained from the OCDB.
AliTrackContainer * GetTrackContainer(Int_t i=0) const
void SetMakeGeneralHistograms(Bool_t g)
Base task in the EMCAL jet framework.
void FillTree(double r, double weight, const AliEmcalJet *datajet, const AliEmcalJet *mcjet, AliSoftDropParameters *dataSoftdrop, AliSoftDropParameters *mcsoftdrop, AliNSubjettinessParameters *dataSubjettiness, AliNSubjettinessParameters *mcSubjettiness, Double_t *angularity, Double_t *ptd, Double_t *rhoparameters)
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:51
Container class for histograms.
Definition: THistManager.h:99
Double_t Pz() const
Definition: AliEmcalJet.h:108
AliSoftDropParameters MakeSoftDropParameters(const fastjet::PseudoJet &jet, const AliSoftdropDefinition &cut) const
void UserCreateOutputObjects()
Main initialization function on the worker.
const AliJetIterableContainer accepted() const
bool Bool_t
Definition: External.C:53
void LinkOutputBranch(const std::string &branchname, Double_t *datalocation)
Double_t NEF() const
Definition: AliEmcalJet.h:148
void SetDefaultClusterEnergy(Int_t d)
Container structure for EMCAL clusters.
Double_t M() const
Definition: AliEmcalJet.h:120
EMCal fiducial acceptance (each eta, phi edge narrowed by jet R)
Definition: AliEmcalJet.h:70
Container for jet within the EMCAL jet framework.
TList * OpenFile(const char *fname)
Definition: DrawAnaELoss.C:65
void SetClusHadCorrEnergyCut(Double_t cut)
static TString TrackContainerNameFactory(Bool_t isAOD)
Get name of the default track container.
static TString ClusterContainerNameFactory(Bool_t isAOD)
Get name of the default cluster container.