레이블이 CMS일하기인 게시물을 표시합니다. 모든 게시물 표시
레이블이 CMS일하기인 게시물을 표시합니다. 모든 게시물 표시

2015년 7월 30일 목요일

CMS (Compact Muon Solenoid) - Pixel Tracker


  • Today, I want to briefly introduce the pixel tracker of CMS.
    The pixel tracker is the most inner detector of CMS, and has key role to reconstruct track of particle, to calculate the interaction point position, and etc.
    Therefore, I would say that the pixel tracker is the most shiny device of CMS.
  • The pixel of pixel tracker is 100 micron * 150 micron size.
    66 million of pixels are on the area about 1 square meter.
  • The geometrical setting of pixel tracker is here.
    You can see the three barrel layers which is length is 53 cm, and two disk layers each front and the backward of barrel layers.

    • As you can see, disk layers look like turbine. Each wing of disk layer is rotated 20 degree   from the plane which is exactly perpendicular to the z-axis.
      It helps to get better resolution than making the disk layer as flat plane.
    • The efficiency when we demand three different layer hit is usable when eta < 2.2.
      Demanding two layers is usable when eta < 2.5.

2015년 7월 29일 수요일

Anti-kt algorithm

  • Everything comes from,
    • Kt algorithm : http://arxiv.org/pdf/hep-ph/9305266v1.pdf
    • Anti-kt algorithm : http://arxiv.org/pdf/0802.1189v2.pdf
  • To grab the jet made by hadronization of parton comes from particle collider (such as electron collider, LHC, Tevatrom), physicists have used many algorithms.
    In the CMS, many jet analysis are done with anti-kt algorithm. Let's briefly check what it is.
  • As a first step, we tag every hadrons as proto-jet. After that, merging hadrons as components of the same jet should be done.
    The anti-kt algorithm is about the way to merge hadrons.
  • The kt-algorithm uses this variable.

    1. Now, find the minimum value among d_ij and d_i.
      If d_ij is the minimum value, merge i and j proto-jet and give
      Energy : E_k = E_i + E_j
      phi = (E_i * phi_i + E_j * phi_j ) / E_k
      and same way for eta.

  • Anti-kt  algorithm.
    1. If we let p = -1, this is anti-kt algorithm.


  • Why we used anti-kt algorithm?









2014년 11월 24일 월요일

LXPLUS에서 Crab job 돌리는 법

1.이 포스트는 CMS에서 제공하는 트위키 페이지인

2.Crab 이란?
  CMS는 data를 처리하기 위해 세계 전역에 computing server들을 가지고 있습니다. 이 서버들은 CMS에 있는 tier1 부터 시작해서 tier2, tier3 로 등급이 매겨집니다. Crab은 이 서버들의 자원을 사용해 데이터 분석을 할 수 있도록 해주는 프로그램입니다. 이 포스트에서는 crab 2 에 대한 사용법을 적어보고자 합니다. 

3.미리 필요한 단계들 - 위의 튜토리얼 링크를 들어가시면 아래의 단계에 필요한 내용들이 있습니다.
- LXPLUS에 사용권한 및 work space를 배정받습니다.
- CMS에서 Grid certification을 받습니다. 
- KCMS의 멤버시라면 국내에 있는 tier2 나 tier3에 계정을 받으시길 바랍니다. 그래야 crab을 돌린 결과파일을 빠르게 한국내의 자신의 서버로 가져올 수 있습니다.
(경북대, 서울시립대, KISTI 등에 있습니다. 구글링하시면 정보를 찾아보실 수 있습니다.)

4. Let's start!
1) lxplus에 접속합니다.
$ ssh -Y user@lxplus.cern.ch
2) work space 로 갑니다.
$ cd /afs/cern.ch/work/u/user
여기서 u는 user의 맨 첫글자를 쓰면 됩니다. user는 자신의 username 이구요. work space를 배정받지 않았다면 이 디렉토리가 없습니다.
3) test 를 위한 directory를 하나 만듭시다. 원하는데로 만드시면 됩니다.
$ mkdir TEST
4) 사용하려 하는 버전의 CMSSW를 불러옵니다.
$ cd TEST
$ cmsrel CMSSW_X_X_X
tutorial 에서는 5_3_11을 불러옵니다.
5) cmsenv 를 합시다.
$ cd CMSSW_X_X_X/src/
$ cmsenv
여기서 cmsenv는 alias입니다. 자세한 내용은 alias 사용법에 대한 포스트를 참고하시길 바랍니다.
6) python script를 만듭시다.
tutorial 을 따라가려면
$ emacs -nw tutorial.py
를 한 다음 
import FWCore.ParameterSet.Config as cms
process = cms.Process('Slurp')

process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring())
process.maxEvents = cms.untracked.PSet( input       = cms.untracked.int32(10) )
process.options   = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )

process.output = cms.OutputModule("PoolOutputModule",
    outputCommands = cms.untracked.vstring("drop *", "keep recoTracks_*_*_*"),
    fileName = cms.untracked.string('outfile.root'),
)
process.out_step = cms.EndPath(process.output)
의 내용을 복붙하면 됩니다.
(복붙 후 저장하고 나오시려면 control + x + s 한 후, control + x+ c 하시면 됩니다. 자세한 emacs 의 사용법은 관련 포스트를 참고하시기 바랍니다.)
혹은, 자신이 crab을 이용해 돌리고 싶은 python script를 현재의 CMSSW_X_X_X/src폴더로 가져오시면 됩니다.
7) crab.sh를 source합시다.
$ source /afs/cern.ch/cms/ccs/wm/scripts/Crab/crab.sh
자신이 사용하고 있는 쉘의 종류에 따라서 마지막의 sh를 csh나 sh 둘 중 하나로 하시면 됩니다.
8) crab script를 만듭시다.
tutorial 에서 제공하는 script를 사용하려면
$ emacs -nw crab .cfg
를 한 다음
[CMSSW]
total_number_of_events  = 10
number_of_jobs          = 5
pset                    = tutorial.py
datasetpath             =  /RelValZMM/CMSSW_5_3_6-START53_V14-v2/GEN-SIM-RECO

