Removing unnecessary dependencies and adding AddTaskMacro.
authorakalweit <akalweit@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Apr 2013 15:28:04 +0000 (15:28 +0000)
committerakalweit <akalweit@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Apr 2013 15:28:04 +0000 (15:28 +0000)
ANALYSIS/BadChunkFilter/AddTaskBadChunkID.C [new file with mode: 0644]
ANALYSIS/BadChunkFilter/AliAnalysisTaskBadChunkID.cxx
ANALYSIS/BadChunkFilter/AliAnalysisTaskBadChunkID.h

diff --git a/ANALYSIS/BadChunkFilter/AddTaskBadChunkID.C b/ANALYSIS/BadChunkFilter/AddTaskBadChunkID.C
new file mode 100644 (file)
index 0000000..046dccd
--- /dev/null
@@ -0,0 +1,52 @@
+AliAnalysisTaskBadChunkID *AddTaskBadChunkID( const TString lMasterJobSessionFlag = "")
+{
+// Creates, configures and attaches to the train a cascades check task.
+   // Get the pointer to the existing analysis manager via the static access method.
+   //==============================================================================
+   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+   if (!mgr) {
+      ::Error("AddTaskBadChunkID", "No analysis manager to connect to.");
+      return NULL;
+   }   
+
+   // Check the analysis type using the event handlers connected to the analysis manager.
+   //==============================================================================
+   if (!mgr->GetInputEventHandler()) {
+      ::Error("AddTaskBadChunkID", "This task requires an input event handler");
+      return NULL;
+   }   
+   TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
+
+   // Create and configure the task
+        AliAnalysisTaskBadChunkID *taskbadchunkID = new AliAnalysisTaskBadChunkID("taskbadchunkID");
+   mgr->AddTask(taskbadchunkID);
+
+   TString outputFileName = AliAnalysisManager::GetCommonFileName();
+   
+   outputFileName += ":BADCHUNKCHECK";
+   //if (lSwitchIsNuclear) outputFileName += "_AA";
+   //outputFileName += "_PP";
+   if (mgr->GetMCtruthEventHandler()) outputFileName += "_MC";
+   //if(lMasterJobSessionFlag.Length()) outputFileName += lMasterJobSessionFlag.Data();
+   
+   Printf("Set OutputFileName : \n %s\n", outputFileName.Data() );
+
+   AliAnalysisDataContainer *coutputList = mgr->CreateContainer("clist",
+                                                            TList::Class(),
+                                                            AliAnalysisManager::kOutputContainer,
+                                                            outputFileName );
+   AliAnalysisDataContainer *coutputTree = mgr->CreateContainer("cTree",
+                                                            TTree::Class(),
+                                                            AliAnalysisManager::kOutputContainer,
+                                                            outputFileName );
+
+   //This one you should merge in file-resident ways...
+   coutputTree->SetSpecialOutput();
+
+   //Recommendation: Tree as a single output slot
+   mgr->ConnectInput( taskbadchunkID, 0, mgr->GetCommonInputContainer());
+   mgr->ConnectOutput(taskbadchunkID, 1, coutputList);
+   mgr->ConnectOutput(taskbadchunkID, 2, coutputTree);
+   
+   return taskbadchunkID;
+}   
index a574d3d..b89c704 100644 (file)
 
 class TTree;
 class TParticle;
-class TVector3;
-
-//class AliMCEventHandler;
-//class AliMCEvent;
-//class AliStack;
-
-class AliESDVertex;
-class AliAODVertex;
-class AliESDv0;
-class AliAODv0;
 
 #include <Riostream.h>
 #include "TList.h"
 #include "TH1.h"
-#include "TH2.h"
-#include "TH3.h"
 #include "TFile.h"
-#include "THnSparse.h"
-#include "TVector3.h"
-#include "TCanvas.h"
-#include "TMath.h"
-#include "TLegend.h"
 #include "TString.h"
 #include "AliLog.h"
-
 #include "AliESDEvent.h"
-#include "AliAODEvent.h"
-#include "AliV0vertexer.h"
-#include "AliCascadeVertexer.h"
-#include "AliESDpid.h"
 #include "AliESDtrack.h"
-#include "AliESDtrackCuts.h"
 #include "AliInputEventHandler.h"
 #include "AliAnalysisManager.h"
