]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
fix error during merging (https://savannah.cern.ch/bugs/index.php?70729)
authorabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 Aug 2010 09:57:56 +0000 (09:57 +0000)
committerabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 Aug 2010 09:57:56 +0000 (09:57 +0000)
16 files changed:
PWG1/TRD/AliTRDcalibration.cxx
PWG1/TRD/AliTRDcheckDET.cxx
PWG1/TRD/AliTRDcheckESD.cxx
PWG1/TRD/AliTRDcheckPID.cxx
PWG1/TRD/AliTRDclusterResolution.cxx
PWG1/TRD/AliTRDefficiency.cxx
PWG1/TRD/AliTRDefficiencyMC.cxx
PWG1/TRD/AliTRDinfoGen.cxx
PWG1/TRD/AliTRDpidRefMaker.cxx
PWG1/TRD/AliTRDpidRefMakerLQ.cxx
PWG1/TRD/AliTRDrecoTask.cxx
PWG1/TRD/AliTRDrecoTask.h
PWG1/TRD/AliTRDresolution.cxx
PWG1/TRD/AliTRDresolution.h
PWG1/TRD/AliTRDv0Monitor.cxx
PWG1/TRD/AliTRDv0Monitor.h

index a9a1dc63bb05fd1d01d43b275436ceaafe9668a9..86a475d161c4f841fdc48d28f1ea378395c2ed64 100644 (file)
@@ -344,7 +344,8 @@ void AliTRDcalibration::UserCreateOutputObjects()
     fContainer->Add(fCHSum);
 
   }
-
+  // Post output data
+  PostData(1, fContainer);
 }
 
 //________________________________________________________________________
@@ -465,15 +466,8 @@ void AliTRDcalibration::UserExec(Option_t *)
     fNbTRDTrackOffline->Fill(nbTrdTracksOffline);
     
   }
-
-  //printf("Nbof tracks %d\n",nbTrdTracks);
-  
-  // Post output data
-  PostData(1, fContainer);
-
-  //printf("post container\n");
-  
-}      
+}  
+    
 //________________________________________________________________________
 void AliTRDcalibration::Terminate(Option_t *) 
 {
index 759ede6b8d57ddbafe6cc78f1bdb38c6490582a5..3a76f0b9ca322a4be4a26c8efef7be77959d2608 100644 (file)
@@ -126,8 +126,7 @@ void AliTRDcheckDET::UserCreateOutputObjects(){
   //
   // Create Output Objects
   //
-  if(!HasFunctorList()) InitFunctorList();
-  fContainer = Histos();
+  AliTRDrecoTask::UserCreateOutputObjects();
   if(!fTriggerNames) fTriggerNames = new TMap();
 }
 
@@ -166,7 +165,6 @@ void AliTRDcheckDET::UserExec(Option_t *opt){
     histo = dynamic_cast<TH1F *>(fContainer->UncheckedAt(kNeventsTrigger));
     histo->GetXaxis()->SetBinLabel(histo->FindBin(triggermask), triggername);
   }
-  PostData(1, fContainer);
 }
 
 
index ef4834f054463e85213265b63616a71cff33d7c1..f5ff206233784f8f543c2719b155469a9c08a478 100644 (file)
@@ -138,6 +138,7 @@ void AliTRDcheckESD::UserCreateOutputObjects()
   // Create Output Containers (TObjectArray containing 1D histograms)\r
   //\r
   Histos();\r
+  PostData(1, fHistos);\r
 }\r
 \r
 //____________________________________________________________________\r
@@ -1004,8 +1005,6 @@ void AliTRDcheckESD::UserExec(Option_t *){
   h->Fill(nTracksAcc);\r
   h = (TH1I*)fHistos->At(kNTracksTPC);\r
   h->Fill(nTracksTPC);\r
-  \r
-  PostData(1, fHistos);\r
 }\r
 \r
 //____________________________________________________________________\r
index 76151e05e2242714e757bd2b0a897ebea788a69b..c91948d0c9d58be652de802d15e59e7ef3e6ba57 100644 (file)
@@ -135,11 +135,10 @@ void AliTRDcheckPID::UserCreateOutputObjects()
   // Create histograms
   // Called once
 
-  if(!HasFunctorList()) InitFunctorList();
-  fContainer = Histos();
-
+  AliTRDrecoTask::UserCreateOutputObjects();
   fPID = new TObjArray();
   fPID->SetOwner(kTRUE);
+  PostData(2, fPID);
 }
 
 //________________________________________________________
@@ -153,8 +152,6 @@ void AliTRDcheckPID::UserExec(Option_t *opt)
   fPID->Delete();
 
   AliTRDrecoTask::UserExec(opt);
-
-  PostData(2, fPID);
 }
 
 
index b21ce81ddcbdbe39ce651c904788d4c12c1572ea..63e67b4de977f385c7019a3d65706f9225c3e4c0 100644 (file)
@@ -267,6 +267,7 @@ AliTRDclusterResolution::~AliTRDclusterResolution()
 void AliTRDclusterResolution::UserCreateOutputObjects()
 {
   fContainer = Histos();
+  PostData(1, fContainer);
 }
 
 //_______________________________________________________
@@ -546,7 +547,6 @@ void AliTRDclusterResolution::UserExec(Option_t *)
     // fill histo for systematic (mean)
     ((TH3S*)arr2->At(it-1))->Fill(10.*cli->GetAnisochronity(), dydx-cli->GetTilt()*dzdx, dy);  
   }
-  PostData(1, fContainer);
 }
 
 
index e6e5045f57f0320cbef43bf77a04f2ce4243b449..15e282aa33acb7cc02137067d2bf96b98479634a 100644 (file)
@@ -95,6 +95,7 @@ void  AliTRDefficiency::UserCreateOutputObjects()
   }
   fContainer->Add(h = new TProfile("h", "", nbins, xbins));
   h->SetMarkerStyle(7);
+  PostData(1, fContainer);
 } 
 
 //____________________________________________________________________
@@ -266,7 +267,6 @@ void AliTRDefficiency::UserExec(Option_t *)
        for(Int_t itk = 0; itk < nTRD - 1; itk++)
                if(labelsacc[indices[itk]] ==labelsacc[indices[itk + 1]]) printf("Double counted MC track: %d\n", labelsacc[indices[itk]]);
        }
-  PostData(1, fContainer);
 }
 
 
index d4839b2ce14592037c71d5f302e9b1e9ab0123d6..a0fd549bd4f2b3fdba770834db19706eb2729cb5 100644 (file)
@@ -43,6 +43,7 @@
 #include "AliTRDcluster.h"
 #include "AliTRDseedV1.h"
 #include "AliTRDtrackV1.h"
+#include "AliTRDpidUtil.h"
 #include "Cal/AliTRDCalPID.h"
 #include "info/AliTRDtrackInfo.h"
 #include "AliTRDinfoGen.h"
