ȥå   ʬ Хåå   ñ측 ǽ   إ   ǽRSS

SoftWare

Last-modified: 2012-12-26 () 16:24:37 (2122d)
Top / SoftWare

SoftWareطκȥ


TDCϤΤΥġ

ɤˤ˺줽ʤΤǡ⡣
ŪPMTʤɤConfigration򵭽Ҥե롣ɤǤ롣=>fileConfig.cc , fileConfig.h

TDCʬۤñ˰饹=>fileTDC.cc , fileTDC.h
ñTDCʬۤ󥰥᡼Ϥ褷PDFϤ褷ưŪ˥ԡƥեåȤƤ뵡ǽĤƤ롣

PDFrootfileLikelihood׻뤿Υ饹TDC饹ѾХץˤʤ뤬ɤΤǤΤޤޡ=>fileLikelihood.cc , fileLikelihood.h

Ȥäơ󥰥᡼եåƥ󥰤ԤäƤ롣

memo: 2012.4.18

WaveformϤΤΥ饹

եåADCϤΤŬ˺ä饹WaveForm饹ȤơͤùDzϤ뤿Τʥ饹
ȤʤWaveForm饹=>fileWaveForm.cc , fileWaveForm.h

WaveFormѾԡõΥ饹=>filePeakSearch.cc , filePeakSearch.h

WaveFormѾPeakSearchȤ롢Ω夬֤ʤɻʬǽ¬ꤹ뤳Ȥò饹=>fileTimeResolution.cc , fileTimeResolution.h

memo: 2012.4.18

ǥDz٥˥

ܶڤ̤äƥץߥ󥰤ΤϤɤΤǡ饤˥Ѥhtml ե򤽤Τޤޤ֤äȴƿ롢Ŭʥץࡣ
TempMonitor饹=>fileTempMonitor.cc,fileTempMonitor.h

ץ륳

#include "TempMonitor.h"

std::string FileName( void );
void temp_out(int ch);

int main(int argc,char *argv[]){

  //--initialize --//
  std::string fname = FileName();
  std::cout << "Output file name =  " << fname << std::endl;

  //󥹥ȥ饯ΰϡIPɥ쥹ȽϤե̾
  TempMonitor *moni = new TempMonitor( "192.168.6.1" , fname );

  //Υдؿǥͥɲä롣
  moni->SetChannel( 2 );
  moni->SetChannel( 3 );

  //˥ֳִ֡ñ̤
  const double tm_in = 1.;  //time interval [s]

  while(1){ 
     moni->Get(); //ټ

     moni->Print(); //ɸ
     moni->Write(); //ե񤭽Ф

     if( moni->CheckInterrupt() != 0 )break;//.processȤեåƤơ줬ʤʤä鶯λ
     sleep((int)tm_in);
  }

  return 0;
}

//run_numberȤեrunʥСݻƤơŬ˿ȤäƤƥ󥯥Ȥؿ
std::string FileName( void ){
  ifstream ifs( "run_number" );

  std::string str;
  ifs >> str;
  ifs.close();

  std::ofstream ofs( "run_number" );
  int rnum = atoi( str.c_str() );
  rnum++;
  ofs << rnum;
  ofs.close();

  std::string fname = "data/temp";
  fname += str;
  fname += ".dat";

  return fname;
}


Memo: 2012.4.18

ʣTDCԡؤΥեåƥ

ʣΥԡİ켡ҥȤФơưŪ˥ԡõեåȤƤ륳ɡfilePeakFit.cc , filePeakFit.h
ޤǻȤäƤޥŬ˥饹˽ľƤߤư̤ڡ¿ʬư󤸤ʤʡѥ᡼ĴƤʤȼ«ʤϤ
ץ륳ɡ

#include "PeakFit.h"

