Reconstruction of the Beam Spot

Complete: 4
Detailed Review status

Contact

  • Francisco Yumiceva

Introduction

The beam spot is the luminous region produced by the collisions of proton beams. The position and spread of the beam spot needs to be measured precisely because of the following reasons:

  • Important input for physics e.g. b-tagging, lifetime, etc.
  • For patter recognition (input for HLT and offline reconstruction).
  • Extraction of the tracking impact parameter resolution.
  • Quick check of global alignment.
  • Provide feedback to accelerator groups.
  • Beam monitor.

The algorithm used to calculated the transverse beam position is the so called d0-phi algorithm. This is a robust and fast χ2 fit which just needs 1000 good tracks to reach micron precision. Using a Log-Likelihood fit, the beam width can be extracted using 20000 good tracks. A more detail description can be found in the CMS Note 2007/021.

Access to the beam spot data

The beam spot data is stored in RECO, AOD, and PAT datasets. This collection can be accessed from an analyzer in CMSSW as follows:

#include "DataFormats/BeamSpot/interface/BeamSpot.h"

// within the analyze()
reco::BeamSpot beamSpot;
edm::Handle<reco::BeamSpot> beamSpotHandle;
iEvent.getByLabel("offlineBeamSpot", beamSpotHandle);

if ( beamSpotHandle.isValid() )
{
    beamSpot = *beamSpotHandle;

} else
{
    edm::LogInfo("MyAnalyzer")
      << "No beam spot available from EventSetup \n";
}

double x0 = beamSpot.x0();
double y0 = beamSpot.y0();
double z0 = beamSpot.z0();
double sigmaz = beamSpot.sigmaZ();
double dxdz = beamSpot.dxdz();
double BeamWidth = beamSpot.BeamWidth();
// print the beam spot object
// cout << beamSpot << endl;

// look at BeamSpot.h in DataFormats package 
// for a complete list of member functions for
// the beam spot object

Status of the Beam spot in MC samples

Simulation of the beam spot

The generated particles have the production vertex at the origin (0,0,0) of the coordinate system. Therefore, to simulate a realistic luminous region the vertices of the generated particles are smeared by a Gaussian distribution in Z, and by the accelerator beta function for the transverse plane. In the case of the presence of beams with a crossing angle, the momentum of the particles are also corrected by a Lorentz boost.

The vertex smearing (and Lorentz boost) should be included in the simulation sequence by calling one of the vertex smearing modules available in "Configuration/StandardSequences", for example:

process.load("Configuration.StandardSequences.VtxSmearedEarly10TeVCollision_cff")

The following configuration files are available for several beam conditions:

  • VtxSmearedEarly900GeVCollision_cff.py
  • VtxSmearedEarly10TeVCollision_cff.py
  • VtxSmearedBetafuncEarlyCollision_cff.py
  • VtxSmearedBetafuncNominalCollision_cff.py

The values of the parameters for each beam condition can be found in the file "IOMC/EventVertexGenerators/python/VtxSmearedParameters_cfi.py". In addition to the vertex smearing by the beta function, there are options to smear the vertices by a flat or Gaussian distributions, see the "IOMC/EventVertexGenerators" package for more details.

Reconstruction of the beam spot

In order to provide a beam spot data in MC samples, we first generate and reconstruct a QCD sample with a given beam conditions. Then, the beam spot analysis code is run to fit the data and extract the beam spot position, spread, and errors. Finally, the beam spot data is loaded into the conditions database so when the reconstruction is run, the beam spot data is copied from the database to the event and it is stored in RECO as an EDM collection.

(need to fix this) Get beam position from the event (Recommended method)

Since 170pre4, the beam spot data is available in the event. Skip to step 3 to learn how to access the beam spot data in this case.

In releases < 170pre4 for example in 168, you can get the beam spot from the event after the following steps:

1. Get recent version of beam spot producer:

addpkg RecoVertex/BeamSpotProducer
2. Enable beam spot Producer. In your analysis configuration cfg file by adding the following line
include "RecoVertex/BeamSpotProducer/data/BeamSpotSimpleGaussian.cff  // for official samples
// or use one of the following for the test samples (see above):
// BeamSpotEarlyCollision.cff, BeamSpotNominalCollision.cff, BeamSpotNominalCollision1.cff,
// BeamSpotNominalCollision2.cff, BeamSpotNominalCollision3.cff, BeamSpotNominalCollision4.cff

If you have your own beam spot in a sqlite file or in the DB, you can modify the cff file above to read your beam spot with the respective tag name.

3. In your analyzer include the beam spot data format and get the data:

#include "DataFormats/BeamSpot/interface/BeamSpot.h"

reco::BeamSpot vertexBeamSpot;
edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
iEvent.getByType(recoBeamSpotHandle);
vertexBeamSpot = *recoBeamSpotHandle;

4. Access the reco::BeamSpot member functions, see the reference manual

5. An example to read the Beam Spot data from the DB and save it as EDCollection in a root file is given in the following cfg file:

RecoVertex/BeamSpotProducer/readFromProducer.cfg

Get beam position from the database

Packages needed for releases 1.3.X and 1.4.X:

cvs co -r V00-00-00 CondCore/BeamSpotPlugins
cvs co -r V00-00-01 CondFormats/BeamSpotObjects
cvs co -r V02-01-01 CondFormats/DataRecord
cvs co -r V00-00-05 RecoVertex/BeamSpotProducer
cvs co -r V00-00-03 DataFormats/BeamSpot

Packages needed for releases 1.5.0pre2:

cvs co -r V00-00-05 RecoVertex/BeamSpotProducer
cvs co -r V00-00-04 DataFormats/BeamSpot

