+ // for(Int_t iTagFiles = 0; iTagFiles < fChain->GetListOfFiles()->GetEntries(); ++iTagFiles)
+ for(Int_t iRunTags = 0; iRunTags < fChain->GetEntries(); ++iRunTags)
+ {
+ 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())) )
+ {
+ for (int iChunk = 0; iChunk < tag->GetNFiles(); iChunk++, iTagFiles++)
+ {
+ iRejectedEvtInFile = 0;
+ iAcceptedEvtInFile = 0;
+
+ localList.Reset();
+
+ flTag = tag->GetFileTag(iChunk);
+ guid = flTag->GetGUID();
+ turl = flTag->GetTURL();
+ lfn = turl(8,turl.Length());
+
+ for (int i = 0; i<flTag->GetNEvents(); i++)
+ {
+ // evTag = flTag->GetEventTag(i);
+
+ if( !evTagCuts || ( evTagCuts && evTagCuts->IsAccepted(flTag->GetEventTag(i))) )
+ {
+ localList.Enter(i);
+ iAcceptedEvtInFile++;
+ }
+ else
+ {
+ ++iRejectedEvt;
+ ++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();
+ }
+ }//lhc tag cuts
+ else {
+ iRejectedLHC += tag->GetNEvents();
+ }
+ }//run tag cuts
+ else {
+ iRejectedRun += tag->GetNEvents();
+ }
+ tag->Clear();
+ } //tag file loop
+
+ collection.WriteSummary(iTotalEvents, iAccepted, iRejectedRun, iRejectedLHC, iRejectedDet, iRejectedEvt);
+ collection.Export();
+