Changes from Davide
authoragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 11 Apr 2011 08:40:09 +0000 (08:40 +0000)
committeragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 11 Apr 2011 08:40:09 +0000 (08:40 +0000)
PWG1/HMPID/AliHMPIDTaskQA.cxx
PWG1/HMPID/AliHMPIDTaskQA.h

index ab27bac..f76b212 100644 (file)
@@ -43,7 +43,7 @@ AliHMPIDTaskQA::AliHMPIDTaskQA() :
   fESD(0x0),fMC(0x0),fUseMC(kTRUE),
   fHmpHistList(0x0),
   fHmpPesdPhmp(0x0),fHmpCkovPesd(0x0),fHmpCkovPhmp(0x0),
-  fHmpMipTrkDistX(0x0),fHmpMipCharge3cm(0x0),
+  fHmpMipCharge3cm(0x0),fHmpMipTrkDist(0x0),
   fHmpTrkFlags(0x0),
   fN1(6),
   fN2(8),
@@ -63,8 +63,14 @@ AliHMPIDTaskQA::AliHMPIDTaskQA() :
   //
   //Default ctor
   //
-  for (Int_t i=0; i<7; i++)
+  for (Int_t i=0; i<7; i++){
+    fHmpPhotons[i]    = 0x0;
+    fHmpPhotP[i]      = 0x0;
+    fHmpPhotSin2th[i] = 0x0;
+    fHmpMipTrkDistPosX[i] = fHmpMipTrkDistNegX[i] = 0x0;
     fHmpMipTrkDistPosY[i] = fHmpMipTrkDistNegY[i] = 0x0;
+    fHmpMipCharge[i] = 0x0;
+  }
 }
 
 //___________________________________________________________________________
@@ -73,7 +79,7 @@ AliHMPIDTaskQA::AliHMPIDTaskQA(const Char_t* name) :
   fESD(0x0), fMC(0x0), fUseMC(kTRUE),
   fHmpHistList(0x0),
   fHmpPesdPhmp(0x0),fHmpCkovPesd(0x0),fHmpCkovPhmp(0x0),
-  fHmpMipTrkDistX(0x0),fHmpMipCharge3cm(0x0),
+  fHmpMipCharge3cm(0x0),fHmpMipTrkDist(0x0),
   fHmpTrkFlags(0x0),
   fN1(6),
   fN2(8),
@@ -93,8 +99,14 @@ AliHMPIDTaskQA::AliHMPIDTaskQA(const Char_t* name) :
   //
   // Constructor. Initialization of Inputs and Outputs
   //
-  for (Int_t i=0; i<7; i++)
+  for (Int_t i=0; i<7; i++){
+    fHmpPhotons[i] = 0x0;
+    fHmpPhotP[i]   = 0x0;
+    fHmpPhotSin2th[i] = 0x0;
+    fHmpMipTrkDistPosX[i] = fHmpMipTrkDistNegX[i] = 0x0;
     fHmpMipTrkDistPosY[i] = fHmpMipTrkDistNegY[i] = 0x0;
+    fHmpMipCharge[i] = 0x0;
+  }
 
   DefineOutput(1,TList::Class());
 }
@@ -114,8 +126,8 @@ AliHMPIDTaskQA& AliHMPIDTaskQA::operator=(const AliHMPIDTaskQA& c)
     fHmpPesdPhmp     = c.fHmpPesdPhmp;
     fHmpCkovPesd     = c.fHmpCkovPesd;
     fHmpCkovPhmp     = c.fHmpCkovPhmp;
-    fHmpMipTrkDistX  = c.fHmpMipTrkDistX;
     fHmpMipCharge3cm = c.fHmpMipCharge3cm;
+    fHmpMipTrkDist   = c.fHmpMipTrkDist;
     fHmpTrkFlags     = c.fHmpTrkFlags;
     fN1              = c.fN1;
     fN2              = c.fN2;
@@ -132,8 +144,14 @@ AliHMPIDTaskQA& AliHMPIDTaskQA::operator=(const AliHMPIDTaskQA& c)
     fKaonCon         = c.fKaonCon;
     fProtCon         = c.fProtCon;
     for (Int_t i=0; i<7; i++){
+      fHmpPhotons[i] = c.fHmpPhotons[i];
+      fHmpPhotP[i]   = c.fHmpPhotP[i];
+      fHmpPhotSin2th[i] = c.fHmpPhotSin2th[i];
+      fHmpMipTrkDistPosX[i] = c.fHmpMipTrkDistPosX[i];
+      fHmpMipTrkDistNegX[i] = c.fHmpMipTrkDistNegX[i];
       fHmpMipTrkDistPosY[i] = c.fHmpMipTrkDistPosY[i];
       fHmpMipTrkDistNegY[i] = c.fHmpMipTrkDistNegY[i];
+      fHmpMipCharge[i] = c.fHmpMipCharge[i];
     }
   }
   return *this;