peak_search_fit3(){
  //gStyle->Load("PeakFit_c.so");

  PeakFit *fit = new PeakFit();

  fit->SetRange( 410 , 600 );
  fit->SetMin( 30 );
  fit->SetPeakThreshold( 15 , 25 );
  fit->SetBgFlag( 1 );

  int ch = 0;
  fit->SetChannel( ch );

  fit->Fit( s_tdc[ch] );

  delete fit;

}

ʤä顢ŬĴ٤

ꤲäѤʤ㡼ޥäΤǡŬľưǧѤߡfilePeakFit2.cc , filePeakFit2.h~
Ĥrootǡ

.x PeakFit.cc+

ߤˤsoեʲΤ褦ʥޥϤ餻

peak_fit(){

  TString fname = "rootfile.root";

  gSystem->Load("PeakFit_cc.so");

  PeakFit *p = new PeakFit();
  p->SetFile( fname );
  p->SetRange( 400 , 620 );
  p->ReadHistogram( "ana" , 36 ); //( Tree name , channnel number )

  p->Fit( 16 , 40 , 20 , 1 );//( channel , down_threshold , up_threshold , bckground_flag )

}


ԡΰ֤ȤꤿȤ⤢Τǡʳʬʬ䤷ƤߤfilePeakFit3.cc , filePeakFit3.h
ץ㡣

peak_fit2(){

  TString fname = "ahoaho.root";

  gSystem->Load("PeakFit_cc.so");

  PeakFit *p = new PeakFit( 0 ); //( output flag search information )
  p->SetFile( fname );

  for( int ch = 0;ch < 255;ch++){
     TString histname = "e1ch";histname += ch;
     p->PushbackHistogram( histname ); //( histname )
  }

  //Peak search and output 
  int peak_num = p->GetPeak( 0 , 0.001 , 0.0005 ); //( ch , down_threshold , up_threshold )                    
  for( int i = 0;i < peak_num;i++){
     cout << "peak_number:" << i << " , x:" << p->GetPx(i) << " , y:" << p->GetPy(i) << endl;
  }

}

Ŭ˥󥰥᡼

󥰥᡼Ŭ˽񤤤Ƥץࡣ
饹=>fileRingImage.cc , fileRingImage.h

#include<iostream>
#include "TROOT.h"
#include "TStyle.h"
#include "TCanvas.h"
#include "RingImage.h"

int main( void ){

  TCanvas *c1 = new TCanvas( "c1" , "c1" );
  c1->Divide(3,1);

  RingImage *r[4];
  c1->cd(1);
  r[0]= new RingImage();
  r[0]->SetBeta( 1.0 );
  r[0]->SetIncidentPosition( 0. , 2000. );
  r[0]->DrawImage( "ap" , 1 );

  r[1]= new RingImage();
  r[1]->SetBeta( 0.9 );
  r[1]->SetIncidentPosition( 0. , 2000. );
  r[1]->DrawImage( "psame" , 2 );

  c1->cd(2);
  r[0]->DrawImage( "ap" , 1 );
  r[0]->DrawImage( "psame" , 2 );

  c1->cd(3);
  r[2]= new RingImage();
  r[2]->SetBeta( 1.0 );
  r[2]->SetIncidentPosition( 0. , 2000. );
  r[2]->DrawImage( "ap" , 1 );

  r[3]= new RingImage();
  r[3]->SetBeta( 1.1 );
  r[3]->SetIncidentPosition( 0. , 2000. );
  r[3]->DrawImage( "psame" , 2 );


  c1->Update();
  c1->Print("tmp.ps");
  
  return 1;
}

ǽϤץå㡣=>fileringimage.ps

Ŭ饹

ȤȤˤƬȤΤʤΤǡŬ˥classäʥС󣱡
fileMyLogger.cc
fileMyLogger.h

Ȥ

