]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
ATO-138, ATO-18 - dEdx calibration description - code to enable visualization of...
authormivanov <marian.ivanov@cern.ch>
Wed, 28 Jan 2015 16:56:56 +0000 (17:56 +0100)
committermivanov <marian.ivanov@cern.ch>
Wed, 28 Jan 2015 16:56:56 +0000 (17:56 +0100)
TPC/TPCrec/AliTPCReconstructor.cxx
TPC/TPCrec/AliTPCReconstructor.h
TPC/TPCrec/AliTPCseed.cxx
TPC/TPCrec/AliTPCtracker.cxx
TPC/TPCrec/AliTPCtracker.h

index ac5a168cefaf92f87cb1e318883fcc0d2da4859b..d9813e1a4f197e124fa3b8fee65c59622f66c829 100644 (file)
 #include "AliTPCcalibDB.h"
 #include "AliTracker.h"
 #include "AliMagF.h"
+#include "TTreeStream.h"
 
 ClassImp(AliTPCReconstructor)
 
 
-Int_t    AliTPCReconstructor::fgStreamLevel     = 0;        // stream (debug) level
+Int_t    AliTPCReconstructor::fgStreamLevel     = 0;             // stream (debug) level
 AliTPCAltroEmulator *  AliTPCReconstructor::fAltroEmulator=0;    // ALTRO emulator
+TTreeSRedirector    *  AliTPCReconstructor::fgDebugStreamer=0;                          // NOTE -  AliTPCReconstructor is not an owner of the streamer
 
 AliTPCReconstructor::AliTPCReconstructor():
 AliReconstructor(),
 fClusterer(NULL),
index 6e092252a05a09df2b13adf7a5edd0d995423a9d..ff4aa00d84964447617bc2b25b7ec1e4f404fcb6 100644 (file)
@@ -13,6 +13,7 @@ class AliTPCclusterer;
 class AliTPCtracker;
 class AliTPCAltroEmulator;
 class TObjArray;
