]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ANALYSIS/AliAnalysisTaskFilterFriendSecond.cxx
added run dependent corrections on T for calibration, removed old method
[u/mrichter/AliRoot.git] / ANALYSIS / AliAnalysisTaskFilterFriendSecond.cxx
index 5796c6a5dc898af7b7b77de496b4cd61121e09af..ef9861b231236773313f59cecc023189795359e4 100644 (file)
@@ -97,10 +97,12 @@ void AliAnalysisTaskFilterFriendSecond::UserCreateOutputObjects()
 void AliAnalysisTaskFilterFriendSecond::UserExec(Option_t */*option*/)
 {
 
-       AliInfo("Filling Friends");
+       //
+       // Filtering Friends
+       //
 
        fESDInput = dynamic_cast<AliESDEvent*>(InputEvent()); // get the input ESD
-       fESDfriendInput = (AliESDfriend*)(fESDInput->FindListObject("AliESDfriend"));
+       fESDfriendInput = InputFriend();  // get the input friend
        if(!fESDInput) {
                printf("AliAnalysisTaskFilterFriendSecond::Exec(): no ESD \n");
                return;
@@ -112,12 +114,10 @@ void AliAnalysisTaskFilterFriendSecond::UserExec(Option_t */*option*/)
        // attach ESDfriend
        
        AliESDfriend* esdFriendOutput = (AliESDfriend*)ESDfriend();  
-       AliDebug(2,Form("Number of ESD tracks in input = %d ",fESDInput->GetNumberOfTracks()));
-       AliDebug(2,Form("Number of tracks in input friends = %d ",fESDfriendInput->GetNumberOfTracks()));
-       AliDebug(2,Form("Number of tracks in output friendsNew before filtering = %d ",esdFriendOutput->GetNumberOfTracks()));
+       AliDebug(3,Form("Number of ESD tracks in input = %d ",fESDInput->GetNumberOfTracks()));
+       AliDebug(3,Form("Number of tracks in input friends = %d ",fESDfriendInput->GetNumberOfTracks()));
+       AliDebug(3,Form("Number of tracks in output friendsNew before filtering = %d ",esdFriendOutput->GetNumberOfTracks()));
        
-       AliESDfriendTrack* tNull = new AliESDfriendTrack();
-
        for (Int_t i = 0; i< fESDInput->GetNumberOfTracks(); i++){
                if (i%3 == 0){
                        // keep friend
@@ -130,7 +130,7 @@ void AliAnalysisTaskFilterFriendSecond::UserExec(Option_t */*option*/)
                }
                else {
                        //discard friend 
-                       AddFriendTrackAt(tNull,i);
+                       SkipFriendTrackAt(i);
                }
        } 
        AliDebug(2,Form("Number of tracks in output friendsNew after filtering with GetEntries() = %d ",esdFriendOutput->GetEntriesInTracks()));
@@ -153,15 +153,16 @@ Bool_t AliAnalysisTaskFilterFriendSecond::UserSelectESDfriendForCurrentEvent()
        // Selecting or discarding current event
        //
 
-               
+       /*              
        fESDInput = dynamic_cast<AliESDEvent*>(InputEvent()); // get the input ESD
        if ((fESDInput->GetNumberOfTracks())%2 == 1){
-               AliDebug(2,"Selecting event");
+               AliDebug(2,"****************Selecting event");
                return kTRUE;
        }
        
-       AliDebug(2,"Discarding event"); 
+       AliDebug(2,"****************Discarding event"); 
        return kFALSE;
-       
-       //return kTRUE;
+       */
+               AliDebug(2,"****************Selecting event");
+       return kTRUE;
 }