Skip to content
Snippets Groups Projects

mCBM 2020: Event based reco with STS, RICH and PSD

Merged Pierre-Alain Loizeau requested to merge p.-a.loizeau/cbmroot:mcbm_event_array_name into master
All threads resolved!
2 files
+ 17
5
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -15,6 +15,7 @@
@@ -15,6 +15,7 @@
#include "CbmStsDigi.h"
#include "CbmStsDigi.h"
#include "CbmTofDigi.h"
#include "CbmTofDigi.h"
 
#include "FairEventHeader.h"
#include "FairLogger.h"
#include "FairLogger.h"
#include "FairRootManager.h"
#include "FairRootManager.h"
#include "FairRunOnline.h"
#include "FairRunOnline.h"
@@ -27,6 +28,7 @@
@@ -27,6 +28,7 @@
#include <TFile.h>
#include <TFile.h>
#include <iomanip>
#include <iomanip>
 
#include <typeinfo>
using std::fixed;
using std::fixed;
using std::setprecision;
using std::setprecision;
@@ -79,8 +81,17 @@ InitStatus CbmCheckEvents::Init() {
@@ -79,8 +81,17 @@ InitStatus CbmCheckEvents::Init() {
LOG(info) << "No TClonesArray with TOF digis found.";
LOG(info) << "No TClonesArray with TOF digis found.";
}
}
fEvents = static_cast<TClonesArray*>(ioman->GetObject("Event"));
fEvents = dynamic_cast<TClonesArray*>(ioman->GetObject("Event"));
if (!fEvents) { LOG(fatal) << "No TClonesArray with events found."; }
if (nullptr == fEvents) {
 
 
if (nullptr != (ioman->GetObject("Event"))) {
 
LOG(error) << "Got pointer of type"
 
<< typeid(ioman->GetObject("Event")).name();
 
LOG(error) << "Got Object of type"
 
<< typeid(*(ioman->GetObject("Event"))).name();
 
} // if( nullptr != (ioman->GetObject("Event") )
 
LOG(fatal) << "No TClonesArray with events found.";
 
} // if (nullptr == fEvents)
CreateHistos();
CreateHistos();
@@ -188,7 +199,7 @@ void CbmCheckEvents::Exec(Option_t* /*option*/) {
@@ -188,7 +199,7 @@ void CbmCheckEvents::Exec(Option_t* /*option*/) {
// Loop over all CbmEvents in the time slice
// Loop over all CbmEvents in the time slice
for (Int_t iEvent = 0; iEvent < nrEvents; iEvent++) {
for (Int_t iEvent = 0; iEvent < nrEvents; iEvent++) {
CbmEvent* event = static_cast<CbmEvent*>(fEvents->At(iEvent));
CbmEvent* event = dynamic_cast<CbmEvent*>(fEvents->At(iEvent));
fEventSize->Fill(event->GetNofData());
fEventSize->Fill(event->GetNofData());
fEventLength->Fill(event->GetEndTime() - event->GetStartTime());
fEventLength->Fill(event->GetEndTime() - event->GetStartTime());
fLengthvsTS->Fill(fNrTs, event->GetEndTime() - event->GetStartTime(), 1);
fLengthvsTS->Fill(fNrTs, event->GetEndTime() - event->GetStartTime(), 1);
Loading