11.05.2013 Views

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

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

22 // S t r i n g s <strong>para</strong> nomes e t i t u l o s<br />

23 char t i t u l o [ 5 0 ] ;<br />

24 char nome [ 5 0 ] ;<br />

25 // Histogramas <strong>para</strong> medidas <strong>de</strong> cada tensão <strong>de</strong> entrada<br />

26 TH1F ∗ h i s t [ 2 0 ] ;<br />

27 // I n i c i a l i z a n d o os histogramas<br />

28 for ( int i = 0 ; i < 20 ; i ++){<br />

29 s p r i n t f (nome , "h: %d" , i ) ;<br />

30 s p r i n t f ( t i t u l o , "Histograma <strong>de</strong> medidas <strong>para</strong> %d mV" ,x mV [ i ] ) ;<br />

31 h i s t [ i ] = new TH1F(nome , t i t u l o , 4200 , −2100, 2100) ;<br />

32 }<br />

33 // Stream <strong>para</strong> a b r i r a r q u i v o s <strong>de</strong> <strong>dados</strong><br />

34 i f s t r e a m in ;<br />

35 // v a r i a v e i s u t i l i z a d a s <strong>para</strong> a b r i r d i r e t ó r i o do r e s p e c t i v o canal<br />

36 int canal ;<br />

37 char mpdpath [ 4 0 ] ;<br />

38 char canalpath [ 1 0 0 ] ;<br />

39<br />

40 cout > mpdpath ;<br />

42 cout > canal ;<br />

44 i f ( canal 4){ cout pwd ( ) ) ;<br />

48 s p r i n t f ( canalpath , "/%s/adc/ch%d/" , mpdpath , canal ) ;<br />

49 TString absdirname = pwd + canalpath ;<br />

50 TSyst<strong>em</strong>Directory d i r ( absdirname . Data ( ) , absdirname . Data ( ) ) ;<br />

51 TList ∗ f i l e s = d i r . G e t L i s t O f F i l e s ( ) ;<br />

52 i f ( f i l e s ) {<br />

53 TSyst<strong>em</strong>File ∗ f i l e ;<br />

54 TString fname ;<br />

55 TIter next ( f i l e s ) ;<br />

56 while ( ( f i l e =(TSyst<strong>em</strong>File ∗) next ( ) ) ) {<br />

57 fname = f i l e −>GetName ( ) ;<br />

58 i f ( ! f i l e −>I s D i r e c t o r y ( ) && fname . EndsWith ( " -1000mV.txt" ) ) {<br />

59 in . open ( absdirname + fname , i f s t r e a m : : in ) ;<br />

60 for ( int i =0; i > id >> amplitu<strong>de</strong> ;<br />

62 h i s t [0]−> F i l l ( amplitu<strong>de</strong> ) ;<br />

63 }<br />

93

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!