]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG2/FORWARD/analysis2/MakeFlow.C
Updates to scripts. Mostly documentation and some new functionalities
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / MakeFlow.C
index 3360e306cdc92b3309fa8a59c8b7725d80807fbd..506680508e0cad84eee0aa1bba855a442a343a68 100644 (file)
@@ -3,7 +3,7 @@
  * @author Alexander Hansen 
  * @date   Wed Mar 23 12:11:33 2011
  * 
- * @brief  
+ * @brief Analyse AODs for flow 
  * 
  * @ingroup pwg2_forward_scripts_makers
  * 
  * The .txt file is expected to contain the path to the files 
  * from the current directory or the absolute path.
  * 
- * @par Inputs: 
- *  
- * 
- * @par Outputs: 
- * - 
+ * @param data         Input data (directory, list, or ROOT file)
+ * @param nevents      Number of events to scan 
+ * @param type         Type of analysis (v<n>)
+ * @param etabins      How may eta bins to make 
+ * @param addFlow      If true, add flow to MC particles
+ * @param addFType     Which type of flow to add to MC particles
+ * @param addFOrder    Order of flow to add to MC particles
+ * @param proof 
  *
  * @ingroup pwg2_forward_flow
  */
@@ -52,27 +55,15 @@ void MakeFlow(TString data      = "",
                           gROOT->GetMacroPath()));
 
   // --- Add to chain either AOD ------------------------------------
-  if (data.IsNull()) {
-    AliError("You didn't add a data file");
-    return;
-  }
-  TChain* chain = new TChain("aodTree");
-
-  if (data.Contains(".txt")) MakeChain(data, chain);
-
-  if (data.Contains(".root")) {
-    TFile* test = TFile::Open(data.Data());
-    if (!test) {
-      AliError(Form("AOD file %s not found", data.Data()));
-      return;
-    }
-    test->Close(); // Remember to close!
-    chain->Add(data.Data());
-  }
+  gROOT->LoadMacro("$ALICE_ROOT/PWG2/FORWARD/analysis2/scripts/MakeChain.C");
+  TChain* chain = MakeChain("AOD", data.Data(), true);
+  // If 0 or less events is select, choose all 
+  if (nEvents <= 0) nEvents = chain->GetEntries();
 
   // --- Initiate the event handlers --------------------------------
-  AliAnalysisManager *mgr  = new AliAnalysisManager("Forward Flow", 
-                                                   "Flow in the forward region");
+  AliAnalysisManager *mgr  = 
+    new AliAnalysisManager("Forward Flow", 
+                          "Flow in the forward region");
 
   // --- AOD input handler -------------------------------------------
   AliAODInputHandler *aodInputHandler = new AliAODInputHandler();