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
34  void setReverseState(bool state) { m_reverse = state; }
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 private:
48  FWMagField(const FWMagField&) = delete; // stop default
49  const FWMagField& operator=(const FWMagField&) = delete; // stop default
50 
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
FWMagField::m_userField
float m_userField
Definition: FWMagField.h:52
DDAxes::y
FWMagField::guessField
void guessField(float estimate) const
Definition: FWMagField.cc:129
FWMagField::GetFieldMag
Float_t GetFieldMag() const
Definition: FWMagField.cc:73
FWMagField::kNone
Definition: FWMagField.h:18
FWMagField::setUserField
void setUserField(float b)
Definition: FWMagField.h:28
FWMagField::setSimpleModel
void setSimpleModel(bool simpleModel)
Definition: FWMagField.h:36
FWMagField::setSource
void setSource(ESource x)
Definition: FWMagField.h:30
edm
HLT enums.
Definition: AlignableModifier.h:19
FWMagField::isSimpleModel
bool isSimpleModel() const
Definition: FWMagField.h:37
FWMagField::FWMagField
FWMagField()
Definition: FWMagField.cc:11
DDAxes::x
FWMagField::checkFieldInfo
void checkFieldInfo(const edm::EventBase *)
Definition: FWMagField.cc:144
FWMagField::ESource
ESource
Definition: FWMagField.h:18
FWMagField::m_eventField
float m_eventField
Definition: FWMagField.h:53
FWMagField::m_numberOfFieldEstimates
int m_numberOfFieldEstimates
Definition: FWMagField.h:61
FWMagField
Definition: FWMagField.h:14
DDAxes::z
FWMagField::getSource
ESource getSource() const
Definition: FWMagField.h:31
b
double b
Definition: hdecay.h:118
FWMagField::GetField
TEveVector GetField(Float_t x, Float_t y, Float_t z) const override
Definition: FWMagField.cc:34
FWMagField::setReverseState
void setReverseState(bool state)
Definition: FWMagField.h:34
FWMagField::resetFieldEstimate
void resetFieldEstimate() const
Definition: FWMagField.cc:135
FWMagField::kEvent
Definition: FWMagField.h:18
FWMagField::m_numberOfFieldIsOnEstimates
int m_numberOfFieldIsOnEstimates
Definition: FWMagField.h:60
FWMagField::m_simpleModel
bool m_simpleModel
Definition: FWMagField.h:56
FWMagField::m_guessedField
float m_guessedField
Definition: FWMagField.h:63
FWMagField::m_source
ESource m_source
Definition: FWMagField.h:51
FWMagField::guessFieldIsOn
void guessFieldIsOn(bool guess) const
Definition: FWMagField.cc:122
FWMagField::getUserField
float getUserField() const
Definition: FWMagField.h:29
FWMagField::~FWMagField
~FWMagField() override
Definition: FWMagField.cc:30
edm::EventBase
Definition: EventBase.h:46
EventBase
FWMagField::m_updateFieldEstimate
bool m_updateFieldEstimate
Definition: FWMagField.h:62
FWMagField::setFFFieldMag
void setFFFieldMag(float)
Definition: FWMagField.cc:190
FWMagField::operator=
const FWMagField & operator=(const FWMagField &)=delete
FWMagField::kUser
Definition: FWMagField.h:18
mps_check.guess
string guess
Definition: mps_check.py:394
FWMagField::m_reverse
bool m_reverse
Definition: FWMagField.h:55
FWMagField::GetMaxFieldMag
Float_t GetMaxFieldMag() const override
Definition: FWMagField.cc:111
FWMagField::m_guessValHist
TH1F * m_guessValHist
Definition: FWMagField.h:59
FWMagField::isReverse
bool isReverse() const
Definition: FWMagField.h:35