cmsrel CMSSW_7_1_0
cd CMSSW_7_1_0/src
git cms-init
git clone SUSYBSMAnalysis/Zprime2muAnalysis


The goal of this exercise is to get you familiar with the muon timing measurement done in the DT and CSC subdetectors. The measurement of muon time-of-flight is done with a precision of about 1-2ns, allowing for things like identification of cosmic muons, muons from other bunch crossings and searches for exotic signals like HSCP (heavy stable charged particles). The RPC system is also performing a time measurement with a very high precision, but currently only the BX assignment is read out and stored.

The exercise is divided into three parts. In the first one we will read DT and CSC segments from the Event and take a first look at their timing. In the second part we match the segments to reconstructed muons and write an analyzer storing information about the muons and the timing measured with these segments in an ntuple. Finally in the third part we will analyze some aspects of the timing measurement. A basic knowledge of C++ and ROOT is assumed in the exercises. Having some experience with CMSSW will be beneficial, though it is not strictly necessary.

DT/CSC timing measurement

In CSC the time is measured on both the cathode and the anode, with the cathode measurement being dominant. The cathode pulse shape is sampled every 50ns and this digitized shape is fit with a template, and from this fit the hit time is extracted. The CSC time for a segment is determined by combining the times measured from matching cathode and anode hits. In the DTs the individual hits are in fact timing measurement, since DT determine hit position by measuring signal arrival time. To extract the timing of a muon one needs to first reconstruct a segment and then the timing can be extracted from deviations between individual hit positions and the segment position (see slides).

Accompanying slides:

Upload here

Creating the Working Area

First of all, setup an area that includes the necessary software used for the exercise.
For this exercise you need the GitHub account: make sure you have done pre-exercise 1.

ssh -Y
cp /afs/ ./
export SCRAM_ARCH=slc6_amd64_gcc530
cmsrel CMSSW_9_2_10
cd CMSSW_9_2_10/src
mkdir UserCode/CMSPOS
cd UserCode/CMSPOS

Main exercises

Part 1: Accessing segment timing

The first step is to access segments stored in the Event and write the timing information to an ntuple so that we can explore it's properties. We will run on /SingleMuon/Run2017C-PromptReco-v3/AOD, actually we can have enough statistics for quick checks without running CRAB but just manually running on the first file from the dataset
process.source = cms.Source("PoolSource",
    fileNames = cms.untracked.vstring('root://')
We will start by accessing the DT and CSC segment collections in the Event and getting the timing information. For CSC timing can be obtained from a CSCSegment directly by calling timeCSC = cscseg->time();, for DT we will take only the Phi component of DT 4D Segments so (after checking that it's present) we can call timeDT = dtseg->phiSegment()->t0();. Here's some things you need to include in your analyzer to access these:
// header files
#include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
#include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h"

#include "FWCore/Framework/interface/ESHandle.h"
#include "Geometry/Records/interface/GlobalTrackingGeometryRecord.h"
#include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h"

  // in the analyzer constructor
  cscSegmentToken_ = consumes<CSCSegmentCollection>(edm::InputTag("cscSegments"));
  dtSegmentToken_ = consumes<DTRecSegment4DCollection>(edm::InputTag("dt4DSegments"));

  // in the analyzer our can access CSC segment time by calling
  time = cscSegment->time();

  // in DT the timing is attached to 2D segments in one of the two projections - phi or theta, so to access it we need to refer to them
  // segments with time==999 have failed the timing calculation and should be ignored
  if (dtSegment->hasPhi() && dtSegment->phiSegment()->t0()!=999) 
      time = dtSegment->phiSegment()->t0();

  if (dtSegment->hasZed() && dtSegment->zSegment()->t0()!=999) 
      time = dtSegment->zSegment()->t0();

So your first task will be to write an EDAnalyzer that reads all CSC and DT segments from the Event and writes a root ntuple containing information about their timing and number of hits (can be accessed for both DT and CSC segments by calling segment->recHits().size()). Once we have our ntuple we can plot the time distribution separately for CSC segments and for Phi and Theta DT segments.

If you don't want to start from scratch a sample code skeleton is available in ...

The timing plots should be looking like this


A cut on the number of hits in a segment might clean up the picture a bit

Part 2: Matching segments to muons

To clean up the results a little we will only look at segments matched to muons. There is an easy way to do that since the muon code includes a MuonSegmentMatcher that for a given muon track returns a list of DT or CSC segments that were used to build the muon. (NOTE: taking hits directly from the muon track won't work since those are TrackingRecHits and here we need DT/CSC Segments, TrackingRecHits don't store the timing information).

We can modify our analyzer to loop over muons found in the Event and only look at segments attached to these muons. In face we will store in our ntuple for each muon some kinematics/ID information and DT/CSC timing information extracted from segments attached to the muon by taking the mean time from all segments. For DT segments we will apply a nHits>5 cut to drop low quality segments.

Part 3: Properties of the timing measurement

Now that we have a DT and CSC measurement attached to a muon we can play around with the ntuple and make some observations. Some things that can be checked:
  • The resolution of the DT and CSC time measurements
  • Compare the measurements from DT and CSC for the same muon
  • The behavior of timing when applying muon ID and pT cuts
  • Stability of mon timing vs Phi

These can be run on an the ntuple produced in the previous exercise, but I'm making a high-statistics version available, created by running over the whole /SingleMuon/Run2017C-PromptReco-v3/AOD dataset

-- PiotrTraczyk - 07 Jul 2014

Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r8 - 2017-09-02 - PiotrTraczyk
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback