IMPORTANT: This page describes the old embedding framework and has been superseded by the new EMCal Embedding Framework! Please see documentation on the new framework.
Embedding
Page under construction
The basic functionalities are in the class AliJetModelBaseTask, in particular the methods to add tracks, clusters, or MC particles to the corresponding track or clusters array. Those methods are AliJetModelBaseTask::AddTrack, AliJetModelBaseTask::AddCluster, AliJetModelBaseTask::AddMCParticle. The embedded objects can be added to the original array or into a copy of it (SetCopyArray(kTRUE)
and SetSuffix(newName)
).
There are currently few types of embedding available:
- Embedding of AOD events (AliJetEmbeddingFromAODTask and AliJetEmbeddingFromPYTHIATask with additional functionalities for our general productions, e.g. pT hard bins)
- Embedding of generated PYTHIA events (AliJetEmbeddingFromGenTask)
- Embedding of single particles (AliJetEmbeddingTask)
- If you need specific features that are not implemented in the available classes, you can write your own class inheriting from AliJetModelBaseTask
Note: The Embedding framework in going to be restructured and updated for the use within the new jet framework. It is currently mandatory to use the old jet framwork since there's an explicit use of the AliPicoTrack in AddTrack.
More info: JIRA ticket for the new embedding development ALPHY-53
Embedding of reconstructed (detector level) PYTHIA
Use the AddTaskJetEmbeddingFromPYTHIA.C macro that runs the task AliJetEmbeddingFromPYTHIATask. Also particle level objects will be available. To distinguish the the embedded objects get the label of the track (track->GetLabel()
), it'll be !=0, differently from data tracks. If you need to use the EMCal you have to run the clusterizer after embedding.
To perform the analysis of the embedded event proceed normally by running the jet finder(s). You probably want to run one on the total event and one on the PYTHIA only event:
AliEmcalJetTask *jetTask= AddTaskEmcalJet(
"PicoTracks",
"", 1, 0.2, 1, 0.15, 0.30, 0.005,
"Jet");
- PYTHIA-only jets:
AliEmcalJetTask *jetTaskMC= AddTaskEmcalJet(
"PicoTracks",
"", 1, 0.2, 1, 0.15, 0.30, 0.005,
"JetMConly");
jetTaskMC->SelectConstituents(TObject::kBitMask, 0);
Embedding of generated (particle level) PYTHIA
It is possible also to embed PYTHIA events from a generator. The relevant task is AliJetEmbeddingFromGenTask.
- Generate Pythia events on-the-fly
gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/train/AddMCGenPythia.C");
AliGenPythia *generPythia = AddMCGenPythia(e_cms,ptminHard,ptmaxHard,2);
- Emded the tracks into the data event
Int_t labPythia = 99999.;
TString kTracksName =
"PicoTracks";
gROOT->LoadMacro("$ALICE_PHYSICS/PWGJE/EMCALJetTasks/macros/AddTaskJetEmbeddingFromGen.C");
kTracksName,
"EmbFromGenTask",
0.15, 1e6,
-0.9,0.9,
0., TMath::TwoPi(),
kTRUE,kTRUE);
Important! The embedding of on-the-fly generated PYTHIA events needs an empty ESD event. You need to create a list (e.g. TString localFiles("AliESDs.list")
) that contains the path to the esdempty.root
file that can be downloaded here: AliESDs.list, esdempty.root
Embedding of single track
The task providing this functionality is AliJetEmbeddingTask and the corresponding AddTaskJetEmbedding.C.
The pT (and mass) of the tracks to be embedded can be drawn randomly
- From a flat distribution
- From a function or histogram given as input
- From a TTree: in this case the tracks are taken in order from the tree (it is suggested to randomize the tree entries first)
For the following examples these variable are used:
- Example 1: embedding of massless tracks with flat pT distribution
AliJetEmbeddingTask *taskEmb = AddTaskJetEmbedding(tracksName.Data(),
"",
"SingleTrackEmbedding",40.,120.,-0.5,0.5,0., TMath::TwoPi(), NTrEmb, NClEmb, copyTracks);
taskEmb->SelectCollisionCandidates(pSel);
- Example 2: embedding of massive tracks with flat pT distribution. As Example 1 substituting
taskEmb->SetMasslessParticles(kTRUE);
with
taskEmbM->SetMasslessParticles(kFALSE);
taskEmbM->SetMass(mass);
- Example 3: embedding of tracks from a pT and a mass distribution
TString pathFileMass, pathFilepT, histonameM, histonamepT;
AliJetEmbeddingTask *taskEmbM = AddTaskJetEmbedding(tracksName.Data(),
"",
"SingleTrackEmbedding",0.,0.,-0.5,0.5,0., TMath::TwoPi(), NTrEmb, NClEmb, copyTracks);
taskEmbDistr->SelectCollisionCandidates(pSel);
taskEmbDistr->SetMasslessParticles(kFALSE);
taskEmbDistr->SetSuffix(newName);
taskEmbDistr->SetMassAndPtDistributionFromFile(pathFileMass, pathFilepT, histonameM, histonamepT);
TString trackEmbDistr = taskEmbDistr->GetOutTrackName();
Several methods avaiable to give the input distributions, check AliJetModelBaseTask and AliJetEmbeddingTask.
- Example 4: embedding with input TTree containing TLorentzVector of the tracks to be embedded. This allows e.g. to keep track of the particle level TLorentzVector of each track in another TTree. The TTree can be prepared with a task like AliAnalysisTaskPrepareInputForEmbedding.
By default, the embedding is performed using detector level tracks, but applying a cut at particle level pT.
TString pathFileTree, treeName, branchName;
AliJetEmbeddingTask *taskEmb4Vect = AddTaskJetEmbedding(tracksName.Data(),
"",
"SingleTrackEmbedding",0.,0.,0,0,0., TMath::TwoPi(), NTrEmb, NClEmb, copyTracks);
taskEmb4Vect->SelectCollisionCandidates(pSel);
Example of analysis
A task to perform the matching between jets in different collections is available: AliAnalysisTaskEmcalJetTagger (see also https://twiki.cern.ch/twiki/bin/view/ALICE/EMCalJetTagger):
AliAnalysisTaskEmcalJetTagger *taskTagPy = AddTaskEmcalJetTagger( jetTask->GetName(), jetTaskMC->GetName(), 0.4,
"",
"",
"PicoTracks",
"",
"TPC",
"V0M", pSel);
Run a task to match the two jet collections. You can use PWGJE/EMCALJetTasks/AliJetResponseMaker.cxx and the add task macro PWGJE / EMCALJetTasks / macros / AddTaskJetResponseMaker.C
AliJetResponseMaker *taskRM = AddTaskJetResponseMaker(
"PicoTracks",
"", jetTaskMC->GetName(),0.2,
"PicoTracks",
"", jetTask->GetName(),
"",0.2);