Reordering of the functions in header file
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 4 Aug 2008 19:50:48 +0000 (19:50 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 4 Aug 2008 19:50:48 +0000 (19:50 +0000)
Example of the fit of systematic shifts in position
(Marian)

TPC/AliTPCcalibTracks.cxx
TPC/AliTPCcalibTracks.h

index 75cb5b2..3b3b5e3 100644 (file)
@@ -44,6 +44,13 @@ TFile fcalib("CalibObjects.root");
 TObjArray * array = (TObjArray*)fcalib.Get("TPCCalib");
 AliTPCcalibTracks * calibTracks = ( AliTPCcalibTracks *)array->FindObject("calibTracks");
 
+
+//USAGE of debug stream example
+ gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
+  gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+")
+  AliXRDPROOFtoolkit tool;
+  TChain * chainres = tool.MakeChain("tracks.txt","ResolCl",0,10200);
+  chainres->Lookup();
 */
 
 
@@ -511,16 +518,6 @@ AliTPCcalibTracks::~AliTPCcalibTracks() {
 }
    
   
-void AliTPCcalibTracks::AddInfo(TChain * chain, char* fileName){
-   // 
-   // Add the neccessary information for processing to the chain 
-   // (cluster parametrization)
-   // 
-   TFile clusterParamFile(fileName);
-   AliTPCClusterParam *clusterParam  =  (AliTPCClusterParam *) clusterParamFile.Get("Param");
-   chain->GetUserInfo()->AddLast((TObject*)clusterParam);
-   cout << "Clusterparametrization added to the chain." << endl;
-}
 
 void AliTPCcalibTracks::Process(AliTPCseed *track){
    // 
@@ -2504,5 +2501,96 @@ AliTPCcalibTracks* AliTPCcalibTracks::TestMerge(AliTPCcalibTracks *ct, AliTPCClu
 }
 
 
+void  AliTPCcalibTracks::MakeQPosNormAll(TTree * chainres, AliTPCClusterParam * param, Int_t maxPoints, Int_t verbose){
+  //
+  // Make position corrections
+  // for the moment Only using debug streamer 
+  // chainres  - debug tree
+  // param     - parameters to be updated
+  // maxPoints - maximal number of points using for fit
+  // verbose   - print info flag
+  /*
+    //Defaults
+    Int_t maxPoints=100000;
+  */
+}
+
+/*
+  gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
+  gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+")
+  AliXRDPROOFtoolkit tool;  
+  TChain * chainres = tool.MakeChain("tracks.txt","ResolCl",0,10200);
+  chainres->Lookup();
+  //
+  //
+  //
+
+
+  gSystem->Load("libSTAT.so");
+
+  TStatToolkit toolkit;
+  Double_t chi2;
+  TVectorD fitParamY0;
+  TVectorD fitParamY1;
+  TVectorD fitParamZ0;
+  TVectorD fitParamZ1;
+  TMatrixD covMatrix;
+  Int_t npoints;
+
+  chainres->SetAlias("dp","(-1+(Cl.fZ>0)*2)*((Cl.fPad-int(Cl.fPad))-0.5)");
+  chainres->SetAlias("dt","(-1+(Cl.fZ>0)*2)*((Cl.fTimeBin-0.66-int(Cl.fTimeBin-0.66))-0.5)");
+  chainres->SetAlias("sp","(sin(dp*pi)-dp*pi)");
+  chainres->SetAlias("st","(sin(dt)-dt)");
+  //
+  chainres->SetAlias("di","sqrt(1.-abs(Cl.fZ/250.))");
+  chainres->SetAlias("dq","sqrt(15./(5+Cl.fMax))");
+  chainres->SetAlias("sy","(0.32/sqrt(0.01^2+Cl.fSigmaY2))");
+  chainres->SetAlias("sz","(0.32/sqrt(0.01^2+Cl.fSigmaZ2))");
+  //
+  //
+  //
+  TCut cutA("1")
+  
+  TString fstringY="";  
+  //
+  fstringY+="(dp)++";            //1
+  fstringY+="(dp)*di++";         //2
+  fstringY+="(dp)*dq++";         //3
+  fstringY+="(dp)*sy++";         //4
+  //
+  fstringY+="(sp)++";            //5
+  fstringY+="(sp)*di++";         //6
+  fstringY+="(sp)*dq++";         //7
+  fstringY+="(sp)*sy++";         //8
+  //
+
+  TString fstringZ="";  
+  fstringZ+="(dt)++";            //1
+  fstringZ+="(dt)*di++";         //2
+  fstringZ+="(dt)*dq++";         //3
+  fstringZ+="(dt)*sz++";         //4
+  //
+  fstringZ+="(st)++";            //5
+  fstringZ+="(st)*di++";         //6
+  fstringZ+="(st)*dq++";         //7
+  fstringZ+="(st)*sz++";         //8
+
+  
+  TString *strZ0 = toolkit.FitPlane(chainres,"(Cl.fZ-PZ0.fElements[0]):CSigmaZ0",fstringZ->Data(), "Cl.fDetector<36"+cutA, chi2,npoints,fitParamZ0,covMatrix,-1,0,100000);
+  TString *strZ1 = toolkit.FitPlane(chainres,"(Cl.fZ-PZ0.fElements[0]):CSigmaZ0",fstringZ->Data(), "Cl.fDetector>36"+cutA, chi2,npoints,fitParamZ1,covMatrix,-1,0,100000);
+
+  TString *strY0 = toolkit.FitPlane(chainres,"(Cl.fY-PY0.fElements[0]):CSigmaY0",fstringY->Data(), "Cl.fDetector<36"+cutA, chi2,npoints,fitParamY0,covMatrix,-1,0,100000);
+  TString *strY1 = toolkit.FitPlane(chainres,"(Cl.fY-PY0.fElements[0]):CSigmaY0",fstringY->Data(), "Cl.fDetector>36"+cutA, chi2,npoints,fitParamY1,covMatrix,-1,0,100000);
+
+  chainres->SetAlias("fitZ0",strZ0->Data());
+  chainres->SetAlias("fitZ1",strZ1->Data());
+  chainres->SetAlias("fitY0",strY0->Data());
+  chainres->SetAlias("fitY1",strY1->Data());
+  chainres->Draw("Cl.fZ-PZ0.fElements[0]","CSigmaY0<0.7&&CSigmaZ0<0.7"+cutA,"",10000)
+
+
+
+*/
+
 
 
index 4a8bcb8..dc6e55a 100644 (file)
@@ -39,6 +39,7 @@ class AliTPCcalibTracksCuts;
 class AliTPCCalPadRegion;
 class AliTPCCalPad;
 class TChain;
+class TTree;
 class TMutex;
 
 using namespace std;
@@ -47,63 +48,58 @@ class AliTPCcalibTracks : public AliTPCcalibBase {
 public :
    AliTPCcalibTracks();                         // default constructor
   AliTPCcalibTracks(const AliTPCcalibTracks&calibTracks); // copy constructor
-   AliTPCcalibTracks(const Text_t *name, const Text_t *title, AliTPCClusterParam *clusterParam, AliTPCcalibTracksCuts* cuts, Int_t logLevel = 0);
+  AliTPCcalibTracks(const Text_t *name, const Text_t *title, AliTPCClusterParam *clusterParam, AliTPCcalibTracksCuts* cuts, Int_t logLevel = 0);
   AliTPCcalibTracks & operator=(const AliTPCcalibTracks& calibTracks);
-
-   virtual ~AliTPCcalibTracks();                // destructor
-   
-   static void     AddInfo(TChain *chain, char *fileName);        // add clusterParametrization as user info to the chain
-   void            Process(AliTPCseed *track);  // to be called by the Selector
-   
-   Int_t           AcceptTrack(AliTPCseed * track);
-   void            FillResolutionHistoLocal(AliTPCseed * track);  // the MAIN-FUNCTION, called for each track to fill the histograms, called by Process(...)
-   static  TH2D*   MakeDiff(TH2D * hfit, TF2 * func);
-
-   virtual Long64_t Merge(TCollection *li);
-   static AliTPCcalibTracks* TestMerge(AliTPCcalibTracks *ct, AliTPCClusterParam *clusterParam, Int_t nCalTracks = 50);
-   
-   void     SetStyle() const;
-   void     Draw(Option_t* opt);                                  // draw some exemplaric histograms for fast result-check
+  
+  virtual ~AliTPCcalibTracks();                // destructor
+  
+  void            Process(AliTPCseed *track);  // to be called by the Selector
+  virtual Long64_t Merge(TCollection *li);
+  void     MakeResPlotsQTree(Int_t minEntries = 100, char* pathName = "plots");
+  static void MakeQPosNormAll(TTree * chain, AliTPCClusterParam * param, Int_t maxPoints=1000000, Int_t verbose=0);
    void     MakeReport(Int_t stat, char* pathName = "plots");     // calls all functions that procude pictures, results are written to pathName, stat is the minimal statistic threshold
-   void     MakeAmpPlots(Int_t stat, char* pathName = "plots");
-   void     MakeDeltaPlots(char* pathName = "plots");
-   void     MakeChargeVsDriftLengthPlotsOld(char* pathName = "plots");
-   void     MakeChargeVsDriftLengthPlots(char* pathName = "plots");
-   void     FitResolutionNew(char* pathName = "plots");
-   void     FitRMSNew(char* pathName = "plots");
-   void     MakeResPlotsQTree(Int_t minEntries = 100, char* pathName = "plots"); 
-   // Thread-stuff:
-   // void     MakeResPlotsQTreeThread(Int_t minEntries = 100, char* pathName = "plots"); 
-   // static void* MakeResPlotsQTreeThreadFunction(void* arg); 
-   
-//protected:   
-   TObjArray* GetfArrayAmpRow() {return fArrayAmpRow;}
-   TObjArray* GetfArrayAmp() {return fArrayAmp;}
-   TObjArray* GetfArrayQDY() {return fArrayQDY;}
-   TObjArray* GetfArrayQDZ() {return fArrayQDZ;}
-   TObjArray* GetfArrayQRMSY() {return fArrayQRMSY;}
-   TObjArray* GetfArrayQRMSZ() {return fArrayQRMSZ;}
-   TObjArray* GetfArrayChargeVsDriftlength() {return fArrayChargeVsDriftlength;}
-   TH1F*      GetfDeltaY() {return fDeltaY;}
-   TH1F*      GetfDeltaZ() {return fDeltaZ;}
-   TObjArray* GetfResolY() {return fResolY;}
-   TObjArray* GetfResolZ() {return fResolZ;}
-   TObjArray* GetfRMSY() {return fRMSY;}
-   TObjArray* GetfRMSZ() {return fRMSZ;}
-   TH1I*      GetfHclus() {return fHclus;}
-   TH1I*      GetfRejectedTracksHisto() {return fRejectedTracksHisto;}
-   TH1I*      GetfHclusterPerPadrow() {return fHclusterPerPadrow;}
-   TH1I*      GetfHclusterPerPadrowRaw() {return fHclusterPerPadrowRaw;}
-   TH2I*      GetfClusterCutHisto() {return fClusterCutHisto;}
-   AliTPCCalPad*          GetfCalPadClusterPerPad() {return fCalPadClusterPerPad; }
-   AliTPCCalPad*          GetfCalPadClusterPerPadRaw() {return fCalPadClusterPerPadRaw;}
-   AliTPCCalPadRegion*    GetCalPadRegionchargeVsDriftlength() {return fcalPadRegionChargeVsDriftlength;}
-   AliTPCcalibTracksCuts* GetCuts() {return fCuts;}
+  //
 
+   
+  Int_t           AcceptTrack(AliTPCseed * track);
+  void            FillResolutionHistoLocal(AliTPCseed * track);  // the MAIN-FUNCTION, called for each track to fill the histograms, called by Process(...)
+  static  TH2D*   MakeDiff(TH2D * hfit, TF2 * func);
+  
+  static AliTPCcalibTracks* TestMerge(AliTPCcalibTracks *ct, AliTPCClusterParam *clusterParam, Int_t nCalTracks = 50);
+  
+  void     SetStyle() const;
+  void     Draw(Option_t* opt);                                  // draw some exemplaric histograms for fast result-check
+  void     MakeAmpPlots(Int_t stat, char* pathName = "plots");
+  void     MakeDeltaPlots(char* pathName = "plots");
+  void     MakeChargeVsDriftLengthPlotsOld(char* pathName = "plots");
+  void     MakeChargeVsDriftLengthPlots(char* pathName = "plots");
+  void     FitResolutionNew(char* pathName = "plots");
+  void     FitRMSNew(char* pathName = "plots");
+  
+  TObjArray* GetfArrayAmpRow() {return fArrayAmpRow;}
+  TObjArray* GetfArrayAmp() {return fArrayAmp;}
+  TObjArray* GetfArrayQDY() {return fArrayQDY;}
+  TObjArray* GetfArrayQDZ() {return fArrayQDZ;}
+  TObjArray* GetfArrayQRMSY() {return fArrayQRMSY;}
+  TObjArray* GetfArrayQRMSZ() {return fArrayQRMSZ;}
+  TObjArray* GetfArrayChargeVsDriftlength() {return fArrayChargeVsDriftlength;}
+  TH1F*      GetfDeltaY() {return fDeltaY;}
+  TH1F*      GetfDeltaZ() {return fDeltaZ;}
+  TObjArray* GetfResolY() {return fResolY;}
+  TObjArray* GetfResolZ() {return fResolZ;}
+  TObjArray* GetfRMSY() {return fRMSY;}
+  TObjArray* GetfRMSZ() {return fRMSZ;}
+  TH1I*      GetfHclus() {return fHclus;}
+  TH1I*      GetfRejectedTracksHisto() {return fRejectedTracksHisto;}
+  TH1I*      GetfHclusterPerPadrow() {return fHclusterPerPadrow;}
+  TH1I*      GetfHclusterPerPadrowRaw() {return fHclusterPerPadrowRaw;}
+  TH2I*      GetfClusterCutHisto() {return fClusterCutHisto;}
+  AliTPCCalPad*          GetfCalPadClusterPerPad() {return fCalPadClusterPerPad; }
+  AliTPCCalPad*          GetfCalPadClusterPerPadRaw() {return fCalPadClusterPerPadRaw;}
+  AliTPCCalPadRegion*    GetCalPadRegionchargeVsDriftlength() {return fcalPadRegionChargeVsDriftlength;}
+  AliTPCcalibTracksCuts* GetCuts() {return fCuts;}
 protected:         
-   ClassDef(AliTPCcalibTracks,1)
   
-   
 private:
    static Int_t   GetBin(Float_t q, Int_t pad);
    static Int_t   GetBin(Int_t  iq, Int_t pad);
@@ -134,6 +130,7 @@ private:
    TH2I      *fClusterCutHisto;     // histogram showing in which padRow the clusters were cutted by which criterium
    AliTPCCalPad *fCalPadClusterPerPad;    // AliTPCCalPad showing the number of clusters per Pad
    AliTPCCalPad *fCalPadClusterPerPadRaw; // AliTPCCalPad showing the number of clusters per Pad before cuts on clusters are applied
+   ClassDef(AliTPCcalibTracks,1)
    
 };