#include <iostream>
#include "../MyLogger.h"
int main( void ){

  //󥹥ȥ饯ؤΰϥȤäȤɸϤ뤫ɤ
  //ФƤƤȤ0ˤ롣༡åȤ1ˤ
  MyLogger *log = new MyLogger( 0 ); 

  log->SetFunction( "Main" ); //ؿ̾Υ򥻥åȤ롣ˤưȽϤ

  //򥻥åȤƤ
  //٥ 1:Info , 2:Data , 3:Warning , 4:Error , 5:Debug
  log->Log("test"); //ϥʸ(string) , ϥ٥롣ǥեȤ1

  log->Log( "\n" , 2); //٥룲[Data]ǡϤʸʳϥåȤʤ
  log->Log( 1 , 2);//ֹ⥤󥯥Ȥʤ
  log->Log( " " , 2);  
  log->Log( 2 , 2);
  log->Log( " " , 2);
  log->Log( 3 , 2);
  log->Log( "\n" , 2);
  
  log->Log( "finished" , 3); //٥3[Warning]
  log->Debug( "debugging" ); //Debugؿdebug϶̤Ǥ롣debugΩֹ򥤥󥯥Ȥɽ
   
  //ϤƤ
  log->Print( 0 ); //ɸϤ롣ϥ٥롣0ꤹȤ٤ƽϤ
  log->Write( "aho.dat" , 2 ); //ե˽񤭽Фե̾ϥ٥

  return 1;
}

ɸϤϤʴ

[0] 2012/2/26_23:30:43 [Info][Main] ** Function <Main> **
[1] 2012/2/26_23:30:43 [Info][Main] test

1 2 3
[2] 2012/2/26_23:30:43 [Warning][Main] finished
[3] 2012/2/26_23:30:43 [Debug][Main] Debug#(0):debugging

ϥեaho.datˤ

1 2 3

ФƤ롣


ǽդäƥѥåסʥС󣲡
fileMyLogger2.cc
fileMyLogger2.h

ץ륳ɡ

#include <iostream>
#include "../MyLogger.h"

int main( void ){


  MyLogger *log = new MyLogger( 0 );

  log->SetFunction( "Main" );
  log->Log("test");

  log->Log( "1 2 3 4", 2);
  log->Log( "3 4 5 6", 2);
  log->Log( "5 6 7 8", 2);

  log->Log( "finished" , 3);

  log->Debug( "debugging" );

  log->Print( 0 );
  log->Write( "aho.dat" , 0 , 0 ); //log levelǡ軰0: , 1:ɵ

  std::cout << "Read!" << std::endl;

  log->Clear(); //ޤǤΥõ
  log->Read("aho.dat"); //ƱեޥåȤǽϤեդɤ߹
   //ΤȤƱ˥٥ʬʬष¸Ƥ
  log->Print( 2 );
  std::string baka = log->GetString( 2 , 3 ); //stringǼ٥
  //軰ϰԤΤʤĥäƤսꡣ0:all,1:id,2:date,3:textʬ
  std::cout << "chk output : " << baka << std::endl;

  return 0;
}

Ϸ̤ϰʲ

[0] 2012/2/27_6:40:42 [Info][Main] ** Function <Main> **
[1] 2012/2/27_6:40:42 [Info][Main] test
[2] 2012/2/27_6:40:42 [Data][Main] 1 2 3 4
[3] 2012/2/27_6:40:42 [Data][Main] 3 4 5 6
[4] 2012/2/27_6:40:42 [Data][Main] 5 6 7 8
[5] 2012/2/27_6:40:42 [Warning][Main] finished
[6] 2012/2/27_6:40:42 [Debug][Main] Debug#(0):debugging
Read!
[2] 2012/2/27_6:40:42 [Data][Main] 1 2 3 4
[3] 2012/2/27_6:40:42 [Data][Main] 3 4 5 6
[4] 2012/2/27_6:40:42 [Data][Main] 5 6 7 8
chk output : 1 2 3 4 3 4 5 6 5 6 7 8

뤳ȤˤäơȤƥǡ񤭽ФꤷȤˡդɤ߹ळȤǤ롣


ʥ饹ޤȤˡʤꤹΤϤɤפơꤿ
ͤˤƤȡǤϤʤ , ¿֤ˤĤ


