allow to reuse tracks
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 23 Feb 2012 14:31:26 +0000 (14:31 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 23 Feb 2012 14:31:26 +0000 (14:31 +0000)
12 files changed:
PWG/FLOW/Base/AliFlowCommonConstants.cxx
PWG/FLOW/Base/AliFlowCommonConstants.h
PWG/FLOW/Base/AliFlowCommonHist.cxx
PWG/FLOW/Base/AliFlowCommonHist.h
PWG/FLOW/Tasks/AliAnalysisTaskFlowEvent.cxx
PWG/FLOW/Tasks/AliAnalysisTaskFlowEvent.h
PWG/FLOW/Tasks/AliFlowCandidateTrack.cxx
PWG/FLOW/Tasks/AliFlowCandidateTrack.h
PWG/FLOW/Tasks/AliFlowEvent.cxx
PWG/FLOW/Tasks/AliFlowEvent.h
PWG/PROOF-INF.PWGflowBase/SETUP.C
PWG/PROOF-INF.PWGflowTasks/SETUP.C

index f4087f6..c51c6a3 100644 (file)
@@ -41,6 +41,7 @@ AliFlowCommonConstants::AliFlowCommonConstants():
   fNbinsPhi(72),
   fNbinsEta(200),
   fNbinsQ(500),
+  fNbinsMass(1),
   fMultMin(0.),            
   fMultMax(10000.),
   fPtMin(0.),       
@@ -51,6 +52,8 @@ AliFlowCommonConstants::AliFlowCommonConstants():
   fEtaMax(5.),      
   fQMin(0.),        
   fQMax(3.),
+  fMassMin(-1.),
+  fMassMax(0.),
   fHistWeightvsPhiMin(0.),
   fHistWeightvsPhiMax(3.)
 {
index 3d77fde..b8e967d 100644 (file)
@@ -27,6 +27,7 @@ class AliFlowCommonConstants: public TNamed {
   Int_t GetNbinsPhi()  const { return fNbinsPhi; }
   Int_t GetNbinsEta()  const { return fNbinsEta; }
   Int_t GetNbinsQ()    const { return fNbinsQ; }
+  Int_t GetNbinsMass() const { return fNbinsMass; }
    
   Double_t GetMultMin() const { return fMultMin; }
   Double_t GetMultMax() const { return fMultMax; }
@@ -38,6 +39,8 @@ class AliFlowCommonConstants: public TNamed {
   Double_t GetEtaMax()  const { return fEtaMax; }
   Double_t GetQMin()    const { return fQMin; }
   Double_t GetQMax()    const { return fQMax; }
+  Double_t GetMassMin()    const { return fMassMin; }
+  Double_t GetMassMax()    const { return fMassMax; }
   Double_t GetHistWeightvsPhiMax() const {return fHistWeightvsPhiMax;}
   Double_t GetHistWeightvsPhiMin() const {return fHistWeightvsPhiMin;}
   
@@ -46,6 +49,7 @@ class AliFlowCommonConstants: public TNamed {
   void SetNbinsPhi( Int_t i )  { fNbinsPhi = i; }
   void SetNbinsEta( Int_t i )  { fNbinsEta = i; }
   void SetNbinsQ( Int_t i )    { fNbinsQ = i; }
+  void SetNbinsMass( Int_t i ) { fNbinsMass = i; }
    
   void SetMultMin( Double_t i ) { fMultMin = i; }
   void SetMultMax( Double_t i ) { fMultMax = i; }
@@ -57,6 +61,8 @@ class AliFlowCommonConstants: public TNamed {
   void SetEtaMax( Double_t i )  { fEtaMax = i; }
   void SetQMin( Double_t i )    { fQMin = i; }
   void SetQMax( Double_t i )    { fQMax = i; }
+  void SetMassMin( Double_t i )    { fMassMin = i; }
+  void SetMassMax( Double_t i )    { fMassMax = i; }
   void SetHistWeightvsPhiMax( Double_t d ) {fHistWeightvsPhiMax=d;}
   void SetHistWeightvsPhiMin( Double_t d ) {fHistWeightvsPhiMin=d;}
   
@@ -70,6 +76,7 @@ class AliFlowCommonConstants: public TNamed {
   Int_t  fNbinsPhi;  // histogram size
   Int_t  fNbinsEta;  // histogram size
   Int_t  fNbinsQ;    // histogram size
+  Int_t  fNbinsMass; // histogram size
  
   // Histograms limits
   Double_t  fMultMin;  // histogram limit 
@@ -82,12 +89,14 @@ class AliFlowCommonConstants: public TNamed {
   Double_t  fEtaMax;    // histogram limit
   Double_t  fQMin;        // histogram limit
   Double_t  fQMax;     // histogram limit
+  Double_t  fMassMin;  // histogram limit 
+  Double_t  fMassMax;  // histogram limit
   Double_t  fHistWeightvsPhiMin; // histogram limit
   Double_t  fHistWeightvsPhiMax; // histogram limit
  
   static AliFlowCommonConstants* fgPMasterConfig; //master object
   
-  ClassDef(AliFlowCommonConstants,1) //ClassDef
+  ClassDef(AliFlowCommonConstants,2) //ClassDef
 };
 
 #endif
index 79a2ce5..f7b558c 100644 (file)
@@ -70,6 +70,7 @@ AliFlowCommonHist::AliFlowCommonHist():
   fHarmonic(NULL),
   fRefMultVsNoOfRPs(NULL),
   fHistRefMult(NULL),
+  fHistMassPOI(NULL),
   fHistList(NULL)
 {
   
@@ -106,6 +107,7 @@ AliFlowCommonHist::AliFlowCommonHist(const AliFlowCommonHist& a):
   fHarmonic(new TProfile(*a.fHarmonic)),
   fRefMultVsNoOfRPs(new TProfile(*a.fRefMultVsNoOfRPs)),
   fHistRefMult(new TH1F(*a.fHistRefMult)),  
+  fHistMassPOI(new TH2F(*a.fHistMassPOI)),  
   fHistList(NULL)
 {
   // copy constructor
@@ -133,6 +135,7 @@ AliFlowCommonHist::AliFlowCommonHist(const AliFlowCommonHist& a):
   fHistList-> Add(fHarmonic);  
   fHistList-> Add(fRefMultVsNoOfRPs);
   fHistList-> Add(fHistRefMult); 
+  fHistList-> Add(fHistMassPOI); 
   if(!fBookOnlyBasic){fHistList-> Add(fHistQ);} 
   if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQ);}
   if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQSub0);}
@@ -173,6 +176,7 @@ AliFlowCommonHist::AliFlowCommonHist(const AliFlowCommonHist& a):
     fHarmonic(NULL),
     fRefMultVsNoOfRPs(NULL),
     fHistRefMult(NULL),
+    fHistMassPOI(NULL),
     fHistList(NULL)
 {
 
@@ -182,6 +186,7 @@ AliFlowCommonHist::AliFlowCommonHist(const AliFlowCommonHist& a):
   Int_t iNbinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
   Int_t iNbinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
   Int_t iNbinsQ = AliFlowCommonConstants::GetMaster()->GetNbinsQ();
+  Int_t iNbinsMass = AliFlowCommonConstants::GetMaster()->GetNbinsMass();
   TString sName;
 
   Double_t  dMultMin = AliFlowCommonConstants::GetMaster()->GetMultMin();            
@@ -196,6 +201,9 @@ AliFlowCommonHist::AliFlowCommonHist(const AliFlowCommonHist& a):
   Double_t  dQMax = AliFlowCommonConstants::GetMaster()->GetQMax();    
   Double_t  dHistWeightvsPhiMin = AliFlowCommonConstants::GetMaster()->GetHistWeightvsPhiMin();
   Double_t  dHistWeightvsPhiMax = AliFlowCommonConstants::GetMaster()->GetHistWeightvsPhiMax();
+  Double_t  dMassMin = AliFlowCommonConstants::GetMaster()->GetMassMin();
+  Double_t  dMassMax = AliFlowCommonConstants::GetMaster()->GetMassMax();
+
   
   cout<<"The settings for the common histograms are as follows:"<<endl;
   cout<<"Multiplicity: "<<iNbinsMult<<" bins between "<<dMultMin<<" and "<<dMultMax<<endl;
@@ -203,6 +211,7 @@ AliFlowCommonHist::AliFlowCommonHist(const AliFlowCommonHist& a):
   cout<<"Phi: "<<iNbinsPhi<<" bins between "<<dPhiMin<<" and "<<dPhiMax<<endl;
   cout<<"Eta: "<<iNbinsEta<<" bins between "<<dEtaMin<<" and "<<dEtaMax<<endl;
   cout<<"Q: "<<iNbinsQ<<" bins between "<<dQMin<<" and "<<dQMax<<endl;
+  cout<<"Mass: "<<iNbinsMass<<" bins between "<<dMassMin<<" and "<<dMassMax<<endl;
 
   //Multiplicity
   sName = "Control_Flow_MultRP_";
@@ -401,6 +410,16 @@ AliFlowCommonHist::AliFlowCommonHist(const AliFlowCommonHist& a):
   fHistRefMult->SetXTitle("Reference multiplicity");
   fHistRefMult->SetYTitle("Counts");
 
+  //mass for POI selection
+  sName = "Control_Flow_Mass_POI";
+  sName +=anInput;
+  fHistMassPOI = new TH2F(sName.Data(), sName.Data(), iNbinsMass, dMassMin, dMassMax,
+                         iNbinsPt, dPtMin, dPtMax);
+  double mbWidth = (dMassMax-dMassMin)/iNbinsMass*1000.;
+  fHistMassPOI->SetXTitle("Mass (GeV/c^{2})");
+  fHistMassPOI->SetYTitle("P_{t} (GeV/c)");
+  fHistMassPOI->SetZTitle( Form("Counts/(%.2f MeV/c^{2})",mbWidth) );
+
   //list of histograms if added here also add in copy constructor
   fHistList = new TList();
   fHistList-> Add(fHistMultRP);        
@@ -425,6 +444,7 @@ AliFlowCommonHist::AliFlowCommonHist(const AliFlowCommonHist& a):
   fHistList-> Add(fHarmonic); 
   fHistList-> Add(fRefMultVsNoOfRPs); 
   fHistList-> Add(fHistRefMult);   
+  fHistList-> Add(fHistMassPOI);   
   if(!fBookOnlyBasic){fHistList-> Add(fHistQ);}           
   if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQ);}
   if(!fBookOnlyBasic){fHistList-> Add(fHistAngleQSub0);}
@@ -464,6 +484,7 @@ AliFlowCommonHist::~AliFlowCommonHist()
   delete fHarmonic;
   delete fRefMultVsNoOfRPs;
   delete fHistRefMult;  
+  delete fHistMassPOI;  
   delete fHistList;
 }
 
@@ -664,6 +685,8 @@ Bool_t AliFlowCommonHist::FillControlHistograms(AliFlowEventSimple* anEvent,TLis
        if(!fBookOnlyBasic){fHistPhiEtaPOI ->Fill(dEta,dPhi,dW);}
        //mean pt
        fHistProMeanPtperBin ->Fill(dPt,dPt,dW);
+       //mass
+       fHistMassPOI->Fill(pTrack->Mass(),dPt,dW);
        //count
        dMultPOI += dW;
       }
index 7b25dd6..d0c4c08 100644 (file)
@@ -73,6 +73,7 @@ class AliFlowCommonHist: public TNamed {
   TProfile* GetHarmonic()            {return fHarmonic; } ; 
   TProfile* GetRefMultVsNoOfRPs()    {return fRefMultVsNoOfRPs; } ;
   TH1F*     GetHistRefMult()         {return fHistRefMult; } ; 
+  TH2F*     GetHistMassPOI()         {return fHistMassPOI; }
   TList*    GetHistList()            {return fHistList;} ;  
 
    
@@ -109,10 +110,11 @@ class AliFlowCommonHist: public TNamed {
   TProfile* fHarmonic;            // harmonic 
   TProfile* fRefMultVsNoOfRPs;    // <reference multiplicity> versus # of RPs
   TH1F*     fHistRefMult;         // reference multiplicity distribution
+  TH2F*     fHistMassPOI;         // mass distribution for POI selection
   
   TList*    fHistList;            // list to hold all histograms  
 
-  ClassDef(AliFlowCommonHist,3)   // macro for rootcint
+  ClassDef(AliFlowCommonHist,4)   // macro for rootcint
 };
 #endif
 
index 6d4a9f2..2693120 100644 (file)
@@ -101,6 +101,7 @@ AliAnalysisTaskFlowEvent::AliAnalysisTaskFlowEvent() :
   fNbinsPhi(100),
   fNbinsEta(200),
   fNbinsQ(500),
+  fNbinsMass(1),
   fMultMin(0.),            
   fMultMax(10000.),
   fPtMin(0.),       
@@ -111,6 +112,8 @@ AliAnalysisTaskFlowEvent::AliAnalysisTaskFlowEvent() :
   fEtaMax(5.),      
   fQMin(0.),        
   fQMax(3.),
+  fMassMin(-1.),            
+  fMassMax(0.),
   fHistWeightvsPhiMin(0.),
   fHistWeightvsPhiMax(3.),
   fExcludedEtaMin(0.), 
@@ -157,6 +160,7 @@ AliAnalysisTaskFlowEvent::AliAnalysisTaskFlowEvent(const char *name, TString RPt
   fNbinsPhi(100),
   fNbinsEta(200),
   fNbinsQ(500),
+  fNbinsMass(1),
   fMultMin(0.),            
   fMultMax(10000.),
   fPtMin(0.),       
@@ -167,6 +171,8 @@ AliAnalysisTaskFlowEvent::AliAnalysisTaskFlowEvent(const char *name, TString RPt
   fEtaMax(5.),      
   fQMin(0.),        
   fQMax(3.),
+  fMassMin(-1.),            
+  fMassMax(0.),
   fHistWeightvsPhiMin(0.),
   fHistWeightvsPhiMax(3.),
   fExcludedEtaMin(0.), 
@@ -253,6 +259,7 @@ void AliAnalysisTaskFlowEvent::UserCreateOutputObjects()
   cc->SetNbinsPhi(fNbinsPhi); 
   cc->SetNbinsEta(fNbinsEta);
   cc->SetNbinsQ(fNbinsQ);
+  cc->SetNbinsMass(fNbinsMass);
   cc->SetMultMin(fMultMin);
   cc->SetMultMax(fMultMax);
   cc->SetPtMin(fPtMin);
@@ -263,6 +270,8 @@ void AliAnalysisTaskFlowEvent::UserCreateOutputObjects()
   cc->SetEtaMax(fEtaMax);
   cc->SetQMin(fQMin);
   cc->SetQMax(fQMax);
+  cc->SetMassMin(fMassMin);
+  cc->SetMassMax(fMassMax);
   cc->SetHistWeightvsPhiMax(fHistWeightvsPhiMax);
   cc->SetHistWeightvsPhiMin(fHistWeightvsPhiMin);
 
@@ -471,15 +480,13 @@ void AliAnalysisTaskFlowEvent::UserExec(Option_t *)
   if(fLoadCandidates) {
     TObjArray* candidates = dynamic_cast<TObjArray*>(GetInputData(availableINslot++));
     //if(candidates->GetEntriesFast()) 
-      //printf("I received %d candidates\n",candidates->GetEntriesFast());
+    //  printf("I received %d candidates\n",candidates->GetEntriesFast());
     if (candidates)
     {
       for(int iCand=0; iCand!=candidates->GetEntriesFast(); ++iCand ) {
         AliFlowCandidateTrack *cand = dynamic_cast<AliFlowCandidateTrack*>(candidates->At(iCand));
         if (!cand) continue;
-        cand->SetForPOISelection(kTRUE);
-        cand->SetForRPSelection(kFALSE);
-        //printf(" Ⱶ Checking at candidate %d with %d daughters\n",iCand,cand->GetNDaughters());
+        //printf(" Ⱶ Checking at candidate %d with %d daughters: mass %f\n",iCand,cand->GetNDaughters(),cand->Mass());
         for(int iDau=0; iDau!=cand->GetNDaughters(); ++iDau) {
           //printf("    Ⱶ Daughter %d with fID %d", iDau, cand->GetIDDaughter(iDau) );
           for(int iRPs=0; iRPs!=fFlowEvent->NumberOfTracks(); ++iRPs ) {
@@ -489,14 +496,16 @@ void AliAnalysisTaskFlowEvent::UserExec(Option_t *)
               continue;
             if( cand->GetIDDaughter(iDau) == iRP->GetID() ) {
               //printf(" was in RP set");
-              cand->SetDaughter( iDau, iRP );
+              //cand->SetDaughter( iDau, iRP );
               //temporarily untagging all daugters
               iRP->SetForRPSelection(kFALSE);
+             fFlowEvent->SetNumberOfRPs( fFlowEvent->GetNumberOfRPs() -1 );
             }
           }
           //printf("\n");
         }
-        fFlowEvent->AddTrack(cand);
+       cand->SetForPOISelection(kTRUE);
+       fFlowEvent->InsertTrack( ((AliFlowTrack*) cand) );
       }
     }
   }
index ef7c96a..d8526ef 100644 (file)
@@ -78,6 +78,7 @@ class AliAnalysisTaskFlowEvent : public AliAnalysisTaskSE {
   void SetNbinsPhi( Int_t i )  { fNbinsPhi = i; }
   void SetNbinsEta( Int_t i )  { fNbinsEta = i; }
   void SetNbinsQ( Int_t i )    { fNbinsQ = i; }
+  void SetNbinsMass( Int_t i ) { fNbinsMass = i; }
    
   void SetMultMin( Double_t i ) { fMultMin = i; }
   void SetMultMax( Double_t i ) { fMultMax = i; }
@@ -89,6 +90,8 @@ class AliAnalysisTaskFlowEvent : public AliAnalysisTaskSE {
   void SetEtaMax( Double_t i )  { fEtaMax = i; }
   void SetQMin( Double_t i )    { fQMin = i; }
   void SetQMax( Double_t i )    { fQMax = i; }
+  void SetMassMin( Double_t i ) { fMassMin = i; }
+  void SetMassMax( Double_t i ) { fMassMax = i; }
   void SetHistWeightvsPhiMin( Double_t i ) {fHistWeightvsPhiMin=i;}
   void SetHistWeightvsPhiMax( Double_t i ) {fHistWeightvsPhiMax=i;}
   // end setters common constants
@@ -134,6 +137,7 @@ class AliAnalysisTaskFlowEvent : public AliAnalysisTaskSE {
   Int_t  fNbinsPhi;  // histogram size
   Int_t  fNbinsEta;  // histogram size
   Int_t  fNbinsQ;    // histogram size
+  Int_t  fNbinsMass; // histogram size
  
   // Histograms limits
   Double_t  fMultMin;  // histogram limit 
@@ -146,6 +150,8 @@ class AliAnalysisTaskFlowEvent : public AliAnalysisTaskSE {
   Double_t  fEtaMax;   // histogram limit
   Double_t  fQMin;     // histogram limit
   Double_t  fQMax;     // histogram limit
+  Double_t  fMassMin;  // histogram limit
+  Double_t  fMassMax;  // histogram limit
   Double_t fHistWeightvsPhiMin; //histogram limit
   Double_t fHistWeightvsPhiMax; //histogram limit
   // end common constants
index 25c4cc2..4f797cc 100644 (file)
@@ -34,6 +34,16 @@ AliFlowCandidateTrack::AliFlowCandidateTrack():
   }
 }
 
+void AliFlowCandidateTrack::ClearMe(void) {
+  AliFlowTrackSimple::Clear();
+  fNDaughters = 0;
+  for(int i=0; i!=5; ++i) {
+    fDaughter[i] = -1;
+    fTrack[i] = NULL;
+  }
+  return;
+}
+
 AliFlowCandidateTrack::AliFlowCandidateTrack(const AliFlowCandidateTrack& aTrack):
   AliFlowTrack(aTrack),
   fNDaughters(aTrack.fNDaughters)
index 09f6dd6..f4bfd20 100644 (file)
@@ -20,6 +20,7 @@ class AliFlowCandidateTrack : public AliFlowTrack {
     AliFlowCandidateTrack& operator=(const AliFlowCandidateTrack& );
     ~AliFlowCandidateTrack();
 
+    void ClearMe(void);
     Int_t GetNDaughters(void)        const { return fNDaughters; }
     void  AddDaughter(Int_t value)  { if(fNDaughters<3) fDaughter[fNDaughters++]=value; }
     Int_t GetIDDaughter(Int_t value) const { return fDaughter[value]; }
index e1bba7a..5ac7f3a 100644 (file)
@@ -673,6 +673,23 @@ void AliFlowEvent::Fill( AliFlowTrackCuts* rpCuts,
     }
   }
 }
+//-----------------------------------------------------------------------
+void AliFlowEvent::InsertTrack(AliFlowTrack *thisTrack) {
+  // adds a flow track at the end of the container
+  AliFlowTrack *pTrack = ReuseTrack( fNumberOfTracks++ );
+  pTrack->SetPt( thisTrack->Pt() );
+  pTrack->SetPhi( thisTrack->Phi() );
+  pTrack->SetEta( thisTrack->Eta() );
+  pTrack->SetWeight( thisTrack->Weight() );
+  pTrack->SetCharge( thisTrack->Charge() );
+  pTrack->SetMass( thisTrack->Mass() );
+  pTrack->SetForRPSelection( thisTrack->InRPSelection() );
+  pTrack->SetForPOISelection( thisTrack->InPOISelection() );
+  if(thisTrack->InSubevent(0)) pTrack->SetForSubevent(0);
+  if(thisTrack->InSubevent(1)) pTrack->SetForSubevent(1);
+  pTrack->SetID( thisTrack->GetID() );
+  return;
+}
 
 //-----------------------------------------------------------------------
 AliFlowTrack* AliFlowEvent::ReuseTrack(Int_t i)
index 7571067..4909cfe 100644 (file)
@@ -77,6 +77,8 @@ public:
 
   AliFlowTrack* GetTrack( Int_t i );
 
+  void InsertTrack(AliFlowTrack*);
+
 protected:
   AliFlowTrack* ReuseTrack( Int_t i);
 
index 6061991..cb625e2 100644 (file)
@@ -1,12 +1,14 @@
 void SETUP() {
-
+  // Set the library paths
   TString dypath = gSystem->GetDynamicPath();
-  dypath.Prepend(".:");
+  dypath.Prepend("./PWGflowBase/:");
   gSystem->SetDynamicPath(dypath);
   gSystem->Load("libPWGflowBase");
 
   // Set the include paths
-  gROOT->ProcessLine(".include PWGflowBase/FLOW/Base");
+  TString incpath = gSystem->GetIncludePath();
+  incpath.Prepend("-I./PWGflowBase/FLOW/Base ");
+  gSystem->SetIncludePath(incpath);
 
   // Set our location, so that other packages can find us
   gSystem->Setenv("PWGflowBase_INCLUDE", "PWGflowBase/FLOW/Base");
index abaf5a4..19319a5 100644 (file)
@@ -1,13 +1,15 @@
 void SETUP() {
-
+  // Set the library paths
   TString dypath = gSystem->GetDynamicPath();
-  dypath.Prepend(".:");
+  dypath.Prepend("./PWGflowTasks/:");
   gSystem->SetDynamicPath(dypath);
   gSystem->Load("libPWGflowBase");
   gSystem->Load("libPWGflowTasks");
   
   // Set the include paths
-  gROOT->ProcessLine(".include PWGflowTasks/FLOW/Tasks $(ALICE_ROOT)/TOF");
+  TString incpath = gSystem->GetIncludePath();
+  incpath.Prepend("-I./PWGflowTasks/FLOW/Tasks -I$ALICE_ROOT/TOF ");
+  gSystem->SetIncludePath(incpath);
 
   // Set our location, so that other packages can find us
   gSystem->Setenv("PWGflowTasks_INCLUDE", "PWGflowTasks/FLOW/Tasks");