fCoeffs(npar),
fError(err)
{
+ // create module
for (int i=0;i<npar;i++) {fCoeffs[i] = parcf[i]; if (parcf[i]!=0) SetBit(0x1<<i);}
}
{/* DUMMY */}
//________________________________________________________________________________________________________
-void AliITSAlignMille2ConstrArray::AddModule(AliITSAlignMille2Module* mod)
+void AliITSAlignMille2ConstrArray::AddModule(AliITSAlignMille2Module* mod, Bool_t needGeom)
{
+ // add module to constraint
int nmd = GetNModules();
// check if its already not there
for (int im=nmd;im--;) {if (mod->GetUniqueID() == (UInt_t)fModuleIDs[im]) return; }
fModuleIDs.Set(nmd+1);
fModulePatt.Set(nmd+1);
fModuleIDs[nmd] = mod->GetUniqueID();
- double jacobian[AliITSAlignMille2Module::kMaxParGeom][AliITSAlignMille2Module::kMaxParGeom];
- if (mod->GeomParamsGlobal()) mod->CalcDerivLocGlo(&jacobian[0][0]);
- //
- Short_t patt = GetPattern();
- if (mod->GeomParamsGlobal()) {
- // the constraint is defined in the module's local frame. If the alignment of geom params is
- // done in the global frame, we need to set the real parameter involved
- patt &= 0xffff<< AliITSAlignMille2Module::kMaxParGeom; // reset the geometry parameters
- for (int i=0;i<AliITSAlignMille2Module::kMaxParGeom;i++) {
- if (!IncludesParam(i)) continue;
- for (int j=0;j<AliITSAlignMille2Module::kMaxParGeom;j++) if (jacobian[i][j]!=0) patt |= (0x1<<j);
+ if (needGeom) { // this is geometrical constraint
+ double jacobian[AliITSAlignMille2Module::kMaxParGeom][AliITSAlignMille2Module::kMaxParGeom];
+ if (mod->GeomParamsGlobal()) mod->CalcDerivLocGlo(&jacobian[0][0]);
+ //
+ Short_t patt = GetPattern();
+ if (mod->GeomParamsGlobal()) {
+ // the constraint is defined in the module's local frame. If the alignment of geom params is
+ // done in the global frame, we need to set the real parameter involved
+ for (int i=AliITSAlignMille2Module::kMaxParGeom;i--;) patt &= ~BIT(i); // reset the geometry parameters
+ for (int i=0;i<AliITSAlignMille2Module::kMaxParGeom;i++) {
+ if (!IncludesParam(i)) continue;
+ for (int j=0;j<AliITSAlignMille2Module::kMaxParGeom;j++) if (jacobian[i][j]!=0) patt |= BIT(j);
+ }
}
+ fModulePatt[nmd] = patt;
}
- fModulePatt[nmd] = patt;
}
//________________________________________________________________________________________________________
}
//________________________________________________________________________________________________________
-Bool_t AliITSAlignMille2ConstrArray::IncludesModPar(AliITSAlignMille2Module* mod, Int_t par) const
+Bool_t AliITSAlignMille2ConstrArray::IncludesModPar(const AliITSAlignMille2Module* mod, Int_t par) const
{
// is this module/parameter mentioned in the list?
return IncludesModPar(mod->GetUniqueID(), par);
//________________________________________________________________________________________________________
void AliITSAlignMille2ConstrArray::Print(Option_t* ) const
{
+ // print data
printf("#%3d Constraint %s of type %d | Value=%+e Error=%+e\n",GetConstraintID(),GetName(),GetType(),GetValue(),GetError());
printf("Weights on params: "); for (int i=0;i<GetNCoeffs();i++) printf("%+.3e ",GetCoeff(i));
printf("\nModules involved: \n");