CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FillInfo.h
Go to the documentation of this file.
2 
4 #include <bitset>
5 #include <iostream>
6 #include <string>
7 #include <sstream>
8 #include <vector>
9 
10 class FillInfo {
11  public:
12  enum FillType { UNKNOWN = 0, PROTONS = 1, IONS = 2, COSMICS = 3, GAP = 4 };
13  enum ParticleType { NONE = 0, PROTON = 1, PB82 = 2, AR18 = 3, D = 4, XE54 = 5 };
16  FillInfo();
17  FillInfo( unsigned short const & lhcFill, bool const & fromData = true );
18  ~FillInfo();
19 
20  //constant static unsigned integer hosting the maximum number of LHC bunch slots
21  static size_t const bunchSlots = 3564;
22 
23  //constant static unsigned integer hosting the available number of LHC bunch slots
24  static size_t const availableBunchSlots = 2808;
25 
26  //reset instance
27  void setFill( unsigned short const & lhcFill, bool const & fromData = true );
28 
29  //getters
30  unsigned short const fillNumber() const;
31 
32  bool const isData() const;
33 
34  unsigned short const bunchesInBeam1() const;
35 
36  unsigned short const bunchesInBeam2() const;
37 
38  unsigned short const collidingBunches() const;
39 
40  unsigned short const targetBunches() const;
41 
42  FillTypeId const fillType() const;
43 
45 
47 
48  float const crossingAngle() const;
49 
50  float const betaStar() const;
51 
52  float const intensityForBeam1() const;
53 
54  float const intensityForBeam2() const;
55 
56  float const energy() const;
57 
58  cond::Time_t const createTime() const;
59 
60  cond::Time_t const beginTime() const;
61 
62  cond::Time_t const endTime() const;
63 
64  std::string const & injectionScheme() const;
65 
66  //returns a boolean, true if the bunch slot number is in the circulating bunch configuration
67  bool isBunchInBeam1( size_t const & bunch ) const;
68 
69  bool isBunchInBeam2( size_t const & bunch ) const;
70 
71  //member functions returning *by value* a vector with all filled bunch slots
72  std::vector<unsigned short> bunchConfigurationForBeam1() const;
73 
74  std::vector<unsigned short> bunchConfigurationForBeam2() const;
75 
76  //setters
77  void setBunchesInBeam1( unsigned short const & bunches );
78 
79  void setBunchesInBeam2( unsigned short const & bunches );
80 
81  void setCollidingBunches( unsigned short const & collidingBunches );
82 
83  void setTargetBunches( unsigned short const & targetBunches );
84 
85  void setFillType( FillTypeId const & fillType );
86 
88 
90 
91  void setCrossingAngle( float const & angle );
92 
93  void setBetaStar( float const & betaStar );
94 
95  void setIntensityForBeam1( float const & intensity );
96 
97  void setIntensityForBeam2( float const & intensity );
98 
99  void setEnergy( float const & energy );
100 
101  void setCreationTime( cond::Time_t const & createTime );
102 
103  void setBeginTime( cond::Time_t const & beginTime );
104 
105  void setEndTime( cond::Time_t const & endTime );
106 
108 
109  //sets all values in one go
110  void setBeamInfo( unsigned short const & bunches1
111  ,unsigned short const & bunches2
112  ,unsigned short const & collidingBunches
113  ,unsigned short const & targetBunches
114  ,FillTypeId const & fillType
115  ,ParticleTypeId const & particleType1
116  ,ParticleTypeId const & particleType2
117  ,float const & angle
118  ,float const & beta
119  ,float const & intensity1
120  ,float const & intensity2
121  ,float const & energy
122  ,cond::Time_t const & createTime
123  ,cond::Time_t const & beginTime
124  ,cond::Time_t const & endTime
125  ,std::string const & scheme
126  ,std::bitset<bunchSlots+1> const & bunchConf1
127  ,std::bitset<bunchSlots+1> const & bunchConf2 );
128 
129  //dumping values on output stream
130  void print(std::stringstream & ss) const;
131 
132  protected:
133  std::bitset<bunchSlots+1> const & bunchBitsetForBeam1() const;
134 
135  std::bitset<bunchSlots+1> const & bunchBitsetForBeam2() const;
136 
137  void setBunchBitsetForBeam1( std::bitset<bunchSlots+1> const & bunchConfiguration );
138 
139  void setBunchBitsetForBeam2( std::bitset<bunchSlots+1> const & bunchConfiguration );
140 
141  private:
142  bool m_isData;
143  unsigned short m_lhcFill;
150  //BEWARE: since CMS counts bunches starting from one,
151  //the size of the bitset must be incremented by one,
152  //in order to avoid off-by-one
153  std::bitset<bunchSlots+1> m_bunchConfiguration1, m_bunchConfiguration2;
154 
156 };
157 
158 std::ostream & operator<<( std::ostream &, FillInfo fillInfo );
ParticleTypeId m_particles1
Definition: FillInfo.h:146
const double beta
void setBetaStar(float const &betaStar)
Definition: FillInfo.cc:266
float const intensityForBeam1() const
Definition: FillInfo.cc:183
void setCrossingAngle(float const &angle)
Definition: FillInfo.cc:262
unsigned short m_bunches1
Definition: FillInfo.h:144
ParticleType
Definition: FillInfo.h:13
unsigned short m_bunches2
Definition: FillInfo.h:144
void setBeamInfo(unsigned short const &bunches1, unsigned short const &bunches2, unsigned short const &collidingBunches, unsigned short const &targetBunches, FillTypeId const &fillType, ParticleTypeId const &particleType1, ParticleTypeId const &particleType2, float const &angle, float const &beta, float const &intensity1, float const &intensity2, float const &energy, cond::Time_t const &createTime, cond::Time_t const &beginTime, cond::Time_t const &endTime, std::string const &scheme, std::bitset< bunchSlots+1 > const &bunchConf1, std::bitset< bunchSlots+1 > const &bunchConf2)
Definition: FillInfo.cc:299
void setCollidingBunches(unsigned short const &collidingBunches)
Definition: FillInfo.cc:242
void setBunchBitsetForBeam2(std::bitset< bunchSlots+1 > const &bunchConfiguration)
Definition: FillInfo.cc:379
cond::Time_t m_beginTime
Definition: FillInfo.h:148
ParticleTypeId const particleTypeForBeam1() const
Definition: FillInfo.cc:167
std::bitset< bunchSlots+1 > m_bunchConfiguration2
Definition: FillInfo.h:153
void setIntensityForBeam2(float const &intensity)
Definition: FillInfo.cc:274
unsigned short m_lhcFill
Definition: FillInfo.h:143
void setBunchBitsetForBeam1(std::bitset< bunchSlots+1 > const &bunchConfiguration)
Definition: FillInfo.cc:375
cond::Time_t const beginTime() const
Definition: FillInfo.cc:199
std::bitset< bunchSlots+1 > const & bunchBitsetForBeam2() const
Definition: FillInfo.cc:370
void setFillType(FillTypeId const &fillType)
Definition: FillInfo.cc:250
float m_crossingAngle
Definition: FillInfo.h:147
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
static size_t const availableBunchSlots
Definition: FillInfo.h:24
std::bitset< bunchSlots+1 > const & bunchBitsetForBeam1() const
Definition: FillInfo.cc:366
float m_betastar
Definition: FillInfo.h:147
void setIntensityForBeam1(float const &intensity)
Definition: FillInfo.cc:270
std::string m_injectionScheme
Definition: FillInfo.h:149
void setBunchesInBeam1(unsigned short const &bunches)
Definition: FillInfo.cc:234
FillTypeId const fillType() const
Definition: FillInfo.cc:163
FillInfo()
Definition: FillInfo.cc:72
unsigned short const fillNumber() const
Definition: FillInfo.cc:139
ParticleType ParticleTypeId
Definition: FillInfo.h:15
unsigned long long Time_t
Definition: Time.h:16
unsigned short const bunchesInBeam1() const
Definition: FillInfo.cc:147
tuple particleType
Definition: autophobj.py:28
void setParticleTypeForBeam2(ParticleTypeId const &particleType)
Definition: FillInfo.cc:258
void setEndTime(cond::Time_t const &endTime)
Definition: FillInfo.cc:290
cond::Time_t m_endTime
Definition: FillInfo.h:148
unsigned short m_targetBunches
Definition: FillInfo.h:144
float m_energy
Definition: FillInfo.h:147
FillType FillTypeId
Definition: FillInfo.h:14
void setTargetBunches(unsigned short const &targetBunches)
Definition: FillInfo.cc:246
std::string const & injectionScheme() const
Definition: FillInfo.cc:207
float const betaStar() const
Definition: FillInfo.cc:179
FillTypeId m_fillType
Definition: FillInfo.h:145
bool isBunchInBeam1(size_t const &bunch) const
Definition: FillInfo.cc:212
void setFill(unsigned short const &lhcFill, bool const &fromData=true)
Definition: FillInfo.cc:115
static size_t const bunchSlots
Definition: FillInfo.h:21
~FillInfo()
Definition: FillInfo.cc:112
cond::Time_t const createTime() const
Definition: FillInfo.cc:195
bool m_isData
Definition: FillInfo.h:142
unsigned short m_collidingBunches
Definition: FillInfo.h:144
float m_intensity1
Definition: FillInfo.h:147
#define COND_SERIALIZABLE
Definition: Serializable.h:37
void setParticleTypeForBeam1(ParticleTypeId const &particleType)
Definition: FillInfo.cc:254
bool isBunchInBeam2(size_t const &bunch) const
Definition: FillInfo.cc:218
cond::Time_t m_createTime
Definition: FillInfo.h:148
std::bitset< bunchSlots+1 > m_bunchConfiguration1
Definition: FillInfo.h:153
cond::Time_t const endTime() const
Definition: FillInfo.cc:203
float const energy() const
Definition: FillInfo.cc:191
ParticleTypeId const particleTypeForBeam2() const
Definition: FillInfo.cc:171
void setBeginTime(cond::Time_t const &beginTime)
Definition: FillInfo.cc:286
bool const isData() const
Definition: FillInfo.cc:143
unsigned short const bunchesInBeam2() const
Definition: FillInfo.cc:151
float const intensityForBeam2() const
Definition: FillInfo.cc:187
std::vector< unsigned short > bunchConfigurationForBeam1() const
Definition: FillInfo.cc:225
void setBunchesInBeam2(unsigned short const &bunches)
Definition: FillInfo.cc:238
ParticleTypeId m_particles2
Definition: FillInfo.h:146
void setEnergy(float const &energy)
Definition: FillInfo.cc:278
unsigned short const targetBunches() const
Definition: FillInfo.cc:159
float const crossingAngle() const
Definition: FillInfo.cc:175
unsigned short const collidingBunches() const
Definition: FillInfo.cc:155
void setCreationTime(cond::Time_t const &createTime)
Definition: FillInfo.cc:282
std::vector< unsigned short > bunchConfigurationForBeam2() const
Definition: FillInfo.cc:229
void setInjectionScheme(std::string const &injectionScheme)
Definition: FillInfo.cc:294
void print(std::stringstream &ss) const
Definition: FillInfo.cc:337
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
float m_intensity2
Definition: FillInfo.h:147