11 #include <THnSparse.h>
30 fPathTreeinputFile(""),
31 fTreeinputName("fTreeJet"),
32 fBranchJDetName("fJetDet."),
33 fBranchJParName("fJetPart."),
54 SetSuffix(
"Embedded");
55 DefineOutput(1, TList::Class());
70 fPathTreeinputFile(
""),
71 fTreeinputName(
"fTreeJet"),
72 fBranchJDetName(
"fJetDet."),
73 fBranchJParName(
"fJetPart."),
94 DefineOutput(2, TList::Class());
120 if(!
fTreeJet4Vect) AliFatal(
"Something went wrong in setting the tree");
122 TLorentzVector *detjet = 0;
136 if(!
fHMassDistrib) AliFatal(
"Something went wrong in setting the M distribution");
142 if(!
fPtSpectrum) AliFatal(
"Something went wrong in setting the pT distribution");
148 if(!
fHMassDistrib) AliFatal(
"Something went wrong in setting the M distribution");
149 if(!
fPtSpectrum) AliFatal(
"Something went wrong in setting the pT distribution");
155 const Int_t ndim = 4;
156 Int_t nbins = 80, mind = -30, maxd = 30, minm = 0, maxm = 80, minpt = 0, maxpt = 120;
160 TString title =
"Check part level;#it{M}_{det} - #it{M}_{par} (GeV); #it{p}_{T, det} - #it{p}_{T, par} (GeV/#it{c}); #it{M} (GeV); #it{p}_{T} (GeV/#it{c})";
162 fhPartJet =
new THnSparseF(
"fhPartJet", title.Data(), ndim, nbinshnsp, minhnsp, maxhnsp);
166 fhEtaPart =
new TH1F(
"fhEtaPart" ,
"#eta distribution part; #eta", 100, -1, 1);
169 fhPhiPart =
new TH1F(
"fhPhiPart" ,
"#varphi distribution; #varphi", 100, (-1)*TMath::Pi(), TMath::Pi());
204 AliFatal(Form(
"Tree or branch name not found"));
206 TLorentzVector *jetDet = 0;
207 TLorentzVector *jetPar = 0;
217 AliWarning(
"Starting from first entry again");
221 pTpar = jetPar->Pt();
225 Int_t countWhile = 0;
231 AliWarning(
"Starting from first entry again");
234 pTpar = jetPar->Pt();
242 AddTrack(jetDet->Pt(), jetDet->Eta(), jetDet->Phi(),0,0,0,0,kFALSE,
fCurrentEntry,
charge, jetDet->M());
245 Double_t x[4] = {jetDet->
M() - jetPar->M(), jetDet->Pt() - jetPar->Pt(), jetPar->M(), jetPar->Pt()};
267 AddTrack(-999,-999,-999,0,0,0,0,kFALSE,0,charge,mass);
299 AliError(
"Null tree");
313 if(filename.Contains(
"alien")) {
314 TGrid::Connect(
"alien://");
316 TFile *f = TFile::Open(filename);
318 Printf(
"File %s not found, cannot SetTree", filename.Data());
322 TTree *tree =
dynamic_cast<TTree*
>(f->Get(treename));
324 Printf(
"Tree %s not found!!!", treename.Data());
341 AliError(
"Set number of bins first! SetNBinsEmbedding(nbins);");
344 Printf(
"Creating array of factors with size %d",
fNBins);
348 Printf(
"Bin %d -> Factor = %e", i,
fDownscale[i]);
355 Printf(
"fGoBack = %d",
fGoBack);
Class for track embedding into an event.
Int_t fCurrentEntry
Current TTree entry.
TString fBranchJDetName
name of the detector level jet branch in the TTree
Int_t fCount
counts number of embedded tracks in the current pT bin
void SetpTDistributionFromFile(TString filename, TString histoname)
TString fPathpTinputFile
path to the file where the external input pT distribution is (can be from alien)
THnSparse * fhPartJet
! control histogram particle level correponsding to embedded from tree
void SetTree(TTree *tree)
Float_t fPtMin
pt minimum value
Int_t fNevPerBin
number of embedded tracks per pT bins
TList * fOutput
! output list for QA histograms
TClonesArray * fOutClusters
! output cluster collection
TTree * fTreeJet4Vect
! tree containing the jet 4-vectors (input for embed.)
Float_t * fDownscale
factor to exclude randomly entries from the embedding
TH1F * fhPhiPart
! Phi particle corresponding to embedded from tree
Base class for embedding into an event.
Int_t fCurrentBin
the current pT bin
void UserCreateOutputObjects()
Long64_t fNTreeEntries
Tree entry number.
TString fPathTreeinputFile
path to the file where the external input Tree is (can be from alien)
Int_t fGoBack
how many times fCurrentBin is set back to 0
TClonesArray * fOutTracks
! output track collection
void Terminate(Option_t *option="")
void UserCreateOutputObjects()
Double_t fMass
assign this mass to particle
void SetTreeFromFile(TString filenameM, TString treename)
Int_t fNTracks
how many tracks are being processed
Float_t * fPtRanges
low lims of the pT ranges corresponding to the fDownscale bin
Bool_t fMassless
make particles massless
Bool_t fOldCutOnDetPt
Apply cut on the embedded track at detector level (this was default before, not we apply the cut at p...
TString fMinputName
name of the external input Mass histogram
Double_t fNeutralMass
assign this mass to neutral particles
Int_t fNClusters
how many clusters are being processed
TH1F * fhEtaPart
! Eta particle corresponding to embedded from tree
Bool_t fFromTree
if true use TTree of jet 4-vectors as input single tracks
TList * fInput
! Input histograms saved in this list
Double_t fNeutralFraction
assign charge==0 to fraction of particles
TH1F * fhTreeEntriesUsed
! Entries of the TTree used
Bool_t fCopyArray
whether or not the array will be copied to a new one before modelling
TString fpTinputName
name of the external input pT histogram
Bool_t fRandomEntry
draw random number to extract the entry number in the tree
virtual ~AliJetEmbeddingTask()
TString fTreeinputName
name of the external input Tree
void FillHistograms()
do jet model action
Float_t GetDownscalinigFactor()
AliVCluster * AddCluster(Double_t e=-1, Double_t eta=-999, Double_t phi=-1, Int_t label=0)
add a cell with given energy, position and times
Bool_t fMassFromDistr
draw the particle mass from fHMassDistrib
TH1F * fPtSpectrum
pt spectrum to extract random pt values
TH1F * fHMassDistrib
shape of mass distribution of embedded tracks
void SetSuffix(const char *s)
AliPicoTrack * AddTrack(Double_t pt=-999, Double_t eta=-999, Double_t phi=-999, Byte_t type=0, Double_t etaemc=0, Double_t phiemc=0, Double_t ptemc=0, Bool_t ise=kFALSE, Int_t label=0, Short_t charge=1, Double_t mass=0.1396)
add a cluster (copy)
TString fBranchJParName
name of the particle level jet branch in the TTree
void SetRejection(Float_t *rej)
void SetMassDistributionFromFile(TString filename, TString histoname)
void SetMassAndPtDistributionFromFile(TString filenameM, TString filenamepT, TString histonameM, TString histonamepT)
TList * OpenFile(const char *fname)
TString fPathMinputFile
path to the file where the external input Mass distribution is (can be from alien) ...
Float_t fPtMax
pt maximum value