@@ -76,6 +77,7 @@ void AliTRDefficiencyMC::UserCreateOutputObjects(){
   //
 
   fContainer = Histos();
+  PostData(1, fContainer);
 }
 
 //_____________________________________________________________________________
@@ -197,8 +199,6 @@ void AliTRDefficiencyMC::UserExec(Option_t *){
     (nall ? 1.E2*Float_t(naccept)/Float_t(nall) : 0.), 
     ncontam, 
     (nall ? 1.E2*Float_t(ncontam)/Float_t(nall) : 0.)));
-
-  PostData(1, fContainer);
 }
 
 
index 9485f35de737e5c5693ea452684ee83a2a1142ab..a5fed4a289f36085c4c7b455420b7b2972dba1c0 100644 (file)
@@ -229,6 +229,7 @@ void AliTRDinfoGen::UserCreateOutputObjects()
   ax->SetBinLabel(11, "Kink");
   ax->SetBinLabel(12, "KinkMC");
   fContainer->AddAt(h, 0);
+  PostData(kMonitor, fContainer);
 }
 
 //____________________________________________________________________
@@ -629,7 +630,6 @@ void AliTRDinfoGen::UserExec(Option_t *){
   PostData(kTracksKink, fTracksKink);
   PostData(kEventInfo, fEventInfo);
   PostData(kV0List, fV0List);
-  PostData(kMonitor, fContainer);
 }
 
 //____________________________________________________________________
index 23b1332256c4f1d4a5e3cec74c072e58e981467f..11a3bd9bc8e6f9dd3e6ce3e9183ae2f1ae95c334 100644 (file)
@@ -8,6 +8,7 @@
 #include "AliLog.h"
 #include "AliESDtrack.h"
 #include "AliTrackReference.h"
+#include "AliAnalysisManager.h"
 
 #include "AliTRDReconstructor.h"
 #include "AliTRDtrackV1.h"
@@ -122,10 +123,12 @@ void AliTRDpidRefMaker::UserCreateOutputObjects()
   h2->GetYaxis()->SetTitle("P bins");
   h2->GetYaxis()->SetNdivisions(511);
   fContainer->AddAt(h2, 0);
+  PostData(1, fContainer);
 
   OpenFile(2);
   fData = new TTree("RefPID", "Reference data for PID");
   fData->Branch("data", &fPIDdataArray);
+  PostData(2, fData);
 }
 
 //________________________________________________________________________
@@ -133,10 +136,19 @@ void AliTRDpidRefMaker::UserExec(Option_t *)
 {
   // Main loop
   // Called for each event
-
-  if(!(fTracks = dynamic_cast<TObjArray*>(GetInputData(1)))) return;
-  if(!(fV0s    = dynamic_cast<TObjArray*>(GetInputData(2)))) return;
-  if(!(fInfo   = dynamic_cast<TObjArray*>(GetInputData(3)))) return;
+  Int_t ev((Int_t)AliAnalysisManager::GetAnalysisManager()->GetCurrentEntry());
+  if(!(fTracks = dynamic_cast<TObjArray*>(GetInputData(1)))){
+    AliDebug(3, Form("Missing tracks container in ev %d", ev)); 
+    return;
+  }
+  if(!(fV0s    = dynamic_cast<TObjArray*>(GetInputData(2)))){ 
+    AliDebug(3, Form("Missing v0 container in ev %d", ev)); 
+    return;
+  }
+  if(!(fInfo   = dynamic_cast<TObjArray*>(GetInputData(3)))){ 
+    AliDebug(3, Form("Missing pid info container in ev %d", ev)); 
+    return;
+  }
 
   AliDebug(1, Form("Entries: Tracks[%d] V0[%d] PID[%d]", fTracks->GetEntriesFast(), fV0s->GetEntriesFast(), fInfo->GetEntriesFast()));
   AliTRDtrackInfo     *track = NULL;
@@ -221,9 +233,6 @@ void AliTRDpidRefMaker::UserExec(Option_t *)
 
     Fill();
   }
-
-  PostData(1, fContainer);
-  PostData(2, fData);
 }
 
 
index e12bb16589b635f927610927d7e4ded3834dda5a..59e052bedd870704757b14fd90e6f22562f4373c 100644 (file)
@@ -92,10 +92,12 @@ void AliTRDpidRefMakerLQ::UserCreateOutputObjects()
   // Called once
 
   fContainer = Histos();
+  PostData(1, fContainer);
 
   //OpenFile(2, "RECREATE");
   fPDF = new TObjArray(AliTRDCalPIDLQ::GetNrefs());
   fPDF->SetOwner();fPDF->SetName("PDF_LQ");
+  PostData(3, fPDF);
 }
 
 
@@ -262,9 +264,6 @@ void AliTRDpidRefMakerLQ::UserExec(Option_t */*opt*/)
       ((TH1*)((TObjArray*)fContainer->At(ip))->At(s))->Fill(dedx[0]+dedx[1]);
     }
   }
-
-  PostData(1, fContainer);
-  PostData(3, fPDF);
 }
 
 
index 1c390069a2111a04de27acdbda5cc38e1e13c6b1..c8114454536d84d34c1af2b862b700a5f400792b 100644 (file)
@@ -108,6 +108,14 @@ Int_t AliTRDrecoTask::GetNRefFigures() const
   return fNRefFigures; 
 } 
 
+//_______________________________________________________
+void AliTRDrecoTask::UserCreateOutputObjects()
+{
+  if(!HasFunctorList()) InitFunctorList();
+  fContainer = Histos();
+  PostData(1, fContainer);
+}
+
 //_______________________________________________________
 void AliTRDrecoTask::UserExec(Option_t *)
 {
@@ -136,7 +144,6 @@ void AliTRDrecoTask::UserExec(Option_t *)
       plot->Execute(this);
     }
   }
-  PostData(1, fContainer);
 }
 
 //_______________________________________________________
index b3aa7a8a050b9c5b79282175bc3825456bafa258..f14a8859997eefb2f2b8b9dec66dd239c247b4c5 100644 (file)
@@ -38,7 +38,7 @@ public:
   virtual ~AliTRDrecoTask();
   
   
-  virtual void   UserCreateOutputObjects() = 0;
+  virtual void   UserCreateOutputObjects();
   virtual void   UserExec(Option_t *opt);
   virtual void   SetDebugLevel(Int_t level);
   
index d6e3513abd8e02b5b13668f85ce266ed085d2616..f36663b6fedc55ec7e8095a491a22260d9bd33db 100644 (file)
@@ -72,6 +72,7 @@
 #include "AliPID.h"
 #include "AliLog.h"
 #include "AliESDtrack.h"
+#include "AliMathBase.h"
 
 #include "AliTRDresolution.h"
 #include "AliTRDgeometry.h"
@@ -203,8 +204,11 @@ void AliTRDresolution::UserCreateOutputObjects()
   }
   if(!fGeo) fGeo = new AliTRDgeometry();
 
