changes for running on AOD
authorkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 23 May 2012 07:21:52 +0000 (07:21 +0000)
committerkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 23 May 2012 07:21:52 +0000 (07:21 +0000)
PWGJE/AliAnalysisTaskJetSpectrum2.cxx
PWGJE/UserTasks/AliAnalysisTaskCheckSingleTrackJetRejection.cxx
PWGJE/UserTasks/AliAnalysisTaskCheckSingleTrackJetRejection.h
PWGJE/UserTasks/AliAnalysisTaskJetHadronCorrelation.cxx
PWGJE/UserTasks/AliAnalysisTaskJetHadronCorrelation.h

index 87bfe5c..fe20900 100644 (file)
@@ -1045,10 +1045,10 @@ void AliAnalysisTaskJetSpectrum2::FillJetHistos(TList &jetsList,TList &particles
        if(fInputHandler->IsEventSelected()&fTriggerBit[it]){
          var1[6] = it;
          fhnJetPt[iType]->Fill(var1);
+         fhnJetPtQA[iType]->Fill(var2);
        }
       }
 
-      fhnJetPtQA[iType]->Fill(var2);
       if(leadTrack)fh2LTrackPtJetPt[iType][kMaxJets]->Fill(leadTrack->Pt(),ptJet);
 
       if(particlesList.GetSize()&&ij<kMaxJets){
index a6a07d0..63c39c4 100755 (executable)
@@ -38,6 +38,7 @@
 #include "AliESDEvent.h"
 #include "AliAODEvent.h"
 #include "AliAODHandler.h"
+#include "AliAODInputHandler.h"
 #include "AliAODTrack.h"
 #include "AliVParticle.h"
 #include "AliAODJet.h"
@@ -295,6 +296,49 @@ void AliAnalysisTaskCheckSingleTrackJetRejection::UserExec(Option_t *)
 
                                // Main loop (called each event)
                                // Execute analysis for current event
+
+                               AliAODEvent *fAOD;
+                               TObject* handler = AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler();
+                               if( handler && handler->InheritsFrom("AliAODInputHandler") ) {
+                                                               fAOD  =  ((AliAODInputHandler*)handler)->GetEvent();
+                                                               if(fUseAODInput) fAODIn = fAOD;
+                                                               if (fDebug > 1)  Printf("%s:%d AOD event from input", (char*)__FILE__,__LINE__);
+                               }
+                               else {
+                                                               handler = AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler();
+                                                               if( handler && handler->InheritsFrom("AliAODHandler") ) {
+                                                                                               fAOD = ((AliAODHandler*)handler)->GetAOD();
+                                                                                               fAODIn = fAOD;
+                                                                                               if (fDebug > 1)  Printf("%s:%d AOD event from output", (char*)__FILE__,__LINE__);
+                                                               }
+                               }
+
+                               if(!fAODIn && !fUseAODInput){ // case we have AOD in input & output and want jets from output
+                                                               TObject* outHandler = AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler();
+                                                               if( outHandler && outHandler->InheritsFrom("AliAODHandler") ) {
+                                                                                               fAODIn = ((AliAODHandler*)outHandler)->GetAOD();
+                                                                                               if (fDebug > 1)  Printf("%s:%d jets from output AOD", (char*)__FILE__,__LINE__);
+                                                               }
+                               }
+
+                               if(fNonStdFile.Length()!=0){
+                                                               // case we have an AOD extension - fetch the jets from the extended output
+
+                                                               AliAODHandler *aodH = dynamic_cast<AliAODHandler*>(AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler());
+                                                               fAODExtension = (aodH?aodH->GetExtension(fNonStdFile.Data()):0);
+                                                               if(!fAODExtension){
+                                                                                               if(fDebug>1)Printf("AODExtension not found for %s",fNonStdFile.Data());
+                                                               }
+                               }
+
+
+
+                               //fAODIn = dynamic_cast<AliAODEvent*>(InputEvent());
+                               if (!fAODIn) {
+                                                               Printf("ERROR %s : fAODIn not available",(char*)__FILE__);
+                                                               return;
+                               }
+
                                AliInputEventHandler* inputHandler = (AliInputEventHandler*)
                                                                ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
                                if(!(inputHandler->IsEventSelected() & AliVEvent::kMB)){
@@ -304,6 +348,7 @@ void AliAnalysisTaskCheckSingleTrackJetRejection::UserExec(Option_t *)
                                if(!IsMC)fH1Events->Fill(0);
 
 
+
                                // start jet analysis
 
                                Double_t Jet_n  [20];
@@ -320,12 +365,7 @@ void AliAnalysisTaskCheckSingleTrackJetRejection::UserExec(Option_t *)
                                                                }
                                }
 
-                               fAODIn = dynamic_cast<AliAODEvent*>(InputEvent());
-                               if (!fAODIn) {
-                                                               Printf("ERROR: fAODIn not available");
-                                                               return;
-                               }
-
+                               // get AOD event from input/ouput
                                TString cAdd = "";
                                cAdd += Form("%02d_",(int)((Radius+0.01)*10.));
                                cAdd += Form("B%d",(int)BackM);
