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