ȤäƤ뤦ˡ줿ʤäΤǥޥʡ󥸡ѹϡWriteȤ˰Ȥ뤳Ȥդʤɤʤ褦ˤꡣ

fileMyLogger3.cc
fileMyLogger3.h

Xcircuit

linuxǤäȲϩޤ񤭤ȤΤΡե꡼եȡ
TimΥڡɤƤơࡢ./configuremakeOK
ڤǤ

VDECط

KEKASICֽǻȤϩߥ졼ʤɤInstallǵäerrorн衣 Ū˰ʲΥڡμ˽Фޤ
VDECΥڡ
ֽɬפsoftware

CentOS5.2Ǥhspice_vC-2009.03ϻȤʤ

hspiceinstallƼ¹ԤsegmentationfaltǤCentOS5.1hspice_vB-2008.09ȤäƤʬΤCentOS5.2
versionȤhspice_vB-2008.09installľư

SElinuxưƤCosmosScope¹Իˤ

CosmosScope2008.09install塢¹Ԥ

/eda/synopsys/CosmosScope_B-2008.09/CosmosScope/bin/aim: error while loading shared libraries: /eda/synopsys/CosmosScope_B-2008.09/CosmosScope/bin/libai_rwtools.so: cannot restore segment prot after reloc: Permission denied

ǤƤ롣
Ĵ٤ƤߤȡSELinuxƥݻΤ˥饤֥λȤ˳Ƥ뤿˵롣ξϡ/eda/synopsys/CosmosScope_B-2008.09/CosmosScope/bin/aim󤬡/eda/synopsys/CosmosScope_B-2008.09/CosmosScope/bin/libai_rwtools.so¹Ԥ褦ȤɡSELinuxŪˤϵޤפȤ̣ϼΥޥɤDzǤ롣

chcon -c -v -R -u system_u -r object_r -t textrel_shlib_t /eda/synopsys/CosmosScope_B-2008.09/CosmosScope/bin/libai_rwtools.so

ξ礳Ʊ褦5~6errorФƤƱͤн褷³ưäȤɤä

FeynmanGraph

ڤFeynman diagram񤱤ƤޤեȥƤ롣
ȤꤢtarषơưץȤFGȤfull pathʬ񤭴ơʬʪ֤path̤installλ饯Ǥ롣
äƤߤ

diag_2.png



C,C++

üioctl

ŤǼΤǡФ񤭡

ǥץ쥤ȤܡɤüǤΤǡޥϤγ֤̿򤷤Ƥ롣CAMACȤƱtty˸Ǥ줿ü̿򤷤Ƥ롣ǥץ񤯺ݤϤΤá
ɸϥȥ꡼Υڡˤ褦ˡ Unix ץϵưˡץ󤵤Ƥ륹ȥ꡼ 3 Ϳ롣ϡ줾(stdin)(stdout)ǥå䥨顼åɽ(stderr)Ǥ롣 FILEηǤꡢեǥץäƤΤǡץ⤫饢Ǥ롣
ʤΤǡioctlʤɤǤ롣Webץߥ󥰤򤷤Ƥߤ褦
ioctlϥեǥץϥǥХؤ׵ꤹͤǤ롣׵᤹뤳ȤΤǤͤioctls.h˽񤫤Ƥ롣(Τ/usr/include/linux/Ȥ/usr/include/asm/Ȥˤ)⤬ˤ롣 軰ϡü°ͤǼ빽¤ΤؤΥݥ󥿡ȤС軰̿()򤹤ȡstdoutȤΥǥץФ°ΥåȤ롣񤭴뤳ȤǡɸϤ椹뤳ȤǤ롣
ǤäƤ褦ˡȤХǥץ쥤ΥʤơϤʸɽʤ褦ǽ

sirial̿

