added correct trigger selection for EMCAL triggers in MC
authorfbock <friederike.bock@cern.ch>
Wed, 1 Oct 2014 13:47:10 +0000 (15:47 +0200)
committerfbock <friederike.bock@cern.ch>
Wed, 1 Oct 2014 13:47:10 +0000 (15:47 +0200)
PWGGA/GammaConv/AliConvEventCuts.cxx
PWGGA/GammaConv/AliConvEventCuts.h
PWGGA/GammaConv/macros/AddTask_GammaConvV1_pp.C

index 49c92df..33079d0 100644 (file)
@@ -68,63 +68,71 @@ const char* AliConvEventCuts::fgkCutNames[AliConvEventCuts::kNCuts] = {
 
 //________________________________________________________________________
 AliConvEventCuts::AliConvEventCuts(const char *name,const char *title) :
-   AliAnalysisCuts(name,title),
-   fHistograms(NULL),
-   fHeaderList(NULL),
-   fEventQuality(-1),
-   fIsHeavyIon(0),
-   fDetectorCentrality(0),
-   fModCentralityClass(0),
-   fMaxVertexZ(10),
-   fCentralityMin(0),
-   fCentralityMax(0),
-   fMultiplicityMethod(0),
-   fSpecialTrigger(0),
-   fSpecialSubTrigger(0),
-   fRemovePileUp(kFALSE),
-   fRejectExtraSignals(0),
-   fOfflineTriggerMask(0),
-   fHasV0AND(kTRUE),
-   fIsSDDFired(kTRUE),
-   fRandom(0),
-   fnHeaders(0),
-   fNotRejectedStart(NULL),
-   fNotRejectedEnd(NULL),
-   fGeneratorNames(NULL),
-   fCutString(NULL),
-   fUtils(NULL),
-   fEtaShift(0.0),
-   fDoEtaShift(kFALSE),
-   fDoReweightHistoMCPi0(kFALSE),
-   fDoReweightHistoMCEta(kFALSE),
-   fDoReweightHistoMCK0s(kFALSE),
-   fPathTrFReweighting(""),
-   fNameHistoReweightingPi0(""),
-   fNameHistoReweightingEta(""),
-   fNameHistoReweightingK0s(""),
-   fNameFitDataPi0(""),
-   fNameFitDataEta(""),
-   fNameFitDataK0s(""),
-   fHistoEventCuts(NULL),
-   hCentrality(NULL),
-   hCentralityVsNumberOfPrimaryTracks(NULL),
-   hVertexZ(NULL),
-   hTriggerClass(NULL),
-   hTriggerClassSelected(NULL),
-   hReweightMCHistPi0(NULL),
-   hReweightMCHistEta(NULL),
-   hReweightMCHistK0s(NULL),
-   fFitDataPi0(NULL),
-   fFitDataEta(NULL),
-   fFitDataK0s(NULL),
-   fAddedSignalPDGCode(0),
-   fPreSelCut(kFALSE),
-   fTriggerSelectedManually(kFALSE),
-   fSpecialTriggerName(""),
-   fSpecialSubTriggerName(""),
-   fNSpecialSubTriggerOptions(0),
-   fV0ReaderName("")
-
+       AliAnalysisCuts(name,title),
+       fHistograms(NULL),
+       fHeaderList(NULL),
+       fEventQuality(-1),
+       fIsHeavyIon(0),
+       fDetectorCentrality(0),
+       fModCentralityClass(0),
+       fMaxVertexZ(10),
+       fCentralityMin(0),
+       fCentralityMax(0),
+       fMultiplicityMethod(0),
+       fSpecialTrigger(0),
+       fSpecialSubTrigger(0),
+       fRemovePileUp(kFALSE),
+       fRejectExtraSignals(0),
+       fOfflineTriggerMask(0),
+       fHasV0AND(kTRUE),
+       fIsSDDFired(kTRUE),
+       fRandom(0),
+       fnHeaders(0),
+       fNotRejectedStart(NULL),
+       fNotRejectedEnd(NULL),
+       fGeneratorNames(NULL),
+       fCutString(NULL),
+       fUtils(NULL),
+       fEtaShift(0.0),
+       fDoEtaShift(kFALSE),
+       fDoReweightHistoMCPi0(kFALSE),
+       fDoReweightHistoMCEta(kFALSE),
+       fDoReweightHistoMCK0s(kFALSE),
+       fPathTrFReweighting(""),
+       fNameHistoReweightingPi0(""),
+       fNameHistoReweightingEta(""),
+       fNameHistoReweightingK0s(""),
+       fNameFitDataPi0(""),
+       fNameFitDataEta(""),
+       fNameFitDataK0s(""),
+       fHistoEventCuts(NULL),
+       hCentrality(NULL),
+       hCentralityVsNumberOfPrimaryTracks(NULL),
+       hVertexZ(NULL),
+       hTriggerClass(NULL),
+       hTriggerClassSelected(NULL),
+       hReweightMCHistPi0(NULL),
+       hReweightMCHistEta(NULL),
+       hReweightMCHistK0s(NULL),
+       fFitDataPi0(NULL),
+       fFitDataEta(NULL),
+       fFitDataK0s(NULL),
+       fAddedSignalPDGCode(0),
+       fPreSelCut(kFALSE),
+       fTriggerSelectedManually(kFALSE),
+       fSpecialTriggerName(""),
+       fSpecialSubTriggerName(""),
+       fNSpecialSubTriggerOptions(0),
+       fV0ReaderName(""),
+       fCaloTriggers(NULL),
+       fTriggerPatchInfo(NULL),
+       fMainTriggerPatchEMCAL(NULL),
+       fCaloTriggersName(""),
+       fCaloTriggerPatchInfoName(""),
+       fTriggersEMCAL(0),
+       fTriggersEMCALSelected(-1),
+       fEMCALTrigInitialized(kFALSE)
+       
 {
    for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
    fCutString=new TObjString((GetCutNumber()).Data());
@@ -138,62 +146,70 @@ AliConvEventCuts::AliConvEventCuts(const char *name,const char *title) :
 
 //________________________________________________________________________
 AliConvEventCuts::AliConvEventCuts(const AliConvEventCuts &ref) :
-   AliAnalysisCuts(ref),
-   fHistograms(NULL),
-   fHeaderList(ref.fHeaderList),
-   fEventQuality(ref.fEventQuality),
-   fIsHeavyIon(ref.fIsHeavyIon),
-   fDetectorCentrality(ref.fDetectorCentrality),
-   fModCentralityClass(ref.fModCentralityClass),
-   fMaxVertexZ(ref.fMaxVertexZ),
-   fCentralityMin(ref.fCentralityMin),
-   fCentralityMax(ref.fCentralityMax),
-   fMultiplicityMethod(ref.fMultiplicityMethod),
-   fSpecialTrigger(ref.fSpecialTrigger),
-   fSpecialSubTrigger(ref.fSpecialSubTrigger),
-   fRemovePileUp(ref.fRemovePileUp),
-   fRejectExtraSignals(ref.fRejectExtraSignals),
-   fOfflineTriggerMask(ref.fOfflineTriggerMask),
-   fHasV0AND(ref.fHasV0AND),
-   fIsSDDFired(ref.fIsSDDFired),
-   fRandom(ref.fRandom),
-   fnHeaders(ref.fnHeaders),
-   fNotRejectedStart(NULL),
-   fNotRejectedEnd(NULL),
-   fGeneratorNames(ref.fGeneratorNames),
-   fCutString(NULL),
-   fUtils(NULL),
-   fEtaShift(ref.fEtaShift),
-   fDoEtaShift(ref.fDoEtaShift),
-   fDoReweightHistoMCPi0(ref.fDoReweightHistoMCPi0),
-   fDoReweightHistoMCEta(ref.fDoReweightHistoMCEta),
-   fDoReweightHistoMCK0s(ref.fDoReweightHistoMCK0s),
-   fPathTrFReweighting(ref.fPathTrFReweighting),
-   fNameHistoReweightingPi0(ref.fNameHistoReweightingPi0),
-   fNameHistoReweightingEta(ref.fNameHistoReweightingEta),
-   fNameHistoReweightingK0s(ref.fNameHistoReweightingK0s),
-   fNameFitDataPi0(ref.fNameFitDataPi0),
-   fNameFitDataEta(ref.fNameFitDataEta),
-   fNameFitDataK0s(ref.fNameFitDataK0s),
-   fHistoEventCuts(NULL),
-   hCentrality(NULL),
-   hCentralityVsNumberOfPrimaryTracks(NULL),
-   hVertexZ(NULL),
-   hTriggerClass(NULL),
-   hTriggerClassSelected(NULL),
-   hReweightMCHistPi0(ref.hReweightMCHistPi0),
-   hReweightMCHistEta(ref.hReweightMCHistEta),
-   hReweightMCHistK0s(ref.hReweightMCHistK0s),
-   fFitDataPi0(ref.fFitDataPi0),
-   fFitDataEta(ref.fFitDataEta),
-   fFitDataK0s(ref.fFitDataK0s),
-   fAddedSignalPDGCode(ref.fAddedSignalPDGCode),
-   fPreSelCut(ref.fPreSelCut),
-   fTriggerSelectedManually(ref.fTriggerSelectedManually),
-   fSpecialTriggerName(ref.fSpecialTriggerName),
-   fSpecialSubTriggerName(ref.fSpecialSubTriggerName),
-   fNSpecialSubTriggerOptions(ref.fNSpecialSubTriggerOptions),
-   fV0ReaderName(ref.fV0ReaderName)
+       AliAnalysisCuts(ref),
+       fHistograms(NULL),
+       fHeaderList(ref.fHeaderList),
+       fEventQuality(ref.fEventQuality),
+       fIsHeavyIon(ref.fIsHeavyIon),
+       fDetectorCentrality(ref.fDetectorCentrality),
+       fModCentralityClass(ref.fModCentralityClass),
+       fMaxVertexZ(ref.fMaxVertexZ),
+       fCentralityMin(ref.fCentralityMin),
+       fCentralityMax(ref.fCentralityMax),
+       fMultiplicityMethod(ref.fMultiplicityMethod),
+       fSpecialTrigger(ref.fSpecialTrigger),
+       fSpecialSubTrigger(ref.fSpecialSubTrigger),
+       fRemovePileUp(ref.fRemovePileUp),
+       fRejectExtraSignals(ref.fRejectExtraSignals),
+       fOfflineTriggerMask(ref.fOfflineTriggerMask),
+       fHasV0AND(ref.fHasV0AND),
+       fIsSDDFired(ref.fIsSDDFired),
+       fRandom(ref.fRandom),
+       fnHeaders(ref.fnHeaders),
+       fNotRejectedStart(NULL),
+       fNotRejectedEnd(NULL),
+       fGeneratorNames(ref.fGeneratorNames),
+       fCutString(NULL),
+       fUtils(NULL),
+       fEtaShift(ref.fEtaShift),
+       fDoEtaShift(ref.fDoEtaShift),
+       fDoReweightHistoMCPi0(ref.fDoReweightHistoMCPi0),
+       fDoReweightHistoMCEta(ref.fDoReweightHistoMCEta),
+       fDoReweightHistoMCK0s(ref.fDoReweightHistoMCK0s),
+       fPathTrFReweighting(ref.fPathTrFReweighting),
+       fNameHistoReweightingPi0(ref.fNameHistoReweightingPi0),
+       fNameHistoReweightingEta(ref.fNameHistoReweightingEta),
+       fNameHistoReweightingK0s(ref.fNameHistoReweightingK0s),
+       fNameFitDataPi0(ref.fNameFitDataPi0),
+       fNameFitDataEta(ref.fNameFitDataEta),
+       fNameFitDataK0s(ref.fNameFitDataK0s),
+       fHistoEventCuts(NULL),
+       hCentrality(NULL),
+       hCentralityVsNumberOfPrimaryTracks(NULL),
+       hVertexZ(NULL),
+       hTriggerClass(NULL),
+       hTriggerClassSelected(NULL),
+       hReweightMCHistPi0(ref.hReweightMCHistPi0),
+       hReweightMCHistEta(ref.hReweightMCHistEta),
+       hReweightMCHistK0s(ref.hReweightMCHistK0s),
+       fFitDataPi0(ref.fFitDataPi0),
+       fFitDataEta(ref.fFitDataEta),
+       fFitDataK0s(ref.fFitDataK0s),
+       fAddedSignalPDGCode(ref.fAddedSignalPDGCode),
+       fPreSelCut(ref.fPreSelCut),
+       fTriggerSelectedManually(ref.fTriggerSelectedManually),
+       fSpecialTriggerName(ref.fSpecialTriggerName),
+       fSpecialSubTriggerName(ref.fSpecialSubTriggerName),
+       fNSpecialSubTriggerOptions(ref.fNSpecialSubTriggerOptions),
+       fV0ReaderName(ref.fV0ReaderName),
+       fCaloTriggers(NULL),
+       fTriggerPatchInfo(NULL),
+       fMainTriggerPatchEMCAL(NULL),
+       fCaloTriggersName(ref.fCaloTriggersName),
+       fCaloTriggerPatchInfoName(ref.fCaloTriggerPatchInfoName),
+       fTriggersEMCAL(ref.fTriggersEMCAL),
+       fTriggersEMCALSelected(ref.fTriggersEMCALSelected),
+       fEMCALTrigInitialized(kFALSE)
 {
    // Copy Constructor
    for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=ref.fCuts[jj];}
@@ -373,6 +389,7 @@ Bool_t AliConvEventCuts::EventIsSelected(AliVEvent *fInputEvent, AliVEvent *fMCE
    cutindex++;
 
    // Check for MC event
+   Bool_t isMC = kFALSE;
    if(fMCEvent && fInputEvent->IsA()==AliESDEvent::Class()){
       // Check if MC event is correctly loaded
       AliMCEventHandler* mcHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
@@ -392,11 +409,14 @@ Bool_t AliConvEventCuts::EventIsSelected(AliVEvent *fInputEvent, AliVEvent *fMCE
          fEventQuality = 2;
          return kFALSE;
       }
+      isMC = kTRUE;
    }
 
+   
+   
    // Event Trigger
 //    cout << "before event trigger" << endl;
-   if(!IsTriggerSelected(fInputEvent)){
+   if(!IsTriggerSelected(fInputEvent, isMC )){
       if(fHistoEventCuts)fHistoEventCuts->Fill(cutindex);
       fEventQuality = 3;
       return kFALSE;
@@ -812,6 +832,8 @@ Bool_t AliConvEventCuts::SetSelectSpecialTrigger(Int_t selectSpecialTrigger)
                fSpecialTrigger=5; // trigger alias kEMC
                fOfflineTriggerMask=AliVEvent::kEMC7 | AliVEvent::kEMC8 | AliVEvent::kEMC1 ;
                fTriggerSelectedManually = kTRUE;
+               fTriggersEMCALSelected= 0;
+               SETBIT(fTriggersEMCALSelected, kL0);
                fSpecialTriggerName="AliVEvent::kEMC7/kEMC8/kEMC1";
                break;
        case 6:
@@ -830,12 +852,16 @@ Bool_t AliConvEventCuts::SetSelectSpecialTrigger(Int_t selectSpecialTrigger)
                fSpecialTrigger=8; // trigger alias kEMCEGA
                fOfflineTriggerMask=AliVEvent::kEMCEGA;
                fTriggerSelectedManually = kTRUE;
+               fTriggersEMCALSelected= 0;
+               SETBIT(fTriggersEMCALSelected, kG2);
                fSpecialTriggerName="AliVEvent::kEMCEGA";
                break;
                case 9:
                fSpecialTrigger=9; // trigger alias kEMCEJE
                fOfflineTriggerMask=AliVEvent::kEMCEJE;
                fTriggerSelectedManually = kTRUE;
+               fTriggersEMCALSelected= 0;
+               SETBIT(fTriggersEMCALSelected, kJ2);
                fSpecialTriggerName="AliVEvent::kEMCEJE";
                break;
        default:
@@ -1020,31 +1046,43 @@ Bool_t AliConvEventCuts::SetSelectSubTriggerClass(Int_t selectSpecialSubTriggerC
                        fSpecialSubTrigger=1; 
                        fNSpecialSubTriggerOptions=1;
                        fSpecialSubTriggerName="7EGA";
+                       fTriggersEMCALSelected= 0;
+                       SETBIT(fTriggersEMCALSelected, kG2);
                        break;
                case 2: // 8EGA - CINT8 EGA
                        fSpecialSubTrigger=1; 
                        fNSpecialSubTriggerOptions=1;
                        fSpecialSubTriggerName="8EGA";
+                       fTriggersEMCALSelected= 0;
+                       SETBIT(fTriggersEMCALSelected, kG2);
                        break;
                case 3: // 7EG1 - CINT7 EG1
                        fSpecialSubTrigger=1; 
                        fNSpecialSubTriggerOptions=1;
                        fSpecialSubTriggerName="7EG1";
+                       fTriggersEMCALSelected= 0;
+                       SETBIT(fTriggersEMCALSelected, kG1);
                        break;
                case 4: // 8EG1 - CINT8 EG1
                        fSpecialSubTrigger=1; 
                        fNSpecialSubTriggerOptions=1;
                        fSpecialSubTriggerName="8EG1";
+                       fTriggersEMCALSelected= 0;
+                       SETBIT(fTriggersEMCALSelected, kG1);
                        break;
                case 5: // 7EG2 - CINT7 EG2
                        fSpecialSubTrigger=1; 
                        fNSpecialSubTriggerOptions=1;
                        fSpecialSubTriggerName="7EG2";
+                       fTriggersEMCALSelected= 0;
+                       SETBIT(fTriggersEMCALSelected, kG2);
                        break;
                case 6: // 8EG2 - CINT8 EG2
                        fSpecialSubTrigger=1; 
                        fNSpecialSubTriggerOptions=1;
                        fSpecialSubTriggerName="8EG2";
+                       fTriggersEMCALSelected= 0;
+                       SETBIT(fTriggersEMCALSelected, kG2);
                        break;
                default:
                        AliError("Warning: Special Subtrigger Class Not known");
@@ -1061,31 +1099,43 @@ Bool_t AliConvEventCuts::SetSelectSubTriggerClass(Int_t selectSpecialSubTriggerC
                        fSpecialSubTrigger=1; 
                        fNSpecialSubTriggerOptions=1;
                        fSpecialSubTriggerName="7EJE";
+                       fTriggersEMCALSelected= 0;
+                       SETBIT(fTriggersEMCALSelected, kJ2);
                        break;
                case 2: // 8EJE - CINT8 EJE
                        fSpecialSubTrigger=1; 
                        fNSpecialSubTriggerOptions=1;
                        fSpecialSubTriggerName="8EJE";
+                       fTriggersEMCALSelected= 0;
+                       SETBIT(fTriggersEMCALSelected, kJ2);
                        break;
                case 3: // 7EJ1 - CINT7 EJ1
                        fSpecialSubTrigger=1; 
                        fNSpecialSubTriggerOptions=1;
                        fSpecialSubTriggerName="7EJ1";
+                       fTriggersEMCALSelected= 0;
+                       SETBIT(fTriggersEMCALSelected, kJ1);
                        break;
                case 4: // 8EJ1 - CINT8 EJ1
                        fSpecialSubTrigger=1; 
                        fNSpecialSubTriggerOptions=1;
                        fSpecialSubTriggerName="8EJ1";
+                       fTriggersEMCALSelected= 0;
+                       SETBIT(fTriggersEMCALSelected, kJ1);
                        break;
                case 5: // 7EJ2 - CINT7 EJ2
                        fSpecialSubTrigger=1; 
                        fNSpecialSubTriggerOptions=1;
                        fSpecialSubTriggerName="7EJ2";
+                       fTriggersEMCALSelected= 0;
+                       SETBIT(fTriggersEMCALSelected, kJ2);
                        break;
                case 6: // 8EJ2 - CINT8 EJ2
                        fSpecialSubTrigger=1; 
                        fNSpecialSubTriggerOptions=1;
                        fSpecialSubTriggerName="8EJ2";
+                       fTriggersEMCALSelected= 0;
+                       SETBIT(fTriggersEMCALSelected, kJ2);
                        break;
                default:
                        AliError("Warning: Special Subtrigger Class Not known");
@@ -1371,7 +1421,7 @@ Int_t AliConvEventCuts::GetNumberOfContributorsVtx(AliVEvent *event){
 
 
 ///________________________________________________________________________
-Bool_t AliConvEventCuts::IsTriggerSelected(AliVEvent *fInputEvent)
+Bool_t AliConvEventCuts::IsTriggerSelected(AliVEvent *fInputEvent, Bool_t isMC)
 {
 
        AliInputEventHandler *fInputHandler=(AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
@@ -1403,10 +1453,25 @@ Bool_t AliConvEventCuts::IsTriggerSelected(AliVEvent *fInputEvent)
 
                if (fOfflineTriggerMask){
                        isSelected = fOfflineTriggerMask & fInputHandler->IsEventSelected();             
+                       
                        if (isSelected && !fPreSelCut){
-                               if (fSpecialSubTrigger>0){
+//                             cout << "Special trigger: "<< fSpecialTrigger << " initialized " << fEMCALTrigInitialized << endl;
+                               if (fSpecialTrigger == 5 || fSpecialTrigger == 8 || fSpecialTrigger == 9){ // EMCAL triggers
+                                       if (!fEMCALTrigInitialized ) InitializeEMCALTrigger(fInputEvent);
+                                       fTriggersEMCAL= GetTriggerList();       
+                               }
+                               if (fSpecialSubTrigger>0 && !isMC){
                                        if (!firedTrigClass.Contains(fSpecialSubTriggerName.Data())) isSelected = 0;
-                               }        
+                               } else if (fSpecialSubTrigger>0 && isMC){
+                                       if (fSpecialTrigger == 5 || fSpecialTrigger == 8 || fSpecialTrigger == 9){ // EMCAL triggers
+                                               isSelected = 0;
+//                                             cout << "triggers: " << fTriggersEMCAL << "    selected triggers: " << fTriggersEMCALSelected << endl;
+                                               if (fTriggersEMCAL&fTriggersEMCALSelected){
+//                                                     cout << "accepted ++++++++++++++++++++" << endl;
+                                                       isSelected = 1;
+                                               }       
+                                       }       
+                               }       
                        }                               
                }        
        }
@@ -1792,7 +1857,10 @@ Int_t AliConvEventCuts::IsParticleFromBGEvent(Int_t index, AliStack *MCStack, Al
 //_________________________________________________________________________
 Int_t AliConvEventCuts::IsEventAcceptedByCut(AliConvEventCuts *ReaderCuts, AliVEvent *InputEvent, AliMCEvent *MCEvent, Int_t isHeavyIon){
 
-       if ( !IsTriggerSelected(InputEvent) )
+       Bool_t isMC = kFALSE;
+       if (MCEvent){isMC = kTRUE;}
+       
+       if ( !IsTriggerSelected(InputEvent, isMC) )
                return 3;
 
        if(isHeavyIon != 0 && !(IsCentralitySelected(InputEvent,MCEvent)))
@@ -2048,3 +2116,164 @@ void AliConvEventCuts::GetCorrectEtaShiftFromPeriod(TString periodName){
    else printf(" Gamma Conversion Cuts %s :: Automatic Eta Shift requested but Period is not known -> No Shift \n\n",(GetCutNumber()).Data());
 }
 
+//________________________________________________________________________
+AliEmcalTriggerPatchInfo* AliConvEventCuts::GetMainTriggerPatch() 
+{
+  //get main trigger match; if not known yet, look for it and cache
+
+  if (fMainTriggerPatchEMCAL) 
+    return fMainTriggerPatchEMCAL;
+
+  if (!fTriggerPatchInfo) {
+    AliError(Form("%s: fTriggerPatchInfo not available",GetName()));
+    return 0;
+  }
+
+  //number of patches in event
+  Int_t nPatch = fTriggerPatchInfo->GetEntries();
+
+  //extract main trigger patch
+  AliEmcalTriggerPatchInfo *patch;
+  for (Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
+    patch = (AliEmcalTriggerPatchInfo*)fTriggerPatchInfo->At( iPatch );
+    if (patch->IsMainTrigger()) {
+      fMainTriggerPatchEMCAL = patch;
+      break;
+    }
+  }
+
+  return fMainTriggerPatchEMCAL;
+}
+
+
+//________________________________________________________________________
+void AliConvEventCuts::InitializeEMCALTrigger(AliVEvent *fInputEvent)
+{
+//     cout << "entered EMCAL trigger initialization" << endl;
+       
+       // Init the analysis.
+       if (fCaloTriggersName.IsNull()){
+               if (fInputEvent->IsA()==AliESDEvent::Class()){
+                       fCaloTriggersName = "EMCALTrigger";
+               } else {
+                       fCaloTriggersName = "emcalTrigger";
+               }       
+       }
+       
+       if (!fCaloTriggersName.IsNull() && !fCaloTriggers) {
+               fCaloTriggers =  dynamic_cast<AliVCaloTrigger*>(fInputEvent->FindListObject(fCaloTriggersName));
+               if (!fCaloTriggers) {
+                       AliError(Form("%s: Could not retrieve calo triggers %s!", GetName(), fCaloTriggersName.Data())); 
+               return;
+               }
+       }
+
+       if (fCaloTriggerPatchInfoName.IsNull()){
+               if (fInputEvent->IsA()==AliESDEvent::Class()){
+                       fCaloTriggerPatchInfoName = "EmcalTriggers";
+               } else {
+                       fCaloTriggerPatchInfoName = "EmcalTriggers";
+               }
+       }       
+       
+       if (!fCaloTriggerPatchInfoName.IsNull() && !fTriggerPatchInfo) {
+               fTriggerPatchInfo = GetArrayFromEvent(fInputEvent, fCaloTriggerPatchInfoName.Data(), "AliEmcalTriggerPatchInfo");
+               if (!fTriggerPatchInfo) {
+                       AliError(Form("%s: Could not retrieve calo trigger patch info %s!", GetName(), fCaloTriggerPatchInfoName.Data())); 
+               return;
+               }
+
+       }
+
+       fEMCALTrigInitialized = kTRUE;
+}
+
+//________________________________________________________________________
+ULong_t AliConvEventCuts::GetTriggerList(){
+       if (!fTriggerPatchInfo)
+       return 0;
+       //number of patches in event
+       Int_t nPatch = fTriggerPatchInfo->GetEntries();
+
+       //loop over patches to define trigger type of event
+       Int_t nG1 = 0;
+       Int_t nG2 = 0;
+       Int_t nJ1 = 0;
+       Int_t nJ2 = 0;
+       Int_t nL0 = 0;
+       AliEmcalTriggerPatchInfo *patch;
+       for (Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
+               patch = (AliEmcalTriggerPatchInfo*)fTriggerPatchInfo->At( iPatch );
+               if (patch->IsGammaHigh()) nG1++;
+               if (patch->IsGammaLow())  nG2++;
+               if (patch->IsJetHigh()) nJ1++;
+               if (patch->IsJetLow())  nJ2++;
+               if (patch->IsLevel0())  nL0++;
+       }
+
+//       AliDebug(2, "Patch summary: ");
+//       AliDebug(2, Form("Number of patches: %d", nPatch));
+//       AliDebug(2, Form("Level0: [%d]" ,nL0));
+//       AliDebug(2, Form("Jet:    low[%d], high[%d]" ,nJ2, nJ1));
+//       AliDebug(2, Form("Gamma:  low[%d], high[%d]" ,nG2, nG1));
+
+//     if (nPatch > 0){
+//             cout <<           Form("Number of patches: %d", nPatch) << endl;
+//             cout <<           Form("Level0: [%d]" ,nL0) << endl;
+//             cout <<           Form("Jet:    low[%d], high[%d]" ,nJ2, nJ1) << endl;
+//             cout <<           Form("Gamma:  low[%d], high[%d]" ,nG2, nG1) << endl;
+//     }
+         
+       ULong_t triggers(0);
+       if (nG1>0)
+       SETBIT(triggers, kG1);
+       if (nG2>0)
+       SETBIT(triggers, kG2);
+       if (nJ1>0)
+       SETBIT(triggers, kJ1);
+       if (nJ2>0)
+       SETBIT(triggers, kJ2);
+       if (nL0>0)
+       SETBIT(triggers, kL0);
+       return triggers;
+}
+
+//________________________________________________________________________
+Bool_t AliConvEventCuts::HasTriggerType(TriggerTypeEMCAL t){
+       // Check if event has a given trigger type
+       if(t == kND){
+               return fTriggersEMCAL == 0;
+       }
+       return TESTBIT(fTriggersEMCAL, int(t));
+}
+
+
+//________________________________________________________________________
+TClonesArray *AliConvEventCuts::GetArrayFromEvent(AliVEvent* fInputEvent, const char *name, const char *clname)
+{
+       // Get array from event.
+
+       TClonesArray *arr = 0;
+       TString sname(name);
+       if (!sname.IsNull()) {
+               arr = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(sname));
+               if (!arr) {
+               AliWarning(Form("%s: Could not retrieve array with name %s!", GetName(), name)); 
+               return 0;
+               }
+       } else {
+               return 0;
+       }
+
+       if (!clname)
+               return arr;
+
+       TString objname(arr->GetClass()->GetName());
+       TClass cls(objname);
+       if (!cls.InheritsFrom(clname)) {
+               AliWarning(Form("%s: Objects of type %s in %s are not inherited from %s!", 
+                                               GetName(), cls.GetName(), name, clname)); 
+               return 0;
+       }
+       return arr;
+}
index 96a5de2..17e395c 100644 (file)
@@ -16,6 +16,8 @@
 #include "AliAnalysisUtils.h"
 #include "AliAnalysisManager.h"
 #include "TRandom3.h"
+#include "AliVCaloTrigger.h"
+#include "AliEmcalTriggerPatchInfo.h"
 
 class AliESDEvent;
 class AliAODEvent;
@@ -44,30 +46,15 @@ class AliConvEventCuts : public AliAnalysisCuts {
                        kNCuts
                };
 
-               Bool_t SetCutIds(TString cutString); 
-               Int_t fCuts[kNCuts];
-               Bool_t SetCut(cutIds cutID, Int_t cut);
-               Bool_t UpdateCutString();
-               static const char * fgkCutNames[kNCuts];
-
-               Bool_t InitializeCutsFromCutString(const TString analysisCutSelection);
-               void SelectCollisionCandidates(UInt_t offlineTriggerMask = AliVEvent::kAny) {
-                       fOfflineTriggerMask = offlineTriggerMask;
-                       fTriggerSelectedManually = kTRUE;
-               }
-               void SelectSpecialTrigger(UInt_t offlineTriggerMask = AliVEvent::kAny, TString TriggerClassName = "AliVEvent::kAny" ) {
-                       fOfflineTriggerMask = offlineTriggerMask;
-                       fSpecialTriggerName = TriggerClassName;
-                       cout << fSpecialTriggerName.Data() << endl;
-                       
-               }   
-
-               void SetAcceptedHeader(TList *HeaderList){fHeaderList = HeaderList;}   
-               TString *GetFoundHeader(){return fGeneratorNames;}
+               enum TriggerTypeEMCAL {
+                       kND       = -1,  //not defined
+                       kJ1       = 1,
+                       kJ2       = 2,
+                       kG1               = 3,
+                       kG2       = 4,
+                       kL0               = 5,
+               };
 
-               Int_t GetEventQuality(){return fEventQuality;}
-               Bool_t GetIsFromPileup(){return fRemovePileUp;}
-               
                AliConvEventCuts(const char *name="EventCuts", const char * title="Event Cuts");
                AliConvEventCuts(const AliConvEventCuts&);
                AliConvEventCuts& operator=(const AliConvEventCuts&);
@@ -77,161 +64,201 @@ class AliConvEventCuts : public AliAnalysisCuts {
 //             static AliConvEventCuts * GetStandardCuts2010PbPb();
 //             static AliConvEventCuts * GetStandardCuts2010pp();
 
-               virtual Bool_t IsSelected(TObject* /*obj*/){return kTRUE;}
-               virtual Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
+               Int_t           fCuts[kNCuts];
+               Bool_t          UpdateCutString();
+               static const char * fgkCutNames[kNCuts];
 
-               TString GetCutNumber();
+               // Seters
+               Bool_t          SetCutIds (TString cutString); 
+               Bool_t          SetCut (cutIds cutID, Int_t cut);
+               Bool_t          SetIsHeavyIon (Int_t isHeavyIon);
+               Bool_t          SetCentralityMax (Int_t centralityBin);
+               Bool_t          SetCentralityMin (Int_t centralityBin);
+               Bool_t          SetRemovePileUp (Int_t removePileUp);  
+               Bool_t          SetMultiplicityMethod (Int_t multiplicityMethod);
+               Bool_t          SetSelectSpecialTrigger (Int_t selectSpecialTrigger);
+               Bool_t          SetSelectSubTriggerClass (Int_t selectSpecialSubTriggerClass);
+               Bool_t          SetRejectExtraSignalsCut (Int_t extraSignal);
+               void            SetV0ReaderName (TString name)                                          { fV0ReaderName = name                                                                  ; }
+               void            SetAddedSignalPDGCode (Int_t addedSignalPDGcode)        { fAddedSignalPDGCode = addedSignalPDGcode                              ; }
+               void            SetPreSelectionCutFlag (Bool_t preSelFlag)                      { fPreSelCut = preSelFlag                                                               ; }   
+               void            SetCaloTriggerPatchInfoName(const char *n)                      { fCaloTriggerPatchInfoName = n                                                 ; }
+               void            SetCaloTriggersName(const char *n)                                      { fCaloTriggersName  = n                                                                ; }
+               void            SetAcceptedHeader(TList *HeaderList)                            { fHeaderList = HeaderList                                                              ; }   
+               void            SetFillCutHistograms( TString name="",
+                                                                                 Bool_t preCut = kTRUE)                { if(!fHistograms){ InitCutHistograms(name,preCut);}    ; }
+               void            SetEtaShift(Double_t etaShift)                                          { fEtaShift = etaShift                                                                  ; } // Eta shift Setting
+               void            SetEtaShift(TString pPbOrPbp)                                           { Double_t etaShift = 0.0                                                               ;
+                                                                                                                                                 if(!pPbOrPbp.CompareTo("pPb"))      etaShift = -0.465 ;
+                                                                                                                                                 else if(!pPbOrPbp.CompareTo("Pbp")) etaShift =  0.465 ;
+                                                                                                                                                 fEtaShift = etaShift                                                                  ; }
+               void            SetUseReweightingWithHistogramFromFile( Bool_t pi0reweight=kTRUE, 
+                                                                                                                       Bool_t etareweight=kFALSE, 
+                                                                                                                       Bool_t k0sreweight=kFALSE, 
+                                                                                                                       TString path="$ALICE_ROOT/PWGGA/GammaConv/MCSpectraInput.root", 
+                                                                                                                       TString histoNamePi0 = "", 
+                                                                                                                       TString histoNameEta = "", 
+                                                                                                                       TString histoNameK0s = "",
+                                                                                                                       TString fitNamePi0 = "", 
+                                                                                                                       TString fitNameEta = "", 
+                                                                                                                       TString fitNameK0s ="" ) 
+                                                                                                                                               {
+                                                                                                                                                 AliInfo(Form("enabled reweighting for: pi0 : %i, eta: %i, K0s: %i",pi0reweight, etareweight, k0sreweight));
+                                                                                                                                                 fDoReweightHistoMCPi0 = pi0reweight                                   ; 
+                                                                                                                                                 fDoReweightHistoMCEta = etareweight                                   ; 
+                                                                                                                                                 fDoReweightHistoMCK0s = k0sreweight                                   ; 
+                                                                                                                                                 fPathTrFReweighting=path                                                              ;
+                                                                                                                                                 fNameHistoReweightingPi0 =histoNamePi0                                ;
+                                                                                                                                                 fNameHistoReweightingEta =histoNameEta                                ;
+                                                                                                                                                 fNameHistoReweightingK0s =histoNameK0s                                ; 
+                                                                                                                                                 fNameFitDataPi0 =fitNamePi0                                                   ;
+                                                                                                                                                 fNameFitDataEta =fitNameEta                                                   ;
+                                                                                                                                                 fNameFitDataK0s =fitNameK0s                                                   ; }
                
-               void GetCentralityRange(Double_t range[2]){range[0]=10*fCentralityMin;range[1]=10*fCentralityMax;};
+               // Geters
+               TString         GetCutNumber();
+               TString*        GetFoundHeader()                                                                        { return fGeneratorNames                                                                ; }
+               Int_t           GetEventQuality()                                                                       { return fEventQuality;                                                                 ; }
+               Bool_t          GetIsFromPileup()                                                                       { return fRemovePileUp;                                                                   }
+               void            GetCentralityRange(Double_t range[2])                           { range[0]=10*fCentralityMin                                                    ;
+                                                                                                                                                 range[1]=10*fCentralityMax                                                    ; }
+               TList*          GetCutHistograms()                                                                      { return fHistograms                                                                    ; }
+               Int_t           GetMultiplicityMethod()                                                         { return fMultiplicityMethod                                                    ; }
+               Int_t           GetSignalRejection()                                                            { return fRejectExtraSignals                                                    ; }
+               Int_t           GetNAcceptedHeaders()                                                           { return fnHeaders                                                                              ; }
+               TString *       GetAcceptedHeaderNames()                                                        { return fGeneratorNames                                                                ; }
+               Int_t *         GetAcceptedHeaderStart()                                                        { return fNotRejectedStart                                                              ; }
+               Int_t *         GetAcceptedHeaderEnd()                                                          { return fNotRejectedEnd                                                                ; }
+               TList*          GetAcceptedHeader()                                                                     { return fHeaderList                                                                    ; }
+               Int_t           GetNumberOfContributorsVtx(AliVEvent *event);
+               Double_t        GetEtaShift()                                                                           { return fEtaShift                                                                              ; }
+               Bool_t          GetDoEtaShift()                                                                         { return fDoEtaShift                                                                    ; }
+               TString         GetSpecialTriggerName()                                                         { return fSpecialTriggerName                                                    ; }
+               AliEmcalTriggerPatchInfo   *GetMainTriggerPatch();
+               ULong_t         GetTriggerList();
+               Float_t         GetWeightForMeson(TString period, Int_t index, AliStack *MCStack, AliVEvent *InputEvent = 0x0);
+               Double_t        GetCentrality(AliVEvent *event);
+               void            GetCorrectEtaShiftFromPeriod(TString periodName);
+               void            GetNotRejectedParticles(Int_t rejection, TList *HeaderList, AliVEvent *MCEvent); 
+               TClonesArray*   GetArrayFromEvent(AliVEvent* fInputEvent, const char *name, const char *clname=0);
                
-               // Cut Selection
-               Bool_t EventIsSelected(AliVEvent *fInputEvent, AliVEvent *fMCEvent);
-               Int_t IsEventAcceptedByCut(AliConvEventCuts *ReaderCuts, AliVEvent *InputEvent, AliMCEvent *MCEvent, Int_t isHeavyIon);
+               Bool_t          InitializeCutsFromCutString(const TString analysisCutSelection);
+               void            SelectCollisionCandidates(UInt_t offlineTriggerMask = AliVEvent::kAny) {
+                       fOfflineTriggerMask = offlineTriggerMask;
+                       fTriggerSelectedManually = kTRUE;
+               }
+               void            SelectSpecialTrigger(UInt_t offlineTriggerMask = AliVEvent::kAny, 
+                                                                                TString TriggerClassName = "AliVEvent::kAny" ) {
+                       fOfflineTriggerMask = offlineTriggerMask;
+                       fSpecialTriggerName = TriggerClassName;
+                       cout << fSpecialTriggerName.Data() << endl;
                        
-               void PrintCuts();
-               void PrintCutsWithValues();
+               }   
+
+               virtual         Bool_t IsSelected(TObject* /*obj*/){return kTRUE;}
+               virtual         Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
 
-               void InitCutHistograms(TString name="",Bool_t preCut = kTRUE);
-               void SetFillCutHistograms(TString name="",Bool_t preCut = kTRUE){if(!fHistograms){InitCutHistograms(name,preCut);};}
-               TList *GetCutHistograms(){return fHistograms;}
+               
+               // Cut Selection
+               Bool_t          EventIsSelected(AliVEvent *fInputEvent, AliVEvent *fMCEvent);
+               Int_t           IsEventAcceptedByCut(AliConvEventCuts *ReaderCuts, AliVEvent *InputEvent, AliMCEvent *MCEvent, Int_t isHeavyIon);
+                       
+               void            PrintCuts();
+               void            PrintCutsWithValues();
+               void            InitCutHistograms(TString name="",Bool_t preCut = kTRUE);
                
                ///Cut functions
-               Int_t IsParticleFromBGEvent(Int_t index, AliStack *MCStack, AliVEvent *InputEvent = 0x0);
-               void GetNotRejectedParticles(Int_t rejection, TList *HeaderList, AliVEvent *MCEvent);
-               void SetUseReweightingWithHistogramFromFile( Bool_t pi0reweight=kTRUE, Bool_t etareweight=kFALSE, Bool_t k0sreweight=kFALSE, TString path="$ALICE_ROOT/PWGGA/GammaConv/MCSpectraInput.root", 
-                                                                                                               TString histoNamePi0 = "", TString histoNameEta = "", TString histoNameK0s = "",
-                                                                                                               TString fitNamePi0 = "", TString fitNameEta = "", TString fitNameK0s ="" ) {
-                       AliInfo(Form("enabled reweighting for: pi0 : %i, eta: %i, K0s: %i",pi0reweight, etareweight, k0sreweight));
-                       fDoReweightHistoMCPi0 = pi0reweight; 
-                       fDoReweightHistoMCEta = etareweight; 
-                       fDoReweightHistoMCK0s = k0sreweight; 
-                       fPathTrFReweighting=path;
-                       fNameHistoReweightingPi0 =histoNamePi0;
-                       fNameHistoReweightingEta =histoNameEta;
-                       fNameHistoReweightingK0s =histoNameK0s; 
-                       fNameFitDataPi0 =fitNamePi0;
-                       fNameFitDataEta =fitNameEta;
-                       fNameFitDataK0s =fitNameK0s;      
-               } 
-               void LoadReweightingHistosMCFromFile ();
-               void SetAddedSignalPDGCode(Int_t addedSignalPDGcode) {fAddedSignalPDGCode = addedSignalPDGcode;}
+               Int_t           IsParticleFromBGEvent(Int_t index, AliStack *MCStack, AliVEvent *InputEvent = 0x0);
+               
+               void            LoadReweightingHistosMCFromFile ();
 
                // Event Cuts
-               Bool_t IsCentralitySelected(AliVEvent *fInputEvent, AliVEvent *fMCEvent = NULL);
-               Double_t GetCentrality(AliVEvent *event);
-               Int_t GetNumberOfContributorsVtx(AliVEvent *event);
-               Bool_t VertexZCut(AliVEvent *fInputEvent);
-               Bool_t IsTriggerSelected(AliVEvent *fInputEvent);
-               Bool_t HasV0AND(){return fHasV0AND;}
-               Bool_t IsSDDFired(){return fIsSDDFired;}
-               Int_t IsSpecialTrigger(){return fSpecialTrigger;}
-               TString GetSpecialTriggerName(){return fSpecialTriggerName;}
-
-               // Request Flags
-               Int_t IsHeavyIon(){return fIsHeavyIon;}
-               Float_t GetWeightForMeson(TString period, Int_t index, AliStack *MCStack, AliVEvent *InputEvent = 0x0);
-               void SetPreSelectionCutFlag(Bool_t preSelFlag){fPreSelCut = preSelFlag;}   
-
-               
-               Int_t GetMultiplicityMethod(){return fMultiplicityMethod;}
-               Int_t GetSignalRejection(){return fRejectExtraSignals;}
-               Int_t GetNAcceptedHeaders(){return fnHeaders; }
-               TString * GetAcceptedHeaderNames(){return fGeneratorNames;}
-               Int_t * GetAcceptedHeaderStart(){return fNotRejectedStart;}
-               Int_t * GetAcceptedHeaderEnd(){return fNotRejectedEnd;}
-               TList* GetAcceptedHeader(){return fHeaderList;}
+               Bool_t          IsCentralitySelected(AliVEvent *fInputEvent, AliVEvent *fMCEvent = NULL);
+               Bool_t          VertexZCut(AliVEvent *fInputEvent);
+               Bool_t          IsTriggerSelected(AliVEvent *fInputEvent, Bool_t isMC);
+               Bool_t          HasV0AND()                                                                                              { return fHasV0AND                                                                              ; }
+               Bool_t          IsSDDFired()                                                                                    { return fIsSDDFired                                                                    ; }
+               Int_t           IsSpecialTrigger()                                                                              { return fSpecialTrigger                                                                ; }
+               void            InitializeEMCALTrigger( AliVEvent *fInputEvent);
+               Bool_t          HasTriggerType(TriggerTypeEMCAL t);
                
-               
-               // Eta shift Setting
-               void SetEtaShift(Double_t etaShift) {
-                       fEtaShift = etaShift;
-               }
-               void SetEtaShift(TString pPbOrPbp) {
-                       Double_t etaShift = 0.0;
-                       if(!pPbOrPbp.CompareTo("pPb"))      etaShift = -0.465;
-                       else if(!pPbOrPbp.CompareTo("Pbp")) etaShift =  0.465;
-                       
-                       fEtaShift = etaShift;
-               }
-               Double_t GetEtaShift() {return fEtaShift;}
-               Bool_t GetDoEtaShift(){return fDoEtaShift;}
-               void DoEtaShift(Bool_t doEtaShift){fDoEtaShift = doEtaShift;}
-               void GetCorrectEtaShiftFromPeriod(TString periodName);
+               // Request Flags
+               Int_t           IsHeavyIon()                                                                                    { return fIsHeavyIon                                                                    ; }
+               void            DoEtaShift(Bool_t doEtaShift)                                                   { fDoEtaShift = doEtaShift                                                              ; }
        
-               Bool_t SetIsHeavyIon(Int_t isHeavyIon);
-               Bool_t SetCentralityMax(Int_t centralityBin);
-               Bool_t SetCentralityMin(Int_t centralityBin);
-               Bool_t SetRemovePileUp(Int_t removePileUp);  
-               Bool_t SetMultiplicityMethod(Int_t multiplicityMethod);
-               Bool_t SetSelectSpecialTrigger(Int_t selectSpecialTrigger);
-               Bool_t SetSelectSubTriggerClass (Int_t selectSpecialSubTriggerClass);
-               Bool_t SetRejectExtraSignalsCut(Int_t extraSignal);
-               void SetV0ReaderName(TString name) {fV0ReaderName = name;}
                
        protected:
-               TList                           *fHistograms;
-               TList                           *fHeaderList;
+               TList                                           *fHistograms;
+               TList                                           *fHeaderList;
 
-               Int_t                           fEventQuality;                                                  // EventQuality
+               Int_t                                           fEventQuality;                                                  // EventQuality
                //cuts
-               Int_t                           fIsHeavyIon;                                                    // flag for heavy ion
-               Int_t                           fDetectorCentrality;                                    // centrality detecotor V0M or CL1
-               Int_t                           fModCentralityClass;                                    // allows to select smaller centrality classes
-               Double_t                        fMaxVertexZ;                                                    // max z offset of vertex
-               Int_t                           fCentralityMin;                                                 // centrality selection lower bin value
-               Int_t                           fCentralityMax;                                                 // centrality selection upper bin value
-               Int_t                           fMultiplicityMethod;                                    // selected multiplicity method
-               Int_t                           fSpecialTrigger;                                                // flag
-               Int_t                           fSpecialSubTrigger;                                             // flag
-               Bool_t                          fRemovePileUp;                                                  // flag
-               Int_t                           fRejectExtraSignals;                                    //
-               UInt_t                          fOfflineTriggerMask;                                    // Task processes collision candidates only
-               Bool_t                          fHasV0AND;                                                              // V0AND Offline Trigger
-               Bool_t                          fIsSDDFired;                                                    // SDD FIRED to select with SDD events
-               TRandom3                        fRandom;                                                                //
-               Int_t                           fnHeaders;                                                              // Number of Headers
-               Int_t                           *fNotRejectedStart;                                     //[fnHeaders]
-               Int_t                           *fNotRejectedEnd;                                               //[fnHeaders]
-               TString                         *fGeneratorNames;                                               //[fnHeaders]
-               TObjString                      *fCutString;                                                    // cut number used for analysis
-               AliAnalysisUtils        *fUtils;
-               Double_t                        fEtaShift;
-               Bool_t                          fDoEtaShift;                                                    // Flag for Etashift
-               Bool_t                          fDoReweightHistoMCPi0;                                  // Flag for reweighting Pi0 input with histogram
-               Bool_t                          fDoReweightHistoMCEta;                                  // Flag for reweighting Eta input with histogram
-               Bool_t                          fDoReweightHistoMCK0s;                                  // Flag for reweighting K0s input with histogram
-               TString                         fPathTrFReweighting;                                    // Path for file used in reweighting
-               TString                         fNameHistoReweightingPi0;                               // Histogram name for reweighting Pi0
-               TString                         fNameHistoReweightingEta;                               // Histogram name for reweighting Eta
-               TString                         fNameHistoReweightingK0s;                               // Histogram name for reweighting K0s
-               TString                         fNameFitDataPi0;                                                // Fit name for fit to spectrum of pi0s in Data
-               TString                         fNameFitDataEta;                                                // Fit name for fit to spectrum of etas in Data
-               TString                         fNameFitDataK0s;                                                // Fit name for fit to spectrum of k0s in Data
+               Int_t                                           fIsHeavyIon;                                                    // flag for heavy ion
+               Int_t                                           fDetectorCentrality;                                    // centrality detecotor V0M or CL1
+               Int_t                                           fModCentralityClass;                                    // allows to select smaller centrality classes
+               Double_t                                        fMaxVertexZ;                                                    // max z offset of vertex
+               Int_t                                           fCentralityMin;                                                 // centrality selection lower bin value
+               Int_t                                           fCentralityMax;                                                 // centrality selection upper bin value
+               Int_t                                           fMultiplicityMethod;                                    // selected multiplicity method
+               Int_t                                           fSpecialTrigger;                                                // flag
+               Int_t                                           fSpecialSubTrigger;                                             // flag
+               Bool_t                                          fRemovePileUp;                                                  // flag
+               Int_t                                           fRejectExtraSignals;                                    //
+               UInt_t                                          fOfflineTriggerMask;                                    // Task processes collision candidates only
+               Bool_t                                          fHasV0AND;                                                              // V0AND Offline Trigger
+               Bool_t                                          fIsSDDFired;                                                    // SDD FIRED to select with SDD events
+               TRandom3                                        fRandom;                                                                //
+               Int_t                                           fnHeaders;                                                              // Number of Headers
+               Int_t                                           *fNotRejectedStart;                                     //[fnHeaders]
+               Int_t                                           *fNotRejectedEnd;                                               //[fnHeaders]
+               TString                                         *fGeneratorNames;                                               //[fnHeaders]
+               TObjString                                      *fCutString;                                                    // cut number used for analysis
+               AliAnalysisUtils                        *fUtils;
+               Double_t                                        fEtaShift;
+               Bool_t                                          fDoEtaShift;                                                    // Flag for Etashift
+               Bool_t                                          fDoReweightHistoMCPi0;                                  // Flag for reweighting Pi0 input with histogram
+               Bool_t                                          fDoReweightHistoMCEta;                                  // Flag for reweighting Eta input with histogram
+               Bool_t                                          fDoReweightHistoMCK0s;                                  // Flag for reweighting K0s input with histogram
+               TString                                         fPathTrFReweighting;                                    // Path for file used in reweighting
+               TString                                         fNameHistoReweightingPi0;                               // Histogram name for reweighting Pi0
+               TString                                         fNameHistoReweightingEta;                               // Histogram name for reweighting Eta
+               TString                                         fNameHistoReweightingK0s;                               // Histogram name for reweighting K0s
+               TString                                         fNameFitDataPi0;                                                // Fit name for fit to spectrum of pi0s in Data
+               TString                                         fNameFitDataEta;                                                // Fit name for fit to spectrum of etas in Data
+               TString                                         fNameFitDataK0s;                                                // Fit name for fit to spectrum of k0s in Data
                // Histograms
-               TH1F                            *fHistoEventCuts;                                               // bookkeeping for event selection cuts
-               TH1F                            *hCentrality;                                                   // centrality distribution for selected events
-               TH2F                            *hCentralityVsNumberOfPrimaryTracks;    // centrality distribution for selected events
-               TH1F                            *hVertexZ;                                                              // vertex z distribution for selected events
-               TH1F                            *hTriggerClass;                                                 // fired offline trigger class
-               TH1F                            *hTriggerClassSelected;                                 // selected fired offline trigger class
-               TH1D                            *hReweightMCHistPi0;                                    // histogram input for reweighting Pi0
-               TH1D                            *hReweightMCHistEta;                                    // histogram input for reweighting Eta
-               TH1D                            *hReweightMCHistK0s;                                    // histogram input for reweighting K0s
-               TF1                             *fFitDataPi0;                                                   // fit to pi0 spectrum in Data
-               TF1                             *fFitDataEta;                                                   // fit to eta spectrum in Data
-               TF1                             *fFitDataK0s;                                                   // fit to K0s spectrum in Data
-               Int_t                           fAddedSignalPDGCode;
-               Bool_t                          fPreSelCut;                                                     // Flag for preselection cut used in V0Reader
-               Bool_t                          fTriggerSelectedManually;                               // Flag for manual trigger selection
-               TString                         fSpecialTriggerName;                                    // Name of the Special Triggers
-               TString                         fSpecialSubTriggerName;                                 // Name of the Special Triggers
-               Int_t                           fNSpecialSubTriggerOptions;
-               TString                         fV0ReaderName;                                                  // Name of V0Reader
-               
+               TH1F                                            *fHistoEventCuts;                                               // bookkeeping for event selection cuts
+               TH1F                                            *hCentrality;                                                   // centrality distribution for selected events
+               TH2F                                            *hCentralityVsNumberOfPrimaryTracks;    // centrality distribution for selected events
+               TH1F                                            *hVertexZ;                                                              // vertex z distribution for selected events
+               TH1F                                            *hTriggerClass;                                                 // fired offline trigger class
+               TH1F                                            *hTriggerClassSelected;                                 // selected fired offline trigger class
+               TH1D                                            *hReweightMCHistPi0;                                    // histogram input for reweighting Pi0
+               TH1D                                            *hReweightMCHistEta;                                    // histogram input for reweighting Eta
+               TH1D                                            *hReweightMCHistK0s;                                    // histogram input for reweighting K0s
+               TF1                                             *fFitDataPi0;                                                   // fit to pi0 spectrum in Data
+               TF1                                             *fFitDataEta;                                                   // fit to eta spectrum in Data
+               TF1                                             *fFitDataK0s;                                                   // fit to K0s spectrum in Data
+               Int_t                                           fAddedSignalPDGCode;
+               Bool_t                                          fPreSelCut;                                                     // Flag for preselection cut used in V0Reader
+               Bool_t                                          fTriggerSelectedManually;                               // Flag for manual trigger selection
+               TString                                         fSpecialTriggerName;                                    // Name of the Special Triggers
+               TString                                         fSpecialSubTriggerName;                                 // Name of the Special Triggers
+               Int_t                                           fNSpecialSubTriggerOptions;
+               // trigger information
+               TString                                         fV0ReaderName;                                                  // Name of V0Reader
+               AliVCaloTrigger                         *fCaloTriggers;                                                 //! calo triggers
+               TClonesArray                            *fTriggerPatchInfo;                                             //! trigger patch info array
+               AliEmcalTriggerPatchInfo        *fMainTriggerPatchEMCAL;                                // main trigger patch, will be cached after first call
+               TString                                         fCaloTriggersName;                              // name of calo triggers collection
+               TString                                         fCaloTriggerPatchInfoName;                      // trigger patch info array name
+               ULong_t                                         fTriggersEMCAL;                                                 // list of fired EMCAL triggers
+               ULong_t                                         fTriggersEMCALSelected;                                 // list of accepted triggers
+               Bool_t                                          fEMCALTrigInitialized;                                  // EMCAL triggers initialized
                
        private:
 
-               ClassDef(AliConvEventCuts,2)
+               ClassDef(AliConvEventCuts,3)
 };
 
 
index a023724..652081a 100644 (file)
@@ -109,8 +109,6 @@ void AddTask_GammaConvV1_pp(  Int_t trainConfig = 1,                                                                                // change differ
        TString *eventCutArray = new TString[numberOfCuts];
        TString *photonCutArray = new TString[numberOfCuts];
        TString *mesonCutArray = new TString[numberOfCuts];
-
-       0000011_01631031009000
        
        if(trainConfig == 1){
                eventCutArray[ 0] = "0000011"; photonCutArray[ 0] = "002093663003800000000"; mesonCutArray[0] = "01631031009000"; //standard cut Pi0 pp 2.76TeV without SDD , only Minbias MC