@@ -145,8 +163,7 @@ AliHMPIDTaskQA::AliHMPIDTaskQA(const AliHMPIDTaskQA& c) :
   fESD(c.fESD),fMC(c.fMC),fUseMC(c.fUseMC),
   fHmpHistList(c.fHmpHistList),
   fHmpPesdPhmp(c.fHmpPesdPhmp),fHmpCkovPesd(c.fHmpCkovPesd),fHmpCkovPhmp(c.fHmpCkovPhmp),
-  fHmpMipTrkDistX(c.fHmpMipTrkDistX),
-  fHmpMipCharge3cm(c.fHmpMipCharge3cm),
+  fHmpMipCharge3cm(c.fHmpMipCharge3cm),fHmpMipTrkDist(c.fHmpMipTrkDist),
   fHmpTrkFlags(c.fHmpTrkFlags),
   fN1(c.fN1),
   fN2(c.fN2),
@@ -167,8 +184,14 @@ AliHMPIDTaskQA::AliHMPIDTaskQA(const AliHMPIDTaskQA& c) :
   // Copy Constructor
   //
   for (Int_t i=0; i<7; i++){
+    fHmpPhotons[i] = c.fHmpPhotons[i];
+    fHmpPhotP[i]   = c.fHmpPhotP[i];
+    fHmpPhotSin2th[i] = c.fHmpPhotSin2th[i];
+    fHmpMipTrkDistPosX[i] = c.fHmpMipTrkDistPosX[i];
+    fHmpMipTrkDistNegX[i] = c.fHmpMipTrkDistNegX[i];
     fHmpMipTrkDistPosY[i] = c.fHmpMipTrkDistPosY[i];
     fHmpMipTrkDistNegY[i] = c.fHmpMipTrkDistNegY[i];
+    fHmpMipCharge[i] = c.fHmpMipCharge[i];
   }
 }
  
@@ -231,15 +254,16 @@ void AliHMPIDTaskQA::UserExec(Option_t *)
     track->GetInnerXYZ(rin);
     track->GetOuterXYZ(rout);
     Double_t ktol = 0.001;
+    Double_t thetaCh = track->GetHMPIDsignal();
 
-    if(Equal(track->GetHMPIDsignal(),-20.,ktol))      fHmpTrkFlags->Fill(0);
-    else if(Equal(track->GetHMPIDsignal(),-9.,ktol))  fHmpTrkFlags->Fill(1);
-    else if(Equal(track->GetHMPIDsignal(),-5.,ktol))  fHmpTrkFlags->Fill(2);
-    else if(Equal(track->GetHMPIDsignal(),-11.,ktol)) fHmpTrkFlags->Fill(3);
-    else if(Equal(track->GetHMPIDsignal(),-22.,ktol)) fHmpTrkFlags->Fill(4);
+    if(Equal(thetaCh,-20.,ktol))      fHmpTrkFlags->Fill(0);
+    else if(Equal(thetaCh,-9.,ktol))  fHmpTrkFlags->Fill(1);
+    else if(Equal(thetaCh,-5.,ktol))  fHmpTrkFlags->Fill(2);
+    else if(Equal(thetaCh,-11.,ktol)) fHmpTrkFlags->Fill(3);
+    else if(Equal(thetaCh,-22.,ktol)) fHmpTrkFlags->Fill(4);
     else fHmpTrkFlags->Fill(4);
 
-    if(Equal(track->GetHMPIDsignal(),-20.,ktol)) continue;
+    if(Equal(thetaCh,-20.,ktol)) continue;
     if(track->GetHMPIDcluIdx() < 0) continue;
 
     Int_t q, nph;
@@ -252,13 +276,12 @@ void AliHMPIDTaskQA::UserExec(Option_t *)
 
     Float_t sign = track->GetSign();
     Int_t ch = track->GetHMPIDcluIdx()/1000000;
