From: kkanaki Date: Tue, 12 Apr 2011 09:39:10 +0000 (+0000) Subject: - access the run number and respective date from the HLT tree X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=3bee17272e8a18487d186500dabf1ddcbb621d27;p=u%2Fmrichter%2FAliRoot.git - access the run number and respective date from the HLT tree (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) --- diff --git a/HLT/QA/tasks/AliAnalysisTaskHLTCentralBarrel.cxx b/HLT/QA/tasks/AliAnalysisTaskHLTCentralBarrel.cxx index b14ebe253b4..339aee168d4 100644 --- a/HLT/QA/tasks/AliAnalysisTaskHLTCentralBarrel.cxx +++ b/HLT/QA/tasks/AliAnalysisTaskHLTCentralBarrel.cxx @@ -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(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; iGetNumberOfTracks(); i++){ diff --git a/HLT/QA/tasks/AliAnalysisTaskHLTCentralBarrel.h b/HLT/QA/tasks/AliAnalysisTaskHLTCentralBarrel.h index 1028d70aead..c383931daee 100644 --- a/HLT/QA/tasks/AliAnalysisTaskHLTCentralBarrel.h +++ b/HLT/QA/tasks/AliAnalysisTaskHLTCentralBarrel.h @@ -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); };