Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:10:44

0001 # Auto generated configuration file
0002 # using: 
0003 # Revision: 1.381.2.17 
0004 # Source: /local/reps/CMSSW/CMSSW/Configuration/PyReleaseValidation/python/ConfigBuilder.py,v 
0005 # with command line options: exampleFilters -s RAW2DIGI,FILTER:hcallaserhbhehffilter2012_cff.hcallLaser2012Filter --data --python hcal_test_exampleFilters.py --no_exec --conditions auto:com10 --eventcontent RAW --datatier RAW -n 10 --no_exec --filein /store/data/Run2012B/SingleElectron/RAW-RECO/laserHCALskim_534p2_24Oct2012-v1/00000/541454BA-4E1F-E211-AC99-003048678B30.root
0006 
0007 
0008 # example of usage of the filter ** HcalLaserEventFilter2012 **
0009 # which is based on a list of laser-like events from 2012A,B,C :
0010 #
0011 #                    eventFileName = cms.string(os.getenv('CMSSW_BASE')+"/src/EventFilter/HcalRawToDigi/data/HCALLaser2012AllDatasets.txt.gz"),
0012 #
0013 # obtained from all datasets.
0014 # Such list has been defined using another filter HcalLaserHBHEHFFilter2012 which implements the actual laser candidate event definition
0015 # which is illustrated in this talk by Jeff Temple https://indico.cern.ch/getFile.py/access?contribId=1&resId=0&materialId=slides&confId=169318
0016 # PLUS the fix explained on slide 6 of G.F. https://indico.cern.ch/getFile.py/access?contribId=3&resId=0&materialId=slides&confId=169321
0017 
0018 # ** HcalLaserEventFilter2012  ** is meant to be used by all analyzes which use prompt 2012 datasets 
0019 # ** HcalLaserHBHEHFFilter2012 ** is also run in this configuration, for comparison
0020 
0021 import FWCore.ParameterSet.Config as cms
0022 
0023 process = cms.Process('exampleFilters')
0024 
0025 # import of standard configurations
0026 process.load('Configuration.StandardSequences.Services_cff')
0027 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0028 process.load('FWCore.MessageService.MessageLogger_cfi')
0029 process.load('Configuration.EventContent.EventContent_cff')
0030 process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
0031 process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff')
0032 process.load('Configuration.StandardSequences.RawToDigi_Data_cff')
0033 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0034 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0035 
0036 process.maxEvents = cms.untracked.PSet(
0037     input = cms.untracked.int32(-1)
0038 )
0039 
0040 # Input source
0041 process.source = cms.Source("PoolSource",
0042     secondaryFileNames = cms.untracked.vstring(),
0043 
0044     # FILTER and RECO were the names of the
0045     # process and subprocess of the first step of the skimming previous processing (534)                            
0046     inputCommands = cms.untracked.vstring('keep *',
0047                                           'drop *_*_*_FILTER',
0048                                           'drop *_*_*_RECO'
0049                                           ),
0050 
0051     # this file belong to the SKIM OF LASER_LIKE candidates => by construction filters return FALSE on all these events 
0052     # both HcalLaserHBHEHFFilter2012 and HcalLaserEventFilter2012 return TRUE / FALSE  for events which are    good-for-physics / laser-like 
0053     fileNames = cms.untracked.vstring('/store/data/Run2012A/Photon/RAW-RECO/20Nov2012-v2/00000/06538BB7-9B34-E211-93A1-003048678CA2.root')
0054 
0055 )
0056 
0057 process.options = cms.untracked.PSet(
0058 
0059 )
0060 
0061 # Production Info
0062 process.configurationMetadata = cms.untracked.PSet(
0063     version = cms.untracked.string('$Revision: 1.1 $'),
0064     annotation = cms.untracked.string('exampleFilters nevts:10'),
0065     name = cms.untracked.string('PyReleaseValidation')
0066 )
0067 
0068 # Output definition
0069 
0070 process.RAWoutput = cms.OutputModule("PoolOutputModule",
0071     splitLevel = cms.untracked.int32(0),
0072     eventAutoFlushCompressedSize = cms.untracked.int32(5242880),
0073     outputCommands = process.RAWEventContent.outputCommands,
0074     fileName = cms.untracked.string('exampleFilters_RAW2DIGI_FILTER.root'),
0075     dataset = cms.untracked.PSet(
0076         filterName = cms.untracked.string(''),
0077         dataTier = cms.untracked.string('RAW')
0078     ),
0079     SelectEvents = cms.untracked.PSet(
0080         SelectEvents = cms.vstring('filtering_step')
0081     )
0082 )
0083 
0084 # Additional output definition
0085 
0086 # Other statements
0087 from Configuration.AlCa.GlobalTag import GlobalTag
0088 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:com10', '')
0089 
0090 
0091 
0092 #################################################
0093 # this is the filter which uses the .txt.gz list of events to perform the rejection of laser-like candidates
0094 process.load('EventFilter.HcalRawToDigi.hcallasereventfilter2012_cfi')
0095 hcallasereventfilter2012=cms.EDFilter("HcalLaserEventFilter2012")
0096 #hcallasereventfilter2012=cms.EDFilter("HcalLaserEventFilter2012",
0097 #                                      # Specify laser events to remove in gziped file
0098 #                                      eventFileName = cms.string("EventFilter/HcalRawToDigi/data/HCALLaser2012AllDatasets.txt.gz"),
0099 #                                      # if verbose==true, run:ls:event for any event failing filter will be printed to cout
0100 #                                      verbose   = cms.untracked.bool(False),
0101 #                                      # Select a prefix to appear before run:ls:event when run info dumped to cout.  This makes searching for listed events a bit easier
0102 #                                      prefix    = cms.untracked.string(""),
0103 #                                      # If minrun or maxrun are >-1, then only a subsection of EventList corresponding to the given [minrun,maxrun] range are searched when looking to reject bad events.  This can speed up the code a bit when looking over a small section of data, since the bad EventList can be shortened considerably.  
0104 #                                      minrun    = cms.untracked.int32(-1),
0105 #                                      maxrun    = cms.untracked.int32(-1),
0106 #                                      WriteBadToFile = cms.untracked.bool(False), # if set to 'True', then the list of events failing the filter cut will be written to a text file 'badHcalLaserList_eventfilter.txt'.  Events in the file will not have any prefix added, but will be a simple list of run:ls:event.
0107 #                                      forceFilterTrue=cms.untracked.bool(False) # if specified, filter will always return 'True'.  You could use this along with the 'verbose' or 'WriteBadToFile' booleans in order to dump out bad event numbers without actually filtering them
0108 #                                      )
0109 
0110 
0111 
0112 #################################################
0113 # this is the filter from which uses RAW in input
0114 # it's this one which has been used to _determine_ the the .txt.gz list of events in the first place 
0115 process.load('EventFilter.HcalRawToDigi.hcallaserhbhehffilter2012_cfi')
0116 hcallaserhbhehffilter2012=cms.EDFilter("HcalLaserHBHEHFFilter2012")
0117 #process.hcallaserhbhehffilter2012 = cms.EDFilter("HcalLaserHBHEHFFilter2012",
0118 #    forceFilterTrue = cms.untracked.bool(False),
0119 #    filterHF = cms.bool(True),
0120 #    HBHEcalibThreshold = cms.double(15.0),
0121 #    verbose = cms.untracked.bool(False),
0122 #    minCalibChannelsHBHELaser = cms.int32(20),
0123 #    minCalibChannelsHFLaser = cms.int32(10),
0124 #    WriteBadToFile = cms.untracked.bool(False),
0125 #    digiLabel = cms.InputTag("hcalDigis"),
0126 #    prefix = cms.untracked.string(''),
0127 #    filterHBHE = cms.bool(True),
0128 #    CalibTS = cms.vint32(3, 4, 5, 6),
0129 #    minFracDiffHBHELaser = cms.double(0.3)
0130 #)
0131 
0132 
0133 
0134 
0135 
0136 
0137 
0138 #################################################
0139 # This is an example of my dummy analyzers
0140 #process.myHelloWorldAnalyzerONE = cms.EDAnalyzer('HelloWorldAnalyzer',
0141 #                        whatToSay   = cms.string('happyHappyONE')
0142 #                        )
0143 #
0144 #process.myHelloWorldAnalyzerTWO = cms.EDAnalyzer('HelloWorldAnalyzer',
0145 #                        whatToSay   = cms.string('happyHappyTWO')
0146 #                        )
0147 
0148 
0149 
0150 
0151 # this is the filter from which uses RAW in input
0152 # filter returns TRUE if event is good for physics; FALSE if it's a laser-like candidate
0153 process.hcallLaser2012Filter = cms.Sequence(process.hcallaserhbhehffilter2012)
0154 process.NOThcallLaser2012Filter = cms.Sequence(~process.hcallaserhbhehffilter2012)
0155 
0156 # this is the filter which uses the .txt.gz list of events to perform the rejection of laser-like candidates
0157 # filter returns TRUE if event is good for physics; FALSE if it's a laser-like candidate
0158 process.hcallEvent2012Filter = cms.Sequence(process.hcallasereventfilter2012)
0159 process.NOThcallEvent2012Filter = cms.Sequence(~process.hcallasereventfilter2012)
0160 
0161 # templates of your analysis code: whatever needs to be protected running after the HCAL laser filtering
0162 # process.myAnalysisONE        = cms.Sequence(process.myHelloWorldAnalyzerONE) 
0163 # process.myAnalysisTWO        = cms.Sequence(process.myHelloWorldAnalyzerTWO) 
0164 # process.myAnalysisTHREE      = cms.Sequence(process.myHelloWorldAnalyzerTHREE) 
0165 # process.myAnalysisFOUR       = cms.Sequence(process.myHelloWorldAnalyzerFOUR) 
0166 
0167 
0168 
0169 #################################################
0170 # Path and EndPath definitions
0171 process.raw2digi_step      = cms.Path(process.RawToDigi)
0172 # filtering_step determines the RAW output  
0173 process.filtering_step     = cms.Path(process.hcallEvent2012Filter)
0174 # the steps with your analysis, protected running after the HCAL laser filtering
0175 process.analysis_stepONE   = cms.Path(process.hcallLaser2012Filter    #* process.myAnalysisONE
0176                                       )
0177 process.analysis_stepTWO   = cms.Path(process.hcallEvent2012Filter    #* process.myAnalysisTWO
0178                                       )
0179 process.analysis_stepTHREE = cms.Path(process.NOThcallLaser2012Filter #* process.myAnalysisTHREE
0180                                       )
0181 process.analysis_stepFOUR  = cms.Path(process.NOThcallEvent2012Filter #* process.myAnalysisFOUR
0182                                       )
0183 process.endjob_step        = cms.EndPath(process.endOfProcess)
0184 process.RAWoutput_step     = cms.EndPath(process.RAWoutput)
0185 
0186 
0187 # Schedule definition
0188 process.schedule = cms.Schedule(process.raw2digi_step,
0189                 process.analysis_stepONE,
0190                 process.analysis_stepTWO,
0191                 process.analysis_stepTHREE,
0192                 process.analysis_stepFOUR,
0193                 process.filtering_step,
0194                 process.endjob_step,
0195                 process.RAWoutput_step)
0196 
0197 ## filter all path with the production filter sequence
0198 #for path in process.paths:
0199 #   getattr(process,path)._seq = process.hcallLaser2012Filter * getattr(process,path)._seq 
0200 
0201 process.options   = cms.untracked.PSet(
0202                         wantSummary = cms.untracked.bool(True),
0203                                     SkipEvent = cms.untracked.vstring('ProductNotFound')
0204                 )