AliRoot Core  3dc7879 (3dc7879)
AliEMCALTriggerTRUDCSConfig.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
17 #include <bitset>
18 #include <iomanip>
19 #include <iostream>
20 #include <sstream>
21 
25 
28 //_____________________________________________________________________________
30 ,fSELPF(0x1e1f)
31 ,fL0SEL(0x1)
32 ,fL0COSM(0)
33 ,fGTHRL0(0)
34 ,fRLBKSTU(0)
35 ,fFw(0x21)
36 {
37  for (Int_t i=0;i<6;i++) fMaskReg[i] = 0;
38 }
39 
40 //_____________________________________________________________________________
42 {
43  if (fL0SEL & 0x0001)
44  return 2;
45  else
46  return 1;
47 }
48 
50  return (fSELPF == other.fSELPF) && (fL0SEL == other.fL0SEL) && (fL0COSM == other.fL0COSM)
51  && (fGTHRL0 == other.fGTHRL0) && (fRLBKSTU == other.fRLBKSTU) && (fFw == other.fFw)
52  && !memcmp(fMaskReg, other.fMaskReg, sizeof(UInt_t) * 6);
53 }
54 
55 std::ostream &operator<<(std::ostream &stream, const AliEMCALTriggerTRUDCSConfig &conf){
56  stream << "SELPF: " << std::hex << conf.fSELPF << ", L0SEL: " << conf.fL0SEL << ", L0COSM: " << std::dec
57  << conf.fL0COSM << ", GTHRL0: " << conf.fGTHRL0 << ", RLBKSTU: " << conf.fRLBKSTU << ", FW: " << std::hex
58  << conf.fFw << std::dec << std::endl;
59  for(int ireg = 0; ireg < 6; ireg++){
60  stream << "Reg" << ireg << ": " << std::bitset<sizeof(UInt_t) *8>(conf.fMaskReg[ireg]) << " (" << conf.fMaskReg[ireg] << ")" << std::endl;
61  }
62  return stream;
63 }
64 
66  std::stringstream jsonstring;
67  jsonstring << "{"
68  << "\"fSELPF\":" << fSELPF << ","
69  << "\"fL0SEL\":" << fL0SEL << ","
70  << "\"fL0COSM\":" << fL0COSM << ","
71  << "\"fGTHRL0\":" << fGTHRL0 << ","
72  << "\"fRLBKSTU\":" << fRLBKSTU << ","
73  << "\"fFw\":" << fFw << ","
74  << "\"fMaskReg\":[" << fMaskReg[0] << "," << fMaskReg[1] << "," << fMaskReg[2] << "," << fMaskReg[3] << "," << fMaskReg[4] << "," << fMaskReg[5] << "]"
75  << "}";
76  return jsonstring.str();
77 }
friend std::ostream & operator<<(std::ostream &stream, const AliEMCALTriggerTRUDCSConfig &other)
Streaming operator.
AliEMCALTriggerTRUDCSConfig()
Default constructor.
bool operator==(const AliEMCALTriggerTRUDCSConfig &other) const
equalty operator
UInt_t fRLBKSTU
TRU circular buffer rollback.
UInt_t fMaskReg[6]
6*16 = 96 mask bits per TRU
std::string ToJSON() const
Serialize object to JSON format.