]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- Changes in the calibration framework to write the filtered friends in a
authorzampolli <zampolli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 10 Mar 2010 15:41:52 +0000 (15:41 +0000)
committerzampolli <zampolli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 10 Mar 2010 15:41:52 +0000 (15:41 +0000)
separate tree.
- Change of the name of the friends tree (esdTree --> esdFriendTree).
- Warning suppressed.

ANALYSIS/ANALYSIScalibLinkDef.h
ANALYSIS/AliAnalysisTaskFilter.cxx
ANALYSIS/AliAnalysisTaskFilter.h
ANALYSIS/AliAnalysisTaskFilterFriend.cxx
ANALYSIS/AliAnalysisTaskFilterFriendSecond.cxx
ANALYSIS/libANALYSIScalib.pkg
STEER/AliESDHandler.cxx
STEER/AliESDHandler.h
STEER/AliESDInputHandler.cxx
STEER/AliReconstruction.cxx

index 88aed78b2573477bd7f8f7b2bd1c22b3c5a6ef52..57b4d2cf4d171b27d00c519e95c6b8fb5e2f6983 100644 (file)
@@ -4,7 +4,7 @@
 #pragma link off all classes;
 #pragma link off all functions;
 
-#pragma link C++ class AliAnalysisTaskCopyESD+;
+//#pragma link C++ class AliAnalysisTaskCopyESD+;
 #pragma link C++ class AliAnalysisTaskFilter+;
 #pragma link C++ class AliAnalysisTaskFilterFriend+;
 #pragma link C++ class AliAnalysisTaskFilterFriendSecond+;
index ce9e98f2d6ef1afbfdacaa819b771e81c8449f1f..64907db126b2ad54ba1e003655cec4b99824bb2b 100644 (file)
@@ -48,9 +48,8 @@ AliAnalysisTaskFilter::AliAnalysisTaskFilter():
        fEntry(0),
        fInputEvent(0x0),
        fInputHandler(0x0),
-       fOutputESD(0x0),
        fOutputESDfriend(0x0),
-       fTreeE(0x0)
+       fTreeEF(0x0)
 {
        //
        // Default constructor
@@ -65,9 +64,8 @@ AliAnalysisTaskFilter::AliAnalysisTaskFilter(const char* name):
        fEntry(0),
        fInputEvent(0x0),
        fInputHandler(0x0),
-       fOutputESD(0x0),
        fOutputESDfriend(0x0),
-       fTreeE(0x0)
+       fTreeEF(0x0)
 {
        //
        // Default constructor
@@ -85,9 +83,8 @@ AliAnalysisTaskFilter::AliAnalysisTaskFilter(const AliAnalysisTaskFilter& obj):
        fEntry(0),
        fInputEvent(0x0),
        fInputHandler(0x0),
-       fOutputESD(0x0),
        fOutputESDfriend(0x0),
-       fTreeE(0x0)
+       fTreeEF(0x0)
 {
        //
        // Copy constructor
@@ -97,9 +94,8 @@ AliAnalysisTaskFilter::AliAnalysisTaskFilter(const AliAnalysisTaskFilter& obj):
        fEntry        = obj.fEntry;
        fInputEvent   = obj.fInputEvent;
        fInputHandler = obj.fInputHandler;
-       fOutputESD    = obj.fOutputESD;
        fOutputESDfriend = obj.fOutputESDfriend;
-       fTreeE        = obj.fTreeE;    
+       fTreeEF        = obj.fTreeEF;    
 }
 
 
@@ -116,9 +112,8 @@ AliAnalysisTaskFilter& AliAnalysisTaskFilter::operator=(const AliAnalysisTaskFil
        fEntry        = other.fEntry;
        fInputEvent   = other.fInputEvent;
        fInputHandler = other.fInputHandler;
-       fOutputESD    = other.fOutputESD;
        fOutputESDfriend = other.fOutputESDfriend;
-       fTreeE        = other.fTreeE;    
+       fTreeEF        = other.fTreeEF;    
        return *this;
 }
 
@@ -155,9 +150,7 @@ void AliAnalysisTaskFilter::CreateOutputObjects()
        AliESDHandler* handler = (AliESDHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
     
        if (handler) {
-               fOutputESD   = handler->GetESD();
-               fTreeE = handler->GetTree();
-               fOutputESD->GetStdContent();
+               fTreeEF = handler->GetTree();
        }
        else {
                AliWarning("No AOD Event Handler connected.") ; 
@@ -191,10 +184,15 @@ void AliAnalysisTaskFilter::Exec(Option_t* option)
                fOutputESDfriend   = handler->GetESDfriend();
                UserExec(option);
        }
+       else {
+         // Set null pointer
+         fOutputESDfriend = 0x0;
+
+       }
 
        // Added protection in case the derived task is not an AOD producer.
        AliAnalysisDataSlot *out0 = GetOutputSlot(0);
-       if (out0 && out0->IsConnected()) PostData(0, fTreeE);    
+       if (out0 && out0->IsConnected()) PostData(0, fTreeEF);    
 }
 
 //______________________________________________________________________
index f13889c15a407147b90eecfb37cbeceb3deb2680..552cd8aa7990e75e1981365c63d46e06557f83c0 100644 (file)
@@ -45,9 +45,8 @@ class AliAnalysisTaskFilter : public AliAnalysisTask
        // Getters
        virtual Int_t         DebugLevel()  {return fDebug;     }
        virtual AliVEvent*    InputEvent()  {return fInputEvent;}
-       virtual AliESDEvent*  ESDEvent()    {return fOutputESD; }
        virtual AliESDfriend* ESDfriend()   {return fOutputESDfriend; }
-       virtual TTree*        OutputTree()  {return fTreeE;     }
+       virtual TTree*        OutputTree()  {return fTreeEF;     }
        virtual Long64_t      Entry()       {return fEntry;     }
        virtual const char*   CurrentFileName();
 
@@ -59,11 +58,10 @@ class AliAnalysisTaskFilter : public AliAnalysisTask
        Int_t                 fEntry;           //  Current entry in the chain
        AliVEvent*            fInputEvent;      //! VEvent Input
        AliInputEventHandler* fInputHandler;    //! Input Handler
-       AliESDEvent*          fOutputESD;       //! ESD out 
        AliESDfriend*         fOutputESDfriend; //! ESD friend out 
-       TTree*                fTreeE;           //  ESD output Tree
+       TTree*                fTreeEF;          //  ESD friend output Tree
        
-       ClassDef(AliAnalysisTaskFilter, 1); // Analysis task for filtering friends
+       ClassDef(AliAnalysisTaskFilter, 2); // Analysis task for filtering friends
 };
 
 #endif
index 628cde3d7a4c2bbd29852bf3a529f548488b89fa..5eab6a853145007cf76d48c398283d5108015c96 100644 (file)
@@ -110,11 +110,9 @@ void AliAnalysisTaskFilterFriend::UserExec(Option_t */*option*/)
                return;
        } 
        // attach ESDfriend
