1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
20 #include <AliPWG0depHelper.h>
22 #include <AliHeader.h>
24 #include <AliGenEventHeader.h>
25 #include <AliGenPythiaEventHeader.h>
26 #include <AliGenCocktailEventHeader.h>
28 //____________________________________________________________________
29 ClassImp(AliPWG0depHelper)
31 //____________________________________________________________________
32 const Int_t AliPWG0depHelper::GetPythiaEventProcessType(AliHeader* aHeader, Bool_t adebug) {
34 // get the process type of the event.
37 // can only read pythia headers, either directly or from cocktalil header
38 AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(aHeader->GenEventHeader());
40 if (!pythiaGenHeader) {
42 AliGenCocktailEventHeader* genCocktailHeader = dynamic_cast<AliGenCocktailEventHeader*>(aHeader->GenEventHeader());
43 if (!genCocktailHeader) {
44 printf("AliPWG0depHelper::GetProcessType : Unknown header type (not Pythia or Cocktail). \n");
48 TList* headerList = genCocktailHeader->GetHeaders();
53 for (Int_t i=0; i<headerList->GetEntries(); i++) {
54 pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(headerList->At(i));
59 if (!pythiaGenHeader) {
60 printf("AliPWG0depHelper::GetProcessType : Could not find Pythia header. \n");
66 printf("AliPWG0depHelper::GetProcessType : Pythia process type found: %d \n",pythiaGenHeader->ProcessType());
69 return pythiaGenHeader->ProcessType();