]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCCalibViewer.cxx
Removing obsolete mapping macro
[u/mrichter/AliRoot.git] / TPC / AliTPCCalibViewer.cxx
index cd1f9629afb2ead0f82b9eb82a0cfddd9606b6fc..2c7492ec15998d9d36bc80753417780b55012f2a 100644 (file)
@@ -130,7 +130,7 @@ AliTPCCalibViewer::AliTPCCalibViewer(TTree* tree)
 }
 
 //_____________________________________________________________________________
-AliTPCCalibViewer::AliTPCCalibViewer(char* fileName, char* treeName)
+AliTPCCalibViewer::AliTPCCalibViewer(const char* fileName, const char* treeName)
                   :TObject(),
                    fTree(0),
                    fFile(0),
@@ -332,9 +332,12 @@ Int_t AliTPCCalibViewer::EasyDraw(const char* drawCommand, const char* sector, c
    //TString drawOptionsStr("profcolz ");
    Bool_t dangerousToDraw = drawStr.Contains(":") || drawStr.Contains(">>");
    if (dangerousToDraw) {
-      Warning("EasyDraw", "The draw string must not contain ':' or '>>'.");
-      return -1;
+      Warning("EasyDraw", "The draw string must not contain ':' or '>>'. Using only first variable for drawing!");
+//      return -1;
+//      drawStr.Resize(drawStr.First(">"));
+      drawStr.Resize(drawStr.First(":"));
    }
+
    TString drawOptionsStr("");
    TRandom rnd(0);
    Int_t rndNumber = rnd.Integer(10000);
@@ -361,6 +364,14 @@ Int_t AliTPCCalibViewer::EasyDraw(const char* drawCommand, const char* sector, c
       drawStr += rndNumber;
       drawStr += "(330,-250,250,330,-250,250)";
    }
+   else if  (sectorStr.Contains("S")) {
+      drawStr += Form(":rpad%s:row%s+(sector>35)*63>>prof", fAppendString.Data(), fAppendString.Data());
+      drawStr += rndNumber;
+      drawStr += "(159,0,159,140,-70,70)";
+      TString sec=sectorStr;
+      sec.Remove(0,1);
+      cutStr += "sector%36=="+sec+" ";
+   }
    else if (sectorStr.IsDigit()) {
       Int_t isec = sectorStr.Atoi();
       drawStr += Form(":rpad%s:row%s>>prof", fAppendString.Data(), fAppendString.Data());
@@ -448,6 +459,11 @@ Int_t AliTPCCalibViewer::EasyDraw1D(const char* drawCommand, const char* sector,
       cutStr += isec;
       cutStr += ") ";
    }
+   else if  (sectorStr.Contains("S")) {
+      TString sec=sectorStr;
+      sec.Remove(0,1);
+      cutStr += "sector%36=="+sec+" ";
+   }
 
    if (cuts && cuts[0] != 0) {
       if (cutStr.Length() != 0) cutStr += "&& ";
@@ -779,7 +795,7 @@ Int_t AliTPCCalibViewer::SigmaCut(const char* drawCommand, const char* sector, c
          cutHistoLTM->SetLineColor(kGreen+2);
          legend->AddEntry(cutHistoLTM, "LTM", "l");
          cutHistoLTM->SetTitle(Form("%s, cumulative; Multiples of #sigma; Fraction of included data", htemp->GetTitle()));
-         if (plotMean && cutHistoMean || plotMedian && cutHistoMedian) cutHistoLTM->Draw("same");
+         if ((plotMean && cutHistoMean) || (plotMedian && cutHistoMedian)) cutHistoLTM->Draw("same");
             else cutHistoLTM->Draw();
          DrawLines(cutHistoLTM, nsigma, legend, kGreen+2, pm);
       }
@@ -980,7 +996,7 @@ Int_t AliTPCCalibViewer::IntegrateOld(const char* drawCommand, const char* secto
          integralHistoLTM->SetLineColor(kGreen+2);
          legend->AddEntry(integralHistoLTM, "LTM", "l");
          integralHistoLTM->SetTitle(Form("%s, integrated; Multiples of #sigma; Fraction of included data", htemp->GetTitle()));
-         if (plotMean && integralHistoMean || plotMedian && integralHistoMedian) integralHistoLTM->Draw("same");
+         if ((plotMean && integralHistoMean) || (plotMedian && integralHistoMedian)) integralHistoLTM->Draw("same");
             else integralHistoLTM->Draw();
          DrawLines(integralHistoLTM, nsigma, legend, kGreen+2, kTRUE);
       }
@@ -1088,7 +1104,7 @@ Int_t AliTPCCalibViewer::Integrate(const char* drawCommand, const char* sector,
          integralGraphLTM->SetLineColor(kGreen+2);
          legend->AddEntry(integralGraphLTM, "LTM", "l");
          integralGraphLTM->SetTitle(Form("%s, integrated; Multiples of #sigma; Fraction of included data", htemp->GetTitle()));
-         if (plotMean && integralGraphMean || plotMedian && integralGraphMedian) integralGraphLTM->Draw("samelu");
+         if ((plotMean && integralGraphMean) || (plotMedian && integralGraphMedian)) integralGraphLTM->Draw("samelu");
             else integralGraphLTM->Draw("alu");
          DrawLines(integralGraphLTM, nsigma, legend, kGreen+2, kTRUE);
       }
@@ -1519,7 +1535,7 @@ TH1F* AliTPCCalibViewer::Integrate(Int_t n, Float_t *array, Int_t nbins, Float_t
 
 
 //_____________________________________________________________________________
-AliTPCCalPad* AliTPCCalibViewer::GetCalPad(const char* desiredData, char* cuts, char* calPadName) const {
+AliTPCCalPad* AliTPCCalibViewer::GetCalPadOld(const char* desiredData, const char* cuts, const char* calPadName) const {
   //
   // creates a AliTPCCalPad out of the 'desiredData'
   // the functionality of EasyDraw1D is used
@@ -1532,16 +1548,53 @@ AliTPCCalPad* AliTPCCalibViewer::GetCalPad(const char* desiredData, char* cuts,
    AliTPCCalPad * createdCalPad = new AliTPCCalPad(calPadName, calPadName);
    Int_t entries = 0;
    for (Int_t sec = 0; sec < 72; sec++) {
+     AliTPCCalROC * roc = createdCalPad->GetCalROC(sec);
       entries = EasyDraw1D(drawStr.Data(), (Int_t)sec, cuts, "goff");
       if (entries == -1) return 0;
+      const Double_t *pchannel = fTree->GetV2();
+      const Double_t *pvalue   = fTree->GetV1();
       for (Int_t i = 0; i < entries; i++) 
-         createdCalPad->GetCalROC(sec)->SetValue((UInt_t)(fTree->GetV2()[i]), (Float_t)(fTree->GetV1()[i]));
+         roc->SetValue((UInt_t)(pchannel[i]), (Float_t)(pvalue[i]));
    }
    return createdCalPad;   
 }
 
+
+//_____________________________________________________________________________
+AliTPCCalPad* AliTPCCalibViewer::GetCalPad(const char* desiredData, const char* cuts, const char* calPadName) const {
+  //
+  // creates a AliTPCCalPad out of the 'desiredData'
+  // the functionality of EasyDraw1D is used
+  // calPadName specifies the name of the created AliTPCCalPad
+  //  - this takes a while -
+  //
+   TString drawStr(desiredData);
+   drawStr.Append(":channel.fElements:sector");
+   AliTPCCalPad * createdCalPad = new AliTPCCalPad(calPadName, calPadName);
+   //
+   Int_t entries = fTree->Draw(drawStr, cuts,"goff");
+   const Double_t *pvalue   = fTree->GetV1();
+   const Double_t *pchannel = fTree->GetV2();
+   const Double_t *psector  = fTree->GetV3();
+
+   for (Int_t ientry=0; ientry<entries; ientry++){
+     Int_t sector= TMath::Nint(psector[ientry]);
+     AliTPCCalROC * roc = createdCalPad->GetCalROC(sector);
+     if (roc) roc->SetValue((UInt_t)(pchannel[ientry]), (Float_t)(pvalue[ientry]));
+   }
+
+  //  for (Int_t sec = 0; sec < 72; sec++) {
+//      AliTPCCalROC * roc = createdCalPad->GetCalROC(sec);
+//       entries = EasyDraw1D(drawStr.Data(), (Int_t)sec, cuts, "goff");
+//       if (entries == -1) return 0;
+//       for (Int_t i = 0; i < entries; i++) 
+//          roc->SetValue((UInt_t)(pchannel[i]), (Float_t)(pvalue[i]));
+//    }
+   return createdCalPad;   
+}
+
 //_____________________________________________________________________________
-AliTPCCalROC* AliTPCCalibViewer::GetCalROC(const char* desiredData, UInt_t sector, char* cuts) const {
+AliTPCCalROC* AliTPCCalibViewer::GetCalROC(const char* desiredData, UInt_t sector, const char* cuts) const {
   //
   // creates a AliTPCCalROC out of the desiredData
   // the functionality of EasyDraw1D is used