Project
Loading...
Searching...
No Matches
TriggerParticle.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
13
15#include "TClonesArray.h"
16#include "TParticle.h"
17
18namespace o2
19{
20namespace eventgen
21{
22
24{
25 LOG(info) << "Init trigger \'particle\' with following parameters";
26 LOG(info) << param;
27 return [&param](const std::vector<TParticle>& particles) -> bool {
28 for (const auto& particle : particles) {
29 if (particle.GetPdgCode() != param.pdg) {
30 continue;
31 }
32 if (particle.Pt() < param.ptMin || particle.Pt() > param.ptMax) {
33 continue;
34 }
35 if (particle.Eta() < param.etaMin || particle.Eta() > param.etaMax) {
36 continue;
37 }
38 if (particle.Phi() < param.phiMin || particle.Phi() > param.phiMax) {
39 continue;
40 }
41 if (particle.Y() < param.yMin || particle.Y() > param.yMax) {
42 continue;
43 }
44 return true;
45 }
46 return false;
47 };
48}
49
50} /* namespace eventgen */
51} /* namespace o2 */
GLenum GLfloat param
Definition glcorearb.h:271
std::function< bool(const std::vector< TParticle > &)> Trigger
Definition Trigger.h:25
Trigger TriggerParticle(const TriggerParticleParam &param)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"