Update the Tag system classes. Reduce memory footprint. Add information from RCT
authorakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 6 Sep 2010 15:29:28 +0000 (15:29 +0000)
committerakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 6 Sep 2010 15:29:28 +0000 (15:29 +0000)
30 files changed:
ANALYSIS/AliAnalysisTaskTagCreator.cxx
ANALYSIS/AliEventPoolSparse.cxx
ANALYSIS/AliEventPoolSparse.h
ANALYSIS/AliTagAnalysis.cxx
STEER/AliAODTagCreator.cxx
STEER/AliAODTagCreator.h
STEER/AliDetectorTag.cxx
STEER/AliDetectorTag.h
STEER/AliDetectorTagCuts.cxx
STEER/AliDetectorTagCuts.h
STEER/AliESDTagCreator.cxx
STEER/AliEventTag.cxx
STEER/AliEventTag.h
STEER/AliEventTagCuts.cxx
STEER/AliEventTagCuts.h
STEER/AliFileTag.cxx [new file with mode: 0644]
STEER/AliFileTag.h [new file with mode: 0644]
STEER/AliLHCTag.cxx
STEER/AliLHCTag.h
STEER/AliLHCTagCuts.cxx
STEER/AliLHCTagCuts.h
STEER/AliMCEvent.cxx
STEER/AliRunTag.cxx
STEER/AliRunTag.h
STEER/AliRunTagCuts.cxx
STEER/AliRunTagCuts.h
STEER/AliTagCreator.cxx
STEER/AliTagCreator.h
STEER/STEERBaseLinkDef.h
STEER/libSTEERBase.pkg

index 7d4f489..769501e 100644 (file)
@@ -117,13 +117,19 @@ void AliAnalysisTaskTagCreator::UserExec(Option_t */*option*/)
        fturl = url->GetFile();
     }
 
