Updating Pb-Pb triggers to include downscaled central and semicentral triggers
authorjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Nov 2011 09:38:54 +0000 (09:38 +0000)
committerjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Nov 2011 09:38:54 +0000 (09:38 +0000)
Central diffractive trigger added
Expansion of trigger classes implemented to write shorter configurations
ZDC configuration changed

ANALYSIS/AliPhysicsSelection.cxx
ANALYSIS/macros/BrowseAndFillPhysicsSelectionOADB.C
OADB/AliOADBPhysicsSelection.cxx
OADB/AliOADBPhysicsSelection.h
OADB/COMMON/PHYSICSSELECTION/data/physicsSelection.root
STEER/STEERBase/AliVEvent.h

index 596b3ab..7377059 100644 (file)
@@ -394,8 +394,10 @@ Bool_t AliPhysicsSelection::EvaluateTriggerLogic(const AliESDEvent* aEsd, AliTri
       //      if(fHistStatisticsTokens)              
     }
   }
-  
+
   TFormula formula("formula", trigger);
+  if (formula.Compile() > 0)
+    AliFatal(Form("Could not evaluate trigger logic %s (evaluated to %s)", triggerLogic, trigger.Data()));
   Bool_t result = formula.Eval(0);
   
   AliDebug(AliLog::kDebug, Form("%s --> %d", trigger.Data(), result));
index bc15d60..ce64fb0 100644 (file)
@@ -23,8 +23,6 @@
 #endif
 
 
