59{
60
61 double tot_adc = 0.;
62 double adc = 0., adc1 = 0., tdc = 0.;
63 unsigned int measure;
64
65 for(int i=0;i<TrigConf::TCTHETANO_B;i++)
66 for(int j=0;j<TrigConf::TCPHINO_B;j++) {
67 BTCEnergy[i][j] = 0;
68 BTCEnergy_adc[i][j] = 0;
69 }
70 for(int i=0;i<TrigConf::TCTHETANO_E;i++)
71 for(int j=0;j<TrigConf::TCPHINO_E;j++)
72 {
73 EETCEnergy[i][j] = 0;
74 WETCEnergy[i][j] = 0;
75 EETCEnergy_adc[i][j] = 0;
76 WETCEnergy_adc[i][j] = 0;
77 }
78 EmcDigiCol::iterator iter3;
79 Identifier id;
80 for (iter3=emcDigiCol->begin();iter3!= emcDigiCol->end();iter3++) {
81 id=(*iter3)->identify();
82
83 unsigned int module;
84 unsigned int theta;
85 unsigned int phi;
86 module = EmcID::barrel_ec(id);
89 adc = double ((*iter3)->getChargeChannel());
90 adc1 = double ((*iter3)->getChargeChannel());
91 measure = (*iter3)->getMeasure();
92 tdc = (*iter3)->getTimeChannel();
93
94 int index = emcCalibConstSvc->getIndex(module,theta,phi);
95
96
97 double trgGain = m_RealizationSvc->getTrgGain(index);
98 std::cout <<"partId, thetaId, phiId, trgGain: " << module << ", " << theta << ", " << phi << ", " << trgGain << std::endl;
99
100
101
102 if((*iter3)->getMeasure()==0) adc = adc*2*800.*2/65535.*(trgGain);
103 else if((*iter3)->getMeasure()==1) adc = adc*16*800.*2/65535*(trgGain);
104 else adc = adc*64*800.*2/65535*(trgGain);
105
106
107
108
109
110
111
112
113
114
115
118
119 if(module==1) BTCEnergy[TCThetaId][TCPhiId] += adc;
120 if(module==0) EETCEnergy[TCThetaId][TCPhiId] += adc;
121 if(module==2) WETCEnergy[TCThetaId][TCPhiId] += adc;
122 if(module==1) BTCEnergy_adc[TCThetaId][TCPhiId] += adc;
123 if(module==0) EETCEnergy_adc[TCThetaId][TCPhiId] += adc;
124 if(module==2) WETCEnergy_adc[TCThetaId][TCPhiId] += adc;
125 }
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142}
static unsigned int theta_module(const Identifier &id)
static unsigned int phi_module(const Identifier &id)
int getTCThetaId(int partId, int ThetaNb, int PhiNb)
int getTCPhiId(int partId, int ThetaNb, int PhiNb)