+class TTreeSRedirector;
 
 class AliTPCReconstructor: public AliReconstructor {
 public:
@@ -41,14 +42,16 @@ public:
   static void  SetStreamLevel(Int_t level) { fgStreamLevel = level;}
   static void  SetAltroEmulator(AliTPCAltroEmulator *altro) { fAltroEmulator=altro;}
   static AliTPCAltroEmulator *  GetAltroEmulator() { return fAltroEmulator;}
-
+  static TTreeSRedirector    *GetDebugStreamer(){return fgDebugStreamer;}
+  static TTreeSRedirector    *SetDebugStreamer(TTreeSRedirector    *debugStreamer){fgDebugStreamer=debugStreamer;}
   void ParseOptions(AliTPCtracker* tracker) const;
-
+  
 private:
   AliTPCReconstructor(const AliTPCReconstructor&); //Not implemented
   AliTPCReconstructor& operator=(const AliTPCReconstructor&); //Not implemented
   AliTPCParam*         GetTPCParam() const;
   static Int_t               fgStreamLevel; // flag for streaming      - for TPC reconstruction
+  static TTreeSRedirector    *fgDebugStreamer; // pointer to the streamer
   AliTPCclusterer*           fClusterer;   // TPC clusterer
   static AliTPCAltroEmulator * fAltroEmulator;    // ALTRO emulator
 
index 94526874f702e16d27a517cfed103d49afa7be39..77e46378655ae4e3fd356ff4c7deacb4a5b57396 100644 (file)
@@ -27,6 +27,7 @@
 #include "TGraphErrors.h"
 #include "AliTPCseed.h"
 #include "AliTPCReconstructor.h"
+#include "AliTPCtracker.h"
 #include "AliTPCClusterParam.h"
 #include "AliTPCCalPad.h"
 #include "AliTPCCalROC.h"
@@ -1311,11 +1312,13 @@ Float_t  AliTPCseed::CookdEdxAnalytical(Double_t low, Double_t up, Int_t type, I
     zres0 *=parcl->GetQnormCorr(ipad, type,1);
     Float_t effLength=parcl->GetQnormCorr(ipad, type,4)*0.5;
     Float_t effDiff  =(parcl->GetQnormCorr(ipad, type,2)+parcl->GetQnormCorr(ipad, type,3))*0.5;
+    Float_t corrThr=0;
+    Float_t corrThrMax=0;
     //
     if (type==1) {
-      corrPos = parcl->GetQnormCorr(ipad, type,5)*
-       parcl->QmaxCorrection(cluster->GetDetector(), cluster->GetRow(),cluster->GetPad(), 
-                             cluster->GetTimeBin(),ty,tz,yres0,zres0,effLength,effDiff);
+      corrThr =        parcl->QmaxCorrection(cluster->GetDetector(), cluster->GetRow(),cluster->GetPad(), 
+                                     cluster->GetTimeBin(),ty,tz,yres0,zres0,effLength,effDiff);
+      corrPos= parcl->GetQnormCorr(ipad, type,5)*corrThr;
       Float_t drm   = 0.5-TMath::Abs(cluster->GetZ()/250.);
       corrPos*=(1+parcl->GetQnormCorr(ipad, type+2,0)*drm);
       corrPos*=(1+parcl->GetQnormCorr(ipad, type+2,1)*ty*ty);
@@ -1323,10 +1326,9 @@ Float_t  AliTPCseed::CookdEdxAnalytical(Double_t low, Double_t up, Int_t type, I
       //
     }
     if (type==0) {
-      corrPos = parcl->GetQnormCorr(ipad, type,5)*
-       parcl->QtotCorrection(cluster->GetDetector(), cluster->GetRow(),cluster->GetPad(), 
-                             cluster->GetTimeBin(),ty,tz,yres0,zres0,cluster->GetQ(),2.5,effLength,effDiff);
-      
+      corrThr = parcl->QtotCorrection(cluster->GetDetector(), cluster->GetRow(),cluster->GetPad(), 
+                                     cluster->GetTimeBin(),ty,tz,yres0,zres0,cluster->GetQ(),2.5,effLength,effDiff);
+      corrPos=parcl->GetQnormCorr(ipad, type,5)*corrThr;      
       Float_t drm   = 0.5-TMath::Abs(cluster->GetZ()/250.);
       corrPos*=(1+parcl->GetQnormCorr(ipad, type+2,0)*drm);
       corrPos*=(1+parcl->GetQnormCorr(ipad, type+2,1)*ty*ty);
@@ -1360,6 +1362,46 @@ Float_t  AliTPCseed::CookdEdxAnalytical(Double_t low, Double_t up, Int_t type, I
     //
     Double_t correctionHVandPT = AliTPCcalibDB::Instance()->GetGainCorrectionHVandPT(time, runNumber,cluster->GetDetector(), 5 , recoParam->GetGainCorrectionHVandPTMode());
     //
+    if ((AliTPCReconstructor::StreamLevel()&AliTPCtracker::kStreamSeeddEdx)){  // this part of the code is for the test purposes only  
+      TTreeSRedirector *pcstream = AliTPCReconstructor:: GetDebugStreamer();
+      TVectorF vecDEDX(9,fDEDX);
+      TVectorF vecSDEDX(4,fSDEDX);
+      TVectorF vecRDEDX(4);
+      corrThrMax = parcl->QmaxCorrection(cluster->GetDetector(), cluster->GetRow(),cluster->GetPad(), 
+                                        cluster->GetTimeBin(),ty,tz,yres0,zres0,effLength,effDiff);
+
+      for (Int_t i=0; i<4; i++) vecRDEDX[i]=(fNCDEDXInclThres[i]>0)?Float_t(fNCDEDX[i])/Float_t(fNCDEDXInclThres[i]):0;
+      if (pcstream){
+       (*pcstream)<<"dEdxCorrDump"<<    // streamer to check dEdx correction calibration
+         //
+         "cl.="<<cluster<<
+         "ipad="<<ipad<<
+         "time="<<time<<
+         "runNumber="<<runNumber<<
+         "vecDEDX.="<<&vecDEDX<<
+         "vecSDEDX.="<<&vecSDEDX<<
+         "vecRDEDX.="<<&vecRDEDX<<
+         "ty="<<ty<<
+         "tz="<<tz<<
+         "yres0="<<yres0<<
+         "zres0="<<zres0<<
+         "qpt="<<fP[4]<<
+         "type="<<type<<
+         "effLength="<<effLength<<
+         "effDiff="<<effDiff<<
+         "corrThr="<<corrThr<<
+         "corrThrMax="<<corrThrMax<<
+         "gainGG="<<gainGG<<
+         "correctionHVandPT="<<correctionHVandPT<<
+         "gainPad="<<gainPad<<
+         "corrPos="<<corrPos<<
+         "gainEqualPadRegion="<<gainEqualPadRegion<<
+         "gainChamber="<<gainChamber<<
+         "corrDipAngle="<<corrDipAngle<<
+         "corrDipAngleAbs="<<corrDipAngleAbs<<
+         "\n";
+      }
+    }
     amp[ncl]=charge;
     amp[ncl]/=gainGG;               // nominal gas gain
     amp[ncl]/=correctionHVandPT;    // correction for the HV and P/T - time dependent
index 16a83dfdd29db2018e624d7549376356ccd4012e..855b067a2456918b6049217e6e5bd8caabf57fb7 100644 (file)
@@ -465,6 +465,7 @@ AliTracker(),
 
   if (AliTPCReconstructor::StreamLevel()>0) {
     fDebugStreamer = new TTreeSRedirector("TPCdebug.root","recreate");
+    AliTPCReconstructor::SetDebugStreamer(fDebugStreamer);
   }
   //
   fSeedsPool = new TClonesArray("AliTPCseed",1000);
index dce6b1351b53e19230b8982a9d20d6b4f892959a..279839e948eadf834dc56b08bb612cda6e596aca 100644 (file)
@@ -62,6 +62,7 @@ public:
     kStreamFindMultiMC        =0x10000,    // flag: stream MC infomation about the multiple find track (ONLY for MC data)
     kStreamFindCurling        =0x20000,    // flag: stream track infroamtion in the FindCurling tracks method
     kStreamFindKinks          =0x40000,    // flag: stream track infroamtion in the FindKinks method
+    kStreamSeeddEdx           =0x80000     // flag: stream TPC dEdx intermediate information  AliTPCseed::CookdEdxNorm (to check and validate methods used in calibration)
   };
   AliTPCtracker();
   AliTPCtracker(const AliTPCParam *par);