#include <TInterpreter.h>
#include <TSystem.h>
#include <TPRegexp.h>
+#include <THashList.h>
#include <Riostream.h>
#include "AliRawReader.h"
fSelectTriggerExpr.ReplaceAll(name,"0");
}
+void AliRawReader::LoadTriggerAlias(const THashList *lst)
+{
+ // Loads the list of trigger aliases defined.
+ // Replaces the alias by the OR of the triggers included in it.
+ // The subsiquent call to LoadTriggerClass is needed
+ // to obtain the final expression in
+ // fSelectedTriggerExpr
+
+ if (fSelectTriggerExpr.IsNull()) return;
+
+ // Make a THashList alias -> trigger classes
+
+ THashList alias2trig;
+ TIter iter(lst);
+ TNamed *nmd = 0;
+
+ // Loop on triggers
+
+ while((nmd = dynamic_cast<TNamed*>(iter.Next()))){
+
+ TString aliasList(nmd->GetTitle());
+ TObjArray* arrAliases = aliasList.Tokenize(',');
+ Int_t nAliases = arrAliases->GetEntries();
+
+ // Loop on aliases for the current trigger
+ for(Int_t i=0; i<nAliases; i++){
+
+ TObjString *alias = (TObjString*) arrAliases->At(i);
+
+ // Find the current alias in the hash list. If it is not there, add TNamed entry
+ TNamed * inlist = (TNamed*)alias2trig.FindObject((alias->GetString()).Data());
+ if (!inlist) {
+ inlist = new TNamed((alias->GetString()).Data(),nmd->GetName());
+ alias2trig.Add(inlist);
+ }
+ else {
+ TString tt(inlist->GetTitle());
+ tt += " || ";
+ tt += nmd->GetName();
+ inlist->SetTitle(tt.Data());
+ }
+ }
+
+ delete arrAliases;
+ }
+ alias2trig.Sort(kSortDescending);
+
+ // Replace all the aliases by the OR of triggers
+ TIter iter1(&alias2trig);
+ while((nmd = dynamic_cast<TNamed*>(iter1.Next()))){
+ fSelectTriggerExpr.ReplaceAll(nmd->GetName(),nmd->GetTitle());
+ }
+}
+
Bool_t AliRawReader::IsSelected() const
{
// apply the selection (if any)
#include "AliRawDataErrorLog.h"
#include "AliRawDataHeader.h"
+class THashList;
class TChain;
class AliRawEventHeaderBase;
class AliRawVEvent;
Bool_t IsRawReaderValid() const { return fIsValid; }
void LoadTriggerClass(const char* name, Int_t index);
+ void LoadTriggerAlias(const THashList *lst);
virtual AliRawReader* CloneSingleEvent() const { return NULL; }
#include <TMessage.h>
#include <TUrl.h>
#include <TRandom.h>
+#include <THashList.h>
#include "AliAlignObj.h"
#include "AliAnalysisManager.h"
return kFALSE;
}
+ // Load trigger aliases and declare the trigger classes included in aliases
+ AliCDBEntry * entry = AliCDBManager::Instance()->Get("GRP/CTP/Aliases");
+ if (entry) {
+ THashList * lst = dynamic_cast<THashList*>(entry->GetObject());
+ lst->Sort(kSortDescending); // to avoid problems with substrungs
+ if (lst) {
+ if (fRawReader) fRawReader->LoadTriggerAlias(lst);
+ // Now declare all the triggers present in the aliases
+ TIter iter(lst);
+ TNamed *nmd = 0;
+ while((nmd = dynamic_cast<TNamed*>(iter.Next()))){
+ fDeclTriggerClasses += " ";
+ fDeclTriggerClasses += nmd->GetName();
+ }
+ }
+ else {
+ AliError("Cannot cast the object with trigger aliases to THashList!");
+ }
+ }
+ else {
+ AliError("No OCDB ebtry for the trigger aliases!");
+ }
+ // Load trigger classes for this run
UChar_t clustmask = 0;
TString trclasses;
ULong64_t trmask = fEventInfo.GetTriggerMask();