Macro to merge ESD tags for a single run
authorakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 10 Sep 2010 08:01:40 +0000 (08:01 +0000)
committerakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 10 Sep 2010 08:01:40 +0000 (08:01 +0000)
ANALYSIS/TagMacros/MergeESDTags.C [new file with mode: 0644]

diff --git a/ANALYSIS/TagMacros/MergeESDTags.C b/ANALYSIS/TagMacros/MergeESDTags.C
new file mode 100644 (file)
index 0000000..fa78b9d
--- /dev/null
@@ -0,0 +1,33 @@
+void MergeESDTags()
+{
+  char spath[2048];
+  char sglob[1024];
+  sprintf(spath,"");
+  sprintf(sglob,"");
+  for (int i=0; i< gApplication->Argc();i++){
+    if (!(strcmp(gApplication->Argv(i),"--path")))
+      sprintf(spath, gApplication->Argv(i+1));
+    if (!(strcmp(gApplication->Argv(i),"--glob")))
+      sprintf(sglob, gApplication->Argv(i+1));
+  }
+
+  if (!strcmp(sglob, "")) sprintf(sglob, "ESD.tag.root");
+
+  printf("*** Connect to AliEn ***\n");
+  TGrid::Connect("alien://");
+  gSystem->Load("libProofPlayer.so");
+  gSystem->Load("libANALYSIS.so");
+  gSystem->Load("libANALYSISalice.so");
+  
+  // Create A tag creator object 
+  AliESDTagCreator *tagCre = new AliESDTagCreator();
+  tagCre->SetStorage(0);
+
+  // Find all the event tag files in the GRID directory
+  TGridResult* tagResult = gGrid->Query(spath,"ESD.tag.root");
+
+  // Merge the tags    
+  tagCre->MergeTagsForRun("ESD",tagResult);
+
+  return;
+}