Skip to content

Commit

Permalink
README formatting fix #1
Browse files Browse the repository at this point in the history
  • Loading branch information
pjurgielewicz authored and mmusich committed Mar 10, 2021
1 parent 406d1e5 commit 0a15676
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -4,4 +4,4 @@ __init__.py
.#*
#*#
*~
*.pb
*.pb
30 changes: 15 additions & 15 deletions DQM/SiPixelPhase1Analyzer/README.md
Expand Up @@ -5,14 +5,14 @@ The aim of this package is to provide a convinient way to present standard Pixel

Imagine a standard histogram of Pixel Forward Detector where bins are simple squares with assigned fixed coordinates (x - disk, y - blade number) - it is not easy to visualize, how exactly bin entries are represented in the detector layout.

Here comes this package - it creates histograms with bins which are laid out in space in a very similar way to the real detector. In case of Forward Detector bins create fans in XY-space.
Here comes this package - it creates histograms with bins which are laid out in space in a very similar way to the real detector. In case of Forward Detector bins create fans in XY-plane.

Two modes of operation
----------------------

This package can operate in two modes:
1. *MODE_REMAP* -- it requires file with Oline histograms that will be remapped to Offline histograms
2. *MODE_ANALYZE* -- takes file to analyze collections contained in events
1. *MODE_REMAP* - it requires file with Oline histograms that will be remapped to Offline histograms
2. *MODE_ANALYZE* - takes file to analyze collections contained in events