LinuxΥꥢ̿˻ȤؿϡtermiosȤإåincludeФ
ºݤΥɤǤȡ빽⤷ܡ졼ʤƸա󤼤Τʤä󤹤͡
ޤޤʬäƤʤɡδؿȤľǥꥢI/O򰷤ȤǤʤ顢ʬǥץߥ󥰤ޥȤ̿뤳Ȥ⤽ۤ񤷤ʤ褦ʵ롣
ʤƤ뤫ʡ

open

openǥեäɤ߽񤭤Ǥ뤬ΰϤդĤäơҤȤĤϥե̾Ǥ⤦ҤȤĤϥե饰(ץ)Ǥ롣 ȤС

open("file.dat","r")

Ȥɤ߽ФѤǥե򳫤ΤĤΥե饰ϤǤ褦Ǥ롣ʲΥ⡣

O_RDONLYɤ߹  
O_WRONLY񤭹
O_RDWRɤ߹ߡ񤭹
O_APPEND񤭹ߤΤӤɲ
O_CREATե뤬ʤ翷
O_TRUNK0ХȤڤΤƤ
O_NDELAYԤ֤ʤdz

Υե饰orطʤɤ뤳ȤǤ롣¿ʬbitοбƤơοȹ碌ʤȻפ
O_NDELAYˤĤĴ٤Ƥ顢⤷Ȥ񤤤ƤäFIFOˤĤ
äˤ⤷ȻפäΤϼΤȡ

ǡϺFIFOɤ߹ߡ񤭹ߤεĤͭФɤʥץǤԤʤޤ
FIFOФopen()ƥॳǥե뵭һҤСեƱͤˤwrite(),ˤread()ƥॳѽޤ
 fwrite(),fprintf(),fpus(),fread(),fscanf(),fgets()ʤɹϤѤƤϤޤ
UNIXǤϥåȤǤFIFOǤPIPEǤ̥եǤǥХեǤƱƥॳ뤬ѤǤΤ餷,
FIFOǤϤ¿ŲԤselect()ƥॳ뤬ѤǤޤԤ̵ϤХ⡼ɤO_NDELAYꤹ뤳Ȥޤ

ʤۤɡȤǤ롣ץ֤ΤȤˤĤơ礤ȶ̣來ޤ

isattyfileno

CȤǡץब쥯󤵤ƤꡢѥפƤ뤫ɤȽꤹȤˤϡisattyȤؿȤ㤨С

if(!isatty(fileno(stdout))){
           A
}else{
           B
}

Aüʳ˽ϤȤ˼¹ԤƤǤ롣 fileno()ϻꤵ줿FileDescriptor(ե뵭һ)бͤint֤äƤ롣ե뵭һҤͤϡδطǤ롣

0  ɸ (stdin)
1  ɸ (stdout)
2  ɸ२顼 (stderr)


ʤߤˡPOSIX줿ϰϤǤ롣

SkypeƳ

skype2.0.18

2009ǯ41ߡskypeκǿС2.2.11CentOSǻȤȤ

error while loading shared libraries: libQtDBus.so.4: cannot open shared object file: No such file or directory

ȤǤƤܤ롣
饤֥äƤ뤫̾餤Τɡroot¤ΤʤʬˤϤäȤɤɤޤǤäƤΤʬʤΤǡŤСǤ2.0.18򤤤롣
tarܡäƤŸǻȤ롣
passwordϤ̤#ǤȤȤǧʤȤ꤬ȯȤꤢнˡȤpasswordѹ
PATH򤭤äƽꡣ

ҤȤޤͽƤproxyطǤԶȤϵʤskypeϤȤˤƤportõ³롢ߤ̿ץȥȤäƤʹȤΤǡޤĤʤäѤʤˤϤʤۤΤġ

Mozilla

thunderbird˥ѥɤ򤫤

