Commit b08a9bdc authored by Gernot Maier's avatar Gernot Maier
Browse files

Initial commit

parents
#
# search for events above an energy and
# convert to dst file
#
# requires:
# - access to evndisp files
# - file list with simtel production files
# - access to simtel files
#
# minimum energy in TeV
MINENERGY=100
# Azimuth
AZ="180deg"
# Particle
PART="gamma_onSource"
# Production
PROD="prod5-Paranal-20deg"
# output DST file
OFIL="${PROD}-${PART}-${AZ}-${MINENERGY}TeV.dst.root"
# temporary list with simtel files
TMPLIST="file_list_${MINENERGY}TeV_${AZ}.list"
rm -f ${TMPLIST}
touch ${TMPLIST}
# File list
FLIST="${CTA_USER_DATA_DIR}/analysis/AnalysisData/FileList_prod5/${PROD}/${PART}.list"
# files to search for
FF=$(find ${CTA_USER_DATA_DIR}/analysis/AnalysisData/${PROD}-sq11-LL/S.hyperarray/EVNDISPnoDLL/${PART}/ -name "279*HD_*_${AZ}.root")
####
# find runs with events above the given energy
for F in ${FF}
do
echo ${F}
RUN=$(root -l -q -b "find_event_energy.C( ${MINENERGY}, \"${F}\")"|grep RUN|awk '{print $2}')
echo ${RUN}
if [[ ${RUN} -gt "0" ]]; then
SIMF=$(grep "run${RUN}_" ${FLIST} | grep ${AZ})
echo ${SIMF} >> ${TMPLIST}
fi
done
###
# convert and put all into one file
CC=$(cat ${TMPLIST})
$EVNDISPSYS/bin/CTA.convert_hessio_to_VDST \
-c $CTA_EVNDISP_AUX_DIR/Calibration/prod5/prod5-IPR.root \
-a ${CTA_EVNDISP_AUX_DIR}/DetectorGeometry/CTA.prod5S.hyperarray.lis \
-minenergy ${MINENERGY} \
-o ${CTA_USER_DATA_DIR}/${OFIL} ${CC}
#/bin/CTA.convert_hessio_to_VDST -c $CTA_EVNDISP_AUX_DIR/Calibration/prod5/prod5-IPR.root -a ../Eventdisplay_AnalysisFiles_CTA/DetectorGeometry/CTA.prod5S.hyperarray.lis -minenergy 100. -o gamma_onSource-100TeV.dst.root /lustre/fs21/group/cta/prod5-grid/Prod5_Paranal_AdvancedBaseline_NSB1x/gamma_onSource/gamma_20deg_0deg_run100___cta-prod5-paranal_desert-2147m-Paranal-dark.simtel.zst
/lustre/fs21/group/cta/prod5-grid/Prod5_Paranal_AdvancedBaseline_NSB1x/gamma_onSource/gamma_20deg_180deg_run2797___cta-prod5-paranal_desert-2147m-Paranal-dark.simtel.zst
/lustre/fs21/group/cta/prod5-grid/Prod5_Paranal_AdvancedBaseline_NSB1x/gamma_onSource/gamma_20deg_180deg_run2796___cta-prod5-paranal_desert-2147m-Paranal-dark.simtel.zst
/lustre/fs21/group/cta/prod5-grid/Prod5_Paranal_AdvancedBaseline_NSB1x/gamma_onSource/gamma_20deg_180deg_run2791___cta-prod5-paranal_desert-2147m-Paranal-dark.simtel.zst
/lustre/fs21/group/cta/prod5-grid/Prod5_Paranal_AdvancedBaseline_NSB1x/gamma_onSource/gamma_20deg_180deg_run2795___cta-prod5-paranal_desert-2147m-Paranal-dark.simtel.zst
/lustre/fs21/group/cta/prod5-grid/Prod5_Paranal_AdvancedBaseline_NSB1x/gamma_onSource/gamma_20deg_180deg_run279___cta-prod5-paranal_desert-2147m-Paranal-dark.simtel.zst
/lustre/fs21/group/cta/prod5-grid/Prod5_Paranal_AdvancedBaseline_NSB1x/gamma_onSource/gamma_20deg_180deg_run2798___cta-prod5-paranal_desert-2147m-Paranal-dark.simtel.zst
/*
* return run number if there are events
* above the given energy in the evndisp
* file
*
* root -l -q -b 'find_event_energy.C( 100., "27HD_199_0deg.root" )'
*
*/
int find_event_energy( double iEnergy_min,
string iEvndispFile )
{
TFile f( iEvndispFile.c_str() );
if( f.IsZombie() )
{
cout << "RUN -1" << endl;
return -1;
}
TTree *t = (TTree*)f.Get( "showerpars" );
if( !t )
{
cout << "RUN -1" << endl;
return -1;
}
Int_t runNumber;
Float_t MCe0;
t->SetBranchAddress( "runNumber", &runNumber );
t->SetBranchAddress( "MCe0", &MCe0 );
for( Long64_t i; i < t->GetEntries(); i++ )
{
t->GetEntry( i );
if( MCe0 > iEnergy_min )
{
cout << endl;
cout << "RUN " << runNumber << endl;
return runNumber;
}
}
// no event found
cout << "RUN 0" << endl;
return 0;
}
#
# search for events above an energy and
# convert to dst file
#
# requires:
# - access to evndisp files
# - file list with simtel production files
# - access to simtel files
#
# minimum energy in TeV
MINENERGY=100
# Azimuth
AZ="180deg"
# Particle
PART="gamma_onSource"
# Production
PROD="prod5-Paranal-20deg"
# output DST file
OFIL="${PROD}-${PART}-${AZ}-${MINENERGY}TeV.dst.root"
# temporary list with simtel files
TMPLIST="file_list_${MINENERGY}TeV_${AZ}.list"
rm -f ${TMPLIST}
touch ${TMPLIST}
# File list
FLIST="${CTA_USER_DATA_DIR}/analysis/AnalysisData/FileList_prod5/${PROD}/${PART}.list"
# files to search for
FF=$(find ${CTA_USER_DATA_DIR}/analysis/AnalysisData/${PROD}-sq11-LL/S.hyperarray/EVNDISPnoDLL/${PART}/ -name "279*HD_*_${AZ}.root")
####
# find runs with events above the given energy
for F in ${FF}
do
echo ${F}
RUN=$(root -l -q -b "find_event_energy.C( ${MINENERGY}, \"${F}\")"|grep RUN|awk '{print $2}')
echo ${RUN}
if [[ ${RUN} -gt "0" ]]; then
SIMF=$(grep "run${RUN}_" ${FLIST} | grep ${AZ})
echo ${SIMF} >> ${TMPLIST}
fi
done
###
# convert and put all into one file
CC=$(cat ${TMPLIST})
$EVNDISPSYS/bin/CTA.convert_hessio_to_VDST \
-c $CTA_EVNDISP_AUX_DIR/Calibration/prod5/prod5-IPR.root \
-a ${CTA_EVNDISP_AUX_DIR}/DetectorGeometry/CTA.prod5S.hyperarray.lis \
-minenergy ${MINENERGY} \
-o ${CTA_USER_DATA_DIR}/${OFIL} ${CC}
#/bin/CTA.convert_hessio_to_VDST -c $CTA_EVNDISP_AUX_DIR/Calibration/prod5/prod5-IPR.root -a ../Eventdisplay_AnalysisFiles_CTA/DetectorGeometry/CTA.prod5S.hyperarray.lis -minenergy 100. -o gamma_onSource-100TeV.dst.root /lustre/fs21/group/cta/prod5-grid/Prod5_Paranal_AdvancedBaseline_NSB1x/gamma_onSource/gamma_20deg_0deg_run100___cta-prod5-paranal_desert-2147m-Paranal-dark.simtel.zst
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment