Fix line length

Fix line length

--- trikScriptRunner/src/trikJavaScriptRunner.cpp
+++ trikScriptRunner/src/trikJavaScriptRunner.cpp
@@ -40,9 +40,11 @@
 	connect(mScriptEngineWorker, &ScriptEngineWorker::completed, this, &TrikJavaScriptRunner::completed);
 	connect(mScriptEngineWorker, &ScriptEngineWorker::startedScript, this, &TrikJavaScriptRunner::onScriptStart);

-	connect(mScriptController.data(), &ScriptExecutionControl::textInStdOut, this, &TrikJavaScriptRunner::textInStdOut);
+	connect(mScriptController.data(), &ScriptExecutionControl::textInStdOut,
+		this, &TrikJavaScriptRunner::textInStdOut);

-	connect(mVariablesServer.data(), &TrikVariablesServer::getVariables, mScriptEngineWorker, &ScriptEngineWorker::getVariables);
+	connect(mVariablesServer.data(), &TrikVariablesServer::getVariables
+		, mScriptEngineWorker, &ScriptEngineWorker::getVariables);
 	connect(mScriptEngineWorker, &ScriptEngineWorker::variablesReady
 		, mVariablesServer.data(), &TrikVariablesServer::sendHTTPResponse);


Fixed #ifdefs

Fixed #ifdefs

git-svn-id: 271780961ce0c2fbd127a88e7bddae13e4800ab4@123 f3a24b6a-cf45-0410-b55a-8c22e2698227

--- source/SoundTouch/cpu_detect_x86_gcc.cpp
+++ source/SoundTouch/cpu_detect_x86_gcc.cpp
@@ -68,7 +68,7 @@
 /// Checks which instruction set extensions are supported by the CPU.
 uint detectCPUextensions(void)
 {
-#if (!(ALLOW_X86_OPTIMIZATIONS) || !(__GNUC__))
+#if (!(SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS) || !(__GNUC__))

     return 0; // always disable extensions on non-x86 platforms.


updated progress log messages

updated progress log messages

--- apps/lib/src/oskar_sim_interferometer_new.cpp
+++ apps/lib/src/oskar_sim_interferometer_new.cpp
@@ -256,6 +256,11 @@
             {
                 sim_vis_block_(&s, &d[gpu_id], num_gpus, gpu_id,
                         num_chunks, sky_chunks, b, iactive, log, status);
+                if (num_gpus > 1) {
+                    oskar_log_message(log, 'S', 0,
+                            "Block %i/%i complete on GPU %i.", b+1,
+                            num_time_blocks, gpu_id);
+                }
             }
             if (thread_id == 0 && b > 0) {
                 // TODO Display free CPU ram?


aesthetic gui changes

aesthetic gui changes

--- apps/ptg-configurator/ptgConfiguratorMain.cpp
+++ apps/ptg-configurator/ptgConfiguratorMain.cpp
@@ -265,7 +265,8 @@
 		wxDefaultValidator, _T("ID_SLIDER1"));
 	FlexGridSizer4->Add(
 		slidPathHighlight, 1,
-		wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
+		wxALL | wxEXPAND | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL,
+		5);
 	edIndexHighlightPath = new wxSpinCtrl(
 		Panel1, ID_SPINCTRL2, _T("0"), wxDefaultPosition, wxDefaultSize, 0, 0,
 		100, 0, _T("ID_SPINCTRL2"));
@@ -435,7 +436,7 @@
 	cbShowClearance = new wxCheckBox(
 		Panel2, ID_CHECKBOX6, _("Clearance diagram"), wxDefaultPosition,
 		wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX6"));
-	cbShowClearance->SetValue(true);
+	cbShowClearance->SetValue(false);
 	FlexGridSizer15->Add(
 		cbShowClearance, 1,
 		wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
@@ -681,6 +682,7 @@
 	gl_TPSpace_TP_obstacles = mrpt::opengl::CSetOfObjects::Create();
 	gl_TPSpace_clearance =
 		mrpt::opengl::CMesh::Create(true, -5.0f, 5.0f, -5.0f, 5.0f);
+	gl_TPSpace_clearance->setVisibility(false);
 	gl_TPSpace_clearance_interp =
 		mrpt::opengl::CMesh::Create(true, -5.0f, 5.0f, -5.0f, 5.0f);
 	gl_TPSpace_clearance_interp->setVisibility(false);
@@ -740,7 +742,7 @@
 	{
 		gl_axis_WS = mrpt::opengl::CAxis::Create(
 			-10.0, -10.0, 0, 10.0, 10.0, 0.0, 1.0, 2.0);
-		gl_axis_WS->setTextScale(0.20f);
+		gl_axis_WS->setTextScale(0.10f);
 		gl_axis_WS->enableTickMarks(true, true, true);
 		gl_axis_WS->setColor_u8(mrpt::img::TColor(30, 30, 30, 50));
 		gl_axis_WS->setTextLabelOrientation(0, 0, 0, 0);
@@ -751,7 +753,7 @@
 	{
 		gl_axis_TPS = mrpt::opengl::CAxis::Create(
 			-1.0, -1.0, 0, 1.0, 1.0, 0.0, 0.25, 2.0);
-		gl_axis_TPS->setTextScale(0.04f);
+		gl_axis_TPS->setTextScale(0.025f);
 		gl_axis_TPS->enableTickMarks(true, true, false);
 		gl_axis_TPS->setColor_u8(mrpt::img::TColor(30, 30, 30, 50));
 		gl_axis_TPS->setTextLabelOrientation(0, 0, 0, 0);


[hm] RSSI threshold lowered to -91

[hm] RSSI threshold lowered to -91

--- arduino/libraries/rf12_itplus/rf12_itplus.cpp
+++ arduino/libraries/rf12_itplus/rf12_itplus.cpp
@@ -382,7 +382,7 @@
     }
     //rf12_xfer(0xC606); // approx 49.2 Kbps, i.e. 10000/29/(1+6) Kbps
     rf12_xfer(0xC613); // DATA RATE 17.241 kbps
-    rf12_xfer(0x94A3); // VDI,FAST,134kHz,0dBm,-91dBm
+    rf12_xfer(0x94A0 | RSSI_91); // VDI,FAST,134kHz,0dBm,-XXdBm
     rf12_xfer(0xC2AC); // AL,!ml,DIG,DQD4
     rf12_xfer(0xCA83); // FIFO8,2-SYNC,!ff,DR
     rf12_xfer(0xCE00 | TX29_GROUP); // SYNC=2DXX；


hinge2 updates, parameter set/get modifications, contact softness, etc

git-svn-id: 83d585846b3bb6dc23aa7649400c5e2e04e3d09e@154 685f7672-210f-0410-90b4-fe3ad19314fe

--- ode/ode/src/joint.cpp
+++ ode/ode/src/joint.cpp
@@ -84,6 +84,62 @@
 }

+// this is like setBall(), except that `axis' is a unit length vector
+// (in global coordinates) that should be used for the first jacobian
+// position row (the other two row vectors will be derived from this).
+// `erp1' is the erp value to use along the axis.
+
+static inline void setBall2 (dxJoint *joint, dxJoint::Info2 *info,
+			    dVector3 anchor1, dVector3 anchor2,
+			    dVector3 axis, dReal erp1)
+{
+  // anchor points in global coordinates with respect to body PORs.
+  dVector3 a1,a2;
+
+  int i,s = info->rowskip;
+
+  // get vectors normal to the axis. in setBall() axis,q1,q2 is [1 0 0],
+  // [0 1 0] and [0 0 1], which makes everything much easier.
+  dVector3 q1,q2;
+  dPlaneSpace (axis,q1,q2);
+
+  // set jacobian
+  for (i=0; i<3; i++) info->J1l[i] = axis[i];
+  for (i=0; i<3; i++) info->J1l[s+i] = q1[i];
+  for (i=0; i<3; i++) info->J1l[2*s+i] = q2[i];
+  dMULTIPLY0_331 (a1,joint->node[0].body->R,anchor1);
+  dCROSS (info->J1a,=,a1,axis);
+  dCROSS (info->J1a+s,=,a1,q1);
+  dCROSS (info->J1a+2*s,=,a1,q2);
+  if (joint->node[1].body) {
+    for (i=0; i<3; i++) info->J2l[i] = -axis[i];
+    for (i=0; i<3; i++) info->J2l[s+i] = -q1[i];
+    for (i=0; i<3; i++) info->J2l[2*s+i] = -q2[i];
+    dMULTIPLY0_331 (a2,joint->node[1].body->R,anchor2);
+    dCROSS (info->J2a,= -,a2,axis);
+    dCROSS (info->J2a+s,= -,a2,q1);
+    dCROSS (info->J2a+2*s,= -,a2,q2);
+  }
+
+  // set right hand side - measure error along (axis,q1,q2)
+  dReal k1 = info->fps * erp1;
+  dReal k = info->fps * info->erp;
+
+  for (i=0; i<3; i++) a1[i] += joint->node[0].body->pos[i];
+  if (joint->node[1].body) {
+    for (i=0; i<3; i++) a2[i] += joint->node[1].body->pos[i];
+    info->c[0] = k1 * (dDOT(axis,a2) - dDOT(axis,a1));
+    info->c[1] = k * (dDOT(q1,a2) - dDOT(q1,a1));
+    info->c[2] = k * (dDOT(q2,a2) - dDOT(q2,a1));
+  }
+  else {
+    info->c[0] = k1 * (dDOT(axis,anchor2) - dDOT(axis,a1));
+    info->c[1] = k * (dDOT(q1,anchor2) - dDOT(q1,a1));
+    info->c[2] = k * (dDOT(q2,anchor2) - dDOT(q2,a1));
+  }
+}
+
+
 // compute anchor points relative to bodies

 static void setAnchors (dxJoint *j, dReal x, dReal y, dReal z,
@@ -294,9 +350,9 @@
 }

-void dxJointLimitMotor::addRotationalLimot (dxJoint *joint,
-					    dxJoint::Info2 *info, int row,
-					    dVector3 ax1)
+int dxJointLimitMotor::addRotationalLimot (dxJoint *joint,
+					   dxJoint::Info2 *info, int row,
+					   dVector3 ax1)
 {
   int srow = row * info->rowskip;

@@ -354,7 +410,9 @@
 	info->hi[row] = dInfinity;
       }
     }
-  }
+    return 1;
+  }
+  else return 0;
 }

@@ -1059,6 +1117,9 @@
     // set LCP bounds
     info->lo[1] = -j->contact.surface.mu;
     info->hi[1] = j->contact.surface.mu;
+    // set slip (constraint force mixing)
+    if (j->contact.surface.mode & dContactSlip1)
+      info->cfm[1] = j->contact.surface.slip1;
   }

   // second friction direction
@@ -1086,6 +1147,9 @@
       info->lo[2] = -j->contact.surface.mu;
       info->hi[2] = j->contact.surface.mu;
     }
+    // set slip (constraint force mixing)
+    if (j->contact.surface.mode & dContactSlip2)
+      info->cfm[2] = j->contact.surface.slip2;
   }
 }

@@ -1117,7 +1181,7 @@
   dSetZero (j->axis1,4);
   j->axis1[0] = 1;
   dSetZero (j->axis2,4);
-  j->axis2[0] = 1;
+  j->axis2[1] = 1;
   j->c0 = 0;
   j->s0 = 0;

@@ -1128,6 +1192,9 @@

   j->limot1.init();
   j->limot2.init();
+
+  j->susp_erp = 0.2;
+  j->susp_cfm = 0;
 }

@@ -1144,6 +1211,10 @@
     if (j->limot1.testRotationalLimit (angle)) atlimit = 1;
   }
   if (atlimit || j->limot1.fmax > 0) info->m++;
+
+  // see if we're poweing axis 2 (we currently never limit this axis)
+  j->limot2.limit = 0;
+  if (j->limot2.fmax > 0) info->m++;
 }

@@ -1164,15 +1235,16 @@

 static void hinge2GetInfo2 (dxJointHinge2 *joint, dxJoint::Info2 *info)
 {
-  // set the three ball-and-socket rows
-  setBall (joint,info,joint->anchor1,joint->anchor2);
-
-  // set the hinge row.
+  // get information we need to set the hinge row
   dReal s,c;
   dVector3 q;
   HINGE2_GET_AXIS_INFO (q,s,c);
   dNormalize3 (q);		// @@@ quicker: divide q by s ?

+  // set the three ball-and-socket rows (aligned to the suspension axis ax1)
+  setBall2 (joint,info,joint->anchor1,joint->anchor2,ax1,joint->susp_erp);
+
+  // set the hinge row
   int s3=3*info->rowskip;
   info->J1a[s3+0] = q[0];
   info->J1a[s3+1] = q[1];
@@ -1202,7 +1274,13 @@
   info->c[3] = k * (joint->c0 * s - joint->s0 * c);

   // if the axis1 hinge is powered, or has joint limits, add in more stuff
-  joint->limot1.addRotationalLimot (joint,info,4,ax1);
+  int row = 4 + joint->limot1.addRotationalLimot (joint,info,4,ax1);
+
+  // if the axis2 hinge is powered, add in more stuff
+  joint->limot2.addRotationalLimot (joint,info,row,ax2);
+
+  // set parameter for the suspension
+  info->cfm[0] = joint->susp_cfm;
 }

@@ -1216,6 +1294,11 @@
     dVector3 ax1,ax2,v;
     dMULTIPLY0_331 (ax1,joint->node[0].body->R,joint->axis1);
     dMULTIPLY0_331 (ax2,joint->node[1].body->R,joint->axis2);
+
+    // don't do anything if the axis1 or axis2 vectors are zero or the same
+    if ((ax1[0]==0 && ax1[1]==0 && ax1[2]==0) ||
+	(ax2[0]==0 && ax2[1]==0 && ax2[2]==0) ||
+	(ax1[0]==ax2[0] && ax1[1]==ax2[1] && ax1[2]==ax2[2])) return;

     // modify axis 2 so it's perpendicular to axis 1
     dReal k = dDOT(ax1,ax2);
@@ -1286,21 +1369,19 @@
 }

