modifications for subevents
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 13 Nov 2009 10:43:01 +0000 (10:43 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 13 Nov 2009 10:43:01 +0000 (10:43 +0000)
PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithScalarProduct.cxx
PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithScalarProduct.h
PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.cxx
PWG2/FLOW/AliFlowCommon/AliFlowEventSimple.h
PWG2/FLOW/AliFlowCommon/AliFlowTrackSimple.h
PWG2/FLOW/AliFlowTasks/AliFlowEventSimpleMaker.cxx
PWG2/FLOW/AliFlowTasks/AliFlowEventSimpleMaker.h
PWG2/FLOW/macros/showSpread.C

index cdb7125..31f00d5 100644 (file)
@@ -45,6 +45,8 @@ ClassImp(AliFlowAnalysisWithScalarProduct)
  
  AliFlowAnalysisWithScalarProduct::AliFlowAnalysisWithScalarProduct():
    fEventNumber(0),
+   fEtaMin(0.01),
+   fEtaMax(1.),
    fDebug(kFALSE),
    fHistList(NULL),
    fHistProUQetaRP(NULL),
@@ -158,8 +160,10 @@ void AliFlowAnalysisWithScalarProduct::Make(AliFlowEventSimple* anEvent) {
     fCommonHists->FillControlHistograms(anEvent);
         
     //get Q vectors for the eta-subevents
-    AliFlowVector vQa = anEvent->GetQsub(-1.,-0.01);  
-    AliFlowVector vQb = anEvent->GetQsub(0.01,1.);
+    AliFlowVector* vQarray = new AliFlowVector[2];
+    anEvent->GetQsub(vQarray);
+    AliFlowVector vQa = vQarray[0];
+    AliFlowVector vQb = vQarray[1];
     //get total Q vector
     AliFlowVector vQ = vQa + vQb;
     
@@ -190,9 +194,11 @@ void AliFlowAnalysisWithScalarProduct::Make(AliFlowEventSimple* anEvent) {
          TVector2 vQm = vQ;
          //subtract particle from the flowvector if used to define it
          if (pTrack->InRPSelection()) {
-           Double_t dQmX = vQm.X() - dUX;
-           Double_t dQmY = vQm.Y() - dUY;
-           vQm.Set(dQmX,dQmY);
+           if (pTrack->InSubevent(0) || pTrack->InSubevent(1)) { 
+             Double_t dQmX = vQm.X() - dUX;
+             Double_t dQmY = vQm.Y() - dUY;
+             vQm.Set(dQmX,dQmY);
+           }
          }
 
          //dUQ = scalar product of vU and vQm
@@ -213,6 +219,7 @@ void AliFlowAnalysisWithScalarProduct::Make(AliFlowEventSimple* anEvent) {
         
     fEventNumber++;
     //    cout<<"@@@@@ "<<fEventNumber<<" events processed"<<endl;
+    delete [] vQarray;
   }
 }
 
index 4fffb20..e0728ec 100644 (file)
@@ -40,11 +40,13 @@ class AliFlowAnalysisWithScalarProduct {
    void    WriteHistograms(TString* outputFileName);     //writes histograms locally
    void    WriteHistograms(TString outputFileName);      //writes histograms locally
 
-   void      SetDebug(Bool_t kt)   { this->fDebug = kt ; }
-   Bool_t    GetDebug() const      { return this->fDebug ; }
+   void    SetSubEventEtaRange(Double_t min, Double_t max) {this->fEtaMin = min; this->fEtaMax = max; };
+
+   void    SetDebug(Bool_t kt)   { this->fDebug = kt ; }
+   Bool_t  GetDebug() const      { return this->fDebug ; }
 
    // Output 
-   TList*   GetHistList() const    { return this->fHistList ; }     // Gets output histogram list
+   TList*    GetHistList() const    { return this->fHistList ; }     // Gets output histogram list
   
    TProfile* GetHistProUQetaRP() const {return this->fHistProUQetaRP;}   
    void      SetHistProUQetaRP(TProfile* const aHistProUQetaRP) {this->fHistProUQetaRP = aHistProUQetaRP;}
@@ -71,6 +73,8 @@ class AliFlowAnalysisWithScalarProduct {
    AliFlowAnalysisWithScalarProduct& operator=(const AliFlowAnalysisWithScalarProduct& anAnalysis); //assignment operator 
       
    Int_t      fEventNumber;      // event counter
+   Double_t   fEtaMin;           // eta range
+   Double_t   fEtaMax;           // eta range
    Bool_t     fDebug ;           // flag for analysis: more print statements
 
    TList*     fHistList;         //list to hold all output histograms  
index 9f9e86e..1d712d1 100644 (file)
@@ -223,16 +223,13 @@ AliFlowVector AliFlowEventSimple::GetQ(Int_t n, TList *weightsList, Bool_t usePh
 }
 
 //-----------------------------------------------------------------------   
-AliFlowVector AliFlowEventSimple::GetQsub(Double_t etaMin, Double_t etaMax, Int_t n, TList *weightsList, Bool_t usePhiWeights, Bool_t usePtWeights, Bool_t useEtaWeights) 
+void AliFlowEventSimple::GetQsub(AliFlowVector* Qarray, Int_t n, TList *weightsList, Bool_t usePhiWeights, Bool_t usePtWeights, Bool_t useEtaWeights) 
 {
-  //for eta subevents
   
   // calculate Q-vector in harmonic n without weights (default harmonic n=2)  
   Double_t dQX = 0.;
   Double_t dQY = 0.;
-  AliFlowVector vQ;
-  vQ.Set(0.,0.);
-  
+    
   Int_t iOrder = n;
   Double_t iUsedTracks = 0;
   Double_t dPhi = 0.;
@@ -282,51 +279,59 @@ AliFlowVector AliFlowEventSimple::GetQsub(Double_t etaMin, Double_t etaMax, Int_
    }          
   } // end of if(weightsList)
   
-  // loop over tracks    
-  for(Int_t i=0;i<fNumberOfTracks;i++)                               
-  {
-   pTrack = (AliFlowTrackSimple*)TrackCollection()->At(i); 
-   if(pTrack)
-   {
-    if(pTrack->InRPSelection())
+  //loop over the two subevents
+  for (Int_t s=0;s<2;s++)  
     {
-     dPhi = pTrack->Phi();
-     dPt  = pTrack->Pt();
-     dEta = pTrack->Eta();
-     if (dEta>etaMin && dEta<etaMax) {
-       // determine Phi weight: (to be improved, I should here only access it + the treatment of gaps in the if statement)
-       if(phiWeights && nBinsPhi)
-        {
-          wPhi = phiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhi/TMath::TwoPi())));
-        }
-       // determine v'(pt) weight:    
-       if(ptWeights && dBinWidthPt)
-        {
-          wPt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt))); 
-        }            
-       // determine v'(eta) weight:    
-       if(etaWeights && dBinWidthEta)
-        {
-          wEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta))); 
-        } 
-
-       // building up the weighted Q-vector:       
-       dQX += wPhi*wPt*wEta*TMath::Cos(iOrder*dPhi);
-       dQY += wPhi*wPt*wEta*TMath::Sin(iOrder*dPhi); 
-    
-       // weighted multiplicity:
-       iUsedTracks+=wPhi*wPt*wEta;
-           
-     } // end of if dEta in eta range
-    } // end of if (pTrack->InRPSelection())
-   } // end of if (pTrack)
-   else {cerr << "no particle!!!"<<endl;}
-  } // loop over particles
-    
-  vQ.Set(dQX,dQY);
-  vQ.SetMult(iUsedTracks);
+      // loop over tracks    
+      for(Int_t i=0;i<fNumberOfTracks;i++)                               
+       {
+         pTrack = (AliFlowTrackSimple*)TrackCollection()->At(i); 
+         if(pTrack)
+           {
+             if(pTrack->InRPSelection())
+               {
+                 if (pTrack->InSubevent(s)) {
+                   dPhi = pTrack->Phi();
+                   dPt  = pTrack->Pt();
+                   dEta = pTrack->Eta();
+                 
+                   // determine Phi weight: (to be improved, I should here only access it + the treatment of gaps in the if statement)
+                   if(phiWeights && nBinsPhi)
+                     {
+                       wPhi = phiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhi/TMath::TwoPi())));
+                     }
+                   // determine v'(pt) weight:    
+                   if(ptWeights && dBinWidthPt)
+                     {
+                       wPt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt))); 
+                     }            
+                   // determine v'(eta) weight:    
+                   if(etaWeights && dBinWidthEta)
+                     {
+                       wEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta))); 
+                     } 
+                   
+                   // building up the weighted Q-vector:       
+                   dQX += wPhi*wPt*wEta*TMath::Cos(iOrder*dPhi);
+                   dQY += wPhi*wPt*wEta*TMath::Sin(iOrder*dPhi); 
+                   
+                   // weighted multiplicity:
+                   iUsedTracks+=wPhi*wPt*wEta;
+                                   
+                 } // end of subevent 
+               } // end of if (pTrack->InRPSelection())
+           } // end of if (pTrack)
+         else {cerr << "no particle!!!"<<endl;}
+       } // loop over particles
+      Qarray[s].Set(dQX,dQY);
+      Qarray[s].SetMult(iUsedTracks);
+      //reset
+      iUsedTracks = 0;
+      dQX = 0.;
+      dQY = 0.;
+    }
   
