Conding violations fixed. The code is now included in libSTEER (Mikolaj)
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 3 Jul 2008 11:16:28 +0000 (11:16 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 3 Jul 2008 11:16:28 +0000 (11:16 +0000)
STEER/AliRelAlignerKalman.cxx
STEER/AliRelAlignerKalman.h
STEER/STEERLinkDef.h
STEER/libSTEER.pkg

index 66d6324d261cc97a80631d860abb9acbf8536886..8b490a534748b5b66940e9eeaedb85e0b6782e8b 100644 (file)
@@ -60,8 +60,6 @@
 //
 //////////////////////////////////////////////////////////////////////////////
 
-#include <Riostream.h>
-
 #include "AliRelAlignerKalman.h"
 
 ClassImp(AliRelAlignerKalman)
@@ -79,7 +77,31 @@ AliRelAlignerKalman::AliRelAlignerKalman():
     fPVolIDArray1(new TArrayI(1)),
     fPVolIDArray2(new TArrayI(1)),
     fPVolIDArray2b(new TArrayI(1)),
+    fPDir1(new TVector3), //Direction
+    fPDir2(new TVector3),
+    fPDir2b(new TVector3),
+    fPDir1Cov(new TMatrixDSym(3)),
+    fPDir2Cov(new TMatrixDSym(3)),
+    fPDir2bCov(new TMatrixDSym(3)),
+    fPDir1ThetaPhiCov(new TMatrixDSym(2)), //Direction vectors are unit vectors, therefore 2 independent components!
+    fPDir2ThetaPhiCov(new TMatrixDSym(2)),
+    fPDir2bThetaPhiCov(new TMatrixDSym(2)),
+    fPPoint1(new TVector3),
+    fPPoint2(new TVector3),
+    fPPoint2b(new TVector3),
+    fPPoint1Cov(new TMatrixDSym(3)),
+    fPPoint2Cov(new TMatrixDSym(3)),
+    fPPoint2bCov(new TMatrixDSym(3)),
+    fPRefPoint(new TVector3(0.,0.,0.)),
+    fPRefPointDir(new TVector3(0.,1.,0.)),
+    fPRefAliTrackPoint(new AliTrackPoint()),
+    fPRotMat(new TMatrixD(3,3)),
+    fPX(new TVectorD( fgkNSystemParams )),
+    fPXcov(new TMatrixDSym( fgkNSystemParams )),
+    fPH(new TMatrixD( fgkNMeasurementParams2TrackMode, fgkNSystemParams )),
     fQ(1e-10),
+    fPMeasurement(new TVectorD( fgkNMeasurementParams2TrackMode )),
+    fPMeasurementCov(new TMatrixDSym( fgkNMeasurementParams2TrackMode )),
     fNMeasurementParams(fgkNMeasurementParams2TrackMode),
     fNSystemParams(fgkNSystemParams),
     fOutRejSigmas(2.),
@@ -108,51 +130,37 @@ AliRelAlignerKalman::AliRelAlignerKalman():
     fFirstLayerVol1(1),
     fLastLayerVol1(6),
     fFirstLayerVol2(7),
-    fLastLayerVol2(8)
+    fLastLayerVol2(8),
+    fPVec010(new TVector3(0,1,0)),
+    fPXMesHist(new TH1D("x","x", 50, 0, 0)),
+    fPZMesHist(new TH1D("z","z", 50, 0, 0)),
+    fPPhiMesHist(new TH1D("phi","phi", 50, 0, 0)),
+    fPThetaMesHist(new TH1D("theta","theta", 50, 0, 0)),
+    fPXMesHist2(new TH1D("x_","x_", 50, 0, 0)),
+    fPZMesHist2(new TH1D("z_","z_", 50, 0, 0)),
+    fPPhiMesHist2(new TH1D("phi_","phi_", 50, 0, 0)),
+    fPThetaMesHist2(new TH1D("theta_","theta_", 50, 0, 0)),
+    fPMesCov11Hist(new TH1D("mescov11","mescov11", 50, 0, 0)),
+    fPMesCov22Hist(new TH1D("mescov22","mescov22", 50, 0, 0)),
+    fPMesCov33Hist(new TH1D("mescov33","mescov33", 50, 0, 0)),
+    fPMesCov44Hist(new TH1D("mescov44","mescov44", 50, 0, 0)),
+    fPMesCov55Hist(new TH1D("mescov55","mescov55", 50, 0, 0)),
+    fPMesCov66Hist(new TH1D("mescov66","mescov66", 50, 0, 0)),
+    fPMesCov77Hist(new TH1D("mescov77","mescov77", 50, 0, 0)),
+    fPMesCov88Hist(new TH1D("mescov88","mescov88", 50, 0, 0)),
+    fPMeasurementCovCorr(new TMatrixDSym(fgkNMeasurementParams2TrackMode))
 {
     //Default constructor
     
-    fPDir1 = new TVector3; //Direction
-    fPDir2 = new TVector3;
-    fPDir2b = new TVector3;
-    fPDir1Cov = new TMatrixDSym(3);
-    fPDir2Cov = new TMatrixDSym(3);
-    fPDir2bCov = new TMatrixDSym(3);
-    fPDir1ThetaPhiCov = new TMatrixDSym(2); //Direction vectors are unit vectors, therefore 2 independent components!
-    fPDir2ThetaPhiCov = new TMatrixDSym(2);
-    fPDir2bThetaPhiCov = new TMatrixDSym(2);
-    fPPoint1 = new TVector3;
-    fPPoint2 = new TVector3;
-    fPPoint2b = new TVector3;
-    fPPoint1Cov = new TMatrixDSym(3);
-    fPPoint2Cov = new TMatrixDSym(3);
-    fPPoint2bCov = new TMatrixDSym(3);
-    fPRefPoint = new TVector3(0.,0.,0.);
-    fPRefPointDir = new TVector3(0.,1.,0.);
     Float_t refpointcov[6] = { 1., 0., 0., 
                                    0., 0.,
                                        1.  };
-    fPRefAliTrackPoint = new AliTrackPoint( 0.,0.,0.,refpointcov,0 );
-    fPMeasurement = new TVectorD( fNMeasurementParams );
-    fPMeasurementCov = new TMatrixDSym( fNMeasurementParams );
-    fPX = new TVectorD( fNSystemParams );
-    fPXcov = new TMatrixDSym( fNSystemParams );
-    fPH = new TMatrixD( fNMeasurementParams, fNSystemParams );
-    fPRotMat = new TMatrixD(3,3);
-    fPVec010 = new TVector3(0,1,0);
+    fPRefAliTrackPoint->SetXYZ( 0., 0., 0., refpointcov );
 
     //default seed: zero, unit(large) errors
     fPXcov->UnitMatrix();
     (*fPXcov) *= 1.;
 
-    fPPhiMesHist = new TH1D("phi","phi", 50, 0, 0);
-    fPThetaMesHist = new TH1D("theta","theta", 50, 0, 0);
-    fPXMesHist = new TH1D("x","x", 50, 0, 0);
-    fPZMesHist = new TH1D("z","z", 50, 0, 0);
-    fPPhiMesHist2 = new TH1D("phi_","phi_", 50, 0, 0);
-    fPThetaMesHist2 = new TH1D("theta_","theta_", 50, 0, 0);
-    fPXMesHist2 = new TH1D("x_","x_", 50, 0, 0);
-    fPZMesHist2 = new TH1D("z_","z_", 50, 0, 0);
 }
 
 Bool_t AliRelAlignerKalman::AddESDTrack( AliESDtrack* pTrack )
@@ -674,7 +682,7 @@ Bool_t AliRelAlignerKalman::FindCosmicInEvent( AliESDEvent* pEvent )
     for (Int_t itrack=0; itrack < ntracks; itrack++)
     {
         pTrack = pEvent->GetTrack(itrack);
-        if (!pTrack) {cout<<"no track!"<<endl;continue;}
+        if (!pTrack) {std::cout<<"no track!"<<std::endl;continue;}
         if(pTrack->GetNcls(0)+pTrack->GetNcls(1) < fMinPointsVol1) continue;
         Float_t phi = pTrack->GetAlpha()+TMath::ASin(pTrack->GetSnp());
         Float_t theta = 0.5*TMath::Pi()-TMath::ATan(pTrack->GetTgl());
@@ -826,7 +834,7 @@ Bool_t AliRelAlignerKalman::FindCosmicInEvent( AliESDEvent* pEvent )
     AliTrackPointArray* pfullITStrackArray = new AliTrackPointArray(1);
     JoinTrackArrays( pfullITStrackArray, pITSArray1, pITSArray2 );
 
-    //cout<<"selected tracks: TPC: "<<TPCgood1<<" "<<TPCgood2<<" ITS: "<<ITSgood1<<" "<<ITSgood2<<endl;
+    //std::cout<<"selected tracks: TPC: "<<TPCgood1<<" "<<TPCgood2<<" ITS: "<<ITSgood1<<" "<<ITSgood2<<std::endl;
 
     //Fill the final trackpointarrays
     if (!ExtractSubTrackPointArray( fPTrackPointArray1,  fPVolIDArray1,  pfullITStrackArray, 1, 6 )) return kFALSE;
@@ -951,6 +959,16 @@ Bool_t AliRelAlignerKalman::FitTrackPointArrayRieman( TVector3* pPoint, TMatrixD
     //printf("FitTrackPointArrayRieman\n");
     //Use AliTrackFitterRieman to fit a track through given point array
     
+    ///////////////////////////////////////
+    //this is just to shut up the compiler!!
+        TMatrixDSym* a = pDirCov;
+        AliTrackPoint* b = pRefPoint;
+        TArrayI* c = pVolIDs;
+        a = a;
+        b = b;
+        c = c;
+    ////////////////////////////////////
+
     AliTrackFitterRieman fitter;
     AliTrackPoint trackPoint;
     const Float_t* pointcov;
@@ -981,6 +999,14 @@ Bool_t AliRelAlignerKalman::FitTrackPointArrayKalman( TVector3* pPoint, TMatrixD
     //Use AliTrackFitterKalman to fit a track through given point array
     //still needs work
     
+    ///////////////////////////////////////
+    //this is just to shut up the compiler!!
+        AliTrackPoint* b = pRefPoint;
+        TArrayI* c = pVolIDs;
+        b = b;
+        c = c;
+    ////////////////////////////////////
+
     AliTrackFitterKalman fitter;
     AliTrackPoint trackPoint, trackPoint2;
 
@@ -1213,7 +1239,7 @@ Bool_t AliRelAlignerKalman::SetCalibrationPass( Bool_t cp )
 void AliRelAlignerKalman::PrintDebugInfo()
 {
     //prints debug info
-    cout<<"AliRelAlignerKalman debug info"<<endl;
+    std::cout<<"AliRelAlignerKalman debug info"<<std::endl;
     printf("fPTrackPointArray1 y: ");
     for (Int_t i=0; i<fPTrackPointArray1->GetNPoints();i++)
     {
index 5c890d78557e829034d970c879feaf884d40f525..5fa2b81d5e4f0cfd6e0b5136699c0ea6f9d2cd54 100644 (file)
 //////////////////////////////////////////////////////////////////////////////
 
 #include <iostream>
-#include "TMath.h"
-#include "TMatrixD.h"
-#include "TMatrixDSym.h"
-#include "TVectorD.h"
-#include "TVectorD.h"
-#include "TDecompLU.h"
-#include "TVector3.h"
-#include "TArrayI.h"
+#include <TMath.h>
+#include <TMatrix.h>
+#include <TVector.h>
+#include <TVector3.h>
+#include <TDecompLU.h>
+#include <TArrayI.h>
+#include <TH1D.h>
+#include <TF1.h>
 
 #include "AliESDtrack.h"
 #include "AliTrackPointArray.h"
 #include "AliESDfriendTrack.h"
 #include "AliESDEvent.h"
 #include "AliESDVertex.h"
-#include "TH1D.h"
-#include "TF1.h"
 
 class AliRelAlignerKalman {
 
 public:
     AliRelAlignerKalman();
+    virtual ~AliRelAlignerKalman() {}
 
     //User methods:
     Bool_t AddESDTrack( AliESDtrack* pTrack );
@@ -81,9 +80,6 @@ public:
     void PrintDebugInfo();
     
 protected:
-    AliRelAlignerKalman& operator= (const AliRelAlignerKalman& aligner );
-    AliRelAlignerKalman(const AliRelAlignerKalman&);
-
     Bool_t UpdateEstimateKalman();
     Bool_t FillMeasurement();
     Bool_t FillMeasurementMatrix();
@@ -151,25 +147,6 @@ private:
     //
     //
 
-    //Control and calibration histograms
-    TH1D* fPXMesHist;  //histo of x measurement
-    TH1D* fPZMesHist;  //histo of y measurement
-    TH1D* fPPhiMesHist; //histo of phi measurement
-    TH1D* fPThetaMesHist; //histo of theta measurement
-    TH1D* fPXMesHist2;  //histo of x measurement (3tracks mode)
-    TH1D* fPZMesHist2;  //histo of y measurement (3tracks mode)
-    TH1D* fPPhiMesHist2; //histo of phi measurement (3tracks mode)
-    TH1D* fPThetaMesHist2; //histo of theta measurement (3tracks mode)
-    TH1D* fPMesCov11Hist;  //histogram of the covariance of a fit parameter, used in calibration
-    TH1D* fPMesCov22Hist;  //histogram of the covariance of a fit parameter, used in calibration
-    TH1D* fPMesCov33Hist;  //histogram of the covariance of a fit parameter, used in calibration
-    TH1D* fPMesCov44Hist;  //histogram of the covariance of a fit parameter, used in calibration
-    TH1D* fPMesCov55Hist;  //histogram of the covariance of a fit parameter, used in calibration
-    TH1D* fPMesCov66Hist;  //histogram of the covariance of a fit parameter, used in calibration
-    TH1D* fPMesCov77Hist;  //histogram of the covariance of a fit parameter, used in calibration
-    TH1D* fPMesCov88Hist;  //histogram of the covariance of a fit parameter, used in calibration
-    TMatrixDSym* fPMeasurementCovCorr; //correction to be applied to the measurement covariance
-    
     Bool_t f3TracksMode; //are we using 3 tracklets?
     Bool_t fSortTrackPointsWithY; //whether to sort the points after processing
     Bool_t fFixedMeasurementCovariance; //don't fiddle with measurement cov - supply it externally
@@ -202,10 +179,32 @@ private:
 
     TVector3 * fPVec010; //vector pointing up
 
+    //Control and calibration histograms
+    TH1D* fPXMesHist;  //histo of x measurement
+    TH1D* fPZMesHist;  //histo of y measurement
+    TH1D* fPPhiMesHist; //histo of phi measurement
+    TH1D* fPThetaMesHist; //histo of theta measurement
+    TH1D* fPXMesHist2;  //histo of x measurement (3tracks mode)
+    TH1D* fPZMesHist2;  //histo of y measurement (3tracks mode)
+    TH1D* fPPhiMesHist2; //histo of phi measurement (3tracks mode)
+    TH1D* fPThetaMesHist2; //histo of theta measurement (3tracks mode)
+    TH1D* fPMesCov11Hist;  //histogram of the covariance of a fit parameter, used in calibration
+    TH1D* fPMesCov22Hist;  //histogram of the covariance of a fit parameter, used in calibration
+    TH1D* fPMesCov33Hist;  //histogram of the covariance of a fit parameter, used in calibration
+    TH1D* fPMesCov44Hist;  //histogram of the covariance of a fit parameter, used in calibration
+    TH1D* fPMesCov55Hist;  //histogram of the covariance of a fit parameter, used in calibration
+    TH1D* fPMesCov66Hist;  //histogram of the covariance of a fit parameter, used in calibration
+    TH1D* fPMesCov77Hist;  //histogram of the covariance of a fit parameter, used in calibration
+    TH1D* fPMesCov88Hist;  //histogram of the covariance of a fit parameter, used in calibration
+    TMatrixDSym* fPMeasurementCovCorr; //correction to be applied to the measurement covariance
+    
     static const Int_t fgkNMeasurementParams2TrackMode = 4; //how many measurables in 2 track mode
     static const Int_t fgkNMeasurementParams3TrackMode = 8; //how many measurables in 3 track mode
     static const Int_t fgkNSystemParams = 8;                //how many fit parameters
     
+    AliRelAlignerKalman& operator= (const AliRelAlignerKalman& aligner );
+    AliRelAlignerKalman(const AliRelAlignerKalman&);
+
     ClassDef(AliRelAlignerKalman,1)     //AliRelAlignerKalman class
 };
 
index c59e7a690edaa7f4dc5d1551c66e7a3d552249e6..643a37318409ec834a812d53b0e45926e82c79f9 100644 (file)
 
 #pragma link C++ class AliEventInfo+;
 
+#pragma link C++ class AliRelAlignerKalman+;
+
 #endif
index a0c82d29ad3276d612f7f62be38e254d6f927a1f..5a757eb85aaad5611481f8e95b384c95c945ec9b 100644 (file)
@@ -62,7 +62,8 @@ AliRecoParam.cxx \
 AliDetectorRecoParam.cxx \
 AliPlaneEff.cxx \
 AliTriggerRunScalers.cxx AliGRPPreprocessor.cxx \
-AliEventInfo.cxx
+AliEventInfo.cxx \
+AliRelAlignerKalman.cxx
 
 
 HDRS:= $(SRCS:.cxx=.h)