Copy constructor implemented.
[u/mrichter/AliRoot.git] / PWG0 / AliPWG0depHelper.cxx
CommitLineData
7ca4655f 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
4c351225 16/* $Id$ */
17
7ca4655f 18#include <TList.h>
19
4c351225 20#include <AliPWG0depHelper.h>
21
22#include <AliHeader.h>
23
24#include <AliGenEventHeader.h>
25#include <AliGenPythiaEventHeader.h>
26#include <AliGenCocktailEventHeader.h>
27
28//____________________________________________________________________
29ClassImp(AliPWG0depHelper)
30
31//____________________________________________________________________
32const Int_t AliPWG0depHelper::GetPythiaEventProcessType(AliHeader* aHeader, Bool_t adebug) {
33 //
34 // get the process type of the event.
35 //
36
37 // can only read pythia headers, either directly or from cocktalil header
38 AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(aHeader->GenEventHeader());
39
40 if (!pythiaGenHeader) {
41
42 AliGenCocktailEventHeader* genCocktailHeader = dynamic_cast<AliGenCocktailEventHeader*>(aHeader->GenEventHeader());
43 if (!genCocktailHeader) {
44 printf("AliPWG0depHelper::GetProcessType : Unknown header type (not Pythia or Cocktail). \n");
45 return -1;
46 }
47
48 TList* headerList = genCocktailHeader->GetHeaders();
49 if (!headerList) {
50 return -1;
51 }
52
53 for (Int_t i=0; i<headerList->GetEntries(); i++) {
54 pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(headerList->At(i));
55 if (pythiaGenHeader)
56 break;
57 }
58
59 if (!pythiaGenHeader) {
60 printf("AliPWG0depHelper::GetProcessType : Could not find Pythia header. \n");
61 return -1;
62 }
63 }
64
65 if (adebug) {
66 printf("AliPWG0depHelper::GetProcessType : Pythia process type found: %d \n",pythiaGenHeader->ProcessType());
67 }
68
69 return pythiaGenHeader->ProcessType();
70}