//__________________________________________________________________________
Bool_t AliAnalysisTaskFastEmbedding::UserNotify()
{
-
+ // User defined Notify(), called once
if(fDebug > 1) Printf("AliAnalysisTaskFastEmbedding::UserNotify()");
// get total nb of events in tree (of this subjob)
//__________________________________________________________________________
void AliAnalysisTaskFastEmbedding::UserExec(Option_t *)
{
+ // Analysis, called once per event
if(fDebug > 1) Printf("AliAnalysisTaskFastEmbedding::UserExec()");
if(!fAODout){
//__________________________________________________________________________
void AliAnalysisTaskFastEmbedding::Terminate(Option_t *)
{
+ // terminate
if(fDebug > 1) Printf("AliAnalysisTaskFastEmbedding::Terminate()");
if(fAODfile && fAODfile->IsOpen())
//__________________________________________________________________________
Int_t AliAnalysisTaskFastEmbedding::GetJobID()
{
+ // gives back the alien subjob id, if available, else -1
+
Int_t id=-1;
const char* env = gSystem->Getenv("ALIEN_PROC_ID"); // GRID
}
//__________________________________________________________________________
-
-Int_t AliAnalysisTaskFastEmbedding::SelectAODfile(){
+Int_t AliAnalysisTaskFastEmbedding::SelectAODfile()
+{
+ // select an AOD file from fAODPathArray
Int_t nFiles = fAODPathArray->GetEntries();
Float_t tmpProp = -1.;
Int_t pendingEvents = fInputEntries-Entry();
//Printf("input entries %d, entry %d, pending events %d", fInputEntries, (Int_t)Entry(), pendingEvents);
+ if(fAODEntriesArray){
while(rndm->Rndm()>tmpProp){
n = rndm->Integer(nFiles);
fAODEntries = fAODEntriesArray->At(n);
tmpProp = fAODEntriesMax ? (Float_t)tmpEntries/fAODEntriesMax : 1.;
}
fAODEntry = (Int_t)(rndm->Uniform(fAODEntries));
+ } else {
+ AliWarning("Number of entries in extra AODs not set!");
+ n = rndm->Integer(nFiles);
+ fAODEntry = 0;
+ }
AliInfo(Form("Select AOD file %d", n));
TObjString *objStr = (TObjString*) fAODPathArray->At(n);
}
//__________________________________________________________________________
-
-Int_t AliAnalysisTaskFastEmbedding::OpenAODfile(Int_t trial){
+Int_t AliAnalysisTaskFastEmbedding::OpenAODfile(Int_t trial)
+{
+ // select and open an AOD file from fAODPathArray
if(fAODPathArray) fFileId = SelectAODfile();
if(fFileId<0) return -1;
TDirectory *owd = gDirectory;
- if (fAODfile) fAODfile->Close();
+ if (fAODfile && fAODfile->IsOpen()) fAODfile->Close();
fAODfile = TFile::Open(fAODPath.Data(),"TIMEOUT=180");
owd->cd();
if(!fAODfile){
//____________________________________________________________________________
Float_t AliAnalysisTaskFastEmbedding::GetPtHard(Bool_t bSet, Float_t newValue){
+ // static stored, available for other tasks in train
+
static Float_t ptHard = -1.;
if(bSet) ptHard = newValue;
//____________________________________________________________________________
Int_t AliAnalysisTaskFastEmbedding::GetPtHardBin(Double_t ptHard){
+ // returns pt hard bin (for LHC10e14, LHC11a1x, LHC11a2x simulations)
+
const Int_t nBins = 10;
Double_t binLimits[nBins] = { 5., 11., 21., 36., 57., 84., 117., 156., 200., 249. }; // lower limits
void SetJetBranch(TString name) {fJetBranch = name;}
void SetEmbedMode(Int_t m) {fEmbedMode = m;}
- Int_t GetEmbedMode() {return fEmbedMode;}
+ Int_t GetEmbedMode() const {return fEmbedMode;}
void SetEvtSelecMode(Int_t s) {fEvtSelecMode = s;}
- Int_t GetEvtSelecMode() {return fEvtSelecMode;}
+ Int_t GetEvtSelecMode() const {return fEvtSelecMode;}
void SetEvtSelJetPtRange(Float_t minPt, Float_t maxPt) {fEvtSelMinJetPt = minPt; fEvtSelMaxJetPt = maxPt;}
void SetEvtSelJetEtaRange(Float_t minEta, Float_t maxEta) {fEvtSelMinJetEta = minEta; fEvtSelMaxJetEta = maxEta;}
Int_t fAODEntry; // entry of extra AOD
Int_t fCountEvents; // count processed events in this file
- Int_t fEmbedMode;
- Int_t fEvtSelecMode;
+ Int_t fEmbedMode; // embedding mode: kAODFull=0, kAODJetTracks=1, kAODJet4Mom=2, kToyTracks=3
+ Int_t fEvtSelecMode; // event selection criterion: kEventsAll=0, kEventsJetPt=1
// event selection from AOD
Float_t fEvtSelMinJetPt; // minimum pt of the leading jet
Int_t OpenAODfile(Int_t trial = 0);
- ClassDef(AliAnalysisTaskFastEmbedding, 5);
+ ClassDef(AliAnalysisTaskFastEmbedding, 6);
};
#endif