From 9993c4fbe66bad8e8c2e05d9c3f78fbd9c40ea8a Mon Sep 17 00:00:00 2001 From: Adrian Meyer-Ahrens <a_meye37@uni-muenster.de> Date: Thu, 27 Jan 2022 15:51:07 +0100 Subject: [PATCH] Add EventStartTime to fix calculation of beta from tof hit --- .../PWGDIL/dielectron/papaframework/PairAnalysisEvent.cxx | 2 ++ .../PWGDIL/dielectron/papaframework/PairAnalysisEvent.h | 4 +++- .../dielectron/papaframework/PairAnalysisVarManager.h | 7 ++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/analysis/PWGDIL/dielectron/papaframework/PairAnalysisEvent.cxx b/analysis/PWGDIL/dielectron/papaframework/PairAnalysisEvent.cxx index 24460f7112..c1589f7ea6 100644 --- a/analysis/PWGDIL/dielectron/papaframework/PairAnalysisEvent.cxx +++ b/analysis/PWGDIL/dielectron/papaframework/PairAnalysisEvent.cxx @@ -75,6 +75,7 @@ PairAnalysisEvent::~PairAnalysisEvent() // fTracks->Clear("C"); fGlobalTracks->Delete(); //global tracks fMCHeader->Delete(); //mc tracks + fEvHeader->Delete(); //rec header fMCTracks->Delete(); //mc tracks fTrdTracks->Delete(); //TRD tracks @@ -134,6 +135,7 @@ void PairAnalysisEvent::SetInput(FairRootManager* man) if (nullptr == fPrimVertex) { fPrimVertex = dynamic_cast<CbmVertex*>(man->GetObject("PrimaryVertex")); } // MC matches and tracks fMCHeader = (FairMCEventHeader*) man->GetObject("MCEventHeader."); + fEvHeader = (FairEventHeader*) man->GetObject("EventHeader."); fMCTracks = (TClonesArray*) man->GetObject("MCTrack"); fStsMatches = (TClonesArray*) man->GetObject("StsTrackMatch"); fMuchMatches = (TClonesArray*) man->GetObject("MuchTrackMatch"); diff --git a/analysis/PWGDIL/dielectron/papaframework/PairAnalysisEvent.h b/analysis/PWGDIL/dielectron/papaframework/PairAnalysisEvent.h index 24fc220666..8f54f42211 100644 --- a/analysis/PWGDIL/dielectron/papaframework/PairAnalysisEvent.h +++ b/analysis/PWGDIL/dielectron/papaframework/PairAnalysisEvent.h @@ -16,7 +16,7 @@ //############################################################# #include "CbmDefs.h" #include "CbmVertex.h" - +#include "FairEventHeader.h" #include <TClonesArray.h> #include <TNamed.h> #include <TObjArray.h> @@ -48,6 +48,7 @@ public: Int_t GetNumberOfHits(ECbmModuleId det) const; Int_t GetNumberOfHitMatches(ECbmModuleId det) const; Int_t GetNumberOfPoints(ECbmModuleId det) const; + Double_t GetEvStartTime() const {return fEvHeader->GetEventTime();} TClonesArray* GetHits(ECbmModuleId det) const; TClonesArray* GetHitMatches(ECbmModuleId det) const; @@ -67,6 +68,7 @@ protected: private: FairMCEventHeader* fMCHeader = NULL; // mc header + FairEventHeader* fEvHeader = NULL; // rec header TClonesArray* fMCTracks = NULL; // mc tracks TClonesArray* fStsMatches = NULL; // STS matches TClonesArray* fMuchMatches = NULL; // MUCH matches diff --git a/analysis/PWGDIL/dielectron/papaframework/PairAnalysisVarManager.h b/analysis/PWGDIL/dielectron/papaframework/PairAnalysisVarManager.h index 902e46cddf..61fee01417 100644 --- a/analysis/PWGDIL/dielectron/papaframework/PairAnalysisVarManager.h +++ b/analysis/PWGDIL/dielectron/papaframework/PairAnalysisVarManager.h @@ -34,6 +34,7 @@ #include <CbmVertex.h> #include <FairMCEventHeader.h> +#include <FairEventHeader.h> #include <FairMCPoint.h> #include <FairRootManager.h> #include <FairTrackParam.h> @@ -279,6 +280,7 @@ public: kCentrality, // event centrality fraction kNevents, // event counter + kEvStartTime, // reconstructed event start time kRunNumber, // run number kYbeam, // beam rapdity kMixingBin, // event mixing pool number @@ -612,6 +614,9 @@ inline void PairAnalysisVarManager::FillVarPairAnalysisEvent(const PairAnalysisE // Set header information FillVarMCHeader(event->GetMCHeader(), values); + values[kEvStartTime]=event->GetEvStartTime(); + std::cout<< "Event Time: " << values[kEvStartTime] <<std::endl; + } inline void PairAnalysisVarManager::FillVarMCHeader(const FairMCEventHeader* header, Double_t* const values) @@ -1780,7 +1785,7 @@ inline void PairAnalysisVarManager::FillVarTofHit(const CbmTofHit* hit, Double_t FillVarPixelHit(hit, values); // Set - values[kBeta] = values[kTrackLength] / 100 / (hit->GetTime() * 1e-9) / TMath::C(); + values[kBeta] = values[kTrackLength] / 100 / ((hit->GetTime()- values[kEvStartTime]) * 1e-9) / TMath::C(); // PID value detla beta values[kTofPidDeltaBetaEL] = values[kBeta] - (values[kP] / TMath::Sqrt(values[kMEL] * values[kMEL] + values[kP] * values[kP])); -- GitLab