-  if(!HasFunctorList()) InitFunctorList();
-  fContainer = Histos();
+  AliTRDrecoTask::UserCreateOutputObjects();
+  PostData(kClToTrk, fCl);
+  PostData(kClToMC, fMCcl);
+/*  PostData(kTrkltToTrk, fTrklt);
+  PostData(kTrkltToMC, fMCtrklt);*/
   InitExchangeContainers();
 }
 
@@ -233,10 +237,6 @@ void AliTRDresolution::UserExec(Option_t *opt)
 /*  fTrklt->Delete();
   fMCtrklt->Delete();*/
   AliTRDrecoTask::UserExec(opt);
-  PostData(kClToTrk, fCl);
-  PostData(kClToMC, fMCcl);
-/*  PostData(kTrkltToTrk, fTrklt);
-  PostData(kTrkltToMC, fMCtrklt);*/
 }
 
 //________________________________________________________
@@ -1763,122 +1763,209 @@ void AliTRDresolution::MakeSummary()
     return;
   }  
   Float_t xy[4] = {0., 0., 0., 0.};
-  Int_t iSumPlot(0);
-  TCanvas *cOut = new TCanvas(Form("TRDsummary%s_%d", GetName(), iSumPlot), "Cluster & Tracklet Resolution", 1024, 768);
-  TF1 fg("fg", "gaus", -500., 500.);
-
-  if(!HasMCdata()) return;
-  cOut->Divide(3,2);
-  
+  Float_t range[2];
   TH2 *h2 = new TH2I("h2SF", "", 20, -.2, .2, fgkNresYsegm[fSegmentLevel], -0.5, fgkNresYsegm[fSegmentLevel]-0.5);
   h2->GetXaxis()->CenterTitle();
   h2->GetYaxis()->CenterTitle();
-  h2->GetZaxis()->CenterTitle();
-  TH1 *h1 = new TH1F("h1SF0", "", 120, -200., 1000.);
-  TGraphErrors *g(NULL);
-  TAxis *ax(h2->GetXaxis());
-  Double_t x, y;
-  TObjArray *a(NULL);
-
-  cOut->cd(1); 
-  h2->SetTitle(Form("Cluster R-Phi Resolution;tg(#phi);%s;Sigma [#mum]", fgkResYsegmName[fSegmentLevel]));
-  a=(TObjArray*)  ((TObjArray*)fGraphS->At(kMCcluster))->At(0);
-  for(Int_t iseg(0); iseg<fgkNresYsegm[fSegmentLevel]; iseg++){
-    g=(TGraphErrors*)a->At(iseg);
-    for(Int_t in(0); in<g->GetN(); in++){
-      g->GetPoint(in, x, y);
-      h2->SetBinContent(ax->FindBin(x), iseg+1, y);
-      h1->Fill(y);
-    }
-  }
-  Int_t jBinMin(1), jBinMax(h1->GetNbinsX());
-  for(Int_t ibin(h1->GetMaximumBin()); ibin--;){
-    if(h1->GetBinContent(ibin)==0){
-      jBinMin=ibin; break;
-    }
-  }
-  for(Int_t ibin(h1->GetMaximumBin()); ibin++;){
-    if(h1->GetBinContent(ibin)==0){
-      jBinMax=ibin; break;
-    }
-  }
-  h2->GetZaxis()->SetRangeUser(h1->GetBinCenter(jBinMin), h1->GetBinCenter(jBinMax));
-  h2->Draw("col2z");
+  h2->GetZaxis()->CenterTitle();h2->GetZaxis()->SetTitleOffset(1.4);
+
+  Int_t ih2(0), iSumPlot(0);
+  TCanvas *cOut = new TCanvas(Form("TRDsummary%s_%d", GetName(), iSumPlot++), "Cluster & Tracklet Resolution", 1024, 768);
+  cOut->Divide(3,2, 2.e-3, 2.e-3, kYellow-7);
+  TVirtualPad *p(NULL);
+
+  p=cOut->cd(1); 
+  p->SetRightMargin(0.16);p->SetTopMargin(0.06);
+  h2=(TH2I*)h2->Clone(Form("h2SF_%d", ih2++));
+  h2->SetTitle(Form("Cluster-Track R-Phi Residuals;tg(#phi);%s;Sigma [#mum]", fgkResYsegmName[fSegmentLevel]));
+  MakeSummaryPlot((TObjArray*)  ((TObjArray*)fGraphS->At(kCluster))->At(0), h2);
+  GetRange(h2, 1, range);
+  h2->GetZaxis()->SetRangeUser(range[0], range[1]);
+  h2->Draw("colz");
+  h2->SetContour(7);
+
+  p=cOut->cd(2); 
+  p->SetRightMargin(0.16);p->SetTopMargin(0.06);
+  h2=(TH2I*)h2->Clone(Form("h2SF_%d", ih2++));
+  h2->SetTitle(Form("Cluster-Track R-Phi Systematics;tg(#phi);%s;Mean [#mum]", fgkResYsegmName[fSegmentLevel]));
+  MakeSummaryPlot((TObjArray*)  ((TObjArray*)fGraphM->At(kCluster))->At(0), h2);
+  GetRange(h2, 0, range);
+  h2->GetZaxis()->SetRangeUser(range[0], range[1]);
+  h2->Draw("colz");
+  h2->SetContour(7);
+
+  p=cOut->cd(3); 
+  p->SetRightMargin(0.06);p->SetTopMargin(0.06);
+  xy[0]=-.5; xy[1]=-0.5; xy[2]=fgkNresYsegm[fSegmentLevel]-.5; xy[3]=2.5;
+  GetGraphArray(xy, kCluster, 1, 1);
+
+  p=cOut->cd(4); 
+  p->SetRightMargin(0.16);p->SetTopMargin(0.06);
+  h2=(TH2I*)h2->Clone(Form("h2SF_%d", ih2++));
+  h2->SetTitle(Form("Tracklet-Track R-Phi Residuals;tg(#phi);%s;Sigma [#mum]", fgkResYsegmName[fSegmentLevel]));
+  MakeSummaryPlot((TObjArray*)  ((TObjArray*)fGraphS->At(kTrack))->At(0), h2);
+  GetRange(h2, 1, range);
+  h2->GetZaxis()->SetRangeUser(range[0], range[1]);
+  h2->Draw("colz");
+  h2->SetContour(7);
+
+  p=cOut->cd(5); 
+  p->SetRightMargin(0.16);p->SetTopMargin(0.06);
+  h2=(TH2I*)h2->Clone(Form("h2SF_%d", ih2++));
+  h2->SetTitle(Form("Tracklet-Track R-Phi Systematics;tg(#phi);%s;Mean [#mum]", fgkResYsegmName[fSegmentLevel]));
+  MakeSummaryPlot((TObjArray*)  ((TObjArray*)fGraphM->At(kTrack))->At(0), h2);
+  GetRange(h2, 0, range);
+  h2->GetZaxis()->SetRangeUser(range[0], range[1]);
+  h2->Draw("colz");
+  h2->SetContour(7);
+
+  p=cOut->cd(6); 
+  p->SetRightMargin(0.06);p->SetTopMargin(0.06);
+  xy[0]=-.5; xy[1]=-0.5; xy[2]=fgkNresYsegm[fSegmentLevel]-.5; xy[3]=2.5;
+  GetGraphArray(xy, kTrack, 1, 1);
 
