AliPhysics  31210d0 (31210d0)
Old Embedding Framework

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:

1. Embedding of AOD events (AliJetEmbeddingFromAODTask and AliJetEmbeddingFromPYTHIATask with additional functionalities for our general productions, e.g. pT hard bins)
2. Embedding of generated PYTHIA events (AliJetEmbeddingFromGenTask)
3. Embedding of single particles (AliJetEmbeddingTask)
4. 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.

## 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:

• PYTHIA+data jets:
• PYTHIA-only jets:

## 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"); Double_t e_cms = 5020.; Double_t ptminHard = 30.; Double_t ptmaxHard = 100.; AliGenPythia *generPythia = AddMCGenPythia(e_cms,ptminHard,ptmaxHard,2); • Emded the tracks into the data event Int_t labPythia = 99999.; // a large number, to give the tracks a label that is larger than that of the tracks already present in the event TString kTracksName = "PicoTracks"; gROOT->LoadMacro("$ALICE_PHYSICS/PWGJE/EMCALJetTasks/macros/AddTaskJetEmbeddingFromGen.C");
kTracksName,
0.15, 1e6,
-0.9,0.9,
0., TMath::TwoPi(),
kTRUE,kTRUE);
genTask->SetSuffix(""); //this will change the name of the track array
genTask->SetGeometryName("EMCAL_COMPLETE12SMV1"); //need to set the Geometry name, not so important which one at generated level

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 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:

Bool_t copyTracks = kTRUE; // whether the track array is copied to a new one before embedding the new track(s)
TString newName = "Emb"; // remember to set a suffix to be appended to the name of the copy of the track array
Int_t NTrEmb = 1; // number of tracks to be embedded per event
Int_t NClEmb = 0; // number of clusters to be embedded per event
Int_t labEmb = 99999; // a large number that will be the label of the first embedded track/event
• Example 1: embedding of massless tracks with flat pT distribution
• Example 2: embedding of massive tracks with flat pT distribution. As Example 1 substituting taskEmb->SetMasslessParticles(kTRUE); with
Int_t mass = 8; //GeV
• Example 3: embedding of tracks from a pT and a mass distribution
TString pathFileMass, pathFilepT, histonameM, histonamepT; //set appropriately
taskEmbDistr->SetMassAndPtDistributionFromFile(pathFileMass, pathFilepT, histonameM, histonamepT); // the file can be stored on alien

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; //set appropriately
TString trackEmb4Vect = taskEmb4Vect->GetOutTrackName(); // gives the final name of the track array with embedded track