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