Possibility to have a software trigger on multiplicity.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Mar 2010 11:03:55 +0000 (11:03 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Mar 2010 11:03:55 +0000 (11:03 +0000)
TDPMjet/AliGenDPMjet.cxx
TDPMjet/AliGenDPMjet.h
TDPMjet/TDPMjet.cxx

index 82b17af..4ea42b6 100644 (file)
@@ -59,7 +59,10 @@ AliGenDPMjet::AliGenDPMjet()
      fPi0Decay(1),
      fDecayAll(0),
      fGenImpPar(0.),
-     fProcess(kDpmMb)
+     fProcess(kDpmMb),
+     fTriggerMultiplicity(0),
+     fTriggerMultiplicityEta(0),
+     fTriggerMultiplicityPtMin(0)
 {
 // Constructor
     fEnergyCMS = 5500.;
@@ -86,7 +89,10 @@ AliGenDPMjet::AliGenDPMjet(Int_t npart)
      fPi0Decay(1),
      fDecayAll(0),
      fGenImpPar(0.),
-     fProcess(kDpmMb)
+     fProcess(kDpmMb),
+     fTriggerMultiplicity(0),
+     fTriggerMultiplicityEta(0),
+     fTriggerMultiplicityPtMin(0)
 {
 // Default PbPb collisions at 5. 5 TeV
 //
@@ -117,7 +123,10 @@ AliGenDPMjet::AliGenDPMjet(const AliGenDPMjet &/*Dpmjet*/)
      fPi0Decay(1),
      fDecayAll(0),
      fGenImpPar(0.),
-     fProcess(kDpmMb)
+     fProcess(kDpmMb),
+     fTriggerMultiplicity(0),
+     fTriggerMultiplicityEta(0),
+     fTriggerMultiplicityPtMin(0)
 {
     // Dummy copy constructor
     fEnergyCMS = 5500.;
@@ -195,9 +204,39 @@ void AliGenDPMjet::Generate()
       fGenImpPar = fDPMjet->GetBImpac();
       
       Int_t np = fParticles.GetEntriesFast();
-      printf("\n **************************************************%d\n",np);
-      Int_t nc=0;
-      if (np==0) continue;
+      //
+      // Multiplicity Trigger
+      if (fTriggerMultiplicity > 0) {
+       Int_t multiplicity = 0;
+       for (Int_t i = 0; i < np; i++) {
+         TParticle *  iparticle = (TParticle *) fParticles.At(i);
+       
+         Int_t statusCode = iparticle->GetStatusCode();
+       
+         // Initial state particle
+         if (statusCode != 1)
+           continue;
+         // eta cut
+         if (fTriggerMultiplicityEta > 0 && TMath::Abs(iparticle->Eta()) > fTriggerMultiplicityEta)
+           continue;
+         // pt cut
+         if (iparticle->Pt() < fTriggerMultiplicityPtMin) 
+           continue;
+         
+         TParticlePDG* pdgPart = iparticle->GetPDG();
+         if (pdgPart && pdgPart->Charge() == 0)
+           continue;
+         ++multiplicity;
+       }
+       //
+       //
+       if (multiplicity < fTriggerMultiplicity) continue;
+       Printf("Triggered on event with multiplicity of %d >= %d", multiplicity, fTriggerMultiplicity);
+      }    
+
+      Int_t nc = 0;
+      if (np == 0) continue;
+
       Int_t i;
       Int_t* newPos     = new Int_t[np];
       Int_t* pSelected  = new Int_t[np];
index 4dc0307..2895725 100644 (file)
@@ -52,7 +52,11 @@ class AliGenDPMjet : public AliGenMC
 
     virtual void    SetGenImpPar(Float_t bValue) {fGenImpPar=bValue;}
     virtual Float_t GetGenImpPar() {return fGenImpPar;}
-    
+    virtual void    SetTriggerChargedMultiplicity(Int_t multiplicity, 
+                                                 Float_t etamax = 0, Float_t ptmin = -1.) 
+    {fTriggerMultiplicity = multiplicity; fTriggerMultiplicityEta = etamax; 
+      fTriggerMultiplicityPtMin = ptmin;}
+
     AliGenDPMjet &  operator=(const AliGenDPMjet & rhs);
     void     AddHeader(AliGenEventHeader* header);
 
@@ -78,7 +82,11 @@ class AliGenDPMjet : public AliGenMC
     Int_t         fDecayAll;       // Flag to switch on long-lived particle decays
     Float_t      fGenImpPar;      // GeneratedImpactParameter
     DpmProcess_t  fProcess;        // Process type
-    
+    // Multiplicity Trigger
+    Int_t         fTriggerMultiplicity;      // Triggered multiplicity
+    Float_t       fTriggerMultiplicityEta;   // Triggered multiplicity eta cut
+    Float_t       fTriggerMultiplicityPtMin; // Triggered multiplicity min pt
+
  private:
     // adjust the weight from kinematic cuts
     void   AdjustWeights();
index 4667239..4722279 100644 (file)
@@ -173,9 +173,6 @@ Int_t TDPMjet::ImportParticles(TClonesArray *particles, Option_t *option)
        entot += DTEVT1.phkk[i][3]; // PHKK[i][3] <-> PHKK(4,i)
      } 
   }
-  printf("\n TDPMjet: DPMJET stack contains %d particles", numpart);
-  // printf("\n TDPMjet: Final not decayed particles: %d",    numStabpart);
-  //printf("\n TDPMjet: Total energy: %f GeV          \n",   entot);
   Int_t nump = 0;
   
   if(!strcmp(option,"") || !strcmp(option,"Final")){