-//FIXME: defaults for 2.76 TeV
-
 void BrowseAndFillPhysicsSelectionOADB(Bool_t fill = kFALSE) {
 
   // Load stuff
@@ -67,7 +65,7 @@ void BrowseAndFillPhysicsSelectionOADB(Bool_t fill = kFALSE) {
 
   // DefaultPP
   AliOADBPhysicsSelection * oadbDefaultPP = new AliOADBPhysicsSelection("oadbDefaultPP");
-  oadbDefaultPP->AddCollisionTriggerClass   ( AliVEvent::kINT7,"+CINT7-I-NOPF-ALLNOTRD","B",0);
+  oadbDefaultPP->AddCollisionTriggerClass   ( AliVEvent::kINT7,"+CINT7-[I|B]-NOPF-ALLNOTRD","B",0);
   oadbDefaultPP->AddBGTriggerClass          ( AliVEvent::kINT7,"+CINT7-AC-NOPF-ALLNOTRD","AC",0);
   oadbDefaultPP->AddBGTriggerClass          ( AliVEvent::kINT7,"+CINT7-E-NOPF-ALLNOTRD","E",0);  
   oadbDefaultPP->SetHardwareTrigger         ( 0,"V0A && V0C");                                       
@@ -103,22 +101,18 @@ void BrowseAndFillPhysicsSelectionOADB(Bool_t fill = kFALSE) {
   oadbDefaultPP->SetHardwareTrigger         ( 5,"V0A && V0C");                                         
   oadbDefaultPP->SetOfflineTrigger          ( 5,"(V0A && V0C) && !V0ABG && !V0CBG  && !TPCLaserWarmUp");
 
-  oadbDefaultPP->AddCollisionTriggerClass   ( AliVEvent::kPHI7,"+CPHI7-I-NOPF-ALLNOTRD","B",  6);
-  oadbDefaultPP->AddCollisionTriggerClass   ( AliVEvent::kPHI7,"+CPHI7-B-NOPF-ALLNOTRD","B",  6);
+  oadbDefaultPP->AddCollisionTriggerClass   ( AliVEvent::kPHI7,"+CPHI7-[I|B]-NOPF-ALLNOTRD","B",  6);
   oadbDefaultPP->AddBGTriggerClass          ( AliVEvent::kPHI7,"+CPHI7-AC-NOPF-ALLNOTRD","AC",6);
   oadbDefaultPP->AddBGTriggerClass          ( AliVEvent::kPHI7,"+CPHI7-E-NOPF-ALLNOTRD","E",  6);
   oadbDefaultPP->SetHardwareTrigger         ( 6,"V0A && V0C");
   oadbDefaultPP->SetOfflineTrigger          ( 6,"(V0A && V0C) && !V0ABG && !V0CBG  && !TPCLaserWarmUp");
   
-  /*
-  // PENDING VALIDATION https://savannah.cern.ch/bugs/?86829
   oadbDefaultPP->AddCollisionTriggerClass   ( AliVEvent::kDG5,"+CDG5-I-NOPF-ALLNOTRD","B",  7);
   oadbDefaultPP->AddBGTriggerClass          ( AliVEvent::kDG5,"+CDG5-AC-NOPF-ALLNOTRD","AC",7);
   oadbDefaultPP->AddBGTriggerClass          ( AliVEvent::kDG5,"+CDG5-E-NOPF-ALLNOTRD","E",  7);
   // TODO TOF condition needs to be implemented (Savannah bug #87064)
   oadbDefaultPP->SetHardwareTrigger         ( 7,"!V0A && !V0C && SPDGFOL1 >= 2");
-  oadbDefaultPP->SetOfflineTrigger          ( 7,"!V0A && !V0C && !V0ABG && !V0CBG && && SPDGFOL1 >= 2 && !TPCLaserWarmUp");
-  */
+  oadbDefaultPP->SetOfflineTrigger          ( 7,"!V0A && !V0C && !V0ABG && !V0CBG && SPDGFOL1 >= 2 && !TPCLaserWarmUp");
 
   oadbContPS->AddDefaultObject(oadbDefaultPP);
 
@@ -126,26 +120,29 @@ void BrowseAndFillPhysicsSelectionOADB(Bool_t fill = kFALSE) {
   AliOADBPhysicsSelection * oadbDefaultPbPb = new AliOADBPhysicsSelection("oadbDefaultPbPb");
   
   Int_t triggerCount = 0;
-  oadbDefaultPbPb->AddCollisionTriggerClass   ( AliVEvent::kMB,"+CPBI1-B-NOPF-ALLNOTRD,CPBI2_B1-B-NOPF-ALLNOTRD,CPBI2_B1-B-PF-ALLNOTRD","B",triggerCount);
-  oadbDefaultPbPb->AddBGTriggerClass          ( AliVEvent::kMB,"+CPBI1-AC-NOPF-ALLNOTRD,CPBI2_B1-AC-NOPF-ALLNOTRD","AC",triggerCount);
-  oadbDefaultPbPb->AddBGTriggerClass          ( AliVEvent::kMB,"+CPBI1-E-NOPF-ALLNOTRD,CPBI2_B1-E-NOPF-ALLNOTRD","E",triggerCount);
+  oadbDefaultPbPb->AddCollisionTriggerClass   ( AliVEvent::kMB,"+CPBI1-B-NOPF-ALLNOTRD,CPBI2_B1-B-[NOPF|PF]-ALLNOTRD","B",triggerCount);
+  oadbDefaultPbPb->AddBGTriggerClass          ( AliVEvent::kMB,"+CPBI[1|2_B1]-AC-NOPF-ALLNOTRD","AC",triggerCount);
+  oadbDefaultPbPb->AddBGTriggerClass          ( AliVEvent::kMB,"+CPBI[1|2_B1]-E-NOPF-ALLNOTRD","E",triggerCount);
   oadbDefaultPbPb->SetHardwareTrigger         ( triggerCount,"V0A && V0C");
   oadbDefaultPbPb->SetOfflineTrigger          ( triggerCount,"V0A && V0C && !V0ABG && !V0CBG && !TPCLaserWarmUp && ZDCTime");
 
   triggerCount++;
   // Bug in early running, CVHN_R2-B-NOPF-ALLNOTRD needed explicitly up to run 167814 (to be moved to custom object as soon as all other things are fine)
-  oadbDefaultPbPb->AddCollisionTriggerClass   ( AliVEvent::kCentral,"+CVHN-B-NOPF-ALLNOTRD,CVHN_R2-B-NOPF-ALLNOTRD,CVHN-B-NOPF-CENTNOTRD,CVHN-B-PF-ALLNOTRD,CVHN-B-PF-CENTNOTRD","B",triggerCount);
-  oadbDefaultPbPb->AddBGTriggerClass          ( AliVEvent::kCentral,"+CVHN-AC-NOPF-ALLNOTRD,CVHN-AC-NOPF-CENTNOTRD","AC",triggerCount);
-  oadbDefaultPbPb->AddBGTriggerClass          ( AliVEvent::kCentral,"+CVHN-E-NOPF-ALLNOTRD,CVHN-E-NOPF-CENTNOTRD","E",triggerCount);
+  //   oadbDefaultPbPb->AddCollisionTriggerClass   ( AliVEvent::kCentral,"+CVHN-B-NOPF-ALLNOTRD,CVHN_R2-B-NOPF-ALLNOTRD,CVHN-B-NOPF-CENTNOTRD,CVHN-B-NOPF-CENTNOTRD,CVHN-B-PF-ALLNOTRD,CVHN-B-PF-CENTNOTRD","B",triggerCount);
+  oadbDefaultPbPb->AddCollisionTriggerClass   ( AliVEvent::kCentral,"+CVHN[|_R2]-B-[NOPF|PF]-[ALL|CENT]NOTRD","B",triggerCount);
+  oadbDefaultPbPb->AddBGTriggerClass          ( AliVEvent::kCentral,"+CVHN-AC-NOPF-[ALL|CENT]NOTRD","AC",triggerCount);
+  oadbDefaultPbPb->AddBGTriggerClass          ( AliVEvent::kCentral,"+CVHN-E-NOPF-[ALL|CENT]NOTRD","E",triggerCount);
   oadbDefaultPbPb->SetHardwareTrigger         ( triggerCount,"V0A && V0C && Central");
   oadbDefaultPbPb->SetOfflineTrigger          ( triggerCount,"V0A && V0C && !V0ABG && !V0CBG && !TPCLaserWarmUp && ZDCTime");
 
   triggerCount++;
   // semicentral includes central ones (and might have different downscaling)
   // Bug in early running, CVHN_R2-B-NOPF-ALLNOTRD,CVLN_B2-B-NOPF-ALLNOTRD needed explicitly up to run 167814 (to be moved to custom object as soon as all other things are fine)
-  oadbDefaultPbPb->AddCollisionTriggerClass   ( AliVEvent::kSemiCentral,"+CVHN-B-NOPF-ALLNOTRD,CVHN_R2-B-NOPF-ALLNOTRD,CVHN-B-NOPF-CENTNOTRD,CVHN-B-PF-ALLNOTRD,CVHN-B-PF-CENTNOTRD,CVLN-B-NOPF-ALLNOTRD,CVLN_B2-B-NOPF-ALLNOTRD,CVLN-B-PF-ALLNOTRD","B",triggerCount);
-  oadbDefaultPbPb->AddBGTriggerClass          ( AliVEvent::kSemiCentral,"+CVHN-AC-NOPF-ALLNOTRD,CVHN-AC-NOPF-CENTNOTRD,CVLN-AC-NOPF-ALLNOTRD","AC",triggerCount);
-  oadbDefaultPbPb->AddBGTriggerClass          ( AliVEvent::kSemiCentral,"+CVHN-E-NOPF-ALLNOTRD,CVHN-E-NOPF-CENTNOTRD,CVLN-E-NOPF-ALLNOTRD","E",triggerCount);
+//   oadbDefaultPbPb->AddCollisionTriggerClass   ( AliVEvent::kSemiCentral,"+CVHN-B-NOPF-ALLNOTRD,CVHN_R2-B-NOPF-ALLNOTRD,CVHN-B-NOPF-CENTNOTRD,CVHN-B-PF-ALLNOTRD,CVHN-B-PF-CENTNOTRD,CVLN-B-NOPF-ALLNOTRD,CVLN_B2-B-NOPF-ALLNOTRD,CVLN-B-PF-ALLNOTRD","B",triggerCount);
+  oadbDefaultPbPb->AddCollisionTriggerClass   ( AliVEvent::kSemiCentral,"+CVHN[|_R2]-B-[NOPF|PF]-[ALL|CENT]NOTRD,CVLN[|_B2]-B-[NOPF|PF]-ALLNOTRD","B",triggerCount);
+  
+  oadbDefaultPbPb->AddBGTriggerClass          ( AliVEvent::kSemiCentral,"+CVHN-AC-NOPF-[ALL|CENT]NOTRD,CVLN-AC-NOPF-ALLNOTRD","AC",triggerCount);
+  oadbDefaultPbPb->AddBGTriggerClass          ( AliVEvent::kSemiCentral,"+CVHN-E-NOPF-[ALL|CENT]NOTRD,CVLN-E-NOPF-ALLNOTRD","E",triggerCount);
   oadbDefaultPbPb->SetHardwareTrigger         ( triggerCount,"V0A && V0C && SemiCentral && !Central");
   oadbDefaultPbPb->SetOfflineTrigger          ( triggerCount,"V0A && V0C && !V0ABG && !V0CBG && !TPCLaserWarmUp && ZDCTime");
 
@@ -191,7 +188,7 @@ void BrowseAndFillPhysicsSelectionOADB(Bool_t fill = kFALSE) {
 
   // Trigger analysis defaults
   AliOADBTriggerAnalysis * oadbTrigAnalysis = new AliOADBTriggerAnalysis("Default");
-  oadbTrigAnalysis->SetZDCCorrParameters(0, 0, 4*0.6, 4*0.6);
+  oadbTrigAnalysis->SetZDCCorrParameters(0, 0, 4*0.7, 4*0.7);
   oadbContTriggerAnalysis->AddDefaultObject(oadbTrigAnalysis);  
 
   // ----- 2009 - 2010 -----
@@ -938,8 +935,7 @@ void BrowseAndFillPhysicsSelectionOADB(Bool_t fill = kFALSE) {
   oadbLHC11d1->SetHardwareTrigger         ( 5,"V0A && V0C");                                         
   oadbLHC11d1->SetOfflineTrigger          ( 5,"(V0A && V0C) && !V0ABG && !V0CBG  && !TPCLaserWarmUp");  
   
-  oadbLHC11d1->AddCollisionTriggerClass   ( AliVEvent::kPHI7,"+CPHI7-B-NOPF-ALLNOTRD","B",  6);
-  oadbLHC11d1->AddCollisionTriggerClass   ( AliVEvent::kPHI7,"+CPHI7-I-NOPF-ALLNOTRD","B",  6);
+  oadbLHC11d1->AddCollisionTriggerClass   ( AliVEvent::kPHI7,"+CPHI7-B-NOPF-ALLNOTRD,CPHI7-I-NOPF-ALLNOTRD","B",  6);
   oadbLHC11d1->AddBGTriggerClass          ( AliVEvent::kPHI7,"+CPHI7-AC-NOPF-ALLNOTRD","AC",6);
   oadbLHC11d1->AddBGTriggerClass          ( AliVEvent::kPHI7,"+CPHI7-E-NOPF-ALLNOTRD","E",  6);
   oadbLHC11d1->SetHardwareTrigger         ( 6,"V0A && V0C");
index 5dd5136..870924e 100644 (file)
@@ -94,14 +94,14 @@ AliOADBPhysicsSelection& AliOADBPhysicsSelection::operator=(const AliOADBPhysics
  
 void AliOADBPhysicsSelection::AddCollisionTriggerClass(AliVEvent::EOfflineTriggerTypes triggerMask, const char* className,const char * beamSide, UInt_t triggerLogic) {
   // add collision trigger class
-  TObjString * tclass = new TObjString(Form("%s &%u *%u",className,triggerMask, triggerLogic));
+  TObjString * tclass = new TObjString(Form("%s &%u *%u",ExpandTriggerString(className),triggerMask, triggerLogic));
   fCollTrigClasses[GetActiveBit(triggerMask)]->Add(tclass); 
   SetBeamSide(tclass->String().Data(),beamSide);
 }
 void AliOADBPhysicsSelection::AddBGTriggerClass       (AliVEvent::EOfflineTriggerTypes triggerMask, const char* className,const char * beamSide, UInt_t triggerLogic) 
 { 
   // add bg trigger class
-  TObjString * tclass = new TObjString(Form("%s &%u *%u",className,triggerMask, triggerLogic));
+  TObjString * tclass = new TObjString(Form("%s &%u *%u",ExpandTriggerString(className),triggerMask, triggerLogic));
   fBGTrigClasses  [GetActiveBit(triggerMask)]->Add(tclass);
   SetBeamSide(tclass->String().Data(),beamSide);
 }
@@ -259,3 +259,83 @@ UInt_t AliOADBPhysicsSelection::GetActiveBit(UInt_t mask) {
   return activeBit;
 
 }
+
+const char* AliOADBPhysicsSelection::ExpandTriggerString(const char* className)
+{
+  // expands [] syntax
+  // E.g. +CVHN-B-[NOPF|PF]-[ALL|CENT]NOTRD goes to +CVHN-B-NOPF-ALLNOTRD,CVHN-B-NOPF-CENTNOTRD,CVHN-B-PF-ALLNOTRD,CVHN-B-PF-CENTNOTRD
+  
+  static TString str;
+  str = className;
+  TObjArray* triggers = str.Tokenize(" ");
+  for (Int_t j=0; j<triggers->GetEntries(); j++)
+  {
+    str = triggers->At(j)->GetName();
+    str = str(1, str.Length());
+    
+    TList list;
+    list.SetOwner();
+
+    TObjArray* triggers2 = str.Tokenize(",");
+    for (Int_t k=0; k<triggers2->GetEntries(); k++)
+      list.Add(new TObjString(triggers2->At(k)->GetName()));
+    delete triggers2;
+    
+//     list.Print();
+    
+    while (1)
+    {
+      Int_t i=0;
+      for (i=0; i<list.GetEntries(); i++)
+      {
+       str = list.At(i)->GetName();
+      
+       Int_t begin = str.Index("[");
+       Int_t end = str.Index("]");
+       if (begin >= 0 && end >= 0)
+       {
+         TString before = str(0, begin);
+         TString after = str(end+1, str.Length());
+         TString tokens = str(begin+1, end-begin-1);
+  //   Printf("%s %s %s", before.Data(), tokens.Data(), after.Data());
+         Int_t pos = 0;
+         while (tokens.Index("|", pos) >= 0)
+         {
+           list.Add(new TObjString(before + tokens(pos, tokens.Index("|", pos) - pos) + after));
+           pos = tokens.Index("|", pos) + 1;
+         }
+         list.Add(new TObjString(before + tokens(pos, tokens.Length()) + after));
+         delete list.RemoveAt(i);
+         
+  //   list.Print();
+         i=-1;
+       }
+      }
+
+      str = "";
+      for (i=0; i<list.GetEntries(); i++)
+      {
+       str += list.At(i)->GetName();
+       str += ",";
+      }
+      str = str(0, str.Length() - 1);
+      break;
+    }
+      
+    TString& target = ((TObjString*) triggers->At(j))->String();
+    target.Form("%c%s", target[0], str.Data());
+  }
+  
+  str = "";
+  for (Int_t j=0; j<triggers->GetEntries(); j++)
+  {
+    str += triggers->At(j)->GetName();
+    str += " ";
+  }
+  str = str(0, str.Length() - 1);
+
+  delete triggers;
+  if (strcmp(className, str.Data()))
+    Printf("AliOADBPhysicsSelection::ExpandTriggerString: In: <%s> Out: <%s>", className, str.Data());
+  return str;
+}
index f3a4367..12648e4 100644 (file)
@@ -71,6 +71,8 @@ class AliOADBPhysicsSelection : public TNamed {
 
 protected:
   void CleanKey(TString & str) ;
+  const char* ExpandTriggerString(const char* className);
+  
  private :
   
   UInt_t fNtriggerBits; // Size of the arrays below. Initialized using NTRIGGERBITS
index d513fe2..3ac0d1c 100644 (file)
Binary files a/OADB/COMMON/PHYSICSSELECTION/data/physicsSelection.root and b/OADB/COMMON/PHYSICSSELECTION/data/physicsSelection.root differ
index d086d61..736ef04 100644 (file)
@@ -54,6 +54,7 @@ public:
       kEMCEGA       = BIT(15), // EMCAL gamma trigger
       kCentral      = BIT(16), // PbPb central collision trigger
       kSemiCentral  = BIT(17), // PbPb semicentral collision trigger
+      kDG5          = BIT(18), // Double gap diffractive
       kUserDefined  = BIT(27), // Set when custom trigger classes are set in AliPhysicsSelection, offline SPD or V0 selection
       // Bits 28 and above are reserved for FLAGS
       kFastOnly     = BIT(30), // The fast cluster fired. This bit is set in to addition another trigger bit, e.g. kMB