Currently, the beam spot information in the DB can be accessed through a sqlite file. The files needed to run this example can be downloaded here: BeamSpot.db and conddbcatalog.xml

Add the following includes and lines in your code to access the data:

#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/IOVSyncValue.h"
#include "CondFormats/DataRecord/interface/BeamSpotObjectsRcd.h"
#include "CondFormats/BeamSpotObjects/interface/BeamSpotObjects.h"

void
BeamSpotFromDB::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
{
        edm::ESHandle< BeamSpotObjects > beamhandle;
        iSetup.get<BeamSpotObjectsRcd>().get(beamhandle);
        const BeamSpotObjects *mybeamspot = beamhandle.product();

        std::cout << *mybeamspot << std::endl;
}
Look at the BeamSpotObjects class for more information about how to get all the parameters.

In your configuration file, add the following lines:

include "CondCore/DBCommon/data/CondDBCommon.cfi"
  replace CondDBCommon.connect = "sqlite_file:BeamSpot.db"    
  replace CondDBCommon.catalog = "file:conddbcatalog.xml"
  es_source = PoolDBESSource { 
    using CondDBCommon
    VPSet toGet = { 
          { string record = "BeamSpotObjectsRcd" string tag = "SimpleGaussian" } 
    }    
  } 

Determination of beam position using an EDAnalyzer

In this section, we describe how to calculate the beam spot parameters using a set of good tracks. To reach a precision in the order of microns, it is necessary to loop over several events in a sample to collect at least 1000 good tracks.

1. Install CMSSW release 1_6_8. Please see Setting up your Computing Environment

2. Checkout packages:

addpkg RecoVertex/BeamSpotProducer
4. Run over some events. In this example, we run over CSA07 QCD events:
cd RecoVertex/BeamSpotProducer/test
edit analysis_d0_phi.cfg:
[-> in PoolSource add a dataset, for example ->] '/store/mc/2007/7/11/CSA07-QCD_Pt_80_120-2027/0001/0001F088-9832-DC11-A133-000423DCF6B8.root' 
[-> comment out the input file ->] #include "RecoVertex/BeamSpotProducer/test/NominalCollision4.cff"
now run cmsRun:
cmsRun analyze_d0_phi.cfg
The relevant output is the following:
calculating beam spot...
 we will use 7390 good tracks out of 28994
 number of tracks used: 0
 number of tracks used: 7390
 number of tracks used: 7390
 number of tracks used: 7390
 number of tracks used: 7390
 number of tracks used: 7390
 number of tracks used: 7390
 number of tracks used: 7384
 number of tracks used: 7373
 number of tracks used: 7359
 number of tracks used: 7337
 number of tracks used: 7301
 number of tracks used: 7244
 number of tracks used: 7189
 number of tracks used: 7129
 number of tracks used: 7013
 number of tracks used: 6787
 number of tracks used: 6382
 number of tracks used: 5665
 number of tracks used: 4615
 total number of iterations = 19
BSFitter: default fit does not extract beam width, assigning a width of zero.
 DEFAULT:
-----------------------------------------------------
            Calculated Beam Spot

   X0 = 0.000137297 +/- 8.54651e-05 [cm]
   Y0 = 1.45161e-05 +/- 8.72648e-05 [cm]
   Z0 = 0.178271 +/- 0.762762 [cm]
 Sigma Z0 = 4.69784 +/- 0.577968 [cm]
 dxdz = 3.60997e-06 +/- 1.61885e-05 [radians]
 dydz = -5.41738e-05 +/- 1.6445e-05 [radians]
 Beam Width = 0 +/- 0 [cm]
-----------------------------------------------------

This sample was generated at (0,0,0) with no crossing-angles, a RMS bunch length in Z of 5.3 cm and the average transverse beam width is of 15 microns. The beam width can be extracted using the log likelihood fit implemented in this package which requires more tracks and a tighten track quality criteria.

5. Track quality cuts can be modified via the framework, see the configuration file

data/d0_phi_analyzer.cff

Online Beam Spot

In preparation.

Upload new beam spot conditions

Action items

  • Beam spot monitoring: * Implement a fast DQM monitoring after HTL which run the full tracking reconstruction by lumi blocks and calculate the beam position. * Implement a DQM monitoring in the in AlCaReco skims. * Displays for the CMS control room of the beam position by the Tracker and by the LHC BPMs.
  • Online beam spot: * Can we run the d0-phi method in the HLT? * Can we use the primary vertex finding in the HLT to estimate the beam position?
  • Feedback the beam spot position to the LHC.
  • Offline beam spot:
    • We are assuming that the beam width is the same in X and Y, we could change the code to take into account the possibility of different beam widths in X and Y.
    • Compare d0-phi method against the primary vertex finding method.

Review status

Reviewer/Editor and Date (copy from screen) Comments
KatiLassilaPerini - 13 Jan 2009 moved from wb to swguide
FranciscoYumiceva - 10 Feb 2007 first version of page

Responsible: FranciscoYumiceva
Last reviewed by: FranciscoYumiceva - 1 Feb 2008

Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng 75511ce7f520a4d76f51938f35e05981.png   manage 0.3 K 2007-02-10 - 22:08 UnknownUser  
Unknown file formatdb BeamSpot.db r1 manage 48.0 K 2007-04-03 - 06:00 FranciscoYumiceva sqlite file with beam spot parameters
XMLxml conddbcatalog.xml r1 manage 0.3 K 2007-04-24 - 17:10 FranciscoYumiceva  
Edit | Attach | Watch | Print version | History: r47 | r42 < r41 < r40 < r39 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r40 - 2009-03-18 - FranciscoYumiceva



 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CMSPublic All webs login

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