-extern "C" void dJointSetHinge2Param1 (dxJointHinge2 *joint,
-				       int parameter, dReal value)
+extern "C" void dJointSetHinge2Param (dxJointHinge2 *joint,
+				      int parameter, dReal value)
 {
   dUASSERT(joint,"bad joint argument");
   dUASSERT(joint->vtable == &__dhinge2_vtable,"joint is not a hinge2");
-  joint->limot1.set (parameter,value);
-}
-
-
-extern "C" void dJointSetHinge2Param2 (dxJointHinge2 *joint,
-				       int parameter, dReal value)
-{
-  dUASSERT(joint,"bad joint argument");
-  dUASSERT(joint->vtable == &__dhinge2_vtable,"joint is not a hinge2");
-  joint->limot2.set (parameter,value);
+  if ((parameter & 0xff00) == 0x100) {
+    joint->limot2.set (parameter & 0xff,value);
+  }
+  else {
+    if (parameter == dParamSuspensionErp) joint->susp_erp = value;
+    else if (parameter == dParamSuspensionCfm) joint->susp_cfm = value;
+    else joint->limot1.set (parameter,value);
+  }
 }

@@ -1335,19 +1416,18 @@
 }

-extern "C" dReal dJointGetHinge2Param1 (dxJointHinge2 *joint, int parameter)
+extern "C" dReal dJointGetHinge2Param (dxJointHinge2 *joint, int parameter)
 {
   dUASSERT(joint,"bad joint argument");
   dUASSERT(joint->vtable == &__dhinge2_vtable,"joint is not a hinge2");
-  return joint->limot1.get (parameter);
-}
-
-
-extern "C" dReal dJointGetHinge2Param2 (dxJointHinge2 *joint, int parameter)
-{
-  dUASSERT(joint,"bad joint argument");
-  dUASSERT(joint->vtable == &__dhinge2_vtable,"joint is not a hinge2");
-  return joint->limot2.get (parameter);
+  if ((parameter & 0xff00) == 0x100) {
+    return joint->limot2.get (parameter & 0xff);
+  }
+  else {
+    if (parameter == dParamSuspensionErp) return joint->susp_erp;
+    else if (parameter == dParamSuspensionCfm) return joint->susp_cfm;
+    else return joint->limot1.get (parameter);
+  }
 }

@@ -1375,6 +1455,21 @@
 }

+extern "C" dReal dJointGetHinge2Angle2Rate (dxJointHinge2 *joint)
+{
+  dUASSERT(joint,"bad joint argument");
+  dUASSERT(joint->vtable == &__dhinge2_vtable,"joint is not a hinge2");
+  if (joint->node[0].body && joint->node[1].body) {
+    dVector3 axis;
+    dMULTIPLY0_331 (axis,joint->node[1].body->R,joint->axis2);
+    dReal rate = -dDOT(axis,joint->node[0].body->avel);
+    if (joint->node[1].body) rate += dDOT(axis,joint->node[1].body->avel);
+    return rate;
+  }
+  else return 0;
+}
+
+
 dxJoint::Vtable __dhinge2_vtable = {
   sizeof(dxJointHinge2),
   (dxJoint::init_fn*) hinge2Init,


fixed the fix :D

fixed the fix :D

git-svn-id: ab538f9709174a506b15ae819e9819105e1f1301@940 5e8c2511-817d-0410-85a1-fd227d6480d1

--- DofRendererDeferred.cpp
+++ DofRendererDeferred.cpp
@@ -6,6 +6,7 @@
  */

 #include "stdafx.h"
+#include "glh/glh_extensions.h"
 #include <GL/glu.h>

 #include <param/EnumParam.h>


EKF: fix bug in sideslip fusion and reduce RAM usage

The bug meant the  Y velocity (state index 5)  covariance was not being updated correctly when sideslip was being used to constrain velocity drift (extended GPS loss).
The rework of the covariance update to reduce RAM follows the same pattern as adopted for other fusion processes

--- EKF/sideslip_fusion.cpp
+++ EKF/sideslip_fusion.cpp
@@ -189,7 +189,7 @@
 		_innov_check_fail_status.flags.reject_sideslip = true;
 		return;

-        } else {
+	} else {
                 _innov_check_fail_status.flags.reject_sideslip = false;

         }
@@ -200,28 +200,30 @@
 	// apply covariance correction via P_new = (I -K*H)*P
 	// first calculate expression for KHP
 	// then calculate P - KHP
+	float KHP[_k_num_states][_k_num_states];
+	float KH[9];
 	for (unsigned row = 0; row < _k_num_states; row++) {
-		KH[row][0] = Kfusion[row] * H_BETA[0];
-		KH[row][1] = Kfusion[row] * H_BETA[1];
-		KH[row][2] = Kfusion[row] * H_BETA[2];
-		KH[row][3] = Kfusion[row] * H_BETA[3];
-		KH[row][4] = Kfusion[row] * H_BETA[4];
-		KH[row][5] = Kfusion[row] * H_BETA[5];
-		KH[row][6] = Kfusion[row] * H_BETA[6];
-		KH[row][22] = Kfusion[row] * H_BETA[22];
-		KH[row][23] = Kfusion[row] * H_BETA[23];
-	}
-
-	for (unsigned row = 0; row < _k_num_states; row++) {
+
+		KH[0] = Kfusion[row] * H_BETA[0];
+		KH[1] = Kfusion[row] * H_BETA[1];
+		KH[2] = Kfusion[row] * H_BETA[2];
+		KH[3] = Kfusion[row] * H_BETA[3];
+		KH[4] = Kfusion[row] * H_BETA[4];
+		KH[5] = Kfusion[row] * H_BETA[5];
+		KH[6] = Kfusion[row] * H_BETA[6];
+		KH[7] = Kfusion[row] * H_BETA[22];
+		KH[8] = Kfusion[row] * H_BETA[23];
+
 		for (unsigned column = 0; column < _k_num_states; column++) {
-			float tmp = KH[row][0] * P[0][column];
-			tmp += KH[row][1] * P[1][column];
-			tmp += KH[row][2] * P[2][column];
-			tmp += KH[row][3] * P[3][column];
-			tmp += KH[row][4] * P[4][column];
-			tmp += KH[row][6] * P[6][column];
-			tmp += KH[row][22] * P[22][column];
-			tmp += KH[row][23] * P[23][column];
+			float tmp = KH[0] * P[0][column];
+			tmp += KH[1] * P[1][column];
+			tmp += KH[2] * P[2][column];
+			tmp += KH[3] * P[3][column];
+			tmp += KH[4] * P[4][column];
+			tmp += KH[5] * P[5][column];
+			tmp += KH[6] * P[6][column];
+			tmp += KH[7] * P[22][column];
+			tmp += KH[8] * P[23][column];
 			KHP[row][column] = tmp;
 		}
 	}


added: additional information is printed for missing atoms (template name)

--- source/STRUCTURE/residueChecker.C
+++ source/STRUCTURE/residueChecker.C
@@ -1,4 +1,4 @@
-// $Id: residueChecker.C,v 1.13 2000/10/30 00:19:59 amoll Exp $
+// $Id: residueChecker.C,v 1.14 2000/11/14 12:38:31 oliver Exp $

 #include <BALL/STRUCTURE/residueChecker.h>
 #include <BALL/KERNEL/forEach.h>
@@ -132,7 +132,7 @@
 					{
 						Log.warn() << *set_it << " ";
 					}
-					Log.warn() << endl;
+					Log.warn() << " (template was " << reference->getName() << ")" << endl;
 					status_ = false;
 				}


[ClangASTContext] Placate `casts away qualifiers` warnings from GCC.

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@300476 91177308-0d34-0410-b5e6-96231b3b80d8

