Test TOF to reject pile-up track (Raphaelle)
authorcblume <Christoph.Blume@cern.ch>
Mon, 7 Jul 2014 15:06:20 +0000 (17:06 +0200)
committercblume <Christoph.Blume@cern.ch>
Mon, 7 Jul 2014 15:06:46 +0000 (17:06 +0200)
TRD/AliTRDCalibTask.cxx
TRD/AliTRDCalibTask.h

index fe4e810..15b67dd 100644 (file)
@@ -115,6 +115,7 @@ AliTRDCalibTask::AliTRDCalibTask(const char *name)
   fNbTrackletsOffline(0),
   fNbTrackletsStandalone(0),
   fAbsoluteGain(0),
+  fTOFbc(0),
   fCH2dSum(0),
   fPH2dSum(0),
   fCH2dSM(0),
@@ -145,6 +146,7 @@ AliTRDCalibTask::AliTRDCalibTask(const char *name)
   fMinNbContributors(0),
   fRangePrimaryVertexZ(9999999.0),
   fRejectPileUpWithSPD(kFALSE),
+  fRejectPileUpWithTOF(kFALSE),
   fMinNbTracks(9),
   fMaxNbTracks(999999999),
   fCutWithVdriftCalib(kFALSE),
@@ -224,6 +226,7 @@ AliTRDCalibTask::~AliTRDCalibTask()
   if(fNbTrackletsOffline) delete fNbTrackletsOffline;
   if(fNbTrackletsStandalone) delete fNbTrackletsStandalone;
   if(fAbsoluteGain) delete fAbsoluteGain;
+  if(fTOFbc) delete fTOFbc;
   if(fCH2dSum) delete fCH2dSum;
   if(fPH2dSum) delete fPH2dSum;
   if(fCH2dSM) delete fCH2dSM;
@@ -364,6 +367,14 @@ void AliTRDCalibTask::UserCreateOutputObjects()
   fAbsoluteGain->SetStats(0);
   fAbsoluteGain->Sumw2();
   fListHist->Add(fAbsoluteGain);
+
+  fTOFbc = new TH2F(Form("TOFbc_%s",(const char*)fName),"TOFbc", 200, -150., 50., nBinsPt, binLimPt);
+  fTOFbc->SetYTitle("Momentum");
+  fTOFbc->SetXTitle("TOF bc");
+  fTOFbc->SetZTitle("counts");
+  fTOFbc->SetStats(0);
+  fTOFbc->Sumw2();
+  fListHist->Add(fTOFbc);
   
   if(IsPHQon()){
     printf("\n        AliTRDCalibTask PHQ is on!!     \n\n");
@@ -809,6 +820,13 @@ void AliTRDCalibTask::UserExec(Option_t *)
       //printf("Not a good track\n");
       continue;
     }
+    
+    Int_t nbcrossing = fkEsdTrack->GetTOFBunchCrossing();
+    fTOFbc->Fill(nbcrossing,fkEsdTrack->Pt());
+    // TOF pile-up rejection is asked
+    if(fRejectPileUpWithTOF) {
+      if(TMath::Abs(nbcrossing)>0.5) continue;
+    }
 
     // First Absolute gain calibration
     Int_t trdNTracklets = (Int_t) fkEsdTrack->GetTRDntracklets();
index 608446d..f5b3447 100644 (file)
@@ -79,6 +79,7 @@ class AliTRDCalibTask : public AliAnalysisTaskSE {
   void SetMinNbOfContributors(Int_t minNbOfContributors)               {fMinNbContributors = minNbOfContributors;};  
   void SetRangePrimaryVertexZ(Double_t rangePrimaryVertexZ)            {fRangePrimaryVertexZ = TMath::Abs(rangePrimaryVertexZ);}; 
   void SetRejectPileUpWithSPD(Bool_t rejectPileUpWithSPD)              {fRejectPileUpWithSPD = rejectPileUpWithSPD;};
+  void SetRejectPileUpWithTOF(Bool_t rejectPileUpWithTOF)              {fRejectPileUpWithTOF = rejectPileUpWithTOF;};
   void SetMinNbTracks(Int_t minNbTracks)                               {fMinNbTracks = minNbTracks;};
   void SetMaxNbTracks(Int_t maxNbTracks)                               {fMaxNbTracks = maxNbTracks;};
   void SetCutWithVdriftCalib(Bool_t cutWithVdriftCalib)                {fCutWithVdriftCalib = cutWithVdriftCalib;};
@@ -146,6 +147,7 @@ class AliTRDCalibTask : public AliAnalysisTaskSE {
   TH1F        *fNbTrackletsStandalone;           //! nb Tracklets standalone
   
   TH2F        *fAbsoluteGain;                    //! Absolute Gain without AliESDfriend
+  TH2F        *fTOFbc;                           //! Check TOF branch crossing
   TH2I        *fCH2dSum;                         //! CH2d charge all
   TProfile2D  *fPH2dSum;                         //! PH2d PH all
   TH2I        *fCH2dSM;                          //! CH2d per SM
@@ -183,6 +185,7 @@ class AliTRDCalibTask : public AliAnalysisTaskSE {
   Int_t       fMinNbContributors;                // Min number of contributors
   Double_t    fRangePrimaryVertexZ;              // Were the primary vertex is
   Bool_t      fRejectPileUpWithSPD;              // Reject pile-up events with SPD
+  Bool_t      fRejectPileUpWithTOF;              // Reject pile-up tracks with TOF
   Int_t       fMinNbTracks;                      // Min Nb Tracks
   Int_t       fMaxNbTracks;                      // Max Nb Tracks
   Bool_t      fCutWithVdriftCalib;               // CutWithVdriftCalib for the gain and PH
@@ -223,7 +226,7 @@ class AliTRDCalibTask : public AliAnalysisTaskSE {
   AliTRDCalibTask(const AliTRDCalibTask&); 
   AliTRDCalibTask& operator=(const AliTRDCalibTask&); 
 
-  ClassDef(AliTRDCalibTask, 5); 
+  ClassDef(AliTRDCalibTask, 6); 
 };
 
 #endif