]>
Commit | Line | Data |
---|---|---|
1 | ||
2 | #include "TROOT.h" | |
3 | #include "TList.h" | |
4 | #include "AliMCEvent.h" | |
5 | #include "AliGenEventHeader.h" | |
6 | #include "AliGenCocktailEventHeader.h" | |
7 | #include "AliGenPythiaEventHeader.h" | |
8 | #include <fstream> | |
9 | #include <iostream> | |
10 | #include "AliAnalysisHelperJetTasks.h" | |
11 | ||
12 | ||
13 | ClassImp(AliAnalysisHelperJetTasks) | |
14 | ||
15 | ||
16 | ||
17 | ||
18 | AliGenPythiaEventHeader* AliAnalysisHelperJetTasks::GetPythiaEventHeader(AliMCEvent *mcEvent){ | |
19 | ||
20 | AliGenEventHeader* genHeader = mcEvent->GenEventHeader(); | |
21 | AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(genHeader); | |
22 | if(!pythiaGenHeader){ | |
23 | // cocktail ?? | |
24 | AliGenCocktailEventHeader* genCocktailHeader = dynamic_cast<AliGenCocktailEventHeader*>(genHeader); | |
25 | ||
26 | if (!genCocktailHeader) { | |
27 | Printf("%s %d: Unknown header type (not Pythia or Cocktail)",(char*)__FILE__,__LINE__); | |
28 | return 0; | |
29 | } | |
30 | TList* headerList = genCocktailHeader->GetHeaders(); | |
31 | for (Int_t i=0; i<headerList->GetEntries(); i++) { | |
32 | pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(headerList->At(i)); | |
33 | if (pythiaGenHeader) | |
34 | break; | |
35 | } | |
36 | if(!pythiaGenHeader){ | |
37 | Printf("%s %d: PythiaHeader not found!",(char*)__FILE__,__LINE__); | |
38 | return 0; | |
39 | } | |
40 | } | |
41 | return pythiaGenHeader; | |
42 | ||
43 | } |