fix coverity issue CID 10883
 fix few warnings
 remove unused variables
Coverity CID 10361 corrected by Sussana
remove data directory from macro in tutorial 4
restore the license text
correct typo in last commit
data directory does not exist when checking out a fresh copy of the software, this cause the tutorial 4 to crash. also te naming of the files is corrected to have the MC name in it.
get the event number in samplertask
Fixes CID 10508 (Resource leak).
Fixes CID 10882 (Uninitialized pointer read).
Fixes CID 10486, 10487, 10488, 10519, 10520, 10521 (Resource leak).
Fixes CID 10509-10513 (Resource leak).
Fixes CID 10177 (Missing return statement).
Remove dead code. Fixes CID 10481, 10482, 10517, 10518 (Resource leak).
Fixes CID 10443, 10444, 10445 (Printf arg type mismatch).
Initalize class data member in constructor. Fixes CID 10907, 10908 (Uninitialized scalar field).
Initalize class data member in constructor. Fixes CID 10920 (Uninitialized scalar field).
Fixes CID 10137 (Unchecked dynamic cast).
Fixes CID 10525 (Dereference before null check).