-  cOut->cd(2); 
-  h2=(TH2I*)h2->Clone("h2SF"); h2->Reset(); h2->SetTitle(Form("Cluster R-Phi Systematics;tg(#phi);%s;Mean [#mum]", fgkResYsegmName[fSegmentLevel]));
-  h1=(TH1F*)h1->Clone("h1SF1"); h1->Reset();
-  //h2->GetZaxis()->SetRangeUser(-100., 100.);
-  a=(TObjArray*)  ((TObjArray*)fGraphM->At(kMCcluster))->At(0);
-  for(Int_t iseg(0); iseg<fgkNresYsegm[fSegmentLevel]; iseg++){
-    g=(TGraphErrors*)a->At(iseg);
-    for(Int_t in(0); in<g->GetN(); in++){
-      g->GetPoint(in, x, y);
-      h2->SetBinContent(ax->FindBin(x), iseg+1, y);
-      h1->Fill(y);
-    }
-  }
-  h1->Fit(&fg, "QN");
-  Double_t m(fg.GetParameter(1)), s(fg.GetParameter(2));
-  h2->GetZaxis()->SetRangeUser(m-2.5*s, m+2.5*s);
-  h2->Draw("col2z");
+  cOut->SaveAs(Form("%s.gif", cOut->GetName()));
 
-  cOut->cd(3); 
+  if(!HasMCdata()){
+    delete cOut;
+    return;
+  }
+  cOut->Clear(); cOut->SetName(Form("TRDsummary%s_%d", GetName(), iSumPlot++));
+  cOut->Divide(3, 2, 2.e-3, 2.e-3, kBlue-10);
+
+  p=cOut->cd(1);  
+  p->SetRightMargin(0.16);p->SetTopMargin(0.06);
+  h2=(TH2I*)h2->Clone(Form("h2SF_%d", ih2++));
+  h2->SetTitle(Form("Cluster-MC R-Phi Resolution;tg(#phi);%s;Sigma [#mum]", fgkResYsegmName[fSegmentLevel]));
+  MakeSummaryPlot((TObjArray*)  ((TObjArray*)fGraphS->At(kMCcluster))->At(0), h2);
+  GetRange(h2, 1, range);
+  h2->GetZaxis()->SetRangeUser(range[0], range[1]);
+  h2->Draw("colz");
+  h2->SetContour(7);
+
+  p=cOut->cd(2);  
+  p->SetRightMargin(0.16);p->SetTopMargin(0.06);
+  h2=(TH2I*)h2->Clone(Form("h2SF_%d", ih2++));
+  h2->SetContour(7);
+  h2->SetTitle(Form("Cluster-MC R-Phi Systematics;tg(#phi);%s;Mean [#mum]", fgkResYsegmName[fSegmentLevel]));
+  MakeSummaryPlot((TObjArray*)  ((TObjArray*)fGraphM->At(kMCcluster))->At(0), h2);
+  GetRange(h2, 0, range);
+  h2->GetZaxis()->SetRangeUser(range[0], range[1]);
+  h2->Draw("colz");
+  h2->SetContour(7);
+
+  p=cOut->cd(3); 
+  p->SetRightMargin(0.06);p->SetTopMargin(0.06);
   xy[0]=-.5; xy[1]=-0.5; xy[2]=fgkNresYsegm[fSegmentLevel]-.5; xy[3]=2.5;
   GetGraphArray(xy, kMCcluster, 1, 1);
 
