CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
ReadCosmicRayData.h
Go to the documentation of this file.
1#ifndef READCOSMICRAYDATAALG
2#define READCOSMICRAYDATAALG
3
4#include "CgemGeomSvc.h"
7#include <vector>
8#include <string>
9#include "TFile.h"
10#include "TTree.h"
11#include "TFileCollection.h"
12#include "TChain.h"
13#include "TString.h"
15
16
17class IDataProviderSvc;
18
19#define MAXNOFHITS 2400
20
21class ReadCosmicRayData : public Algorithm{
22public:
23 // Constructor
24 ReadCosmicRayData(const std::string& name, ISvcLocator* pSvcLocator);
26 // Executable
27 StatusCode initialize();
28 StatusCode execute ();
29 StatusCode finalize ();
30
31private:
32 // Read the data from a given root file, and save them as a BOSS Cgem Digit object
33 void ReadCgemDigits();
34 void SaveCgemDigits();
35 // Read the data from a given root file, and save them as a BOSS Cgem Cluster object
36 void ReadCgemClusters();
37 void SaveCgemClusters();
38 // Translators for possible different ID definitions
39 int TranslateDigitLayerID(int Input_LayerID);
40 int TranslateDigitSheetID(int Input_SheetID);
41 int TranslateDigitStripType(int Input_StripType);
42 int TranslateDigitStripID(int Input_StripID, int StripType);
43 int TranslateDigitXStripID(int Input_StripID);
44 int TranslateDigitVStripID(int Input_StripID);
45
46 int TranslateClusterLayerID(int Input_LayerID);
47 int TranslateClusterSheetID(int Input_SheetID);
48 int TranslateClusterFlag(int Input_Flag);
49 double TranslateRecPhi(double Input_RecPhi);
50 double TranslateRecV(double Input_RecV);
51 double TranslateRecZ(double Input_RecZ);
52
53 bool ConvertHitToDigi(int ihit, unsigned int &charge_channel, unsigned int &time_channel);
54private:
55 // Specify the location of the input file
56 string Dir_file;
57 // Specify the name of the tree that records the digit information
58 string TreeDigi;
59 // Specify the name of the tree that records the cluster information
60 string TreeCluster;
61 // A switch of reading digit information
62 bool ReadDigi;
63 // A switch of reading cluster information
64 bool ReadCluster;
65 // A flag of successful reading digit information
66 bool finish_read_digi;
67 // A flag of successful reading cluster information
68 bool finish_read_cluster;
69 // A switch to cut on tpc information
70 bool Cut_on_tpc;
71
72 // run number
73 int m_runNo;
74
75
76
77 // The values to translate the IDs
78 int Shift_DigitLayerID ;
79 int Shift_DigitSheetID ;
80 int Shift_DigitXStripID ;
81 int Shift_DigitVStripID ;
82 int Shift_ClusterLayerID ;
83 int Shift_ClusterSheetID ;
84 double Shift_RecPhi ;
85 double Shift_RecV ;
86 double Shift_RecZ ;
87
88 int DigiSheetID ;
89 int ClusterSheetID ;
90 double ClusterRecZ ;
91 double R_Cluster ;
92
93 // specify the set of the data taken
94 string CosmicRayDataSetID;
95
96 // The pointer of the input file
97 TFile *f;
98 // The pointer of the tree records digit information
99 TChain *Tdigi;
100 // The pointer of the tree records cluster information
101 TTree *Tcluster;
102 //TChain *Tcluster;
103
104 // The variables of digit information
105 int No_Entries_D;
106 int Ind_Entry_D;
107 int m_Event_D;
108 int m_nGemHit;
109 double m_charge[MAXNOFHITS];
110 double m_time[MAXNOFHITS];
111 int m_LayerID[MAXNOFHITS];
112 int m_SheetID[MAXNOFHITS];
113 int m_StripType[MAXNOFHITS];
114 int m_StripID[MAXNOFHITS];
115 bool m_GemHit_is_tpc[MAXNOFHITS];
116
117 int m_channel[MAXNOFHITS];
118 int m_ROC[MAXNOFHITS];
119 int m_chip[MAXNOFHITS];
120 int m_FEB[MAXNOFHITS];
121 int m_plane[MAXNOFHITS];
122 int m_sheet[MAXNOFHITS];
123 int m_view[MAXNOFHITS];
124 int m_strip[MAXNOFHITS];
125 bool m_saturated[MAXNOFHITS];
126 //++++++++++++++++++++++++++++++++++
127
128 // The variables of cluster information
129 int No_Entries_C;
130 int Ind_Entry_C;
131 int m_Event_C;
132 int m_nGemCluster;
133
134 int m_ClusterHitIndex[70][30];
135 int m_ClusternHit[70];
136 int m_ClusterLayerID[70];
137 int m_ClusterSheetID[70];
138 int m_Flag[70];
139 int m_ClusterFlagB[70];
140 int m_ClusterFlagE[70];
141 double m_EnergyDeposit[70];
142 double m_Cluster_x[70];
143 double m_Cluster_z[70];
144 double m_Cluster_x_cc[70];
145 double m_Cluster_x_tpc[70];
146 double m_Cluster_z_cc[70];
147 double m_Cluster_z_tpc[70];
148 double m_RecPhi[70];
149 double m_RecV[70];
150 double m_RecZ[70];
151
152 // A data server
153 IDataProviderSvc* m_evtSvc;
154
155};
156#endif
#define MAXNOFHITS
ReadCosmicRayData(const std::string &name, ISvcLocator *pSvcLocator)