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