-       AliESDEvent* esdEventOutput = (AliESDEvent*)ESDEvent();
        
        AliESDfriend* esdFriendOutput = (AliESDfriend*)ESDfriend();  
        AliInfo(Form("Number of ESD tracks in input = %d ",fESDInput->GetNumberOfTracks()));
-       AliInfo(Form("Number of ESD tracks in output = %d ",esdEventOutput->GetNumberOfTracks()));
        AliInfo(Form("Number of tracks in input friends = %d ",fESDfriendInput->GetNumberOfTracks()));
        AliInfo(Form("Number of tracks in output friendsNew before filtering = %d ",esdFriendOutput->GetNumberOfTracks()));
        
@@ -124,7 +122,6 @@ void AliAnalysisTaskFilterFriend::UserExec(Option_t */*option*/)
                if (i%2 ==0){
                        // keep friend
                        AliInfo(Form("Keeping %d-th track",i));
-                       esdEventOutput->GetTrack(i);
                        AliESDfriendTrack* tOld = (AliESDfriendTrack*)fESDfriendInput->GetTrack(i);
                        AliDebug(2,Form("1P of the %d-th track = %f",i,tOld->Get1P()));
                        AliInfo(Form("1P of the %d-th track = %f",i,tOld->Get1P()));
index 2deceb8b150deba87f16d847c830dbd76c69c966..6012dec5a89387ec9cffd33399dc1ce49caa3313 100644 (file)
@@ -110,11 +110,9 @@ void AliAnalysisTaskFilterFriendSecond::UserExec(Option_t */*option*/)
                return;
        } 
        // attach ESDfriend
-       AliESDEvent* esdEventOutput = (AliESDEvent*)ESDEvent();
        
        AliESDfriend* esdFriendOutput = (AliESDfriend*)ESDfriend();  
        AliInfo(Form("Number of ESD tracks in input = %d ",fESDInput->GetNumberOfTracks()));
-       AliInfo(Form("Number of ESD tracks in output = %d ",esdEventOutput->GetNumberOfTracks()));
        AliInfo(Form("Number of tracks in input friends = %d ",fESDfriendInput->GetNumberOfTracks()));
        AliInfo(Form("Number of tracks in output friendsNew before filtering = %d ",esdFriendOutput->GetNumberOfTracks()));
        
