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