-  return vQ;
+  //return vQ;
   
 }
 
index cdd5649..78b3cf3 100644 (file)
@@ -48,8 +48,7 @@ class AliFlowEventSimple: public TObject {
   TObjArray* TrackCollection() const        { return this->fTrackCollection; }
  
   AliFlowVector GetQ(Int_t n=2, TList *weightsList=NULL, Bool_t usePhiWeights=kFALSE, Bool_t usePtWeights=kFALSE, Bool_t useEtaWeights=kFALSE);
-  AliFlowVector GetQsub(Double_t etaMin=-0.9, Double_t etaMax=0.9, Int_t n=2, TList *weightsList=NULL, Bool_t usePhiWeights=kFALSE, Bool_t usePtWeights=kFALSE, Bool_t useEtaWeights=kFALSE);  //for eta subevents
-  //add here more subevent options   
+  void GetQsub(AliFlowVector* Qarray, Int_t n=2, TList *weightsList=NULL, Bool_t usePhiWeights=kFALSE, Bool_t usePtWeights=kFALSE, Bool_t useEtaWeights=kFALSE);  
 
  private:
   TObjArray*              fTrackCollection;        // collection of tracks
index bacbb9e..1459f6b 100644 (file)
@@ -30,18 +30,21 @@ class AliFlowTrackSimple: public TObject {
   TBits    GetFlowBits() const;
   Bool_t   InRPSelection() const; 
   Bool_t   InPOISelection() const; 
-    
+  Bool_t   InSubevent(Int_t i) const; 
+      
   void SetEta(Double_t eta);
   void SetPt(Double_t pt); 
   void SetPhi(Double_t phi);
   void SetForRPSelection(Bool_t b); 
   void SetForPOISelection(Bool_t b); 
-  
+  void SetForSubevent(Int_t i); 
+    
  private:
   Double_t fEta;    // eta
   Double_t fPt;     // pt
   Double_t fPhi;    // phi
   TBits fFlowBits;  // bits to set if track is selected
+  TBits fSubEventBits;  // bits to set if track is selected for a subevent
   
 
   ClassDef(AliFlowTrackSimple,1)                 // macro for rootcint
@@ -55,12 +58,15 @@ inline Double_t AliFlowTrackSimple::Pt() const {
   return this->fPt;}
 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 { 
   return this->fFlowBits.TestBitNumber(1); }
+inline Bool_t AliFlowTrackSimple::InSubevent(Int_t i) const { 
+  return this->fSubEventBits.TestBitNumber(i); }
 
 inline void AliFlowTrackSimple::SetEta(Double_t val) {
   fEta = val; }
@@ -69,9 +75,13 @@ inline void AliFlowTrackSimple::SetPt(Double_t val) {
   //  cout << "pt set to:" << fPt << endl;}
 inline void AliFlowTrackSimple::SetPhi(Double_t val) {
   fPhi = val; }
+//TBits
 inline void AliFlowTrackSimple::SetForRPSelection(Bool_t val) {
   fFlowBits.SetBitNumber(0,val); }
 inline void AliFlowTrackSimple::SetForPOISelection(Bool_t val) {
   fFlowBits.SetBitNumber(1,val); }
+inline void AliFlowTrackSimple::SetForSubevent(Int_t i) {
+  fSubEventBits.SetBitNumber(i,kTRUE); }
+
 #endif
 
index b4c426c..15b950a 100644 (file)
@@ -50,7 +50,11 @@ AliFlowEventSimpleMaker::AliFlowEventSimpleMaker() :
   fEllipticFlowValue(0.),
   fMultiplicityOfEvent(1000000000),
   fMinMult(0),
-  fMaxMult(1000000000)
+  fMaxMult(1000000000),
+  fEtaMinA(-1.0),
+  fEtaMaxA(-0.01),
+  fEtaMinB(0.01),
+  fEtaMaxB(1.0)
 {
   //constructor
 }
@@ -191,19 +195,29 @@ AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, Al
        AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
        pTrack->SetPt(pParticle->Pt() );
        pTrack->SetEta(pParticle->Eta() );
-       pTrack->SetPhi(pParticle->Phi() );
-       
+       if (fEllipticFlowValue!=0.) 
+         { pTrack->SetPhi(pParticle->Phi()-fEllipticFlowValue*TMath::Sin(2*(pParticle->Phi()-fMCReactionPlaneAngle))); cout<<"Added flow to particle"<<endl; }
+       else { pTrack->SetPhi(pParticle->Phi() ); }     
+
        //marking the particles used for int. flow:
        if(bPassedRPFlowCuts) {  
          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);
+         }
+
        }
        //marking the particles used for diff. flow:
        if(bPassedPOIFlowCuts) {
          pTrack->SetForPOISelection(kTRUE);
          iSelParticlesPOI++;
        }
-       //adding a particles which were used either for int. or diff. flow to the list
+       //adding particles which were used either for int. or diff. flow to the list
        pEvent->TrackCollection()->Add(pTrack);
        iGoodTracks++;
       }//end of if(bPassedIntFlowCuts || bPassedDiffFlowCuts) 
