CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
Cgem/ReadCosmicRayData/bak_ReadCosmicRayData-00-00-04/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 // The values to translate the IDs
70 int Shift_DigitLayerID ;
71 int Shift_DigitSheetID ;
72 int Shift_DigitXStripID ;
73 int Shift_DigitVStripID ;
74 int Shift_ClusterLayerID ;
75 int Shift_ClusterSheetID ;
76 double Shift_RecPhi ;
77 double Shift_RecV ;
78 double Shift_RecZ ;
79
80 int DigiSheetID ;
81 int ClusterSheetID ;
82 double ClusterRecZ ;
83 double R_Cluster ;
84
85 // specify the set of the data taken
86 string CosmicRayDataSetID;
87
88 // The pointer of the input file
89 TFile *f;
90 // The pointer of the tree records digit information
91 TTree *Tdigi;
92 // The pointer of the tree records cluster information
93 TTree *Tcluster;
94
95 // The variables of digit information
96 int No_Entries_D;
97 int Ind_Entry_D;
98 int m_Event_D;
99 int m_nGemHit;
100 double m_charge[MAXNOFHITS];
101 double m_time[MAXNOFHITS];
102 int m_LayerID[MAXNOFHITS];
103 int m_SheetID[MAXNOFHITS];
104 int m_StripType[MAXNOFHITS];
105 int m_StripID[MAXNOFHITS];
106 bool m_GemHit_is_tpc[MAXNOFHITS];
107
108 int m_channel[MAXNOFHITS];
109 int m_ROC[MAXNOFHITS];
110 int m_chip[MAXNOFHITS];
111 int m_FEB[MAXNOFHITS];
112 int m_plane[MAXNOFHITS];
113 int m_view[MAXNOFHITS];
114 int m_strip[MAXNOFHITS];
115 bool m_saturated[MAXNOFHITS];
116 //++++++++++++++++++++++++++++++++++
117
118 // The variables of cluster information
119 int No_Entries_C;
120 int Ind_Entry_C;
121 int m_Event_C;
122 int m_nGemCluster;
123
124 int m_ClusterHitIndex[70][30];
125 int m_ClusternHit[70];
126 int m_ClusterLayerID[70];
127 int m_ClusterSheetID[70];
128 int m_Flag[70];
129 int m_ClusterFlagB[70];
130 int m_ClusterFlagE[70];
131 double m_EnergyDeposit[70];
132 double m_Cluster_x[70];
133 double m_Cluster_z[70];
134 double m_Cluster_x_cc[70];
135 double m_Cluster_x_tpc[70];
136 double m_Cluster_z_cc[70];
137 double m_Cluster_z_tpc[70];
138 double m_RecPhi[70];
139 double m_RecV[70];
140 double m_RecZ[70];
141
142 // A data server
143 IDataProviderSvc* m_evtSvc;
144
145};
146#endif