index 424e994..82bf4fc 100644 (file)
@@ -48,7 +48,7 @@ class AliAnalysisTaskCheckSingleTrackJetRejection : public AliAnalysisTaskSE
                virtual void    SetMC(Bool_t ismc=kFALSE){IsMC=ismc;}\r
     virtual void    FinishTaskOutput();\r
     virtual Bool_t  PythiaInfoFromFile(const char* currFile,Float_t &fXsec,Float_t &fTrials);\r
-    //    virtual Float_t GetTotalEvents(const char* currFile);\r
+    //virtual Float_t GetTotalEvents(const char* currFile);\r
     virtual Double_t DeltaPhi(Double_t phi1,Double_t phi2);\r
     virtual Double_t DeltaR(Double_t phi1,Double_t phi2,Double_t eta1,Double_t eta2);\r
 \r
index 611e683..2720c09 100755 (executable)
@@ -38,6 +38,7 @@
 #include "AliESDEvent.h"
 #include "AliAODEvent.h"
 #include "AliAODHandler.h"
+#include "AliAODInputHandler.h"
 #include "AliAODTrack.h"
 #include "AliAODJet.h"
 #include "AliAODJetEventBackground.h"
@@ -440,9 +441,52 @@ void AliAnalysisTaskJetHadronCorrelation::UserExec(Option_t *)
 
 
                                // Main loop (called each event)
-                               // Execute analysis for current event
-                               AliInputEventHandler* inputHandler = (AliInputEventHandler*)
-                                                               ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
+                        // Execute analysis for current event
+
+                               AliAODEvent *fAOD;
+                               TObject* handler = AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler();
+                               if( handler && handler->InheritsFrom("AliAODInputHandler") ) {
+                                                               fAOD  =  ((AliAODInputHandler*)handler)->GetEvent();
+                                                               if(fUseAODInput) fAODIn = fAOD;
+                                                               if (fDebug > 1)  Printf("%s:%d AOD event from input", (char*)__FILE__,__LINE__);
+                               }
+                               else {
+                                                               handler = AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler();
+                                                               if( handler && handler->InheritsFrom("AliAODHandler") ) {
+                                                                                               fAOD = ((AliAODHandler*)handler)->GetAOD();
+                                                                                               fAODIn = fAOD;
+                                                                                               if (fDebug > 1)  Printf("%s:%d AOD event from output", (char*)__FILE__,__LINE__);
+                                                               }
+                               }
+
+                               if(!fAODIn && !fUseAODInput){ // case we have AOD in input & output and want jets from output
+                                                               TObject* outHandler = AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler();
+                                                               if( outHandler && outHandler->InheritsFrom("AliAODHandler") ) {
+                                                                                               fAODIn = ((AliAODHandler*)outHandler)->GetAOD();
+                                                                                               if (fDebug > 1)  Printf("%s:%d jets from output AOD", (char*)__FILE__,__LINE__);
+                                                               }
+                               }
+
+                               if(fNonStdFile.Length()!=0){
+                                                               // case we have an AOD extension - fetch the jets from the extended output
+
+                                                               AliAODHandler *aodH = dynamic_cast<AliAODHandler*>(AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler());
+                                                               fAODExtension = (aodH?aodH->GetExtension(fNonStdFile.Data()):0);
+                                                               if(!fAODExtension){
+                                                                                               if(fDebug>1)Printf("AODExtension not found for %s",fNonStdFile.Data());
+                                                               }
+                               }
+
+
+
+                               //fAODIn = dynamic_cast<AliAODEvent*>(InputEvent());
+                               if (!fAODIn) {
+                                                               Printf("ERROR %s : fAODIn not available",(char*)__FILE__);
+                                                               return;
+                               }
+
+                                 AliInputEventHandler* inputHandler = (AliInputEventHandler*)
+                                                                           ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
                                if(!(inputHandler->IsEventSelected() & AliVEvent::kMB)){
                                                                if (fDebug > 1 ) Printf(" Trigger Selection: event REJECTED ... ");
                                                                return;
@@ -481,12 +525,6 @@ void AliAnalysisTaskJetHadronCorrelation::UserExec(Option_t *)
                                                                }
                                }
 
-                               fAODIn = dynamic_cast<AliAODEvent*>(InputEvent());
-                               if (!fAODIn) {
-                                                               Printf("ERROR: fAODIn not available");
-                                                               return;
-                               }
-
                                //////-----------------------------------------------------------------------------------
 
 
index 89a8296..8aa3e26 100755 (executable)
@@ -47,7 +47,7 @@ class AliAnalysisTaskJetHadronCorrelation : public AliAnalysisTaskSE
                virtual void   SetSkipCone(Int_t skipCone=0){SkipCone=skipCone;}\r
                virtual void   SetMC(Bool_t ismc=true){IsMC=ismc;}\r
                virtual void   FinishTaskOutput();\r
-               //              virtual Float_t GetTotalEvents(const char* currFile);\r
+               //virtual Float_t GetTotalEvents(const char* currFile);\r
                virtual Double_t DeltaPhi(Double_t phi1,Double_t phi2);\r
 \r
 \r