Demonstrates usage of TEveTrackPRopagator with different magnetic field configurations.
Needs to be run in compiled mode. root
void track(Int_t mode = 5, Bool_t isRungeKutta = kTRUE) Modes are 0. B = 0, no difference btween signed and charge particles;
#include <iostream>
{
public:
~GappedField(){};
{
}
};
{
bool m_magnetIsOn;
bool m_reverse;
bool m_simpleModel;
public:
CmsMagField():
m_magnetIsOn(true),
m_reverse(false),
m_simpleModel(true){}
virtual ~CmsMagField(){}
virtual Double_t GetMaxFieldMagD()
const {
return m_magnetIsOn ? 3.8 : 0.0; }
void setMagnetState( bool state )
{
if (state != m_magnetIsOn)
{
if ( state )
std::cout << "Magnet state is changed to ON" << std::endl;
else
std::cout << "Magnet state is changed to OFF" << std::endl;
}
m_magnetIsOn = state;
}
bool isMagnetOn() const { return m_magnetIsOn;}
void setReverseState(bool state) { m_reverse = state; }
bool isReverse() const { return m_reverse;}
void setSimpleModel(bool simpleModel) { m_simpleModel = simpleModel; }
bool isSimpleModel() const { return m_simpleModel;}
{
double R =
sqrt(x*x+y*y);
double field = m_reverse?-GetMaxFieldMag():GetMaxFieldMag();
{
if ( m_simpleModel ||
( R>461.0 && R<490.5 ) ||
( R>534.5 && R<597.5 ) ||
( R>637.0 && R<700.0 ) )
} else {
if (m_simpleModel)
{
if ( z > 0 )
return TEveVectorD(x/R*field/3.8*2.0, y/R*field/3.8*2.0, 0);
else
return TEveVectorD(-x/R*field/3.8*2.0, -y/R*field/3.8*2.0, 0);
}
{
if ( z > 0 )
return TEveVectorD(x/R*field/3.8*2.0, y/R*field/3.8*2.0, 0);
else
return TEveVectorD(-x/R*field/3.8*2.0, -y/R*field/3.8*2.0, 0);
}
}
}
};
{
rc->
fV.Set(0.028558, -0.000918, 3.691919);
rc->
fP.Set(0.767095, -2.400006, -0.313103);
pm1->
fV.Set(1.479084, -4.370661, 3.119761);
pm2->
fV.Set(57.72345, -89.77011, -9.783746);
return track;
}
{
if (isRungeKutta)
{
}
else
{
}
switch (mode)
{
case 0:
{
track = make_track(prop, 1);
break;
}
case 1:
{
track = make_track(prop, 1);
break;
}
case 2:
{
track = make_track(prop, 1);
break;
}
case 3:
{
rc->
fV.Set(0.028558, -0.000918, 3.691919);
rc->
fP.Set(0.767095, -0.400006, 2.313103);
break;
}
case 4:
{
CmsMagField* mf = new CmsMagField;
mf->setReverseState(true);
rc->
fV.Set(0.027667, 0.007919, 0.895964);
rc->
fP.Set(3.903134, 2.252232, -3.731366);
break;
}
case 5:
{
CmsMagField* mf = new CmsMagField;
mf->setReverseState(true);
mf->setSimpleModel(false);
rc->
fV.Set(-16.426592, 16.403185, -19.782692);
rc->
fP.Set(3.631100, 3.643450, 0.682254);
break;
}
case 6:
{
rc->
fV.Set(57.1068, 31.2401, -7.07629);
rc->
fP.Set(4.82895, 2.35083, -0.611757);
break;
}
};
if (isRungeKutta)
else
}
#endif