Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
TrackAna.cxx
1/*
2 * TrackAna.cxx
3 *
4 * Created on: 07-08-2013
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#include "TrackAna.h"
11#include "Cout.h"
12#include "MemoryMapManager.h"
13
14#include "CutCollection.h"
15#include "CutContainer.h"
16#include "Event.h"
17#include "TrackVirtualCut.h"
18
19namespace Hal {
20 TrackAna::TrackAna(ECutUpdate tiers) :
21 EventAna(tiers), fTrackCollectionsNo(0), fCurrentTrackCollectionID(0), fTrackIndex(0), fCurrentTrack(nullptr) {}
22
23 TrackAna::TrackAna(const TrackAna& ana) :
24 EventAna(ana),
25 fTrackCollectionsNo(ana.fTrackCollectionsNo),
26 fCurrentTrackCollectionID(ana.fCurrentTrackCollectionID),
27 fTrackIndex(ana.fTrackIndex),
28 fCurrentTrack(NULL) {}
29
47
48 Task::EInitFlag TrackAna::Init() {
49 if (Task::EInitFlag::kSUCCESS == EventAna::Init()) {
51 return Task::EInitFlag::kSUCCESS;
52 } else
53 return Task::EInitFlag::kFATAL;
54 }
55
56 void TrackAna::SetOption(Option_t* option) { EventAna::SetOption(option); }
57
59
61 Int_t trackCollections = fCutContainer->GetTrackCollectionsNo();
62 Int_t eventCollections = fCutContainer->GetEventCollectionsNo();
63 Int_t jump = trackCollections / eventCollections;
64 if (jump == 0) {
65 Cout::PrintInfo("Too many event collections, some of them will be ignored", EInfo::kLowWarning);
66 jump++;
67 }
68 if (trackCollections != jump * eventCollections) {
69 Cout::PrintInfo("Some track collections will be ignored", EInfo::kLowWarning);
70 }
71 for (int i = 0; i < eventCollections; i++) {
72 for (int j = i * jump; j < (i + 1) * jump; j++) {
73 fCutContainer->LinkCollections(ECutUpdate::kEvent, i, ECutUpdate::kTrack, j);
74 }
75 }
76 }
77
80 Int_t trackCollections = fCutContainer->GetTrackCollectionsNo();
81 if (trackCollections == 0) {
82#ifdef HAL_DEBUG
83 Cout::PrintInfo("No track collections, virtual will be added", EInfo::kDebugInfo);
84#endif
86 }
88 }
89
90 void TrackAna::Exec(Option_t* opt) { EventAna::Exec(opt); }
91
92 TrackAna::~TrackAna() {}
93
95 Package* pack = EventAna::Report();
96 return pack;
97 }
98
100
101 TrackAna& TrackAna::operator=(const TrackAna& other) {
102 if (this != &other) {
105 fTrackIndex = other.fTrackIndex;
108 }
109 return *this;
110 }
111} // namespace Hal
static void PrintInfo(TString text, Hal::EInfo status)
Definition Cout.cxx:370
Int_t GetNextNo() const
Int_t GetNextAddr(Int_t index) const
void LinkCollections(ECutUpdate opt_low, Int_t in_low, ECutUpdate opt_high, Int_t in_high)
void AddCut(const Cut &cut, Option_t *opt=" ")
Int_t GetEventCollectionsNo() const
CutCollection * GetEventCollection(Int_t collection) const
Int_t GetTrackCollectionsNo() const
Bool_t PassTrack(Track *track, const Int_t collection)
CutContainer * fCutContainer
Definition EventAna.h:78
virtual void CheckCutContainerCollections()
Definition EventAna.cxx:200
virtual void SetOption(Option_t *opt)
Definition EventAna.cxx:115
Event * fCurrentEvent
Definition EventAna.h:86
MemoryMapManager * fMemoryMap
Definition EventAna.h:82
EventAna & operator=(const EventAna &other)
Definition EventAna.cxx:449
virtual Package * Report() const
Definition EventAna.cxx:259
virtual void FinishTask()
Definition EventAna.cxx:291
Int_t fCurrentEventCollectionID
Definition EventAna.h:65
virtual void Exec(Option_t *opt)
Definition EventAna.cxx:104
virtual Task::EInitFlag Init()
Definition EventAna.cxx:66
Track * GetTrack(Int_t i) const
Definition Event.h:208
void AddTrackToMapTrack(Int_t event_collection, Int_t track_collection, Int_t index)
Int_t GetTemporaryTotalTracksNo() const
void PrepareMaps(Int_t collection)
virtual void Exec(Option_t *opt)
Definition TrackAna.cxx:90
Track * fCurrentTrack
Definition TrackAna.h:42
virtual Task::EInitFlag Init()
Definition TrackAna.cxx:48
Int_t fCurrentTrackCollectionID
Definition TrackAna.h:34
virtual Package * Report() const
Definition TrackAna.cxx:94
virtual void FinishTask()
Definition TrackAna.cxx:99
virtual void ProcessEvent()
Definition TrackAna.cxx:30
Int_t fTrackIndex
Definition TrackAna.h:38
Int_t fTrackCollectionsNo
Definition TrackAna.h:30
virtual void SetOption(Option_t *option)
Definition TrackAna.cxx:56
virtual void ProcessTrack()
Definition TrackAna.cxx:58
virtual void CheckCutContainerCollections()
Definition TrackAna.cxx:78
virtual void LinkCollections()
Definition TrackAna.cxx:60