6/29/2009

坚持

世界上没有什么东西可以代替坚持不懈。聪明不能,因为世界上失败的聪明人太多了;天赋也不能,因为没有毅力的天赋只不过是空想;教育也不能,因为世界上到 处都可以见到受过高等教育的人半途而废。如今,只有决心和坚持不懈才是万能的。”美国作家卡文·库利吉的一句话道出了坚持的重要性。

6/26/2009

"^" in C++ means bitsize exclusive OR

The ^ (bitwise exclusive OR) operator compares each bit of its first operand
to the corresponding bit of the second operand. If both bits are 1's or both
bits are 0's, the corresponding bit of the result is set to 0. Otherwise, this
operator sets the corresponding result bit to 1.

The following example shows the values of a, b, and the result of a ^ b
represented as 32-bit binary numbers:

bit pattern of a 00000000000000000000000001011100

bit pattern of b 00000000000000000000000000101110

bit pattern of a^b 00000000000000000000000001110010

so it can not be used in power function,
you need to use

pow (7,3)

to get 7^3;

6/12/2009

Get Histogram lay together

A THStack is a collection of TH1 (or derived) objects
Use THStack::Add to add a new histogram to the list.

If you want to draw the histogram on the log scale,
just get a pad in log scale, and draw the thstack on
this pad, everything will be done, as easy as that!!!


hvem1->SetFillColor(kRed);
hvem1->SetMarkerStyle(21);
hvem1->SetMarkerColor(kRed);
hs->Add(hvem1);


hvem2->SetFillColor(kBlue);
hvem2->SetMarkerStyle(21);
hvem2->SetMarkerColor(kBlue);

hs->Add(hvem2);

pad1->cd();
hs->Draw();
c1->Modified();
c1->Update();

change the physics email password

1. $ssh gyuan@phys.lsu.edu
2. $yppasswd

Very nice c++ website

http://www.comp-phys.org/pt/

6/08/2009

S(1000) decteases with zenith angle

For a given energy the value of S(1000) decrease with zenith angle, due to the attenuation of the shower particles and geometrical effects.

It is regarded as the signal S(1000) the shower would have produced had it arrived at theta =38 degrees.

6/01/2009

Creat sub directory in a root file

please refer to /tutorial/dirs.C

/***************************************
...
top->cd(); //change directory back to top

TDirectory *sub = top->mkdir("Result"); //create the sub directory named Result
sub->cd(); // make the "sub" directory the current directory

hpk->Write(); //write hpk to this sub directory

...
/*****************************************