Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-10 22:50:01

0001 #!/bin/bash
0002 
0003 set -x
0004 
0005 # Check if CMSSW envs are setup
0006 : ${CMSSW_BASE:?'You need to set CMSSW environemnt first.'}
0007 
0008 # DEFAULTS
0009 
0010 events=5000
0011 geometry=Extended2026D77
0012 
0013 # ARGUMENT PARSING
0014 
0015 while getopts ":n:g:" opt; do
0016   case $opt in
0017     n)
0018       echo "Generating $OPTARG events" >&1
0019       events=${OPTARG}
0020       ;;
0021     g)
0022       echo "Using $OPTARG geometry" >&1
0023       geometry=${OPTARG}
0024       ;;
0025     \?)
0026       echo "Invalid option: -$OPTARG" >&2
0027       exit 1
0028       ;;
0029     :)
0030       echo "Option -$OPTARG requires an argument." >&2
0031       exit 1
0032       ;;
0033   esac
0034 done
0035 
0036 . runMaterialDumpFunctions
0037 
0038 # GEN-SIM goes first
0039 if checkFile SingleMuPt10_pythia8_cfi_GEN_SIM_PhaseII.root ; then
0040   cmsDriver.py SingleMuPt10_pythia8_cfi \
0041 -s GEN,SIM \
0042 --conditions auto:phase2_realistic \
0043 -n ${events} \
0044 --era Phase2C2 \
0045 --eventcontent FEVTDEBUG \
0046 --datatier GEN-SIM \
0047 --beamspot NoSmear \
0048 --customise Validation/Geometry/customiseForDumpMaterialAnalyser_ForPhaseII.customiseForMaterialAnalyser_ForPhaseII \
0049 --geometry ${geometry} \
0050 --fileout file:SingleMuPt10_pythia8_cfi_GEN_SIM_PhaseII.root \
0051 --python_filename SingleMuPt10_pythia8_cfi_GEN_SIM_PhaseII.py > SingleMuPt10_pythia8_cfi_GEN_SIM_PhaseII.log 2>&1
0052 
0053   if [ $? -ne 0 ]; then
0054     echo "Error executing the GEN-SIM step, aborting."
0055     exit 1
0056   fi
0057 fi
0058 
0059 # DIGI comes next
0060 if checkFile SingleMuPt10_step2_DIGI_L1_DIGI2RAW_HLT_PhaseII.root ; then
0061   cmsDriver.py step2   \
0062 -s DIGI:pdigi_valid,L1TrackTrigger,L1,DIGI2RAW,HLT:@fake2  \
0063 --conditions auto:phase2_realistic \
0064 -n -1  \
0065 --era Phase2C2  \
0066 --eventcontent FEVTDEBUGHLT \
0067 --datatier GEN-SIM-DIGI-RAW  \
0068 --nThreads=6 \
0069 --geometry ${geometry}  \
0070 --filein file:SingleMuPt10_pythia8_cfi_GEN_SIM_PhaseII.root  \
0071 --fileout file:SingleMuPt10_step2_DIGI_L1_DIGI2RAW_HLT_PhaseII.root \
0072 --python_filename SingleMuPt10_step2_DIGI_L1_DIGI2RAW_HLT_PhaseII.py > SingleMuPt10_step2_DIGI_L1_DIGI2RAW_HLT_PhaseII.log 2>&1
0073 
0074   if [ $? -ne 0 ]; then
0075     echo "Error executing the DIGI step, aborting."
0076     exit 1
0077   fi
0078 fi
0079 
0080 # Reco and special customization
0081 if checkFile SingleMuPt10_step3_RECO_DQM_PhaseII.root ; then
0082   cmsDriver.py step3 \
0083 -s RAW2DIGI,L1Reco,RECO,VALIDATION:@phase2Validation,DQM:@phase2 \
0084 --conditions auto:phase2_realistic \
0085 -n -1  \
0086 --era Phase2C2  \
0087 --eventcontent FEVTDEBUGHLT,DQM  \
0088 --datatier GEN-SIM-RECO,DQMIO  \
0089 --nThreads=6 \
0090 --geometry ${geometry}  \
0091 --filein file:SingleMuPt10_step2_DIGI_L1_DIGI2RAW_HLT_PhaseII.root  \
0092 --fileout file:SingleMuPt10_step3_RECO_DQM_PhaseII.root \
0093 --python_filename SingleMuPt10_step2_RECO_DQM_PhaseII.py > SingleMuPt10_step3_RECO_DQM_PhaseII.log 2>&1
0094 
0095   if [ $? -ne 0 ]; then
0096     echo "Error executing the RECO step, aborting."
0097     exit 1
0098   fi
0099 fi
0100 
0101 # HARVESTING
0102 if checkFile DQM_V0001_R000000001__Global__CMSSW_X_Y_Z__RECO.root ; then
0103   cmsDriver.py step4  \
0104 -s HARVESTING:@trackingOnlyValidation+@trackingOnlyDQM  \
0105 --conditions auto:run2_mc \
0106 -n -1   \
0107 --era Phase2C2  \
0108 --scenario pp  \
0109 --filetype DQM  \
0110 --geometry ${geometry}  \
0111 --mc  \
0112 --filein file:SingleMuPt10_step3_RECO_DQM_PhaseII_inDQM.root  \
0113 --python_filename SingleMuPt10_step4_HARVESTING_PhaseII.py > SingleMuPt10_step4_HARVESTING_PhaseII.log 2>&1
0114 
0115   if [ $? -ne 0 ]; then
0116     echo "Error executing the HARVESTING step, aborting."
0117     exit 1
0118   fi
0119 fi
0120 
0121 # Neutrino Particle gun
0122 
0123 if checkFile single_neutrino_random.root ; then
0124   cmsRun ../python/single_neutrino_cfg.py
0125   if [ $? -ne 0 ]; then
0126     echo "Error generating single neutrino gun, aborting."
0127     exit 1
0128   fi
0129   if [ ! -e Images ]; then
0130     mkdir Images
0131   fi
0132 fi
0133 
0134 # Make material map for each subdetector from simulation
0135 
0136 for t in BeamPipe Tracker Phase2PixelBarrel Phase2OTBarrel Phase2PixelEndcap Phase2OTForward; do
0137   if [ ! -e matbdg_${t}.root ]; then
0138     python3 runP_Tracker.py geom=${geometry} label=$t >& /dev/null &
0139   fi
0140 done
0141 
0142 waitPendingJobs
0143 
0144 # Always run the comparison at this stage, since you are guaranteed that all the ingredients are there
0145 
0146 for t in BeamPipe Tracker TrackerSumPhaseII Phase2PixelBarrel Phase2OTBarrel Phase2PixelEndcap Phase2OTForward; do
0147   python3 MaterialBudget.py -s -d ${t}
0148   if [ $? -ne 0 ]; then
0149     echo "Error while producing simulation material for ${t}, aborting"
0150     exit 1
0151   fi
0152 done
0153 
0154 python MaterialBudget.py -c -r DQM_V0001_R000000001__Global__CMSSW_X_Y_Z__RECO.root -l PhaseIIDetector > MaterialBudget_Simul_vs_Reco_PhaseII.log 2>&1
0155