adding subevents onthefly
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 13 Nov 2009 14:33:31 +0000 (14:33 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 13 Nov 2009 14:33:31 +0000 (14:33 +0000)
PWG2/FLOW/AliFlowCommon/AliFlowEventSimpleMakerOnTheFly.cxx
PWG2/FLOW/AliFlowCommon/AliFlowEventSimpleMakerOnTheFly.h

index 883a962..fcb7575 100644 (file)
@@ -67,7 +67,11 @@ AliFlowEventSimpleMakerOnTheFly::AliFlowEventSimpleMakerOnTheFly(UInt_t iseed):
   fPhiDistribution(NULL),
   fMyTRandom3(NULL),
   fCount(0),
-  fNoOfLoops(1)
+  fNoOfLoops(1),
+  fEtaMinA(-1.0),
+  fEtaMaxA(-0.01),
+  fEtaMinB(0.01),
+  fEtaMaxB(1.0)
 {
   // constructor
   fMyTRandom3 = new TRandom3(iseed);   
@@ -219,6 +223,13 @@ AliFlowEventSimple* AliFlowEventSimpleMakerOnTheFly::CreateEventOnTheFly()
        pTrack->SetPhi(dTmpPhi); 
        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); 
@@ -234,6 +245,13 @@ AliFlowEventSimple* AliFlowEventSimpleMakerOnTheFly::CreateEventOnTheFly()
         pTrack->SetPhi(dTmpPhi);
         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);
@@ -250,6 +268,14 @@ AliFlowEventSimple* AliFlowEventSimpleMakerOnTheFly::CreateEventOnTheFly()
         pTrack->SetPhi(dTmpPhi);
         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);
@@ -262,6 +288,13 @@ AliFlowEventSimple* AliFlowEventSimpleMakerOnTheFly::CreateEventOnTheFly()
          pTrack->SetPhi(dTmpPhi);
          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);
index 9ae3aa9..9531336 100644 (file)
@@ -117,6 +117,9 @@ class AliFlowEventSimpleMakerOnTheFly {
   void SetNoOfLoops(Int_t noofl) {this->fNoOfLoops = noofl;}
   Int_t GetNoOfLoops() const {return this->fNoOfLoops;} 
 
+  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;};
+
  private:
  
   AliFlowEventSimpleMakerOnTheFly(const AliFlowEventSimpleMakerOnTheFly& anAnalysis);            // copy constructor
@@ -170,7 +173,11 @@ class AliFlowEventSimpleMakerOnTheFly {
   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  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
 };