36 #include <fastjet/ClusterSequence.hh> 37 #include <fastjet/contrib/Nsubjettiness.hh> 38 #include <fastjet/contrib/SoftDrop.hh> 39 #include <fastjet/config.h> 40 #if FASJET_VERSION_NUMBER >= 30302 41 #include <fastjet/tools/Recluster.hh> 43 #include <fastjet/contrib/Recluster.hh> 48 #include <TLorentzVector.h> 50 #include <TObjString.h> 54 #include "AliAODEvent.h" 55 #include "AliAODInputHandler.h" 56 #include "AliAnalysisManager.h" 57 #include "AliAnalysisDataSlot.h" 58 #include "AliAnalysisDataContainer.h" 60 #include "AliCDBEntry.h" 61 #include "AliCDBManager.h" 74 #include "AliTriggerCluster.h" 75 #include "AliTriggerConfiguration.h" 76 #include "AliVCluster.h" 77 #include "AliVParticle.h" 79 #ifdef EXPERIMENTAL_JETCONSTITUENTS 101 fJetStructureMeasured(
nullptr),
107 fReclusterizer(kCAAlgo),
109 fHasTrueEvent(false),
110 fTriggerSelectionBits(AliVEvent::kAny),
111 fTriggerSelectionString(
""),
112 fNameTriggerDecisionContainer(
"EmcalTriggerDecision"),
113 fUseTriggerSelectionForData(false),
114 fUseDownscaleWeight(false),
115 fUseChargedConstituents(true),
116 fUseNeutralConstituents(true),
121 fFillStructGlob(true)
157 DefineOutput(2, TTree::Class());
178 clusterenergybinning(200, 0., 200),
179 cellenergybinning(1000, 0., 100),
180 timebinning(1000, -500., 500.),
181 m02binning(100, 0., 1.),
182 ncellbinning(101, -0.5, 100.5),
183 exoticsbinning(2, -0.5, 1.5);
186 fQAHistos->
CreateTH1(
"hTriggerClusterCounter",
"Event counter separating into trigger clusters", 7, -1.5, 5.5);
187 fQAHistos->
CreateTH2(
"hClusterConstE",
"EMCAL cluster energy vs jet pt; p_{t, jet} (GeV/c); E_{cl} (GeV)", jetptbinning, clusterenergybinning);
188 fQAHistos->
CreateTH2(
"hClusterConstTime",
"EMCAL cluster time vs. jet pt; p_{t, jet} (GeV/c); t_{cl} (ns)", jetptbinning, timebinning);
189 fQAHistos->
CreateTH2(
"hClusterConstM02",
"EMCAL cluster M02 vs. jet pt; p{t, jet} (GeV/c); M02", jetptbinning, m02binning);
190 fQAHistos->
CreateTH2(
"hClusterConstNcell",
"EMCAL cluster ncell vs. jet pt; p{t, jet} (GeV/c); Number of cells", jetptbinning, ncellbinning);
191 fQAHistos->
CreateTH2(
"hClusterConstExotics",
"EMCAL cluster exotics cut vs jet pt; p{t, jet} (GeV/c); Cluster exotics", jetptbinning, exoticsbinning);
192 fQAHistos->
CreateTH2(
"hClusterConstMinCellEnergy",
"EMCAL Cluster const min cell energy; p{t, jet} (GeV/c); E_{cell} (GeV/c)", jetptbinning, cellenergybinning);
193 fQAHistos->
CreateTH2(
"hClusterConstMaxCellEnergy",
"EMCAL Cluster const max (seed) cell energy; p{t, jet} (GeV/c); E_{cell} (GeV/c)", jetptbinning, cellenergybinning);
196 #ifdef EXPERIMENTAL_JETCONSTITUENTS 197 fQAHistos->
CreateTH2(
"hChargedConstituentPt",
"charged constituent pt vs jet pt (via constituent map); p_{t,jet} (GeV/c); p_{t,ch} (GeV/c)", jetptbinning, clusterenergybinning);
198 fQAHistos->
CreateTH2(
"hChargedIndexPt",
"charged constituent pt vs jet pt (via index map); p_{t, jet} (GeV/c); p_{t, ch} (GeV/c)", jetptbinning, clusterenergybinning);
200 fQAHistos->
CreateTH2(
"hClusterConstituentEDefault",
"cluster constituent default energy vs. jet pt (va constituent map); p_{t, jet} (GeV/c); E_{cl} (GeV)", jetptbinning, clusterenergybinning);
201 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);
202 fQAHistos->
CreateTH2(
"hClusterConstituentEHC",
"cluster constituent hadronic-corrected energy vs. jet pt (va constituent map); p_{t, jet} (GeV/c); E_{cl} (GeV)", jetptbinning, clusterenergybinning);
203 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);
204 fQAHistos->
CreateTH2(
"hClusterIndexEHC",
"cluster constituent hadronic-corrected energy vs. jet pt (via index map); p_{t, jet} (GeV/c); E_{cl} (GeV)", jetptbinning, clusterenergybinning);
205 fQAHistos->
CreateTH2(
"hLeadingChargedConstituentPt",
"Pt of the leading charged constituent in jet; p_{t,jet} (GeV/c); p_{t,ch} (GeV/c)", jetptbinning, clusterenergybinning);
206 fQAHistos->
CreateTH2(
"hLeadingClusterConstituentPt",
"Pt of the leading cluster constituent in jet; p_{t,jet} (GeV/c); p_{t,ch} (GeV/c)", jetptbinning, clusterenergybinning);
211 std::string treename = this->GetOutputSlot(2)->GetContainer()->GetName();
270 std::stringstream rhoTagData, rhoTagMC;
271 if(datajets) rhoTagData <<
"R" << std::setw(2) << std::setfill(
'0') <<
static_cast<Int_t>(datajets->
GetJetRadius() * 10.);
272 if(mcjets) rhoTagMC <<
"R" << std::setw(2) << std::setfill(
'0') <<
static_cast<Int_t>(mcjets->
GetJetRadius() * 10.);
275 std::string rhoSparseData =
"RhoSparse_Full_" + rhoTagData.str(), rhoSparseMC =
"RhoSparse_Full_" + rhoTagMC.str(),
276 rhoMassData =
"RhoMassSparse_Full_" + rhoTagData.str(), rhoMassMC =
"RhoMassSparse_Full_" + rhoTagMC.str();
281 AliDebugStream(2) <<
"Found rho parameter for reconstructed pt: " << (rhoPtRec ?
"yes" :
"no") <<
", value: " << (rhoPtRec ? rhoPtRec->GetVal() : 0.) << std::endl;
282 AliDebugStream(2) <<
"Found rho parameter for sim pt: " << (rhoPtSim ?
"yes" :
"no") <<
", value: " << (rhoPtSim ? rhoPtSim->GetVal() : 0.) << std::endl;
283 AliDebugStream(2) <<
"Found rho parameter for reconstructed Mass: " << (rhoMassRec ?
"yes" :
"no") <<
", value: " << (rhoMassRec ? rhoMassRec->GetVal() : 0.) << std::endl;
284 AliDebugStream(2) <<
"Found rho parameter for sim Mass: " << (rhoMassSim ?
"yes" :
"no") <<
", value: " << (rhoMassSim ? rhoMassSim->GetVal() : 0.) << std::endl;
286 rhoPtRec ? rhoPtRec->GetVal() : 0.,
287 rhoPtSim ? rhoPtSim->GetVal() : 0.,
288 rhoMassRec ? rhoMassRec->GetVal() : 0.,
289 rhoMassSim ? rhoMassSim->GetVal() : 0.
294 AliDebugStream(1) <<
"Inspecting jet radius " << (datajets ? datajets->
GetJetRadius() : mcjets->
GetJetRadius()) << std::endl;
298 if(datajets && !mcjets){
300 std::vector<std::string> clusternames;
302 for(
auto t : triggerinfos) {
303 if(std::find(clusternames.begin(), clusternames.end(), t.Triggercluster()) == clusternames.end()) clusternames.emplace_back(t.Triggercluster());
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 || isCENTNOTRD) {
314 if(isCALO || isCALOFAST){
327 auto triggerstring =
MatchTrigger(selectionString.Data());
328 AliDebugStream(2) <<
"Getting downscale correction factor for trigger string " << triggerstring << std::endl;
331 AliDebugStream(1) <<
"Using downscale weight " << weight << std::endl;
349 nsubjettinessSettings.
fBeta = 1.;
350 nsubjettinessSettings.
fRadius = 0.4;
353 AliDebugStream(1) <<
"In data jets branch: found " << datajets->
GetNJets() <<
" jets, " << datajets->
GetNAcceptedJets() <<
" were accepted\n";
354 AliDebugStream(1) <<
"Having MC information: " << (mcjets ? TString::Format(
"yes, with %d jets", mcjets->
GetNJets()) :
"no") << std::endl;
356 AliDebugStream(1) <<
"In MC jets branch: found " << mcjets->
GetNJets() <<
" jets, " << mcjets->
GetNAcceptedJets() <<
" were accepted\n";
358 for(
auto jet : datajets->
accepted()) {
359 double pt = jet->Pt(), pz = jet->Pz(), E = jet->E(), M = TMath::Sqrt(E*E - pt*pt - pz*pz);
360 AliDebugStream(2) <<
"Next jet: pt:" << jet->Pt() <<
", E: " << E <<
", pz: " << pz <<
", M(self): " << M <<
"M(fj)" << jet->M() << std::endl;
365 AliDebugStream(2) <<
"Not found associated jet" << std::endl;
383 AliErrorStream() <<
"Error in reclusterization - skipping jet" << std::endl;
385 AliErrorStream() <<
"Error in substructure observable - skipping jet" << std::endl;
398 AliErrorStream() <<
"Error in reclusterization - skipping jet" << std::endl;
400 AliErrorStream() <<
"Error in substructure observable - skipping jet" << std::endl;
407 AliDebugStream(1) <<
"In MC pure jet branch: found " << mcjets->
GetNJets() <<
" jets, " << mcjets->
GetNAcceptedJets() <<
" were accepted\n";
418 AliErrorStream() <<
"Error in reclusterization - skipping jet" << std::endl;
420 AliErrorStream() <<
"Error in substructure observable - skipping jet" << std::endl;
430 AliDebugStream(1) <<
"Trigger selection called\n";
432 AliErrorStream() <<
"Impossible combination: Neither rec nor true event available. Rejecting ..." << std::endl;
439 AliDebugStream(1) <<
"Applying trigger selection for trigger bits " << std::bitset<sizeof(decltype(fTriggerSelectionBits)) * 8>(
fTriggerSelectionBits) <<
"and trigger selection string " <<
fTriggerSelectionString << std::endl;
441 AliDebugStream(1) <<
"Passed trigger bit selection" << std::endl;
444 AliDebugStream(1) <<
"Passed trigger string section" << std::endl;
447 AliDebugStream(1) <<
"Found trigger decision object: " << (trgselresult ?
"yes" :
"no") << std::endl;
449 AliErrorStream() <<
"Trigger decision container with name " <<
fNameTriggerDecisionContainer <<
" not found in event - not possible to select EMCAL triggers" << std::endl;
453 AliDebugStream(1) <<
"Data event selected" << std::endl;
458 if(!(fInputHandler->IsEventSelected() & AliVEvent::kINT7))
return false;
461 AliDebugStream(1) <<
"Found trigger decision object: " << (mctrigger ?
"yes" :
"no") << std::endl;
463 AliErrorStream() <<
"Trigger decision container with name " <<
fNameTriggerDecisionContainer <<
" not found in event - not possible to select EMCAL triggers" << std::endl;
474 AliCDBManager * cdb = AliCDBManager::Instance();
475 if(!fMCEvent && cdb){
477 AliCDBEntry *en = cdb->Get(
"GRP/CTP/Config");
478 AliTriggerConfiguration *trg =
static_cast<AliTriggerConfiguration *
>(en->GetObject());
479 std::vector<std::string> clusternames;
480 for(
auto c : trg->GetClusters()) {
481 AliTriggerCluster *clust =
static_cast<AliTriggerCluster *
>(
c);
482 std::string clustname = clust->GetName();
483 auto iscent = clustname.find(
"CENT") != std::string::npos, iscalo = clustname.find(
"CALO") != std::string::npos;
484 if(!(iscalo || iscent))
continue;
485 AliInfoStream() <<
"Adding trigger cluster " << clustname <<
" to cluster lumi monitor" << std::endl;
486 clusternames.emplace_back(clustname);
490 fLumiMonitor =
new TH1F(
"hLumiMonitor",
"Luminosity monitor", clusternames.size(), 0, clusternames.size());
492 for(
auto c : clusternames) {
493 fLumiMonitor->GetXaxis()->SetBinLabel(currentbin++,
c.data());
502 if(fInputEvent->GetFiredTriggerClasses().Contains(
"INT7")) {
504 auto int7trigger = trigger.IsTriggerClass(
"INT7");
505 auto bunchcrossing = trigger.BunchCrossing() ==
"B";
506 auto nopf = trigger.PastFutureProtection() ==
"NOPF";
507 bool centcalo = (trigger.Triggercluster().find(
"CENT") != std::string::npos) || (trigger.Triggercluster().find(
"CALO") != std::string::npos);
508 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;
509 if(int7trigger && bunchcrossing && nopf && centcalo) {
510 double downscale = downscalefactors->GetDownscaleFactorForTriggerClass(trigger.ExpandClassName());
511 AliDebugStream(5) <<
"Using downscale " << downscale << std::endl;
512 fLumiMonitor->Fill(trigger.Triggercluster().data(), 1./downscale);
521 result.
fPt = TMath::Abs(jet.
Pt());
530 std::vector<double> zcharged, zneutral;
534 auto trk = jet.
TrackAt(icharged, tracks->GetArray());
537 if(!trk->Charge()) charged =
false;
539 auto z = jet.
GetZ(trk);
540 if(charged) zcharged.push_back(z);
541 else zneutral.push_back(z);
546 auto clust = jet.
ClusterAt(iclust, clusters->GetArray());
547 TLorentzVector clustervec;
549 auto z = jet.
GetZ(clustervec.Px(), clustervec.Py(), clustervec.Pz());
550 zneutral.push_back(z);
556 if(zcharged.size()) {
557 std::sort(zcharged.begin(), zcharged.end(), std::greater<double>());
562 std::sort(zneutral.begin(), zneutral.end(), std::greater<double>());
570 const int kClusterOffset = 30000;
571 std::vector<fastjet::PseudoJet> constituents;
573 AliDebugStream(2) <<
"Make new jet substrucutre for " << (isMC ?
"MC" :
"data") <<
" jet: Number of tracks " << jet.
GetNumberOfTracks() <<
", clusters " << jet.
GetNumberOfClusters() << std::endl;
575 AliDebugStream(1) <<
"Jet substructure: Using charged constituents" << std::endl;
577 auto track = jet.
TrackAt(itrk, tracks->GetArray());
580 fastjet::PseudoJet constituentTrack(track->Px(), track->Py(), track->Pz(), track->E());
581 constituentTrack.set_user_index(jet.
TrackAt(itrk));
582 constituents.push_back(constituentTrack);
587 AliDebugStream(1) <<
"Jet substructure: Using neutral constituents" << std::endl;
589 auto cluster = jet.
ClusterAt(icl, clusters->GetArray());
590 TLorentzVector clustervec;
592 fastjet::PseudoJet constituentCluster(clustervec.Px(), clustervec.Py(), clustervec.Pz(), cluster->GetHadCorrEnergy());
593 constituentCluster.set_user_index(jet.
ClusterAt(icl) + kClusterOffset);
594 constituents.push_back(constituentCluster);
598 AliDebugStream(3) <<
"Found " << constituents.size() <<
" constituents for jet with pt=" << jet.
Pt() <<
" GeV/c" << std::endl;
599 if(!constituents.size()){
600 AliErrorStream() <<
"Jet has 0 constituents." << std::endl;
604 fastjet::JetDefinition jetdef(fastjet::antikt_algorithm, jetradius*2, static_cast<fastjet::RecombinationScheme>(0), fastjet::BestFJ30 );
605 std::vector<fastjet::PseudoJet> outputjets;
607 fastjet::ClusterSequence jetfinder(constituents, jetdef);
608 outputjets = jetfinder.inclusive_jets(0);
611 }
catch (fastjet::Error &e) {
612 AliErrorStream() <<
" FJ Exception caught: " << e.message() << std::endl;
615 AliErrorStream() <<
"Softdrop exception caught: " << e.
what() << std::endl;
621 fastjet::contrib::SoftDrop softdropAlgorithm(cutparameters.
fBeta, cutparameters.
fZ);
622 softdropAlgorithm.set_verbose_structure(kTRUE);
623 #if FASTJET_VERSION_NUMBER >= 30302 624 fastjet::Recluster reclusterizer(cutparameters.
fRecluserAlgo, 1, fastjet::Recluster::keep_only_hardest);
626 fastjet::contrib::Recluster reclusterizer(cutparameters.
fRecluserAlgo, 1,
true);
628 softdropAlgorithm.set_reclustering(kTRUE, &reclusterizer);
629 AliDebugStream(4) <<
"Jet has " << jet.constituents().size() <<
" constituents" << std::endl;
630 auto groomed = softdropAlgorithm(jet);
632 auto softdropstruct = groomed.structure_of<fastjet::contrib::SoftDrop>();
636 softdropstruct.delta_R(),
638 softdropstruct.delta_R(),
640 softdropstruct.dropped_count()});
642 }
catch(std::bad_cast &e) {
649 fastjet::contrib::Nsubjettiness (1,fastjet::contrib::KT_Axes(),fastjet::contrib::NormalizedCutoffMeasure(cut.
fBeta, cut.
fRadius, 1e100)).result(jet),
650 fastjet::contrib::Nsubjettiness (2,fastjet::contrib::KT_Axes(),fastjet::contrib::NormalizedCutoffMeasure(cut.
fBeta, cut.
fRadius, 1e100)).result(jet)
658 TVector3 jetvec(jet.
Px(), jet.
Py(), jet.
Pz());
662 AliDebugStream(1) <<
"Angularity: Using charged constituents" << std::endl;
664 auto track = jet.
TrackAt(itrk, tracks->GetArray());
666 AliErrorStream() <<
"Associated constituent particle / track not found\n";
671 TVector3 trackvec(track->Px(), track->Py(), track->Pz());
673 num += track->Pt() * trackvec.DrEtaPhi(jetvec);
678 AliDebugStream(1) <<
"Using neutral constituents" << std::endl;
680 auto clust = jet.
ClusterAt(icl, clusters->GetArray());
682 AliErrorStream() <<
"Associated constituent cluster not found\n";
685 TLorentzVector clusterp;
688 num += clusterp.Pt() * clusterp.Vect().DrEtaPhi(jetvec);
689 den += clusterp.Pt();
701 AliDebugStream(1) <<
"Using charged constituents" << std::endl;
703 auto trk = jet.
TrackAt(itrk, particles->GetArray());
705 AliErrorStream() <<
"Associated constituent particle / track not found\n";
710 num += trk->Pt() * trk->Pt();
715 AliDebugStream(1) <<
"Using neutral constituents" << std::endl;
717 auto clust = jet.
ClusterAt(icl, clusters->GetArray());
719 AliErrorStream() <<
"Associated constituent cluster not found\n";
722 TLorentzVector clusterp;
724 num += clusterp.Pt() * clusterp.Pt();
725 den += clusterp.Pt();
728 return TMath::Sqrt(num)/den;
733 auto clust = jet->
ClusterAt(icl, clusters->GetArray());
734 AliDebugStream(3) <<
"cluster time " << clust->GetTOF() << std::endl;
739 fQAHistos->
FillTH2(
"hClusterConstExotics", jet->
Pt(), clust->GetIsExotic() ? 1. : 0.);
741 double mincell(100000.), maxcell(0.);
742 for(
int icell = 0; icell < clust->GetNCells(); icell++){
743 double ecell = clust->E() * clust->GetCellAmplitudeFraction(icell);
744 if(ecell < mincell) mincell = ecell;
745 if(ecell > maxcell) maxcell = ecell;
750 #ifdef EXPERIMENTAL_JETCONSTITUENTS 756 #ifdef EXPERIMENTAL_JETCONSTITUENTS 759 auto part = jet->
TrackAt(itrk, cont->GetArray());
764 AliDebugStream(2) <<
"Jet: Number of particle constituents: " << jet->
GetParticleConstituents().size() << std::endl;
767 AliDebugStream(3) <<
"Found particle constituent with pt " << part.Pt() <<
", from VParticle " << part.GetParticle()->Pt() << std::endl;
772 AliDebugStream(2) <<
"Jet: Number of cluster constituents: " << jet->
GetClusterConstituents().size() << std::endl;
775 AliDebugStream(3) <<
"Found cluster constituent with energy " << clust.E() <<
" using energy definition " <<
static_cast<int>(clust.GetDefaultEnergyType()) << std::endl;
777 fQAHistos->
FillTH2(
"hClusterConstituentENLC", jet->
Pt(), clust.GetCluster()->GetNonLinCorrEnergy());
778 fQAHistos->
FillTH2(
"hClusterConstituentEHC", jet->
Pt(), clust.GetCluster()->GetHadCorrEnergy());
785 fQAHistos->
FillTH1(
"hLeadingClusterConstituentPt", jet->
Pt(), leadingcluster->GetCluster()->GetHadCorrEnergy());
788 fQAHistos->
FillTH1(
"hLeadingChargedConstituentPt", jet->
Pt(), leadingcharged->GetParticle()->Pt());
797 auto part = jet.
TrackAt(ipart, particles->GetArray());
799 if(part->Charge()) ncharged++;
811 std::vector<std::string> tokens;
813 std::stringstream decoder(fInputEvent->GetFiredTriggerClasses().Data());
814 while(std::getline(decoder, result,
' ')) tokens.emplace_back(result);
816 for(
auto t : tokens) {
817 if(t.find(triggertoken) != std::string::npos) {
827 const std::array<std::string, 8> kEMCALTriggers = {
828 "EJ1",
"EJ2",
"DJ1",
"DJ2",
"EG1",
"EG2",
"DG1",
"DG2" 830 bool isEMCAL =
false;
831 for(
auto emcaltrg : kEMCALTriggers) {
832 if(triggerstring.find(emcaltrg) != std::string::npos) {
844 AliInputEventHandler *inputhandler =
static_cast<AliInputEventHandler *
>(mgr->GetInputEventHandler());
846 if(inputhandler->IsA() == AliAODInputHandler::Class()){
847 std::cout <<
"Analysing AOD events\n";
850 std::cout <<
"Analysing ESD events\n";
854 std::stringstream taskname;
855 taskname <<
"JetSubstructureTreemaker_R" << std::setw(2) << std::setfill(
'0') << int(jetradius*10) << trigger;
857 mgr->AddTask(treemaker);
865 particles->SetMinPt(0.);
874 mcjets->SetName(
"mcjets");
882 std::cout <<
"Track container name: " << tracks->GetName() << std::endl;
883 tracks->SetMinPt(0.15);
887 std::cout <<
"Using full or neutral jets ..." << std::endl;
889 std::cout <<
"Cluster container name: " << clusters->GetName() << std::endl;
893 std::cout <<
"Using charged jets ... " << std::endl;
903 datajets->SetName(
"datajets");
910 std::string triggerstring(trigger);
911 if(triggerstring.find(
"INT7") != std::string::npos) {
913 }
else if(triggerstring.find(
"EJ1") != std::string::npos) {
916 }
else if(triggerstring.find(
"EJ2") != std::string::npos) {
919 }
else if(triggerstring.find(
"EG1") != std::string::npos) {
922 }
else if(triggerstring.find(
"EG2") != std::string::npos) {
928 std::string jettypestring;
933 default: jettypestring =
"Undef";
937 std::stringstream outputfile, histname, treename;
938 outputfile << mgr->GetCommonFileName() <<
":JetSubstructure_" << jettypestring <<
"_R" << std::setw(2) << std::setfill(
'0') << int(jetradius * 10.) <<
"_" << trigger;
939 histname <<
"JetSubstructureHistos_" << jettypestring <<
"_R" << std::setw(2) << std::setfill(
'0') << int(jetradius * 10.) <<
"_" << trigger;
940 treename <<
"JetSubstructureTree_" << jettypestring <<
"_R" << std::setw(2) << std::setfill(
'0') << int(jetradius * 10.) <<
"_" << trigger;
941 mgr->ConnectInput(treemaker, 0, mgr->GetCommonInputContainer());
942 mgr->ConnectOutput(treemaker, 1, mgr->CreateContainer(histname.str().data(), AliEmcalList::Class(), AliAnalysisManager::kOutputContainer, outputfile.str().data()));
943 mgr->ConnectOutput(treemaker, 2, mgr->CreateContainer(treename.str().data(), TTree::Class(), AliAnalysisManager::kOutputContainer, mgr->GetCommonFileName()));
949 LinkBranch(jettree, &fZg, Form(
"Zg%s", tag),
"D");
950 LinkBranch(jettree, &fRg, Form(
"Rg%s", tag),
"D");
951 LinkBranch(jettree, &fMg, Form(
"Mg%s", tag),
"D");
952 LinkBranch(jettree, &fPtg, Form(
"Ptg%s", tag),
"D");
953 LinkBranch(jettree, &fMug, Form(
"Mug%s", tag),
"D");
954 LinkBranch(jettree, &fDeltaR, Form(
"DeltaRg%s", tag),
"D");
955 LinkBranch(jettree, &fNDropped, Form(
"NDropped%s", tag),
"I");
959 LinkBranch(jettree, &fOneSubjettiness, Form(
"OneSubjettiness%s", tag),
"D");
960 LinkBranch(jettree, &fTwoSubjettiness, Form(
"TwoSubjettiness%s", tag),
"D");
964 LinkBranch(jettree, &fAngularity, Form(
"Angularity%s", tag),
"D");
965 LinkBranch(jettree, &fPtD, Form(
"PtD%s", tag),
"D");
969 LinkBranch(jettree, &fPt, Form(
"PtJet%s", tag),
"D");
970 LinkBranch(jettree, &fE, Form(
"EJet%s", tag),
"D");
971 LinkBranch(jettree, &fEta, Form(
"Eta%s", tag),
"D");
972 LinkBranch(jettree, &fPhi, Form(
"Phi%s", tag),
"D");
973 LinkBranch(jettree, &fArea, Form(
"Area%s", tag),
"D");
974 LinkBranch(jettree, &fMass, Form(
"Mass%s", tag),
"D");
975 LinkBranch(jettree, &fNEF, Form(
"NEF%s", tag),
"D");
976 LinkBranch(jettree, &fNCharged, Form(
"NCharged%s", tag),
"I");
977 LinkBranch(jettree, &fNNeutral, Form(
"NNeutral%s", tag),
"I");
978 LinkBranch(jettree, &fZLeading, Form(
"ZLeading%s", tag),
"D");
979 LinkBranch(jettree, &fZLeadingCharged, Form(
"ZLeadingCharged%s", tag),
"D");
980 LinkBranch(jettree, &fZLeadingNeutral, Form(
"ZLeadingNeutral%s", tag),
"D");
984 LinkBranch(jettree, &fJetRadius,
"Radius",
"D");
985 LinkBranch(jettree, &fEventWeight,
"EventWeight",
"D");
986 LinkBranch(jettree, &fTriggerClusterIndex,
"TriggerClusterIndex",
"I");
988 std::string varnames[] = {
"RhoPtRec",
"RhoPtSim",
"RhoMassRec",
"RhoMassSim"};
989 for(
int i = 0; i < 4; i++){
990 LinkBranch(jettree, fRhoParamters + i, varnames[i].data(),
"D");
995 void LinkBranch(
TTree *jettree,
void *data,
const char *branchname,
const char *type) {
996 jettree->Branch(branchname, data, Form(
"%s/%s", branchname, type));
TTree * fJetSubstructureTree
! Tree with jet substructure information
void LinkJetTreeBranches(TTree *jettree, bool fillRho)
Double_t fZLeadingNeutral
z of the leading neutral constituent
void LinkJetTreeBranches(TTree *jettree, const char *tag)
Bool_t fFillStructGlob
Fill other substructure variables.
Bool_t fFillSoftDrop
Fill soft drop parameters.
Double_t fBeta
Cut on Beta.
Bool_t fHasRecEvent
Has reconstructed event (for trigger selection)
Bool_t fFillPart
Fill particle level information.
void LinkJetTreeBranches(TTree *jettree, const char *tag)
Double_t fZLeadingCharged
z of the leading charged constituent
void SetTriggerString(TString triggerstring)
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
AliJetContainer * GetJetContainer(Int_t i=0) const
void LinkJetTreeBranches(TTree *jettree, const char *tag)
AliNSubjettinessParameters * fNSubTrue
! Data field for true n-subjettiness parameters in jet tree
virtual void UserCreateOutputObjects()
Int_t fNCharged
Number of charged constituents.
AliNSubjettinessDefinition fSubjettinessSettings
TH1 * fLumiMonitor
! Luminosity monitor
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
Double_t fEventWeight
event weight (downscale factor)
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
TString fTriggerSelectionString
Trigger selection string.
Tree with jet substructure information.
static AliEmcalDownscaleFactorsOCDB * Instance()
Double_t fJetRadius
jet radius
Bool_t fFillNSub
Fill N-subjettiness.
Bool_t fHasTrueEvent
Has Monte-Carlo truth (for trigger selection)
AliSoftDropParameters * fSoftDropMeasured
! Data field for measured soft drop parameters in jet tree
AliSoftDropParameters fSoftDrop
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.
Int_t fTriggerClusterIndex
Index of the trigger cluster (0 - CENT, 1 - CENTNOTRD)
void SetHasTrueEvent(Bool_t hastrue)
Structure for results from the soft drop algorithm.
Double_t GetDownscaleFactorForTriggerClass(const TString &trigger) const
virtual void UserExecOnce()
Task initializations handled in user tasks.
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)
Set pre-configured event cut object.
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.
fastjet::JetAlgorithm fRecluserAlgo
Reclusterization algorithm.
Container for particles within the EMCAL framework.
Double_t fZLeading
z of the leading constituent
Int_t GetDefaultClusterEnergy() const
Int_t TrackAt(Int_t idx) const
void LinkJetTreeBranches(TTree *jettree, const char *tag)
UShort_t GetNumberOfTracks() const
Double_t fNEF
Jet Neutral Energy Fraction.
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
Jet kinematic parameters.
TPC fiducial acceptance (each eta edge narrowed by jet R)
void SetRun(int runnumber)
AliRhoParameter * GetRhoFromEvent(const char *name)
AliSoftdropDefinition fSoftdropSettings
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.
UShort_t GetNumberOfClusters() const
void SetJetPtCut(Float_t cut)
THashList * GetListOfHistograms() const
Get the list of histograms.
Bool_t fFillRho
Fill rho parameters.
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
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 const char * what() const
virtual ~AliAnalysisTaskEmcalJetSubstructureTree()
Bool_t fUseChargedConstituents
Use charged constituents.
Bool_t fUseDownscaleWeight
Use 1/downscale as weight.
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.
Double_t GetZ(const Double_t trkPx, const Double_t trkPy, const Double_t trkPz) const
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
virtual Bool_t IsTriggerSelected()
Selection of a hardware trigger.
std::string MatchTrigger(const std::string &triggerclass) const
Container for trigger decision object.
AliJetStructureParameters * fJetStructureMeasured
! Measured jet substructure parameters
THistManager * fQAHistos
! QA histos
bool IsSelectEmcalTriggers(const std::string &triggerstring) const
Double_t fSDZCut
Soft drop z-cut.
void SetTriggerBits(UInt_t triggersel)
Double_t fRhoParamters[4]
Rho parameters.
Double_t fSDBetaCut
Soft drop beta cut.
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.
AliEmcalList * fOutput
!output list
AliJetKineParameters * fKineSim
! Particle level jet kinematics
Reclusterizer_t fReclusterizer
Reclusterizer method.
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.
Container class for histograms.
Global jet substructure paramters.
void SetHasRecEvent(Bool_t hasrec)
AliJetKineParameters MakeJetKineParameters(const AliEmcalJet &jet, JetRecType_t rectype, const AliParticleContainer *const particles, const AliClusterContainer *const clusters) const
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.
AliAnalysisTaskEmcalJetSubstructureTree()
DCal fiducial acceptance (each eta, phi edge narrowed by jet R)
const AliJetIterableContainer accepted() const
void SetDefaultClusterEnergy(Int_t d)
TString fNameTriggerDecisionContainer
Global trigger decision container.
Int_t fNNeutral
Number of neutral constituents.
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.
EMCal fiducial acceptance (each eta, phi edge narrowed by jet R)
Container for jet within the EMCAL jet framework.
AliNSubjettinessParameters fNsubjettiness
Bool_t fUseNeutralConstituents
Use neutral constituents.
Bool_t fUseTriggerSelectionForData
Use trigger selection on data (require trigger patch in addition to trigger selection string) ...
TList * OpenFile(const char *fname)
void SetClusHadCorrEnergyCut(Double_t cut)
UInt_t fTriggerSelectionBits
Trigger selection bits.
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.