add option to assign pi0 mass to neutral background particles
authormverweij <marta.verweij@cern.ch>
Wed, 10 Sep 2014 11:13:21 +0000 (13:13 +0200)
committermverweij <marta.verweij@cern.ch>
Wed, 10 Sep 2014 11:13:35 +0000 (13:13 +0200)
PWGJE/EMCALJetTasks/AliJetEmbeddingTask.cxx
PWGJE/EMCALJetTasks/AliJetEmbeddingTask.h

index 90be965..8f9324c 100644 (file)
@@ -14,7 +14,8 @@ ClassImp(AliJetEmbeddingTask)
 AliJetEmbeddingTask::AliJetEmbeddingTask() : 
   AliJetModelBaseTask("AliJetEmbeddingTask"),
   fMassless(kFALSE),
-  fNeutralFraction(0)
+  fNeutralFraction(0),
+  fNeutralMass(0.135)
 {
   // Default constructor.
   SetSuffix("Embedded");
@@ -24,7 +25,8 @@ AliJetEmbeddingTask::AliJetEmbeddingTask() :
 AliJetEmbeddingTask::AliJetEmbeddingTask(const char *name) : 
   AliJetModelBaseTask(name),
   fMassless(kFALSE),
-  fNeutralFraction(0)
+  fNeutralFraction(0),
+  fNeutralMass(0.135)
 {
   // Standard constructor.
   SetSuffix("Embedded");
@@ -54,12 +56,15 @@ void AliJetEmbeddingTask::Run()
       CopyTracks();
     for (Int_t i = 0; i < fNTracks; ++i) {
       Double_t mass = 0.1396;
-      if(fMassless) mass = 0.;
       Short_t charge = 1;
       if(fNeutralFraction>0.) {
        Double_t rnd = gRandom->Rndm();
-       if(rnd<fNeutralFraction) charge = 0;
+       if(rnd<fNeutralFraction) {
+         charge = 0;
+         mass = fNeutralMass;
+       }
       }
+      if(fMassless) mass = 0.;
       AddTrack(-1,-999,-1,0,0,0,0,kFALSE,0,charge,mass);
     }
   }
index 9a61fd0..372c098 100644 (file)
@@ -13,6 +13,7 @@ class AliJetEmbeddingTask : public AliJetModelBaseTask {
 
   void           SetMasslessParticles(Bool_t b) { fMassless        = b ; }
   void           SetNeutralFraction(Double_t f) { fNeutralFraction = f ; }
+  void           SetNeutralMass(Double_t m)     { fNeutralMass     = m ; }
 
  protected:
   void           Run();
@@ -20,10 +21,11 @@ class AliJetEmbeddingTask : public AliJetModelBaseTask {
  private:
   Bool_t         fMassless;               //make particles massless
   Double_t       fNeutralFraction;        //assign charge==0 to fraction of particles
+  Double_t       fNeutralMass;            //assign this mass to neutral particles
 
   AliJetEmbeddingTask(const AliJetEmbeddingTask&);            // not implemented
   AliJetEmbeddingTask &operator=(const AliJetEmbeddingTask&); // not implemented
 
-  ClassDef(AliJetEmbeddingTask, 3) // Jet embedding task
+  ClassDef(AliJetEmbeddingTask, 4) // Jet embedding task
 };
 #endif