For the most recent version of these instructions, click here.

Instructions for the Muon CSC Example

CMSSW_0_9_0_pre2

Michael Schmitt / Northwestern University
schmittm@lotus.phys.northwestern.edu
Last modified: Sun Aug 13 09:48:53 CDT 2006

Overview

These instructions show you how to compile and run a CMSSW program which will take a raw input data file (typically in root format), and produce muon segments, as follows:
  1. read in the raw data events and unpack the EMU detectors
  2. create all the DIGI's
  3. find 2D local space-points, called "recHits"
  4. find "segments," ie, short portions of muon tracks
I have provided some crude analysis / debugging routines as well, to help you get started with your own analysis.

At Northwestern, to work at the LPC:

LPC only:
kinit -n [userid]
xhost + cmsuafng.fnal.gov
ssh -t cmsuafng.fnal.gov

Fundamentals

source /afs/fnal.gov/files/code/cms/setup/cshrc uaf  [LPC only]
setenv SCRAM_ARCH `scramv1 arch`

Install Code & Compile it (2-August-2006)

First, create an area and declare CMSSW project.
mkdir ~/DEV
cd ~/DEV
scramv1 project CMSSW CMSSW_0_9_0_pre2
cd CMSSW_0_9_0_pre2/src
project CMSSW
at the LPC only:
cmscvsroot CMSSW
cvs login
[98passwd]
Next, check out the necessary packages:
cvs co -r CMSSW_0_9_0_pre2 EventFilter/CSCRawToDigi
cvs co -r CMSSW_0_9_0_pre2 CondFormats/CSCObjects
cvs co -r CMSSW_0_9_0_pre2 RecoLocalMuon/CSCRecHit
(Note that you do not necessarily need all of these packages.
The most vital one is RecoLocalMuon/CSCRecHit.)

As of 2-August, one routine needs to be checked out from the head. It should be tagged for CMSSW_0_9_0_pre3.

cvs co -r HEAD EventFilter/CSCRawToDigi/src/CSCDCCExaminer.cc

Get copies of the "private" routines that Michael wrote as a starting point. (Notice the periods at the end!)
These routines are meant to be for your analysis. You can get an idea of how to hook your own routines into the CMSSW framework: aside from the routines you need to list them in the BuildFile file. Without that, the routines will not be "known" to CMSSW.

cd RecoLocalMuon/CSCRecHit/test/
cp -v ~schmittm/DEV14/CMSSW_0_9_0_pre2/src/RecoLocalMuon/CSCRecHit/test/myRoutines.cc .
cp -v ~schmittm/DEV14/CMSSW_0_9_0_pre2/src/RecoLocalMuon/CSCRecHit/test/myRoutines.h .
cp -v ~schmittm/DEV14/CMSSW_0_9_0_pre2/src/RecoLocalMuon/CSCRecHit/test/BuildFile .
cp -v ~schmittm/DEV14/CMSSW_0_9_0_pre2/src/RecoLocalMuon/CSCRecHit/test/mtccproc.cfg .

Notice!
It can be difficult to get these files when working on lxplus.
I have allowed access to this area for various people. If you try to copy these files and run into trouble, send me an e-mail and I will add you to the ACL list. (Make sure you tell me your userID on lxplus.)

Meanwhile I have copied the current version of all these files to ~schmittm/public/ on lxplus where you can get at them, I hope.


Compile the code.

cd ~/DEV/CMSSW_0_9_0_pre2/src
eval `scramv1 runtime -csh`
scramv1 b
This will take several minutes.
 
Sometimes there will be an error that indicates a missing symbol (basically, getStrips from the strip DIGI):
@@@@ Checking shared library for missing symbols: 
tmp/slc3_ia32_gcc323/src/RecoLocalMuon/CSCRecHit/test/libCSCRecHitReader.so: undefined symbols
  _ZNK12CSCStripDigi8getStripEv
        needed by tmp/slc3_ia32_gcc323/src/RecoLocalMuon/CSCRecHit/test/libCSCRecHitReader.so
If that occurs, then try scramv1 b a second time.

Running

In order to run the CMSSW executable, try this:
cd ~/DEV/CMSSW_0_9_0_pre2/src/RecoLocalMuon/CSCRecHit/test

