BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
Digi.cxx
Go to the documentation of this file.
2using namespace std;
3
4
5void PrintMcInfo::printDigi(ofstream& os)
6{
7
8 os<< '\t' <<setw(40)<<"MdcDigi"<<setw(30)<<"TofDigi"<<setw(29)<<"EmcDigi"<<"MucDig"<<endl;
9 os<< '\t' <<"(layer , wire, trkIndex)"<<" "<<"(B/EC, layer, phi_module, trkIndex)"<<" "<<"(B/EC, theta, phi, trkIndex)"<<" "<<"(B/EC, segment, layer, strip, trkIndex)"<<endl;
10
11
12 SmartDataPtr<MdcDigiCol> mdcCol(eventSvc(),"/Event/Digi/MdcDigiCol");
13 SmartDataPtr<TofDigiCol> tofCol(eventSvc(),"/Event/Digi/TofDigiCol");
14 SmartDataPtr<EmcDigiCol> emcCol(eventSvc(),"/Event/Digi/EmcDigiCol");
15 SmartDataPtr<MucDigiCol> mucCol(eventSvc(),"/Event/Digi/MucDigiCol");
16
17 MdcDigiCol::const_iterator it_mdc = mdcCol->begin();
18 TofDigiCol::const_iterator it_tof = tofCol->begin();
19 EmcDigiCol::const_iterator it_emc = emcCol->begin();
20 MucDigiCol::const_iterator it_muc = mucCol->begin();
21
22 vector<MdcDigiCol::const_iterator> vmdc;
23 vector<TofDigiCol::const_iterator> vtof;
24 vector<EmcDigiCol::const_iterator> vemc;
25 vector<MucDigiCol::const_iterator> vmuc;
26
27
28 if(mdcCol->size() != 0)
29 {
30 for(;it_mdc != mdcCol->end();it_mdc++)
31 {
32 vmdc.push_back(it_mdc);
33 }
34 }
35 if(tofCol->size() != 0)
36 {
37 for(;it_tof != tofCol->end();it_tof++)
38 {
39 vtof.push_back(it_tof);
40 }
41 }
42
43 if(emcCol->size() != 0)
44 {
45 for(;it_emc != emcCol->end();it_emc++)
46 {
47 vemc.push_back(it_emc);
48 }
49 }
50
51 if(mucCol->size() != 0)
52 {
53 for(;it_muc != mucCol->end();it_muc++)
54 {
55 vmuc.push_back(it_muc);
56 }
57 }
58
59
60 for(int i=0;;i++)
61 {
62 bool bmdc=(i>vmdc.size())?true:false;
63 bool btof=(i>vtof.size())?true:false;
64 bool bemc=(i>vemc.size())?true:false;
65 bool bmuc=(i>vmuc.size())?true:false;
66 if((i>=vmdc.size())&&(i>=vtof.size())&&(i>=vemc.size())&&(i>=vmuc.size())) break;
67 for (int m = 0; m < 8; m++) os<<" ";
68 if(vmdc.size()>0)
69 {
70 if(i<vmdc.size())
71 {
72 const Identifier ident_mdc = (*vmdc[i])->identify();
73 os<<setw(6)<<MdcID::layer(ident_mdc);
74 os<<setw(6)<<MdcID::wire(ident_mdc);
75 os<<setw(15)<<(*vmdc[i])->getTrackIndex();
76 }else{for (int m = 0; m < 27; m++) os<<" ";}
77 }else{for (int m = 0; m < 27; m++) os<<" ";}
78
79
80 if(vtof.size()>0)
81 {
82 if(i<vtof.size())
83 {
84 const Identifier ident_tof =(*vtof[i])->identify();
85 if(TofID::barrel_ec(ident_tof)==1){os<<"B "<<" ";}
86 if(TofID::barrel_ec(ident_tof)==0){os<<"E_E"<<" ";}
87 if(TofID::barrel_ec(ident_tof)==2){os<<"W_E"<<" ";}
88 os<<setw(6)<<TofID::layer(ident_tof);
89 os<<setw(6)<<TofID::phi_module(ident_tof);
90 os<<setw(22)<<(*vtof[i])->getTrackIndex();
91 }else{for (int m = 0; m < 39; m++) os<<" ";}
92 }else{for (int m = 0; m < 39; m++) os<<" ";}
93
94
95 if(vemc.size()>0)
96 {
97 if(i<vemc.size())
98 {
99 const Identifier ident_emc = (*vemc[i])->identify();
100 if(EmcID::barrel_ec(ident_emc)==1){os<<"B "<<" ";}
101 if(EmcID::barrel_ec(ident_emc)==0){os<<"E_E"<<" ";}
102 if(EmcID::barrel_ec(ident_emc)==2){os<<"W_E"<<" ";}
103 os<<setw(6)<<EmcID::theta_module(ident_emc);
104 os<<setw(6)<<EmcID::phi_module(ident_emc);
105 os<<setw(12)<<(*vemc[i])->getTrackIndex();
106 }else{for (int m = 0; m < 29; m++) os<<" ";}
107 }else{for (int m = 0; m < 29; m++) os<<" ";}
108
109 if(vmuc.size()>0)
110 {
111 if(i<vmuc.size())
112 {
113 const Identifier ident_muc = (*vmuc[i])->identify();
114 if(MucID::barrel_ec(ident_muc)==1){os<<"B "<<" ";}
115 if(MucID::barrel_ec(ident_muc)==0){os<<"E_E"<<" ";}
116 if(MucID::barrel_ec(ident_muc)==2){os<<"W_E"<<" ";}
117 os<<setw(6)<<MucID::segment(ident_muc);
118 os<<setw(6)<<MucID::layer(ident_muc);
119 os<<setw(6)<<MucID::strip(ident_muc);
120 os<<setw(6)<<(*vmuc[i])->getTrackIndex();
121 os<<endl;
122 }else{ os<<endl;}
123 }else{os<<endl;}
124
125 }
126 vmdc.clear();
127 vtof.clear();
128 vemc.clear();
129 vmuc.clear();
130}
static unsigned int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0)
Definition: EmcID.cxx:38
static unsigned int theta_module(const Identifier &id)
Definition: EmcID.cxx:43
static unsigned int phi_module(const Identifier &id)
Definition: EmcID.cxx:48
static int layer(const Identifier &id)
Values of different levels (failure returns 0)
Definition: MdcID.cxx:49
static int wire(const Identifier &id)
Definition: MdcID.cxx:54
static int barrel_ec(const Identifier &id)
Values of different levels.
Definition: MucID.cxx:41
static int layer(const Identifier &id)
Definition: MucID.cxx:61
static int segment(const Identifier &id)
Definition: MucID.cxx:51
static int strip(const Identifier &id)
Definition: MucID.cxx:76
void printDigi(ofstream &)
Definition: Digi.cxx:5
static int phi_module(const Identifier &id)
Definition: TofID.cxx:73
static int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0)
Definition: TofID.cxx:61
static int layer(const Identifier &id)
Definition: TofID.cxx:66