--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -4484,7 +4484,8 @@
       const clang::ObjCInterfaceType *objc_interface_type =
           objc_class_type->getInterfaceType();
       if (objc_interface_type &&
-          GetCompleteType((lldb::opaque_compiler_type_t)objc_interface_type)) {
+          GetCompleteType(static_cast<lldb::opaque_compiler_type_t>(
+              const_cast<clang::ObjCInterfaceType *>(objc_interface_type)))) {
         clang::ObjCInterfaceDecl *class_interface_decl =
             objc_interface_type->getDecl();
         if (class_interface_decl) {
@@ -4592,7 +4593,8 @@
       const clang::ObjCInterfaceType *objc_interface_type =
           objc_class_type->getInterfaceType();
       if (objc_interface_type &&
-          GetCompleteType((lldb::opaque_compiler_type_t)objc_interface_type)) {
+          GetCompleteType(static_cast<lldb::opaque_compiler_type_t>(
+              const_cast<clang::ObjCInterfaceType *>(objc_interface_type)))) {
         clang::ObjCInterfaceDecl *class_interface_decl =
             objc_interface_type->getDecl();
         if (class_interface_decl) {
@@ -5660,7 +5662,8 @@
     const clang::ObjCInterfaceType *objc_interface_type =
         objc_class_type->getInterfaceType();
     if (objc_interface_type &&
-        GetCompleteType((lldb::opaque_compiler_type_t)objc_interface_type)) {
+        GetCompleteType(static_cast<lldb::opaque_compiler_type_t>(
+            const_cast<clang::ObjCInterfaceType *>(objc_interface_type)))) {
       clang::ObjCInterfaceDecl *class_interface_decl =
           objc_interface_type->getDecl();
       if (class_interface_decl) {
@@ -5807,7 +5810,8 @@
     const clang::ObjCInterfaceType *objc_interface_type =
         objc_class_type->getInterfaceType();
     if (objc_interface_type &&
-        GetCompleteType((lldb::opaque_compiler_type_t)objc_interface_type)) {
+        GetCompleteType(static_cast<lldb::opaque_compiler_type_t>(
+            const_cast<clang::ObjCInterfaceType *>(objc_interface_type)))) {
       clang::ObjCInterfaceDecl *class_interface_decl =
           objc_interface_type->getDecl();
       if (class_interface_decl) {


ENH: restored copy constructor test Blueprint

--- Modules/Blueprints/test/selxBlueprintTest.cxx
+++ Modules/Blueprints/test/selxBlueprintTest.cxx
@@ -122,23 +122,24 @@
   EXPECT_THROW( blueprint->GetConnection( "Component0", "Component1" ), std::runtime_error );
 }

-//TEST_F( BlueprintTest, CopyConstuctor )
-//{
-//  std::unique_ptr< BlueprintImpl > baseBlueprint;
-//  EXPECT_NO_THROW( baseBlueprint = std::unique_ptr< BlueprintImpl >( new BlueprintImpl() ) );
-//
-//  baseBlueprint->SetComponent( "Component0", { { "OperationType", { "Transform" } } } );
-//  std::unique_ptr< BlueprintImpl > clonedBaseBlueprint;
-//  EXPECT_NO_THROW( clonedBaseBlueprint = std::make_unique< BlueprintImpl >( *baseBlueprint.get() ) );
-//
-//  EXPECT_NO_THROW( clonedBaseBlueprint->SetComponent( "Component1", { { "OperationType", { "Source" } }, { "Dimensionality", { "3" } } } ) );
-//
-//  BlueprintImpl::ParameterMapType clonedComponent0;
-//  EXPECT_NO_THROW( clonedComponent0 = clonedBaseBlueprint->GetComponent( "Component0" ) );
-//
-//  BlueprintImpl::ParameterMapType component1;
-//  EXPECT_THROW( component1 = baseBlueprint->GetComponent( "Component1" ), std::runtime_error );
-//}
+TEST_F( BlueprintTest, CopyConstuctor )
+{
+  auto baseBlueprint = Blueprint::New();
+  baseBlueprint->SetComponent( "Component0", { { "OperationType", { "Transform" } } } );
+
+  auto baseBlueprintImpl = baseBlueprint->GetBlueprintImpl();
+
+  std::unique_ptr< BlueprintImpl > clonedBaseBlueprint;
+  EXPECT_NO_THROW( clonedBaseBlueprint = std::make_unique< BlueprintImpl >( baseBlueprintImpl ) );
+
+  EXPECT_NO_THROW( clonedBaseBlueprint->SetComponent( "Component1", { { "OperationType", { "Source" } }, { "Dimensionality", { "3" } } } ) );
+
+  BlueprintImpl::ParameterMapType clonedComponent0;
+  EXPECT_NO_THROW( clonedComponent0 = clonedBaseBlueprint->GetComponent( "Component0" ) );
+
+  BlueprintImpl::ParameterMapType component1;
+  EXPECT_THROW( component1 = baseBlueprint->GetComponent( "Component1" ), std::runtime_error );
+}

 TEST_F( BlueprintTest, Compose )
 {


Minor tweaks

Minor tweaks

--- BeatEmLeft-Engine/BeatEmLeft-Engine/Components/KeyboardInputComponent.cpp
+++ BeatEmLeft-Engine/BeatEmLeft-Engine/Components/KeyboardInputComponent.cpp
@@ -61,7 +61,7 @@
 				else
 					keys["up"] = KeyStates::HELD;
 			}
-			else if (keycode == SDLK_DOWN)
+			if (keycode == SDLK_DOWN)
 			{
 				if (keys["down"] == KeyStates::RELEASED)
 					keys["down"] = KeyStates::PRESSED;
@@ -77,7 +77,7 @@
 				else
 					keys["left"] = KeyStates::HELD;
 			}
-			else if (keycode == SDLK_RIGHT)
+			if (keycode == SDLK_RIGHT)
 			{
 				if (keys["right"] == KeyStates::RELEASED)
 					keys["right"] = KeyStates::PRESSED;


- oops, terminology fail: predicate -> predecessor

--- bangra.cpp
+++ bangra.cpp
@@ -3412,7 +3412,7 @@
     std::string name;
     std::vector<ILBasicBlockParameterRef> parameters;
     ILTerminatorRef terminator;
-    std::unordered_set<ILLabelRef> predicates;
+    std::unordered_set<ILLabelRef> predecessors;

     ILBasicBlock()
     {}
@@ -3442,12 +3442,12 @@

     virtual void relocateRefs() {}

-    void addPredicate(const ILLabelRef &label) {
-        predicates.insert(label);
-    }
-
-    void discardPredicate(const ILLabelRef &label) {
-        predicates.erase(predicates.find(label));
+    void addPredecessor(const ILLabelRef &label) {
+        predecessors.insert(label);
+    }
+
+    void discardPredecessor(const ILLabelRef &label) {
+        predecessors.erase(predecessors.find(label));
     }

     void clear();
@@ -3845,7 +3845,7 @@
 void ILBasicBlock::remove(ILInstructionRef instr) {
     if (llvm::isa<ILLabel>(instr.get())) {
         auto label = std::static_pointer_cast<ILLabel>(instr);
-        label->getLabelBlock()->discardPredicate(label);
+        label->getLabelBlock()->discardPredecessor(label);
     }
     assert(instr->getBlock().get() == this);
     if (firstvalue == instr) {
@@ -3898,7 +3898,7 @@
     }
     if (llvm::isa<ILLabel>(instr.get())) {
         auto label = std::static_pointer_cast<ILLabel>(instr);
-        label->getLabelBlock()->addPredicate(label);
+        label->getLabelBlock()->addPredecessor(label);
     }

 }
@@ -4335,7 +4335,7 @@
         ss << ansi(ANSI_STYLE_OPERATOR,")");
     }
     ss << ansi(ANSI_STYLE_OPERATOR,":") << "\n";
-    for (auto &label : predicates) {
+    for (auto &label : predecessors) {
         ss << "  # <- " << label->getRefRepr(false) << "\n";
     }
     for (auto value = firstvalue; value; value = value->nextvalue) {
@@ -4851,7 +4851,7 @@
     // * resolves instructions with constant inputs to constants
     // * ensures that all types and templates have been specialized
     // * generates implicit casts
-    // ? lowers block arguments that only have one predicate
+    // ? lowers block arguments that only have one predecessor
     // ? removes instructions and values that don't contribute to anything
     // ? removes unreachable blocks due to constant conditions,
     //   and removes single basic block arguments from blocks that are always
@@ -5046,8 +5046,8 @@

     void eval_parameters(const ILBasicBlockRef &block) {
-        if (block->predicates.size() == 1) {
-            auto &pred = *block->predicates.begin();
+        if (block->predecessors.size() == 1) {
+            auto &pred = *block->predecessors.begin();
             // all parameters can be inlined
             for (size_t i = 0; i < block->parameters.size(); ++i) {
                 auto &param = block->parameters[i];
@@ -5062,7 +5062,7 @@
                 auto &param = block->parameters[i];
                 Type *common_type = nullptr;
                 bool failed = false;
-                for (auto &pred : block->predicates) {
+                for (auto &pred : block->predecessors) {
                     auto &arg = pred->getArgument(i);
                     Type *type = arg->getType();
                     if (type == Type::Any) {
@@ -5075,7 +5075,7 @@
                     }
                 }
                 if (failed) {
-                    for (auto &pred : block->predicates) {
+                    for (auto &pred : block->predecessors) {
                         auto &arg = pred->getArgument(i);
                         ilMessage(arg, "conflicting type here");
                     }
@@ -5085,8 +5085,8 @@
                     ilError(param, "unable to type parameter");
                 }
                 param->parameter_type = common_type;
-                // cast predicates where necessary
-                for (auto &pred : block->predicates) {
+                // cast predecessors where necessary
+                for (auto &pred : block->predecessors) {
                     auto &arg = pred->getArgument(i);
                     generate_cast(pred->getBlock(), pred, arg, common_type);
                 }
@@ -5410,11 +5410,11 @@
         for (size_t i = 0; i < il_block->parameters.size(); ++i) {
             auto &param = il_block->parameters[i];
             LLVMValueRef llvm_phi = resolveValue(param);
-            size_t predcount = il_block->predicates.size();
+            size_t predcount = il_block->predecessors.size();
             LLVMValueRef incoming_values[predcount];
             LLVMBasicBlockRef incoming_blocks[predcount];
             size_t k = 0;
-            for (auto &pred : il_block->predicates) {
+            for (auto &pred : il_block->predecessors) {
                 auto &arg = pred->getArgument(i);
                 incoming_values[k] = resolveValue(arg);
                 incoming_blocks[k] = resolveBlock(pred->getBlock());


fixes #272 implemented createImportJobs method so that we can import based upon job string

--- AlembicMAXScript.cpp
+++ AlembicMAXScript.cpp
@@ -195,7 +195,7 @@

 		AppendFunction(
 			exocortexAlembicImportJobs,	//* function ID * /
-			_M("createImportJobs"),           //* internal name * /
+			_M("createImportJob"),           //* internal name * /
 			0,                      //* function name string resource name * /
 			TYPE_INT,               //* Return type * /
 			0,                      //* Flags  * /
@@ -349,52 +349,88 @@
 	return 0;
 }

+
+bool parseBool(std::string value){
+	//std::istringstream(valuePair[1]) >> bExportSelected;
+
+	if( value.find("true") != std::string::npos || value.find("1") != std::string::npos ){
+		return true;
+	}
+	else{
+		return false;
+	}
+}
+
 int ExocortexAlembicStaticInterface_ExocortexAlembicImportJobs( CONST_2013 MCHAR* jobString );
 int ExocortexAlembicStaticInterface::ExocortexAlembicImportJobs( CONST_2013 MCHAR* jobString )
 {
-
-	//ESS_STRUCTURED_EXCEPTION_REPORTING_START
-
-	//	return ExocortexAlembicStaticInterface_ExocortexAlembicImport( strPath, bImportNormals, bImportUVs, bImportMaterialIds, bAttachToExisting, iVisOption);
-
-	//ESS_STRUCTURED_EXCEPTION_REPORTING_END
-
-	//return alembic_failure;
-	return 0;
-}
-
-
-int ExocortexAlembicStaticInterface_ExocortexAlembicImport( CONST_2013 MCHAR* strPath, BOOL bImportNormals, BOOL bImportUVs, BOOL bImportMaterialIds, BOOL bAttachToExisting, int iVisOption);
-
-int ExocortexAlembicStaticInterface::ExocortexAlembicImport( CONST_2013 MCHAR* strPath, BOOL bImportNormals, BOOL bImportUVs, BOOL bImportMaterialIds, BOOL bAttachToExisting, int iVisOption)
-{
 	ESS_STRUCTURED_EXCEPTION_REPORTING_START

-		return ExocortexAlembicStaticInterface_ExocortexAlembicImport( strPath, bImportNormals, bImportUVs, bImportMaterialIds, bAttachToExisting, iVisOption);
+		return ExocortexAlembicStaticInterface_ExocortexAlembicImportJobs( jobString );

 	ESS_STRUCTURED_EXCEPTION_REPORTING_END

 	return alembic_failure;
 }

-int ExocortexAlembicStaticInterface_ExocortexAlembicImport( CONST_2013 MCHAR* strPath, BOOL bImportNormals, BOOL bImportUVs, BOOL bImportMaterialIds, BOOL bAttachToExisting, int iVisOption)
+int ExocortexAlembicStaticInterface_ExocortexAlembicImportJobs( CONST_2013 MCHAR* jobString )
 {
 	try {

-		ESS_LOG_INFO( "ExocortexAlembicImport( strPath=" << strPath <<
-			", bImportNormals=" << bImportNormals << ", bImportUVs=" << bImportUVs <<
-			", bImportMaterialIds=" << bImportMaterialIds << ", bAttachToExisting=" << bAttachToExisting <<
-			", iVisOption=" << iVisOption << " )" );
+      //CONST_2013 MCHAR* strPath,
+      //BOOL bImportNormals,
+      //BOOL bImportUVs,
+      //BOOL bImportMaterialIds,
+      //BOOL bAttachToExisting,
+      //int iVisOption
+
+		//ESS_LOG_INFO( "ExocortexAlembicImport( strPath=" << strPath <<
+		//	", bImportNormals=" << bImportNormals << ", bImportUVs=" << bImportUVs <<
+		//	", bImportMaterialIds=" << bImportMaterialIds << ", bAttachToExisting=" << bAttachToExisting <<
+		//	", iVisOption=" << iVisOption << " )" );
+
+      ESS_LOG_INFO( "Processing import job: "<<jobString);

 		alembic_importoptions options;
-		options.importNormals = (bImportNormals != FALSE);
-		options.importUVs = (bImportUVs != FALSE);
-		options.importMaterialIds = (bImportMaterialIds != FALSE);
-		options.attachToExisting = (bAttachToExisting != FALSE);
-		options.importVisibility = static_cast<VisImportOption>(iVisOption);
-
-		std::string file = EC_MCHAR_to_UTF8( strPath );
+
+		std::string file;// = EC_MCHAR_to_UTF8( strPath );

+		std::vector<std::string> tokens;
+		boost::split(tokens, jobString, boost::is_any_of(";"));
+		for(int j=0; j<tokens.size(); j++){
+
+			std::vector<std::string> valuePair;
+			boost::split(valuePair, tokens[j], boost::is_any_of("="));
+			if(valuePair.size() != 2){
+				ESS_LOG_WARNING("Skipping invalid token: "<<tokens[j]);
+				continue;
+			}
+
+			if(boost::iequals(valuePair[0], "filename")){
+				file = valuePair[1];
+			}
+			else if(boost::iequals(valuePair[0], "normals")){
+				options.importNormals = parseBool(valuePair[1]);
+			}
+			else if(boost::iequals(valuePair[0], "uvs")){
+				options.importUVs = parseBool(valuePair[1]);
+			}
+			else if(boost::iequals(valuePair[0], "materialIds")){
+            options.importMaterialIds = parseBool(valuePair[1]);
+			}
+         else if(boost::iequals(valuePair[0], "attachToExisting")){
+            options.attachToExisting = parseBool(valuePair[1]);
+			}
+			else
+			{
+				ESS_LOG_INFO("Skipping invalid token: "<<tokens[j]);
+				continue;
+			}
+		}
+
+
+
+
 	// If no filename, then return an error code
 		if(file.size() == 0) {
 			ESS_LOG_ERROR( "No filename specified." );
@@ -509,6 +545,31 @@
 }

+int ExocortexAlembicStaticInterface_ExocortexAlembicImport( CONST_2013 MCHAR* strPath, BOOL bImportNormals, BOOL bImportUVs, BOOL bImportMaterialIds, BOOL bAttachToExisting, int iVisOption);
+
+int ExocortexAlembicStaticInterface::ExocortexAlembicImport( CONST_2013 MCHAR* strPath, BOOL bImportNormals, BOOL bImportUVs, BOOL bImportMaterialIds, BOOL bAttachToExisting, int iVisOption)
+{
+	ESS_STRUCTURED_EXCEPTION_REPORTING_START
+
+		return ExocortexAlembicStaticInterface_ExocortexAlembicImport( strPath, bImportNormals, bImportUVs, bImportMaterialIds, bAttachToExisting, iVisOption);
+
+	ESS_STRUCTURED_EXCEPTION_REPORTING_END
+
+	return alembic_failure;
+}
+
+int ExocortexAlembicStaticInterface_ExocortexAlembicImport( CONST_2013 MCHAR* strPath, BOOL bImportNormals, BOOL bImportUVs, BOOL bImportMaterialIds, BOOL bAttachToExisting, int iVisOption)
+{
+	std::stringstream jobStream;
+	jobStream<<"filename="<<strPath<<";normals="<<bImportNormals<<";uvs="<<bImportUVs<<";materialIds="<<bImportMaterialIds<<";attachToExisting="<<bAttachToExisting;
+
+	TSTR tStr = EC_UTF8_to_TSTR( jobStream.str().c_str() );
+	return ExocortexAlembicStaticInterface_ExocortexAlembicImportJobs( tStr.data() );
+
+	return 0;
+}
+
+
 void addNodeChildren(INode* pNode, ObjectList& allSceneObjects, TimeValue time, std::string path)
 {
 	for(int i=0; i<pNode->NumberOfChildren(); i++){
@@ -551,17 +612,6 @@
 	}

 	return alembic_success;
-}
-
-bool parseBool(std::string value){
-	//std::istringstream(valuePair[1]) >> bExportSelected;
-
-	if( value.find("true") != std::string::npos || value.find("1") != std::string::npos ){
-		return true;
-	}
-	else{
-		return false;
-	}
 }

 int ExocortexAlembicStaticInterface_ExocortexAlembicExportJobs( CONST_2013 MCHAR* jobString );


Adding missing inline qualifiers for Cast function

--- choice.hpp
+++ choice.hpp
@@ -19,7 +19,7 @@
 namespace choice {

 template<typename TOut,typename TIn>
-TOut Cast( const TIn& input )
+inline TOut Cast( const TIn& input )
 {
     std::stringstream stream;
     TOut output;
@@ -31,7 +31,7 @@
 }

 template<>
-bool Cast( const std::string& input )
+inline bool Cast( const std::string& input )
 {
     std::string trueString("true");
     std::string falseString("false");
@@ -48,7 +48,6 @@
         return output;
     }
 }
-

 class ArgException : public std::logic_error
 {


Handled the call operator properly.

Handled the call operator properly.

git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@142033 91177308-0d34-0410-b5e6-96231b3b80d8

--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -1378,20 +1378,25 @@
 }

 static inline bool
-check_op_param (bool unary, bool binary, uint32_t num_params)
-{
+check_op_param (uint32_t op_kind, bool unary, bool binary, uint32_t num_params)
+{
+    // Special-case call since it can take any number of operands
+    if(op_kind == OO_Call)
+        return true;
+
     // The parameter count doens't include "this"
     if (num_params == 0)
         return unary;
     if (num_params == 1)
         return binary;
+    else
     return false;
 }
-
+;
 bool
 ClangASTContext::CheckOverloadedOperatorKindParameterCount (uint32_t op_kind, uint32_t num_params)
 {
-#define OVERLOADED_OPERATOR(Name,Spelling,Token,Unary,Binary,MemberOnly) case OO_##Name: return check_op_param (Unary, Binary, num_params);
+#define OVERLOADED_OPERATOR(Name,Spelling,Token,Unary,Binary,MemberOnly) case OO_##Name: return check_op_param (op_kind, Unary, Binary, num_params);
     switch (op_kind)
     {
 #include "clang/Basic/OperatorKinds.def"


cosmetics, add spaces to improve reading and other

--- PWGGA/CaloTrackCorrelations/AliAnaElectron.cxx
+++ PWGGA/CaloTrackCorrelations/AliAnaElectron.cxx
@@ -167,35 +167,38 @@
 Bool_t  AliAnaElectron::ClusterSelected(AliVCluster* calo, Int_t nMaxima)
 {
   AliDebug(1,Form("Current Event %d; Before selection : E %2.2f, pT %2.2f, Ecl %2.2f, phi %2.2f, eta %2.2f",
-           GetReader()->GetEventNumber(),fMomentum.E(),fMomentum.Pt(),calo->E(),fMomentum.Phi()*TMath::RadToDeg(),fMomentum.Eta()));
+                  GetReader()->GetEventNumber(),fMomentum.E(),fMomentum.Pt(),
+                  calo->E(),GetPhi(fMomentum.Phi())*TMath::RadToDeg(),fMomentum.Eta()));

   //.......................................
-  //If too small or big energy, skip it
-  if(fMomentum.E() < GetMinEnergy() || fMomentum.E() > GetMaxEnergy() ) return kFALSE ;
+  // If too small or big energy, skip it
+  if ( fMomentum.E() < GetMinEnergy() ||
+       fMomentum.E() > GetMaxEnergy()   ) return kFALSE ;
   AliDebug(2,Form("\t Cluster %d Pass E Cut",calo->GetID()));

   //.......................................
   // TOF cut, BE CAREFUL WITH THIS CUT
   Double_t tof = calo->GetTOF()*1e9;
-  if(tof < fTimeCutMin || tof > fTimeCutMax) return kFALSE;
+  if ( tof < fTimeCutMin || tof > fTimeCutMax ) return kFALSE;
   AliDebug(2,Form("\t Cluster %d Pass Time Cut",calo->GetID()));

   //.......................................
-  if(calo->GetNCells() <= fNCellsCut && GetReader()->GetDataType() != AliCaloTrackReader::kMC) return kFALSE;
+  if ( calo->GetNCells() <= fNCellsCut &&
+       GetReader()->GetDataType() != AliCaloTrackReader::kMC ) return kFALSE;
   AliDebug(2,Form("\t Cluster %d Pass NCell Cut",calo->GetID()));

   //.......................................
-  //Check acceptance selection
-  if(IsFiducialCutOn())
+  // Check acceptance selection
+  if ( IsFiducialCutOn() )
   {
     Bool_t in = GetFiducialCut()->IsInFiducialCut(fMomentum.Eta(),fMomentum.Phi(),GetCalorimeter()) ;
-    if(! in ) return kFALSE ;
+    if ( !in ) return kFALSE ;
   }
   AliDebug(2,"\t Fiducial cut passed");

   //.......................................
-  //Skip not matched clusters with tracks
-  if(!IsTrackMatched(calo, GetReader()->GetInputEvent()))
+  // Skip not matched clusters with tracks
+  if ( !IsTrackMatched(calo, GetReader()->GetInputEvent()) )
   {
       AliDebug(1,"\t Reject non track-matched clusters");
       return kFALSE ;
@@ -203,25 +206,25 @@
   else AliDebug(2,"\t Track-matching cut passed");

   //...........................................
-  // skip clusters with too many maxima
-  if(nMaxima < fNLMCutMin || nMaxima > fNLMCutMax) return kFALSE ;
+  // Skip clusters with too many maxima
+  if ( nMaxima < fNLMCutMin || nMaxima > fNLMCutMax ) return kFALSE ;
   AliDebug(2,Form("\t Cluster %d pass NLM %d of out of range",calo->GetID(), nMaxima));

   //.......................................
-  //Check Distance to Bad channel, set bit.
+  // Check Distance to Bad channel, set bit.
   Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
-  if(distBad < 0.) distBad=9999. ; //workout strange convension dist = -1. ;
-  if(distBad < fMinDist) {//In bad channel (PHOS cristal size 2.2x2.2 cm), EMCAL ( cell units )
+  if ( distBad < 0.       ) distBad=9999. ; //workout strange convension dist = -1. ;
+  if ( distBad < fMinDist ) //In bad channel (PHOS cristal size 2.2x2.2 cm), EMCAL ( cell units )
     return kFALSE ;
-  }
   else AliDebug(2,Form("\t Bad channel cut passed %4.2f > %2.2f",distBad, fMinDist));
   //printf("Cluster %d Pass Bad Dist Cut \n",icalo);

- AliDebug(1,Form("Current Event %d; After  selection : E %2.2f, pT %2.2f, Ecl %2.2f, phi %2.2f, eta %2.2f",
-           GetReader()->GetEventNumber(),
-           fMomentum.E(), fMomentum.Pt(),calo->E(),fMomentum.Phi()*TMath::RadToDeg(),fMomentum.Eta()));
-
-  //All checks passed, cluster selected
+  AliDebug(1,Form("Current Event %d; After  selection : E %2.2f, pT %2.2f, Ecl %2.2f, phi %2.2f, eta %2.2f",
+                  GetReader()->GetEventNumber(),
+                  fMomentum.E(), fMomentum.Pt(),calo->E(),
+                  GetPhi(fMomentum.Phi())*TMath::RadToDeg(),fMomentum.Eta()));
+
+  // All checks passed, cluster selected
   return kTRUE;

 }
@@ -231,11 +234,11 @@
 //______________________________________________________________________________________________
 void  AliAnaElectron::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag, Int_t pidTag)
 {
-  if(!fFillSSHistograms || GetMixedEvent()) return;
+  if ( !fFillSSHistograms || GetMixedEvent() ) return;

   Int_t pidIndex = 0;// Electron
-  if     (pidTag == AliCaloPID::kElectron)      pidIndex = 0;
-  else if(pidTag == AliCaloPID::kChargedHadron) pidIndex = 1;
+  if      ( pidTag == AliCaloPID::kElectron      ) pidIndex = 0;
+  else if ( pidTag == AliCaloPID::kChargedHadron ) pidIndex = 1;
   else return;

   Float_t energy  = cluster->E();
@@ -249,24 +252,23 @@
   Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;

   Float_t eta = fMomentum.Eta();
-  Float_t phi = fMomentum.Phi();
-  if(phi < 0) phi+=TMath::TwoPi();
+  Float_t phi = GetPhi(fMomentum.Phi());

   fhLam0E[pidIndex] ->Fill(energy, lambda0, GetEventWeight());
   fhLam1E[pidIndex] ->Fill(energy, lambda1, GetEventWeight());
   fhDispE[pidIndex] ->Fill(energy, disp   , GetEventWeight());

-  if(GetCalorimeter() == kEMCAL &&  GetFirstSMCoveredByTRD() >= 0 &&
-     GetModuleNumber(cluster) >= GetFirstSMCoveredByTRD() )
+  if ( GetCalorimeter() == kEMCAL &&  GetFirstSMCoveredByTRD() >= 0 &&
+       GetModuleNumber(cluster) >= GetFirstSMCoveredByTRD() )
   {
     fhLam0ETRD[pidIndex]->Fill(energy, lambda0, GetEventWeight());
     fhLam1ETRD[pidIndex]->Fill(energy, lambda1, GetEventWeight());
     fhDispETRD[pidIndex]->Fill(energy, disp   , GetEventWeight());
   }

-  if(!fFillOnlySimpleSSHisto)
-  {
-    if(energy < 2)
+  if ( !fFillOnlySimpleSSHisto )
+  {
+    if ( energy < 2 )
     {
       fhNCellsLam0LowE[pidIndex] ->Fill(ncells, lambda0, GetEventWeight());
       fhEtaLam0LowE[pidIndex]    ->Fill(eta,    lambda0, GetEventWeight());
@@ -279,7 +281,7 @@
       fhPhiLam0HighE[pidIndex]   ->Fill(phi,    lambda0, GetEventWeight());
     }

-    if(GetCalorimeter() == kEMCAL)
+    if ( GetCalorimeter() == kEMCAL )
     {
       GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), GetReader()->GetInputEvent()->GetEMCALCells(), cluster,
                                                                                l0, l1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi);
@@ -289,7 +291,7 @@
       fhSumPhiE         [pidIndex]-> Fill(energy, sPhi     , GetEventWeight());
       fhSumEtaPhiE      [pidIndex]-> Fill(energy, sEtaPhi  , GetEventWeight());
       fhDispEtaPhiDiffE [pidIndex]-> Fill(energy, dPhi-dEta, GetEventWeight());
-      if(dEta+dPhi>0)
+      if ( dEta+dPhi > 0 )
           fhSphericityE [pidIndex]-> Fill(energy, (dPhi-dEta)/(dEta+dPhi), GetEventWeight());

       if      (energy < 2 ) fhDispEtaDispPhiEBin[pidIndex][0]->Fill(dEta, dPhi, GetEventWeight());
@@ -300,25 +302,26 @@
     }
   }

-  if(IsDataMC())
+  if ( IsDataMC() )
   {
     AliVCaloCells* cells = 0;
-    if(GetCalorimeter() == kEMCAL) cells = GetEMCALCells();
-    else                           cells = GetPHOSCells();
+    if ( GetCalorimeter() == kEMCAL ) cells = GetEMCALCells();
+    else                              cells = GetPHOSCells();

     //Fill histograms to check shape of embedded clusters
     Float_t fraction = 0;
-    if(GetReader()->IsEmbeddedClusterSelectionOn()){//Only working for EMCAL
-
+    if ( GetReader()->IsEmbeddedClusterSelectionOn() )
+    {//Only working for EMCAL
       Float_t clusterE = 0; // recalculate in case corrections applied.
       Float_t cellE    = 0;
-      for(Int_t icell = 0; icell < cluster->GetNCells(); icell++){
+      for(Int_t icell = 0; icell < cluster->GetNCells(); icell++)
+      {
         cellE    = cells->GetCellAmplitude(cluster->GetCellAbsId(icell));
         clusterE+=cellE;
         fraction+=cellE*cluster->GetCellAmplitudeFraction(icell);
       }

-      //Fraction of total energy due to the embedded signal
+      // Fraction of total energy due to the embedded signal
       fraction/=clusterE;

       AliDebug(1,Form("Energy fraction of embedded signal %2.3f, Energy %2.3f",fraction, clusterE));
@@ -329,10 +332,10 @@
     // Check the origin and fill histograms
     Int_t index = -1;

-    if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
-       !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) &&
-       !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) &&
-       !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta))
+    if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
+        !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) &&
+        !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) &&
+        !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta) )
     {
       index = kmcssPhoton;
     }//photon   no conversion
@@ -341,7 +344,7 @@
     {
       index = kmcssElectron;

-      if(!GetReader()->IsEmbeddedClusterSelectionOn())
+      if ( !GetReader()->IsEmbeddedClusterSelectionOn() )
       {
         //Check particle overlaps in cluster

@@ -353,16 +356,16 @@
         {
           ancLabel = GetMCAnalysisUtils()->CheckCommonAncestor(cluster->GetLabels()[0],cluster->GetLabels()[ilab], GetMC(),
                                                                ancPDG,ancStatus,fMomentumMC,fProdVertex);
-          if(ancPDG!=22 && TMath::Abs(ancPDG)!=11) noverlaps++;
-        }
-
-        if(noverlaps == 1){
+          if ( ancPDG!=22 && TMath::Abs(ancPDG)!=11 ) noverlaps++;
+        }
+
+        if      ( noverlaps == 1 ) {
           fhMCElectronELambda0NoOverlap  ->Fill(energy, lambda0, GetEventWeight());
         }
-        else if(noverlaps == 2){
+        else if ( noverlaps == 2 ) {
           fhMCElectronELambda0TwoOverlap ->Fill(energy, lambda0, GetEventWeight());
         }
-        else if(noverlaps > 2){
+        else if ( noverlaps >  2 ) {
           fhMCElectronELambda0NOverlap   ->Fill(energy, lambda0, GetEventWeight());
         }
         else
@@ -372,17 +375,17 @@
       }//No embedding

       //Fill histograms to check shape of embedded clusters
-      if(GetReader()->IsEmbeddedClusterSelectionOn())
-      {
-        if     (fraction > 0.9)
+      if ( GetReader()->IsEmbeddedClusterSelectionOn() )
+      {
+        if      ( fraction > 0.9 )
         {
           fhEmbedElectronELambda0FullSignal   ->Fill(energy, lambda0, GetEventWeight());
         }
-        else if(fraction > 0.5)
+        else if ( fraction > 0.5 )
         {
           fhEmbedElectronELambda0MostlySignal ->Fill(energy, lambda0, GetEventWeight());
         }
-        else if(fraction > 0.1)
+        else if ( fraction > 0.1 )
         {
           fhEmbedElectronELambda0MostlyBkg    ->Fill(energy, lambda0, GetEventWeight());
         }
@@ -412,13 +415,13 @@

     fhMCELambda0[pidIndex][index]    ->Fill(energy, lambda0, GetEventWeight());

-    if(GetCalorimeter() == kEMCAL && !fFillOnlySimpleSSHisto)
+    if ( GetCalorimeter() == kEMCAL && !fFillOnlySimpleSSHisto )
     {
       fhMCEDispEta        [pidIndex][index]-> Fill(energy, dEta     , GetEventWeight());
       fhMCEDispPhi        [pidIndex][index]-> Fill(energy, dPhi     , GetEventWeight());
       fhMCESumEtaPhi      [pidIndex][index]-> Fill(energy, sEtaPhi  , GetEventWeight());
       fhMCEDispEtaPhiDiff [pidIndex][index]-> Fill(energy, dPhi-dEta, GetEventWeight());
-      if(dEta+dPhi>0)
+      if ( dEta+dPhi > 0 )
           fhMCESphericity [pidIndex][index]-> Fill(energy, (dPhi-dEta)/(dEta+dPhi), GetEventWeight());
     }
   } // MC data
@@ -549,7 +552,7 @@
   fhEOverPvsPCutM02CutdEdx->SetYTitle("E/p");
   outputContainer->Add(fhEOverPvsPCutM02CutdEdx);

-  if(IsDataMC())
+  if ( IsDataMC() )
   {
     for(Int_t i = 0; i < fNOriginHistograms; i++)
     {
@@ -586,7 +589,7 @@

   TString pidParticle[] = {"Electron","ChargedHadron"} ;

-  if(fFillWeightHistograms)
+  if ( fFillWeightHistograms )
   {
     fhECellClusterRatio  = new TH2F ("hECellClusterRatio"," cell energy / cluster energy vs cluster energy, for selected electrons",
                                      nptbins,ptmin,ptmax, 100,0,1.);
@@ -626,12 +629,12 @@
       //        fhLambda1ForW0[iw]->SetYTitle("#lambda^{2}_{1}");
       //        outputContainer->Add(fhLambda1ForW0[iw]);
     }
-  }
+  }  // weight

   for(Int_t pidIndex = 0; pidIndex < 2; pidIndex++)
   {
     // Shower shape
-    if(fFillSSHistograms)
+    if ( fFillSSHistograms )
     {
       fhLam0E[pidIndex]  = new TH2F (Form("h%sLam0E",pidParticle[pidIndex].Data()),
                                      Form("%s: #lambda_{0}^{2} vs E",pidParticle[pidIndex].Data()),
@@ -654,7 +657,7 @@
       fhDispE[pidIndex]->SetXTitle("E (GeV) ");
       outputContainer->Add(fhDispE[pidIndex]);

-      if(GetCalorimeter() == kEMCAL &&  GetFirstSMCoveredByTRD() >=0 )
+      if ( GetCalorimeter() == kEMCAL &&  GetFirstSMCoveredByTRD() >=0 )
       {
         fhLam0ETRD[pidIndex]  = new TH2F (Form("h%sLam0ETRD",pidParticle[pidIndex].Data()),
                                           Form("%s: #lambda_{0}^{2} vs E, EMCAL SM covered by TRD",pidParticle[pidIndex].Data()),
@@ -678,7 +681,7 @@
         outputContainer->Add(fhDispETRD[pidIndex]);
       }

-      if(!fFillOnlySimpleSSHisto)
+      if ( !fFillOnlySimpleSSHisto )
       {
         fhNCellsLam0LowE[pidIndex]  = new TH2F (Form("h%sNCellsLam0LowE",pidParticle[pidIndex].Data()),
                                                 Form("%s: N_{cells} in cluster vs #lambda_{0}^{2}, E < 2 GeV",pidParticle[pidIndex].Data()),
@@ -723,7 +726,7 @@
         fhPhiLam0HighE[pidIndex]->SetXTitle("#varphi (rad)");
         outputContainer->Add(fhPhiLam0HighE[pidIndex]);

-        if(GetCalorimeter() == kEMCAL)
+        if ( GetCalorimeter() == kEMCAL )
         {
           fhDispEtaE[pidIndex]  = new TH2F (Form("h%sDispEtaE",pidParticle[pidIndex].Data()),
                                             Form("%s: #sigma^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i} - <#eta>)^{2}/ #Sigma w_{i} vs E",pidParticle[pidIndex].Data()),
@@ -788,9 +791,9 @@
       }
     } // Shower shape

-    if(IsDataMC())
-    {
-      if(fFillSSHistograms)
+    if ( IsDataMC() )
+    {
+      if ( fFillSSHistograms )
       {
         for(Int_t i = 0; i < 6; i++)
         {
@@ -801,7 +804,7 @@
           fhMCELambda0[pidIndex][i]->SetXTitle("E (GeV)");
           outputContainer->Add(fhMCELambda0[pidIndex][i]) ;

-          if(GetCalorimeter()==kEMCAL && !fFillOnlySimpleSSHisto)
+          if ( GetCalorimeter()==kEMCAL && !fFillOnlySimpleSSHisto )
           {
             fhMCEDispEta[pidIndex][i]  = new TH2F (Form("h%sEDispEtaE_MC%s",pidParticle[pidIndex].Data(),pnamess[i].Data()),
                                                    Form("cluster from %s : %s like, #sigma^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i} - <#eta>)^{2}/ #Sigma w_{i} vs E",ptypess[i].Data(),pidParticle[pidIndex].Data()),
@@ -843,7 +846,7 @@
       }
     }

-    //if(IsCaloPIDOn() && pidIndex > 0) continue;
+    //if ( IsCaloPIDOn() && pidIndex > 0 ) continue;

     fhNCellsE[pidIndex]  = new TH2F (Form("h%sNCellsE",pidParticle[pidIndex].Data()),
                                      Form("N cells in %s cluster vs E ",pidParticle[pidIndex].Data()),
@@ -907,7 +910,8 @@
     fhEtaPhi[pidIndex]->SetYTitle("#varphi (rad)");
     fhEtaPhi[pidIndex]->SetXTitle("#eta");
     outputContainer->Add(fhEtaPhi[pidIndex]) ;
-    if(GetMinPt() < 0.5)
+
+    if ( GetMinPt() < 0.5 )
     {
       fhEtaPhi05[pidIndex]  = new TH2F(Form("h%sEtaPhi05",pidParticle[pidIndex].Data()),
                                        Form("%s: #eta vs #varphi, E > 0.5",pidParticle[pidIndex].Data()),
@@ -918,7 +922,7 @@
     }

-    if(IsDataMC())
+    if ( IsDataMC() )
     {
       for(Int_t i = 0; i < fNOriginHistograms; i++)
       {
@@ -967,11 +971,11 @@
   }// pid Index

-  if(fFillSSHistograms)
-  {
-    if(IsDataMC())
-    {
-      if(!GetReader()->IsEmbeddedClusterSelectionOn())
+  if ( fFillSSHistograms )
+  {
+    if ( IsDataMC() )
+    {
+      if ( !GetReader()->IsEmbeddedClusterSelectionOn() )
       {
         fhMCElectronELambda0NoOverlap  = new TH2F("hELambda0_MCElectron_NoOverlap",
                                                   "cluster from Electron : E vs #lambda_{0}^{2}",
@@ -996,7 +1000,7 @@
       } // No embedding

       // Fill histograms to check shape of embedded clusters
-      if(GetReader()->IsEmbeddedClusterSelectionOn())
+      if ( GetReader()->IsEmbeddedClusterSelectionOn() )
       {
         fhEmbeddedSignalFractionEnergy  = new TH2F("hEmbeddedSignal_FractionEnergy",
                                                    "Energy Fraction of embedded signal versus cluster energy",
@@ -1086,7 +1090,7 @@
   if      (GetCalorimeter() == kPHOS ) pl = GetPHOSClusters ();
   else if (GetCalorimeter() == kEMCAL) pl = GetEMCALClusters();

-  if(!pl)
+  if ( !pl )
   {
     AliWarning(Form("TObjArray with %s clusters is NULL!",GetCalorimeterString().Data()));
     return;
@@ -1113,11 +1117,11 @@
     {
       evtIndex=GetMixedEvent()->EventIndexForCaloCluster(calo->GetID()) ;
       //Get the vertex and check it is not too large in z
-      if(TMath::Abs(GetVertex(evtIndex)[2])> GetZvertexCut()) continue;
+      if ( TMath::Abs(GetVertex(evtIndex)[2])> GetZvertexCut() ) continue;
     }

     //Cluster selection, not charged, with photon id and in fiducial cut
-    if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
+    if ( GetReader()->GetDataType() != AliCaloTrackReader::kMC )
     {
       calo->GetMomentum(fMomentum,GetVertex(evtIndex)) ;
     }//Assume that come from vertex in straight line
@@ -1130,12 +1134,12 @@
     //--------------------------------------
     // Cluster selection
     //--------------------------------------
-    AliVCaloCells* cells    = 0;
-    if(GetCalorimeter() == kEMCAL) cells = GetEMCALCells();
-    else                           cells = GetPHOSCells();
+    AliVCaloCells* cells = 0;
+    if ( GetCalorimeter() == kEMCAL ) cells = GetEMCALCells();
+    else                              cells = GetPHOSCells();

     Int_t nMaxima = GetCaloUtils()->GetNumberOfLocalMaxima(calo, cells); // NLM
-    if(!ClusterSelected(calo,nMaxima)) continue;
+    if ( !ClusterSelected(calo,nMaxima) ) continue;

     //-------------------------------------
     // PID selection via dE/dx
@@ -1143,20 +1147,26 @@

     AliVTrack *track = GetCaloUtils()->GetMatchedTrack(calo, GetReader()->GetInputEvent());

-    if(!track)
+    if ( !track )
     {
       AliWarning("Null track");
       continue;
     }

+    if ( track->P() < 0.01 )
+    {
+      AliWarning("Too Low P track %f GeV/c, continue\n",track->P());
+      continue;
+    }
+
     //printf("track dedx %f, p %f, cluster E %f\n",track->GetTPCsignal(),track->P(),calo->E());
-    Float_t dEdx = track->GetTPCsignal();
+    Float_t dEdx   = track->GetTPCsignal();
     Float_t eOverp = calo->E()/track->P();

     fhdEdxvsE->Fill(calo ->E(), dEdx, GetEventWeight());
     fhdEdxvsP->Fill(track->P(), dEdx, GetEventWeight());

-    if( eOverp < fEOverPMax && eOverp > fEOverPMin)
+    if ( eOverp < fEOverPMax && eOverp > fEOverPMin )
     {
       fhdEdxvsECutEOverP  ->Fill(calo ->E(), dEdx, GetEventWeight());
       fhdEdxvsPCutEOverP  ->Fill(track->P(), dEdx, GetEventWeight());
@@ -1164,7 +1174,7 @@

     // Apply a mild cut on the cluster SS and check the value of dEdX and EOverP
     Float_t m02 = calo->GetM02();
-    if(m02 > 0.1 && m02 < 0.4)
+    if ( m02 > 0.1 && m02 < 0.4 )
     {
       fhdEdxvsECutM02  ->Fill(calo ->E(), dEdx  , GetEventWeight());
       fhdEdxvsPCutM02  ->Fill(track->P(), dEdx  , GetEventWeight());
@@ -1174,18 +1184,18 @@

     Int_t pid  = AliCaloPID::kChargedHadron;

-    if( dEdx < fdEdxMax && dEdx > fdEdxMin)
+    if ( dEdx < fdEdxMax && dEdx > fdEdxMin )
     {
       fhEOverPvsE->Fill(calo ->E(), eOverp, GetEventWeight());
       fhEOverPvsP->Fill(track->P(), eOverp, GetEventWeight());

-      if(m02 > 0.1 && m02 < 0.4)
+      if ( m02 > 0.1 && m02 < 0.4 )
       {
         fhEOverPvsECutM02CutdEdx->Fill(calo ->E(), eOverp, GetEventWeight());
         fhEOverPvsPCutM02CutdEdx->Fill(track->P(), eOverp, GetEventWeight());
       }

-      if( eOverp < fEOverPMax && eOverp > fEOverPMin)
+      if ( eOverp < fEOverPMax && eOverp > fEOverPMin )
       {
         pid  = AliCaloPID::kElectron;
       } // E/p
@@ -1193,7 +1203,7 @@
     }// dE/dx

     Int_t pidIndex = 0;// Electron
-    if(pid == AliCaloPID::kChargedHadron) pidIndex = 1;
+    if ( pid == AliCaloPID::kChargedHadron ) pidIndex = 1;

     //--------------------------------------------------------------------------------------
     // Play with the MC stack if available
@@ -1201,50 +1211,50 @@

     //Check origin of the candidates
     Int_t tag = -1 ;
-    if(IsDataMC())
+    if ( IsDataMC() )
     {
       tag = GetMCAnalysisUtils()->CheckOrigin(calo->GetLabels(), calo->GetNLabels(), GetMC(),
                                               GetReader()->GetNameOfMCEventHederGeneratorToAccept());

       AliDebug(1,Form("Origin of candidate, bit map %d",tag));

-      if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) && fhMCE[pidIndex][kmcPhoton])
+      if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) && fhMCE[pidIndex][kmcPhoton] )
       {
         fhMCdEdxvsE  [kmcPhoton]->Fill(calo ->E(), dEdx  , GetEventWeight());
         fhMCdEdxvsP  [kmcPhoton]->Fill(track->P(), dEdx  , GetEventWeight());
         fhMCEOverPvsE[kmcPhoton]->Fill(calo ->E(), eOverp, GetEventWeight());
         fhMCEOverPvsP[kmcPhoton]->Fill(track->P(), eOverp, GetEventWeight());

-        if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) && fhMCE[pidIndex][kmcConversion])
+        if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) && fhMCE[pidIndex][kmcConversion] )
         {
           fhMCdEdxvsE  [kmcConversion]->Fill(calo ->E(), dEdx  , GetEventWeight());
           fhMCdEdxvsP  [kmcConversion]->Fill(track->P(), dEdx  , GetEventWeight());
           fhMCEOverPvsE[kmcConversion]->Fill(calo ->E(), eOverp, GetEventWeight());
           fhMCEOverPvsP[kmcConversion]->Fill(track->P(), eOverp, GetEventWeight());
         }
-        else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay) &&
-                !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE[pidIndex][kmcPi0Decay])
+        else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay) &&
+                 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE[pidIndex][kmcPi0Decay] )
         {
           fhMCdEdxvsE  [kmcPi0Decay]->Fill(calo ->E(), dEdx  , GetEventWeight());
           fhMCdEdxvsP  [kmcPi0Decay]->Fill(track->P(), dEdx  , GetEventWeight());
           fhMCEOverPvsE[kmcPi0Decay]->Fill(calo ->E(), eOverp, GetEventWeight());
           fhMCEOverPvsP[kmcPi0Decay]->Fill(track->P(), eOverp, GetEventWeight());
         }
-        else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE  [pidIndex][kmcPi0])
+        else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE  [pidIndex][kmcPi0] )
         {
           fhMCdEdxvsE  [kmcPi0]->Fill(calo ->E(), dEdx  , GetEventWeight());
           fhMCdEdxvsP  [kmcPi0]->Fill(track->P(), dEdx  , GetEventWeight());
           fhMCEOverPvsE[kmcPi0]->Fill(calo ->E(), eOverp, GetEventWeight());
           fhMCEOverPvsP[kmcPi0]->Fill(track->P(), eOverp, GetEventWeight());
         }
-        else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) && fhMCE[pidIndex][kmcEta])
+        else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) && fhMCE[pidIndex][kmcEta] )
         {
           fhMCdEdxvsE  [kmcEta]->Fill(calo ->E(), dEdx  , GetEventWeight());
           fhMCdEdxvsP  [kmcEta]->Fill(track->P(), dEdx  , GetEventWeight());
           fhMCEOverPvsE[kmcEta]->Fill(calo ->E(), eOverp, GetEventWeight());
           fhMCEOverPvsP[kmcEta]->Fill(track->P(), eOverp, GetEventWeight());
         }
-        else if( fhMCE[pidIndex][kmcOtherDecay] )
+        else if ( fhMCE[pidIndex][kmcOtherDecay] )
         {
           fhMCdEdxvsE  [kmcOtherDecay]->Fill(calo ->E(), dEdx  , GetEventWeight());
           fhMCdEdxvsP  [kmcOtherDecay]->Fill(track->P(), dEdx  , GetEventWeight());
@@ -1252,28 +1262,28 @@
           fhMCEOverPvsP[kmcOtherDecay]->Fill(track->P(), eOverp, GetEventWeight());
         }
       }
-      else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron) && fhMCE[pidIndex][kmcAntiNeutron])
+      else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron) && fhMCE[pidIndex][kmcAntiNeutron] )
       {
         fhMCdEdxvsE  [kmcAntiNeutron]->Fill(calo ->E(), dEdx  , GetEventWeight());
         fhMCdEdxvsP  [kmcAntiNeutron]->Fill(track->P(), dEdx  , GetEventWeight());
         fhMCEOverPvsE[kmcAntiNeutron]->Fill(calo ->E(), eOverp, GetEventWeight());
         fhMCEOverPvsP[kmcAntiNeutron]->Fill(track->P(), eOverp, GetEventWeight());
       }
-      else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiProton) && fhMCE[pidIndex][kmcAntiProton])
+      else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiProton) && fhMCE[pidIndex][kmcAntiProton] )
       {
         fhMCdEdxvsE  [kmcAntiProton]->Fill(calo ->E(), dEdx  , GetEventWeight());
         fhMCdEdxvsP  [kmcAntiProton]->Fill(track->P(), dEdx  , GetEventWeight());
         fhMCEOverPvsE[kmcAntiProton]->Fill(calo ->E(), eOverp, GetEventWeight());
         fhMCEOverPvsP[kmcAntiProton]->Fill(track->P(), eOverp, GetEventWeight());
       }
-      else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) && fhMCE[pidIndex][kmcElectron])
+      else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) && fhMCE[pidIndex][kmcElectron] )
       {
         fhMCdEdxvsE  [kmcElectron]->Fill(calo ->E(), dEdx  , GetEventWeight());
         fhMCdEdxvsP  [kmcElectron]->Fill(track->P(), dEdx  , GetEventWeight());
         fhMCEOverPvsE[kmcElectron]->Fill(calo ->E(), eOverp, GetEventWeight());
         fhMCEOverPvsP[kmcElectron]->Fill(track->P(), eOverp, GetEventWeight());
       }
-      else if( fhMCE[pidIndex][kmcOther])
+      else if ( fhMCE[pidIndex][kmcOther] )
       {
         fhMCdEdxvsE  [kmcOther]->Fill(calo ->E(), dEdx  , GetEventWeight());
         fhMCdEdxvsP  [kmcOther]->Fill(track->P(), dEdx  , GetEventWeight());
@@ -1288,7 +1298,7 @@

     FillShowerShapeHistograms(calo,tag,pid);

-    if(pid == AliCaloPID::kElectron)
+    if ( pid == AliCaloPID::kElectron )
       WeightHistograms(calo);

     //-----------------------------------------
@@ -1296,17 +1306,17 @@
     //-----------------------------------------

     // Data, PID check on
-    if(IsCaloPIDOn())
+    if ( IsCaloPIDOn() )
     {
       // Get most probable PID, 2 options check bayesian PID weights or redo PID
       // By default, redo PID

-      if(GetCaloPID()->GetIdentifiedParticleType(calo)!=AliCaloPID::kPhoton)
-      {
-        if(fAODParticle == AliCaloPID::kElectron)
+      if ( GetCaloPID()->GetIdentifiedParticleType(calo)!=AliCaloPID::kPhoton )
+      {
+        if ( fAODParticle == AliCaloPID::kElectron )
           continue;

-        if(fAODParticle == 0 )
+        if ( fAODParticle == 0 )
           pid = AliCaloPID::kChargedHadron ;
       }

@@ -1317,7 +1327,8 @@

     Float_t maxCellFraction = 0;
     Int_t absID = GetCaloUtils()->GetMaxEnergyCell(cells, calo,maxCellFraction);
-    if ( absID >= 0 )fhMaxCellDiffClusterE[pidIndex]->Fill(fMomentum.E(), maxCellFraction, GetEventWeight());
+    if ( absID >= 0 )
+      fhMaxCellDiffClusterE[pidIndex]->Fill(fMomentum.E(), maxCellFraction, GetEventWeight());

     fhNCellsE[pidIndex] ->Fill(fMomentum.E(), calo->GetNCells()  , GetEventWeight());
     fhNLME   [pidIndex] ->Fill(fMomentum.E(), nMaxima            , GetEventWeight());
@@ -1327,7 +1338,7 @@
     // Create AOD for analysis
     //----------------------------

-    //Add AOD with electron/hadron object to aod branch
+    // Add AOD with electron/hadron object to aod branch
     if ( pid == fAODParticle || fAODParticle == 0 )
     {
       AliCaloTrackParticle aodpart = AliCaloTrackParticle(fMomentum);
@@ -1353,9 +1364,9 @@
       //...............................................
       //Set bad channel distance bit
       Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
-      if     (distBad > fMinDist3) aodpart.SetDistToBad(2) ;
-      else if(distBad > fMinDist2) aodpart.SetDistToBad(1) ;
-      else                         aodpart.SetDistToBad(0) ;
+      if      ( distBad > fMinDist3 ) aodpart.SetDistToBad(2) ;
+      else if ( distBad > fMinDist2 ) aodpart.SetDistToBad(1) ;
+      else                            aodpart.SetDistToBad(0) ;
       //printf("DistBad %f Bit %d\n",distBad, aodpart.DistToBad());

       // MC tag
@@ -1382,7 +1393,7 @@

   AliVParticle * primary     = 0x0;

-  if( IsDataMC() && !GetMC() )
+  if ( IsDataMC() && !GetMC() )
   {
     AliFatal("MCEvent not available! STOP");
     return;
@@ -1392,7 +1403,7 @@
   Double_t v[3] = {0,0,0}; //vertex ;
   GetReader()->GetVertex(v);
   //fhVertex->Fill(v[0], v[1], v[2], GetEventWeight());
-  if(TMath::Abs(v[2]) > GetZvertexCut()) return ; // done elsewhere for Single Event analysis, but there for mixed event
+  if ( TMath::Abs(v[2]) > GetZvertexCut() ) return ; // done elsewhere for Single Event analysis, but there for mixed event

   //----------------------------------
   //Loop on stored AOD photons
@@ -1405,11 +1416,11 @@
     Int_t pdg = ph->GetIdentifiedParticleType();

     Int_t pidIndex = 0;// Electron
-    if     (pdg == AliCaloPID::kElectron)      pidIndex = 0;
-    else if(pdg == AliCaloPID::kChargedHadron) pidIndex = 1;
+    if      ( pdg == AliCaloPID::kElectron      ) pidIndex = 0;
+    else if ( pdg == AliCaloPID::kChargedHadron ) pidIndex = 1;
     else                                       continue    ;

-    if(((Int_t) ph->GetDetectorTag()) != GetCalorimeter()) continue;
+    if ( ((Int_t) ph->GetDetectorTag()) != GetCalorimeter() ) continue;

     AliDebug(1,Form("ID Electron: pt %f, phi %f, eta %f", ph->Pt(),ph->Phi(),ph->Eta())) ;

@@ -1420,23 +1431,23 @@
     Float_t etacluster = ph->Eta();
     Float_t ecluster   = ph->E();

-    fhE[pidIndex]   ->Fill(ecluster,  GetEventWeight());
+    fhE [pidIndex]  ->Fill(ecluster,  GetEventWeight());
     fhPt[pidIndex]  ->Fill(ptcluster, GetEventWeight());

     fhPhi[pidIndex] ->Fill(ptcluster, phicluster, GetEventWeight());
     fhEta[pidIndex] ->Fill(ptcluster, etacluster, GetEventWeight());

-    if     (ecluster   > 0.5) fhEtaPhi  [pidIndex]->Fill(etacluster, phicluster, GetEventWeight());
-    else if(GetMinPt() < 0.5) fhEtaPhi05[pidIndex]->Fill(etacluster, phicluster, GetEventWeight());
+    if      ( ecluster   > 0.5 ) fhEtaPhi  [pidIndex]->Fill(etacluster, phicluster, GetEventWeight());
+    else if ( GetMinPt() < 0.5 ) fhEtaPhi05[pidIndex]->Fill(etacluster, phicluster, GetEventWeight());

     //.......................................
     //Play with the MC data if available
-    if(IsDataMC())
+    if ( IsDataMC() )
     {
       //....................................................................
       // Access MC information in stack if requested, check that it exists.
       Int_t label =ph->GetLabel();
-      if(label < 0)
+      if ( label < 0 )
       {
         AliDebug(1,Form("*** bad label ***:  label %d", label));
         continue;
@@ -1453,7 +1464,7 @@
       //Float_t ptprim  = 0;
       primary = GetMC()->GetTrack(label);

-      if(!primary)
+      if ( !primary )
       {
         AliWarning(Form("*** no primary ***:  label %d", label));
         continue;
@@ -1464,7 +1475,7 @@

       Int_t tag =ph->GetTag();

-      if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) && fhMCE[pidIndex][kmcPhoton])
+      if      ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) && fhMCE[pidIndex][kmcPhoton] )
       {
         fhMCE  [pidIndex][kmcPhoton] ->Fill(ecluster , GetEventWeight());
         fhMCPt [pidIndex][kmcPhoton] ->Fill(ptcluster, GetEventWeight());
@@ -1475,7 +1486,7 @@
         fhMC2E    [pidIndex][kmcPhoton] ->Fill(ecluster, eprim         , GetEventWeight());
         fhMCDeltaE[pidIndex][kmcPhoton] ->Fill(ecluster, eprim-ecluster, GetEventWeight());

-        if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) && fhMCE[pidIndex][kmcConversion])
+        if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) && fhMCE[pidIndex][kmcConversion] )
         {
           fhMCE  [pidIndex][kmcConversion] ->Fill(ecluster , GetEventWeight());
           fhMCPt [pidIndex][kmcConversion] ->Fill(ptcluster, GetEventWeight());
@@ -1486,8 +1497,8 @@
           fhMC2E[pidIndex][kmcConversion]     ->Fill(ecluster, eprim         , GetEventWeight());
           fhMCDeltaE[pidIndex][kmcConversion] ->Fill(ecluster, eprim-ecluster, GetEventWeight());
         }
-        else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay) &&
-                !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE[pidIndex][kmcPi0Decay])
+        else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay) &&
+                 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE[pidIndex][kmcPi0Decay] )
         {
           fhMCE  [pidIndex][kmcPi0Decay] ->Fill(ecluster , GetEventWeight());
           fhMCPt [pidIndex][kmcPi0Decay] ->Fill(ptcluster, GetEventWeight());
@@ -1498,8 +1509,8 @@
           fhMC2E[pidIndex][kmcPi0Decay]     ->Fill(ecluster, eprim         , GetEventWeight());
           fhMCDeltaE[pidIndex][kmcPi0Decay] ->Fill(ecluster, eprim-ecluster, GetEventWeight());
         }
-        else if( (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) ||
-                  GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay) ) && fhMCE[pidIndex][kmcOtherDecay])
+        else if ( ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) ||
+                    GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay) ) && fhMCE[pidIndex][kmcOtherDecay] )
         {
           fhMCE  [pidIndex][kmcOtherDecay] ->Fill(ecluster , GetEventWeight());
           fhMCPt [pidIndex][kmcOtherDecay] ->Fill(ptcluster, GetEventWeight());
@@ -1510,7 +1521,7 @@
           fhMC2E    [pidIndex][kmcOtherDecay] ->Fill(ecluster, eprim         , GetEventWeight());
           fhMCDeltaE[pidIndex][kmcOtherDecay] ->Fill(ecluster, eprim-ecluster, GetEventWeight());
         }
-        else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE  [pidIndex][kmcPi0])
+        else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE  [pidIndex][kmcPi0] )
         {
           fhMCE  [pidIndex][kmcPi0] ->Fill(ecluster , GetEventWeight());
           fhMCPt [pidIndex][kmcPi0] ->Fill(ptcluster, GetEventWeight());
@@ -1521,7 +1532,7 @@
           fhMC2E[pidIndex][kmcPi0]     ->Fill(ecluster, eprim         , GetEventWeight());
           fhMCDeltaE[pidIndex][kmcPi0] ->Fill(ecluster, eprim-ecluster, GetEventWeight());
         }
-        else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) && fhMCE[pidIndex][kmcEta])
+        else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) && fhMCE[pidIndex][kmcEta] )
         {
           fhMCE  [pidIndex][kmcEta] ->Fill(ecluster , GetEventWeight());
           fhMCPt [pidIndex][kmcEta] ->Fill(ptcluster, GetEventWeight());
@@ -1533,7 +1544,7 @@
           fhMCDeltaE[pidIndex][kmcEta] ->Fill(ecluster, eprim-ecluster, GetEventWeight());
         }
       }
-      else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron) && fhMCE[pidIndex][kmcAntiNeutron])
+      else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron) && fhMCE[pidIndex][kmcAntiNeutron] )
       {
         fhMCE  [pidIndex][kmcAntiNeutron] ->Fill(ecluster , GetEventWeight());
         fhMCPt [pidIndex][kmcAntiNeutron] ->Fill(ptcluster, GetEventWeight());
@@ -1544,7 +1555,7 @@
         fhMC2E[pidIndex][kmcAntiNeutron]     ->Fill(ecluster, eprim         , GetEventWeight());
         fhMCDeltaE[pidIndex][kmcAntiNeutron] ->Fill(ecluster, eprim-ecluster, GetEventWeight());
       }