eval `scramv1 runtime -csh`

cmsRun mtccproc.cfg
The program may "sit" there for a while before showing anything on the screen. This is normal.
If you see an error:
  ConvertFile::ConvertFile() File file:./mtcc.root was not found.
then you need to make a soft link to a real file -- see below.

If the job runs successfully, then you should see something like this:

Runs
  Run 1503 /Run
/Runs

InputSourceClass PoolSource /InputSourceClass
EventsRead 10 /EventsRead
/InputFile

The configuration file is mtccproc.cfg and it looks like this:

process TEST = {

#
# Use this if the file is "new" and written with CMSSW_0_9_0_pre2 or later.
#       source = PoolSource {
#                untracked vstring fileNames = {"file:./mtcc.root"}
#                untracked int32 maxEvents = 10
#                untracked uint32 debugVebosity = 10
#                untracked bool   debugFlag     = false
#               }

#
# Use this if the file is "old" and written with CMSSW_0_8_0_xxxx
         source = PoolConvert {
                 untracked vstring fileNames = {"file:./mtcc.root"}
                 untracked int32 maxEvents = 10
         }

        module out = PoolOutputModule {
                untracked string fileName ="csc_events.root"
        }

        module cscunpacker = CSCDCCUnpacker {
          untracked bool Debug = false
          untracked bool PrintEventNumber = false
# 0_8_0_pre2   untracked string theMappingFile = "../../../CondFormats/CSCObjects/test/csc_slice_test_map.txt"
          FileInPath theMappingFile = "CondFormats/CSCObjects/test/csc_slice_test_map.txt"
          untracked bool UseExaminer = true
          untracked uint32 ErrorMask = 0xDFCFEFFF 
          untracked uint32 ExaminerMask = 0x7FB7BF6
                             } 

        service = Timing { }
        service = SimpleMemoryCheck { }

        include "Geometry/MuonCommonData/data/muonIdealGeometryXML.cfi"
        include "Geometry/CSCGeometry/data/cscGeometry.cfi"
        # include "MagneticField/Engine/data/volumeBasedMagneticField.cfi"

        include "RecoLocalMuon/CSCRecHit/data/CSCRecHit2DProducer.cfi"
        module rechitproducer = CSCRecHit2DProducer{
             string CSCStripDigiProducer = "cscunpacker"
             string CSCWireDigiProducer  = "cscunpacker"
             int32 no_of_chamber_types = 9
             vstring algo_types = { 
                                    "CSCRecHit2DFromStripsAndWires",
                                    "CSCRecHit2DFromORedStrips"
                                   }
             VPSet algo_psets = {
                                    {using common_params}, 
                                    {using common_params} 
                                }
             vint32 algo_per_chamber_type = { 2, 1, 1, 1, 1, 1, 1, 1, 1 }
             untracked bool debug = true
        }


        include "RecoLocalMuon/CSCSegment/data/CSCSegmentAlgorithmSK.cfi"
        include "RecoLocalMuon/CSCSegment/data/CSCSegmentAlgorithmTC.cfi"

        module segmentproducer = CSCSegmentProducer {
                # Name of RecHitProducer producer module(s)...
                string CSCRecHit2DProducer = "rechitproducer"
                # Choice of the building algo: 1 SK, 2 TC...
                int32 algo_type = 1  
                # std::vector
                VPSet algo_psets = {
                        {using CSCSegAlgoSK}, {using CSCSegAlgoTC}
                }
        }

        module mine = myRoutines{
        }

        path p = {cscunpacker, rechitproducer, segmentproducer, mine}
#       endpath e = {out}
}

As you can see,


Data Files

I have example MTCC data files you can use:

It is not obvious how long the files will remain in these temporary areas.

In order to get these files yourself, or to get other files, you need to use CASTOR which is a general file-storage system at CERN.

In order to find what files are available, try:

nsls -l /castor/cern.ch/cms/emuslice/globaldaq/
and to copy a file to your own disk, use
rfcp /castor/cern.ch/cms/emuslice/globaldaq/   
Note that this can take several minutes.

We will try to hand-pick some "good" files and make them available to everyone, as well as specify some useful information about them. This will take some time.