Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
This is a two step process.

1) First step:
run HLT on RAW data and store RAW+DataScouting event content.
Make sure you use the same CMSSW release used to collect the data.

2) Second step:
run RECO on the output of 1) and store AOD+DataSouting event content
Make sure you use the same CMSSW release used to make prompt reconstruction of the collected data

################################################################################


--------------------------
-- 1) RAW --> HLT + RAW --
--------------------------

Setup environment following updated instruction at 
https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideGlobalHLT#Frozen_2012_menus

as of today (25/07/2012) :

setenv SCRAM_ARCH slc5_amd64_gcc462   # if using [t]csh

scram p -n CMSSW_5_2_6_hltpatch1_HLT CMSSW CMSSW_5_2_6_hltpatch1
cd CMSSW_5_2_6_hltpatch1/src
cmsenv

cvs co -r V00-00-59-05   Configuration/AlCa                               
cvs co -r V13-06-85      HLTrigger/Configuration                          
cvs co -r V01-02-26      HLTrigger/JetMET                                 
cvs co -r V01-04-01      HLTrigger/Timer                                  
cvs co -r V01-08-09      Validation/RecoMET                               

checkdeps -a
scram b -j4

rehash   # using [t]csh

--

hltGetConfiguration --full --offline --data --unprescale --process TEST --globaltag auto:hltonline orcoff:/cdaq/physics/Run2012/7e33/v2.1/HLT/V12 > hlt_data.py

This menu (/cdaq/physics/Run2012/7e33/v2.1/HLT/V12) correspond to run 193999, and in general is good for Run2012B.
For Run2012C and following one *might* have to use something different. Please check.

--

Edit hlt_data.py: 

- add input file name:
  process.source ...  
  (for example 'rfio:/castor/cern.ch/cms/store/data/Run2012B/JetHT/RAW/v1/000/193/999/265915A1-789B-E111-80B6-0025901D5DB8.root') --> typically the RAW data is on castor (*not* on eos) so the files should be "staged" before running for an efficient processing.

- add max number of events to process:
  process.maxEvents ...  

- add TrgReport (add above global tag for example): <----- should be present BY DEFAULT (please check..)
  # enable the TrigReport and TimeReport                                                                     
  process.options = cms.untracked.PSet(
    wantSummary = cms.untracked.bool( True )
  )

- process.MessageLogger:
  reportEvery = cms.untracked.int32( 100 )
  limit = cms.untracked.int32( 10 ) 

- comment out all output modules except process.PhysicsDSTOutput
   #process.AOutput = cms.EndPath( process.hltPreAOutput + process.hltOutputA )                                   
   #process.BOutput = cms.EndPath( process.hltPreBOutput + process.hltOutputB )                      
   #process.ALCAP0Output = cms.EndPath( process.hltPreALCAP0Output + process.hltOutputALCAP0 )
   ...
   ...
   #process.NanoDSTOutput = cms.EndPath( process.hltPreNanoDSTOutput + process.hltOutputNanoDST )   

   process.PhysicsDSTOutput = cms.EndPath( process.hltPrePhysicsDSTOutputSmart + process.hltOutputPhysicsDST )

   #process.RPCMONOutput = cms.EndPath( process.hltPreRPCMONOutput + process.hltOutputRPCMON )                    
   #process.TrackerCalibrationOutput = cms.EndPath( process.hltPreTrackerCalibrationOutput + process.hltOutputTrackerCalibration )
   ...