-#include "AliMCEventHandler.h"
-#include "AliMCEvent.h"
-#include "AliStack.h"
-
-#include "AliCFContainer.h"
-#include "AliMultiplicity.h"
-#include "AliAODMCParticle.h"
-#include "AliESDcascade.h"
-#include "AliAODcascade.h"
-#include "AliESDUtils.h"
-#include "AliGenEventHeader.h"
-
+//#include "AliMCEventHandler.h"
+//#include "AliMCEvent.h"
+//#include "AliStack.h"
 #include "AliAnalysisTaskBadChunkID.h"
 
 using std::cout;
@@ -91,8 +59,6 @@ AliAnalysisTaskBadChunkID::AliAnalysisTaskBadChunkID()
 {
   // Dummy Constructor
 
-  
-
 }
 
 AliAnalysisTaskBadChunkID::AliAnalysisTaskBadChunkID(const char *name) 
@@ -179,8 +145,8 @@ void AliAnalysisTaskBadChunkID::UserExec(Option_t *)
   // Called for each event
 
    AliESDEvent *lESDevent = 0x0;
-   AliMCEvent  *lMCevent  = 0x0; 
-   AliStack    *lMCstack  = 0x0; 
+   //AliMCEvent  *lMCevent  = 0x0;
+   //AliStack    *lMCstack  = 0x0;
 
   // Connect to the InputEvent   
   // After these lines, we should have an ESD/AOD event
@@ -193,6 +159,8 @@ void AliAnalysisTaskBadChunkID::UserExec(Option_t *)
       return;
    }
 
+/* Anyhow not needed for cross-check
    lMCevent = MCEvent();
    if (!lMCevent) {
       Printf("ERROR: Could not retrieve MC event \n");
@@ -206,7 +174,8 @@ void AliAnalysisTaskBadChunkID::UserExec(Option_t *)
       cout << "Name of the file with pb :" <<  fInputHandler->GetTree()->GetCurrentFile()->GetName() << endl;
       return;
    }
-   
+*/
 //------------------------------------------------
 // Track Multiplicity Information Acquistion
 //------------------------------------------------
index bf2a5da..71a31c0 100644 (file)
 
 class TList;
 class TH1F;
-class TH2F;
-class TH3F;
-class TVector3;
-class THnSparse;
-
-class AliESDpid;
-class AliESDtrackCuts;
 class AliESDEvent;
-class AliPhysicsSelection;
-class AliCFContainer;
 
 #include "TString.h"
 //#include "AliESDtrackCuts.h"
@@ -52,27 +43,27 @@ class AliAnalysisTaskBadChunkID : public AliAnalysisTaskSE {
   virtual void   UserExec(Option_t *option);
   virtual void   Terminate(Option_t *);
   
- private:
-        // Note : In ROOT, "//!" means "do not stream the data from Master node to Worker node" ...
-        // your data member object is created on the worker nodes and streaming is not needed.
-        // http://root.cern.ch/download/doc/11InputOutput.pdf, page 14
-
+private:
+  // Note : In ROOT, "//!" means "do not stream the data from Master node to Worker node" ...
+  // your data member object is created on the worker nodes and streaming is not needed.
+  // http://root.cern.ch/download/doc/11InputOutput.pdf, page 14
+  
   TList  *fList;  //! List of Control plots
   TTree  *fTree;  //! Output Tree
-
+  
   TH1F      *fHistNEvents;    //! Keeping track of N(events)
-
+  
   Int_t fRunNumber;       //! Run Number
   TString fFileName;      //! Chunk Number
   Int_t fNGlobalTracks;   //! Number of kITSrefit tracks
   Int_t fNTracks;         //! Number of tracks
-
-  //Objects Controlling Task Behaviour 
-
-   AliAnalysisTaskBadChunkID(const AliAnalysisTaskBadChunkID&);            // not implemented
-   AliAnalysisTaskBadChunkID& operator=(const AliAnalysisTaskBadChunkID&); // not implemented
-   
-   ClassDef(AliAnalysisTaskBadChunkID, 11);
+  
+  //Objects Controlling Task Behaviour
+  
+  AliAnalysisTaskBadChunkID(const AliAnalysisTaskBadChunkID&);            // not implemented
+  AliAnalysisTaskBadChunkID& operator=(const AliAnalysisTaskBadChunkID&); // not implemented
+  
+  ClassDef(AliAnalysisTaskBadChunkID, 11);
 };
 
 #endif