]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliTagCreator.cxx
Adding Generate method to build a store with identical values (Laurent)
[u/mrichter/AliRoot.git] / STEER / AliTagCreator.cxx
index fa80beb0680afb5ac497c707f8171f41440dd8ec..381db46c3dbf26bb83790f6785e02aff74f7ebcb 100644 (file)
@@ -25,7 +25,6 @@
 #include <TString.h>
 #include <TTree.h>
 #include <TSystem.h>
-#include <TSystemDirectory.h>
 #include <TChain.h>
 #include <TLorentzVector.h>
 
@@ -184,8 +183,7 @@ Bool_t AliTagCreator::MergeTags() {
     const char * name = 0x0;
     // Add all files matching *pattern* to the chain
     while((name = gSystem->GetDirEntry(dirp))) {
-      if (strstr(name,tagPattern))       
-       fgChain->Add(name);  
+      if (strstr(name,tagPattern)) fgChain->Add(name);  
     }//directory loop
     AliInfo(Form("Chained tag files: %d",fgChain->GetEntries()));
   }//local mode
@@ -205,7 +203,6 @@ Bool_t AliTagCreator::MergeTags() {
   }//grid mode
  
   AliRunTag *tag = new AliRunTag;
-  AliEventTag *evTag = new AliEventTag;
   fgChain->SetBranchAddress("AliTAG",&tag);
    
   //Defining new tag objects
@@ -215,12 +212,7 @@ Bool_t AliTagCreator::MergeTags() {
   btag->SetCompressionLevel(9);
   for(Int_t iTagFiles = 0; iTagFiles < fgChain->GetEntries(); iTagFiles++) {
     fgChain->GetEntry(iTagFiles);
-    newTag->SetRunId(tag->GetRunId());
-    const TClonesArray *tagList = tag->GetEventTags();
-    for(Int_t j = 0; j < tagList->GetEntries(); j++) {
-      evTag = (AliEventTag *) tagList->At(j);
-      newTag->AddEventTag(*evTag);
-    }
+    newTag = tag;
     ttag.Fill();
     newTag->Clear();
   }//tag file loop 
@@ -251,7 +243,6 @@ Bool_t AliTagCreator::MergeTags() {
   ttag.Write();
   ftag->Close();
 
-  delete tag;
   delete newTag;
 
   return kTRUE;
@@ -272,7 +263,6 @@ Bool_t AliTagCreator::MergeTags(TGridResult *result) {
   }
   AliInfo(Form("Chained tag files: %d",fgChain->GetEntries()));
   AliRunTag *tag = new AliRunTag;
-  AliEventTag *evTag = new AliEventTag;
   fgChain->SetBranchAddress("AliTAG",&tag);
    
   //Defining new tag objects
@@ -282,12 +272,7 @@ Bool_t AliTagCreator::MergeTags(TGridResult *result) {
   btag->SetCompressionLevel(9);
   for(Int_t iTagFiles = 0; iTagFiles < fgChain->GetEntries(); iTagFiles++) {
     fgChain->GetEntry(iTagFiles);
-    newTag->SetRunId(tag->GetRunId());
-    const TClonesArray *tagList = tag->GetEventTags();
-    for(Int_t j = 0; j < tagList->GetEntries(); j++) {
-      evTag = (AliEventTag *) tagList->At(j);
-      newTag->AddEventTag(*evTag);
-    }
+    newTag = tag;
     ttag.Fill();
     newTag->Clear();
   }//tag file loop 
@@ -318,7 +303,6 @@ Bool_t AliTagCreator::MergeTags(TGridResult *result) {
   ttag.Write();
   ftag->Close();
 
-  delete tag;
   delete newTag;
 
   return kTRUE;
@@ -382,7 +366,7 @@ void AliTagCreator::CreateTag(TFile* file, const char *guid, const char *md5, co
   b->GetEntry(0);
   Int_t iInitRunNumber = esd->GetRunNumber();
 
-  Int_t iNumberOfEvents = b->GetEntries();
+  Int_t iNumberOfEvents = (Int_t)b->GetEntries();
   for (Int_t iEventNumber = 0; iEventNumber < iNumberOfEvents; iEventNumber++) {
     ntrack = 0;
     nPos = 0;
@@ -688,7 +672,7 @@ void AliTagCreator::CreateTag(TFile* file, const char *filepath, Int_t Counter)
   b->GetEntry(0);
   Int_t iInitRunNumber = esd->GetRunNumber();
 
-  Int_t iNumberOfEvents = b->GetEntries();
+  Int_t iNumberOfEvents = (Int_t)b->GetEntries();
   for (Int_t iEventNumber = 0; iEventNumber < iNumberOfEvents; iEventNumber++) {
     ntrack = 0;
     nPos = 0;