AliPhysics  8d00e07 (8d00e07)
AliEmcalTriggerSelectionCuts.h
Go to the documentation of this file.
1 /************************************************************************************
2  * Copyright (C) 2017, Copyright Holders of the ALICE Collaboration *
3  * All rights reserved. *
4  * *
5  * Redistribution and use in source and binary forms, with or without *
6  * modification, are permitted provided that the following conditions are met: *
7  * * Redistributions of source code must retain the above copyright *
8  * notice, this list of conditions and the following disclaimer. *
9  * * Redistributions in binary form must reproduce the above copyright *
10  * notice, this list of conditions and the following disclaimer in the *
11  * documentation and/or other materials provided with the distribution. *
12  * * Neither the name of the <organization> nor the *
13  * names of its contributors may be used to endorse or promote products *
14  * derived from this software without specific prior written permission. *
15  * *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
19  * DISCLAIMED. IN NO EVENT SHALL ALICE COLLABORATION BE LIABLE FOR ANY *
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
26  ************************************************************************************/
27 #ifndef ALIEMCALTRIGGERSELECTIONCUTS_H
28 #define ALIEMCALTRIGGERSELECTIONCUTS_H
29 
30 #include <iosfwd>
31 #include <TObject.h>
32 
33 class AliEMCALTriggerPatchInfo;
34 
35 // operator<< has to be forward declared carefully to stay in the global namespace so that it works with CINT.
36 // For generally how to keep the operator in the global namespace, See: https://stackoverflow.com/a/38801633
37 namespace PWG { namespace EMCAL { class AliEmcalTriggerSelectionCuts; } }
38 std::ostream & operator<< (std::ostream &in, const PWG::EMCAL::AliEmcalTriggerSelectionCuts &cuts);
39 
40 namespace PWG {
41 namespace EMCAL {
42 
51 public:
53  kADC = 0,
54  kEnergyRough = 1,
56  kEnergyOfflineSmeared = 3
57  };
58  enum PatchType_t {
59  kAnyPatch = 0,
60  kL1JetPatch = 1,
61  kL1GammaPatch = 2,
62  kL0Patch = 3,
63  kL1JetLowPatch = 4,
64  kL1JetHighPatch = 5,
65  kL1GammaLowPatch = 6,
66  kL1GammaHighPatch = 7
67  };
69  kEMCALAcceptance = 0,
70  kDCALAcceptance = 1,
71  kEMCALDCALAcceptance = 2
72  };
73 
79 
80  PatchType_t GetPatchType() const { return fPatchType; }
81  SelectionMethod_t GetSelectionMethod() const { return fSelectionMethod; }
82  Double_t GetThreshold() const { return fThreshold; }
83  Bool_t IsRequestingSimpleOfflinePatches() const { return fUseSimpleOffline; }
84 
85  void SetPatchType(PatchType_t patchType) { fPatchType = patchType; }
86  void SetAcceptanceType(AcceptanceType_t acceptance) { fAcceptanceType = acceptance; }
87  void SetSelectionMethod(SelectionMethod_t selectionMethod) { fSelectionMethod = selectionMethod; }
88  void SetThreshold(Double_t threshold) { fThreshold = threshold; }
89  void SetUseSimpleOfflinePatches(Bool_t doUse = kTRUE) { fUseSimpleOffline = doUse; }
90  void SetUseRecalcPatches(Bool_t doUse = kTRUE) { fUseRecalc = doUse; }
91 
98  Bool_t IsSelected(const AliEMCALTriggerPatchInfo * const patch) const;
99 
108  Int_t CompareTriggerPatches(const AliEMCALTriggerPatchInfo *first, const AliEMCALTriggerPatchInfo *second) const;
109 
119  friend std::ostream& ::operator<<(std::ostream &stream, const AliEmcalTriggerSelectionCuts &cuts);
120 
121 protected:
122 
129  Double_t GetCutPrimitive(const AliEMCALTriggerPatchInfo * const patch) const;
130 
137  Bool_t SelectPatchType(const AliEMCALTriggerPatchInfo * const patch) const;
138 
149  Bool_t SelectAcceptance(const AliEMCALTriggerPatchInfo * const patch) const;
150 
157 
158 private:
159 
167  void PrintStream(std::ostream &stream) const;
168 
170  ClassDef(AliEmcalTriggerSelectionCuts, 1); // Cuts for the EMCAL Trigger selection
172 };
173 
174 }
175 }
176 
177 #endif /* ALIEMCALTRIGGERSELECTIONCUTS_H */
Class for the selection of trigger patches in the EMCAL triggered event selection.
double Double_t
Definition: External.C:58
void SetSelectionMethod(SelectionMethod_t selectionMethod)
Bool_t fUseSimpleOffline
Request simple offline patches.
Namespace for EMCAL framework classes and task.
int Int_t
Definition: External.C:63
Namespace for PWG framework classes.
SelectionMethod_t fSelectionMethod
Variable to cut on.
std::ostream & operator<<(std::ostream &stream, const AliEmcalTrackSelResultPtr &ref)
AcceptanceType_t fAcceptanceType
Acceptance type (EMCAL or DCAL acceptance)
void SetAcceptanceType(AcceptanceType_t acceptance)
bool Bool_t
Definition: External.C:53
Offline energy, from cells, calibrated, exluding hot towers.
PatchType_t fPatchType
Type of the patch to be selected.