CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  virtual ~FWMagField();
24 
25  // get field values
26  virtual TEveVector GetField(Float_t x, Float_t y, Float_t z) const;
27  virtual Float_t GetMaxFieldMag() const;
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&); // stop default
51  const FWMagField& operator=(const FWMagField&); // 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
Float_t GetFieldMag() const
Definition: FWMagField.cc:85
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
virtual TEveVector GetField(Float_t x, Float_t y, Float_t z) const
Definition: FWMagField.cc:40
bool m_reverse
Definition: FWMagField.h:57
bool m_updateFieldEstimate
Definition: FWMagField.h:64
TH1F * m_guessValHist
Definition: FWMagField.h:61
float float float z
void setFFFieldMag(float)
Definition: FWMagField.cc:229
ESource m_source
Definition: FWMagField.h:53
void guessField(float estimate) const
Definition: FWMagField.cc:155
float m_userField
Definition: FWMagField.h:54
ESource getSource() const
Definition: FWMagField.h:33
void checkFieldInfo(const edm::EventBase *)
Definition: FWMagField.cc:172
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
const FWMagField & operator=(const FWMagField &)
float m_eventField
Definition: FWMagField.h:55
void guessFieldIsOn(bool guess) const
Definition: FWMagField.cc:148
Definition: DDAxes.h:10
virtual Float_t GetMaxFieldMag() const
Definition: FWMagField.cc:136
void resetFieldEstimate() const
Definition: FWMagField.cc:162
virtual ~FWMagField()
Definition: FWMagField.cc:32
bool isSimpleModel() const
Definition: FWMagField.h:39