How are bins booked and what kind of histograms may be produced
---------------------------------------------------------------
Expand All @@ -21,10 +21,10 @@ To obtain global position of each module of the Pixel Detector GeomDet::surface(

Types of booked histograms:

- barrel_layer_n, [1,...,4],
- barrel_summary (keeps all 4 layers in one histogram),
- forward_disk_n, [-3,...,3],
- forward_summary (keeps all 6 disks in one histogram like here, disks on the negative side of x-axis correspond to disks on the negative side of the barrel, the higher the center of the disk the higher is also disk number).
- `barrel_layer_n`, [1,...,4],
- `barrel_summary` (keeps all 4 layers in one histogram),
- `forward_disk_n`, [-3,...,3],
- `forward_summary` (keeps all 6 disks in one histogram like here, disks on the negative side of x-axis correspond to disks on the negative side of the barrel, the higher the center of the disk the higher is also disk number).

Barrel histograms do not differ much from Online barrel histograms. Here is just Offline naming convention used. X axis represents global z-coordinate when y axis is a simple offline ladder number.

Expand All @@ -39,15 +39,15 @@ How to configure the package
----------------------------

1. *MODE_REMAP*
* it is required to provide a dummy file with at least one event to make the analyze() method fire ('fileNames = cms.untracked.vstring("file:RECO_file.root")')
* set 'opMode = cms.untracked.uint32(MODE_REMAP)'
* give a file in which histograms to remap will be searched for 'remapRootFileName = cms.untracked.vstring("dqmFile.root")'
* 'baseHistogramName', 'pathToHistograms' and 'isBarrelSource' are closely related to each other because every nth element describes one histogram set that will be remapped.
The plugin will be looking for all histograms which names are provided in 'baseHistogramName' in a corresponding directory 'pathToHistograms' in file 'remapRootFileName' and assumes it is of type (Barrel/Forward : 1/0) as specified in 'isBarrelSource'. If everything goes fine there will be produced output file with histograms contained in directories which are named exactly the same as entries in 'baseHistogramName'. Besides of booking new histograms each directory contains also source histograms from the original file. If there is a problem with opening source histogram it will be skipped.
* it is required to provide a dummy file with at least one event to make the analyze() method fire (`fileNames = cms.untracked.vstring("file:RECO_file.root")`)
* set `opMode = cms.untracked.uint32(MODE_REMAP)`
* give a file in which histograms to remap will be searched for `remapRootFileName = cms.untracked.vstring("dqmFile.root")`
* `baseHistogramName`, `pathToHistograms` and `isBarrelSource` are closely related to each other because every nth element describes one histogram set that will be remapped.
The plugin will be looking for all histograms which names are provided in `baseHistogramName` in a corresponding directory `pathToHistograms` in file `remapRootFileName` and assumes it is of type (Barrel/Forward : 1/0) as specified in `isBarrelSource`. If everything goes fine there will be produced output file with histograms contained in directories which are named exactly the same as entries in `baseHistogramName`. Besides of booking new histograms each directory contains also source histograms from the original file. If there is a problem with opening source histogram it will be skipped.
2. *MODE_ANALYZE"
* set your input file ('fileNames = cms.untracked.vstring("file:RECO_file.root")')
* set 'opMode = cms.untracked.uint32(MODE_ANALYZE)'
* set the source collection of your inputs 'src = cms.InputTag("generalTracks")', at this point of development only recHits are allowed -- these are extracted from collection of tracks
* set your input file (`fileNames = cms.untracked.vstring("file:RECO_file.root")`)
* set `opMode = cms.untracked.uint32(MODE_ANALYZE)`
* set the source collection of your inputs `src = cms.InputTag("generalTracks")`, at this point of development only `recHits` are allowed - these are extracted from collection of tracks
After running the code in this mode user should get a root file which contains the distribution of __something__ in Barrel and Forward Detector.
DEBUG mode
Expand Down
2 changes: 1 addition & 1 deletion DQM/SiPixelPhase1Analyzer/plugins/SiPixelPhase1Analyzer.cc
Expand Up @@ -190,7 +190,7 @@ void SiPixelPhase1Analyzer::BookBarrelHistograms(TDirectory* currentDir, const s
th2p->SetFloat();

th2p->GetXaxis()->SetTitle("");
th2p->GetYaxis()->SetTitle("z [cm]");
th2p->GetYaxis()->SetTitle("~ladder");

th2p->SetOption("COLZ L");

Expand Down
17 changes: 3 additions & 14 deletions DQM/SiPixelPhase1Analyzer/python/ConfFile_cfg.py
@@ -1,29 +1,19 @@
# process = cms.Process("Demo")

# process.load("FWCore.MessageService.MessageLogger_cfi")

# process.source = cms.Source("PoolSource",
# # replace 'myfile.root' with the source file you want to use
# fileNames = cms.untracked.vstring(
# 'file:myfile.root'
# )
# )
import FWCore.ParameterSet.Config as cms

process = cms.Process("SiPixelPhase1Analyzer")
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring(
'/store/relval/CMSSW_9_0_0_pre4/RelValTTbar_13/GEN-SIM-DIGI-RAW/90X_upgrade2017_realistic_v6-v1/10000/12DD2CF5-C8EC-E611-BF61-0CC47A4C8F08.root'
#"file:RECO_file.root"
# '/store/relval/CMSSW_9_0_0_pre4/RelValTTbar_13/GEN-SIM-DIGI-RAW/90X_upgrade2017_realistic_v6-v1/10000/12DD2CF5-C8EC-E611-BF61-0CC47A4C8F08.root'
"file:RECO_file.root"
)
)

MODE_ANALYZE = 0
MODE_REMAP = 1

process.demo = cms.EDAnalyzer('SiPixelPhase1Analyzer',
opMode = cms.untracked.uint32(MODE_REMAP),
opMode = cms.untracked.uint32(MODE_ANALYZE),
src = cms.InputTag("generalTracks"),
debugFileName = cms.untracked.string("debug.txt"),

Expand All @@ -49,7 +39,6 @@
from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, '90X_upgrade2017_realistic_v6', '')

# 90X_upgrade2017_realistic_v6
# auto:phase1_2017_realistic

# Output root file name:
Expand Down

0 comments on commit 0a15676

Please sign in to comment.