Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef _TRACKEXTRAPOLATING_ALG_H
#define _TRACKEXTRAPOLATING_ALG_H
#include "CyberDataCol.h"
#include "Tools/Algorithm.h"
#include "Objects/Track.h"
using namespace Cyber;
class TrackExtrapolatingAlg: public Cyber::Algorithm{
public:
TrackExtrapolatingAlg(){};
~TrackExtrapolatingAlg(){};
class Factory : public Cyber::AlgorithmFactory
{
public:
Cyber::Algorithm* CreateAlgorithm() const{ return new TrackExtrapolatingAlg(); }
};
StatusCode ReadSettings(Cyber::Settings& m_settings);
StatusCode Initialize( CyberDataCol& m_datacol );
StatusCode RunAlgorithm( CyberDataCol& m_datacol );
StatusCode ClearAlgorithm();
// Get points in each plane of layer
StatusCode GetLayerRadius(std::vector<float> & ECAL_layer_radius, std::vector<float> & HCAL_layer_radius);
// If the track reach barrel ECAL
bool IsReachECAL(Cyber::Track * track);
// Get track state at calorimeter
StatusCode GetTrackStateAtCalo(Cyber::Track * track,
Cyber::TrackState & trk_state_at_calo);
// get extrapolated points
StatusCode ExtrapolateByRadius( const std::vector<float> & ECAL_layer_radius, std::vector<float> & HCAL_layer_radius,
const Cyber::TrackState & CALO_trk_state, Cyber::Track* p_track);
// Get the radius rho
float GetRho(const Cyber::TrackState & trk_state);
// Get coordinates of the center of the circle
TVector2 GetCenterOfCircle(const Cyber::TrackState & trk_state, const float & rho);
// phase from center to reference point
float GetRefAlpha0(const Cyber::TrackState & trk_state, const TVector2 & center);
// If the charged particle return back
bool IsReturn(float rho, TVector2 & center);
std::vector<float> GetDeltaPhi(float rho, TVector2 center, float alpha0, vector<float> layer_radius, const Cyber::TrackState & CALO_trk_state);
std::vector<TVector3> GetExtrapoPoints(std::string calo_name,
float rho, TVector2 center, float alpha0,
const Cyber::TrackState & CALO_trk_state,
const std::vector<float>& delta_phi);
// Get phi0 of extrapolated points. Note that this phi0 is not same as the definition of the phi0 in TrackState, but will be stored in TrackState
float GetExtrapolatedPhi0(float Kappa, float ECAL_phi0, TVector2 center, TVector3 ext_point);
// To sort the extrapolatedpoints, define the following comparison function
static bool SortByPhi0(const Cyber::TrackState& trk_state1, const Cyber::TrackState& trk_state2 )
{ return TMath::Abs(trk_state1.phi0) < TMath::Abs(trk_state2.phi0); }
private:
};
#endif