//__________________________________________________________________________
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
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+//
+// task compares jets in two branches,
+// written for analysis of jet embedding in HI events
+//
+// newer class: AliAnalysisTaskJetResponseV2
+//
+
#include "TChain.h"
#include "TTree.h"
#include "TMath.h"
#ifndef ALIANALYSISTASKJETRESPONSE_H
#define ALIANALYSISTASKJETRESPONSE_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+//
+// task compares jets in two branches,
+// written for analysis of jet embedding in HI events
+//
+// newer class: AliAnalysisTaskJetResponseV2
+//
+
class TH1F;
class TH2F;
class TH3F;
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+//
+// task compares jets in two branches,
+// written for analysis of jet embedding in HI events
+//
+
+
#include "TChain.h"
#include "TTree.h"
#include "TMath.h"
Int_t AliAnalysisTaskJetResponseV2::GetNInputTracks()
{
+ // number of tracks in the event, obtained via jet finder
Int_t nInputTracks = 0;
THnSparse* AliAnalysisTaskJetResponseV2::NewTHnSparseF(const char* name, UInt_t entries, UInt_t opt)
{
+ // generate new THnSparseF, axes are defined in GetDimParams()
+
Int_t count = 0;
UInt_t tmp = entries;
while(tmp!=0){
void AliAnalysisTaskJetResponseV2::GetDimParams(Int_t iEntry, Bool_t hr, TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax)
{
+ // stores label and binning of axis for THnSparse
const Double_t pi = TMath::Pi();
//____________________________________________________________________________
Int_t AliAnalysisTaskJetResponseV2::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
//____________________________________________________________________________
Double_t AliAnalysisTaskJetResponseV2::GetPt(AliAODJet *j, Int_t mode=0){
+ // returns jet pt, also negative pt after background subtraction if available
+
Double_t pt = 0.;
if(fKeepJets && mode==1){ // background subtracted pt, can be negative
#ifndef ALIANALYSISTASKJETRESPONSEV2_H
#define ALIANALYSISTASKJETRESPONSEV2_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+//
+// task compares jets in two branches,
+// written for analysis of jet embedding in HI events
+//
+
class TH1F;
class TH2F;
class TH3F;
TString fJetBranchName[2]; // name of jet branches to compare
TList *fListJets[2]; //! jet lists
- TString fBackgroundBranch;
+ TString fBackgroundBranch; // branch of external background
// event selection
Bool_t fIsPbPb; // is Pb-Pb (fast embedding) or p-p (detector response)