Changeset 19812 for trunk/Mars/hawc


Ignore:
Timestamp:
10/27/19 18:24:16 (5 years ago)
Author:
tbretz
Message:
Improvements. Added 'Fake HAWC variables', added the possibility to train Core location on the ground, added how to change tree output name, improved selector, exit when ranger fails.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/hawc/runranger.sh

    r19801 r19812  
    55OUT=ranger.csv
    66TRAINRATIO=0.7
     7#TREE=Events
    78
    89# Classical reconstruction parameters
     
    1314#TRUEVAR="MeanY*conv"
    1415
    15 # Impact on ground
    16 #TRUEVAR="TMath::Hypot(X,Y)"
    17 #TRUEVAR="atan2(X,Y)*TMath::RadToDeg()"
     16# Impact on ground (We can not use GroundR here, see --no-indirection)
     17#TRUEVAR="GroundR"
     18#TRUEVAR="GroundPhi"
     19#TRUEVAR="X"
     20#TRUEVAR="Y"
    1821
    1922echo --------------------------------- Creating input files -------------------------
     
    2932
    3033# Some cuts to remove events with strange contents
    31 selector=NumUsedPixels>2.5 && lgArea>-1 && abs(SlopeTrans/conv)<1
     34selector=lgArea>-1 && abs(SlopeTrans/conv)<2.5
    3235
    3336# Define some alias for easier use and use in the selector
     
    3538conv=1.14112295210361481e-01
    3639lgArea=log10(TMath::TwoPi()*Width*Length*conv^2)
     40GroundR=sqrt(X*X + Y*Y)
     41GroundPhi=atan2(Y, X)
    3742
    3843# Add additonal columns
     
    4651Delta    = Delta
    4752Angle    = atan2(MeanX, MeanY)
    48 M3L      = M3Long*TMath::Sign(1, CosDeltaAlpha)*conv
     53M3L      = M3Long*sign(CosDeltaAlpha)*conv
    4954M3T      = M3Trans*conv
    5055Asym     = Asym*conv
     
    5560ConcCore = ConcCore
    5661ConcCOG  = ConcCOG
    57 SlopeL   = SlopeLong*TMath::Sign(1, CosDeltaAlpha)/conv
     62SlopeL   = SlopeLong*sign(CosDeltaAlpha)/conv
    5863SlopeT   = SlopeTrans/conv
     64MeanX    = MeanX
     65MeanY    = MeanY
    5966
    6067TimeSpread  = TimeSpread
     
    6875
    6976# Be careful, this is true MC information
    70 #GroundR   = TMath::Hypot(X,Y)
    71 #GroundPhi = atan2(Y,X)
     77#GroundR   = GroundR
     78#GroundPhi = GroundPhi
    7279#GroundX   = X
    73 #GroundYY  = Y
     80#GroundY   = Y
    7481EOF
    7582
     
    93100        --file ${TRAIN} --outprefix ${OUT} --depvarname True \
    94101        --verbose --treetype 3 --impmeasure 1 --write
     102if [ $? != 0 ]; then
     103  exit 1
     104fi
    95105
    96106echo ""
     
    105115        --file ${TEST} --outprefix ${OUT} --predict ${OUT}.forest \
    106116        --verbose --treetype 3
    107 
    108 echo --------------------------------- Creating root file ---------------------------
    109 ${NICE} ${CSV2ROOT} ${TEST} ${OUT}.root --force
    110117if [ $? != 0 ]; then
    111118  exit 1
    112119fi
    113120
    114 ${NICE} ${CSV2ROOT} ${OUT}.prediction ${OUT}.root --update
     121echo --------------------------------- Creating root file ---------------------------
     122${NICE} ${CSV2ROOT} ${TEST} ${OUT}.root ${TREE} --force
    115123if [ $? != 0 ]; then
    116124  exit 1
    117125fi
    118126
     127${NICE} ${CSV2ROOT} ${OUT}.prediction ${OUT}.root ${TREE} --update
     128if [ $? != 0 ]; then
     129  exit 1
     130fi
Note: See TracChangeset for help on using the changeset viewer.