-      else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiProton) && fhMCE[pidIndex][kmcAntiProton])
+      else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiProton) && fhMCE[pidIndex][kmcAntiProton] )
       {
         fhMCE  [pidIndex][kmcAntiProton] ->Fill(ecluster , GetEventWeight());
         fhMCPt [pidIndex][kmcAntiProton] ->Fill(ptcluster, GetEventWeight());
@@ -1555,7 +1566,7 @@
         fhMC2E    [pidIndex][kmcAntiProton] ->Fill(ecluster, eprim         , GetEventWeight());
         fhMCDeltaE[pidIndex][kmcAntiProton] ->Fill(ecluster, eprim-ecluster, GetEventWeight());
       }
-      else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) && fhMCE[pidIndex][kmcElectron])
+      else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) && fhMCE[pidIndex][kmcElectron] )
       {
         fhMCE  [pidIndex][kmcElectron] ->Fill(ecluster , GetEventWeight());
         fhMCPt [pidIndex][kmcElectron] ->Fill(ptcluster, GetEventWeight());
@@ -1566,7 +1577,7 @@
         fhMC2E[pidIndex][kmcElectron]     ->Fill(ecluster, eprim         , GetEventWeight());
         fhMCDeltaE[pidIndex][kmcElectron] ->Fill(ecluster, eprim-ecluster, GetEventWeight());
       }
