]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliESDTagCreator.cxx
Bug fix - chack the abs values
[u/mrichter/AliRoot.git] / STEER / AliESDTagCreator.cxx
index 7f79a1a56eddc8b2a465752e6007354da007eaad..c11f4677f86ffa33dbb5b4ab535c79f003f81a99 100644 (file)
@@ -77,20 +77,20 @@ Bool_t AliESDTagCreator::ReadGridCollection(TGridResult *fresult) {
   Int_t nEntries = fresult->GetEntries();
 
   TString alienUrl;
-  const char* guid;
-  const char* md5;
-  const char* turl;
-  Long64_t size = -1;
+//   const char* guid;
+//   const char* md5;
+//   const char* turl;
+//   Long64_t size = -1;
 
   Int_t counter = 0;
   for(Int_t i = 0; i < nEntries; i++) {
     alienUrl = fresult->GetKey(i,"turl");
-    guid = fresult->GetKey(i,"guid");
-    if(fresult->GetKey(i,"size")) size = atol (fresult->GetKey(i,"size"));
-    md5 = fresult->GetKey(i,"md5");
-    turl = fresult->GetKey(i,"turl");
-    if(md5 && !strlen(guid)) md5 = 0;
-    if(guid && !strlen(guid)) guid = 0;
+//     guid = fresult->GetKey(i,"guid");
+//     if(fresult->GetKey(i,"size")) size = atol (fresult->GetKey(i,"size"));
+//     md5 = fresult->GetKey(i,"md5");
+//     turl = fresult->GetKey(i,"turl");
+//     if(md5 && !strlen(guid)) md5 = 0;
+//     if(guid && !strlen(guid)) guid = 0;
     
     fChain->Add(alienUrl);
     //fGUIDList->Add(new TObjString(guid));
@@ -125,14 +125,14 @@ Bool_t AliESDTagCreator::ReadLocalCollection(const char *localpath) {
   // case where it finds an AliESDs.root file it creates the tags
   
   void *dira =  gSystem->OpenDirectory(localpath);
-  Char_t fPath[256];
+  Char_t fPath[512];
   const char * dirname = 0x0;
   const char * filename = 0x0;
   const char * pattern = "AliESDs.root"; 
 
   Int_t counter = 0;
   while((dirname = gSystem->GetDirEntry(dira))) {
-    sprintf(fPath,"%s/%s",localpath,dirname);
+    snprintf(fPath, 512,"%s/%s",localpath,dirname);
     void *dirb =  gSystem->OpenDirectory(fPath);
     while((filename = gSystem->GetDirEntry(dirb))) {
       if(strstr(filename,pattern)) {
@@ -278,6 +278,7 @@ void AliESDTagCreator::CreateTag(TChain* chain, const char *type) {
     }
     else {
       AliFileTag *nftag = new AliFileTag();
+      nftag->SetGUID(fguid);
 
 //       if(fSession == "grid") {
 //     TString fturltemp = "alien://"; fturltemp += url->GetFile();
@@ -671,13 +672,13 @@ void AliESDTagCreator::CreateESDTags(Int_t fFirstEvent, Int_t fLastEvent, AliGRP
   else lastEvent = fLastEvent;
 
   char fileName[256];
-  sprintf(fileName, "Run%d.Event%d_%d.ESD.tag.root", 
+  snprintf(fileName, 256, "Run%d.Event%d_%d.ESD.tag.root", 
          iInitRunNumber,fFirstEvent,lastEvent);
   AliInfo(Form("writing tags to file %s", fileName));
   AliDebug(1, Form("writing tags to file %s", fileName));
  
   TFile* ftag = TFile::Open(fileName, "recreate");
+  
   AliRunTag *tag = new AliRunTag();
   AliEventTag *evTag = new AliEventTag();
   TTree * ttag = new TTree("T","A Tree with event tags");
@@ -829,7 +830,7 @@ void AliESDTagCreator::CreateESDTagsFullRun(TTree *chain, AliGRPObject *grpData,
   Int_t iFirstEvent = 0;
 
   char fileName[256];
-  sprintf(fileName, "Run%d.Event%d_%d.ESD.tag.root", 
+  snprintf(fileName, 256, "Run%d.Event%d_%d.ESD.tag.root", 
          iInitRunNumber,iFirstEvent,iNumberOfEvents);
   AliInfo(Form("writing tags to file %s", fileName));
   AliDebug(1, Form("writing tags to file %s", fileName));