2 /**************************************************************************
3 * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
19 //-------------------------------------------------------------------------
20 // Implementation of the Virtual Event Handler Interface for AOD
21 // Author: Andreas Morsch, CERN
22 //-------------------------------------------------------------------------
32 #include "AliAODHandler.h"
33 #include "AliAODEvent.h"
34 #include "AliAODExtension.h"
35 #include "AliAODTracklets.h"
37 #include "AliAODMCParticle.h"
38 #include "AliAODMCHeader.h"
39 #include "AliMCEventHandler.h"
40 #include "AliMCEvent.h"
41 #include "AliGenEventHeader.h"
42 #include "AliGenHijingEventHeader.h"
43 #include "AliGenDPMjetEventHeader.h"
44 #include "AliGenPythiaEventHeader.h"
45 #include "AliGenCocktailEventHeader.h"
46 #include "AliCodeTimer.h"
47 #include "AliAODBranchReplicator.h"
48 #include "Riostream.h"
52 ClassImp(AliAODHandler)
54 //______________________________________________________________________________
55 AliAODHandler::AliAODHandler() :
60 fFillExtension(kTRUE),
61 fNeedsHeaderReplication(kFALSE),
62 fNeedsTOFHeaderReplication(kFALSE),
63 fNeedsVZEROReplication(kFALSE),
64 fNeedsTracksBranchReplication(kFALSE),
65 fNeedsVerticesBranchReplication(kFALSE),
66 fNeedsV0sBranchReplication(kFALSE),
67 fNeedsCascadesBranchReplication(kFALSE),
68 fNeedsTrackletsBranchReplication(kFALSE),
69 fNeedsPMDClustersBranchReplication(kFALSE),
70 fNeedsJetsBranchReplication(kFALSE),
71 fNeedsFMDClustersBranchReplication(kFALSE),
72 fNeedsCaloClustersBranchReplication(kFALSE),
73 fNeedsCaloTriggerBranchReplication(kFALSE),
74 fNeedsMCParticlesBranchReplication(kFALSE),
75 fNeedsDimuonsBranchReplication(kFALSE),
76 fNeedsHMPIDBranchReplication(kFALSE),
77 fAODIsReplicated(kFALSE),
78 fTreeBuffSize(30000000),
88 // default constructor
91 //______________________________________________________________________________
92 AliAODHandler::AliAODHandler(const char* name, const char* title):
93 AliVEventHandler(name, title),
97 fFillExtension(kTRUE),
98 fNeedsHeaderReplication(kFALSE),
99 fNeedsTOFHeaderReplication(kFALSE),
100 fNeedsVZEROReplication(kFALSE),
101 fNeedsTracksBranchReplication(kFALSE),
102 fNeedsVerticesBranchReplication(kFALSE),
103 fNeedsV0sBranchReplication(kFALSE),
104 fNeedsCascadesBranchReplication(kFALSE),
105 fNeedsTrackletsBranchReplication(kFALSE),
106 fNeedsPMDClustersBranchReplication(kFALSE),
107 fNeedsJetsBranchReplication(kFALSE),
108 fNeedsFMDClustersBranchReplication(kFALSE),
109 fNeedsCaloClustersBranchReplication(kFALSE),
110 fNeedsCaloTriggerBranchReplication(kFALSE),
111 fNeedsMCParticlesBranchReplication(kFALSE),
112 fNeedsDimuonsBranchReplication(kFALSE),
113 fNeedsHMPIDBranchReplication(kFALSE),
114 fAODIsReplicated(kFALSE),
115 fTreeBuffSize(30000000),
125 // Normal constructor.
128 //______________________________________________________________________________
129 AliAODHandler::~AliAODHandler()
135 if (fFileA) fFileA->Close();
143 //______________________________________________________________________________
144 Bool_t AliAODHandler::Init(Option_t* opt)
148 // Create the AODevent object
150 Bool_t createStdAOD = fIsStandard || fFillAOD;
151 if(!fAODEvent && createStdAOD){
152 fAODEvent = new AliAODEvent();
154 fAODEvent->CreateStdContent();
157 // File opening according to execution mode
161 TDirectory *owd = gDirectory;
162 if (option.Contains("proof")) {
164 // Merging via files. Need to access analysis manager via interpreter.
165 gROOT->ProcessLine(Form("AliAnalysisDataContainer *c_common_out = AliAnalysisManager::GetAnalysisManager()->GetCommonOutputContainer();"));
166 gROOT->ProcessLine(Form("AliAnalysisManager::GetAnalysisManager()->OpenProofFile(c_common_out, \"RECREATE\");"));
170 fFileA = new TFile(fFileName.Data(), "RECREATE");
176 TIter next(fExtensions);
177 AliAODExtension *ext;
178 while ((ext=(AliAODExtension*)next())) ext->Init(option);
181 TIter nextf(fFilters);
182 AliAODExtension *filteredAOD;
183 while ((filteredAOD=(AliAODExtension*)nextf())) {
184 filteredAOD->SetEvent(fAODEvent);
185 filteredAOD->Init(option);
192 //______________________________________________________________________________
193 void AliAODHandler::Print(Option_t* opt) const
195 // Print info about this object
197 cout << opt << Form("IsStandard %d filename=%s",fIsStandard,fFileName.Data()) << endl;
201 cout << opt << fExtensions->GetEntries() << " extensions :" << endl;
202 PrintExtensions(*fExtensions);
206 cout << opt << fFilters->GetEntries() << " filters :" << endl;
207 PrintExtensions(*fFilters);
211 //______________________________________________________________________________
212 void AliAODHandler::PrintExtensions(const TObjArray& array) const
214 // Show the list of aod extensions
216 AliAODExtension* ext(0x0);
217 while ( ( ext = static_cast<AliAODExtension*>(next()) ) )
223 //______________________________________________________________________________
224 void AliAODHandler::StoreMCParticles(){
227 // Remap the labels from ESD stack and store
228 // the AODMCParticles, makes only sense if we have
229 // the mcparticles branch
230 // has to be done here since we cannot know in advance
231 // which particles are needed (e.g. by the tracks etc.)
233 // Particles have been selected by AliMCEventhanlder->SelectParticle()
234 // To use the MCEventhandler here we need to set it from the outside
235 // can vanish when Handler go to the ANALYSISalice library
237 // The Branch booking for mcParticles and mcHeader has to happen
238 // in an external task for now since the AODHandler does not have access
239 // the AnalysisManager. For the same reason the pointer t o the MCEventH
240 // has to passed to the AOD Handler by this task
241 // (doing this in the steering macro would not work on PROOF)
243 if (!fAODEvent) return;
244 TClonesArray *mcarray = (TClonesArray*)fAODEvent->FindListObject(AliAODMCParticle::StdBranchName());
247 AliAODMCHeader *mcHeader = (AliAODMCHeader*)fAODEvent->FindListObject(AliAODMCHeader::StdBranchName());
250 // Get the MC Infos.. Handler needs to be set before
251 // while adding the branch
252 // This needs to be done, not to depend on the AnalysisManager
254 if(!fMCEventH)return;
255 if(!fMCEventH->MCEvent())return;
256 AliStack *pStack = fMCEventH->MCEvent()->Stack();
259 fMCEventH->CreateLabelMap();
262 // Get the Event Header
265 AliHeader* header = fMCEventH->MCEvent()->Header();
267 AliGenEventHeader* genHeader = 0;
268 if (header) genHeader = header->GenEventHeader();
271 genHeader->PrimaryVertex(vtxMC);
272 mcHeader->SetVertex(vtxMC[0],vtxMC[1],vtxMC[2]);
273 // we search the MCEventHeaders first
274 // Two cases, cocktail or not...
275 AliGenCocktailEventHeader* genCocktailHeader = dynamic_cast<AliGenCocktailEventHeader*>(genHeader);
276 if(genCocktailHeader){
277 // we have a coktail header add the name once
278 mcHeader->AddGeneratorName(genHeader->GetName());
279 TList* headerList = genCocktailHeader->GetHeaders();
280 // the first entry defines some extra general settings
281 AliGenEventHeader *headerEntry = dynamic_cast<AliGenEventHeader*>(headerList->At(0));
283 AliFatal("AliGenEventHeader entry not found in the header list");
285 SetMCHeaderInfo(mcHeader,headerEntry);
289 // No Cocktail just take the first one
290 SetMCHeaderInfo(mcHeader,genHeader);
292 // Add all the headers and names, if no cocktail header
293 // there will be only one entry
294 mcHeader->AddCocktailHeaders(genHeader);
301 // Store the AliAODParticlesMC
302 AliMCEvent* mcEvent = fMCEventH->MCEvent();
304 Int_t np = mcEvent->GetNumberOfTracks();
305 Int_t nprim = mcEvent->GetNumberOfPrimaries();
309 TClonesArray& l = *mcarray;
311 for(int i = 0; i < np; ++i){
312 if(fMCEventH->IsParticleSelected(i)){
314 AliMCParticle* mcpart = (AliMCParticle*) mcEvent->GetTrack(i);
315 if(i<nprim)flag |= AliAODMCParticle::kPrimary;
317 if(mcEvent->IsPhysicalPrimary(i))flag |= AliAODMCParticle::kPhysicalPrim;
318 if(mcEvent->IsSecondaryFromWeakDecay(i))flag |= AliAODMCParticle::kSecondaryFromWeakDecay;
319 if(mcEvent->IsSecondaryFromMaterial(i))flag |= AliAODMCParticle::kSecondaryFromMaterial;
321 if(fMCEventH->GetNewLabel(i)!=j){
322 AliError(Form("MISMATCH New label %d j: %d",fMCEventH->GetNewLabel(i),j));
325 AliAODMCParticle mcpartTmp(mcpart,i,flag);
327 mcpartTmp.SetStatus(mcpart->Particle()->GetStatusCode());
328 mcpartTmp.SetMCProcessCode(mcpart->Particle()->GetUniqueID());
330 Int_t d0 = mcpartTmp.GetDaughter(0);
331 Int_t d1 = mcpartTmp.GetDaughter(1);
332 Int_t m = mcpartTmp.GetMother();
334 // other than for the track labels, negative values mean
335 // no daughter/mother so preserve it
338 // no first daughter -> no second daughter
339 // nothing to be done
340 // second condition not needed just for sanity check at the end
341 mcpartTmp.SetDaughter(0,d0);
342 mcpartTmp.SetDaughter(1,d1);
343 } else if(d1 < 0 && d0 >= 0) {
345 // second condition not needed just for sanity check at the end
346 if(fMCEventH->IsParticleSelected(d0)){
347 mcpartTmp.SetDaughter(0,fMCEventH->GetNewLabel(d0));
349 mcpartTmp.SetDaughter(0,-1);
351 mcpartTmp.SetDaughter(1,d1);
353 else if (d0 > 0 && d1 > 0 ){
354 // we have two or more daughters loop on the stack to see if they are
358 for(int id = d0; id<=d1;++id){
359 if(fMCEventH->IsParticleSelected(id)){
362 d0Tmp = fMCEventH->GetNewLabel(id);
363 d1Tmp = d0Tmp; // this is to have the same schema as on the stack i.e. with one daugther d0 and d1 are the same
365 else d1Tmp = fMCEventH->GetNewLabel(id);
368 mcpartTmp.SetDaughter(0,d0Tmp);
369 mcpartTmp.SetDaughter(1,d1Tmp);
371 AliError(Form("Unxpected indices %d %d",d0,d1));
375 mcpartTmp.SetMother(m);
377 if(fMCEventH->IsParticleSelected(m))mcpartTmp.SetMother(fMCEventH->GetNewLabel(m));
378 else AliError(Form("PROBLEM Mother not selected %d \n", m));
381 new (l[j++]) AliAODMCParticle(mcpartTmp);
385 AliInfo(Form("AliAODHandler::StoreMCParticles: Selected %d (Primaries %d / total %d) after validation \n",
388 // Set the labels in the AOD output...
392 TClonesArray* tracks = fAODEvent->GetTracks();
395 for(int it = 0; it < fAODEvent->GetNumberOfTracks();++it){
396 AliAODTrack *track = dynamic_cast<AliAODTrack*>(fAODEvent->GetTrack(it));
397 if(!track) AliFatal("Not a standard AOD");
400 Int_t label = track->GetLabel();
401 if(label<0){ // preserve the sign for later usage
406 if (label >= AliMCEvent::BgLabelOffset()) label = mcEvent->BgLabelToIndex(label);
407 if(label > np || track->GetLabel() == 0){
408 AliWarning(Form("Wrong ESD track label %5d (%5d)",track->GetLabel(), label));
410 if(fMCEventH->GetNewLabel(label) == 0) {
411 AliWarning(Form("New label not found for %5d (%5d)",track->GetLabel(), label));
413 track->SetLabel(sign*fMCEventH->GetNewLabel(label));
415 track->GetTOFLabel(tofLabel);
417 for (Int_t i = 0; i < 3; i++) {
418 label = tofLabel[i]; // esd label
419 Int_t nlabel = label; // new label
420 if (label < 0) continue;
421 if (label >= AliMCEvent::BgLabelOffset()) nlabel = mcEvent->BgLabelToIndex(label);
422 if(nlabel > np || label == 0) {
423 AliWarning(Form("Wrong TOF label %5d (%5d)", label, nlabel));
425 if(fMCEventH->GetNewLabel(label) == 0){
426 AliWarning(Form("New TOF label not found for %5d %5d",i, label ));
427 tofLabel[i] = -label;
429 tofLabel[i] = fMCEventH->GetNewLabel(label);
432 track->SetTOFLabel(tofLabel);
437 TClonesArray *clusters = fAODEvent->GetCaloClusters();
439 for (Int_t iClust = 0;iClust < fAODEvent->GetNumberOfCaloClusters(); ++iClust) {
440 AliAODCaloCluster * cluster = fAODEvent->GetCaloCluster(iClust);
441 UInt_t nLabel = cluster->GetNLabels();
442 // Ugly but do not want to fragment memory by creating
443 // new Int_t (nLabel)
444 Int_t* labels = const_cast<Int_t*>(cluster->GetLabels());
446 for(UInt_t i = 0;i < nLabel;++i){
447 labels[i] = fMCEventH->GetNewLabel(cluster->GetLabelAt(i));
450 // cluster->SetLabels(labels,nLabel);
454 // AOD calo cells MC label re-index
455 Int_t iCell, nCell, cellMCLabel, cellMCLabelNew;;
457 Double_t cellE, cellT, cellEFrac;
458 AliAODCaloCells *cells;
461 cells = fAODEvent->GetEMCALCells();
463 nCell = cells->GetNumberOfCells() ;
464 for( iCell = 0; iCell < nCell; iCell++ ){
465 cells->GetCell( iCell, cellAbsId, cellE, cellT, cellMCLabel, cellEFrac );
466 // GetNewLabel returns 1 in case when -1 is supplied
467 if( cellMCLabel < 0 )
468 cellMCLabelNew = cellMCLabel;
470 cellMCLabelNew = fMCEventH->GetNewLabel( cellMCLabel );
472 cells->SetCell( iCell, cellAbsId, cellE, cellT, cellMCLabelNew, cellEFrac );
476 cells = fAODEvent->GetPHOSCells();
478 nCell = cells->GetNumberOfCells() ;
479 for( iCell = 0; iCell < nCell; iCell++ ){
480 cells->GetCell( iCell, cellAbsId, cellE, cellT, cellMCLabel, cellEFrac );
481 // GetNewLabel returns 1 in case when -1 is supplied
482 if( cellMCLabel < 0 )
483 cellMCLabelNew = cellMCLabel;
485 cellMCLabelNew = fMCEventH->GetNewLabel( cellMCLabel );
487 cells->SetCell( iCell, cellAbsId, cellE, cellT, cellMCLabelNew, cellEFrac );
492 AliAODTracklets *tracklets = fAODEvent->GetTracklets();
494 for(int it = 0;it < tracklets->GetNumberOfTracklets();++it){
495 int label0 = tracklets->GetLabel(it,0);
496 int label1 = tracklets->GetLabel(it,1);
497 if(label0>=0)label0 = fMCEventH->GetNewLabel(label0);
498 if(label1>=0)label1 = fMCEventH->GetNewLabel(label1);
499 tracklets->SetLabel(it,0,label0);
500 tracklets->SetLabel(it,1,label1);
506 //______________________________________________________________________________
507 Bool_t AliAODHandler::FinishEvent()
509 // Fill data structures
510 if(fFillAOD && fFillAODRun && fAODEvent){
511 fAODEvent->MakeEntriesReferencable();
516 if ((fFillAOD && fFillAODRun) || fFillExtension) {
517 if (fExtensions && fFillExtension) {
518 // fFillExtension can be set by the ESD filter or by a delta filter in case of AOD inputs
519 TIter next(fExtensions);
520 AliAODExtension *ext;
521 while ((ext=(AliAODExtension*)next())) ext->FinishEvent();
523 if (fFilters && fFillAOD && fFillAODRun) {
524 TIter nextf(fFilters);
525 AliAODExtension *ext;
526 while ((ext=(AliAODExtension*)nextf())) {
532 if (fIsStandard && fAODEvent)
534 fAODEvent->ResetStd();
539 TClonesArray *mcarray = static_cast<TClonesArray*>(fAODEvent->FindListObject(AliAODMCParticle::StdBranchName()));
540 if(mcarray) mcarray->Delete();
542 AliAODMCHeader *mcHeader = static_cast<AliAODMCHeader*>(fAODEvent->FindListObject(AliAODMCHeader::StdBranchName()));
543 if(mcHeader) mcHeader->Reset();
546 // Reset AOD replication flag
547 fAODIsReplicated = kFALSE;
551 //______________________________________________________________________________
552 Bool_t AliAODHandler::Terminate()
555 AddAODtoTreeUserInfo();
557 TIter nextF(fFilters);
558 AliAODExtension *ext;
559 while ((ext=static_cast<AliAODExtension*>(nextF())))
561 ext->AddAODtoTreeUserInfo();
564 TIter nextE(fExtensions);
565 while ((ext=static_cast<AliAODExtension*>(nextE())))
567 ext->AddAODtoTreeUserInfo();
573 //______________________________________________________________________________
574 Bool_t AliAODHandler::TerminateIO()
582 // When closing the file, the tree is also deleted.
586 TIter nextF(fFilters);
587 AliAODExtension *ext;
588 while ((ext=static_cast<AliAODExtension*>(nextF())))
593 TIter nextE(fExtensions);
594 while ((ext=static_cast<AliAODExtension*>(nextE())))
602 //______________________________________________________________________________
603 void AliAODHandler::CreateTree(Int_t flag)
605 // Creates the AOD Tree
606 fTreeA = new TTree("aodTree", "AliAOD tree");
607 fTreeA->Branch(fAODEvent->GetList());
608 if (flag == 0) fTreeA->SetDirectory(0);
612 //______________________________________________________________________________
613 void AliAODHandler::FillTree()
617 Long64_t nbf = fTreeA->Fill();
618 if (fTreeBuffSize>0 && fTreeA->GetAutoFlush()<0 && (fMemCountAOD += nbf)>fTreeBuffSize ) { // default limit is still not reached
619 nbf = fTreeA->GetZipBytes();
620 if (nbf>0) nbf = -nbf;
621 else nbf = fTreeA->GetEntries();
622 fTreeA->SetAutoFlush(nbf);
623 AliInfo(Form("Calling fTreeA->SetAutoFlush(%lld) | W:%lld T:%lld Z:%lld",
624 nbf,fMemCountAOD,fTreeA->GetTotBytes(),fTreeA->GetZipBytes()));
629 //______________________________________________________________________________
630 void AliAODHandler::AddAODtoTreeUserInfo()
632 // Add aod event to tree user info
633 if (fTreeA) fTreeA->GetUserInfo()->Add(fAODEvent);
634 // Now the tree owns our fAODEvent...
638 //______________________________________________________________________________
639 void AliAODHandler::AddBranch(const char* cname, void* addobj, const char* filename)
641 // Add a new branch to the aod. Added optional filename parameter if the
642 // branch should be written to a separate file.
644 if (strlen(filename))
646 AliAODExtension *ext = AddExtension(filename);
647 ext->AddBranch(cname, addobj);
651 // Add branch to all filters
652 // Add branch to all filters
654 TIter next(fFilters);
655 AliAODExtension *ext;
656 while ((ext=(AliAODExtension*)next())) ext->AddBranch(cname, addobj);
659 TDirectory *owd = gDirectory;
665 char** apointer = (char**) addobj;
666 TObject* obj = (TObject*) *apointer;
668 fAODEvent->AddObject(obj);
670 const Int_t kSplitlevel = 99; // default value in TTree::Branch()
671 const Int_t kBufsize = 32000; // default value in TTree::Branch()
673 if (!fTreeA->FindBranch(obj->GetName()))
675 // Do the same as if we book via
676 // TTree::Branch(TCollection*)
678 fTreeA->Bronch(obj->GetName(), cname, fAODEvent->GetList()->GetObjectRef(obj),
679 kBufsize, kSplitlevel - 1);
684 //______________________________________________________________________________
685 AliAODExtension *AliAODHandler::AddExtension(const char *filename, const char *title, Bool_t tomerge)
687 // Add an AOD extension with some branches in a different file.
689 TString fname(filename);
690 if (!fname.EndsWith(".root")) fname += ".root";
692 fExtensions = new TObjArray();
693 fExtensions->SetOwner();
695 AliAODExtension *ext = (AliAODExtension*)fExtensions->FindObject(fname);
697 ext = new AliAODExtension(fname, title);
698 fExtensions->Add(ext);
700 ext->SetToMerge(tomerge);
704 //______________________________________________________________________________
705 AliAODExtension *AliAODHandler::GetExtension(const char *filename) const
707 // Getter for AOD extensions via file name.
708 if (!fExtensions) return NULL;
709 return (AliAODExtension*)fExtensions->FindObject(filename);
712 //______________________________________________________________________________
713 AliAODExtension *AliAODHandler::AddFilteredAOD(const char *filename, const char *filtername, Bool_t tomerge)
715 // Add an AOD extension that can write only AOD events that pass a user filter.
717 fFilters = new TObjArray();
718 fFilters->SetOwner();
720 AliAODExtension *filter = (AliAODExtension*)fFilters->FindObject(filename);
722 filter = new AliAODExtension(filename, filtername, kTRUE);
723 fFilters->Add(filter);
725 filter->SetToMerge(tomerge);
729 //______________________________________________________________________________
730 AliAODExtension *AliAODHandler::GetFilteredAOD(const char *filename) const
732 // Getter for AOD filters via file name.
733 if (!fFilters) return NULL;
734 return (AliAODExtension*)fFilters->FindObject(filename);
737 //______________________________________________________________________________
738 void AliAODHandler::SetOutputFileName(const char* fname)
744 //______________________________________________________________________________
745 const char *AliAODHandler::GetOutputFileName() const
748 return fFileName.Data();
751 //______________________________________________________________________________
752 const char *AliAODHandler::GetExtraOutputs(Bool_t merge) const
754 // Get extra outputs as a string separated by commas.
755 static TString eoutputs;
757 AliAODExtension *obj;
759 TIter next1(fExtensions);
760 while ((obj=(AliAODExtension*)next1())) {
761 if (merge && !obj->IsToMerge()) continue;
762 if (!eoutputs.IsNull()) eoutputs += ",";
763 eoutputs += obj->GetName();
767 TIter next2(fFilters);
768 while ((obj=(AliAODExtension*)next2())) {
769 if (merge && !obj->IsToMerge()) continue;
770 if (!eoutputs.IsNull()) eoutputs += ",";
771 eoutputs += obj->GetName();
774 return eoutputs.Data();
777 //______________________________________________________________________________
778 Bool_t AliAODHandler::HasExtensions() const
780 // Whether or not we manage extensions
782 if ( fExtensions && fExtensions->GetEntries()>0 ) return kTRUE;
787 //______________________________________________________________________________
788 void AliAODHandler::SetMCHeaderInfo(AliAODMCHeader *mcHeader,AliGenEventHeader *genHeader){
791 // Utility function to cover different cases for the AliGenEventHeader
792 // Needed since different ProcessType and ImpactParamter are not
793 // in the base class...
795 if(!genHeader)return;
796 AliGenPythiaEventHeader *pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(genHeader);
797 if (pythiaGenHeader) {
798 mcHeader->SetEventType(pythiaGenHeader->ProcessType());
799 mcHeader->SetPtHard(pythiaGenHeader->GetPtHard());
803 AliGenDPMjetEventHeader* dpmJetGenHeader = dynamic_cast<AliGenDPMjetEventHeader*>(genHeader);
805 if (dpmJetGenHeader){
806 mcHeader->SetEventType(dpmJetGenHeader->ProcessType());
810 AliGenHijingEventHeader* hijingGenHeader = dynamic_cast<AliGenHijingEventHeader*>(genHeader);
812 mcHeader->SetImpactParameter(hijingGenHeader->ImpactParameter());
816 // AliWarning(Form("MC Eventheader not known: %s",genHeader->GetName()));