-
Notifications
You must be signed in to change notification settings - Fork 676
PWGEM/PhotonMeson: add EMEventCut and rename namespace #4968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| // Copyright 2019-2020 CERN and copyright holders of ALICE O2. | ||
| // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. | ||
| // All rights not expressly granted are reserved. | ||
| // | ||
| // This software is distributed under the terms of the GNU General Public | ||
| // License v3 (GPL Version 3), copied verbatim in the file "COPYING". | ||
| // | ||
| // In applying this license CERN does not waive the privileges and immunities | ||
| // granted to it by virtue of its status as an Intergovernmental Organization | ||
| // or submit itself to any jurisdiction. | ||
|
|
||
| // | ||
| // Class for em event selection | ||
| // | ||
|
|
||
| #include "Framework/Logger.h" | ||
| #include "PWGEM/PhotonMeson/Core/EMEventCut.h" | ||
|
|
||
| ClassImp(EMEventCut); | ||
|
|
||
| const char* EMEventCut::mCutNames[static_cast<int>(EMEventCut::EMEventCuts::kNCuts)] = {"RequireFT0AND", "Zvtx", "RequireNoTFB", "RequireNoITSROFB"}; | ||
|
|
||
| void EMEventCut::SetRequireFT0AND(bool flag) | ||
| { | ||
| mRequireFT0AND = flag; | ||
| LOG(info) << "EM Event Cut, require FT0AND: " << mRequireFT0AND; | ||
| } | ||
|
|
||
| void EMEventCut::SetZvtxRange(float min, float max) | ||
| { | ||
| mMinZvtx = min; | ||
| mMaxZvtx = max; | ||
| LOG(info) << "EM Event Cut, set z vtx range: " << mMinZvtx << " - " << mMaxZvtx; | ||
| } | ||
|
|
||
| void EMEventCut::SetRequireNoTFB(bool flag) | ||
| { | ||
| mRequireNoTFB = flag; | ||
| LOG(info) << "EM Event Cut, require No TF border: " << mRequireNoTFB; | ||
| } | ||
|
|
||
| void EMEventCut::SetRequireNoITSROFB(bool flag) | ||
| { | ||
| mRequireNoITSROFB = flag; | ||
| LOG(info) << "EM Event Cut, require No ITS ROF border: " << mRequireNoITSROFB; | ||
| } | ||
|
|
||
| void EMEventCut::print() const | ||
| { | ||
| LOG(info) << "EM Event Cut:"; | ||
| for (int i = 0; i < static_cast<int>(EMEventCuts::kNCuts); i++) { | ||
| switch (static_cast<EMEventCuts>(i)) { | ||
| case EMEventCuts::kFT0AND: | ||
| LOG(info) << mCutNames[i] << " = " << mRequireFT0AND; | ||
| break; | ||
| case EMEventCuts::kZvtx: | ||
| LOG(info) << mCutNames[i] << " in [" << mMinZvtx << ", " << mMaxZvtx << "]"; | ||
| break; | ||
| case EMEventCuts::kNoTFB: | ||
| LOG(info) << mCutNames[i] << " = " << mRequireNoTFB; | ||
| break; | ||
| case EMEventCuts::kNoITSROFB: | ||
| LOG(info) << mCutNames[i] << " = " << mRequireNoITSROFB; | ||
| break; | ||
|
|
||
| default: | ||
| LOG(fatal) << "Cut unknown!"; | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| // Copyright 2019-2020 CERN and copyright holders of ALICE O2. | ||
| // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. | ||
| // All rights not expressly granted are reserved. | ||
| // | ||
| // This software is distributed under the terms of the GNU General Public | ||
| // License v3 (GPL Version 3), copied verbatim in the file "COPYING". | ||
| // | ||
| // In applying this license CERN does not waive the privileges and immunities | ||
| // granted to it by virtue of its status as an Intergovernmental Organization | ||
| // or submit itself to any jurisdiction. | ||
|
|
||
| // | ||
| // Class for em photon event selection | ||
| // | ||
|
|
||
| #ifndef PWGEM_PHOTONMESON_CORE_EMEVENTCUT_H_ | ||
| #define PWGEM_PHOTONMESON_CORE_EMEVENTCUT_H_ | ||
|
|
||
| #include "TNamed.h" | ||
| #include "Common/CCDB/EventSelectionParams.h" | ||
| #include "Common/CCDB/TriggerAliases.h" | ||
|
|
||
| using namespace std; | ||
|
|
||
| class EMEventCut : public TNamed | ||
| { | ||
| public: | ||
| EMEventCut() = default; | ||
| EMEventCut(const char* name, const char* title) : TNamed(name, title) {} | ||
|
|
||
| enum class EMEventCuts : int { | ||
| kFT0AND, // i.e. sel8 | ||
| kZvtx, | ||
| kNoTFB, // no time frame border | ||
| kNoITSROFB, // no ITS read out frame border | ||
| kNCuts | ||
| }; | ||
|
|
||
| static const char* mCutNames[static_cast<int>(EMEventCuts::kNCuts)]; | ||
|
|
||
| template <typename T> | ||
| bool IsSelected(T const& collision) const | ||
| { | ||
| if (!IsSelected(collision, EMEventCuts::kFT0AND)) { | ||
| return false; | ||
| } | ||
| if (!IsSelected(collision, EMEventCuts::kZvtx)) { | ||
| return false; | ||
| } | ||
| if (!IsSelected(collision, EMEventCuts::kNoTFB)) { | ||
| return false; | ||
| } | ||
| if (!IsSelected(collision, EMEventCuts::kNoITSROFB)) { | ||
| return false; | ||
| } | ||
| return true; | ||
| } | ||
|
|
||
| template <typename T> | ||
| bool IsSelected(T const& collision, const EMEventCuts& cut) const | ||
| { | ||
| switch (cut) { | ||
| case EMEventCuts::kFT0AND: | ||
| return collision.sel8(); | ||
| // return collision.selection_bit(o2::aod::evsel::kIsTriggerTVX); // alternative way. | ||
|
|
||
| case EMEventCuts::kZvtx: | ||
| return mMinZvtx < collision.posZ() && collision.posZ() < mMaxZvtx; | ||
|
|
||
| case EMEventCuts::kNoTFB: | ||
| return collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder); | ||
|
|
||
| case EMEventCuts::kNoITSROFB: | ||
| return collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder); | ||
|
|
||
| default: | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| // Setters | ||
| void SetRequireFT0AND(bool flag); | ||
| void SetZvtxRange(float min, float max); | ||
| void SetRequireNoTFB(bool flag); | ||
| void SetRequireNoITSROFB(bool flag); | ||
|
|
||
| /// @brief Print the track selection | ||
| void print() const; | ||
|
|
||
| private: | ||
| bool mRequireFT0AND{true}; | ||
| float mMinZvtx{-10.f}, mMaxZvtx{+10.f}; // range in pT | ||
| bool mRequireNoTFB{true}; | ||
| bool mRequireNoITSROFB{true}; | ||
|
|
||
| ClassDef(EMEventCut, 1); | ||
| }; | ||
|
|
||
| #endif // PWGEM_PHOTONMESON_CORE_EMEVENTCUT_H_ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not pollute the global namespace!