-    evtTag->SetGUID(guid);
-    if(fAODFileName.Length() != 0) {
-       evtTag->SetMD5("");
-       evtTag->SetTURL(fturl);
-       evtTag->SetSize(0);
+    if (fRunTag->GetFileId(guid) == -1) {
+      AliFileTag *eftag = new AliFileTag();
+
+      eftag->SetGUID(guid);
+      if(fAODFileName.Length() != 0) {
+       eftag->SetMD5("");
+       eftag->SetTURL(fturl);
+       eftag->SetSize(0);
+      }
+      else eftag->SetPath(fturl);
+
+      fRunTag->AddFileTag(eftag);
     }
-    else evtTag->SetPath(fturl);
     //
     // Add the event tag
     fRunTag->AddEventTag(*evtTag);
index b85159a..9adc180 100644 (file)
@@ -97,6 +97,10 @@ void testpool(const char * dirname = ".", const char * pattern = "Run180001") {
 #include "AliRunTag.h"
 #include "AliEventTag.h"
 #include "AliLog.h"
+#include "AliRunTagCuts.h"
+#include "AliLHCTagCuts.h"
+#include "AliDetectorTagCuts.h"
+#include "AliEventTagCuts.h"
 
 #include <TObjArray.h>
 #include <TAxis.h>
@@ -121,6 +125,10 @@ AliEventPoolSparse::AliEventPoolSparse() :
   fLHCCut(0x0),
   fDetCut(0x0),
   fEvCut(0x0),
+  fRunTagCut(0x0),
+  fEventTagCut(0x0),
+  fDetectorTagCut(0x0),
+  fLHCTagCut(0x0),
   fBinNumber(0)
 {
   // Default constructor. Initializes the THnSparseI,
@@ -145,6 +153,10 @@ AliEventPoolSparse::AliEventPoolSparse(const char* name, const char* title, TCha
   fLHCCut(0x0),
   fDetCut(0x0),
   fEvCut(0x0),
+  fRunTagCut(0x0),
+  fEventTagCut(0x0),
+  fDetectorTagCut(0x0),
+  fLHCTagCut(0x0),
   fBinNumber(0){
   // Constructor. Initializes the THnSparseI,
   // the initial size of the pool array and the array itself
@@ -181,6 +193,12 @@ AliEventPoolSparse::~AliEventPoolSparse() {
   delete fLHCCut;
   delete fDetCut;
   delete fEvCut;
+
+  delete fRunTagCut;
+  delete fEventTagCut;
+  delete fDetectorTagCut;
+  delete fLHCTagCut;
+
 }
 
 
@@ -257,13 +275,15 @@ void  AliEventPoolSparse::Init(){
 
     if (current != fTagChain->GetTreeNumber()) {        
       // Update the formula leaves if a new file is processed by the chain
-      if (fRunCut) fRunCut->UpdateFormulaLeaves();      
-      if (fLHCCut) fLHCCut->UpdateFormulaLeaves();      
-      if (fDetCut) fDetCut->UpdateFormulaLeaves();      
-      if (fEvCut)  fEvCut->UpdateFormulaLeaves();
+//       if (fRunCut) fRunCut->UpdateFormulaLeaves();   
+//       if (fLHCCut) fLHCCut->UpdateFormulaLeaves();   
+//       if (fDetCut) fDetCut->UpdateFormulaLeaves();   
+//       if (fEvCut)  fEvCut->UpdateFormulaLeaves();
+
+      if (fEventTagCut) fEventTagCut->InitializeTriggerClasses(tag->GetActiveTriggerClasses());
 
       for (Int_t ivar=0; ivar<fHnSparseI.GetNdimensions(); ++ivar)
-       if (fVars[ivar]) fVars[ivar]->UpdateFormulaLeaves();
+       if (fVars[ivar]) fVars[ivar]->UpdateFormulaLeaves();
 
       // Create the ESD/AOD chain if not done
       if (!fChain) {
@@ -281,65 +301,133 @@ void  AliEventPoolSparse::Init(){
       // Update the tree number
       current = fTagChain->GetTreeNumber();
     }
+    
+    // Deprecated use of TTreeFormulas
+//     // Apply Run, LHC, and detector cuts if they exist
+//     if(!fRunCut || fRunCut->EvalInstance(iTagFiles) == 1) {          
+//       if(!fLHCCut || fLHCCut->EvalInstance(iTagFiles) == 1) {        
+//     if(!fDetCut || fDetCut->EvalInstance(iTagFiles) == 1) {
+        
 
-    // Apply Run, LHC, and detector cuts if they exist
-    if(!fRunCut || fRunCut->EvalInstance(iTagFiles) == 1) {     
-      if(!fLHCCut || fLHCCut->EvalInstance(iTagFiles) == 1) {   
-       if(!fDetCut || fDetCut->EvalInstance(iTagFiles) == 1) {
+//       // Get access to the event data in the TTreeFormula
+//       if (fEvCut) fEvCut->GetNdata();
+//       for (Int_t ivar=0; ivar<fHnSparseI.GetNdimensions(); ++ivar)
+//         if (fVars[ivar]) fVars[ivar]->GetNdata();
         
+//       // Loop on events
+//       //      const TClonesArray *tagList = tag->GetEventTags();
+//       Int_t iFiles = tag->GetNFiles();
+//       for (int ifs = 0; ifs<iFiles; ifs++) {
+//         AliFileTag *eftag = (AliFileTag *) tag->GetFileTag(ifs);
+
+//         guid = eftag->GetGUID();     
+//         turl = eftag->GetTURL();     
+//         path = eftag->GetPath();     
+           
+//         Int_t iEvents = eftag->GetNEvents();
+//         for(Int_t i = 0; i < iEvents; i++) {         
+//           evTag = (AliEventTag *) eftag->GetEventTag(i);     
+             
+             
+//           if(!fEvCut || fEvCut->EvalInstance(i) == 1) {
+//             TEntryList *fLocalList = new TEntryList();
+//             fLocalList->SetTreeName(fChain->GetName());
+//             fLocalList->SetFileName(turl.Data());
+//             fLocalList->Enter(i);
+               
+               
+//             // Add this event to the corresponding pool
+//             {
+//               // Increment the bin content corrresponding to the vector "x" by "w",
+//               // and store the event index iev to the array associated with the bin,
+//               // then return the bin index.
+                 
+//               for (Int_t ivar=0; ivar<ndim; ++ivar) x[ivar] = fVars[ivar]->EvalInstance(i);
+                 
+//               Int_t bin =  fHnSparseI.Fill(x);
+//               // Check if we have to enlarge the array of pointers
+//               if (bin>=fN) Set(bin+fChunkSize);
+//               // Allocate the TEntryList if this is the first use of it
+//               if (!fPool[bin]) fPool[bin] = new TEntryList();
+//               // Add the event iev to the corresponding bin
+//               fPool[bin]->Add(fLocalList);
+//             }
+//           }
+//         }//event loop        
+         
+//         for (Int_t ipool=0; ipool<fHnSparseI.GetNbins(); ++ipool) 
+//           fPool[ipool]->OptimizeStorage();
+           
+//         // Add the current file to the ESD/AOD chain
+//         if(!path.IsNull()) fChain->AddFile(path);    
+//         else if(!turl.IsNull()) fChain->AddFile(turl);
+//       }
+//     }//detector tag cuts
+//       }//lhc tag cuts
+//     }//run tag cut   
 
-         // Get access to the event data in the TTreeFormula
-         if (fEvCut) fEvCut->GetNdata();
-         for (Int_t ivar=0; ivar<fHnSparseI.GetNdimensions(); ++ivar)
-           if (fVars[ivar]) fVars[ivar]->GetNdata();
+    // Apply Run, LHC, and detector cuts if they exist
+    if(!fRunTagCut || fRunTagCut->IsAccepted(tag)) {    
+      if(!fLHCTagCut || fLHCTagCut->IsAccepted(tag->GetLHCTag())) {     
+       if(!fDetectorTagCut || fDetectorTagCut->IsAccepted(tag->GetDetectorTags())) {
+        
+//       // Get access to the event data in the TTreeFormula
+//       if (fEvCut) fEvCut->GetNdata();
+         for (Int_t ivar=0; ivar<fHnSparseI.GetNdimensions(); ++ivar)
+           if (fVars[ivar]) fVars[ivar]->GetNdata();
         
          // Loop on events
-         const TClonesArray *tagList = tag->GetEventTags();
-         Int_t iEvents = tagList->GetEntries();
-         for(Int_t i = 0; i < iEvents; i++) {   
-           evTag = (AliEventTag *) tagList->At(i);      
-
-           guid = evTag->GetGUID();     
-           turl = evTag->GetTURL();     
-           path = evTag->GetPath();     
-
-
-           if(!fEvCut || fEvCut->EvalInstance(i) == 1) {
-             TEntryList *fLocalList = new TEntryList();
-             fLocalList->SetTreeName(fChain->GetName());
-             fLocalList->SetFileName(turl.Data());
-             fLocalList->Enter(i);
-
-
-             // Add this event to the corresponding pool
-             {
-               // Increment the bin content corrresponding to the vector "x" by "w",
-               // and store the event index iev to the array associated with the bin,
-               // then return the bin index.
-
-               for (Int_t ivar=0; ivar<ndim; ++ivar) x[ivar] = fVars[ivar]->EvalInstance(i);
+         //      const TClonesArray *tagList = tag->GetEventTags();
+         Int_t iFiles = tag->GetNFiles();
+         for (int ifs = 0; ifs<iFiles; ifs++) {
+           AliFileTag *eftag = (AliFileTag *) tag->GetFileTag(ifs);
+
+           guid = eftag->GetGUID();     
+           turl = eftag->GetTURL();     
+           path = eftag->GetPath();     
+           
+           Int_t iEvents = eftag->GetNEvents();
+           for(Int_t i = 0; i < iEvents; i++) {         
+             evTag = (AliEventTag *) eftag->GetEventTag(i);     
+             
+             
+             if(!fEventTagCut || fEventTagCut->IsAccepted(evTag)) {
+               TEntryList *fLocalList = new TEntryList();
+               fLocalList->SetTreeName(fChain->GetName());
+               fLocalList->SetFileName(turl.Data());
+               fLocalList->Enter(i);
+               
                
-               Int_t bin =  fHnSparseI.Fill(x);
-               // Check if we have to enlarge the array of pointers
-               if (bin>=fN) Set(bin+fChunkSize);
-               // Allocate the TEntryList if this is the first use of it
-               if (!fPool[bin]) fPool[bin] = new TEntryList();
-               // Add the event iev to the corresponding bin
-               fPool[bin]->Add(fLocalList);
+               // Add this event to the corresponding pool
+               {
+                 // Increment the bin content corrresponding to the vector "x" by "w",
+                 // and store the event index iev to the array associated with the bin,
+                 // then return the bin index.
+                 
+                 for (Int_t ivar=0; ivar<ndim; ++ivar) x[ivar] = fVars[ivar]->EvalInstance(i);
+                 
+                 Int_t bin =  fHnSparseI.Fill(x);
+                 // Check if we have to enlarge the array of pointers
+                 if (bin>=fN) Set(bin+fChunkSize);
+                 // Allocate the TEntryList if this is the first use of it
+                 if (!fPool[bin]) fPool[bin] = new TEntryList();
+                 // Add the event iev to the corresponding bin
+                 fPool[bin]->Add(fLocalList);
+               }
              }
-           }
-         }//event loop          
+           }//event loop        
          
-         for (Int_t ipool=0; ipool<fHnSparseI.GetNbins(); ++ipool) 
-           fPool[ipool]->OptimizeStorage();
-
-         // Add the current file to the ESD/AOD chain
-         if(!path.IsNull()) fChain->AddFile(path);      
-         else if(!turl.IsNull()) fChain->AddFile(turl);
-        
+           for (Int_t ipool=0; ipool<fHnSparseI.GetNbins(); ++ipool) 
+             fPool[ipool]->OptimizeStorage();
+           
+           // Add the current file to the ESD/AOD chain
+           if(!path.IsNull()) fChain->AddFile(path);    
+           else if(!turl.IsNull()) fChain->AddFile(turl);
+         }
        }//detector tag cuts
       }//lhc tag cuts
     }//run tag cut      
+
   }//tag file loop      
 
   delete [] x;
@@ -375,6 +463,27 @@ void AliEventPoolSparse::SetEventCut(const char * cut){
 }
 
 // _________________________________________________________________________
+void AliEventPoolSparse::SetRunCut(AliRunTagCuts* cut)
+{
+  fRunTagCut = cut;
+}
+// _________________________________________________________________________
+void AliEventPoolSparse::SetEventCut(AliEventTagCuts* cut)
+{
+  fEventTagCut = cut;
+}
+// _________________________________________________________________________
+void AliEventPoolSparse::SetDetectorCut(AliDetectorTagCuts* cut)
+{
+  fDetectorTagCut = cut;
+}
+// _________________________________________________________________________
+void AliEventPoolSparse::SetLHCCut(AliLHCTagCuts* cut)
+{
+  fLHCTagCut = cut;
+}
+
+// _________________________________________________________________________
 void AliEventPoolSparse::Set(Int_t n){
   // Set size of the array of pointers to n.
   // A new array is created, the old contents copied to the new array,
index 8ca2f10..3bcfb90 100644 (file)
 
 class TChain;
 class TTreeFormula;
+class AliRunTagCuts;
+class AliEventTagCuts;
+class AliDetectorTagCuts;
+class AliLHCTagCuts;
 
 //_____________________________________________________________________________
 class AliEventPoolSparse : public AliVEventPool {
@@ -62,6 +66,11 @@ class AliEventPoolSparse : public AliVEventPool {
   void SetDetCut(const char * cut);
   void SetEventCut(const char * cut);
 
+  void SetRunCut(AliRunTagCuts* cut);
+  void SetEventCut(AliEventTagCuts* cut);
+  void SetDetectorCut(AliDetectorTagCuts* cut);
+  void SetLHCCut(AliLHCTagCuts* cut);
+
   TTreeFormula ** GetPoolVars() const {return fVars;}
   TTreeFormula * GetRunCut() const {return fRunCut;}
   TTreeFormula * GetLHCCut() const {return fLHCCut;}
@@ -91,9 +100,15 @@ class AliEventPoolSparse : public AliVEventPool {
   TTreeFormula * fLHCCut;// LNC-based selection
   TTreeFormula * fDetCut;// Detector-based selection
   TTreeFormula * fEvCut; // Event-based selection
+
+  AliRunTagCuts *fRunTagCut; // RunTag class cut
+  AliEventTagCuts *fEventTagCut; // EventTag class cut
+  AliDetectorTagCuts *fDetectorTagCut; // DetectorTag class cut
+  AliLHCTagCuts *fLHCTagCut; // LHCTag class cut
+
   Int_t fBinNumber;      // Current bin
   
-  ClassDef(AliEventPoolSparse,1)  // 
+  ClassDef(AliEventPoolSparse,2)  // 
 };
 
 #endif
index 1436463..6e28d09 100644 (file)
@@ -178,6 +178,8 @@ TChain *AliTagAnalysis::QueryTags(AliRunTagCuts *runTagCuts,
   //Defining tag objects
   AliRunTag   *tag     = new AliRunTag;
   AliEventTag *evTag   = 0x0;
+  AliFileTag  *flTag   = 0x0;
+
   fChain->SetBranchAddress("AliTAG",&tag);
 
   TString guid;
@@ -190,24 +192,39 @@ TChain *AliTagAnalysis::QueryTags(AliRunTagCuts *runTagCuts,
   
   for(Int_t iEntry = 0; iEntry < fChain->GetEntries(); iEntry++) {
     fChain->GetEntry(iEntry);
+    evTagCuts->InitializeTriggerClasses(tag->GetActiveTriggerClasses());
 
     if(runTagCuts->IsAccepted(tag)) {
       if(lhcTagCuts->IsAccepted(tag->GetLHCTag())) {
        if(detTagCuts->IsAccepted(tag->GetDetectorTags())) {
          localList->Reset();
          Int_t iEvents = tag->GetNEvents();
-         const TClonesArray *tagList = tag->GetEventTags();
-         for(Int_t i = 0; i < iEvents; i++) {
-           evTag = (AliEventTag *) tagList->At(i);
-           guid = evTag->GetGUID(); 
-           turl = evTag->GetTURL(); 
-           path = evTag->GetPath();
-           localList->SetTreeName(aliceFile.Data());
-           if(turl!="") localList->SetFileName(turl.Data());
-           else localList->SetFileName(path.Data());
+         
+         for (int i = 0; i < iEvents; i++) {
+           //      evTag = tag->GetEventTag(i);
+           flTag = tag->GetFileTagForEvent(i);
+           guid = flTag->GetGUID();
+           turl = flTag->GetTURL();
+           path = flTag->GetPath();
+           localList->SetTreeName(aliceFile.Data());
+           if(turl!="") localList->SetFileName(turl.Data());
+           else localList->SetFileName(path.Data());
+
+           if(evTagCuts->IsAccepted(tag->GetEventTag(i))) localList->Enter(i);
+         }
+
+//       const TClonesArray *tagList = tag->GetEventTags();
+//       for(Int_t i = 0; i < iEvents; i++) {
+//         evTag = (AliEventTag *) tagList->At(i);
+//         guid = evTag->GetGUID(); 
+//         turl = evTag->GetTURL(); 
+//         path = evTag->GetPath();
+//         localList->SetTreeName(aliceFile.Data());
+//         if(turl!="") localList->SetFileName(turl.Data());
+//         else localList->SetFileName(path.Data());
            
-           if(evTagCuts->IsAccepted(evTag)) localList->Enter(i);
-         }//event loop
+//         if(evTagCuts->IsAccepted(evTag)) localList->Enter(i);
+//       }//event loop
          iAccepted += localList->GetN();
          if(turl != "")      esdChain->AddFile(turl);
          else if(path != "") esdChain->AddFile(path);
@@ -281,16 +298,18 @@ TChain *AliTagAnalysis::QueryTags(const char *fRunCut,
        if(fDetectorFormula->EvalInstance(iTagFiles) == 1) {
           localList->Reset();   
          Int_t iEvents = fEventFormula->GetNdata();     
-         const TClonesArray *tagList = tag->GetEventTags();     
-         for(Int_t i = 0; i < iEvents; i++) {   
-           evTag = (AliEventTag *) tagList->At(i);      
-           guid = evTag->GetGUID();     
-           turl = evTag->GetTURL();     
-           path = evTag->GetPath();     
-           localList->SetTreeName(aliceFile.Data());
-           localList->SetFileName(turl.Data());
-           if(fEventFormula->EvalInstance(i) == 1) localList->Enter(i);
-         }//event loop          
+         // *** FIXME ***
+
+//       const TClonesArray *tagList = tag->GetEventTags();     
+//       for(Int_t i = 0; i < iEvents; i++) {   
+//         evTag = (AliEventTag *) tagList->At(i);      
+//         guid = evTag->GetGUID();     
+//         turl = evTag->GetTURL();     
+//         path = evTag->GetPath();     
+//         localList->SetTreeName(aliceFile.Data());
+//         localList->SetFileName(turl.Data());
+//         if(fEventFormula->EvalInstance(i) == 1) localList->Enter(i);
+//       }//event loop          
 
          if(path != "")      esdChain->AddFile(path);   
          else if(turl != "") esdChain->AddFile(turl);   
@@ -354,44 +373,80 @@ AliTagAnalysis::CreateXMLCollection(const char* name,
   //Defining tag objects
   AliRunTag* tag = new AliRunTag;
   fChain->SetBranchAddress("AliTAG",&tag);
+
+  Int_t iTagFiles = 0;
   
-  for(Int_t iTagFiles = 0; iTagFiles < fChain->GetListOfFiles()->GetEntries(); ++iTagFiles) 
+  AliEventTag *evTag = 0x0;
+  AliFileTag  *flTag = 0x0;
+
+  //  for(Int_t iTagFiles = 0; iTagFiles < fChain->GetListOfFiles()->GetEntries(); ++iTagFiles) 
+  for(Int_t iRunTags = 0; iRunTags < fChain->GetEntries(); ++iRunTags) 
   {
-    fChain->GetEntry(iTagFiles);
+    fChain->GetEntry(iRunTags);
     //Event list
     iTotalEvents += tag->GetNEvents();
     localList.Reset();
     
+    evTagCuts->InitializeTriggerClasses(tag->GetActiveTriggerClasses());
+    
     if ( !runTagCuts || ( runTagCuts && runTagCuts->IsAccepted(tag) ) ) 
       {
        if ( !lhcTagCuts || ( lhcTagCuts && lhcTagCuts->IsAccepted(tag->GetLHCTag())) ) 
          {
            if ( !detTagCuts || ( detTagCuts && detTagCuts->IsAccepted(tag->GetDetectorTags())) )
              {
-               Int_t i(0);
-               TIter next(tag->GetEventTags());
-               AliEventTag* evTag(0x0);
-               iRejectedEvtInFile = 0;
-               iAcceptedEvtInFile = 0;
-               while ( ( evTag = static_cast<AliEventTag*>(next()) ) )
+               for (int iChunk = 0; iChunk < tag->GetNFiles(); iChunk++, iTagFiles++) 
                  {
-                   guid = evTag->GetGUID(); 
-                   turl = evTag->GetTURL(); 
+                   iRejectedEvtInFile = 0;
+                   iAcceptedEvtInFile = 0;
+
+                   flTag = tag->GetFileTag(iChunk);
+                   guid = flTag->GetGUID();
+                   turl = flTag->GetTURL();
                    lfn = turl(8,turl.Length());
-                   if( !evTagCuts || ( evTagCuts && evTagCuts->IsAccepted(evTag)) )
-            {
-             localList.Enter(i);
-              iAcceptedEvtInFile++;
-            }
-                   else 
+
+                   for (int i = 0; i<flTag->GetNEvents(); i++) 
                      {
-                       ++iRejectedEvt;
-                       ++iRejectedEvtInFile;
+                       //                      evTag = flTag->GetEventTag(i);
+               
+                       if( !evTagCuts || ( evTagCuts && evTagCuts->IsAccepted(flTag->GetEventTag(i))) )
+                         {
+                           localList.Enter(i);
+                           iAcceptedEvtInFile++;
+                         }
+                       else 
+                         {
+                           ++iRejectedEvt;
+                           ++iRejectedEvtInFile;
+                         }
                      }
-                   ++i;
-                 }//event loop
-               iAccepted += localList.GetN();
-               collection.WriteBody(iTagFiles+1,guid,lfn,turl,&localList,iAcceptedEvtInFile,iRejectedEvtInFile);
+               // *** FIXME ***
+//             Int_t i(0);
+
+//             TIter next(tag->GetEventTags());
+//             AliEventTag* evTag(0x0);
+//             iRejectedEvtInFile = 0;
+//             iAcceptedEvtInFile = 0;
+//             while ( ( evTag = static_cast<AliEventTag*>(next()) ) )
+//               {
+//                 guid = evTag->GetGUID(); 
+//                 turl = evTag->GetTURL(); 
+//                 lfn = turl(8,turl.Length());
+//                 if( !evTagCuts || ( evTagCuts && evTagCuts->IsAccepted(evTag)) )
+//                   {
+//                     localList.Enter(i);
+//                     iAcceptedEvtInFile++;
+//                   }
+//                 else 
+//                   {
+//                     ++iRejectedEvt;
+//                     ++iRejectedEvtInFile;
+//                   }
+//                 ++i;
+//               }//event loop
+                   iAccepted += localList.GetN();
+                   collection.WriteBody(iTagFiles+1,guid,lfn,turl,&localList,iAcceptedEvtInFile,iRejectedEvtInFile);
+                 } // chunk loop
              }//detector tag cuts
            else {
              iRejectedDet += tag->GetNEvents();
@@ -476,23 +531,27 @@ Bool_t AliTagAnalysis::CreateXMLCollection(const char* name,
       if(fLHCFormula->EvalInstance(iTagFiles) == 1) {   
        if(fDetectorFormula->EvalInstance(iTagFiles) == 1) {     
          Int_t iEvents = fEventFormula->GetNdata();
-         const TClonesArray *tagList = tag->GetEventTags();
-         iRejectedEvtInFile = 0;
-         iAcceptedEvtInFile = 0;
-         for(Int_t i = 0; i < iEvents; i++) {
-           evTag = (AliEventTag *) tagList->At(i);
-           guid = evTag->GetGUID(); 
-           turl = evTag->GetTURL(); 
-           lfn = turl(8,turl.Length());
-           if(fEventFormula->EvalInstance(i) == 1) {
-             localList->Enter(i);
-             iAcceptedEvtInFile++;
-           }
-           else {
-             iRejectedEvt++;
-             iRejectedEvtInFile++;
-           }
-         }//event loop
+         // *** FIXME ***
+
+
+//       const TClonesArray *tagList = tag->GetEventTags();
+//       iRejectedEvtInFile = 0;
+//       iAcceptedEvtInFile = 0;
+//       for(Int_t i = 0; i < iEvents; i++) {
+//         evTag = (AliEventTag *) tagList->At(i);
+//         guid = evTag->GetGUID(); 
+//         turl = evTag->GetTURL(); 
+//         lfn = turl(8,turl.Length());
+//         if(fEventFormula->EvalInstance(i) == 1) {
+//           localList->Enter(i);
+//           iAcceptedEvtInFile++;
+//         }
+//         else {
+//           iRejectedEvt++;
+//           iRejectedEvtInFile++;
+//         }
+//       }//event loop
+
          collection->WriteBody(iTagFiles+1,guid,lfn,turl,localList,iAcceptedEvtInFile, iRejectedEvtInFile);
          iAccepted += localList->GetN();
        }//detector tag cuts
index e052542..6191d48 100644 (file)
@@ -36,6 +36,7 @@
 //AliRoot
 #include "AliRunTag.h"
 #include "AliEventTag.h"
+#include "AliFileTag.h"
 #include "AliPID.h"
 #include "AliAODEvent.h"
 #include "AliAODVertex.h"
@@ -227,7 +228,7 @@ void AliAODTagCreator::CreateTag(TChain* chain, const char *type) {
     while((name = gSystem->GetDirEntry(dirp))) {
        if (strstr(name,tagPattern)) fTreeTEsd->Add(name);
     }//directory loop
-    AliInfo(Form("Chained tag files: %lld", fTreeTEsd->GetEntries()));
+    AliInfo(Form("Chained tag files: %lld",fTreeTEsd->GetEntries()));
       
     fChain = chain;
     
@@ -297,14 +298,16 @@ void AliAODTagCreator::CreateTags(const char* type)
     Int_t ntags    = 0;
     Int_t tagentry = 0;
     const TClonesArray *evTagList = 0;
-   
+    TString foldguid = "";
+
     for (Int_t iEventNumber = 0; iEventNumber < nEvents; iEventNumber++) {
        // Copy old tag information
        if (iEventNumber >= ntags) {
            fTreeTEsd->GetEntry(tagentry++);
            fRunTag->CopyStandardContent(fRunTagEsd);
-           evTagList = fRunTagEsd->GetEventTags();
-           ntags += evTagList->GetEntries();
+//         evTagList = fRunTagEsd->GetEventTags();
+//         ntags += evTagList->GetEntries();
+           ntags = fRunTagEsd->GetNEvents();
        }
 
        // Create a new Tag
@@ -330,13 +333,16 @@ void AliAODTagCreator::CreateTags(const char* type)
        FillEventTag(fAODEvent, evTag);
        // Set the event and input file references
        //evTag->SetEventId(iEventNumber+1);
-       evTag->SetGUID(fguid);
-       if(!strcmp(type,"grid")) {
-           evTag->SetMD5("");
-           evTag->SetTURL(fturl);
-           evTag->SetSize(0);
-           }
-       else evTag->SetPath(fturl);
+       
+       // **** FIXME ****
+//     evTag->SetGUID(fguid);
+//     if(!strcmp(type,"grid")) {
+//         evTag->SetMD5("");
+//         evTag->SetTURL(fturl);
+//         evTag->SetSize(0);
+//         }
+//     else evTag->SetPath(fturl);
+       //  **** FIXME ****
 
        // Check if a new run has to be created
        // File has changed
@@ -344,13 +350,58 @@ void AliAODTagCreator::CreateTags(const char* type)
            ftempGuid = fguid;
            fTreeT->Fill();
            fRunTag->Clear("");
+
+           AliFileTag *nftag = new AliFileTag();
+           
+           if(fSession == "grid") {
+             nftag->SetMD5("");
+             nftag->SetTURL(fturl);
+             nftag->SetSize(0);
+           }
+           else {
+             nftag->SetPath(fturl);
+             nftag->SetSize(0);
+             nftag->SetMD5("");
+             nftag->SetTURL(fturl);
+           }
+      
+           if (fRunTag->GetFileId(fguid) > -1)
+             AliFatal("Adding a file which is already in the RunTag.");
+           
+           fRunTag->AddFileTag(nftag);
+           
        }
+
        // Run# has changed
        if (oldRun != (fAODEvent->GetRunNumber()))
        {
            oldRun = fAODEvent->GetRunNumber();
+
+           fTreeT->Fill();
+           fRunTag->Clear("");
+           ftempGuid = fguid;
            fTreeT->Fill();
            fRunTag->Clear("");
+
+           AliFileTag *nftag = new AliFileTag();
+           
+           if(fSession == "grid") {
+             nftag->SetMD5("");
+             nftag->SetTURL(fturl);
+             nftag->SetSize(0);
+           }
+           else {
+             nftag->SetPath(fturl);
+             nftag->SetSize(0);
+             nftag->SetMD5("");
+             nftag->SetTURL(fturl);
+           }
+      
+           if (fRunTag->GetFileId(fguid) > -1)
+             AliFatal("Adding a file which is already in the RunTag.");
+           
+           fRunTag->AddFileTag(nftag);
+           
        }
        
        // Add the event tag
index 7bed0f0..42f1c60 100644 (file)
@@ -36,7 +36,7 @@ class TGridResult;
 class AliAODEvent;
 class AliRunTag;
 class AliEventTag;
-
+class AliFileTag;
 
 //___________________________________________________________________________
 class AliAODTagCreator : public AliTagCreator {
index 2348726..5888ca6 100644 (file)
@@ -33,18 +33,31 @@ ClassImp(AliDetectorTag)
 AliDetectorTag::AliDetectorTag() :
   TObject(),
   fMaskDAQ(0),
-  fMaskReco(0)
+  fMaskReco(0),
+  fDetectorValidityRange(),
+  fDetectorStatus()
 {
   // Default constructor
+  for (int iter=0; iter<AliDAQ::kHLTId; iter++) {
+    fDetectorValidityRange[iter] = 0;
+    fDetectorStatus[iter] = "";
+  }
 }
 
 //___________________________________________________________________________
 AliDetectorTag::AliDetectorTag(const AliDetectorTag & detTag) :
   TObject(detTag),
   fMaskDAQ(detTag.fMaskDAQ),
-  fMaskReco(detTag.fMaskReco)
- {
+  fMaskReco(detTag.fMaskReco),
+  fDetectorValidityRange(),
+  fDetectorStatus() 
+{
   // DetectorTag copy constructor
+  
+  for (int iter=0; iter<AliDAQ::kHLTId; iter++) {
+    fDetectorValidityRange[iter] = detTag.GetDetectorValidityRange(iter);
+    fDetectorStatus[iter] = detTag.GetDetectorStatus(iter);
+  }
 }
 
 //___________________________________________________________________________
@@ -55,6 +68,10 @@ AliDetectorTag & AliDetectorTag::operator=(const AliDetectorTag &detTag) {
     
     fMaskDAQ = detTag.fMaskDAQ;   
     fMaskReco = detTag.fMaskReco;   
+    for (int iter=0; iter<AliDAQ::kHLTId; iter++) {
+      fDetectorValidityRange[iter] = detTag.GetDetectorValidityRange(iter);
+      fDetectorStatus[iter] = detTag.GetDetectorStatus(iter);
+    }
   }
   return *this;
 }
@@ -64,6 +81,14 @@ AliDetectorTag::~AliDetectorTag() {
   // Destructor
 }
 
+void AliDetectorTag::UpdateFromRunTable(AliDetectorTag &detTag)
+{
+  for (int iter=0; iter<AliDAQ::kHLTId; iter++) {
+    fDetectorValidityRange[iter] = detTag.GetDetectorValidityRange(iter);
+    fDetectorStatus[iter] = detTag.GetDetectorStatus(iter);
+  }
+}
+
 
 //___________________________________________________________________________
 // void AliDetectorTag::SetDetectorConfiguration() {
index 3befcc4..67dc5f3 100644 (file)
@@ -26,14 +26,20 @@ class AliDetectorTag : public TObject {
   AliDetectorTag &operator=(const AliDetectorTag &rhs);
   virtual ~AliDetectorTag();
   
+  void UpdateFromRunTable(AliDetectorTag &detTag);
+
   //____________________________________________________//
   void SetDetectorMask(UInt_t mask)     {fMaskDAQ = mask; fMaskReco = mask; }
   void SetDetectorMaskDAQ(UInt_t mask)  {fMaskDAQ = mask;}
   void SetDetectorMaskReco(UInt_t mask) {fMaskReco = mask;}
+  void SetDetectorValidityRange(UChar_t idet, UShort_t vr) {fDetectorValidityRange[idet] = vr; }
+  void SetDetectorStatus(UChar_t idet, TString co) { fDetectorStatus[idet] = co; }
   TObjArray *GetDetectorMask() { return 0; } // {return fDetectorArray;}
   UInt_t GetIntDetectorMask() { return fMaskDAQ; }
   UInt_t GetIntDetectorMaskDAQ() { return fMaskDAQ; }
   UInt_t GetIntDetectorMaskReco() { return fMaskReco; }
+  UShort_t GetDetectorValidityRange(UChar_t idet) const { return fDetectorValidityRange[idet]; }
+  TString  GetDetectorStatus(UChar_t idet) const { return fDetectorStatus[idet]; }
   const char *GetDetectorMaskDAQ() { return AliDAQ::ListOfTriggeredDetectors(fMaskDAQ); }
   const char *GetDetectorMaskReco() { return AliDAQ::ListOfTriggeredDetectors(fMaskReco); }
   void PrintDetectorMask();
@@ -96,7 +102,10 @@ class AliDetectorTag : public TObject {
   //   Bool_t     fZDC;           //ZDC active = 1
   //   Bool_t     fEMCAL;         //EMCAL active = 1
 
-  ClassDef(AliDetectorTag, 5)  //(ClassName, ClassVersion)
+  UShort_t   fDetectorValidityRange[AliDAQ::kHLTId];
+  TString    fDetectorStatus[AliDAQ::kHLTId];
+
+  ClassDef(AliDetectorTag, 6)  //(ClassName, ClassVersion)
 };
 //______________________________________________________________________________
 
index db130f5..150a9b8 100644 (file)
@@ -34,9 +34,15 @@ AliDetectorTagCuts::AliDetectorTagCuts() :
   TObject(),
   fDetectorsReco(0),
   fDetectorsDAQ(0),
-  fDetectorsFlag(kFALSE)
+  fDetectorsFlag(kFALSE),
+  fDetectorValidityMatch(),
+  fDetectorValidityFlag()
 {
   //Default constructor which calls the Reset method.
+  for (int iter = 0; iter<AliDAQ::kHLTId; iter++) {
+    fDetectorValidityMatch[iter] = 0;
+    fDetectorValidityFlag[iter] = 0;
+  }
 }
 
 //___________________________________________________________________________
@@ -50,7 +56,13 @@ Bool_t AliDetectorTagCuts::IsAccepted(AliDetectorTag *detTag) const {
   if (fDetectorsFlag) {
     Bool_t daqsel = (detTag->GetIntDetectorMaskDAQ() & fDetectorsDAQ) > 0;
     Bool_t recsel = (detTag->GetIntDetectorMaskReco() & fDetectorsReco) > 0;
-    return (daqsel && recsel);
+    Bool_t valsel = kTRUE;
+    for (int iter=0;  iter<AliDAQ::kHLTId; iter++) {
+      if (fDetectorValidityFlag[iter])
+       if (!(fDetectorValidityMatch[iter] == detTag->GetDetectorValidityRange(iter)))
+         valsel = kFALSE;
+    }
+    return (daqsel && recsel && valsel);
   }
   return true;
 
@@ -64,6 +76,15 @@ Bool_t AliDetectorTagCuts::IsAccepted(AliDetectorTag *detTag) const {
 //   }
 //   return kTRUE;
 }
+  
+void AliDetectorTagCuts::SetDetectorValidityValue(TString det, UShort_t val)
+{
+  // Set Validity requiement for detector
+
+  Short_t detid = AliDAQ::DetectorID(det.Data());
+  fDetectorValidityMatch[detid] = val;
+  fDetectorsFlag = kTRUE;
+}
 
 //___________________________________________________________________________
 // Bool_t AliDetectorTagCuts::IsSelected(TString detName, TString& detectors) const {
index 50a7639..f975166 100644 (file)
@@ -28,6 +28,7 @@ class AliDetectorTagCuts : public TObject {
   void SetListOfDetectors(const TString& detectors) {fDetectorsDAQ = AliDAQ::DetectorPattern(detectors); fDetectorsReco = AliDAQ::DetectorPattern(detectors); fDetectorsFlag = kTRUE;}
   void SetListOfDetectorsDAQ(const TString& detectors) {fDetectorsDAQ = AliDAQ::DetectorPattern(detectors); fDetectorsFlag = kTRUE;}
   void SetListOfDetectorsReco(const TString& detectors) {fDetectorsReco = AliDAQ::DetectorPattern(detectors); fDetectorsFlag = kTRUE;}
+  void SetDetectorValidityValue(TString det, UShort_t val);
  
   Bool_t IsAccepted(AliDetectorTag *detTag) const;
 
@@ -39,8 +40,10 @@ class AliDetectorTagCuts : public TObject {
   UInt_t fDetectorsReco;  //selected detector pattern for Reco
   UInt_t fDetectorsDAQ;   //selected detector pattern for DAQ
   Bool_t fDetectorsFlag; //cut used or not
+  UShort_t   fDetectorValidityMatch[AliDAQ::kHLTId]; // Detector validity to match
+  Bool_t     fDetectorValidityFlag[AliDAQ::kHLTId];  // Flag if validity match is to be used
   
-  ClassDef(AliDetectorTagCuts, 2)
+  ClassDef(AliDetectorTagCuts, 3)
 };
 
 #endif
index 08043f9..02e2b4e 100644 (file)
@@ -201,7 +201,7 @@ Bool_t AliESDTagCreator::ReadCAFCollection(const char *filename) {
 void AliESDTagCreator::CreateTag(TChain* chain, const char *type) {
   //private method that creates tag files
   TString fSession = type;
-  TString fguid, fmd5, fturl;
+  TString fguid, fmd5, fturl, foldguid;
   TString fTempGuid;
 
   Int_t iRunNumber = 0;
@@ -230,7 +230,6 @@ void AliESDTagCreator::CreateTag(TChain* chain, const char *type) {
   localFileName += ".ESD.tag.root";
 
   TString fileName;
-  TRefArray tmp;
  
   if(fStorage == 0) {
     fileName = localFileName.Data();      
@@ -259,258 +258,64 @@ void AliESDTagCreator::CreateTag(TChain* chain, const char *type) {
   tag->SetMagneticField(esd->GetMagneticField());
   tag->SetBeamEnergy(esd->GetBeamEnergy());
   tag->SetBeamType(TString(esd->GetBeamType()));
+  tag->SetActiveTriggerClasses(esd->GetESDRun()->GetActiveTriggerClasses());
+  
+  foldguid = "";
 
   for(Int_t iEventNumber = 0; iEventNumber < chain->GetEntries(); iEventNumber++) {
     FillEventTag(chain, evTag, iEventNumber, esd);
-//     ntrack = 0; nPos = 0; nNeg = 0; nNeutr =0;
-//     nK0s = 0; nNeutrons = 0; nPi0s = 0;
-//     nGamas = 0; nProtons = 0; nKaons = 0;
-//     nPions = 0; nMuons = 0; nElectrons = 0; nFWMuons = 0; nFWMatchedMuons = 0;        
-//     nCh1GeV = 0; nCh3GeV = 0; nCh10GeV = 0;
-//     nMu1GeV = 0; nMu3GeV = 0; nMu10GeV = 0;
-//     nEl1GeV = 0; nEl3GeV = 0; nEl10GeV = 0;
-//     maxPt = .0; etamaxPt = -999.; phimaxPt = -999.; meanPt = .0; totalP = .0;
-//     fVertexflag = 1;
-    
-//     chain->GetEntry(iEventNumber);    
-//     esdold = esd->GetAliESDOld();
-//     if(esdold) esd->CopyFromOldESD();
+
+    if(iEventNumber == 0) iInitRunNumber = esd->GetRunNumber();
+    iRunNumber = esd->GetRunNumber();
+    if(iRunNumber != iInitRunNumber) AliFatal("Inconsistency of run numbers in the AliESD - You are trying to merge different runs!!!");
 
     TFile *file = chain->GetFile();
     const TUrl *url = file->GetEndpointUrl();
     fguid = file->GetUUID().AsString();
-    if(fSession == "grid") {
-      TString fturltemp = "alien://"; fturltemp += url->GetFile();
-      fturl = fturltemp(0,fturltemp.Index(".root",5,0,TString::kExact)+5);
-    }
-    else fturl = url->GetFile();
 
-    if(iEventNumber == 0) iInitRunNumber = esd->GetRunNumber();
-    iRunNumber = esd->GetRunNumber();
-    if(iRunNumber != iInitRunNumber) AliFatal("Inconsistency of run numbers in the AliESD - You are trying to merge different runs!!!");
+    if (foldguid == fguid) {
+      tag->AddEventTag(*evTag);
+    }
+    else {
+      AliFileTag *nftag = new AliFileTag();
 
-//     const AliESDVertex * vertexIn = esd->GetVertex();
-//     fVertexName = vertexIn->GetName();
-//     if(fVertexName == "default") fVertexflag = 0;
+      if(fSession == "grid") {
+       TString fturltemp = "alien://"; fturltemp += url->GetFile();
+       fturl = fturltemp(0,fturltemp.Index(".root",5,0,TString::kExact)+5);
+      }
+      else fturl = url->GetFile();
 
-//     for (Int_t iTrackNumber = 0; iTrackNumber < esd->GetNumberOfTracks(); iTrackNumber++) {
-//       AliESDtrack * esdTrack = esd->GetTrack(iTrackNumber);
-//       if(esdTrack->GetLabel() != 0) fIsSim = kTRUE;
-//       else if(esdTrack->GetLabel() == 0) fIsSim = kFALSE;
-//       UInt_t status = esdTrack->GetStatus();
-      
-//       //select only tracks with ITS refit
-//       if ((status&AliESDtrack::kITSrefit)==0) continue;
-//       //select only tracks with TPC refit
-//       if ((status&AliESDtrack::kTPCrefit)==0) continue;
-      
-//       //select only tracks with the "combined PID"
-//       if ((status&AliESDtrack::kESDpid)==0) continue;
-//       Double_t p[3];
-//       esdTrack->GetPxPyPz(p);
-//       Double_t pt2 = p[0]*p[0]+p[1]*p[1];
-//       Double_t momentum = TMath::Sqrt(pt2+p[2]*p[2]);
-//       Double_t fPt = TMath::Sqrt(pt2);
-//       totalP += momentum;
-//       meanPt += fPt;
-//       if(fPt > maxPt) {
-//       maxPt = fPt;
-//       phimaxPt = esdTrack->Phi();
-//       etamaxPt = esdTrack->Eta();
-//       }
-      
-//       if(esdTrack->GetSign() > 0) {
-//     nPos++;
-//     if(fPt > fLowPtCut) nCh1GeV++;
-//     if(fPt > fHighPtCut) nCh3GeV++;
-//     if(fPt > fVeryHighPtCut) nCh10GeV++;
-//       }
-//       if(esdTrack->GetSign() < 0) {
-//     nNeg++;
-//     if(fPt > fLowPtCut) nCh1GeV++;
-//     if(fPt > fHighPtCut) nCh3GeV++;
-//     if(fPt > fVeryHighPtCut) nCh10GeV++;
-//       }
-//       if(esdTrack->GetSign() == 0) nNeutr++;
-      
-//       //PID
-//       Double_t prob[5];
-//       esdTrack->GetESDpid(prob);
-      
-//       Double_t rcc = 0.0;
-//       for(Int_t i = 0; i < AliPID::kSPECIES; i++) rcc += prob[i]*partFrac[i];
-//       if(rcc == 0.0) continue;
-//       //Bayes' formula
-//       Double_t w[5];
-//       for(Int_t i = 0; i < AliPID::kSPECIES; i++) w[i] = prob[i]*partFrac[i]/rcc;
-      
-//       //protons
-//       if ((w[4]>w[3])&&(w[4]>w[2])&&(w[4]>w[1])&&(w[4]>w[0])) nProtons++;
-//       //kaons
-//       if ((w[3]>w[4])&&(w[3]>w[2])&&(w[3]>w[1])&&(w[3]>w[0])) nKaons++;
-//       //pions
-//       if ((w[2]>w[4])&&(w[2]>w[3])&&(w[2]>w[1])&&(w[2]>w[0])) nPions++; 
-//       //electrons
-//       if ((w[0]>w[4])&&(w[0]>w[3])&&(w[0]>w[2])&&(w[0]>w[1])) {
-//     nElectrons++;
-//     if(fPt > fLowPtCut) nEl1GeV++;
-//     if(fPt > fHighPtCut) nEl3GeV++;
-//     if(fPt > fVeryHighPtCut) nEl10GeV++;
-//       }       
-//       ntrack++;
-//     }//esd track loop
-    
-//     /////////////
-//     //muon code//
-//     ////////////
-//     Int_t nMuonTracks = esd->GetNumberOfMuonTracks();
-//     // loop over all reconstructed tracks (also first track of combination)
-//     for (Int_t iTrack = 0; iTrack <  nMuonTracks;  iTrack++) {
-//       AliESDMuonTrack* muonTrack = esd->GetMuonTrack(iTrack);
-//       if (muonTrack == 0x0) continue;
-      
-//       // Coordinates at vertex
-//       fZ = muonTrack->GetZ(); 
-//       fY = muonTrack->GetBendingCoor();
-//       fX = muonTrack->GetNonBendingCoor(); 
-      
-//       fThetaX = muonTrack->GetThetaX();
-//       fThetaY = muonTrack->GetThetaY();
-      
-//       fPyz = 1./TMath::Abs(muonTrack->GetInverseBendingMomentum());
-//       fPzRec = - fPyz / TMath::Sqrt(1.0 + TMath::Tan(fThetaY)*TMath::Tan(fThetaY));
-//       fPxRec = fPzRec * TMath::Tan(fThetaX);
-//       fPyRec = fPzRec * TMath::Tan(fThetaY);
-//       fCharge = Int_t(TMath::Sign(1.,muonTrack->GetInverseBendingMomentum()));
-      
-//       //ChiSquare of the track if needed
-//       fChisquare = muonTrack->GetChi2()/(2.0 * muonTrack->GetNHit() - 5);
-//       fEnergy = TMath::Sqrt(fMUONMASS * fMUONMASS + fPxRec * fPxRec + fPyRec * fPyRec + fPzRec * fPzRec);
-//       fEPvector.SetPxPyPzE(fPxRec, fPyRec, fPzRec, fEnergy);
-      
-//       if (muonTrack->GetMatchTrigger()>0) nFWMatchedMuons++;
+      if(fSession == "grid") {
+       nftag->SetMD5("");
+       nftag->SetTURL(fturl);
+       nftag->SetSize(0);
+      }
+      else {
+       nftag->SetPath(fturl);
+       nftag->SetSize(0);
+       nftag->SetMD5("");
+       nftag->SetTURL(fturl);
+      }
+      foldguid = fguid;
       
-//       nMuons++;
-//       nFWMuons++;
-//       if(fEPvector.Pt() > fLowPtCut) {
-//         nMu1GeV++; 
-//         if(fEPvector.Pt() > fHighPtCut) {
-//           nMu3GeV++; 
-//           if (fEPvector.Pt() > fVeryHighPtCut) {
-//             nMu10GeV++;
-//           }
-//         }
-//       }
-//     }//muon track loop
-    
-//     // Fill the event tags 
-//     if(ntrack != 0) meanPt = meanPt/ntrack;
-    
-//     //AliInfo(Form("====================================="));
-//     //AliInfo(Form("URL: %s - GUID: %s",fturl.Data(),fguid.Data()));
-//     //AliInfo(Form("====================================="));
-
-//     //First physics data
-//     const AliMultiplicity *spdMult = esd->GetMultiplicity();
-//     evTag->SetNumberOfFiredChipsLayer1(spdMult->GetNumberOfFiredChips(0));
-//     evTag->SetNumberOfFiredChipsLayer2(spdMult->GetNumberOfFiredChips(1));
-//     evTag->SetNumberOfSPDTracklets(spdMult->GetNumberOfTracklets());
-
-//     AliESDVZERO *vzeroData = esd->GetVZEROData();
-//     evTag->SetMTotV0A(vzeroData->GetMTotV0A());
-//     evTag->SetMTotV0C(vzeroData->GetMTotV0C());
-//     evTag->SetNbPMV0A(vzeroData->GetNbPMV0A());
-//     evTag->SetNbPMV0C(vzeroData->GetNbPMV0C());
-
-//     //evTag->SetEventId(iEventNumber+1);
-//     evTag->SetPeriodNumber(esd->GetPeriodNumber());
-//     evTag->SetOrbitNumber(esd->GetOrbitNumber());
-//     evTag->SetBunchCrossNumber(esd->GetBunchCrossNumber());
-//     evTag->SetGUID(fguid);
-    if(fSession == "grid") {
-      evTag->SetMD5("");
-      evTag->SetTURL(fturl);
-      evTag->SetSize(0);
+      if (tag->GetFileId(fguid) > -1)
+       AliFatal("Adding a file which is already in the RunTag.");
+
+      tag->AddFileTag(nftag);
     }
-    else evTag->SetPath(fturl);
-    
-//     evTag->SetVertexX(vertexIn->GetXv());
-//     evTag->SetVertexY(vertexIn->GetYv());
-//     evTag->SetVertexZ(vertexIn->GetZv());
-//     evTag->SetVertexZError(vertexIn->GetZRes());
-//     evTag->SetVertexFlag(fVertexflag);
-    
-//     evTag->SetT0VertexZ(esd->GetT0zVertex());
-    
-//     evTag->SetTriggerMask(esd->GetTriggerMask());
-//     evTag->SetTriggerCluster(esd->GetTriggerCluster());
-    
-//     evTag->SetEventType(esd->GetEventType());
-//     evTag->SetFiredTriggerClasses(esd->GetFiredTriggerClasses());
-
-//     evTag->SetZDCNeutron1Energy(esd->GetZDCN1Energy());
-//     evTag->SetZDCProton1Energy(esd->GetZDCP1Energy());
-//     evTag->SetZDCEMEnergy(esd->GetZDCEMEnergy(0),esd->GetZDCEMEnergy(1));
-//     evTag->SetZDCNeutron1Energy(esd->GetZDCN2Energy());
-//     evTag->SetZDCProton1Energy(esd->GetZDCP2Energy());
-//     evTag->SetNumOfParticipants(esd->GetZDCParticipants());
-    
-    
-//     evTag->SetNumOfTracks(esd->GetNumberOfTracks());
-//     evTag->SetNumOfPosTracks(nPos);
-//     evTag->SetNumOfNegTracks(nNeg);
-//     evTag->SetNumOfNeutrTracks(nNeutr);
-    
-//     evTag->SetNumOfV0s(esd->GetNumberOfV0s());
-//     evTag->SetNumOfCascades(esd->GetNumberOfCascades());
-//     evTag->SetNumOfKinks(esd->GetNumberOfKinks());
-//     evTag->SetNumOfPMDTracks(esd->GetNumberOfPmdTracks());
-    
-//     evTag->SetNumOfProtons(nProtons);
-//     evTag->SetNumOfKaons(nKaons);
-//     evTag->SetNumOfPions(nPions);
-//     evTag->SetNumOfMuons(nMuons);
-//     evTag->SetNumOfFWMuons(nFWMuons);
-//     evTag->SetNumOfFWMatchedMuons(nFWMatchedMuons);
-//     evTag->SetNumOfElectrons(nElectrons);
-//     evTag->SetNumOfPhotons(nGamas);
-//     evTag->SetNumOfPi0s(nPi0s);
-//     evTag->SetNumOfNeutrons(nNeutrons);
-//     evTag->SetNumOfKaon0s(nK0s);
-    
-//     evTag->SetNumOfChargedAbove1GeV(nCh1GeV);
-//     evTag->SetNumOfChargedAbove3GeV(nCh3GeV);
-//     evTag->SetNumOfChargedAbove10GeV(nCh10GeV);
-//     evTag->SetNumOfMuonsAbove1GeV(nMu1GeV);
-//     evTag->SetNumOfMuonsAbove3GeV(nMu3GeV);
-//     evTag->SetNumOfMuonsAbove10GeV(nMu10GeV);
-//     evTag->SetNumOfElectronsAbove1GeV(nEl1GeV);
-//     evTag->SetNumOfElectronsAbove3GeV(nEl3GeV);
-//     evTag->SetNumOfElectronsAbove10GeV(nEl10GeV);
-    
-//     tmp.Clear();
-//     evTag->SetNumOfPHOSClusters(esd->GetPHOSClusters(&tmp));
-//     tmp.Clear();
-//     evTag->SetNumOfEMCALClusters(esd->GetEMCALClusters(&tmp));
-    
-//     evTag->SetTotalMomentum(totalP);
-//     evTag->SetMeanPt(meanPt);
-//     evTag->SetMaxPt(maxPt);
-//     evTag->SetEtaMaxPt(etamaxPt);
-//     evTag->SetPhiMaxPt(phimaxPt);
-    
+
     tag->SetRunId(iInitRunNumber);
 //     if(fIsSim) tag->SetDataType(0);
 //     else tag->SetDataType(1);
 
-    if(fguid != fTempGuid) {
-      fTempGuid = fguid;
-      ttag->Fill();
-      tag->Clear("");
-    }
-    tag->AddEventTag(*evTag);
+//     if(fguid != fTempGuid) {
+//       fTempGuid = fguid;
+//       ttag->Fill();
+//       tag->Clear("");
+//     }
     if(iEventNumber+1 == chain->GetEntries()) {
       //AliInfo(Form("File: %s",fturl.Data()));
+
       ttag->Fill();
       tag->Clear("");
     }      
@@ -604,247 +409,22 @@ void AliESDTagCreator::CreateTag(TFile* file, const char *guid, const char *md5,
 
   t->GetEntry(0);
   Int_t iInitRunNumber = esd->GetRunNumber();
+  tag->SetMagneticField(esd->GetMagneticField());
+  tag->SetBeamEnergy(esd->GetBeamEnergy());
+  tag->SetBeamType(TString(esd->GetBeamType()));
+  tag->SetActiveTriggerClasses(esd->GetESDRun()->GetActiveTriggerClasses());
+
+  AliFileTag *eftag = new AliFileTag();
+  eftag->SetMD5(md5);
+  eftag->SetTURL(fturl);
+  eftag->SetSize(size);
+  tag->AddFileTag(eftag);
 
   Int_t iNumberOfEvents = (Int_t)t->GetEntries();
   for (Int_t iEventNumber = 0; iEventNumber < iNumberOfEvents; iEventNumber++) {
     FillEventTag(t, evTag, iEventNumber, esd);
-//     ntrack = 0;
-//     nPos = 0;
-//     nNeg = 0;
-//     nNeutr =0;
-//     nK0s = 0;
-//     nNeutrons = 0;
-//     nPi0s = 0;
-//     nGamas = 0;
-//     nProtons = 0;
-//     nKaons = 0;
-//     nPions = 0;
-//     nMuons = 0;
-//     nFWMuons = 0;
-//     nFWMatchedMuons = 0;
-//     nElectrons = 0;   
-//     nCh1GeV = 0;
-//     nCh3GeV = 0;
-//     nCh10GeV = 0;
-//     nMu1GeV = 0;
-//     nMu3GeV = 0;
-//     nMu10GeV = 0;
-//     nEl1GeV = 0;
-//     nEl3GeV = 0;
-//     nEl10GeV = 0;
-//     maxPt = .0;
-//     etamaxPt = -999.;
-//     phimaxPt = -999.;
-//     meanPt = .0;
-//     totalP = .0;
-//     fVertexflag = 1;
-    
-//     t->GetEntry(iEventNumber);
     iRunNumber = esd->GetRunNumber();
     if(iRunNumber != iInitRunNumber) AliFatal("Inconsistency of run numbers in the AliESD!!!");
-//     const AliESDVertex * vertexIn = esd->GetVertex();
-//     fVertexName = vertexIn->GetName();
-//     if(fVertexName == "default") fVertexflag = 0;
-
-//     for (Int_t iTrackNumber = 0; iTrackNumber < esd->GetNumberOfTracks(); iTrackNumber++) {
-//       AliESDtrack * esdTrack = esd->GetTrack(iTrackNumber);
-//       if(esdTrack->GetLabel() != 0) fIsSim = kTRUE;
-//       else if(esdTrack->GetLabel() == 0) fIsSim = kFALSE;
-//       UInt_t status = esdTrack->GetStatus();
-      
-//       //select only tracks with ITS refit
-//       if ((status&AliESDtrack::kITSrefit)==0) continue;
-//       //select only tracks with TPC refit
-//       if ((status&AliESDtrack::kTPCrefit)==0) continue;
-      
-//       //select only tracks with the "combined PID"
-//       if ((status&AliESDtrack::kESDpid)==0) continue;
-//       Double_t p[3];
-//       esdTrack->GetPxPyPz(p);
-//       Double_t pt2 = p[0]*p[0]+p[1]*p[1];
-//       Double_t momentum = TMath::Sqrt(pt2+p[2]*p[2]);
-//       Double_t fPt = TMath::Sqrt(pt2);
-//       totalP += momentum;
-//       meanPt += fPt;
-//       if(fPt > maxPt) {
-//       maxPt = fPt;
-//       etamaxPt = esdTrack->Eta();
-//       phimaxPt = esdTrack->Phi();
-//       }
-      
-             
-//       if(esdTrack->GetSign() > 0) {
-//     nPos++;
-//     if(fPt > fLowPtCut) nCh1GeV++;
-//     if(fPt > fHighPtCut) nCh3GeV++;
-//     if(fPt > fVeryHighPtCut) nCh10GeV++;
-//       }
-//       if(esdTrack->GetSign() < 0) {
-//     nNeg++;
-//     if(fPt > fLowPtCut) nCh1GeV++;
-//     if(fPt > fHighPtCut) nCh3GeV++;
-//     if(fPt > fVeryHighPtCut) nCh10GeV++;
-//       }
-//       if(esdTrack->GetSign() == 0) nNeutr++;
-      
-//       //PID
-//       Double_t prob[5];
-//       esdTrack->GetESDpid(prob);
-      
-//       Double_t rcc = 0.0;
-//       for(Int_t i = 0; i < AliPID::kSPECIES; i++) rcc += prob[i]*partFrac[i];
-//       if(rcc == 0.0) continue;
-//       //Bayes' formula
-//       Double_t w[5];
-//       for(Int_t i = 0; i < AliPID::kSPECIES; i++) w[i] = prob[i]*partFrac[i]/rcc;
-      
-//       //protons
-//       if ((w[4]>w[3])&&(w[4]>w[2])&&(w[4]>w[1])&&(w[4]>w[0])) nProtons++;
-//       //kaons
-//       if ((w[3]>w[4])&&(w[3]>w[2])&&(w[3]>w[1])&&(w[3]>w[0])) nKaons++;
-//       //pions
-//       if ((w[2]>w[4])&&(w[2]>w[3])&&(w[2]>w[1])&&(w[2]>w[0])) nPions++; 
-//       //electrons
-//       if ((w[0]>w[4])&&(w[0]>w[3])&&(w[0]>w[2])&&(w[0]>w[1])) {
-//     nElectrons++;
-//     if(fPt > fLowPtCut) nEl1GeV++;
-//     if(fPt > fHighPtCut) nEl3GeV++;
-//     if(fPt > fVeryHighPtCut) nEl10GeV++;
-//       }       
-//       ntrack++;
-//     }//esd track loop
-    
-//     /////////////
-//     //muon code//
-//     ////////////
-//     Int_t nMuonTracks = esd->GetNumberOfMuonTracks();
-//     // loop over all reconstructed tracks (also first track of combination)
-//     for (Int_t iTrack = 0; iTrack <  nMuonTracks;  iTrack++) {
-//       AliESDMuonTrack* muonTrack = esd->GetMuonTrack(iTrack);
-//       if (muonTrack == 0x0) continue;
-      
-//       // Coordinates at vertex
-//       fZ = muonTrack->GetZ(); 
-//       fY = muonTrack->GetBendingCoor();
-//       fX = muonTrack->GetNonBendingCoor(); 
-      
-//       fThetaX = muonTrack->GetThetaX();
-//       fThetaY = muonTrack->GetThetaY();
-      
-//       fPyz = 1./TMath::Abs(muonTrack->GetInverseBendingMomentum());
-//       fPzRec = - fPyz / TMath::Sqrt(1.0 + TMath::Tan(fThetaY)*TMath::Tan(fThetaY));
-//       fPxRec = fPzRec * TMath::Tan(fThetaX);
-//       fPyRec = fPzRec * TMath::Tan(fThetaY);
-//       fCharge = Int_t(TMath::Sign(1.,muonTrack->GetInverseBendingMomentum()));
-      
-//       //ChiSquare of the track if needed
-//       fChisquare = muonTrack->GetChi2()/(2.0 * muonTrack->GetNHit() - 5);
-//       fEnergy = TMath::Sqrt(fMUONMASS * fMUONMASS + fPxRec * fPxRec + fPyRec * fPyRec + fPzRec * fPzRec);
-//       fEPvector.SetPxPyPzE(fPxRec, fPyRec, fPzRec, fEnergy);
-      
-//       if (muonTrack->GetMatchTrigger()>0) nFWMatchedMuons++;
-      
-//       nMuons++;
-//       nFWMuons++;
-//       if(fEPvector.Pt() > fLowPtCut) {
-//         nMu1GeV++; 
-//         if(fEPvector.Pt() > fHighPtCut) {
-//           nMu3GeV++; 
-//           if (fEPvector.Pt() > fVeryHighPtCut) {
-//             nMu10GeV++;
-//           }
-//         }
-//       }
-//     }//muon track loop
-    
-//     // Fill the event tags 
-//     if(ntrack != 0) meanPt = meanPt/ntrack;
-    
-//     //First physics data
-//     const AliMultiplicity *spdMult = esd->GetMultiplicity();
-//     evTag->SetNumberOfFiredChipsLayer1(spdMult->GetNumberOfFiredChips(0));
-//     evTag->SetNumberOfFiredChipsLayer2(spdMult->GetNumberOfFiredChips(1));
-//     evTag->SetNumberOfSPDTracklets(spdMult->GetNumberOfTracklets());
-
-//     AliESDVZERO *vzeroData = esd->GetVZEROData();
-//     evTag->SetMTotV0A(vzeroData->GetMTotV0A());
-//     evTag->SetMTotV0C(vzeroData->GetMTotV0C());
-//     evTag->SetNbPMV0A(vzeroData->GetNbPMV0A());
-//     evTag->SetNbPMV0C(vzeroData->GetNbPMV0C());
-
-//     //evTag->SetEventId(iEventNumber+1);
-//     evTag->SetPeriodNumber(esd->GetPeriodNumber());
-//     evTag->SetOrbitNumber(esd->GetOrbitNumber());
-//     evTag->SetBunchCrossNumber(esd->GetBunchCrossNumber());
-
-//     evTag->SetGUID(fguid);
-    evTag->SetMD5(fmd5);
-    evTag->SetTURL(fturl);
-    evTag->SetSize(size);
-//     evTag->SetVertexX(vertexIn->GetXv());
-//     evTag->SetVertexY(vertexIn->GetYv());
-//     evTag->SetVertexZ(vertexIn->GetZv());
-//     evTag->SetVertexZError(vertexIn->GetZRes());
-//     evTag->SetVertexFlag(fVertexflag);
-    
-//     evTag->SetT0VertexZ(esd->GetT0zVertex());
-    
-//     evTag->SetTriggerMask(esd->GetTriggerMask());
-//     evTag->SetTriggerCluster(esd->GetTriggerCluster());
-    
-//     evTag->SetEventType(esd->GetEventType());
-//     evTag->SetFiredTriggerClasses(esd->GetFiredTriggerClasses());
-
-//     evTag->SetZDCNeutron1Energy(esd->GetZDCN1Energy());
-//     evTag->SetZDCProton1Energy(esd->GetZDCP1Energy());
-//     evTag->SetZDCEMEnergy(esd->GetZDCEMEnergy(0),esd->GetZDCEMEnergy(1));
-//     evTag->SetZDCNeutron1Energy(esd->GetZDCN2Energy());
-//     evTag->SetZDCProton1Energy(esd->GetZDCP2Energy());
-//     evTag->SetNumOfParticipants(esd->GetZDCParticipants());
-    
-    
-//     evTag->SetNumOfTracks(esd->GetNumberOfTracks());
-//     evTag->SetNumOfPosTracks(nPos);
-//     evTag->SetNumOfNegTracks(nNeg);
-//     evTag->SetNumOfNeutrTracks(nNeutr);
-    
-//     evTag->SetNumOfV0s(esd->GetNumberOfV0s());
-//     evTag->SetNumOfCascades(esd->GetNumberOfCascades());
-//     evTag->SetNumOfKinks(esd->GetNumberOfKinks());
-//     evTag->SetNumOfPMDTracks(esd->GetNumberOfPmdTracks());
-    
-//     evTag->SetNumOfProtons(nProtons);
-//     evTag->SetNumOfKaons(nKaons);
-//     evTag->SetNumOfPions(nPions);
-//     evTag->SetNumOfMuons(nMuons);
-//     evTag->SetNumOfFWMuons(nFWMuons);
-//     evTag->SetNumOfFWMatchedMuons(nFWMatchedMuons);
-//     evTag->SetNumOfElectrons(nElectrons);
-//     evTag->SetNumOfPhotons(nGamas);
-//     evTag->SetNumOfPi0s(nPi0s);
-//     evTag->SetNumOfNeutrons(nNeutrons);
-//     evTag->SetNumOfKaon0s(nK0s);
-    
-//     evTag->SetNumOfChargedAbove1GeV(nCh1GeV);
-//     evTag->SetNumOfChargedAbove3GeV(nCh3GeV);
-//     evTag->SetNumOfChargedAbove10GeV(nCh10GeV);
-//     evTag->SetNumOfMuonsAbove1GeV(nMu1GeV);
-//     evTag->SetNumOfMuonsAbove3GeV(nMu3GeV);
-//     evTag->SetNumOfMuonsAbove10GeV(nMu10GeV);
-//     evTag->SetNumOfElectronsAbove1GeV(nEl1GeV);
-//     evTag->SetNumOfElectronsAbove3GeV(nEl3GeV);
-//     evTag->SetNumOfElectronsAbove10GeV(nEl10GeV);
-    
-//     tmp.Clear();
-//     evTag->SetNumOfPHOSClusters(esd->GetPHOSClusters(&tmp));
-//     tmp.Clear();
-//     evTag->SetNumOfEMCALClusters(esd->GetEMCALClusters(&tmp));
-    
-//     evTag->SetTotalMomentum(totalP);
-//     evTag->SetMeanPt(meanPt);
-//     evTag->SetMaxPt(maxPt);
-//     evTag->SetEtaMaxPt(etamaxPt);
-//     evTag->SetPhiMaxPt(phimaxPt);
     
     tag->SetRunId(iInitRunNumber);
     if(fIsSim) tag->SetDataType(0);
@@ -955,244 +535,24 @@ void AliESDTagCreator::CreateTag(TFile* file, const char *filepath, Int_t Counte
   
   t->GetEntry(0);
   Int_t iInitRunNumber = esd->GetRunNumber();
+  tag->SetMagneticField(esd->GetMagneticField());
+  tag->SetBeamEnergy(esd->GetBeamEnergy());
+  tag->SetBeamType(TString(esd->GetBeamType()));
+  tag->SetActiveTriggerClasses(esd->GetESDRun()->GetActiveTriggerClasses());
+
+  AliFileTag *eftag = new AliFileTag();
+  eftag->SetPath(filepath);
+  eftag->SetTURL(Form("local://%s", filepath));
+  eftag->SetSize(0);
+  eftag->SetMD5("");
+  tag->AddFileTag(eftag);
 
   Int_t iNumberOfEvents = (Int_t)t->GetEntries();
   for (Int_t iEventNumber = 0; iEventNumber < iNumberOfEvents; iEventNumber++) {
     FillEventTag(t, evTag, iEventNumber, esd);
-//     ntrack = 0;
-//     nPos = 0;
-//     nNeg = 0;
-//     nNeutr =0;
-//     nK0s = 0;
-//     nNeutrons = 0;
-//     nPi0s = 0;
-//     nGamas = 0;
-//     nProtons = 0;
-//     nKaons = 0;
-//     nPions = 0;
-//     nMuons = 0;
-//     nFWMuons = 0;
-//     nFWMatchedMuons = 0;
-//     nElectrons = 0;   
-//     nCh1GeV = 0;
-//     nCh3GeV = 0;
-//     nCh10GeV = 0;
-//     nMu1GeV = 0;
-//     nMu3GeV = 0;
-//     nMu10GeV = 0;
-//     nEl1GeV = 0;
-//     nEl3GeV = 0;
-//     nEl10GeV = 0;
-//     maxPt = .0;
-//     etamaxPt = -999.;
-//     phimaxPt = -999.;
-//     meanPt = .0;
-//     totalP = .0;
-//     fVertexflag = 1;
-    
-//     t->GetEntry(iEventNumber);
     iRunNumber = esd->GetRunNumber();
     if(iRunNumber != iInitRunNumber) AliFatal("Inconsistency of run numbers in the AliESD!!!");
-//     const AliESDVertex * vertexIn = esd->GetVertex();
-//     fVertexName = vertexIn->GetName();
-//     if(fVertexName == "default") fVertexflag = 0;
-
-//     for (Int_t iTrackNumber = 0; iTrackNumber < esd->GetNumberOfTracks(); iTrackNumber++) {
-//       AliESDtrack * esdTrack = esd->GetTrack(iTrackNumber);
-//       if(esdTrack->GetLabel() != 0) fIsSim = kTRUE;
-//       else if(esdTrack->GetLabel() == 0) fIsSim = kFALSE;
-//       UInt_t status = esdTrack->GetStatus();
-      
-//       //select only tracks with ITS refit
-//       if ((status&AliESDtrack::kITSrefit)==0) continue;
-//       //select only tracks with TPC refit
-//       if ((status&AliESDtrack::kTPCrefit)==0) continue;
-      
-//       //select only tracks with the "combined PID"
-//       if ((status&AliESDtrack::kESDpid)==0) continue;
-//       Double_t p[3];
-//       esdTrack->GetPxPyPz(p);
-//       Double_t pt2 = p[0]*p[0]+p[1]*p[1];
-//       Double_t momentum = TMath::Sqrt(pt2+p[2]*p[2]);
-//       Double_t fPt = TMath::Sqrt(pt2);
-//       totalP += momentum;
-//       meanPt += fPt;
-//       if(fPt > maxPt) {
-//       maxPt = fPt;
-//       etamaxPt = esdTrack->Eta();
-//       phimaxPt = esdTrack->Phi();
-//       }
-      
-      
-//       if(esdTrack->GetSign() > 0) {
-//     nPos++;
-//     if(fPt > fLowPtCut) nCh1GeV++;
-//     if(fPt > fHighPtCut) nCh3GeV++;
-//     if(fPt > fVeryHighPtCut) nCh10GeV++;
-//       }
-//       if(esdTrack->GetSign() < 0) {
-//     nNeg++;
-//     if(fPt > fLowPtCut) nCh1GeV++;
-//     if(fPt > fHighPtCut) nCh3GeV++;
-//     if(fPt > fVeryHighPtCut) nCh10GeV++;
-//       }
-//       if(esdTrack->GetSign() == 0) nNeutr++;
-      
-//       //PID
-//       Double_t prob[5];
-//       esdTrack->GetESDpid(prob);
-      
-//       Double_t rcc = 0.0;
-//       for(Int_t i = 0; i < AliPID::kSPECIES; i++) rcc += prob[i]*partFrac[i];
-//       if(rcc == 0.0) continue;
-//       //Bayes' formula
-//       Double_t w[5];
-//       for(Int_t i = 0; i < AliPID::kSPECIES; i++) w[i] = prob[i]*partFrac[i]/rcc;
-      
-//       //protons
-//       if ((w[4]>w[3])&&(w[4]>w[2])&&(w[4]>w[1])&&(w[4]>w[0])) nProtons++;
-//       //kaons
-//       if ((w[3]>w[4])&&(w[3]>w[2])&&(w[3]>w[1])&&(w[3]>w[0])) nKaons++;
-//       //pions
-//       if ((w[2]>w[4])&&(w[2]>w[3])&&(w[2]>w[1])&&(w[2]>w[0])) nPions++; 
-//       //electrons
-//       if ((w[0]>w[4])&&(w[0]>w[3])&&(w[0]>w[2])&&(w[0]>w[1])) {
-//     nElectrons++;
-//     if(fPt > fLowPtCut) nEl1GeV++;
-//     if(fPt > fHighPtCut) nEl3GeV++;
-//     if(fPt > fVeryHighPtCut) nEl10GeV++;
-//       }       
-//       ntrack++;
-//     }//esd track loop
-    
-//     /////////////
-//     //muon code//
-//     ////////////
-//     Int_t nMuonTracks = esd->GetNumberOfMuonTracks();
-//     // loop over all reconstructed tracks (also first track of combination)
-//     for (Int_t iTrack = 0; iTrack <  nMuonTracks;  iTrack++) {
-//       AliESDMuonTrack* muonTrack = esd->GetMuonTrack(iTrack);
-//       if (muonTrack == 0x0) continue;
-      
-//       // Coordinates at vertex
-//       fZ = muonTrack->GetZ(); 
-//       fY = muonTrack->GetBendingCoor();
-//       fX = muonTrack->GetNonBendingCoor(); 
-      
-//       fThetaX = muonTrack->GetThetaX();
-//       fThetaY = muonTrack->GetThetaY();
-      
-//       fPyz = 1./TMath::Abs(muonTrack->GetInverseBendingMomentum());
-//       fPzRec = - fPyz / TMath::Sqrt(1.0 + TMath::Tan(fThetaY)*TMath::Tan(fThetaY));
-//       fPxRec = fPzRec * TMath::Tan(fThetaX);
-//       fPyRec = fPzRec * TMath::Tan(fThetaY);
-//       fCharge = Int_t(TMath::Sign(1.,muonTrack->GetInverseBendingMomentum()));
-      
-//       //ChiSquare of the track if needed
-//       fChisquare = muonTrack->GetChi2()/(2.0 * muonTrack->GetNHit() - 5);
-//       fEnergy = TMath::Sqrt(fMUONMASS * fMUONMASS + fPxRec * fPxRec + fPyRec * fPyRec + fPzRec * fPzRec);
-//       fEPvector.SetPxPyPzE(fPxRec, fPyRec, fPzRec, fEnergy);
-      
-//       if (muonTrack->GetMatchTrigger()>0) nFWMatchedMuons++;
-
-//       nMuons++;
-//       nFWMuons++;
-//       if(fEPvector.Pt() > fLowPtCut) {
-//         nMu1GeV++; 
-//         if(fEPvector.Pt() > fHighPtCut) {
-//           nMu3GeV++; 
-//           if (fEPvector.Pt() > fVeryHighPtCut) {
-//             nMu10GeV++;
-//           }
-//         }
-//       }
-//     }//muon track loop
-    
-//     // Fill the event tags 
-//     if(ntrack != 0) meanPt = meanPt/ntrack;
-    
-//     //First physics data
-//     const AliMultiplicity *spdMult = esd->GetMultiplicity();
-//     evTag->SetNumberOfFiredChipsLayer1(spdMult->GetNumberOfFiredChips(0));
-//     evTag->SetNumberOfFiredChipsLayer2(spdMult->GetNumberOfFiredChips(1));
-//     evTag->SetNumberOfSPDTracklets(spdMult->GetNumberOfTracklets());
-
-//     AliESDVZERO *vzeroData = esd->GetVZEROData();
-//     evTag->SetMTotV0A(vzeroData->GetMTotV0A());
-//     evTag->SetMTotV0C(vzeroData->GetMTotV0C());
-//     evTag->SetNbPMV0A(vzeroData->GetNbPMV0A());
-//     evTag->SetNbPMV0C(vzeroData->GetNbPMV0C());
-
-//     //evTag->SetEventId(iEventNumber+1);
-//     evTag->SetPeriodNumber(esd->GetPeriodNumber());
-//     evTag->SetOrbitNumber(esd->GetOrbitNumber());
-//     evTag->SetBunchCrossNumber(esd->GetBunchCrossNumber());
-    evTag->SetPath(filepath);
-//     evTag->SetVertexX(vertexIn->GetXv());
-//     evTag->SetVertexY(vertexIn->GetYv());
-//     evTag->SetVertexZ(vertexIn->GetZv());
-//     evTag->SetVertexZError(vertexIn->GetZRes());
-//     evTag->SetVertexFlag(fVertexflag);
-    
-//     evTag->SetT0VertexZ(esd->GetT0zVertex());
-    
-//     evTag->SetTriggerMask(esd->GetTriggerMask());
-//     evTag->SetTriggerCluster(esd->GetTriggerCluster());
-    
-//     evTag->SetEventType(esd->GetEventType());
-//     evTag->SetFiredTriggerClasses(esd->GetFiredTriggerClasses());
-
-//     evTag->SetZDCNeutron1Energy(esd->GetZDCN1Energy());
-//     evTag->SetZDCProton1Energy(esd->GetZDCP1Energy());
-//     evTag->SetZDCEMEnergy(esd->GetZDCEMEnergy(0),esd->GetZDCEMEnergy(1));
-//     evTag->SetZDCNeutron1Energy(esd->GetZDCN2Energy());
-//     evTag->SetZDCProton1Energy(esd->GetZDCP2Energy());
-//     evTag->SetNumOfParticipants(esd->GetZDCParticipants());
-    
-    
-//     evTag->SetNumOfTracks(esd->GetNumberOfTracks());
-//     evTag->SetNumOfPosTracks(nPos);
-//     evTag->SetNumOfNegTracks(nNeg);
-//     evTag->SetNumOfNeutrTracks(nNeutr);
-    
-//     evTag->SetNumOfV0s(esd->GetNumberOfV0s());
-//     evTag->SetNumOfCascades(esd->GetNumberOfCascades());
-//     evTag->SetNumOfKinks(esd->GetNumberOfKinks());
-//     evTag->SetNumOfPMDTracks(esd->GetNumberOfPmdTracks());
-    
-//     evTag->SetNumOfProtons(nProtons);
-//     evTag->SetNumOfKaons(nKaons);
-//     evTag->SetNumOfPions(nPions);
-//     evTag->SetNumOfMuons(nMuons);
-//     evTag->SetNumOfFWMuons(nFWMuons);
-//     evTag->SetNumOfFWMatchedMuons(nFWMatchedMuons);
-//     evTag->SetNumOfElectrons(nElectrons);
-//     evTag->SetNumOfPhotons(nGamas);
-//     evTag->SetNumOfPi0s(nPi0s);
-//     evTag->SetNumOfNeutrons(nNeutrons);
-//     evTag->SetNumOfKaon0s(nK0s);
-    
-//     evTag->SetNumOfChargedAbove1GeV(nCh1GeV);
-//     evTag->SetNumOfChargedAbove3GeV(nCh3GeV);
-//     evTag->SetNumOfChargedAbove10GeV(nCh10GeV);
-//     evTag->SetNumOfMuonsAbove1GeV(nMu1GeV);
-//     evTag->SetNumOfMuonsAbove3GeV(nMu3GeV);
-//     evTag->SetNumOfMuonsAbove10GeV(nMu10GeV);
-//     evTag->SetNumOfElectronsAbove1GeV(nEl1GeV);
-//     evTag->SetNumOfElectronsAbove3GeV(nEl3GeV);
-//     evTag->SetNumOfElectronsAbove10GeV(nEl10GeV);
-    
-//     tmp.Clear();
-//     evTag->SetNumOfPHOSClusters(esd->GetPHOSClusters(&tmp));
-//     tmp.Clear();
-//     evTag->SetNumOfEMCALClusters(esd->GetEMCALClusters(&tmp));
-    
-//     evTag->SetTotalMomentum(totalP);
-//     evTag->SetMeanPt(meanPt);
-//     evTag->SetMaxPt(maxPt);
-//     evTag->SetEtaMaxPt(etamaxPt);
-//     evTag->SetPhiMaxPt(phimaxPt);
+    //    evTag->SetPath(filepath);
     
     tag->SetRunId(iInitRunNumber);
 //     if(fIsSim) tag->SetDataType(0);
@@ -1325,264 +685,48 @@ void AliESDTagCreator::CreateESDTags(Int_t fFirstEvent, Int_t fLastEvent, AliGRP
 
   if ((fLastEvent != -1) && ((Int_t) b->GetEntries() > fLastEvent)) 
     iNumberOfEvents = fLastEvent + 1;
+
+  AliFileTag *eftag = new AliFileTag();
+  tag->AddFileTag(eftag);
+
   for (Int_t iEventNumber = fFirstEvent; iEventNumber < iNumberOfEvents; iEventNumber++) {
     FillEventTag(b, evTag, iEventNumber, esd);
-//     ntrack = 0;
-//     nPos = 0;
-//     nNeg = 0;
-//     nNeutr =0;
-//     nK0s = 0;
-//     nNeutrons = 0;
-//     nPi0s = 0;
-//     nGamas = 0;
-//     nProtons = 0;
-//     nKaons = 0;
-//     nPions = 0;
-//     nMuons = 0;
-//     nFWMuons = 0;
-//     nFWMatchedMuons = 0;
-//     nElectrons = 0;   
-//     nCh1GeV = 0;
-//     nCh3GeV = 0;
-//     nCh10GeV = 0;
-//     nMu1GeV = 0;
-//     nMu3GeV = 0;
-//     nMu10GeV = 0;
-//     nEl1GeV = 0;
-//     nEl3GeV = 0;
-//     nEl10GeV = 0;
-//     maxPt = .0;
-//     etamaxPt = -999.;
-//     phimaxPt = -999.;
-//     meanPt = .0;
-//     totalP = .0;
-//     fVertexflag = 0;
-
-//     b->GetEntry(iEventNumber);
     iRunNumber = esd->GetRunNumber();
     if(iRunNumber != iInitRunNumber) AliFatal("Inconsistency of run numbers in the AliESD!!!");
 
-    TFile *file = b->GetCurrentFile();
-    const TUrl *url = file->GetEndpointUrl();
-    fguid = file->GetUUID().AsString();
-    if(fStorage == 1) {
-      TString fturltemp = "alien://"; fturltemp += url->GetFile();
-      fturl = fturltemp(0,fturltemp.Index(".root",5,0,TString::kExact)+5);
-    }
-    else fturl = url->GetFile();
+    if (iEventNumber == fFirstEvent) {
+      TFile *file = b->GetCurrentFile();
+      const TUrl *url = file->GetEndpointUrl();
+      fguid = file->GetUUID().AsString();
+      if(fStorage == 1) {
+       TString fturltemp = "alien://"; fturltemp += url->GetFile();
+       fturl = fturltemp(0,fturltemp.Index(".root",5,0,TString::kExact)+5);
+      }
+      else fturl = url->GetFile(); 
+      
+      //    evTag->SetGUID(fguid);
+      ((AliFileTag *) tag->GetFileTag(tag->GetNFiles()-1))->SetGUID(fguid);
+      if(fStorage == 1) {
+       ((AliFileTag *) tag->GetFileTag(tag->GetNFiles()-1))->SetMD5("");
+       ((AliFileTag *) tag->GetFileTag(tag->GetNFiles()-1))->SetTURL(fturl);
+       ((AliFileTag *) tag->GetFileTag(tag->GetNFiles()-1))->SetSize(0);
+      }
+      else {
+       //      evTag->SetPath(fturl);
+       ((AliFileTag *) tag->GetFileTag(tag->GetNFiles()-1))->SetPath(fturl);
+       ((AliFileTag *) tag->GetFileTag(tag->GetNFiles()-1))->SetMD5("");
+       ((AliFileTag *) tag->GetFileTag(tag->GetNFiles()-1))->SetSize(0);
+      }
 
-    evTag->SetGUID(fguid);
-    if(fStorage == 1) {
-      evTag->SetMD5("");
-      evTag->SetTURL(fturl);
-      evTag->SetSize(0);
     }
-    else evTag->SetPath(fturl);
-//     const AliESDVertex * vertexIn = esd->GetVertex();
-//     if (!vertexIn) AliError("ESD has not defined vertex.");
-//     if (vertexIn) fVertexName = vertexIn->GetName();
-//     if(fVertexName != "default") fVertexflag = 1;
-//     for (Int_t iTrackNumber = 0; iTrackNumber < esd->GetNumberOfTracks(); iTrackNumber++) {
-//       AliESDtrack * esdTrack = esd->GetTrack(iTrackNumber);
-//       UInt_t status = esdTrack->GetStatus();
-      
-//       //select only tracks with ITS refit
-//       if ((status&AliESDtrack::kITSrefit)==0) continue;
-//       //select only tracks with TPC refit
-//       if ((status&AliESDtrack::kTPCrefit)==0) continue;
-      
-//       //select only tracks with the "combined PID"
-//       if ((status&AliESDtrack::kESDpid)==0) continue;
-//       Double_t p[3];
-//       esdTrack->GetPxPyPz(p);
-//       Double_t pt2 = p[0]*p[0]+p[1]*p[1];
-//       Double_t momentum = TMath::Sqrt(pt2+p[2]*p[2]);
-//       Double_t fPt = TMath::Sqrt(pt2);
-//       totalP += momentum;
-//       meanPt += fPt;
-//       if(fPt > maxPt) {
-//       maxPt = fPt;
-//       phimaxPt = esdTrack->Eta();
-//       etamaxPt = esdTrack->Phi();
-//       }
-      
-//       if(esdTrack->GetSign() > 0) {
-//     nPos++;
-//     if(fPt > fLowPtCut) nCh1GeV++;
-//     if(fPt > fHighPtCut) nCh3GeV++;
-//     if(fPt > fVeryHighPtCut) nCh10GeV++;
-//       }
-//       if(esdTrack->GetSign() < 0) {
-//     nNeg++;
-//     if(fPt > fLowPtCut) nCh1GeV++;
-//     if(fPt > fHighPtCut) nCh3GeV++;
-//     if(fPt > fVeryHighPtCut) nCh10GeV++;
-//       }
-//       if(esdTrack->GetSign() == 0) nNeutr++;
-      
-//       //PID
-//       Double_t prob[5];
-//       esdTrack->GetESDpid(prob);
-      
-//       Double_t rcc = 0.0;
-//       for(Int_t i = 0; i < AliPID::kSPECIES; i++) rcc += prob[i]*partFrac[i];
-//       if(rcc == 0.0) continue;
-//       //Bayes' formula
-//       Double_t w[5];
-//       for(Int_t i = 0; i < AliPID::kSPECIES; i++) w[i] = prob[i]*partFrac[i]/rcc;
-      
-//       //protons
-//       if ((w[4]>w[3])&&(w[4]>w[2])&&(w[4]>w[1])&&(w[4]>w[0])) nProtons++;
-//       //kaons
-//       if ((w[3]>w[4])&&(w[3]>w[2])&&(w[3]>w[1])&&(w[3]>w[0])) nKaons++;
-//       //pions
-//       if ((w[2]>w[4])&&(w[2]>w[3])&&(w[2]>w[1])&&(w[2]>w[0])) nPions++; 
-//       //electrons
-//       if ((w[0]>w[4])&&(w[0]>w[3])&&(w[0]>w[2])&&(w[0]>w[1])) {
-//     nElectrons++;
-//     if(fPt > fLowPtCut) nEl1GeV++;
-//     if(fPt > fHighPtCut) nEl3GeV++;
-//     if(fPt > fVeryHighPtCut) nEl10GeV++;
-//       }       
-//       ntrack++;
-//     }//track loop
-    
-//     /////////////
-//     //muon code//
-//     ////////////
-//     Int_t nMuonTracks = esd->GetNumberOfMuonTracks();
-//     // loop over all reconstructed tracks (also first track of combination)
-//     for (Int_t iTrack = 0; iTrack <  nMuonTracks;  iTrack++) {
-//       AliESDMuonTrack* muonTrack = esd->GetMuonTrack(iTrack);
-//       if (muonTrack == 0x0) continue;
-      
-//       // Coordinates at vertex
-//       fZ = muonTrack->GetZ(); 
-//       fY = muonTrack->GetBendingCoor();
-//       fX = muonTrack->GetNonBendingCoor(); 
-      
-//       fThetaX = muonTrack->GetThetaX();
-//       fThetaY = muonTrack->GetThetaY();
-      
-//       fPyz = 1./TMath::Abs(muonTrack->GetInverseBendingMomentum());
-//       fPzRec = - fPyz / TMath::Sqrt(1.0 + TMath::Tan(fThetaY)*TMath::Tan(fThetaY));
-//       fPxRec = fPzRec * TMath::Tan(fThetaX);
-//       fPyRec = fPzRec * TMath::Tan(fThetaY);
-//       fCharge = Int_t(TMath::Sign(1.,muonTrack->GetInverseBendingMomentum()));
-      
-//       //ChiSquare of the track if needed
-//       fChisquare = muonTrack->GetChi2()/(2.0 * muonTrack->GetNHit() - 5);
-//       fEnergy = TMath::Sqrt(fMUONMASS * fMUONMASS + fPxRec * fPxRec + fPyRec * fPyRec + fPzRec * fPzRec);
-//       fEPvector.SetPxPyPzE(fPxRec, fPyRec, fPzRec, fEnergy);
-      
-//       if (muonTrack->GetMatchTrigger()>0) nFWMatchedMuons++;
-
-//       nMuons++;
-//       nFWMuons++;
-//       if(fEPvector.Pt() > fLowPtCut) {
-//         nMu1GeV++; 
-//         if(fEPvector.Pt() > fHighPtCut) {
-//           nMu3GeV++; 
-//           if (fEPvector.Pt() > fVeryHighPtCut) {
-//             nMu10GeV++;
-//           }
-//         }
-//       }
-//     }//muon track loop
 
-    
-//     // Fill the event tags 
-//     if(ntrack != 0)
-//       meanPt = meanPt/ntrack;
-
-//     //First physics data
-//     const AliMultiplicity *spdMult = esd->GetMultiplicity();
-//     evTag->SetNumberOfFiredChipsLayer1(spdMult->GetNumberOfFiredChips(0));
-//     evTag->SetNumberOfFiredChipsLayer2(spdMult->GetNumberOfFiredChips(1));
-//     evTag->SetNumberOfSPDTracklets(spdMult->GetNumberOfTracklets());
-
-//     AliESDVZERO *vzeroData = esd->GetVZEROData();
-//     evTag->SetMTotV0A(vzeroData->GetMTotV0A());
-//     evTag->SetMTotV0C(vzeroData->GetMTotV0C());
-//     evTag->SetNbPMV0A(vzeroData->GetNbPMV0A());
-//     evTag->SetNbPMV0C(vzeroData->GetNbPMV0C());
-
-//     //evTag->SetEventId(iEventNumber+1);
-//     evTag->SetPeriodNumber(esd->GetPeriodNumber());
-//     evTag->SetOrbitNumber(esd->GetOrbitNumber());
-//     evTag->SetBunchCrossNumber(esd->GetBunchCrossNumber());
-//     if (vertexIn) {
-//       evTag->SetVertexX(vertexIn->GetXv());
-//       evTag->SetVertexY(vertexIn->GetYv());
-//       evTag->SetVertexZ(vertexIn->GetZv());
-//       evTag->SetVertexZError(vertexIn->GetZRes());
-//     }  
-//     evTag->SetVertexFlag(fVertexflag);
-
-//     evTag->SetT0VertexZ(esd->GetT0zVertex());
-    
-//     evTag->SetTriggerMask(esd->GetTriggerMask());
-//     evTag->SetTriggerCluster(esd->GetTriggerCluster());
-    
-//     evTag->SetEventType(esd->GetEventType());
-//     evTag->SetFiredTriggerClasses(esd->GetFiredTriggerClasses());
-
-//     evTag->SetZDCNeutron1Energy(esd->GetZDCN1Energy());
-//     evTag->SetZDCProton1Energy(esd->GetZDCP1Energy());
-//     evTag->SetZDCNeutron2Energy(esd->GetZDCN2Energy());
-//     evTag->SetZDCProton2Energy(esd->GetZDCP2Energy());
-//     evTag->SetZDCEMEnergy(esd->GetZDCEMEnergy(0),esd->GetZDCEMEnergy(1));
-//     evTag->SetNumOfParticipants(esd->GetZDCParticipants());
-    
-    
-//     evTag->SetNumOfTracks(esd->GetNumberOfTracks());
-//     evTag->SetNumOfPosTracks(nPos);
-//     evTag->SetNumOfNegTracks(nNeg);
-//     evTag->SetNumOfNeutrTracks(nNeutr);
-    
-//     evTag->SetNumOfV0s(esd->GetNumberOfV0s());
-//     evTag->SetNumOfCascades(esd->GetNumberOfCascades());
-//     evTag->SetNumOfKinks(esd->GetNumberOfKinks());
-//     evTag->SetNumOfPMDTracks(esd->GetNumberOfPmdTracks());
-    
-//     evTag->SetNumOfProtons(nProtons);
-//     evTag->SetNumOfKaons(nKaons);
-//     evTag->SetNumOfPions(nPions);
-//     evTag->SetNumOfMuons(nMuons);
-//     evTag->SetNumOfFWMuons(nFWMuons);
-//     evTag->SetNumOfFWMatchedMuons(nFWMatchedMuons);
-//     evTag->SetNumOfElectrons(nElectrons);
-//     evTag->SetNumOfPhotons(nGamas);
-//     evTag->SetNumOfPi0s(nPi0s);
-//     evTag->SetNumOfNeutrons(nNeutrons);
-//     evTag->SetNumOfKaon0s(nK0s);
-    
-//     evTag->SetNumOfChargedAbove1GeV(nCh1GeV);
-//     evTag->SetNumOfChargedAbove3GeV(nCh3GeV);
-//     evTag->SetNumOfChargedAbove10GeV(nCh10GeV);
-//     evTag->SetNumOfMuonsAbove1GeV(nMu1GeV);
-//     evTag->SetNumOfMuonsAbove3GeV(nMu3GeV);
-//     evTag->SetNumOfMuonsAbove10GeV(nMu10GeV);
-//     evTag->SetNumOfElectronsAbove1GeV(nEl1GeV);
-//     evTag->SetNumOfElectronsAbove3GeV(nEl3GeV);
-//     evTag->SetNumOfElectronsAbove10GeV(nEl10GeV);
-    
-//     tmp.Clear();
-//     evTag->SetNumOfPHOSClusters(esd->GetPHOSClusters(&tmp));
-//     tmp.Clear();
-//     evTag->SetNumOfEMCALClusters(esd->GetEMCALClusters(&tmp));
-    
-//     evTag->SetTotalMomentum(totalP);
-//     evTag->SetMeanPt(meanPt);
-//     evTag->SetMaxPt(maxPt);
-//     evTag->SetEtaMaxPt(etamaxPt);
-//     evTag->SetPhiMaxPt(phimaxPt);
     tag->AddEventTag(*evTag);
   }    
   
   tag->SetLHCTag(lhcLuminosity,lhcState);
   tag->SetDetectorTag(esd->GetESDRun()->GetDetectorsInDAQ(), esd->GetESDRun()->GetDetectorsInReco());
-  
+  tag->SetActiveTriggerClasses(esd->GetESDRun()->GetActiveTriggerClasses());
+
   // Get magnetic field info
   Bool_t ok = kTRUE;
   
@@ -1636,7 +780,7 @@ void AliESDTagCreator::CreateESDTags(Int_t fFirstEvent, Int_t fLastEvent, AliGRP
   //QA setting 
   tag->SetQAArray(qa, qalength) ; 
   tag->SetEventSpecies(es, eslength) ;
-       
+
   ftag->cd();
   ttag->Fill();
   tag->Clear();
@@ -1668,6 +812,7 @@ void AliESDTagCreator::CreateESDTagsFullRun(TTree *chain, AliGRPObject *grpData,
 
   Int_t iRunNumber = 0;
   TString fguid, fmd5, fturl;
+  TString fturlold;
 
   AliInfo(Form("Creating the ESD tags......."));       
 
@@ -1694,6 +839,9 @@ void AliESDTagCreator::CreateESDTagsFullRun(TTree *chain, AliGRPObject *grpData,
   TBranch * btag = ttag->Branch("AliTAG", &tag);
   btag->SetCompressionLevel(9);
 
+//   AliFileTag *eftag = new AliFileTag();
+//   tag->AddFileTag(*eftag);
+
   for (Int_t iEventNumber = iFirstEvent; iEventNumber < iNumberOfEvents; iEventNumber++) {
     FillEventTag(chain, evTag, iEventNumber, esd);
 
@@ -1709,15 +857,37 @@ void AliESDTagCreator::CreateESDTagsFullRun(TTree *chain, AliGRPObject *grpData,
     }
     else fturl = url->GetFile();
 
-    evTag->SetGUID(fguid);
-    if(fStorage == 1) {
-      evTag->SetMD5("");
-      evTag->SetTURL(fturl);
-      evTag->SetSize(0);
+    if (fturl.CompareTo(fturlold)) {
+
+      AliFileTag *eftag = new AliFileTag();
+      
+      //evTag->SetGUID(fguid);
+      eftag->SetGUID(fguid);
+      if(fStorage == 1) {
+       //       evTag->SetMD5("");
+       //       evTag->SetTURL(fturl);
+       //       evTag->SetSize(0);
+       eftag->SetPath("");
+       eftag->SetMD5("");
+       eftag->SetTURL(fturl);
+       eftag->SetSize(0);
+      }
+      else {
+       //       evTag->SetPath(fturl);
+       //       evTag->SetTURL(fturl);
+       eftag->SetPath(fturl);
+       eftag->SetTURL(fturl);
+       eftag->SetMD5("");
+       eftag->SetSize(0);
+      }
+
+      tag->AddFileTag(eftag);
+    
+      fturlold = fturl;
+      
     }
     else {
-      evTag->SetPath(fturl);
-      evTag->SetTURL(fturl);
+      //      cout << "FileTag found " << fturl.Data() << " " << fturlold.Data() << endl;
     }
 
     tag->AddEventTag(*evTag);
@@ -1725,6 +895,7 @@ void AliESDTagCreator::CreateESDTagsFullRun(TTree *chain, AliGRPObject *grpData,
 
   tag->SetLHCTag(lhcLuminosity,lhcState);
   tag->SetDetectorTag(esd->GetESDRun()->GetDetectorsInDAQ(), esd->GetESDRun()->GetDetectorsInReco());
+  tag->SetActiveTriggerClasses(esd->GetESDRun()->GetActiveTriggerClasses());
   
   // Get magnetic field info
   Bool_t ok = kTRUE;
@@ -1779,7 +950,7 @@ void AliESDTagCreator::CreateESDTagsFullRun(TTree *chain, AliGRPObject *grpData,
   //QA setting 
   tag->SetQAArray(qa, qalength) ; 
   tag->SetEventSpecies(es, eslength) ;
-  
+
   ftag->cd();
   ttag->Fill();
   tag->Clear();
@@ -2024,7 +1195,7 @@ void AliESDTagCreator::FillEventTag(TTree *chain, AliEventTag *evTag, Int_t iEve
   evTag->SetTriggerCluster(esd->GetTriggerCluster());
   
   evTag->SetEventType(esd->GetEventType());
-  evTag->SetFiredTriggerClasses(esd->GetFiredTriggerClasses());
+  //*T*  evTag->SetFiredTriggerClasses(esd->GetFiredTriggerClasses());
   
   evTag->SetZDCNeutron1Energy(esd->GetZDCN1Energy());
   evTag->SetZDCProton1Energy(esd->GetZDCP1Energy());
@@ -2084,7 +1255,7 @@ void AliESDTagCreator::FillEventTag(TTree *chain, AliEventTag *evTag, Int_t iEve
 void AliESDTagCreator::CreateESDRunTagSummary(TTree *chain)
 {
   // Merge all tags from a run into a single RunTag
-  // with as many EventTags as there is files
+  // with only the File tags
   AliRunTag *rtag;
   chain->SetBranchAddress("AliTAG", &rtag);
 
@@ -2099,16 +1270,6 @@ void AliESDTagCreator::CreateESDRunTagSummary(TTree *chain)
     chain->GetEntry(itag);
     tag->CopyStandardContent(rtag);
     
-    TString curguid="";
-
-    for (int iev=0; iev<rtag->GetEventTags()->GetEntries(); iev++) {
-      if (!curguid.Contains(((AliEventTag *) rtag->GetEventTags()->At(iev))->GetGUID())) {
-       curguid = ((AliEventTag *) rtag->GetEventTags()->At(iev))->GetGUID();
-       cout << "Adding " << curguid << endl;
-       tag->AddEventTag(*((AliEventTag *) rtag->GetEventTags()->At(iev)));
-      }
-    }
-
     ttag->Fill();
     tag->Clear();
   }
index 5a1c455..abd2fbd 100644 (file)
@@ -22,6 +22,8 @@
 //-----------------------------------------------------------------
 
 #include "AliEventTag.h"
+#include <TObjArray.h>
+#include <TObjString.h>
 
 ClassImp(AliEventTag)
 
@@ -31,15 +33,16 @@ ClassImp(AliEventTag)
     fPeriodNumber(0),
     fOrbitNumber(0),
     fBunchCrossNumber(0),
-    fFiredTriggerClasses(),
+    //*T*    fFiredTriggerClasses(),
     fEventType(0),
     fPhysicsFlag(0),
     fBackgroundFlag(0),
-    fGUID(0),
-    fPath(0),
-    fsize(0),
-    fmd5(0),
-    fturl(0),
+//     fGUID(0),
+//     fPath(0),
+//     fsize(0),
+//     fmd5(0),
+//     fturl(0),
+//    fFileRef(0),
     fNumberOfParticipants(-10),
     fNumberOfParticipants2(-10),
     fImpactParameter(-10.0),
@@ -120,15 +123,16 @@ AliEventTag::AliEventTag(const AliEventTag & evTag) :
   fPeriodNumber(evTag.fPeriodNumber),
   fOrbitNumber(evTag.fOrbitNumber),
   fBunchCrossNumber(evTag.fBunchCrossNumber),
-  fFiredTriggerClasses(evTag.fFiredTriggerClasses),
+  //*T*  fFiredTriggerClasses(evTag.fFiredTriggerClasses),
   fEventType(evTag.fEventType),
   fPhysicsFlag(evTag.fPhysicsFlag),
   fBackgroundFlag(evTag.fBackgroundFlag),
-  fGUID(evTag.fGUID),
-  fPath(evTag.fPath),
-  fsize(evTag.fsize),
-  fmd5(evTag.fmd5),
-  fturl(evTag.fturl),
+//   fGUID(evTag.fGUID),
+//   fPath(evTag.fPath),
+//   fsize(evTag.fsize),
+//   fmd5(evTag.fmd5),
+//   fturl(evTag.fturl),
+// fFileRef(0),
   fNumberOfParticipants(evTag.fNumberOfParticipants),
   fNumberOfParticipants2(evTag.fNumberOfParticipants2),
   fImpactParameter(evTag.fImpactParameter),
@@ -211,15 +215,15 @@ AliEventTag & AliEventTag::operator=(const AliEventTag &evTag) {
     SetPeriodNumber(evTag.GetPeriodNumber());
     SetOrbitNumber(evTag.GetOrbitNumber());
     SetBunchCrossNumber(evTag.GetBunchCrossNumber());
-    SetFiredTriggerClasses(evTag.GetFiredTriggerClasses());
+    //*T*    SetFiredTriggerClasses(evTag.GetFiredTriggerClasses());
     SetEventType(evTag.GetEventType());
     SetPhysicsFlag(evTag.GetPhysicsFlag());
     SetBackgroungFlag(evTag.GetBackgroundFlag());
-    SetGUID(evTag.GetGUID());
-    SetPath(evTag.GetPath());
-    SetMD5(evTag.GetMD5());
-    SetTURL(evTag.GetTURL());
-    SetSize(evTag.GetSize());
+//     SetGUID(evTag.GetGUID());
+//     SetPath(evTag.GetPath());
+//     SetMD5(evTag.GetMD5());
+//     SetTURL(evTag.GetTURL());
+//     SetSize(evTag.GetSize());
     SetNumOfParticipants(evTag.GetNumOfParticipants());
     SetImpactParameter(evTag.GetImpactParameter());
     SetVertexX(evTag.GetVertexX());
@@ -296,3 +300,28 @@ AliEventTag & AliEventTag::operator=(const AliEventTag &evTag) {
 AliEventTag::~AliEventTag() {
   // AliEventTag destructor
 }
+
+// void AliEventTag::SetGUID(TString Pid) { ((AliFileTag * ) fFileRef.GetObject())->SetGUID(Pid);}
+// void AliEventTag::SetPath(TString Pid) {((AliFileTag * ) fFileRef.GetObject())->SetPath(Pid);}
+// void AliEventTag::SetMD5(TString Pid) {((AliFileTag * ) fFileRef.GetObject())->SetMD5(Pid);}
+// void AliEventTag::SetTURL(TString Pid) {((AliFileTag * ) fFileRef.GetObject())->SetTURL(Pid);}
+// void AliEventTag::SetSize(Long64_t i) {((AliFileTag * ) fFileRef.GetObject())->SetSize(i);}
+
+TString AliEventTag::GetFiredTriggerClasses(TString actclass) const 
+{
+  // Uses the actclass string to decode the trigger mask
+  // into the fired trigger classes
+  TObjArray *actrig = actclass.Tokenize(" ");
+  TString tFired("");
+
+  for(Int_t i = 0; i < actrig->GetEntries(); i++) {
+    if (fTriggerMask & (1ull << i)) {
+      TString str = ((TObjString *) actrig->At(i))->GetString();
+      if (tFired.Length() > 0)
+       tFired += " ";
+      tFired += str;
+    }
+  }
+
+  return tFired;
+}
index 9cbe4f2..5a6aa33 100644 (file)
@@ -30,16 +30,16 @@ class AliEventTag : public TObject {
   void SetOrbitNumber(UInt_t n) {fOrbitNumber = n;}
   void SetBunchCrossNumber(UShort_t n) {fBunchCrossNumber = n;}
 
-  void SetFiredTriggerClasses(TString names) {fFiredTriggerClasses = names;}
+  //*T*  void SetFiredTriggerClasses(TString names) {fFiredTriggerClasses = names;}
   void SetEventType(UInt_t ntype) {fEventType = ntype;}
   void SetPhysicsFlag(UShort_t nflag) {fPhysicsFlag = nflag;}
   void SetBackgroungFlag(UShort_t nflag) {fBackgroundFlag = nflag;}
 
-  void SetGUID(TString Pid) {fGUID = Pid;}
-  void SetPath(TString Pid) {fPath = Pid;}
-  void SetMD5(TString Pid) {fmd5 = Pid;}
-  void SetTURL(TString Pid) {fturl = Pid;}
-  void SetSize(Long64_t i) {fsize = i;}
+/*   void SetGUID(TString Pid); */
+/*   void SetPath(TString Pid); */
+/*   void SetMD5(TString Pid); */
+/*   void SetTURL(TString Pid); */
+/*   void SetSize(Long64_t i); */
   void SetNumOfParticipants(Int_t P) {fNumberOfParticipants = P;}
   void SetNumOfParticipants2(Int_t P2) {fNumberOfParticipants = P2;}
   void SetImpactParameter(Float_t Pimpact) {fImpactParameter = Pimpact;}
@@ -119,16 +119,17 @@ class AliEventTag : public TObject {
   UInt_t GetOrbitNumber() const {return fOrbitNumber;}
   UShort_t GetBunchCrossNumber() const {return fBunchCrossNumber;}
 
-  TString GetFiredTriggerClasses() const {return fFiredTriggerClasses;}
+  //*T*  TString GetFiredTriggerClasses() const {return fFiredTriggerClasses;}
+  TString GetFiredTriggerClasses(TString actclass) const; //*T* {return fFiredTriggerClasses;}
   UInt_t GetEventType() const {return fEventType;}
   UShort_t GetPhysicsFlag() const {return fPhysicsFlag;}
   UShort_t GetBackgroundFlag() const {return fBackgroundFlag;}
 
-  const char *GetGUID() const {return fGUID.Data();}
-  const char *GetPath() const {return fPath.Data();}
-  const char *GetMD5() const {return fmd5.Data();}
-  const char *GetTURL() const {return fturl.Data();}
-  Long64_t    GetSize() const {return fsize;}
+/*   const char *GetGUID() const {return ((AliFileTag *) fFileRef.GetObject())->GetGUID();} */
+/*   const char *GetPath() const {return ((AliFileTag *) fFileRef.GetObject())->GetPath();} */
+/*   const char *GetMD5() const {return  ((AliFileTag *) fFileRef.GetObject())->GetMD5();} */
+/*   const char *GetTURL() const {return ((AliFileTag *) fFileRef.GetObject())->GetTURL();} */
+/*   Long64_t    GetSize() const {return ((AliFileTag *) fFileRef.GetObject())->GetSize();} */
   Int_t       GetNumOfParticipants() const {return fNumberOfParticipants;}
   Int_t       GetNumOfParticipants2() const {return fNumberOfParticipants2;}
   Float_t     GetImpactParameter() const {return fImpactParameter;}
@@ -207,16 +208,16 @@ class AliEventTag : public TObject {
   UInt_t    fPeriodNumber;                  //The period number
   UInt_t    fOrbitNumber;                   //The orbit number
   UShort_t  fBunchCrossNumber;              //The BC number
-  TString   fFiredTriggerClasses;           //List of the fired trigger class names
+  //*T*  TString   fFiredTriggerClasses;           //List of the fired trigger class names
   UInt_t    fEventType;                     //event type == 7 ==> PHYSICS_EVENT
   UShort_t  fPhysicsFlag;                   //1 - flagged as correct physics event
   UShort_t  fBackgroundFlag;                //1 - flagged by the background rejection procedure
 
-  TString   fGUID;                         //The unique identifier of the file
-  TString   fPath;                         //The file's path (local storage)
-  Long64_t  fsize;                          //the size of the file
-  TString   fmd5;                           //another file identifier
-  TString   fturl;                          //the file's url
+/*   TString   fGUID;                      //The unique identifier of the file */
+/*   TString   fPath;                      //The file's path (local storage) */
+/*   Long64_t  fsize;                          //the size of the file */
+/*   TString   fmd5;                           //another file identifier */
+/*   TString   fturl;                          //the file's url */
   Int_t     fNumberOfParticipants;         //Number of participants - side C
   Int_t     fNumberOfParticipants2;                //Number of participants - side A
   Float_t   fImpactParameter;              //The impact parameter
@@ -285,12 +286,12 @@ class AliEventTag : public TObject {
   Int_t     fNumberOfFiredChipsLayer2;      //number of fired chips - layer 2
   Int_t     fNumberOfSPDTracklets;          //number of SPD tracklets
 
-  Float_t     fMTotV0A;                     //Total multiplicity in V0 A side
-  Float_t     fMTotV0C;                     //Total multiplicity in V0 C side
+  Float_t   fMTotV0A;                       //Total multiplicity in V0 A side
+  Float_t   fMTotV0C;                       //Total multiplicity in V0 C side
   Short_t   fNbPMV0A;                       //Total number of fired channels in V0 A side
   Short_t   fNbPMV0C;                       //Total number of fired channels in V0 C side
 
-  ClassDef(AliEventTag,16)  //(ClassName, ClassVersion)
+  ClassDef(AliEventTag,17)  //(ClassName, ClassVersion)
       };
 //___________________________________________________________________________
 
index 718b191..7ded76d 100644 (file)
 //   Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
 //-----------------------------------------------------------------
 
-class AliLog;
+#include <AliLog.h>
 class AliESD;
 
-#include "TMath.h"
+#include <TMath.h>
 #include "AliEventTag.h"
 #include "AliEventTagCuts.h"
+#include <TObjArray.h>
+#include <TObjString.h>
 
 ClassImp(AliEventTagCuts)
 
@@ -171,8 +173,8 @@ AliEventTagCuts::AliEventTagCuts() :
   fNumberOfSPDTrackletsMin(0), fNumberOfSPDTrackletsMax(100000),
   fNumberOfSPDTrackletsFlag(kFALSE),
   
-  fFiredTriggerCleassFlag(kFALSE), fFiredTriggerCleass("")
-
+  fFiredTriggerClassFlag(kFALSE), fFiredTriggerClass(""),
+  fActiveTriggerClasses("")
 {
   //Default constructor which calls the Reset method.
   Reset();
@@ -339,8 +341,8 @@ void AliEventTagCuts::Reset() {
   fNumberOfFiredChipsLayer2Min = 0, fNumberOfFiredChipsLayer2Max = 100000;
   fNumberOfSPDTrackletsMin = 0, fNumberOfSPDTrackletsMax = 100000;
 
-  fFiredTriggerCleass = "";
-  fFiredTriggerCleassFlag = kFALSE;
+  fFiredTriggerClass = "";
+  fFiredTriggerClassFlag = kFALSE;
 }
 
 //___________________________________________________________________________
@@ -942,10 +944,22 @@ void AliEventTagCuts::SetHBTRadiiRange(Float_t low, Float_t high) {
   fHBTRadiiFlag = kTRUE;
 }
 
-void AliEventTagCuts::SetFiredTriggerClass(TString aclass)
+void AliEventTagCuts::AddRequiredFiredTriggerClass(TString aclass)
 {
-  fFiredTriggerCleass = aclass;
-  fFiredTriggerCleassFlag = kTRUE;
+  fFiredTriggerClassFlag += " ";
+  fFiredTriggerClass += aclass;
+  fFiredTriggerClassFlag = kTRUE;
+}
+
+void AliEventTagCuts::ResetTriggerClasses()
+{
+  fFiredTriggerClassFlag = kFALSE;
+  fFiredTriggerClass = "";
+}
+
+void AliEventTagCuts::InitializeTriggerClasses(TString aclass)
+{
+  fActiveTriggerClasses = aclass;
 }
 
 //___________________________________________________________________________
@@ -1220,9 +1234,321 @@ Bool_t AliEventTagCuts::IsAccepted(AliEventTag *EvTag) const {
     if((EvTag->GetHBTRadii() < fHBTRadiiMin) || (EvTag->GetHBTRadii() > fHBTRadiiMax))
       return kFALSE; 
 
-  if (fFiredTriggerCleassFlag)
-    if (!EvTag->GetFiredTriggerClasses().Contains(fFiredTriggerCleass))
+  if (fFiredTriggerClassFlag) {
+    if (fActiveTriggerClasses.Length() == 0) {
+      AliWarning("Attempt to select Trigger classes but Active trigger classes not set in AliEventTagCuts. Cannot make the selection on Fired Trigger classes");
+    }
+    else {
+      TObjArray *tClasses = fFiredTriggerClass.Tokenize(" ");
+      Bool_t tTrig = kFALSE;
+    
+      for (int itrig=0; itrig<tClasses->GetEntries(); itrig++)
+       if (EvTag->GetFiredTriggerClasses(fActiveTriggerClasses).Contains(((TObjString *) tClasses->At(itrig))->GetString()))
+         tTrig = kTRUE;
+      
+      tClasses->Delete();
+      delete tClasses;
+      
+      if (!tTrig)
+       return kFALSE;
+    }
+  }
+  
+  return kTRUE;
+}
+
+Bool_t AliEventTagCuts::IsAccepted(const AliEventTag *EvTag) const
+{
+  //Returns true if the event is accepted otherwise false.
+  if(fEventTypeFlag)
+    if(EvTag->GetEventType() != fEventType)
+      return kFALSE;
+  
+  if(fNumberOfFiredChipsLayer1Flag)
+    if((EvTag->GetNumberOfFiredChipsLayer1() < fNumberOfFiredChipsLayer1Min) || (EvTag->GetNumberOfFiredChipsLayer1() > fNumberOfFiredChipsLayer1Max))
+      return kFALSE;
+
+  if(fNumberOfFiredChipsLayer2Flag)
+    if((EvTag->GetNumberOfFiredChipsLayer2() < fNumberOfFiredChipsLayer2Min) || (EvTag->GetNumberOfFiredChipsLayer2() > fNumberOfFiredChipsLayer2Max))
+      return kFALSE;
+
+  if(fNumberOfSPDTrackletsFlag)
+    if((EvTag->GetNumberOfSPDTracklets() < fNumberOfSPDTrackletsMin) || (EvTag->GetNumberOfSPDTracklets() > fNumberOfSPDTrackletsMax))
+      return kFALSE;
+
+  if(fPeriodNumberFlag)
+    if((EvTag->GetPeriodNumber() < fPeriodNumberMin) || (EvTag->GetPeriodNumber() > fPeriodNumberMax))
       return kFALSE;
+
+  if(fOrbitNumberFlag)
+    if((EvTag->GetOrbitNumber() < fOrbitNumberMin) || (EvTag->GetOrbitNumber() > fOrbitNumberMax))
+      return kFALSE;
+
+  if(fBunchCrossNumberFlag)
+    if((EvTag->GetBunchCrossNumber() < fBunchCrossNumberMin) || (EvTag->GetBunchCrossNumber() > fBunchCrossNumberMax))
+      return kFALSE;
+
+
+ if(fEtaFlag)
+    if((EvTag->GetEtaMaxPt() < fEtaMin) || (EvTag->GetEtaMaxPt() > fEtaMax))
+      return kFALSE;
+
+  if(fPhiFlag)
+    if((EvTag->GetPhiMaxPt() < fPhiMin) || (EvTag->GetPhiMaxPt() > fPhiMax))
+      return kFALSE;
+
+  if(fVzFlag)
+    if((EvTag->GetVertexZ() < fVzMin) || (EvTag->GetVertexZ() > fVzMax))
+      return kFALSE;
+  
+  if(fVyFlag)
+    if((EvTag->GetVertexY() < fVyMin) || (EvTag->GetVertexY() > fVyMax))
+      return kFALSE;
+  
+  if(fVxFlag)
+    if((EvTag->GetVertexX() < fVxMin) || (EvTag->GetVertexX() > fVxMax))
+      return kFALSE;
+  
+  if(fNParticipantsFlag)
+    if((EvTag->GetNumOfParticipants() < fNParticipantsMin) || (EvTag->GetNumOfParticipants() > fNParticipantsMax))
+      return kFALSE; 
+  
+  if(fImpactParamFlag)
+    if((EvTag->GetImpactParameter() < fImpactParamMin) || (EvTag->GetImpactParameter() > fImpactParamMax))
+      return kFALSE; 
+  
+  if(fPVFlag)
+    if((EvTag->GetVertexFlag() != fPrimaryVertexFlag))
+      return kFALSE; 
+  
+  if(fPVzErrorFlag)
+    if((EvTag->GetVertexZError() < fPrimaryVertexZErrorMin) || (EvTag->GetVertexZError() > fPrimaryVertexZErrorMax))
+      return kFALSE; 
+  if(fTriggerMaskFlag)
+    if((EvTag->GetTriggerMask() & fTriggerMask) != fTriggerMask)
+      return kFALSE; 
+  if(fTriggerClusterFlag)
+    if((EvTag->GetTriggerCluster() != fTriggerCluster))
+      return kFALSE; 
+
+  if(fZDCNeutron1EnergyFlag)
+    if((EvTag->GetZDCNeutron1Energy() < fZDCNeutron1EnergyMin) || (EvTag->GetZDCNeutron1Energy() > fZDCNeutron1EnergyMax))
+      return kFALSE; 
+  
+  if(fZDCProton1EnergyFlag)
+    if((EvTag->GetZDCProton1Energy() < fZDCProton1EnergyMin) || (EvTag->GetZDCProton1Energy() > fZDCProton1EnergyMax))
+      return kFALSE; 
+  
+  if(fZDCNeutron2EnergyFlag)
+    if((EvTag->GetZDCNeutron2Energy() < fZDCNeutron2EnergyMin) || (EvTag->GetZDCNeutron2Energy() > fZDCNeutron2EnergyMax))
+      return kFALSE; 
+  
+  if(fZDCProton2EnergyFlag)
+    if((EvTag->GetZDCProton2Energy() < fZDCProton2EnergyMin) || (EvTag->GetZDCProton2Energy() > fZDCProton2EnergyMax))
+      return kFALSE; 
+  
+  if(fZDCEMEnergyFlag)
+    if((EvTag->GetZDCEMEnergy(1) < fZDCEMEnergyMin) || (EvTag->GetZDCEMEnergy(1) > fZDCEMEnergyMax))
+      return kFALSE; 
+  
+  if(fT0VertexZFlag)
+    if((EvTag->GetT0VertexZ() < fT0VertexZMin) || (EvTag->GetT0VertexZ() > fT0VertexZMax))
+      return kFALSE; 
+  
+  if(fMultFlag)
+    if((EvTag->GetNumOfTracks() < fMultMin) || (EvTag->GetNumOfTracks() > fMultMax))
+      return kFALSE; 
+  
+  if(fPosMultFlag)
+    if((EvTag->GetNumOfPosTracks() < fPosMultMin) || (EvTag->GetNumOfPosTracks() > fPosMultMax))
+      return kFALSE; 
+  
+  if(fNegMultFlag)
+    if((EvTag->GetNumOfNegTracks() < fNegMultMin) || (EvTag->GetNumOfNegTracks() > fNegMultMax))
+      return kFALSE; 
+  
+  if(fNeutrMultFlag)
+    if((EvTag->GetNumOfNeutrTracks() < fNeutrMultMin) || (EvTag->GetNumOfNeutrTracks() > fNeutrMultMax))
+      return kFALSE; 
+  
+  if(fNV0sFlag)
+    if((EvTag->GetNumOfV0s() < fNV0sMin) || (EvTag->GetNumOfV0s() > fNV0sMax))
+      return kFALSE; 
+  
+  if(fNCascadesFlag)
+    if((EvTag->GetNumOfCascades() < fNCascadesMin) || (EvTag->GetNumOfCascades() > fNCascadesMax))
+      return kFALSE; 
+  
+  if(fNKinksFlag)
+    if((EvTag->GetNumOfKinks() < fNKinksMin) || (EvTag->GetNumOfKinks() > fNKinksMax))
+      return kFALSE; 
+
+
+  if(fNPMDTracksFlag)
+    if((EvTag->GetNumOfPMDTracks() < fNPMDTracksMin) || (EvTag->GetNumOfPMDTracks() > fNPMDTracksMax))
+      return kFALSE; 
+  if(fNFMDTracksFlag)
+    if((EvTag->GetNumOfFMDTracks() < fNFMDTracksMin) || (EvTag->GetNumOfFMDTracks() > fNFMDTracksMax))
+      return kFALSE; 
+  if(fNPHOSClustersFlag)
+    if((EvTag->GetNumOfPHOSClusters() < fNPHOSClustersMin) || (EvTag->GetNumOfPHOSClusters() > fNPHOSClustersMax))
+      return kFALSE; 
+  if(fNEMCALClustersFlag)
+    if((EvTag->GetNumOfEMCALClusters() < fNEMCALClustersMin) || (EvTag->GetNumOfEMCALClusters() > fNEMCALClustersMax))
+      return kFALSE; 
+  if(fNJetCandidatesFlag)
+    if((EvTag->GetNumOfJetCandidates() < fNJetCandidatesMin) || (EvTag->GetNumOfJetCandidates() > fNJetCandidatesMax))
+      return kFALSE; 
+
+
+  if(fTopJetEnergyMinFlag)
+    if((EvTag->GetMaxJetEnergy() < fTopJetEnergyMin))
+      return kFALSE; 
+  
+  if(fNHardPhotonCandidatesFlag)
+    if((EvTag->GetNumOfHardPhotonsCandidates() < fNHardPhotonCandidatesMin) || (EvTag->GetNumOfHardPhotonsCandidates() > fNHardPhotonCandidatesMax))
+      return kFALSE; 
+  
+  if(fTopNeutralEnergyMinFlag)
+    if((EvTag->GetMaxNeutralEnergy() < fTopNeutralEnergyMin))
+      return kFALSE; 
+  
+  if(fNChargedAbove1GeVFlag)
+    if((EvTag->GetNumOfChargedAbove1GeV() < fNChargedAbove1GeVMin) || (EvTag->GetNumOfChargedAbove1GeV() > fNChargedAbove1GeVMax))
+      return kFALSE; 
+  
+  if(fNChargedAbove3GeVFlag)
+    if((EvTag->GetNumOfChargedAbove3GeV() < fNChargedAbove3GeVMin) || (EvTag->GetNumOfChargedAbove3GeV() > fNChargedAbove3GeVMax))
+      return kFALSE; 
+  
+  if(fNChargedAbove10GeVFlag)
+    if((EvTag->GetNumOfChargedAbove10GeV() < fNChargedAbove10GeVMin) || (EvTag->GetNumOfChargedAbove10GeV() > fNChargedAbove10GeVMax))
+      return kFALSE; 
+  
+  if(fNMuonsAbove1GeVFlag)
+    if((EvTag->GetNumOfMuonsAbove1GeV() < fNMuonsAbove1GeVMin) || (EvTag->GetNumOfMuonsAbove1GeV() > fNMuonsAbove1GeVMax))
+      return kFALSE; 
+  
+  if(fNMuonsAbove3GeVFlag)
+    if((EvTag->GetNumOfMuonsAbove3GeV() < fNMuonsAbove3GeVMin) || (EvTag->GetNumOfMuonsAbove3GeV() > fNMuonsAbove3GeVMax))
+      return kFALSE; 
+  
+  if(fNMuonsAbove10GeVFlag)
+    if((EvTag->GetNumOfMuonsAbove10GeV() < fNMuonsAbove10GeVMin) || (EvTag->GetNumOfMuonsAbove10GeV() > fNMuonsAbove10GeVMax))
+      return kFALSE; 
+  
+  if(fNElectronsAbove1GeVFlag)
+    if((EvTag->GetNumOfElectronsAbove1GeV()  < fNElectronsAbove1GeVMin) || (EvTag->GetNumOfElectronsAbove1GeV()  > fNElectronsAbove1GeVMax))
+      return kFALSE; 
+  
+  if(fNElectronsAbove3GeVFlag)
+    if((EvTag->GetNumOfElectronsAbove3GeV() < fNElectronsAbove3GeVMin) || (EvTag->GetNumOfElectronsAbove3GeV() > fNElectronsAbove3GeVMax))
+      return kFALSE; 
+  
+  if(fNElectronsAbove10GeVFlag)
+    if((EvTag->GetNumOfElectronsAbove10GeV() < fNElectronsAbove10GeVMin) || (EvTag->GetNumOfElectronsAbove10GeV() > fNElectronsAbove10GeVMax))
+      return kFALSE; 
+  
+  if(fNElectronsFlag)
+    if((EvTag->GetNumOfElectrons() < fNElectronsMin) || (EvTag->GetNumOfElectrons() > fNElectronsMax))
+      return kFALSE; 
+  
+  if(fNFWMuonsFlag)
+    if((EvTag->GetNumOfFWMuons() < fNFWMuonsMin) || (EvTag->GetNumOfFWMuons() > fNFWMuonsMax))
+      return kFALSE; 
+  
+  if(fNFWMatchedMuonsFlag)
+    if((EvTag->GetNumOfFWMatchedMuons() < fNFWMatchedMuonsMin) || (EvTag->GetNumOfFWMatchedMuons() > fNFWMatchedMuonsMax))
+      return kFALSE; 
+  
+  if(fNMuonsFlag)
+    if((EvTag->GetNumOfMuons() < fNMuonsMin) || (EvTag->GetNumOfMuons() > fNMuonsMax))
+      return kFALSE; 
+  
+  if(fNPionsFlag)
+    if((EvTag->GetNumOfPions() < fNPionsMin) || (EvTag->GetNumOfPions() > fNPionsMax))
+      return kFALSE; 
+  
+  if(fNKaonsFlag)
+    if((EvTag->GetNumOfKaons() < fNKaonsMin) || (EvTag->GetNumOfKaons() > fNKaonsMax))
+      return kFALSE; 
+  
+  if(fNProtonsFlag)
+    if((EvTag->GetNumOfProtons() < fNProtonsMin) || (EvTag->GetNumOfProtons() > fNProtonsMax))
+      return kFALSE; 
+  
+  if(fNLambdasFlag)
+    if((EvTag->GetNumOfLambdas() < fNLambdasMin) || (EvTag->GetNumOfLambdas() > fNLambdasMax))
+      return kFALSE; 
+  
+  if(fNPhotonFlag)
+    if((EvTag->GetNumOfPhotons() < fNPhotonsMin) || (EvTag->GetNumOfPhotons() > fNPhotonsMax))
+      return kFALSE; 
+  
+  if(fNPi0sFlag)
+    if((EvTag->GetNumOfPi0s() < fNPi0sMin) || (EvTag->GetNumOfPi0s() > fNPi0sMax))
+      return kFALSE; 
+  
+  if(fNNeutronsFlag)
+    if((EvTag->GetNumOfNeutrons() < fNNeutronsMin) || (EvTag->GetNumOfNeutrons() > fNNeutronsMax))
+      return kFALSE; 
+  
+  if(fNKaon0sFlag)
+    if((EvTag->GetNumOfKaon0s() < fNKaon0sMin) || (EvTag->GetNumOfKaon0s() > fNKaon0sMax))
+      return kFALSE; 
+  
+  if(fTotalPFlag)
+    if((EvTag->GetTotalMomentum() < fTotalPMin) || (EvTag->GetTotalMomentum() > fTotalPMax))
+      return kFALSE; 
+  
+  if(fMeanPtFlag)
+    if((EvTag->GetMeanPt() < fMeanPtMin) || (EvTag->GetMeanPt() > fMeanPtMax))
+      return kFALSE; 
+  
+  if(fTopPtMinFlag)
+    if((EvTag->GetMaxPt() < fTopPtMin))
+      return kFALSE; 
+  
+  if(fTotalNeutralPFlag)
+    if((EvTag->GetNeutralTotalMomentum() < fTotalNeutralPMin) || (EvTag->GetNeutralTotalMomentum() > fTotalNeutralPMax))
+      return kFALSE; 
+  
+  if(fMeanNeutralPtFlag)
+    if((EvTag->GetNeutralMeanPt() < fMeanNeutralPtMin) || (EvTag->GetNeutralMeanPt() >fMeanNeutralPtMax ))
+      return kFALSE; 
+  
+  if(fTopNeutralPtMinFlag)
+    if((EvTag->GetNeutralMaxPt() < fTopNeutralPtMin))
+      return kFALSE; 
+  
+  if(fEventPlaneAngleFlag)
+    if((EvTag->GetEventPlaneAngle() < fEventPlaneAngleMin) || (EvTag->GetEventPlaneAngle() > fEventPlaneAngleMax))
+      return kFALSE; 
+  
+  if(fHBTRadiiFlag)
+    if((EvTag->GetHBTRadii() < fHBTRadiiMin) || (EvTag->GetHBTRadii() > fHBTRadiiMax))
+      return kFALSE; 
+
+  if (fFiredTriggerClassFlag) {
+    if (fActiveTriggerClasses.Length() == 0) {
+      AliWarning("Attempt to select Trigger classes but Active trigger classes not set in AliEventTagCuts. Cannot make the selection on Fired Trigger classes");
+    }
+    else {
+      TObjArray *tClasses = fFiredTriggerClass.Tokenize(" ");
+      Bool_t tTrig = kFALSE;
+    
+      for (int itrig=0; itrig<tClasses->GetEntries(); itrig++)
+       if (EvTag->GetFiredTriggerClasses(fActiveTriggerClasses).Contains(((TObjString *) tClasses->At(itrig))->GetString()))
+         tTrig = kTRUE;
+      
+      tClasses->Delete();
+      delete tClasses;
+      
+      if (!tTrig)
+       return kFALSE;
+    }
+  }
   
   return kTRUE;
+  
 }
index d3d35a6..ad9063d 100644 (file)
@@ -104,9 +104,12 @@ class AliEventTagCuts : public TObject {
   void SetNumberOfSPDTrackletsRange(Int_t low, Int_t high);
 
   // Trigger
-  void SetFiredTriggerClass(TString aclass);
+  void ResetTriggerClasses();
+  void AddRequiredFiredTriggerClass(TString aclass);
+  void InitializeTriggerClasses(TString aclass);
 
   Bool_t IsAccepted(AliEventTag *EvTag) const;
+  Bool_t IsAccepted(const AliEventTag *EvTag) const;
 
   //____________________________________________________//
  private:
@@ -260,10 +263,12 @@ class AliEventTagCuts : public TObject {
   Int_t fNumberOfSPDTrackletsMin, fNumberOfSPDTrackletsMax;   //min/max number of SPD tracklets
   Bool_t fNumberOfSPDTrackletsFlag;                          // Shows whether this cut is used or not
 
-  Bool_t fFiredTriggerCleassFlag;                             // Shows whether this cut is used or not
-  TString fFiredTriggerCleass;                                // Triger class must be present to accept event
+  Bool_t fFiredTriggerClassFlag;                              // Shows whether this cut is used or not
+  TString fFiredTriggerClass;                                 // Triger class must be present to accept event
 
-  ClassDef(AliEventTagCuts, 3)
+  TString fActiveTriggerClasses;                              // Trigger classes active for this run
+
+  ClassDef(AliEventTagCuts, 4)
 };
 
 #endif
diff --git a/STEER/AliFileTag.cxx b/STEER/AliFileTag.cxx
new file mode 100644 (file)
index 0000000..e420f15
--- /dev/null
@@ -0,0 +1,95 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id: AliFileTag.cxx 14745 2006-08-04 15:48:44Z panos $ */
+
+//-----------------------------------------------------------------
+//           Implementation of the FileTag class
+//   This is the class to deal with the tags in the file level
+//   Origin: Adam Kisiel, CERN, Adam.Kisiel@cern.ch
+//-----------------------------------------------------------------
+
+#include "AliFileTag.h"
+#include <stdlib.h>
+
+ClassImp(AliFileTag)
+
+//___________________________________________________________________________
+AliFileTag::AliFileTag() : 
+  TObject(),  
+  fGUID(""),
+  fPath(""),
+  fsize(0),
+  fmd5(""),
+  fturl(""),
+  fEventTags(1000)
+{
+  // AliFileTag default constructor
+  
+}
+
+AliFileTag::AliFileTag(const AliFileTag &tag):
+  TObject(tag),
+  fGUID(tag.fGUID),
+  fPath(tag.fPath),
+  fsize(tag.fsize),
+  fmd5(tag.fmd5),
+  fturl(tag.fturl),
+  fEventTags(10000)
+{
+  for (int iev=0; iev<tag.GetNEvents(); iev++)
+    AddEventTag(*(tag.GetEventTag(iev)));
+}
+
+AliFileTag &AliFileTag::operator=(const AliFileTag &tag)
+{
+  if (this != &tag) {
+    TObject::operator=(tag);
+
+    SetGUID(tag.GetGUID());
+    SetPath(tag.GetPath());
+    SetSize(tag.GetSize());
+    SetMD5(tag.GetMD5());
+    SetTURL(tag.GetTURL());
+    
+    for (int iev=0; iev<tag.GetNEvents(); iev++)
+      AddEventTag(*(tag.GetEventTag(iev)));
+  }
+
+  return *this;
+}
+
+//___________________________________________________________________________
+AliFileTag::~AliFileTag() {
+  // AliEventTag destructor
+  //  fEventTag.Delete();
+  fEventTags.Delete();
+}
+
+//___________________________________________________________________________
+void AliFileTag::AddEventTag(const AliEventTag & EvTag) {
+  //Adds an entry to the event tag TClonesArray
+
+  fEventTags.Add(new AliEventTag(EvTag));
+}
+
+void AliFileTag::CopyFileInfo(const AliFileTag &tag)
+{
+  SetGUID(tag.GetGUID());
+  SetPath(tag.GetPath());
+  SetSize(tag.GetSize());
+  SetMD5(tag.GetMD5());
+  SetTURL(tag.GetTURL());
+}
diff --git a/STEER/AliFileTag.h b/STEER/AliFileTag.h
new file mode 100644 (file)
index 0000000..900c293
--- /dev/null
@@ -0,0 +1,62 @@
+#ifndef ALIFILETAG_H
+#define ALIFILETAG_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+
+/* $Id: AliLHCTag.h 14745 2006-08-04 15:48:44Z panos $ */
+
+//-------------------------------------------------------------------------
+//                          Class AliFileTag
+//   This is the class to deal with the tags for the file level
+//
+//    Origin: Adam Kisiel, CERN, Adam.Kisiel@cern.ch
+//-------------------------------------------------------------------------
+
+#include <TObject.h>
+#include <TString.h>
+#include "TObjArray.h"
+#include "AliEventTag.h"
+
+//______________________________________________________________________________
+class AliFileTag : public TObject {
+ public:
+  AliFileTag();
+  AliFileTag(const AliFileTag &tag);
+  virtual ~AliFileTag();
+  
+  AliFileTag &operator=(const AliFileTag &tag);
+
+  //____________________________________________________//  
+  void SetGUID(TString Pid) { fGUID = Pid; }
+  void SetPath(TString Pid) { fPath = Pid; }
+  void SetMD5(TString Pid) {fmd5 = Pid; }
+  void SetTURL(TString Pid) {fturl = Pid; }
+  void SetSize(Long64_t i) {fsize = i; }
+  void AddEventTag(const AliEventTag &t);
+
+  void CopyFileInfo(const AliFileTag &tag);
+
+  //____________________________________________________//
+  const char *GetGUID() const {return fGUID.Data();}
+  const char *GetPath() const {return fPath.Data();}
+  const char *GetMD5() const {return fmd5.Data();}
+  const char *GetTURL() const {return fturl.Data();}
+  Long64_t    GetSize() const {return fsize;}
+  Int_t       GetNEvents() const {return fEventTags.GetEntries(); }
+  const AliEventTag *GetEventTag(Int_t iev) const {return (const AliEventTag *)fEventTags.At(iev);}
+
+  //____________________________________________________//
+ private:
+  TString   fGUID;                         //The unique identifier of the file
+  TString   fPath;                         //The file's path (local storage)
+  Long64_t  fsize;                          //the size of the file
+  TString   fmd5;                           //another file identifier
+  TString   fturl;                          //the file's url
+  TObjArray fEventTags;                     //array with all event tags
+  
+  ClassDef(AliFileTag,1)   //(ClassName, ClassVersion)
+};
+//______________________________________________________________________________
+
+#endif
index daf0b01..cdb5717 100644 (file)
@@ -29,11 +29,55 @@ ClassImp(AliLHCTag)
   AliLHCTag::AliLHCTag() : 
     TObject(),  
     fLHCState(0),
-    fLHCLuminosity(-10.)
+    fLHCLuminosity(-10.),
+    fNBunches(0),
+    fFillingScheme(),
+    fFillNo(-1),
+    fBeamEnergy(-1.0),
+    fBunchIntensity(0.0)
 {
   // AliLHCTag default constructor
 }
 
+AliLHCTag::AliLHCTag(const AliLHCTag &tag):
+  TObject(tag),
+  fLHCState(tag.fLHCState),
+  fLHCLuminosity(tag.fLHCLuminosity),
+  fNBunches(tag.fNBunches),
+  fFillingScheme(tag.fFillingScheme),
+  fFillNo(tag.fFillNo),
+  fBeamEnergy(tag.fBeamEnergy),
+  fBunchIntensity(tag.fBunchIntensity)
+{
+}
+
+AliLHCTag &AliLHCTag::operator=(const AliLHCTag &tag)
+{
+  if (this != &tag) {
+    TObject::operator=(tag);
+
+    TString state(tag.GetLHCState());
+    SetLHCState(state);
+    SetLuminosity(tag.GetLuminosity());
+    SetNBunches(tag.GetNBunches());
+    SetFillingScheme(tag.GetFillingScheme());
+    SetFillNo(tag.GetFillNo());
+    SetBeamEnergy(tag.GetBeamEnergy());
+    SetBunchIntensity(tag.GetBunchIntensity());
+  }
+
+  return *this;
+}
+
+void AliLHCTag::UpdateFromRunTable(AliLHCTag &tag)
+{
+  SetNBunches(tag.GetNBunches());
+  SetFillingScheme(tag.GetFillingScheme());
+  SetFillNo(tag.GetFillNo());
+  SetBeamEnergy(tag.GetBeamEnergy());
+  SetBunchIntensity(tag.GetBunchIntensity());  
+}
+
 //___________________________________________________________________________
 AliLHCTag::~AliLHCTag() {
   // AliEventTag destructor
index b52deaf..21e0305 100644 (file)
 class AliLHCTag : public TObject {
  public:
   AliLHCTag();
+  AliLHCTag(const AliLHCTag &tag);
   virtual ~AliLHCTag();
   
+  AliLHCTag &operator=(const AliLHCTag &tag);
+
   //____________________________________________________//
+  //  void SetLHCTag(Float_t lumin, TString type) {fLHCLuminosity = lumin; fLHCState = type; }
+  void UpdateFromRunTable(AliLHCTag &tag);
+
   void SetLHCState(TString type) {fLHCState = type;}
   void SetLuminosity(Float_t lumin) {fLHCLuminosity = lumin;}
-  void SetLHCTag(Float_t lumin, TString type) {fLHCLuminosity = lumin; fLHCState = type; }
+  void SetNBunches(UShort_t nb) { fNBunches = nb; };
+  void SetFillingScheme(TString sch) { fFillingScheme = sch; }
+  void SetFillNo(Int_t fill) { fFillNo = fill; };
+  void SetBeamEnergy(Float_t be) { fBeamEnergy = be; }
+  void SetBunchIntensity(Float_t bi) { fBunchIntensity = bi; }
+  
   
   //____________________________________________________//
-  const char *GetLHCState() {return fLHCState.Data();}
+  const char *GetLHCState() const {return fLHCState.Data();}
   Float_t     GetLuminosity() const {return fLHCLuminosity;}
-  
+  UShort_t    GetNBunches() const {return fNBunches; }
+  TString     GetFillingScheme() const {return fFillingScheme; }
+  Int_t       GetFillNo() const {return fFillNo; }
+  Float_t     GetBeamEnergy() const {return fBeamEnergy; }
+  Float_t     GetBunchIntensity() const {return fBunchIntensity; }
+
   //____________________________________________________//
  private:
-  TString fLHCState;      //LHC run conditions - comments
-  Float_t fLHCLuminosity; //the value of the luminosity
-  
-  ClassDef(AliLHCTag,1)  //(ClassName, ClassVersion)
+  TString  fLHCState;      //LHC run conditions - comments
+  Float_t  fLHCLuminosity; //the value of the luminosity
+  UShort_t fNBunches;      //Number of bunches in beam
+  TString  fFillingScheme; //Filling scheme name
+  Int_t    fFillNo;        //Fill number
+  Float_t  fBeamEnergy;    //Beam energy
+  Float_t  fBunchIntensity;//Intensity per bunch
+
+  ClassDef(AliLHCTag,2)   //(ClassName, ClassVersion)
 };
 //______________________________________________________________________________
 
index 6ab3936..eed2df0 100644 (file)
@@ -34,7 +34,17 @@ AliLHCTagCuts::AliLHCTagCuts() :
   fLHCStateFlag(kFALSE),
   fLHCLuminosityMin(0),
   fLHCLuminosityMax(0),
-  fLHCLuminosityFlag(kFALSE)
+  fLHCLuminosityFlag(kFALSE),
+  fNBunchesRange(), 
+  fNBunchesFlag(kFALSE),     
+  fFillingScheme(""),        
+  fFillingSchemeFlag(kFALSE),          
+  fFillNoRange(),       
+  fFillNoFlag(kFALSE),           
+  fBeamEnergyRange(),   
+  fBeamEnergyFlag(kFALSE),       
+  fBunchIntensityRange(),
+  fBunchIntensityFlag(kFALSE)  
 {
   //Default constructor which calls the Reset method.
   Reset();
@@ -53,6 +63,20 @@ void AliLHCTagCuts::Reset() {
   fLHCLuminosityMin = -1.0;
   fLHCLuminosityMax = 0.0;
   fLHCLuminosityFlag = kFALSE;
+  fNBunchesRange[0] = 0; 
+  fNBunchesRange[1] = 10000; 
+  fNBunchesFlag = kFALSE;
+  fFillingScheme = "";        
+  fFillingSchemeFlag = kFALSE;          
+  fFillNoRange[0] = 0;       
+  fFillNoRange[1] = 10000000;       
+  fFillNoFlag = kFALSE;           
+  fBeamEnergyRange[0] = 0.0;
+  fBeamEnergyRange[1] = 10000;   
+  fBeamEnergyFlag = kFALSE;       
+  fBunchIntensityRange[0] = 0.0;
+  fBunchIntensityRange[1] = 1e30;
+  fBunchIntensityFlag = kFALSE;  
 }
 
 //___________________________________________________________________________
@@ -64,6 +88,21 @@ Bool_t AliLHCTagCuts::IsAccepted(AliLHCTag *lhcTag) const {
   if(fLHCLuminosityFlag)
     if((lhcTag->GetLuminosity() < fLHCLuminosityMin)||(lhcTag->GetLuminosity() > fLHCLuminosityMax))
       return kFALSE;
+  if (fNBunchesFlag) 
+    if ((lhcTag->GetNBunches() < fNBunchesRange[0]) || (lhcTag->GetNBunches() > fNBunchesRange[1]))
+      return kFALSE;
+  if (fFillingSchemeFlag) 
+    if (!(lhcTag->GetFillingScheme().Contains(fFillingScheme)))
+      return kFALSE;
+  if (fFillNoFlag) 
+    if ((lhcTag->GetFillNo() < fFillNoRange[0]) || (lhcTag->GetFillNo() > fFillNoRange[1]))
+      return kFALSE;
+  if (fBeamEnergyFlag) 
+    if ((lhcTag->GetBeamEnergy() < fBeamEnergyRange[0]) || (lhcTag->GetBeamEnergy() > fBeamEnergyRange[1]))
+      return kFALSE;
+  if (fBunchIntensityFlag) 
+    if ((lhcTag->GetBunchIntensity() < fBunchIntensityRange[0]) || (lhcTag->GetBunchIntensity() > fBunchIntensityRange[1]))
+      return kFALSE;
+
   return kTRUE;
 }
index 96c6af5..1894536 100644 (file)
@@ -26,7 +26,13 @@ class AliLHCTagCuts : public TObject {
  //____________________________________________________//
   void SetLHCState(TString state) {fLHCState = state; fLHCStateFlag = kTRUE;}
   void SetLHCLuminosityRange(Float_t low, Float_t high) {fLHCLuminosityMin = low; fLHCLuminosityMax = high; fLHCLuminosityFlag = kTRUE;}
+
+  void SetNBunchesRange(UShort_t nbm, UShort_t nbx) { fNBunchesFlag = kTRUE; fNBunchesRange[0] = nbm; fNBunchesRange[1] = nbx; }
+  void SetFillingScheme(TString sch) { fFillingSchemeFlag = kTRUE; fFillingScheme = sch; }
+  void SetFillNoRange(Int_t fmin, Int_t fmax) { fFillNoFlag = kTRUE; fFillNoRange[0] = fmin; fFillNoRange[2] = fmax; }
+  void SetBeamEnergyRange(Float_t bemin, Float_t bemax) { fBeamEnergyFlag = kTRUE; fBeamEnergyRange[0] = bemin; fBeamEnergyRange[1] = bemax; }
+  void SetBunchIntensityRange(Float_t bimin, Float_t bimax) { fBunchIntensityFlag = kTRUE; fBunchIntensityRange[0] = bimin; fBunchIntensityRange[1] = bimax; }
+
   Bool_t IsAccepted(AliLHCTag *lhcTag) const;
 
   //____________________________________________________//
@@ -36,8 +42,18 @@ class AliLHCTagCuts : public TObject {
   Float_t fLHCLuminosityMin;      //LHC luminosity - min
   Float_t fLHCLuminosityMax;      //LHC luminosity - max
   Bool_t  fLHCLuminosityFlag;     //Shows whether this cut is used or
-
-  ClassDef(AliLHCTagCuts, 1)
+  UShort_t fNBunchesRange[2];     //Number of bunches in beam
+  Bool_t   fNBunchesFlag;         //Shows whether this cut is used or
+  TString  fFillingScheme;        //Rquired filling scheme name
+  Bool_t   fFillingSchemeFlag;    //Shows whether this cut is used or
+  Int_t    fFillNoRange[2];       //Required Fill no range
+  Bool_t   fFillNoFlag;           //Shows whether this cut is used or
+  Float_t  fBeamEnergyRange[2];   //Beam energy range
+  Bool_t   fBeamEnergyFlag;       //Shows whether this cut is used or
+  Float_t  fBunchIntensityRange[2];//Intensity per bunch range
+  Bool_t   fBunchIntensityFlag;   //Shows whether this cut is used or
+
+  ClassDef(AliLHCTagCuts, 2)
 };
 
 #endif
index 5cc0c4e..a1fd658 100644 (file)
@@ -183,16 +183,28 @@ void AliMCEvent::Clean()
     }
 }
 
+#include <iostream>
+
 void AliMCEvent::FinishEvent()
 {
   // Clean-up after event
   //    
     if (fStack) fStack->Reset(0);
+    std::cout << "MCParticles delete " << fMCParticleMap->GetEntries() << std::endl;
     fMCParticles->Delete();
-    fMCParticleMap->Clear();
-    if (fTRBuffer)
+    std::cout << "ParticleMap clear " << std::endl;
+    
+    if (fMCParticleMap) 
+      fMCParticleMap->Clear();
+    std::cout << "Clear done" << std::endl;
+    if (fTRBuffer) {
+      std::cout << "TRBuffer delete" << std::endl;
       fTRBuffer->Delete();
-    fTrackReferences->Delete();
+    }
+    //    fTrackReferences->Delete();
+  std::cout << "TrackReferences clear" << std::endl;
+    fTrackReferences->Clear();
+  std::cout << "Finished" << std::endl;
     fNparticles = -1;
     fNprimaries = -1;    
     fStack      =  0;
@@ -264,7 +276,7 @@ void AliMCEvent::ReorderAndExpandTreeTR()
     fTmpFileTR = new TFile("TrackRefsTmp.root", "recreate");
     fTmpTreeTR = new TTree("TreeTR", "TrackReferences");
     if (!fTRBuffer)  fTRBuffer = new TClonesArray("AliTrackReference", 100);
-    fTmpTreeTR->Branch("TrackReferences", "TClonesArray", &fTRBuffer, 32000, 0);
+    fTmpTreeTR->Branch("TrackReferences", "TClonesArray", &fTRBuffer, 64000, 0);
     
 
 //
index cddf963..6ec0ae8 100644 (file)
@@ -21,6 +21,7 @@
 //   Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
 //-----------------------------------------------------------------
 
+#include <stdlib.h>
 #include "AliRunTag.h"
 #include "AliDetectorTag.h"
 #include "AliEventTag.h"
@@ -41,16 +42,29 @@ ClassImp(AliRunTag)
     fLHCPeriod(0),
     fRecPass(0),
     fProductionName(0),
-    fAliceRunQuality(0),
+    fAliceRunValidated(0),
+    fAliceRunGlobalQuality(0),
     fAliceBeamEnergy(0.0),
     fAliceBeamType(0),
     fAliceCalibrationVersion(0),
     fAliceDataType(0),
-    fNumEvents(0),
+    //    fNumEvents(0),
+    fNumFiles(0),
+    fBeamTriggers(0),
+    fCollisionTriggers(0),
+    fEmptyTriggers(0),
+    fASideTriggers(0),
+    fCSideTriggers(0),
+    fHMTriggers(0),
+    fMuonTriggers(0),
+    fCollisionRate(0.0),
+    fMeanVertex(0.0),
+    fVertexQuality(0.0),
     fNumDetectors(0),
-    fEventTag("AliEventTag", 1000),
+    fFileTags(100),
     fDetectorTag(),
     fLHCTag(), 
+    fActiveTriggerClasses(""),
     fQA(),  
     fQALength(0), 
     fQAArray(NULL), 
@@ -63,11 +77,12 @@ ClassImp(AliRunTag)
 //___________________________________________________________________________
 AliRunTag::~AliRunTag() {
   //Destructor
-  fEventTag.Delete();
+  //  fEventTag.Delete();
   if ( fQAArray ) 
     delete [] fQAArray ; 
   if ( fEventSpecies )
     delete [] fEventSpecies ; 
+  fFileTags.Delete();
 }
 
 //___________________________________________________________________________
@@ -84,16 +99,29 @@ fGeant3Version(tag.fGeant3Version),
 fLHCPeriod(tag.fLHCPeriod),
 fRecPass(tag.fRecPass),
 fProductionName(tag.fProductionName),
-fAliceRunQuality(tag.fAliceRunQuality),
+fAliceRunValidated(tag.fAliceRunValidated),
+fAliceRunGlobalQuality(tag.fAliceRunGlobalQuality),
 fAliceBeamEnergy(tag.fAliceBeamEnergy),
 fAliceBeamType(tag.fAliceBeamType),
 fAliceCalibrationVersion(tag.fAliceCalibrationVersion),
 fAliceDataType(tag.fAliceDataType),
-fNumEvents(tag.fNumEvents),
+//fNumEvents(tag.fNumEvents),
+fNumFiles(tag.fNumFiles),
+fBeamTriggers(tag.fBeamTriggers),
+fCollisionTriggers(tag.fCollisionTriggers),
+fEmptyTriggers(tag.fEmptyTriggers),
+fASideTriggers(tag.fASideTriggers),
+fCSideTriggers(tag.fCSideTriggers),
+fHMTriggers(tag.fHMTriggers),
+fMuonTriggers(tag.fMuonTriggers),
+fCollisionRate(tag.fCollisionRate),
+fMeanVertex(tag.fMeanVertex),
+fVertexQuality(tag.fVertexQuality),
 fNumDetectors(tag.fNumDetectors),
-fEventTag(tag.fEventTag),
+fFileTags(100),
 fDetectorTag(tag.fDetectorTag),
 fLHCTag(tag.fLHCTag), 
+fActiveTriggerClasses(tag.fActiveTriggerClasses),
 fQA(tag.fQA),
 fQALength(tag.fQALength),
 fQAArray(NULL), 
@@ -113,6 +141,11 @@ fEventSpecies(NULL)
     fEventSpecies = new Bool_t[fESLength] ; 
     memcpy(fEventSpecies, tag.fEventSpecies, fESLength*sizeof(Bool_t)) ;
   }
+  for (int ifl=0; ifl<fNumFiles; ifl++) {
+    AddFileTag(tag.GetFileTag(ifl));
+  }
+    
+
 }
 
 //___________________________________________________________________________
@@ -130,16 +163,28 @@ AliRunTag& AliRunTag::operator = (const AliRunTag& tag) {
     fLHCPeriod                = tag.fLHCPeriod ; 
     fRecPass                  = tag.fRecPass ; 
     fProductionName           = tag.fProductionName ; 
-    fAliceRunQuality          = tag.fAliceRunQuality ; 
+    fAliceRunValidated        = tag.fAliceRunValidated ; 
+    fAliceRunGlobalQuality    = tag.fAliceRunGlobalQuality ; 
     fAliceBeamEnergy          = tag.fAliceBeamEnergy ;
     fAliceBeamType            = tag.fAliceBeamType ; 
     fAliceCalibrationVersion  = tag.fAliceCalibrationVersion ; 
     fAliceDataType            = tag.fAliceDataType ; 
-    fNumEvents                = tag.fNumEvents ;
+    //    fNumEvents                = tag.fNumEvents ;
+    fNumFiles                 = tag.fNumFiles;
+    fBeamTriggers             = tag.fBeamTriggers;
+    fCollisionTriggers       = tag.fCollisionTriggers;
+    fEmptyTriggers           = tag.fEmptyTriggers;
+    fASideTriggers           = tag.fASideTriggers;
+    fCSideTriggers           = tag.fCSideTriggers;
+    fHMTriggers               = tag.fHMTriggers;
+    fMuonTriggers             = tag.fMuonTriggers;
+    fCollisionRate           = tag.fCollisionRate;
+    fMeanVertex                      = tag.fMeanVertex;
+    fVertexQuality           = tag.fVertexQuality;
     fNumDetectors             = tag.fNumDetectors ; 
-    fEventTag                 = tag.fEventTag ;
     fDetectorTag              = tag.fDetectorTag ;
     fLHCTag                   = tag.fLHCTag ;  
+    fActiveTriggerClasses     = tag.fActiveTriggerClasses;
     fQA                       = tag.fQA ;      
     fQALength                 = tag.fQALength ; 
     if (fQAArray) 
@@ -159,6 +204,11 @@ AliRunTag& AliRunTag::operator = (const AliRunTag& tag) {
       fEventSpecies = new Bool_t[fESLength] ; 
       memcpy(fEventSpecies, tag.fEventSpecies, fESLength*sizeof(Bool_t)) ;
     }
+    for (int ifl=0; ifl<fNumFiles; ifl++) {
+      AddFileTag(tag.GetFileTag(ifl));
+    }
+//     for (int ifile=0; ifile<tag.GetFileTags()->GetEntries(); ifile++)
+//       AddFileTag(*((AliFileTag *) tag.GetFileTags()->At(ifile)));
   }
   return *this ; 
 }
@@ -177,16 +227,50 @@ void AliRunTag::CopyStandardContent(AliRunTag *oldtag) {
   SetLHCPeriod(oldtag->GetLHCPeriod());
   SetReconstructionPass(oldtag->GetReconstructionPass());
   SetProductionName(oldtag->GetProductionName());
+  SetRunValidation(oldtag->GetRunValidation());
   SetRunQuality(oldtag->GetRunQuality());
   SetBeamEnergy(oldtag->GetBeamEnergy());
   SetBeamType(oldtag->GetBeamType());
   SetCalibVersion(oldtag->GetCalibVersion());
   SetDataType(oldtag->GetDataType());
+  SetBeamTriggers(oldtag->GetBeamTriggers());
+  SetCollisionTriggers(oldtag->GetCollisionTriggers());
+  SetEmptyTriggers(oldtag->GetEmptyTriggers());
+  SetASideTriggers(oldtag->GetASideTriggers());
+  SetCSideTriggers(oldtag->GetCSideTriggers());
+  SetHMTriggers(oldtag->GetHMTriggers());
+  SetMuonTriggers(oldtag->GetMuonTriggers());
+  SetCollisionRate(oldtag->GetCollisionRate());
+  SetMeanVertex(oldtag->GetMeanVertex());
+  SetVertexQuality(oldtag->GetVertexQuality());
   SetLHCTag(oldtag->GetLHCTag()->GetLuminosity(),oldtag->GetLHCTag()->GetLHCState());
   SetDetectorTag(oldtag->GetDetectorTags()->GetIntDetectorMaskDAQ(), oldtag->GetDetectorTags()->GetIntDetectorMaskReco());
+  SetActiveTriggerClasses(oldtag->GetActiveTriggerClasses());
   SetQA(*(oldtag->GetQA())) ;          
   SetQAArray(oldtag->GetQAArray(), oldtag->GetQALength()) ;  
   SetEventSpecies(oldtag->GetEventSpecies(), oldtag->GetESLength()) ;  
+  for (int ifile=0; ifile<oldtag->GetNFiles(); ifile++) {
+    AliFileTag *ntag = new AliFileTag();
+    ntag->CopyFileInfo((const AliFileTag &) *(oldtag->GetFileTag(ifile)));
+    AddFileTag(ntag);
+  }
+}
+
+void AliRunTag::UpdateFromRunTable(AliRunTag *tabtag)
+{
+  SetBeamTriggers(tabtag->GetBeamTriggers());
+  SetCollisionTriggers(tabtag->GetCollisionTriggers());
+  SetEmptyTriggers(tabtag->GetEmptyTriggers());
+  SetASideTriggers(tabtag->GetASideTriggers());
+  SetCSideTriggers(tabtag->GetCSideTriggers());
+  SetHMTriggers(tabtag->GetHMTriggers());
+  SetMuonTriggers(tabtag->GetMuonTriggers());
+  SetCollisionRate(tabtag->GetCollisionRate());
+  SetMeanVertex(tabtag->GetMeanVertex());
+  SetVertexQuality(tabtag->GetVertexQuality());
+  SetRunQuality(tabtag->GetRunQuality());
+  fLHCTag.UpdateFromRunTable(*tabtag->GetLHCTag());
+  fDetectorTag.UpdateFromRunTable(*tabtag->GetDetectorTags());
 }
 
 //___________________________________________________________________________
@@ -217,7 +301,8 @@ void AliRunTag::SetEventSpecies(Bool_t * es, Int_t eslength) {
 //___________________________________________________________________________
 void AliRunTag::SetLHCTag(Float_t lumin, TString type) {
   //Setter for the LHC tags
-  fLHCTag.SetLHCTag(lumin,type);
+  fLHCTag.SetLuminosity(lumin);
+  fLHCTag.SetLHCState(type);
 }
 
 //___________________________________________________________________________
@@ -239,16 +324,23 @@ void AliRunTag::SetDetectorTag(UInt_t mask, UInt_t maskReco) {
 //___________________________________________________________________________
 void AliRunTag::AddEventTag(const AliEventTag & EvTag) {
   //Adds an entry to the event tag TClonesArray
-  new(fEventTag[fNumEvents++]) AliEventTag(EvTag);
+  ((AliFileTag *) fFileTags[fNumFiles-1])->AddEventTag(EvTag);
+  //  new(fEventTag[fNumEvents++]) AliEventTag(EvTag);
+}
+
+void AliRunTag::AddFileTag(AliFileTag *t) {
+  //Adds an entry for each file tag
+  //  new(fFileTags[fNumFiles++]) AliFileTag(t);
+  fFileTags[fNumFiles++] = t;
 }
 
 //___________________________________________________________________________
 void AliRunTag::Clear(const char *) {
   //Resets the number of events and detectors
-  fEventTag.Delete();
-  fNumEvents = 0;
-  fDetectorTag.Clear();
-  fNumDetectors = 0;
+  //  fEventTag.Delete();
+  //  fNumEvents = 0;
+  fFileTags.Delete();
+  fNumFiles = 0;
   if ( fQAArray ) {
     delete [] fQAArray ;
     fQAArray = 0x0;
@@ -260,3 +352,51 @@ void AliRunTag::Clear(const char *) {
   } 
   fESLength=0;
 }
+
+const AliEventTag* AliRunTag::GetEventTag(int evt) const
+{
+  int curev = evt;
+  int curf = 0;
+
+  if (evt >= GetNEvents()) return 0;
+  while (curev > ((AliFileTag *) fFileTags[curf])->GetNEvents()) {
+    curf++;
+    curev -= ((AliFileTag *) fFileTags[curf])->GetNEvents();
+  }
+  return ((AliFileTag *) fFileTags[curf])->GetEventTag(curev);
+}
+
+AliFileTag *AliRunTag::GetFileTagForEvent(int evt) 
+{
+  // Returns FileTag in which the given event is
+  int curev = evt;
+  int curf = 0;
+
+  if (evt >= GetNEvents()) return 0;
+  while (curev > ((AliFileTag *) fFileTags[curf])->GetNEvents()) {
+    curf++;
+    curev -= ((AliFileTag *) fFileTags[curf])->GetNEvents();
+  }
+  return (AliFileTag *) fFileTags[curf];
+}
+
+Int_t       AliRunTag::GetNEvents() const
+{
+  Int_t evtot = 0;
+  for (int iter=0; iter<fNumFiles; iter++)
+    evtot += ((AliFileTag *) fFileTags[iter])->GetNEvents();
+
+  return evtot;
+}
+
+Int_t      AliRunTag::GetFileId(const char *guid)
+{
+  for (int iter=0; iter<fNumFiles; iter++) {
+    if (strcmp(((AliFileTag *) fFileTags[iter])->GetGUID(), guid))
+      return iter;
+  }
+  return -1;
+}
+
index 6b77c4e..deb14f8 100644 (file)
@@ -18,6 +18,7 @@
 #include <TClonesArray.h>
 #include "AliLHCTag.h"
 #include "AliDetectorTag.h"
+#include "AliFileTag.h"
 #include "AliQA.h"
 
 class AliEventTag;
@@ -43,12 +44,23 @@ class AliRunTag : public TObject {
   void SetLHCPeriod(TString v) {fLHCPeriod = v; }
   void SetReconstructionPass(TString v) {fRecPass = v; }
   void SetProductionName(TString v) {fProductionName = v; }
-  void SetRunQuality(Int_t Pn) {fAliceRunQuality = Pn;}
+  void SetRunValidation(Bool_t val) {fAliceRunValidated = val; }
+  void SetRunQuality(Int_t Pn) {fAliceRunGlobalQuality = Pn;}
   void SetBeamEnergy(Float_t PE) {fAliceBeamEnergy = PE;}
   void SetBeamType(TString Ptype) {fAliceBeamType = Ptype;}
   void SetCalibVersion(Int_t Pn) {fAliceCalibrationVersion = Pn;}
   void SetDataType(Int_t i) {fAliceDataType = i;}
-  void SetNEvents(Int_t Pn) { fNumEvents = Pn; }
+/*   void SetNEvents(Int_t Pn) { fNumEvents = Pn; } */
+  void SetBeamTriggers(ULong_t bt) { fBeamTriggers = bt; }
+  void SetCollisionTriggers(ULong_t ct) { fCollisionTriggers = ct; }
+  void SetEmptyTriggers(ULong_t et) {fEmptyTriggers = et; }
+  void SetASideTriggers(ULong_t at) {fASideTriggers = at; }
+  void SetCSideTriggers(ULong_t ct) {fCSideTriggers = ct; }
+  void SetHMTriggers(ULong_t ht) {fHMTriggers = ht; }
+  void SetMuonTriggers(ULong_t mt) {fMuonTriggers = mt; }
+  void SetCollisionRate(Float_t rate) {fCollisionRate = rate; }
+  void SetMeanVertex(Float_t mv) {fMeanVertex = mv; }
+  void SetVertexQuality(Float_t vq) {fVertexQuality = vq; }
   void SetLHCTag(Float_t Plumin, TString type);
   void SetDetectorTag(UInt_t mask, UInt_t maskReco=0);
   void SetQA(const AliQA &qa) { fQA=qa; }      
@@ -56,9 +68,13 @@ class AliRunTag : public TObject {
   void SetEventSpecies(Bool_t * es, Int_t eslength) ;
   void AddEventTag(const AliEventTag &t);
   void Clear(const char * opt = "");
+  void AddFileTag(AliFileTag *t);
+
+  void SetActiveTriggerClasses(TString str) { fActiveTriggerClasses = str; }
 
   void CopyStandardContent(AliRunTag *oldtag);
-  
+  void UpdateFromRunTable(AliRunTag *tabtag);
+
   //____________________________________________________//
   Int_t       GetRunId() const {return fAliceRunId;}
   Float_t     GetMagneticField() const {return fAliceMagneticField;}
@@ -71,21 +87,39 @@ class AliRunTag : public TObject {
   const char* GetLHCPeriod() const {return fLHCPeriod.Data();}
   const char* GetReconstructionPass() const {return fRecPass.Data();}
   const char* GetProductionName() const {return fProductionName.Data();}
-  Int_t       GetRunQuality() const {return fAliceRunQuality;}
+  Bool_t      GetRunValidation() const {return fAliceRunValidated;}
+  Int_t       GetRunQuality() const {return fAliceRunGlobalQuality;}
   Float_t     GetBeamEnergy() const {return fAliceBeamEnergy;}
   const char *GetBeamType() const {return fAliceBeamType.Data();}
   Int_t       GetCalibVersion() const {return fAliceCalibrationVersion;}
   Int_t       GetDataType() const {return fAliceDataType;}
-  Int_t       GetNEvents() const {return fNumEvents;}
+  Int_t       GetNEvents() const;
+  ULong_t     GetBeamTriggers() const {return fBeamTriggers;}
+  ULong_t     GetCollisionTriggers() const {return fCollisionTriggers;}
+  ULong_t     GetEmptyTriggers() const {return fEmptyTriggers;}
+  ULong_t     GetASideTriggers() const {return fASideTriggers;}
+  ULong_t     GetCSideTriggers() const {return fCSideTriggers;}
+  ULong_t     GetHMTriggers() const {return fHMTriggers;}
+  ULong_t     GetMuonTriggers() const {return fMuonTriggers;}
+  Float_t     GetCollisionRate() const {return fCollisionRate;}
+  Float_t     GetMeanVertex() const {return fMeanVertex;}
+  Float_t     GetVertexQuality() const {return fVertexQuality;}
   AliLHCTag  *GetLHCTag() {return &fLHCTag; } 
   AliDetectorTag *GetDetectorTags() {return &fDetectorTag;}
-  const TClonesArray *GetEventTags() const {return &fEventTag;}
+  //  const TClonesArray *GetEventTags() const {return &fEventTag;}
+  const AliEventTag* GetEventTag(int evt) const;
+  AliFileTag *GetFileTagForEvent(int evt);
+  Int_t       GetNFiles() const { return fFileTags.GetEntries(); }
+  AliFileTag *GetFileTag(Int_t ifile) const {return (AliFileTag *) fFileTags.At(ifile);}
   const AliQA *GetQA() const {return &fQA;}
   ULong_t *  GetQAArray() const {return fQAArray;}     
   Int_t      GetQALength() const { return fQALength ; }
   Bool_t *   GetEventSpecies() const {return fEventSpecies;}   
   Int_t      GetESLength() const { return fESLength ; }
+  Int_t      GetFileId(const char *guid);
   
+  TString    GetActiveTriggerClasses() const {return fActiveTriggerClasses; }
+
   //____________________________________________________//
  private:
   Int_t        fAliceRunId;              //the run id
@@ -99,23 +133,40 @@ class AliRunTag : public TObject {
   TString      fLHCPeriod;               //datataking period
   TString      fRecPass;                 //Reconstruction pass number
   TString      fProductionName;          //production name
-  Bool_t       fAliceRunQuality;         //validation script
+  Bool_t       fAliceRunValidated;       //validation script
+  Int_t        fAliceRunGlobalQuality;   //validation script
   Float_t      fAliceBeamEnergy;         //beam energy cm
   TString      fAliceBeamType;           //run type (pp, AA, pA)
   Int_t        fAliceCalibrationVersion; //calibration version  
   Int_t        fAliceDataType;           //0: simulation -- 1: data  
-  Int_t        fNumEvents;               //number of events per file
+/*   Int_t        fNumEvents;               //number of events per file */
+  Int_t        fNumFiles;                //number of files in the run
+  ULong_t      fBeamTriggers;            //number of beam triggers in run (CBEAMB)
+  ULong_t      fCollisionTriggers;       //number of collision triggers in run (CINT1-B)
+  ULong_t      fEmptyTriggers;           //number of empty triggers in run (CINT1-E)
+  ULong_t      fASideTriggers;           //number of A-side triggers in run (CINT1-A)
+  ULong_t      fCSideTriggers;           //number of C-side triggers in run (CINT1-C)
+  ULong_t      fHMTriggers;              //number of High-Mult triggers
+  ULong_t      fMuonTriggers;            //number of Muon Triggers
+  Float_t      fCollisionRate;           //Average collision rate
+  Float_t      fMeanVertex;              //mean vertex position
+  Float_t      fVertexQuality;           //vertex quality
   Int_t        fNumDetectors;            //number of detector configs per file
-  TClonesArray fEventTag;                //array with all event tags
+  //  TClonesArray fEventTag;                //array with all event tags
+  //  TClonesArray fFileTags;                //array of file tags
+  //  AliFileTag **fFileTags;                //array of file tags
+  TObjArray    fFileTags;                //array of file tags
   AliDetectorTag fDetectorTag;           //array with all the detector tags
   AliLHCTag    fLHCTag;                  //LHC tag object
+  TString      fActiveTriggerClasses;    //Active trigger classes for run
   AliQA        fQA;                      //needed for backward compaibility
   Int_t        fQALength;                // Length of the fQA array  
   ULong_t *    fQAArray ;                //[fQALength] QA objects's data       
   Int_t        fESLength;                // Length of the Event Specie Length
-  Bool_t *     fEventSpecies;           //[fESLength] EventSpecies in this run 
+  Bool_t *     fEventSpecies;            //[fESLength] EventSpecies in this run        
   
-  ClassDef(AliRunTag,7)  //(ClassName, ClassVersion)
+
+  ClassDef(AliRunTag,9)  //(ClassName, ClassVersion)
 };
 //___________________________________________________________________________
 
index 3626182..94d09d3 100644 (file)
@@ -35,6 +35,8 @@ AliRunTagCuts::AliRunTagCuts() :
   fAliceRunIdFlag(kFALSE),              
   fAliceMagneticField(-1.),          
   fAliceMagneticFieldFlag(kFALSE),      
+  fAliceDipoleField(-1.),
+  fAliceDipoleFieldFlag(kFALSE),
   fAliceRunStartTimeMin(-1),        
   fAliceRunStartTimeMax(-1),        
   fAliceRunStartTimeFlag(kFALSE),       
@@ -46,9 +48,17 @@ AliRunTagCuts::AliRunTagCuts() :
   fRootVersion(""),                 
   fRootVersionFlag(kFALSE),             
   fGeant3Version(""),               
-  fGeant3VersionFlag(kFALSE),           
-  fAliceRunQuality(0),             
-  fAliceRunQualityFlag(kFALSE),         
+  fGeant3VersionFlag(kFALSE),   
+  fLHCPeriod(""),
+  fLHCPeriodFlag(kFALSE),
+  fRecPass(""),
+  fRecPassFlag(kFALSE),
+  fProdName(""),
+  fProdNameFlag(kFALSE),
+  fAliceRunValidation(0),             
+  fAliceRunValidationFlag(kFALSE),         
+  fAliceRunQualities(""),
+  fAliceRunQualitiesFlag(kFALSE),
   fAliceBeamEnergy(-1),             
   fAliceBeamEnergyFlag(kFALSE),         
   fAliceBeamType(""),               
@@ -56,7 +66,27 @@ AliRunTagCuts::AliRunTagCuts() :
   fAliceCalibrationVersion(-1),    
   fAliceCalibrationVersionFlag(kFALSE),
   fAliceDataType(-1),                
-  fAliceDataTypeFlag(kFALSE)
+  fAliceDataTypeFlag(kFALSE),
+  fBeamTriggerRange(),
+  fBeamTriggerFlag(kFALSE),
+  fCollisionTriggerRange(),
+  fCollisionTriggerFlag(kFALSE),
+  fEmptyTriggerRange(),
+  fEmptyTriggerFlag(kFALSE),
+  fASideTriggerRange(),
+  fASideTriggerFlag(kFALSE),
+  fCSideTriggerRange(),
+  fCSideTriggerFlag(kFALSE),
+  fHMTriggerRange(),
+  fHMTriggerFlag(kFALSE),
+  fMuonTriggerRange(),
+  fMuonTriggerFlag(kFALSE),
+  fCollisionRateRange(),
+  fCollisionRateFlag(kFALSE),
+  fMeanVertexRange(),
+  fMeanVertexFlag(kFALSE),
+  fVertexQualityRange(),
+  fVertexQualityFlag(kFALSE)
 {
   //Default constructor which calls the Reset method.
 }
@@ -73,6 +103,8 @@ void AliRunTagCuts::Reset() {
   fAliceRunIdFlag = kFALSE;              
   fAliceMagneticField = -1.;          
   fAliceMagneticFieldFlag = kFALSE;      
+  fAliceDipoleField = -1.;
+  fAliceDipoleFieldFlag = kFALSE;
   fAliceRunStartTimeMin = -1;        
   fAliceRunStartTimeMax = -1;        
   fAliceRunStartTimeFlag = kFALSE;       
@@ -85,8 +117,16 @@ void AliRunTagCuts::Reset() {
   fRootVersionFlag = kFALSE;             
   fGeant3Version = "";               
   fGeant3VersionFlag = kFALSE;           
-  fAliceRunQuality = 0;             
-  fAliceRunQualityFlag = kFALSE;         
+  fLHCPeriod = "";
+  fLHCPeriodFlag = kFALSE;
+  fRecPass = "";
+  fRecPassFlag = kFALSE;
+  fProdName = "";
+  fProdNameFlag = kFALSE;
+  fAliceRunValidation = 0;             
+  fAliceRunValidationFlag = kFALSE;         
+  fAliceRunQualities = "";
+  fAliceRunQualitiesFlag = kFALSE;
   fAliceBeamEnergy = -1;             
   fAliceBeamEnergyFlag = kFALSE;         
   fAliceBeamType = "";               
@@ -95,6 +135,44 @@ void AliRunTagCuts::Reset() {
   fAliceCalibrationVersionFlag = kFALSE;
   fAliceDataType = -1;                
   fAliceDataTypeFlag = kFALSE;           
+  fBeamTriggerRange[0] = 0;
+  fBeamTriggerRange[1] = 0;
+  fBeamTriggerFlag = kFALSE;
+  fCollisionTriggerRange[0] = 0;
+  fCollisionTriggerRange[1] = 0;
+  fCollisionTriggerFlag = kFALSE;
+  fEmptyTriggerRange[0] = 0;
+  fEmptyTriggerRange[1] = 0;
+  fEmptyTriggerFlag = kFALSE;
+  fASideTriggerRange[0] = 0;
+  fASideTriggerRange[1] = 0;
+  fASideTriggerFlag = kFALSE;
+  fCSideTriggerRange[0] = 0;
+  fCSideTriggerRange[1] = 0;
+  fCSideTriggerFlag = kFALSE;
+  fHMTriggerRange[0] = 0;
+  fHMTriggerRange[1] = 0;
+  fHMTriggerFlag = kFALSE;
+  fMuonTriggerRange[0] = 0;
+  fMuonTriggerRange[1] = 0;
+  fMuonTriggerFlag = kFALSE;
+  fCollisionRateRange[0] = 0;
+  fCollisionRateRange[1] = 0;
+  fCollisionRateFlag = kFALSE;
+  fMeanVertexRange[0] = 0;
+  fMeanVertexRange[1] = 0;
+  fMeanVertexFlag = kFALSE;
+  fVertexQualityRange[0] = 0;
+  fVertexQualityRange[1] = 0;
+  fVertexQualityFlag = kFALSE;
+}
+
+void AliRunTagCuts::AddRunQualityValue(Int_t qval)
+{
+  // Adds to the list of selected run qualities
+  fAliceRunQualities += qval;
+  fAliceRunQualities += " ";
+  fAliceRunQualitiesFlag = kTRUE;
 }
 
 //___________________________________________________________________________
@@ -106,6 +184,9 @@ Bool_t AliRunTagCuts::IsAccepted(AliRunTag *RunTag) const {
   if(fAliceMagneticFieldFlag)
     if((RunTag->GetMagneticField() != fAliceMagneticField))
       return kFALSE;
+  if(fAliceDipoleFieldFlag)
+    if((RunTag->GetDipoleField() != fAliceDipoleField))
+      return kFALSE;
   if(fAliceRunStartTimeFlag)
     if((RunTag->GetRunStartTime() < fAliceRunStartTimeMin) || (RunTag->GetRunStartTime() > fAliceRunStartTimeMax))
       return kFALSE;
@@ -121,9 +202,36 @@ Bool_t AliRunTagCuts::IsAccepted(AliRunTag *RunTag) const {
   if(fGeant3VersionFlag)
     if((RunTag->GetGeant3Version() != fGeant3Version))
       return kFALSE;
-  if(fAliceRunQualityFlag)
-    if(RunTag->GetRunQuality())
+  if(fLHCPeriodFlag)
+    if((RunTag->GetLHCPeriod() != fLHCPeriod))
+      return kFALSE;
+  if(fRecPassFlag)
+    if((RunTag->GetReconstructionPass() != fRecPass))
+      return kFALSE;
+  if(fProdNameFlag)
+    if((RunTag->GetProductionName() != fProdName))
+      return kFALSE;
+  if(fAliceRunValidationFlag)
+    if(RunTag->GetRunValidation())
+      return kFALSE;
+  if (fAliceRunQualitiesFlag) {
+    TObjArray *tQualities = fAliceRunQualities.Tokenize(" ");
+    Bool_t tQual = kFALSE;
+
+    TString tRQual = "";
+    tRQual += RunTag->GetRunQuality();
+
+    for (int iqual=0; iqual<tQualities->GetEntries(); iqual++)
+      if (((TObjString *) tQualities->At(iqual))->GetString().Contains(tRQual))
+       tQual = kTRUE;
+       //      if (EvTag->GetFiredTriggerClasses().Contains(((TObjString *) tClasses->At(iqual))->GetString()))
+  
+    tQualities->Delete();
+    delete tQualities;
+
+    if (!tQual)
       return kFALSE;
+  }
   if(fAliceBeamEnergyFlag)
     if(RunTag->GetBeamEnergy() != fAliceBeamEnergy)
       return kFALSE;
@@ -136,6 +244,36 @@ Bool_t AliRunTagCuts::IsAccepted(AliRunTag *RunTag) const {
   if(fAliceDataTypeFlag)
     if(RunTag->GetDataType() != fAliceDataType)
       return kFALSE;
+  if (fBeamTriggerFlag)
+    if ((RunTag->GetBeamTriggers() < fBeamTriggerRange[0]) || (RunTag->GetBeamTriggers() > fBeamTriggerRange[1]))
+      return kFALSE;
+  if (fCollisionTriggerFlag)
+    if ((RunTag->GetCollisionTriggers() < fCollisionTriggerRange[0]) || (RunTag->GetCollisionTriggers() > fCollisionTriggerRange[1]))
+      return kFALSE;
+  if (fEmptyTriggerFlag)
+    if ((RunTag->GetEmptyTriggers() < fEmptyTriggerRange[0]) || (RunTag->GetEmptyTriggers() > fEmptyTriggerRange[1]))
+      return kFALSE;
+  if (fCSideTriggerFlag)
+    if ((RunTag->GetCSideTriggers() < fCSideTriggerRange[0]) || (RunTag->GetCSideTriggers() > fCSideTriggerRange[1]))
+      return kFALSE;
+  if (fASideTriggerFlag)
+    if ((RunTag->GetASideTriggers() < fASideTriggerRange[0]) || (RunTag->GetASideTriggers() > fASideTriggerRange[1]))
+      return kFALSE;
+  if (fHMTriggerFlag)
+    if ((RunTag->GetHMTriggers() < fHMTriggerRange[0]) || (RunTag->GetHMTriggers() > fHMTriggerRange[1]))
+      return kFALSE;
+  if (fMuonTriggerFlag)
+    if ((RunTag->GetMuonTriggers() < fMuonTriggerRange[0]) || (RunTag->GetMuonTriggers() > fMuonTriggerRange[1]))
+      return kFALSE;
+  if (fCollisionRateFlag)
+    if ((RunTag->GetCollisionRate() < fCollisionRateRange[0]) || (RunTag->GetCollisionRate() > fCollisionRateRange[1]))
+      return kFALSE;
+  if (fMeanVertexFlag)
+    if ((RunTag->GetMeanVertex() < fMeanVertexRange[0]) || (RunTag->GetMeanVertex() > fMeanVertexRange[1]))
+      return kFALSE;
+  if (fVertexQualityFlag)
+    if ((RunTag->GetVertexQuality() < fVertexQualityRange[0]) || (RunTag->GetVertexQuality() > fVertexQualityRange[1]))
+      return kFALSE;
+
   return kTRUE;
 }
index a4633af..76b32a2 100644 (file)
@@ -26,17 +26,32 @@ class AliRunTagCuts : public TObject {
  //____________________________________________________//
   void SetRunId(Int_t Pid) {fAliceRunId = Pid; fAliceRunIdFlag = kTRUE;}
   void SetMagneticField(Float_t Pmag) {fAliceMagneticField = Pmag; fAliceMagneticFieldFlag = kTRUE;}
+  void SetDipoleField(Float_t Pmag) {fAliceDipoleField = Pmag; fAliceDipoleFieldFlag = kTRUE;}
   void SetRunStartTimeRange(Int_t t0, Int_t t1) {fAliceRunStartTimeMin = t0; fAliceRunStartTimeMax = t1; fAliceRunStartTimeFlag = kTRUE;}
   void SetRunStopTimeRange(Int_t t0, Int_t t1) {fAliceRunStopTimeMin = t0; fAliceRunStopTimeMax = t1; fAliceRunStartTimeFlag = kTRUE;}
   void SetAlirootVersion(TString v) {fAlirootVersion = "VO_ALICE@AliRoot::"; fAlirootVersion += v; fAlirootVersionFlag = kTRUE;}
   void SetRootVersion(TString v) {fRootVersion = "VO_ALICE@ROOT::"; fRootVersion += v; fRootVersionFlag = kTRUE;}
   void SetGeant3Version(TString v) {fGeant3Version = "VO_ALICE@GEANT3::"; fGeant3Version += v; fGeant3VersionFlag = kTRUE;}
-  void SetRunQuality(Int_t Pn) {fAliceRunQuality = Pn; fAliceRunQualityFlag = kTRUE;}
+  void SetLHCPeriod(TString v) {fLHCPeriod = v; fLHCPeriodFlag = kTRUE; }
+  void SetReconstructionPass(TString v) {fRecPass = v; fRecPassFlag = kTRUE; }
+  void SetProductionName(TString v) {fProdName = v; fProdNameFlag = kTRUE; }
+  void SetRunValidation(Int_t Pn) {fAliceRunValidation = Pn; fAliceRunValidationFlag = kTRUE;}
+  void AddRunQualityValue(Int_t qval);
   void SetBeamEnergy(Float_t PE) {fAliceBeamEnergy = PE; fAliceBeamTypeFlag = kTRUE;}
   void SetBeamType(TString Ptype) {fAliceBeamType = Ptype; fAliceCalibrationVersionFlag = kTRUE;}
   void SetCalibVersion(Int_t Pn) {fAliceCalibrationVersion = Pn; fAliceCalibrationVersionFlag = kTRUE;}
   void SetDataType(Int_t i) {fAliceDataType = i; fAliceDataTypeFlag = kTRUE;}
+  void SetBeamTriggersRange(ULong_t tmin, ULong_t tmax) { fBeamTriggerRange[0] = tmin; fBeamTriggerRange[1] = tmax; fBeamTriggerFlag = kTRUE; }
+  void SetCollisionTriggersRange(ULong_t tmin, ULong_t tmax) { fCollisionTriggerRange[0] = tmin; fCollisionTriggerRange[1] = tmax; fCollisionTriggerFlag = kTRUE; }
+  void SetEmptyTriggersRange(ULong_t tmin, ULong_t tmax) { fEmptyTriggerRange[0] = tmin; fEmptyTriggerRange[1] = tmax; fEmptyTriggerFlag = kTRUE; }
+  void SetASideTriggersRange(ULong_t tmin, ULong_t tmax) { fASideTriggerRange[0] = tmin; fASideTriggerRange[1] = tmax; fASideTriggerFlag = kTRUE; }
+  void SetCSideTriggersRange(ULong_t tmin, ULong_t tmax) { fCSideTriggerRange[0] = tmin; fCSideTriggerRange[1] = tmax; fCSideTriggerFlag = kTRUE; }
+  void SetHMTriggersRange(ULong_t tmin, ULong_t tmax) { fHMTriggerRange[0] = tmin; fHMTriggerRange[1] = tmax; fHMTriggerFlag = kTRUE; }
+  void SetMuonTriggersRange(ULong_t tmin, ULong_t tmax) { fMuonTriggerRange[0] = tmin; fMuonTriggerRange[1] = tmax; fMuonTriggerFlag = kTRUE; }
+  void SetCollisionRatesRange(ULong_t tmin, ULong_t tmax) { fCollisionRateRange[0] = tmin; fCollisionRateRange[1] = tmax; fCollisionRateFlag = kTRUE; }
+  void SetMeanVertexsRange(ULong_t tmin, ULong_t tmax) { fMeanVertexRange[0] = tmin; fMeanVertexRange[1] = tmax; fMeanVertexFlag = kTRUE; }
+  void SetVertexQualitysRange(ULong_t tmin, ULong_t tmax) { fVertexQualityRange[0] = tmin; fVertexQualityRange[1] = tmax; fVertexQualityFlag = kTRUE; }
+
   Bool_t IsAccepted(AliRunTag *RunTag) const;
 
   //____________________________________________________//
@@ -45,6 +60,8 @@ class AliRunTagCuts : public TObject {
   Bool_t  fAliceRunIdFlag;              //Shows whether this cut is used or not
   Float_t fAliceMagneticField;          //value of the magnetic field
   Bool_t  fAliceMagneticFieldFlag;      //Shows whether this cut is used or not
+  Float_t fAliceDipoleField;            //value of the dipole field
+  Bool_t  fAliceDipoleFieldFlag;        //Shows whether this cut is used or not
   Int_t   fAliceRunStartTimeMin;        //minimum run start date
   Int_t   fAliceRunStartTimeMax;        //maximum run start date
   Bool_t  fAliceRunStartTimeFlag;       //Shows whether this cut is used or not
@@ -57,8 +74,16 @@ class AliRunTagCuts : public TObject {
   Bool_t  fRootVersionFlag;             //Shows whether this cut is used or not
   TString fGeant3Version;               //geant3 version
   Bool_t  fGeant3VersionFlag;           //Shows whether this cut is used or not
-  Bool_t  fAliceRunQuality;             //validation script
-  Bool_t  fAliceRunQualityFlag;         //Shows whether this cut is used or not
+  TString fLHCPeriod;                   //LHC period version
+  Bool_t  fLHCPeriodFlag;               //Shows whether this cut is used or not
+  TString fRecPass;                     //Reconstruction pass
+  Bool_t  fRecPassFlag;                 //Shows whether this cut is used or not
+  TString fProdName;                    //Production Name
+  Bool_t  fProdNameFlag;                //Shows whether this cut is used or not
+  Bool_t  fAliceRunValidation;          //validation script
+  Bool_t  fAliceRunValidationFlag;      //Shows whether this cut is used or not
+  TString fAliceRunQualities;           //selected qualities
+  Bool_t  fAliceRunQualitiesFlag;       //Shows whether this cut is used or not
   Float_t fAliceBeamEnergy;             //beam energy cm
   Bool_t  fAliceBeamEnergyFlag;         //Shows whether this cut is used or not
   TString fAliceBeamType;               //run type (pp, AA, pA)
@@ -67,8 +92,28 @@ class AliRunTagCuts : public TObject {
   Bool_t  fAliceCalibrationVersionFlag; //Shows whether this cut is used or not
   Int_t   fAliceDataType;               //0: simulation -- 1: data  
   Bool_t  fAliceDataTypeFlag;           //Shows whether this cut is used or not
+  ULong_t fBeamTriggerRange[2];         //Beam trigger maximum and minimum
+  Bool_t  fBeamTriggerFlag;             //Shows whether this cut is used or not
+  ULong_t fCollisionTriggerRange[2];    //Collision trigger maximum and minimum
+  Bool_t  fCollisionTriggerFlag;        //Shows whether this cut is used or not
+  ULong_t fEmptyTriggerRange[2];        //Empty trigger maximum and minimum
+  Bool_t  fEmptyTriggerFlag;            //Shows whether this cut is used or not
+  ULong_t fASideTriggerRange[2];        //ASide trigger maximum and minimum
+  Bool_t  fASideTriggerFlag;            //Shows whether this cut is used or not
+  ULong_t fCSideTriggerRange[2];        //CSide trigger maximum and minimum
+  Bool_t  fCSideTriggerFlag;            //Shows whether this cut is used or not
+  ULong_t fHMTriggerRange[2];           //High Multiplicity trigger maximum and minimum
+  Bool_t  fHMTriggerFlag;               //Shows whether this cut is used or not
+  ULong_t fMuonTriggerRange[2];         //Muon trigger maximum and minimum
+  Bool_t  fMuonTriggerFlag;             //Shows whether this cut is used or not
+  Float_t fCollisionRateRange[2];       //Collision rate range
+  Bool_t  fCollisionRateFlag;           //Shows whether this cut is used or not
+  Float_t fMeanVertexRange[2];          //Mean Vertex Postion
+  Bool_t  fMeanVertexFlag;              //Shows whether this cut is used or not
+  Float_t fVertexQualityRange[2];       //Mean Vertex quality
+  Bool_t  fVertexQualityFlag;           //Shows whether this cut is used or not
 
-  ClassDef(AliRunTagCuts, 1)
+  ClassDef(AliRunTagCuts, 2)
 };
 
 #endif
index 6f5aac3..0e87a52 100644 (file)
@@ -446,15 +446,19 @@ Bool_t AliTagCreator::MergeToSingleRunTag(TChain *chain, const char *filename)
 
   AliRunTag *tag = new AliRunTag;
   TTree * ttag = new TTree("T","A Tree with event tags");
-  TBranch * btag = ttag->Branch("AliTAG", &tag);
+  TBranch * btag = ttag->Branch("AliTAG", &tag, 1000000);
   btag->SetCompressionLevel(9);
+  ttag->AutoSave("10000");
 
   AliRunTag *rtag = new AliRunTag();
   chain->SetBranchAddress("AliTAG", &rtag);
 
+  AliFileTag *evt;
+
   if (chain->GetEntries()) {
     chain->GetEntry(0);
     tag->CopyStandardContent(rtag);
+    tag->Clear();
 
     int runno = rtag->GetRunId();
 
@@ -465,8 +469,9 @@ Bool_t AliTagCreator::MergeToSingleRunTag(TChain *chain, const char *filename)
        continue;
       }
 
-      for (int iev=0; iev<rtag->GetEventTags()->GetEntries(); iev++) {
-       tag->AddEventTag(*((AliEventTag *) rtag->GetEventTags()->At(iev)));
+      for (int iev=0; iev<rtag->GetNFiles(); iev++) {
+       evt = (AliFileTag *) rtag->GetFileTag(iev);
+       tag->AddFileTag(new AliFileTag(*evt));
       }
     }
   }
index 0316373..cfeb6c5 100644 (file)
@@ -39,7 +39,7 @@ class AliTagCreator : public TObject {
   //____________________________________________________//
   Bool_t MergeTags(const char* type);
   Bool_t MergeTags(const char* type, TGridResult *result);
-  Bool_t MergeTags(const char *type, const char *inflist);
+  Bool_t MergeTags(const char* type, const char *inflist);
 
   Bool_t MergeTagsForRun(const char* type);
   Bool_t MergeTagsForRun(const char* type, TGridResult *result);
index 816e731..eba0dbe 100644 (file)
@@ -31,6 +31,7 @@
 #pragma link C++ class AliLHCTag+;
 #pragma link C++ class AliDetectorTag+;
 #pragma link C++ class AliEventTag+;
+#pragma link C++ class AliFileTag+;
 
 #pragma link C++ class AliRunTagCuts+;
 #pragma link C++ class AliLHCTagCuts+;
index 7574b95..169c5d2 100644 (file)
@@ -11,7 +11,7 @@ SRCS = AliVParticle.cxx \
        AliVEventPool.cxx \
        AliVCuts.cxx \
        AliPID.cxx AliLog.cxx \
-       AliRunTag.cxx AliLHCTag.cxx AliDetectorTag.cxx AliEventTag.cxx \
+       AliRunTag.cxx AliLHCTag.cxx AliDetectorTag.cxx AliEventTag.cxx AliFileTag.cxx \
        AliEventTagCuts.cxx AliRunTagCuts.cxx \
        AliLHCTagCuts.cxx AliDetectorTagCuts.cxx \
        AliTagCreator.cxx \