]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
memory leaks
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 May 2008 10:53:09 +0000 (10:53 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 May 2008 10:53:09 +0000 (10:53 +0000)
PWG2/FLOW/AliFlowAnalysisWithLYZEventPlane.cxx
PWG2/FLOW/AliFlowAnalysisWithLYZEventPlane.h
PWG2/FLOW/AliFlowAnalysisWithMCEventPlane.cxx
PWG2/FLOW/AliFlowAnalysisWithMCEventPlane.h
PWG2/FLOW/AliFlowAnalysisWithScalarProduct.cxx
PWG2/FLOW/AliFlowAnalysisWithScalarProduct.h
PWG2/FLOW/AliFlowCommonHist.cxx
PWG2/FLOW/AliFlowCommonHist.h
PWG2/FLOW/AliFlowEventSimpleMaker.cxx
PWG2/FLOW/AliFlowEventSimpleMaker.h

index 5bf28f702133545d11fd9642d786f40a6b4b214b..15af624b1b97029d12d2908822bfeb8cdac42e8a 100644 (file)
@@ -80,13 +80,13 @@ ClassImp(AliFlowAnalysisWithLYZEventPlane)
    fCommonHists(0),
    fCommonHistsRes(0),
    fEventNumber(0),
-   fQX(0),
-   fQY(0),
+//   fQX(0),
+//   fQY(0),
    fQ2sum(0),
    fQtheta(0),
-   fEvent(0x0),
-   fTrack(0x0),
-   fLYZEP(0x0)
+//   fEvent(0x0),
+   fTrack(NULL),
+   fLYZEP(NULL)
 {
 
   // Constructor.
@@ -186,16 +186,17 @@ void AliFlowAnalysisWithLYZEventPlane::Init() {
  
 //-----------------------------------------------------------------------
  
-void AliFlowAnalysisWithLYZEventPlane::Make(AliFlowEventSimple* fEvent, AliFlowLYZEventPlane* fLYZEP) {
+void AliFlowAnalysisWithLYZEventPlane::Make(AliFlowEventSimple* anEvent, AliFlowLYZEventPlane* fLYZEP) {
+  //void AliFlowAnalysisWithLYZEventPlane::Make(AliFlowEventSimple* anEvent) {
 
   //Get the event plane and weight for each event
-  if (fEvent) {
+  if (anEvent) {
          
     //fill control histograms     
-    fCommonHists->FillControlHistograms(fEvent);
+    fCommonHists->FillControlHistograms(anEvent);
 
     //get the Q vector from the FlowEvent
-    fQ = fEvent->GetQ(); 
+    fQ = anEvent->GetQ(); 
     //Weight with the multiplicity
     Double_t fQX = 0.;
     Double_t fQY = 0.;
@@ -243,10 +244,10 @@ void AliFlowAnalysisWithLYZEventPlane::Make(AliFlowEventSimple* fEvent, AliFlowL
        
     //calculate flow
     //loop over the tracks of the event
-    Int_t fNumberOfTracks = fEvent->NumberOfTracks(); 
+    Int_t fNumberOfTracks = anEvent->NumberOfTracks(); 
     for (Int_t i=0;i<fNumberOfTracks;i++) 
       {
-       fTrack = fEvent->GetTrack(i) ; 
+       fTrack = anEvent->GetTrack(i) ; 
        if (fTrack){
          if (fTrack->UseForDifferentialFlow()) {
            Double_t fPhi = fTrack->Phi();
index 012029c0f19f5f134412874560b7a0ba240d4961..e36f1ee6fa6e9666809ce35c209687490ece4d40 100644 (file)
@@ -30,6 +30,7 @@ class AliFlowAnalysisWithLYZEventPlane {
   
   virtual void   Init();
   virtual void   Make(AliFlowEventSimple* fEvent, AliFlowLYZEventPlane* fLYZEP);
+  //  virtual void   Make(AliFlowEventSimple* anEvent);
   virtual void   Finish();
 
   // input files
@@ -58,8 +59,8 @@ class AliFlowAnalysisWithLYZEventPlane {
 
  private:
 
-  //AliFlowAnalysisWithLYZEventPlane(const AliFlowAnalysisWithLYZEventPlane& lyz) {}    // AliFlowAnalysisWithLYZEventPlane object cannot be copied
-  //void operator=(const AliFlowAnalysisWithLYZEventPlane &lyz) {}   
+  //  AliFlowAnalysisWithLYZEventPlane(const AliFlowAnalysisWithLYZEventPlane& lyz);    // AliFlowAnalysisWithLYZEventPlane object cannot be copied
+  //  void operator=(const AliFlowAnalysisWithLYZEventPlane &lyz);   
  
   TFile*             fOutFile;                //! 
   TFile*             fFirstRunFile ;          //! pointer to file from first run
@@ -95,14 +96,14 @@ class AliFlowAnalysisWithLYZEventPlane {
   AliFlowCommonHistResults* fCommonHistsRes;  //!
 
   Int_t     fEventNumber;  // event counter
-  Double_t  fQX;           // local flow vector
-  Double_t  fQY;           // local flow vector
+  //  Double_t  fQX;           // local flow vector
+  //  Double_t  fQY;           // local flow vector
   AliFlowVector  fQ;       // flow vector
   TVector2  fQsum;         // flow vector sum
   Double_t  fQ2sum;        // flow vector sum squared
   Double_t  fQtheta;       // flow vector projected on ref. angle theta
    
-  AliFlowEventSimple*  fEvent ;               //!
+  //  AliFlowEventSimple*  fEvent ;               //!
   AliFlowTrackSimple*  fTrack ;               //!
   AliFlowLYZEventPlane* fLYZEP ;              //!
 
index 47988715fd1e5fdce3f90448f8c86860ac92f45a..db101186879ecdaed553ac5b0933327b18c3d87b 100644 (file)
@@ -46,15 +46,14 @@ ClassImp(AliFlowAnalysisWithMCEventPlane)
    fEventNumber(0),
    fMult(0),
    fNbins(0),
-   fEvent(0x0),
-   fTrack(0x0),
+   fTrack(NULL),
    fDebug(kFALSE),
    fHistFileName(0),
    fHistFile(0),
-   fCommonHists(0),
-   fCommonHistsRes(0),
-   fHistProFlow(0),
-   fHistRP(0)
+   fCommonHists(NULL),
+   fCommonHistsRes(NULL),
+   fHistProFlow(NULL),
+   fHistRP(NULL)
 
 {
 
@@ -105,16 +104,16 @@ void AliFlowAnalysisWithMCEventPlane::Init() {
  
 //-----------------------------------------------------------------------
  
-void AliFlowAnalysisWithMCEventPlane::Make(AliFlowEventSimple* fEvent, Double_t fRP) {
+void AliFlowAnalysisWithMCEventPlane::Make(AliFlowEventSimple* anEvent, Double_t fRP) {
 
   //Calculate v2 from the MC reaction plane
-  if (fEvent) {
+  if (anEvent) {
          
     //fill control histograms     
-    fCommonHists->FillControlHistograms(fEvent);
+    fCommonHists->FillControlHistograms(anEvent);
 
     //get the Q vector from the FlowEvent
-    fQ = fEvent->GetQ(); 
+    fQ = anEvent->GetQ(); 
     //cout<<"fQ.Mod() = " << fQ.Mod() << endl;
     //for chi calculation:
     fQsum += fQ;
@@ -126,10 +125,10 @@ void AliFlowAnalysisWithMCEventPlane::Make(AliFlowEventSimple* fEvent, Double_t
               
     //calculate flow
     //loop over the tracks of the event
-    Int_t fNumberOfTracks = fEvent->NumberOfTracks(); 
+    Int_t fNumberOfTracks = anEvent->NumberOfTracks(); 
     for (Int_t i=0;i<fNumberOfTracks;i++) 
       {
-       fTrack = fEvent->GetTrack(i) ; 
+       fTrack = anEvent->GetTrack(i) ; 
        if (fTrack){
          if (fTrack->UseForDifferentialFlow()) {
            Double_t fPhi = fTrack->Phi();
index e2ee380ba03a2d98ef390cb482c8dc0823c325bf..4c49254d0a5c8ed2d5dd6b3e05ed43020063050a 100644 (file)
@@ -40,7 +40,7 @@ class AliFlowAnalysisWithMCEventPlane {
    virtual  ~AliFlowAnalysisWithMCEventPlane();  //destructor
  
    void    Init();                             //defines variables and histograms
-   void    Make(AliFlowEventSimple* fEvent, Double_t fRP);   //calculates variables and fills histograms
+   void    Make(AliFlowEventSimple* anEvent, Double_t fRP);   //calculates variables and fills histograms
    void    Finish();                           //saves histograms
   
    void      SetDebug(Bool_t kt)                 { this->fDebug = kt ; }
@@ -65,7 +65,6 @@ class AliFlowAnalysisWithMCEventPlane {
    Int_t     fMult;         // multiplicity
    Int_t     fNbins;        // number of bins
       
-   AliFlowEventSimple*   fEvent ;     //!
    AliFlowTrackSimple*   fTrack ;     //!
      
    Bool_t       fDebug ;            //! flag for lyz analysis: more print statements
index 357be5632f40995cfc4a3ccf0a2941c2ca8423f4..c7c68bab18dd573b815268424bae9d6ee3bc841b 100644 (file)
@@ -44,13 +44,12 @@ ClassImp(AliFlowAnalysisWithScalarProduct)
  
  AliFlowAnalysisWithScalarProduct::AliFlowAnalysisWithScalarProduct():
    fEventNumber(0),
-   fEvent(0x0),
-   fTrack(0x0),
+   fTrack(NULL),
    fDebug(kFALSE),
    fHistFileName(0),
-   fHistFile(0),
-   fHistProUQ(0),
-   fCommonHists(0)
+   fHistFile(NULL),
+   fHistProUQ(NULL),
+   fCommonHists(NULL)
 {
 
   // Constructor.
@@ -94,24 +93,24 @@ void AliFlowAnalysisWithScalarProduct::Init() {
  
 //-----------------------------------------------------------------------
  
-void AliFlowAnalysisWithScalarProduct::Make(AliFlowEventSimple* fEvent) {
+void AliFlowAnalysisWithScalarProduct::Make(AliFlowEventSimple* anEvent) {
 
   //Fill histogram
-  if (fEvent) {
+  if (anEvent) {
 
     //fill control histograms     
-    fCommonHists->FillControlHistograms(fEvent);
+    fCommonHists->FillControlHistograms(anEvent);
          
     //get the Q vector from the FlowEvent
-    fQ = fEvent->GetQ();
+    fQ = anEvent->GetQ();
     //Double_t fMult =  fQ.GetMult();
             
     //loop over the tracks of the event
-    Int_t fNumberOfTracks = fEvent->NumberOfTracks(); 
+    Int_t fNumberOfTracks = anEvent->NumberOfTracks(); 
     for (Int_t i=0;i<fNumberOfTracks;i++) 
       {
 
-       fTrack = fEvent->GetTrack(i) ; 
+       fTrack = anEvent->GetTrack(i) ; 
        if (fTrack){
          if (fTrack->UseForDifferentialFlow()) {
          Double_t fPhi = fTrack->Phi();
@@ -159,3 +158,5 @@ void AliFlowAnalysisWithScalarProduct::Finish() {
          
   cout<<".....finished"<<endl;
  }
+
+
index 9ee3625c1bdd355c289f4d6cda79b931878f1c52..3ce5a580f6c3f08066386918385767e0a8c1001d 100644 (file)
@@ -35,7 +35,7 @@ class AliFlowAnalysisWithScalarProduct {
    virtual  ~AliFlowAnalysisWithScalarProduct();  //destructor
  
    void    Init();                             //defines variables and histograms
-   void    Make(AliFlowEventSimple* fEvent);   //calculates variables and fills histograms
+   void    Make(AliFlowEventSimple* anEvent);   //calculates variables and fills histograms
    void    Finish();                           //saves histograms
   
    void      SetDebug(Bool_t kt)                 { this->fDebug = kt ; }
@@ -57,7 +57,6 @@ class AliFlowAnalysisWithScalarProduct {
    
    Int_t     fEventNumber;  // event counter
          
-   AliFlowEventSimple*   fEvent ;     //!
    AliFlowTrackSimple*   fTrack ;     //!
      
    Bool_t       fDebug ;            //! flag for lyz analysis: more print statements
index d86ef0a8dfee13c91384b5ab6539dfae22e8a29b..7ecf4a793d696fb4bcaa043ee8409e191942753c 100644 (file)
@@ -39,7 +39,7 @@ ClassImp(AliFlowCommonHist)
 //-----------------------------------------------------------------------
 
   AliFlowCommonHist::AliFlowCommonHist(TString input):
-   fEvent(0),
+//   fEvent(0),
    fTrack(0), 
    fHistMultOrig(0),
    fHistMultInt(0),
@@ -175,10 +175,10 @@ AliFlowCommonHist::~AliFlowCommonHist()
 
 //----------------------------------------------------------------------- 
 
-Bool_t AliFlowCommonHist::FillControlHistograms(AliFlowEventSimple* fEvent)
+Bool_t AliFlowCommonHist::FillControlHistograms(AliFlowEventSimple* Event)
 {
   //Fills the control histograms
-  if (!fEvent){
+  if (!Event){
     cout<<"##### FillControlHistograms: FlowEvent pointer null"<<endl;
     return kFALSE;
   }
@@ -187,10 +187,10 @@ Bool_t AliFlowCommonHist::FillControlHistograms(AliFlowEventSimple* fEvent)
 
 
   //fill the histograms
-  Int_t fNumberOfTracks = fEvent->NumberOfTracks();
+  Int_t fNumberOfTracks = Event->NumberOfTracks();
   fHistMultOrig->Fill(fNumberOfTracks);
 
-  AliFlowVector fQ = fEvent->GetQ(); 
+  AliFlowVector fQ = Event->GetQ(); 
   //weight by the Multiplicity
   Double_t fQX = fQ.X()/fQ.GetMult();
   Double_t fQY = fQ.Y()/fQ.GetMult();
@@ -200,7 +200,7 @@ Bool_t AliFlowCommonHist::FillControlHistograms(AliFlowEventSimple* fEvent)
   Int_t fMultInt = 0;
   Int_t fMultDiff = 0;
   for (Int_t i=0;i<fNumberOfTracks;i++) {
-    fTrack = fEvent->GetTrack(i);
+    fTrack = Event->GetTrack(i);
     if (fTrack ) {
       if (fTrack->UseForIntegratedFlow()){
        fPt = fTrack->Pt();
index c978ac790c5ab65dea89939580b75a99da039e28..00466ee5a66da621fc313c24aaf3542a8d9ff2e4 100644 (file)
@@ -25,7 +25,7 @@ class AliFlowCommonHist {
   virtual ~AliFlowCommonHist();
 
   //make fill methods here
-  Bool_t FillControlHistograms(AliFlowEventSimple* fEvent);
+  Bool_t FillControlHistograms(AliFlowEventSimple* Event);
  
   //make get methods here
   Double_t GetEntriesInPtBin(Int_t fBin);   //gets entries from fHistPtDiff
@@ -46,7 +46,7 @@ class AliFlowCommonHist {
  
  private:
 
-  AliFlowEventSimple* fEvent;     //!
+  //  AliFlowEventSimple* fEvent;     //!
   AliFlowTrackSimple* fTrack;     //!
 
   //define histograms here
index 17484106b05849afc47c3cc4b65b32b59d49119d..6f30a7d759d7c755beadac1668eebc753d33a01c 100644 (file)
@@ -217,21 +217,21 @@ AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliMCEvent* fInput)
    
   //normal loop
   while (fGoodTracks < fN && ftrkN < fNumberOfInputTracks) {
-    AliMCParticle* fParticle = fInput->GetTrack(ftrkN);   //get input particle
+    AliMCParticle* myParticle = fInput->GetTrack(ftrkN);   //get input particle
     //cut on tracks
-    if (TMath::Abs(fParticle->Eta()) < 0.2)
+    if (TMath::Abs(myParticle->Eta()) < 0.2)
       {
        if(
-          TMath::Abs(fParticle->Particle()->GetPdgCode()) == 211
-          //         TMath::Abs(fParticle->Particle()->GetPdgCode()) == 211 ||
-          //         TMath::Abs(fParticle->Particle()->GetPdgCode()) == 321 ||
-          //         TMath::Abs(fParticle->Particle()->GetPdgCode()) == 2212
+          TMath::Abs(myParticle->Particle()->GetPdgCode()) == 211
+          //         TMath::Abs(myParticle->Particle()->GetPdgCode()) == 211 ||
+          //         TMath::Abs(myParticle->Particle()->GetPdgCode()) == 321 ||
+          //         TMath::Abs(myParticle->Particle()->GetPdgCode()) == 2212
           )
          {
            fTrack = new AliFlowTrackSimple() ;
-           fTrack->SetPt(fParticle->Pt() );
-           fTrack->SetEta(fParticle->Eta() );
-           fTrack->SetPhi(fParticle->Phi() );
+           fTrack->SetPt(myParticle->Pt() );
+           fTrack->SetEta(myParticle->Eta() );
+           fTrack->SetPhi(myParticle->Phi() );
            fTrack->SetForIntegratedFlow(kTRUE);
            fTrack->SetForDifferentialFlow(kTRUE);
 
@@ -243,13 +243,13 @@ AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliMCEvent* fInput)
            fEvent->TrackCollection()->Add(fTrack) ;         
          }
          /*      else if(
-                 TMath::Abs(fParticle->Particle()->GetPdgCode()) == 211
+                 TMath::Abs(myParticle->Particle()->GetPdgCode()) == 211
                  )
            {
              fTrack = new AliFlowTrackSimple();
-             fTrack->SetPt(fParticle->Pt() );
-             fTrack->SetEta(fParticle->Eta() );
-             fTrack->SetPhi(fParticle->Phi() );
+             fTrack->SetPt(myParticle->Pt() );
+             fTrack->SetEta(myParticle->Eta() );
+             fTrack->SetPhi(myParticle->Phi() );
              fTrack->SetForIntegratedFlow(kFALSE);
              fTrack->SetForDifferentialFlow(kTRUE);
 
@@ -296,14 +296,14 @@ AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* fInput)
 
   //normal loop
   while (fGoodTracks < fN && ftrkN < fNumberOfInputTracks) {
-    AliESDtrack* fParticle = fInput->GetTrack(ftrkN);   //get input particle
+    AliESDtrack* myParticle = fInput->GetTrack(ftrkN);   //get input particle
     //cut on tracks
-    if (TMath::Abs(fParticle->Eta()) < 0.2)
+    if (TMath::Abs(myParticle->Eta()) < 0.2)
       {
        fTrack = new AliFlowTrackSimple() ;
-       fTrack->SetPt(fParticle->Pt() );
-       fTrack->SetEta(fParticle->Eta() );
-       fTrack->SetPhi(fParticle->Phi() );
+       fTrack->SetPt(myParticle->Pt() );
+       fTrack->SetEta(myParticle->Eta() );
+       fTrack->SetPhi(myParticle->Phi() );
        fTrack->SetForIntegratedFlow(kTRUE);
        fTrack->SetForDifferentialFlow(kTRUE);
 
@@ -349,14 +349,14 @@ AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliAODEvent* fInput)
   
   //normal loop
   while (fGoodTracks < fN && ftrkN < fNumberOfInputTracks) {
-    AliAODTrack* fParticle = fInput->GetTrack(ftrkN);   //get input particle
+    AliAODTrack* myParticle = fInput->GetTrack(ftrkN);   //get input particle
     //cut on tracks
-    if (TMath::Abs(fParticle->Eta()) < 0.2)
+    if (TMath::Abs(myParticle->Eta()) < 0.2)
       {
        fTrack = new AliFlowTrackSimple() ;
-       fTrack->SetPt(fParticle->Pt() );
-       fTrack->SetEta(fParticle->Eta() );
-       fTrack->SetPhi(fParticle->Phi() );
+       fTrack->SetPt(myParticle->Pt() );
+       fTrack->SetEta(myParticle->Eta() );
+       fTrack->SetPhi(myParticle->Phi() );
        fTrack->SetForIntegratedFlow(kTRUE);
        fTrack->SetForDifferentialFlow(kTRUE);
 
@@ -402,17 +402,17 @@ AliFlowEventSimple*  AliFlowEventSimpleMaker::FillTracks(AliESDEvent* fInput, Al
 
   //normal loop
   while (fGoodTracks < fN && ftrkN < fNumberOfInputTracks) {
-    AliESDtrack* fParticle = fInput->GetTrack(ftrkN);   //get input particle
+    AliESDtrack* myParticle = fInput->GetTrack(ftrkN);   //get input particle
     //get Label
-    Int_t fLabel = fParticle->GetLabel();
+    Int_t fLabel = myParticle->GetLabel();
     //match to mc particle
     AliMCParticle* fMcParticle = fInputMc->GetTrack(TMath::Abs(fLabel));
     
     //check
-    if (TMath::Abs(fParticle->GetLabel())!=fMcParticle->Label()) cout<<"fParticle->GetLabel()!=fMcParticle->Label() "<<fParticle->GetLabel()<<"  "<<fMcParticle->Label()<<endl;
+    if (TMath::Abs(myParticle->GetLabel())!=fMcParticle->Label()) cout<<"myParticle->GetLabel()!=fMcParticle->Label() "<<myParticle->GetLabel()<<"  "<<fMcParticle->Label()<<endl;
     
     //cut on tracks
-    if (TMath::Abs(fParticle->Eta()) < 0.2)
+    if (TMath::Abs(myParticle->Eta()) < 0.2)
       {
        if(
           TMath::Abs(fMcParticle->Particle()->GetPdgCode()) == 211 //pions
@@ -423,9 +423,9 @@ AliFlowEventSimple*  AliFlowEventSimpleMaker::FillTracks(AliESDEvent* fInput, Al
          {
            if(fOption == 0) { //take the PID from the MC & the kinematics from the ESD
              fTrack = new AliFlowTrackSimple() ;
-             fTrack->SetPt(fParticle->Pt() );
-             fTrack->SetEta(fParticle->Eta() );
-             fTrack->SetPhi(fParticle->Phi() );
+             fTrack->SetPt(myParticle->Pt() );
+             fTrack->SetEta(myParticle->Eta() );
+             fTrack->SetPhi(myParticle->Phi() );
              fTrack->SetForIntegratedFlow(kTRUE);
              fTrack->SetForDifferentialFlow(kTRUE);
            }
index 0d08af0a33ae00a55c4c2426c6894f1c40c932bc..ff558dbced45b3ec24f7f3e48e8cba190df8ad53 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+/* copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
 /* $Id$ */