Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
TrackColDumAna.cxx
1/*
2 * TrackColDumAna.cxx
3 *
4 * Created on: 12 sie 2022
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#include "TrackColDumAna.h"
11
12#include "CutCollection.h"
13#include "CutContainer.h"
14#include "DataManager.h"
15#include "Event.h"
16#include "MemoryMapManager.h"
17
18#include <RtypesCore.h>
19
20namespace Hal {
21
22 TrackColDumAna::TrackColDumAna() {
23 // TODO Auto-generated constructor stub
24 }
25
26 TrackColDumAna::~TrackColDumAna() {}
27
28 TrackColDumAna::TrackColDumAna(const TrackColDumAna& other) : TrackAna(other) {}
29
30 TrackColDumAna& TrackColDumAna::operator=(const TrackColDumAna& other) {
31 if (this == &other) return *this;
32
33 return *this;
34 }
35
36 Task::EInitFlag TrackColDumAna::Init() {
37 Task::EInitFlag flag = TrackAna::Init();
38 Int_t event_col = fCutContainer->GetEventCollectionsNo();
39 if (event_col != 0) return Task::EInitFlag::kFATAL;
40 // fSelectionMap.resize(fCutContainer->GetTrackCollectionsNo());
41 // fBufferSize.resize(fCutContainer->GetTrackCollectionsNo());
42 fNewEvent = fCurrentEvent->GetNewEvent();
43 DataManager* ioManager = DataManager::Instance();
44 ioManager->Register(Form("%s.", fNewEvent->ClassName()), "HalEvents", fNewEvent, kTRUE);
45 return flag;
46 }
47
48 void TrackColDumAna::ProcessEvent() {
49 fMemoryMap->PrepareMaps(fCurrentEventCollectionID);
50 CutCollection* cont = fCutContainer->GetEventCollection(fCurrentEventCollectionID);
51 for (fTrackIndex = 0; fTrackIndex < fMemoryMap->GetTemporaryTotalTracksNo(); fTrackIndex++) {
52 fCurrentTrack = fCurrentEvent->GetTrack(fTrackIndex);
53 for (int j = 0; j < cont->GetNextNo(); j++) {
54 fCurrentTrackCollectionID = cont->GetNextAddr(j);
55 if (fCutContainer->PassTrack(fCurrentTrack, fCurrentTrackCollectionID)) {
56 fCurrentTrack->SetStatus(fCurrentTrack->GetStatus() + fCurrentTrackCollectionID * 1000); // change track status !!
57 fMemoryMap->AddTrackToMapTrack(fCurrentEventCollectionID,
58 fCurrentTrackCollectionID,
59 fTrackIndex); // load track into memory map - may be usefull at
60 // finish event
61 ProcessTrack();
62 }
63 }
64 }
65 fMemoryMap->BufferEvent(fCurrentEventCollectionID);
66 // int tracks = fMemoryMap->GetTemporaryTotalTracksNo();
67 }
68
69
70} /* namespace Hal */
Int_t GetNextNo() const
Int_t GetNextAddr(Int_t index) const
void Register(const char *name, const char *folderName, TNamed *obj, Bool_t toFile)