index 56bf7c8..bc78cab 100644 (file)
@@ -63,6 +63,9 @@ class AliFlowEventSimpleMaker {
   void  SetMaxMult(Int_t multmax) {this->fMaxMult = multmax; }
   Int_t GetMaxMult() const        {return this->fMaxMult; }
 
+  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:
   AliFlowEventSimpleMaker(const AliFlowEventSimpleMaker& anAnalysis);            //copy constructor
   AliFlowEventSimpleMaker& operator=(const AliFlowEventSimpleMaker& anAnalysis); //assignment operator
@@ -77,7 +80,11 @@ class AliFlowEventSimpleMaker {
   Int_t     fMinMult;              // Minimum multiplicity from tracks selected using CORRFW
   Int_t     fMaxMult;              // Maximum multiplicity from tracks selected using CORRFW
 
-     
+  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(AliFlowEventSimpleMaker,0)    // macro for rootcint
 };
  
index a58611d..0cdc486 100644 (file)
@@ -1912,11 +1912,11 @@ void LoadSpreadLibraries(const libModes mode) {
   //--------------------------------------
   // Load the needed libraries most of them already loaded by aliroot
   //--------------------------------------
-  gSystem->Load("libTree.so");
-  gSystem->Load("libGeom.so");
-  gSystem->Load("libVMC.so");
-  gSystem->Load("libXMLIO.so");
-  gSystem->Load("libPhysics.so");
+  gSystem->Load("libTree");
+  gSystem->Load("libGeom");
+  gSystem->Load("libVMC");
+  gSystem->Load("libXMLIO");
+  gSystem->Load("libPhysics");
   
   //----------------------------------------------------------
   // >>>>>>>>>>> Local mode <<<<<<<<<<<<<< 
@@ -1930,13 +1930,13 @@ void LoadSpreadLibraries(const libModes mode) {
   //==================================================================================  
   //load needed libraries:
   gSystem->AddIncludePath("-I$ROOTSYS/include");
-  gSystem->Load("libTree.so");
+  gSystem->Load("libTree");
 
   // for AliRoot
   gSystem->AddIncludePath("-I$ALICE_ROOT/include");
-  gSystem->Load("libANALYSIS.so");
-  gSystem->Load("libPWG2flowCommon.so");
-  cerr<<"libPWG2flowCommon.so loaded ..."<<endl;
+  gSystem->Load("libANALYSIS");
+  gSystem->Load("libPWG2flowCommon");
+  cerr<<"libPWG2flowCommon loaded ..."<<endl;
   
   }