Test Trigger macro
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 1 Mar 2006 09:57:16 +0000 (09:57 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 1 Mar 2006 09:57:16 +0000 (09:57 +0000)
EMCAL/macros/TestEMCALTrigger.C [new file with mode: 0644]

diff --git a/EMCAL/macros/TestEMCALTrigger.C b/EMCAL/macros/TestEMCALTrigger.C
new file mode 100644 (file)
index 0000000..dc2201f
--- /dev/null
@@ -0,0 +1,51 @@
+
+// Test Macro, shows how to execute the Trigger, and prints the results. 
+// Author: Gustavo Conesa
+
+void TestEMCALTrigger(){
+
+  //Loader  
+  AliRunLoader* rl=0x0;
+  
+  cout<<"TestEMCALTrigger: Creating Run Loader ..."<<endl;
+  rl = AliRunLoader::Open("galice.root",
+                         AliConfig::GetDefaultEventFolderName(),
+                         "read");
+  if (rl == 0x0)
+    {
+      gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
+      return;
+    }
+
+  AliEMCALLoader *emcalLoader = dynamic_cast<AliEMCALLoader*>
+    (rl->GetDetectorLoader("EMCAL"));
+
+  //Get Maximum number of events
+
+  Int_t maxevent =  rl->GetNumberOfEvents();
+  cout<<"n events "<<maxevent<<endl;
+
+  //Load Digits  
+  rl->LoadDigits("EMCAL");
+  
+  //Create trigger pointer and set thresholds if you want
+  //Defautl threshold values need to be fixed
+  AliEMCALTrigger *tr = new AliEMCALTrigger();  
+  tr->SetL0MBPbPbThreshold(500);
+  tr->SetL0MBppThreshold(100);
+  tr->SetL1JetLowPtThreshold(2000);
+  tr->SetL1JetMediumPtThreshold(10000);
+  tr->SetL1JetHighPtThreshold(20000);
+
+  //event loop
+  for(Int_t iEvent = 0; iEvent < maxevent ; iEvent++){
+    rl->GetEvent(iEvent);
+    cout<<">>>>>>>>>>> Event >>> "<<iEvent<<endl;
+    
+    //Select trigger for each event
+    tr->Trigger();//Do the trigger algorithm
+    
+    tr->Print("");//Print results. 
+    
+  }
+}