@@ -124,7 +122,6 @@ void AliAnalysisTaskFilterFriendSecond::UserExec(Option_t */*option*/)
                if (i%3 == 0){
                        // keep friend
                        AliInfo(Form("Keeping %d-th track",i));
-                       esdEventOutput->GetTrack(i);
                        AliESDfriendTrack* tOld = (AliESDfriendTrack*)fESDfriendInput->GetTrack(i);
                        AliDebug(2,Form("1P of the %d-th track = %f",i,tOld->Get1P()));
                        AddFriendTrackAt(tOld,i);
index 13fab97b0e5ee062a1c1fd384dab2945c9765b13..0f84553e91476a5efd29fa4d573618aee7fae9ad 100644 (file)
@@ -1,6 +1,6 @@
 #-*- Mode: Makefile -*-
 
-SRCS =         AliAnalysisTaskCopyESD.cxx \
+SRCS =         \
        AliAnalysisTaskFilter.cxx \
        AliAnalysisTaskFilterFriend.cxx \
        AliAnalysisTaskFilterFriendSecond.cxx \
index 37f7f147332140009c66ebd5d0f319c2ff189a4b..72519f90fcc1a23744018941a3fb444456d9b82b 100644 (file)
@@ -39,12 +39,10 @@ ClassImp(AliESDHandler)
 //______________________________________________________________________________
 AliESDHandler::AliESDHandler() :
        AliVEventHandler(),
-       fESDEvent(NULL),
        fesdf(NULL),
-       fTreeE(NULL),
-       fFileE(NULL),
+       fTreeEF(NULL),
        fFileEF(NULL),
-       fFileName("")
+       fFileName("AliESDfriends_v2.root")
 {
        // default constructor
 }
@@ -52,12 +50,10 @@ AliESDHandler::AliESDHandler() :
 //______________________________________________________________________________
 AliESDHandler::AliESDHandler(const char* name, const char* title):
        AliVEventHandler(name, title),
-       fESDEvent(NULL),
        fesdf(NULL),
-       fTreeE(NULL),
-       fFileE(NULL),
+       fTreeEF(NULL),
        fFileEF(NULL),
-       fFileName("")
+       fFileName("AliESDfriends_v2.root")
 {
 
        // constructor with name and title
@@ -68,19 +64,13 @@ AliESDHandler::AliESDHandler(const char* name, const char* title):
 AliESDHandler::~AliESDHandler() 
 {
        // Destructor.
-       delete fESDEvent;
        delete fesdf;
-       if(fFileE){
-               // is already handled in TerminateIO
-               fFileE->Close();
-               delete fFileE;
-       }
        if(fFileEF){
                // is already handled in TerminateIO
                fFileEF->Close();
                delete fFileEF;
        }
-       delete fTreeE;
+       delete fTreeEF;
 }
 
 //______________________________________________________________________________
@@ -94,18 +84,26 @@ Bool_t AliESDHandler::Init(Option_t* opt)
        TString option(opt);
        option.ToLower();
        TDirectory *owd = gDirectory;
+
+       fesdf = new AliESDfriend();
+
+       // Open the file with friends
        if (option.Contains("proof")) {
                // proof
                // Merging via files. Need to access analysis manager via interpreter.
                gROOT->ProcessLine(Form("AliAnalysisManager::GetAnalysisManager()->OpenProofFile(\"%s\", \"RECREATE\");", fFileName.Data()));
                gROOT->ProcessLine(Form("AliAnalysisManager::GetAnalysisManager()->GetCommonOutputContainer()->SetFile((TFile*)0x%lx);", gFile));
-               fFileE = gFile;
+               fFileEF = gFile;
        } else {
                // local and grid
-               fFileE = new TFile(fFileName.Data(), "RECREATE");
+               fFileEF = new TFile(fFileName.Data(), "RECREATE");
        }
-       CreateTree(1);
-       CreateFriends(1);
+
+       // Create the friends tree
+       fFileEF->cd();
+       fTreeEF = new TTree("esdFriendTree", "Tree with ESD friends");
+       fTreeEF->Branch("ESDfriend.","AliESDfriend", &fesdf);
+
        owd->cd();
        
        return kTRUE;
@@ -122,7 +120,6 @@ Bool_t AliESDHandler::FinishEvent()
        FillTree();
        
        // resetting
-       fESDEvent->Reset();
        fesdf->~AliESDfriend();
        new(fesdf) AliESDfriend();  
        return kTRUE;
@@ -135,7 +132,6 @@ Bool_t AliESDHandler::Terminate()
        // Terminate 
        //
 
-       AddESDtoTreeUserInfo();
        return kTRUE;
 }
 
@@ -146,43 +142,17 @@ Bool_t AliESDHandler::TerminateIO()
        // Terminate IO
        //
 
-       if (fFileE) {
-               fFileE->cd();
-               fTreeE->Write();
-               fFileE->Close();
-               delete fFileE;
-               fFileE = 0;
+       if (fFileEF) {
+               fFileEF->cd();
+               fTreeEF->Write();
+               fFileEF->Close();
+               delete fFileEF;
+               fFileEF = 0;
        }
 
        return kTRUE;
 }
 
-
-//______________________________________________________________________________
-void AliESDHandler::CreateTree(Int_t /*flag*/)
-{
-       //
-       // Creates the ESD Tree
-       // 
-
-       fTreeE = new TTree("esdTree", "AliESD tree");
-       // Create the ESDevent object
-       if(!fESDEvent){
-               fESDEvent = new AliESDEvent();
-               fESDEvent->CreateStdContent();
-       }
-       fESDEvent->WriteToTree(fTreeE);
-}
-//______________________________________________________________________________
-void AliESDHandler::CreateFriends(Int_t /*flag*/)
-{
-       fesdf = new AliESDfriend();
-
-       TBranch *br=fTreeE->Branch("ESDfriend.","AliESDfriend", &fesdf);
-       br->SetFile("AliESDfriends_v1.root");
-       fESDEvent->AddObject(fesdf);
-}
-
 //______________________________________________________________________________
 void AliESDHandler::FillTree()
 {
@@ -192,19 +162,7 @@ void AliESDHandler::FillTree()
 
        AliDebug(2,Form("number of friend tracks = %d\n",fesdf->GetNumberOfTracks()));
 
-       fFileE->cd();
-       fTreeE->Fill();
+       fFileEF->cd();
+       fTreeEF->Fill();
 }
 
-//______________________________________________________________________________
-void AliESDHandler::AddESDtoTreeUserInfo()
-{
-       //
-       // Add aod event to tree user info
-       //
-
-       fTreeE->GetUserInfo()->Add(fESDEvent);
-}
-
-
-
index 072180b2f497cdc2bf684d70cfec320065f937b0..fc50b514ee3326b8185928283fc61acf3bb0d516 100644 (file)
@@ -35,26 +35,20 @@ class AliESDHandler : public AliVEventHandler {
        virtual Bool_t Terminate();
        virtual Bool_t TerminateIO();
        
-       AliESDEvent* GetESD()  {return fESDEvent;}
        AliESDfriend* GetESDfriend()  {return fesdf;}
-       virtual TTree* GetTree() const {return fTreeE;}
-       void CreateTree(Int_t flag);
-       void CreateFriends(Int_t flag);
+       virtual TTree* GetTree() const {return fTreeEF;}
        void FillTree();
-       void AddESDtoTreeUserInfo();
        void SetInputTree(TTree* /*tree*/) {;}
  private:
 
        AliESDHandler(const AliESDHandler&);             // Not implemented
        AliESDHandler& operator=(const AliESDHandler&);  // Not implemented
        
-       AliESDEvent* fESDEvent; //! Pointer to the ESD event
        AliESDfriend* fesdf;    //! Pointer to the ESD friend
-       TTree* fTreeE;          //! tree for ESD persistency
-       TFile* fFileE;          //! Output file
+       TTree* fTreeEF;         //! Output tree for friends
        TFile* fFileEF;         //! Output file for friends
-       TString fFileName;      //  Output file name
+       TString fFileName;      //!  Output file name for friends
        
-    ClassDef(AliESDHandler, 1)
+    ClassDef(AliESDHandler, 2)
 };
 #endif
index 7ed03ea98c4561d4fd25fd388ae7904efbccaa7a..a2eb1027f9ad9d1743f1ff17abb11ca6df2e0777 100644 (file)
@@ -100,7 +100,7 @@ Bool_t AliESDInputHandler::Init(TTree* tree,  Option_t* opt)
       esdTreeFName = (theTree->GetCurrentFile())->GetName();
       esdFriendTreeFName = esdTreeFName;
       esdFriendTreeFName.ReplaceAll("AliESDs.root", "AliESDfriends.root");
-      theTree->AddFriend("esdTree", esdFriendTreeFName.Data());
+      theTree->AddFriend("esdFriendTree", esdFriendTreeFName.Data());
     }
 
     if (!fEvent) fEvent = new AliESDEvent();
index b533fe8dd700558bbb8fc1db97fdfeca00adb490..3c82b7630d0db765a28816d9f52be47c89fe011f 100644 (file)
@@ -1508,9 +1508,9 @@ void AliReconstruction::SlaveBegin(TTree*)
   fesd->WriteToTree(ftree);
   if (fWriteESDfriend) {
     ffileF = TFile::Open("AliESDfriends.root", "RECREATE");
-    ftreeF = new TTree("esdTree", "Tree with ESD Friend objects");
+    ftreeF = new TTree("esdFriendTree", "Tree with ESD Friend objects");
     fesdf  = new AliESDfriend();
-    TBranch *br=ftreeF->Branch("ESDfriend.","AliESDfriend", &fesdf);
+    ftreeF->Branch("ESDfriend.","AliESDfriend", &fesdf);
     fesd->AddObject(fesdf);
     ffile->cd();
   }