-    Double_t dist = TMath::Sqrt( (xpc-x)*(xpc-x) + (ypc - y)*(ypc - y));
-    fHmpMipTrkDistX->Fill(xpc - x);
-    if (sign > 0.) fHmpMipTrkDistPosY[ch]->Fill(ypc - y);
-    if (sign < 0.) fHmpMipTrkDistNegY[ch]->Fill(ypc - y);
-    Double_t pHmp[3] = {0}, pHmp3 = 0;
-    if (track->GetOuterHmpPxPyPz(pHmp)) pHmp3 = TMath::Sqrt(pHmp[0]*pHmp[0]+pHmp[1]*pHmp[1]+pHmp[2]*pHmp[2]);
+    if (sign > 0.) fHmpMipTrkDistPosX[ch]->Fill(xpc - x), fHmpMipTrkDistPosY[ch]->Fill(ypc - y);
+    if (sign < 0.) fHmpMipTrkDistNegX[ch]->Fill(xpc - x), fHmpMipTrkDistNegY[ch]->Fill(ypc - y);
+    fHmpMipCharge[ch]->Fill(q);
+    Double_t dist = TMath::Sqrt((xpc - x)*(xpc - x) + (ypc - y)*(ypc - y));
     if (dist <= 3.0) fHmpMipCharge3cm->Fill(q);
+    fHmpMipTrkDist->Fill(dist);
 
     track->GetHMPIDpid(probs);
     pPid->SetProbabilities(probs);
@@ -267,10 +290,16 @@ void AliHMPIDTaskQA::UserExec(Option_t *)
       pPart = pStack->Particle(label);
     }
 
