Adding NPart distribution for DPMJET (Chiara)
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 20 Nov 2012 14:30:14 +0000 (14:30 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 20 Nov 2012 14:30:14 +0000 (14:30 +0000)
ANALYSIS/AliCentralitySelectionTask.cxx

index 6b5f13b..73b2747 100644 (file)
@@ -1159,20 +1159,22 @@ void AliCentralitySelectionTask::UserExec(Option_t */*option*/)
     if (fIsMCInput && eventHandler && (mcEvent=eventHandler->MCEvent()) && (stack=mcEvent->Stack())) {
       
       AliGenHijingEventHeader* hHijing=0;
+      AliGenDPMjetEventHeader* dpmHeader=0;
+      
       AliGenEventHeader* mcGenH = mcEvent->GenEventHeader();
       if (mcGenH->InheritsFrom(AliGenHijingEventHeader::Class())) {
        hHijing = (AliGenHijingEventHeader*)mcGenH;
+       if(hHijing) Npart = hHijing->ProjectileParticipants()+hHijing->TargetParticipants();
       }
       else if (mcGenH->InheritsFrom(AliGenCocktailEventHeader::Class())) {
        TList* headers = ((AliGenCocktailEventHeader*)mcGenH)->GetHeaders();
        hHijing = dynamic_cast<AliGenHijingEventHeader*>(headers->FindObject("Hijing"));
+       if(hHijing) Npart = hHijing->ProjectileParticipants()+hHijing->TargetParticipants();
       }
-      if (hHijing) {
-       Npart  = hHijing->ProjectileParticipants()+hHijing->TargetParticipants();
+      else if (mcGenH->InheritsFrom(AliGenDPMjetEventHeader::Class())) {
+       dpmHeader = (AliGenDPMjetEventHeader*)mcGenH;
+       if(dpmHeader) Npart = dpmHeader->ProjectileParticipants()+ dpmHeader->TargetParticipants();
       }
-      else {
-       // now you really have a problem.
-      } 
     }
   }