====== Storing Data on Castor ======
===== Introduction =====
Castor is a storage manager system used to store physics production files and user files [[http://castor.web.cern.ch]]. It can be used to store large files that are too large for your lxplus account. The access to the files is however a bit different than on lxplus.
===== Your directory on castor =====
If your username on lxplus is myusername, then you will have a directory under: ''/castor/cern.ch/user/m/myusername''. To make the access a little easier, it may be helpful to define a path $CASTOR to this directory (''setenv CASTOR /castor/cern.ch/user/m/myusername'' in your .tcshrc file).
===== Accessing your data on castor =====
To access your data the normal unix-commands like ls, mkdir, etc. will not work. Instead you have to use special commands. The most important are:
* **rfdir** - List the files in the directory (used like ''ls'').
* **rfrename** - Renames and/or moves a file to a different directory (used like ''mv'').
* **rfmkdir** - Creates a new directory (used like ''mkdir'').
* **rfcp** - Copies files (used like ''cp''). Use the -r option to copy recursively.
* **rfrm** - Removes a file (used like ''rm'').
A longer list of commands can be found [[http://castor.web.cern.ch/castor/ug/|here]].
**NOTE:** Tab-completion does not work in castor!
===== How to store files on castor in a DaVinci-job =====
If you want to write a [[DaVinci::miniDST|miniDST]], it may be a good idea to store it on castor, as the (mini)DST files usually tend to be large.
To store them on castor, add a ''rfio:'' before the castor-path in your Python-options file:
DATAFILE='rfio:/castor/cern.ch/user/m/myusername/myfile.dst'
===== How to access files on castor in a DaVinci-job =====
To access your files on castor in DaVinci, use the prefix ''castor:'' in your path for the datafile, e.g.
DATAFILE='PFN:castor:/castor/cern.ch/user/m/myusername/myfile.dst'