setter to assume pion mass for clusters
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / AliJetEmbeddingFromGenTask.cxx
index 8e107e5..beb9614 100644 (file)
@@ -35,6 +35,10 @@ ClassImp(AliJetEmbeddingFromGenTask)
 AliJetEmbeddingFromGenTask::AliJetEmbeddingFromGenTask() : 
   AliJetModelBaseTask("AliJetEmbeddingFromGenTask"),
   fGen(0),
+  fMassless(kFALSE),
+  fChargedOnly(kFALSE),
+  fHistPt(0),
+  fHistEtaPhi(0),
   fHistTrials(0),
   fHistXsection(0),
   fHistPtHard(0)
@@ -47,6 +51,10 @@ AliJetEmbeddingFromGenTask::AliJetEmbeddingFromGenTask() :
 AliJetEmbeddingFromGenTask::AliJetEmbeddingFromGenTask(const char *name, Bool_t drawqa) :
   AliJetModelBaseTask(name,drawqa),
   fGen(0),
+  fMassless(kFALSE),
+  fChargedOnly(kFALSE),
+  fHistPt(0),
+  fHistEtaPhi(0),
   fHistTrials(0),
   fHistXsection(0),
   fHistPtHard(0)
@@ -71,6 +79,12 @@ void AliJetEmbeddingFromGenTask::UserCreateOutputObjects()
 
   AliJetModelBaseTask::UserCreateOutputObjects();
 
+  fHistPt = new TH1F("fHistpt","fHistPt;#it{p}_{T};N",100,0.,100.);
+  fOutput->Add(fHistPt);
+
+  fHistEtaPhi = new TH2F("fHistEtaPhi","fHistEtaPhi;#eta;#varphi",100,-3.,3.,100.,0.,TMath::TwoPi());
+  fOutput->Add(fHistEtaPhi);
+
   fHistTrials = new TH1F("fHistTrials", "fHistTrials", 1, 0, 1);
   fHistTrials->GetYaxis()->SetTitle("trials");
   fOutput->Add(fHistTrials);
@@ -136,8 +150,7 @@ void AliJetEmbeddingFromGenTask::Run()
     if (!pdg) 
       continue;
     Int_t c = (Int_t)(TMath::Abs(pdg->Charge()));
-    if (c==0) 
-      continue;
+    if (fChargedOnly && c==0)  continue;
     Double_t pt = part->Pt();
     Double_t eta = part->Eta();
     Double_t phi = part->Phi();
@@ -153,7 +166,11 @@ void AliJetEmbeddingFromGenTask::Run()
       continue;
     if (pt>fPtMax)
       continue;
-    AddTrack(pt, eta, phi,0,0,0,0,0,0,part->GetMass());
+    Double_t mass = part->GetMass();
+    if(fMassless) mass = 0.;
+    fHistPt->Fill(pt);
+    fHistEtaPhi->Fill(eta,phi);
+    AddTrack(pt, eta, phi,0,0,0,0,0,0,c,mass);
   }
 
   FillPythiaHistograms();
@@ -169,8 +186,6 @@ void AliJetEmbeddingFromGenTask::FillPythiaHistograms() {
   AliRunLoader *rl = AliRunLoader::Instance();
   AliGenPythiaEventHeader *genPH = dynamic_cast<AliGenPythiaEventHeader*>(rl->GetHeader()->GenEventHeader());
   if(genPH) {
-    Printf("found pythia event header. pThard: %f Trials: %d xsec: %f",genPH->GetPtHard(),genPH->Trials(),genPH->GetXsection());
-
     Float_t xsec = genPH->GetXsection();
     Int_t trials = genPH->Trials();
     Float_t pthard = genPH->GetPtHard();