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 {
12  class EventBase;
13 }
14 
15 class FWMagField: public TEveMagField
16 {
17  Float_t GetFieldMag() const;
18 
19 public:
20  enum ESource { kNone, kEvent, kUser };
21 
22  FWMagField();
23  ~FWMagField() override;
24 
25  // get field values
26  TEveVector GetField(Float_t x, Float_t y, Float_t z) const override;
27  Float_t GetMaxFieldMag() const override;
28 
29  // auto/user behaviour
30  void setUserField(float b) { m_userField = b; }
31  float getUserField() const { return m_userField; }
32  void setSource(ESource x) { m_source = x; }
33  ESource getSource() const { return m_source; }
34 
35  // field model
36  void setReverseState( bool state ){ m_reverse = state; }
37  bool isReverse() const { return m_reverse;}
38  void setSimpleModel( bool simpleModel ){ m_simpleModel = simpleModel; }
39  bool isSimpleModel() const { return m_simpleModel;}
40 
41  // field estimate
42  void guessFieldIsOn( bool guess ) const;
43  void guessField( float estimate ) const;
44  void resetFieldEstimate() const;
45 
46  void checkFieldInfo(const edm::EventBase*);
47  void setFFFieldMag(float);
48 
49 private:
50  FWMagField(const FWMagField&) = delete; // stop default
51  const FWMagField& operator=(const FWMagField&) = delete; // stop default
52 
54  float m_userField;
55  float m_eventField;
56 
57  bool m_reverse;
59 
60  // runtime estimate , have to be mutable becuse of GetField() is const
61  mutable TH1F *m_guessValHist;
64  mutable bool m_updateFieldEstimate;
65  mutable float m_guessedField;
66 };
67 
68 #endif
int m_numberOfFieldEstimates
Definition: FWMagField.h:63
float getUserField() const
Definition: FWMagField.h:31
int m_numberOfFieldIsOnEstimates
Definition: FWMagField.h:62
void setReverseState(bool state)
Definition: FWMagField.h:36
bool isReverse() const
Definition: FWMagField.h:37
bool m_simpleModel
Definition: FWMagField.h:58
float m_guessedField
Definition: FWMagField.h:65
bool m_reverse
Definition: FWMagField.h:57
bool m_updateFieldEstimate
Definition: FWMagField.h:64
TH1F * m_guessValHist
Definition: FWMagField.h:61
ESource m_source
Definition: FWMagField.h:53
float m_userField
Definition: FWMagField.h:54
ESource getSource() const
Definition: FWMagField.h:33
string guess
Definition: mps_check.py:387
void setSimpleModel(bool simpleModel)
Definition: FWMagField.h:38
double b
Definition: hdecay.h:120
void setUserField(float b)
Definition: FWMagField.h:30
void setSource(ESource x)
Definition: FWMagField.h:32
HLT enums.
float m_eventField
Definition: FWMagField.h:55
bool isSimpleModel() const
Definition: FWMagField.h:39