13 #include <TParameter.h>
16 #include <THashTable.h>
19 #include "AliVEvent.h"
29 fLHC11hAnchorRun(kTRUE),
32 fUseAsVetoTable(kTRUE),
33 fMinEntriesPerPtHardBin(1),
34 fCurrentPtHardBin(-1),
40 SetSuffix(
"PYTHIAEmbedding");
42 fRandomAccess = kTRUE;
49 fPYTHIAPath(
"alien:///alice/sim/2012/LHC12a15e_fix/%d/%d/AOD149/%04d/AliAOD.root"),
51 fLHC11hAnchorRun(kTRUE),
54 fUseAsVetoTable(kTRUE),
55 fMinEntriesPerPtHardBin(1),
56 fCurrentPtHardBin(-1),
82 fHistPtHardBins =
new TH1F(
"fHistPtHardBins",
"fHistPtHardBins", 11, 0, 11);
87 const Int_t ptHardLo[11] = { 0, 5,11,21,36,57, 84,117,152,191,234};
88 const Int_t ptHardHi[11] = { 5,11,21,36,57,84,117,152,191,234,1000000};
90 for (
Int_t i = 1; i < 12; i++)
91 fHistPtHardBins->GetXaxis()->SetBinLabel(i, Form(
"%d-%d",ptHardLo[i-1],ptHardHi[i-1]));
93 fHistEmbeddingQA =
new TH1F(
"fHistEmbeddingQA",
"fHistEmbeddingQA", 2, 0, 2);
100 fHistRejectedEvents =
new TH1F(
"fHistRejectedEvents",
"fHistRejectedEvents", 500, -0.5, 499.5);
117 AliWarning(
"No hard pt bin scaling!");
131 AliDebug(3,
"Adding pt hard bin param object to the event list...");
162 static Int_t order[20]={-1};
187 Int_t runNumber = InputEvent()->GetRunNumber();
189 Int_t semiGoodRunList[32] = {169975, 169981, 170038, 170040, 170083, 170084, 170085,
190 170088, 170089, 170091, 170152, 170155, 170159, 170163,
191 170193, 170195, 170203, 170204, 170228, 170230, 170268,
192 170269, 170270, 170306, 170308, 170309, 169238, 169160,
193 169156, 169148, 169145, 169144};
197 for (
Int_t i = 0; i < 32; i++) {
198 if (runNumber == semiGoodRunList[i]) {
227 AliWarning(Form(
"File %s found in the vetoed file table. Skipping...", fileName.Data()));
231 AliWarning(Form(
"File %s not found in the allowed file table. Skipping...", fileName.Data()));
236 if (fileName.BeginsWith(
"alien://") && !gGrid) {
237 AliInfo(
"Trying to connect to AliEn ...");
238 TGrid::Connect(
"alien://");
241 TString baseFileName(fileName);
242 if (baseFileName.Contains(
".zip#")) {
243 Ssiz_t pos = baseFileName.Last(
'#');
244 baseFileName.Remove(pos);
247 if (
gSystem->AccessPathName(baseFileName)) {
248 AliError(Form(
"File %s does not exist!", baseFileName.Data()));
252 AliDebug(3,Form(
"Trying to open file %s...", fileName.Data()));
253 TFile *
file = TFile::Open(fileName);
255 if (!file || file->IsZombie()) {
256 AliError(Form(
"Unable to open file: %s!", fileName.Data()));
AliJetEmbeddingFromPYTHIATask()
Int_t GetRandomPtHardBin()
virtual Bool_t OpenNextFile()
TList * fOutput
! output list for QA histograms
TH1 * fHistEmbeddingQA
File ID not embedded.
Class for Pythia event embedding into data.
TArrayD fPtHardBinScaling
void UserCreateOutputObjects()
Bool_t ExecOnce()
generate a particle with random eta,phi, and correlated pt,mass values
TH1 * fHistPtHardBins
Number of event embedded from the current pt hard bin.
Bool_t ExecOnce()
generate a particle with random eta,phi, and correlated pt,mass values
ClassImp(AliJetEmbeddingFromPYTHIATask) AliJetEmbeddingFromPYTHIATask
TParameter< int > * fPtHardBinParam
Pt hard bin of the current open file.
virtual Bool_t GetNextEntry()
Bool_t fQAhistos
draw QA histograms
void UserCreateOutputObjects()
Int_t fMinEntriesPerPtHardBin
Int_t fPtHardBinCount
Pt hard bin param.
Int_t fCurrentAODFileID
Current file being processed (via the event handler)
void SetSuffix(const char *s)
virtual ~AliJetEmbeddingFromPYTHIATask()
Class for embedding a AOD event into a data event.
TH1 * fHistRejectedEvents
Embedding QA.