]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ANALYSIS/AliAnalysisTaskMCParticleFilter.cxx
Obsolete.
[u/mrichter/AliRoot.git] / ANALYSIS / AliAnalysisTaskMCParticleFilter.cxx
index e7c7fa82bb44e102dd170fa4959b940f685fd1ec..aba20f8cdfe927e2c9ead2862f561c3e6fa84cd0 100644 (file)
@@ -99,7 +99,7 @@ Bool_t AliAnalysisTaskMCParticleFilter::Notify()
     }
     TTree *xtree = (TTree*)fxsec->Get("Xsection");
     if(!xtree){
-      Printf("%s:%d tree not found in the pyxsec.root",(char*)__FILE__,__LINE__);
+      AliWarning(Form("%s:%d tree not found in the pyxsec.root",(char*)__FILE__,__LINE__));
       return kTRUE;
     }
     xtree->SetBranchAddress("xsection",&xsection);
@@ -119,7 +119,7 @@ AliAnalysisTaskMCParticleFilter::AliAnalysisTaskMCParticleFilter(const char* nam
     fHistList(0x0)
 {
   // Default constructor
-  DefineOutput(1,TList::Class());  
+  DefineOutput(1, TList::Class());  
 }
 
 /*
@@ -255,20 +255,20 @@ void AliAnalysisTaskMCParticleFilter::UserExec(Option_t */*option*/)
   // Get the proper MC Collision Geometry
   AliGenEventHeader* mcEH = mcE->GenEventHeader();
 
-  AliGenPythiaEventHeader *pyH = dynamic_cast<AliGenPythiaEventHeader*>(mcEH);
-  AliGenHijingEventHeader *hiH = 0;
-  AliCollisionGeometry *colG = 0;
+  AliGenPythiaEventHeader *pyH  = dynamic_cast<AliGenPythiaEventHeader*>(mcEH);
+  AliGenHijingEventHeader *hiH  = 0;
+  AliCollisionGeometry    *colG = 0;
   AliGenDPMjetEventHeader *dpmH = 0;
   // it can be only one save some casts
   // assuming PYTHIA and HIJING are the most likely ones...
   if(!pyH){
-    hiH = dynamic_cast<AliGenHijingEventHeader*>(mcEH);
-    if(!hiH){
-      colG = dynamic_cast<AliCollisionGeometry *>(mcEH);
-      if(!colG)dpmH = dynamic_cast<AliGenDPMjetEventHeader*>(mcEH);
-    }
+      hiH = dynamic_cast<AliGenHijingEventHeader*>(mcEH);
+      if(!hiH){
+         dpmH = dynamic_cast<AliGenDPMjetEventHeader*>(mcEH);
+      }
   }
-
+  
+  if (hiH || dpmH) colG = dynamic_cast<AliCollisionGeometry*>(mcEH);
 
   // fetch the trials on a event by event basis, not from pyxsec.root otherwise 
   // we will get a problem when running on proof since Notify may be called 
@@ -299,7 +299,7 @@ void AliAnalysisTaskMCParticleFilter::UserExec(Option_t */*option*/)
 
   if (colG) {
     aodMCHo->SetReactionPlaneAngle(colG->ReactionPlaneAngle());
-    printf("Found Collision Geometry. Got Reaction Plane %lf\n", colG->ReactionPlaneAngle());
+    AliInfo(Form("Found Collision Geometry. Got Reaction Plane %lf\n", colG->ReactionPlaneAngle()));
   }
 
 
@@ -402,18 +402,12 @@ void AliAnalysisTaskMCParticleFilter::Terminate(Option_t */*option*/){
   //
 
 
-  TTree *tree = (TTree*)GetOutputData(0);
   fHistList = (TList*)GetOutputData(1);
   if(!fHistList){
     Printf("%s:%d Output list not found",(char*)__FILE__,__LINE__);
     return;
   }
 
-  if(!tree){
-    Printf("%s:%d Output tree not found",(char*)__FILE__,__LINE__);
-    return;
-  }
-
   TProfile *hXsec = ((TProfile*)(fHistList->FindObject("h1Xsec")));
   TH1F* hTrials  = ((TH1F*)(fHistList->FindObject("h1Trials")));
   if(!hXsec)return;
@@ -422,16 +416,6 @@ void AliAnalysisTaskMCParticleFilter::Terminate(Option_t */*option*/){
   Float_t xsec = hXsec->GetBinContent(1);
   Float_t trials = hTrials->Integral();
   AliInfo(Form("Average -section %.4E and total number of trials %E",xsec,trials));
-  
-  // This only works if the tree is not a special output
-  // in this case it is already written
-  /*
-  TParameter<float> *x = new TParameter<float>("xsection",xsec);
-  tree->GetUserInfo()->Add(x);
-  TParameter<float> *t = new TParameter<float>("trials",trials);
-  tree->GetUserInfo()->Add(t);
-  */
-  
 
 }