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