Class Reference for E1039 Core & Analysis Software
AnaSortMixVertex.h
Go to the documentation of this file.
1 #ifndef _ANA_SortMixVertex__H_
2 #define _ANA_SortMixVertex__H_
3 #include <fstream>
4 #include <ktracker/SRawEvent.h>
5 #include <ktracker/SRecEvent.h>
9 #include <ktracker/GFField.h>
10 #include <ktracker/GFTrack.h>
11 
12 class TFile;
13 class TTree;
14 class SRecTrack;
15 class SQEvent;
16 class SQHitVector;
17 
18 /*struct SRecDimuonData {
19  int trk_id_pos;
20  int trk_id_neg;
21  std::string origin;
22  TVector3 pos;
23  TLorentzVector mom;
24  TLorentzVector mom_pos;
25  TLorentzVector mom_neg;
26  double mass;
27  double pT;
28  double x1;
29  double x2;
30  double xF;
31  double costh;
32  double phi;
33 
34  SRecDimuonData();
35  virtual ~SRecDimuonData() {;}
36 
37  ClassDef(SRecDimuonData, 1);
38 
39 };*/
40 
43 {
45  std::string m_name;
46  std::string m_dir_out;
47  //std::string geom_file_name;
48  std::string m_ds;
49  int m_run_id;
50  bool m_use_raw;
51  bool m_use_rec;
52  unsigned int m_n_evt_max;
53  int m_verb;
55  SRawEvent* m_raw;
56  SRecEvent* m_rec;
57  SQEvent* sq_evt;
58  SQHitVector* sq_htvec;
60  std::ofstream m_ofs;
61  TFile* m_file_out;
62 
63  //bool dumpfit;
64  //int m_target_id;
65 
66  public:
67  virtual ~AnaSortMixVertex();
68  virtual void Init(const int run_id);
69  virtual void End();
70  virtual void Analyze(const int run_id, const std::vector<std::string> list_in);
71  AnaSortMixVertex(const std::string name="ana_mixvertex");
72 
73 
74  virtual void SortTree(TTree* tree_to_sort);
75  virtual void MixTracks(TTree* sorted_tree);
76  virtual void DoVertex(TTree* inputtree, const int run_id, bool mix);
77  bool Target_Like(SRecTrack* trk_pos, SRecTrack* trk_neg);
78  bool Dump_Like(SRecTrack* trk_pos, SRecTrack* trk_neg);
79  bool UpStream_Like(SRecTrack* trk_pos, SRecTrack* trk_neg);
80  //virtual void PrepareMC(char* file_mctree);
81  virtual void EmbedMCSignal( char *file_mixed, char* file_mcsignal);
82  void SetTargetPos( const int target_pos){m_target_pos = target_pos;}
83 
85  std::string Name() const { return m_name; }
87  void SetOutputDir(const std::string dir_out) { m_dir_out = dir_out; }
89  void SetOutputDir(const int dir_out) { m_dir_out = std::to_string(dir_out); }
91  std::string GetOutputDir() const { return m_dir_out; }
92  void SetDataset(const std::string ds) { m_ds = ds; }
93  std::string GetDataset() const { return m_ds; }
94  void SetRunID(const int run_id) { m_run_id = run_id; }
95  int GetRunID() const { return m_run_id; }
96  void UseRawEvent(const bool value) { m_use_raw = value; }
97  void UseRecEvent(const bool value) { m_use_rec = value; }
99  void SetNumEventsAnalyzed(const unsigned int n_evt) { m_n_evt_max = n_evt; }
100  void Verbosity(const int verb) { m_verb = verb; }
101  int Verbosity() const { return m_verb; }
103  std::ofstream& OFS() { return m_ofs; }
105  TFile* OFile() { return m_file_out; }
106 
107 
108  protected:
109  SRawEvent* GetRawEvent() { return m_raw; }
110  SRecEvent* GetRecEvent() { return m_rec; }
111 
112  TTree* ana_tree;
113  TTree* sorted_tree;
114  TTree* mixed_tree;
115  TTree* save_sorted;
116  TTree* save_mix;
117 
118 
122 
123  //int rfp00; ///< RF+00
124  float rfp00c;
125  float pot_p00;
126  float liveP; //Live PoT
127 
128  int DimMult;
133 
134  std::vector<SRecTrack> pos_tracks, neg_tracks;
135  std::vector<SRecTrack> pos_tracks_mix, neg_tracks_mix;
141 
144 
147 
148 
149 };
150 #endif // _ANA_VERTEXFIT__H_
Base class of all analysis modules.
float liveP
proton number corrsponding to RF+00 (pedestal corrected)
void SetNumEventsAnalyzed(const unsigned int n_evt)
Set the max number of events to be analyzed per run.
std::string GetOutputDir() const
Get the output directory.
std::vector< SRecTrack > pos_tracks_mix
void SetOutputDir(const std::string dir_out)
Set the output directory.
std::ofstream & OFS()
Get the ofstream object for output. Usable in Init(), AnalyzeEvent() and End() of each analysis modul...
AnaSortMixVertex(const std::string name="ana_mixvertex")
void Verbosity(const int verb)
Set the verbosity.
SRecEvent * GetRecEvent()
Get a pointer to SRecEvent. Usable in AnalyzeEvent().
void UseRawEvent(const bool value)
Turn on/off the use of SRawEvent.
int Verbosity() const
std::string Name() const
Get the name of analysis module.
void SetDataset(const std::string ds)
Set the dataset to be analyzed.
void UseRecEvent(const bool value)
virtual void End()
virtual void Init(const int run_id)
Function to initialize all variables for the 1st analysis step.
bool Dump_Like(SRecTrack *trk_pos, SRecTrack *trk_neg)
virtual void DoVertex(TTree *inputtree, const int run_id, bool mix)
std::vector< SRecTrack > neg_tracks_mix
SQGenFit::GFField * gfield_v2
SRawEvent * GetRawEvent()
Get a pointer to SRawEvent. Usable in AnalyzeEvent().
SRecEvent * recEvent_upstream_like
virtual void MixTracks(TTree *sorted_tree)
Mixing tracks from sorted_tree.
void SetRunID(const int run_id)
Set the run ID to be analyzed.
bool Target_Like(SRecTrack *trk_pos, SRecTrack *trk_neg)
bool UpStream_Like(SRecTrack *trk_pos, SRecTrack *trk_neg)
std::vector< SRecTrack > pos_tracks
void SetOutputDir(const int dir_out)
Set the output directory using the given integer (usually run ID).
virtual ~AnaSortMixVertex()
SRecEvent * recEvent_dump_like
int GetRunID() const
Get the run ID to be analyzed.
virtual void Analyze(const int run_id, const std::vector< std::string > list_in)
float rfp00c
RF+00 corrected for the pedestal.
SRecEvent * recEvent_target_like
void SetTargetPos(const int target_pos)
std::string GetDataset() const
Get the dataset to be analyzed.
SRecEvent * recEvent
std::vector< SRecTrack > neg_tracks
virtual void SortTree(TTree *tree_to_sort)
TFile * OFile()
Get the TFile object for output. Usable in Init(), AnalyzeEvent() and End() of each analysis module.
virtual void EmbedMCSignal(char *file_mixed, char *file_mcsignal)
MC preperation for embedding.
An SQ interface class to hold one event header.
Definition: SQEvent.h:17
An SQ interface class to hold a list of SQHit objects.
Definition: SQHitVector.h:32