Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
CutCollection.h
1/*
2 * CutCollection.h
3 *
4 * Created on: 04-05-2022
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#ifndef HALCUTSUBCONTAINER_H_
11#define HALCUTSUBCONTAINER_H_
12
13#include "Cut.h"
14
15#include "Array.h"
16
17#include <TObjArray.h>
18#include <TString.h>
19#include <vector>
20
21#include "Std.h"
22
23namespace Hal {
24 class CutMonitor;
25 class Event;
26 class Track;
27 class TwoTrack;
28
34 class CutCollectionLinks : public TObject {
35 std::vector<int> fLinks;
36 Bool_t fUsed = {kFALSE};
37
38 public:
40 void SafeInit();
41 void AddAddr(Int_t addr);
42 inline Int_t GetAddr(Int_t index) const { return fLinks[index]; }
43 inline Int_t GetSize() const { return fLinks.size(); }
44 void MakeUsed() { fUsed = kTRUE; }
45 Bool_t IsUsed() const { return fUsed; };
46 virtual ~CutCollectionLinks() {};
47 ClassDef(CutCollectionLinks, 1)
48 };
49
50 class CutCollection : public TObject {
51 private:
52 TObjArray* fCutMonitors;
53 TObjArray *fCuts, *fFastCuts;
54 ULong64_t fPassedSlow, fFailedSlow, fPassedFast, fFailedFast;
55 Int_t fFastCutsNo;
56 Int_t fSlowCutsNo;
57 Int_t fCutMonitorsNo;
58 CutCollectionLinks fPrev, fNext, fPrevBckg, fNextBckg;
59 ECutUpdate fMode; // mode event/ track. two track
60 Bool_t fInit, fDummy;
61 Int_t fCollectionID, fContainerSize, fStep;
62 TObjArray** fCutContainerArr; //[fContainerSize]
68 void Update(Bool_t val, TObject* obj);
73 void AdvancedMonitorInitialization(Int_t task_id);
81 Int_t MatchCut(Cut* address, CutCollection* input);
88 TObjArray* LocateInLowerCollections(TString cut);
95 TObjArray* LocateCuts(TString classname);
103 Bool_t CheckIfComptatiblie(Cut* cut1, Cut* cut2);
109 ECutUpdate GetUpdateFromName(TString cutname) const;
110 inline TObjArray* GetCutContainerArray(ECutUpdate upd) const {
111 return fCutContainerArr[static_cast<Int_t>(upd)];
112 ;
113 }
114
115 public:
123 CutCollection(TObjArray** container, Int_t cont_size, ECutUpdate update, Int_t collectionNo);
133 CutCollection* MakeNewCopy(TObjArray** container) const;
138 void Init(Int_t task_id);
142 void PrintInfo() const;
150 void SetStep(Int_t step) { fStep = step; };
156 void AddCut(Cut* cut, Option_t* opt = " ");
161 void MarkAsDummy();
166 void AddCutMonitor(CutMonitor* monitor);
172 void AddNextAddr(Int_t value, Bool_t background = kFALSE);
178 void AddPreviousAddr(Int_t value, Bool_t background = kFALSE);
186 void MakeDummyCopy(const CutCollection* copy, Bool_t copy_high_links = kTRUE);
192 Int_t Compare(const TObject* obj) const;
199 ULong64_t GetFailed(Option_t* opt = "") const;
206 ULong64_t GetPassed(Option_t* opt = "") const;
211 Int_t GetCutNo() const { return fCuts->GetEntriesFast(); };
216 Int_t GetCollectionID() const { return fCollectionID; };
221 Int_t GetFastCutNo() const { return fFastCuts->GetEntriesFast(); };
226 Int_t GetCutMonitorNo() const { return fCutMonitors->GetEntriesFast(); };
232 Bool_t PassEvent(Event* obj);
238 Bool_t PassTrack(Track* obj);
244 Bool_t PassTwoTrack(TwoTrack* pair);
249 Bool_t IsSortable() const { return kTRUE; };
259 Bool_t IsDummy() const { return fDummy; };
265 Cut* GetCut(Int_t index) const { return (Cut*) fCuts->UncheckedAt(index); };
271 Cut* GetFastCut(Int_t index) const { return (Cut*) fFastCuts->UncheckedAt(index); };
277 Cut* FindCut(TString name) const;
283 CutMonitor* GetCutMonitor(Int_t index) const;
289 CutCollection* Replicate(Int_t new_collection) const;
294 inline Int_t GetPrevNo() const { return fPrev.GetSize(); };
299 inline Int_t GetNextNo() const { return fNext.GetSize(); };
305 inline Int_t GetPrevAddr(Int_t index) const { return fPrev.GetAddr(index); };
311 inline Int_t GetNextAddr(Int_t index) const { return fNext.GetAddr(index); };
316 inline Int_t GetPrevNoBackground() const { return fPrevBckg.GetSize(); };
321 inline Int_t GetNextNoBackround() const { return fNextBckg.GetSize(); };
328 inline Int_t GetPrevAddBackround(Int_t index) const { return fPrevBckg.GetAddr(index); };
335 inline Int_t GetNextAddrBackround(Int_t index) const { return fNextBckg.GetAddr(index); };
340 virtual Package* Report() const;
341 virtual ~CutCollection();
342 ClassDef(CutCollection, 1)
343 };
344} // namespace Hal
345#endif /* HALCUTSUBCONTAINER_H_ */
Int_t GetPrevAddr(Int_t index) const
Bool_t IsDummy() const
Bool_t IsSortable() const
void MakeDummyCopy(const CutCollection *copy, Bool_t copy_high_links=kTRUE)
CutCollection * MakeNewCopy(TObjArray **container) const
Int_t GetCollectionID() const
void SetStep(Int_t step)
Int_t GetNextNo() const
Bool_t PassEvent(Event *obj)
Int_t GetNextAddrBackround(Int_t index) const
void AddPreviousAddr(Int_t value, Bool_t background=kFALSE)
void AddCutMonitor(CutMonitor *monitor)
Bool_t PassTwoTrack(TwoTrack *pair)
Cut * GetCut(Int_t index) const
void AddCut(Cut *cut, Option_t *opt=" ")
Bool_t PassTrack(Track *obj)
Int_t GetCutMonitorNo() const
Cut * GetFastCut(Int_t index) const
virtual Package * Report() const
CutCollection * Replicate(Int_t new_collection) const
Cut * FindCut(TString name) const
Int_t Compare(const TObject *obj) const
Int_t GetPrevAddBackround(Int_t index) const
void AddNextAddr(Int_t value, Bool_t background=kFALSE)
CutMonitor * GetCutMonitor(Int_t index) const
Int_t GetNextAddr(Int_t index) const
ULong64_t GetFailed(Option_t *opt="") const
Int_t GetPrevNo() const
void Init(Int_t task_id)
Int_t GetPrevNoBackground() const
Int_t GetCutNo() const
Int_t GetNextNoBackround() const
Int_t GetFastCutNo() const
ULong64_t GetPassed(Option_t *opt="") const
Definition Cut.h:40