output_file              = outfile.root

[USER]
return_data             = 0
copy_data               = 1
storage_element        = T2_IT_Legnaro
user_remote_dir         = TutGridSchool

[CRAB]
scheduler = remoteGlidein
jobtype                 = cmssw
의 내용을 복붙하시면 됩니다. 
여기서 수정을 가해야 할 부분들이 있습니다.
-total_number_of_events 는 원하는 총 이벤트 갯수를 입력하시면 됩니다.
-number_of_jobs는 총 이벤트를 몇개의 job으로 나눠서 제출할지 적으면 됩니다. 예를 들어서 total_number_of_events가 2500000이고 number_of_jobs가 500이라면 자동적으로 한 job에 5000개씩의 이벤트를 돌리게 되고 결과 파일 500개가 나옵니다. 각 파일당 5000개의 이벤트를 가지고 있구요.
- pset 에는 자신이 돌리고 싶은 python script를 입력하시면 됩니다.
- datasetpath는 자신이 사용하는 datapath를 넣으시면 되구요, dataset을 사용하지 않는 MC generation과 같은 경우는 datasetpath  =  None을 입력하시면 됩니다.
-output_file 에는 python 스크립트에 입력한 동일한 이름의 아웃풋 파일 이름이 들어가야 합니다. 잡이 여러개면 outfile뒤에 랜덤한 이름이 붙어 number_of_jobs 의 수만큼의 파일들이 출력됩니다.
-storage_element 는 자신이 결과를 받고자 하는 곳의 정보를 입력합니다. 만약 서울시립대의 tier3에 데이터를 받고 싶다면, T3_KR_UOS를 입력하면 됩니다. 당연히 해당하는 server에 계정을 가지고 있어야 겠지요.
추가적인 옵션들은 튜토리얼 페이지를 참고하시기 바랍니다.
9) crab을 돌려봅시다.
$ crab -create
을 하면 여러줄의 메세지들이 터미널에 뜹니다. 에러가 났는지, 아니면 create 명령이 성공적으로 이루어졌는지 알려줍니다. 에러가 났다면 에러메세지를 확인하고 수정을 가하시길 바랍니다.
성공적으로 create가 되었다면 
$ crab -submit
으로 job을 submit 합니다. 여러 메세지가 뜬 후, 몇 개의 job이 submit 되었는지가 뜹니다.
이 job의 정보를 확인하기 위해서는
$ crab -status
를 치면 됩니다. 그럼 각 job들에 대한 정보와 특별히 task monitering 을 위한 url을 알려줍니다. 그 url을 복붙해서 브라우저에 주소를 쳐서 들어가면 아주 쉽게 job의 상황을 확인할 수 있습니다.

10) fail에 대처하기
job을 돌리다보면 fail이 뜨는 경우가 있습니다. 이 때는 먼저 task monitering url 에서 fail 한 집들의 Appl Exit Code를 확인해 보시길 바랍니다.
Succeeded한 job들은 그 코드가 0이고, fail한 job들은 다양한 코드들을 보여줍니다.
를 참고하시기 바랍니다. 
해결방안을 찾을 수 있는 부분들은 수정후 다시 submit 해야 하고 ( -resubmit은 아래를 참고)
못찾겠다면 Succeeded할 때 까지 resubmit 하시길 바랍니다.
몇몇 job은 성공하고 몇몇 job이 실패하는 경우라면 resubmit이 소용있지만, 
submit한 모든 job들이 fail 한다면 python script나 cfg script 혹은 storage element에 문제가 있는 것이므로 문제를 수정 후 다시 submit 하시길 바랍니다.

11) -resubmit에 앞서
한 가지 요령이겠지만, 많은 job 들을 돌리고자 한다면 5개 정도의 job을 먼저 돌려보고 fail하는지 아닌지 먼저 확인해 보고 그 이후에 많은 job들을 돌리시길 바랍니다.
12) -resubmit 하는 법
job들이 모두 돌아간 후, 혹은 돌아가는 도중에 fail한 job들을 resubmit 하는 방법입니다.
먼저 status를 확인합시다.
$ crab -status
이것을 치면 터미널에 exit한 job들의 정보가 뜹니다. exit코드 별로 해당하는 job들의 목록이 정리되어 뜹니다.
그 정보들을 가지고 먼저
$ crab -get 1,11,15,20
과 같은 명령으로 결과를 가져옵니다. 여기에 1,11,15,20은 fail한 job들을 입력하시면 됩니다. crab -status 명령어에 의해 띄어진 메세지들에 있으니 복붙해서 넣으시면 됩니다.
그럼 어디에 job들을 가져왔는지 알려줍니다. (fail한 잡들의 error가 의심된다면 알려주는 디렉토리의 .stdout 확장자의 내용을 읽어보시길 바랍니다.)
 마지막으로 
$ crab -resubmit 1,11,15,20
으로 resubmit 해 줍니다. 그러면 1,11,15,20의 자리에 넣은 job들을 resubmit 하게 됩니다.
모든 job을 성공할 때 까지 이 과정을 반복하시면 됩니다.