- edit process.hltOutputPhysicsDST:
  - comment out SelectEvents: 
    #    SelectEvents = cms.untracked.PSet(  SelectEvents = cms.vstring( 'DST_Ele8_CaloIdL_CaloIsoVL_TrkIdVL_TrkIsoVL_HT250_v1',
    #  'DST_HT250_v1', 	
    #  'DST_L1HTT_Or_L1MultiJet_v1',
    #  'DST_Mu5_HT250_v1' ) ),     
  - add RAW data in the output:  
    outputCommands = cms.untracked.vstring( 'drop *',
      'keep *_hltActivityPhotonClusterShape_*_*',
      'keep *_hltActivityPhotonEcalIso_*_*',
      'keep *_hltActivityPhotonHcalForHE_*_*',
      'keep *_hltActivityPhotonHcalIso_*_*',
      'keep *_hltCaloJetIDPassed_*_*',
      'keep *_hltElectronActivityDetaDphi_*_*',
      'keep *_hltHitElectronActivityTrackIsol_*_*',
      'keep *_hltKT6CaloJets_rho*_*',
      'keep *_hltL3MuonCandidates_*_*',
      'keep *_hltL3MuonCombRelIsolations_*_*',
      'keep *_hltMetClean_*_*',
      'keep *_hltMet_*_*',
      'keep *_hltPixelMatchElectronsActivity_*_*',
      'keep *_hltPixelVertices_*_*',
      'keep *_hltRecoEcalSuperClusterActivityCandidate_*_*',
      'keep L1GlobalTriggerReadoutRecord_hltGtDigis_*_*',
      'keep edmTriggerResults_*_*_*',
      ## RAW data
      'keep FEDRawDataCollection_rawDataCollector_*_*',
      'keep FEDRawDataCollection_source_*_*',
      'keep triggerTriggerEvent_*_*_*',
      'keep *_hltL1GtObjectMap_*_*'                                      
                                           )

--

Run code:

cmsRun hlt_data.py >& hlt_data_01.txt &

the trigger report is here: hlt_data_01.txt
the output .root file is here: outputPhysicsDST.root





--------------------------------
-- 2) HLT + RAW --> HLT + AOD --
--------------------------------

Setup CMSSW area 
(the instructions below are for Run2012B. 
The CMSSW release might change for different datasets: 
please check in DAS what was used for prompt reco):


setenv SCRAM_ARCH slc5_amd64_gcc462
scram p -n CMSSW_5_2_4_patch2_DataScouting CMSSW CMSSW_5_2_4_patch2
cd CMSSW_5_2_4_patch2_DataScouting/src
cmsenv


Create configuration file for reconstruction of the data:

cmsDriver.py reco --step RAW2DIGI,RECO --conditions GR_P_V32::All --eventcontent AOD --no_exec --data --filein file:outputPhysicsDST.root --fileout outputPhysicsDST_HLTplusAOD.root --python_filename promptReco_RAW2DIGI_AOD.py --number -1

NOTE 1 : the global tag is correct for Run2012B. If you analyze other periods, the appropriate global tag used for prompt reco shoudl be used

NOTE 2 : the input file must be the output of the previous step


Edit to add the DataScouting event content:

process.AODoutput.outputCommands.extend(
        cms.untracked.vstring(
       'keep *_hltActivityPhotonClusterShape_*_*',
       'keep *_hltActivityPhotonEcalIso_*_*',
       'keep *_hltActivityPhotonHcalForHE_*_*',
       'keep *_hltActivityPhotonHcalIso_*_*',
       'keep *_hltCaloJetIDPassed_*_*',
       'keep *_hltElectronActivityDetaDphi_*_*',
       'keep *_hltHitElectronActivityTrackIsol_*_*',
       'keep *_hltKT6CaloJets_rho*_*',
       'keep *_hltL3MuonCandidates_*_*',
       'keep *_hltL3MuonCombRelIsolations_*_*',
       'keep *_hltMetClean_*_*',
       'keep *_hltMet_*_*',
       'keep *_hltPixelMatchElectronsActivity_*_*',
       'keep *_hltPixelVertices_*_*',
       'keep *_hltRecoEcalSuperClusterActivityCandidate_*_*',
       'keep L1GlobalTriggerReadoutRecord_hltGtDigis_*_*',
       'keep edmTriggerResults_*_*_*',
       ## RAW data                                                                                                    
       #'keep FEDRawDataCollection_rawDataCollector_*_*',           
       #'keep FEDRawDataCollection_source_*_*', 
       'keep triggerTriggerEvent_*_*_*',
       'keep *_hltL1GtObjectMap_*_*'
            )
          )

--

Run code:

cmsRun promptReco_RAW2DIGI_AOD.py

The output file is : outputPhysicsDST_HLTplusAOD.root
  - This file contains both AOD data format + PhysicsDST data format
  and can be used for HLT vs RECO comparisons on event-by-event base.

--