AliPhysics  a3b326c (a3b326c)
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 <algorithm>
28 #include <array>
29 #include <iostream>
30 #include <string>
31 #include <set>
32 #include <sstream>
33 #include <vector>
34 
35 #include <fastjet/ClusterSequence.hh>
36 #include <fastjet/contrib/Nsubjettiness.hh>
37 #include <fastjet/contrib/SoftDrop.hh>
38 
39 #include <THistManager.h>
40 #include <TLinearBinning.h>
41 #include <TLorentzVector.h>
42 #include <TMath.h>
43 #include <TObjString.h>
44 #include <TString.h>
45 #include <TVector3.h>
46 
47 #include "AliAODEvent.h"
48 #include "AliAODInputHandler.h"
49 #include "AliAnalysisManager.h"
50 #include "AliAnalysisDataSlot.h"
51 #include "AliAnalysisDataContainer.h"
53 #include "AliCDBEntry.h"
54 #include "AliCDBManager.h"
55 #include "AliClusterContainer.h"
56 #include "AliJetContainer.h"
59 #include "AliEmcalJet.h"
60 #include "AliEmcalList.h"
63 #include "AliLog.h"
64 #include "AliParticleContainer.h"
65 #include "AliRhoParameter.h"
66 #include "AliTrackContainer.h"
67 #include "AliTriggerCluster.h"
68 #include "AliTriggerConfiguration.h"
69 #include "AliVCluster.h"
70 #include "AliVParticle.h"
71 
72 #ifdef EXPERIMENTAL_JETCONSTITUENTS
75 #endif
76 
77 
81 
82 namespace EmcalTriggerJets {
83 
86  fJetSubstructureTree(nullptr),
87  fGlobalTreeParams(nullptr),
88  fSoftDropMeasured(nullptr),
89  fSoftDropTrue(nullptr),
90  fNSubMeasured(nullptr),
91  fNSubTrue(nullptr),
92  fKineRec(nullptr),
93  fKineSim(nullptr),
94  fJetStructureMeasured(nullptr),
95  fJetStructureTrue(nullptr),
96  fQAHistos(nullptr),
97  fLumiMonitor(nullptr),
98  fSDZCut(0.1),
99  fSDBetaCut(0),
100  fReclusterizer(kCAAlgo),
101  fTriggerSelectionBits(AliVEvent::kAny),
102  fTriggerSelectionString(""),
103  fNameTriggerDecisionContainer("EmcalTriggerDecision"),
104  fUseTriggerSelectionForData(false),
105  fUseDownscaleWeight(false),
106  fUseChargedConstituents(true),
107  fUseNeutralConstituents(true),
108  fFillPart(true),
109  fFillRho(true),
110  fFillSoftDrop(true),
111  fFillNSub(true),
112  fFillStructGlob(true)
113 {
114 }
115 
117  AliAnalysisTaskEmcalJet(name, kTRUE),
124  fKineRec(nullptr),
125  fKineSim(nullptr),
130  fSDZCut(0.1),
131  fSDBetaCut(0),
133  fTriggerSelectionBits(AliVEvent::kAny),
135  fNameTriggerDecisionContainer("EmcalTriggerDecision"),
137  fUseDownscaleWeight(false),
140  fFillPart(true),
141  fFillRho(true),
142  fFillSoftDrop(true),
143  fFillNSub(true),
144  fFillStructGlob(true)
145 {
146  DefineOutput(2, TTree::Class());
147  SetUseAliAnaUtils(true);
148 }
149 
153  if(fSoftDropTrue) delete fSoftDropTrue;
154  if(fNSubMeasured) delete fNSubMeasured;
155  if(fNSubTrue) delete fNSubTrue;
156  if(fKineRec) delete fKineRec;
157  if(fKineSim) delete fKineSim;
160 }
161 
164 
165  // Make QA for constituent clusters
166  TLinearBinning jetptbinning(9, 20, 200),
167  clusterenergybinning(200, 0., 200),
168  timebinning(1000, -500., 500.),
169  m02binning(100, 0., 1.),
170  ncellbinning(101, -0.5, 100.5);
171  fQAHistos = new THistManager("QAhistos");
172  fQAHistos->CreateTH1("hEventCounter", "Event counter", 1, 0.5, 1.5);
173  fQAHistos->CreateTH2("hClusterConstE", "EMCAL cluster energy vs jet pt; p_{t, jet} (GeV/c); E_{cl} (GeV)", jetptbinning, clusterenergybinning);
174  fQAHistos->CreateTH2("hClusterConstTime", "EMCAL cluster time vs. jet pt; p_{t, jet} (GeV/c); t_{cl} (ns)", jetptbinning, timebinning);
175  fQAHistos->CreateTH2("hClusterConstM02", "EMCAL cluster M02 vs. jet pt; p{t, jet} (GeV/c); M02", jetptbinning, m02binning);
176  fQAHistos->CreateTH2("hClusterConstNcell", "EMCAL cluster ncell vs. jet pt; p{t, jet} (GeV/c); Number of cells", jetptbinning, ncellbinning);
177 
178  // Test of constituent QA
179 #ifdef EXPERIMENTAL_JETCONSTITUENTS
180  fQAHistos->CreateTH2("hChargedConstituentPt", "charged constituent pt vs jet pt (via constituent map); p_{t,jet} (GeV/c); p_{t,ch} (GeV/c)", jetptbinning, clusterenergybinning);
181  fQAHistos->CreateTH2("hChargedIndexPt", "charged constituent pt vs jet pt (via index map); p_{t, jet} (GeV/c); p_{t, ch} (GeV/c)", jetptbinning, clusterenergybinning);
182 
183  fQAHistos->CreateTH2("hClusterConstituentEDefault", "cluster constituent default energy vs. jet pt (va constituent map); p_{t, jet} (GeV/c); E_{cl} (GeV)", jetptbinning, clusterenergybinning);
184  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);
185  fQAHistos->CreateTH2("hClusterConstituentEHC", "cluster constituent hadronic-corrected energy vs. jet pt (va constituent map); p_{t, jet} (GeV/c); E_{cl} (GeV)", jetptbinning, clusterenergybinning);
186  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);
187  fQAHistos->CreateTH2("hClusterIndexEHC", "cluster constituent hadronic-corrected energy vs. jet pt (via index map); p_{t, jet} (GeV/c); E_{cl} (GeV)", jetptbinning, clusterenergybinning);
188  fQAHistos->CreateTH2("hLeadingChargedConstituentPt", "Pt of the leading charged constituent in jet; p_{t,jet} (GeV/c); p_{t,ch} (GeV/c)", jetptbinning, clusterenergybinning);
189  fQAHistos->CreateTH2("hLeadingClusterConstituentPt", "Pt of the leading cluster constituent in jet; p_{t,jet} (GeV/c); p_{t,ch} (GeV/c)", jetptbinning, clusterenergybinning);
190 #endif
191  for(auto h : *(fQAHistos->GetListOfHistograms())) fOutput->Add(h);
192 
193  OpenFile(2);
194  std::string treename = this->GetOutputSlot(2)->GetContainer()->GetName();
195  fJetSubstructureTree = new TTree(treename.data(), "Tree with jet substructure information");
196 
198  fGlobalTreeParams->LinkJetTreeBranches(fJetSubstructureTree, fFillRho);
201  if(fFillPart) {
204  }
205  if(fFillSoftDrop) {
208  if(fFillPart) {
211  }
212  }
213  if(fFillNSub) {
216  if(fFillPart) {
219  }
220  }
221 
222  if(fFillStructGlob){
225  if(fFillPart){
228  }
229  }
230 
231  PostData(1, fOutput);
232  PostData(2, fJetSubstructureTree);
233 }
234 
238  }
239 }
240 
244  AliParticleContainer *particles = GetParticleContainer("mcparticles");
245 
246  AliJetContainer *mcjets = GetJetContainer("mcjets");
247  AliJetContainer *datajets = GetJetContainer("datajets");
248 
249  FillLuminosity(); // Makes only sense in data
250 
251  // for(auto e : *(fInputEvent->GetList())) std::cout << e->GetName() << std::endl;
252 
253  std::stringstream rhoTagData, rhoTagMC;
254  if(datajets) rhoTagData << "R" << std::setw(2) << std::setfill('0') << static_cast<Int_t>(datajets->GetJetRadius() * 10.);
255  if(mcjets) rhoTagMC << "R" << std::setw(2) << std::setfill('0') << static_cast<Int_t>(mcjets->GetJetRadius() * 10.);
256 
257  if(fFillRho){
258  std::string rhoSparseData = "RhoSparse_Full_" + rhoTagData.str(), rhoSparseMC = "RhoSparse_Full_" + rhoTagMC.str(),
259  rhoMassData = "RhoMassSparse_Full_" + rhoTagData.str(), rhoMassMC = "RhoMassSparse_Full_" + rhoTagMC.str();
260  AliRhoParameter *rhoPtRec = GetRhoFromEvent(rhoSparseData.data()),
261  *rhoMassRec = GetRhoFromEvent(rhoMassData.data()),
262  *rhoPtSim = GetRhoFromEvent(rhoSparseMC.data()),
263  *rhoMassSim = GetRhoFromEvent(rhoMassMC.data());
264  AliDebugStream(2) << "Found rho parameter for reconstructed pt: " << (rhoPtRec ? "yes" : "no") << ", value: " << (rhoPtRec ? rhoPtRec->GetVal() : 0.) << std::endl;
265  AliDebugStream(2) << "Found rho parameter for sim pt: " << (rhoPtSim ? "yes" : "no") << ", value: " << (rhoPtSim ? rhoPtSim->GetVal() : 0.) << std::endl;
266  AliDebugStream(2) << "Found rho parameter for reconstructed Mass: " << (rhoMassRec ? "yes" : "no") << ", value: " << (rhoMassRec ? rhoMassRec->GetVal() : 0.) << std::endl;
267  AliDebugStream(2) << "Found rho parameter for sim Mass: " << (rhoMassSim ? "yes" : "no") << ", value: " << (rhoMassSim ? rhoMassSim->GetVal() : 0.) << std::endl;
268  Double_t rhopars[4] = {
269  rhoPtRec ? rhoPtRec->GetVal() : 0.,
270  rhoPtSim ? rhoPtSim->GetVal() : 0.,
271  rhoMassRec ? rhoMassRec->GetVal() : 0.,
272  rhoMassSim ? rhoMassSim->GetVal() : 0.
273  };
274  memcpy(this->fGlobalTreeParams->fRhoParamters, rhopars, sizeof(Double_t) * 4);
275  }
276 
277  AliDebugStream(1) << "Inspecting jet radius " << (datajets ? datajets->GetJetRadius() : mcjets->GetJetRadius()) << std::endl;
278  this->fGlobalTreeParams->fJetRadius = (datajets ? datajets->GetJetRadius() : mcjets->GetJetRadius());
279  fGlobalTreeParams->fTriggerClusterIndex = -1; // Reset trigger cluster index
280 
281  // Run trigger selection (not on pure MCgen train)
282  if(datajets){
283  if(!(fInputHandler->IsEventSelected() & fTriggerSelectionBits)) return false;
284  if(!mcjets){
285  // Pure data - do EMCAL trigger selection from selection string
286  if(fTriggerSelectionString.Length()) {
287  if(!fInputEvent->GetFiredTriggerClasses().Contains(fTriggerSelectionString)) return false;
289  auto trgselresult = static_cast<PWG::EMCAL::AliEmcalTriggerDecisionContainer *>(fInputEvent->FindListObject(fNameTriggerDecisionContainer));
290  AliDebugStream(1) << "Found trigger decision object: " << (trgselresult ? "yes" : "no") << std::endl;
291  if(!trgselresult){
292  AliErrorStream() << "Trigger decision container with name " << fNameTriggerDecisionContainer << " not found in event - not possible to select EMCAL triggers" << std::endl;
293  return false;
294  }
295  if(!trgselresult->IsEventSelected(fTriggerSelectionString)) return false;
296  }
297  }
298 
299  // decode trigger string in order to determine the trigger clusters
300  std::vector<std::string> clusternames;
301  auto triggerinfos = PWG::EMCAL::Triggerinfo::DecodeTriggerString(fInputEvent->GetFiredTriggerClasses().Data());
302  for(auto t : triggerinfos) {
303  if(std::find(clusternames.begin(), clusternames.end(), t.Triggercluster()) == clusternames.end()) clusternames.emplace_back(t.Triggercluster());
304  }
305  bool isCENT = (std::find(clusternames.begin(), clusternames.end(), "CENT") != clusternames.end()),
306  isCENTNOTRD = (std::find(clusternames.begin(), clusternames.end(), "CENTNOTRD") != clusternames.end()),
307  isCALO = (std::find(clusternames.begin(), clusternames.end(), "CALO") != clusternames.end()),
308  isCALOFAST = (std::find(clusternames.begin(), clusternames.end(), "CALOFAST") != clusternames.end());
309  if(isCENT) fGlobalTreeParams->fTriggerClusterIndex = 0;
310  else if(isCENTNOTRD) fGlobalTreeParams->fTriggerClusterIndex = 1;
311  else if(isCALO) fGlobalTreeParams->fTriggerClusterIndex = 2;
312  else if(isCALOFAST) fGlobalTreeParams->fTriggerClusterIndex = 3;
313  } else {
315  // Simulation - do EMCAL trigger selection from trigger selection object
316  auto mctrigger = static_cast<PWG::EMCAL::AliEmcalTriggerDecisionContainer *>(fInputEvent->FindListObject(fNameTriggerDecisionContainer));
317  AliDebugStream(1) << "Found trigger decision object: " << (mctrigger ? "yes" : "no") << std::endl;
318  if(!mctrigger){
319  AliErrorStream() << "Trigger decision container with name " << fNameTriggerDecisionContainer << " not found in event - not possible to select EMCAL triggers" << std::endl;
320  return false;
321  }
322  if(!mctrigger->IsEventSelected(fTriggerSelectionString)) return false;
323  }
324  }
325  }
326 
327  double weight = 1.;
329  AliDebugStream(2) << "Trigger selection string: " << fTriggerSelectionString << std::endl;
330  TString selectionString = (fTriggerSelectionBits & AliVEvent::kINT7) ? "INT7" : fTriggerSelectionString;
331  auto triggerstring = MatchTrigger(selectionString.Data());
332  AliDebugStream(2) << "Getting downscale correction factor for trigger string " << triggerstring << std::endl;
334  }
335  AliDebugStream(1) << "Using downscale weight " << weight << std::endl;
336  this->fGlobalTreeParams->fEventWeight = weight;
337 
338 
339  // Count events (for spectrum analysis)
340  fQAHistos->FillTH1("hEventCounter", 1);
341 
342  AliSoftdropDefinition softdropSettings;
343  softdropSettings.fBeta = fSDBetaCut;
344  softdropSettings.fZ = fSDZCut;
345  switch(fReclusterizer) {
346  case kCAAlgo: softdropSettings.fRecluserAlgo = fastjet::cambridge_aachen_algorithm; break;
347  case kKTAlgo: softdropSettings.fRecluserAlgo = fastjet::kt_algorithm; break;
348  case kAKTAlgo: softdropSettings.fRecluserAlgo = fastjet::antikt_algorithm; break;
349  };
350 
351  AliNSubjettinessDefinition nsubjettinessSettings;
352  nsubjettinessSettings.fBeta = 1.;
353  nsubjettinessSettings.fRadius = 0.4;
354 
355  if(datajets) {
356  AliDebugStream(1) << "In data jets branch: found " << datajets->GetNJets() << " jets, " << datajets->GetNAcceptedJets() << " were accepted\n";
357  AliDebugStream(1) << "Having MC information: " << (mcjets ? TString::Format("yes, with %d jets", mcjets->GetNJets()) : "no") << std::endl;
358  if(mcjets) {
359  AliDebugStream(1) << "In MC jets branch: found " << mcjets->GetNJets() << " jets, " << mcjets->GetNAcceptedJets() << " were accepted\n";
360  }
361  for(auto jet : datajets->accepted()) {
362  double pt = jet->Pt(), pz = jet->Pz(), E = jet->E(), M = TMath::Sqrt(E*E - pt*pt - pz*pz);
363  AliDebugStream(2) << "Next jet: pt:" << jet->Pt() << ", E: " << E << ", pz: " << pz << ", M(self): " << M << "M(fj)" << jet->M() << std::endl;
364  AliEmcalJet *associatedJet = jet->ClosestJet();
365 
366  if(mcjets) {
367  if(!associatedJet) {
368  AliDebugStream(2) << "Not found associated jet" << std::endl;
369  continue;
370  }
371  if(!(SelectJet(*jet, tracks) && SelectJet(*associatedJet, particles))) continue;
372  try {
373  DoConstituentQA(jet, tracks, clusters);
374  AliJetSubstructureData structureData = MakeJetSubstructure(*jet, datajets->GetJetRadius() * 2., tracks, clusters, {softdropSettings, nsubjettinessSettings}),
375  structureMC = fFillPart ? MakeJetSubstructure(*associatedJet, mcjets->GetJetRadius() * 2, particles, nullptr, {softdropSettings, nsubjettinessSettings}) : AliJetSubstructureData();
377  if(fKineSim) *fKineSim = MakeJetKineParameters(*associatedJet);
378  if(fSoftDropMeasured) *fSoftDropMeasured = structureData.fSoftDrop;
379  if(fSoftDropTrue) *fSoftDropTrue = structureMC.fSoftDrop;
380  if(fNSubMeasured) *fNSubMeasured = structureData.fNsubjettiness;
381  if(fNSubTrue) *fNSubTrue = structureMC.fNsubjettiness;
382  if(fJetStructureMeasured) *fJetStructureMeasured = {MakeAngularity(*jet, tracks, clusters), MakePtD(*jet, tracks, clusters)};
383  if(fJetStructureTrue) *fJetStructureTrue = {MakeAngularity(*associatedJet, particles, nullptr), MakePtD(*associatedJet, particles, nullptr)};
384  fJetSubstructureTree->Fill();
385  } catch(ReclusterizerException &e) {
386  AliErrorStream() << "Error in reclusterization - skipping jet" << std::endl;
387  } catch(SubstructureException &e) {
388  AliErrorStream() << "Error in substructure observable - skipping jet" << std::endl;
389  }
390  } else {
391  if(!SelectJet(*jet, tracks)) continue;
392  try {
393  DoConstituentQA(jet, tracks, clusters);
394  AliJetSubstructureData structure = MakeJetSubstructure(*jet, 0.4, tracks, clusters, {softdropSettings, nsubjettinessSettings});
397  if(fNSubMeasured) *fNSubMeasured = structure.fNsubjettiness;
398  if(fJetStructureMeasured) *fJetStructureMeasured = {MakeAngularity(*jet, tracks, clusters), MakePtD(*jet, tracks, clusters)};
399  fJetSubstructureTree->Fill();
400  } catch(ReclusterizerException &e) {
401  AliErrorStream() << "Error in reclusterization - skipping jet" << std::endl;
402  } catch(SubstructureException &e) {
403  AliErrorStream() << "Error in substructure observable - skipping jet" << std::endl;
404  }
405  }
406  }
407  } else {
408  if(mcjets) {
409  // for MCgen train
410  AliDebugStream(1) << "In MC pure jet branch: found " << mcjets->GetNJets() << " jets, " << mcjets->GetNAcceptedJets() << " were accepted\n";
411  for(auto j : mcjets->accepted()){
412  AliEmcalJet *mcjet = static_cast<AliEmcalJet *>(j);
413  try {
414  AliJetSubstructureData structure = MakeJetSubstructure(*mcjet, mcjets->GetJetRadius() * 2., particles, nullptr,{softdropSettings, nsubjettinessSettings});
415  if(this->fKineSim) *fKineSim = MakeJetKineParameters(*mcjet);
416  if(fSoftDropTrue) *fSoftDropTrue = structure.fSoftDrop;
417  if(fNSubTrue) *fNSubTrue = structure.fNsubjettiness;
418  if(fJetStructureTrue) *fJetStructureTrue = {MakeAngularity(*mcjet, particles, nullptr), MakePtD(*mcjet, particles, nullptr)};
419  fJetSubstructureTree->Fill();
420  } catch (ReclusterizerException &e) {
421  AliErrorStream() << "Error in reclusterization - skipping jet" << std::endl;
422  } catch (SubstructureException &e) {
423  AliErrorStream() << "Error in substructure observable - skipping jet" << std::endl;
424  }
425  }
426  }
427  }
428 
429  return true;
430 }
431 
433  AliCDBManager * cdb = AliCDBManager::Instance();
434  if(!fMCEvent && cdb){
435  // Get List of trigger clusters
436  AliCDBEntry *en = cdb->Get("GRP/CTP/Config");
437  AliTriggerConfiguration *trg = static_cast<AliTriggerConfiguration *>(en->GetObject());
438  std::vector<std::string> clusternames;
439  for(auto c : trg->GetClusters()) {
440  AliTriggerCluster *clust = static_cast<AliTriggerCluster *>(c);
441  std::string clustname = clust->GetName();
442  auto iscent = clustname.find("CENT") != std::string::npos, iscalo = clustname.find("CALO") != std::string::npos;
443  if(!(iscalo || iscent)) continue;
444  clusternames.emplace_back(clustname);
445  }
446 
447  // Set the x-axis of the luminosity monitor histogram
448  fLumiMonitor = new TH1F("hLumiMonitor", "Luminosity monitor", clusternames.size(), 0, clusternames.size());
449  int currentbin(1);
450  for(auto c : clusternames) {
451  fLumiMonitor->GetXaxis()->SetBinLabel(currentbin++, c.data());
452  }
453  fOutput->Add(fLumiMonitor);
454  }
455 }
456 
459  auto downscalefactors = PWG::EMCAL::AliEmcalDownscaleFactorsOCDB::Instance();
460  if(fInputEvent->GetFiredTriggerClasses().Contains("INT7")) {
461  for(auto trigger : PWG::EMCAL::Triggerinfo::DecodeTriggerString(fInputEvent->GetFiredTriggerClasses().Data())){
462  auto int7trigger = trigger.IsTriggerClass("INT7");
463  auto bunchcrossing = trigger.BunchCrossing() == "B";
464  auto nopf = trigger.PastFutureProtection() == "NOPF";
465  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.Triggercluster() << std::endl;
466  if(int7trigger && bunchcrossing && nopf) {
467  double downscale = downscalefactors->GetDownscaleFactorForTriggerClass(trigger.ExpandClassName());
468  AliDebugStream(5) << "Using downscale " << downscale << std::endl;
469  fLumiMonitor->Fill(trigger.Triggercluster().data(), 1./downscale);
470  }
471  }
472  }
473  }
474 }
475 
477  AliJetKineParameters result;
478  result.fPt = TMath::Abs(jet.Pt());
479  result.fE = jet.E();
480  result.fEta = jet.Eta();
481  result.fPhi = jet.Phi();
482  result.fArea = jet.Area();
483  result.fMass = jet.M();
484  result.fNEF = jet.NEF();
485  result.fNCharged = jet.GetNumberOfTracks();
486  result.fNNeutral = jet.GetNumberOfClusters();
487  return result;
488 }
489 
491  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
492  std::vector<fastjet::PseudoJet> constituents;
493  bool isMC = dynamic_cast<const AliMCParticleContainer *>(tracks);
494  AliDebugStream(2) << "Make new jet substrucutre for " << (isMC ? "MC" : "data") << " jet: Number of tracks " << jet.GetNumberOfTracks() << ", clusters " << jet.GetNumberOfClusters() << std::endl;
495  if(tracks && (fUseChargedConstituents || isMC)){ // Neutral particles part of particle container in case of MC
496  for(int itrk = 0; itrk < jet.GetNumberOfTracks(); itrk++){
497  auto track = jet.TrackAt(itrk, tracks->GetArray());
498  if(!track->Charge() && !fUseNeutralConstituents) continue; // Reject neutral constituents in case of using only charged consituents
499  if(track->Charge() && !fUseChargedConstituents) continue; // Reject charged constituents in case of using only neutral consituents
500  fastjet::PseudoJet constituentTrack(track->Px(), track->Py(), track->Pz(), track->E());
501  constituentTrack.set_user_index(jet.TrackAt(itrk));
502  constituents.push_back(constituentTrack);
503  }
504  }
505 
506  if(clusters && fUseNeutralConstituents){
507  for(int icl = 0; icl < jet.GetNumberOfClusters(); icl++) {
508  auto cluster = jet.ClusterAt(icl, clusters->GetArray());
509  TLorentzVector clustervec;
510  cluster->GetMomentum(clustervec, fVertex, (AliVCluster::VCluUserDefEnergy_t)clusters->GetDefaultClusterEnergy());
511  fastjet::PseudoJet constituentCluster(clustervec.Px(), clustervec.Py(), clustervec.Pz(), cluster->GetHadCorrEnergy());
512  constituentCluster.set_user_index(jet.ClusterAt(icl) + kClusterOffset);
513  constituents.push_back(constituentCluster);
514  }
515  }
516 
517  AliDebugStream(3) << "Found " << constituents.size() << " constituents for jet with pt=" << jet.Pt() << " GeV/c" << std::endl;
518  if(!constituents.size()){
519  AliErrorStream() << "Jet has 0 constituents." << std::endl;
520  throw ReclusterizerException();
521  }
522  // Redo jet finding on constituents with a
523  fastjet::JetDefinition jetdef(fastjet::antikt_algorithm, jetradius*2, static_cast<fastjet::RecombinationScheme>(0), fastjet::BestFJ30 );
524  std::vector<fastjet::PseudoJet> outputjets;
525  try {
526  fastjet::ClusterSequence jetfinder(constituents, jetdef);
527  outputjets = jetfinder.inclusive_jets(0);
529  return result;
530  } catch (fastjet::Error &e) {
531  AliErrorStream() << " FJ Exception caught: " << e.message() << std::endl;
532  throw ReclusterizerException();
533  } catch (SoftDropException &e) {
534  AliErrorStream() << "Softdrop exception caught: " << e.what() << std::endl;
535  throw ReclusterizerException();
536  }
537 }
538 
540  fastjet::contrib::SoftDrop softdropAlgorithm(cutparameters.fBeta, cutparameters.fZ);
541  softdropAlgorithm.set_verbose_structure(kTRUE);
542  std::unique_ptr<fastjet::contrib::Recluster> reclusterizer(new fastjet::contrib::Recluster(cutparameters.fRecluserAlgo, 1, true));
543  softdropAlgorithm.set_reclustering(kTRUE, reclusterizer.get());
544  AliDebugStream(4) << "Jet has " << jet.constituents().size() << " constituents" << std::endl;
545  auto groomed = softdropAlgorithm(jet);
546  try {
547  auto softdropstruct = groomed.structure_of<fastjet::contrib::SoftDrop>();
548 
549  AliSoftDropParameters result({softdropstruct.symmetry(),
550  groomed.m(),
551  softdropstruct.delta_R(),
552  groomed.perp(),
553  softdropstruct.delta_R(),
554  softdropstruct.mu(),
555  softdropstruct.dropped_count()});
556  return result;
557  } catch(std::bad_cast &e) {
558  throw SoftDropException();
559  }
560 }
561 
564  fastjet::contrib::Nsubjettiness (1,fastjet::contrib::KT_Axes(),fastjet::contrib::NormalizedCutoffMeasure(cut.fBeta, cut.fRadius, 1e100)).result(jet),
565  fastjet::contrib::Nsubjettiness (2,fastjet::contrib::KT_Axes(),fastjet::contrib::NormalizedCutoffMeasure(cut.fBeta, cut.fRadius, 1e100)).result(jet)
566  });
567  return result;
568 }
569 
571  if(!(jet.GetNumberOfTracks() || jet.GetNumberOfClusters()))
572  throw SubstructureException();
573  TVector3 jetvec(jet.Px(), jet.Py(), jet.Pz());
574  Double_t den(0.), num(0.);
575  bool isMC = dynamic_cast<const AliMCParticleContainer *>(tracks);
576  if(tracks && (fUseChargedConstituents || isMC)){
577  for(UInt_t itrk = 0; itrk < jet.GetNumberOfTracks(); itrk++) {
578  auto track = jet.TrackAt(itrk, tracks->GetArray());
579  if(!track){
580  AliErrorStream() << "Associated constituent particle / track not found\n";
581  continue;
582  }
583  if(!track->Charge() && !fUseNeutralConstituents) continue; // Reject neutral constituents in case of using only charged consituents
584  if(track->Charge() && !fUseChargedConstituents) continue; // Reject charged constituents in case of using only neutral consituents
585  TVector3 trackvec(track->Px(), track->Py(), track->Pz());
586 
587  num += track->Pt() * trackvec.DrEtaPhi(jetvec);
588  den += +track->Pt();
589  }
590  }
591  if(clusters && fUseNeutralConstituents) {
592  for(UInt_t icl = 0; icl < jet.GetNumberOfClusters(); icl++){
593  auto clust = jet.ClusterAt(icl, clusters->GetArray());
594  if(!clust) {
595  AliErrorStream() << "Associated constituent cluster not found\n";
596  continue;
597  }
598  TLorentzVector clusterp;
599  clust->GetMomentum(clusterp, fVertex, (AliVCluster::VCluUserDefEnergy_t)clusters->GetDefaultClusterEnergy());
600 
601  num += clusterp.Pt() * clusterp.Vect().DrEtaPhi(jetvec);
602  den += clusterp.Pt();
603  }
604  }
605  return num/den;
606 }
607 
609  if (!(jet.GetNumberOfTracks() || jet.GetNumberOfClusters()))
610  throw SubstructureException();
611  Double_t den(0.), num(0.);
612  bool isMC = dynamic_cast<const AliMCParticleContainer *>(particles);
613  if(particles && (fUseChargedConstituents || isMC)){
614  for(UInt_t itrk = 0; itrk < jet.GetNumberOfTracks(); itrk++) {
615  auto trk = jet.TrackAt(itrk, particles->GetArray());
616  if(!trk){
617  AliErrorStream() << "Associated constituent particle / track not found\n";
618  continue;
619  }
620  if(!trk->Charge() && !fUseNeutralConstituents) continue; // Reject neutral constituents in case of using only charged consituents
621  if(trk->Charge() && !fUseChargedConstituents) continue; // Reject charged constituents in case of using only neutral consituents
622  num += trk->Pt() * trk->Pt();
623  den += trk->Pt();
624  }
625  }
626  if(clusters && fUseNeutralConstituents){
627  for(UInt_t icl = 0; icl < jet.GetNumberOfClusters(); icl++){
628  auto clust = jet.ClusterAt(icl, clusters->GetArray());
629  if(!clust) {
630  AliErrorStream() << "Associated constituent cluster not found\n";
631  continue;
632  }
633  TLorentzVector clusterp;
634  clust->GetMomentum(clusterp, fVertex, (AliVCluster::VCluUserDefEnergy_t)clusters->GetDefaultClusterEnergy());
635  num += clusterp.Pt() * clusterp.Pt();
636  den += clusterp.Pt();
637  }
638  }
639  return TMath::Sqrt(num)/den;
640 }
641 
643  for(int icl = 0; icl < jet->GetNumberOfClusters(); icl++){
644  auto clust = jet->ClusterAt(icl, clusters->GetArray());
645  AliDebugStream(3) << "cluster time " << clust->GetTOF() << std::endl;
646  fQAHistos->FillTH2("hClusterConstE", jet->Pt(),clust->GetUserDefEnergy(clusters->GetDefaultClusterEnergy()));
647  fQAHistos->FillTH2("hClusterConstTime", jet->Pt(), clust->GetTOF());
648  fQAHistos->FillTH2("hClusterConstM02", jet->Pt(), clust->GetM02());
649  fQAHistos->FillTH2("hClusterConstNcell", jet->Pt(), clust->GetNCells());
650 
651 #ifdef EXPERIMENTAL_JETCONSTITUENTS
652  fQAHistos->FillTH2("hClusterIndexENLC", jet->Pt(), clust->GetNonLinCorrEnergy());
653  fQAHistos->FillTH2("hClusterIndexEHC", jet->Pt(), clust->GetHadCorrEnergy());
654 #endif
655  }
656 
657 #ifdef EXPERIMENTAL_JETCONSTITUENTS
658  // Loop over charged particles - fill test histogram
659  for(int itrk = 0; itrk < jet->GetNumberOfTracks(); itrk++){
660  auto part = jet->TrackAt(itrk, cont->GetArray());
661  fQAHistos->FillTH2("hChargedIndexPt", jet->Pt(), part->Pt());
662  }
663 
664  // Look over charged constituents
665  AliDebugStream(2) << "Jet: Number of particle constituents: " << jet->GetParticleConstituents().size() << std::endl;
666  for(auto part : jet->GetParticleConstituents()) {
667  //auto part = static_cast<PWG::JETFW::AliEmcalParticleJetConstituent *>(pconst);
668  AliDebugStream(3) << "Found particle constituent with pt " << part.Pt() << ", from VParticle " << part.GetParticle()->Pt() << std::endl;
669  fQAHistos->FillTH2("hChargedConstituentPt", jet->Pt(), part.Pt());
670  }
671 
672  // Loop over neutral constituents
673  AliDebugStream(2) << "Jet: Number of cluster constituents: " << jet->GetClusterConstituents().size() << std::endl;
674  for(auto clust : jet->GetClusterConstituents()){
675  //auto clust = static_cast<PWG::JETFW::AliEmcalClusterJetConstituent *>(cconst);
676  AliDebugStream(3) << "Found cluster constituent with energy " << clust.E() << " using energy definition " << static_cast<int>(clust.GetDefaultEnergyType()) << std::endl;
677  fQAHistos->FillTH2("hClusterConstituentEDefault", jet->Pt(), clust.E());
678  fQAHistos->FillTH2("hClusterConstituentENLC", jet->Pt(), clust.GetCluster()->GetNonLinCorrEnergy());
679  fQAHistos->FillTH2("hClusterConstituentEHC", jet->Pt(), clust.GetCluster()->GetHadCorrEnergy());
680  }
681 
682  // Fill global observables: Leading charged and cluster constituents
683  auto leadingcharged = jet->GetLeadingParticleConstituent();
684  auto leadingcluster = jet->GetLeadingClusterConstituent();
685  if(leadingcluster){
686  fQAHistos->FillTH1("hLeadingClusterConstituentPt", jet->Pt(), leadingcluster->GetCluster()->GetHadCorrEnergy());
687  }
688  if(leadingcharged) {
689  fQAHistos->FillTH1("hLeadingChargedConstituentPt", jet->Pt(), leadingcharged->GetParticle()->Pt());
690  }
691 #endif
692 }
693 
695  int ncharged = 0, nneutral = jet.GetNumberOfClusters();
696  if(particles) {
697  for(decltype(jet.GetNumberOfTracks()) ipart = 0; ipart < jet.GetNumberOfTracks(); ipart++){
698  auto part = jet.TrackAt(ipart, particles->GetArray());
699  if(!part) continue;
700  if(part->Charge()) ncharged++;
701  else nneutral++;
702  }
703  }
704  // check if the jet has at least one consituent for jet substructure
705  int nallowed = 0;
706  nallowed += fUseChargedConstituents ? ncharged : 0;
707  nallowed += fUseNeutralConstituents ? nneutral : 0;
708  return nallowed > 0;
709 }
710 
711 std::string AliAnalysisTaskEmcalJetSubstructureTree::MatchTrigger(const std::string &triggertoken) const {
712  std::vector<std::string> tokens;
713  std::string result;
714  std::stringstream decoder(fInputEvent->GetFiredTriggerClasses().Data());
715  while(std::getline(decoder, result, ' ')) tokens.emplace_back(result);
716  result.clear();
717  for(auto t : tokens) {
718  if(t.find(triggertoken) != std::string::npos) {
719  // take first occurrence - downscale factor should normally be the same
720  result = t;
721  break;
722  }
723  }
724  return result;
725 }
726 
727 bool AliAnalysisTaskEmcalJetSubstructureTree::IsSelectEmcalTriggers(const std::string &triggerstring) const {
728  const std::array<std::string, 8> kEMCALTriggers = {
729  "EJ1", "EJ2", "DJ1", "DJ2", "EG1", "EG2", "DG1", "DG2"
730  };
731  bool isEMCAL = false;
732  for(auto emcaltrg : kEMCALTriggers) {
733  if(triggerstring.find(emcaltrg) != std::string::npos) {
734  isEMCAL = true;
735  break;
736  }
737  }
738  return isEMCAL;
739 }
740 
742  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
743 
744  Bool_t isAOD(kFALSE);
745  AliInputEventHandler *inputhandler = static_cast<AliInputEventHandler *>(mgr->GetInputEventHandler());
746  if(inputhandler) {
747  if(inputhandler->IsA() == AliAODInputHandler::Class()){
748  std::cout << "Analysing AOD events\n";
749  isAOD = kTRUE;
750  } else {
751  std::cout << "Analysing ESD events\n";
752  }
753  }
754 
755  std::stringstream taskname;
756  taskname << "JetSubstructureTreemaker_R" << std::setw(2) << std::setfill('0') << int(jetradius*10) << trigger;
758  mgr->AddTask(treemaker);
759  treemaker->SetMakeGeneralHistograms(kTRUE);
760 
761  // Adding containers
762  if(isMC) {
763  AliParticleContainer *particles = treemaker->AddMCParticleContainer("mcparticles");
764  particles->SetMinPt(0.);
765 
766  AliJetContainer *mcjets = treemaker->AddJetContainer(
767  jettype,
769  recombinationScheme,
770  jetradius,
772  particles, nullptr);
773  mcjets->SetName("mcjets");
774  mcjets->SetJetPtCut(20.);
775  }
776 
777  if(isData) {
778  AliTrackContainer *tracks(nullptr);
779  if((jettype == AliJetContainer::kChargedJet) || (jettype == AliJetContainer::kFullJet)){
781  std::cout << "Track container name: " << tracks->GetName() << std::endl;
782  tracks->SetMinPt(0.15);
783  }
784  AliClusterContainer *clusters(nullptr);
786  std::cout << "Using full or neutral jets ..." << std::endl;
788  std::cout << "Cluster container name: " << clusters->GetName() << std::endl;
789  clusters->SetClusHadCorrEnergyCut(0.3); // 300 MeV E-cut
790  clusters->SetDefaultClusterEnergy(AliVCluster::kHadCorr);
791  } else {
792  std::cout << "Using charged jets ... " << std::endl;
793  }
794 
795  AliJetContainer *datajets = treemaker->AddJetContainer(
796  jettype,
798  recombinationScheme,
799  jetradius,
801  tracks, clusters);
802  datajets->SetName("datajets");
803  datajets->SetJetPtCut(20.);
804 
805  treemaker->SetUseAliAnaUtils(true, true);
806  treemaker->SetVzRange(-10., 10);
807 
808  // configure trigger selection
809  std::string triggerstring(trigger);
810  if(triggerstring.find("INT7") != std::string::npos) {
811  treemaker->SetTriggerBits(AliVEvent::kINT7);
812  } else if(triggerstring.find("EJ1") != std::string::npos) {
813  treemaker->SetTriggerBits(AliVEvent::kEMCEJE);
814  treemaker->SetTriggerString("EJ1");
815  } else if(triggerstring.find("EJ2") != std::string::npos) {
816  treemaker->SetTriggerBits(AliVEvent::kEMCEJE);
817  treemaker->SetTriggerString("EJ2");
818  }
819  }
820 
821  std::string jettypestring;
822  switch(jettype) {
823  case AliJetContainer::kFullJet: jettypestring = "FullJets"; break;
824  case AliJetContainer::kChargedJet: jettypestring = "ChargedJets"; break;
825  case AliJetContainer::kNeutralJet: jettypestring = "NeutralJets"; break;
826  default: jettypestring = "Undef";
827  };
828 
829  // Connecting containers
830  std::stringstream outputfile, histname, treename;
831  outputfile << mgr->GetCommonFileName() << ":JetSubstructure_" << jettypestring << "_R" << std::setw(2) << std::setfill('0') << int(jetradius * 10.) << "_" << trigger;
832  histname << "JetSubstructureHistos_" << jettypestring << "_R" << std::setw(2) << std::setfill('0') << int(jetradius * 10.) << "_" << trigger;
833  treename << "JetSubstructureTree_" << jettypestring << "_R" << std::setw(2) << std::setfill('0') << int(jetradius * 10.) << "_" << trigger;
834  mgr->ConnectInput(treemaker, 0, mgr->GetCommonInputContainer());
835  mgr->ConnectOutput(treemaker, 1, mgr->CreateContainer(histname.str().data(), AliEmcalList::Class(), AliAnalysisManager::kOutputContainer, outputfile.str().data()));
836  mgr->ConnectOutput(treemaker, 2, mgr->CreateContainer(treename.str().data(), TTree::Class(), AliAnalysisManager::kOutputContainer, mgr->GetCommonFileName()));
837 
838  return treemaker;
839 }
840 
841 void AliSoftDropParameters::LinkJetTreeBranches(TTree *jettree, const char *tag) {
842  LinkBranch(jettree, &fZg, Form("Zg%s", tag), "D");
843  LinkBranch(jettree, &fRg, Form("Rg%s", tag), "D");
844  LinkBranch(jettree, &fMg, Form("Mg%s", tag), "D");
845  LinkBranch(jettree, &fPtg, Form("Ptg%s", tag), "D");
846  LinkBranch(jettree, &fMug, Form("Mug%s", tag), "D");
847  LinkBranch(jettree, &fDeltaR, Form("DeltaRg%s", tag), "D");
848  LinkBranch(jettree, &fNDropped, Form("NDropped%s", tag), "I");
849 };
850 
852  LinkBranch(jettree, &fOneSubjettiness, Form("OneSubjettiness%s", tag), "D");
853  LinkBranch(jettree, &fTwoSubjettiness, Form("TwoSubjettiness%s", tag), "D");
854 }
855 
857  LinkBranch(jettree, &fAngularity, Form("Angularity%s", tag), "D");
858  LinkBranch(jettree, &fPtD, Form("PtD%s", tag), "D");
859 }
860 
861 void AliJetKineParameters::LinkJetTreeBranches(TTree *jettree, const char *tag){
862  LinkBranch(jettree, &fPt, Form("PtJet%s", tag), "D");
863  LinkBranch(jettree, &fE, Form("EJet%s", tag), "D");
864  LinkBranch(jettree, &fEta, Form("Eta%s", tag), "D");
865  LinkBranch(jettree, &fPhi, Form("Phi%s", tag), "D");
866  LinkBranch(jettree, &fArea, Form("Area%s", tag), "D");
867  LinkBranch(jettree, &fMass, Form("Mass%s", tag), "D");
868  LinkBranch(jettree, &fNEF, Form("NEF%s", tag), "D");
869  LinkBranch(jettree, &fPt, Form("PtJet%s", tag), "D");
870  LinkBranch(jettree, &fNCharged, Form("NCharged%s", tag), "I");
871  LinkBranch(jettree, &fNNeutral, Form("NNeutral%s", tag), "I");
872 }
873 
875  LinkBranch(jettree, &fJetRadius, "Radius", "D");
876  LinkBranch(jettree, &fEventWeight, "EventWeight", "D");
877  LinkBranch(jettree, &fTriggerClusterIndex, "TriggerClusterIndex", "I");
878  if(fillRho) {
879  std::string varnames[] = {"RhoPtRec", "RhoPtSim", "RhoMassRec", "RhoMassSim"};
880  for(int i = 0; i < 4; i++){
881  LinkBranch(jettree, fRhoParamters + i, varnames[i].data(), "D");
882  }
883  }
884 }
885 
886 void LinkBranch(TTree *jettree, void *data, const char *branchname, const char *type) {
887  jettree->Branch(branchname, data, Form("%s/%s", branchname, type));
888 }
889 } /* namespace EmcalTriggerJets */
Double_t Area() const
Definition: AliEmcalJet.h:130
double Double_t
Definition: External.C:58
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
AliNSubjettinessParameters * fNSubTrue
! Data field for true n-subjettiness parameters in jet tree
Double_t Eta() const
Definition: AliEmcalJet.h:121
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
static AliEmcalDownscaleFactorsOCDB * Instance()
AliSoftDropParameters * fSoftDropMeasured
! Data field for measured soft drop parameters in jet tree
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
Int_t fTriggerClusterIndex
Index of the trigger cluster (0 - CENT, 1 - CENTNOTRD)
Structure for results from the soft drop algorithm.
Double_t GetDownscaleFactorForTriggerClass(const TString &trigger) const
virtual void UserExecOnce()
Task initializations handled in user tasks.
Double_t E() const
Definition: AliEmcalJet.h:119
const PWG::JETFW::AliEmcalParticleJetConstituent * GetLeadingParticleConstituent() const
Get the leading particle constituent.
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.
void SetVzRange(Double_t min, Double_t max)
AliNSubjettinessParameters * fNSubMeasured
! Data field for measured n-subjettiness parameters in jet tree
static std::vector< PWG::EMCAL::Triggerinfo > DecodeTriggerString(const std::string &triggerstring)
Decoding trigger string.
AliClusterContainer * AddClusterContainer(const char *n)
Create new cluster container and attach it to the task.
TString part
use mixed event to constrain combinatorial background
Definition: InvMassFit.C:52
fastjet::JetAlgorithm fRecluserAlgo
Reclusterization algorithm.
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
AliJetKineParameters MakeJetKineParameters(const AliEmcalJet &jet) const
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
static AliAnalysisTaskEmcalJetSubstructureTree * AddEmcalJetSubstructureTreeMaker(Bool_t isMC, Bool_t isData, Double_t jetradius, AliJetContainer::EJetType_t jettype, AliJetContainer::ERecoScheme_t recombinationScheme, Bool_t useDCAL, const char *name)
void LinkBranch(TTree *jettree, void *data, const char *branchname, const char *type)
Helper function linking struct members to branches in the jet substructure tree.
AliJetStructureParameters * fJetStructureTrue
! True jet substructure paramteres
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
AliJetStructureParameters * fJetStructureMeasured
! Measured jet substructure parameters
Double_t Pt() const
Definition: AliEmcalJet.h:109
Bool_t isMC
AliJetKineParameters * fKineRec
! Detector level jet kinematics
const PWG::JETFW::AliEmcalClusterJetConstituent * GetLeadingClusterConstituent() const
Get the leading cluster constituent.
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
AliEmcalList * fOutput
!output list
AliJetKineParameters * fKineSim
! Particle level jet kinematics
Double_t fVertex[3]
!event vertex
AliTrackContainer * AddTrackContainer(const char *n)
Create new track container and attach it to the task.
AliTrackContainer * GetTrackContainer(Int_t i=0) const
void SetMakeGeneralHistograms(Bool_t g)
Base task in the EMCAL jet framework.
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
AliJetTreeGlobalParameters * fGlobalTreeParams
! Global jet tree parameters (same for all jets in event)
void UserCreateOutputObjects()
Main initialization function on the worker.
DCal fiducial acceptance (each eta, phi edge narrowed by jet R)
Definition: AliEmcalJet.h:72
const AliJetIterableContainer accepted() const
bool Bool_t
Definition: External.C:53
Double_t NEF() const
Definition: AliEmcalJet.h:148
void SetDefaultClusterEnergy(Int_t d)
bool SelectJet(const AliEmcalJet &jet, const AliParticleContainer *particles) const
AliSoftDropParameters * fSoftDropTrue
! Data field for true soft drop parameters in jet tree
Container structure for EMCAL clusters.
Container for MC-true particles within the EMCAL framework.
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.
Bool_t fUseTriggerSelectionForData
Use trigger selection on data (require trigger patch in addition to trigger selection string) ...
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.