-    if(track->GetHMPIDsignal() > 0 ){
+    if(thetaCh > 0 ){
+      Double_t pHmp[3] = {0}, pHmp3 = 0;
+      if (track->GetOuterHmpPxPyPz(pHmp)) pHmp3 = TMath::Sqrt(pHmp[0]*pHmp[0]+pHmp[1]*pHmp[1]+pHmp[2]*pHmp[2]);
       if (pHmp3) fHmpPesdPhmp->Fill(track->P(),pHmp3);
-      fHmpCkovPesd->Fill(track->P(),track->GetHMPIDsignal());
-      if (pHmp3) fHmpCkovPhmp->Fill(pHmp3,track->GetHMPIDsignal());
+      fHmpCkovPesd->Fill(track->P(),thetaCh);
+      if (pHmp3) fHmpCkovPhmp->Fill(pHmp3,thetaCh);
+      fHmpPhotons[ch]->Fill(nph);
+      fHmpPhotP[ch]->Fill(pHmp3,nph);
+      Double_t sin2 = TMath::Power(TMath::Sin(th),2);
+      fHmpPhotSin2th[ch]->Fill(sin2,nph);
 
       if (fUseMC && dist<0.5 && TMath::Abs(th)<0.13){
         if (!pStack->IsPhysicalPrimary(label)) continue;
@@ -347,20 +376,42 @@ void AliHMPIDTaskQA::UserCreateOutputObjects() {
    fHmpCkovPhmp = new TH2F("fHmpCkovPhmp","HMPID: ThetaCherenkov vs P;p_hmp (GeV/c);#Theta_C;Entries",100,0,10,110,0,1.1);
    fHmpHistList->Add(fHmpCkovPhmp);
 
-   fHmpMipTrkDistX = new TH1F("fHmpMipTrkDistX","HMPID MIP-Track distance in local X;distance (cm);Entries",800,-20,20);
-   fHmpHistList->Add(fHmpMipTrkDistX);
-
    for (Int_t i=0; i<7; i++){
-     TString title=Form("MIP-Track distance in local Y, Chamber %d;distance (cm);Entries",i);
+     TString title=Form("MIP-Track distance in local X, Chamber %d;distance (cm);Entries",i);
+     fHmpMipTrkDistPosX[i] = new TH1F(Form("fHmpMipTrkDistPosX%d",i),title.Data(),800,-20,20);
+     fHmpHistList->Add(fHmpMipTrkDistPosX[i]);
+     fHmpMipTrkDistNegX[i] = new TH1F(Form("fHmpMipTrkDistNegX%d",i),title.Data(),800,-20,20);
+     fHmpHistList->Add(fHmpMipTrkDistNegX[i]);
+
+     title=Form("MIP-Track distance in local Y, Chamber %d;distance (cm);Entries",i);
      fHmpMipTrkDistPosY[i] = new TH1F(Form("fHmpMipTrkDistPosY%d",i),title.Data(),800,-20,20);
      fHmpHistList->Add(fHmpMipTrkDistPosY[i]);
      fHmpMipTrkDistNegY[i] = new TH1F(Form("fHmpMipTrkDistNegY%d",i),title.Data(),800,-20,20);
      fHmpHistList->Add(fHmpMipTrkDistNegY[i]);
+
+     title=Form("Mip charge distribution, Chamber %d;Charge;Entries",i);
+     fHmpMipCharge[i] = new TH1F(Form("fHmpMipCharge%d",i),title.Data(),5001,-0.5,5000.5);
+     fHmpHistList->Add(fHmpMipCharge[i]);
+
+     title=Form("Photons, Chamber %d;N of Photons;Entries",i);
+     fHmpPhotons[i] = new TH1F(Form("fHmpPhotons%d",i),title.Data(),100,0,100);
+     fHmpHistList->Add(fHmpPhotons[i]);
+
+     title=Form("Photons versus HMP momentum, Chamber %d;P (GeV);N of Photons",i);
+     fHmpPhotP[i] = new TH2F(Form("fHmpPhotP%d",i),title.Data(),200,0.,20.,100,0,100);
+     fHmpHistList->Add(fHmpPhotP[i]);
+
+     title=Form("Photons versus sin(th)^2 (uncorrected), Chamber %d;P (GeV);N of Photons",i);
+     fHmpPhotSin2th[i] = new TH2F(Form("fHmpPhotSin2th%d",i),title.Data(),100,0.,1.,100,0,100);
+     fHmpHistList->Add(fHmpPhotSin2th[i]);
    }
 
    fHmpMipCharge3cm = new TH1F("fHmpMipCharge3cm","HMPID MIP Charge;MIP Charge (ADC);Entries",5001,-0.5,5000.5);
    fHmpHistList->Add(fHmpMipCharge3cm);
 
+   fHmpMipTrkDist = new TH1F("fHmpMipTrkDist","Mip-track distance in all the chambers",100,0.,10.);
+   fHmpHistList->Add(fHmpMipTrkDist);
+
    fHmpTrkFlags = new TH1F("fHmpTrkFlags","HMPID track flags",6,0,6);
    TString summary[6] =  {"NotPerformed","MipDistCut", "MipQdcCut", "NoPhotAccept", "kNoRad", "other"};
    for(Int_t ibin = 0; ibin < 6; ibin++) fHmpTrkFlags->GetXaxis()->SetBinLabel(ibin+1,Form("%i  %s",ibin+1,summary[ibin].Data()));
index 8635e00..a78f37d 100644 (file)
@@ -63,11 +63,17 @@ class AliHMPIDTaskQA : public AliAnalysisTaskSE {
   TH2F          *fHmpPesdPhmp;          // HMP momentum vs ESD momentum
   TH2F          *fHmpCkovPesd;          // Ckov angle vs ESD momentum
   TH2F          *fHmpCkovPhmp;          // Ckov angle vs HMP momenutm
-  TH1F          *fHmpMipTrkDistX;       // Xtrk - Xmip
-  TH1F          *fHmpMipTrkDistPosY[7]; // Ytrk - Ymip of positive tracks
-  TH1F          *fHmpMipTrkDistNegY[7]; // Ytrk - Ymip of negative tracks
   TH1F          *fHmpMipCharge3cm;      // Mip charge with 3 cm distance cut
+  TH1F          *fHmpMipTrkDist;        // Mip-track distance over-all
   TH1F          *fHmpTrkFlags;          // track flags
+  TH1F          *fHmpPhotons[7];        // Photons per ring
+  TH2F          *fHmpPhotP[7];          // Photons per ring vs momentum
+  TH2F          *fHmpPhotSin2th[7];     // Photons per ring vs sin(th)^2
+  TH1F          *fHmpMipTrkDistPosX[7]; // Xtrk - Xmip of positive tracks
+  TH1F          *fHmpMipTrkDistNegX[7]; // Xtrk - Xmip of negative tracks
+  TH1F          *fHmpMipTrkDistPosY[7]; // Ytrk - Ymip of positive tracks
+  TH1F          *fHmpMipTrkDistNegY[7]; // Ytrk - Ymip of negative tracks
+  TH1F          *fHmpMipCharge[7];      // Mip charge distribution
 
   Int_t          fN1;                   // number of points for pi and K
   Int_t          fN2;                   // number of point for p
@@ -84,7 +90,7 @@ class AliHMPIDTaskQA : public AliAnalysisTaskSE {
   TH1I          *fKaonCon;              // tracks identified as kaons
   TH1I          *fProtCon;              // tracks identified as protons
 
-  ClassDef(AliHMPIDTaskQA,1);
+  ClassDef(AliHMPIDTaskQA,2);
 };
 
 #endif