#include <fcntl.h>
#include <fstream>
-using namespace std;
+//#define _DUMP_EQ_BEFORE_
+//#define _DUMP_EQ_AFTER_
//#define _DUMPEQ_BEFORE_
//#define _DUMPEQ_AFTER_
+using std::ifstream;
ClassImp(AliMillePede2)
Bool_t AliMillePede2::fgInvChol = kTRUE; // Invert global matrix with Cholesky solver
fAccRunListWgh(0),
fRunWgh(1),
fkReGroup(0)
-{}
+{
+ fWghScl[0] = fWghScl[1] = -1;
+}
//_____________________________________________________________________________________________
AliMillePede2::AliMillePede2(const AliMillePede2& src) :
fAccRunListWgh(0),
fRunWgh(1),
fkReGroup(0)
-{printf("Dummy\n");}
+{
+ fWghScl[0] = src.fWghScl[0];
+ fWghScl[1] = src.fWghScl[1];
+ printf("Dummy\n");
+}
//_____________________________________________________________________________________________
AliMillePede2::~AliMillePede2()
//
sws.Start();
+#ifdef _DUMP_EQ_BEFORE_
+ const char* faildumpB = Form("mp2eq_before%d.dat",fIter);
+ int defoutB = dup(1);
+ if (defoutB<0) {AliFatal("Failed on dup"); exit(1);}
+ int slvDumpB = open(faildumpB, O_RDWR|O_CREAT, 0666);
+ if (slvDumpB>=0) {
+ dup2(slvDumpB,1);
+ printf("Solving%d for %d params\n",fIter,fNGloSize);
+ matCGlo.Print("10");
+ for (int i=0;i<fNGloSize;i++) printf("b%2d : %+.10f\n",i,fVecBGlo[i]);
+ }
+ dup2(defoutB,1);
+ close(slvDumpB);
+ close(defoutB);
+
+#endif
/*
printf("Solving:\n");
matCGlo.Print("l");
//
dup2(defoutB,1);
close(slvDumpB);
+ close(defoutB);
#endif
//
fGloSolveStatus = SolveGlobalMatEq(); // obtain solution for this step
//
dup2(defoutA,1);
close(slvDumpA);
+ close(defoutA);
#endif
//
sws.Stop();
if (fGloSolveStatus==kFailed) return 0;
//
for (int i=fNGloPar;i--;) fDeltaPar[i] += fVecBGlo[i]; // Update global parameters values (for iterations)
+
+#ifdef _DUMP_EQ_AFTER_
+ const char* faildumpA = Form("mp2eq_after%d.dat",fIter);
+ int defoutA = dup(1);
+ if (defoutA<0) {AliFatal("Failed on dup"); exit(1);}
+ int slvDumpA = open(faildumpA, O_RDWR|O_CREAT, 0666);
+ if (slvDumpA>=0) {
+ dup2(slvDumpA,1);
+ printf("Solving%d for %d params\n",fIter,fNGloSize);
+ matCGlo.Print("10");
+ for (int i=0;i<fNGloSize;i++) printf("b%2d : %+.10f\n",i,fVecBGlo[i]);
+ }
+ dup2(defoutA,1);
+ close(slvDumpA);
+ close(defoutA);
+#endif
//
/*
printf("Solved:\n");
//
dup2(defout,1);
close(slvDump);
+ close(defout);
printf("#Dumped failed matrix and RHS to %s\n",faildump);
}
else AliInfo("Failed on file open for matrix dumping");
prevAns = kTRUE;
for (int i=n;i--;) if (runID == (*fRejRunList)[i]) {
prevAns = kFALSE;
- printf("New Run to reject: %ld -> %d\n",runID,prevAns);
+ AliInfo(Form("New Run to reject: %ld",runID));
break;
}
}
else if (fAccRunList && (n=fAccRunList->GetSize())) { // is run specifically selected
prevAns = kFALSE;
- for (int i=n;i--;) if (runID == (*fAccRunList)[i]) {prevAns = kTRUE; fRunWgh = (*fAccRunListWgh)[i]; break;}
+ for (int i=n;i--;) if (runID == (*fAccRunList)[i]) {
+ prevAns = kTRUE;
+ if (fAccRunListWgh) fRunWgh = (*fAccRunListWgh)[i];
+ AliInfo(Form("New Run to accept explicitly: %ld, weight=%f",runID,fRunWgh));
+ break;
+ }
+ if (!prevAns) AliInfo(Form("New Run is not in the list to accept: %ld",runID));
}
}
//