Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
MemoryMapManager.h
1/*
2 * MemoryMapManager.h
3 *
4 * Created on: 28-10-2013
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#ifndef HALMEMORYMAPMANAGER_H_
11#define HALMEMORYMAPMANAGER_H_
12
13
14#include "Array.h"
15#include "CompressionMap.h"
16#include "Event.h"
17
18namespace Hal {
19 class IOManager;
20 class CutContainer;
21 class MiniEventTask;
25 class EventArray : public TObject {
26 public:
30 Int_t fSize;
34 Event** fArray; //[fSize]
38 EventArray(Int_t task_id, Int_t size = 1);
44 inline Event* At(const Int_t size) { return fArray[size]; };
48 virtual ~EventArray() {
49 for (int i = 0; i < fSize; i++)
50 delete fArray[i];
51 delete[] fArray;
52 };
53 ClassDef(EventArray, 1)
54 };
58 class MemoryMapManager : public TObject {
59 friend class MiniEventTask;
60
61 private:
62 Bool_t fUseCompression;
63 Bool_t fDirectAcces;
64 Int_t fTrackMapSize, fFormatID;
65 Int_t fEventCollectionsNo, fTrackCollectionsNo, fMixSize;
66 Int_t* fEventToTrackNo; //[fEventCollectionsNo]
67 Int_t* fCounter; //[fEventCollectionsNo]
68 Int_t* fTotalTracks; //[fEventCollectionsNo]
69 Bool_t* fReadyToMix; //[fEventCollectionsNo]
70 EventArray** fEvents; //[fEventCollectionsNo]
71 EventInterface* fInterface;
72 //"true" collections x mix_size
73 CompressionMap fCompression;
74 Int_t fMaxTrackCollectionNo;
75 Event* fCurrentEvent; // pointer to processed event
76 Array_4<Int_t>* fTrackMap;
77 Array_3<Int_t>* fTrackCounter;
78 void ReloadMap(Int_t size);
79 void CalculateCompressedMap(Int_t event_collection);
80 Int_t GetTrackCollectionsNo(Int_t event_collection) const;
81 Int_t GetCounter(Int_t event_collection, Int_t track_collection) const;
87 void ResetTrackMaps(Int_t event_collection, Int_t counter);
94 void ResetTrackMaps(Int_t event_collection, Int_t track_collection, Int_t counter);
95
96 public:
115 void ManualUpdate(Event* event);
120 void SetMixSize(Int_t mix_size);
125 Int_t GetTemporaryTotalTracksNo() const;
134 void Init(Int_t event_factor, Int_t task_id, Bool_t compress, std::vector<TString> direct);
141 void AddTrackToMapTrack(Int_t event_collection, Int_t track_collection, Int_t index);
146 void BufferEvent(Int_t collection);
152 Event* GetEvent(Int_t collection) const;
160 Track* GetTrack(Int_t event_collection, Int_t track_collection, Int_t index) const;
167 Track* GetTemporaryTrack(Int_t event_collection, Int_t track_collection, Int_t index) const;
174 Track* GetRawTrack(Int_t event_collection, Int_t index) const;
180 Event* GetEvent(Int_t collection, Int_t counter) const;
189 Track* GetTrack(Int_t event_collection, Int_t track_collection, Int_t counter, Int_t index) const;
197 Track* GetRawTrack(Int_t event_collection, Int_t counter, Int_t index) const;
202 void RejectLastEvent(Int_t event_collection);
207 void ResetEventCollection(Int_t collection);
211 void ClearEvent();
216 void PrepareMaps(Int_t collection);
220 void PrintMap() const;
226 Int_t GetCounter(Int_t event_collection) const;
233 Int_t GetTracksNo(Int_t event_collection, Int_t track_collection) const;
241 Int_t GetTracksNo(Int_t event_collection, Int_t track_collection, Int_t counter) const;
247 Int_t GetRawTracksNo(Int_t event_collection) const;
253 Bool_t IsReadyToMixing(Int_t collection) const;
254 virtual ~MemoryMapManager();
255 ClassDef(MemoryMapManager, 1)
256 };
257} // namespace Hal
258#endif /* HALMEMORYMAPMANAGER_H_ */
EventArray(Int_t task_id, Int_t size=1)
Event * At(const Int_t size)
void Init(Int_t event_factor, Int_t task_id, Bool_t compress, std::vector< TString > direct)
Int_t GetTracksNo(Int_t event_collection, Int_t track_collection) const
Track * GetRawTrack(Int_t event_collection, Int_t index) const
void AddTrackToMapTrack(Int_t event_collection, Int_t track_collection, Int_t index)
void SetMixSize(Int_t mix_size)
Event * GetEvent(Int_t collection) const
Int_t GetTemporaryTotalTracksNo() const
void RejectLastEvent(Int_t event_collection)
void BufferEvent(Int_t collection)
Bool_t IsReadyToMixing(Int_t collection) const
Track * GetTrack(Int_t event_collection, Int_t track_collection, Int_t index) const
Int_t GetRawTracksNo(Int_t event_collection) const
void ManualUpdate(Event *event)
void PrepareMaps(Int_t collection)
void ResetEventCollection(Int_t collection)
Track * GetTemporaryTrack(Int_t event_collection, Int_t track_collection, Int_t index) const