-  cOut->cd(4); 
-  h2=(TH2I*)h2->Clone("h2SF"); h2->Reset();
-  h2->SetTitle(Form("Tracklet R-Phi Resolution;tg(#phi);%s;Sigma [#mum]", fgkResYsegmName[fSegmentLevel]));
-  //h2->GetZaxis()->SetRangeUser(100., 500.);
-  h1=(TH1F*)h1->Clone("h1SF2"); h1->Reset();
-  a=(TObjArray*)  ((TObjArray*)fGraphS->At(kMCtracklet))->At(0);
-  for(Int_t iseg(0); iseg<fgkNresYsegm[fSegmentLevel]; iseg++){
-    g=(TGraphErrors*)a->At(iseg);
-    for(Int_t in(0); in<g->GetN(); in++){
-      g->GetPoint(in, x, y);
-      h2->SetBinContent(ax->FindBin(x), iseg+1, y);
-      h1->Fill(y);
-    }
+  p=cOut->cd(4); 
+  p->SetRightMargin(0.16);p->SetTopMargin(0.06);
+  h2=(TH2I*)h2->Clone(Form("h2SF_%d", ih2++));
+  h2->SetContour(7);
+  h2->SetTitle(Form("Tracklet-MC R-Phi Resolution;tg(#phi);%s;Sigma [#mum]", fgkResYsegmName[fSegmentLevel]));
+  MakeSummaryPlot((TObjArray*)  ((TObjArray*)fGraphS->At(kMCtracklet))->At(0), h2);
+  GetRange(h2, 1, range);
+  h2->GetZaxis()->SetRangeUser(range[0], range[1]);
+  h2->Draw("colz");
+  h2->SetContour(7);
+
+  p=cOut->cd(5); 
+  p->SetRightMargin(0.16);p->SetTopMargin(0.06);
+  h2=(TH2I*)h2->Clone(Form("h2SF_%d", ih2++));
+  h2->SetContour(7);
+  h2->SetTitle(Form("Tracklet-MC R-Phi Systematics;tg(#phi);%s;Mean [#mum]", fgkResYsegmName[fSegmentLevel]));
+  MakeSummaryPlot((TObjArray*)  ((TObjArray*)fGraphM->At(kMCtracklet))->At(0), h2);
+  GetRange(h2, 0, range);
+  h2->GetZaxis()->SetRangeUser(range[0], range[1]);
+  h2->Draw("colz");
+  h2->SetContour(7);
+
+  p=cOut->cd(6); 
+  p->SetRightMargin(0.06);p->SetTopMargin(0.06);
+  xy[0]=-.5; xy[1]=-0.5; xy[2]=fgkNresYsegm[fSegmentLevel]-.5; xy[3]=2.5;
+  GetGraphArray(xy, kMCtracklet, 1, 1);
+
+  cOut->SaveAs(Form("%s.gif", cOut->GetName()));
+  delete cOut;
+}
+
+//________________________________________________________
+void AliTRDresolution::GetRange(TH2 *h2, Char_t mod, Float_t *range)
+{
+// Returns the range of the bulk of data in histogram h2. Removes outliers. 
+// The "range" vector should be initialized with 2 elements
+// Option "mod" can be any of
+//   - 0 : gaussian like distribution 
+//   - 1 : tailed distribution 
+
+  Int_t nx(h2->GetNbinsX())
+      , ny(h2->GetNbinsY())
+      , n(nx*ny);
+  Double_t *data=new Double_t[n];
+  for(Int_t ix(1), in(0); ix<=nx; ix++){
+    for(Int_t iy(1); iy<=ny; iy++)
+      data[in++] = h2->GetBinContent(ix, iy);
+  }
+  Double_t mean, sigm;
+  AliMathBase::EvaluateUni(n, data, mean, sigm, Int_t(n*.8));
+
+  range[0]=mean-3.*sigm; range[1]=mean+3.*sigm;
+  if(mod==1) range[0]=TMath::Max(Float_t(1.e-3), range[0]); 
+  AliDebug(2, Form("h[%s] range0[%f %f]", h2->GetName(), range[0], range[1]));
+  TH1S h1("h1SF0", "", 100, range[0], range[1]);
+  h1.FillN(n,data,0);
+  delete [] data;
+  switch(mod){
+  case 0:// gaussian distribution  
+  {
+    TF1 fg("fg", "gaus", mean-3.*sigm, mean+3.*sigm);
+    h1.Fit(&fg, "QN");
+    mean=fg.GetParameter(1); sigm=fg.GetParameter(2);
+    range[0] = mean-2.5*sigm;range[1] = mean+2.5*sigm;
+    AliDebug(2, Form("     rangeG[%f %f]", range[0], range[1]));
+    break;
   }
-  jBinMin=1; jBinMax=h1->GetNbinsX();
-  for(Int_t ibin(h1->GetMaximumBin()); ibin--;){
-    if(h1->GetBinContent(ibin)==0){
-      jBinMin=ibin; break;
+  case 1:// tailed distribution  
+  {  
+    Int_t bmax(h1.GetMaximumBin());
+    Int_t jBinMin(1), jBinMax(100);
+    for(Int_t ibin(bmax); ibin--;){
+      if(h1.GetBinContent(ibin)==0){
+        jBinMin=ibin; break;
+      }
     }
-  }
-  for(Int_t ibin(h1->GetMaximumBin()); ibin++;){
-    if(h1->GetBinContent(ibin)==0){
-      jBinMax=ibin; break;
+    for(Int_t ibin(bmax); ibin++;){
+      if(h1.GetBinContent(ibin)==0){
+        jBinMax=ibin; break;
+      }
     }
+    range[0]=h1.GetBinCenter(jBinMin); range[1]=h1.GetBinCenter(jBinMax);
+    AliDebug(2, Form("     rangeT[%f %f]", range[0], range[1]));
+    break;
   }
-  h2->GetZaxis()->SetRangeUser(h1->GetBinCenter(jBinMin), h1->GetBinCenter(jBinMax));
-  h2->Draw("col2z");
+  }
+
+  return;
+}
 
-  cOut->cd(5); 
-  h2=(TH2I*)h2->Clone("h2SF"); h2->Reset(); h2->SetTitle(Form("Tracklet R-Phi Systematics;tg(#phi);%s;Mean [#mum]", fgkResYsegmName[fSegmentLevel]));
-  h1=(TH1F*)h1->Clone("h1SF3"); h1->Reset();
-  a=(TObjArray*)  ((TObjArray*)fGraphM->At(kMCtracklet))->At(0);
+//________________________________________________________
+void AliTRDresolution::MakeSummaryPlot(TObjArray *a, TH2 *h2)
+{
+  h2->Reset();  
+  Double_t x,y;
+  TGraphErrors *g(NULL); TAxis *ax(h2->GetXaxis());
   for(Int_t iseg(0); iseg<fgkNresYsegm[fSegmentLevel]; iseg++){
     g=(TGraphErrors*)a->At(iseg);
     for(Int_t in(0); in<g->GetN(); in++){
       g->GetPoint(in, x, y);
       h2->SetBinContent(ax->FindBin(x), iseg+1, y);
-      h1->Fill(y);
     }
   }
-  h1->Fit(&fg, "QN");
-  m=fg.GetParameter(1); s=fg.GetParameter(2);
-  h2->GetZaxis()->SetRangeUser(m-2.5*s, m+2.5*s);
-  h2->Draw("col2z");
-
-  cOut->cd(6); 
-  xy[0]=-.5; xy[1]=-0.5; xy[2]=fgkNresYsegm[fSegmentLevel]-.5; xy[3]=2.5;
-  GetGraphArray(xy, kMCtracklet, 1, 1);
-
-  cOut->SaveAs(Form("%s.gif", cOut->GetName()));
 }
 
+
 //________________________________________________________
 Char_t const *fgParticle[11]={
   " p bar", " K -", " #pi -", " #mu -", " e -",
@@ -2381,7 +2468,7 @@ Bool_t AliTRDresolution::Process(TH2 * const h2, TF1 *f, Float_t k, TGraphErrors
     Int_t abin(ibin*kINTEGRAL+1),bbin(abin+kINTEGRAL-1),mbin(abin+Int_t(kINTEGRAL/2));
     Double_t x = h2->GetXaxis()->GetBinCenter(mbin);
     TH1D *h = h2->ProjectionY(pn, abin, bbin);
-    if((n=(Int_t)h->GetEntries())<100){ 
+    if((n=(Int_t)h->GetEntries())<150){ 
       AliDebug(4, Form("  x[%f] range[%d %d] stat[%d] low statistics !", x, abin, bbin, n));
       continue;
     }
index e99b80c54b7701a887b5e2100689a26619f7f975..736d0d95756d4d9a47216af839dfef1523b8e36e 100644 (file)
@@ -104,6 +104,8 @@ private:
   TObjArray*  BuildMonitorContainerTracklet(const char* name, Bool_t expand=kFALSE);
   TObjArray*  BuildMonitorContainerTrack(const char* name);
   void    GetLandauMpvFwhm(TF1 * const f, Float_t &mpv, Float_t &xm, Float_t &xM);
+  void    GetRange(TH2 *h2, Char_t mod, Float_t *range);
+  void    MakeSummaryPlot(TObjArray *a, TH2 *h2);
   Bool_t  Process(TH2* const h2, TF1 *f, Float_t k, TGraphErrors **g);
   Bool_t  Process2D(ETRDresolutionPlot ip, Int_t idx=-1, TF1 *f=NULL,  Float_t scale=1., Int_t gidx=-1);
   Bool_t  Process2Darray(ETRDresolutionPlot ip, Int_t idx=-1, TF1 *f=NULL,  Float_t scale=1.);
index 9072161c931630bb01cec7ad106744f179d9a706..7a7f26a08086c9a3e20fb7032f5ab20efc7dd78a 100644 (file)
@@ -97,33 +97,33 @@ Bool_t AliTRDv0Monitor::GetRefFigure(Int_t /*ifig*/)
 }
 
 //________________________________________________________________________
-void AliTRDv0Monitor::UserCreateOutputObjects()
+TObjArray* AliTRDv0Monitor::Histos()
 {
   // Create histograms
   // Called once
 
+  if(fContainer) return fContainer;
 
-fContainer = new TObjArray(kNPlots);
-fContainer->SetName("V0Monitoring");
-
-
-const char *samplename[AliPID::kSPECIES] = {"electrons","muons","pions","kaons","protons"};
-const char *decayname[AliTRDv0Info::kNDecays] = {"gamma","K0s","Lambda","AntiLambda"};
-const char *detectorname[kNDets] = {"ITS","TPC","TOF"};
-
-fhQualityReductions = new TH1I(Form("fhQualityReductions"),Form("Number of tracks cut out by different quality cut steps"),11,-9,2);
-fContainer->Add(fhQualityReductions);
-
-for(Int_t ipart = 0;ipart < AliPID::kSPECIES; ipart++){
-  fhCutReductions[ipart] = new TH1I(Form("fhCutReductions_%s",samplename[ipart]),Form("Number of tracks cut out by different cut steps for %s",samplename[ipart]),19,-17,2);
-  fContainer->Add(fhCutReductions[ipart]);
-  for(Int_t idetector = 0; idetector < kNDets; idetector++){
-    fhDetPID[idetector][ipart] = new TH2F(Form("fhDetector_%s_%s",detectorname[idetector],samplename[ipart]),Form("%s Likelihood for %s vs. momentum",detectorname[idetector], samplename[ipart]),100,0.,10.,100, 0., 1.);
-
-    fContainer->Add(fhDetPID[idetector][ipart]);
-  }
-  fhComPID[ipart] = new TH2F(Form("fhComPID_%s",samplename[ipart]),Form("Combined TPC/TOF PID: Likelihood for %s",samplename[ipart]),100,0.,10.,100,0.,1.);
-
+  fContainer = new TObjArray(kNPlots);
+  fContainer->SetName("V0Monitoring");
+  
+  const char *samplename[AliPID::kSPECIES] = {"electrons","muons","pions","kaons","protons"};
+  const char *decayname[AliTRDv0Info::kNDecays] = {"gamma","K0s","Lambda","AntiLambda"};
+  const char *detectorname[kNDets] = {"ITS","TPC","TOF"};
+  
+  fhQualityReductions = new TH1I(Form("fhQualityReductions"),Form("Number of tracks cut out by different quality cut steps"),11,-9,2);
+  fContainer->Add(fhQualityReductions);
+  
+  for(Int_t ipart = 0;ipart < AliPID::kSPECIES; ipart++){
+    fhCutReductions[ipart] = new TH1I(Form("fhCutReductions_%s",samplename[ipart]),Form("Number of tracks cut out by different cut steps for %s",samplename[ipart]),19,-17,2);
+    fContainer->Add(fhCutReductions[ipart]);
+    for(Int_t idetector = 0; idetector < kNDets; idetector++){
+      fhDetPID[idetector][ipart] = new TH2F(Form("fhDetector_%s_%s",detectorname[idetector],samplename[ipart]),Form("%s Likelihood for %s vs. momentum",detectorname[idetector], samplename[ipart]),100,0.,10.,100, 0., 1.);
+  
+      fContainer->Add(fhDetPID[idetector][ipart]);
+    }
+    fhComPID[ipart] = new TH2F(Form("fhComPID_%s",samplename[ipart]),Form("Combined TPC/TOF PID: Likelihood for %s",samplename[ipart]),100,0.,10.,100,0.,1.);
+  
     fContainer->Add(fhComPID[ipart]);
 
     for(Int_t cutstep = 0; cutstep < kNCutSteps; cutstep++){
@@ -131,39 +131,38 @@ for(Int_t ipart = 0;ipart < AliPID::kSPECIES; ipart++){
       
       fContainer->Add(fhTPCdEdx[ipart][cutstep]);
     }
-}
-
-for(Int_t iDecay = 0; iDecay < AliTRDv0Info::kNDecays; iDecay++){   
-  for(Int_t cutstep =0; cutstep < kNCutSteps; cutstep++){
-    fhV0Chi2ndf[iDecay][cutstep] =  new TH2F(Form("fhV0Chi2ndf_%s_[%d]",decayname[iDecay],cutstep),Form("Chi2/NDF vs. momentum"),100,0.,10.,500, 0., 500.);
-    
-    fContainer->Add(fhV0Chi2ndf[iDecay][cutstep]);
-    
-    fhPsiPair[iDecay][cutstep] =  new TH2F(Form("fhV0PsiPair_%s_[%d]",decayname[iDecay],cutstep),Form("Psi_pair vs. momentum"),100,0.,10.,200, 0., 1.6);
-    
-    fContainer->Add(fhPsiPair[iDecay][cutstep]);
-
-    fhPointAngle[iDecay][cutstep] =  new TH2F(Form("fhPointAngle_%s_[%d]",decayname[iDecay],cutstep),Form("Pointing Angle vs. momentum"),100,0.,10.,500, 0., 1.6);     
-    fContainer->Add(fhPointAngle[iDecay][cutstep]);
-
-    fhDCA[iDecay][cutstep] =  new TH2F(Form("fhDCA_%s_[%d]",decayname[iDecay],cutstep),Form("V0 Daughter DCA vs. momentum"),100,0.,10.,500, 0., 1.);
-    
-    fContainer->Add(fhDCA[iDecay][cutstep]);
-
-    fhOpenAngle[iDecay][cutstep] =  new TH2F(Form("fhOpenAngle_%s_[%d]",decayname[iDecay],cutstep),Form("Opening Angle vs. momentum"),100,0.,10.,500, 0., 1.6);
-    
-    fContainer->Add(fhOpenAngle[iDecay][cutstep]);
-
-    fhRadius[iDecay][cutstep] =  new TH2F(Form("fhRadius_%s_[%d]",decayname[iDecay],cutstep),Form("V0 Generation Radius vs. momentum"),100,0.,10.,500, 0., 150.);
-    
-    fContainer->Add(fhRadius[iDecay][cutstep]);
   }
-
-  fhInvMass[iDecay] =  new TH2F(Form("fhInvMass_%s",decayname[iDecay]),Form("Invariant Mass vs. momentum"),100,0.,10.,500, 0., 2.);
-    
-  fContainer->Add(fhInvMass[iDecay]); 
-
-} 
+  
+  for(Int_t iDecay = 0; iDecay < AliTRDv0Info::kNDecays; iDecay++){   
+    for(Int_t cutstep =0; cutstep < kNCutSteps; cutstep++){
+      fhV0Chi2ndf[iDecay][cutstep] =  new TH2F(Form("fhV0Chi2ndf_%s_[%d]",decayname[iDecay],cutstep),Form("Chi2/NDF vs. momentum"),100,0.,10.,500, 0., 500.);
+      
+      fContainer->Add(fhV0Chi2ndf[iDecay][cutstep]);
+      
+      fhPsiPair[iDecay][cutstep] =  new TH2F(Form("fhV0PsiPair_%s_[%d]",decayname[iDecay],cutstep),Form("Psi_pair vs. momentum"),100,0.,10.,200, 0., 1.6);
+      
+      fContainer->Add(fhPsiPair[iDecay][cutstep]);
+  
+      fhPointAngle[iDecay][cutstep] =  new TH2F(Form("fhPointAngle_%s_[%d]",decayname[iDecay],cutstep),Form("Pointing Angle vs. momentum"),100,0.,10.,500, 0., 1.6);     
+      fContainer->Add(fhPointAngle[iDecay][cutstep]);
+  
+      fhDCA[iDecay][cutstep] =  new TH2F(Form("fhDCA_%s_[%d]",decayname[iDecay],cutstep),Form("V0 Daughter DCA vs. momentum"),100,0.,10.,500, 0., 1.);
+      
+      fContainer->Add(fhDCA[iDecay][cutstep]);
+  
+      fhOpenAngle[iDecay][cutstep] =  new TH2F(Form("fhOpenAngle_%s_[%d]",decayname[iDecay],cutstep),Form("Opening Angle vs. momentum"),100,0.,10.,500, 0., 1.6);
+      
+      fContainer->Add(fhOpenAngle[iDecay][cutstep]);
+  
+      fhRadius[iDecay][cutstep] =  new TH2F(Form("fhRadius_%s_[%d]",decayname[iDecay],cutstep),Form("V0 Generation Radius vs. momentum"),100,0.,10.,500, 0., 150.);
+      
+      fContainer->Add(fhRadius[iDecay][cutstep]);
+    }
+  
+    fhInvMass[iDecay] =  new TH2F(Form("fhInvMass_%s",decayname[iDecay]),Form("Invariant Mass vs. momentum"),100,0.,10.,500, 0., 2.);
+      
+    fContainer->Add(fhInvMass[iDecay]); 
+  } 
 
 /*TH1F *hV0mcPID[AliPID::kSPECIES][AliPID::kSPECIES];
   Int_t nPBins = 200;
@@ -176,7 +175,11 @@ for(Int_t iDecay = 0; iDecay < AliTRDv0Info::kNDecays; iDecay++){
   fhV0mcPID[iSample][iSpecies] = new TH1F(Form("fhV0mcPID_%s_is_%s",name[iSample],name[iSpecies]),Form("%s contained in %s sample",name[iSpecies],name[iSample]), nPBins, 0.2, 13.);
   }
   }*/
+
+  return fContainer;
 }
+
+
 //________________________________________________________________________
 void AliTRDv0Monitor::UserExec(Option_t *) 
 {
@@ -203,71 +206,68 @@ void AliTRDv0Monitor::UserExec(Option_t *)
       
       fhQualityReductions->Fill(v0->fQuality);//fills integer codes for tracks cut out by track/V0 quality cuts
       
-      if(!(v0->fQuality == 1))continue;
+      if(!(v0->fQuality == 1)) continue;
 
       for(Int_t part = 0; part < AliPID::kSPECIES; part++){
-  fhCutReductions[part]->Fill(v0->GetPID(part,track));//fill in numbers of tracks eliminated by different PID cuts
+        fhCutReductions[part]->Fill(v0->GetPID(part,track));//fill in numbers of tracks eliminated by different PID cuts
       }
 
     
       for(Int_t idecay(0), part(-1); idecay <  AliTRDv0Info::kNDecays; idecay++){//loop over decay types considered for reference data
-  
-  if(idecay ==  AliTRDv0Info::kLambda){ //protons and pions from Lambda
-    part = AliPID::kProton;
-  } else if(idecay == AliTRDv0Info::kAntiLambda) { //antiprotons and pions from Anti-Lambda     
-    part = AliPID::kProton;
-  } else if(idecay ==   AliTRDv0Info::kK0s) {//pions from K0s
-    part = AliPID::kPion;
-  } else if(idecay ==  AliTRDv0Info::kGamma) {//electrons from conversions
-    part = AliPID::kElectron;
-  } 
-  
-  //fill histograms with track/V0 quality cuts only
-  fhPsiPair[idecay][0]->Fill(v0->fV0Momentum,v0->fPsiPair);//Angle between daughter momentum plane and plane perpendicular to magnetic field
-  fhInvMass[idecay]->Fill(v0->fV0Momentum,v0->fInvMass[idecay]);//Invariant mass
-  fhPointAngle[idecay][0]->Fill(v0->fV0Momentum,v0->fPointingAngle);// = TMath::ACos(esdv0->GetV0CosineOfPointingAngle()); // Cosine of pointing angle
-  fhOpenAngle[idecay][0]->Fill(v0->fV0Momentum,v0->fOpenAngle);// opening angle between daughters
-  fhDCA[idecay][0]->Fill(v0->fV0Momentum,v0->fDCA);// Distance of closest approach of daughter tracks  
-  fhV0Chi2ndf[idecay][0]->Fill(v0->fV0Momentum,v0->fChi2ndf[idecay]);//Kalman Filter Chi2/NDF
-  fhRadius[idecay][0]->Fill(v0->fV0Momentum,v0->fRadius);//distance of decay/conversion from primary vertex in x-y plane
-
-  if(v0->HasTrack(track) == -1){         
-    fhTPCdEdx[part][0]->Fill(v0->fTrackN->P(),v0->fTPCdEdx[AliTRDv0Info::kNeg]);//TPC dE/dx for negative track
-  } else if(v0->HasTrack(track) == 1){
-    fhTPCdEdx[part][0]->Fill(v0->fTrackP->P(),v0->fTPCdEdx[AliTRDv0Info::kPos]);//TPC dE/dx for positive track
-  }
-
-  //fill histograms after invariant mass cuts
-  if((v0->fInvMass[idecay] < v0->fUpInvMass[idecay][0])&&(v0->fInvMass[idecay]> v0->fDownInvMass[idecay])){
-    fhV0Chi2ndf[idecay][1]->Fill(v0->fV0Momentum,v0->fChi2ndf[idecay]);
-    fhPsiPair[idecay][1]->Fill(v0->fV0Momentum,v0->fPsiPair);
-    fhPointAngle[idecay][1]->Fill(v0->fV0Momentum,v0->fPointingAngle);
-    fhOpenAngle[idecay][1]->Fill(v0->fV0Momentum,v0->fOpenAngle);
-    fhDCA[idecay][1]->Fill(v0->fV0Momentum,v0->fDCA);
-    fhRadius[idecay][1]->Fill(v0->fV0Momentum,v0->fRadius);
-    if(v0->HasTrack(track) == -1)
-      fhTPCdEdx[part][1]->Fill(v0->fTrackN->P(),v0->fTPCdEdx[AliTRDv0Info::kNeg]);
-    else if(v0->HasTrack(track) == 1)
-      fhTPCdEdx[part][1]->Fill(v0->fTrackP->P(),v0->fTPCdEdx[AliTRDv0Info::kPos]);
-
-  }
-
-  //fill histograms after all reference selection cuts
-  if(v0->GetPID(part,track)==1){
-    fhV0Chi2ndf[idecay][2]->Fill(v0->fV0Momentum,v0->fChi2ndf[idecay]);
-    fhPsiPair[idecay][2]->Fill(v0->fV0Momentum,v0->fPsiPair);
-    fhPointAngle[idecay][2]->Fill(v0->fV0Momentum,v0->fPointingAngle);
-    fhOpenAngle[idecay][2]->Fill(v0->fV0Momentum,v0->fOpenAngle);
-    fhDCA[idecay][2]->Fill(v0->fV0Momentum,v0->fDCA);
-    fhRadius[idecay][2]->Fill(v0->fV0Momentum,v0->fRadius);
-    if(v0->HasTrack(track) == -1)
-      fhTPCdEdx[part][2]->Fill(v0->fTrackN->P(),v0->fTPCdEdx[AliTRDv0Info::kNeg]);
-    else if(v0->HasTrack(track) == 1)
-      fhTPCdEdx[part][2]->Fill(v0->fTrackP->P(),v0->fTPCdEdx[AliTRDv0Info::kPos]);
-
-  }
+        if(idecay ==  AliTRDv0Info::kLambda){ //protons and pions from Lambda
+          part = AliPID::kProton;
+        } else if(idecay == AliTRDv0Info::kAntiLambda) { //antiprotons and pions from Anti-Lambda     
+          part = AliPID::kProton;
+        } else if(idecay ==   AliTRDv0Info::kK0s) {//pions from K0s
+          part = AliPID::kPion;
+        } else if(idecay ==  AliTRDv0Info::kGamma) {//electrons from conversions
+          part = AliPID::kElectron;
+        } 
+        
+        //fill histograms with track/V0 quality cuts only
+        fhPsiPair[idecay][0]->Fill(v0->fV0Momentum,v0->fPsiPair);//Angle between daughter momentum plane and plane perpendicular to magnetic field
+        fhInvMass[idecay]->Fill(v0->fV0Momentum,v0->fInvMass[idecay]);//Invariant mass
+        fhPointAngle[idecay][0]->Fill(v0->fV0Momentum,v0->fPointingAngle);// = TMath::ACos(esdv0->GetV0CosineOfPointingAngle()); // Cosine of pointing angle
+        fhOpenAngle[idecay][0]->Fill(v0->fV0Momentum,v0->fOpenAngle);// opening angle between daughters
+        fhDCA[idecay][0]->Fill(v0->fV0Momentum,v0->fDCA);// Distance of closest approach of daughter tracks    
+        fhV0Chi2ndf[idecay][0]->Fill(v0->fV0Momentum,v0->fChi2ndf[idecay]);//Kalman Filter Chi2/NDF
+        fhRadius[idecay][0]->Fill(v0->fV0Momentum,v0->fRadius);//distance of decay/conversion from primary vertex in x-y plane
+      
+        if(v0->HasTrack(track) == -1){   
+          fhTPCdEdx[part][0]->Fill(v0->fTrackN->P(),v0->fTPCdEdx[AliTRDv0Info::kNeg]);//TPC dE/dx for negative track
+        } else if(v0->HasTrack(track) == 1){
+          fhTPCdEdx[part][0]->Fill(v0->fTrackP->P(),v0->fTPCdEdx[AliTRDv0Info::kPos]);//TPC dE/dx for positive track
+        }
+      
+        //fill histograms after invariant mass cuts
+        if((v0->fInvMass[idecay] < v0->fUpInvMass[idecay][0])&&(v0->fInvMass[idecay]> v0->fDownInvMass[idecay])){
+          fhV0Chi2ndf[idecay][1]->Fill(v0->fV0Momentum,v0->fChi2ndf[idecay]);
+          fhPsiPair[idecay][1]->Fill(v0->fV0Momentum,v0->fPsiPair);
+          fhPointAngle[idecay][1]->Fill(v0->fV0Momentum,v0->fPointingAngle);
+          fhOpenAngle[idecay][1]->Fill(v0->fV0Momentum,v0->fOpenAngle);
+          fhDCA[idecay][1]->Fill(v0->fV0Momentum,v0->fDCA);
+          fhRadius[idecay][1]->Fill(v0->fV0Momentum,v0->fRadius);
+          if(v0->HasTrack(track) == -1)
+            fhTPCdEdx[part][1]->Fill(v0->fTrackN->P(),v0->fTPCdEdx[AliTRDv0Info::kNeg]);
+          else if(v0->HasTrack(track) == 1)
+            fhTPCdEdx[part][1]->Fill(v0->fTrackP->P(),v0->fTPCdEdx[AliTRDv0Info::kPos]);
+      
+        }
+
+        //fill histograms after all reference selection cuts
+        if(v0->GetPID(part,track)==1){
+          fhV0Chi2ndf[idecay][2]->Fill(v0->fV0Momentum,v0->fChi2ndf[idecay]);
+          fhPsiPair[idecay][2]->Fill(v0->fV0Momentum,v0->fPsiPair);
+          fhPointAngle[idecay][2]->Fill(v0->fV0Momentum,v0->fPointingAngle);
+          fhOpenAngle[idecay][2]->Fill(v0->fV0Momentum,v0->fOpenAngle);
+          fhDCA[idecay][2]->Fill(v0->fV0Momentum,v0->fDCA);
+          fhRadius[idecay][2]->Fill(v0->fV0Momentum,v0->fRadius);
+          if(v0->HasTrack(track) == -1)
+            fhTPCdEdx[part][2]->Fill(v0->fTrackN->P(),v0->fTPCdEdx[AliTRDv0Info::kNeg]);
+          else if(v0->HasTrack(track) == 1)
+            fhTPCdEdx[part][2]->Fill(v0->fTrackP->P(),v0->fTPCdEdx[AliTRDv0Info::kPos]);
+        }
       }
     }
   }
-  PostData(1, fContainer);
 }
index 634fa4552abb1d3202bd9befdcff00e9deba6dc7..0e2cda1c9fbbc83e7de8bc18f6670513910b8b4d 100644 (file)
@@ -40,10 +40,10 @@ public:
   AliTRDv0Monitor(const char *name, const char *title);
   virtual ~AliTRDv0Monitor(){};
 
-  Bool_t  GetRefFigure(Int_t ifig); 
-  void    UserCreateOutputObjects();
-  void    UserExec(Option_t *option);
-  void    MakeSummary();
+  Bool_t      GetRefFigure(Int_t ifig); 
+  TObjArray*  Histos();
+  void        UserExec(Option_t *option);
+  void        MakeSummary();
 
 private:
   AliTRDv0Monitor(const AliTRDv0Monitor&);              // not implemented