AliPhysics  master (3d17d9d)
AliEmcalTriggerStringDecoder.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 __ALIEMCALTRIGGERSTRINGDECODER_H__
28 #define __ALIEMCALTRIGGERSTRINGDECODER_H__
29 #include <string>
30 #include <vector>
31 #include <TObject.h>
32 #include "AliEmcalStringView.h"
33 
34 namespace PWG {
35 
36 namespace EMCAL {
37 
52 class Triggerinfo : public TObject {
53 public:
55  Triggerinfo(const std::string &triggerclass, const std::string &bc, const std::string &pf, const std::string &clust):
56  TObject(),
57  fTriggerClass(triggerclass), fBunchCrossing(bc), fPastFutureProtection(pf), fTriggerCluster(clust) {}
58  virtual ~Triggerinfo() {}
59 
64  std::string ExpandClassName() const;
65 
73  bool IsTriggerClass(EMCAL_STRINGVIEW triggerclass) const;
74 
75  const std::string &Triggerclass() const { return fTriggerClass; }
76  const std::string &BunchCrossing() const { return fBunchCrossing; }
77  const std::string &PastFutureProtection() const { return fPastFutureProtection; }
78  const std::string &Triggercluster() const { return fTriggerCluster; }
79 
91  static std::vector<PWG::EMCAL::Triggerinfo> DecodeTriggerString(EMCAL_STRINGVIEW triggerstring);
92 private:
93  std::string fTriggerClass;
94  std::string fBunchCrossing;
95  std::string fPastFutureProtection;
96  std::string fTriggerCluster;
97  ClassDef(Triggerinfo, 1);
98 };
99 
100 
101 }
102 }
103 #endif
const std::string & BunchCrossing() const
const std::string & Triggerclass() const
Decoded structure of a trigger string.
std::string fPastFutureProtection
Type of the past-future protection.
std::string fTriggerClass
Trigger class.
const std::string & Triggercluster() const
std::string fBunchCrossing
Bunch crossing type.
static std::vector< PWG::EMCAL::Triggerinfo > DecodeTriggerString(EMCAL_STRINGVIEW triggerstring)
Decoding trigger string.
Triggerinfo(const std::string &triggerclass, const std::string &bc, const std::string &pf, const std::string &clust)
Namespace for EMCAL framework classes and task.
std::string ExpandClassName() const
Reconstruct trigger string from information in the Triggerinfo object.
Namespace for PWG framework classes.
const std::string & PastFutureProtection() const
std::string fTriggerCluster
Trigger cluster.
bool IsTriggerClass(EMCAL_STRINGVIEW triggerclass) const
Check if the trigger info corresponds to a certain trigger input class.
#define EMCAL_STRINGVIEW