use cuts for poi and rp also onthefly
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 25 Feb 2010 14:09:25 +0000 (14:09 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 25 Feb 2010 14:09:25 +0000 (14:09 +0000)
PWG2/FLOW/AliFlowCommon/AliFlowEventSimpleMakerOnTheFly.cxx
PWG2/FLOW/AliFlowCommon/AliFlowEventSimpleMakerOnTheFly.h
PWG2/FLOW/AliFlowCommon/AliFlowTrackSimple.cxx
PWG2/FLOW/AliFlowCommon/AliFlowTrackSimple.h
PWG2/FLOW/AliFlowCommon/AliFlowTrackSimpleCuts.cxx
PWG2/FLOW/AliFlowCommon/AliFlowTrackSimpleCuts.h
PWG2/FLOW/macros/runFlowAnalysisOnTheFly.C

index 0e07f71..0fb498e 100644 (file)
@@ -73,6 +73,8 @@ AliFlowEventSimpleMakerOnTheFly::AliFlowEventSimpleMakerOnTheFly(UInt_t iseed):
   fPhiRange(0.),
   fPtRange(0.),
   fEtaRange(0.),
+  fNonflowSectorMin(0.),
+  fNonflowSectorMax(TMath::TwoPi()),
   fEtaMinA(-1.0),
   fEtaMaxA(-0.01),
   fEtaMinB(0.01),
@@ -125,7 +127,7 @@ void AliFlowEventSimpleMakerOnTheFly::Init()
 
 //========================================================================
 
-AliFlowEventSimple* AliFlowEventSimpleMakerOnTheFly::CreateEventOnTheFly()
+AliFlowEventSimple* AliFlowEventSimpleMakerOnTheFly::CreateEventOnTheFly(AliFlowTrackSimpleCuts *cutsRP, AliFlowTrackSimpleCuts *cutsPOI)
 {
   // method to create event on the fly
   
@@ -192,15 +194,15 @@ AliFlowEventSimple* AliFlowEventSimpleMakerOnTheFly::CreateEventOnTheFly()
   Int_t iGoodTracks = 0;
   Int_t iSelParticlesRP = 0;
   Int_t iSelParticlesPOI = 0;
-  const Int_t maxNoOfSplitedTracks = 10;
-  if(fNoOfLoops>maxNoOfSplitedTracks)
-  {
-   cout<<"One track can be splitted at maximum into 10 tracks !!!!"<<endl;
-   exit(0);
-  } 
-  Double_t *dTmpPhi = new Double_t[maxNoOfSplitedTracks]; 
-  Double_t *dTmpPt = new Double_t[maxNoOfSplitedTracks];
-  Double_t *dTmpEta = new Double_t[maxNoOfSplitedTracks];
+  // parameters of original tracks:
+  Double_t dPhiOriginalTrack = 0.; 
+  Double_t dPtOriginalTrack = 0.; 
+  Double_t dEtaOriginalTrack = 0.; 
+  // parameters of splitted tracks:  
+  Double_t dPhiSplittedTrack = 0.; 
+  Double_t dPtSplittedTrack = 0.; 
+  Double_t dEtaSplittedTrack = 0.; 
+  
   Double_t dTmpV2 = 0.;
   Bool_t bUniformAcceptance = kTRUE;
   Double_t Pi = TMath::Pi();
@@ -208,20 +210,20 @@ AliFlowEventSimple* AliFlowEventSimpleMakerOnTheFly::CreateEventOnTheFly()
   if(!((fPhiMin1==0.) && (fPhiMax1==0.) && (fPhiMin2==0.) && (fPhiMax2==0.))) {
     bUniformAcceptance = kFALSE;
   }
-  
+  // loop over original tracks:
   for(Int_t i=0;i<iNewMultiplicityOfRP;i++) 
   {
-   // get the track parameters: 
-   dTmpPt[0] = fPtSpectra->GetRandom();
-   dTmpEta[0] = fMyTRandom3->Uniform(dEtaMin,dEtaMax); 
-   // to be improved (optimized):   
+   // sample the pt and eta for original track: 
+   dPtOriginalTrack = fPtSpectra->GetRandom();
+   dEtaOriginalTrack = fMyTRandom3->Uniform(dEtaMin,dEtaMax); 
+   // generate flow harmonic which will determine the azimuthal distribution (to be improved - optimized):   
    if(fPtDependentHarmonics || fEtaDependentHarmonics) 
    {
     if(fEtaDependentHarmonics)
     {
      if(fV2vsEtaSpread>0.)
      { 
-      dTmpV2 = TMath::Exp(-pow(dTmpEta[0]/fV2vsEtaSpread,2.));
+      dTmpV2 = TMath::Exp(-pow(dEtaOriginalTrack/fV2vsEtaSpread,2.));
      }
      if(!fPtDependentHarmonics)
      {
@@ -232,88 +234,122 @@ AliFlowEventSimple* AliFlowEventSimpleMakerOnTheFly::CreateEventOnTheFly()
     {
      if(!fEtaDependentHarmonics)
      {
-      if(dTmpPt[0] >= fPtCutOff) {dTmpV2 = fV2vsPtEtaMax;} 
-      else {dTmpV2 = fV2vsPtEtaMax*(dTmpPt[0]/fPtCutOff);} 
+      if(dPtOriginalTrack >= fPtCutOff) {dTmpV2 = fV2vsPtEtaMax;} 
+      else {dTmpV2 = fV2vsPtEtaMax*(dPtOriginalTrack/fPtCutOff);} 
      } else
        {
-        if(dTmpPt[0] >= fPtCutOff) {dTmpV2 *= fV2vsPtEtaMax;} 
-        else {dTmpV2 *= fV2vsPtEtaMax*(dTmpPt[0]/fPtCutOff);}         
+        if(dPtOriginalTrack >= fPtCutOff) {dTmpV2 *= fV2vsPtEtaMax;} 
+        else {dTmpV2 *= fV2vsPtEtaMax*(dPtOriginalTrack/fPtCutOff);}         
        }
     } // end of if(fPtDependentHarmonics)
+    // flow harmonic is determined and plugged in as a parameter in the predefined azimuthal distribution:
     fPhiDistribution->SetParameter(1,dTmpV2);         
    }
-   dTmpPhi[0] = fPhiDistribution->GetRandom();
+   // sample the phi angle for original track: 
+   dPhiOriginalTrack = fPhiDistribution->GetRandom();
+   // from each original track make fNoOfLoops splitted tracks if the particle is ongoing in 
+   // detector's sector ranging from fNonflowSectorMin to fNonflowSectorMax
+   // (simulating nonflow correlations between fNoOfLoops tracks in certain detector's sector):
    for(Int_t d=0;d<fNoOfLoops;d++) 
    {
-    if(d>0) 
+    if(d>0 && (dPhiOriginalTrack>=fNonflowSectorMin && dPhiOriginalTrack<fNonflowSectorMax)) 
     {
-     dTmpPhi[d] = dTmpPhi[0];
-     dTmpPt[d] = dTmpPt[0];
-     dTmpEta[d] = dTmpEta[0]; 
+     dPhiSplittedTrack = dPhiOriginalTrack;
+     dPtSplittedTrack = dPtOriginalTrack;
+     dEtaSplittedTrack = dEtaOriginalTrack;
      // phi:
      if(fPhiRange>0.)
      {
-      dTmpPhi[d] = fMyTRandom3->Uniform(dTmpPhi[0]-fPhiRange,dTmpPhi[0]+fPhiRange);
-      if(dTmpPhi[d]<0) 
+      dPhiSplittedTrack = fMyTRandom3->Uniform(dPhiOriginalTrack-fPhiRange,dPhiOriginalTrack+fPhiRange);
+      if(dPhiSplittedTrack<0) 
       {
-       dTmpPhi[d]+=TMath::TwoPi(); // to ensure angle is in [0,2Pi>
+       dPhiSplittedTrack+=TMath::TwoPi(); // to ensure angle is in [0,2Pi>
       } 
-      if(dTmpPhi[d]>=TMath::TwoPi())
+      if(dPhiSplittedTrack>=TMath::TwoPi())
       {
-       dTmpPhi[d]-=TMath::TwoPi(); // to ensure angle is in [0,2Pi>
+       dPhiSplittedTrack-=TMath::TwoPi(); // to ensure angle is in [0,2Pi>
       }      
      } // end of if(fPhiRange>0.)    
      // pt:
      if(fPtRange>0.)
      {
-      Double_t minPt = dTmpPt[0]-fPtRange;
-      Double_t maxPt = dTmpPt[0]+fPtRange;
+      Double_t minPt = dPtOriginalTrack-fPtRange;
+      Double_t maxPt = dPtOriginalTrack+fPtRange;
       if(minPt<0)
       {
        minPt = 0.; // protection against pt<0 for splitted track
       } 
-      dTmpPt[d] = fMyTRandom3->Uniform(minPt,maxPt);
+      dPtSplittedTrack = fMyTRandom3->Uniform(minPt,maxPt);
      } // end of if(fPtRange>0.)    
      // eta:     
      if(fEtaRange>0.)
      {
-      dTmpEta[d] = fMyTRandom3->Uniform(dTmpEta[0]-fEtaRange,dTmpEta[0]+fEtaRange);
+      dEtaSplittedTrack = fMyTRandom3->Uniform(dEtaOriginalTrack-fEtaRange,dEtaOriginalTrack+fEtaRange);
      } // end of if(fEtaRange>0.)    
-    } // end of if(d>0)   
-    // make the new track
-    AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
+    } // end of if(d>0)  
+    Double_t dTmpPhi = -44.;
+    Double_t dTmpPt = -44.;
+    Double_t dTmpEta = -44.;
+    if(d>0)
+    {
+     if(dPhiOriginalTrack>=fNonflowSectorMin && dPhiOriginalTrack<fNonflowSectorMax)
+     {
+      dTmpPhi = dPhiSplittedTrack;
+      dTmpPt = dPtSplittedTrack;
+      dTmpEta = dEtaSplittedTrack;
+     }
+    } else
+      {
+       dTmpPhi = dPhiOriginalTrack;
+       dTmpPt = dPtOriginalTrack;
+       dTmpEta = dEtaOriginalTrack;      
+      }   
+    // make the new track:
+    AliFlowTrackSimple *pTrack = new AliFlowTrackSimple();
     // uniform acceptance:
     if(bUniformAcceptance) 
     {
-     pTrack->SetPt(dTmpPt[d]); 
-         pTrack->SetEta(dTmpEta[d]); 
-         pTrack->SetPhi(dTmpPhi[d]); 
-         pTrack->SetForRPSelection(kTRUE); 
-         iSelParticlesRP++; 
-         // assign particles to subevents
-         if (pTrack->Eta()>=fEtaMinA && pTrack->Eta()<=fEtaMaxA) 
+     pTrack->SetPt(dTmpPt); 
+         pTrack->SetEta(dTmpEta); 
+         pTrack->SetPhi(dTmpPhi);
+         // checking RP cuts:           
+     if(cutsRP->PassesCuts(pTrack))
+     {
+          pTrack->SetForRPSelection(kTRUE); 
+      iSelParticlesRP++; 
+         }
+         // assign particles to subevents:
+         if(pTrack->Eta()>=fEtaMinA && pTrack->Eta()<=fEtaMaxA) 
          {
           pTrack->SetForSubevent(0);
          }
-     if (pTrack->Eta()>=fEtaMinB && pTrack->Eta()<=fEtaMaxB) 
+     if(pTrack->Eta()>=fEtaMinB && pTrack->Eta()<=fEtaMaxB) 
      {
           pTrack->SetForSubevent(1);
          }
-         pTrack->SetForPOISelection(kTRUE); 
-         iSelParticlesPOI++; 
+         // checking POI cuts:
+         if(cutsPOI->PassesCuts(pTrack))
+     {
+          pTrack->SetForPOISelection(kTRUE); 
+          iSelParticlesPOI++; 
+         }
          pEvent->TrackCollection()->Add(pTrack); 
          iGoodTracks++; 
     } // end of if(bUniformAcceptance) 
     // non-uniform acceptance, 1st sector:
-    else if ((dTmpPhi[d] > fPhiMin1*Pi/180) && (dTmpPhi[d] < fPhiMax1*Pi/180)) 
+    else if ((dTmpPhi > fPhiMin1*Pi/180) && (dTmpPhi < fPhiMax1*Pi/180)) 
     {
          if(fMyTRandom3->Uniform(0,1) > 1 - fProbability1) 
          {
-          pTrack->SetPt(dTmpPt[d]);
-          pTrack->SetEta(dTmpEta[d]);
-          pTrack->SetPhi(dTmpPhi[d]);
-          pTrack->SetForRPSelection(kTRUE);
-          iSelParticlesRP++;
+          pTrack->SetPt(dTmpPt);
+          pTrack->SetEta(dTmpEta);
+          pTrack->SetPhi(dTmpPhi);
+          // checking RP cuts:
+          if(cutsRP->PassesCuts(pTrack))
+      {
+           pTrack->SetForRPSelection(kTRUE);
+           iSelParticlesRP++;
+          }
           // assign particles to subevents
           if (pTrack->Eta()>=fEtaMinA && pTrack->Eta()<=fEtaMaxA) 
           {
@@ -323,64 +359,84 @@ AliFlowEventSimple* AliFlowEventSimpleMakerOnTheFly::CreateEventOnTheFly()
           {
            pTrack->SetForSubevent(1);
           }
-          pTrack->SetForPOISelection(kTRUE);
-          iSelParticlesPOI++;
+          // checking POI cuts:
+          if(cutsPOI->PassesCuts(pTrack))
+      {
+           pTrack->SetForPOISelection(kTRUE);
+           iSelParticlesPOI++;
+          }
           pEvent->TrackCollection()->Add(pTrack);
           iGoodTracks++;
          } // end of if(fMyTRandom3->Uniform(0,1) > 1 - fProbability1) 
     } // end of else if ((dTmpPhi > fPhiMin1*Pi/180) && (dTmpPhi < fPhiMax1*Pi/180)) 
     // non-uniform acceptance, 2nd sector:
-    else if ((dTmpPhi[d] > fPhiMin2*Pi/180) && (dTmpPhi[d] < fPhiMax2*Pi/180)) 
-    {
-         if(fMyTRandom3->Uniform(0,1) > 1 - fProbability2)
+    else if ((dTmpPhi > fPhiMin2*Pi/180) && (dTmpPhi < fPhiMax2*Pi/180)) 
+      {
+       if(fMyTRandom3->Uniform(0,1) > 1 - fProbability2)
          {
-          pTrack->SetPt(dTmpPt[d]);
-          pTrack->SetEta(dTmpEta[d]);
-          pTrack->SetPhi(dTmpPhi[d]);
-          pTrack->SetForRPSelection(kTRUE);
-          iSelParticlesRP++;
-          // assign particles to subevents
-          if (pTrack->Eta()>=fEtaMinA && pTrack->Eta()<=fEtaMaxA) 
-          {
-           pTrack->SetForSubevent(0);
-          }
-          if (pTrack->Eta()>=fEtaMinB && pTrack->Eta()<=fEtaMaxB) 
-          {
-           pTrack->SetForSubevent(1);
-          }
-          pTrack->SetForPOISelection(kTRUE);
-          iSelParticlesPOI++;
-          pEvent->TrackCollection()->Add(pTrack);
-          iGoodTracks++;
+           pTrack->SetPt(dTmpPt);
+           pTrack->SetEta(dTmpEta);
+           pTrack->SetPhi(dTmpPhi);
+           // checking RP cuts:
+           if(cutsRP->PassesCuts(pTrack))
+             {
+               pTrack->SetForRPSelection(kTRUE);
+               iSelParticlesRP++;
+             }
+           // assign particles to subevents
+           if (pTrack->Eta()>=fEtaMinA && pTrack->Eta()<=fEtaMaxA) 
+             {
+               pTrack->SetForSubevent(0);
+             }
+           if (pTrack->Eta()>=fEtaMinB && pTrack->Eta()<=fEtaMaxB) 
+             {
+               pTrack->SetForSubevent(1);
+             }
+           // checking POI cuts:
+           if(cutsPOI->PassesCuts(pTrack))
+             {
+               pTrack->SetForPOISelection(kTRUE);
+               iSelParticlesPOI++;
+             }
+           pEvent->TrackCollection()->Add(pTrack);
+           iGoodTracks++;
          } // end of if(fMyTRandom3->Uniform(0,1) > 1 - fProbability2)
-    } // end of else if ((dTmpPhi > fPhiMin2*Pi/180) && (dTmpPhi < fPhiMax2*Pi/180))
+      } // end of else if ((dTmpPhi > fPhiMin2*Pi/180) && (dTmpPhi < fPhiMax2*Pi/180))
     else 
-    {
-         pTrack->SetPt(dTmpPt[d]);
-         pTrack->SetEta(dTmpEta[d]);
-         pTrack->SetPhi(dTmpPhi[d]);
-         pTrack->SetForRPSelection(kTRUE);
-         iSelParticlesRP++;
-         // assign particles to subevents
-         if (pTrack->Eta()>=fEtaMinA && pTrack->Eta()<=fEtaMaxA) 
+      {
+       pTrack->SetPt(dTmpPt);
+       pTrack->SetEta(dTmpEta);
+       pTrack->SetPhi(dTmpPhi);
+       // checking RP cuts:
+       if(cutsRP->PassesCuts(pTrack))
          {
-          pTrack->SetForSubevent(0);
+           pTrack->SetForRPSelection(kTRUE);
+           iSelParticlesRP++;
          }
-         if (pTrack->Eta()>=fEtaMinB && pTrack->Eta()<=fEtaMaxB) 
+       // assign particles to subevents
+       if (pTrack->Eta()>=fEtaMinA && pTrack->Eta()<=fEtaMaxA) 
          {
-          pTrack->SetForSubevent(1);
+             pTrack->SetForSubevent(0);
          }
-         pTrack->SetForPOISelection(kTRUE);
-     iSelParticlesPOI++;
-         pEvent->TrackCollection()->Add(pTrack);
-         iGoodTracks++;
-    } // end of else
+       if (pTrack->Eta()>=fEtaMinB && pTrack->Eta()<=fEtaMaxB) 
+         {
+           pTrack->SetForSubevent(1);
+         }
+       // checking POI cuts:
+       if(cutsPOI->PassesCuts(pTrack))
+         {
+             pTrack->SetForPOISelection(kTRUE);
+             iSelParticlesPOI++;
+         }
+       pEvent->TrackCollection()->Add(pTrack);
+       iGoodTracks++;
+      } // end of else
    } // end of for(Int_t d=0;d<fNoOfLoops;d++)
   } // end of for(Int_t i=0;i<iNewMultiplicityOfRP;i++)
   
   // update the event quantities
   pEvent->SetEventNSelTracksRP(iSelParticlesRP);  
-  pEvent->SetNumberOfTracks(iGoodTracks);//tracks used either for RP or for POI selection
+  pEvent->SetNumberOfTracks(iGoodTracks); // total number of tracks (RPs + POIs + the ones that didn't pass neither RP nor POI cuts)
   pEvent->SetMCReactionPlaneAngle(dMCReactionPlaneAngle);
   
   Int_t cycle = 0;
@@ -401,10 +457,6 @@ AliFlowEventSimple* AliFlowEventSimpleMakerOnTheFly::CreateEventOnTheFly()
     cout << "# " << fCount << " events processed" << endl;
   }
   
-  delete [] dTmpPhi;
-  delete [] dTmpPt;
-  delete [] dTmpEta;
-  
   return pEvent;  
   
 } // end of CreateEventOnTheFly()
index c0cb0f8..efacb3f 100644 (file)
@@ -21,6 +21,7 @@ class TF1;
 class TRandom3;
 
 #include "AliFlowEventSimple.h"  //needed as include
+#include "AliFlowTrackSimpleCuts.h"
     
 class AliFlowEventSimpleMakerOnTheFly {
 
@@ -31,7 +32,7 @@ class AliFlowEventSimpleMakerOnTheFly {
 
   virtual void Init(); 
   
-  AliFlowEventSimple* CreateEventOnTheFly();  // create an event on the fly
+  AliFlowEventSimple* CreateEventOnTheFly(AliFlowTrackSimpleCuts *cutsRP, AliFlowTrackSimpleCuts *cutsPOI);  // create an event on the fly
  
     
   //                        *****************************
@@ -131,6 +132,10 @@ class AliFlowEventSimpleMakerOnTheFly {
   Double_t GetPtRange() const {return this->fPtRange;}   
   void SetEtaRange(Double_t er) {this->fEtaRange = er;}
   Double_t GetEtaRange() const {return this->fEtaRange;} 
+  void SetNonflowSectorMin(Double_t nsMin) {this->fNonflowSectorMin = nsMin;}
+  Double_t GetNonflowSectorMin() const {return this->fNonflowSectorMin;} 
+  void SetNonflowSectorMax(Double_t nsMax) {this->fNonflowSectorMax = nsMax;}
+  Double_t GetNonflowSectorMax() const {return this->fNonflowSectorMax;} 
   void SetSubeventEtaRange(Double_t minA,Double_t maxA,Double_t minB,Double_t maxB) 
   {this->fEtaMinA = minA; this->fEtaMaxA = maxA;this->fEtaMinB = minB; this->fEtaMaxB = maxB;};
 
@@ -186,16 +191,18 @@ class AliFlowEventSimpleMakerOnTheFly {
   TF1*      fPhiDistribution; // azimuthal distribution
   //................................................................................................
   
-  TRandom3* fMyTRandom3; // our TRandom3 generator
-  Int_t     fCount;      // count number of events 
-  Int_t     fNoOfLoops;  // number of times to use the same particle (nonflow)
-  Double_t  fPhiRange;   // splitted track phi range (+/- from original track's phi) for uniform sampling
-  Double_t  fPtRange;    // splitted track pt range (+/- from original track's pt) for uniform sampling
-  Double_t  fEtaRange;   // splitted track eta range (+/- from original track's eta) for uniform sampling
-  Double_t  fEtaMinA;    // minimum eta of subevent A eta range
-  Double_t  fEtaMaxA;    // maximum eta of subevent A eta range
-  Double_t  fEtaMinB;    // minimum eta of subevent B eta range
-  Double_t  fEtaMaxB;    // maximum eta of subevent B eta range  
+  TRandom3* fMyTRandom3;       // our TRandom3 generator
+  Int_t     fCount;            // count number of events 
+  Int_t     fNoOfLoops;        // number of times to use the same particle (nonflow)
+  Double_t  fPhiRange;         // splitted track phi range (+/- from original track's phi) for uniform sampling
+  Double_t  fPtRange;          // splitted track pt range (+/- from original track's pt) for uniform sampling
+  Double_t  fEtaRange;         // splitted track eta range (+/- from original track's eta) for uniform sampling
+  Double_t  fNonflowSectorMin; // detector's sector in which tracks are splitted starts at angle fNonflowSectorMin
+  Double_t  fNonflowSectorMax; // detector's sector in which tracks are splitted ends at angle fNonflowSectorMin
+  Double_t  fEtaMinA;          // minimum eta of subevent A eta range
+  Double_t  fEtaMaxA;          // maximum eta of subevent A eta range
+  Double_t  fEtaMinB;          // minimum eta of subevent B eta range
+  Double_t  fEtaMaxB;          // maximum eta of subevent B eta range  
 
   ClassDef(AliFlowEventSimpleMakerOnTheFly,0) // macro for rootcint
 };
index fb14074..a077f37 100644 (file)
@@ -43,7 +43,7 @@ AliFlowTrackSimple::AliFlowTrackSimple():
 //-----------------------------------------------------------------------
 
 AliFlowTrackSimple::AliFlowTrackSimple(const AliFlowTrackSimple& aTrack):
-  TObject(),
+  TNamed(),
   fEta(aTrack.fEta),
   fPt(aTrack.fPt),
   fPhi(aTrack.fPhi),
index 1459f6b..3ab47f6 100644 (file)
@@ -2,16 +2,17 @@
 * See cxx source for full Copyright notice */
 /* $Id$ */
 
-#ifndef AliFlowTrackSimple_H
-#define AliFlowTrackSimple_H
+#ifndef ALIFLOWTRACKSIMPLE_H
+#define ALIFLOWTRACKSIMPLE_H
 
+#include "TNamed.h"
 #include "TBits.h"
 
 // AliFlowTrackSimple:
 // A simple track class to the the AliFlowEventSimple for flow analysis
 // author: N. van der Kolk (kolk@nikhef.nl)
 
-class AliFlowTrackSimple: public TObject {
+class AliFlowTrackSimple: public TNamed {
 
  public:
   AliFlowTrackSimple();
index 6ac2b4c..7daeb34 100644 (file)
@@ -14,8 +14,9 @@
  **************************************************************************/
 
 /* $Id$ */ 
-#include "TObject.h"
+#include "TNamed.h"
 #include "AliFlowTrackSimpleCuts.h"
+#include "AliFlowTrackSimple.h" 
 
 
 // AliFlowTrackSimpleCuts:
@@ -36,8 +37,7 @@ AliFlowTrackSimpleCuts::AliFlowTrackSimpleCuts():
   fEtaMin(0.),
   fPhiMax(0.),
   fPhiMin(0.),
-  fPID(0)
-  
+  fPID(0) 
 {
   //constructor 
   
@@ -46,7 +46,7 @@ AliFlowTrackSimpleCuts::AliFlowTrackSimpleCuts():
 //-----------------------------------------------------------------------
 
 AliFlowTrackSimpleCuts::AliFlowTrackSimpleCuts(const AliFlowTrackSimpleCuts& someCuts):
-  TObject(),
+  TNamed(),
   fPtMax(someCuts.fPtMax),
   fPtMin(someCuts.fPtMin),
   fEtaMax(someCuts.fEtaMax),
@@ -82,3 +82,17 @@ AliFlowTrackSimpleCuts::~AliFlowTrackSimpleCuts()
   //destructor
   
 }
+
+
+//----------------------------------------------------------------------- 
+
+Bool_t AliFlowTrackSimpleCuts::PassesCuts(AliFlowTrackSimple *track)
+{
+  //simple method to check if the simple track passes the simple cuts
+  if(track->Pt() >= fPtMin && track->Pt() < fPtMax &&
+     track->Eta() >= fEtaMin && track->Eta() < fEtaMax &&
+     track->Phi() >= fPhiMin && track->Phi() < fPhiMax)
+    { return kTRUE; } 
+  else
+    { return kFALSE; }  
+}
index 2496922..9f9f759 100644 (file)
@@ -7,12 +7,14 @@
 // kinematic cuts
 // author: N. van der Kolk (kolk@nikhef.nl)
 
-#ifndef AliFlowTrackSimpleCuts_H
-#define AliFlowTrackSimpleCuts_H
+#ifndef ALIFLOWTRACKSIMPLECUTS_H
+#define ALIFLOWTRACKSIMPLECUTS_H
 
-class TObject;
+#include "AliFlowTrackSimple.h"  //needed as include
 
-class AliFlowTrackSimpleCuts : public TObject {
+class TNamed;
+
+class AliFlowTrackSimpleCuts : public TNamed {
 
  public:
   AliFlowTrackSimpleCuts();
@@ -37,6 +39,9 @@ class AliFlowTrackSimpleCuts : public TObject {
   Double_t GetPhiMax() const    {return this->fPhiMax; }
   Double_t GetPhiMin() const    {return this->fPhiMin; }
   Int_t    GetPID() const       {return this->fPID; }
+  
+  //simple method to check if the simple track passes the simple cuts:
+  Bool_t PassesCuts(AliFlowTrackSimple *track);
 
  private:
   Double_t fPtMax;
index 4f317c6..b35ff33 100644 (file)
@@ -36,6 +36,24 @@ Double_t maxA = -0.01;
 Double_t minB = 0.01;
 Double_t maxB = 0.9;
 
+// Define simple cuts for RP selection:
+Double_t ptMinRP = 0.0; // in GeV
+Double_t ptMaxRP = 10.0; // in GeV
+Double_t etaMinRP  = -0.9;
+Double_t etaMaxRP  = 0.9;
+Double_t phiMinRP  = 0.0; // in degrees
+Double_t phiMaxRP  = 360.0; // in degrees
+Int_t pidRP = -1; // to be improved (supported eventually)
+
+// Define simple cuts for POI selection:
+Double_t ptMinPOI = 0.0; // in GeV
+Double_t ptMaxPOI = 10.0; // in GeV
+Double_t etaMinPOI  = -0.9;
+Double_t etaMaxPOI  = 0.9;
+Double_t phiMinPOI  = 0.0; // in degrees
+Double_t phiMaxPOI  = 360.0; // in degrees
+Int_t pidPOI = -1; // to be improved (supported eventually)
+
 // Parameters for the simulation of events 'on the fly': 
 //===SEED========================================================
 // use always the same seed for random generators. 
@@ -63,6 +81,11 @@ Double_t etaRange = 0.0; // If the original track with pseudorapidity eta is spl
                          // from (eta-etaRange, eta+etaRange). If etaRange = 0.0, the
                          // pseudorapidity of splitted track will be the same as the
                          // pseudorapidity of original track.
+// in addition one can simulate nonflow only in a certain detector's sector 
+// ranging from nonflowSectorMin to nonflowSectorMax. Outside this sector the
+// tracks will not be splitted. Use the following two settings only if iLoops>1:                         
+Double_t nonflowSectorMin = 0.0; // detector's sector in which tracks will be splitted starts at this angle (in degrees)                         
+Double_t nonflowSectorMax = 360.0; // detector's sector in which tracks will be splitted ends at this angle (in degrees)                        
 
 //===FLOW HARMONICS===============================================================
 // harmonics V1, V2, V4... are constants or functions of pt and eta:                    
@@ -105,7 +128,7 @@ Bool_t bMultDistrOfRPsIsGauss = kTRUE;
                     
 Int_t iMultiplicityOfRP = 500;        // mean multiplicity of RPs (if sampled from Gaussian)
 Double_t dMultiplicitySpreadOfRP = 0; // multiplicity spread of RPs (if sampled from Gaussian)
-Int_t iMinMultOfRP = 50;             // minimal multiplicity of RPs (if sampled uniformly)
+Int_t iMinMultOfRP = 50;              // minimal multiplicity of RPs (if sampled uniformly)
 Int_t iMaxMultOfRP = 500;             // maximal multiplicity of RPs (if sampled uniformly)
                     
 //===DETECTOR ACCEPTANCE===============================================================
@@ -125,7 +148,7 @@ Bool_t uniformAcceptance = kTRUE;
 // 1st non-uniform sector:
 Double_t phimin1 = 60;  // first non-uniform sector starts at this azimuth
 Double_t phimax1 = 120; // first non-uniform sector ends at this azimuth
-Double_t p1 = 0.6;     // e.g. if p1 = 0 all particles emitted in phimin1 < phi < phimax1 are blocked
+Double_t p1 = 0.5;     // e.g. if p1 = 0 all particles emitted in phimin1 < phi < phimax1 are blocked
                         // e.g. if p1 = 0.5 half of the particles emitted in phimin1 < phi < phimax1 are blocked
 
 // 2nd non-uniform sector (Remark: if you do NOT want to simulate this sector, set phimin2 = phimax2 = p2 = 0):                 
@@ -440,6 +463,8 @@ int runFlowAnalysisOnTheFly(Int_t nEvts=1000, Int_t mode=mLocal)
  eventMakerOnTheFly->SetPhiRange(phiRange*TMath::Pi()/180.);
  eventMakerOnTheFly->SetPtRange(ptRange);
  eventMakerOnTheFly->SetEtaRange(etaRange);
+ eventMakerOnTheFly->SetNonflowSectorMin(nonflowSectorMin*TMath::Pi()/180.);
+ eventMakerOnTheFly->SetNonflowSectorMax(nonflowSectorMax*TMath::Pi()/180.);
  if(bMultDistrOfRPsIsGauss)
  {
   eventMakerOnTheFly->SetMultDistrOfRPsIsGauss(bMultDistrOfRPsIsGauss);
@@ -501,13 +526,32 @@ int runFlowAnalysisOnTheFly(Int_t nEvts=1000, Int_t mode=mLocal)
   eventMakerOnTheFly->SetSecondSectorPhiMax(phimax2);
   eventMakerOnTheFly->SetSecondSectorProbability(p2);
  }
-       
+ // simple cuts for RPs and POIs:
+ AliFlowTrackSimpleCuts *cutsRP = new AliFlowTrackSimpleCuts();
+ cutsRP->SetPtMax(ptMaxRP);
+ cutsRP->SetPtMin(ptMinRP);
+ cutsRP->SetEtaMax(etaMaxRP);
+ cutsRP->SetEtaMin(etaMinRP);
+ cutsRP->SetPhiMax(phiMaxRP*TMath::Pi()/180.);
+ cutsRP->SetPhiMin(phiMinRP*TMath::Pi()/180.);
+ cutsRP->SetPID(pidRP);
+  
+ AliFlowTrackSimpleCuts *cutsPOI = new AliFlowTrackSimpleCuts();
+ cutsPOI->SetPtMax(ptMaxPOI);
+ cutsPOI->SetPtMin(ptMinPOI);
+ cutsPOI->SetEtaMax(etaMaxPOI);
+ cutsPOI->SetEtaMin(etaMinPOI);
+ cutsPOI->SetPhiMax(phiMaxPOI*TMath::Pi()/180.);
+ cutsPOI->SetPhiMin(phiMinPOI*TMath::Pi()/180.);
+ cutsPOI->SetPID(pidPOI);
+                                       
  //---------------------------------------------------------------------------------------  
  // create and analyze events 'on the fly':
 
  for(Int_t i=0;i<nEvts;i++) {   
    // creating the event with above settings:
-   AliFlowEventSimple *event = eventMakerOnTheFly->CreateEventOnTheFly(); 
+   AliFlowEventSimple *event = eventMakerOnTheFly->CreateEventOnTheFly(cutsRP,cutsPOI); 
    
    // analyzing the created event 'on the fly':
    // do flow analysis for various methods: