]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- access the run number and respective date from the HLT tree
authorkkanaki <kkanaki@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 12 Apr 2011 09:39:10 +0000 (09:39 +0000)
committerkkanaki <kkanaki@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 12 Apr 2011 09:39:10 +0000 (09:39 +0000)
  (when offline data are not there, the run number was 0 and the date 19700101)
- moved this access inside the UserExec where the HLT tree is accessible
- removed NotifyRun with the access to the offline tree (that might not always be there)

HLT/QA/tasks/AliAnalysisTaskHLTCentralBarrel.cxx
HLT/QA/tasks/AliAnalysisTaskHLTCentralBarrel.h

index b14ebe253b4daf5f57dc0881ea44fc3f91940950..339aee168d4fec73d64e38f11c2e62d62ce1539c 100644 (file)
@@ -56,6 +56,7 @@ AliAnalysisTaskHLTCentralBarrel::AliAnalysisTaskHLTCentralBarrel()
   ,fTrackHLT(0)
   ,fOptions()
   ,fTextBox(0)
+  ,fSwitch(kTRUE)
 {
   // Constructor
   // Define input and output slots here
@@ -78,6 +79,7 @@ AliAnalysisTaskHLTCentralBarrel::AliAnalysisTaskHLTCentralBarrel(const char *nam
   ,fTrackHLT(0) 
   ,fOptions()
   ,fTextBox(0)
+  ,fSwitch(kTRUE)
 {
   // Constructor
   // Define input and output slots here
@@ -152,16 +154,6 @@ void AliAnalysisTaskHLTCentralBarrel::UserCreateOutputObjects(){
   PostData(1, fOutputList);
 }
 
-void AliAnalysisTaskHLTCentralBarrel::NotifyRun(){
-  AliESDEvent *esdOFF = dynamic_cast<AliESDEvent*>(InputEvent());
-  TTimeStamp* timestamp = new TTimeStamp(esdOFF->GetTimeStamp());
-  fTextBox->SetName("text");
-  
-  TString s = Form("Run %d, Date %d", esdOFF->GetRunNumber(), timestamp->GetDate());
-  fTextBox->SetTitle(s);
-}
-
 void AliAnalysisTaskHLTCentralBarrel::UserExec(Option_t *){
 // see header for documentation
     
@@ -179,7 +171,16 @@ void AliAnalysisTaskHLTCentralBarrel::UserExec(Option_t *){
      printf("ERROR: HLT ESD is not available.\n");
      return;
   }
-      
+  
+  if(fSwitch==kTRUE){  
+     TTimeStamp *timestamp = new TTimeStamp(esdHLT->GetTimeStamp());
+     fTextBox->SetName("text");
+     TString s = Form("Run %d, Date %d", esdHLT->GetRunNumber(), timestamp->GetDate());
+     printf("You are analyzing run %d from date %d\n", esdHLT->GetRunNumber(), timestamp->GetDate());
+     fTextBox->SetTitle(s);
+     fSwitch=kFALSE;
+  }
+    
   // if(fUseHLTTrigger && !((AliHLTGlobalTriggerDecision*)esdHLT->GetHLTTriggerDecision())->Result()) return;  
   
   //============================ OFFLINE =============================//
@@ -284,7 +285,7 @@ void AliAnalysisTaskHLTCentralBarrel::UserExec(Option_t *){
 
   Int_t nr_tracksHLT = 0;  
   if(esdHLT->GetEventSpecie()==16) return; // skip calibration events
-  
+
   const AliESDVertex *vertHLT = esdHLT->GetPrimaryVertexTracks();
     
   for(Int_t i=0; i<esdHLT->GetNumberOfTracks(); i++){
index 1028d70aeada1be6d2e16a5433318e15acc8f4cc..c383931daee23b896181a47353be4f6b63f13339 100644 (file)
@@ -34,7 +34,6 @@ class AliAnalysisTaskHLTCentralBarrel : public AliAnalysisTaskSE {
     virtual void  UserCreateOutputObjects();
     virtual void  UserExec(Option_t *option);
     virtual void  Terminate(Option_t *);
-    virtual void  NotifyRun();
 
     // function to select only HLT triggered events
     //void SetUseHLTTriggerDecision(Bool_t useHLT = kFALSE) { fUseHLTTrigger = useHLT;        }
@@ -69,7 +68,9 @@ class AliAnalysisTaskHLTCentralBarrel : public AliAnalysisTaskSE {
     THnSparse *fTrackHLT; //! HLT track properties
     
     TString fOptions; //! options for filling event and/or track properties for hlt and/or offline
-    TText *fTextBox; //! TText box containing run number info and date
+    TText *fTextBox;  //! TText box containing run number info and date
+    Bool_t fSwitch;   //! boolean used to execute parts of the code in the UserExec only once, although
+                      // the function is called once per event
     
     ClassDef(AliAnalysisTaskHLTCentralBarrel, 0);
 };