Dead and noisy channels masking
General description
There are some channels that don't work properly. Generally we can divide this channels into two groups:
- dead channels (do not answer)
- noisy channels (answer to much)
The purpose of dead and noisy channels masking is to exclude both groups of channels from simulation and reconstruction.
Steps that have to be taken
Out of software:
- retrieve list of dead and noisy channels
- convert this list to XML file
In Software:
The software part of dead and noisy channels masking takes place during digitalization.
Common part for every detectors
parse XML file and create AnalysisMask
This step of masking takes part directly in software. In order to parse XML and create
AnalysisMask(
TotemCondFormats/DAQInformation/interface/AnalysisMask.h
) we should use DAQMappingSourceXML class (
TotemCondFormats/DAQInformation/plugins/DAQMappingSourceXML.cc
). To use this class we have to include in our configuration file a special module. We have to also provide mapping files and XML files containing dead & noisy channels. Sample configuration files will be later presented in this document.
Roman Pots
retrieve list of dead and noisy channels
The list of dead and noisy channels can be obtained by using extract_vfat_channels script written by Dominik Mierzejewski. The description of this script can be found at
https://twiki.cern.ch/twiki/bin/view/TOTEM/CompComTools.
convert this list to XML file
To convert this list to XML file we can use deadChannelsToXML.py which is described at
https://twiki.cern.ch/twiki/bin/view/TOTEM/CompComTools.
use AnalysisMask in order to exclude channels from simulation and reconstruction
To exclude channels from simulation or reconstruction we have to simply check whether an
AnalysisMask contains this channels and then (if it is true) remove this channels from vector (or sth similar) of channels. For Roman Pots it is done in:
Reconstruction:
In class
TotemRawData (
TotemRawData/RawToDigi/plugins/Raw2DigiProducer.cc
) in method rpDataProduce
Simulation:
In class
RPDigiProducer (
SimTotem/RPDigiProducer/src/RPDigiProducer.cc
)
In method beginJob (after software migration it is very likely that this method will change to beginRun)
- removing dead and noisy channels
In method produce, using
DeadChannelsManager (
SimTotem/RPDigiProducer/src/DeadChannelsManager.cc
)
Sample configuration file
In reconstruction dead and noisy channels are always excluded. However in simulation it is not necessary, hence a special flag indicating whether we want to simulate dead channels or not was introduced. A sample configuration file can be found in the repository:
TotemCondFormats/DAQInformation/test/prodRPinelastic90Energy7TeV_cfg_withDeadChannels.py
.
The new part is:
process.load('TotemCondFormats.DAQInformation.DAQMappingSourceXML_cfi')
# mapping files
process.DAQMappingSourceXML.mappingFileNames.append('TotemCondFormats/DAQInformation/data/rp_220.xml') #load all mapping files
process.DAQMappingSourceXML.mappingFileNames.append('TotemCondFormats/DAQInformation/data/rp_147.xml')
process.DAQMappingSourceXML.mappingFileNames.append('TotemCondFormats/DAQInformation/data/t1_all.xml')
process.DAQMappingSourceXML.mappingFileNames.append('TotemCondFormats/DAQInformation/data/t2_4quarters.xml')
# mask files
process.DAQMappingSourceXML.maskFileNames.append('TotemCondFormats/DAQInformation/data/deadChannels_220.xml') #load configuration files
process.DAQMappingSourceXML.maskFileNames.append('TotemCondFormats/DAQInformation/data/deadChannels_147.xml') #for both stations
process.RPSiDetDigitizer.simulateDeadChannels = cms.bool(True) #this flag (set to true) indicates that we want to take
#into account dead channels
NOTE
If you need more specific documentation, please look into source code of class mentioned in this documentation. Important parts of the code are documented in the repository.
NOTE2
All scripts presented in this section (extract_vfat_channels, deadChannelsToXML.py)
works only for Roman Pots.
--
JakubSmajek - 02-Sep-2011
T1 detector
retrieve raw list of dead and noisy channels
The list of dead and noisy channels can be obtained by using
T1DeadChannelAnalyzer that is similar to
T1XMLDataDigiProducer.
T1DeadChannelAnalyzer count hits per channel and saves it in the map: encoded_channel_number -> number_of_hits.
where:
encoded_channel_number = 1000000 * arm + 100000 * plane + 10000 * chamber + 1000 * channelType + channelNumber;
You can run
T1DeadChannelAnalyzer using sample configuration file:
import FWCore.ParameterSet.Config as cms
process = cms.Process("T1ChannelsHitRate")
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(NUMBER_OF_EVENTS)
)
process.load("Configuration.TotemCommon.LoggerMin_cfi")
# raw data source
process.source = cms.Source("RawDataSource",
verbosity = cms.untracked.uint32(0),
eventsToCheck = cms.uint32(10),
skipCorruptedEvents = cms.bool(False),
performChecks = cms.bool(True),
setRunNumberFromFileName=cms.bool(False),
fileNames = cms.untracked.vstring('PATH_TO_RAW_DATA')
)
process.DAQInformationSourceXML = cms.ESSource("DAQInformationSourceXML",
xmlFileName = cms.string('TotemRawData/RawToDigi/python/T1_all_0.xml')
)
process.t1raw2digi = cms.EDAnalyzer("T1DeadChannelDataAnalyzer",
verbosity = cms.untracked.uint32(0),
deadCutValue= cms.untracked.uint32(150),
noiseCutValue= cms.untracked.uint32(10),
)
process.o1 = cms.OutputModule("PoolOutputModule",
fileName = cms.untracked.string('./recoT1_091101_mux.root'),
outputCommands=cms.untracked.vstring('drop totemRawEvent_*_*_*')
)
process.p1 = cms.Path(process.t1raw2digi)
process.outpath = cms.EndPath(process.o1)
it is advised to set NUMBER_OF_EVENTS > 10 000.
deadCutValue and noiseCutValue is used when checking if channel is dead or noisy.
By default deadCutValue = 200 and noiseCutValue = 9.
it means that channel is considered dead if it's hits number is less or equal than average_number_of_hits_per_channel_in_plane / deadCutValue
channel is considered as noisy when it's hits number is greater or equal then average_number_of_hits_per_channel_in_plane * noiseCutValue
At the end of processing all channels that are considered dead or noisy are printed.
The output has format:
arm:plane:chamber:channel_type:channel_number
Example:
$ cmsRun T1DeadChannelAnalyzer_runner.py > rawDeadChannelsList.txt
Create XML file with dead and noisy channels
rawDeadChannelsList.txt has to be changed to XML file.
To do that i wrote
T1RawDeadChannelsToXML.py that parse rawDeadChannelsList.txt file and prints xml format file -
T1DeadChannelsList.xml
to run it:
$ python T1RawDeadChannelsToXML.py rawDeadChannelsList.txt > T1DeadChannelsList.xml
XML file format:
<top>
<t1_detector_set id="100">
<t1_arm id="0">
<t1_plane id="1">
<t1_csc id="2">
<t1_channel_type id="1" full_mask="no">
<channel id="44"/>
<channel id="55"/>
</t1_channel_type>
<t1_channel_type id="2" full_mask="yes"/>
<t1_channel_type id="3" full_mask="no">
<channel id="220"/>
<channel id="129"/>
</t1_channel_type>
</t1_csc>
</t1_plane>
</t1_arm>
</t1_detector_set>
</top>
Chart presenting number of hits per channel in T1 detector
use AnalysisMask in order to exclude channels from simulation and reconstruction
To exclude channels from simulation or reconstruction we have to simply check whether an
AnalysisMask contains this channels and then (if it is true) skip operation. For T1 it is done in:
Reconstruction:
In class (
TotemRawData/RawToDigi/plugins/Raw2DigiProducer.cc
) in method
T1DataProduce
Simulation:
In classes:
T1DigiProducer (
SimTotem/T1DigiProducer/src/T1DigiProducer.cc
)
T1Digitizer (
SimTotem/T1DigiProducer/src/T1Digitizer.cc
)
T1WireElectronicsSim (
SimTotem/T1DigiProducer/src/T1WireElectronicsSim.cc
)
T1StripElectronicsSimStandard (
SimTotem/T1DigiProducer/src/T1StripElectronicsSimStandard.cc
)
T1StripElectronicsSimVfat (
SimTotem/T1DigiProducer/src/T1StripElectronicsSimVfat.cc
)
In method beginJob of
T1DigiProducer (after software migration it is very likely that this method will change to beginRun)
- removing dead and noisy channels
In method produce, using
T1DeadChannelsManager (
SimTotem/T1DigiProducer/src/T1DeadChannelsManager.cc
)
Sample configuration file
In reconstruction dead and noisy channels are always excluded. However in simulation it is not necessary, hence a special flag indicating whether we want to simulate dead channels or not was introduced.
The new part is:
process.load('TotemCondFormats.DAQInformation.DAQMappingSourceXML_cfi')
# mask files
process.DAQMappingSourceXML.maskFileNames.append('PATH_TO_T1_DEAD_CHANNEL_LIST') #load configuration files
process.T1Digis.simulateDeadChannels = cms.bool(True) #this flag (set to true) indicates that we want to take dead channels into account.
--
MarcinBorratynski - 08-Sep-2011