# include <math.h>
# include "hdebug.h"
# include "hmatrixcategory.h"
# include "hmdccal3.h"
# include "hmdchitaux.h"
# include "hsymmat.h"
ClassImp(HMdcHitAux)
HMdcHitAux :: HMdcHitAux(void){
clear();
}
HMdcHitAux :: HMdcHitAux (HMdcHitAux ©){
#if DEBUG_LEVEL>3
gDebuger->enterFunc("HMdcHitAux::HMdcHitAux(copy)");
#endif
myPoint[0] = copy.getPointX();
myPoint[1] = copy.getPointY();
myPoint[2] = copy.getPointZ();
mySlope[0] = copy.getSlopeX();
mySlope[1] = copy.getSlopeY();
myChi = copy.getChi();
myNumberOfHits = copy.getNumHits();
for (Int_t nplane=0; nplane < 6 ; nplane++){
addCal(copy.getCal(nplane),nplane);
}
toBeDeleted = copy.isDel();
isUsed = copy.getIsUsed();
#if DEBUG_LEVEL>3
gDebuger->leaveFunc("HMdcHitAux::HMdcHitAux(copy)");
#endif
}
HMdcHitAux :: ~HMdcHitAux(void){
}
void HMdcHitAux :: clear(void){
Int_t i;
for(i=0;i<=2;i++){
myPoint[i] = 20000.;
}
for(i=0;i<2;i++){
mySlope[i]= 20000.;
}
cov.Clear();
myChi= 20000.;
myNumberOfHits=0;
for(i=0; i<6; i++){
cal[i]= NULL;
}
toBeDeleted = 0;
isUsed = 0;
}
void HMdcHitAux :: setPoint(Float_t x, Float_t y, Float_t z){
myPoint[0] = x;
myPoint[1] = y;
myPoint[2] = z;
}
void HMdcHitAux :: setSlope(Float_t xSlope, Float_t ySlope){
mySlope[0] = xSlope;
mySlope[1] = ySlope;
}
void HMdcHitAux :: setError(Float_t xError, Float_t yError){
cov.setErr(0,xError);
cov.setErr(1,yError);
}
void HMdcHitAux :: setErrorSlope(Float_t xerror, Float_t yerror){
cov.setErr(2,xerror);
cov.setErr(3,yerror);
}
void HMdcHitAux :: addCal(HMdcCal3* data){
cal[myNumberOfHits] = data;
myNumberOfHits++;
}
void HMdcHitAux :: addCal(HMdcCal3* data, Int_t pos){
if(cal[pos]==NULL) myNumberOfHits++;
cal[pos]=data;
}
void HMdcHitAux :: print(ostream &file){
file << "isUsed ? " << isUsed << endl;
file << "tobedeleted ?" << toBeDeleted << endl;
file << "calibrated data: " << endl;
HMdcCal3* cal = NULL;
for (Int_t i=0; i<6; i++){
cal = getCal(i);
if(cal!=NULL){
file << "plane " << i << endl;
cal->print(file);
}
}
file << "track at Z= " << myPoint[2] << " for " << myNumberOfHits <<
" hits, " << myNumberOfHits-4 << " DOF " << endl;
file << "X" << '\t' << myPoint[0] << " +- " << sqrt(cov.getErr(0)) << endl;
file << "X Slope" << '\t' << mySlope[0] << " +- " << sqrt(cov.getErr(1)) << endl;
file << "Y" << '\t' << myPoint[1] << " +- " << sqrt(cov.getErr(2)) << endl;
file << "Y Slope" << '\t' << mySlope[1] << " +- " << sqrt(cov.getErr(3)) <<
'\n'<< '\n';
file << "chi**2/DOF" << '\t' << myChi << endl;
}
void HMdcHitAux :: printCal(){
for(Int_t i=0; i<6; i++){
if(getCal(i)!=NULL){
cout << "plane " << i+1 << endl;
getCal(i)->print();
}
}
}
void HMdcHitAux :: printCal(ostream& file){
for(Int_t i=0; i<6; i++){
if(getCal(i)!=NULL){
getCal(i)->print(file);
}
}
}
void HMdcHitAux :: print(){
cout << "isUsed ? " << isUsed << endl;
cout << "number of hits" << '\t' << myNumberOfHits << endl;
for(Int_t i=0; i<6; i++){
if(getCal(i)!=NULL){
getCal(i)->print();
}
}
}
void HMdcHitAux :: operator= (HMdcHitAux *copy){
#if DEBUG_LEVEL>3
gDebuger->enterFunc("HMdcHitAux::operator=(HMdcHitAux*)");
#endif
myPoint[0] = copy->getPointX();
myPoint[1] = copy->getPointY();
myPoint[2] = copy->getPointZ();
cov.setErr(0,copy->getXError());
cov.setErr(1,copy->getYError());
mySlope[0] = copy->getSlopeX();
mySlope[1] = copy->getSlopeY();
cov.setErr(2,copy->getErrorSlope1());
cov.setErr(3,copy->getErrorSlope2());
myChi = copy->getChi();
for (Int_t nplane=0; nplane < 6 ; nplane++){
cal[nplane] = copy->getCal(nplane);
}
myNumberOfHits = copy->getNumHits();
#if DEBUG_LEVEL>3
gDebuger->leaveFunc("HMdcHitAux::operator=(HMdcHitAux*)");
#endif
}
void HMdcHitAux :: operator= (HMdcHitAux ©){
#if DEBUG_LEVEL>3
gDebuger->enterFunc("HMdcHitAux::operator=(HMdcHitAux&)");
#endif
myPoint[0] = copy.getPointX();
myPoint[1] = copy.getPointY();
myPoint[2] = copy.getPointZ();
cov.setErr(0,copy.getXError());
cov.setErr(1,copy.getYError());
mySlope[0] = copy.getSlopeX();
mySlope[1] = copy.getSlopeY();
cov.setErr(2,copy.getErrorSlope1());
cov.setErr(3,copy.getErrorSlope2());
myChi = copy.getChi();
for (Int_t nplane=0; nplane < 6 ; nplane++){
cal[nplane] = copy.getCal(nplane);
}
myNumberOfHits = copy.getNumHits();
#if DEBUG_LEVEL>3
gDebuger->leaveFunc("HMdcHitAux::operator=(HMdcHitAux&)");
#endif
}
void HMdcHitAux :: markHits(void){
# if DEBUG_LEVEL >2
gDebuger->enterFunc("HMdcHitAux::markHits");
#endif
for(Int_t i=0; i<6 ; i++){
if(cal[i]!=NULL) cal[i]->incrFlag();
}
# if DEBUG_LEVEL >2
gDebuger->leaveFunc("HMdcHitAux::markHits");
#endif
}
void HMdcHitAux :: unMarkHits(void){
for(Int_t i=0; i<6 ; i++){
if(cal[i]!=NULL){cal[i]->decrFlag();}
}
}
Last change: Sat May 22 13:02:16 2010
Last generated: 2010-05-22 13:02
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.