+/**************************************************************************
+ * 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. *
+ **************************************************************************/
+
+//
+// Helper Class that contains a lot of
+// usefull static functions jet matchin pythia access etc.
+//
+// Author: C. Klein-Boesing IKP Muenster
#include "TROOT.h"
#include "TDirectory.h"
Int_t AliAnalysisHelperJetTasks::fgLastProcessType = -1;
-AliGenPythiaEventHeader* AliAnalysisHelperJetTasks::GetPythiaEventHeader(AliMCEvent *mcEvent){
-
+AliGenPythiaEventHeader* AliAnalysisHelperJetTasks::GetPythiaEventHeader(const AliMCEvent *mcEvent){
+ //
+ // Fetch the pythia event header
+ //
if(!mcEvent)return 0;
AliGenEventHeader* genHeader = mcEvent->GenEventHeader();
AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(genHeader);
void AliAnalysisHelperJetTasks::PrintStack(AliMCEvent *mcEvent,Int_t iFirst,Int_t iLast,Int_t iMaxPrint){
+ //
+ // Print the stack informatuin up to the iMaxPrint event
+ //
AliStack *stack = mcEvent->Stack();
if(!stack){
void AliAnalysisHelperJetTasks::GetClosestJets(AliAODJet *genJets,const Int_t &kGenJets,
- AliAODJet *recJets,const Int_t &kRecJets,
+ const AliAODJet *recJets,const Int_t &kRecJets,
Int_t *iGenIndex,Int_t *iRecIndex,
Int_t iDebug,Float_t maxDist){
-void AliAnalysisHelperJetTasks::GetClosestJets(TList *genJetsList,const Int_t &kGenJets,
- TList *recJetsList,const Int_t &kRecJets,
+void AliAnalysisHelperJetTasks::GetClosestJets(const TList *genJetsList,const Int_t &kGenJets,
+ const TList *recJetsList,const Int_t &kRecJets,
TArrayI &iGenIndex,TArrayI &iRecIndex,
Int_t iDebug,Float_t maxDist){
}
}
-void AliAnalysisHelperJetTasks::GetJetMatching(TList *genJetsList, const Int_t &kGenJets,
- TList *recJetsList, const Int_t &kRecJets,
+void AliAnalysisHelperJetTasks::GetJetMatching(const TList *genJetsList, const Int_t &kGenJets,
+ const TList *recJetsList, const Int_t &kRecJets,
TArrayI &iMatchIndex, TArrayF &fPtFraction,
Int_t iDebug, Float_t maxDist){
}
}
-Double_t AliAnalysisHelperJetTasks::GetFractionOfJet(AliAODJet *recJet, AliAODJet *genJet){
-
+Double_t AliAnalysisHelperJetTasks::GetFractionOfJet(const AliAODJet *recJet, const AliAODJet *genJet){
+ //
+ // get the fraction of hte signal jet in the full jt
+ //
Double_t ptGen = genJet->Pt();
if(ptGen==0.) return 999.;
Bool_t AliAnalysisHelperJetTasks::PrintDirectorySize(const char* currFile){
+ //
+ // Print the size on disk and in memory occuppied by a directory
+ //
+
TFile *fIn = TFile::Open(currFile);
if(!fIn){
// not a severe condition but inciate that we have no information
Bool_t AliAnalysisHelperJetTasks::Selected(Bool_t bSet,Bool_t bNew){
+ //
+ // Static helper task, (re)set event by event
+ //
+
+
static Bool_t bSelected = kTRUE; // if service task is not run we acccpet all
if(bSet){
bSelected = bNew;
UInt_t AliAnalysisHelperJetTasks::SelectInfo(Bool_t bSet,UInt_t iNew){
+ //
+ // set event by event the slection info
+ //
+
static UInt_t iSelectInfo = 0; //
if(bSet){
iSelectInfo = iNew;
Int_t AliAnalysisHelperJetTasks::EventClass(Bool_t bSet,Int_t iNew){
+ //
+ // gloab storage/access to event class
+ //
+
static Int_t iEventClass = 0; //
if(bSet){
iEventClass = iNew;
//___________________________________________________________________________________________________________
-Bool_t AliAnalysisHelperJetTasks::GetEventShapes(TVector3 &n01, TVector3 * pTrack, Int_t nTracks, Double_t * eventShapes)
+Bool_t AliAnalysisHelperJetTasks::GetEventShapes(TVector3 &n01,const TVector3 * pTrack, Int_t nTracks, Double_t * eventShapes)
{
// ***
// Event shape calculation
AliAnalysisHelperJetTasks::MCProcessType AliAnalysisHelperJetTasks::GetPythiaEventProcessType(AliGenEventHeader* aHeader, Bool_t adebug) {
+ //
+ // fetch the process type from the mc header
+ //
+
AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(aHeader);
class TVector3;
class AliGenEventHeader;
-// Helper Class that contains a lot of usefull static functions (i.e. for Flavor selection.
+
+//
+// Helper Class that contains a lot of
+// usefull static functions jet matchin pythia access etc.
+//
+
class AliAnalysisHelperJetTasks : public TObject {
public:
// same as in PWG0Helper
enum MCProcessType { kInvalidProcess = -1, kND = 0x1, kDD = 0x2, kSD = 0x4, kOnePart = 0x8 };
- static AliGenPythiaEventHeader* GetPythiaEventHeader(AliMCEvent *mcEvent);
+ static AliGenPythiaEventHeader* GetPythiaEventHeader(const AliMCEvent *mcEvent);
static void PrintStack(AliMCEvent *mcEvent,Int_t iFirst = 0,Int_t iLast = 0,Int_t iMaxPrint = 10);
static void GetClosestJets(AliAODJet *genJets,
const Int_t &kGenJets,
- AliAODJet *recJets,
+ const AliAODJet *recJets,
const Int_t &kRecJets,
Int_t *iGenIndex,
Int_t *iRecIndex,
Int_t iDebug = 0, Float_t maxDist = 0.3);
- static void GetClosestJets(TList *genJetsList,const Int_t &kGenJets,
- TList *recJetsList,const Int_t &kRecJets,
+ static void GetClosestJets(const TList *genJetsList,const Int_t &kGenJets,
+ const TList *recJetsList,const Int_t &kRecJets,
TArrayI &iGenIndex,TArrayI &iRecIndex,
Int_t iDebug = 0,Float_t maxDist = 0.3);
- static void GetJetMatching(TList *genJetsList, const Int_t &kGenJets,
- TList *recJetsList, const Int_t &kRecJets,
+ static void GetJetMatching(const TList *genJetsList, const Int_t &kGenJets,
+ const TList *recJetsList, const Int_t &kRecJets,
TArrayI &iMatchIndex, TArrayF &fPtFraction,
Int_t iDebug = 0, Float_t maxDist = 0.3);
- static Double_t GetFractionOfJet(AliAODJet *recJet, AliAODJet *genJet);
+ static Double_t GetFractionOfJet(const AliAODJet *recJet,const AliAODJet *genJet);
static void MergeOutputDirs(const char* cFiles,const char* cPattern,const char *cOutFile,Bool_t bUpdate = false); // merges all directories containing the pattern
static void MergeOutput(char* cFiles, char* cDir = "",char *cList = "",char* cOutFile ="allpt.root",Bool_t bUpdate = false); // Merges the files in the input text file needs the two histograms fh1PtHard_Trials, fh1Xsec and the name of the input list
static Bool_t PythiaInfoFromFile(const char* currFile,Float_t &fXsec,Float_t &fTrials);// get the cross section and the trails either from pyxsec.root or from pysec_hists.root
static Bool_t PrintDirectorySize(const char* currFile); // print the size of the output on a given file
- static Bool_t GetEventShapes(TVector3 &n01, TVector3 * pTrack, Int_t nTracks, Double_t * eventShapes);
+ static Bool_t GetEventShapes(TVector3 &n01,const TVector3 * pTrack, Int_t nTracks, Double_t * eventShapes);
static MCProcessType GetPythiaEventProcessType(AliGenEventHeader* aHeader, Bool_t adebug = kFALSE);
static MCProcessType GetDPMjetEventProcessType(AliGenEventHeader* aHeader, Bool_t adebug = kFALSE);
static Int_t fgLastProcessType; // stores the raw value of the last process type extracted
- ClassDef(AliAnalysisHelperJetTasks, 5)
+ ClassDef(AliAnalysisHelperJetTasks, 6)
};
#endif // ALIANALYSISHELPERJETTASKS_H