Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
CutContainer.h
1/*
2 * CutContainer.h
3 *
4 * Created on: 06-08-2013
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#ifndef HALCUTCONTAINER_H_
11#define HALCUTCONTAINER_H_
12
13#include <TObjArray.h>
14#include <TString.h>
15
16#include "Cut.h"
17#include "CutCollection.h"
18#include "CutMonitor.h"
19#include "Std.h"
20
21//#define SHOW_CUT_INIT
25namespace Hal {
26 class CutContainer : public TObject {
27 Bool_t fInit;
28 Int_t fSize;
29 // TObjArray *fTempCutContainers;
30 TObjArray** fTempCutMonitors; //[fSize]
31 TObjArray** fCutContainers; //[fSize]
32 void VerifyOrder(TObjArray* obj);
33 void ExtractComplexMonitor(CutMonitor* mon, TString& opt);
34 void MakeComplexAxis(CutMonitor* mon, Int_t axis, Int_t opt);
35 Bool_t ExtractRegExp(const CutMonitor& cut, Option_t* opt);
36 Bool_t ExtractRegExp2(const CutMonitor& cut, Option_t* opt);
37 Bool_t CheckTwoTracksOptions(const CutMonitor& cutmon, Option_t* opt);
38 Bool_t CheckTwoTracksOptions(const Cut& cutmon, Option_t* opt);
39
40 protected:
41 inline TObjArray* GetCutContainer(ECutUpdate upd) const { return (TObjArray*) fCutContainers[static_cast<Int_t>(upd)]; };
42
43 public:
47 enum class ELinkPolicy { kOneToMany, kEqual, kReplicateLast, kReplicateFirst, kAnyToAny };
56 CutContainer(const CutContainer& cont);
61 CutContainer(ECutUpdate tiers_no);
66 void Init(const Int_t task_id = 0);
72 void AddCut(const Cut& cut, Option_t* opt = " ");
76 void InitReport() const;
82 void AddMonitor(const CutMonitor& monitor, Option_t* opt = " ");
90 void LinkCollections(ECutUpdate opt_low, Int_t in_low, ECutUpdate opt_high, Int_t in_high);
100 void ReplicateCollection(ECutUpdate type, Int_t collection_no, Int_t new_collection_no, Option_t* option = "");
106 void RemoveCollection(ECutUpdate update, Int_t collection);
116 void MakeDummyCopies(ECutUpdate update, CutContainer* other, Bool_t copy_link);
120 void AddVirtualCut(ECutUpdate update, Int_t col);
124 Int_t GetCollectionsNo(ECutUpdate update) const;
129 Int_t GetEventCollectionsNo() const;
134 Int_t GetTrackCollectionsNo() const;
139 Int_t GetTwoTrackCollectionsNo() const;
148 Bool_t LinkCollections(ECutUpdate first, ECutUpdate last, ELinkPolicy policy);
154 inline CutCollection* GetEventCollection(Int_t collection) const {
155 return (CutCollection*) fCutContainers[static_cast<Int_t>(ECutUpdate::kEvent)]->UncheckedAt(collection);
156 ;
157 };
163 inline CutCollection* GetTrackCollection(Int_t collection) const {
164 return (CutCollection*) fCutContainers[static_cast<Int_t>(ECutUpdate::kTrack)]->UncheckedAt(collection);
165 };
171 inline CutCollection* GetTwoTrackCollection(Int_t collection) const {
172 return (CutCollection*) fCutContainers[static_cast<Int_t>(ECutUpdate::kTwoTrack)]->UncheckedAt(collection);
173 };
179 inline CutCollection* GetTwoTrackBackgroundCollection(Int_t collection) const {
180 return (CutCollection*) fCutContainers[static_cast<Int_t>(ECutUpdate::kTwoTrackBackground)]->UncheckedAt(collection);
181 };
186 inline Int_t GetSize() const { return fSize; };
193 inline Bool_t PassEvent(Event* event, const Int_t collection) {
194 return ((CutCollection*) fCutContainers[static_cast<Int_t>(ECutUpdate::kEvent)]->UncheckedAt(collection))->PassEvent(event);
195 }
202 inline Bool_t PassTrack(Track* track, const Int_t collection) {
203 return ((CutCollection*) fCutContainers[static_cast<Int_t>(ECutUpdate::kTrack)]->UncheckedAt(collection))->PassTrack(track);
204 };
211 inline Bool_t PassSignalPair(TwoTrack* pair, const Int_t collection) {
212 return ((CutCollection*) fCutContainers[static_cast<Int_t>(ECutUpdate::kTwoTrack)]->UncheckedAt(collection))
213 ->PassTwoTrack(pair);
214 };
221 inline Bool_t PassBackgroundPair(TwoTrack* pair, const Int_t collection) {
222 return ((CutCollection*) fCutContainers[static_cast<Int_t>(ECutUpdate::kTwoTrackBackground)]->UncheckedAt(collection))
223 ->PassTwoTrack(pair);
224 };
229 virtual Package* Report() const;
230 virtual ~CutContainer();
231 ClassDef(CutContainer, 1)
232 };
233} // namespace Hal
234#endif /* HALCUTCONTAINER_H_ */
CutCollection * GetTwoTrackBackgroundCollection(Int_t collection) const
void ReplicateCollection(ECutUpdate type, Int_t collection_no, Int_t new_collection_no, Option_t *option="")
Bool_t PassSignalPair(TwoTrack *pair, const Int_t collection)
Bool_t PassEvent(Event *event, const Int_t collection)
Int_t GetSize() const
void MakeDummyCopies(ECutUpdate update, CutContainer *other, Bool_t copy_link)
Int_t GetTwoTrackCollectionsBackgroundNo() const
void LinkCollections(ECutUpdate opt_low, Int_t in_low, ECutUpdate opt_high, Int_t in_high)
void RemoveCollection(ECutUpdate update, Int_t collection)
void AddVirtualCut(ECutUpdate update, Int_t col)
void InitReport() const
CutCollection * GetTwoTrackCollection(Int_t collection) const
virtual Package * Report() const
Int_t GetTwoTrackCollectionsNo() const
void AddMonitor(const CutMonitor &monitor, Option_t *opt=" ")
void AddCut(const Cut &cut, Option_t *opt=" ")
Int_t GetCollectionsNo(ECutUpdate update) const
void Init(const Int_t task_id=0)
Int_t GetEventCollectionsNo() const
CutCollection * GetTrackCollection(Int_t collection) const
Bool_t PassBackgroundPair(TwoTrack *pair, const Int_t collection)
CutCollection * GetEventCollection(Int_t collection) const
Int_t GetTrackCollectionsNo() const
Bool_t PassTrack(Track *track, const Int_t collection)
Definition Cut.h:40