Sistema multicanal para aquisiç˜ao de dados em um ... - CBPFIndex
Sistema multicanal para aquisiç˜ao de dados em um ... - CBPFIndex
Sistema multicanal para aquisiç˜ao de dados em um ... - CBPFIndex
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
235 // g r á f i c o <strong>de</strong> c a l i b r a ç ã o com a média e o d e s v i o padrão dos a j u s t e s<br />
236 for ( int i = 0 ; i < 20 ; i++){<br />
237 h i s t [ i ]−>GetXaxis ( )−>S e t T i t l e ( "Amplitu<strong>de</strong> (mV)" ) ;<br />
238 h i s t [ i ]−>GetXaxis ( )−>C e n t e r T i t l e ( true ) ;<br />
239 h i s t [ i ]−>GetXaxis ( )−>S e t T i t l e O f f s e t ( 1 . 5 ) ;<br />
240 h i s t [ i ]−>GetYaxis ( )−>S e t T i t l e ( "Valor <strong>de</strong> ADC (LSB)" ) ;<br />
241 h i s t [ i ]−>GetYaxis ( )−>C e n t e r T i t l e ( true ) ;<br />
242 h i s t [ i ]−>GetYaxis ( )−>S e t T i t l e O f f s e t ( 1 . 5 ) ;<br />
243 h i s t [ i ]−> S e t F i l l C o l o r ( 4 ) ;<br />
244 h i s t [ i ]−>Fit ( "gaus" , "0" ) ;<br />
245 TF1 ∗ f i t g = h i s t [ i ]−>GetFunction ( "gaus" ) ;<br />
246 Double t chi2 = f i t g −>GetChisquare ( ) ;<br />
247 Double t mean = f i t g −>GetParameter ( 1 ) ;<br />
248 Double t sigma = f i t g −>GetParameter ( 2 ) ;<br />
249 Double t <strong>em</strong>ean = f i t g −>GetParError ( 1 ) ;<br />
250 Double t esigma = f i t g −>GetParError ( 2 ) ;<br />
251 y ADC [ i ] = mean ; // média do a j u s t e gaussiano<br />
252 yE ADC [ i ] = sigma ; // sigma do a j u s t e gaussiano<br />
253 yE50 ADC [ i ] = sigma ∗50; // sigma m u l t i p l i c a d o por 50 <strong>para</strong> barra <strong>de</strong><br />
e r r o s<br />
254 Emean ADC [ i ] = <strong>em</strong>ean ∗50; // erro da média m u l t i p l i c a d o por 50 <strong>para</strong><br />
barra <strong>de</strong> e r r o s<br />
255 Eerro ADC [ i ] = esigma ∗50; // erro do sigma m u l t i p l i c a d o por 50 <strong>para</strong><br />
256 i f ( i ==0){<br />
barra <strong>de</strong> e r r o s<br />
257 h i s t [ i ]−>Draw ( ) ;<br />
258 } else {<br />
259 h i s t [ i ]−>Draw( "same" ) ;<br />
260 }<br />
261 c1−>Modified ( ) ;<br />
262 }<br />
263 h i s t [0]−> GetYaxis ( )−>SetRangeUser (0 ,5000) ;<br />
264 s p r i n t f ( t i t u l o , "Histogramas do ADC: Ch%d, %s" , canal , mpdpath ) ;<br />
265 h i s t [0]−> S e t T i t l e ( t i t u l o ) ;<br />
266 c1−>Update ( ) ;<br />
267 s p r i n t f ( t i t u l o , "./%s/root_adc_hist_ch%d.png" , mpdpath , canal ) ;<br />
268 c1−>Print ( t i t u l o , "png" ) ;<br />
269 // Plotando g r á f i c o <strong>de</strong> l a r g u r a s dos histogramas e e r r o s<br />
270 c1−>Clear ( ) ;<br />
271 graph = new TGraphErrors (20 ,y ADC, yE ADC, Emean ADC, Eerro ADC ) ;<br />
272 s p r i n t f ( t i t u l o , "Largura dos histogramas do ADC: Ch%d, %s" , canal , mpdpath<br />
) ;<br />
273 graph−>S e t T i t l e ( t i t u l o ) ;<br />
98