]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDCalibraFillHisto.cxx
Revert "Revert "#103626: Commit DCal geometry to master" since the files are broken."
[u/mrichter/AliRoot.git] / TRD / AliTRDCalibraFillHisto.cxx
index 558e0b0e37720cc746e32b4514b921e1dc5c6eb5..e3ce45ac3af327efb2fb347f23db8394145e314e 100644 (file)
@@ -142,6 +142,7 @@ AliTRDCalibraFillHisto::AliTRDCalibraFillHisto()
   ,fLinearFitterOn(kFALSE)
   ,fLinearFitterDebugOn(kFALSE)
   ,fExbAltFitOn(kFALSE)
+  ,fScaleWithTPCSignal(kFALSE)
   ,fRelativeScale(0)
   ,fThresholdClusterPRF2(15.0)
   ,fLimitChargeIntegration(kFALSE)
@@ -181,6 +182,7 @@ AliTRDCalibraFillHisto::AliTRDCalibraFillHisto()
   ,fNumberTrack(0)
   ,fTimeMax(0)
   ,fSf(10.0)
+  ,fRangeHistoCharge(150)
   ,fNumberBinCharge(50)
   ,fNumberBinPRF(10)
   ,fNgroupprf(3)
@@ -232,6 +234,7 @@ AliTRDCalibraFillHisto::AliTRDCalibraFillHisto(const AliTRDCalibraFillHisto &c)
   ,fLinearFitterOn(c.fLinearFitterOn)
   ,fLinearFitterDebugOn(c.fLinearFitterDebugOn)
   ,fExbAltFitOn(c.fExbAltFitOn)
+  ,fScaleWithTPCSignal(c.fScaleWithTPCSignal)
   ,fRelativeScale(c.fRelativeScale)
   ,fThresholdClusterPRF2(c.fThresholdClusterPRF2)
   ,fLimitChargeIntegration(c.fLimitChargeIntegration)
@@ -271,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)
@@ -685,6 +689,10 @@ Bool_t AliTRDCalibraFillHisto::UpdateHistogramsV1(const AliTRDtrackV1 *t,const A
   Int_t numberoftrdtracklets = t->GetNumberOfTracklets();
   if(numberoftrdtracklets < fMinNbTRDtracklets) return kFALSE;
 
+  Double_t tpcsignal = 1.0;
+  if(esdtrack) tpcsignal = esdtrack->GetTPCsignal()/50.0;
+  if(fScaleWithTPCSignal && tpcsignal <0.00001) return kFALSE;
+
   //
   if (!fCalibDB) {
     AliInfo("Could not get calibDB");
@@ -750,7 +758,15 @@ Bool_t AliTRDCalibraFillHisto::UpdateHistogramsV1(const AliTRDtrackV1 *t,const A
       // Add the charge if shared cluster
       cls = tracklet->GetClusters(jc+AliTRDseedV1::kNtb);
       //
-      chargeQ += StoreInfoCHPHtrack(cl, tracklet->GetQperTB(jc),group,row,col,cls); //tracklet->GetdQdl(jc)
+      //Scale with TPC signal or not
+      if(!fScaleWithTPCSignal) {
+       chargeQ += StoreInfoCHPHtrack(cl, tracklet->GetQperTB(jc),group,row,col,cls); //tracklet->GetdQdl(jc)
+       //printf("Do not scale now\n");
+      }
+      else {
+       chargeQ += StoreInfoCHPHtrack(cl, tracklet->GetQperTB(jc)/tpcsignal,group,row,col,cls); //tracklet->GetdQdl(jc)
+      }
+    
     }
     
     ////////////////////////////////////////
@@ -811,8 +827,8 @@ Bool_t AliTRDCalibraFillHisto::UpdateHistogramsV1(const AliTRDtrackV1 *t,const A
        Float_t dcaz = b[1];
        Int_t tpcnbclusters = 0;
        if(esdtrack) tpcnbclusters = esdtrack->GetTPCclusters(0);
-       Double_t tpcsignal = 0.0;
-       if(esdtrack) tpcsignal = esdtrack->GetTPCsignal();
+       Double_t ttpcsignal = 0.0;
+       if(esdtrack) ttpcsignal = esdtrack->GetTPCsignal();
         Int_t    cutvdriftlinear = 0;
        if(!pass) cutvdriftlinear = 1;
        
@@ -824,7 +840,7 @@ Bool_t AliTRDCalibraFillHisto::UpdateHistogramsV1(const AliTRDtrackV1 *t,const A
          "dcaxy="<<dcaxy<<
          "dcaz="<<dcaz<<
          "nbtpccls="<<tpcnbclusters<<
-         "tpcsignal="<<tpcsignal<<
+         "tpcsignal="<<ttpcsignal<<
          "cutvdriftlinear="<<cutvdriftlinear<<
          "ptrd="<<momentum<<
          "nbtrdtracklet="<<numberoftrdtracklets<<
@@ -2714,7 +2730,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");
@@ -2730,7 +2746,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) {
@@ -2752,10 +2768,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