-      else if( fhMCE[pidIndex][kmcOther])
+      else if ( fhMCE[pidIndex][kmcOther] )
       {
         fhMCE  [pidIndex][kmcOther] ->Fill(ecluster , GetEventWeight());
         fhMCPt [pidIndex][kmcOther] ->Fill(ptcluster, GetEventWeight());
@@ -1586,7 +1597,7 @@
 //____________________________________________________
 void AliAnaElectron::Print(const Option_t * opt) const
 {
-  if(! opt)
+  if ( !opt )
     return;

   printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
@@ -1608,26 +1619,26 @@
 //______________________________________________________
 void AliAnaElectron::WeightHistograms(AliVCluster *clus)
 {
-  if(!fFillWeightHistograms || GetMixedEvent()) return;
+  if ( !fFillWeightHistograms || GetMixedEvent() ) return;

   AliVCaloCells* cells = 0;
-  if(GetCalorimeter() == kEMCAL) cells = GetEMCALCells();
-  else                           cells = GetPHOSCells();
+  if ( GetCalorimeter() == kEMCAL ) cells = GetEMCALCells();
+  else                              cells = GetPHOSCells();

   // First recalculate energy in case non linearity was applied
   Float_t  energy = 0;
   Float_t  ampMax = 0;
-  for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++) {
-
-    Int_t id       = clus->GetCellsAbsId()[ipos];
-
-    //Recalibrate cell energy if needed
+  for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
+  {
+    Int_t id = clus->GetCellsAbsId()[ipos];
+
+    // Recalibrate cell energy if needed
     Float_t amp = cells->GetCellAmplitude(id);
     GetCaloUtils()->RecalibrateCellAmplitude(amp,GetCalorimeter(), id);

     energy    += amp;

-    if(amp> ampMax)
+    if ( amp> ampMax )
       ampMax = amp;
   } // energy loop

@@ -1656,14 +1667,14 @@
   }

   // Recalculate shower shape for different W0
-  if(GetCalorimeter()==kEMCAL)
+  if ( GetCalorimeter()==kEMCAL )
   {
     Float_t l0org = clus->GetM02();
     Float_t l1org = clus->GetM20();
     Float_t dorg  = clus->GetDispersion();

-    for(Int_t iw = 0; iw < 14; iw++){
-
+    for(Int_t iw = 0; iw < 14; iw++)
+    {
       GetCaloUtils()->GetEMCALRecoUtils()->SetW0(1+iw*0.5);
       GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), cells, clus);


enh: Add template instantiations for linear interpolation of ByteImage [Image]

--- Modules/Image/src/InterpolateImageFunction.cc
+++ Modules/Image/src/InterpolateImageFunction.cc
@@ -284,6 +284,7 @@

 // ND
 template class GenericNearestNeighborInterpolateImageFunction<ByteImage>;
+template class GenericLinearInterpolateImageFunction<ByteImage>;
 mirtkInterpolatorInstantiations(GenericNearestNeighborInterpolateImageFunction);
 mirtkInterpolatorInstantiations(GenericLinearInterpolateImageFunction);
 mirtkInterpolatorInstantiations(GenericBSplineInterpolateImageFunction);
@@ -294,6 +295,7 @@
 mirtkInterpolatorInstantiations(GenericSincInterpolateImageFunction);

 // 2D
+template class GenericLinearInterpolateImageFunction2D<ByteImage>;
 mirtkInterpolatorInstantiations(GenericLinearInterpolateImageFunction2D);
 mirtkInterpolatorInstantiations(GenericBSplineInterpolateImageFunction2D);
 mirtkInterpolatorInstantiations(GenericCubicBSplineInterpolateImageFunction2D);
@@ -303,6 +305,7 @@
 mirtkInterpolatorInstantiations(GenericSincInterpolateImageFunction2D);

 // 3D
+template class GenericLinearInterpolateImageFunction3D<ByteImage>;
 mirtkInterpolatorInstantiations(GenericLinearInterpolateImageFunction3D);
 mirtkInterpolatorInstantiations(GenericBSplineInterpolateImageFunction3D);
 mirtkInterpolatorInstantiations(GenericCubicBSplineInterpolateImageFunction3D);
@@ -312,6 +315,7 @@
 mirtkInterpolatorInstantiations(GenericSincInterpolateImageFunction3D);

 // 4D
+template class GenericLinearInterpolateImageFunction4D<ByteImage>;
 mirtkInterpolatorInstantiations(GenericLinearInterpolateImageFunction4D);
 mirtkInterpolatorInstantiations(GenericBSplineInterpolateImageFunction4D);
 mirtkInterpolatorInstantiations(GenericCubicBSplineInterpolateImageFunction4D);


separate the clientCount from the clientIdx

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@41448 27541ba8-7e3a-0410-8455-c3a389f83636

--- tutorials/net/parallelMergeServer.C
+++ tutorials/net/parallelMergeServer.C
@@ -327,6 +327,7 @@
    mon->Add(ss);

    UInt_t clientCount = 0;
+   UInt_t clientIndex = 0;

    THashTable mergers;

@@ -353,9 +354,10 @@
             ss->Close();
          } else {
             TSocket *client = ((TServerSocket *)s)->Accept();
-            client->Send(clientCount, kStartConnection);
+            client->Send(clientIndex, kStartConnection);
             client->Send(kProtocolVersion, kProtocol);
             ++clientCount;
+            ++clientIndex;
             mon->Add(client);
             printf("Accept %d connections\n",clientCount);
          }


Fix a warning in base64.cpp

Fix a warning in base64.cpp

darcs-hash:20071001040055-1210e-b1b01a263dbb0fe16686bfa59089916e9db38f3d

--- base64.cpp
+++ base64.cpp
@@ -2,7 +2,7 @@

 std::string base64_encode(const std::string &in)
 {
-    char *map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+    const std::string map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
     std::string result;
     int len = (int)in.size();
     unsigned long value;


Bugfix: `load_DDS_texture`: Fix integer overflow of `bufsize`.

	modified:   code/ylikuutio/loaders/texture_loader.cpp


bug-fix: fix stay-on-top on Linux

bug-fix: fix stay-on-top on Linux

--- src/vmainwindow.cpp
+++ src/vmainwindow.cpp
@@ -3202,12 +3202,7 @@
     bool shown = isVisible();
     Qt::WindowFlags flags = this->windowFlags();

-#if defined(Q_OS_LINUX) || defined(Q_OS_UNIX)
-    Qt::WindowFlags magicFlag = Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint;
-#else
     Qt::WindowFlags magicFlag = Qt::WindowStaysOnTopHint;
-#endif
-
     if (p_enabled) {
         setWindowFlags(flags | magicFlag);
     } else {


Fix DX10 resize crash

Fix DX10 resize crash

--- starlight_d3d10.cpp
+++ starlight_d3d10.cpp
@@ -101,11 +101,9 @@
 }

 void renderer::D3D10::Resize(int32_t width, int32_t height) {
-	ImGui_ImplDX10_InvalidateDeviceObjects();
 	CleanupRenderTarget();
-	g_pSwapChain->ResizeBuffers(0, (UINT) width, (UINT) height, DXGI_FORMAT_UNKNOWN, 0);
+	g_pSwapChain->ResizeBuffers(0, 0, 0, DXGI_FORMAT_UNKNOWN, 0);
 	CreateRenderTarget();
-	ImGui_ImplDX10_CreateDeviceObjects();
 }

 extern void ImGui_ImplDX10_NewFrame();


Irrelevant comments and failed attempts erased, cleaner code

--- src/cf_tf_listener.cpp
+++ src/cf_tf_listener.cpp
@@ -3,8 +3,6 @@
 #include <stdio.h>
 #include <tf/transform_listener.h>
 #include "std_msgs/String.h"
-//#include <cob_object_detection_msg/Detection.msg>
-//#include <cob_object_detection_msgs/DetectObjects.h>
 #include "geometry_msgs/PoseStamped.h"
 #include <cob_object_detection_msgs/DetectionArray.h>
 #include <sensor_msgs/Image.h>
@@ -12,95 +10,36 @@
 #include <visualization_msgs/Marker.h>
 #include <visualization_msgs/MarkerArray.h>

-//void Callback(const cob_object_detection_msgs::Detection::Detection_::_pose_type msg) //You cannot subscribe just to the pose, you subscribe to the whole message. Therefore, the types must match
-void Callback(const cob_object_detection_msgs::DetectionArray &msg)                      //const because we are just reading it, & to pass by reference
+void Callback(const cob_object_detection_msgs::DetectionArray &msg)                     //const because we are just reading it, & to pass by reference
 {
-    //int nvmark=0;                                 //Visible markers
-    //ROS_INFO_STREAM("I heard " << msg); //"<<
-    //ROS_INFO_STREAM("Message 1: " << msg.detections[0].label);
-    //if (msg.detections.empty() != true) ROS_INFO_STREAM(msg.detections.size());
-    //char buffer [50];
     if (msg.detections.empty() != true){
         for (int i=0; i <= msg.detections.size()-1; i++){  //msg.detections.size()
             try{
                 //ROS_INFO_STREAM("Message 1: " << msg.detections[i]);                  //Displays the whole detection information
-                switch (msg.detections[i].id){              //We do this so that we know that we can address the pose to the right marker. Will be replaced
+                switch (msg.detections[i].id){                                          //We do this so that we know that we can address the pose to the right marker. Will be replaced
                     case 0: {ROS_INFO("CF 0:"); break;};
                     case 1: {ROS_INFO("CF 1:"); break;};
                     case 2: {ROS_INFO("CF 2:"); break;};
                     case 3: {ROS_INFO("CF 3:"); break;};
+                default:{ROS_INFO("ID Fail"); break;};                                  //If an error occurs and the detections[i] is accessed erronially
                 }

                 ROS_INFO_STREAM(msg.detections[i].pose.pose);
             }
             catch(...){
-                //ROS_INFO("Failed to send Marker [%s]", i); //sprintf(buffer, i)
+                ROS_INFO("Failed to send Marker "); //sprintf(buffer, i));              //Need to find how to efficiently convert int to string without too much pain
             }
         }
     }
     //else  ROS_INFO("No Marker");
-
-    /* ****  **** */
-
-    /* **** Function to chop the Detection Array into several Detection, so that they can be treated and sent separately**** */
-
-    /* **** Function to chop the Detection into the different datatypes and publish it **** */
-    /*for (int i=1; i<=nvmark+1; i++)           //For all visible markers:
-    {
-        try{
-            ROS_INFO("Marker [s%]", i);     //We could chop this marker
-            //Here we should chop the data that interests us, taking just the geometry_msgs::PoseStamped and send it to the
-        }
-        catch(){
-            ROS_INFO("Failed to send Marker [s%]", i);
-        }
-    }*/
 }

 int main(int argc, char **argv)
 {
-  /**
-   * The ros::init() function needs to see argc and argv so that it can perform
-   * any ROS arguments and name remapping that were provided at the command line.
-   * For programmatic remappings you can use a different version of init() which takes
-   * remappings directly, but for most command-line programs, passing argc and argv is
-   * the easiest way to do it.  The third argument to init() is the name of the node.
-   *
-   * You must call one of the versions of ros::init() before using any other
-   * part of the ROS system.
-   */
   ros::init(argc, argv, "listener");
-
-  /**
-   * NodeHandle is the main access point to communications with the ROS system.
-   * The first NodeHandle constructed will fully initialize this node, and the last
-   * NodeHandle destructed will close down the node.
-   */
   ros::NodeHandle nh;
-
-  /**
-   * The subscribe() call is how you tell ROS that you want to receive messages
-   * on a given topic.  This invokes a call to the ROS
-   * master node, which keeps a registry of who is publishing and who
-   * is subscribing.  Messages are passed to a callback function, here
-   * called chatterCallback.  subscribe() returns a Subscriber object that you
-   * must hold on to until you want to unsubscribe.  When all copies of the Subscriber
-   * object go out of scope, this callback will automatically be unsubscribed from
-   * this topic.
-   *
-   * The second parameter to the subscribe() function is the size of the message
-   * queue.  If messages are arriving faster than they are being processed, this
-   * is the number of messages that will be buffered up before beginning to throw
-   * away the oldest ones.
-   */
-
   ros::Subscriber sub = nh.subscribe("/fiducials/fiducial_detection_array",1,Callback); //Basic subscriber. Just has the topic it is subscribed to, the callback function and how many messages it caches

-  /**
-   * ros::spin() will enter a loop, pumping callbacks.  With this version, all
-   * callbacks will be called from within this thread (the main one).  ros::spin()
-   * will exit when Ctrl-C is pressed, or the node is shutdown by the master.
-   */
   while(nh.ok()){
     ros::spinOnce();
   }


silence warnings

silence warnings

--- Library/Sources/Stroika/Foundation/IO/Network/Transfer/Client_WinHTTP.cpp
+++ Library/Sources/Stroika/Foundation/IO/Network/Transfer/Client_WinHTTP.cpp
@@ -282,6 +282,13 @@

     try {
         //ProgressStatusCallback::SafeSetProgressAndCheckCanceled (progressCallback, 0.36f);
+		if (request.fData.size () > numeric_limits<DWORD>::max ()) {
+			DoThrow (StringException (L"Too large a message to send using WinHTTP"));
+		}
+#if     qSilenceAnnoyingCompilerWarnings && _MSC_VER
+#pragma warning (push)
+#pragma warning (4 : 4267)
+#endif
         ThrowIfFalseGetLastError (::WinHttpSendRequest (
                                       hRequest,
                                       useHeaderStrBuf.c_str (), -1,
@@ -290,6 +297,9 @@
                                       NULL
                                   )
                                  );
+#if     qSilenceAnnoyingCompilerWarnings && _MSC_VER
+#pragma warning (pop)
+#endif
         //ProgressStatusCallback::SafeSetProgressAndCheckCanceled (progressCallback, 0.36f);

         // this must be called before the 'body' goes out of scope!


[SwiftASTContext] Clean up function types and document a limitation.

<rdar://problem/47194104>

--- source/Symbol/SwiftASTContext.cpp
+++ source/Symbol/SwiftASTContext.cpp
@@ -5352,8 +5352,7 @@
   case swift::TypeKind::GenericFunction:
     swift_flags |= eTypeIsGeneric;
   case swift::TypeKind::Function:
-    swift_flags |=
-        eTypeIsBuiltIn | eTypeHasValue | eTypeIsScalar | eTypeInstanceIsPointer;
+    swift_flags |= eTypeIsPointer | eTypeHasValue;
     break;
   case swift::TypeKind::BuiltinInteger:
     swift_flags |=
@@ -5920,13 +5919,13 @@
     return bound_type.GetBitSize(nullptr).getValueOr(0);
   }

-  const swift::TypeKind type_kind = swift_can_type->getKind();
-  switch (type_kind) {
-  case swift::TypeKind::Function:
+  // lldb ValueObject subsystem expects functions to be a single
+  // pointer in size to print them correctly. This is not true
+  // for swift (where functions aren't necessarily a single pointer
+  // in size), so we need to work around the limitation here.
+  if (swift_can_type->getKind() == swift::TypeKind::Function)
     return GetPointerByteSize() * 8;
-  default:
-    break;
-  }
+
   const swift::irgen::FixedTypeInfo *fixed_type_info =
       GetSwiftFixedTypeInfo(type);
   if (fixed_type_info)


change limit

change limit

--- PWGGA/GammaConvBase/AliConversionMesonCuts.cxx
+++ PWGGA/GammaConvBase/AliConversionMesonCuts.cxx
@@ -4599,7 +4599,7 @@
       switch(fMassParamFunction){
         case 0: // EMC-EMC
           if (pt<2.0){
-              pt_used=3.0;
+              pt_used=2.0;
           } else if (pt>50.0) {
               pt_used=50.;
           } else {


Replacing function table in "struct Computed_field" with a virtual class
Computed_field_core to get C++ to handle all the function pointer tables and
virtualisation required.  Will allow a proper class hierarchy and better
debugging and reduces the code a lot, and allows for further consolidation in
the future.

git-svn-id: 4705079bc6b8aadf675e3696f5c015a6aa4916e3@4527 3c1deb5b-d424-0410-962d-aba41a686d42

--- source/computed_field/computed_field.cpp
+++ source/computed_field/computed_field.cpp
@@ -4226,7 +4226,7 @@
 {
 	int i, return_code;

-	ENTER(list_Computed_field_ ## filter);
+	ENTER(Computed_field_core::list);
 	if (field)
 	{
 		if (0 < field->number_of_source_fields)


Bugfix: `loaders::load_FBX_texture`: PNG loading loplaceholder code.

	modified:   code/ylikuutio/loaders/texture_loader.cpp


INTEGRATION: CWS loadenv01 (1.12.86); FILE MERGED 2004/03/15 10:30:15 as 1.12.86.1: #i24378# new helper to open streams read/write as XStream

--- ucbhelper/inc/ucbhelper/content.hxx
+++ ucbhelper/inc/ucbhelper/content.hxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: content.hxx,v $
  *
- *  $Revision: 1.12 $
- *
- *  last change: $Author: kso $ $Date: 2002-04-09 11:49:27 $
+ *  $Revision: 1.13 $
+ *
+ *  last change: $Author: svesik $ $Date: 2004-04-21 12:33:03 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -67,6 +67,9 @@
 #endif
 #ifndef _COM_SUN_STAR_UCB_COMMANDABORTEDEXCEPTION_HPP_
 #include <com/sun/star/ucb/CommandAbortedException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XSTREAM_HPP_
+#include <com/sun/star/io/XStream.hpp>
 #endif
 #ifndef _COM_SUN_STAR_UNO_REFERENCE_HXX_
 #include <com/sun/star/uno/Reference.hxx>
@@ -785,6 +788,19 @@
                ::com::sun::star::uno::RuntimeException,
                ::com::sun::star::uno::Exception );
     /**
+      * This methods gives read/write access to the content stream of a content (i.e
+      * the content of a file located at the local file system).
+      * Internally it executes the command "open" at the content.
+      *
+      * @return an implementation of the interface XStream, which can
+      *         be used to read/write the content's data.
+      */
+    ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >
+    openWriteableStream()
+        throw( ::com::sun::star::ucb::CommandAbortedException,
+               ::com::sun::star::uno::RuntimeException,
+               ::com::sun::star::uno::Exception );
+    /**
       * This methods gives read access to the content stream of a content (i.e
       * the content of a file located at the local file system).
       * Internally it executes the command "open" at the content.


Update party.cpp

Update party.cpp

--- src/char/src/party.cpp
+++ src/char/src/party.cpp
@@ -1,7 +1,7 @@
 #include "party.h"

 std::shared_ptr<Party> cache_fetch_party(uint32_t charId) {
-auto conn = Core::connectionPool.getConnection<Core::Osirose>();
+  auto conn = Core::connectionPool.getConnection<Core::Osirose>();
   Core::Party partyTable{};
   Core::PartyMembers partyMembersTable{};

@@ -32,18 +32,62 @@
     return {};
   }

-  for (auto& r : res2) {
+  for (const auto& r : res2) {
     party.members.push_back(r.memberId);
   }

-  return std::make_shared<Party>(party);
+  return {party};
+}
+
+void cache_create_party(std::shared_ptr<Party> party) {
+  if (!party) return;
+
+  auto conn = Core::connectionPool.getConnection<Core::Osirose>();
+  Core::Party partyTable{};
+
+  conn(sqlpp::insert_into(partyTable)
+       .set(partyTable.name = party->name)
+       .set(partyTable.leaderId = party->leader)
+       .set(partyTable.options = party->options)
+       .set(partyTable.level = party->level)
+       .set(partyTable.lastGotItemIndex = party->last_got_item_index)
+       .set(partyTable.lastGotEtcIndex = party->last_got_etc_index)
+       .set(partyTable.lastGotZulyIndex = party->last_got_zuly_index));
 }

 void cache_write_party(std::shared_ptr<Party> party) {
+  if (!party) return;
+  auto conn = Core::connectionPool.getConnection<Core::Osirose>();
+  Core::Party partyTable{};
+
+  conn(sqlpp::update(partyTable)
+       .set(partyTable.name = party->name)
+       .set(partyTable.leaderId = party->leader)
+       .set(partyTable.options = party->options)
+       .set(partyTable.level = party->level)
+       .set(partyTable.lastGotItemIndex = party->last_got_item_index)
+       .set(partyTable.lastGotEtcIndex = party->last_got_etc_index)
+       .set(partyTable.lastGotZulyIndex = party->last_got_zuly_index)
+       .where(partyTable.id == party->id));
 }

 void cache_write_party_members(std::shared_ptr<Party> party) {
+  if (!party) return;
+  auto conn = Core::connectionPool.getConnection<Core::Osirose>();
+  Core::PartyMembers partyMembersTable{};
+
+  conn(sqlpp::remove_from(partyMembersTable).where(partyMembersTable.id == party->id));
+  auto insert = sqlpp::insert_into(partyMembersTable).columns(partyMembersTable.id, partyMembersTable.memberId);
+  for (auto m : party-> members) {
+    multi_insert.values.add(partyMembersTable.id = party->id, partyMembersTable.memberId = m);
+  }
+  conn(insert);
 }

 void cache_remove_party(std::shared_ptr<Party> party) {
+  if (!party) return;
+  auto conn = Core::connectionPool.getConnection<Core::Osirose>();
+  Core::Party partyTable{};
+
+  conn(sqlpp::remove_from(partyTable).where(partyTable.id == party->id));
 }


ENH: 1649: Factorized otb::Wrapper::ClampAndWriteVectorImage<>().

--- Modules/Wrappers/ApplicationEngine/src/otbWrapperOutputImageParameter.cxx
+++ Modules/Wrappers/ApplicationEngine/src/otbWrapperOutputImageParameter.cxx
@@ -19,20 +19,20 @@
  */

 #include "otbWrapperOutputImageParameter.h"
+
 #include "otbClampImageFilter.h"
 #include "otbImageIOFactory.h"
+#include "otbWrapperCastImage.h"
+
+#ifdef OTB_USE_MPI
+#  include "otbMPIConfig.h"
+#  include "otbMPIVrtWriter.h"
+#  ifdef OTB_USE_SPTW
+#    include "otbSimpleParallelTiffWriter.h"
+#  endif
+#endif
+
 #include "itksys/SystemTools.hxx"
-
-#ifdef OTB_USE_MPI
-
-#include "otbMPIConfig.h"
-#include "otbMPIVrtWriter.h"
-
-#ifdef OTB_USE_SPTW
-#include "otbSimpleParallelTiffWriter.h"
-#endif
-
-#endif

 #define CAST_IMAGE_BASE( T, image_base )		\
@@ -219,82 +219,8 @@
 }

-namespace details
-{
-
-
 template< typename TOutputImage,
 	  typename TInputImage >
-struct Clamp
-{
-  using InputClampImageFilter =
-    ClampImageFilter< TInputImage, DoubleVectorImageType >;
-
-  using OutputClampImageFilter =
-    ClampImageFilter< DoubleVectorImageType , TOutputImage >;
-
-
-  Clamp( TInputImage * in ) :
-    icif( InputClampImageFilter::New() ),
-    ocif( OutputClampImageFilter::New() ),
-    out( ocif->GetOutput() )
-  {
-    assert( in );
-
-    icif->SetInput( in );
-
-    ocif->SetInput( icif->GetOutput() );
-  }
-
-  typename InputClampImageFilter::Pointer icif;
-  typename OutputClampImageFilter::Pointer ocif;
-  TOutputImage * out;
-};
-
-
-template< typename TOutputImage >
-struct Clamp< TOutputImage,
-	      DoubleVectorImageType >
-{
-  using OutputClampImageFilter =
-    ClampImageFilter< DoubleVectorImageType , TOutputImage >;
-
-
-  Clamp( DoubleVectorImageType * in ) :
-    ocif( OutputClampImageFilter::New() ),
-    out( ocif->GetOutput() )
-  {
-    assert( in );
-
-    ocif->SetInput( in );
-  }
-
-  itk::ProcessObject::Pointer icif;
-  typename OutputClampImageFilter::Pointer ocif;
-  TOutputImage * out;
-};
-
-
-template<>
-struct Clamp< DoubleVectorImageType,
-	      DoubleVectorImageType >
-{
-  Clamp( DoubleVectorImageType * in ) :
-    out( in )
-  {
-    assert( in );
-  }
-
-  itk::ProcessObject::Pointer icif;
-  itk::ProcessObject::Pointer ocif;
-  DoubleVectorImageType * out;
-};
-
-} // namespace details.
-
-
-template< typename TOutputImage,
-	  typename TInputImage >
 void
 OutputImageParameter
 ::ClampAndWriteVectorImage( TInputImage * in )
@@ -303,7 +229,7 @@
   assert( !m_FileName.empty() );

   // Use metaprogramming to choose optimized pipeline.
-  details::Clamp< TOutputImage, TInputImage > clamp( in );
+  details::CastImage< TOutputImage, TInputImage > clamp( in );

 #ifdef OTB_USE_MPI


INTEGRATION: CWS configure18 (1.15.6); FILE MERGED 2006/07/13 15:18:19 rene 1.15.6.1: #i64798# system neon 0.26.x support, by geki

--- ucb/source/ucp/webdav/NeonPropFindRequest.cxx
+++ ucb/source/ucp/webdav/NeonPropFindRequest.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: NeonPropFindRequest.cxx,v $
  *
- *  $Revision: 1.15 $
- *
- *  last change: $Author: hr $ $Date: 2006-06-20 05:36:43 $
+ *  $Revision: 1.16 $
+ *
+ *  last change: $Author: kz $ $Date: 2006-07-19 09:35:25 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -175,11 +175,19 @@

 // -------------------------------------------------------------------
 extern "C" void NPFR_propfind_results( void* userdata,
+#if NEON_VERSION >= 0260
+                                       const ne_uri* href_uri,
+#else
                                        const char* href,
+#endif
                                        const NeonPropFindResultSet* set )
 {
     // @@@ href is not the uri! DAVResource ctor wants uri!

+#if NEON_VERSION >= 0260
+    // href should be free'd? says header ...
+    char* href = ne_uri_unparse(href_uri);
+#endif
     DAVResource theResource(
                         OStringToOUString( href, RTL_TEXTENCODING_UTF8 ) );

@@ -209,11 +217,19 @@

 // -------------------------------------------------------------------
 extern "C" void NPFR_propnames_results( void* userdata,
+#if NEON_VERSION >= 0260
+                                        const ne_uri* href_uri,
+#else
                                         const char* href,
+#endif
                                         const NeonPropFindResultSet* results )
 {
     // @@@ href is not the uri! DAVResourceInfo ctor wants uri!

+#if NEON_VERSION >= 0260
+    // href should be free'd? says header ...
+    char* href = ne_uri_unparse(href_uri);
+#endif
     // Create entry for the resource.
     DAVResourceInfo theResource(
                         OStringToOUString( href, RTL_TEXTENCODING_UTF8 ) );


Fixed a bug in the path remapper that caused
a crash if the path to be remaped was NULL.

<rdar://problem/12371888>

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@164653 91177308-0d34-0410-b5e6-96231b3b80d8

--- source/Target/PathMappingList.cpp
+++ source/Target/PathMappingList.cpp
@@ -172,12 +172,17 @@
 bool
 PathMappingList::RemapPath (const ConstString &path, ConstString &new_path) const
 {
+    const char *path_cstr = path.GetCString();
+
+    if (!path_cstr)
+        return false;
+
     const_iterator pos, end = m_pairs.end();
     for (pos = m_pairs.begin(); pos != end; ++pos)
     {
         const size_t prefixLen = pos->first.GetLength();

-        if (::strncmp (pos->first.GetCString(), path.GetCString(), prefixLen) == 0)
+        if (::strncmp (pos->first.GetCString(), path_cstr, prefixLen) == 0)
         {
             std::string new_path_str (pos->second.GetCString());
             new_path_str.append(path.GetCString() + prefixLen);


idon't catch and rethrow exceptions, this does nothing except to hide thier true origin from the debugger!

--- opencog/reasoning/pln/BackInferenceTreeNode.cc
+++ opencog/reasoning/pln/BackInferenceTreeNode.cc
@@ -1260,8 +1260,8 @@
 void BITNode::expandNextLevel()
 {
     AtomSpaceWrapper *atw = GET_ASW;
-    try
-    {
+//    try
+//    {
         tlog(-2, "Expanding with fitness %.4f\n", fitness());
         tlog(-2, "In expansion pool? %s\n", (STLhas2(root->exec_pool, this)? "YES":"NO"));
         rawPrint(*getTarget(), getTarget()->begin(), -2);
@@ -1292,10 +1292,12 @@
                 }
             }
         }
+#if 0 // Don't catch and rethrow, this just hides the original thrower!!
     } catch(...) {
         tlog(0,"Exception in ExpandNextLevel()");
         throw;
     }
+#endif
 }

 /* Algorithm: Evaluation */