fix macro control plots npart eccentricity
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 9 Nov 2010 22:23:44 +0000 (22:23 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 9 Nov 2010 22:23:44 +0000 (22:23 +0000)
PWG2/FLOW/AliFlowTasks/AliAnalysisTaskQAflow.cxx
PWG2/FLOW/AliFlowTools/glauberMC/AliGlauberMC.cxx
PWG2/FLOW/Documentation/examples/runGlauberMCexample.C

index c6bf6c3..153b322 100644 (file)
@@ -106,6 +106,8 @@ void AliAnalysisTaskQAflow::UserCreateOutputObjects()
   before->Add(hist); after->Add(hist->Clone()); //13
   hist = new TH1D("TPC_vertex_z", "TPC vertex z", 100,-20.0,20.0);
   before->Add(hist); after->Add(hist->Clone()); //14
+  hist = new TH1D("ptyield", "p_{t} spectrum", 10000,0.0,10.0);
+  before->Add(hist); after->Add(hist->Clone()); //15
   
   //post data here as it doesn't change anyway (the pointer to list anyway)
 
@@ -160,6 +162,8 @@ void AliAnalysisTaskQAflow::UserExec(Option_t *)
   TH1* hetatracksA = dynamic_cast<TH1*>(after->At(13));
   TH1* hprimvtxzTPCB = dynamic_cast<TH1*>(before->At(14));
   TH1* hprimvtxzTPCA = dynamic_cast<TH1*>(after->At(14));
+  TH1* hptyieldB = dynamic_cast<TH1*>(before->At(15));
+  TH1* hptyieldA = dynamic_cast<TH1*>(after->At(15));
 
   AliMultiplicity* tracklets = const_cast<AliMultiplicity*>(event->GetMultiplicity());
   Int_t ntracklets=0;
@@ -231,6 +235,7 @@ void AliAnalysisTaskQAflow::UserExec(Option_t *)
     Int_t nitscls=0;
     Float_t eta=0.0;
     Float_t phi=0.0;
+    Float_t pt=0.0;
     AliESDtrack* track = dynamic_cast<AliESDtrack*>(fTrackCuts->GetTrack());
     if (track)
     {
@@ -239,7 +244,8 @@ void AliAnalysisTaskQAflow::UserExec(Option_t *)
       ntpccls=track->GetTPCNcls();
       eta=track->Eta();
       phi=track->Phi();
-      meanpt+=track->Pt();
+      pt=track->Pt();
+      meanpt+=pt;
       tpcchi2percls= (ntpccls==0)?0.0:tpcchi2/ntpccls;
       nitscls = track->GetNcls(0);
       hITSclsB->Fill(nitscls); if (pass) hITSclsA->Fill( nitscls);
@@ -249,6 +255,7 @@ void AliAnalysisTaskQAflow::UserExec(Option_t *)
       hdcazB->Fill(dcaz); if (pass) hdcazA->Fill(dcaz);
       hetatracksB->Fill(eta); if (pass) hetatracksA->Fill(eta);
       hphitracksB->Fill(phi); if (pass) hphitracksA->Fill(phi);
+      hptyieldB->Fill(pt); if (pass) hptyieldA->Fill(pt);
     }
   }
   meanpt = meanpt/ntracks;
index b198892..0616a31 100644 (file)
@@ -645,7 +645,7 @@ Double_t AliGlauberMC::GetEccentricityPartColl() const
 Double_t AliGlauberMC::GetEccentricity() const
 {
   //get standard eccentricity of participants
-  if (fNcoll<2) return 0.0;
+  if (fNpart<2) return 0.0;
   return ((fSy2-fSx2)/(fSy2+fSx2));
 }
 
index d131c3a..3c825da 100644 (file)
   Option_t *sysA="Pb"; 
   Option_t *sysB="Pb";
   Double_t signn=72; // inelastic nucleon nucleon cross section
-  const char *fname="GlauberMC_PbPb_ntuple.root"; // name output file
+  //const char *fname="GlauberMC_PbPb_ntuple.root"; // name output file
 
   // run the code to produce an ntuple:
   //  AliGlauberMC::runAndSaveNucleons(10000,"Pb","Pb",72);
   Double_t mind=0.4;
-  AliGlauberMC::runAndSaveNtuple(nevents,sysA,sysB,signn,mind,fname);
+  AliGlauberMC::runAndSaveNtuple(nevents,sysA,sysB,signn,mind);
 
 }