diff --git a/analysis/PWGDIL/dielectron/papaframework/PairAnalysisEvent.cxx b/analysis/PWGDIL/dielectron/papaframework/PairAnalysisEvent.cxx index 24460f7112487fd172fe9c2a3ff5634b6441b95a..c1589f7ea62a33fc9decc99519288acdefde8a52 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 24fc2206661e894e043f4062cd658c3a485432c0..8f54f42211ffa75ef096a84fd490ba504f912c1b 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 902e46cddf15043130af01c4479174d20a738424..61fee0141788857d3be0855c021408ccc3247ec0 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]));