added detector acceptance effect in AliFlowEventSimple + removed AliFlowEventSimpleMa...
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 17 Jun 2010 14:08:19 +0000 (14:08 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 17 Jun 2010 14:08:19 +0000 (14:08 +0000)
PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.cxx
PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.h
PWG2/FLOW/AliFlowCommon/AliFlowTrackSimple.h
PWG2/FLOW/AliFlowTasks/AliFlowEventSimpleMaker.cxx
PWG2/FLOW/macros/runFlowAnalysis.C

index bfee3e2..196cf97 100644 (file)
@@ -511,6 +511,7 @@ AliFlowEventSimple::AliFlowEventSimple( TTree* inputTree,
 void AliFlowEventSimple::CloneTracks(Int_t n)
 {
   //clone every track n times to add non-flow
+  if (n<=0) return; //no use to clone stuff zero or less times
   Int_t ntracks = fNumberOfTracks;
   fTrackCollection->Expand((n+1)*fNumberOfTracks);
   for (Int_t i=0; i<n; i++)
@@ -536,7 +537,10 @@ void AliFlowEventSimple::ResolutionPt(Double_t res)
 }
 
 //_____________________________________________________________________________
-void AliFlowEventSimple::TagSubeventsInEta(Double_t etaMinA, Double_t etaMaxA, Double_t etaMinB, Double_t etaMaxB )
+void AliFlowEventSimple::TagSubeventsInEta( Double_t etaMinA,
+                                            Double_t etaMaxA,
+                                            Double_t etaMinB,
+                                            Double_t etaMaxB )
 {
   //Flag two subevents in given eta ranges
   for (Int_t i=0; i<fNumberOfTracks; i++)
@@ -549,7 +553,7 @@ void AliFlowEventSimple::TagSubeventsInEta(Double_t etaMinA, Double_t etaMaxA, D
 }
 
 //_____________________________________________________________________________
-void AliFlowEventSimple::AddV1(Double_t v1)
+void AliFlowEventSimple::AddV1( Double_t v1 )
 {
   //add v2 to all tracks wrt the reaction plane angle
   for (Int_t i=0; i<fNumberOfTracks; i++)
@@ -560,7 +564,7 @@ void AliFlowEventSimple::AddV1(Double_t v1)
 }
 
 //_____________________________________________________________________________
-void AliFlowEventSimple::AddV2(Double_t v2)
+void AliFlowEventSimple::AddV2( Double_t v2 )
 {
   //add v2 to all tracks wrt the reaction plane angle
   for (Int_t i=0; i<fNumberOfTracks; i++)
@@ -571,7 +575,7 @@ void AliFlowEventSimple::AddV2(Double_t v2)
 }
 
 //_____________________________________________________________________________
-void AliFlowEventSimple::AddV4(Double_t v4)
+void AliFlowEventSimple::AddV4( Double_t v4 )
 {
   //add v4 to all tracks wrt the reaction plane angle
   for (Int_t i=0; i<fNumberOfTracks; i++)
@@ -582,7 +586,7 @@ void AliFlowEventSimple::AddV4(Double_t v4)
 }
 
 //_____________________________________________________________________________
-void AliFlowEventSimple::AddFlow(Double_t v1, Double_t v2, Double_t v4)
+void AliFlowEventSimple::AddFlow( Double_t v1, Double_t v2, Double_t v4 )
 {
   //add flow to all tracks wrt the reaction plane angle
   for (Int_t i=0; i<fNumberOfTracks; i++)
@@ -593,7 +597,7 @@ void AliFlowEventSimple::AddFlow(Double_t v1, Double_t v2, Double_t v4)
 }
 
 //_____________________________________________________________________________
-void AliFlowEventSimple::TagRP(AliFlowTrackSimpleCuts* cuts)
+void AliFlowEventSimple::TagRP( AliFlowTrackSimpleCuts* cuts )
 {
   //tag tracks as reference particles (RPs)
   for (Int_t i=0; i<fNumberOfTracks; i++)
@@ -605,7 +609,7 @@ void AliFlowEventSimple::TagRP(AliFlowTrackSimpleCuts* cuts)
 }
 
 //_____________________________________________________________________________
-void AliFlowEventSimple::TagPOI(AliFlowTrackSimpleCuts* cuts)
+void AliFlowEventSimple::TagPOI( AliFlowTrackSimpleCuts* cuts )
 {
   //tag tracks as particles of interest (POIs)
   for (Int_t i=0; i<fNumberOfTracks; i++)
@@ -616,3 +620,32 @@ void AliFlowEventSimple::TagPOI(AliFlowTrackSimpleCuts* cuts)
   }
 }
 
+//_____________________________________________________________________________
+void AliFlowEventSimple::DefineDeadZone( Double_t etaMin,
+                                         Double_t etaMax,
+                                         Double_t phiMin,
+                                         Double_t phiMax )
+{
+  //mark tracks in given eta-phi region as dead
+  //by resetting the flow bits
+  for (Int_t i=0; i<fNumberOfTracks; i++)
+  {
+    AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
+    Double_t eta = track->Eta();
+    Double_t phi = track->Phi();
+    if (eta>etaMin && eta<etaMax && phi>phiMin && phi<phiMax)
+      track->ResetFlowTags();
+  }
+}
+
+//_____________________________________________________________________________
+Int_t AliFlowEventSimple::CleanUpDeadTracks()
+{
+  //remove tracks that have no flow tags set and cleanup the container
+  for (Int_t i=0; i<fNumberOfTracks; i++)
+  {
+    AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
+    if (track->IsDead()) delete track;
+  }
+  fTrackCollection->Compress(); //clean up empty slots
+}
index 5aca536..64eb16e 100644 (file)
@@ -71,6 +71,8 @@ class AliFlowEventSimple: public TObject {
   void AddV2( Double_t v2 );
   void AddV4( Double_t v4 );
   void AddFlow( Double_t v1, Double_t v2, Double_t v4 );
+  void DefineDeadZone( Double_t etaMin, Double_t etaMax, Double_t phiMin, Double_t phiMax );
+  Int_t CleanUpDeadTracks();
  
   AliFlowTrackSimple* GetTrack(Int_t i);
   void AddTrack( AliFlowTrackSimple* track ); 
@@ -79,8 +81,8 @@ class AliFlowEventSimple: public TObject {
   void Get2Qsub(AliFlowVector* Qarray, Int_t n=2, TList *weightsList=NULL, Bool_t usePhiWeights=kFALSE, Bool_t usePtWeights=kFALSE, Bool_t useEtaWeights=kFALSE);  
 
   //these should go away!!!!
-  TObjArray* TrackCollection() const                { return fTrackCollection; } //deprecated!
-  void     SetNumberOfTracks(Int_t nr)              { fNumberOfTracks = nr; }
+  TObjArray* TrackCollection() const                { return NULL; } //deprecated!
+  void     SetNumberOfTracks(Int_t nr)              {} 
 
  protected:
   TObjArray*              fTrackCollection;           //-> collection of tracks
index 9dc1463..bf346e9 100644 (file)
@@ -32,10 +32,11 @@ public:
   Double_t Eta() const; 
   Double_t Pt()  const; 
   Double_t Phi() const; 
-  TBits    GetFlowBits() const;
-  Bool_t   InRPSelection() const; 
-  Bool_t   InPOISelection() const; 
-  Bool_t   InSubevent(Int_t i) const;
+
+  Bool_t InRPSelection() const; 
+  Bool_t InPOISelection() const; 
+  Bool_t InSubevent(Int_t i) const;
+  Bool_t IsDead() const {return (fFlowBits.CountBits()==0);}
       
   void SetEta(Double_t eta);
   void SetPt(Double_t pt); 
@@ -43,6 +44,8 @@ public:
   void SetForRPSelection(Bool_t b=kTRUE); 
   void SetForPOISelection(Bool_t b=kTRUE); 
   void SetForSubevent(Int_t i); 
+  void ResetFlowTags() {fFlowBits.ResetAllBits();}
+  void ResetSubEventTags() {fSubEventBits.ResetAllBits();}
   
   void ResolutionPt(Double_t resolution);
 
@@ -65,6 +68,7 @@ public:
                 Double_t precision,
                 Int_t maxNumberOfIterations=100 );
     
+  const TBits* GetFlowBits() const {return &fFlowBits;}
  private:
   Double_t fEta;    // eta
   Double_t fPt;     // pt
@@ -84,8 +88,6 @@ inline Double_t AliFlowTrackSimple::Pt() const {
 inline Double_t AliFlowTrackSimple::Phi() const { 
   return this->fPhi; }
 //TBits
-inline TBits AliFlowTrackSimple::GetFlowBits() const { 
-  return this->fFlowBits; }
 inline Bool_t AliFlowTrackSimple::InRPSelection() const { 
   return this->fFlowBits.TestBitNumber(0); }
 inline Bool_t AliFlowTrackSimple::InPOISelection() const { 
index ecebad8..400bbdc 100644 (file)
@@ -106,8 +106,8 @@ AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks( AliMCEvent* anInput, co
       }
       
       //check if any bits are set
-      TBits bFlowBits = pTrack->GetFlowBits();
-      if (bFlowBits.CountBits() ==0) {
+      const TBits* bFlowBits = pTrack->GetFlowBits();
+      if (bFlowBits->CountBits() ==0) {
        delete pTrack; } //track will not be used anymore
       else {
        pEvent->TrackCollection()->Add(pTrack) ; 
@@ -288,8 +288,8 @@ AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliAODEvent* anInput,  c
       
       
       //check if any bits are set
-      TBits bFlowBits = pTrack->GetFlowBits();
-      if (bFlowBits.CountBits() ==0) {
+      const TBits* bFlowBits = pTrack->GetFlowBits();
+      if (bFlowBits->CountBits() ==0) {
        delete pTrack; } //track will not be used anymore
       else {
        pEvent->TrackCollection()->Add(pTrack) ; 
@@ -408,8 +408,8 @@ AliFlowEventSimple*  AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, c
       else { cout<<"Not a valid option"<<endl; }
       
       //check if any bits are set
-      TBits bFlowBits = pTrack->GetFlowBits();
-      if (bFlowBits.CountBits() ==0) {
+      const TBits* bFlowBits = pTrack->GetFlowBits();
+      if (bFlowBits->CountBits() ==0) {
        delete pTrack; } //track will not be used anymore
       else {
        pEvent->TrackCollection()->Add(pTrack) ; 
index 7e428a1..c760cdb 100644 (file)
@@ -28,8 +28,6 @@
 #include <AliFlowCommon/AliFlowAnalysisWithFittingQDistribution.h>
 #include <AliFlowCommon/AliFlowAnalysisWithMixedHarmonics.h>
 #include <AliFlowCommon/AliFlowAnalysisWithNestedLoops.h>
-#include <AliFlowTasks/AliFlowEventSimpleMaker.h>
-#include <FlowEventMakers/FlowEventSimpleMaker.h>
 
 //--------------------------------------------------------------------------------------
 // Run flow analysis on local data with custom FlowEvent maker
@@ -120,12 +118,8 @@ int runFlowAnalysis(const anaModes mode=mLocal, Int_t aRuns = 100, const char*
   random3Temp.SetSeed(sseed);
 
   if (mode == mLocal || mode == mLocalPAR) {
-    // AliFlow event in aliroot or with pars
-    AliFlowEventSimpleMaker* fEventMaker = new AliFlowEventSimpleMaker();
   }
   else if (mode == mLocalSource) {
-    // flow event in source mode
-    FlowEventSimpleMaker* fEventMaker = new FlowEventSimpleMaker(); 
   }
   else{
     cout << "No supported running mode selected!" << endl;
@@ -425,14 +419,13 @@ int runFlowAnalysis(const anaModes mode=mLocal, Int_t aRuns = 100, const char*
                cout << "new multiplicity: " << nNewMultOfEvent << endl;
                cout << "new flow value: " << xNewFlowValue << endl;
              }
-             fEventMaker->SetNoOfLoops(nLoops);
-             fEventMaker->SetEllipticFlowValue(xNewFlowValue);
-             fEventMaker->SetMultiplicityOfEvent(nNewMultOfEvent);
-             xRPAngle=TMath::TwoPi()*random3Temp.Rndm();
-             fEventMaker->SetMCReactionPlaneAngle(xRPAngle);
              */
 
-             AliFlowEventSimple *fEvent = fEventMaker->FillTracks(kTree, cutsInt, cutsDiff); 
+             AliFlowEventSimple *fEvent = new AliFlowEventSimple(kTree, cutsInt, cutsDiff); 
+             //xRPAngle=random3Temp.Uniform(0.0,TMath::TwoPi());
+        //fEvent->SetMCReactionPlaneAngle(xRPAngle);
+        //fEvent->SetV2(xNewFlowValue);
+        //fEvent->CloneTracks(nLoops);
                            
              // do flow analysis for various methods
              if(MCEP)    mcep->Make(fEvent);
@@ -646,10 +639,6 @@ void LoadLibraries(const anaModes mode) {
     gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithMixedHarmonics.cxx+");
     gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithNestedLoops.cxx+");
     
-    // Class to fill the FlowEvent without aliroot dependence
-    // can be found in the directory FlowEventMakers
-    gROOT->LoadMacro("FlowEventMakers/FlowEventSimpleMaker.cxx+");   
-    
     cout << "finished loading macros!" << endl;  
     
   }