CMS 3D CMS Logo

FWMagField.h
Go to the documentation of this file.
1 #ifndef Fireworks_Tracks_FWMagField_h
2 #define Fireworks_Tracks_FWMagField_h
3 // -*- C++ -*-
4 //
5 // Simplified model of the CMS detector magnetic field
6 //
7 #include "TEveTrackPropagator.h"
8 class TH1F;
9 
10 namespace edm {
11  class EventBase;
12 }
13 
14 class FWMagField : public TEveMagField {
15  Float_t GetFieldMag() const;
16 
17 public:
18  enum ESource { kNone, kEvent, kUser };
19 
20  FWMagField();
21  ~FWMagField() override;
22 
23  // get field values
24  TEveVector GetField(Float_t x, Float_t y, Float_t z) const override;
25  Float_t GetMaxFieldMag() const override;
26 
27  // auto/user behaviour
28  void setUserField(float b) { m_userField = b; }
29  float getUserField() const { return m_userField; }
30  void setSource(ESource x) { m_source = x; }
31  ESource getSource() const { return m_source; }
32 
33  // field model
35  bool isReverse() const { return m_reverse; }
36  void setSimpleModel(bool simpleModel) { m_simpleModel = simpleModel; }
37  bool isSimpleModel() const { return m_simpleModel; }
38 
39  // field estimate
40  void guessFieldIsOn(bool guess) const;
41  void guessField(float estimate) const;
42  void resetFieldEstimate() const;
43 
44  void checkFieldInfo(const edm::EventBase*);
45  void setFFFieldMag(float);
46 
47  FWMagField(const FWMagField&) = delete; // stop default
48  const FWMagField& operator=(const FWMagField&) = delete; // stop default
49 
50 private:
52  float m_userField;
53  float m_eventField;
54 
55  bool m_reverse;
57 
58  // runtime estimate , have to be mutable becuse of GetField() is const
59  mutable TH1F* m_guessValHist;
62  mutable bool m_updateFieldEstimate;
63  mutable float m_guessedField;
64 };
65 
66 #endif
int m_numberOfFieldEstimates
Definition: FWMagField.h:61
int m_numberOfFieldIsOnEstimates
Definition: FWMagField.h:60
void resetFieldEstimate() const
Definition: FWMagField.cc:135
void guessFieldIsOn(bool guess) const
Definition: FWMagField.cc:122
float getUserField() const
Definition: FWMagField.h:29
TEveVector GetField(Float_t x, Float_t y, Float_t z) const override
Definition: FWMagField.cc:34
void setReverseState(bool state)
Definition: FWMagField.h:34
bool m_simpleModel
Definition: FWMagField.h:56
float m_guessedField
Definition: FWMagField.h:63
const FWMagField & operator=(const FWMagField &)=delete
~FWMagField() override
Definition: FWMagField.cc:30
bool m_reverse
Definition: FWMagField.h:55
bool m_updateFieldEstimate
Definition: FWMagField.h:62
TH1F * m_guessValHist
Definition: FWMagField.h:59
Float_t GetMaxFieldMag() const override
Definition: FWMagField.cc:111
void setFFFieldMag(float)
Definition: FWMagField.cc:190
ESource m_source
Definition: FWMagField.h:51
bool isReverse() const
Definition: FWMagField.h:35
float m_userField
Definition: FWMagField.h:52
Float_t GetFieldMag() const
Definition: FWMagField.cc:73
string guess
Definition: mps_check.py:395
void checkFieldInfo(const edm::EventBase *)
Definition: FWMagField.cc:144
void guessField(float estimate) const
Definition: FWMagField.cc:129
void setSimpleModel(bool simpleModel)
Definition: FWMagField.h:36
double b
Definition: hdecay.h:118
void setUserField(float b)
Definition: FWMagField.h:28
void setSource(ESource x)
Definition: FWMagField.h:30
HLT enums.
bool isSimpleModel() const
Definition: FWMagField.h:37
float m_eventField
Definition: FWMagField.h:53
ESource getSource() const
Definition: FWMagField.h:31