]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCcalibLaser.cxx
Triggered Balance Function analysis (multidimensions)
[u/mrichter/AliRoot.git] / TPC / AliTPCcalibLaser.cxx
index 83294ad63eb0981a0db2e553de8649e5b8fd52c5..749e4e3e0709d47000bd4a4ace1537885e3dd3eb 100644 (file)
@@ -591,6 +591,7 @@ void AliTPCcalibLaser::Process(AliESDEvent * event) {
   if (!fESDfriend) {
     return;
   }
+  if (fESDfriend->TestSkipBit()) return;
   if (fESD->GetNumberOfTracks()<kMinTracks) return; //not enough tracks
   AliDebug(4,Form("Event number in current file: %d",event->GetEventNumberInFile()));
   //
@@ -3135,7 +3136,7 @@ void AliTPCcalibLaser::DumpScanInfo(TTree * chain, const char * cutUser){
     memcpy(smZ, chain->GetV1(), entries*sizeof(Double_t));
     //
     //
-    sprintf(grnamefull,"Side_%d_Bundle_%d_Rod_%d_Beam_%d",
+    snprintf(grnamefull,1000,"Side_%d_Bundle_%d_Rod_%d_Beam_%d",
            ltrp->GetSide(),  ltrp->GetBundle(), ltrp->GetRod(), ltrp->GetBeam());
     // store data  
     // phi
@@ -3156,7 +3157,7 @@ void AliTPCcalibLaser::DumpScanInfo(TTree * chain, const char * cutUser){
     pphi[0] = fp.GetParameter(0);                          // offset
     pphi[1] = fp.GetParameter(1);                          // slope
     pphi[2] = TMath::Sqrt(fp.GetChisquare()/(entries-2.));  // normalized chi2
-    sprintf(grname,"phi_id%d",id);
+    snprintf(grname,1000,"phi_id%d",id);
     grphi->SetName(grname);  grphi->SetTitle(grnamefull);
     grphi->GetXaxis()->SetTitle("b_{z} (T)");
     grphi->GetYaxis()->SetTitle("#Delta r#phi (cm)");
@@ -3174,7 +3175,7 @@ void AliTPCcalibLaser::DumpScanInfo(TTree * chain, const char * cutUser){
     pphiP[0] = fp.GetParameter(0);                          // offset
     pphiP[1] = fp.GetParameter(1);                          // slope
     pphiP[2] = TMath::Sqrt(fp.GetChisquare()/(entries-2.));  // normalized chi2
-    sprintf(grname,"phiP_id%d",id);
+    snprintf(grname,1000,"phiP_id%d",id);
     grphiP->SetName(grname);  grphiP->SetTitle(grnamefull);
     grphiP->GetXaxis()->SetTitle("b_{z} (T)");
     grphiP->GetYaxis()->SetTitle("#Delta #phi (rad)");
@@ -3192,7 +3193,7 @@ void AliTPCcalibLaser::DumpScanInfo(TTree * chain, const char * cutUser){
     pmZ[0] = fp.GetParameter(0);                          // offset
     pmZ[1] = fp.GetParameter(1);                          // slope
     pmZ[2] = TMath::Sqrt(fp.GetChisquare()/(entries-2.));  // normalized chi2
-    sprintf(grname,"mZ_id%d",id);
+    snprintf(grname,1000,"mZ_id%d",id);
     grmZ->SetName(grname);  grmZ->SetTitle(grnamefull);
     grmZ->GetXaxis()->SetTitle("b_{z} (T)");
     grmZ->GetYaxis()->SetTitle("#Delta z (cm)");
@@ -3278,9 +3279,10 @@ Long64_t AliTPCcalibLaser::Merge(TCollection *li) {
       if (!h &&hm &&hm->GetEntries()>0) {
        h=(TH1F*)hm->Clone();
        h->SetDirectory(0);
-       fDeltaZ.AddAt(h,id);
+       fDeltaZ.AddAt(h,id);      
       }
-      if (hm) h->Add(hm);
+      if (h && hm) h->Add(hm);
+
       // merge fP3 histograms
       hm = (TH1F*)cal->fDeltaP3.At(id);
       h  = (TH1F*)fDeltaP3.At(id);
@@ -3289,7 +3291,7 @@ Long64_t AliTPCcalibLaser::Merge(TCollection *li) {
        h->SetDirectory(0);
        fDeltaP3.AddAt(h,id);
       }
-      if (hm) h->Add(hm);
+      if (h && hm) h->Add(hm);
       // merge fP4 histograms
       hm = (TH1F*)cal->fDeltaP4.At(id);
       h  = (TH1F*)fDeltaP4.At(id);
@@ -3298,7 +3300,7 @@ Long64_t AliTPCcalibLaser::Merge(TCollection *li) {
        h->SetDirectory(0);
        fDeltaP4.AddAt(h,id);
       }
-      if (hm) h->Add(hm);
+      if (h&&hm) h->Add(hm);
 
       //
       // merge fDeltaPhi histograms
@@ -3309,7 +3311,7 @@ Long64_t AliTPCcalibLaser::Merge(TCollection *li) {
        h->SetDirectory(0);
        fDeltaPhi.AddAt(h,id);
       }
-      if (hm) h->Add(hm);
+      if (h&&hm) h->Add(hm);
       // merge fDeltaPhiP histograms
       hm = (TH1F*)cal->fDeltaPhiP.At(id);
       h  = (TH1F*)fDeltaPhiP.At(id);
@@ -3318,7 +3320,7 @@ Long64_t AliTPCcalibLaser::Merge(TCollection *li) {
        h->SetDirectory(0);
        fDeltaPhiP.AddAt(h,id);
       }
-      if (hm) h->Add(hm);
+      if (h&&hm) h->Add(hm);
       // merge fSignals histograms
       hm = (TH1F*)cal->fSignals.At(id);
       h  = (TH1F*)fSignals.At(id);
@@ -3327,7 +3329,7 @@ Long64_t AliTPCcalibLaser::Merge(TCollection *li) {
        h->SetDirectory(0);
        fSignals.AddAt(h,id);
       }
-      if (hm) h->Add(hm);
+      if (h&&hm) h->Add(hm);
       //
       //
       // merge ProfileY histograms -0
@@ -3517,9 +3519,9 @@ void   AliTPCcalibLaser::MakeFitHistos(){
     TH2F *profz = (TH2F*)fDeltaZres.UncheckedAt(id);
     //TH2F *profy2 = (TH2F*)fDeltaYres2.UncheckedAt(id);
     TH2F *profy2 = 0;
-    TH2F *profz2 = (TH2F*)fDeltaZres2.UncheckedAt(id);
-    TH2F *profyabs = (TH2F*)fDeltaYresAbs.UncheckedAt(id);
-    TH2F *profzabs = (TH2F*)fDeltaYresAbs.UncheckedAt(id);
+    TH2F *profz2 = 0;//(TH2F*)fDeltaZres2.UncheckedAt(id);
+    TH2F *profyabs = 0; //(TH2F*)fDeltaYresAbs.UncheckedAt(id);
+    TH2F *profzabs = 0; //(TH2F*)fDeltaYresAbs.UncheckedAt(id);
     //    TH2F *profy3 = (TH2F*)fDeltaYres3.UncheckedAt(id);
     //TH2F *profz3 = (TH2F*)fDeltaZres3.UncheckedAt(id);
     if (!profy){
@@ -3563,11 +3565,11 @@ void   AliTPCcalibLaser::MakeFitHistos(){
     TH1F * hisdz = (TH1F*)fDeltaZ.At(id);
     //TH1F * hisP3 = (TH1F*)fDeltaP3.At(id);
     TH1F * hisP3 = 0;
-    TH1F * hisP4 = (TH1F*)fDeltaP4.At(id);
+    TH1F * hisP4 = 0;
     
-    TH1F * hisdphi = (TH1F*)fDeltaPhi.At(id);
-    TH1F * hisdphiP = (TH1F*)fDeltaPhiP.At(id);
-    TH1F * hisSignal = (TH1F*)fSignals.At(id);
+    TH1F * hisdphi = 0;//(TH1F*)fDeltaPhi.At(id);
+    TH1F * hisdphiP = 0;//(TH1F*)fDeltaPhiP.At(id);
+    TH1F * hisSignal = 0; //(TH1F*)fSignals.At(id);
 
     if (!hisdz){
       hisdz = new TH1F(Form("hisdz%d",id),Form("hisdz%d",id),1000,-10,10);
@@ -4168,21 +4170,21 @@ void AliTPCcalibLaser::DumpLaser(const char *finput, Int_t run){
     delete his;
     //
     his=hisTimeInput->Projection(1);
-    Int_t firstBinTime=his->FindFirstBinAbove(0);
-    Int_t lastBinTime=his->FindLastBinAbove(0);
+    //    Int_t firstBinTime=his->FindFirstBinAbove(0);
+    //Int_t lastBinTime=his->FindLastBinAbove(0);
     //hisTimeInput->GetAxis(1)->SetRange(firstBinTime, lastBinTime);
     delete his;
     //
     //
     his=hisTimeInput->Projection(2);
-    Int_t firstBinZ=his->FindFirstBinAbove(0);
-    Int_t lastBinZ=his->FindLastBinAbove(0);
+    //Int_t firstBinZ=his->FindFirstBinAbove(0);
+    //Int_t lastBinZ=his->FindLastBinAbove(0);
     //hisTimeInput->GetAxis(2)->SetRange(firstBinZ, lastBinZ);
     delete his;
     //
     his=hisPadInput->Projection(2);
-    Int_t firstBinY=his->FindFirstBinAbove(0);
-    Int_t lastBinY=his->FindLastBinAbove(0);
+    //    Int_t firstBinY=his->FindFirstBinAbove(0);
+    //Int_t lastBinY=his->FindLastBinAbove(0);
     //hisPadInput->GetAxis(2)->SetRange(firstBinY, lastBinY);
     delete his;
     //
@@ -4211,8 +4213,8 @@ void AliTPCcalibLaser::DumpLaser(const char *finput, Int_t run){
       his->GetXaxis()->SetRangeUser(his->GetMean()-kSigma*his->GetRMS(), his->GetMean()+kSigma*his->GetRMS());
       meandEdx[irow] =his->GetMean();
       sigmadEdx[irow]=his->GetRMS();
-      Int_t bindedx0= his->FindBin(meandEdx[irow]-kSigma*sigmadEdx[irow]);
-      Int_t bindedx1= his->FindBin(meandEdx[irow]+kSigma*sigmadEdx[irow]);
+      //      Int_t bindedx0= his->FindBin(meandEdx[irow]-kSigma*sigmadEdx[irow]);
+      //Int_t bindedx1= his->FindBin(meandEdx[irow]+kSigma*sigmadEdx[irow]);
       //      hisPad->GetAxis(3)->SetRange(bindedx0,bindedx1);
       //hisTime->GetAxis(3)->SetRange(bindedx0,bindedx1 );
       delete his;
@@ -4223,8 +4225,8 @@ void AliTPCcalibLaser::DumpLaser(const char *finput, Int_t run){
       his->GetXaxis()->SetRangeUser(his->GetMean()-kSigma*his->GetRMS(), his->GetMean()-kSigma*his->GetRMS());
       meanSTime[irow] =his->GetMean();
       sigmaSTime[irow]=his->GetRMS();
-      Int_t binSTime0= his->FindBin(his->GetMean()-kSigma*his->GetRMS());
-      Int_t binSTime1= his->FindBin(his->GetMean()+kSigma*his->GetRMS());
+      //Int_t binSTime0= his->FindBin(his->GetMean()-kSigma*his->GetRMS());
+      //Int_t binSTime1= his->FindBin(his->GetMean()+kSigma*his->GetRMS());
       //      hisTime->GetAxis(2)->SetRange(binSTime0, binSTime1);
       delete his;
       //
@@ -4233,8 +4235,8 @@ void AliTPCcalibLaser::DumpLaser(const char *finput, Int_t run){
       his->GetXaxis()->SetRangeUser(his->GetMean()-kSigma*his->GetRMS(), his->GetMean()+kSigma*his->GetRMS());
       meanSPad[irow] =his->GetMean();
       sigmaSPad[irow]=his->GetRMS();   
-      Int_t binSPad0= his->FindBin(his->GetMean()-kSigma*his->GetRMS());
-      Int_t binSPad1= his->FindBin(his->GetMean()+kSigma*his->GetRMS());
+      //      Int_t binSPad0= his->FindBin(his->GetMean()-kSigma*his->GetRMS());
+      //Int_t binSPad1= his->FindBin(his->GetMean()+kSigma*his->GetRMS());
       //      hisPad->GetAxis(2)->SetRange(binSPad0, binSPad1);
       delete his;
       //
@@ -4333,7 +4335,7 @@ void AliTPCcalibLaser::FitLaserClusters(Int_t run){
   const Double_t kDistCutFit=0.5;              
   const Double_t kDistCutFitPad=0.25;
   const Double_t kDistCutFitTime=0.25;
-  const Int_t kSmoothRow=5.;
+  const Int_t kSmoothRow=5;
   TFile f("hisLasers.root");  // Input file
   TTree * treeInput=(TTree*)f.Get("laserClusters"); 
   TTreeSRedirector *pcstream=new TTreeSRedirector("fitLasers.root");
@@ -4559,7 +4561,7 @@ void AliTPCcalibLaser::FitLaserClusters(Int_t run){
       fitPadLocal[irow]=0;
       fitTimeLocal[irow]=0;
       if (isOK[irow]<0.5) continue;     
-      Int_t sector=(irow<roc->GetNRows(0))? sectorInner:sectorOuter;
+      Int_t sector=(irow<Int_t(roc->GetNRows(0)))? sectorInner:sectorOuter;
       if (TMath::Abs(ltrp->GetVecSec()->GetMatrixArray()[irow]-sector)>0.1) continue;
       //
       TLinearFitter fitterPadLocal(2,"pol1");