#include <PndMvdEventMerger.h>
|
std::vector< TClonesArray * > | fBuffer |
|
Definition at line 11 of file PndMvdEventMerger.h.
PndMvdEventMerger::PndMvdEventMerger |
( |
| ) |
|
PndMvdEventMerger::PndMvdEventMerger |
( |
TString |
fileName, |
|
|
TString |
branchName, |
|
|
Int_t |
nEvents, |
|
|
Int_t |
nMerged |
|
) |
| |
Definition at line 17 of file PndMvdEventMerger.cxx.
References FillBuffer().
21 cout <<
"-E- PndMvdEventMerger: Error in filling buffer";
Int_t FillBuffer(TString fileName, TString branchName, Int_t nEvents, Int_t nMerged)
PndMvdEventMerger::~PndMvdEventMerger |
( |
| ) |
|
|
virtual |
Int_t PndMvdEventMerger::AddTClonesArray |
( |
TClonesArray * |
target, |
|
|
TClonesArray * |
source |
|
) |
| |
Definition at line 126 of file PndMvdEventMerger.cxx.
References i, and TString.
Referenced by PndMvdEventMergerTask::Exec(), and FillBuffer().
128 Int_t origSize = target->GetEntriesFast();
129 for (
int i = 0;
i < source->GetEntriesFast();
i++){
130 std::cout << source->GetClass()->GetName() << std::endl;
131 TString myClassName(source->GetClass()->GetName());
132 if(myClassName.Contains(
"PndSdsMCPoint"))
134 else if (myClassName.Contains(
"PndSdsDigiPixel"))
136 else if (myClassName.Contains(
"PndSdsDigiStrip"))
142 else std::cout <<
"The Class: " << myClassName <<
" is unknown!" << std::endl;
145 return target->GetEntriesFast();
Class for digitised strip hits.
Data class to store the digi output of a pixel module.
Int_t PndMvdEventMerger::FillBuffer |
( |
TString |
fileName, |
|
|
TString |
branchName, |
|
|
Int_t |
nEvents, |
|
|
Int_t |
nMerged |
|
) |
| |
|
private |
Definition at line 56 of file PndMvdEventMerger.cxx.
References AddTClonesArray(), fBuffer, and CAMath::Min().
Referenced by PndMvdEventMerger().
64 TClonesArray* pointArray= NULL;
65 TClonesArray* mergedPointsArray = NULL;
68 TFile* bgfile =
new TFile(fileName);
71 cout <<
"-W- CbmMvdPileupManager::FillBuffer: Background file "
72 << fileName <<
" could noy be opened! " << endl;
75 cout <<
"-I- CbmMvdPileupManager::FillBuffer: Opening file " << endl;
76 cout << fileName << endl;
78 TTree* bgtree = (TTree*) bgfile->Get(
"pndsim");
81 cout <<
"-W- CbmMvdPileupManager::FillBuffer: "
82 <<
"Could not find pndsim tree in background file " << endl;
86 Int_t nEventsInFile = bgtree->GetEntries();
87 cout <<
"-I- CbmMvdPileupManager::FillBuffer: " << nEventsInFile
88 <<
" events in file" << endl;
90 cout <<
"-I- CbmMvdPileupManager::FillBuffer: Buffering " << nBuffer
93 Int_t nMergedBuffer =
TMath::Min(nMerged, nEventsInFile);
96 bgtree->SetBranchAddress(branchName, &pointArray);
98 for (Int_t iEvent=0; iEvent<nMergedBuffer; iEvent++)
100 bgtree->GetEntry(iEvent);
102 mergedPointsArray = (TClonesArray*)pointArray->Clone();
104 std::cout <<
"New size of mergedPointsArray: " <<
AddTClonesArray(mergedPointsArray, pointArray) << std::endl;
110 for (Int_t iEvent=0; iEvent<nBuffer; iEvent++)
112 std::cout <<
"Adding Event: " << iEvent <<
" to buffer!" << std::endl;
113 std::cout <<
"Merged PointsArray Size: " << mergedPointsArray->GetEntriesFast() << std::endl;
115 fBuffer.push_back((TClonesArray*)mergedPointsArray);
static T Min(const T &x, const T &y)
Int_t AddTClonesArray(TClonesArray *target, TClonesArray *source)
std::vector< TClonesArray * > fBuffer
TClonesArray * PndMvdEventMerger::GetEvent |
( |
Int_t |
iEvent | ) |
|
Definition at line 30 of file PndMvdEventMerger.cxx.
References fBuffer.
Referenced by PndMvdEventMergerTask::Exec().
35 if ((
unsigned int)iEvent >
fBuffer.size())
37 cout <<
"-W- CbmMvdPileupManager::GetEvent: Event " << iEvent
38 <<
" not present in buffer! " << endl;
39 cout <<
" Returning NULL pointer! "
44 TClonesArray* pArray = (TClonesArray*)
fBuffer[iEvent];
48 cout <<
"-W CbmMvdPileupManager::GetEvent: Returning NULL pointer!"
std::vector< TClonesArray * > fBuffer
std::vector<TClonesArray*> PndMvdEventMerger::fBuffer |
|
private |
The documentation for this class was generated from the following files: