hpstr
The Heavy Photon Search Toolkit for Reconstruction (hpstr) provides an interface to physics data from the HPS experiment saved in the LCIO format and converts it into an ROOT based format.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TridentHistos.h
Go to the documentation of this file.
1#ifndef TRIDENTHISTOS_H
2#define TRIDENTHISTOS_H
3
4#include "HistoManager.h"
5#include "Track.h"
6#include "TrackerHit.h"
7#include "RawSvtHit.h"
8#include "CalCluster.h"
9#include "Vertex.h"
10#include "Particle.h"
11#include <string>
12#include <vector>
13
15
16 public:
17
18 TridentHistos(const std::string& inputName) :
19 HistoManager(inputName)
20 {
21 m_name = inputName;
22 BuildAxes();
23 }
24
25 virtual void Define3DHistos(){};
26 virtual void Define2DHistos();
27 void DefineHistos();
28 void saveHistos(TFile* outF,std::string folder);
29 void AssignLayerCode(Track* ele_trk, Track* pos_trk);
30 std::string getLayerCodeFromHistoName(std::string name);
31 bool isLayerCode(std::string histoName, int nLayers, int ptr );
32 void setOutputDir(TFile* outF, std::string folder, std::string histoName);
33 std::string getLayerCodeFromTrack(Track* trk);
34 std::string splitByElePosLayerCombos(std::string histoName);
35 void BuildAxes();
36
37 void Fill1DTrack(Track* track, double trkTimeOffset,float weight = 1., const std::string& trkname = "");
38 void Fill2DTrack(Track* track,float weight = 1., const std::string& trkname = "");
39
40 //This should probably go somewhere else
41 void FillResidualHistograms(Track* track, int ly, double res, double sigma);
42
43 void Fill1DVertex(Vertex* vtx, float weight = 1.);
44
45 //TODO Change this
46 void Fill1DVertex(Vertex* vtx, Particle* ele, Particle* pos, Track* ele_trk, Track* pos_trk, double trkTimeOffset,float weight = 1.);
47
48 void Fill1DHistograms(Track* track = nullptr, Vertex* vtx = nullptr, float weight = 1.);
49 void Fill2DHistograms(Vertex* vtx = nullptr, float weight = 1.);
50
51 //Truth comparison
52 void Fill1DTrackTruth(Track* track, Track* truth_track, float weight=1.,const std::string& ="");
53 std::pair<CalCluster*, Track*> getTrackClusterPair(Track* trk,std::vector<CalCluster*>& clusters, float weight);
54 //track_x goes for x axis, and y for y axis
55 void FillTrackComparisonHistograms(Track* track_x, Track* track_y, float weight = 1.);
56 void doTrackComparisonPlots(bool doplots) {doTrkCompPlots = doplots;};
57 // void FillTrackClusterHistos(std::pair<CalCluster, Track*> ele, std::pair<CalCluster, Track*> posOrGamma, double calTimeOffset, double trkTimeOffset,std::vector<CalCluster*> * clusterList, double weight);
58 void FillTrackClusterHistos(std::pair<CalCluster, Track*> ele,
59 std::pair<CalCluster, Track*> posOrGamma, double calTimeOffset,
60 double trkTimeOffset,double weight);
61 void FillWABHistos(std::pair<CalCluster*, Track*> ele, CalCluster* gamma, double weight);
62 void setBeamEnergy(double ebeam){eBeam_=ebeam;};
63private:
64
65 // Vertices
66 std::vector<std::string> vPs{"vtx_chi2", "vtx_X", "vtx_Y", "vtx_Z", "vtx_sigma_X","vtx_sigma_Y","vtx_sigma_Z","vtx_InvM","vtx_InvMErr"};
67 std::string layerCode;
68
69 bool doTrkCompPlots{false};
70
71 //histogram template splitting
72 virtual void DefineHistosFromTemplateOnly(std::vector<std::string> histoCopyNames,
73 std::string makeCopyJsonTag = "default=single_copy");
74 virtual void DefineOneTimeHistos();
75 double eBeam_;
76 double stdBeamEnergy_=4.5; // GeV...use this to shift PSums from different beam energies in order to compare...
77
78};
79
80#endif //TRACKHISTOS_H
Class used to encapsulate information about a particle.
Class used to encapsulate raw svt hit information.
Class used to encapsulate track information.
Class used to encapsulate tracker hit information.
Class used to encapsulate Vertex information.
description
std::string m_name
description
Definition Track.h:32
std::pair< CalCluster *, Track * > getTrackClusterPair(Track *trk, std::vector< CalCluster * > &clusters, float weight)
void DefineHistos()
Definition of histograms from json config.
virtual void Define3DHistos()
define additional 3D histo by hand
void Fill1DTrack(Track *track, double trkTimeOffset, float weight=1., const std::string &trkname="")
void saveHistos(TFile *outF, std::string folder)
save histograms
TridentHistos(const std::string &inputName)
void FillTrackComparisonHistograms(Track *track_x, Track *track_y, float weight=1.)
std::string layerCode
void Fill2DTrack(Track *track, float weight=1., const std::string &trkname="")
double stdBeamEnergy_
void FillResidualHistograms(Track *track, int ly, double res, double sigma)
virtual void DefineHistosFromTemplateOnly(std::vector< std::string > histoCopyNames, std::string makeCopyJsonTag="default=single_copy")
void Fill1DHistograms(Track *track=nullptr, Vertex *vtx=nullptr, float weight=1.)
void Fill1DVertex(Vertex *vtx, float weight=1.)
void doTrackComparisonPlots(bool doplots)
void FillWABHistos(std::pair< CalCluster *, Track * > ele, CalCluster *gamma, double weight)
virtual void Define2DHistos()
define additional 2D histo by hand
void Fill1DTrackTruth(Track *track, Track *truth_track, float weight=1., const std::string &="")
virtual void DefineOneTimeHistos()
std::string getLayerCodeFromTrack(Track *trk)
void Fill2DHistograms(Vertex *vtx=nullptr, float weight=1.)
std::vector< std::string > vPs
void FillTrackClusterHistos(std::pair< CalCluster, Track * > ele, std::pair< CalCluster, Track * > posOrGamma, double calTimeOffset, double trkTimeOffset, double weight)
void setOutputDir(TFile *outF, std::string folder, std::string histoName)
void AssignLayerCode(Track *ele_trk, Track *pos_trk)
void setBeamEnergy(double ebeam)
bool isLayerCode(std::string histoName, int nLayers, int ptr)
std::string splitByElePosLayerCombos(std::string histoName)
std::string getLayerCodeFromHistoName(std::string name)