Implemented ZDC time cut in phsyics selection and in trigger analysis for MC. Trackle...
authormfloris <mfloris@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 30 Nov 2010 15:36:27 +0000 (15:36 +0000)
committermfloris <mfloris@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 30 Nov 2010 15:36:27 +0000 (15:36 +0000)
ANALYSIS/AliPhysicsSelection.cxx
ANALYSIS/AliPhysicsSelection.h
ANALYSIS/AliTriggerAnalysis.cxx

index 3cb20cf..81537fb 100644 (file)
@@ -92,6 +92,8 @@
 // to be present:
 //   AddBGTriggerClass("+CSMBA-ABCE-NOPF-ALL -CSMBB-ABCE-NOPF-ALL");
 //
+// The class also supports the triggers used in heavy ion runs
+//
 //   Origin: Jan Fiete Grosse-Oetringhaus, CERN 
 //           Michele Floris, CERN
 //-------------------------------------------------------------------------
@@ -138,7 +140,8 @@ AliPhysicsSelection::AliPhysicsSelection() :
   fUseMuonTriggers(0),
   fFillingScheme(""),
   fBin0CallBack(""),
-  fBin0CallBackPointer(0)
+  fBin0CallBackPointer(0),
+  fIsPP(kFALSE)
 {
   // constructor
   
@@ -393,9 +396,9 @@ UInt_t AliPhysicsSelection::IsCollisionCandidate(const AliESDEvent* aEsd)
       // ZDC
       // Bool_t zdcA = triggerAnalysis->IsOfflineTriggerFired(aEsd, AliTriggerAnalysis::kZDCA);
       // Bool_t zdcC = triggerAnalysis->IsOfflineTriggerFired(aEsd, AliTriggerAnalysis::kZDCC);
-      Bool_t zdcA = triggerAnalysis->ZDCTDCTrigger(aEsd, AliTriggerAnalysis::kASide);
-      Bool_t zdcC = triggerAnalysis->ZDCTDCTrigger(aEsd, AliTriggerAnalysis::kCSide);
-      
+      Bool_t zdcA    = triggerAnalysis->ZDCTDCTrigger (aEsd, AliTriggerAnalysis::kASide);
+      Bool_t zdcC    = triggerAnalysis->ZDCTDCTrigger (aEsd, AliTriggerAnalysis::kCSide);
+      Bool_t zdcTime = triggerAnalysis->ZDCTimeTrigger(aEsd);
 
       // Some "macros"
       Bool_t mb1 = (fastOROffline > 0 || v0A || v0C) && (!v0BG);
@@ -488,14 +491,18 @@ UInt_t AliPhysicsSelection::IsCollisionCandidate(const AliESDEvent* aEsd)
          fHistStatistics[iHistStat]->Fill(kStatZDCC, i);
        if (zdcA && zdcC)
          fHistStatistics[iHistStat]->Fill(kStatZDCAC, i);
-        
+       // We reject the event if the ZDC timing cut is not respected
+       if (zdcTime)
+         fHistStatistics[iHistStat]->Fill(kStatZDCTime, i);
+        else if (!fIsPP) 
+         continue;
        //       if (fastOROffline > 1 && !v0BG)
        //         fHistStatistics[iHistStat]->Fill(kStatFO2NoBG, i);
             
        //if (fastOROffline > 0 && (v0A || v0C) && !v0BG)
        //  fHistStatistics[iHistStat]->Fill(kStatFO1AndV0, i);
   
-       if (v0A && v0C && !v0BG && !bgID)
+       if (v0A && v0C && !v0BG && (!bgID && fIsPP))
          fHistStatistics[iHistStat]->Fill(kStatV0, i);
 
         Bool_t offlineAccepted = kFALSE;
@@ -517,7 +524,7 @@ UInt_t AliPhysicsSelection::IsCollisionCandidate(const AliESDEvent* aEsd)
              {
                if (!v0BG) fHistStatistics[iHistStat]->Fill(kStatOffline, i);
       
-               if (fBackgroundIdentification && bgID)
+               if (fBackgroundIdentification && bgID && fIsPP)
                  {
                    AliDebug(AliLog::kDebug, "Rejecting event because of background identification");
                    fHistStatistics[iHistStat]->Fill(kStatBG, i);
@@ -763,11 +770,11 @@ Bool_t AliPhysicsSelection::Initialize(const AliESDEvent* aEsd)
   // initializes the object for the given ESD
   
   AliInfo(Form("Initializing for beam type: %s", aEsd->GetESDRun()->GetBeamType()));
-  Bool_t pp = kTRUE;
+  fIsPP = kTRUE;
   if (strcmp(aEsd->GetESDRun()->GetBeamType(), "Pb-Pb") == 0)
-    pp = kFALSE;
-  
-  return Initialize(aEsd->GetRunNumber(), pp);
+    fIsPP = kFALSE;
+
+  return Initialize(aEsd->GetRunNumber(), fIsPP);
 }
 
 Bool_t AliPhysicsSelection::Initialize(Int_t runNumber, Bool_t pp)
@@ -1039,6 +1046,7 @@ TH2F * AliPhysicsSelection::BookHistStatistics(const char * tag) {
   h->GetXaxis()->SetBinLabel(kStatZDCA,          "ZDCA");
   h->GetXaxis()->SetBinLabel(kStatZDCC,          "ZDCC");
   h->GetXaxis()->SetBinLabel(kStatZDCAC,         "ZDCA & ZDCC");
+  h->GetXaxis()->SetBinLabel(kStatZDCTime,       "ZDC Time Cut");
   h->GetXaxis()->SetBinLabel(kStatMB1,          "(FO >= 1 | V0A | V0C) & !V0 BG");
   h->GetXaxis()->SetBinLabel(kStatMB1Prime,      "(FO >= 2 | (FO >= 1 & (V0A | V0C)) | (V0A &v0C) ) & !V0 BG");
   //h->GetXaxis()->SetBinLabel(kStatFO1AndV0,   "FO >= 1 & (V0A | V0C) & !V0 BG");
index e180f6f..02dcf5a 100644 (file)
@@ -36,7 +36,7 @@ class AliPhysicsSelection : public AliAnalysisCuts
 public:
 
 public:
-  enum {kStatTriggerClass=1,kStatHWTrig,kStatV0ABG,kStatV0CBG,kStatMB1,kStatMB1Prime,kStatFMD,kStatFO1,kStatFO2,kStatFO2L1,kStatV0A,kStatV0C,kStatZDCA,kStatZDCC,kStatZDCAC,kStatV0,kStatOffline,kStatBG,kStatAccepted};
+  enum {kStatTriggerClass=1,kStatHWTrig,kStatV0ABG,kStatV0CBG,kStatMB1,kStatMB1Prime,kStatFMD,kStatFO1,kStatFO2,kStatFO2L1,kStatV0A,kStatV0C,kStatZDCA,kStatZDCC,kStatZDCAC,kStatZDCTime,kStatV0,kStatOffline,kStatBG,kStatAccepted};
 
 #ifdef VERBOSE_STAT
   enum {kStatRowBG=0,kStatRowAcc,kStatRowBGFrac,kStatRowAccFrac,kStatRowErrGoodFrac,kStatRowGoodFrac,kStatRowErrGood,kStatRowGood}; // offset wrt fBGStatOffset
@@ -131,7 +131,9 @@ protected:
   TString fBin0CallBack; // callback used to determine if an event is in the bin0 (name of the task where the callback is implemented);
   Bin0Callback_t fBin0CallBackPointer; //! don't stream this. TO BE REMOVED SOON
 
-  ClassDef(AliPhysicsSelection, 10)
+  Bool_t fIsPP; // True if processing pp run, false if heavy ion
+
+  ClassDef(AliPhysicsSelection, 11)
     
     private:
   AliPhysicsSelection(const AliPhysicsSelection&);
index 42f4a05..7e5b17c 100644 (file)
@@ -979,28 +979,44 @@ Bool_t AliTriggerAnalysis::ZDCTimeTrigger(const AliESDEvent *aEsd, Bool_t fillHi
   // It can be used in order to eliminate
   // parasitic collisions
   Bool_t zdcAccept = kFALSE;
-
   AliESDZDC *esdZDC = aEsd->GetESDZDC();
 
-  const Float_t refSum = -568.5;
-  const Float_t refDelta = -2.1;
-  const Float_t sigmaSum = 3.25;
-  const Float_t sigmaDelta = 2.25;
-  for(Int_t i = 0; i < 4; ++i) {
-    if (esdZDC->GetZDCTDCData(10,i) != 0) {
-      Float_t tdcC = 0.025*(esdZDC->GetZDCTDCData(10,i)-esdZDC->GetZDCTDCData(14,i)); 
-      for(Int_t j = 0; j < 4; ++j) {
-       if (esdZDC->GetZDCTDCData(12,j) != 0) {
-         Float_t tdcA = 0.025*(esdZDC->GetZDCTDCData(12,j)-esdZDC->GetZDCTDCData(14,j));
-         if(fillHists) fHistTimeZDC->Fill(tdcC-tdcA,tdcC+tdcA);
-         if (((tdcC-tdcA-refDelta)*(tdcC-tdcA-refDelta)/(sigmaDelta*sigmaDelta) +
-              (tdcC+tdcA-refSum)*(tdcC+tdcA-refSum)/(sigmaSum*sigmaSum))< 1.0)
-           zdcAccept = kTRUE;
+  if(fMC) {
+     UInt_t esdFlag =  esdZDC->GetESDQuality();
+
+     Bool_t znaFired=kFALSE, zpaFired=kFALSE;
+     Bool_t zem1Fired=kFALSE, zem2Fired=kFALSE;
+     Bool_t zncFired=kFALSE, zpcFired=kFALSE;
+     //
+     // **** Trigger patterns
+     if((esdFlag & 0x00000001) == 0x00000001) znaFired=kTRUE;
+     if((esdFlag & 0x00000002) == 0x00000002) zpaFired=kTRUE;
+     if((esdFlag & 0x00000004) == 0x00000004) zem1Fired=kTRUE;
+     if((esdFlag & 0x00000008) == 0x00000008) zem2Fired=kTRUE;
+     if((esdFlag & 0x00000010) == 0x00000010) zncFired=kTRUE;
+     if((esdFlag & 0x00000020) == 0x00000020) zpcFired=kTRUE;
+     zdcAccept = (znaFired | zncFired);
+  }
+  else {
+    const Float_t refSum = -568.5;
+    const Float_t refDelta = -2.1;
+    const Float_t sigmaSum = 3.25;
+    const Float_t sigmaDelta = 2.25;
+    for(Int_t i = 0; i < 4; ++i) {
+      if (esdZDC->GetZDCTDCData(10,i) != 0) {
+       Float_t tdcC = 0.025*(esdZDC->GetZDCTDCData(10,i)-esdZDC->GetZDCTDCData(14,i)); 
+       for(Int_t j = 0; j < 4; ++j) {
+         if (esdZDC->GetZDCTDCData(12,j) != 0) {
+           Float_t tdcA = 0.025*(esdZDC->GetZDCTDCData(12,j)-esdZDC->GetZDCTDCData(14,j));
+           if(fillHists) fHistTimeZDC->Fill(tdcC-tdcA,tdcC+tdcA);
+           if (((tdcC-tdcA-refDelta)*(tdcC-tdcA-refDelta)/(sigmaDelta*sigmaDelta) +
+                (tdcC+tdcA-refSum)*(tdcC+tdcA-refSum)/(sigmaSum*sigmaSum))< 1.0)
+             zdcAccept = kTRUE;
+         }
        }
       }
     }
   }
-
   return zdcAccept;
 }