PCthunderbirdȤȻפäƳ뤬ïǤ᡼ɤƤޤΤäѤꤢޤʤȤȤǡк
thunderbirdϥץեȤΤǥȾȤƤơ켫Τ˥ѥɤ򤫤뤳ȤdzȤǤʤ褦ˤ뤳ȤǤ롣profilepasswordȤɥȤ
¨ʤʴǡХåå->̤PCdzȤȴñ˳餷ȤꤢϤDz

ΤޤޤǤϤۤοͤȤʤȤ⤬Τǡк롣
кĶñǡ֥ץեפȤΤˡͥץեκѹthunderbirdΤǤϤǤʤΤǡץեޥ͡ꤹ롣

thunderbird -p

ȥե̾OK
ǡֺ夳Υץե򤷤褦פȤȤΥåϤƤС桼ڤؤ褦ʡʷUIˤǤ롣

firefoxưʤ

OSС󥢥åפơfirefoxư褦Ȥ顢"firefox is already running"ȽФƵưʤ Ĵ٤ĤβǽäơҤȤĤϡ֥ץưƤס⤦ҤȤĤϡ֥åե뤬ĤäƤפäԤkillƤǤpsƤץfirefoxФʤäΤǡԤǤȽǡ

кȤơ~user/.mozzila/firefox/???.default/.parentlockDz


perl

ޤ˻֤ΤȤ(⤷ϸƨ򤷤Ȥ)ˡͷٶƤߤ롣ϲΩġ

htmlɤ񤭽ФƤߤ...ˤޤCGIưƤߤ

apacheǽפʡ.htaccessפȤե뤬롣ŪϰʲITѸ켭ŵѡ

ApacheʤɤWebФǻѤǤ롢WebФưǥ쥯ȥñ̤椹뤿Υե롣
ŪˤϡCGISSIʤɤ¹Ԥ뤿(̿)䡢ĥҤȤ˥ե륿פꤹMIMEפꡢ桼ǧڡIPɥ쥹ɥᥤñ̤ǤΥ¤ʤɤ񤭹ळȤǤ롣

Ϸ빽򤤤ߤ
=>.htaccess
=>ȤۤۤCGI


ǻȤCGIλ⤷ʤȤʤ

>ꤷǤǤʤ(^^;)

apache꤫=>NǤapache2.0

09.3.16
SQUIDtry&errorμ򤷤ƤSQUIDLAN⤫ΥꥯURLǥå̵ͭǧå夷ƤФޥϤ顢ˤ˹Ƴǧ褦ʾξ֤Ϥ뤿ǧˤʤʤSQUIDϰָˤޤꥯȤäȤΥȤ˹뤫ɤåˤΤǡŤˤޤȿǤƬ𤷤ƤhtmlǤϵΤΤäƤCGIʤΤפȻפäƤޥߥǤ
Ctrl+Shift+RǥɤOKɤäƤ뤫ΤʤSQUIDФ(⡩)åȤʤǹǤ롣
ʤΤǡFirefoxΥ硼ȥåȥˤĤĴ٤ʡåˤĤ򤤵äabout:configȤfirefox򤤤äƤΤȻפäʤۤ󤰡
CGIưܤܤtryƤ
09.6.13.Sat
Ф餯ۤä餫ƤCGIưäѤץΤʥǥХåǤƤʤä
ץexecuteǤΤǡ⤦ΤȤϤǤ롪
ĶΤäѤϫǤ͡

NETWORK

ͥåȥط˺Ͽ

lustre

lustreϥץ󥽡ʬե륷ƥǡ褯ȤƤ롣
ȤСNFSƥǾȤꤹȤˡҤȤĤΥСޥ˥եΥޥȤ򤵤ΤǤϤʤĤΥޥʬۤôʤʤ롣ä褹뤿Ρ饹ѤΥե륷ƥबlustreǤ롣ȻפŪˤϡ֥桼¦饢ΤϤҤȤĤΥե륷ƥºݤˤʣΥСΤФ(ʬ)ޥȤסĤȤ褦ʴĶ롣

Lustreե륷ƥγ
Lustreե륷ƥI/Oǽɾ