]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDCalibraFillHisto.cxx
Compilation with Root6: TH1::GetXaxis returns now const TAxis*
[u/mrichter/AliRoot.git] / TRD / AliTRDCalibraFillHisto.cxx
index 871385bbec8121fcad610126f82ceee00126520c..45d023828bd283c873cbc6f28a455b4e5d9a7f84 100644 (file)
@@ -182,6 +182,7 @@ AliTRDCalibraFillHisto::AliTRDCalibraFillHisto()
   ,fNumberTrack(0)
   ,fTimeMax(0)
   ,fSf(10.0)
+  ,fRangeHistoCharge(150)
   ,fNumberBinCharge(50)
   ,fNumberBinPRF(10)
   ,fNgroupprf(3)
@@ -273,6 +274,7 @@ AliTRDCalibraFillHisto::AliTRDCalibraFillHisto(const AliTRDCalibraFillHisto &c)
   ,fNumberTrack(c.fNumberTrack)
   ,fTimeMax(c.fTimeMax)
   ,fSf(c.fSf)
+  ,fRangeHistoCharge(c.fRangeHistoCharge)
   ,fNumberBinCharge(c.fNumberBinCharge)
   ,fNumberBinPRF(c.fNumberBinPRF)
   ,fNgroupprf(c.fNgroupprf)
@@ -687,10 +689,8 @@ Bool_t AliTRDCalibraFillHisto::UpdateHistogramsV1(const AliTRDtrackV1 *t,const A
   Int_t numberoftrdtracklets = t->GetNumberOfTracklets();
   if(numberoftrdtracklets < fMinNbTRDtracklets) return kFALSE;
 
-  Double_t tpcsignal = 0.0;
-  if (esdtrack) {
-    tpcsignal = esdtrack->GetTPCsignal()/50.0;
-  }
+  Double_t tpcsignal = 1.0;
+  if(esdtrack) tpcsignal = esdtrack->GetTPCsignal()/50.0;
   if(fScaleWithTPCSignal && tpcsignal <0.00001) return kFALSE;
 
   //
@@ -1691,8 +1691,10 @@ Float_t AliTRDCalibraFillHisto::StoreInfoCHPHtrack(const AliTRDcluster *cl,const
 
   // Fill the fPHPlace and value
   if (fPH2dOn) {
-    fPHPlace[time] = group[1];
-    fPHValue[time] = charge;
+    if (time>=0 && time<fTimeMax) {
+      fPHPlace[time] = group[1];
+      fPHValue[time] = charge;
+    }
   }
 
   return correction;
@@ -2730,7 +2732,7 @@ void AliTRDCalibraFillHisto::CreateCH2d(Int_t nn)
   name += fCalibraMode->GetNrphi(0);
   
   fCH2d = new TH2I("CH2d",(const Char_t *) name
-                  ,fNumberBinCharge,0,300,nn,0,nn);
+                  ,(Int_t)fNumberBinCharge,0,fRangeHistoCharge,nn,0,nn);
   fCH2d->SetYTitle("Det/pad groups");
   fCH2d->SetXTitle("charge deposit [a.u]");
   fCH2d->SetZTitle("counts");
@@ -2746,7 +2748,7 @@ void AliTRDCalibraFillHisto::SetRelativeScale(Float_t RelativeScale)
 {
   //
   // Set the factor that will divide the deposited charge
-  // to fit in the histo range [0,300]
+  // to fit in the histo range [0,fRangeHistoCharge]
   //
  
   if (RelativeScale > 0.0) {
@@ -2768,10 +2770,11 @@ void  AliTRDCalibraFillHisto::FillCH2d(Int_t x, Float_t y)
   // 
   
   //skip simply the value out of range
-  if((y>=300.0) || (y<0.0)) return;
+  if((y>=fRangeHistoCharge) || (y<0.0)) return;
+  if(fRangeHistoCharge < 0.0) return;
   
   //Calcul the y place
-  Int_t yplace = (Int_t) (fNumberBinCharge*y/300.0)+1;
+  Int_t yplace = (Int_t) (fNumberBinCharge*y/fRangeHistoCharge)+1;
   Int_t place = (fNumberBinCharge+2)*(x+1)+yplace;
   
   //Fill